diff --git a/build/with_fcm/make_fcm.sh b/build/with_fcm/make_fcm.sh index 85bdb7fb4377bd041fef7cb146c40146dc2de99b..5a8fb36f84c6fda8129566f8658f1706d1e57d32 100755 --- a/build/with_fcm/make_fcm.sh +++ b/build/with_fcm/make_fcm.sh @@ -205,7 +205,7 @@ LD_FLAGS="\$LD_FLAGS \$OMP_LD" LIBS="rt dl" -ENTRYPOINTS="rain_ice.o shallow_mf.o turb.o ice_adjust.o ini_neb.o" +ENTRYPOINTS="rain_ice.o shallow_mf.o turb.o ice_adjust.o" FCM_ARGS="$FCM_ARGS" diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e0c59ca63c8a28034f13ebc4a1f30f26dafd9754 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,3 @@ +# Ignore the content of doxygen directory but not the directory itself +doxygen/** +!doxygen/.gitkeep diff --git a/docs/CodingNorms.md b/docs/CodingNorms.md index 9af506695c1a70a7b980f89bde542be6f5b6fe34..d207d31616220abf15d5dfbb19a84c0aeb7f3218 100644 --- a/docs/CodingNorms.md +++ b/docs/CodingNorms.md @@ -93,3 +93,101 @@ Valid: computation of delta tempo_s budget_store_add(delta tempo_s) ``` + +## Comments +The code must contain comments to help futur developers. + +In addition, those comments can be used by external tools, so they must be formatted correctly. +At least two tools can be applied on the PHYEX source code. + +Firstly, doxygen is used to build html pages documenting the source code. Unfortunately doxygen has +limitations and only few comments can be reported on the html pages without rewritting the existing code +(doxygen waits for comment before the subroutine and not inside): + + - in a module file, the general documentation (just after the module statement) must begin by "!> @file" on the first line and following lines must begin with a double exclamation mark "!!"; + - dummy arguments must be declared each one on a separate line followed by a comment strarting with "!<". + +Secondly an home-made tool can extract comments on some variables to document the namelist keys. +This tool waits for comment formatted as described for doxygen (one dummy argument by line followed by "!<"). + +Here is an example with a complete template for a module containing a subroutine: +``` +!MNH_LIC Copyright 1995-2021 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 MODE_FOO +!> @file +!!These comments will be visible in doxygen and will be +!!associated to the file containing this module +! +IMPLICIT NONE +! +TYPE FOO_t + REAL :: X1 !< Documentation for X1, needed by doxygen and the tool used to ocument namelists +END TYPE FOO_t +! +CONTAINS +! +SUBROUTINE FOO(K) +!!*** *FOO* - short comment +!! +!!* PURPOSE +!! ------- +!! What the surbroutines does +!! +!!* METHOD +!! ------ +!! 0. Declarations +!! 1. Declaration of arguments +!! 2. Declaration of local variables +!! 1. Computation +!! +!!* EXTERNAL +!! -------- +!! subroutine XXX : to ... +!! subroutine YYY : to ... +!! module MODI_BAR : interface for the BAR subroutine +!! +!!* IMPLICIT ARGUMENTS +!! ------------------ +!! List of the different modules used +!! +!!* REFERENCE +!! --------- +!! Reference paper, book... +!! +!! AUTHOR +!! ------ +!! Name of the author +!! +!! MODIFICATIONS +!! ------------- +!! Original Month Year +!! Month Year (contributor): descrption of the contribution +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! --------------- +! +USE MODI_BAR +! +!* 0.1. Declaration of arguments +! ------------------------ +! +INTEGER, INTENT(IN) :: K !< Documentation for K +! +!* 0.2 Declaration of local variables +! ------------------------------ +! +INTEGER :: II +! +!* 1. COMPUTATION +! -------------- +! +II=K +END SUBROUTINE FOO +! +END MODULE MODE_FOO +``` diff --git a/docs/Developer.md b/docs/Developer.md index 89868756a0714d74a0f5ad72ed4fd6af3bc08c9a..e3bfe21695d4e1b72d5668482c9b87671eb31ab8 100644 --- a/docs/Developer.md +++ b/docs/Developer.md @@ -117,3 +117,8 @@ Pull requests concerning the physics continue to follow the same path as before ## Contribution workflow for other developers Other developers must work with source code coming directly from the master branch. They issue pull requests directly on this branch as usual with git repositories. + +## Code documentation + +The code must contain comments. +The documentation rules to folllow are described in the [CodingNorms](./CodingNorms.md) document. diff --git a/docs/TODO b/docs/TODO index a67078606bd493c183b3dd9c7c0767e620e1213f..b2737ea86c990db23fa7dcb1ec250ffe5f821f88 100644 --- a/docs/TODO +++ b/docs/TODO @@ -17,7 +17,7 @@ Intégration de PHYEX dans des cycles/versions officielles: - REPRO48 seule: la version de code qui sera retenue à la fin est celle de Méso-NH 5.5 - REPRO55 seule: la version de code qui sera retenue à la fin est celle du cycle 48 d'AROME - defined(REPRO48) || defined(REPRO55): la version de code qui sera retenue à la fin est nouvelle - - Ces clés devront être supprimées + - Ces clés devront être supprimées (attention particulière sur lsnow_t avec rain_ice_old, ini_snow et lima) - Répertoires ext - Répertoire arome/ext et mesonh/ext contiennent les codes non PHYEX qu'il faut modifier dans le pack pour qu'il puisse être compilé. - Ce répertoire devra être vidé à la fin du phasage, les modifications nécessaires devront avoir été fournies par ailleurs @@ -37,6 +37,7 @@ Merge pb: - KFB ? Pb identifiés à corriger plus tard: + - demander aux hirlamistes de supprimer ini_snow (en ajoutant une clé comme lsnow_t pour modifier les valeurs dans ini_rain_ice) - deposition devrait être déplacée dans ice4_tendencies - avec les optimisations de Ryad, les tableaux 3D de precip passés à ice4_tendencies lorsque HSUBG_RC_RR_ACCR=='PRFR' ne sont pas utilisables puisque les K1, K2 et K3 diff --git a/docs/doxygen/.gitkeep b/docs/doxygen/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/arome/aux/modd_misc.F90 b/src/arome/aux/modd_misc.F90 new file mode 100644 index 0000000000000000000000000000000000000000..c70ee9180e817374c4ec63486aa1a0f558543dea --- /dev/null +++ b/src/arome/aux/modd_misc.F90 @@ -0,0 +1,43 @@ +MODULE MODD_MISC +! +USE MODD_BUDGET, ONLY: TBUDGETCONF_t +IMPLICIT NONE +! +!> @file +!! MODD_MISC - definition of a structure containing all the control parameters for arome +!! +!! This is a structure specifically built for arome. +!! All the constants needed to call the parametrisations in arome which are not +!! contained in the different structures entering the parametrisation are put here. +!! These keys are mainly in modd_conf in mesonh. +TYPE MISC_t + !These values are not (yet) tuneable in arome. + LOGICAL :: LMFCONV=.TRUE. !< Use convective mass flux in the condensation scheme + LOGICAL :: OCOMPUTE_SRC=.TRUE. !< Compute s'r' + INTEGER :: KMI=1 !< Model numer + INTEGER :: KSPLIT=1 !< Number of small timestep for the turbulence scheme + CHARACTER(LEN=6) :: CPROGRAM='AROME' !< Name of the model + LOGICAL :: ONOMIXLG=.FALSE. !< Turbulence for lagrangian variables + LOGICAL :: OOCEAN=.FALSE. !< Ocean version of the turbulence scheme + LOGICAL :: ODEEPOC=.FALSE. !< Ocean version of the turbulence scheme + LOGICAL :: OCOUPLES=.FALSE. !< Ocean-atmo LES interactive coupling + LOGICAL :: OBLOWSNOW=.FALSE. !< Blowsnow + REAL :: XRSNOW=1. !< Blowing factor + CHARACTER(LEN=4), DIMENSION(2) :: HLBCX='CYCL' !< Boundary condition + CHARACTER(LEN=4), DIMENSION(2) :: HLBCY='CYCL' !< Boundary condition + LOGICAL :: OIBM=.FALSE. !< Run with IBM + LOGICAL :: OFLYER=.FALSE. !< MesoNH flyer diagnostic + REAL :: XCEI_MAX=1. !< Turbulence at cloud edges + REAL :: XCEI_MIN=0 !< Turbulence at cloud edges. + REAL :: XCOEF_AMPL_SAT=0 !< Turbulence at cloud edges. + LOGICAL :: ODIAG_IN_RUN=.FALSE. !< LES diagnostics + CHARACTER(LEN=4) :: HTURBLEN_CL='NONE' !< Turbulence length in clouds + LOGICAL :: O2D=.FALSE. !< 2D version of the turbulence + + !These values are computed from the model setup + LOGICAL :: OFLAT !< Flat configuration + + !Budget configuration + TYPE(TBUDGETCONF_t) :: TBUCONF !< Budget configuration +END TYPE MISC_t +END MODULE MODD_MISC diff --git a/src/arome/aux/mode_posnam_phy.F90 b/src/arome/aux/mode_posnam_phy.F90 new file mode 100644 index 0000000000000000000000000000000000000000..71b057cc52e32ad747cb223cfa5d35093991089b --- /dev/null +++ b/src/arome/aux/mode_posnam_phy.F90 @@ -0,0 +1,19 @@ +MODULE MODE_POSNAM_PHY +CONTAINS +SUBROUTINE POSNAM_PHY(KUNITNML, CDNAML, LDNEEDNAM, LDFOUND, KLUOUT) +!Wrapper to call the AROME version of posnam + +IMPLICIT NONE + +INTEGER, INTENT(IN) :: KUNITNML !< Logical unit to access the namelist +CHARACTER(LEN=*), INTENT(IN) :: CDNAML !< Namelist name +LOGICAL, INTENT(IN) :: LDNEEDNAM !< True to abort if namelist is absent +LOGICAL, INTENT(OUT) :: LDFOUND !< True if namelist has been found +INTEGER, INTENT(IN) :: KLUOUT !< Logical unit for output + +#include "posnam.intfb.h" +CALL POSNAM(KUNITNML, CDNAML) +LDFOUND=.TRUE. !Posnam aborts if not found + +END SUBROUTINE POSNAM_PHY +END MODULE MODE_POSNAM_PHY diff --git a/src/arome/ext/apl_arome.F90 b/src/arome/ext/apl_arome.F90 index 3fd80fa343f5effa0790dcf0d4a56aaab2006774..c77c3b9f04c651167511f9bc4dee344e5ae23c47 100644 --- a/src/arome/ext/apl_arome.F90 +++ b/src/arome/ext/apl_arome.F90 @@ -206,7 +206,7 @@ USE YOMHOOK , ONLY : LHOOK ,DR_HOOK USE YOESW , ONLY : RSUN2 USE YOMCST , ONLY : TCST USE YOMLUN , ONLY : NULOUT -USE YOMCT0 , ONLY : LTWOTL, LSFORCS, LSLAG, LNHDYN, LAROME +USE YOMCT0 , ONLY : LTWOTL, LSFORCS, LSLAG, LNHDYN, LAROME, LELAM USE YOMVERT , ONLY : VP00 USE YOMRIP0 , ONLY : NINDAT USE YOMNUDGLH , ONLY : LNUDGLH, NSTARTNUDGLH, NSTOPNUDGLH, NINTNUDGLH, NTAUNUDGLH, & @@ -837,12 +837,6 @@ REAL(KIND=JPRB) :: ZHOOK_HANDLE #include "acvisih.intfb.h" #include "aro_ground_diag_2isba.h" -#ifdef REPRO48 -!To compensate a bug introduced in 48t3 -!Must be suppressed as soon as the bug is corrected -#include "aroini_budget.h" -#endif - ! ------------------------------------------------------------------ #include "fcttrm.func.h" @@ -862,19 +856,16 @@ ASSOCIATE(YDDIM=>YDGEOMETRY%YRDIM, YDGEM=>YDGEOMETRY%YRGEM, YDSTA=>YDGEOMETRY%YR & ) ASSOCIATE(MINPRR=>YDPARAR%MINPRR, MINPRS=>YDPARAR%MINPRS, MVQS=>YDPARAR%MVQS, MINPRG=>YDPARAR%MINPRG, & -& LOTOWNC=>YDPARAR%LOTOWNC, LFPREC3D=>YDPARAR%LFPREC3D, NRRI=>YDPARAR%NRRI, NRRL=>YDPARAR%NRRL, CSUBG_AUCV_RC=>YDPARAR%CSUBG_AUCV_RC, & -& CSUBG_AUCV_RI=>YDPARAR%CSUBG_AUCV_RI, CCONDENS=>YDPARAR%CCONDENS, CSUBG_MF_PDF=>YDPARAR%CSUBG_MF_PDF, & -& LTOTPREC=>YDPARAR%LTOTPREC, NPRINTFR=>YDPARAR%NPRINTFR, CMF_CLOUD=>YDPARAR%CMF_CLOUD, MALBDIR=>YDPARAR%MALBDIR, & +& LOTOWNC=>YDPARAR%LOTOWNC, LFPREC3D=>YDPARAR%LFPREC3D, NRRI=>YDPARAR%NRRI, NRRL=>YDPARAR%NRRL, & +& LTOTPREC=>YDPARAR%LTOTPREC, NPRINTFR=>YDPARAR%NPRINTFR, MALBDIR=>YDPARAR%MALBDIR, & & NSWB_MNH=>YDPARAR%NSWB_MNH, XSW_BANDS=>YDPARAR%XSW_BANDS, MACPRG=>YDPARAR%MACPRG, MSWDIR=>YDPARAR%MSWDIR, & -& LMIXUV=>YDPARAR%LMIXUV, MSWDIF=>YDPARAR%MSWDIF, LOLSMC=>YDPARAR%LOLSMC, NDIAGWMAX=>YDPARAR%NDIAGWMAX, & -& MACPRS=>YDPARAR%MACPRS, MACPRR=>YDPARAR%MACPRR, LSQUALL=>YDPARAR%LSQUALL, VSIGQSAT=>YDPARAR%VSIGQSAT, & -& MALBSCA=>YDPARAR%MALBSCA, RADSN=>YDPARAR%RADSN, LOSEDIC=>YDPARAR%LOSEDIC, LDIAGWMAX=>YDPARAR%LDIAGWMAX, & -& CSEDIM=>YDPARAR%CSEDIM, CLAMBDA3=>YDPARAR%CLAMBDA3, & +& MSWDIF=>YDPARAR%MSWDIF, LOLSMC=>YDPARAR%LOLSMC, NDIAGWMAX=>YDPARAR%NDIAGWMAX, & +& MACPRS=>YDPARAR%MACPRS, MACPRR=>YDPARAR%MACPRR, LSQUALL=>YDPARAR%LSQUALL, & +& MALBSCA=>YDPARAR%MALBSCA, RADSN=>YDPARAR%RADSN, LDIAGWMAX=>YDPARAR%LDIAGWMAX, & & NPTP=>YDPARAR%NPTP, NSPLITR=>YDPARAR%NSPLITR, NSPLITG=>YDPARAR%NSPLITG, NSV=>YDPARAR%NSV, & -& CFRAC_ICE_SHALLOW_MF=>YDPARAR%CFRAC_ICE_SHALLOW_MF, CFRAC_ICE_ADJUST=>YDPARAR%CFRAC_ICE_ADJUST, MVTS=>YDPARAR%MVTS, & -& NREFROI2=>YDPARAR%NREFROI2, NREFROI1=>YDPARAR%NREFROI1, MVEMIS=>YDPARAR%MVEMIS, LOWARM=>YDPARAR%LOWARM, & -& LOCND2=>YDPARAR%LOCND2, LOSIGMAS=>YDPARAR%LOSIGMAS, NRR=>YDPARAR%NRR, LOSUBG_COND=>YDPARAR%LOSUBG_COND, & -& RADGR=>YDPARAR%RADGR, CMF_UPDRAFT=>YDPARAR%CMF_UPDRAFT, LHARATU=>YDPARAR%LHARATU, XMINLM=>YDPHY0%XMINLM, & +& NREFROI2=>YDPARAR%NREFROI2, NREFROI1=>YDPARAR%NREFROI1, MVEMIS=>YDPARAR%MVEMIS, & +& NRR=>YDPARAR%NRR, & +& RADGR=>YDPARAR%RADGR, XMINLM=>YDPHY0%XMINLM, & & XMAXLM=>YDPHY0%XMAXLM, AERCS1=>YDPHY0%AERCS1, AERCS3=>YDPHY0%AERCS3, AERCS5=>YDPHY0%AERCS5, RDECRD1=>YDPHY0%RDECRD1, & & RDECRD2=>YDPHY0%RDECRD2, RDECRD3=>YDPHY0%RDECRD3, RDECRD4=>YDPHY0%RDECRD4, LMPA=>YDARPHY%LMPA, LUSECHEM=>YDARPHY%LUSECHEM, & & LKFBCONV=>YDARPHY%LKFBCONV, LMFSHAL=>YDARPHY%LMFSHAL, LMICRO=>YDARPHY%LMICRO, CCOUPLING=>YDARPHY%CCOUPLING, & @@ -883,7 +874,8 @@ ASSOCIATE(MINPRR=>YDPARAR%MINPRR, MINPRS=>YDPARAR%MINPRS, MVQS=>YDPARAR%MVQS, MI & LRCO2=>YDARPHY%LRCO2, LMSE=>YDARPHY%LMSE, LSURFEX_KFROM=>YDARPHY%LSURFEX_KFROM, NSURFEXCTL=>YDMSE%NSURFEXCTL, & & XZSEPS=>YDMSE%XZSEPS, NDLUNG=>YDDIM%NDLUNG, NDGUNG=>YDDIM%NDGUNG, NPROMA=>YDDIM%NPROMA, NDLUXG=>YDDIM%NDLUXG, & & NDGUXG=>YDDIM%NDGUXG, NGFL_EXT=>YGFL%NGFL_EXT, YLRAD=>YGFL%YLRAD, YIRAD=>YGFL%YIRAD, NGFL_EZDIAG=>YGFL%NGFL_EZDIAG, & -& NLIMA=>YGFL%NLIMA, CMICRO=>YDPARAR%CMICRO, NPROMICRO=>YDPARAR%NPROMICRO, & +& NLIMA=>YGFL%NLIMA, CMICRO=>YDPARAR%CMICRO, & +& PHYEX=>YDPARAR%PHYEX, & & YSD_VAD=>YDSURF%YSD_VAD, QCO2=>YDPHY3%QCO2, NRAY=>YDPHY%NRAY, & & LRAYFM=>YDPHY%LRAYFM, LO3ABC=>YDPHY%LO3ABC, LRAY=>YDPHY%LRAY, LRSTAER=>YDPHY%LRSTAER, LRNUEXP=>YDPHY%LRNUEXP, & & AMAGSTOPH_CASBS=> YDSTOPH%AMAGSTOPH_CASBS, LFORCENL=>YDSTOPH%LFORCENL, NFORCESTART=>YDSTOPH%NFORCESTART, & @@ -895,8 +887,8 @@ ASSOCIATE(MINPRR=>YDPARAR%MINPRR, MINPRS=>YDPARAR%MINPRS, MVQS=>YDPARAR%MVQS, MI & LDPRECIPS=>YDPHY%LDPRECIPS, LDPRECIPS2=>YDPHY%LDPRECIPS2, NDTPREC=>YDPRECIPS%NDTPREC, NDTPREC2=>YDPRECIPS%NDTPREC2, & & NGPTOT=>YDGEM%NGPTOT, NGPBLKS=>YDDIM%NGPBLKS, NTSSG=>YDDPHY%NTSSG, YEZDIAG=>YGFL%YEZDIAG, YEXT=>YGFL%YEXT, & & YNOGW=>YGFL%YNOGW, YCHEM=>YGFL%YCHEM, YSP_SBD=>YDSURF%YSP_SBD, LEDR=>YDPHY%LEDR, LAGPHY=>YDEPHY%LAGPHY, & -& YLIMA=>YGFL%YLIMA, LSPSDT => YSPPT_CONFIG%LSPSDT, LKOGAN=>YDPARAR%LKOGAN, LHGT_QS=>YDPARAR%LHGT_QS, & -& LMODICEDEP=>YDPARAR%LMODICEDEP, LWINDFARM=>YDPHY%LWINDFARM, LSTATNW=>YDPARAR%LSTATNW, & +& YLIMA=>YGFL%YLIMA, LSPSDT => YSPPT_CONFIG%LSPSDT, LKOGAN=>YDPARAR%LKOGAN, & +& LMODICEDEP=>YDPARAR%LMODICEDEP, LWINDFARM=>YDPHY%LWINDFARM, & & RG=>YDCST%RG, RCPD=>YDCST%RCPD, RATM=>YDCST%RATM, RTT=>YDCST%RTT, RPI=>YDCST%RPI, & & RCW=>YDCST%RCW, RCPV=>YDCST%RCPV, RLVTT=>YDCST%RLVTT, RCS=>YDCST%RCS, RLSTT=>YDCST%RLSTT, & & RGAMW=>YDCST%RGAMW, RBETW=>YDCST%RBETW, RALPW=>YDCST%RALPW, RGAMS=>YDCST%RGAMS, & @@ -914,10 +906,6 @@ IF (LINTFLEX) YLPROCSET=NEWINTPROCSET() ! 1. Preliminary calculations necessary ! for all types of physics. ! ------------------------------------ -#ifdef REPRO48 -!see comment associated to the include statement -CALL AROINI_BUDGET(YDMODEL%YRML_DIAG%YRLDDH%LSDDH) -#endif INSTEP_DEB=1 INSTEP_FIN=1 @@ -1354,14 +1342,14 @@ IF (LMICRO.OR.LTURB.OR.LLMSE.OR.LKFBCONV) THEN ENDDO !initialise sigma for subgrid condensation coming !from previous time step turbulence scheme - IF (LOSIGMAS) THEN + IF (PHYEX%NEBN%LSIGMAS) THEN DO JLEV = 1, YDCPG_OPTS%KFLEVG ZSIGM_(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JLEV)= YDMF_PHYS_BASE_STATE%SRC(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JLEV) ENDDO ENDIF !initialise convective mas flux for subgrid condensation coming !from previous time step convection scheme - IF (LOSUBG_COND.AND..NOT.LOSIGMAS) THEN + IF (PHYEX%NEBN%LSUBG_COND.AND..NOT.PHYEX%NEBN%LSIGMAS) THEN IF (LKFBCONV) THEN DO JLEV = 1, YDCPG_OPTS%KFLEVG ZMFM_(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JLEV)=YDMF_PHYS_BASE_STATE%SRC(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JLEV) @@ -1547,7 +1535,7 @@ IF (LMICRO) THEN CALL SWAP_THS CALL SWAP_RS - IF (LMFSHAL .AND. (CMF_CLOUD=='DIRE'.OR.CMF_CLOUD=='BIGA')) THEN + IF (LMFSHAL .AND. (PHYEX%PARAM_MFSHALLN%CMF_CLOUD=='DIRE'.OR.PHYEX%PARAM_MFSHALLN%CMF_CLOUD=='BIGA')) THEN IOFF_MFSHAL=IOFF_MFSHAL+3 IF (YDCPG_OPTS%KSTEP==0) THEN DO JLEV = 1, YDCPG_OPTS%KFLEVG @@ -1611,24 +1599,25 @@ IF (LMICRO) THEN ! for now a copy is needed (see below, inside). I don't like than :-( REK ZLIMAS_(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,1:YDCPG_OPTS%KFLEVG,1:NLIMA)=ZLIMASIN_(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,1:YDCPG_OPTS%KFLEVG,1:NLIMA) - CALL ARO_ADJUST_LIMA (YDCPG_OPTS%KFLEVG, IKU, IKL, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG, YDCPG_BNDS%KFDIA, NRR, & - & NLIMA, YDCPG_OPTS%KSTEP+1, LOSUBG_COND, LOSIGMAS, LOCND2, CCONDENS, CLAMBDA3, ZDT, VSIGQSAT, ZZZ_F_, ZRHODJM__(:, 1:YDCPG_OPTS%KFLEVG), & + CALL ARO_ADJUST_LIMA (PHYEX, & + & YDCPG_OPTS%KFLEVG, IKU, IKL, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG, YDCPG_BNDS%KFDIA, NRR, & + & NLIMA, YDCPG_OPTS%KSTEP+1, PHYEX%NEBN%LSUBG_COND, PHYEX%NEBN%LSIGMAS, ZDT, PHYEX%NEBN%VSIGQSAT, ZZZ_F_, ZRHODJM__(:, 1:YDCPG_OPTS%KFLEVG), & & ZRHODREFM__(:, 1:YDCPG_OPTS%KFLEVG), ZEXNREFM_, ZPABSM__(:, 1:YDCPG_OPTS%KFLEVG), ZTHM__(:, 1:YDCPG_OPTS%KFLEVG), & & ZRM_, ZLIMAM_, ZSIGM_, ZPTRWNU_, ZDTHRAD_, ZMFM_, ZRC_MF_, ZRI_MF_, ZCF_MF_, ZTHS__(:, 1:YDCPG_OPTS%KFLEVG), ZRS_, & & ZLIMAS_, ZSRCS__(:, 1:YDCPG_OPTS%KFLEVG), ZNEBMNH_, ZICEFR_, ZPRCFR_, YDDDH, YDMODEL%YRML_DIAG%YRLDDH, YDMODEL%YRML_DIAG%YRMDDH, & & LLIMAINIT ) ELSE -! CALL ARO_ADJUST (KLON,KIDIA,KFDIA,KLEV,NRR,& !this is the target version - CALL ARO_ADJUST (YDCPG_BNDS%KFDIA, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG, NRR, & - & CFRAC_ICE_ADJUST, CCONDENS, CLAMBDA3, LOSUBG_COND, & - & LOSIGMAS, CMICRO, LOCND2, LHGT_QS, CSUBG_MF_PDF, & - & ZDT, VSIGQSAT, ZZZ_F_, ZRHODJM__(:, 1:YDCPG_OPTS%KFLEVG), & - & ZEXNREFM_, ZRHODREFM__(:, 1:YDCPG_OPTS%KFLEVG), ZPABSM__(:, 1:YDCPG_OPTS%KFLEVG), ZTHM__(:, 1:YDCPG_OPTS%KFLEVG), ZRM_, ZSIGM_, & - & ZMFM_, ZRC_MF_, ZRI_MF_, ZCF_MF_, ZTHS__(:, 1:YDCPG_OPTS%KFLEVG), ZRS_, ZSRCS__(:, 1:YDCPG_OPTS%KFLEVG), & + CALL ARO_ADJUST (PHYEX, & + & YDCPG_BNDS%KFDIA, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG, NRR, & + & CMICRO, & + & ZDT, ZZZ_F_, ZRHODJM__(:, 1:YDCPG_OPTS%KFLEVG), & + & ZEXNREFM_, ZRHODREFM__(:, 1:YDCPG_OPTS%KFLEVG), ZPABSM__(:, 1:YDCPG_OPTS%KFLEVG), & + & ZTHM__(:, 1:YDCPG_OPTS%KFLEVG), ZRM_, ZSIGM_, & + & ZMFM_, ZRC_MF_, ZRI_MF_, ZCF_MF_, ZTHS__(:, 1:YDCPG_OPTS%KFLEVG), ZRS_, ZSRCS__(:, 1:YDCPG_OPTS%KFLEVG), & & ZNEBMNH_, & & ZICLDFR_,ZWCLDFR_,ZSSIO_,ZSSIU_,ZIFR_,& - & ZHLC_HRC_, ZHLC_HCF_, ZHLI_HRI_, ZHLI_HCF_, & + & ZHLC_HRC_, ZHLC_HCF_, ZHLI_HRI_, ZHLI_HCF_, & & YDDDH, YDMODEL%YRML_DIAG%YRLDDH, YDMODEL%YRML_DIAG%YRMDDH,& & ZSPP_ALL%YSPP_PSIGQSAT,ZSPP_ALL%YSPP_ICE_CLD_WGT) @@ -2526,7 +2515,7 @@ IF(LKFBCONV) THEN ! avance temporelle et inversion niveau pour ZMFS_ ! on utilise PSIGS pour le flux de masse pour la condensation sous maille ! car PSIGS n est utilise que si LOSIGMAS=T - IF (LOSUBG_COND.AND..NOT.LOSIGMAS) THEN + IF (PHYEX%NEBN%LSUBG_COND.AND..NOT.PHYEX%NEBN%LSIGMAS) THEN YDVARS%SRC%T1(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,1:YDCPG_OPTS%KFLEVG)=ZMFS_(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,1:YDCPG_OPTS%KFLEVG) ENDIF IF(MOD(YDCPG_OPTS%KSTEP+1,NPRINTFR)==0) THEN @@ -2662,7 +2651,7 @@ ENDIF ! ------------------------------------------------------------------ IF (LMFSHAL) THEN - IF (CMF_UPDRAFT=='DUAL') THEN + IF (PHYEX%PARAM_MFSHALLN%CMF_UPDRAFT=='DUAL') THEN ! Updraft computation from EDMF/ECMWF dual proposal ! Version May 2007 ! @@ -2687,7 +2676,7 @@ IF (LMFSHAL) THEN ENDDO ! If OCND2 and non-LIMA microphysics use water or mixed-phase cloud fraction for VDFHGHTHL, else use cloud fraction YDVARS%A%T1 - IF (LOCND2.AND.LMICRO.AND.CMICRO/='LIMA') THEN + IF (PHYEX%PARAM_ICEN%LOCND2.AND.LMICRO.AND.CMICRO/='LIMA') THEN DO JLEV=1,YDCPG_OPTS%KFLEVG ZZWCLDFR(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JLEV) = ZWCLDFR_(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JLEV) ENDDO @@ -2699,7 +2688,7 @@ IF (LMFSHAL) THEN ! IF LHARATU=TRUE then TKE at t-dt is needed as input for vdfexcuhl so fill ZTKEEDMF with t-1 value from PTKEM - IF (LHARATU) THEN + IF (PHYEX%TURBN%LHARAT) THEN DO JLEV=1,YDCPG_OPTS%KFLEVG ZTKEEDMF(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JLEV)=ZTKEM(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JLEV) ZLENGTH_M(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JLEV)=0.01_JPRB @@ -2774,7 +2763,7 @@ IF (LMFSHAL) THEN ! JDRAFT=2 : dry updraft ! JDRAFT=3 : wet updraft - IF (CMF_UPDRAFT=='DUAL') THEN + IF (PHYEX%PARAM_MFSHALLN%CMF_UPDRAFT=='DUAL') THEN ! Goes from one of the updraft from the IFS level world to the Méso-NH level world ! go from q to r) DO JLEV = 1,YDCPG_OPTS%KFLEVG @@ -2791,7 +2780,7 @@ IF (LMFSHAL) THEN ENDDO ZZW_UP_(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,1:IKT)=0._JPRB ZZFRAC_UP_(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,1:IKT)=0._JPRB - IF (LHARATU) THEN + IF (PHYEX%TURBN%LHARAT) THEN DO JLEV = 1,YDCPG_OPTS%KFLEVG DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA ZLENGTHM__(JLON,JLEV) = MAX(0.01_JPRB,ZLENGTH_M(JLON,JLEV)) @@ -2820,9 +2809,10 @@ IF (LMFSHAL) THEN ZARG_FLXZTHVMF_ => ZFLXZTHVMF_(:,1:YDCPG_OPTS%KFLEVG) ENDIF - CALL ARO_SHALLOW_MF (KKL=IKL, KLON=YDCPG_BNDS%KFDIA, KLEV=YDCPG_OPTS%KFLEVG, KFDIA=YDCPG_BNDS%KFDIA, KRR=NRR, KRRL=NRRL, & - & KRRI=NRRI, KSV=NGFL_EXT, HMF_UPDRAFT=CMF_UPDRAFT, HMF_CLOUD=CMF_CLOUD, HFRAC_ICE=CFRAC_ICE_SHALLOW_MF, & - & OMIXUV=LMIXUV, ONOMIXLG=.FALSE., KSV_LGBEG=0, KSV_LGEND=0, KTCOUNT=YDCPG_OPTS%KSTEP+1, PTSTEP=ZDT, & + CALL ARO_SHALLOW_MF (PHYEX, & + & KKL=IKL, KLON=YDCPG_BNDS%KFDIA, KLEV=YDCPG_OPTS%KFLEVG, KFDIA=YDCPG_BNDS%KFDIA, KRR=NRR, KRRL=NRRL, & + & KRRI=NRRI, KSV=NGFL_EXT, & + & KSV_LGBEG=0, KSV_LGEND=0, PTSTEP=ZDT, & & PDX=YDGEOMETRY%YREGEO%EDELX, PDY=YDGEOMETRY%YREGEO%EDELY, & & PZZ=ZZZ_, PZZF=ZZZ_F_, PDZZF=ZDZZ_F_, PRHODJ=ZRHODJM__(:, 1:YDCPG_OPTS%KFLEVG), PRHODREF=ZRHODREFM__(:, 1:YDCPG_OPTS%KFLEVG), & & PPABSM=ZPABSM__(:, 1:YDCPG_OPTS%KFLEVG), PEXNM=ZEXNREFM_, PSFTH=ZSFTH_, PSFRV=ZSFRV_, PTHM=ZTHM__(:, 1:YDCPG_OPTS%KFLEVG), & @@ -2835,7 +2825,7 @@ IF (LMFSHAL) THEN !wc No variance due to dry updraft yet. ! Putting ZSIGMF to 0 for dry updraft might be obsolete - IF (LSTATNW) THEN + IF (PHYEX%NEBN%LSTATNW) THEN IF (JDRAFT .EQ. 2) THEN DO JLEV = 1,YDCPG_OPTS%KFLEVG ZSIGMF_(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JLEV)=0._JPRB @@ -2850,7 +2840,7 @@ IF (LMFSHAL) THEN ! traitement des sorties pour repasser dans le monde Aladin - IF ((CMF_CLOUD=='DIRE'.OR.CMF_CLOUD=='BIGA').AND.JDRAFT==3) THEN + IF ((PHYEX%PARAM_MFSHALLN%CMF_CLOUD=='DIRE'.OR.PHYEX%PARAM_MFSHALLN%CMF_CLOUD=='BIGA').AND.JDRAFT==3) THEN ! sauvegarde pour le schema de nuage DO JLEV = 1,YDCPG_OPTS%KFLEVG ZP1EZDIAG(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JLEV,1)=ZRC_MF_(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JLEV) @@ -2965,15 +2955,16 @@ IF (LTURB) THEN ! Appel avec les arguments modifiés pour variables LIMA : ! KSV_TURB, ZSFTURB, ZTURBM, ZTURBS, ZTENDSV_TURB - CALL ARO_TURB_MNH(KKA=IKA, KKU=IKU, KKL=IKL, KLON=YDCPG_BNDS%KFDIA, KLEV=YDCPG_OPTS%KFLEVG, KRR=NRR, & - & KRRL=NRRL, KRRI= NRRI, KSV=NLIMA, KTCOUNT=YDCPG_OPTS%KSTEP+1, KGRADIENTS=NGRADIENTS, LDHARATU=LHARATU, & - & CMICRO=CMICRO, & + CALL ARO_TURB_MNH(PHYEX, & + & KKA=IKA, KKU=IKU, KKL=IKL, KLON=YDCPG_BNDS%KFDIA, KLEV=YDCPG_OPTS%KFLEVG, KRR=NRR, & + & KRRL=NRRL, KRRI= NRRI, KSV=NLIMA, KGRADIENTS=NGRADIENTS, & + & CMICRO=CMICRO, & & PTSTEP=ZDT, PZZ=ZZZ_, PZZF=ZZZ_F_, PZZTOP=ZZTOP_, PRHODJ=ZRHODJM__, PTHVREF=ZTHVREFM__, & - & HINST_SFU='M', PSFTH=ZSFTH_, PSFRV=ZSFRV_, PSFSV=ZSFSVLIMA_, PSFU=ZSFU_, & + & PSFTH=ZSFTH_, PSFRV=ZSFRV_, PSFSV=ZSFSVLIMA_, PSFU=ZSFU_, & & PSFV=ZSFV_, PPABSM=ZPABSM__, PUM=ZUM__, PVM=ZVM__, PWM=ZWM__, PTKEM=ZTKEM__, PEPSM=ZEPSM, PSVM=ZLIMAM_, & & PSRCM=ZSRCS__, PTHM=ZTHM__, PRM=ZRM_, PRUS=ZUS__, PRVS=ZVS__, PRWS=ZWS__, PRTHS=ZTHS__, PRRS=ZRS_, & & PRSVSIN=ZLIMASIN_, PRSVS=ZLIMAS_, PRTKES=ZTKES_, PRTKES_OUT=ZTKES_OUT__, PREPSS=ZEPSS, PHGRAD=ZTURB3D__, & - & PSIGS=ZSIGS__, OSUBG_COND=LOSUBG_COND, PFLXZTHVMF=ZFLXZTHVMF_SUM__, PLENGTHM=ZLENGTHM__, PLENGTHH=ZLENGTHH__, & + & PSIGS=ZSIGS__, PFLXZTHVMF=ZFLXZTHVMF_SUM__, PLENGTHM=ZLENGTHM__, PLENGTHH=ZLENGTHH__, & & MFMOIST=ZMF_UP__, PDRUS_TURB=ZTENDU_TURB__, PDRVS_TURB=ZTENDV_TURB__, PDRTHLS_TURB=ZTENDTHL_TURB__, & & PDRRTS_TURB=ZTENDRT_TURB__, PDRSVS_TURB=ZTENDSV_TURBLIMA_, PDP=ZDP__, PTP=ZTP__, PTPMF=ZTPMF__, PTDIFF=ZTDIFF__, & & PTDISS=ZTDISS__, PEDR=ZEDR__, YDDDH=YDDDH, YDLDDH=YDMODEL%YRML_DIAG%YRLDDH, YDMDDH=YDMODEL%YRML_DIAG%YRMDDH & @@ -3044,12 +3035,13 @@ IF (LTURB) THEN ENDIF ! avance temporelle et inversion niveau pour ZSIGS__ - IF (LOSUBG_COND .AND. LOSIGMAS) THEN - IF (CMF_CLOUD=='DIRE'.OR.CMF_CLOUD=='BIGA'.OR.CMF_CLOUD=='NONE') THEN + IF (PHYEX%NEBN%LSUBG_COND .AND. PHYEX%NEBN%LSIGMAS) THEN + IF (PHYEX%PARAM_MFSHALLN%CMF_CLOUD=='DIRE'.OR.PHYEX%PARAM_MFSHALLN%CMF_CLOUD=='BIGA'.OR. & + &PHYEX%PARAM_MFSHALLN%CMF_CLOUD=='NONE') THEN DO JLEV = 1,YDCPG_OPTS%KFLEVG YDVARS%SRC%T1(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JLEV)=ZSIGS__(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JLEV) ENDDO - ELSEIF (CMF_CLOUD=='STAT') THEN + ELSEIF (PHYEX%PARAM_MFSHALLN%CMF_CLOUD=='STAT') THEN DO JLEV = 1,YDCPG_OPTS%KFLEVG DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA YDVARS%SRC%T1(JLON,JLEV)=SQRT(ZSIGS__(JLON,JLEV)**2+ZSIGMF_(JLON,JLEV)**2 ) @@ -3078,7 +3070,7 @@ IF (LTURB) THEN ENDDO - IF (LHARATU) THEN + IF (PHYEX%TURBN%LHARAT) THEN DO JLEV = 1,YDCPG_OPTS%KFLEVG DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA ZTENDTKE(JLON,JLEV)=ZTENDTKE(JLON,JLEV)+(ZTKEEDMFS(JLON,JLEV)-ZTKES_(JLON,JLEV)) @@ -3181,7 +3173,7 @@ IF (LMICRO) THEN & ZRSIN_(NPTP,JLEV,3),ZRSIN_(NPTP,JLEV,4),ZRSIN_(NPTP,JLEV,5), ZRSIN_(NPTP,JLEV,6) ENDDO WRITE(NULOUT,*)'ZDT=',ZDT - WRITE(NULOUT,*)'NRR and co',NRR,YDCPG_OPTS%KSTEP+1,NSPLITR,LOSUBG_COND, LOSIGMAS, CSUBG_AUCV_RC,LOWARM + WRITE(NULOUT,*)'NRR and co',NRR,YDCPG_OPTS%KSTEP+1,NSPLITR ENDIF ZSEA_(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=0.0_JPRB @@ -3211,23 +3203,23 @@ IF (LMICRO) THEN ELSE ZPTRWNU_ => ZWM__(1:YDCPG_BNDS%KFDIA,1:YDCPG_OPTS%KFLEVG) ENDIF - CALL ARO_LIMA(YDCPG_OPTS%KFLEVG, IKU, IKL, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG,YDCPG_BNDS%KFDIA,NRR, NLIMA, YDCPG_OPTS%KSTEP+1, & + CALL ARO_LIMA(PHYEX, YDCPG_OPTS%KFLEVG, IKU, IKL, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG,YDCPG_BNDS%KFDIA,NRR, NLIMA, & & NSPLITR, NSPLITG, ZDT, ZDZZ_, ZRHODJM__(:, 1:YDCPG_OPTS%KFLEVG), ZRHODREFM__(:, 1:YDCPG_OPTS%KFLEVG), & & ZEXNREFM_, ZPABSM__(:, 1:YDCPG_OPTS%KFLEVG), ZPTRWNU_, ZDTHRAD_, ZTHM__(:, 1:YDCPG_OPTS%KFLEVG), ZRM_, & & ZLIMAM_, ZTHS__(:, 1:YDCPG_OPTS%KFLEVG), ZRS_, ZLIMAS_, ZEVAP_, ZINPRR_NOTINCR_, & & ZINPRS_NOTINCR_, ZINPRG_NOTINCR_, ZINPRH_NOTINCR_, ZPFPR_, ZNEBMNH_, ZICEFR_, ZPRCFR_, YDDDH, YDMODEL%YRML_DIAG%YRLDDH, & & YDMODEL%YRML_DIAG%YRMDDH) ELSE - !CALL ARO_RAIN_ICE (NPROMICRO,KLEV,IKU,IKL,KLON,KLEV,KFDIA,NRR,KSTEP+1,& !this is the target version - CALL ARO_RAIN_ICE (NPROMICRO,YDCPG_OPTS%KFLEVG,IKU,IKL,YDCPG_BNDS%KFDIA,YDCPG_OPTS%KFLEVG,YDCPG_BNDS%KFDIA,NRR,YDCPG_OPTS%KSTEP+1, & - & NSPLITR, LOSUBG_COND, CSUBG_AUCV_RC, CSUBG_AUCV_RI, LOSEDIC, CSEDIM, CMICRO, ZDT, ZDZZ_, & + CALL ARO_RAIN_ICE (PHYEX, & + & YDCPG_OPTS%KFLEVG,IKU,IKL,YDCPG_BNDS%KFDIA,YDCPG_OPTS%KFLEVG,YDCPG_BNDS%KFDIA,NRR, & + & CMICRO, ZDT, ZDZZ_, & & ZRHODJM__(:, 1:YDCPG_OPTS%KFLEVG), ZRHODREFM__(:, 1:YDCPG_OPTS%KFLEVG), ZEXNREFM_, ZPABSM__(:, 1:YDCPG_OPTS%KFLEVG), & & ZHLC_HRC_, ZHLC_HCF_, ZHLI_HRI_, ZHLI_HCF_, & & ZTHM__(:, 1:YDCPG_OPTS%KFLEVG), & & ZRM_, ZSIGS__(:, 1:YDCPG_OPTS%KFLEVG), ZNEBMNH_, ZTHS__(:, 1:YDCPG_OPTS%KFLEVG), ZRS_, ZEVAP_, & - & ZCIT_, LOWARM, ZSEA_, ZTOWN_, & + & ZCIT_, ZSEA_, ZTOWN_, & & ZICLDFR_, ZWCLDFR_, ZSSIO_, ZSSIU_, ZIFR_, & - & LOCND2, LKOGAN, LMODICEDEP,& + & LKOGAN, LMODICEDEP,& & ZINPRR_NOTINCR_, ZINPRS_NOTINCR_, ZINPRG_NOTINCR_, & & ZINPRH_NOTINCR_, ZPFPR_, & & YDDDH, YDMODEL%YRML_DIAG%YRLDDH, YDMODEL%YRML_DIAG%YRMDDH,& diff --git a/src/arome/ext/aplpar.F90 b/src/arome/ext/aplpar.F90 new file mode 100644 index 0000000000000000000000000000000000000000..281d5b31a9d251af6fcc1fb0a82d259bf89ee762 --- /dev/null +++ b/src/arome/ext/aplpar.F90 @@ -0,0 +1,5139 @@ +#ifdef RS6K +@PROCESS NOCHECK +#endif +SUBROUTINE APLPAR(YDCST, YDMF_PHYS_BASE_STATE, YDMF_PHYS_NEXT_STATE, YDGEOMETRY, YDCPG_BNDS, YDCPG_OPTS, & +& YDCPG_MISC, YDCPG_GPAR, YDCPG_PHY0, YDMF_PHYS, YDCPG_DYN0, YDMF_PHYS_SURF, YDCPG_SL1, YDCPG_SL2, & +& YDVARS, YDGMV, YDSURF, YDCFU, YDXFU, YDMODEL, PGFL, PGMVT1, PGFLT1, PTRAJ_PHYS, & +& YDDDH) + +!**** *APLPAR * - APPEL DES PARAMETRISATIONS PHYSIQUES. + +! Sujet. +! ------ +! - APPEL DES SOUS-PROGRAMMES DE PARAMETRISATION +! INTERFACE AVEC LES PARAMETRISATIONS PHYSIQUES (IALPP). +! - CALL THE SUBROUTINES OF THE E.C.M.W.F. PHYSICS PACKAGE. + +!** Interface. +! ---------- +! *CALL* *APLPAR* + +!----------------------------------------------------------------------- + +! - 2D (1:KLEV) . + +! PGFL : GFL FIELDS +! PKOZO : CHAMPS POUR LA PHOTOCHIMIE DE L'OZONE (KVCLIS CHAMPS). +! PKOZO : FIELDS FOR PHOTOCHEMISTERY OF OZONE (KVCLIS FIELDS). + +! PGPAR : BUFFER FOR 2D FIELDS - CONTAINS PRECIP, ALBEDO, EMISS, TS +! : SURFACE FLUXES +! - INPUT/OUTPUT 1D +! YDDDH : DDH superstructure + +!----------------------------------------------------------------------- + +! Externes. +! --------- + +! Methode. +! -------- +! - TERMINE LES INITIALISATIONS. +! - APPELLE LES SS-PRGMS TAMPONS SUIVANT LA LOGIQUE TROUVEE +! DANS /YOMPHY/. EUX MEMES VONT DECLARER LES TABLEAUX DE TRAVAIL +! ET APPELER LES PARAMETRISATIONS ELLES MEMES. +! - FINISH UP THE INITIALIZATION. +! - CALL THE BUFFER SUBROUTINES FOLLOWING /YOEPHY/ REQUIREMENTS +! WHICH IN TURN CALL THE ACTUAL PHYSICS SUBROUTINES +! (THIS LAST POINT NOT PARTIALLY DONE) + +! Auteur. +! ------- +! 90-09-28: A. Joly, *CNRM*. + +! Modifications. +! -------------- +! 2007-02-01 M.Janousek : Introduction of 3MT routines +! 2007-02-19 R.Brozkova : Cleaning obsolet features (LSRCON, LSRCONT, LNEBT, +! pre-ISBA, modularisation and racionalisation. +! 2007-04-17 S.Ivatek-S : Over dimensioning of PGPAR (KLON,NGPAR+1) is used +! boundary checking bf +! 2007-05-10 E. Bazile : Introduction of the AROME shallow convection (LCVPPKF) +! 2007-03-21 A. Alias : Modifications for SURFEX (IGFL_EXT) +! 2007-05-07 F. Bouyssel: Several modifications for SURFEX +! 2007-05-07 F. Bouyssel: New argument in ACCOEFK +! 2007-06-27 A. Alias : Use NGFL_EXT instead of IGFL_EXT +! 2008-02-18 F. Bouyssel: New acdifv1 & acdifv2 & arp_ground_param +! 2008-02-21 E. Bazile : Cleaning for the call of the AROME shallow convection (LCVPPKF) +! 4-Mar-2008 Y. Seity : Cleaning IR and WV similated sat radiances +! (replaced by Fullpos Calculations) +! 2008-03-14 Y. Bouteloup: Store diffusion coefficients from non-linear model +! 2007-10-11 A. Alias : New Call to ACHMT/ACNEBR/ACPBLH (P. Marquet/JF. Gueremy) +! 2008-02-01 P. Marquet : modify ZALBD/ZALBP and PFRSODS if LRAYFM15 (idem V4) +! 2008-03-26 F. Bouyssel: Intrduction of LACDIFUS +! 2008-04-28 E. Bazile : Introduction of ZPROTH_CVPP for the TKE scheme +! 2008-05-09, J.F. Gueremy : Flux MEMO sur mer (ACFLUSO/LFLUSO) + +! and P. Marquet : ZCEROV as new argument in ACDIFUS +! 2008-06-01 F. Bouyssel: Interface of radozc (ECMWF ozone) +! 2008-09-02 F. Vana : Better split of ACPTKE and ACDIFV1 code +! 2008-10-01 F. Bouyssel: Call of radozcmf instead of radozc (ECMWF ozone) +! 2008-10-05 E. Bazile : Computation of the PBL height from the TKE. +! 03-Oct-2008 J. Masek parameters for NER statistical model via namelist +! 2009-Jan-21 F. Vana : new mixing lengths for pTKE + few fixes +! 2008-11 C. Payan: Neutral Wind (new arg in the call of ACHMT) +! 2008-11-15 F. Bouyssel: Correction of negative humidities +! 2009-05-01 Y. Bouteloup : Store radiative cloud water and ice in GFL (YIRAD and YLRAD) +! 2009-05-25 F. Bouyssel: Cleaning +! K. Yessad (Jul 2009): remove CDLOCK + some cleanings +! 2009-08-07 A. Alias : LCALLSFX introduced to call only once SURFEX at NSTEP=0 +! Computation of ZRTI (INVERSE DE R*T) added (after ACHMTLS)-not done +! Negatives humidity correction PFCQVNG in acdifus (J.F. Gueremy) +! add ZAESUL/ZAEVOL to CALL RADAER +! 2009-09-21 D. Banciu: complete the cascade within 3MT frame; +! prepare the environment for Rash and Kristjansson condensation (RK) scheme +! remove some arguments of ACPUM and ACUPD (LUDEN option was removed) +! 12-Oct-2009 F. Vana : optimization + update of mixing lengths for p/eTKE +! 2009-10-15 Y. Bouteloup : Store radiative cloud water and ice in GFL (YIRAD and YLRAD) +! 2009-10-23 O.Riviere Intro. of LGWDSPNL for GWD in simpl. phys. +! 2010-01-21 S. Riette: PU, PV and ZDEPTH_HEIGHT in 3D for ARO_GROUND_DIAG +! 2010-05-11 F. Bouyssel : Use of PINDX, PINDY +! 2010-06-20 Y. Seity : Use AROCLDIA to compute PBLH +! 2010-10 A. Alias Compute Sunshine duration +! 2010-10 A. Alias modify ZALBD/ZALBP and PEMIS if LRAYFM for CLIMAT (JF Gueremy) +! 2010-08-10 P.marguinaud : Cleaning +! 2011-01-10 F. Bouyssel: Intro. of LADJCLD and some cleaning. +! 2010-12-01 E. Bazile: TKE1 for AROCLDIA and contributions terms of the +! TKE equations for DDH. +! 2010-12 S. Riette: aro_ground_diag interface modified to add snow cover +! 2010-12 B. Decharme : modify the radiative coupling with surfex (SW per band in ACRADIN and RADHEAT) +! 2011-02 A. Alias : Computation of ZRTI (INVERSE DE R*T) added (after ACHMTLS) +! 2011-02 A. Voldoire : add ZAERINDS to CALL RADAER and ACRADIN +! for sulfate indirect effect computation +! L. Bengtsson-Sedlar & F. Vana 18-Feb-2011 : CA scheme for convection +! I. Bastak-Duran, F. Vana & R. Brozkova 16-Mar-2011: TOUCANS, version 0 +! 2011-02-01 M. Mokhtari: Several modifications for aplpar and introduction of the key LMDUST +! (treatment of the desert aerosols) +! 2011-02-24 Y. Bouteloup : EDKF + Surface forcing for MUSC +! 2011-03-26 F. Bouyssel: Intro. of PSPSG (snow cover with surfex) +! 2011-09-07 J.M. Piriou: PCMT convection scheme. +! 2011-11-17 J.F. Gueremy: ZQLI_CVP diagnostic convective water content +! 2011-06: M. Jerczynski - some cleaning to meet norms +! 2011-11-29 K-I. Ivarsson, L. Bengtsson: RK-scheme modifications +! 26-Jan-2012: F. Vana + I. Bastak-Duran - TOUCANS update + bugfixes +! 2012-04-24 F. Bouyssel: Bug correction on surface water fluxes with surfex +! 2012-06-09 M. Mile: Bug correction for undefined z0;z0h at 0th step CALL ARO_GROUND_DIAG_Z0 +! 2012-09-11 : P.Marguinaud : Add control threshold for +! 2013-06-17 J.M. Piriou: evaporation for PCMT scheme. +! T. Wilhelmsson (Sept 2013) Geometry and setup refactoring. +! 2013-11-08 Y. Bouteloup New version of ACDIFV1 and ACDIFV2 for "full implicit PMMC09 scheme" +! F. Vana 28-Nov-2013 : Redesigned trajectory handling. +! 2013-11, J. Masek: Introduction of ACRANEB2 scheme, externalized +! computation of direct albedo for ACRANEB/ACRANEB2. +! Phasing to cy40t1. +! K. Yessad (July 2014): Move some variables. +! 2014-09, C. Wastl: Adaptations for orographic shadowing +! 2014-10, R. Brozkova: phasing TOUCANS. +! 2016-03, E. Bazile: phasing MUSC for surf_ideal_flux +! 2016-03, L. Gerard: LNSDO AND LCVCSD +! 2016-04, J. Masek: Exponential-random cloud overlap with variable +! decorrelation depth. +! 2016-09, J. Masek: Proper diagnostics of sunshine duration in ACRANEB2. +! 2016-09, M. Mokhtari & A. Ambar: preliminary calculation for passive scalar +! 2016-10, P. Marguinaud : Port to single precision +! K. Yessad (Dec 2016): Prune obsolete options. +! 2016-06, F.Taillefer: add of aro_ground_diag_2isba call +! 2017-09, Y.Bouteloup: Phased Francoise's modification on cy45 +! 2017-09, J. Masek: Fix for protected convective cloudiness, +! shifted dimensioning of PGMU0. +! R. El Khatib 05-Feb-2018 fix bounds violations +! 2018-09, F. Duruisseau: Add PQRCONV1 and PQSCONV1 out (BAYRAD) +! 2018-09, D. St-Martin: Add non-orographic GWD scheme (ACNORGWD) +! 2018-09, R. Roehrig: add ACTKE input/output (ZQLC/ZQIC and ZKQROV/ZKQLROV) (from JF Guérémy) +! 2018-09, M. Michou: Add call to chem_main to activate ARPEGE-Climat chemistry scheme +! 2018-09, R. Brozkova: Fixes in thermodynamic adjustment - deep convective +! condensates protection. Passing of diagnostic hail. +! 2018-09, J. Masek: Calculation of snow fractions over bare ground and +! vegetation moved to ACSOL (case LVGSN=T). Coding of +! ALARO-1 fixes for LZ0HSREL=T. Diagnostics of global +! normal irradiance and mean radiant temperature. +! 2018-11, J.M. Piriou: correct 2010 historical bug about adding cloud sedimentation to resolved surface precipitation. +! R. Hogan 24-Jan-2019 Removed radiation scheme from cycle 15 +! R. El Khatib 30-Apr-2019 fix uninitialized variable +! 2018-10, I. Etchevers : add Visibilities +! 2019-01, I. Etchevers, Y. Seity : add Precipitation Type +! 2019-05, J.M. Piriou: LCVRESDYN + LADJCLD. +! 2019-09, M. Hrastinski: Dataflow for TKE and TTE terms in ALARO DDH (PFTCNS). +! 2019-09, L. Gerard: Modified call to ACNSDO. +! 2019-09, R. Brozkova: Introduction of new NDIFFNEB options. +! 2019-09, J. Masek: Introduction of ETKE_MIN, efficient ACRANEB2 clearsky +! computations. +! 2019-10, I. Etchevers : Visibilities in ACVISIH, AROCLDIA=>ACCLDIA +! 2019-10, Y.Bouteloup : New anti-GPS in accvimp.F90 +! 2019-10, Y.Bouteloup and M. Bouzghaiam : Radiation modifications. Remove of FMR15, remove acradin.F90 direct +! call to recmwf.F90 and add interface to ecrad (in recmwf !) +! 2020-07, J.M. Piriou and O. Jaron: interface Tiedtke scheme with lightning flash density. +! 2020-10, J. Masek : modified call to ACCLDIA +! 2020-10, M. Hrastinski: Reorganized computation of the moist gustiness +! correction. Modified call of ACMRIP and ACMIXELEN subroutines. +! 2020-11, Y.Bouteloup : Interface to IFS deep convection scheme under LCVTDK key +! 2020-12, U.Andrae : Introduce SPP for HARMONIE-AROME +! 2021-04, J.M. Piriou: interface PCMT with lightning flash density. +! 2021-09, J.M. Piriou: initialize LLLAND for PCMT lightning computations. +! 2021- R.Brozkova,D.Nemec: interfaced subroutine DIAGFLASH for ALARO +! bf for ALARO graupel + removed ZMELNET/ZMELGET +! 13-Jul-2022 R. El Khatib Fix initialization of ZQGM + +! End Modifications +!------------------------------------------------------------------------------- + +!----------------------------------------------------------------------- +! ****************************************************************** +! ****** IDIOSYNCRASIES *** IDIOSYNCRASIES *** IDIOSYNCRASIES ****** +! ****************************************************************** +! *** HEALTH WARNING: *** +! *** =============== *** +! *** NOTE THAT WITHIN THE E.C.M.W.F. PHYSICS HALF-LEVELS *** +! *** ARE INDEXED FROM 1 TO NFLEVG+1 WHILE THEY ARE BETWEEN *** +! *** 0 AND NFLEVG IN THE REST OF THE MODEL. THE CHANGE IS TAKEN*** +! *** CARE OF IN THE CALL TO THE VARIOUS SUBROUTINES OF THE *** +! *** PHYSICS PACKAGE *** +! *** *** +! *** THIS IS SUPPOSED TO BE A "TEMPORARY" FEATURE TO BE *** +! *** STRAIGHTENED OUT IN THE "NEAR" FUTURE *** +! ****************************************************************** + +! ------------------------------------------------------------------ + +USE GEOMETRY_MOD , ONLY : GEOMETRY +USE MF_PHYS_TYPE_MOD , ONLY : MF_PHYS_TYPE +USE CPG_TYPE_MOD , ONLY : CPG_MISC_TYPE, CPG_DYN_TYPE, CPG_PHY_TYPE, & + & CPG_SL1_TYPE, CPG_SL2_TYPE, CPG_GPAR_TYPE +USE CPG_OPTS_TYPE_MOD , ONLY : CPG_BNDS_TYPE, CPG_OPTS_TYPE +USE MF_PHYS_SURFACE_TYPE_MOD,ONLY : MF_PHYS_SURF_TYPE +USE FIELD_VARIABLES_MOD, ONLY : FIELD_VARIABLES +USE SURFACE_FIELDS_MIX , ONLY : TSURF +USE YOMXFU , ONLY : TXFU +USE TYPE_MODEL , ONLY : MODEL +USE PARKIND1 , ONLY : JPIM ,JPRB +USE YOMHOOK , ONLY : LHOOK ,DR_HOOK +USE YOMVERT , ONLY : VP00 +USE YOMCST , ONLY : TCST +USE YOMDYNA , ONLY : L3DTURB +USE YOMRIP0 , ONLY : NINDAT +USE DDH_MIX , ONLY : TYP_DDH +USE YOMLUN , ONLY : NULOUT +USE YOMLSFORC , ONLY : LMUSCLFA,NMUSCLFA +USE YOMTRAJ , ONLY : TRAJ_PHYS_TYPE, LPRTTRAJ +USE YOMCFU , ONLY : TCFU !!! for parameters of FLASH +USE SPP_MOD , ONLY : YSPP, YSPP_CONFIG +USE MF_PHYS_BASE_STATE_TYPE_MOD & + & , ONLY : MF_PHYS_BASE_STATE_TYPE +USE MF_PHYS_NEXT_STATE_TYPE_MOD & + & , ONLY : MF_PHYS_NEXT_STATE_TYPE + + +USE YOMGMV , ONLY : TGMV +USE SC2PRG_MOD , ONLY : SC2PRG + +USE YOMCT0 , ONLY : LCALLSFX ,LSFORCS, LELAM, LTWOTL, LAROME, LCORWAT +USE YOMNUD , ONLY : NFNUDG ,LNUDG +USE YOMSNU , ONLY : XPNUDG +USE YOMSCM , ONLY : LGSCM +USE YOMCHET , ONLY : GCHETN +USE YOMDYNCORE , ONLY : RPLDARE, RPLRG + +USE INTFLEX_MOD , ONLY : LINTFLEX, TYPE_INTPROCSET, NEWINTPROCSET, CLEANINTPROCSET +! ------------------------------------------------------------------------- + +IMPLICIT NONE + +TYPE (TCST), INTENT(IN) :: YDCST +TYPE (MF_PHYS_BASE_STATE_TYPE), INTENT(IN) :: YDMF_PHYS_BASE_STATE +TYPE (MF_PHYS_NEXT_STATE_TYPE), INTENT(INOUT) :: YDMF_PHYS_NEXT_STATE +TYPE(GEOMETRY), INTENT(IN) :: YDGEOMETRY +TYPE(CPG_BNDS_TYPE), INTENT(IN) :: YDCPG_BNDS +TYPE(CPG_OPTS_TYPE), INTENT(IN) :: YDCPG_OPTS +TYPE(CPG_MISC_TYPE), INTENT(INOUT) :: YDCPG_MISC +TYPE(CPG_GPAR_TYPE), INTENT(INOUT) :: YDCPG_GPAR +TYPE(CPG_PHY_TYPE), INTENT(IN) :: YDCPG_PHY0 +TYPE(MF_PHYS_TYPE), INTENT(INOUT) :: YDMF_PHYS +TYPE(CPG_DYN_TYPE), INTENT(IN) :: YDCPG_DYN0 +TYPE(MF_PHYS_SURF_TYPE), INTENT(INOUT) :: YDMF_PHYS_SURF +TYPE(CPG_SL1_TYPE), INTENT(INOUT) :: YDCPG_SL1 +TYPE(CPG_SL2_TYPE), INTENT(INOUT) :: YDCPG_SL2 +TYPE(FIELD_VARIABLES), INTENT(INOUT) :: YDVARS +TYPE(TGMV), INTENT(IN) :: YDGMV +TYPE(TSURF), INTENT(IN) :: YDSURF +TYPE(TCFU), INTENT(IN) :: YDCFU +TYPE(TXFU), INTENT(IN) :: YDXFU +TYPE(MODEL), INTENT(IN) :: YDMODEL + + +REAL(KIND=JPRB), INTENT(INOUT) :: PGFL(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,YDMODEL%YRML_GCONF%YGFL%NDIM) +REAL(KIND=JPRB), INTENT(INOUT) :: PGMVT1(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,YDGMV%YT1%NDIM) +REAL(KIND=JPRB), INTENT(INOUT) :: PGFLT1(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,YDMODEL%YRML_GCONF%YGFL%NDIM1) + + +TYPE (TRAJ_PHYS_TYPE), INTENT(INOUT) :: PTRAJ_PHYS +TYPE(TYP_DDH) ,INTENT(INOUT) :: YDDDH + +! ------------------------------------------------------------------ +LOGICAL :: LL_SAVE_PHSURF + +INTEGER(KIND=JPIM) :: IFIELDSS + +INTEGER(KIND=JPIM) :: INSTEP_DEB,INSTEP_FIN +INTEGER(KIND=JPIM) :: JROF, JSPP + +! --- UPPER AIR PHYSICAL TENDENCIES. +REAL(KIND=JPRB) :: ZTENDH(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Enthalpy tendency. +REAL(KIND=JPRB) :: ZTENDQ(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Moisture tendency. +REAL(KIND=JPRB) :: ZTENDPTKE(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Pseudo progn. TKE + +! GFL tendencies for APL_AROME (assumes YDMODEL%YRML_GCONF%YGFL%NUMFLDS>=YDMODEL%YRML_PHY_MF%YRPARAR%NRR) +! for now, use Jovi's trick : +REAL(KIND=JPRB) :: ZTENDGFL(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,YDMODEL%YRML_GCONF%YGFL%NUMFLDS) ! GFL tendencies + +! --- UPPER AIR PHYSICAL TENDENCIES FOR AROME. +! (the previous one are not used in AROME) +REAL(KIND=JPRB) :: ZTENDD (YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! d tendency +REAL(KIND=JPRB) :: ZTENDEXT(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,YDMODEL%YRML_GCONF%YGFL%NGFL_EXT) ! GFL EXTRA tendency +REAL(KIND=JPRB) :: ZTENDEXT_DEP(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,YDMODEL%YRML_GCONF%YGFL%NGFL_EXT) ! GFL EXTRA tendency +REAL(KIND=JPRB) :: ZDIFEXT(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG,YDMODEL%YRML_GCONF%YGFL%NGFL_EXT) ! Extra-GFL fluxes. + +REAL(KIND=JPRB) :: ZTENDU (YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! U tendency without deep convection contribution +REAL(KIND=JPRB) :: ZTENDV (YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! V tendency without deep convection contribution + +! --- RADIATION COEFFICIENTS FOR SIMPLIFIED PHYSICS IN GRID-POINT --- +REAL(KIND=JPRB) :: ZAC(YDCPG_OPTS%KLON,(YDCPG_OPTS%KFLEVG+1)*(YDCPG_OPTS%KFLEVG+1)) ! Curtis matrix. +REAL(KIND=JPRB) :: ZAC_HC(YDCPG_OPTS%KFLEVG+1,YDCPG_OPTS%KFLEVG+1) ! horizontally-constant field for ZAC. + + + +! required for INTFLEX +TYPE(TYPE_INTPROCSET) :: YLPROCSET + +! SPP +REAL(KIND=JPRB) :: ZGP2DSPP(YDCPG_OPTS%KLON,YSPP%N2D) + + +REAL(KIND=JPRB), POINTER :: ZPTENDEFB11(:,:), ZPTENDEFB21(:,:) +REAL(KIND=JPRB), POINTER :: ZPTENDEFB31(:,:) +REAL(KIND=JPRB), POINTER :: ZPTENDG1(:,:) +REAL(KIND=JPRB), POINTER :: ZPTENDICONV1(:,:), ZPTENDI1(:,:) +REAL(KIND=JPRB), POINTER :: ZPTENDLCONV1(:,:) +REAL(KIND=JPRB), POINTER :: ZP1EZDIAG(:,:,:) +REAL(KIND=JPRB), POINTER :: ZPTENDQ1(:,:) +REAL(KIND=JPRB), POINTER :: ZPTENDRCONV1(:,:) +REAL(KIND=JPRB), POINTER :: ZPTENDR1(:,:) +REAL(KIND=JPRB), POINTER :: ZPTENDSCONV1(:,:) +REAL(KIND=JPRB), POINTER :: ZPTENDS1(:,:) +REAL(KIND=JPRB), POINTER :: ZPTENDTKE1(:,:) +REAL(KIND=JPRB), POINTER :: ZPTENDL1(:,:) + +! ------------------------------------------------------------------ +! ATTENTION SI KVCLIG < 7 LES CHAMPS SUIVANTS NE SONT +! PAS REELLEMENT ALLOUES EN MEMOIRE. +!* +! ------------------------------------------------------------------ +! DECLARATION DES TABLEAUX LOCAUX-GLOBAUX DES PARAMETRISATIONS +INTEGER(KIND=JPIM) :: INLAB(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG), INLAB_CVPP(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZNLAB(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZNLABCVP(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) + +! ------------------------------------------------------------------ +! ARE DIMENSIONNED 0:KLEV ONLY IN ORDER TO KEEP IN MIND +! THAT THEY ARE COMPUTED AT "HALF LEVELS". +! THEY ARE USED HOWEVER FROM 1 TO KLEV. + +REAL(KIND=JPRB) :: ZXTROV(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZXUROV(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZXPTKEROV(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZRRCOR(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZMRIPP(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZMRIFPP(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZBNEBCVPP(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZBNEBQ(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZMN2PP(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZMN2_ES(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZMN2_EQ(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZMN2_DS(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZMN2_DQ(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +! ZMRIMC : M(C) from P. Marquet's moist Ri computation - for TKE correction after TOMs +! ZMRICTERM : Rv/R.F(C)-1/M(C).T/Tv from P. Marquet's moist Ri computation - for TKE correction after TOMs +REAL(KIND=JPRB) :: ZMRIMC(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZMRICTERM(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZTSTAR(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZTSTAR2(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) !diag +REAL(KIND=JPRB) :: ZTSTARQ(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZTSTAR2Q(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG)!diag +REAL(KIND=JPRB) :: ZTAU_TKE(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG)!DISSIPATION TIME SCALE TAU -FOR TOM's CALCULATION +REAL(KIND=JPRB) :: ZF_EPS(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! Conversion function lm-L +REAL(KIND=JPRB) :: ZFUN_TTE(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! Function in computation of tte_tilde +REAL(KIND=JPRB) :: ZKTROV(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZKUROV(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZNBVNO(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZKQROV(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZKQLROV(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZKNROV(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) + +REAL(KIND=JPRB) :: ZFHORM(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZFHORH(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! arrays for 3D turb +! ZFMTKE - F_m function for static K_m computation +! ZFHTKE - F_h function for static K_h computation +REAL(KIND=JPRB) :: ZFMTKE(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZFTTKE(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZRHS(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +! ZAUTKE - alpha_u for dry AF scheme +! ZATTKE - alpha_theta for dry AF scheme +REAL(KIND=JPRB) :: ZAUTKE(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZATTKE(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +!ZTH_FUN, ZWW_FUN - T_h, A_h, F_ww - stability functions for TOMs par. +REAL(KIND=JPRB) :: ZTH_FUN(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZWW_FUN(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +! ZFMGST - stability function F_m for moist gustiness correction +REAL(KIND=JPRB) :: ZFMGST(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) + + +! ------------------------------------------------------------------ +REAL(KIND=JPRB) :: ZATSLC(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZNEBS(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZQLIS(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZNEBS0(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZQLIS0(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZNEBC0(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) !Nebulosite convective radiative +REAL(KIND=JPRB) :: ZNEBDIFF(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) !Nebulosite: calcul de la diffusion +REAL(KIND=JPRB) :: ZNEBCH(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) !Nebulosite convective condensation +REAL(KIND=JPRB) :: ZUNEBH(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) !Nebulosite convective histo +REAL(KIND=JPRB) :: ZDETFI(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) !fraction of instantaneous detrained air +REAL(KIND=JPRB) :: ZFPCOR(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZFHP(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZLMT(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZZLMT(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZLMU(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZLMU2(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZLMT2(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! temporary storage of lm,lh +REAL(KIND=JPRB) :: ZLML(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! TKE type mixing length +REAL(KIND=JPRB) :: ZLMLTILD(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! 'STATIC' TKE type mixing length +REAL(KIND=JPRB) :: ZOME(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! updraught envt vert vel*dt +REAL(KIND=JPRB) :: ZFALLR(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! fall velocity of rain +REAL(KIND=JPRB) :: ZFALLS(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! fall velocity of snow +REAL(KIND=JPRB) :: ZFALLG(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! fall velocity of graupel +REAL(KIND=JPRB) :: ZICEFR1(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG)! Resolved Condensate ice fraction +REAL(KIND=JPRB) :: ZRHCRI(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Smith scheme critical RH +REAL(KIND=JPRB) :: ZRHDFDA(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG)! RK scheme change in RH over cloud +REAL(KIND=JPRB) :: ZLHS(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Sublimation latent heat +REAL(KIND=JPRB) :: ZLHV(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Evaporation latent heat +REAL(KIND=JPRB) :: ZLH(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Temporar storage for updated PLH +REAL(KIND=JPRB) :: ZLSCPE(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Temporar storage for updated PLSCPE +REAL(KIND=JPRB) :: ZQSAT(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Temporar storage for updated PQSAT +REAL(KIND=JPRB) :: ZQSATS(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! QSAT of resolved cond./evap. scheme +REAL(KIND=JPRB) :: ZQW(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Temporar storage for updated PQW +REAL(KIND=JPRB) :: ZRH(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Temporar storage for updated PRH +REAL(KIND=JPRB) :: ZTW(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Temporar storage for updated PTW) +REAL(KIND=JPRB) :: ZDQ(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Saturation departure for a given thermodynamic state +REAL(KIND=JPRB) :: ZDQM(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! maximum saturation departure +REAL(KIND=JPRB) :: ZPOID(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! DP/(RG*DT) FOR A GIVEN LEVEL AND A GIVEN TIME STEP. +REAL(KIND=JPRB) :: ZIPOI(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! INVERSE OF ZPOID. + +REAL(KIND=JPRB) :: ZQU(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Updraught Specific moisture +REAL(KIND=JPRB) :: ZTU(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Updraught Temperature +REAL(KIND=JPRB) :: ZUU(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Updraught zonal wind +REAL(KIND=JPRB) :: ZVU(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Updraught merid. wind + +REAL(KIND=JPRB) :: ZTMIC(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Temperature for microphysics +REAL(KIND=JPRB) :: ZQMIC(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Specific moisture for microphysics + +REAL(KIND=JPRB) :: ZT(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! updated temperature T for cascading parameterization +REAL(KIND=JPRB) :: ZTCORR(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! temperature corr. for convective cloud +REAL(KIND=JPRB) :: ZU(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! updated zonal velocity +REAL(KIND=JPRB) :: ZV(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! updated meridional velocity + +REAL(KIND=JPRB) :: ZQV(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! corrected (for negative values) vapour + ! updated value for cascading parameterization +REAL(KIND=JPRB) :: ZQI(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! corrected (for negative values) cloud ice + ! updated value for cascading parameterization +REAL(KIND=JPRB) :: ZQL(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! corrected (for negative values) cloud liquid + ! updated value for cascading parameterization +REAL(KIND=JPRB) :: ZQR(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! corrected (for negative values) rain + ! updated value for cascading parameterization +REAL(KIND=JPRB) :: ZQS(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! corrected (for negative values) snow + ! updated value for cascading parameterization +REAL(KIND=JPRB) :: ZQG(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! corrected (for negative values) graupel + ! updated value for cascading parameterization +REAL(KIND=JPRB) :: ZQH(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! corrected (for negative values) hail + ! updated value for cascading parameterization +REAL(KIND=JPRB) :: ZCP(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! new cp for turbulent diffusion +REAL(KIND=JPRB) :: ZQT(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZTENHA(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZTENQVA(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZFCQVNG(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! correction flux increment for neg vapour +REAL(KIND=JPRB) :: ZFCQING(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! correction flux increment for neg ice +REAL(KIND=JPRB) :: ZFCQLNG(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! correction flux increment for neg liquid water +REAL(KIND=JPRB) :: ZFPLSL(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! total liquid water flux: diff+sedi+rain +REAL(KIND=JPRB) :: ZFPLSN(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! total solid water flux: diff+sedi+snow +REAL(KIND=JPRB) :: ZFCQL(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! condensation flux(liquid) +REAL(KIND=JPRB) :: ZFCQI(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! condensation flux(ice) +REAL(KIND=JPRB) :: ZDIFCQD(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! downdraft flux of specific humidity +REAL(KIND=JPRB) :: ZDIFCQLD(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! downdraft flux of liquid water +REAL(KIND=JPRB) :: ZDIFCQID(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! downdraft flux of solid water +REAL(KIND=JPRB) :: ZSEDIQL(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! sedimentation flux of cloud liquid water +REAL(KIND=JPRB) :: ZSEDIQI(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! sedimentation flux of cloud ice water +REAL(KIND=JPRB) :: ZDIFCSD(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! downdraft entalphy flux +REAL(KIND=JPRB) :: ZSTRCUD(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! change in horizontal mom. +REAL(KIND=JPRB) :: ZSTRCVD(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! change in horizontal mom. +REAL(KIND=JPRB) :: ZRCVOTT(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! degree of inhomogeneity in precips. +REAL(KIND=JPRB) :: ZSIGPC(YDCPG_OPTS%KLON) ! Convective precipit mesh fraction +REAL(KIND=JPRB) :: ZSIGP(YDCPG_OPTS%KLON) ! Precipitation mesh fraction +REAL(KIND=JPRB) :: ZAUXPRC(YDCPG_OPTS%KLON) ! Precipitation auxilary +REAL(KIND=JPRB) :: ZDIFCVPPQ(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! Flux de CVPP (KFB or EDKF) sur Qv +REAL(KIND=JPRB) :: ZDIFCVPPS(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! Flux de CVPP (KFB or EDKF) sur CpT +REAL(KIND=JPRB) :: ZDIFCVTH(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! Flux de CV sur Theta air sec +REAL(KIND=JPRB) :: ZDIFCVPPU(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! Flux de CVPP (EDKF) sur U +REAL(KIND=JPRB) :: ZDIFCVPPV(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! Flux de CVPP (EDKF) sur V + +REAL(KIND=JPRB) :: ZEDMFQ(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! Mass flux part of EDMF flux for Qv +REAL(KIND=JPRB) :: ZEDMFS(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! Mass flux part of EDMF flux for CpT +REAL(KIND=JPRB) :: ZEDMFU(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! Mass flux part of EDMF flux for U +REAL(KIND=JPRB) :: ZEDMFV(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! Mass flux part of EDMF flux for V +REAL(KIND=JPRB) :: ZMF_UP(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! Mass flux for implicit formulation of EDMF equation (LEDMFI) +REAL(KIND=JPRB) :: ZMU(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! Flux de masse (updraft) pour XIOS output +REAL(KIND=JPRB) :: ZMD(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! Flux de masse (downdraft) pour XIOS output + +REAL(KIND=JPRB) :: ZCONDCVPPL(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! Flux de condensation liquide du a CVVPP (KFB) +REAL(KIND=JPRB) :: ZCONDCVPPI(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! Flux de condensation glace du a CVVPP (KFB) +REAL(KIND=JPRB) :: ZPRODTH_CVPP(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! Flux de production thermique de TKE du a CVPP(KFB) +REAL(KIND=JPRB) :: ZDTRAD(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! radiation contribution to T tendency +REAL(KIND=JPRB) :: ZDQVDIFF(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! turtb.diff contribution to Qv tendency +REAL(KIND=JPRB) :: ZRKQCTEND(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Qc input for RK condensation scheme +REAL(KIND=JPRB) :: ZRKQVTEND(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! Qv input for RK condensation scheme +REAL(KIND=JPRB) :: ZRKTTEND(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! T input for RK condensation scheme +REAL(KIND=JPRB) :: ZDQV, ZDQI, ZDQL, ZDQR, ZDQS, ZDQC, ZGDT, ZGDTI,& + & ZQV0, ZQX0, ZQX1,& + & ZCONVC, ZTOTC,ZDTURDIFF +REAL(KIND=JPRB) :: ZTMPPRODTH(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) ! temporary array + +!!for BAYRAD +REAL(KIND=JPRB) :: ZDE2MR(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) ! temporary array for conversion of density to mixing ratio +!----------------------------------------------------------------- + +! - 2D (0:KLEV) . + +! ZKTROV : COEFFICIENT D'ECHANGE VERTICAL DE T ET Q EN KG/(M*M*S). +! ZKUROV : COEFFICIENT D'ECHANGE VERTICAL DE U ET V EN KG/(M*M*S). +! ZKNROV : COEFFICIENT D'ECHANGE VERTICAL NEUTRE EN KG/(M*M*S). +! ZNBVNO : FREQUENCE DE BRUNT-VAISALA DIVISEE PAR G FOIS LA DENSITE. + +! ZNEBS : NEBULOSITE STRATIFORME (SCHEMA STATISTIQUE DE NUAGES). +! : STRATIFORM CLOUDINESS (STATISTICAL CLOUD SCHEME) +! ZQLIS : QUANTITE D'EAU LIQUIDE STRATIFORME (SCHEMA STATISTIQUE). +! : STRATIFORM LIQUID WATER (STATISTICAL CLOUD SCHEME) + + +! - 2D (1:KLEV) . + +! INLAB : INDICE D'INSTABILITE CONVECTIVE. + +INTEGER(KIND=JPIM) :: INND(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZXDROV(YDCPG_OPTS%KLON),ZXHROV(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZUGST(YDCPG_OPTS%KLON),ZVGST(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZCDROV(YDCPG_OPTS%KLON),ZCHROV(YDCPG_OPTS%KLON),ZDQSTS(YDCPG_OPTS%KLON),ZGWDCS(YDCPG_OPTS%KLON),& + & ZHQ(YDCPG_OPTS%KLON),ZHU(YDCPG_OPTS%KLON),ZHTR(YDCPG_OPTS%KLON),ZCDNH(YDCPG_OPTS%KLON),ZMOD(YDCPG_OPTS%KLON),& + & ZRTI(YDCPG_OPTS%KLON),ZDPHI(YDCPG_OPTS%KLON),ZPRS(YDCPG_OPTS%KLON),ZSTAB(YDCPG_OPTS%KLON),ZTAUX(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZWFC(YDCPG_OPTS%KLON),ZWPMX(YDCPG_OPTS%KLON),ZWLMX(YDCPG_OPTS%KLON),ZWSEQ(YDCPG_OPTS%KLON),& + & ZWSMX(YDCPG_OPTS%KLON),ZWWILT(YDCPG_OPTS%KLON),& + & ZC3(YDCPG_OPTS%KLON),ZCG(YDCPG_OPTS%KLON),ZCN(YDCPG_OPTS%KLON),& + & ZNEIJG(YDCPG_OPTS%KLON),ZNEIJV(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZPCLS(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZPREN(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZFRSODS(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZCD(YDCPG_OPTS%KLON) + + +! - 1D (DIAGNOSTIQUE) . + +! ZCDROV : PCD RENORME EN DENSITE FOIS VITESSE. +! ZCDNH : COEFFICIENT NEUTRE D'ECHANGE EN SURFACE POUR LA CHALEUR. +! ZCDNH : EXCHANGE COEFF. AT SURFACE LEVEL IN NEUTRAL CONDITIONS FOR HEAT. +! ZCG : COEFFICIENT THERMIQUE DU SOL NU. +! ZCG : THERMICAL COEFFICIENT OF BARE GROUND. +! ZCN : COEFFICIENT THERMIQUE DE LA NEIGE. +! ZCN : THERMICAL COEFFICIENT OF SNOW. +! ZCHROV : PCH RENORME EN DENSITE FOIS VITESSE. +! ZC3 : COEFFICIENT UTILE POUR LE CALCUL DU DRAINAGE +! ZDQSTS : DERIVEE DE PQSATS PAR RAPPORT A LA TEMPERATURE. +! ZGWDCS : VARIABLE DE SURFACE POUR LE DRAG OROGRAPHIQUE (RHO*N0/G). +! ZHQ : POIDS DE L'HUMIDITE DE L'AIR DANS L'HUMIDITE DE SURFACE. +! ZHTR : RESISTANCE A LA TRANSPIRATION DU COUVERT VEGETAL. +! ZHTR : FOLIAGE TRANSPIRATION RESISTANCE. +! ZHU : POIDS DE L'HUMIDITE SATURANTE DANS L'HUMIDITE DE SURFACE. +! ZNEIJG : FRACTION DE NEIGE RECOUVRANT LE SOL. +! ZNEIJV : FRACTION DE NEIGE RECOUVRANT LA VEGETATION. +! ZRTI : INVERSE DE R*T. +! ZDPHI : EPAISSEUR EN GEOPOTENTIEL DU NIVEAU DE SURFACE. +! ZPRS : CONSTANTE DES GAZ POUR L'AIR AU SOL. +! ZSTAB : INDICE DE STABILITE A LA SURFACE. +! INND : INDICE DE PRECIPITATIONS CONVECTIVES. +! ZWFC : TENEUR EN EAU A LA CAPACITE AUX CHAMPS. +! ZWFC : FIELD CAPACITY WATER CONTENT. +! ZWPMX : TENEUR EN EAU MAXIMALE DU RESERVOIR PROFOND. +! ZWPMX : MAXIMUM WATER CONTENT OF THE DEEP WATER-TANK. +! ZWLMX : TENEUR EN EAU MAXIMALE DU RESERVOIR D'INTERCEPTION. +! ZWLMX : MAXIMUM WATER CONTENT OF THE INTERCEPTION WATER-TANK. +! ZWSEQ : TENEUR EN EAU A L'EQUILIBRE (EQUILIBRE ENTRE GRAVITE ET +! CAPILLARITE) EN SURFACE. +! ZWSEQ : SURFACE WATER CONTENT FOR THE BALANCE BETWEEN GRAVITY +! AND CAPILLARITY +! ZWSMX : TENEUR EN EAU MAXIMALE DU RESERVOIR SUPERFICIEL. +! ZWSMX : MAXIMUM WATER CONTENT FOR THE SUPERFICIAL WATER-TANK. +! ZWWILT : TENEUR EN EAU AU POINT DE FLETRISSEMENT. +! ZWWILT : WATER CONTENT AT THE WILTING POINT. +! ZSSO_STDEV : OROGRAPHY STANDARD DEVIATION +! ZTWSNOW : SNOW COVER FROM SURFEX +! ZTOWNS : FRACTION OF TOWN FROM SURFEX +REAL(KIND=JPRB) :: ZDAER(YDCPG_OPTS%KFLEVG), ZBLH(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZQO3(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZAER(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,6) +REAL(KIND=JPRB) :: ZAERO(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,12) +REAL(KIND=JPRB) :: ZAERD(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZAERINDS(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZQCO2(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZROZ(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZDPHIV(YDCPG_OPTS%KLON),ZDPHIT(YDCPG_OPTS%KLON) + +REAL(KIND=JPRB) :: ZMAN(0:YDCPG_OPTS%KFLEVG), ZMAK(0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZSSO_STDEV(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZTWSNOW(YDCPG_OPTS%KLON),ZTOWNS(YDCPG_OPTS%KLON) +! - (PROFILS DIAGNOSTIQUES) +! ZDAER : EPAISSEUR OPTIQUE DES AEROSOLS STANDARDS DANS LA COUCHE +! ZDAER : OPTICAL DEPTH OF STANDARD AEROSOLS IN THE LAYER. +! ZQO3 : RAPPORT DE MELANGE MASSIQUE D'OZONE +! (0): " " MOYEN AU-DESSUS DU MODELE +! ZQO3 : OZONE MIXING RATIO (MASS). +! (0):AVERAGED-ABOVE " " . +! ZQCO2 : RAPPORT MASSIQUE LOCAL DU CO2. +! ZQCO2 : CO2 MIXING RATIO (MASS). + +! IJN : DIMENSION TABLEAUX ETENDUS POUR CYCLE DIURNE RAYONNEMENT +! IJN AU PLUSL A KLON + +!* INPUT ARGUMENTS FOR ACRADIN ( RAYT ECMWF POUR CLIMAT ) + +! 1-D ARRAYS +! ---------- + +REAL(KIND=JPRB) :: ZTRSOD(YDCPG_OPTS%KLON) + +! 2-D ARRAYS +! ---------- + +!* OUTPUT ARGUMENTS FOR THE ECMWF PHYSICS + +! 0.2 LOCAL ARRAYS FOR ECMWF PHYSICS PACKAGE +! -------------------------------------- + +REAL(KIND=JPRB) :: ZCEMTR(YDCPG_OPTS%KLON,0:1) , ZCTRSO(YDCPG_OPTS%KLON,0:1) +REAL(KIND=JPRB) :: ZALBD(YDCPG_OPTS%KLON,YDCPG_OPTS%KSW), ZALBP(YDCPG_OPTS%KLON,YDCPG_OPTS%KSW),& + & ZALB(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZSFSWDIR (YDCPG_OPTS%KLON,YDCPG_OPTS%KSW), ZSFSWDIF (YDCPG_OPTS%KLON,YDCPG_OPTS%KSW) +REAL(KIND=JPRB) :: ZTRSODIR (YDCPG_OPTS%KLON,YDCPG_OPTS%KSW), ZTRSODIF (YDCPG_OPTS%KLON,YDCPG_OPTS%KSW) +REAL(KIND=JPRB) :: ZFSDNN(YDCPG_OPTS%KLON),ZFSDNV(YDCPG_OPTS%KLON) + +! 1-D ARRAYS +! ---------- + +REAL(KIND=JPRB) :: ZSUDU(YDCPG_OPTS%KLON) , ZDSRP(YDCPG_OPTS%KLON) , ZSDUR(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZTHETAVS(YDCPG_OPTS%KLON), ZTHETAS(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZAESEA(YDCPG_OPTS%KLON), ZAELAN(YDCPG_OPTS%KLON), ZAESOO(YDCPG_OPTS%KLON), ZAEDES(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZAESUL(YDCPG_OPTS%KLON), ZAEVOL(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZMERL(YDCPG_OPTS%KLON) + +! 2-D ARRAYS +! ---------- + +REAL(KIND=JPRB) :: ZTENT(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG), ZGEOSLC(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZTHETAV(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZDUM(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) + +! LOCAL ARRAYS FOR TKE +! ZCOEFN : COEFFICIENT STATISTIQUE POUR LES FLUX D'EAUX CONDENSEES. + +REAL(KIND=JPRB) :: ZCOEFN(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) + +! LOCAL ARRAYS FOR ACVPPKF +REAL(KIND=JPRB) :: ZQLI_CVPP(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZNEB_CVPP(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +! LOCAL ARRAYS FOR EDKF +REAL(KIND=JPRB) :: ZIMPL + +! 2-D ARRAY FOR SIMPL.RADIATION SCHEME + +REAL(KIND=JPRB) :: ZZNEB(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) + +INTEGER(KIND=JPIM) :: IJN, IMLTYPE, JCHA, JLEV, JLON, JSG, JGFL, JDIAG, IAERO +INTEGER(KIND=JPIM) :: ILONMNH, IKRR, ISPLITR ! useful size of klon arrays for mesonh physics +LOGICAL :: LLCLS, LLHMT, LLMAF, LLREDPR + +REAL(KIND=JPRB) :: ZAEN, ZAEO, ZALBV, ZCARDI, ZEPS0, ZEPSNEB, ZEPSO3 +REAL(KIND=JPRB) :: ZALBPMER + +! 2-D ARRAYS + +! ZNEBC : NEBULOSITE CONVECTIVE A L'ECHELLE DE LA MAILLE. +! ZQLIC : EAU LIQUIDE CONVECTIVE A L'ECHELLE DE LA MAILLE. +! ZQCL : CONDENSAT STRATIFORME LIQUIDE +! ZQCI : CONDENSAT STRATIFORME SOLIDE +! ZFHEVPPC : FLUX DE CHALEUR DU A L'EVAPORATION DES PREC. CONVECTIVES. +! ZFHMLTSC : FLUX DE CHALEUR DU A LA FONTE/GEL DES PREC. CONVECTIVES. +! ZFPEVPPC : EVAPORATION DES PREC. CONVECTIVES. +! ICIS : INDICE DE NIVEAU D'INSTABILITE SECHE. + +REAL(KIND=JPRB) :: ZNEBC(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZQLIC(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZQCL(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZQCI(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZFHEVPPC(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZFHMLTSC(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG)& + & ,ZFPEVPPC(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +INTEGER(KIND=JPIM) :: ICIS(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) + + +! SURFEX local VARIABLES +! ---------------------------- + +! Implicit coupling coefficients +INTEGER(KIND=JPIM) :: IRR +REAL(KIND=JPRB) :: ZDTMSE,ZRHGMT,ZSTATI,ZADTMS +REAL(KIND=JPRB) :: ZCFAQ(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZCFAS(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),& + & ZCFATH(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZCFAU(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZCFBQ(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),& + & ZCFBS(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZCFBTH(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),& + & ZCFBU(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZCFBV(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),& + & ZCFBU_G(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZCFBV_G(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),& + & ZCFBS_G(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZCFBQ_G(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) + +REAL(KIND=JPRB) :: ZDSE(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZFEV(YDCPG_OPTS%KLON),ZFMDU(YDCPG_OPTS%KLON),ZFMDV(YDCPG_OPTS%KLON),ZFEVS(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZSRAIN(YDCPG_OPTS%KLON), ZSSNOW(YDCPG_OPTS%KLON), ZSGROUPEL(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZSFCO2(YDCPG_OPTS%KLON), ZRHODREFM(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZDEPTH_HEIGHT(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG), ZZS(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZTSN(YDCPG_OPTS%KLON),ZTN(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZBUDTH (YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZBUDSO (YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZFCLL (YDCPG_OPTS%KLON) +! FOR Hv +REAL(KIND=JPRB) :: ZHV2(YDCPG_OPTS%KLON) +! FOR DUST +REAL(KIND=JPRB), DIMENSION (YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) :: ZQDM +REAL(KIND=JPRB) :: ZCFASV(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,1:YDMODEL%YRML_GCONF%YGFL%NGFL_EXT) ! SCOND MEMBRE POUR LES SCALAIRES PASSIFS +REAL(KIND=JPRB) :: ZCFBSV(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,1:YDMODEL%YRML_GCONF%YGFL%NGFL_EXT) ! SCOND MEMBRE POUR LES SCALAIRES PASSIFS +REAL(KIND=JPRB) :: ZSMOOTRAC(1:YDMODEL%YRML_GCONF%YGFL%NGFL_EXT) ! SCOND MEMBRE POUR LES SCALAIRES PASSIFS +REAL(KIND=JPRB) :: ZINVDT, ZINVG, ZRSCP, ZINVATM + +REAL(KIND=JPRB), DIMENSION(YDCPG_OPTS%KLON,1,YDCPG_OPTS%KFLEVG,YDMODEL%YRML_GCONF%YGFL%NGFL_EXT):: ZZI_SVM +REAL(KIND=JPRB), DIMENSION (YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,YDMODEL%YRML_GCONF%YGFL%NGFL_EZDIAG):: ZZI_PEZDIAG +REAL(KIND=JPRB), DIMENSION (:,:,:), ALLOCATABLE :: ZSVM, ZPSV +REAL(KIND=JPRB), DIMENSION (:,:), ALLOCATABLE :: ZSFSV ! passifs scalaires surf flux +! TRAITEMENT DES SCALAIRES PASSIFS +REAL(KIND=JPRB) :: ZTM(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB), DIMENSION (YDCPG_OPTS%KLON,1,YDCPG_OPTS%KFLEVG) :: ZZZ,ZDZZ,ZZI_PABSM, ZZI_THM,& + & ZZI_EXNREFM, ZZI_RHODREFM,ZEVAP,ZZDEP,ZZI_RHO +REAL(KIND=JPRB) :: ZZI_APHI(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB), DIMENSION (YDCPG_OPTS%KLON,1,YDCPG_OPTS%KFLEVG,6) :: ZZI_RM +! 3-D ARRAYS +REAL(KIND=JPRB), DIMENSION(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,YDCPG_OPTS%KSW):: ZPIZA_DST !Single scattering + ! albedo of dust (points,lev,wvl) +REAL(KIND=JPRB), DIMENSION(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,YDCPG_OPTS%KSW):: ZCGA_DST !Assymetry factor + ! for dust (points,lev,wvl) +REAL(KIND=JPRB), DIMENSION(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,YDCPG_OPTS%KSW):: ZTAUREL_DST !tau/tau_{550} + !dust (points,lev,wvl) + +! ACFLUSO (ECUME) local variable +!------------------------------------------- +REAL(KIND=JPRB) :: ZCE(YDCPG_OPTS%KLON), ZCEROV(YDCPG_OPTS%KLON), ZCRTI(YDCPG_OPTS%KLON) + + +! New ACDIFV1 local variable +!-------------------------------------------- +REAL(KIND=JPRB) :: ZXURO(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZXQRO(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZXTRO(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) + +! New ACNORGWD local variables +!-------------------------------------------- +REAL(KIND=JPRB) :: ZD_U(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG), ZD_V(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: Z_PP(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: Z_UU(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: Z_VV(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: Z_TT(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: Z_VO(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZFLX_LOTT_GWU(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG), ZFLX_LOTT_GWV(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZPRECGWD(YDCPG_OPTS%KLON) + +! TKE+ for ACCLDIA +REAL(KIND=JPRB) :: ZTKE1(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZTPRDY(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) + +! For ACVISIH +REAL(KIND=JPRB) :: ZQGM(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) + + +! New ARP_GROUND_PARAM local variable +!------------------------------------------------ + +REAL(KIND=JPRB) :: ZALPHA1(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZCOEFA (YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZLVT (YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZQICE (YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZDIFWQ (YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZDIFWS (YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZSC_FEVI (YDCPG_OPTS%KLON),ZSC_FEVN(YDCPG_OPTS%KLON),ZSC_FCLL(YDCPG_OPTS%KLON),ZSC_FCLN(YDCPG_OPTS%KLON) + +! TRAJECTORY (For diffusion !) local VARIABLES +! ---------------------------- +REAL(KIND=JPRB) :: ZCDROV_SAVE(YDCPG_OPTS%KLON),ZCHROV_SAVE(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZKTROV_SAVE(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZKUROV_SAVE(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZTRAJGWD(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) !Traj buffer saved for TL/AD (YDMODEL%YRML_PHY_MF%YRSIMPHL%LGWDSPNL) + +REAL(KIND=JPRB) :: ZRVMD,ZDELTA +LOGICAL :: LLAERO, LLAROME, LLCALLRAD +REAL(KIND=JPRB) :: ZAIPCMT(YDCPG_OPTS%KLON) ! Activity Index of PCMT: 1. if PCMT is active, 0. else case. +REAL(KIND=JPRB) :: ZALF_CAPE(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZALF_CVGQ(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZQIC(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZQLC(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZQRC(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZQSC(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZQVI +REAL(KIND=JPRB) :: ZQLI_CVP(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZQC_DET_PCMT(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZFPLS(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZFPLC(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZFPL(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZCSGC(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZTZER +CHARACTER(LEN=200) :: CLERR + +! Tracers: prognostique aerosols, passive scalars... +INTEGER(KIND=JPIM) :: INBTRA +INTEGER(KIND=JPIM) :: INBTRA_DEP +REAL(KIND=JPRB), ALLOCATABLE :: ZSTRCTRA(:,:,:) +REAL(KIND=JPRB), ALLOCATABLE :: ZTRA(:,:,:) + +! New chemistry local variables +!------------------------------------- +INTEGER(KIND=JPIM) :: IFLDX, IFLDX2, ILEVX +INTEGER(KIND=JPIM), ALLOCATABLE :: INDCHEM(:), IGPLAT(:) +REAL(KIND=JPRB), ALLOCATABLE :: ZSD_XA(:,:,:), ZSD_X2(:,:), ZTENGFL(:,:,:) +REAL(KIND=JPRB), ALLOCATABLE :: ZCFLX(:,:), ZCFLXO(:,:), ZCHEMDV(:,:), ZAEROP(:,:,:) +REAL(KIND=JPRB), ALLOCATABLE :: ZTENC(:,:,:), ZDELP(:,:), ZWND(:), ZDUMMY1(:,:), ZGELAT(:) +REAL(KIND=JPRB), ALLOCATABLE :: ZNEEFLX(:), ZCHEM2AER(:,:,:) +REAL(KIND=JPRB) :: ZDCAPE(YDCPG_OPTS%KLON) ! Descending CAPE for gusts. + +! ACRANEB/ACRANEB2 local variables +! -------------------------------- +REAL(KIND=JPRB) :: ZLAMB ! proportion of Lambertian scattering +REAL(KIND=JPRB) :: ZALBDIR (YDCPG_OPTS%KLON) ! direct (parallel) surface albedo +REAL(KIND=JPRB) :: ZCLCT_RAD(YDCPG_OPTS%KLON) ! total cloud cover for radiation +REAL(KIND=JPRB) :: ZDECRD (YDCPG_OPTS%KLON) ! decorrelation depth for cloud overlaps +REAL(KIND=JPRB) :: ZDECRD_MF(YDCPG_OPTS%KLON) ! decorrelation depth for cloud overlaps + ! in microphysics + +REAL(KIND=JPRB) :: ZDQG + +! IFS deep convection scheme local variables +! -------------------------------- +INTEGER(KIND=JPIM) :: ITOPC(YDCPG_OPTS%KLON),IBASC(YDCPG_OPTS%KLON),ITYPE(YDCPG_OPTS%KLON),ISPPN2D +INTEGER(KIND=JPIM) :: ICBOT(YDCPG_OPTS%KLON),ICTOP(YDCPG_OPTS%KLON),IBOTSC(YDCPG_OPTS%KLON) +LOGICAL :: LLDSLPHY,LLPTQ,LLLAND(YDCPG_OPTS%KLON),LLCUM(YDCPG_OPTS%KLON),LLSC(YDCPG_OPTS%KLON),LLSHCV(YDCPG_OPTS%KLON),LLLINOX(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZLIGH_CTG(YDCPG_OPTS%KLON),ZCTOPH(YDCPG_OPTS%KLON),ZPRECMX(YDCPG_OPTS%KLON),ZICE(YDCPG_OPTS%KLON),ZCDEPTH(YDCPG_OPTS%KLON),ZWMFU(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZVERVEL(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG), ZGEOM1(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG), ZGEOMH(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZTENQ(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZTENU(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZTENV(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZLCRIT_AER(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZSNDE(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,2) +REAL(KIND=JPRB) :: ZCUCONVCA(YDCPG_OPTS%KLON),ZGAW(YDCPG_OPTS%KLON),ZVDIFTS,ZDXTDK(YDCPG_OPTS%KLON) +REAL(KIND=JPRB) :: ZLU(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZLUDE(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZMFU(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZLISUM(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZMFD(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZWMEAN(YDCPG_OPTS%KLON),ZACPR(YDCPG_OPTS%KLON),ZDIFF(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZMFUDE_RATE(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZMFDDE_RATE(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZFHPCL(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZFHPCN(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZFCQLF(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZFCQLI(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZFRSO(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG),ZFRTH(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) +REAL(KIND=JPRB) :: ZGP2DSPPA(YDCPG_OPTS%KLON,1),ZLUDELI(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,4),ZLRAIN(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG),ZRSUD(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,2) +REAL(KIND=JPRB), ALLOCATABLE :: ZCEN(:,:,:),ZSCAV(:) + +! Precipitation type diagnostics +!-------------------------------- +REAL(KIND=JPRB) :: ZFPLSG(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG) + +REAL(KIND=JPRB) :: ZENTCH(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG) + +INTEGER (KIND=JPIM) :: IMOC_CLPH (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZADJ_DTAJU (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZADJ_TAUX (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZBAY_QRCONV (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZBAY_QSCONV (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZDSA_C1 (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZDSA_C2 (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZDSA_CPS (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZDSA_LHS (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZDSA_RS (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZFLU_CDN (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZFLU_CD (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZFLU_CH (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZFLU_EMIS (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZFLU_FEVI (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KTSSG+1) +REAL (KIND=JPRB) :: ZFLU_NEIJ (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZFLU_QS1 (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZFLU_QSATS (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZFLU_QSAT (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZFLU_VEG (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZKUR_KTROV_H (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZKUR_KUROV_H (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZMSC_FHP (YDCPG_OPTS%KLON, 0:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZMSC_FRMQ (YDCPG_OPTS%KLON, 0:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZMSC_LH (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZMSC_LSCPE (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZMSC_QW (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZMSC_TW (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZPFL_FEFB1 (YDCPG_OPTS%KLON, 0:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZPFL_FEFB2 (YDCPG_OPTS%KLON, 0:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZPFL_FEFB3 (YDCPG_OPTS%KLON, 0:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZPFL_FPLCH (YDCPG_OPTS%KLON, 0:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZPFL_FPLSH (YDCPG_OPTS%KLON, 0:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZPFL_FPLSN (YDCPG_OPTS%KLON, 0:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZPFL_FP (YDCPG_OPTS%KLON, 0:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZPFL_FTKEI (YDCPG_OPTS%KLON, 0:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZPFL_FTKE (YDCPG_OPTS%KLON, 0:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZRDT_COR (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZRDT_RAB3C (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZRDT_RAB3N (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZRDT_RAB4C (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZRDT_RAB4N (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZRDT_RAB6C (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZRDT_RAB6N (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZRDT_RAT1C (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZRDT_RAT1N (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZRDT_RAT2C (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZRDT_RAT2N (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZRDT_RAT3C (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZRDT_RAT3N (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZRDT_RAT4C (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZRDT_RAT4N (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZRDT_RAT5C (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZRDT_RAT5N (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZTDS_TDALBNS (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZTDS_TDRHONS (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZTDS_TDSNS (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZTDS_TDTP (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%YRSURF_DIMS%YSP_SBD%NLEVS) +REAL (KIND=JPRB) :: ZTDS_TDTS (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZTDS_TDWL (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZTDS_TDWPI (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZTDS_TDWP (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZTDS_TDWSI (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZTDS_TDWS (YDCPG_OPTS%KLON) + +REAL (KIND=JPRB) :: ZPRC_DPRECIPS2 (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%NDTPREC2) +REAL (KIND=JPRB) :: ZPRC_DPRECIPS (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%NDTPREC) +REAL (KIND=JPRB) :: ZRDG_CVGQ (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZRDG_LCVQ (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZRDG_MMU0 (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZRDG_MU0LU (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZRDG_MU0M (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZRDG_MU0N (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZRDG_MU0 (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZSAV_DDAL (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZSAV_DDOM (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZSAV_ENTCH (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZSAV_FHPS (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZSAV_GZ0F (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZSAV_GZ0HF (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZSAV_HV (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZSAV_PBLH (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZSAV_QSH (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZSAV_UDAL (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZSAV_UDGRO (YDCPG_OPTS%KLON) +REAL (KIND=JPRB) :: ZSAV_UDOM (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) +REAL (KIND=JPRB) :: ZSAV_UNEBH (YDCPG_OPTS%KLON, 1:YDCPG_OPTS%KFLEVG) + +REAL(KIND=JPRB) :: ZHOOK_HANDLE, ZHOOK_HANDLE_1 + +! ------------------------------------------------------------------ + +#include "abor1.intfb.h" +#include "acaa1.intfb.h" +#include "acajucv.intfb.h" +#include "accdev.intfb.h" +#include "accldia.intfb.h" +#include "acclph.intfb.h" +#include "accoefk.intfb.h" +#include "accsu.intfb.h" +#include "accvimpgy.intfb.h" +#include "accvimp.intfb.h" +#include "accvimp_v3.intfb.h" +#include "accvud.intfb.h" +#include "acdayd.intfb.h" +#include "acdifoz.intfb.h" +#include "acdifus.intfb.h" +#include "acdifv1.intfb.h" +#include "acdifv2.intfb.h" +#include "acdifv3.intfb.h" +#include "acdnshf.intfb.h" +#include "acdrac.intfb.h" +#include "acdrag.intfb.h" +#include "acdrme.intfb.h" +#include "acdrov.intfb.h" +#include "acevadcape.intfb.h" +#include "acfluso.intfb.h" +#include "achmt.intfb.h" +#include "achmtls.intfb.h" +#include "acmixelen.intfb.h" +#include "acmixlentm.intfb.h" +#include "acmixlenz.intfb.h" +#include "acmodo.intfb.h" +#include "acmrip.intfb.h" +#include "acmris.intfb.h" +#include "acmriss.intfb.h" +#include "acnebc.intfb.h" +#include "acnebcond.intfb.h" +#include "acnebn.intfb.h" +#include "acnebr.intfb.h" +#include "acnorgwd.intfb.h" +#include "acnpart.intfb.h" +#include "acnsdo.intfb.h" +#include "acozone.intfb.h" +#include "acpblh.intfb.h" +#include "acpblhtm.intfb.h" +#include "acpcmt.intfb.h" +#include "acpluie.intfb.h" +#include "acpluis.intfb.h" +#include "acpluiz.intfb.h" +#include "acptke.intfb.h" +#include "acradcoef.intfb.h" +#include "acraneb2.intfb.h" +#include "acraneb.intfb.h" +#include "acrso.intfb.h" +#include "acsol.intfb.h" +#include "actkecoefkh.intfb.h" +#include "actkecoefk.intfb.h" +#include "actkehmt.intfb.h" +#include "actke.intfb.h" +#include "actkezotls.intfb.h" +#include "actqsat.intfb.h" +#include "actqsats.intfb.h" +#include "acupd.intfb.h" +#include "acupm.intfb.h" +#include "acuptq.intfb.h" +#include "acupu.intfb.h" +#include "acveg.intfb.h" +#include "acvisih.intfb.h" +#include "acvppkf.intfb.h" +#include "aplmphys.intfb.h" +#include "aplpar2intflex.intfb.h" +#include "aplpar_init.intfb.h" +#include "aro_ground_diag_2isba.h" +#include "aro_ground_diag.h" +#include "aro_ground_diag_z0.h" +#include "aro_ground_param.h" +#include "aro_mnhdust.h" +#include "arp_ground_param.intfb.h" +#include "checkmv.intfb.h" +!include "chem_main.intfb.h" +#include "cpchet.intfb.h" +#include "cpmvvps.intfb.h" +#include "cpnudg.intfb.h" +#include "cpozo.intfb.h" +#include "cpphinp.intfb.h" +#include "cpqsol.intfb.h" +#include "cptend_flex.intfb.h" +#include "cptend_new.intfb.h" +#include "cptends.intfb.h" +#include "cputqy_aplpar_expl.intfb.h" +#include "cputqy_aplpar_loop.intfb.h" +#include "cpwts.intfb.h" +#include "cucalln_mf.intfb.h" +#include "culight.intfb.h" +#include "dprecips.intfb.h" +#include "mean_rad_temp.intfb.h" +#include "mf_phys_bayrad.intfb.h" +#include "mf_phys_corwat.intfb.h" +#include "mf_phys_cvv.intfb.h" +#include "mf_phys_fpl_part1.intfb.h" +#include "mf_phys_fpl_part2.intfb.h" +#include "mf_phys_mocon.intfb.h" +#include "mf_phys_precips.intfb.h" +#include "mf_phys_save_phsurf_part1.intfb.h" +#include "mf_phys_save_phsurf_part2.intfb.h" +#include "mf_phys_transfer.intfb.h" +#include "ppwetpoint.intfb.h" +#include "profilechet.intfb.h" +#include "qngcor.intfb.h" +#include "radaer.intfb.h" +#include "radheat.intfb.h" +#include "radozcmf.intfb.h" +#include "recmwf.intfb.h" +#include "suozon.intfb.h" +#include "surf_ideal_flux.intfb.h" +#include "writephysio.intfb.h" +#include "wrphtrajm.intfb.h" +#include "wrphtrajtm_nl.intfb.h" +#include "wrradcoef.intfb.h" +#include "wrscmr.intfb.h" +#include "aplpar_flexdia.intfb.h" +#include "checknan.intfb.h" +#include "aclight.intfb.h" +#include "diagflash.intfb.h" + +! ------------------------------------------------------------------ + +#include "fcttrm.func.h" + +! ------------------------------------------------------------------ +IF (LHOOK) CALL DR_HOOK('APLPAR',0,ZHOOK_HANDLE) +ASSOCIATE(YDDIM=>YDGEOMETRY%YRDIM, YDDIMV=>YDGEOMETRY%YRDIMV, YDVAB=>YDGEOMETRY%YRVAB, YDPHY=>YDMODEL%YRML_PHY_MF%YRPHY, & +& YDPTRSLB1=>YDMODEL%YRML_DYN%YRPTRSLB1, YDPTRSLB2=>YDMODEL%YRML_DYN%YRPTRSLB2, YDTOPH=>YDMODEL%YRML_PHY_MF%YRTOPH, & +& YDSIMPHL=>YDMODEL%YRML_PHY_MF%YRSIMPHL, YDRIP=>YDMODEL%YRML_GCONF%YRRIP, YDMDDH=>YDMODEL%YRML_DIAG%YRMDDH, & +& YDRCOEF=>YDMODEL%YRML_PHY_RAD%YRRCOEF, YDARPHY=>YDMODEL%YRML_PHY_MF%YRARPHY, YDDPHY=>YDMODEL%YRML_PHY_G%YRDPHY, & +& YDLDDH=>YDMODEL%YRML_DIAG%YRLDDH, YDPHY2=>YDMODEL%YRML_PHY_MF%YRPHY2, YGFL=>YDMODEL%YRML_GCONF%YGFL, & +& YDEPHY=> YDMODEL%YRML_PHY_EC%YREPHY, YDPARAR=>YDMODEL%YRML_PHY_MF%YRPARAR, YDPRECIPS=>YDMODEL%YRML_PHY_MF%YRPHY%YRDPRECIPS, & +& YDGEM=>YDGEOMETRY%YRGEM, YDSTA=>YDGEOMETRY%YRSTA, YDERDI=>YDMODEL%YRML_PHY_RAD%YRERDI, YDMCC=>YDMODEL%YRML_AOC%YRMCC, & +& YDERAD=>YDMODEL%YRML_PHY_RAD%YRERAD, YDPHY3=>YDMODEL%YRML_PHY_MF%YRPHY3, YDPHY1=>YDMODEL%YRML_PHY_MF%YRPHY1, & +& YDPHY0=>YDMODEL%YRML_PHY_MF%YRPHY0, YDNORGWD=>YDMODEL%YRML_PHY_MF%YRNORGWD, YDMSE=>YDMODEL%YRML_PHY_MF%YRMSE, & +& YDPHYDS=>YDMODEL%YRML_PHY_MF%YRPHYDS ) + + +ASSOCIATE(CMF_UPDRAFT=>YDPARAR%PHYEX%PARAM_MFSHALLN%CMF_UPDRAFT, TSPHY=>YDPHY2%TSPHY, NTSSG=>YDDPHY%NTSSG, LMDUST=>YDARPHY%LMDUST, & +& LMSE=>YDARPHY%LMSE, YI=>YGFL%YI, YEZDIAG=>YGFL%YEZDIAG, YL =>YGFL%YL, YEXT=>YGFL%YEXT, YG=>YGFL%YG, & +& YQ=>YGFL%YQ, YR=>YGFL%YR, YSCONV=>YGFL%YSCONV, YS=>YGFL%YS, YEFB3=>YGFL%YEFB3, YEFB2=>YGFL%YEFB2, YEFB1=>YGFL%YEFB1, & +& LCHEM_ARPCLIM=>YDMODEL%YRML_CHEM%YRCHEM%LCHEM_ARPCLIM, NGFL_EXT=>YGFL%NGFL_EXT, YTKE=>YGFL%YTKE, YLCONV=>YGFL%YLCONV, & +& YRCONV=>YGFL%YRCONV, YICONV=>YGFL%YICONV, YSP_SBD=>YDSURF%YSP_SBD, LTRAJPS=>YDSIMPHL%LTRAJPS, LNEBR=>YDPHY%LNEBR, & +& LNEBN=>YDPHY%LNEBN, LSTRAPRO=>YDPHY%LSTRAPRO, LPTKE=> YDPHY%LPTKE, NDPSFI=>YDPHY%NDPSFI, LOZONE=>YDPHY%LOZONE, & +& L3MT=>YDPHY%L3MT, LGPCMT=>YDPHY%LGPCMT, LAJUCV=>YDPHY%LAJUCV, LCVPGY=>YDPHY%LCVPGY, LRRGUST=>YDPHY%LRRGUST, & +& LEDR=>YDPHY%LEDR, NTAJUC=> YDTOPH%NTAJUC, NTPLUI=>YDTOPH%NTPLUI, LDPRECIPS=>YDPHY%LDPRECIPS, LDPRECIPS2=>YDPHY%LDPRECIPS2, & +& LRCOEF =>YDRCOEF%LRCOEF, NG3SR=>YDRCOEF%NG3SR, XMINLM=>YDPHY0%XMINLM, RTCAPE=>YDPHY0%RTCAPE, GRSO=>YDPHY0%GRSO, & +& GCVTSMO=>YDPHY0%GCVTSMO, XKLM=>YDPHY0%XKLM, GAEPS=>YDPHY0%GAEPS, AERCS1=>YDPHY0%AERCS1, AERCS3=>YDPHY0%AERCS3, & +& AERCS5=>YDPHY0%AERCS5, HUTIL2=>YDPHY0%HUTIL2, HUTIL1=>YDPHY0%HUTIL1, XMAXLM=>YDPHY0%XMAXLM, TEQK=>YDPHY0%TEQK, & +& HUCOE=>YDPHY0%HUCOE, LCVNHD=>YDPHY0%LCVNHD, TEQC=>YDPHY0%TEQC, UHDIFV=>YDPHY0%UHDIFV, HUTIL=>YDPHY0%HUTIL, & +& NPCLO1=>YDPHY0%NPCLO1, NPCLO2=>YDPHY0%NPCLO2, RDECRD=>YDPHY0%RDECRD, RDECRD1=>YDPHY0%RDECRD1, RDECRD2=>YDPHY0%RDECRD2, & +& RDECRD3=>YDPHY0%RDECRD3, RDECRD4=>YDPHY0%RDECRD4, ETKE_MIN=>YDPHY0%ETKE_MIN, HSOLIWR=>YDPHY1%HSOLIWR, & +& ALCRIN=>YDPHY1%ALCRIN, ALBMED=>YDPHY1%ALBMED, WSMX=>YDPHY1%WSMX, LALBMERCLIM=>YDPHY1%LALBMERCLIM, HSOLIT0=>YDPHY1%HSOLIT0, & +& HSOL=>YDPHY1%HSOL, WPMX=>YDPHY1%WPMX, EMCRIN=>YDPHY1%EMCRIN, EMMMER=>YDPHY1%EMMMER, TMERGL=>YDPHY1%TMERGL, & +& EMMGLA=>YDPHY1%EMMGLA, LRAFTKE=>YDPHY2%LRAFTKE, LRAFTUR=>YDPHY2%LRAFTUR, HVCLS=>YDPHY2%HVCLS, HTCLS=>YDPHY2%HTCLS, & +& FSM_HH=>YDPHY3%FSM_HH, FSM_GG=>YDPHY3%FSM_GG, FSM_FF=>YDPHY3%FSM_FF, FSM_EE=>YDPHY3%FSM_EE, FSM_II=>YDPHY3%FSM_II, & +& FSM_CC=>YDPHY3%FSM_CC, FSM_DD=>YDPHY3%FSM_DD, RLAMB_WATER=>YDPHY3%RLAMB_WATER, RII0=>YDPHY3%RII0, QCO2=>YDPHY3%QCO2, & +& RLAMB_SOLID=>YDPHY3%RLAMB_SOLID, NDLUNG=>YDDIM%NDLUNG, NDGUNG=>YDDIM%NDGUNG, NDLUXG=>YDDIM%NDLUXG, & +& NDGUXG=>YDDIM%NDGUXG, LRDEPOS=>YDARPHY%LRDEPOS, LMPA=>YDARPHY%LMPA, CCOUPLING=>YDARPHY%CCOUPLING, LSURFEX_KFROM=>YDARPHY%LSURFEX_KFROM, & +& YA=>YGFL%YA, NGFL_EZDIAG=>YGFL%NGFL_EZDIAG, YFQTUR=>YGFL%YFQTUR, YFSTUR=>YGFL%YFSTUR, YIRAD=>YGFL%YIRAD, & +& YLRAD=>YGFL%YLRAD, XZSEPS=>YDMSE%XZSEPS, LVDIFSPNL=>YDSIMPHL%LVDIFSPNL, LGWDSPNL=>YDSIMPHL%LGWDSPNL, & +& LRAYSP=>YDSIMPHL%LRAYSP, LSTRA=>YDPHY%LSTRA, LAEROSOO=>YDPHY%LAEROSOO, LCDDPRO=>YDPHY%LCDDPRO, LRKCDEV=>YDPHY%LRKCDEV, & +& LHUCN=>YDPHY%LHUCN, LCOEFK_TOMS=>YDPHY%LCOEFK_TOMS, LVDIF=>YDPHY%LVDIF, LRRMES=>YDPHY%LRRMES, LCVRA=>YDPHY%LCVRA, & +& LCVTDK=>YDPHY%LCVTDK, LCOEFK_RIS=>YDPHY%LCOEFK_RIS, LAEROLAN=>YDPHY%LAEROLAN, LNEBECT=>YDPHY%LNEBECT, & +& LAERODES=>YDPHY%LAERODES, LNEWSTAT=>YDPHY%LNEWSTAT, LTHERMO=>YDPHY%LTHERMO, LO3FL=>YDPHY%LO3FL, LPHSPSH=>YDPHY%LPHSPSH, & +& LSNV=>YDPHY%LSNV, LECSHAL=>YDPHY%LECSHAL, LECT=>YDPHY%LECT, LDIFCONS=>YDPHY%LDIFCONS, LNODIFQC=>YDPHY%LNODIFQC, & +& LAEROVOL=>YDPHY%LAEROVOL, LRSTAER=>YDPHY%LRSTAER, NCALLRAD=>YDPHY%NCALLRAD, LNCVPGY=>YDPHY%LNCVPGY, & +& LRAYLU=>YDPHY%LRAYLU, LAEROSUL=>YDPHY%LAEROSUL, LO3ABC=>YDPHY%LO3ABC, LSTRAS=>YDPHY%LSTRAS, LCOEFK_PTTE=>YDPHY%LCOEFK_PTTE, & +& LSFHYD=>YDPHY%LSFHYD, LAEROSEA=>YDPHY%LAEROSEA, NDIFFNEB=>YDPHY%NDIFFNEB, LEDKF=>YDPHY%LEDKF, LRCVOTT=>YDPHY%LRCVOTT, & +& LMPHYS=>YDPHY%LMPHYS, LZ0HSREL=>YDPHY%LZ0HSREL, LCAMOD=>YDPHY%LCAMOD, LCOMOD=>YDPHY%LCOMOD, LCONDWT=>YDPHY%LCONDWT, & +& LCVCSD=>YDPHY%LCVCSD, LNSDO=>YDPHY%LNSDO, LUDEVOL=>YDPHY%LUDEVOL, LRAY=>YDPHY%LRAY, LGWD=>YDPHY%LGWD, & +& LCOEFKTKE=>YDPHY%LCOEFKTKE, LRAYFM=>YDPHY%LRAYFM, LECDEEP=>YDPHY%LECDEEP, LCVGQD=>YDPHY%LCVGQD, LGWDC=>YDPHY%LGWDC, & +& LNORGWD=>YDPHY%LNORGWD, LFLUSO=>YDPHY%LFLUSO, LNEBCO=>YDPHY%LNEBCO, LNEBCV=>YDPHY%LNEBCV, LSOLV=>YDPHY%LSOLV, & +& LCOEFKSURF=>YDPHY%LCOEFKSURF, LRNUEXP=>YDPHY%LRNUEXP, NRAY=>YDPHY%NRAY, LDAYD=>YDPHY%LDAYD, LEDMFI=>YDPHY%LEDMFI, & +& LFPCOR=>YDPHY%LFPCOR, LRPROX=>YDPHY%LRPROX, LPROCLD=>YDPHY%LPROCLD, LACDIFUS=>YDPHY%LACDIFUS, LCAPE=>YDPHY%LCAPE, & +& LCVRAV3=>YDPHY%LCVRAV3, LHMTO=>YDPHY%LHMTO, LVGSN=>YDPHY%LVGSN, LCVPPKF=>YDPHY%LCVPPKF, LCVPRO=>YDPHY%LCVPRO, & +& LADJCLD=>YDPHY%LADJCLD, LGRAPRO=>YDPHY%LGRAPRO, RDECLI=>YDRIP%RDECLI, CMF_CLOUD=>YDPARAR%PHYEX%PARAM_MFSHALLN%CMF_CLOUD, & +& XSW_BANDS=>YDPARAR%XSW_BANDS, NSWB_MNH=>YDPARAR%NSWB_MNH, LMIXUV=>YDPARAR%PHYEX%PARAM_MFSHALLN%LMIXUV, NTRADI=>YDTOPH%NTRADI, & +& NTNEBU=>YDTOPH%NTNEBU, NTDIFU=>YDTOPH%NTDIFU, NTOZON=>YDTOPH%NTOZON, NTDRME=>YDTOPH%NTDRME, NTCVIM=>YDTOPH%NTCVIM, & +& NTCOET=>YDTOPH%NTCOET, NTDRAG=>YDTOPH%NTDRAG, RMESOQ=>YDTOPH%RMESOQ, RMESOT=>YDTOPH%RMESOT, RMESOU=>YDTOPH%RMESOU, & +& NTQSAT=>YDTOPH%NTQSAT, NTCOEF=>YDTOPH%NTCOEF, NAER=>YDERAD%NAER, NOZOCL=>YDERAD%NOZOCL, NRADFR=>YDERAD%NRADFR, & +& NAERMACC=>YDERAD%NAERMACC, & +& NSW=>YDERAD%NSW, RCARDI=>YDERDI%RCARDI, RSUNDUR=>YDERDI%RSUNDUR, LXVISI=>YDXFU%LXVISI, LXVISI2=>YDXFU%LXVISI2, & +& LMCC03=>YDMCC%LMCC03, NSTOP=>YDRIP%NSTOP, RCODEC=>YDRIP%RCODEC, RHGMT=>YDRIP%RHGMT, RSIDEC=>YDRIP%RSIDEC, & +& RSOVR=>YDRIP%RSOVR, RSTATI=>YDRIP%RSTATI, TSTEP=>YDRIP%TSTEP, NDTPREC=>YDPHY%YRDPRECIPS%NDTPREC, NDTPREC2=>YDPHY%YRDPRECIPS%NDTPREC2, & +& STPRE=>YDSTA%STPRE, STPREH=>YDSTA%STPREH, STTEM=>YDSTA%STTEM, NORGWD_NNOVERDIF=>YDNORGWD%NORGWD_NNOVERDIF, & +& LGCHECKMV=>YDPHY%LGCHECKMV, NAERO=>YGFL%NAERO, NCHEM=>YDMODEL%YRML_GCONF%YGFL%NCHEM, NACTAERO=>YGFL%NACTAERO, & + & RG=>YDCST%RG, RSIGMA=>YDCST%RSIGMA, RCPV=>YDCST%RCPV, RETV=>YDCST%RETV, & + & RCW=>YDCST%RCW, RCS=>YDCST%RCS, RLVTT=>YDCST%RLVTT, RLSTT=>YDCST%RLSTT, & + & RTT=>YDCST%RTT, RALPW=>YDCST%RALPW, RBETW=>YDCST%RBETW, RGAMW=>YDCST%RGAMW, & + & RALPS=>YDCST%RALPS, RBETS=>YDCST%RBETS, RGAMS=>YDCST%RGAMS, RALPD=>YDCST%RALPD, & + & RBETD=>YDCST%RBETD, RGAMD=>YDCST%RGAMD, RCPD=>YDCST%RCPD, RATM=>YDCST%RATM, & + & RKAPPA=>YDCST%RKAPPA, RV=>YDCST%RV, RD=>YDCST%RD, & +& LXMRT=>YDXFU%LXMRT, RDELXN=>YDGEM%RDELXN, LFLASH =>YDCFU%LFLASH, CGMIXLEN=>YDMODEL%YRML_PHY_MF%YRPHY%CGMIXLEN ) + +CALL SC2PRG(YEFB1%MP1, ZTENDGFL, ZPTENDEFB11) +CALL SC2PRG(YEFB2%MP1, ZTENDGFL, ZPTENDEFB21) +CALL SC2PRG(YEFB3%MP1, ZTENDGFL, ZPTENDEFB31) +CALL SC2PRG(YG%MP1, ZTENDGFL, ZPTENDG1) +CALL SC2PRG(YICONV%MP1, ZTENDGFL, ZPTENDICONV1) +CALL SC2PRG(YI%MP1, ZTENDGFL, ZPTENDI1) +CALL SC2PRG(YLCONV%MP1, ZTENDGFL, ZPTENDLCONV1) +CALL SC2PRG(YL%MP1, ZTENDGFL, ZPTENDL1) +CALL SC2PRG(YQ%MP1, ZTENDGFL, ZPTENDQ1) +CALL SC2PRG(YRCONV%MP1, ZTENDGFL, ZPTENDRCONV1) +CALL SC2PRG(YR%MP1, ZTENDGFL, ZPTENDR1) +CALL SC2PRG(YSCONV%MP1, ZTENDGFL, ZPTENDSCONV1) +CALL SC2PRG(YS%MP1, ZTENDGFL, ZPTENDS1) +CALL SC2PRG(YTKE%MP1, ZTENDGFL, ZPTENDTKE1) + +CALL SC2PRG(1, YEZDIAG(:)%MP, YDMODEL%YRML_GCONF%YGFL%NGFL_EZDIAG, PGFL, ZP1EZDIAG) + +! ------------------------------------------------------------------ + +! 0. constructor for procset +IF (LINTFLEX) YLPROCSET=NEWINTPROCSET() + +! 1. Preliminary calculations necessary +! for all types of physics. +! ------------------------------------ + + +INSTEP_DEB=1 +INSTEP_FIN=1 + +! SPP +IF ( YSPP_CONFIG%LSPP ) THEN + DO JSPP=1,YSPP%N2D + ZGP2DSPP(:,JSPP) = YSPP%GP_ARP(JSPP)%GP2D(:,1,YDCPG_BNDS%KBL) + ENDDO +ENDIF + +CALL CPPHINP(YDCPG_OPTS%LVERTFE, YDGEOMETRY, YDMODEL, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDVARS%GEOMETRY%GEMU%T0, YDVARS%GEOMETRY%GELAM%T0, & +& YDVARS%U%T0, YDVARS%V%T0, YDVARS%Q%T0, YDVARS%Q%DL, YDVARS%Q%DM, YDVARS%CVGQ%DL, YDVARS%CVGQ%DM, YDCPG_PHY0%XYB%RDELP, & +& YDCPG_DYN0%CTY%EVEL, YDVARS%CVGQ%T0, ZRDG_MU0, ZRDG_MU0LU, ZRDG_MU0M, ZRDG_MU0N, ZRDG_CVGQ) +ZRDG_LCVQ(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,1:YDCPG_OPTS%KFLEVG)=ZRDG_CVGQ(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,1:YDCPG_OPTS%KFLEVG) + +DO JROF=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZFLU_QSATS(JROF)=0.0_JPRB +ENDDO + +CALL MF_PHYS_FPL_PART1 (YDCPG_BNDS, YDCPG_OPTS, ZPFL_FPLCH, ZPFL_FPLSH, YDVARS%CPF%T0, YDVARS%SPF%T0, & +& YDMODEL) + + +! * In some cases, some pseudo-historic surface buffers (like z0) should +! not be modified between the entrance and the output of APLPAR +! (this is the case for example if LDCONFX=T). +! For the time being, we must save: +! - HV (group VV) : resistance to evapotranspiration +! - Z0F (group VD): gravity * surface roughness length +! - Z0H (group VV): gravity * roughness length for heat +! - PBLH (group VH): PBL height +! - SPSH (group VH): +! - QSH (group VH): + +LL_SAVE_PHSURF=YDCPG_OPTS%LCONFX +IF (LL_SAVE_PHSURF) THEN + CALL MF_PHYS_SAVE_PHSURF_PART1 (YDCPG_BNDS, YDCPG_OPTS, ZSAV_DDAL, ZSAV_DDOM, ZSAV_ENTCH, & + & ZSAV_FHPS, ZSAV_GZ0F, ZSAV_GZ0HF, ZSAV_HV, ZSAV_PBLH, ZSAV_QSH, ZSAV_UDAL, ZSAV_UDGRO, ZSAV_UDOM, & + & ZSAV_UNEBH, YDMF_PHYS_SURF%GSD_VF%PZ0F, YDMF_PHYS_SURF%GSD_VH%PPBLH, YDMF_PHYS_SURF%GSD_VH%PQSH, & + & YDMF_PHYS_SURF%GSD_VH%PSPSH, YDMF_PHYS_SURF%GSD_VK%PUDGRO, YDMF_PHYS_SURF%GSD_VV%PHV, YDMF_PHYS_SURF%GSD_VV%PZ0H, & + & YDVARS%DAL%T0, YDVARS%DOM%T0, YDVARS%UAL%T0, YDVARS%UEN%T0, YDVARS%UNEBH%T0, YDVARS%UOM%T0, & + & YDMODEL) +ENDIF + + +IF (LMDUST) THEN + ZDIFEXT (:,:,:) = 0.0_JPRB +ENDIF + +CALL APLPAR_INIT (YDCPG_OPTS%LAROME, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, NTSSG, & +& YSP_SBD%NLEVS, YDMF_PHYS_SURF%GSD_VF%PVEG, ZMSC_FRMQ, ZDSA_CPS, ZDSA_LHS, ZDSA_RS, ZMSC_LH, ZMSC_LSCPE, ZFLU_QSAT,& +& ZMSC_QW, ZMSC_TW, ZFLU_CD, ZFLU_CDN, ZFLU_CH, ZDSA_C1, ZDSA_C2, ZFLU_EMIS, ZFLU_FEVI, ZPFL_FTKE, & +& ZPFL_FTKEI, ZPFL_FEFB1, ZPFL_FEFB2, ZPFL_FEFB3, ZFLU_NEIJ, ZFLU_VEG, ZFLU_QSATS, IMOC_CLPH) + +!* 2. Complete physics. +! ----------------- + +! 2.2 Complete physics. +! ----------------- + +! PAS DE TEMPS DE LA PHYSIQUE (/YOMPHY2/) +! Dans le cas des iterations de l'initialisation par modes normaux, +! le pas de temps pour la physique ne peux pas etre nul pour APLPAR et +! CPATY (par contre c'est bien PDTPHY qui est passe en argument aux autres +! sous-prog. de la physique). Ceci est du a l'impossibilite de prendre en +! compte des flux qui deviennent infinis pour TSPHY=0 (flux de masse du au +! reajustement des sursaturations par exemple...). Mais les tendances phys. +! sont bien nulles dans le cas de la configuration 'E' (Modes Normaux). +! PHYSICS TIME STEP (/YOMPHY2/) +! In case of normal mode initialisation iterations, the physics time +! step cannot be zero for APLPAR and CPATY (nevertheless it is PDTPHY +! which is passed to other physics subroutines). This is due to the +! impossibility to take into account fluxes which are infinite for TSPHY=0 +! (e.g.: mass flux due to oversaturation...). + +! CALL PARAMETERISATIONS + +DO JROF=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS_SURF%GSD_VF%PLSM(JROF)=REAL(NINT(YDMF_PHYS_SURF%GSD_VF%PLSM(JROF)),JPRB) +ENDDO + +IF (LTWOTL) THEN + IF (LAJUCV) THEN + DO JLEV=1,YDCPG_OPTS%KFLEVG + DO JROF=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZADJ_TAUX(JROF,JLEV)=YDVARS%T%T0(JROF,JLEV) + ENDDO + ENDDO + CALL ACAJUCV(YDMODEL%YRML_PHY_MF%YRPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & NTPLUI, YDCPG_OPTS%KFLEVG, NTAJUC, YDCPG_PHY0%PREHYD, YDCPG_PHY0%XYB%ALPH, YDCPG_PHY0%XYB%DELP, & + & YDCPG_PHY0%XYB%LNPR, YDVARS%T%T0) + DO JLEV=1,YDCPG_OPTS%KFLEVG + DO JROF=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZADJ_DTAJU(JROF,JLEV)=YDVARS%T%T0(JROF,JLEV)-ZADJ_TAUX(JROF,JLEV) + ENDDO + ENDDO + ENDIF +ELSE + ! IF (LAJUCV) THEN + ! missing code under LAJUCV for leap-frog schemes. + ! ENDIF +ENDIF + + +! +!------------------------------------------------- +! Check magnitude of model variables. +!------------------------------------------------- +! +IF(LGCHECKMV) CALL CHECKMV(YDCPG_OPTS%NINDAT, YDCST, YDRIP, YDPHY0, YDPHY2, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & YDCPG_OPTS%KFLEVG, YDCPG_OPTS%KSTEP, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDVARS%GEOMETRY%GELAM%T0, & + & YDVARS%GEOMETRY%GEMU%T0, ZRDG_MU0, YDMF_PHYS_SURF%GSD_VF%PLSM, YDMF_PHYS_BASE_STATE%T, & + & YDMF_PHYS_BASE_STATE%Q, YDMF_PHYS_BASE_STATE%YGSP_RR%T ) +! ------------------------------------------------------------------ + +LLREDPR=LCVCSD +ZRVMD=RV-RD +! SURFEX and passive scalar +IF (YDCPG_OPTS%LCONFX) THEN + ZDTMSE=0.01_JPRB + ZSTATI=RSTATI-ZDTMSE*.5_JPRB + ZADTMS=0._JPRB +ELSE + ZDTMSE=TSPHY + ZSTATI=RSTATI + ZADTMS=ZDTMSE +ENDIF +ZRHGMT=REAL(RHGMT,JPRB) +ZAIPCMT(:)=0._JPRB + +ALLOCATE(ZSVM (YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,NGFL_EXT)) +ALLOCATE(ZSFSV (YDCPG_OPTS%KLON,NGFL_EXT)) +ALLOCATE(ZPSV (YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,NGFL_EXT)) + +! ------------------------------------------------------------------ +! 1.- INITIALISATIONS COMPLEMENTAIRES +! ----------------------------------- +IJN = YDCPG_OPTS%KLON + +! CALCUL FIN DE IJN +! IJN = 1 +! ZMU0 = MAX(0.,-SIGN(1.,-PMU0(KIDIA))) +! DO 1 JLON = KIDIA+1, KFDIA +! ZMUN = MAX(0.,-SIGN(1.,-PMU0(JLON))) +! IJN = IJN + IABS(NINT(ZMUN)-NINT(ZMU0)) +! ZMU0 = ZMUN +! 1 CONTINUE + +!* 1.0 DECORRELATION DEPTH FOR CLOUD OVERLAPS +IF ( RDECRD <= 0._JPRB .OR. LRNUEXP ) THEN + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZDECRD(JLON)=RDECRD1+RDECRD2* & + & EXP(-((ASIN(YDVARS%GEOMETRY%GEMU%T0(JLON))-RDECRD3*RDECLI)/RDECRD4)**2) + ENDDO +ENDIF +IF ( RDECRD <= 0._JPRB ) THEN + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZDECRD_MF(JLON)=ZDECRD(JLON) + ENDDO +ELSE + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZDECRD_MF(JLON)=RDECRD + ENDDO +ENDIF + +!* 1.1 INITIALISATION DE L'OZONE + +IF (LMPHYS) THEN + IF (LOZONE) THEN + + ! L'ozone est initialise par PO3 (ozone GFL). + ! Ozone is computed from PO3 (GFL ozone). + + ZEPSO3=1.E-11_JPRB + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZQO3(JLON,0)=1.E-9_JPRB + ENDDO + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZQO3(JLON,JLEV) = MAX(ZEPSO3,YDMF_PHYS_BASE_STATE%O3(JLON,JLEV)) + ENDDO + ENDDO + + ELSEIF(YDMODEL%YRML_PHY_G%YRDPHY%NVCLIS == 1) THEN + ZEPSO3=1.E-11_JPRB + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZQO3(JLON,0)=1.E-9_JPRB + ENDDO + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZQO3(JLON,JLEV) = YDCPG_MISC%KOZO(JLON,JLEV,1) + ENDDO + ENDDO + + ELSEIF ((LO3FL).AND.(NOZOCL == 1).AND.(LRAYFM)) THEN + IF (MOD(YDCPG_OPTS%KSTEP,NRADFR) == 0) THEN + CALL RADOZCMF(YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, & + & YDVARS%GEOMETRY%GEMU%T0, ZROZ) + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZQO3(JLON,0)=1.E-9_JPRB + ENDDO + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZQO3(JLON,JLEV)=ZROZ(JLON,JLEV)*YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP(JLON,JLEV) + ENDDO + ENDDO + ENDIF + + ELSE + CALL SUOZON(YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, ZQO3, & + & .FALSE., YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, LO3ABC, & + & YDMF_PHYS_SURF%GSD_VC%PA, YDMF_PHYS_SURF%GSD_VC%PB, YDMF_PHYS_SURF%GSD_VC%PC) + ENDIF + +! GAZ CARBONIQUE. + + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZQCO2(JLON,JLEV)=QCO2 + ENDDO + ENDDO + + + ! INITIALISATION DE LA COORDONNEE ETA. + ! INITIALISATION DE LA COORDONNEE ETA. + +! EPAISSEUR STD AEROSOLS + ZAEO = AERCS1*YDSTA%SVETAH(YDCPG_OPTS%KTDIA-1) + AERCS3*YDSTA%SVETAH(YDCPG_OPTS%KTDIA-1)**3& + & + AERCS5*YDSTA%SVETAH(YDCPG_OPTS%KTDIA-1)**5 + DO JLEV = YDCPG_OPTS%KTDIA, YDCPG_OPTS%KFLEVG + ZAEN = AERCS1*YDSTA%SVETAH(JLEV) + AERCS3*YDSTA%SVETAH(JLEV)**3& + & + AERCS5*YDSTA%SVETAH(JLEV)**5 + ZDAER(JLEV) = ZAEN - ZAEO + ZAEO = ZAEN + ENDDO + + IF ( LNEWSTAT ) THEN + + DO JLEV = YDCPG_OPTS%KTDIA, YDCPG_OPTS%KFLEVG-1 + ZMAN(JLEV) = FSM_CC * TANH(FSM_DD*YDSTA%SVETAH(JLEV)) + ZMAK(JLEV) = FSM_EE * YDSTA%SVETAH(JLEV)**FSM_FF +& + & FSM_GG * (1-YDSTA%SVETAH(JLEV))**FSM_HH + FSM_II + ENDDO + +! MATHEMATICAL FILTER FOR THE EDGES + + IF ( LRPROX ) THEN + DO JLEV = YDCPG_OPTS%KTDIA, YDCPG_OPTS%KTDIA+3 + ZMAK(JLEV) = ZMAK(JLEV) / 2**(YDCPG_OPTS%KTDIA+4-JLEV) + ENDDO + DO JLEV = YDCPG_OPTS%KFLEVG-4, YDCPG_OPTS%KFLEVG-1 + ZMAK(JLEV) = ZMAK(JLEV) / 2**(5-YDCPG_OPTS%KFLEVG+JLEV) + ENDDO + ENDIF + + ELSE + DO JLEV = YDCPG_OPTS%KTDIA, YDCPG_OPTS%KFLEVG-1 + ZMAN(JLEV) = 0.3_JPRB*YDSTA%SVETAH(JLEV) + ZMAK(JLEV) = 0.1_JPRB + ENDDO + ENDIF !LNEWSTAT + +!3MT +! INCREMENTAL CORRECTION FLUX FOR NEGAVTIVE HUMIDITY VALUES + + ZFCQVNG(:,:)=0.0_JPRB + ZFCQING(:,:)=0.0_JPRB + ZFCQLNG(:,:)=0.0_JPRB + + ZPRODTH_CVPP(:,:)=0.0_JPRB + + ZGDT=RG*TSPHY + ZGDTI=1.0_JPRB/ZGDT + + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + +! LAYER WEIGHTS + + ZPOID(JLON,JLEV)=YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP(JLON,JLEV)*ZGDTI + ZIPOI(JLON,JLEV)=YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP(JLON,JLEV)*ZGDT + +! CALCULATION OF LATENT HEATS + + ZLHV(JLON,JLEV)=FOLH(YDMF_PHYS_BASE_STATE%T(JLON,JLEV),0.0_JPRB) + ZLHS(JLON,JLEV)=FOLH(YDMF_PHYS_BASE_STATE%T(JLON,JLEV),1.0_JPRB) + + ENDDO + ENDDO + +! ------------------------------------------------------------------ +! PROGNOSTIC GEMS/MACC AEROSOLS - INITIAL COMPUTATIONS +! IMPORTANT for IFS: Tracer order is : CO2 - other tracers - react Gases - Aerosol - extra GFL +! ------------------------------------------------------------------ + + ! Preliminary for prog. aerosol or extra gfl + INBTRA=0 + IF (LMDUST.AND.(NGFL_EXT/=0)) INBTRA=NGFL_EXT + IF (NAERO>0) INBTRA=NAERO ! the two cases exclude each other + ALLOCATE(ZSTRCTRA(YDCPG_OPTS%KLON,0:YDCPG_OPTS%KFLEVG,INBTRA)) ! to cover both prog aero and extra gfl cases + ALLOCATE(ZTRA (YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG,INBTRA)) + IF (INBTRA > 0) THEN + ZSTRCTRA(:,:,:) = 0._JPRB + ZTRA(:,:,:) = 0._JPRB + ENDIF + IF(INBTRA == 0) THEN + INBTRA_DEP=0 + ELSE + INBTRA_DEP=1 + ENDIF + +! ------------------------------------------------------------------ +! - CHANGEMENTS DE VARIABLES ET INVERSION DES NIVEAUX +! POUR LE TRAITEMENT DES SCALAIRES PASSIFS +! -------------------------------------------------------------------- + + ZSFSV=0.0_JPRB ! surf. flux of scalars + IF (LMDUST.AND.(NGFL_EXT/=0)) THEN +! SIZE OF ARRAY FOR MSE + ILONMNH=YDCPG_BNDS%KFDIA-YDCPG_BNDS%KIDIA+1 + ZINVDT=1/YDCPG_OPTS%ZDTPHY + ZINVG=1/RG + ZZI_APHI=YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI + ZTM=YDMF_PHYS_BASE_STATE%T +!SETUP + ZZI_SVM=0.0_JPRB + ZZI_PEZDIAG=0.0_JPRB + ZZI_PABSM=101325._JPRB + ZZI_RHODREFM=1.0_JPRB + ZZI_RHO=1.0_JPRB + ZZZ=0.0_JPRB + ZAERD=0.0_JPRB + ZP1EZDIAG=0.0_JPRB + +!Initialisation des scalaires passifs pour aro_ground_param + DO JGFL=1,NGFL_EXT + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZSVM(JLON,JLEV,JGFL)=MAX(YDMF_PHYS_BASE_STATE%P1EXT(JLON,JLEV,JGFL),0.0_JPRB) + ENDDO + ENDDO + ENDDO + + !initialisation de ZZZ + DO JLEV = 1,YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZZZ(JLON,1,JLEV)=ZZI_APHI(JLON,JLEV)*ZINVG + ENDDO + ENDDO + + !initialisation de ZDZZ + DO JLEV = 2, YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZDZZ(JLON,1,JLEV)=ZZZ(JLON,1,JLEV-1)-ZZZ(JLON,1,JLEV) + ENDDO + ENDDO + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZDZZ(JLON,1,1)=ZZI_APHI(JLON,0)*ZINVG-ZZZ(JLON,1,1) + ENDDO + + +!Initialisation de ZZI_RHODREFM + DO JLEV = 1 , YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZZI_RHODREFM(JLON,1,JLEV)=YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF(JLON,JLEV)/& + & (YDMF_PHYS_BASE_STATE%T(JLON,JLEV)*YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R(JLON,JLEV)) + ENDDO + ENDDO + +!Initialisation de ZZI_PABSM + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + DO JLEV = 1 , YDCPG_OPTS%KFLEVG + ZZI_PABSM(JLON,1,JLEV)=YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF(JLON,JLEV) + ENDDO + ENDDO + +!Initialisation de ZZI_EXNREFM + ZRSCP=RD/RCPD + ZINVATM=1/RATM + DO JLEV = 1 , YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZZI_EXNREFM(JLON,1,JLEV)=(YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF(JLON,JLEV)*ZINVATM)**(ZRSCP) + ENDDO + ENDDO + +!Initialisation de ZZI_THM + DO JLEV = 1 , YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZZI_THM(JLON,1,JLEV)=ZTM(JLON,JLEV)/ZZI_EXNREFM(JLON,1,JLEV) + ENDDO + ENDDO + +!Initialisation des scalaires passifs pour aro_mnhdust (inversion des niveaux) + DO JGFL=1,NGFL_EXT + DO JLON=1,YDCPG_OPTS%KLON + DO JLEV=1,YDCPG_OPTS%KFLEVG + ZZI_SVM(JLON,1,JLEV,JGFL)=ZSVM(JLON,JLEV,JGFL) + ENDDO + ENDDO + ENDDO + + ENDIF ! ENDIF (LMDUST & NGFL_EXT) +ENDIF !LMPHYS +!** +! ------------------------------------------------------------------ +! 2.- MISES A ZERO DE SECURITE EN CAS DE NON-APPEL DES PARAMETRIS. +! ------------------------------------------------------------------ +ZEPS0=1.E-12_JPRB +ZEPSNEB=1.E-10_JPRB + +! To profitize from the vectorization collapsing the (:,:) form is preferable. +! (Even better would be to completely avoid any useless initialization.) + +! arrays dimensioned from 0:KLEV (half level quantities) +ZFPCOR (:,:) = 0.0_JPRB +ZFHP (:,:) = 0.0_JPRB +ZXTROV (:,:) = 1.0_JPRB +ZXUROV (:,:) = 1.0_JPRB +ZLMT (:,:) = 0.0_JPRB +ZZLMT (:,:) = 0.0_JPRB +ZLMU (:,:) = 0.0_JPRB +ZLMU2 (:,:) = 0.0_JPRB +ZLMT2 (:,:) = 0.0_JPRB +ZKTROV (:,:) = 0.0_JPRB +ZKQROV (:,:) = 0.0_JPRB +ZKQLROV (:,:) = 0.0_JPRB +ZKUROV (:,:) = 0.0_JPRB +ZFHEVPPC(:,:) = 0.0_JPRB +ZFHMLTSC(:,:) = 0.0_JPRB +ZFPEVPPC(:,:) = 0.0_JPRB +ZFCQL (:,:) = 0.0_JPRB +ZFCQI (:,:) = 0.0_JPRB +ZDIFCVPPQ (:,:) = 0.0_JPRB +ZDIFCVPPS (:,:) = 0.0_JPRB +ZDIFCVTH (:,:) = 0.0_JPRB +ZDIFCVPPU (:,:) = 0.0_JPRB +ZDIFCVPPV (:,:) = 0.0_JPRB +ZCONDCVPPL(:,:) = 0.0_JPRB +ZCONDCVPPI(:,:) = 0.0_JPRB +ZSEDIQL(:,:) = 0.0_JPRB +ZSEDIQI(:,:) = 0.0_JPRB + +ZXURO (:,:) = 0.0_JPRB +ZXQRO (:,:) = 0.0_JPRB +ZXTRO (:,:) = 0.0_JPRB + +ZALPHA1 (:,:) = 0.0_JPRB +ZCOEFA (:,:) = 0.0_JPRB +ZLVT (:,:) = 0.0_JPRB +ZQICE (:,:) = 0.0_JPRB + +ZF_EPS (:,:) = 1.0_JPRB +ZFUN_TTE (:,:) = 1.0_JPRB +ZMRIPP (:,:) = 1.E-12_JPRB +ZMRIMC (:,:) = 1.0_JPRB +ZMRICTERM (:,:) = 1.0_JPRB +ZRRCOR (:,:) = 1.0_JPRB +ZTAU_TKE (:,:) = 0.0_JPRB +ZTH_FUN (:,:) = 1.0_JPRB +ZMRIFPP (:,:) = 1.E-12_JPRB +ZMN2PP (:,:) = 1.E-12_JPRB +ZMN2_ES (:,:) = 1.0_JPRB +ZMN2_EQ (:,:) = 1.0_JPRB +ZMN2_DS (:,:) = 1.0_JPRB +ZMN2_DQ (:,:) = 1.0_JPRB +ZTSTAR (:,:) = 1.E-12_JPRB +ZTSTAR2 (:,:) = 1.E-12_JPRB +ZTSTARQ (:,:) = 1.E-12_JPRB +ZTSTAR2Q (:,:) = 1.E-12_JPRB +ZFMGST (:,:) = 1.0_JPRB +ZFMTKE (:,:) = 1.0_JPRB +ZFTTKE (:,:) = 1.0_JPRB +ZAUTKE (:,:) = 1.0_JPRB +ZATTKE (:,:) = 1.0_JPRB +ZTH_FUN(:,:) = 1.0_JPRB +ZWW_FUN(:,:) = 1.0_JPRB +ZBNEBCVPP(:,:) = 0.0_JPRB +ZBNEBQ(:,:) = 0.0_JPRB +ZRHS(:,:) = 0.0_JPRB +ZLML(:,:) = 1.0_JPRB +ZLMLTILD(:,:) = 1.0_JPRB + +ZDIFWQ (:) = 0.0_JPRB +ZDIFWS (:) = 0.0_JPRB +ZSC_FEVI(:) = 1.0_JPRB +ZSC_FEVN(:) = 1.0_JPRB +ZSC_FCLL(:) = 1.0_JPRB +ZSC_FCLN(:) = 1.0_JPRB +ZCDNH(:) = 1.0_JPRB + +! arrays dimensioned from 1:KLEV (full level quantities) +ZTENT (:,:) = 0.0_JPRB +ZNEBS (:,:) = ZEPS0 +ZNEBC (:,:) = ZEPS0 +ZNEBS0 (:,:) = ZEPS0 +ZNEBC0 (:,:) = ZEPS0 +ZNEBCH (:,:) = 0.0_JPRB +ZUNEBH (:,:) = 0.0_JPRB +ZDETFI (:,:) = 0.0_JPRB +ZNEBDIFF(:,:) = 0.0_JPRB +ZQLIS (:,:) = 0.0_JPRB +ZQLIS0 (:,:) = 0.0_JPRB +ZCFATH (:,:) = 0.0_JPRB +ZCFAU (:,:) = 0.0_JPRB +ZCFBTH (:,:) = 0.0_JPRB +ZCFBU (:,:) = 0.0_JPRB +ZCFBV (:,:) = 0.0_JPRB +ZQLIC (:,:) = 0.0_JPRB +INLAB (:,:) = 0 +INLAB_CVPP(:,:) = 0 +ICIS (:,:) = 1 +ZQLI_CVPP(:,:) = 0.0_JPRB +ZNEB_CVPP(:,:) = ZEPS0 + +ZEDMFQ (:,:) = 0.0_JPRB +ZEDMFS (:,:) = 0.0_JPRB +ZEDMFU (:,:) = 0.0_JPRB +ZEDMFV (:,:) = 0.0_JPRB +ZMF_UP (:,: ) = 0.0_JPRB +ZQLI_CVP(:,:) = 0.0_JPRB +ZQC_DET_PCMT(:,:) = 0.0_JPRB +ZTENHA(:,:) = 0.0_JPRB +ZTENQVA(:,:) = 0.0_JPRB +ZRHDFDA(:,:) = 0.0_JPRB +ZQIC (:,:) = 0.0_JPRB +ZQLC (:,:) = 0.0_JPRB +ZQRC (:,:) = 0.0_JPRB +ZQSC (:,:) = 0.0_JPRB +ZQG (:,:) = 0.0_JPRB +ZQH (:,:) = 0.0_JPRB + +! --------------------------------------------------------------------- +! Correction of negative advected humidity and precipitation values +! --------------------------------------------------------------------- + +IF (LCONDWT) THEN + IF (L3MT .OR. LSTRAPRO .OR. LPROCLD) THEN + IF (LGRAPRO) THEN +!cdir unroll=8 + DO JLEV = 1, YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZQI(JLON,JLEV)=MAX(0.0_JPRB,YDMF_PHYS_BASE_STATE%I(JLON,JLEV)) + ZQL(JLON,JLEV)=MAX(0.0_JPRB,YDMF_PHYS_BASE_STATE%L(JLON,JLEV)) + ZQR(JLON,JLEV)=MAX(0.0_JPRB,YDMF_PHYS_BASE_STATE%R(JLON,JLEV)) + ZQS(JLON,JLEV)=MAX(0.0_JPRB,YDMF_PHYS_BASE_STATE%S(JLON,JLEV)) + ZQG(JLON,JLEV)=MAX(0.0_JPRB,YDMF_PHYS_BASE_STATE%G(JLON,JLEV)) + ! CORRECTION OF NEGATIVE ADVECTED VALUES: + ! VAPOUR PUT IN PFCQVNG + ! LIQUID,ICE PUT IN PFCQL/ING + ! FOR RAIN/SNOW/GRAUPEL PUT IN PFCQR/S/GNG + + ZDQI=ZQI(JLON,JLEV)-YDMF_PHYS_BASE_STATE%I(JLON,JLEV) + ZDQL=ZQL(JLON,JLEV)-YDMF_PHYS_BASE_STATE%L(JLON,JLEV) + ZDQR=ZQR(JLON,JLEV)-YDMF_PHYS_BASE_STATE%R(JLON,JLEV) + ZDQS=ZQS(JLON,JLEV)-YDMF_PHYS_BASE_STATE%S(JLON,JLEV) + ZDQG=ZQG(JLON,JLEV)-YDMF_PHYS_BASE_STATE%G(JLON,JLEV) + ZDQC=ZDQI+ZDQL+ZDQR+ZDQS+ZDQG + + ZQV0=YDMF_PHYS_BASE_STATE%Q(JLON,JLEV)-ZIPOI(JLON,JLEV)*(0.0_JPRB- YDMF_PHYS%OUT%FCQNG(JLON,JLEV-1) & + & -YDMF_PHYS%OUT%FCQNNG(JLON,JLEV-1)-YDMF_PHYS%OUT%FCQLNG(JLON,JLEV-1)-YDMF_PHYS%OUT%FCQRNG(JLON,JLEV-1) & + & -YDMF_PHYS%OUT%FCQSNG(JLON,JLEV-1)-YDMF_PHYS%OUT%FCQGNG(JLON,JLEV-1)) + ZQV(JLON,JLEV)=MAX(0.0_JPRB,ZQV0-ZDQC) + ZDQV=MAX(0.0_JPRB,ZQV0-ZDQC)-YDMF_PHYS_BASE_STATE%Q(JLON,JLEV) + + YDMF_PHYS%OUT%FCQNG(JLON,JLEV)=YDMF_PHYS%OUT%FCQNG(JLON,JLEV-1)-ZDQV*ZPOID(JLON,JLEV) + YDMF_PHYS%OUT%FCQNNG(JLON,JLEV)=YDMF_PHYS%OUT%FCQNNG(JLON,JLEV-1)-ZDQI*ZPOID(JLON,JLEV) + YDMF_PHYS%OUT%FCQLNG(JLON,JLEV)=YDMF_PHYS%OUT%FCQLNG(JLON,JLEV-1)-ZDQL*ZPOID(JLON,JLEV) + YDMF_PHYS%OUT%FCQRNG(JLON,JLEV)=YDMF_PHYS%OUT%FCQRNG(JLON,JLEV-1)-ZDQR*ZPOID(JLON,JLEV) + YDMF_PHYS%OUT%FCQSNG(JLON,JLEV)=YDMF_PHYS%OUT%FCQSNG(JLON,JLEV-1)-ZDQS*ZPOID(JLON,JLEV) + YDMF_PHYS%OUT%FCQGNG(JLON,JLEV)=YDMF_PHYS%OUT%FCQGNG(JLON,JLEV-1)-ZDQG*ZPOID(JLON,JLEV) + ENDDO + ENDDO + ELSE + DO JLEV = 1, YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZQI(JLON,JLEV)=MAX(0.0_JPRB,YDMF_PHYS_BASE_STATE%I(JLON,JLEV)) + ZQL(JLON,JLEV)=MAX(0.0_JPRB,YDMF_PHYS_BASE_STATE%L(JLON,JLEV)) + ZQR(JLON,JLEV)=MAX(0.0_JPRB,YDMF_PHYS_BASE_STATE%R(JLON,JLEV)) + ZQS(JLON,JLEV)=MAX(0.0_JPRB,YDMF_PHYS_BASE_STATE%S(JLON,JLEV)) + + ! CORRECTION OF NEGATIVE ADVECTED VALUES: + ! VAPOUR PUT IN PFCQVNG + ! LIQUID,ICE PUT IN PFCQL/ING + ! FOR RAIN/SNOW PUT IN PFCQR/SNG + + ZDQI=ZQI(JLON,JLEV)-YDMF_PHYS_BASE_STATE%I(JLON,JLEV) + ZDQL=ZQL(JLON,JLEV)-YDMF_PHYS_BASE_STATE%L(JLON,JLEV) + ZDQR=ZQR(JLON,JLEV)-YDMF_PHYS_BASE_STATE%R(JLON,JLEV) + ZDQS=ZQS(JLON,JLEV)-YDMF_PHYS_BASE_STATE%S(JLON,JLEV) + ZDQC=ZDQI+ZDQL+ZDQR+ZDQS + + ZQV0=YDMF_PHYS_BASE_STATE%Q(JLON,JLEV)-ZIPOI(JLON,JLEV)*(0.0_JPRB- YDMF_PHYS%OUT%FCQNG(JLON,JLEV-1)& + & -YDMF_PHYS%OUT%FCQNNG(JLON,JLEV-1)-YDMF_PHYS%OUT%FCQLNG(JLON,JLEV-1)-YDMF_PHYS%OUT%FCQRNG(JLON,JLEV-1)& + & -YDMF_PHYS%OUT%FCQSNG(JLON,JLEV-1)) + ZQV(JLON,JLEV)=MAX(0.0_JPRB,ZQV0-ZDQC) + ZDQV=MAX(0.0_JPRB,ZQV0-ZDQC)-YDMF_PHYS_BASE_STATE%Q(JLON,JLEV) + + YDMF_PHYS%OUT%FCQNG(JLON,JLEV)=YDMF_PHYS%OUT%FCQNG(JLON,JLEV-1)-ZDQV*ZPOID(JLON,JLEV) + YDMF_PHYS%OUT%FCQNNG(JLON,JLEV)=YDMF_PHYS%OUT%FCQNNG(JLON,JLEV-1)-ZDQI*ZPOID(JLON,JLEV) + YDMF_PHYS%OUT%FCQLNG(JLON,JLEV)=YDMF_PHYS%OUT%FCQLNG(JLON,JLEV-1)-ZDQL*ZPOID(JLON,JLEV) + YDMF_PHYS%OUT%FCQRNG(JLON,JLEV)=YDMF_PHYS%OUT%FCQRNG(JLON,JLEV-1)-ZDQR*ZPOID(JLON,JLEV) + YDMF_PHYS%OUT%FCQSNG(JLON,JLEV)=YDMF_PHYS%OUT%FCQSNG(JLON,JLEV-1)-ZDQS*ZPOID(JLON,JLEV) + ENDDO + ENDDO + ENDIF + + IF (LGPCMT) THEN + DO JLEV = 1, YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZTZER=MAX(0.0_JPRB,-SIGN(1.0_JPRB,-(YDVARS%ICONV%T0(JLON,JLEV)-ZEPS0)+0.0_JPRB)) + ZQIC(JLON,JLEV)=ZTZER*YDVARS%ICONV%T0(JLON,JLEV) + ZDQI=ZQIC(JLON,JLEV)-YDVARS%ICONV%T0(JLON,JLEV) + + ZTZER=MAX(0.0_JPRB,-SIGN(1.0_JPRB,-(YDVARS%LCONV%T0(JLON,JLEV)-ZEPS0)+0.0_JPRB)) + ZQLC(JLON,JLEV)=ZTZER*YDVARS%LCONV%T0(JLON,JLEV) + ZDQL=ZQLC(JLON,JLEV)-YDVARS%LCONV%T0(JLON,JLEV) + + ZTZER=MAX(0.0_JPRB,-SIGN(1.0_JPRB,-(YDVARS%RCONV%T0(JLON,JLEV)-ZEPS0)+0.0_JPRB)) + ZQRC(JLON,JLEV)=ZTZER*YDVARS%RCONV%T0(JLON,JLEV) + ZDQR=ZQRC(JLON,JLEV)-YDVARS%RCONV%T0(JLON,JLEV) + + ZTZER=MAX(0.0_JPRB,-SIGN(1.0_JPRB,-(YDVARS%SCONV%T0(JLON,JLEV)-ZEPS0)+0.0_JPRB)) + ZQSC(JLON,JLEV)=ZTZER*YDVARS%SCONV%T0(JLON,JLEV) + ZDQS=ZQSC(JLON,JLEV)-YDVARS%SCONV%T0(JLON,JLEV) + + ZDQC=ZDQI+ZDQL+ZDQR+ZDQS + + ZQV0=ZQV(JLON,JLEV)-ZIPOI(JLON,JLEV)*(0.0_JPRB-ZFCQVNG(JLON,JLEV-1)& + & -YDMF_PHYS%OUT%FCNEGQIC(JLON,JLEV-1)-YDMF_PHYS%OUT%FCNEGQLC(JLON,JLEV-1)& + & -YDMF_PHYS%OUT%FCNEGQRC(JLON,JLEV-1)-YDMF_PHYS%OUT%FCNEGQSC(JLON,JLEV-1)) + ZQVI=MAX(0.0_JPRB,ZQV0-ZDQC) + ZDQV=ZQVI-ZQV(JLON,JLEV) + ZQV(JLON,JLEV)=ZQVI + + ZFCQVNG(JLON,JLEV)=ZFCQVNG(JLON,JLEV-1)-ZDQV*ZPOID(JLON,JLEV) + YDMF_PHYS%OUT%FCQNG(JLON,JLEV)=YDMF_PHYS%OUT%FCQNG(JLON,JLEV)+ZFCQVNG(JLON,JLEV) + YDMF_PHYS%OUT%FCNEGQIC(JLON,JLEV)=YDMF_PHYS%OUT%FCNEGQIC(JLON,JLEV-1)-ZDQI*ZPOID(JLON,JLEV) + YDMF_PHYS%OUT%FCNEGQLC(JLON,JLEV)=YDMF_PHYS%OUT%FCNEGQLC(JLON,JLEV-1)-ZDQL*ZPOID(JLON,JLEV) + YDMF_PHYS%OUT%FCNEGQRC(JLON,JLEV)=YDMF_PHYS%OUT%FCNEGQRC(JLON,JLEV-1)-ZDQR*ZPOID(JLON,JLEV) + YDMF_PHYS%OUT%FCNEGQSC(JLON,JLEV)=YDMF_PHYS%OUT%FCNEGQSC(JLON,JLEV-1)-ZDQS*ZPOID(JLON,JLEV) + ENDDO + ENDDO + ZFCQVNG(:,:)=0.0_JPRB + ENDIF + ELSE + DO JLEV = 1, YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZQI(JLON,JLEV)=YDMF_PHYS_BASE_STATE%I(JLON,JLEV) + ZQL(JLON,JLEV)=YDMF_PHYS_BASE_STATE%L(JLON,JLEV) + ZQR(JLON,JLEV)=YDMF_PHYS_BASE_STATE%R(JLON,JLEV) + ZQS(JLON,JLEV)=YDMF_PHYS_BASE_STATE%S(JLON,JLEV) + IF (LGRAPRO) THEN + ZQG(JLON,JLEV)=YDMF_PHYS_BASE_STATE%G(JLON,JLEV) + ENDIF + ZQV(JLON,JLEV)=YDMF_PHYS_BASE_STATE%Q(JLON,JLEV) + ENDDO + ENDDO + ENDIF +ELSE + DO JLEV = 1, YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZQI(JLON,JLEV)=0.0_JPRB + ZQL(JLON,JLEV)=0.0_JPRB + ZQV(JLON,JLEV)=YDMF_PHYS_BASE_STATE%Q(JLON,JLEV) + ENDDO + ENDDO +ENDIF ! LCONDWT + +DO JCHA = 1, 6 + DO JLEV = YDCPG_OPTS%KTDIA, YDCPG_OPTS%KFLEVG + DO JLON = 1, YDCPG_OPTS%KLON + ZAER(JLON,JLEV,JCHA)=0.0_JPRB + ENDDO + ENDDO +ENDDO + +DO JLEV = YDCPG_OPTS%KTDIA, YDCPG_OPTS%KFLEVG + DO JLON = 1, YDCPG_OPTS%KLON + ZAERINDS(JLON,JLEV)=0.0_JPRB + ENDDO +ENDDO + +DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZCEMTR (JLON,0) = 0.0_JPRB + ZCEMTR (JLON,1) = 0.0_JPRB + ZCTRSO (JLON,0) = 0.0_JPRB + ZCTRSO (JLON,1) = 0.0_JPRB + ZTRSOD (JLON) = 0.0_JPRB + ZSUDU (JLON) = 0.0_JPRB + ZXDROV (JLON) = 1.0_JPRB + ZXHROV (JLON) = 1.0_JPRB + ZTAUX (JLON) = ZEPS0 + IMOC_CLPH (JLON) = YDCPG_OPTS%KFLEVG +ENDDO +DO JSG = 1, NSW + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZALBD (JLON,JSG) = 0.0_JPRB + ZALBP (JLON,JSG) = 0.0_JPRB + ZSFSWDIF(JLON,JSG) = 0.0_JPRB + ZSFSWDIR(JLON,JSG) = 0.0_JPRB + ZTRSODIF(JLON,JSG) = 0.0_JPRB + ZTRSODIR(JLON,JSG) = 0.0_JPRB + ENDDO +ENDDO + +! ------------------------------------------------------- +! Security values for pseudo-historical arrays at KSTEP=0 +! ------------------------------------------------------- + +IF((LNEBR.OR.(TRIM(CGMIXLEN) == 'TM')& + & .OR.(TRIM(CGMIXLEN) == 'TMC')).AND.YDCPG_OPTS%KSTEP == 0) THEN +!DEC$ IVDEP + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS_SURF%GSD_VH%PPBLH(JLON)=(XMINLM+XMAXLM)*0.5_JPRB + ENDDO +ENDIF +IF((LNEBCO.OR.LGWDC).AND.YDCPG_OPTS%KSTEP == 0) THEN + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS_SURF%GSD_VH%PTCCH(JLON)=0.0_JPRB + YDMF_PHYS_SURF%GSD_VH%PSCCH(JLON)=0.0_JPRB + YDMF_PHYS_SURF%GSD_VH%PBCCH(JLON)=0.0_JPRB + ENDDO +ENDIF + +IF((LNEBN.OR.LNEBR.OR.LRRGUST).AND.YDCPG_OPTS%KSTEP == 0) THEN + DO JLEV=YDCPG_OPTS%KTDIA-1,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZPFL_FPLCH(JLON,JLEV)=0.0_JPRB + ENDDO + ENDDO +ENDIF +IF(LRRGUST.AND.YDCPG_OPTS%KSTEP == 0) THEN + DO JLEV=YDCPG_OPTS%KTDIA-1,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZPFL_FPLSH(JLON,JLEV)=0.0_JPRB + ENDDO + ENDDO +ENDIF +IF(LCVPGY.AND.YDCPG_OPTS%KSTEP == 0) THEN + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS_BASE_STATE%CVV(JLON,JLEV)=0.0_JPRB + ENDDO + ENDDO +ENDIF +IF(LPHSPSH.AND.YDCPG_OPTS%KSTEP == 0) THEN + YDMF_PHYS_SURF%GSD_VH%PSPSH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=0._JPRB +ENDIF +IF(LCOEFKTKE.AND.YDCPG_OPTS%KSTEP == 0) THEN + YDMF_PHYS_SURF%GSD_VH%PQSH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=YDMF_PHYS_BASE_STATE%Q(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KFLEVG) +ENDIF +IF(LCVCSD.AND.LUDEVOL.AND.YDCPG_OPTS%KSTEP==0) THEN + YDMF_PHYS_SURF%GSD_VK%PUDGRO(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=0._JPRB +ENDIF +IF(LRKCDEV.AND.YDCPG_OPTS%KSTEP == 0) THEN + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZDTRAD(JLON,JLEV)=0.0_JPRB + ZRKTTEND(JLON,JLEV)=0.0_JPRB + ZRKQVTEND(JLON,JLEV)=0.0_JPRB + ZRKQCTEND(JLON,JLEV)=0.0_JPRB + ZDQVDIFF(JLON,JLEV)=0.0_JPRB + YDVARS%RKTH%T0(JLON,JLEV) = 0.0_JPRB + YDVARS%RKTQV%T0(JLON,JLEV)= 0.0_JPRB + YDVARS%RKTQC%T0(JLON,JLEV)= 0.0_JPRB + ENDDO + ENDDO +ENDIF +IF (L3MT) THEN + IF (LCVPRO) THEN + YDVARS%UNEBH%T0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:)=MAX(0._JPRB,YDVARS%UNEBH%T0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:)) + ZUNEBH(:,:)=MIN(1.0_JPRB-ZEPS0,YDVARS%UNEBH%T0(:,:)+MAX(0._JPRB,YDVARS%UAL%T0(:,:))) + ELSE + ZUNEBH(:,:)=YDVARS%UNEBH%T0(:,:) + ENDIF +ENDIF + +! ------------------------------------------------------------------ +! The LMPHYS and LEPHYS keys should in the following be +! dispached to individual parametrizations. +IF(LMPHYS) THEN +!* +! ------------------------------------------------------------------ +! 4.- CALCULS THERMODYNAMIQUES +! ---------------------------- + IF ( LTHERMO ) THEN + CALL ACTQSAT (YDCST, YDPHY, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTQSAT, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, ZQV, YDMF_PHYS_BASE_STATE%T, & + & ZGEOSLC, ZMSC_LH, ZMSC_LSCPE, ZFLU_QSAT, ZMSC_QW, YDCPG_MISC%RH, ZMSC_TW) + ENDIF + +!* +! ------------------------------------------------------------------ +! 4.BIS. COEFFICIENTS THERMO-HYDRIQUES DU SOL +! ------------------------------------------- + + IF (LSFORCS) THEN ! Surface forcing for 1D model MUSC + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZTSN(JLON)=YDMF_PHYS_BASE_STATE%YGSP_RR%T(JLON) + ZTN(JLON) =YDMF_PHYS_BASE_STATE%T(JLON,YDCPG_OPTS%KFLEVG) + ENDDO + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZRHODREFM(JLON) = YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF(JLON,YDCPG_OPTS%KFLEVG)/(YDMF_PHYS_BASE_STATE%T(JLON,YDCPG_OPTS%KFLEVG)*YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R(JLON,YDCPG_OPTS%KFLEVG)) + ZTHETAS(JLON) = ZTSN(JLON)*(RATM/YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD(JLON,YDCPG_OPTS%KFLEVG))**RKAPPA + ENDDO + LLAROME = .FALSE. + CALL SURF_IDEAL_FLUX(YDRIP, YDPHY0, YDPHYDS, LLAROME, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF(:, YDCPG_OPTS%KFLEVG), ZRHODREFM, YDMF_PHYS_SURF%GSD_SFO%PGROUP, & + & ZTN, ZTSN, YDMF_PHYS_SURF%GSD_VF%PLSM, YDMF_PHYS_BASE_STATE%Q(:, YDCPG_OPTS%KFLEVG), YDMF_PHYS_BASE_STATE%U(:, YDCPG_OPTS%KFLEVG), & + & YDMF_PHYS_BASE_STATE%V(:, YDCPG_OPTS%KFLEVG), ZTHETAS, YDMF_PHYS%OUT%FCS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, 1), & + & ZFEV, ZFMDU, ZFMDV) + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS_BASE_STATE%YGSP_RR%T(JLON)=ZTSN(JLON) + ENDDO + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZDELTA=MAX(0.0_JPRB,SIGN(1.0_JPRB,RTT-YDMF_PHYS_BASE_STATE%YGSP_RR%T(JLON))) + ! To be equivalent to surfex forcing + YDMF_PHYS%OUT%FEVL(JLON,1)=ZFEV(JLON)*(1.0_JPRB-ZDELTA) + YDMF_PHYS%OUT%FEVN(JLON,1)=ZFEV(JLON)*ZDELTA + YDMF_PHYS%OUT%FCLL(JLON,1)=YDMF_PHYS%OUT%FEVL(JLON,1)*ZMSC_LH(JLON,YDCPG_OPTS%KFLEVG) + YDMF_PHYS%OUT%FCLN(JLON,1)=YDMF_PHYS%OUT%FEVN(JLON,1)*ZMSC_LH(JLON,YDCPG_OPTS%KFLEVG) + ZDSA_LHS(JLON)=FOLH(YDMF_PHYS_BASE_STATE%YGSP_RR%T(JLON),0.0_JPRB) + ENDDO + ENDIF ! End of surface forcing for 1D model MUSC + + IF ( .NOT.LMSE ) THEN + IF ( LSOLV ) THEN + LLHMT=.FALSE. + CALL ACSOL (YDCPG_OPTS%YRCLI, YDCST, YDPHY, YDPHY1, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDMF_PHYS_SURF%GSD_VV%PARG, & + & YDMF_PHYS_SURF%GSD_VV%PD2, YDMF_PHYS_SURF%GSD_VF%PZ0F, YDMF_PHYS_SURF%GSD_VV%PZ0H, YDMF_PHYS_SURF%GSD_VF%PZ0RLF, & + & YDMF_PHYS_SURF%GSD_VF%PLSM, YDMF_PHYS_SURF%GSD_VV%PIVEG, YDMF_PHYS_SURF%GSD_VV%PLAI, YDMF_PHYS_BASE_STATE%YGSP_SG%A, & + & YDMF_PHYS_BASE_STATE%YGSP_SG%R, YDMF_PHYS_SURF%GSD_VV%PSAB, YDMF_PHYS_BASE_STATE%YGSP_SG%F, YDMF_PHYS_BASE_STATE%YGSP_RR%T, & + & YDMF_PHYS_SURF%GSD_VF%PVEG, YDMF_PHYS_BASE_STATE%YGSP_SB%Q, YDMF_PHYS_BASE_STATE%YGSP_SB%TL, & + & YDMF_PHYS_BASE_STATE%YGSP_RR%W, YDMF_PHYS_BASE_STATE%YGSP_RR%IC, LLHMT, ZDSA_C1, ZDSA_C2, & + & ZC3, ZCG, ZCN, YDMF_PHYS%OUT%CT, ZNEIJG, ZNEIJV, ZWFC, ZWPMX, ZWSEQ, ZWSMX, ZWWILT) + ELSE + +! INITIALISATION DE L'INERTIE THERMIQUE DU SOL. + +!DEC$ IVDEP + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%CT(JLON)=HSOL /(& + & 1.0_JPRB+HSOLIWR*(YDMF_PHYS_BASE_STATE%YGSP_RR%W(JLON)+YDMF_PHYS_BASE_STATE%YGSP_SB%Q(JLON,1))/(WSMX+WPMX)& + & *EXP(-0.5_JPRB*(HSOLIT0*(YDMF_PHYS_BASE_STATE%YGSP_RR%T(JLON)-RTT))**2)) + ENDDO + ENDIF + ENDIF + +!* +! ------------------------------------------------------------------ +! 4.TER.- INITIALISATIONS LIEES AU SCHEMA DE SURFACE EXTERNALISE +! ------------------------------------------------------------------ + + IF (LMSE) THEN + +! INITIALISATION DU SCHEMA DE SURFACE EXTERNALISE ET DES +! VARIABLES PSEUDO-HISTORIQUES ASSOCIEES + + IF ( (NSWB_MNH /= NSW) .AND. LRAYFM ) CALL ABOR1('APLPAR: NSWB_MNH not = NSW') + + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%GZ0 (JLON) = YDCPG_GPAR%GZ0(JLON) + YDMF_PHYS%OUT%GZ0H (JLON) = YDCPG_GPAR%GZ0H(JLON) + ZFLU_EMIS (JLON) = YDCPG_GPAR%VEMIS(JLON) + YDCPG_MISC%QS (JLON) = YDCPG_GPAR%VQS(JLON) + YDMF_PHYS_BASE_STATE%YGSP_RR%T (JLON) = YDCPG_GPAR%VTS(JLON) + ZSRAIN (JLON) = YDCPG_GPAR%RAIN(JLON) + ZSSNOW (JLON) = YDCPG_GPAR%SNOW(JLON) + ZSGROUPEL(JLON) = 0._JPRB + ZTSN (JLON) = YDMF_PHYS_BASE_STATE%YGSP_RR%T(JLON) + ENDDO + + IF ( LRAY ) THEN + ! ACRANEB/ACRANEB2 radiation => one solar band + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%ALB (JLON) = YDCPG_GPAR%ALBSCA(JLON,1) + ZALBDIR(JLON) = YDCPG_GPAR%ALBDIR(JLON,1) + ENDDO + ELSE + ! FMR radiation => NSW solar bands + DO JSG=1,NSW + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZALBP(JLON,JSG) = YDCPG_GPAR%ALBDIR(JLON,JSG) + ZALBD(JLON,JSG) = YDCPG_GPAR%ALBSCA(JLON,JSG) + ENDDO + ENDDO + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%ALB(JLON)=0.0_JPRB + ENDDO + DO JSG=1,NSW + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%ALB(JLON)=YDMF_PHYS%OUT%ALB(JLON)+0.5*(ZALBP(JLON,JSG)+ZALBD(JLON,JSG)) + ENDDO + ENDDO + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%ALB(JLON)=YDMF_PHYS%OUT%ALB(JLON)/REAL(NSW,JPRB) + ENDDO + ENDIF + + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + IF (ZFLU_EMIS(JLON)==0._JPRB) THEN + ZFLU_EMIS(JLON) = 0.99_JPRB + YDMF_PHYS_BASE_STATE%YGSP_RR%T (JLON) = 288.0_JPRB + YDMF_PHYS%OUT%ALB (JLON) = 0.1_JPRB + ENDIF + ENDDO + + ENDIF ! LMSE +! +! Define z0;z0h if it's necessary +! + IF (LMSE.AND.(.NOT.LCOEFKTKE).AND.(.NOT.LCOEFK_TOMS).AND.YDCPG_OPTS%KSTEP == 0) THEN + CALL ARO_GROUND_DIAG_Z0( YDCPG_BNDS%KBL, YDCPG_OPTS%KGPCOMP, YDCPG_BNDS%KFDIA-YDCPG_BNDS%KIDIA+1, YDCPG_BNDS%KIDIA, & + & YDCPG_BNDS%KFDIA, NDGUNG, NDGUXG, NDLUNG, NDLUXG, YDVARS%GEOMETRY%RINDX%T0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & YDVARS%GEOMETRY%RINDY%T0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), LSURFEX_KFROM, YDMF_PHYS%OUT%GZ0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & YDMF_PHYS%OUT%GZ0H(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)) + ENDIF +!* +! ------------------------------------------------------------------ +! 5.- STRUCTURE ET CHAMPS DANS LA COUCHE LIMITE DE SURFACE +! ------------------------------------------------------------------ + +! INITIALISATION DES HAUTEURS "METEO". + + IF ( LHMTO ) THEN + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZDPHIV(JLON)=RG*HVCLS + ZDPHIT(JLON)=RG*HTCLS + ENDDO + ENDIF + + IF ( LVDIF.OR.LHMTO.OR.LGWD ) THEN + LLCLS=LGWD.OR.LVDIF + LLHMT=LHMTO + IF (LMSE) THEN + IF(LCOEFKTKE.AND.LCOEFKSURF) THEN + + IF (YDCPG_OPTS%KSTEP == 0) THEN + CALL ARO_GROUND_DIAG_Z0( YDCPG_BNDS%KBL, YDCPG_OPTS%KGPCOMP, YDCPG_BNDS%KFDIA-YDCPG_BNDS%KIDIA+1, & + & YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, NDGUNG, NDGUXG, NDLUNG, NDLUXG, YDVARS%GEOMETRY%RINDX%T0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & YDVARS%GEOMETRY%RINDY%T0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), LSURFEX_KFROM, YDMF_PHYS%OUT%GZ0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & YDMF_PHYS%OUT%GZ0H(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)) + ENDIF + + + CALL ACTKEZOTLS ( YDPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & YDMF_PHYS_BASE_STATE%T, YDMF_PHYS%OUT%GZ0, YDMF_PHYS%OUT%GZ0H, YDMF_PHYS_BASE_STATE%YGSP_RR%T, & + & YDCPG_MISC%QS, ZFLU_CDN, ZCDNH, ZDSA_CPS, ZRTI, ZDSA_RS) + + ELSE + CALL ACHMTLS (YDCST, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, YDMF_PHYS_BASE_STATE%T, & + & YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, YDMF_PHYS_BASE_STATE%YGSP_RR%T, YDCPG_MISC%QS, & + & ZDPHIT, YDMF_PHYS%OUT%GZ0, YDMF_PHYS%OUT%GZ0H, LLCLS, ZNBVNO, ZMRIPP, ZDSA_CPS, ZGWDCS, & + & ZDSA_LHS, ZPCLS, ZFLU_CD, ZFLU_CDN) +! Computation of ZRTI + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZDPHI(JLON)=YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF(JLON,YDCPG_OPTS%KFLEVG)-YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI(JLON,YDCPG_OPTS%KFLEVG) + ZPRS(JLON)=RD+ZRVMD*YDCPG_MISC%QS(JLON) + ZRTI(JLON)=2.0_JPRB/(YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R(JLON,YDCPG_OPTS%KFLEVG)*YDMF_PHYS_BASE_STATE%T(JLON,YDCPG_OPTS%KFLEVG)+RKAPPA*ZDPHI(JLON)& + & +ZPRS(JLON)*YDMF_PHYS_BASE_STATE%YGSP_RR%T(JLON)) + ENDDO + ENDIF + ELSE + IF (LCOEFKSURF) THEN + CALL ACTKEHMT ( YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, YDSURF%YSD_VVD%NUMFLDS>=8.AND.LSOLV, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, ZQV, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, ZPFL_FPLSH, & + & ZPFL_FPLCH, ZDPHIT, ZDPHIV, YDMF_PHYS_SURF%GSD_VF%PZ0F, YDMF_PHYS_SURF%GSD_VV%PZ0H, YDMF_PHYS_SURF%GSD_VF%PZ0RLF, & + & YDMF_PHYS_SURF%GSD_VV%PHV, YDMF_PHYS_SURF%GSD_VF%PLSM, ZNEIJG, ZNEIJV, YDMF_PHYS_BASE_STATE%YGSP_SG%F, & + & YDMF_PHYS_BASE_STATE%YGSP_RR%T, YDMF_PHYS_SURF%GSD_VF%PVEG, ZWFC, YDMF_PHYS_BASE_STATE%YGSP_RR%W, & + & YDMF_PHYS_BASE_STATE%YGSP_RR%IC, LLCLS, LLHMT, ZNBVNO, ZMRIPP, ZFLU_CD, ZFLU_CDN, ZCDROV, & + & ZFLU_CH, ZCHROV, ZDSA_CPS, ZDQSTS, ZGWDCS, YDMF_PHYS%OUT%GZ0, YDMF_PHYS%OUT%GZ0H, ZHQ, ZHU, & + & ZFLU_NEIJ, YDMF_PHYS%OUT%QCLS, YDCPG_MISC%QS, ZFLU_QSATS, YDMF_PHYS%OUT%RHCLS, ZDSA_RS, & + & ZRTI, ZSTAB, YDMF_PHYS%OUT%TCLS, YDMF_PHYS%OUT%UCLS, YDMF_PHYS%OUT%VCLS, YDMF_PHYS%OUT%NUCLS, & + & YDMF_PHYS%OUT%NVCLS, ZPCLS, ZFLU_VEG, ZXDROV, ZXHROV, YDMF_PHYS%OUT%UGST, YDMF_PHYS%OUT%VGST & + & ) + ELSE + CALL ACHMT (YDCPG_OPTS%YRCLI, YDMODEL%YRML_PHY_MF%YRPHY, YDMODEL%YRML_PHY_MF%YRPHY0, YDMODEL%YRML_PHY_MF%YRPHY1, YDMODEL%YRML_PHY_MF%YRPHY2, & + & YDCST, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, YDSURF%YSD_VVD%NUMFLDS>=8.AND.LSOLV, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, ZQV, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, ZPFL_FPLSH, & + & ZPFL_FPLCH, ZDPHIT, ZDPHIV, YDMF_PHYS_SURF%GSD_VF%PZ0F, YDMF_PHYS_SURF%GSD_VV%PZ0H, YDMF_PHYS_SURF%GSD_VF%PZ0RLF, & + & YDMF_PHYS_SURF%GSD_VV%PHV, YDMF_PHYS_SURF%GSD_VF%PLSM, ZNEIJG, ZNEIJV, YDMF_PHYS_BASE_STATE%YGSP_SG%F, & + & YDMF_PHYS_BASE_STATE%YGSP_RR%T, YDMF_PHYS_SURF%GSD_VF%PVEG, ZWFC, YDMF_PHYS_BASE_STATE%YGSP_RR%W, & + & YDMF_PHYS_BASE_STATE%YGSP_RR%IC, LLCLS, LLHMT, ZNBVNO, ZMRIPP, ZFLU_CD, ZFLU_CDN, ZCDROV, & + & ZFLU_CH, ZCHROV, ZDSA_CPS, ZDQSTS, ZGWDCS, YDMF_PHYS%OUT%GZ0, YDMF_PHYS%OUT%GZ0H, ZHQ, ZHU, & + & ZFLU_NEIJ, YDMF_PHYS%OUT%QCLS, YDCPG_MISC%QS, ZFLU_QSATS, YDMF_PHYS%OUT%RHCLS, ZDSA_RS, & + & ZRTI, ZSTAB, YDMF_PHYS%OUT%TCLS, YDMF_PHYS%OUT%UCLS, YDMF_PHYS%OUT%VCLS, YDMF_PHYS%OUT%NUCLS, & + & YDMF_PHYS%OUT%NVCLS, ZPCLS, ZFLU_VEG, ZXDROV, ZXHROV, YDMF_PHYS%OUT%UGST, YDMF_PHYS%OUT%VGST & + & ) + ENDIF + ENDIF + + IF (LPTKE) THEN + YDMF_PHYS_BASE_STATE%TKE(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,1:YDCPG_OPTS%KFLEVG) = MAX(YDMF_PHYS_BASE_STATE%TKE(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,1:YDCPG_OPTS%KFLEVG),ETKE_MIN) + ENDIF + IF (LCOEFK_PTTE) THEN + YDVARS%TTE%T0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,1:YDCPG_OPTS%KFLEVG) = MAX(YDVARS%TTE%T0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,1:YDCPG_OPTS%KFLEVG),ETKE_MIN) + ENDIF + + IF(LCOEFKTKE) THEN + ZCP(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,1:YDCPG_OPTS%KFLEVG) = RCPD*(1.0_JPRB+(RCPV/RCPD-1.0_JPRB)*(& + & ZQV(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,1:YDCPG_OPTS%KFLEVG)+ZQI(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,1:YDCPG_OPTS%KFLEVG)+& + & ZQL(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,1:YDCPG_OPTS%KFLEVG))) + ELSE + ZCP(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,1:YDCPG_OPTS%KFLEVG) = YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,1:YDCPG_OPTS%KFLEVG) + ENDIF + + IF(LCOEFK_RIS .AND. LCOEFKTKE) THEN + ! computation of Ri*,Ri** for mixing lenth computation + CALL ACMRISS ( YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & NTCOEF, YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, & + & ZQV, ZQL, ZQI, ZFLU_QSAT, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%U, & + & YDMF_PHYS_BASE_STATE%V, ZMSC_LSCPE, YDMF_PHYS%OUT%GZ0, ZMN2PP, ZMRIPP) + ENDIF + + ! COMPUTATION OF mixing lengths from Ri*,Ri** - FIRST GUES for moist AF + + !--------------------------------------------------- + ! COMPUTATION OF 'DRY' mixing lengths : lm_d lh_d + ! COMPUTATION OF ZPBLH - PBL HEIGHT + + IF (CGMIXLEN == 'Z' .OR. & + & CGMIXLEN == 'EL0'.OR. & + & CGMIXLEN == 'EL1'.OR. & + & CGMIXLEN == 'EL2'.OR. & + & CGMIXLEN == 'AY' .OR. & + & CGMIXLEN == 'AYC'.AND.(.NOT.LECT)) THEN + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZTHETAV(JLON,JLEV)=YDMF_PHYS_BASE_STATE%T(JLON,JLEV)*(1.0_JPRB+RETV*ZQV(JLON,JLEV))& + & *(RATM/YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF(JLON,JLEV))**RKAPPA + ENDDO + ENDDO + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZTHETAVS(JLON)=YDMF_PHYS_BASE_STATE%YGSP_RR%T(JLON)*(1.0_JPRB+RETV*YDCPG_MISC%QS(JLON))& + & *(RATM/YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD(JLON,YDCPG_OPTS%KFLEVG))**RKAPPA + ENDDO + CALL ACCLPH (YDCST, YDPHY0, YDPHY2, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KTDIA, & + & YDCPG_OPTS%KFLEVG, ZTHETAV, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, ZTHETAVS, IMOC_CLPH, YDMF_PHYS%OUT%CLPH, YDMF_PHYS%OUT%VEIN, & + & ZUGST, ZVGST) + ZBLH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=YDMF_PHYS%OUT%CLPH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA) + IF (.NOT.LRAFTUR) THEN + YDMF_PHYS%OUT%UGST(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=ZUGST(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA) + YDMF_PHYS%OUT%VGST(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=ZVGST(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA) + ENDIF + ELSE + ZBLH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=YDMF_PHYS_SURF%GSD_VH%PPBLH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA) + ENDIF + + ENDIF ! end of LVDIF or LHMTO or LGWD + + IF ( (LVDIF.OR.LGWD).AND.(.NOT.(LNEBR.OR.LECT)) ) THEN + + IF(TRIM(CGMIXLEN) == 'Z') THEN + !------------------------------------------------- + ! "z dependent" mixing length. + !------------------------------------------------- + ZBLH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=1.0_JPRB/UHDIFV + CALL ACMIXLENZ ( YDPHY, YDPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, 1, YDCPG_OPTS%KFLEVG, & + & .FALSE., YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, ZBLH, YDMF_PHYS%OUT%GZ0, & + & YDMF_PHYS%OUT%GZ0H, ZLMU, ZLMT) + + ELSEIF((TRIM(CGMIXLEN) == 'TMC').OR.(TRIM(CGMIXLEN) == 'AYC')) THEN + ! Cubique du climat + ZBLH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=MIN(XMAXLM,MAX(XMINLM,ZBLH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA))) + CALL ACMIXLENTM ( YDPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS%OUT%GZ0, YDMF_PHYS%OUT%GZ0H, & + & ZBLH, ZLMU, ZLMT) + + ELSEIF(TRIM(CGMIXLEN) == 'TM') THEN + ! Ancienne formulation pour Lm + ZBLH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=MIN(XMAXLM,MAX(XMINLM,ZBLH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)))*XKLM + CALL ACMIXLENZ ( YDPHY, YDPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, 1, YDCPG_OPTS%KFLEVG, & + & .FALSE., YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, ZBLH, YDMF_PHYS%OUT%GZ0, & + & YDMF_PHYS%OUT%GZ0H, ZLMU, ZLMT) + + ! Cubique du climat pour Lh + ZBLH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=ZBLH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)/XKLM + CALL ACMIXLENTM ( YDPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS%OUT%GZ0, YDMF_PHYS%OUT%GZ0H, & + & ZBLH, ZZLMT, ZLMT & + & ) + + ELSEIF(TRIM(CGMIXLEN) == 'AY') THEN + ! new Ayotte-Tudor ZBLH & mixing length + CALL ACMIXLENZ ( YDPHY, YDPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, 1, YDCPG_OPTS%KFLEVG, & + & .FALSE., YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, ZBLH, YDMF_PHYS%OUT%GZ0, & + & YDMF_PHYS%OUT%GZ0H, ZLMU, ZLMT) + + ELSEIF((CGMIXLEN(1:2) == 'EL').AND.LPTKE) THEN + ! e-type mixing length converted to Prandtl type + CALL ACMIXLENZ(YDPHY, YDPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, 1, YDCPG_OPTS%KFLEVG, & + & .TRUE., YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, ZBLH, YDMF_PHYS%OUT%GZ0, & + & YDMF_PHYS%OUT%GZ0H, ZLMU, ZLMT) + ZLMU2(:,:)=ZLMU(:,:) + ZLMT2(:,:)=ZLMT(:,:) + IF (CGMIXLEN == 'EL0') THEN + IMLTYPE=0 + ! to have identical mixing length like in pTKE + ! e-type mixing length converted to Prandtl type + CALL ACMIXLENZ(YDPHY, YDPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, 1, YDCPG_OPTS%KFLEVG, & + & .FALSE., YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, ZBLH, YDMF_PHYS%OUT%GZ0, & + & YDMF_PHYS%OUT%GZ0H, ZLMU, ZLMT) + ZLMU2(:,:)=ZLMU(:,:) + ZLMT2(:,:)=ZLMT(:,:) + ELSEIF (CGMIXLEN == 'EL1') THEN + IMLTYPE=1 + ELSEIF (CGMIXLEN == 'EL2') THEN + IMLTYPE=2 + ELSE + CLERR='APLPAR: UNEXPECTED VALUE FOR CGMIXLEN: '//TRIM(CGMIXLEN) + CALL ABOR1(CLERR) + ENDIF + + IF( LCOEFK_RIS) THEN + LLMAF=.TRUE. + CALL ACMIXELEN(YGFL, YDPHY, YDPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KTDIA, & + & YDCPG_OPTS%KFLEVG, YDCPG_OPTS%KSTEP, IMLTYPE, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%T, & + & ZQV, ZQL, ZQI, YDMF_PHYS_BASE_STATE%R, YDMF_PHYS_BASE_STATE%S, YDMF_PHYS_BASE_STATE%TKE, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%ALPH, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%LNPR, & + & ZMN2PP, ZFMGST, ZPFL_FPLSH, ZPFL_FPLCH, YDMF_PHYS%OUT%GZ0, YDMF_PHYS_BASE_STATE%YGSP_RR%T, & + & ZFLU_CDN, ZBLH, ZLMU, ZLMT, YDVARS%MXL%T0, ZLML, ZLMLTILD, ZRRCOR, LLMAF) + ENDIF + + ELSE + CLERR='APLPAR: UNEXPECTED VALUE FOR CGMIXLEN: '//TRIM(CGMIXLEN) + CALL ABOR1(CLERR) + ENDIF + + IF(LCOEFKTKE) THEN + + ! ------------------------------------------------------------- + ! COMPUTATION OF Ri', NCVPP AND COEFFICIENT FOR MOIST GUSTINESS + ! ------------------------------------------------------------- + IF(LCOEFK_RIS) THEN + CALL ACMRIS ( YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & NTCOEF, YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, ZMSC_LSCPE, ZQV, ZQL, ZQI, ZFLU_QSAT, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, ZLMU, ZLMT, YDMF_PHYS%OUT%GZ0, & + & ZMRIPP) + ENDIF + + CALL ACMRIP(YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTCOEF, YDCPG_OPTS%KFLEVG, & + & YDCPG_OPTS%KSTEP, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, ZQV, ZQL, ZQI, ZCP, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%ALPH, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%LNPR, ZFLU_QSAT, ZMSC_QW, ZMSC_TW, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, YDVARS%FQTUR%T0, YDVARS%FSTUR%T0, & + & YDVARS%SHTUR%T0, YDMF_PHYS_BASE_STATE%TKE, YDVARS%TTE%T0, YDMF_PHYS_BASE_STATE%YGSP_RR%T, YDMF_PHYS_SURF%GSD_VH%PQSH, & + & ZDSA_RS, ZDSA_CPS, ZRTI, YDMF_PHYS%OUT%GZ0, LLCLS, ZMRIPP, ZMRIFPP, ZBNEBCVPP, ZBNEBQ, & + & ZNBVNO, ZFMTKE, ZFTTKE, ZF_EPS, ZFUN_TTE, ZAUTKE, ZATTKE, ZFHORM, ZFHORH, ZTH_FUN, ZWW_FUN, & + & ZMRIMC, ZMRICTERM, ZMN2PP, ZMN2_ES, ZMN2_EQ, ZMN2_DS, ZMN2_DQ, ZFMGST) + + ENDIF ! LCOEFTKE + + ! FINISHING MIXING LENGTH COMPUTATION + IF((CGMIXLEN(1:2) == 'EL').AND.LPTKE) THEN + ZLMU(:,:)=ZLMU2(:,:) + ZLMT(:,:)=ZLMT2(:,:) + IF (CGMIXLEN == 'EL0') THEN + IMLTYPE=0 + ELSEIF (CGMIXLEN == 'EL1') THEN + IMLTYPE=1 + ELSEIF (CGMIXLEN == 'EL2') THEN + IMLTYPE=2 + ENDIF + LLMAF=.FALSE. + CALL ACMIXELEN(YGFL, YDPHY, YDPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KTDIA, & + & YDCPG_OPTS%KFLEVG, YDCPG_OPTS%KSTEP, IMLTYPE, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%T, & + & ZQV, ZQL, ZQI, YDMF_PHYS_BASE_STATE%R, YDMF_PHYS_BASE_STATE%S, YDMF_PHYS_BASE_STATE%TKE, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%ALPH, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%LNPR, & + & ZMN2PP, ZFMGST, ZPFL_FPLSH, ZPFL_FPLCH, YDMF_PHYS%OUT%GZ0, YDMF_PHYS_BASE_STATE%YGSP_RR%T, & + & ZFLU_CDN, ZBLH, ZLMU, ZLMT, YDVARS%MXL%T0, ZLML, ZLMLTILD, ZRRCOR, LLMAF) + ENDIF + + ENDIF ! (LVDIF or LGWD) and( not(LNEBR or LECT)) + + IF ( LVDIF.OR.LHMTO.OR.LGWD ) THEN + + IF (LFLUSO.AND.(.NOT.LMSE)) THEN + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZCRTI(JLON) = 1.0_JPRB/(YDMF_PHYS_BASE_STATE%YGSP_RR%T(JLON)*ZDSA_RS(JLON)) + ENDDO + CALL ACFLUSO (YDCST, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%Q, YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%U, & + & YDMF_PHYS_BASE_STATE%V, ZDPHIT, ZDPHIV, YDMF_PHYS%OUT%GZ0, YDMF_PHYS_SURF%GSD_VF%PLSM, & + & ZFLU_QSATS, ZCRTI, YDMF_PHYS_BASE_STATE%YGSP_RR%T, LLHMT, ZFLU_CD, ZFLU_CDN, ZCDROV, ZCE, & + & ZCEROV, ZFLU_CH, ZCHROV, YDMF_PHYS%OUT%QCLS, YDMF_PHYS%OUT%RHCLS, YDMF_PHYS%OUT%TCLS, YDMF_PHYS%OUT%UCLS, & + & YDMF_PHYS%OUT%VCLS, YDMF_PHYS%OUT%UGST, YDMF_PHYS%OUT%VGST) + ELSE + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZCE (JLON) = ZFLU_CH (JLON) + ZCEROV(JLON) = ZCHROV(JLON) + ENDDO + ENDIF + + ENDIF ! LVDIF or LHMTO or LGWD + + IF (LRAFTKE) THEN + YDMF_PHYS%OUT%CAPE(:)=0._JPRB + ZDCAPE(:)=0._JPRB + CALL ACCLDIA(YDCST, YDCPG_OPTS%LXCLP, YDCPG_OPTS%LXTGST, YDCPG_OPTS%LXXGST, YDPHY, YDPHY2, YDTOPH, YDCPG_BNDS%KIDIA, & + & YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, YDMF_PHYS%OUT%UCLS, YDMF_PHYS%OUT%VCLS, YDMF_PHYS_BASE_STATE%U, & + & YDMF_PHYS_BASE_STATE%V, YDMF_PHYS%OUT%CAPE, ZDCAPE, YDMF_PHYS_BASE_STATE%TKE, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDVARS%GEOMETRY%OROG%T0, YDMF_PHYS%OUT%UGST, YDMF_PHYS%OUT%VGST, ZBLH, IMOC_CLPH) + ENDIF + +!** +! ------------------------------------------------------------------ +! 6.- TURBULENCE: COEFFICIENTS D'ECHANGE +! ------------------------------------------------------------------ + + IF ( (LVDIF.OR.LGWD).AND.(.NOT.(LNEBR.OR.LECT)) ) THEN + !------------------------------------------------- + ! Compute diffusion coefficients. + !------------------------------------------------- + + IF(LCOEFKTKE) THEN + CALL ACTKECOEFK ( YDPHY0, YDPHY2, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTCOEF, & + & YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, & + & ZFMTKE, ZFTTKE, ZAUTKE, ZATTKE, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, YDMF_PHYS_BASE_STATE%T, & + & YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, ZLMU, ZLMT, YDMF_PHYS%OUT%GZ0, ZKTROV, & + & ZKUROV, ZKNROV, ZXTROV, ZXUROV, ZXPTKEROV) + ELSE + CALL ACCOEFK ( YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & NTCOEF, YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, ZMSC_LSCPE, ZQV, ZQL, ZQI, ZFLU_QSAT, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, ZPFL_FPLSH, & + & ZPFL_FPLCH, ZLMU, ZLMT, YDMF_PHYS%OUT%GZ0, YDMF_PHYS%OUT%GZ0H, ZBLH, ZKTROV, ZKUROV, ZKNROV, & + & ZNBVNO, ZXTROV, ZXUROV, ZXPTKEROV) + ENDIF + ENDIF + + IF (LCVPPKF) THEN + CALL ACVPPKF(YDCST,YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTCVIM, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, YDMF_PHYS_BASE_STATE%T, ZQV, ZQL, ZQI, YDMF_PHYS_BASE_STATE%U, & + & YDMF_PHYS_BASE_STATE%V, YDCPG_DYN0%CTY%VVEL(:, 1:), YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, YDMF_PHYS_BASE_STATE%TKE, & + & ZDIFCVPPQ, ZDIFCVPPS, ZCONDCVPPL, ZCONDCVPPI, ZPRODTH_CVPP, INLAB_CVPP, ZQLI_CVPP, ZNEB_CVPP, & + & INND) + ENDIF + + !------------------------------------------------- + ! Call to EDKF + !------------------------------------------------- + IF (LEDKF) THEN + IF (LEDMFI) THEN + ZIMPL=0._JPRB + ELSE + ZIMPL=1._JPRB + ENDIF + CALL ABOR1('APLPAR: CODE MUST BE UPDATED, IMPL_MF IS NOW SET IN NAMELIST') + + IF (YDCPG_OPTS%KSTEP == 0) YDMF_PHYS_SURF%GSD_SFL%PGROUP(:,:) = 0.0_JPRB + CALL ARP_SHALLOW_MF( YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KTDIA, YDCPG_OPTS%KFLEVG, & + & TSPHY, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, CMF_UPDRAFT, CMF_CLOUD, LMIXUV, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, & + & YDMF_PHYS_BASE_STATE%T, ZQV, ZQL, ZQI, ZQR, ZQS, YDMF_PHYS_BASE_STATE%TKE, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, ZEDMFQ, ZEDMFS, ZEDMFU, ZEDMFV, YDMF_PHYS_SURF%GSD_SFL%PGROUP(:, 1), & + & YDMF_PHYS_SURF%GSD_SFL%PGROUP(:, 2), ZPRODTH_CVPP, ZQLI_CVPP, ZNEB_CVPP, INLAB_CVPP, ZMF_UP) + + ENDIF + + IF ( LVDIF.AND.LECT ) THEN + IF ( LCONDWT ) THEN + YDCPG_MISC%QICE(:,:)= ZQI(:,:) + YDCPG_MISC%QLI(:,:) = ZQL(:,:) + ELSE + YDCPG_MISC%QICE(:,:)= 0.0_JPRB + YDCPG_MISC%QLI(:,:) = 0.0_JPRB + ENDIF + +! Computation of the 2 znlab used in acbl89 + IF (.NOT. LECSHAL) INLAB_CVPP(:,:) = 0 + IF (LECDEEP) THEN + ZNLABCVP(:,:) = 1.0_JPRB + ELSE + ZNLABCVP(:,:) = 0.0_JPRB + ENDIF + IF(LNEBN.OR.LNEBR.OR.LRRGUST) THEN + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZNLABCVP(JLON,JLEV) = ZNLABCVP(JLON,JLEV)& + & *MAX(0.0_JPRB,SIGN(1.0_JPRB,ZPFL_FPLCH(JLON,JLEV)-ZPFL_FPLCH(JLON,JLEV-1)-YDPHY0%REPS)) + ZNLAB(JLON,JLEV) = REAL(INLAB_CVPP(JLON,JLEV),JPRB) + ENDDO + ENDDO + ENDIF + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZNLAB(JLON,JLEV) = REAL(INLAB_CVPP(JLON,JLEV),JPRB) + ENDDO + ENDDO + + CALL ACTKE (YDCST, YDLDDH, YDMODEL%YRML_DIAG%YRMDDH, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, & + & YDCPG_OPTS%KLON, NTCOEF, NTCOET, YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, & + & ZQV, ZQIC, ZQLC, ZMSC_LSCPE, ZFLU_CD, ZFLU_CH, YDMF_PHYS%OUT%GZ0, YDMF_PHYS_BASE_STATE%YGSP_RR%T, & + & YDCPG_MISC%QS, YDCPG_MISC%QICE, YDCPG_MISC%QLI, YDMF_PHYS_BASE_STATE%TKE, ZPRODTH_CVPP, ZNLAB, & + & ZNLABCVP, ZKTROV, ZKQROV, ZKQLROV, ZKUROV, ZXTROV, ZXUROV, ZNBVNO, ZNEBS, ZQLIS, ZNEBS0, & + & ZQLIS0, ZCOEFN, ZPFL_FTKE, ZPFL_FTKEI, ZTKE1, ZTPRDY, YDMF_PHYS%OUT%EDR, YDDDH) + YDMF_PHYS%OUT%CLPH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=MIN(XMAXLM,MAX(XMINLM,YDMF_PHYS%OUT%CLPH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA))) + ENDIF + + + !------------------------------------------------- + ! Store diffusion coefficients in trajectory in temporary variables + ! before final writing. + !------------------------------------------------- + ZKTROV_SAVE(:,:)=ZKTROV(:,:) + ZKUROV_SAVE(:,:)=ZKUROV(:,:) + ZCDROV_SAVE(:)=ZCDROV(:) + ZCHROV_SAVE(:)=ZCHROV(:) + +!** +! ------------------------------------------------------------------ +! 7.- RAYONNEMENT +! ---------------- +! -------------------------------------------------------------------- +! - COMPUTE DUST PROPERTIES FOR RADIATION IF LMDUST=T +! -------------------------------------------------------------------- + IF (LMDUST.AND.(NGFL_EXT/=0)) THEN +! input dust scalar concentration in ppp from + + CALL ARO_MNHDUST (1, ILONMNH, YDCPG_OPTS%KFLEVG, NGFL_EXT, YDCPG_OPTS%ZDTPHY, ZZI_SVM(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, :, :, 1:NGFL_EXT), & + & ZZZ(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, :, :), ZDZZ(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, :, :), ZZI_PABSM(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, :, :), & + & ZZI_THM(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, :, :), ZZI_RHODREFM(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, :, :), & + & NSWB_MNH, YDCPG_OPTS%KSTEP+1, ZZI_SVM(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, :, :, 1:NGFL_EXT), ZPIZA_DST(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, :, :), & + & ZCGA_DST(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, :, :), ZTAUREL_DST(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, :, :), & + & ZAERD(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, :), NGFL_EZDIAG, ZZI_PEZDIAG(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, :, :) & + & ) + + ZP1EZDIAG(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:,:)=ZZI_PEZDIAG(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:,:) + +! return to aladin environment (inversion des niveaux) + DO JGFL=1,NGFL_EXT + DO JLON=1,YDCPG_OPTS%KLON + DO JLEV=1,YDCPG_OPTS%KFLEVG + ZSVM(JLON,JLEV,JGFL)=ZZI_SVM(JLON,1,JLEV,JGFL) + ENDDO + ENDDO + ENDDO + ENDIF + +! 7.1 Albedo et emissivite en presence de neige +! Albedo and emissivity with snow + + IF (.NOT.LMSE) THEN +!DEC$ IVDEP + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + IF (LSNV) THEN + IF ((YDMF_PHYS_SURF%GSD_VF%PVEG(JLON) < 0.01_JPRB).OR.(YDMF_PHYS_SURF%GSD_VF%PALBF(JLON) >= 0.60_JPRB)) THEN + ZALBV=0.0_JPRB + YDMF_PHYS_SURF%GSD_VF%PALBSF(JLON)=YDMF_PHYS_SURF%GSD_VF%PALBF(JLON) + ELSE + ZALBV=(YDMF_PHYS_SURF%GSD_VF%PALBF(JLON)-(1.0_JPRB-YDMF_PHYS_SURF%GSD_VF%PVEG(JLON))*YDMF_PHYS_SURF%GSD_VF%PALBSF(JLON))/YDMF_PHYS_SURF%GSD_VF%PVEG(JLON) + ENDIF + YDMF_PHYS%OUT%ALB(JLON)= (1.0_JPRB-YDMF_PHYS_SURF%GSD_VF%PVEG(JLON))*(1.0_JPRB-ZNEIJG(JLON)) *& + & YDMF_PHYS_SURF%GSD_VF%PALBSF(JLON)& + & + (1.0_JPRB-YDMF_PHYS_SURF%GSD_VF%PVEG(JLON))*ZNEIJG(JLON) *& + & MAX(YDMF_PHYS_SURF%GSD_VF%PALBSF(JLON),YDMF_PHYS_BASE_STATE%YGSP_SG%A(JLON,1))& + & + YDMF_PHYS_SURF%GSD_VF%PVEG(JLON)*ZNEIJV(JLON) *& + & MAX(ZALBV,YDMF_PHYS_BASE_STATE%YGSP_SG%A(JLON,1))& + & + YDMF_PHYS_SURF%GSD_VF%PVEG(JLON)*(1.0_JPRB-ZNEIJV(JLON)) * ZALBV + ZFLU_EMIS(JLON)= (1.0_JPRB-YDMF_PHYS_SURF%GSD_VF%PVEG(JLON))*(1.0_JPRB-ZNEIJG(JLON)) *& + & YDMF_PHYS_SURF%GSD_VF%PEMISF(JLON)& + & + (1.0_JPRB-YDMF_PHYS_SURF%GSD_VF%PVEG(JLON))*ZNEIJG(JLON) * EMCRIN& + & + YDMF_PHYS_SURF%GSD_VF%PVEG(JLON)*ZNEIJV(JLON) * EMCRIN& + & + YDMF_PHYS_SURF%GSD_VF%PVEG(JLON)*(1.0_JPRB-ZNEIJV(JLON)) * YDMF_PHYS_SURF%GSD_VF%PEMISF(JLON) + ELSE + IF (LVGSN) THEN + IF (LZ0HSREL.AND.LCOEFKSURF) THEN + ! new treatment, PNEIJ is gridbox snow fraction + YDMF_PHYS%OUT%ALB(JLON)=(1.0_JPRB-ZFLU_VEG(JLON)-ZFLU_NEIJ(JLON))*YDMF_PHYS_SURF%GSD_VF%PALBF(JLON)+ & + & ZFLU_VEG(JLON)*YDMF_PHYS_SURF%GSD_VV%PALV(JLON)+ZFLU_NEIJ(JLON)*YDMF_PHYS_BASE_STATE%YGSP_SG%A(JLON,1) + ELSE + ! old treatment, PNEIJ is snow fraction for bare ground + YDMF_PHYS%OUT%ALB(JLON)=YDMF_PHYS_SURF%GSD_VF%PALBF(JLON)-ZFLU_NEIJ(JLON)*(YDMF_PHYS_SURF%GSD_VF%PALBF(JLON)- & + & YDMF_PHYS_BASE_STATE%YGSP_SG%A(JLON,1))+(ZFLU_NEIJ(JLON)-ZNEIJV(JLON))* & + & YDMF_PHYS_SURF%GSD_VF%PVEG(JLON)*(YDMF_PHYS_SURF%GSD_VV%PALV(JLON)-YDMF_PHYS_BASE_STATE%YGSP_SG%A(JLON,1)) + ENDIF + + YDMF_PHYS%OUT%ALB(JLON)=MIN(ABS(YDMF_PHYS_SURF%GSD_VV%PIVEG(JLON)-2._JPRB),1.0_JPRB) * YDMF_PHYS%OUT%ALB(JLON) +(& + & 1.0_JPRB-MIN(ABS(YDMF_PHYS_SURF%GSD_VV%PIVEG(JLON)-2._JPRB),1.0_JPRB))& + & * MAX(ALCRIN,YDMF_PHYS%OUT%ALB(JLON)) + YDMF_PHYS_SURF%GSP_SG%PT_T1(JLON,1)=YDMF_PHYS%OUT%ALB(JLON) + + ZFLU_EMIS(JLON)=YDMF_PHYS_SURF%GSD_VF%PEMISF(JLON)-ZFLU_NEIJ(JLON)*(YDMF_PHYS_SURF%GSD_VF%PEMISF(JLON)-EMCRIN) + + ELSE + YDMF_PHYS%OUT%ALB(JLON)=YDMF_PHYS_SURF%GSD_VF%PALBF(JLON)-ZFLU_NEIJ(JLON)*(YDMF_PHYS_SURF%GSD_VF%PALBF(JLON)& + & -MAX(YDMF_PHYS_SURF%GSD_VF%PALBF(JLON),ALCRIN)) + ZFLU_EMIS(JLON)=YDMF_PHYS_SURF%GSD_VF%PEMISF(JLON)-ZFLU_NEIJ(JLON)*(YDMF_PHYS_SURF%GSD_VF%PEMISF(JLON)-EMCRIN) + ENDIF + ENDIF + ENDDO + + IF (LRAYFM) THEN + ! diffuse and direct (parallel) albedo in NSW solar intervals + IF (LALBMERCLIM) THEN + DO JSG=1,NSW + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZALBD(JLON,JSG)=YDMF_PHYS%OUT%ALB(JLON) + ZALBPMER=(1.0_JPRB+& + & 0.5_JPRB*ZRDG_MU0M(JLON)*(1.0_JPRB/YDMF_PHYS%OUT%ALB(JLON)-1.0_JPRB))/ (& + & 1.0_JPRB+ZRDG_MU0M(JLON)*(1.0_JPRB/YDMF_PHYS%OUT%ALB(JLON)-1.0_JPRB))**2 + ZALBP(JLON,JSG)=YDMF_PHYS%OUT%ALB(JLON)* YDMF_PHYS_SURF%GSD_VF%PLSM(JLON)+& + & ZALBPMER *(1.0_JPRB-YDMF_PHYS_SURF%GSD_VF%PLSM(JLON)) + ENDDO + ENDDO + ELSE +!DEC$ IVDEP + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZMERL(JLON)=(1.0_JPRB-YDMF_PHYS_SURF%GSD_VF%PLSM(JLON))*(1.0_JPRB& + & -MAX(0.0_JPRB,SIGN(1.0_JPRB,TMERGL-YDMF_PHYS_BASE_STATE%YGSP_RR%T(JLON)))) + ZFLU_EMIS(JLON)=ZFLU_EMIS(JLON)*YDMF_PHYS_SURF%GSD_VF%PLSM(JLON)+ZMERL(JLON)*EMMMER& + & +(1.0_JPRB-YDMF_PHYS_SURF%GSD_VF%PLSM(JLON))*(1.0_JPRB-ZMERL(JLON))*EMMGLA + ENDDO + DO JSG=1,NSW + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZALBD(JLON,JSG)=(1.0_JPRB-ZMERL(JLON))*YDMF_PHYS%OUT%ALB(JLON)+& + & ZMERL(JLON) *ALBMED + ZALBP(JLON,JSG)=(1.0_JPRB-ZMERL(JLON))*YDMF_PHYS%OUT%ALB(JLON)+& + & ZMERL(JLON) *& + & MAX(0.037_JPRB/(1.1_JPRB*ZRDG_MU0(JLON)**1.4_JPRB+0.15_JPRB),ZEPS0) + ENDDO + ENDDO + ENDIF + ELSEIF (LRAY) THEN + ! direct (parallel) albedo for ACRANEB/ACRANEB2, Geleyn's formula + ! with given proportion of Lambertian scattering + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + IF ( YDMF_PHYS_SURF%GSD_VF%PLSM(JLON) < 0.5_JPRB .AND. YDMF_PHYS_BASE_STATE%YGSP_RR%T(JLON) >= TMERGL ) THEN + ZLAMB=RLAMB_WATER ! water surface (open sea) + ELSE + ZLAMB=RLAMB_SOLID ! solid surface (frozen sea or land) + ENDIF + ZALBDIR(JLON)=ZLAMB*YDMF_PHYS%OUT%ALB(JLON)+(1._JPRB-ZLAMB)*(1._JPRB+& + & 0.5_JPRB*ZRDG_MU0(JLON)*(1.0_JPRB/YDMF_PHYS%OUT%ALB(JLON)-1.0_JPRB))/ (& + & 1.0_JPRB+ZRDG_MU0(JLON)*(1.0_JPRB/YDMF_PHYS%OUT%ALB(JLON)-1.0_JPRB))**2 + ENDDO + ENDIF + + ENDIF ! .NOT.LMSE + + ! Appel de la routine d'aerosols + + LLAERO=LAEROSEA.AND.LAEROLAN.AND.LAEROSOO.AND.LAERODES + + IF ( (LRAYFM.AND.(MOD(YDCPG_OPTS%KSTEP,NRADFR) == 0)) & + & .OR. ( (LRAY.OR.LRAYSP).AND.(.NOT.LRSTAER)) ) THEN + + IF (LLAERO) THEN + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZAESEA(JLON) = YDMF_PHYS_SURF%GSD_VA%PSEA(JLON) + ZAELAN(JLON) = YDMF_PHYS_SURF%GSD_VA%PLAN(JLON) + ZAESOO(JLON) = YDMF_PHYS_SURF%GSD_VA%PSOO(JLON) + ZAEDES(JLON) = YDMF_PHYS_SURF%GSD_VA%PDES(JLON) + ENDDO + ELSE + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZAESEA(JLON) = 0.0_JPRB + ZAELAN(JLON) = 0.0_JPRB + ZAESOO(JLON) = 0.0_JPRB + ZAEDES(JLON) = 0.0_JPRB + ENDDO + ENDIF + IF (LAEROSUL) THEN + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZAESUL(JLON) = YDMF_PHYS_SURF%GSD_VA%PSUL(JLON) + ENDDO + ELSE + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZAESUL(JLON) = 0.0_JPRB + ENDDO + ENDIF + IF (LAEROVOL) THEN + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZAEVOL(JLON) = YDMF_PHYS_SURF%GSD_VA%PVOL(JLON) + ENDDO + ELSE + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZAEVOL(JLON) = 0.0_JPRB + ENDDO + ENDIF + + IF ( ( (LRAYFM.AND.NAER /= 0) .OR.LRAY.OR.LRAYSP).AND.LLAERO ) THEN + CALL RADAER ( YDMODEL%YRML_PHY_RAD%YREAERD, YDERAD, YDPHY, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, & + & YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, & + & YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%YGSP_RR%T, ZAESEA, ZAELAN, ZAESOO, ZAEDES, & + & ZAESUL, ZAEVOL, ZAER, ZAERINDS ) + ENDIF + + ELSEIF ( (LRAY.OR.LRAYSP).AND.LRSTAER ) THEN + + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZAER(JLON,JLEV,1)=ZDAER(JLEV) + ZAER(JLON,JLEV,2:6)=0._JPRB + ENDDO + ENDDO + + ENDIF ! FOR AEROSOLS + +! We uses the extinction coefficient explicitely solved by ARO_MNHDUST + IF (LMDUST.AND.(NGFL_EXT/=0)) THEN + ZAER(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:,3) = ZAERD(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) + ENDIF + + +! 7.2 Flux radiatifs par ciel clair (Code Geleyn) +! Clear sky radiative fluxes (Geleyn's scheme) + + ! separate clearsky call is kept only for old ACRANEB; for ACRANEB2 + ! duplicit calculation of gaseous transmissions is avoided + IF (LRAY.AND.NRAY == 1.AND.YDCFU%NFRRC /= 0) THEN + IF (MOD(YDCPG_OPTS%KSTEP,YDCFU%NFRRC) == 0) THEN + CALL ACRANEB(YDRIP, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & NTRADI, YDCPG_OPTS%KFLEVG, IJN, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, YDCPG_MISC%NEB, ZQV, ZQCO2, YDCPG_MISC%QICE, YDCPG_MISC%QLI, & + & ZQO3, YDMF_PHYS_BASE_STATE%T, YDMF_PHYS%OUT%ALB, ZALBDIR, ZFLU_EMIS, ZRDG_MU0, YDVARS%GEOMETRY%GEMU%T0, & + & YDVARS%GEOMETRY%GELAM%T0, ZRDG_MU0LU, YDMF_PHYS_BASE_STATE%YGSP_RR%T, YDMF_PHYS%OUT%FRSO, YDMF_PHYS%OUT%FRTH, & + & ZFRSODS, YDMF_PHYS%OUT%FRSOPS, YDMF_PHYS%OUT%FRSOLU, YDMF_PHYS%OUT%FRTHDS, ZAER, ZMAK, ZMAN) + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%FRSOC(JLON,0)=YDMF_PHYS%OUT%FRSO(JLON,NTRADI-1,1) + YDMF_PHYS%OUT%FRSOC(JLON,1)=YDMF_PHYS%OUT%FRSO(JLON,YDCPG_OPTS%KFLEVG,1) + YDMF_PHYS%OUT%FRTHC(JLON,0)=YDMF_PHYS%OUT%FRTH(JLON,NTRADI-1,1) + YDMF_PHYS%OUT%FRTHC(JLON,1)=YDMF_PHYS%OUT%FRTH(JLON,YDCPG_OPTS%KFLEVG,1) + ENDDO + ENDIF + ENDIF + +! 7.3 Nebulosite et Convection +! Cloud cover and Convection +! 7.3.1 Shallow + Deep convection + + IF (LCVPGY) THEN + ! Le schema de convection de J. F. Gueremy + IF (LCONDWT) THEN + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZQCL(JLON,JLEV)=ZQL(JLON,JLEV) + ZQCI(JLON,JLEV)=ZQI(JLON,JLEV) + ENDDO + ENDDO + ELSE + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZQCL(JLON,JLEV)=0.0_JPRB + ZQCI(JLON,JLEV)=0.0_JPRB + ENDDO + ENDDO + ENDIF + CALL ACCVIMPGY ( YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & NTCVIM, YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%ALPH, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, ZMSC_LH, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%LNPR, ZQV, & + & ZQCI, ZQCL, ZQLIS, ZFLU_QSAT, ZMSC_QW, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, & + & YDMF_PHYS_BASE_STATE%T, ZMSC_TW, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, ZDSA_CPS, YDVARS%GEOMETRY%GM%T0, & + & YDMF_PHYS_BASE_STATE%YGSP_RR%T, YDMF_PHYS%OUT%DIFCQ, YDMF_PHYS%OUT%DIFCQL, YDMF_PHYS%OUT%DIFCQN, & + & YDMF_PHYS%OUT%DIFCS, YDMF_PHYS%OUT%FCCQL, YDMF_PHYS%OUT%FCCQN, YDMF_PHYS%OUT%FPFPCL, YDMF_PHYS%OUT%FPFPCN, & + & YDMF_PHYS%OUT%FPEVPCL, YDMF_PHYS%OUT%FPEVPCN, ZFHMLTSC, ZFHEVPPC, ZFPEVPPC, YDMF_PHYS%OUT%FPLCL, & + & YDMF_PHYS%OUT%FPLCN, ZNEBC, ZQLIC, YDMF_PHYS%OUT%STRCU, YDMF_PHYS%OUT%STRCV, ICIS, INLAB, INND, & + & YDMF_PHYS_BASE_STATE%CVV) + + DO JLEV = YDCPG_OPTS%KTDIA, YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%DIFCS(JLON,JLEV) = YDMF_PHYS%OUT%DIFCS(JLON,JLEV) - ZFHEVPPC(JLON,JLEV)& + & - ZFHMLTSC(JLON,JLEV) + YDMF_PHYS%OUT%DIFCQ(JLON,JLEV) = YDMF_PHYS%OUT%DIFCQ(JLON,JLEV) + YDMF_PHYS%OUT%FPEVPCL(JLON,JLEV)& + & + YDMF_PHYS%OUT%FPEVPCN(JLON,JLEV) + ENDDO + ENDDO + YDMF_PHYS%OUT%FPEVPCL=0._JPRB + YDMF_PHYS%OUT%FPEVPCN=0._JPRB + IF (LGRAPRO) THEN + YDMF_PHYS%OUT%FPEVPCG=0._JPRB + ENDIF + ! Prise en compte des nuages convectifs diagnostiques sortant d'ACMTUD + IF (LNCVPGY) THEN + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZNEBC0(JLON,JLEV)=ZNEBC(JLON,JLEV) + ZQLI_CVP(JLON,JLEV)=ZQLIC(JLON,JLEV) + ENDDO + ENDDO + ENDIF + + ! Annulation possible des flux convectifs pour les eaux condensees. + IF (.FALSE.) THEN + DO JLEV=0,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%DIFCQL(JLON,JLEV)=0.0_JPRB + YDMF_PHYS%OUT%DIFCQN(JLON,JLEV)=0.0_JPRB + ENDDO + ENDDO + ENDIF + ENDIF ! (LCVPGY) + + IF ( LCONDWT.AND.(.NOT.LNEBECT)) THEN + + IF(LCVPRO.AND.LNEBCV) THEN +! convective cloudiness in case we need protection of convective cloud water. + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZNEBCH(JLON,JLEV)=ZUNEBH(JLON,JLEV) + ENDDO + ENDDO + IF (LCVCSD) THEN + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZNEBC0(JLON,JLEV)=MAX(ZEPSNEB,& + & MIN(1._JPRB-ZEPSNEB,ZUNEBH(JLON,JLEV))) + ENDDO + ENDDO + ENDIF + ENDIF + + CALL ACNEBCOND (YDCST, YDRIP, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & NTPLUI, YDCPG_OPTS%KFLEVG, LLREDPR, YDSTA, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, YDCPG_MISC%RH, ZBLH, ZQV, ZQI, ZQL, ZMSC_QW, YDMF_PHYS_BASE_STATE%T, & + & ZNEBCH, YDVARS%GEOMETRY%GM%T0, YDMF_PHYS_BASE_STATE%YGSP_RR%T, ZQLIS, ZNEBS, ZRHCRI, ZRH, & + & ZQSATS, ZICEFR1, ZQLIS0, ZNEBS0) + + IF (LMUSCLFA) CALL WRSCMR(NMUSCLFA, 'ZRHCRI', ZRHCRI, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG) + IF (LMUSCLFA) CALL WRSCMR(NMUSCLFA, 'ZQLIS0', ZQLIS0, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG) + IF (LMUSCLFA) CALL WRSCMR(NMUSCLFA, 'ZQLIS', ZQLIS, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG) + + IF(LRKCDEV) THEN +! Rash-Kristiansson cloud water scheme - second part. + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ! analytical solution dRH/dCLOUD: + ZRHDFDA(JLON,JLEV)=2._JPRB*(1._JPRB - ZNEBS(JLON,JLEV))& + & *(1.0_JPRB-ZRHCRI(JLON,JLEV)) + ENDDO + ENDDO + ENDIF + + + ENDIF ! LCONDWT .AND. .NOT.LNEBECT + + !------------------------------------------------- + ! PCMT convection scheme. + !------------------------------------------------- + IF(LGPCMT) THEN + ZSMOOTRAC(1:INBTRA) = GCVTSMO ! as usual + + IF(LEDMFI) THEN + CALL ACPCMT(YDCST, YDGEM, YDGEOMETRY%YRDIM, YDGEOMETRY%YREGEO, YDLDDH, YDMODEL%YRML_DIAG%YRMDDH, & + & YDRIP, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTCVIM, YDCPG_OPTS%KFLEVG, & + & INBTRA, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%ALPH, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDCPG_DYN0%CTY%VVEL(:, 1:), & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, ZMSC_LH, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%LNPR, YDMF_PHYS_BASE_STATE%Q, ZQI, ZQL, YDMF_PHYS_BASE_STATE%R, & + & YDMF_PHYS_BASE_STATE%S, ZQLIS, ZFLU_QSAT, ZMSC_QW, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, & + & ZRDG_CVGQ, YDMF_PHYS_BASE_STATE%T, ZMSC_TW, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, YDMF_PHYS_BASE_STATE%TKE, & + & ZTRA(:, :, INBTRA_DEP:INBTRA), ZSMOOTRAC(1:INBTRA), ZQLC, ZQIC, ZQRC, ZQSC, YDVARS%GEOMETRY%GM%T0, & + & YDMF_PHYS_BASE_STATE%YGSP_RR%T, YDCPG_MISC%QS, ZFLU_NEIJ, YDMF_PHYS_SURF%GSD_VF%PLSM, YDSTA, & + & ZEDMFQ, YDMF_PHYS%OUT%DIFCQL, YDMF_PHYS%OUT%DIFCQN, YDMF_PHYS%OUT%DIFCQLC, YDMF_PHYS%OUT%DIFCQIC, & + & ZEDMFS, ZDIFCVTH, ZTMPPRODTH, YDMF_PHYS%OUT%FCCQL, YDMF_PHYS%OUT%FCCQN, ZEDMFU, ZEDMFV, ZSTRCTRA(:, :, INBTRA_DEP:INBTRA), & + & YDMF_PHYS%OUT%FIMCC, YDMF_PHYS%OUT%FPEVPCL, YDMF_PHYS%OUT%FPEVPCN, YDMF_PHYS%OUT%FPLCL, YDMF_PHYS%OUT%FPLCN, & + & ZMF_UP, ZMU, ZMD, YDMF_PHYS%OUT%FPFPCL, YDMF_PHYS%OUT%FPFPCN, YDMF_PHYS%OUT%FEDQLC, YDMF_PHYS%OUT%FEDQIC, & + & YDMF_PHYS%OUT%FEDQRC, YDMF_PHYS%OUT%FEDQSC, YDMF_PHYS%OUT%FCNEGQLC, YDMF_PHYS%OUT%FCNEGQIC, YDMF_PHYS%OUT%FCNEGQRC, & + & YDMF_PHYS%OUT%FCNEGQSC, INLAB, ZNEBC0, ZQLI_CVP, ZTU, ZQU, ZQC_DET_PCMT, ZCSGC, ZENTCH, INND, & + & YDMF_PHYS%OUT%CAPE, ZAIPCMT, ZALF_CAPE, ZALF_CVGQ, YDVARS%UAL%T0, YDVARS%UOM%T0, YDVARS%DAL%T0, & + & YDVARS%DOM%T0, YDDDH) + ELSE + CALL ACPCMT(YDCST, YDGEM, YDGEOMETRY%YRDIM, YDGEOMETRY%YREGEO, YDLDDH, YDMODEL%YRML_DIAG%YRMDDH, & + & YDRIP, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTCVIM, YDCPG_OPTS%KFLEVG, & + & INBTRA, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%ALPH, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDCPG_DYN0%CTY%VVEL(:, 1:), & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, ZMSC_LH, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%LNPR, YDMF_PHYS_BASE_STATE%Q, ZQI, ZQL, YDMF_PHYS_BASE_STATE%R, & + & YDMF_PHYS_BASE_STATE%S, ZQLIS, ZFLU_QSAT, ZMSC_QW, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, & + & ZRDG_CVGQ, YDMF_PHYS_BASE_STATE%T, ZMSC_TW, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, YDMF_PHYS_BASE_STATE%TKE, & + & ZTRA(:, :, INBTRA_DEP:INBTRA), ZSMOOTRAC(1:INBTRA), ZQLC, ZQIC, ZQRC, ZQSC, YDVARS%GEOMETRY%GM%T0, & + & YDMF_PHYS_BASE_STATE%YGSP_RR%T, YDCPG_MISC%QS, ZFLU_NEIJ, YDMF_PHYS_SURF%GSD_VF%PLSM, YDSTA, & + & YDMF_PHYS%OUT%DIFCQ, YDMF_PHYS%OUT%DIFCQL, YDMF_PHYS%OUT%DIFCQN, YDMF_PHYS%OUT%DIFCQLC, YDMF_PHYS%OUT%DIFCQIC, & + & YDMF_PHYS%OUT%DIFCS, ZDIFCVTH, ZTMPPRODTH, YDMF_PHYS%OUT%FCCQL, YDMF_PHYS%OUT%FCCQN, YDMF_PHYS%OUT%STRCU, & + & YDMF_PHYS%OUT%STRCV, ZSTRCTRA(:, :, INBTRA_DEP:INBTRA), YDMF_PHYS%OUT%FIMCC, YDMF_PHYS%OUT%FPEVPCL, & + & YDMF_PHYS%OUT%FPEVPCN, YDMF_PHYS%OUT%FPLCL, YDMF_PHYS%OUT%FPLCN, ZMF_UP, ZMU, ZMD, YDMF_PHYS%OUT%FPFPCL, & + & YDMF_PHYS%OUT%FPFPCN, YDMF_PHYS%OUT%FEDQLC, YDMF_PHYS%OUT%FEDQIC, YDMF_PHYS%OUT%FEDQRC, YDMF_PHYS%OUT%FEDQSC, & + & YDMF_PHYS%OUT%FCNEGQLC, YDMF_PHYS%OUT%FCNEGQIC, YDMF_PHYS%OUT%FCNEGQRC, YDMF_PHYS%OUT%FCNEGQSC, & + & INLAB, ZNEBC0, ZQLI_CVP, ZTU, ZQU, ZQC_DET_PCMT, ZCSGC, ZENTCH, INND, YDMF_PHYS%OUT%CAPE, & + & ZAIPCMT, ZALF_CAPE, ZALF_CVGQ, YDVARS%UAL%T0, YDVARS%UOM%T0, YDVARS%DAL%T0, YDVARS%DOM%T0, & + & YDDDH) + ENDIF + IF(LFLASH) THEN + ! Lightning flashes: interface between PCMT and CULIGHT input data. + CALL ACLIGHT(YDMODEL%YRML_PHY_MF,YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA,YDCPG_OPTS%KLON,NTCVIM,YDCPG_OPTS%KFLEVG,& + & ZQLC,ZQIC,ZLU,ICBOT,ICTOP,LLCUM,YDMF_PHYS%OUT%CAPE) + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZMFU(JLON,JLEV)=ZMF_UP(JLON,JLEV) + ENDDO + ENDDO + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + LLLAND(JLON)=YDMF_PHYS_SURF%GSD_VF%PLSM(JLON) > 0.5_JPRB + ENDDO + ENDIF + ENDIF + +! Appel du calcul de nebulosite. + + IF(LNEBN) THEN + CALL ACNEBN (YDCST, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTNEBU, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, ZQV, ZQL, ZQI, & + & ZFLU_QSAT, YDMF_PHYS_BASE_STATE%T, ZPFL_FPLCH, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, ZUNEBH, ZNEBS0, ZQLIS0, ZQLI_CVP, ZNEB_CVPP, ZQLI_CVPP, & + & ZAIPCMT, YDCPG_MISC%NEB, ZNEBC0, YDCPG_MISC%QICE, YDCPG_MISC%QLI, YDSTA) + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG +!DEC$ IVDEP + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDCPG_MISC%NEB(JLON,JLEV)=YDCPG_MISC%NEB(JLON,JLEV)*GAEPS + ENDDO + ENDDO + ENDIF + + IF ( LNEBR ) THEN + CALL ACNEBR ( YDERAD, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & NTCOEF, NTNEBU, YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, ZMSC_LSCPE, ZQV, & + & ZFLU_QSAT, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%U, & + & YDMF_PHYS_BASE_STATE%V, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, & + & YDMF_PHYS%OUT%GZ0, ZPFL_FPLCH, YDMF_PHYS_SURF%GSD_VH%PPBLH, YDCPG_MISC%QS, YDMF_PHYS_BASE_STATE%YGSP_RR%T, & + & ZKTROV, ZKUROV, ZNBVNO, YDCPG_MISC%NEB, ZNEBS, YDCPG_MISC%QICE, YDCPG_MISC%QLI, ZQLIS) + ENDIF + +! Diagnostique de nebulosite partielle. + CALL ACNPART(YDCST, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTNEBU, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, & + & ZDECRD, YDCPG_MISC%NEB, YDMF_PHYS%OUT%CLCH, YDMF_PHYS%OUT%CLCM, YDMF_PHYS%OUT%CLCL, YDCPG_MISC%CLCT, & + & ZCLCT_RAD, PCLCC=YDMF_PHYS%OUT%CLCC, PNEBC=ZNEBC0, PTOPC=YDMF_PHYS%OUT%CTOP) + +! 7.3.5 Computation of the equivalent coefficients for simplified +! radiation scheme + + IF ( LRAYSP .AND.(YDCPG_OPTS%KSTEP == 1).AND.LRCOEF ) THEN + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZZNEB(JLON,JLEV)=0.0_JPRB + ENDDO + ENDDO + + CALL ACRADCOEF ( YDRCOEF, YDPHY3, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KTDIA, & + & YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, ZZNEB, ZQV, ZQCO2, YDCPG_MISC%QICE, YDCPG_MISC%QLI, & + & ZQO3, YDMF_PHYS_BASE_STATE%T, ZRDG_MMU0, YDCPG_MISC%DHSF, ZFLU_EMIS, ZAER, ZAC, ZAC_HC, & + & ZRDT_COR, ZRDT_RAB3C, ZRDT_RAB3N, ZRDT_RAB4C, ZRDT_RAB4N, ZRDT_RAB6C, ZRDT_RAB6N, ZRDT_RAT1C, & + & ZRDT_RAT1N, ZRDT_RAT2C, ZRDT_RAT2N, ZRDT_RAT3C, ZRDT_RAT3N, ZRDT_RAT4C, ZRDT_RAT4N, ZRDT_RAT5C, & + & ZRDT_RAT5N) + ENDIF + +! 7.3.6 Module chimique - Chemistry module + + IF (LCHEM_ARPCLIM) THEN ! at this stage call when ARPEGE-Climat chemistry only + + ! initialisation below needs to be refined later for more general use + IFLDX = 1_JPIM + IFLDX2 = 1_JPIM + ILEVX = 1_JPIM + ALLOCATE(ZSD_XA(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,IFLDX), ZSD_X2(YDCPG_OPTS%KLON,IFLDX2)) + ALLOCATE(INDCHEM(NCHEM),IGPLAT(YDCPG_OPTS%KLON)) + ALLOCATE(ZCFLX(YDCPG_OPTS%KLON,NCHEM), ZCFLXO(YDCPG_OPTS%KLON,NCHEM), ZCHEMDV(YDCPG_OPTS%KLON,0)) ! no species with dry deposition in ARPCLIM + ALLOCATE(ZAEROP(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,NACTAERO),ZTENC(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,NCHEM)) + ALLOCATE(ZDELP(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG), ZWND(YDCPG_OPTS%KLON),ZDUMMY1(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG), ZGELAT(YDCPG_OPTS%KLON)) + ALLOCATE(ZNEEFLX(YDCPG_OPTS%KLON),ZCHEM2AER(YDCPG_OPTS%KLON,YDCPG_OPTS%KFLEVG,4)) + INDCHEM(:) = 1_JPIM ! we should have here the indexes of the chemical species in the YCHEM array, to be implemented later + IGPLAT (:) = 1_JPIM + ZSD_XA (:,:,:) = 0._JPRB + ZSD_X2 (:,:) = 0._JPRB + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZDELP(JLON,JLEV) = YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD(JLON,JLEV) - YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD(JLON,JLEV-1) + ENDDO + ENDDO + ZWND (:) = 0._JPRB ! not used in ARPEGE-Climat chemistry + ZDUMMY1 (:,:) = 1.0E-18_JPRB + ZGELAT(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA) = ASIN(YDVARS%GEOMETRY%GEMU%T0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)) + ZCFLX (:,:) = 0._JPRB + ZCFLXO (:,:) = 0._JPRB + ZCHEMDV (:,:) = 0._JPRB + ZAEROP (:,:,:) = 0._JPRB ! no interaction aerosol/chemistry in ARPCLIM + ZTENGFL(:,:,:) = 0._JPRB ! only used later for diagnostics + ZTENC (:,:,:) = 0._JPRB ! not used in ARPEGE-Climat chemistry + ZNEEFLX (:) = 0._JPRB ! not used in ARPEGE-Climat chemistry + ZCHEM2AER (:,:,:) = 0._JPRB ! not used in ARPEGE-Climat chemistry + +!#if false +! ! YDVAB YDDIMV not used for ARPEGE-Climat chemistry +! CALL CHEM_MAIN & +! &( YDVAB, YDDIMV, YDMODEL, KIDIA , KFDIA , KLON , KLEV, KVCLIS, NCHEM, INDCHEM,& +! & TSPHY , IGPLAT, IFLDX , IFLDX2 , ILEVX,& +! & ZSD_XA , ZSD_X2, ZDELP, PAPRS, PAPRSF, PAPHI, PQ, PT,& +! & ZDUMMY1, ZDUMMY1, ZDUMMY1, ZDUMMY1, PNEB,& +! & PFPLCL, PFPLCN, PFPLSL, PFPLSN, ZDUMMY1,& +! & PALB, ZWND, PLSM,& +! & PMU0, ZGELAT, PGELAM, PGEMU, PKOZO, ZCFLX, ZCFLXO, ZCHEMDV, PGFL,& +! & ZAEROP, ZTENGFL, PCHEM, ZTENC, ZNEEFLX, ZCHEM2AER ) +!#endif + ENDIF + + +! 7.4 Rayonnement Geleyn +! Geleyn's radiation + + IF ( LRAY ) THEN + SELECT CASE (NRAY) + CASE(1) + CALL ACRANEB(YDRIP, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & NTRADI, YDCPG_OPTS%KFLEVG, IJN, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, YDCPG_MISC%NEB, ZQV, ZQCO2, YDCPG_MISC%QICE, YDCPG_MISC%QLI, & + & ZQO3, YDMF_PHYS_BASE_STATE%T, YDMF_PHYS%OUT%ALB, ZALBDIR, ZFLU_EMIS, ZRDG_MU0, YDVARS%GEOMETRY%GEMU%T0, & + & YDVARS%GEOMETRY%GELAM%T0, ZRDG_MU0LU, YDMF_PHYS_BASE_STATE%YGSP_RR%T, YDMF_PHYS%OUT%FRSO, YDMF_PHYS%OUT%FRTH, & + & ZFRSODS, YDMF_PHYS%OUT%FRSOPS, YDMF_PHYS%OUT%FRSOLU, YDMF_PHYS%OUT%FRTHDS, ZAER, ZMAK, & + & ZMAN) + + ! update sunshine duration [s] +!DEC$ IVDEP + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + IF ( YDMF_PHYS%OUT%FRSOPS(JLON) > RSUNDUR*ZRDG_MU0(JLON) ) THEN + !YDMF_PHYS_SURF%GSD_VD%PSUND(JLON)=YDMF_PHYS_SURF%GSD_VD%PSUND(JLON)+TSTEP + YDMF_PHYS_SURF%GSD_VD%PSUND(JLON)=YDMF_PHYS_SURF%GSD_VD%PSUND(JLON)+ZADTMS ! fix stepx case + ENDIF + ENDDO + CASE(2) + CALL ACRANEB2(YDERDI, YDRIP, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & NTRADI, YDCPG_OPTS%KFLEVG, IJN, YDCPG_OPTS%KSTEP, YDCFU%NFRRC, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, YDCPG_MISC%NEB, ZQV, ZQCO2, YDCPG_MISC%QICE, YDCPG_MISC%QLI, & + & ZQO3, YDMF_PHYS_BASE_STATE%T, YDMF_PHYS%OUT%ALB, ZALBDIR, ZFLU_EMIS, YDVARS%GEOMETRY%GELAM%T0, & + & YDVARS%GEOMETRY%GEMU%T0, ZRDG_MU0, ZRDG_MU0LU, YDMF_PHYS_BASE_STATE%YGSP_RR%T, ZDECRD, & + & ZCLCT_RAD, YDMF_PHYS%OPT%GDEOSI, YDMF_PHYS%OPT%GUEOSI, YDMF_PHYS%OPT%GMU0, YDMF_PHYS%OPT%GMU0_MIN, & + & YDMF_PHYS%OPT%GMU0_MAX, YDMF_PHYS%OPT%GDEOTI, YDMF_PHYS%OPT%GDEOTI2, YDMF_PHYS%OPT%GUEOTI, & + & YDMF_PHYS%OPT%GUEOTI2, YDMF_PHYS%OPT%GEOLT, YDMF_PHYS%OPT%GEOXT, YDMF_PHYS%OPT%GRPROX, YDMF_PHYS%OPT%GMIXP, & + & YDMF_PHYS%OPT%GFLUXC, YDMF_PHYS%OPT%GRSURF, YDMF_PHYS_SURF%GSD_VD%PSUND, YDMF_PHYS%OUT%FRSO, & + & YDMF_PHYS%OUT%FRTH, YDMF_PHYS%OUT%FRSOC, YDMF_PHYS%OUT%FRTHC, ZFRSODS, YDMF_PHYS%OUT%FRSOPS, & + & YDMF_PHYS%OUT%FRSOLU, YDMF_PHYS%OUT%FRTHDS, ZAER) + ENDSELECT + + ! sum downward diffuse and direct solar radiation at surface + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%FRSODS(JLON)=ZFRSODS(JLON)+YDMF_PHYS%OUT%FRSOPS(JLON) + ENDDO + +! 7.5 Rayonnement Morcrette +! Morcrette's radiation + + ELSEIF ( LRAYFM ) THEN + + LLCALLRAD=(MOD(YDCPG_OPTS%KSTEP,NRADFR) == 0 ) +! IF (NCALLRAD==1) ! <== not yet + IF (NCALLRAD==2) LLCALLRAD=(LLCALLRAD.AND.(YDCPG_OPTS%KSTEP<=NSTOP-1)) +! IF (NCALLRAD==3) ! <== not yet + IAERO=SIZE(ZAERO,3) + ! ---- Intermittent call to radiation scheme + IF (LLCALLRAD) THEN + CALL RECMWF(YDGEOMETRY%YRDIMV, YDMODEL, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, & + & YDCPG_OPTS%KSW, & + & NOZOCL, NAERMACC, IAERO, & + & ZALBD, ZALBP, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, & + & YDCPG_MISC%NEB, ZQO3, ZDUM,ZDUM,ZDUM, & + & ZDUM,ZDUM,ZDUM,ZDUM,ZDUM,& + & ZAER, ZAERO, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, ZFLU_EMIS, & + & ZRDG_MU0M, ZQV, ZFLU_QSAT, YDCPG_MISC%QICE, YDCPG_MISC%QLI, & + & ZQS, ZQR, YDMF_PHYS_SURF%GSD_VF%PLSM, YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%YGSP_RR%T, & + & YDMF_PHYS%RAD%EMTD, YDMF_PHYS%RAD%EMTU, YDMF_PHYS%RAD%TRSW, YDMF_PHYS%OUT%FRTHC, & + & YDMF_PHYS%OUT%FRTH, YDMF_PHYS%OUT%FRSOC, YDMF_PHYS%OUT%FRSO, ZSFSWDIR, ZSFSWDIF, ZFSDNN, & + & ZFSDNV, ZCTRSO, ZCEMTR, ZTRSOD, ZTRSODIR, & + & ZTRSODIF, ZPIZA_DST, ZCGA_DST, ZTAUREL_DST, & + & ZAERINDS, YDVARS%GEOMETRY%GELAM%T0, YDVARS%GEOMETRY%GEMU%T0, YDCPG_GPAR%SWDIR, YDCPG_GPAR%SWDIF, & + & ZRDG_MU0LU, YDMF_PHYS%OUT%ALB, YDMF_PHYS%RAD%RMOON) + ELSE + IF (LMSE) THEN + DO JSG=1,NSW + ZTRSODIR(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JSG)=YDCPG_GPAR%SWDIR(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JSG) + ZTRSODIF(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JSG)=YDCPG_GPAR%SWDIF(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JSG) + ENDDO + ENDIF + ENDIF + + IF (LRAYLU) YDMF_PHYS%OUT%FRSOLU(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=YDMF_PHYS%RAD%RMOON(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA) + + ! ---- Flux update and radiative heating rates + CALL RADHEAT ( YDERAD, YDERDI, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, ZFLU_EMIS, YDMF_PHYS%RAD%EMTD, & + & ZRDG_MU0, ZQV, ZTENT, YDMF_PHYS%RAD%TRSW, ZTRSOD, YDMF_PHYS_BASE_STATE%YGSP_RR%T, TSPHY, & + & ZTRSODIR, ZTRSODIF, ZALBD, ZALBP, YDMF_PHYS%OUT%FRSO, YDMF_PHYS%OUT%FRTH, YDMF_PHYS%OUT%FRSODS, & + & YDMF_PHYS%OUT%FRTHDS, ZCEMTR, ZCTRSO, YDMF_PHYS%OUT%FRSOC, YDMF_PHYS%OUT%FRTHC, ZSUDU, ZSDUR, & + & ZDSRP, ZSFSWDIR, ZSFSWDIF, YDMF_PHYS%OUT%FRSOPS, ZFRSODS, YDMF_PHYS%OUT%FRSOPT ) + + + ! ---- Take into account day duration depending on altitude. + IF(LDAYD) CALL ACDAYD(YDCST, YDRIP, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, & + & YDCPG_OPTS%KTDIA, NTSSG, YDVARS%GEOMETRY%GEMU%T0, ZRDG_MU0, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, YDMF_PHYS%OUT%FRSO) + + ! ---- Correct solar absorption as a function of pmu0. + IF(GRSO < 1._JPRB) CALL ACRSO(YDPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, & + & YDCPG_OPTS%KTDIA, NTSSG, YDVARS%GEOMETRY%GEMU%T0, ZRDG_MU0, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, YDMF_PHYS%OUT%FRSO) + + IF(.NOT.LMSE) THEN + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZALB(JLON)=0.0_JPRB + DO JSG=1,NSW + ZALB(JLON)=ZALB(JLON)+0.5_JPRB*(ZALBD(JLON,JSG)+ZALBP(JLON,JSG)) + ENDDO + ZALB(JLON)=ZALB(JLON)/FLOAT(NSW) + YDMF_PHYS%OUT%FRSODS(JLON)=YDMF_PHYS%OUT%FRSO(JLON,YDCPG_OPTS%KFLEVG,1)/(1.0_JPRB-ZALB(JLON)) + ENDDO + ENDIF + ! Compute Sunshine Duration (in seconds) +!DEC$ IVDEP + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + IF(YDMF_PHYS%OUT%FRSODS(JLON) >= RSUNDUR) THEN + YDMF_PHYS_SURF%GSD_VD%PSUND(JLON)=YDMF_PHYS_SURF%GSD_VD%PSUND(JLON)+1.0_JPRB*TSTEP + ENDIF + ENDDO + + ENDIF + + IF (LRAY.OR.LRAYFM ) THEN + + ! Direct normal irradiance with securities + DO JLON = YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%FRSDNI(JLON)=YDMF_PHYS%OUT%FRSOPS(JLON) + IF (ZRDG_MU0(JLON) > 3.0E-02_JPRB) THEN + YDMF_PHYS%OUT%FRSDNI(JLON)=YDMF_PHYS%OUT%FRSOPS(JLON)/ZRDG_MU0(JLON) + ENDIF + YDMF_PHYS%OUT%FRSDNI(JLON)=MAX(0.0_JPRB,YDMF_PHYS%OUT%FRSDNI(JLON)) + ENDDO + ENDIF + + IF (LRAY.OR.LRAYFM) THEN + + ! global normal irradiance + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%FRSGNI(JLON)=YDMF_PHYS%OUT%FRSDNI(JLON)+0.5_JPRB*( & + & (1.0_JPRB+ZRDG_MU0(JLON))*(YDMF_PHYS%OUT%FRSODS(JLON)-YDMF_PHYS%OUT%FRSOPS(JLON) )+ & + & (1.0_JPRB-ZRDG_MU0(JLON))*(YDMF_PHYS%OUT%FRSODS(JLON)-YDMF_PHYS%OUT%FRSO (JLON,YDCPG_OPTS%KFLEVG,1))) + ENDDO + + ! mean radiant temperature + IF (LXMRT) THEN + CALL MEAN_RAD_TEMP(YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, ZRDG_MU0, YDMF_PHYS%OUT%FRSO(:, YDCPG_OPTS%KFLEVG, 1), & + & YDMF_PHYS%OUT%FRSODS, YDMF_PHYS%OUT%FRSOPS, YDMF_PHYS%OUT%FRTH(:, YDCPG_OPTS%KFLEVG, 1), YDMF_PHYS%OUT%FRTHDS, & + & YDMF_PHYS%OUT%MRT) + ENDIF + + ENDIF + +!* +! ------------------------------------------------------------------ + +! 7.BIS. BILAN HYDRIQUE DU SOL +! ---------------------------- +! CALCUL DES RESISTANCES A L'EVAPOTRANSPIRATION HV ET +! A LA TRANSPIRATION +! ------------------------------------------------------------------ +! HTR DU COUVERT VEGETAL +! ---------------------- + + IF (LSOLV.AND.(.NOT.LMSE)) THEN + CALL ACVEG ( YDPHY, YDPHY1, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS%OUT%FRSO, ZQV, ZFLU_QSAT, YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_SURF%GSD_VV%PD2, YDMF_PHYS_SURF%GSD_VF%PLSM, & + & YDMF_PHYS_SURF%GSD_VV%PIVEG, YDMF_PHYS_SURF%GSD_VV%PLAI, ZFLU_NEIJ, ZFLU_VEG, YDMF_PHYS_SURF%GSD_VV%PRSMIN, & + & ZCHROV, ZGWDCS, ZWFC, YDMF_PHYS_BASE_STATE%YGSP_RR%FC, ZWWILT, YDMF_PHYS_BASE_STATE%YGSP_SB%Q, & + & ZFLU_QSATS, ZHQ, ZHTR, ZHU, YDMF_PHYS_SURF%GSD_VV%PHV, ZWLMX) + ENDIF + +! ------------------------------------------------------------------ +! 8.- DIFFUSION VERTICALE TURBULENTE +! ---------------------------------- + IF ( LVDIF ) THEN + +! Sauvegarde temporaire de l'ancien acdifus pour les besoins du Climat + IF ( LACDIFUS ) THEN + + IF(NDIFFNEB == 1) THEN + ZNEBDIFF(:,:)=ZNEBS(:,:) + ELSEIF(NDIFFNEB == 2) THEN + ZNEBDIFF(:,:)=YDCPG_MISC%NEB(:,:) + ELSEIF(NDIFFNEB == 3) THEN + ZNEBDIFF(:,:)=ZNEBS(:,:)+(1.0_JPRB-ZNEBS(:,:))*ZNEBCH(:,:) + ENDIF + + CALL ACDIFUS ( YDMCC, YGFL, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & NTDIFU, YDCPG_OPTS%KFLEVG, YSP_SBD%NLEVS, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, YDMF_PHYS%OUT%FRSO, & + & ZKTROV, ZKUROV, ZKNROV, ZQV, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, YDMF_PHYS_BASE_STATE%T, & + & YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, ZXTROV, ZXUROV, ZXPTKEROV, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%ALPH, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, ZQL, ZQI, & + & ZNEBDIFF, YDMF_PHYS_BASE_STATE%TKE, ZLMU, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%LNPR, ZFLU_CD, & + & ZFLU_CDN, ZCDROV, ZCHROV, ZCEROV, ZDSA_CPS, YDMF_PHYS%OUT%CT, ZDQSTS, ZFLU_EMIS, YDMF_PHYS_SURF%GSD_VH%PSPSH, & + & ZHQ, ZHTR, ZHU, YDMF_PHYS_SURF%GSD_VV%PHV, YDMF_PHYS_SURF%GSD_VF%PLSM, YDMF_PHYS_SURF%GSD_VV%PIVEG, & + & ZFLU_NEIJ, YDCPG_MISC%QS, ZFLU_QSATS, YDMF_PHYS_BASE_STATE%YGSP_SB%T, YDMF_PHYS_BASE_STATE%YGSP_RR%T, & + & ZFLU_VEG, ZXDROV, ZXHROV, YDMF_PHYS_BASE_STATE%YGSP_RR%W, YDMF_PHYS_BASE_STATE%YGSP_RR%IC, YDMF_PHYS%OUT%DIFTQ, & + & YDMF_PHYS%OUT%DIFTS, YDMF_PHYS%OUT%FCQNG, YDMF_PHYS%OUT%STRTU, YDMF_PHYS%OUT%STRTV, YDMF_PHYS%OUT%DIFTQL, & + & YDMF_PHYS%OUT%DIFTQN, ZTENDPTKE, YDMF_PHYS%OUT%FCHSP, YDMF_PHYS%OUT%FCLL, YDMF_PHYS%OUT%FCLN, & + & YDMF_PHYS%OUT%FCS, ZFLU_FEVI, YDMF_PHYS%OUT%FEVL, YDMF_PHYS%OUT%FEVN, YDMF_PHYS%OUT%FEVV, YDMF_PHYS%OUT%FTR, & + & ZDSA_LHS, YDMF_PHYS%OUT%FRTH, YDMF_PHYS_SURF%GSD_VF%PZ0F, YDMF_PHYS_SURF%GSD_VV%PZ0H) + + ELSE + + IF ( LPTKE ) THEN + IF ( LMSE.AND.LCALLSFX ) THEN + IF (YDCPG_OPTS%KSTEP == 0) THEN + ZFLU_CD(:)=ZFLU_CDN(:) ! very first approximation + ELSE + ZFLU_CD(:)=MAX(YDCPG_GPAR%CD(:),ZEPS0) + ENDIF + ENDIF + CALL ACPTKE(YGFL, YDLDDH, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & YDCPG_OPTS%KTDIA, YDCPG_OPTS%KFLEVG, YDCPG_OPTS%KSTEP, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, ZKNROV, YDMF_PHYS_BASE_STATE%T, & + & YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%ALPH, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, YDMF_PHYS_BASE_STATE%TKE, & + & ZLMU, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%LNPR, ZF_EPS, ZFUN_TTE, ZMRIPP, ZMRIFPP, ZRHS, & + & ZMN2_ES, ZMN2_EQ, ZRRCOR, YDVARS%FQTUR%T0, YDVARS%FSTUR%T0, YDVARS%SHTUR%T0, ZFLU_CD, YDMF_PHYS%OUT%GZ0, & + & ZKUROV, ZKTROV, ZXPTKEROV, ZLMLTILD, YDVARS%MXL%T0, ZLML, ZTH_FUN, ZWW_FUN, ZTENDPTKE, YDVARS%TTE%T0, & + & YDCPG_MISC%FTCNS) + ENDIF + + CALL ACDIFV1 (YDCST, YGFL, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & YDCPG_OPTS%KTDIA, YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, & + & ZCP, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, ZKTROV, ZKQROV, ZKUROV, ZQV, ZQL, ZQI, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, & + & YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, ZSVM, ZXTROV, ZXUROV, & + & ZXDROV, ZXHROV, ZEDMFS, ZEDMFQ, ZEDMFU, ZEDMFV, ZMF_UP, ZXURO, ZXQRO, ZXTRO, ZCFAQ, ZCFAS, & + & ZCFATH, ZCFAU, ZCFASV, ZCFBQ, ZCFBS, ZCFBTH, ZCFBU, ZCFBV, ZCFBSV, ZDSE, ZQT) + + + IF ( LMSE.AND.LCALLSFX ) THEN + + IF (LRAYFM) THEN + ZCARDI=RCARDI + ELSEIF (LRAY) THEN + ZCARDI=QCO2 + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZSFSWDIF(JLON,1)=ZFRSODS(JLON) + ZSFSWDIR(JLON,1)=YDMF_PHYS%OUT%FRSOPS(JLON) + ENDDO + ENDIF + + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZRHODREFM(JLON)=YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF(JLON,YDCPG_OPTS%KFLEVG)/(YDMF_PHYS_BASE_STATE%T(JLON,YDCPG_OPTS%KFLEVG)*YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R(JLON,YDCPG_OPTS%KFLEVG)) + ZDEPTH_HEIGHT(JLON,:)=(YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF(JLON,:)-YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI(JLON,YDCPG_OPTS%KFLEVG))/RG + ZZS(JLON)=YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI(JLON,YDCPG_OPTS%KFLEVG)/RG + ENDDO + + IRR=2 + + CALL ARO_GROUND_PARAM( YDCPG_BNDS%KBL, YDCPG_OPTS%KGPCOMP, YDCPG_BNDS%KFDIA-YDCPG_BNDS%KIDIA+1, & + & YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KSTEP, IRR, NSW, NGFL_EXT, NDGUNG, NDGUXG, & + & NDLUNG, NDLUXG, LSURFEX_KFROM, LMPA, CCOUPLING, YDCPG_OPTS%LCONFX, NINDAT, ZRHGMT, ZSTATI, RSOVR, & + & RCODEC, RSIDEC, YDVARS%GEOMETRY%RINDX%T0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), YDVARS%GEOMETRY%RINDY%T0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & YDMF_PHYS_BASE_STATE%U(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG:YDCPG_OPTS%KFLEVG), & + & YDMF_PHYS_BASE_STATE%V(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG:YDCPG_OPTS%KFLEVG), & + & YDMF_PHYS_BASE_STATE%T(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG:YDCPG_OPTS%KFLEVG), & + & YDMF_PHYS_BASE_STATE%Q(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG:YDCPG_OPTS%KFLEVG), & + & ZSVM(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG:YDCPG_OPTS%KFLEVG, 1:NGFL_EXT), & + & ZCARDI, ZRHODREFM(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG:YDCPG_OPTS%KFLEVG), & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG:YDCPG_OPTS%KFLEVG), & + & ZDTMSE, ZDEPTH_HEIGHT(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG), ZZS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & XZSEPS, ZRDG_MU0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), ZRDG_MU0N(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & YDVARS%GEOMETRY%GELAM%T0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), YDVARS%GEOMETRY%GEMU%T0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & XSW_BANDS, ZSRAIN(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), ZSSNOW(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & ZSGROUPEL(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), YDMF_PHYS%OUT%FRTHDS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & ZSFSWDIF(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, 1:NSW), ZSFSWDIR(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, 1:NSW), & + & ZCFAQ(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG:YDCPG_OPTS%KFLEVG), ZCFATH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG:YDCPG_OPTS%KFLEVG), & + & ZCFAU(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG:YDCPG_OPTS%KFLEVG), ZCFBQ(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG:YDCPG_OPTS%KFLEVG), & + & ZCFBTH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG:YDCPG_OPTS%KFLEVG), ZCFBU(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG:YDCPG_OPTS%KFLEVG), & + & ZCFBV(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG:YDCPG_OPTS%KFLEVG), YDMF_PHYS%OUT%FCS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, 1), & + & ZFEV(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), ZSFSV(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, 1:NGFL_EXT), & + & ZSFCO2(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), ZFMDU(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), ZFMDV(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & ZALBP(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, 1:NSW), ZALBD(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, 1:NSW), & + & ZFLU_EMIS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), ZTSN(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), YDMF_PHYS%OUT%FRTH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG, 1) & + & ) !orographic shadowing + +! Opposite water vapor flux + ZFEVS(:)=-ZFEV(:) + + CALL ARO_GROUND_DIAG( YDCPG_BNDS%KBL, YDCPG_OPTS%KGPCOMP, YDCPG_BNDS%KFDIA-YDCPG_BNDS%KIDIA+1, & + & YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG, -1, NDGUNG, NDGUXG, NDLUNG, NDLUXG, & + & LSURFEX_KFROM, ZZS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), ZFEVS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & YDMF_PHYS_BASE_STATE%U(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, 1:YDCPG_OPTS%KFLEVG), YDMF_PHYS_BASE_STATE%V(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, 1:YDCPG_OPTS%KFLEVG), & + & ZDEPTH_HEIGHT(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, 1:YDCPG_OPTS%KFLEVG), YDMF_PHYS%OUT%FRTH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG, 1), & + & YDMF_PHYS%OUT%FRSO(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG, 1), YDVARS%GEOMETRY%RINDX%T0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & YDVARS%GEOMETRY%RINDY%T0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), YDCPG_MISC%QS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & YDMF_PHYS%OUT%GZ0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), YDMF_PHYS%OUT%GZ0H(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & YDMF_PHYS%OUT%TCLS (YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), YDMF_PHYS%OUT%QCLS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & YDMF_PHYS%OUT%RHCLS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), YDMF_PHYS%OUT%UCLS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & YDMF_PHYS%OUT%VCLS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), YDMF_PHYS%OUT%NUCLS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & YDMF_PHYS%OUT%NVCLS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), YDMF_PHYS%OUT%FCLL(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, 1), & + & YDMF_PHYS%OUT%FCLN(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, 1), YDMF_PHYS%OUT%FEVL(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, 1), & + & YDMF_PHYS%OUT%FEVN(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, 1), ZSSO_STDEV(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & ZTWSNOW(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), ZBUDTH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), ZBUDSO(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & ZFCLL(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), ZTOWNS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), ZCD(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & YDMF_PHYS%OUT%SIC(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)) + + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDCPG_GPAR%GZ0(JLON) = YDMF_PHYS%OUT%GZ0 (JLON) + YDCPG_GPAR%GZ0H(JLON) = YDMF_PHYS%OUT%GZ0H(JLON) + YDCPG_GPAR%VEMIS(JLON) = ZFLU_EMIS(JLON) + YDCPG_GPAR%VQS(JLON) = YDCPG_MISC%QS (JLON) + YDCPG_GPAR%CD(JLON) = ZCD (JLON) + ENDDO + + DO JSG=1,NSW + YDCPG_GPAR%ALBSCA(:,JSG) = ZALBD(:,JSG) + YDCPG_GPAR%ALBDIR(:,JSG) = ZALBP(:,JSG) + ENDDO + + DO JSG = 1, NTSSG+1 + DO JLEV = 0, YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%FRTH(JLON,JLEV,JSG)=YDMF_PHYS%OUT%FRTH(JLON,JLEV,JSG)+ZBUDTH(JLON) + ENDDO + ENDDO + ENDDO + +! calculation of variables for the old "ISBA" atmosphere scheme + IF (.NOT. LELAM) THEN + CALL ARO_GROUND_DIAG_2ISBA( YDCPG_BNDS%KBL, YDCPG_OPTS%KGPCOMP, YDCPG_BNDS%KFDIA-YDCPG_BNDS%KIDIA+1, & + & YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, NDGUNG, NDGUXG, NDLUNG, NDLUXG, LSURFEX_KFROM, YDVARS%GEOMETRY%RINDX%T0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & YDVARS%GEOMETRY%RINDY%T0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), YDMF_PHYS_SURF%GSD_VF%PLSM, & + & YDMF_PHYS_SURF%GSD_VV%PARG, YDMF_PHYS_SURF%GSD_VV%PSAB, YDMF_PHYS_SURF%GSD_VV%PD2, ZTSN, & + & ZTWSNOW, YDMF_PHYS_SURF%GSP_SB%PT_T1(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, 1), YDMF_PHYS_SURF%GSP_RR%PW_T1(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & YDMF_PHYS_SURF%GSP_SB%PQ_T1(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, 1), YDMF_PHYS_SURF%GSP_RR%PIC_T1(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & YDMF_PHYS_SURF%GSP_SB%PTL_T1(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, 1), YDMF_PHYS_SURF%GSP_RR%PFC_T1(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & YDMF_PHYS_SURF%GSP_SG%PA_T1(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, 1), YDMF_PHYS_SURF%GSP_SG%PR_T1(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, 1), & + & ZHV2 ) + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS_SURF%GSD_VV%PHV(JLON) = ZHV2(JLON) + ENDDO + ENDIF + + IF (LDIFCONS.AND..NOT.LNODIFQC) THEN + CALL ACAA1 (YDCST, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KTDIA, & + & YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, ZCOEFN, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, & + & ZQL, ZQI, YDMF_PHYS_BASE_STATE%T, ZALPHA1, ZCOEFA, ZLVT, ZQICE) + ENDIF + + ELSEIF (.NOT.LMSE) THEN + + IF(NDIFFNEB == 5) THEN + ZNEBDIFF(:,:)=ZNEBS(:,:) + ELSEIF(NDIFFNEB == 2) THEN + ZNEBDIFF(:,:)=YDCPG_MISC%NEB(:,:) + ELSEIF(NDIFFNEB == 3) THEN + ZNEBDIFF(:,:)=ZNEBS(:,:)+(1.0_JPRB-ZNEBS(:,:))*ZNEBCH(:,:) + ENDIF + + IF (.NOT. LSFORCS) THEN + IF (LEDMFI) THEN + ZCFBS_G(:,:) = ZCFBS(:,:) + ZCFBQ_G(:,:) = ZCFBQ(:,:) + ZCFBU_G(:,:) = ZCFBU(:,:) + ZCFBV_G(:,:) = ZCFBV(:,:) + ENDIF + CALL ARP_GROUND_PARAM (YDCST, YDMCC, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & YDCPG_OPTS%KTDIA, YDCPG_OPTS%KFLEVG, YSP_SBD%NLEVS, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, & + & ZCP, YDMF_PHYS%OUT%FRSO, ZQV, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, YDMF_PHYS_BASE_STATE%T, & + & YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, ZXURO, ZXQRO, ZXTRO, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, & + & ZQL, ZQI, ZNEBDIFF, ZFLU_CD, ZFLU_CDN, ZCDROV, ZCHROV, ZCEROV, ZDSA_CPS, YDMF_PHYS%OUT%CT, & + & ZDQSTS, ZFLU_EMIS, YDMF_PHYS_SURF%GSD_VH%PSPSH, ZHQ, ZHTR, ZHU, YDMF_PHYS_SURF%GSD_VV%PHV, & + & YDMF_PHYS_SURF%GSD_VF%PLSM, YDMF_PHYS_SURF%GSD_VV%PIVEG, ZFLU_NEIJ, YDCPG_MISC%QS, & + & ZFLU_QSATS, YDMF_PHYS_BASE_STATE%YGSP_SB%T, YDMF_PHYS_BASE_STATE%YGSP_RR%T, ZFLU_VEG, & + & ZXDROV, ZXHROV, YDMF_PHYS_BASE_STATE%YGSP_RR%W, YDMF_PHYS_BASE_STATE%YGSP_RR%IC, ZDSE, & + & ZCFAS, ZCFAU, ZCFBS, ZCFBU, ZCFBV, ZCFBQ, ZCOEFA, ZALPHA1, ZLVT, ZQICE, ZDIFWQ, ZDIFWS, & + & ZFMDU, ZFMDV, ZSC_FEVI, ZSC_FEVN, ZSC_FCLL, ZSC_FCLN, YDMF_PHYS%OUT%FCHSP, YDMF_PHYS%OUT%FCLL, & + & YDMF_PHYS%OUT%FCLN, YDMF_PHYS%OUT%FCS, ZFLU_FEVI, YDMF_PHYS%OUT%FEVL, YDMF_PHYS%OUT%FEVN, & + & YDMF_PHYS%OUT%FEVV, YDMF_PHYS%OUT%FTR, ZDSA_LHS, YDMF_PHYS_SURF%GSD_VH%PQSH, YDMF_PHYS%OUT%FRTH, & + & YDMF_PHYS_SURF%GSD_VF%PZ0F, YDMF_PHYS_SURF%GSD_VV%PZ0H) + + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%DIFTQ(JLON,YDCPG_OPTS%KFLEVG)=ZDIFWQ(JLON) + YDMF_PHYS%OUT%DIFTS(JLON,YDCPG_OPTS%KFLEVG)=ZDIFWS(JLON) + ENDDO + + IF (LEDMFI) THEN + ZCFBQ(:,:) = ZCFBQ_G(:,:) + ZCFBS(:,:) = ZCFBS_G(:,:) + ZCFBU(:,YDCPG_OPTS%KFLEVG) = ZCFBU_G(:,YDCPG_OPTS%KFLEVG) + ZCFBV(:,YDCPG_OPTS%KFLEVG) = ZCFBV_G(:,YDCPG_OPTS%KFLEVG) + ENDIF + + ENDIF ! <== LSFORCS + + ELSEIF (.NOT. LCALLSFX) THEN + YDMF_PHYS%OUT%FCS(:,:) = 0.0_JPRB + ZFEV(:) = 0.0_JPRB + + ENDIF !LMSE.AND.LCALLSFX + + CALL ACDIFV2 (LSFORCS, YDCST, YGFL, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON,& + & YDCPG_OPTS%KTDIA, YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, ZCFAQ, ZCFAS, & + & ZCFAU, ZCFASV, ZCFBQ, ZCFBS, ZCFBU, ZCFBV, ZCFBSV, ZKTROV, ZKQROV, ZKQLROV, ZKUROV, ZDSE, & + & ZQT, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, ZPOID, YDMF_PHYS_BASE_STATE%T, ZQL, ZQI, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, ZCOEFA, ZALPHA1, ZLVT, ZQICE, ZSFSV, YDMF_PHYS%OUT%FCS, & + & ZFEV, ZFMDU, ZFMDV, ZTSN, ZXHROV, ZDIFEXT, YDMF_PHYS%OUT%DIFTQ, YDMF_PHYS%OUT%DIFTS, YDMF_PHYS%OUT%STRTU, & + & YDMF_PHYS%OUT%STRTV, YDMF_PHYS%OUT%DIFTQL, YDMF_PHYS%OUT%DIFTQN, YDMF_PHYS%OUT%DIFCQ, YDMF_PHYS%OUT%DIFCS, & + & YDMF_PHYS%OUT%STRCU, YDMF_PHYS%OUT%STRCV, YDVARS%SHTUR%T0 ) + + IF (LEDKF) THEN + IF (LSFORCS) THEN + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS_SURF%GSD_SFL%PGROUP(JLON,1) = YDMF_PHYS%OUT%FCS(JLON,1) + YDMF_PHYS_SURF%GSD_SFL%PGROUP(JLON,2) = ZFEV(JLON) + ENDDO + ELSE + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS_SURF%GSD_SFL%PGROUP(JLON,1) = YDMF_PHYS%OUT%DIFTS(JLON,YDCPG_OPTS%KFLEVG) + YDMF_PHYS_SURF%GSD_SFL%PGROUP(JLON,2) = YDMF_PHYS%OUT%DIFTQ(JLON,YDCPG_OPTS%KFLEVG) + ENDDO + ENDIF + ENDIF + + IF ( LMSE ) THEN + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDCPG_GPAR%VTS(JLON) = ZTSN (JLON) + YDMF_PHYS_SURF%GSP_SG%PF_T1(JLON,1) = ZTWSNOW (JLON) + ENDDO + ENDIF + + ! First compute horizontal exchange coefficients for momentum: + ! (there's mo TOMs contribution, thus has to be done at latest here) + IF (L3DTURB) THEN + CALL ACTKECOEFKH(YDRIP, YDMODEL%YRML_PHY_MF, YDGEOMETRY%YREGEO, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, & + & YDCPG_OPTS%KLON, YDCPG_OPTS%KTDIA, YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%TKE, ZTENDPTKE, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%T, & + & YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%ALPH, YDMF_PHYS_BASE_STATE%DIV, & + & YDMF_PHYS_BASE_STATE%VOR, YDVARS%U%DL, YDVARS%V%DL, YDMF_PHYS_BASE_STATE%YCPG_PHY%W, YDMF_PHYS_BASE_STATE%YCPG_PHY%WL, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%WM, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%LNPR, ZLML, ZFHORM, ZFHORH, ZKUROV, ZRTI, ZFLU_CD, & + & ZCDROV, LPTKE, ZKUR_KUROV_H, ZKUR_KTROV_H, ZRHS) + ENDIF + + IF (LCOEFKTKE) THEN + IF (NDIFFNEB == 1) THEN + ZCOEFA(:,:) = ZBNEBQ(:,:) + ELSEIF (NDIFFNEB == 4) THEN + ZCOEFA(:,:) = ZBNEBCVPP(:,:) + ENDIF + CALL ACDIFV3 ( YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KTDIA, & + & YDCPG_OPTS%KFLEVG, YDCPG_OPTS%KSTEP, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, ZCP, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, ZKTROV, & + & ZXTROV, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, & + & ZCHROV, ZXHROV, ZCOEFA, ZQV, ZQL, ZQI, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, YDMF_PHYS_BASE_STATE%T, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%ALPH, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%LNPR, ZLML, & + & ZTH_FUN, ZWW_FUN, ZF_EPS, YDMF_PHYS%OUT%DIFTS, YDMF_PHYS%OUT%DIFTQ, YDMF_PHYS_BASE_STATE%TKE, & + & ZTENDPTKE, ZMN2_ES, ZMN2_EQ, ZMN2_DS, ZMN2_DQ, YDMF_PHYS%OUT%DIFTQL, YDMF_PHYS%OUT%DIFTQN, & + & ZDIFWQ, ZDIFWS, YDMF_PHYS%OUT%FCLL, YDMF_PHYS%OUT%FCLN, YDMF_PHYS%OUT%FCS, ZFLU_FEVI, YDMF_PHYS%OUT%FEVL, & + & YDMF_PHYS%OUT%FEVN, YDMF_PHYS%OUT%GZ0, ZRTI, ZSC_FEVI, ZSC_FEVN, ZSC_FCLL, ZSC_FCLN, & + & ZTSTAR, ZTSTAR2, ZTSTARQ, ZTSTAR2Q) + + !store fluxes and shear term + !GFL fields are on full levels, fluxes on half levels + IF (YFQTUR%LGP.AND.YFSTUR%LGP) THEN + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDVARS%FQTUR%T0(JLON,JLEV)=YDMF_PHYS%OUT%DIFTQ(JLON,JLEV)+YDMF_PHYS%OUT%DIFTQL(JLON,JLEV)& + & +YDMF_PHYS%OUT%DIFTQN(JLON,JLEV) + YDVARS%FSTUR%T0(JLON,JLEV)=YDMF_PHYS%OUT%DIFTS(JLON,JLEV) + ENDDO + ENDDO + ENDIF + ENDIF ! LCOEFKTKE + + ! Now the heat coefficient can be completed by TKE+ containing + ! the TOMs contribution. + IF (L3DTURB) THEN + CALL ACTKECOEFKH(YDRIP, YDMODEL%YRML_PHY_MF, YDGEOMETRY%YREGEO, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, & + & YDCPG_OPTS%KLON, YDCPG_OPTS%KTDIA, YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%TKE, ZTENDPTKE, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%T, & + & YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%ALPH, YDMF_PHYS_BASE_STATE%DIV, & + & YDMF_PHYS_BASE_STATE%VOR, YDVARS%U%DL, YDVARS%V%DL, YDMF_PHYS_BASE_STATE%YCPG_PHY%W, YDMF_PHYS_BASE_STATE%YCPG_PHY%WL, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%WM, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%LNPR, ZLML, ZFHORM, ZFHORH, ZKUROV, ZRTI, ZFLU_CD, & + & ZCDROV, LPTKE, ZKUR_KUROV_H, ZKUR_KTROV_H, ZRHS) + ENDIF + + ENDIF + +!----------------------------------------------------------------------------- +! THE DEEP CONVECTION WILL SEE THE SHALLOW PART FROM KFB AS IT IS WITH LOUIS +! SCHEME AND THE MODIFIED RI +!---------------------------------------------------------------------------- + IF (LCVPPKF.OR.(LEDKF .AND. .NOT. LEDMFI)) THEN + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%DIFTQ (JLON,JLEV) = YDMF_PHYS%OUT%DIFTQ(JLON,JLEV) + ZDIFCVPPQ(JLON,JLEV) + YDMF_PHYS%OUT%DIFTS (JLON,JLEV) = YDMF_PHYS%OUT%DIFTS(JLON,JLEV) + ZDIFCVPPS(JLON,JLEV) + YDMF_PHYS%OUT%STRTU (JLON,JLEV) = YDMF_PHYS%OUT%STRTU(JLON,JLEV) + ZDIFCVPPU(JLON,JLEV) + YDMF_PHYS%OUT%STRTV (JLON,JLEV) = YDMF_PHYS%OUT%STRTV(JLON,JLEV) + ZDIFCVPPV(JLON,JLEV) + ENDDO + ENDDO + ENDIF + + IF (L3MT) THEN + + ! ------------------------------------------------------------------ + ! UPDATE TEMPERATURE, LIQUID WATER AND ICE BY THE TURBULENT FLUXES + ! INCLUDING CORRECTION OF NEGATIVE VALUES OF WATER SPECIES + ! SAVE THE INCREMENTAL PART DUE TO THE TURBULENT DIFFUSION PROCESSES + ! ------------------------------------------------------------------ + +! setup of auxiliary variables for water vapour updating for RK condensation scheme + + IF(LRKCDEV) THEN + ZDTURDIFF=1._JPRB + IF (LCVGQD) ZDTURDIFF=0._JPRB + ENDIF + +!cdir unroll=8 + DO JLEV = YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG +!DEC$ IVDEP + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + + ZT(JLON,JLEV)=YDMF_PHYS_BASE_STATE%T(JLON,JLEV)-ZIPOI(JLON,JLEV)/YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP(JLON,JLEV)& + & *(YDMF_PHYS%OUT%DIFTS(JLON,JLEV)-YDMF_PHYS%OUT%DIFTS(JLON,JLEV-1)) + ZQX0=ZQI(JLON,JLEV) + ZQX1=ZQX0-ZIPOI(JLON,JLEV)*(YDMF_PHYS%OUT%DIFTQN(JLON,JLEV)& + & -YDMF_PHYS%OUT%DIFTQN(JLON,JLEV-1)) + ZQI(JLON,JLEV)=MAX(0.0_JPRB,ZQX1) + ZDQI=MAX(0.0_JPRB,ZQX1)-ZQX1 + ZFCQING(JLON,JLEV)=ZFCQING(JLON,JLEV-1)-ZDQI*ZPOID(JLON,JLEV) + YDMF_PHYS%OUT%FCQNNG(JLON,JLEV)=YDMF_PHYS%OUT%FCQNNG(JLON,JLEV)+ZFCQING(JLON,JLEV) + ZQX0=ZQL(JLON,JLEV) + ZQX1=ZQX0-ZIPOI(JLON,JLEV)*(YDMF_PHYS%OUT%DIFTQL(JLON,JLEV)& + & -YDMF_PHYS%OUT%DIFTQL(JLON,JLEV-1)) + ZQL(JLON,JLEV)=MAX(0.0_JPRB,ZQX1) + ZDQL= MAX(0.0_JPRB,ZQX1)-ZQX1 + ZFCQLNG(JLON,JLEV)=ZFCQLNG(JLON,JLEV-1)-ZDQL*ZPOID(JLON,JLEV) + YDMF_PHYS%OUT%FCQLNG(JLON,JLEV)=YDMF_PHYS%OUT%FCQLNG(JLON,JLEV)+ZFCQLNG(JLON,JLEV) + ZDQC=ZDQI+ZDQL + + ZQX0=ZQV(JLON,JLEV) + ZQX1=ZQX0-ZIPOI(JLON,JLEV)*(YDMF_PHYS%OUT%DIFTQ(JLON,JLEV)& + & -YDMF_PHYS%OUT%DIFTQ(JLON,JLEV-1)) + ZQV0=ZQX1-ZIPOI(JLON,JLEV)*(0.0_JPRB& + & -ZFCQVNG(JLON,JLEV-1)-ZFCQING(JLON,JLEV-1)& + & -ZFCQLNG(JLON,JLEV-1)) + IF(LCVGQD) THEN + ZQV(JLON,JLEV)=MAX(0.0_JPRB,ZQV0-ZDQC) + ENDIF + ZDQV=MAX(0.0_JPRB,ZQV0-ZDQC)-ZQX1 + ZDQVDIFF(JLON,JLEV)=ZDQV+ZQX1-ZQX0 + ZFCQVNG(JLON,JLEV)=ZFCQVNG(JLON,JLEV-1)-ZDQV*ZPOID(JLON,JLEV) + YDMF_PHYS%OUT%FCQNG(JLON,JLEV)=YDMF_PHYS%OUT%FCQNG(JLON,JLEV)+ZFCQVNG(JLON,JLEV) + IF(LRKCDEV.AND.YDCPG_OPTS%KSTEP>0) THEN + ZDTRAD(JLON,JLEV)=ZIPOI(JLON,JLEV)/YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP(JLON,JLEV)* (& + & YDMF_PHYS%OUT%FRSO(JLON,JLEV-1,1)-YDMF_PHYS%OUT%FRSO(JLON,JLEV,1)& + & +YDMF_PHYS%OUT%FRTH(JLON,JLEV-1,1)-YDMF_PHYS%OUT%FRTH(JLON,JLEV,1) ) + ZRKTTEND(JLON,JLEV)=(ZT(JLON,JLEV)-YDVARS%RKTH%T0(JLON,JLEV)& + & +ZDTRAD(JLON,JLEV))/TSPHY + ZRKQVTEND(JLON,JLEV)=(MAX(0._JPRB,ZQV(JLON,JLEV)& + & +ZDQVDIFF(JLON,JLEV)*ZDTURDIFF)& + & -MAX(0._JPRB,YDVARS%RKTQV%T0(JLON,JLEV)))/TSPHY + ZRKQCTEND(JLON,JLEV)= (MAX(0._JPRB,ZQI(JLON,JLEV)+ZQL(JLON,JLEV))& + & -MAX(0._JPRB,YDVARS%RKTQC%T0(JLON,JLEV)))/TSPHY + ENDIF + ENDDO + ENDDO + + ELSEIF (LSTRAPRO) THEN + + ! ------------------------------------------------------------------ + ! UPDATE THE CORRECTION FLUXES FOR NEGATIVE VALUES OF WATER SPECIES + ! SAVE THE INCREMENTAL PART DUE TO THE TURBULENT DIFFUSION PROCESSES + ! ------------------------------------------------------------------ + DO JLEV = YDCPG_OPTS%KTDIA, YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + + ZT (JLON,JLEV)= YDMF_PHYS_BASE_STATE%T(JLON,JLEV) + ZQX0=ZQI(JLON,JLEV) + ZQX1=ZQX0-ZIPOI(JLON,JLEV)*(YDMF_PHYS%OUT%DIFTQN(JLON,JLEV)& + & -YDMF_PHYS%OUT%DIFTQN(JLON,JLEV-1)) + ZDQI= MAX(0.0_JPRB,ZQX1)-ZQX1 + ZFCQING(JLON,JLEV)=ZFCQING(JLON,JLEV-1)-ZDQI*ZPOID(JLON,JLEV) + YDMF_PHYS%OUT%FCQNNG(JLON,JLEV)=YDMF_PHYS%OUT%FCQNNG(JLON,JLEV)+ZFCQING(JLON,JLEV) + ZQX0=ZQL(JLON,JLEV) + ZQX1=ZQX0-ZIPOI(JLON,JLEV)*(YDMF_PHYS%OUT%DIFTQL(JLON,JLEV)& + & -YDMF_PHYS%OUT%DIFTQL(JLON,JLEV-1)) + ZDQL= MAX(0.0_JPRB,ZQX1)-ZQX1 + ZFCQLNG(JLON,JLEV)=ZFCQLNG(JLON,JLEV-1)-ZDQL*ZPOID(JLON,JLEV) + YDMF_PHYS%OUT%FCQLNG(JLON,JLEV)=YDMF_PHYS%OUT%FCQLNG(JLON,JLEV)+ZFCQLNG(JLON,JLEV) + ZDQC=ZDQI+ZDQL + + ZQX0=ZQV(JLON,JLEV) + ZQX1=ZQX0-ZIPOI(JLON,JLEV)*(YDMF_PHYS%OUT%DIFTQ(JLON,JLEV)& + & -YDMF_PHYS%OUT%DIFTQ(JLON,JLEV-1)) + ZQV0=ZQX1-ZIPOI(JLON,JLEV)*(0.0_JPRB& + & -ZFCQVNG(JLON,JLEV-1)-ZFCQING(JLON,JLEV-1)& + & -ZFCQLNG(JLON,JLEV-1)) + ZDQV=MAX(0.0_JPRB,ZQV0-ZDQC)-ZQX1 + ZFCQVNG(JLON,JLEV)=ZFCQVNG(JLON,JLEV-1)-ZDQV*ZPOID(JLON,JLEV) + YDMF_PHYS%OUT%FCQNG(JLON,JLEV)=YDMF_PHYS%OUT%FCQNG(JLON,JLEV)+ZFCQVNG(JLON,JLEV) + + ENDDO + ENDDO + + ENDIF ! 3MT || LSTRAPRO + + ! ------------------------------------------------------ + ! DIAGNOSTIC DE LA HAUTEUR DE COUCHE LIMITE, SELON TROEN ET MAHRT, + ! POUR USAGE AU PAS DE TEMPS SUIVANT. + ! ------------------------------------------------------ + + IF((TRIM(CGMIXLEN) == 'TM').OR.(TRIM(CGMIXLEN) == 'TMC')) THEN + ZBLH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=MIN(XMAXLM,MAX(XMINLM,YDMF_PHYS_SURF%GSD_VH%PPBLH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA))) + CALL ACPBLHTM ( YDPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTDIFU, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, ZQV, YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, YDMF_PHYS%OUT%STRTU, & + & YDMF_PHYS%OUT%STRTV, ZPCLS, YDMF_PHYS%OUT%TCLS, YDMF_PHYS%OUT%QCLS, YDMF_PHYS%OUT%FCS, YDMF_PHYS%OUT%FCLL, & + & YDMF_PHYS%OUT%FCLN, ZDSA_LHS, YDMF_PHYS%OUT%GZ0, IMOC_CLPH, ZBLH, ZUGST, ZVGST) + YDMF_PHYS_SURF%GSD_VH%PPBLH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=ZBLH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA) + YDMF_PHYS%OUT%CLPH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=ZBLH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA) + IF (.NOT.LRAFTUR) THEN + YDMF_PHYS%OUT%UGST(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=ZUGST(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA) + YDMF_PHYS%OUT%VGST(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=ZVGST(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA) + ENDIF + ENDIF + + IF(LNEBCO.AND.LNEBR)THEN + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZPREN(JLON)=YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD(JLON,YDCPG_OPTS%KFLEVG) + ENDDO + CALL ACPBLH ( YDPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTDIFU, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, & + & ZQV, YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, & + & YDMF_PHYS%OUT%STRTU, YDMF_PHYS%OUT%STRTV, ZPREN, YDMF_PHYS_BASE_STATE%YGSP_RR%T, YDCPG_MISC%QS, & + & YDMF_PHYS%OUT%FCS, YDMF_PHYS%OUT%FCLL, YDMF_PHYS%OUT%FCLN, ZDSA_LHS, ZRTI, YDMF_PHYS_SURF%GSD_VH%PPBLH & + & ) + ENDIF + ! ------------------------------------------------------------------ + ! UPDATE PASSIFS SCALAIRS DUE TO THE TURBULENT DIFFUSION PROCESSES + ! ------------------------------------------------------------------ + IF (LMDUST.AND.(NGFL_EXT/=0)) THEN + DO JGFL=1,NGFL_EXT + DO JLON=1,YDCPG_OPTS%KLON + DO JLEV=1,YDCPG_OPTS%KFLEVG + ZSVM(JLON,JLEV,JGFL)=ZSVM(JLON,JLEV,JGFL)-ZIPOI(JLON,JLEV)& + & *(ZDIFEXT(JLON,JLEV,JGFL)-ZDIFEXT(JLON,JLEV-1,JGFL)) + ZSVM(JLON,JLEV,JGFL)=MAX(ZSVM(JLON,JLEV,JGFL),0.0_JPRB) + ENDDO + ENDDO + ENDDO + ENDIF ! LMDUST + ENDIF ! LVDIF + +! DIAGNOSTIC SUPPLEMENTAIRE FLUX DE RAYONNEMENT (PFRTHDS ET PFRSOPT) +! ADDITIONAL DIAGNOSTICS OF RADIATIVE FLUXES (PFRTHDS AND PFRSOPT) + +!DEC$ IVDEP + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + IF(.NOT.LMSE)YDMF_PHYS%OUT%FRTHDS(JLON)=YDMF_PHYS%OUT%FRTH(JLON,YDCPG_OPTS%KFLEVG,1)/ZFLU_EMIS(JLON)+RSIGMA*YDMF_PHYS_BASE_STATE%YGSP_RR%T(JLON)**4 + IF(ZRDG_MU0(JLON) <= 0.0_JPRB) THEN + + + YDMF_PHYS%OUT%FRSOPT(JLON)=0.0_JPRB + ELSE + YDMF_PHYS%OUT%FRSOPT(JLON)=RII0*ZRDG_MU0(JLON) + ENDIF + ENDDO + +! ADDITIONAL DIAGNOSTIC OF THE DERIVATIVE OF THE NON SOLAR SURFACE +! HEAT FLUX WITH RESPECT TO SURFACE TEMPERATURE (PDERNSHF) + + IF(LMCC03)THEN + CALL ACDNSHF(YDCST, YDPHY, YDPHY1, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KTDIA, & + & YDCPG_OPTS%KFLEVG, ZFLU_EMIS, YDMF_PHYS_SURF%GSD_VF%PLSM, ZFLU_NEIJ, ZQV, YDCPG_MISC%QS, YDMF_PHYS_BASE_STATE%YGSP_RR%T, & + & ZCHROV, ZDQSTS, YDMF_PHYS%OUT%DRNSHF) + ENDIF + +!* +! ------------------------------------------------------------------ +! 9.- TRAINEE DES ONDES DE GRAVITE INDUITES PAR LE RELIEF +! ------------------------------------------------------------------ + IF ( LGWD ) THEN + CALL ACDRAG (YDCST, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTDRAG, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, & + & ZNBVNO, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, & + & YDVARS%GEOMETRY%RCORI%T0, YDMF_PHYS_SURF%GSD_VF%PGETRL, ZGWDCS, YDMF_PHYS_SURF%GSD_VF%PVRLAN, YDMF_PHYS_SURF%GSD_VF%PVRLDI, & + & YDMF_PHYS%OUT%STRDU, YDMF_PHYS%OUT%STRDV, ZTRAJGWD) + ENDIF + ! SAVE FOR TL/NL COEFS FROM VERT. DIFF AND GWD + + IF (LTRAJPS.AND.(LVDIFSPNL.OR.LGWDSPNL)) THEN + + + IF(.NOT.LVDIFSPNL) THEN + ZKTROV_SAVE(:,:)=0.0_JPRB + ZKUROV_SAVE(:,:)=0.0_JPRB + ZCDROV_SAVE(:)=0.0_JPRB + ZCHROV_SAVE(:)=0.0_JPRB + ENDIF + IF(.NOT. LGWDSPNL) THEN + ZTRAJGWD(:,:)=0.0_JPRB + ENDIF + + CALL WRPHTRAJTM_NL(YDGEOMETRY, YDSIMPHL, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, PTRAJ_PHYS, & + & ZKTROV_SAVE, ZKUROV_SAVE, ZCDROV_SAVE, ZCHROV_SAVE, ZTRAJGWD, YDMF_PHYS_BASE_STATE%L, YDMF_PHYS_BASE_STATE%I, & + & YDMF_PHYS_BASE_STATE%R, YDMF_PHYS_BASE_STATE%S, ZQLIS, ZNEBS) + ENDIF + +! ------------------------------------------------------------------ +! 10.- PRECIPITATIONS STRATIFORMES. +! --------------------------------- + + IF ( LSTRA.AND.(.NOT.LSTRAPRO) ) THEN + CALL ACPLUIE ( YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTPLUI, & + & YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, & + & ZQV, ZMSC_QW, YDMF_PHYS_BASE_STATE%T, YDMF_PHYS%OUT%FPFPSL, YDMF_PHYS%OUT%FPFPSN, YDMF_PHYS%OUT%FCSQL, & + & YDMF_PHYS%OUT%FCSQN, YDMF_PHYS%OUT%FPEVPSL, YDMF_PHYS%OUT%FPEVPSN, YDMF_PHYS%OUT%FPLSL, YDMF_PHYS%OUT%FPLSN& + & ) + ENDIF + + IF ( LSTRAS ) THEN + CALL ACPLUIS (YDCST, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTPLUI, & + & YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, & + & ZNEBS, ZQV, ZQLIS, ZMSC_QW, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, YDMF_PHYS_BASE_STATE%T, YDMF_PHYS%OUT%FCSQL, & + & YDMF_PHYS%OUT%FCSQN, YDMF_PHYS%OUT%FPLSL, YDMF_PHYS%OUT%FPLSN, YDMF_PHYS%OUT%FPEVPSL, YDMF_PHYS%OUT%FPEVPSN, & + & YDMF_PHYS%OUT%FPFPSL, YDMF_PHYS%OUT%FPFPSN ) + ENDIF + + IF (L3MT.OR.LSTRAPRO) THEN + + IF (LCOEFKTKE.OR.LLREDPR) THEN + CALL ACTQSATS ( YDPHY, YDPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTQSAT, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, ZQV, ZT, & + & ZGEOSLC, ZLH, ZLSCPE, ZQSAT, ZQW, ZRH, ZTW) + CALL ACNEBCOND (YDCST, YDRIP, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & NTPLUI, YDCPG_OPTS%KFLEVG, LLREDPR, YDSTA, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, YDCPG_MISC%RH, ZBLH, ZQV, ZQI, ZQL, ZQW, ZT, ZNEBCH, & + & YDVARS%GEOMETRY%GM%T0, YDMF_PHYS_BASE_STATE%YGSP_RR%T, ZQLIS, ZNEBS, ZRHCRI, ZRH, ZQSATS, & + & ZICEFR1, ZQLIS0, ZNEBS0) + CALL ACCDEV (YDCST, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTPLUI, & + & YDCPG_OPTS%KFLEVG, YDSTA, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, & + & ZQV, ZQI, ZQL, ZQS, ZQR, ZQG, ZQW, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, ZT, ZMSC_TW, ZNEBS, & + & ZRHCRI, ZICEFR1, ZQSATS, ZNEBCH, ZRHDFDA, ZRKTTEND, ZRKQVTEND, ZRKQCTEND, ZQLI_CVPP, & + & ZNEB_CVPP, YDMF_PHYS_SURF%GSD_VF%PLSM, ZFLU_NEIJ, YDVARS%GEOMETRY%GM%T0, YDMF_PHYS_BASE_STATE%YGSP_RR%T, & + & ZDECRD_MF, YDMF_PHYS%OUT%FPFPSL, YDMF_PHYS%OUT%FPFPSN, YDMF_PHYS%OUT%FPFPSG, YDMF_PHYS%OUT%FCSQL, & + & YDMF_PHYS%OUT%FCSQN, YDMF_PHYS%OUT%FPEVPSL, YDMF_PHYS%OUT%FPEVPSN, YDMF_PHYS%OUT%FPEVPSG, YDMF_PHYS%OUT%FPLSL, & + & YDMF_PHYS%OUT%FPLSN, YDMF_PHYS%OUT%FPLSG, ZSEDIQL, ZSEDIQI, YDMF_PHYS%OUT%DIAGH) + ELSE + CALL ACCDEV (YDCST, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTPLUI, & + & YDCPG_OPTS%KFLEVG, YDSTA, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, & + & ZQV, ZQI, ZQL, ZQS, ZQR, ZQG, ZMSC_QW, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, YDMF_PHYS_BASE_STATE%T, & + & ZMSC_TW, ZNEBS, ZRHCRI, ZICEFR1, ZQSATS, ZNEBCH, ZRHDFDA, ZRKTTEND, ZRKQVTEND, ZRKQCTEND, & + & ZQLI_CVPP, ZNEB_CVPP, YDMF_PHYS_SURF%GSD_VF%PLSM, ZFLU_NEIJ, YDVARS%GEOMETRY%GM%T0, YDMF_PHYS_BASE_STATE%YGSP_RR%T, & + & ZDECRD_MF, YDMF_PHYS%OUT%FPFPSL, YDMF_PHYS%OUT%FPFPSN, YDMF_PHYS%OUT%FPFPSG, YDMF_PHYS%OUT%FCSQL, & + & YDMF_PHYS%OUT%FCSQN, YDMF_PHYS%OUT%FPEVPSL, YDMF_PHYS%OUT%FPEVPSN, YDMF_PHYS%OUT%FPEVPSG, YDMF_PHYS%OUT%FPLSL, & + & YDMF_PHYS%OUT%FPLSN, YDMF_PHYS%OUT%FPLSG, ZSEDIQL, ZSEDIQI, YDMF_PHYS%OUT%DIAGH) + ENDIF + + ENDIF + + IF (L3MT) THEN + + + ! ---------------------------------------------------------------- + ! UPDATE HUMIDITY VARIABLES BY RESOLVED CONDENSATION FLUXES + ! ---------------------------------------------------------------- +!cdir unroll=8 + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZDQL=ZIPOI(JLON,JLEV)* (& + & YDMF_PHYS%OUT%FCSQL(JLON,JLEV)-YDMF_PHYS%OUT%FCSQL(JLON,JLEV-1)) + ZQL(JLON,JLEV)=ZQL(JLON,JLEV)+ZDQL + ZDQI=ZIPOI(JLON,JLEV)* (& + & YDMF_PHYS%OUT%FCSQN(JLON,JLEV)-YDMF_PHYS%OUT%FCSQN(JLON,JLEV-1)) + ZQI(JLON,JLEV)=ZQI(JLON,JLEV)+ZDQI + ZQV(JLON,JLEV)=ZQV(JLON,JLEV)-ZDQI-ZDQL + + ZT(JLON,JLEV)=ZT(JLON,JLEV)+(ZLHV(JLON,JLEV)*ZDQL& + & +ZLHS(JLON,JLEV)*ZDQI)/YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP(JLON,JLEV) + ENDDO + ENDDO + +!rb : Store values for next time-step: all cases + IF(LRKCDEV) THEN + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDVARS%RKTH%T0(JLON,JLEV)= ZT(JLON,JLEV)+ZDTRAD(JLON,JLEV) + YDVARS%RKTQV%T0(JLON,JLEV)=ZQV(JLON,JLEV)+ZDQVDIFF(JLON,JLEV)*ZDTURDIFF + YDVARS%RKTQC%T0(JLON,JLEV)= ZQI(JLON,JLEV)+ZQL(JLON,JLEV) + ENDDO + ENDDO + ENDIF + + ENDIF ! L3MT + +! 11.- PRECIPITATIONS SOUS-MAILLES. +! --------------------------------- + + IF (LVDIF.AND.(LCVRA.OR.L3MT.OR.LCVRAV3)) THEN +! LA TENDANCE DYNAMIQUE DE Q EST MULTIPLIEE PAR UN +! FACTEUR CORRECTIF FONCTION DE LA RESOLUTION LOCALE +! DU MODELE PUIS AUGMENTEE DE LA CONTRIBUTION +! DE L EVAPORATION DU SOL. + IF(LCVCSD.OR..NOT.LCVGQD) THEN + IF (LCOMOD) THEN + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZMOD(JLON)=1._JPRB/(1.0_JPRB+YDVARS%GEOMETRY%GM%T0(JLON)*TEQK) + ENDDO + ELSE + ZMOD(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=1._JPRB + ENDIF +!cdir unroll=8 + DO JLEV = YDCPG_OPTS%KTDIA, YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA + ZRDG_CVGQ(JLON,JLEV) = ZRDG_CVGQ(JLON,JLEV)*ZMOD(JLON) & + & -RG*YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP(JLON,JLEV)& + & *(YDMF_PHYS%OUT%DIFTQ(JLON,JLEV)-YDMF_PHYS%OUT%DIFTQ(JLON,JLEV-1)& + & +ZFCQVNG(JLON,JLEV)-ZFCQVNG(JLON,JLEV-1)) + ENDDO + ENDDO + ENDIF + IF (LCAPE) THEN + IF (LCAMOD) THEN + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZTAUX(JLON)=RTCAPE*(YDVARS%GEOMETRY%GM%T0(JLON)*TEQC) + ENDDO + ELSE + ZTAUX=RTCAPE + ENDIF ! lcamod + ENDIF + ENDIF + + + IF (L3MT) THEN + ! - TEMPORAIRES + ! ZSIGPC: CONVECTIVE FRACTION OF PRECIPITATION FLUX, USED A POSTERIORI + ! ZSIGP : PRECIPITATION MESH FRACTION + ZSIGPC=0.0_JPRB + ZSIGP=1.0_JPRB ! used to limit/scale dd area + IF (LCVPRO) THEN + ! ------------------------- + ! UPDRAUGHT CONTRIBUTION + ! ------------------------- + + CALL ACTQSATS ( YDPHY, YDPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTQSAT, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, ZQV, ZT, ZGEOSLC, & + & ZLH, ZLSCPE, ZQSAT, ZQW, ZRH, ZTW) + + IF (.NOT.LCVCSD) THEN + CALL ACCVUD ( YDMODEL%YRML_PHY_EC%YRECUCONVCA, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, & + & YDCPG_OPTS%KLON, YDCPG_OPTS%KTDIA, YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%ALPH, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & ZRDG_CVGQ, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%LNPR, & + & ZQV, ZQI, ZQL, ZQSAT, ZQW, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, ZT, ZTW, YDMF_PHYS_BASE_STATE%U, & + & YDMF_PHYS_BASE_STATE%V, YDMF_PHYS_BASE_STATE%VOR, YDVARS%DAL%T0, YDMF_PHYS_BASE_STATE%YGSP_RR%T, & + & ZTAUX, YDVARS%GEOMETRY%RCORI%T0, YDVARS%GEOMETRY%GM%T0, ZDECRD_MF, YDMF_PHYS%OUT%DIFCQ, YDMF_PHYS%OUT%DIFCQL, & + & YDMF_PHYS%OUT%DIFCQN, YDMF_PHYS%OUT%DIFCS, YDMF_PHYS%OUT%FCCQL, YDMF_PHYS%OUT%FCCQN, YDMF_PHYS%OUT%STRCU, & + & YDMF_PHYS%OUT%STRCV, ZATSLC, INLAB, YDVARS%UNEBH%T0, ZDETFI, ZTU, ZQU, ZUU, ZVU, INND, YDMF_PHYS%OUT%CAPE, & + & YDMF_PHYS%OUT%CUCONVCA, YDMF_PHYS%OUT%NLCONVCA, ZGEOSLC, YDVARS%UEN%T0, YDVARS%UAL%T0, YDVARS%UOM%T0 & + & ) + + ! Initialize temperature correction + ZTCORR(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:)=ZTU(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:)-ZT(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) + ! Initialize Environment horizontal velocity + ZU(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:)=YDMF_PHYS_BASE_STATE%U(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) + ZV(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:)=YDMF_PHYS_BASE_STATE%V(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) + ELSE +! PUT IN ZTCORR THE CONDENSATE USED IN TRIGGERING + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZTCORR(JLON,JLEV)=MAX(0._JPRB,ZQI(JLON,JLEV)+ZQL(JLON,JLEV) -& + & MAX(0._JPRB,YDMF_PHYS_BASE_STATE%I(JLON,JLEV)+YDMF_PHYS_BASE_STATE%L(JLON,JLEV)) ) + ENDDO + ENDDO +! PASS T9 CONDENSATES TO ACCSU + CALL ACCSU ( YDMODEL%YRML_PHY_EC%YRECUCONVCA, YDMODEL%YRML_PHY_EC%YRECUMF, YDMODEL%YRML_PHY_MF, & + & YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KTDIA, YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%ALPH, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & ZRDG_CVGQ, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%LNPR, & + & ZQV, ZTCORR, YDMF_PHYS_BASE_STATE%I, YDMF_PHYS_BASE_STATE%L, ZQSAT, ZQW, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, & + & ZT, ZTW, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, YDMF_PHYS_BASE_STATE%VOR, YDCPG_DYN0%CTY%VVEL(:, 1:), & + & YDMF_PHYS%OUT%FCSQL, YDMF_PHYS%OUT%FCSQN, YDMF_PHYS_BASE_STATE%YGSP_RR%T, ZTAUX, YDVARS%GEOMETRY%RCORI%T0, & + & ZDECRD_MF, YDMF_PHYS_SURF%GSD_VK%PUDGRO, YDMF_PHYS%OUT%CUCONVCA, YDMF_PHYS%OUT%NLCONVCA, YDMF_PHYS%OUT%DIFCQ, & + & YDMF_PHYS%OUT%DIFCQL, YDMF_PHYS%OUT%DIFCQN, YDMF_PHYS%OUT%DIFCS, YDMF_PHYS%OUT%FCCQL, YDMF_PHYS%OUT%FCCQN, & + & YDMF_PHYS%OUT%STRCU, YDMF_PHYS%OUT%STRCV, ZATSLC, INLAB, YDVARS%UNEBH%T0, ZDETFI, ZTU, ZQU, & + & ZUU, ZVU, INND, YDMF_PHYS%OUT%CAPE, ZGEOSLC, YDVARS%UEN%T0, YDVARS%UAL%T0, YDVARS%UOM%T0) + + ! Initialize temperature correction + ZTCORR(:,:)=ZTU(:,:) + ! Initialize Environment horizontal velocity + ZU(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:)=YDMF_PHYS_BASE_STATE%U(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) + ZV(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:)=YDMF_PHYS_BASE_STATE%V(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) + ENDIF + + + CALL ACUPU(YDPHY, YDPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KTDIA, & + & YDCPG_OPTS%KFLEVG, YDVARS%UAL%T0, YDVARS%UNEBH%T0, ZDETFI, ZPOID, ZIPOI, ZLHV, ZLHS, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, & + & YDMF_PHYS%OUT%DIFCQ, YDMF_PHYS%OUT%DIFCQN, YDMF_PHYS%OUT%DIFCQL, YDMF_PHYS%OUT%DIFCS, YDMF_PHYS%OUT%FCCQL, & + & YDMF_PHYS%OUT%FCCQN, YDMF_PHYS%OUT%FCSQL, YDMF_PHYS%OUT%FCSQN, ZSIGP, ZSIGPC, ZNEBS, ZQI, ZQL, & + & ZQV, ZT, YDMF_PHYS%OUT%FCQNG, YDMF_PHYS%OUT%FCQNNG, YDMF_PHYS%OUT%FCQLNG) + +!rb store "-B" state: no protection of Ncv + IF(LRKCDEV.AND.(.NOT.LNEBCV)) THEN + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDVARS%RKTH%T0(JLON,JLEV)=YDVARS%RKTH%T0(JLON,JLEV)-ZT(JLON,JLEV) + YDVARS%RKTQV%T0(JLON,JLEV)=YDVARS%RKTQV%T0(JLON,JLEV)-ZQV(JLON,JLEV) + YDVARS%RKTQC%T0(JLON,JLEV)=YDVARS%RKTQC%T0(JLON,JLEV)-ZQI(JLON,JLEV)& + & -ZQL(JLON,JLEV) + ENDDO + ENDDO + ENDIF + + ENDIF !LCVPRO + + + ! --------------------------------------------------------- + ! MICROPHYSICS (AUTOCONVERSION, COLLECTION AND EVAPORATION) + ! OF TOTAL CONDENSATE (RESOLVED + SUB-GRID) + ! --------------------------------------------------------- + + ZAUXPRC(:)=0._JPRB + ZRCVOTT(:,:)=0._JPRB + + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + + ! COMPUTE TOTAL CONDENSATION FLUX + ! ------------------------------- + ZFCQL(JLON,JLEV)=YDMF_PHYS%OUT%FCSQL(JLON,JLEV)+YDMF_PHYS%OUT%FCCQL(JLON,JLEV) + ZFCQI(JLON,JLEV)=YDMF_PHYS%OUT%FCSQN(JLON,JLEV)+YDMF_PHYS%OUT%FCCQN(JLON,JLEV) + IF (LRCVOTT) THEN + ZCONVC=MAX(0.0_JPRB, YDMF_PHYS%OUT%FCCQL(JLON,JLEV)+YDMF_PHYS%OUT%FCCQN(JLON,JLEV)) + ZAUXPRC(JLON)=ZAUXPRC(JLON)+& + & MAX(0.0_JPRB,YDMF_PHYS%OUT%FCSQL(JLON,JLEV)+YDMF_PHYS%OUT%FCSQN(JLON,JLEV)& + & -YDMF_PHYS%OUT%FCSQL(JLON,JLEV-1)-YDMF_PHYS%OUT%FCSQN(JLON,JLEV-1)) + ZTOTC=ZCONVC+ZAUXPRC(JLON) + ZRCVOTT(JLON,JLEV)=MAX(0.0_JPRB,SIGN(1.0_JPRB,ZTOTC-ZEPS0))& + & *ZCONVC/MAX(ZTOTC,ZEPS0) + ENDIF + ENDDO + ENDDO + + CALL ACTQSATS ( YDPHY, YDPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTQSAT, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, ZQV, ZT, ZGEOSLC, & + & ZLH, ZLSCPE, ZQSAT, ZQW, ZRH, ZTW) + + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZDQ(JLON,JLEV)=ZQW(JLON,JLEV)& + & -(ZQV(JLON,JLEV)+ZQI(JLON,JLEV)+ZQL(JLON,JLEV)) + ZDQM(JLON,JLEV)=ZQW(JLON,JLEV) + ENDDO + ENDDO + + CALL APLMPHYS( YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KTDIA, & + & YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, ZQV, ZQI, ZQL, ZQS, ZQR, ZQG, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & ZT, ZIPOI, ZDQ, ZDQM, ZLHS, ZLHV, ZNEBS, ZPOID, ZRCVOTT, ZTCORR, YDMF_PHYS_SURF%GSD_VF%PLSM, & + & ZFLU_NEIJ, YDMF_PHYS_BASE_STATE%YGSP_RR%T, ZDECRD_MF, ZFCQL, ZFCQI, ZFALLR, ZFALLS, ZFALLG, YDMF_PHYS%OUT%FPFPSL, & + & YDMF_PHYS%OUT%FPFPSN, YDMF_PHYS%OUT%FPFPSG, YDMF_PHYS%OUT%FPEVPSL, YDMF_PHYS%OUT%FPEVPSN, YDMF_PHYS%OUT%FPEVPSG, & + & YDMF_PHYS%OUT%FPLSL, YDMF_PHYS%OUT%FPLSN, YDMF_PHYS%OUT%FPLSG, ZSEDIQL, ZSEDIQI, YDMF_PHYS%OUT%DIAGH) + + ! ------------------------------------------------------------ + ! UPDATE AFTER MICROPHYSICS - 3MT + ! ------------------------------------------------------------ + + CALL ACUPM( YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KTDIA, & + & YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, ZLHS, ZLHV, YDCPG_DYN0%CTY%EVEL, ZIPOI, & + & ZPOID, YDVARS%UAL%T0, YDVARS%UOM%T0, YDMF_PHYS%OUT%FPEVPSL, YDMF_PHYS%OUT%FPEVPSN, YDMF_PHYS%OUT%FPEVPSG, & + & YDMF_PHYS%OUT%FPFPSL, YDMF_PHYS%OUT%FPFPSN, YDMF_PHYS%OUT%FPFPSG, YDMF_PHYS%OUT%FPLSL, YDMF_PHYS%OUT%FPLSN, & + & YDMF_PHYS%OUT%FPLSG, ZFCQL, ZFCQI, YDMF_PHYS%OUT%FCCQL, YDMF_PHYS%OUT%FCCQN, ZOME, ZFHP, ZQV, & + & ZQL, ZQI, ZQR, ZQS, ZQG, ZT, YDMF_PHYS%OUT%FCSQL, YDMF_PHYS%OUT%FCSQN, YDMF_PHYS%OUT%FCQNG, YDMF_PHYS%OUT%FCQRNG, & + & YDMF_PHYS%OUT%FCQSNG, YDMF_PHYS%OUT%FCQGNG) + + IF (LCDDPRO) THEN + ! ------------------------- + ! DOWNDRAUGHT CONTRIBUTION + ! ------------------------- + + ZDIFCQD(:,:)=0.0_JPRB + ZDIFCQLD(:,:)=0.0_JPRB + ZDIFCQID(:,:)=0.0_JPRB + ZDIFCSD(:,:)=0.0_JPRB + ZSTRCUD(:,:)=0.0_JPRB + ZSTRCVD(:,:)=0.0_JPRB + + CALL ACTQSATS ( YDPHY, YDPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTQSAT, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, ZQV, ZT, ZGEOSLC, & + & ZLH, ZLSCPE, ZQSAT, ZQW, ZRH, ZTW) + + IF (LNSDO) THEN + CALL ACNSDO(YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KTDIA, & + & YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%ALPH, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%LNPR, ZQV, ZQI, ZQL, ZQR, ZQS, ZQW, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, & + & ZSIGP, ZT, ZTW, ZU, ZV, YDCPG_DYN0%CTY%VVEL(:, 1:), ZATSLC, ZGEOSLC, YDMF_PHYS%OUT%FPLSL, YDMF_PHYS%OUT%FPLSN, & + & YDMF_PHYS%OUT%FPEVPSL, YDMF_PHYS%OUT%FPEVPSN, ZDIFCQD, ZDIFCQLD, ZDIFCQID, ZDIFCSD, YDMF_PHYS%OUT%FPEVPCL, & + & YDMF_PHYS%OUT%FPEVPCN, ZSTRCUD, ZSTRCVD, YDVARS%DAL%T0, YDVARS%DOM%T0) + ELSE + CALL ACMODO(YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KTDIA, & + & YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%ALPH, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%LNPR, ZQV, ZQI, & + & ZQL, ZQW, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, & + & ZSIGP, ZT, ZTW, ZU, ZV, YDCPG_DYN0%CTY%EVEL, ZOME, ZATSLC, ZGEOSLC, ZFHP, YDMF_PHYS%OUT%FPLSL, & + & YDMF_PHYS%OUT%FPLSN, YDMF_PHYS%OUT%FPLSG, ZDIFCQD, ZDIFCQLD, ZDIFCQID, ZDIFCSD, YDMF_PHYS%OUT%FPEVPCL, & + & YDMF_PHYS%OUT%FPEVPCN, YDMF_PHYS%OUT%FPEVPCG, ZSTRCUD, ZSTRCVD, YDVARS%DAL%T0, YDVARS%DOM%T0 & + & ) + ENDIF + ! --------------------------------------------- + ! UPDATE VARIABLES BY DOWNDRAUGHT CONTRIBUTION + ! --------------------------------------------- + + + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + + ! UPDATE CONVECTIVE DIFFUSION AND EVAPORATION FLUXES + ! -------------------------------------------------- + + YDMF_PHYS%OUT%DIFCS(JLON,JLEV) =YDMF_PHYS%OUT%DIFCS(JLON,JLEV) +ZDIFCSD(JLON,JLEV) + YDMF_PHYS%OUT%DIFCQ(JLON,JLEV) =YDMF_PHYS%OUT%DIFCQ(JLON,JLEV) +ZDIFCQD(JLON,JLEV) + YDMF_PHYS%OUT%DIFCQL(JLON,JLEV)=YDMF_PHYS%OUT%DIFCQL(JLON,JLEV)+ZDIFCQLD(JLON,JLEV) + YDMF_PHYS%OUT%DIFCQN(JLON,JLEV)=YDMF_PHYS%OUT%DIFCQN(JLON,JLEV)+ZDIFCQID(JLON,JLEV) + YDMF_PHYS%OUT%STRCU(JLON,JLEV)=YDMF_PHYS%OUT%STRCU(JLON,JLEV)+ZSTRCUD(JLON,JLEV) + YDMF_PHYS%OUT%STRCV(JLON,JLEV)=YDMF_PHYS%OUT%STRCV(JLON,JLEV)+ZSTRCVD(JLON,JLEV) + ENDDO + ENDDO + + CALL ACUPD(YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KTDIA, & + & YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, & + & ZLHS, ZLHV, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, ZIPOI, ZPOID, ZFALLR, ZFALLS, ZFALLG, YDMF_PHYS%OUT%FPEVPSL, & + & YDMF_PHYS%OUT%FPEVPSN, YDMF_PHYS%OUT%FPEVPSG, YDMF_PHYS%OUT%FPEVPCL, YDMF_PHYS%OUT%FPEVPCN, YDMF_PHYS%OUT%FPEVPCG, & + & ZFHP, ZDIFCSD, ZDIFCQD, ZDIFCQLD, ZDIFCQID, ZQV, ZQL, ZQI, ZQR, ZQS, ZQG, ZT, YDVARS%UEN%T0, YDMF_PHYS%OUT%FCQNG, & + & YDMF_PHYS%OUT%FCQNNG, YDMF_PHYS%OUT%FCQLNG, YDMF_PHYS%OUT%FCQRNG, YDMF_PHYS%OUT%FCQSNG, YDMF_PHYS%OUT%FCQGNG, & + & YDMF_PHYS%OUT%FPLSL, YDMF_PHYS%OUT%FPLSN, YDMF_PHYS%OUT%FPLSG) + +!rb store "+C": case with no protection of Ncv + IF((LRKCDEV).AND.(.NOT.LNEBCV)) THEN + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDVARS%RKTH%T0(JLON,JLEV)=YDVARS%RKTH%T0(JLON,JLEV)+ZT(JLON,JLEV) + YDVARS%RKTQV%T0(JLON,JLEV)=YDVARS%RKTQV%T0(JLON,JLEV)+ZQV(JLON,JLEV) + YDVARS%RKTQC%T0(JLON,JLEV)=YDVARS%RKTQC%T0(JLON,JLEV)& + & +ZQI(JLON,JLEV)+ZQL(JLON,JLEV) + ENDDO + ENDDO + ENDIF + + ! PARTITION CONVECTIVE/STRATIFORM PRECIPITATION + ! --------------------------------------------- + DO JLEV=YDCPG_OPTS%KTDIA-1,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%FPLCL(JLON,JLEV)=ZSIGPC(JLON)*YDMF_PHYS%OUT%FPLSL(JLON,JLEV) + YDMF_PHYS%OUT%FPLSL(JLON,JLEV)=YDMF_PHYS%OUT%FPLSL(JLON,JLEV)-YDMF_PHYS%OUT%FPLCL(JLON,JLEV) + YDMF_PHYS%OUT%FPLCN(JLON,JLEV)=ZSIGPC(JLON)*YDMF_PHYS%OUT%FPLSN(JLON,JLEV) + YDMF_PHYS%OUT%FPLSN(JLON,JLEV)=YDMF_PHYS%OUT%FPLSN(JLON,JLEV)-YDMF_PHYS%OUT%FPLCN(JLON,JLEV) + ENDDO + ENDDO + IF (LGRAPRO) THEN + DO JLEV=YDCPG_OPTS%KTDIA-1,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%FPLCG(JLON,YDCPG_OPTS%KFLEVG)=0.0_JPRB !ZSIGPC(JLON)*PFPLSG(JLON,JLEV) + YDMF_PHYS%OUT%FPLSG(JLON,JLEV)=YDMF_PHYS%OUT%FPLSG(JLON,JLEV)-YDMF_PHYS%OUT%FPLCG(JLON,JLEV) + ENDDO + ENDDO + ENDIF + ENDIF ! LCDDPRO + + ENDIF ! L3MT + +! ----------------------------------------------------- + + IF ( LCVRA ) THEN + + IF (LSTRAPRO) THEN + DO JLEV = YDCPG_OPTS%KTDIA-1, YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%DIFTQ(JLON,JLEV)=YDMF_PHYS%OUT%DIFTQ(JLON,JLEV)+ZFCQVNG(JLON,JLEV) + ENDDO + ENDDO + ENDIF + + CALL ACCVIMP ( YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTCVIM, & + & YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%ALPH, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, & + & ZRDG_CVGQ, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%LNPR, ZQV, & + & ZFLU_QSAT, ZMSC_QW, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, & + & YDMF_PHYS_BASE_STATE%T, ZMSC_TW, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, YDMF_PHYS_BASE_STATE%VOR, & + & YDCPG_DYN0%CTY%VVEL(:, 1:), YDVARS%GEOMETRY%GM%T0, YDMF_PHYS_BASE_STATE%YGSP_RR%T, ZTAUX, YDVARS%GEOMETRY%RCORI%T0, & + & YDMF_PHYS%OUT%DIFCQ, YDMF_PHYS%OUT%DIFCS, YDMF_PHYS%OUT%FCCQL, YDMF_PHYS%OUT%FCCQN, YDMF_PHYS%OUT%FPLCL, & + & YDMF_PHYS%OUT%FPLCN, YDMF_PHYS%OUT%FPFPCL, YDMF_PHYS%OUT%FPFPCN, YDMF_PHYS%OUT%FPEVPCL, YDMF_PHYS%OUT%FPEVPCN, & + & YDMF_PHYS%OUT%STRCU, YDMF_PHYS%OUT%STRCV, ZFPCOR, INLAB, YDMF_PHYS%OUT%CAPE, INND, YDMF_PHYS%OUT%DIFTQ, & + & YDMF_PHYS%OUT%DIFTS, ZGEOSLC, YDVARS%GEOMETRY%GEMU%T0) + + IF (LSTRAPRO) THEN + DO JLEV = YDCPG_OPTS%KTDIA-1, YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%DIFTQ(JLON,JLEV)=YDMF_PHYS%OUT%DIFTQ(JLON,JLEV)-ZFCQVNG(JLON,JLEV) + ENDDO + ENDDO + ENDIF + + ELSEIF (LCVRAV3) THEN + + CALL ACCVIMP_V3 (YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & NTCVIM, YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%ALPH, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, ZRDG_CVGQ, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%LNPR, & + & ZQV, ZMSC_QW, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, YDMF_PHYS_BASE_STATE%T, & + & ZMSC_TW, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, YDMF_PHYS_BASE_STATE%YGSP_RR%T, YDMF_PHYS_SURF%GSD_VH%PPBLH, & + & YDMF_PHYS%OUT%DIFCQ, YDMF_PHYS%OUT%DIFCS, YDMF_PHYS%OUT%FCCQL, YDMF_PHYS%OUT%FCCQN, YDMF_PHYS%OUT%FPLCL, & + & YDMF_PHYS%OUT%FPLCN, YDMF_PHYS%OUT%FPFPCL, YDMF_PHYS%OUT%FPFPCN, YDMF_PHYS%OUT%FPEVPCL, YDMF_PHYS%OUT%FPEVPCN, & + & YDMF_PHYS%OUT%STRCU, YDMF_PHYS%OUT%STRCV, INLAB, INND, YDMF_PHYS%OUT%DIFTQ, YDMF_PHYS%OUT%DIFTS & + & ) + + ELSEIF (LCVTDK) THEN ! <== IFS deep convection scheme + + DO JLEV=1,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZGEOM1(JLON,JLEV) = YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF(JLON,JLEV)-YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI(JLON,YDCPG_OPTS%KFLEVG) + ZVERVEL(JLON,JLEV) = YDCPG_DYN0%CTY%VVEL(JLON,JLEV)*YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF(JLON,JLEV) + ZLISUM(JLON,JLEV) = 0.0_JPRB + ZLCRIT_AER(JLON,JLEV) = 5.E-4_JPRB + ENDDO + ENDDO + DO JLEV=0,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZGEOMH(JLON,JLEV)=YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI(JLON,JLEV)-YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI(JLON,YDCPG_OPTS%KFLEVG) + ZFCQLF(JLON,JLEV)=0.0_JPRB + ZFCQLI(JLON,JLEV)=0.0_JPRB + ENDDO + ENDDO + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + LLLAND(JLON) = (YDMF_PHYS_SURF%GSD_VF%PLSM(JLON)>0.5_JPRB) + LLSHCV(JLON) = .FALSE. + ZCUCONVCA(JLON) = 0.0_JPRB + ZACPR(JLON) = 0.0_JPRB + ZDXTDK(JLON) = RDELXN/YDVARS%GEOMETRY%GM%T0(JLON) + ENDDO + LLPTQ = .FALSE. + CALL ACUPTQ (YDCST, YDCPG_OPTS%KLON, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG, LLPTQ, YDMF_PHYS%OUT%FRSO, & + & YDMF_PHYS%OUT%FRTH, YDMF_PHYS%OUT%DIFCQ, YDMF_PHYS%OUT%DIFCS, YDMF_PHYS%OUT%DIFTQ, YDMF_PHYS%OUT%DIFTS, & + & YDMF_PHYS%OUT%FCCQL, YDMF_PHYS%OUT%FCCQN, YDMF_PHYS%OUT%FPLCL, YDMF_PHYS%OUT%FPLCN, YDMF_PHYS%OUT%FPEVPCL, & + & YDMF_PHYS%OUT%FPEVPCN, YDMF_PHYS%OUT%FPFPCL, YDMF_PHYS%OUT%FPFPCN, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, & + & YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%Q, YDMF_PHYS_BASE_STATE%YGSP_RR%T, ZTENHA, & + & ZTENQVA ) + + DO JLEV=1,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZTENT(JLON,JLEV) = ZTENHA(JLON,JLEV)/YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP(JLON,JLEV) + ZTENQ(JLON,JLEV) = ZTENQVA(JLON,JLEV) + ZTENU(JLON,JLEV) = 0.0_JPRB + ZTENV(JLON,JLEV) = 0.0_JPRB + ENDDO + ENDDO + LLDSLPHY=.TRUE. + ZVDIFTS = 0._JPRB + ISPPN2D = 0 + + CALL CUCALLN_MF (RPLDARE, RPLRG, YDCPG_OPTS%KSTEP, YDMODEL%YRML_PHY_EC%YRTHF, YDCST, YDMODEL%YRML_PHY_RAD%YRERAD, & + & YDMODEL%YRML_PHY_SLIN, YDMODEL%YRML_PHY_EC, YDMODEL%YRML_GCONF%YGFL, & + & YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, 0, YDCPG_OPTS%KFLEVG, ZDXTDK, ISPPN2D, & + & LLLAND, LLDSLPHY, TSPHY, ZVDIFTS, YDMF_PHYS_BASE_STATE%T, ZQV, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, & + & ZLISUM, ZVERVEL, YDMF_PHYS%OUT%DIFTQ, YDMF_PHYS%OUT%DIFTS, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, ZGEOM1, ZGEOMH, YDVARS%GEOMETRY%GM%T0, & + & ZCUCONVCA, ZGP2DSPPA, ZTENT, ZTENQ, ZTENU, ZTENV, ZACPR, ITOPC, IBASC, ITYPE, ICBOT, ICTOP, & + & IBOTSC, LLCUM, LLSC, LLSHCV, ZLCRIT_AER, ZLU, ZLUDE, ZLUDELI, ZSNDE, ZMFU, ZMFD, YDMF_PHYS%OUT%DIFCQ, & + & YDMF_PHYS%OUT%DIFCS, ZFHPCL, ZFHPCN, YDMF_PHYS%OUT%FPLCL, YDMF_PHYS%OUT%FPLCN, ZLRAIN, ZRSUD, YDMF_PHYS%OUT%STRCU, & + & YDMF_PHYS%OUT%STRCV, ZFCQLF, ZFCQLI, ZMFUDE_RATE, ZMFDDE_RATE, YDMF_PHYS%OUT%CAPE, ZWMEAN, & + & ZDIFF, 0, ZCEN, ZTENC, ZSCAV) + DO JLEV=0,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZFPCOR (JLON,JLEV)=YDMF_PHYS%OUT%FPLCL(JLON,JLEV)+YDMF_PHYS%OUT%FPLCN(JLON,JLEV) + YDMF_PHYS%OUT%FCCQL (JLON,JLEV)=YDMF_PHYS%OUT%FPLCL(JLON,JLEV) + YDMF_PHYS%OUT%FCCQN (JLON,JLEV)=YDMF_PHYS%OUT%FPLCN(JLON,JLEV) + YDMF_PHYS%OUT%FPFPCL (JLON,JLEV)=YDMF_PHYS%OUT%FPLCL(JLON,JLEV) + YDMF_PHYS%OUT%FPFPCN (JLON,JLEV)=YDMF_PHYS%OUT%FPLCN(JLON,JLEV) + YDMF_PHYS%OUT%FPEVPCL(JLON,JLEV)=0._JPRB + YDMF_PHYS%OUT%FPEVPCN(JLON,JLEV)=0._JPRB + ENDDO + ENDDO + + ENDIF + IF(LFLASH .AND. (LCVTDK .OR. LGPCMT)) THEN + ! LIGHTNING PARAMETERIZATION. OUTPUT IS PFLASH, TOTAL LIGHTNING FLASH RATES. + ZGAW(:)=0._JPRB + CALL CULIGHT (RPLDARE, RPLRG, YDMODEL%YRML_PHY_EC%YRTHF, YDCST, YDEPHY, YGFL, & + & YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, & + & ZGAW, ZGAW, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, LLLAND, YDMF_PHYS_BASE_STATE%T, ZLU, ZMFU, YDMF_PHYS%OUT%CAPE, & + & YDMF_PHYS%OUT%FPLCL, YDMF_PHYS%OUT%FPLCN, LLCUM, ICBOT, ICTOP, LLLINOX, YDMF_PHYS%OUT%FLASH, & + & ZLIGH_CTG, ZCTOPH, ZPRECMX, ZICE, ZCDEPTH, ZWMFU) + ! LIGHTNING FLASH RATES ARE CONVERTED IN fl/km2/s BEFORE ENTERING CFU TIME ACCUMULATION. + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%FLASH(JLON)=YDMF_PHYS%OUT%FLASH(JLON)/86400._JPRB + ENDDO + ELSEIF(LFLASH) THEN + DO JLON=YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%FLASH(JLON)=0._JPRB + ENDDO + ENDIF + + IF ( LADJCLD ) THEN + ZFRSO(:,:) = 0.0_JPRB + ZFRTH(:,:) = 0.0_JPRB + LLPTQ = .TRUE. + CALL ACUPTQ (YDCST, YDCPG_OPTS%KLON, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG, LLPTQ, & + & ZFRSO, ZFRTH, YDMF_PHYS%OUT%DIFCQ, YDMF_PHYS%OUT%DIFCS, YDMF_PHYS%OUT%DIFTQ, YDMF_PHYS%OUT%DIFTS, & + & YDMF_PHYS%OUT%FCCQL, YDMF_PHYS%OUT%FCCQN, YDMF_PHYS%OUT%FPLCL, YDMF_PHYS%OUT%FPLCN, YDMF_PHYS%OUT%FPEVPCL, & + & YDMF_PHYS%OUT%FPEVPCN, YDMF_PHYS%OUT%FPFPCL, YDMF_PHYS%OUT%FPFPCN, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, & + & YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%Q, YDMF_PHYS_BASE_STATE%YGSP_RR%T, ZTENHA, & + & ZTENQVA ) + ENDIF + + IF ( LPROCLD ) THEN + IF(LGPCMT) THEN + ! Microphysics occurs in a shell between updraft and its resolved environment. + ZNEBS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG)=1._JPRB-(1._JPRB-ZNEBS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG))& + & *(1._JPRB-ZCSGC(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG)) + ZTMIC(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG)=YDMF_PHYS_BASE_STATE%T(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG) + ZQMIC(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG)=ZCSGC(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG)& + & *ZFLU_QSAT(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG)& + & +(1._JPRB-ZCSGC(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG))*ZQV(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG) + ZQLIS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG)=MAX(ZQLIS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG),& + & ZCSGC(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG)& + & *(ZQL(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG)+ZQI(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG))& + & +(1._JPRB-ZCSGC(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG))*ZQLIS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG)) + ZQC_DET_PCMT(:,:)=0._JPRB + ELSE + ! Microphysics occurs in the resolved state. + ZTMIC(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG)=YDMF_PHYS_BASE_STATE%T(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG) + ZQMIC(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG)=ZQV(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KTDIA:YDCPG_OPTS%KFLEVG) + ENDIF + + CALL ACPLUIZ (YDCST, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTPLUI, & + & YDCPG_OPTS%KFLEVG, ZTMIC, ZQMIC, ZQL, ZQI, ZQR, ZQS, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, ZNEBS, ZQLIS, & + & ZNEB_CVPP, ZQLI_CVPP, ZQC_DET_PCMT, ZTENHA, ZTENQVA, LADJCLD, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, & + & YDMF_PHYS_BASE_STATE%YGSP_RR%T, ZFLU_NEIJ, YDMF_PHYS_SURF%GSD_VF%PLSM, YDVARS%GEOMETRY%GM%T0, & + & YDSTA, YDMF_PHYS%OUT%FCSQL, YDMF_PHYS%OUT%FCSQN, YDMF_PHYS%OUT%FPLSL, YDMF_PHYS%OUT%FPLSN, YDMF_PHYS%OUT%FPEVPSL, & + & YDMF_PHYS%OUT%FPEVPSN, YDMF_PHYS%OUT%FPFPSL, YDMF_PHYS%OUT%FPFPSN, ZSEDIQL, ZSEDIQI ) + + IF(LGPCMT.AND.LCVNHD) THEN + ! Evaporation processes within convective environment + ! will be used by the convection, to compute their feedback on convective updrafts. + ! This information is put here in PDDAL. + YDVARS%DAL%T0(:,:)=0._JPRB + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDVARS%DAL%T0(JLON,JLEV)=( & + & +YDMF_PHYS%OUT%FPEVPSL(JLON,JLEV)-YDMF_PHYS%OUT%FPEVPSL(JLON,JLEV-1) & + & +YDMF_PHYS%OUT%FPEVPSN(JLON,JLEV)-YDMF_PHYS%OUT%FPEVPSN(JLON,JLEV-1) & + & +YDMF_PHYS%OUT%FPEVPCL(JLON,JLEV)-YDMF_PHYS%OUT%FPEVPCL(JLON,JLEV-1) & + & +YDMF_PHYS%OUT%FPEVPCN(JLON,JLEV)-YDMF_PHYS%OUT%FPEVPCN(JLON,JLEV-1)) & + & /RG*YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP(JLON,JLEV) + ENDDO + ENDDO + IF(LMUSCLFA) CALL WRSCMR(NMUSCLFA, 'PFPEVPSL0', YDMF_PHYS%OUT%FPEVPSL, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG+1& + & ) + IF(LMUSCLFA) CALL WRSCMR(NMUSCLFA, 'PFPEVPSN0', YDMF_PHYS%OUT%FPEVPSN, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG+1& + & ) + IF(LMUSCLFA) CALL WRSCMR(NMUSCLFA, 'PFPEVPCL0', YDMF_PHYS%OUT%FPEVPCL, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG+1& + & ) + IF(LMUSCLFA) CALL WRSCMR(NMUSCLFA, 'PFPEVPCN0', YDMF_PHYS%OUT%FPEVPCN, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG+1& + & ) + ENDIF + ENDIF + + IF ( LNEBCO ) THEN + CALL ACNEBC ( YDPHY0, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTNEBU, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS%OUT%FPLCL, YDMF_PHYS%OUT%FPLCN, INLAB, INND, YDMF_PHYS_SURF%GSD_VH%PTCCH, YDMF_PHYS_SURF%GSD_VH%PSCCH, & + & YDMF_PHYS_SURF%GSD_VH%PBCCH) + ENDIF + IF ( LGWDC ) THEN + CALL ACDRAC ( YDPHY0, YDPHY2, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTDRAG, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, ZNBVNO, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, YDMF_PHYS_BASE_STATE%U, & + & YDMF_PHYS_BASE_STATE%V, YDMF_PHYS%OUT%FPLCL, YDMF_PHYS%OUT%FPLCN, YDMF_PHYS_SURF%GSD_VH%PSCCH, & + & YDMF_PHYS_SURF%GSD_VH%PBCCH, YDMF_PHYS%OUT%STRCU, YDMF_PHYS%OUT%STRCV) + ENDIF + + ZFLX_LOTT_GWU(:, :) = 0.0_JPRB + ZFLX_LOTT_GWV(:, :) = 0.0_JPRB + + IF ( LNORGWD ) THEN + + ! Inversion du sens des niveaux + DO JLON = YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA + DO JLEV = 1, YDCPG_OPTS%KFLEVG + Z_PP(JLON, JLEV) = YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF(JLON, YDCPG_OPTS%KFLEVG - JLEV + 1) + Z_UU(JLON, JLEV) = YDMF_PHYS_BASE_STATE%U(JLON, YDCPG_OPTS%KFLEVG - JLEV + 1) + Z_VV(JLON, JLEV) = YDMF_PHYS_BASE_STATE%V(JLON, YDCPG_OPTS%KFLEVG - JLEV + 1) + Z_TT(JLON, JLEV) = YDMF_PHYS_BASE_STATE%T(JLON, YDCPG_OPTS%KFLEVG - JLEV + 1) + Z_VO(JLON, JLEV) = YDMF_PHYS_BASE_STATE%VOR(JLON, YDCPG_OPTS%KFLEVG - JLEV + 1) + ZD_U(JLON, JLEV) = TSPHY * YDMF_PHYS_BASE_STATE%P1NOGW(JLON, YDCPG_OPTS%KFLEVG - JLEV + 1) + ZD_V(JLON, JLEV) = TSPHY * YDMF_PHYS_BASE_STATE%P2NOGW(JLON, YDCPG_OPTS%KFLEVG - JLEV + 1) + ENDDO + ENDDO + + ZPRECGWD(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA) = MAX(0.0_JPRB, & + & YDMF_PHYS%OUT%FPLCL(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KFLEVG) + YDMF_PHYS%OUT%FPLCN(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,YDCPG_OPTS%KFLEVG)) + + CALL ACNORGWD(YDNORGWD, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, & + & TSPHY, Z_PP, YDVARS%GEOMETRY%GEMU%T0, Z_TT, Z_UU, Z_VV, Z_VO, ZPRECGWD, ZD_U, ZD_V) + + DO JLON = YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA + DO JLEV = 1, YDCPG_OPTS%KFLEVG + YDMF_PHYS_BASE_STATE%P1NOGW(JLON, JLEV) = ZD_U(JLON, YDCPG_OPTS%KFLEVG - JLEV + 1) / TSPHY + YDMF_PHYS_BASE_STATE%P2NOGW(JLON, JLEV) = ZD_V(JLON, YDCPG_OPTS%KFLEVG - JLEV + 1) / TSPHY + ENDDO + ENDDO + + !-- CALCUL DU FLUX, PAR INTEGRATION DE LA TENDANCE DE HAUT EN BAS. + ! LES FLUX SONT SUPPOSES NULS AU PREMIER NIVEAU (1 = TOP) DE CALCUL. + DO JLEV = 1, YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA + ZFLX_LOTT_GWU(JLON, JLEV) = ZFLX_LOTT_GWU(JLON, JLEV - 1) - YDMF_PHYS_BASE_STATE%P1NOGW(JLON, JLEV)*YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP(JLON, JLEV)/RG + ZFLX_LOTT_GWV(JLON, JLEV) = ZFLX_LOTT_GWV(JLON, JLEV - 1) - YDMF_PHYS_BASE_STATE%P2NOGW(JLON, JLEV)*YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP(JLON, JLEV)/RG + YDMF_PHYS%OUT%STRCU(JLON, JLEV) = YDMF_PHYS%OUT%STRCU(JLON, JLEV) + ZFLX_LOTT_GWU(JLON, JLEV) + YDMF_PHYS%OUT%STRCV(JLON, JLEV) = YDMF_PHYS%OUT%STRCV(JLON, JLEV) + ZFLX_LOTT_GWV(JLON, JLEV) + !+ TODOLATER +! PSTRNORGWDU(JLON, JLEV) = PSTRNORGWDU(JLON, JLEV) + ZFLX_LOTT_GWU(JLON, JLEV) + !+ TODOLATER +! PSTRNORGWDV(JLON, JLEV) = PSTRNORGWDV(JLON, JLEV) + ZFLX_LOTT_GWV(JLON, JLEV) + ENDDO + ENDDO + + ! NO VERTICAL DIFFUSION IN THE MIDDLE ATMOSPHERE + DO JLEV = 1, NORGWD_NNOVERDIF + DO JLON = YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%STRTU(JLON, JLEV) = 0.0 + YDMF_PHYS%OUT%STRTV(JLON, JLEV) = 0.0 + ENDDO + ENDDO + + !+ TODOLATER +! IF (LNOWINDTEND) THEN + !+ TODOLATER +! DO JLEV = 0, KLEV + !+ TODOLATER +! DO JLON = KIDIA, KFDIA + !+ TODOLATER +! PSTRCU(JLON,JLEV) = 0._JPRB + !+ TODOLATER +! PSTRCV(JLON,JLEV) = 0._JPRB + !+ TODOLATER +! ENDDO + !+ TODOLATER +! ENDDO + !+ TODOLATER +! ENDIF + + ENDIF + +!* +! ------------------------------------------------------------------ +! SAUVEGARDE DES FLUX DE PRECIPITATION CONVECTIVE ET STRATIFORME. + + IF(LNEBN.OR.LNEBR.OR.LRRGUST) THEN + IF (LFPCOR) THEN + IF (LCDDPRO) THEN + DO JLEV=YDCPG_OPTS%KTDIA-1,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZPFL_FPLCH(JLON,JLEV)=YDMF_PHYS%OUT%FPLCL(JLON,JLEV)+YDMF_PHYS%OUT%FPLCN(JLON,JLEV) + ENDDO + ENDDO + ELSE + DO JLEV=YDCPG_OPTS%KTDIA-1,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZPFL_FPLCH(JLON,JLEV)=ZFPCOR(JLON,JLEV) + ENDDO + ENDDO + ENDIF + ELSE + DO JLEV=YDCPG_OPTS%KTDIA-1,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZPFL_FPLCH(JLON,JLEV)=YDMF_PHYS%OUT%FPLCL(JLON,JLEV)+YDMF_PHYS%OUT%FPLCN(JLON,JLEV) + ENDDO + ENDDO + ENDIF + ENDIF + + IF(LRRGUST) THEN + DO JLEV=YDCPG_OPTS%KTDIA-1,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZPFL_FPLSH(JLON,JLEV)=YDMF_PHYS%OUT%FPLSL(JLON,JLEV)+YDMF_PHYS%OUT%FPLSN(JLON,JLEV)+YDMF_PHYS%OUT%FPLSG(JLON,JLEV) + ENDDO + ENDDO + ENDIF + + ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ! UPDATE TRANSPORT FLUXES DUE TO SEDIMENTATION OF CLOUDS. + ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS%OUT%DIFTQL(JLON,JLEV)=YDMF_PHYS%OUT%DIFTQL(JLON,JLEV)+ZSEDIQL(JLON,JLEV) + YDMF_PHYS%OUT%DIFTQN(JLON,JLEV)=YDMF_PHYS%OUT%DIFTQN(JLON,JLEV)+ZSEDIQI(JLON,JLEV) + ZFPLSL (JLON,JLEV)=YDMF_PHYS%OUT%DIFTQL(JLON,JLEV)+YDMF_PHYS%OUT%FPLSL (JLON,JLEV) + ZFPLSN (JLON,JLEV)=YDMF_PHYS%OUT%DIFTQN(JLON,JLEV)+YDMF_PHYS%OUT%FPLSN (JLON,JLEV) + ENDDO + ENDDO + IF (LGRAPRO) THEN + DO JLEV=YDCPG_OPTS%KTDIA,YDCPG_OPTS%KFLEVG + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZFPLSN (JLON,JLEV)=ZFPLSN(JLON,JLEV)+YDMF_PHYS%OUT%FPLSG(JLON,JLEV) + ENDDO + ENDDO + ENDIF + + ! - - - - - - - - - - - - - - - - - + ! CORRECT NEGATIVE WATER CONTENTS. + ! - - - - - - - - - - - - - - - - - + + IF ( LCONDWT.AND.LPROCLD.AND..NOT.LGPCMT ) THEN + CALL QNGCOR (YDCST, YDPHY2, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTPLUI, YDCPG_OPTS%KFLEVG,& + & ZQV, ZQL, ZQI, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, YDMF_PHYS%OUT%DIFCQ, YDMF_PHYS%OUT%DIFCQN, & + & YDMF_PHYS%OUT%DIFCQL, YDMF_PHYS%OUT%DIFTQ, YDMF_PHYS%OUT%DIFTQN, YDMF_PHYS%OUT%DIFTQL, YDMF_PHYS%OUT%FPEVPSL, & + & YDMF_PHYS%OUT%FPEVPSN, YDMF_PHYS%OUT%FPEVPCL, YDMF_PHYS%OUT%FPEVPCN, YDMF_PHYS%OUT%FPFPSL, YDMF_PHYS%OUT%FPFPSN, & + & YDMF_PHYS%OUT%FPFPCL, YDMF_PHYS%OUT%FPFPCN, YDMF_PHYS%OUT%FCCQL, YDMF_PHYS%OUT%FCCQN, YDMF_PHYS%OUT%FCSQL, & + & YDMF_PHYS%OUT%FCSQN, YDMF_PHYS%OUT%FCQNG ) + + ! Comment the following lines, which generate negative QR/QS values in CPTEND_NEW. + !DO JLON=KIDIA,KFDIA + ! PFPLSL(JLON,KLEV)=PFPLSL(JLON,KLEV)+PDIFTQL(JLON,KLEV) + ! PFPLSN(JLON,KLEV)=PFPLSN(JLON,KLEV)+PDIFTQI(JLON,KLEV) + !ENDDO + + ENDIF + +!* +! ------------------------------------------------------------------ +! 12. - BILAN HYDRIQUE DU SOL +! --------------------------- + IF ( LMSE ) THEN + + DO JLON=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDCPG_GPAR%RAIN(JLON)=ZFPLSL(JLON,YDCPG_OPTS%KFLEVG)+YDMF_PHYS%OUT%FPLCL(JLON,YDCPG_OPTS%KFLEVG) + YDCPG_GPAR%SNOW(JLON)=ZFPLSN(JLON,YDCPG_OPTS%KFLEVG)+YDMF_PHYS%OUT%FPLCN(JLON,YDCPG_OPTS%KFLEVG) + ENDDO + + ELSE + + IF ( LSFHYD.AND.LSOLV ) THEN + CALL ACDROV (YDCST, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG,& + & YSP_SBD%NLEVS, YDMF_PHYS%OUT%FPLCL, YDMF_PHYS%OUT%FPLCN, ZFPLSL, ZFPLSN, YDMF_PHYS%OUT%FRSO, & + & YDMF_PHYS%OUT%FRTH, ZDSA_C1, ZDSA_C2, ZC3, ZCN, YDMF_PHYS%OUT%CT, YDMF_PHYS_SURF%GSD_VV%PD2, & + & YDMF_PHYS%OUT%FEVV, YDMF_PHYS%OUT%FTR, YDMF_PHYS_SURF%GSD_VV%PLAI, ZFLU_NEIJ, ZFLU_VEG, ZWFC, & + & ZWPMX, YDMF_PHYS_BASE_STATE%YGSP_RR%FC, ZWLMX, ZWSEQ, ZWSMX, YDMF_PHYS%OUT%FCHSP, YDMF_PHYS%OUT%FCLL, & + & YDMF_PHYS%OUT%FCLN, YDMF_PHYS%OUT%FCS, ZFLU_FEVI, YDMF_PHYS%OUT%FEVL, YDMF_PHYS%OUT%FEVN, YDMF_PHYS_SURF%GSD_VF%PLSM, & + & YDMF_PHYS_BASE_STATE%YGSP_SG%F, YDMF_PHYS_BASE_STATE%YGSP_SB%T, YDMF_PHYS_BASE_STATE%YGSP_RR%T, & + & YDMF_PHYS_BASE_STATE%YGSP_SB%Q, YDMF_PHYS_BASE_STATE%YGSP_SB%TL, YDMF_PHYS_BASE_STATE%YGSP_RR%W, & + & YDMF_PHYS_BASE_STATE%YGSP_RR%IC, YDMF_PHYS%OUT%FGEL, YDMF_PHYS%OUT%FGELS, YDMF_PHYS%OUT%FLWSP, & + & YDMF_PHYS%OUT%FONTE, YDMF_PHYS%OUT%RUISP, YDMF_PHYS%OUT%RUISL, YDMF_PHYS%OUT%RUISS) + ENDIF + + ENDIF + +!* +!- -------------------------------------------------------------------- +! 13.- DRAG MESOSPHERIQUE POUR UN MODELE POSSEDANT DES NIVEAUX +! AU-DESSUS DE 50 KM (I.E. DANS LA MESOSPHERE) +! ------------------------------------------------------------------ + IF ( LRRMES ) THEN + CALL ACDRME (YDCST, YDSTA, YDPHY2, YDTOPH, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & NTDRME, YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, & + & YDMF_PHYS_BASE_STATE%T, ZQV, YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, YDMF_PHYS%OUT%FRMH, & + & ZMSC_FRMQ, YDMF_PHYS%OUT%STRMU, YDMF_PHYS%OUT%STRMV) + ENDIF + +!* +! ------------------------------------------------------------------ +! 14.- FLUX PHOTO-CHIMIQUE D'OZONE +! ------------------------------------------------------------------ + IF ( LOZONE ) THEN + CALL ACOZONE ( YDPHY2, YDTOPH, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, NTOZON, YDCPG_OPTS%KFLEVG, & + & YDMODEL%YRML_PHY_G%YRDPHY%NVCLIS, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, YDCPG_MISC%KOZO, ZQO3(1, 1), YDMF_PHYS_BASE_STATE%T, & + & ZRDG_MU0, YDMF_PHYS%OUT%FCHOZ) + +! DIFFUSION TURBULENTE/DEPOT SEC DE L'OZONE + + CALL ACDIFOZ ( YDRIP, YDPHY2, YDMODEL%YRML_PHY_MF%YRVDOZ, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & YDCPG_OPTS%KTDIA, YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, & + & YDMF_PHYS%OUT%FPLCL, YDMF_PHYS%OUT%FPLSL, YDMF_PHYS%OUT%FRSO, ZKTROV, ZQO3(1, 1), YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, & + & YDMF_PHYS_BASE_STATE%T, ZXTROV, ZFLU_NEIJ, YDVARS%GEOMETRY%GEMU%T0, YDMF_PHYS_SURF%GSD_VV%PIVEG, & + & YDMF_PHYS%OUT%FCHOZ & + & ) + ENDIF +!* +! ------------------------------------------------------------------ +! 15.- CALCUL DES FLUX D'ENTHALPIE ET DE CHALEUR SENSIBLE LIES AUX +! PRECIPITATIONS EN FONCTION DES FLUX DE PRECIPITATION +! ET DE CONDENSATION. +! ------------------------------------------------------------------ + + ! STORE THE PSEUDO-HISTORIC SURFACE PRECIPITATION SENSIBLE HEAT FLUX + ! ------------------------------------------------------------------- + + IF (LPHSPSH) THEN + DO JLON=YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA + YDMF_PHYS_SURF%GSD_VH%PSPSH(JLON)=(YDMF_PHYS_BASE_STATE%T(JLON,YDCPG_OPTS%KFLEVG)-YDMF_PHYS_BASE_STATE%YGSP_RR%T(JLON)) * ((& + & RCW-RCPD)*(YDMF_PHYS%OUT%FPLSL(JLON,YDCPG_OPTS%KFLEVG)+YDMF_PHYS%OUT%FPLCL(JLON,YDCPG_OPTS%KFLEVG))& + & +(RCS-RCPD)*(YDMF_PHYS%OUT%FPLSN(JLON,YDCPG_OPTS%KFLEVG)+YDMF_PHYS%OUT%FPLCN(JLON,YDCPG_OPTS%KFLEVG)) ) + ENDDO + IF (LGRAPRO) THEN + DO JLON=YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA + YDMF_PHYS_SURF%GSD_VH%PSPSH(JLON)=YDMF_PHYS_SURF%GSD_VH%PSPSH(JLON)+(YDMF_PHYS_BASE_STATE%T(JLON,YDCPG_OPTS%KFLEVG)-YDMF_PHYS_BASE_STATE%YGSP_RR%T(JLON)) * (& + &(RCS-RCPD)*(YDMF_PHYS%OUT%FPLSG(JLON,YDCPG_OPTS%KFLEVG)+YDMF_PHYS%OUT%FPLCG(JLON,YDCPG_OPTS%KFLEVG))) + ENDDO + ENDIF + ENDIF !LPHSPSH + +!* +! ------------------------------------------------------------------ +! 16.- CALCUL DE LA DENSITE DES FOUDRES (DIAGNOSTIQUE). +! ------------------------------------------------------------------ + + IF (LFLASH) THEN +! tbd +! about vertical velocity: +! PWW is the resolved w in m/s given by the dynamics. +! In case moist deep convection is not fully resolved, we should consider +! computing w from the mass flux. See transport in ACCVUD. +! + CALL DIAGFLASH(YDCFU,YDMODEL%YRML_PHY_MF,YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA,YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG,& + & YDCPG_OPTS%KSTEP,& + & ZQL,ZQI,YDMF_PHYS_BASE_STATE%R,YDMF_PHYS_BASE_STATE%S,ZQG,ZQH,YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP,& + & YDMF_PHYS_BASE_STATE%T,YDMF_PHYS_BASE_STATE%YCPG_PHY%W,YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R,& + & YDVARS%UAL%T0,YDVARS%UOM%T0,YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF,& + & YDMF_PHYS_SURF%GSD_VF%PLSM,YDMF_PHYS%OUT%FLASH) + ENDIF + +! Store radiative cloudiness in GFL structure for ISP, Historical files or PostProcessing + IF (YIRAD%LGP) YDVARS%IRAD%T1(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) = YDCPG_MISC%QICE(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) + IF (YLRAD%LGP) YDVARS%LRAD%T1(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) = YDCPG_MISC%QLI (YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) + IF (YA%LGP) YDVARS%A%T1(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) = YDCPG_MISC%NEB (YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) + + +!* +! ----------------------------------------------------------------------- +! 16.- DDH FLEXIBLES POUR LES CHAMPS DE SURFACE VARIABLES/FLUX/TENDANCES. +! ----------------------------------------------------------------------- + + IF (YDMODEL%YRML_DIAG%YRLDDH%LFLEXDIA) THEN + CALL APLPAR_FLEXDIA (YDCPG_BNDS, YDCPG_OPTS, YDCPG_MISC, YDMF_PHYS, YDMF_PHYS_SURF, YDMODEL, & + & YDDDH, YDMF_PHYS_BASE_STATE) + ENDIF + + IF (LECT.AND.LRAFTKE) THEN + ! DCAPE due to precipitation evaporation. + CALL ACEVADCAPE(YDMODEL%YRML_PHY_MF%YRPHY2, YDCST, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, YDMF_PHYS%OUT%FPLSL, & + & YDMF_PHYS%OUT%FPLSN, YDMF_PHYS%OUT%FPLCL, YDMF_PHYS%OUT%FPLCN, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, ZDCAPE) + ! Gusts. + CALL ACCLDIA(YDCST, YDCPG_OPTS%LXCLP, YDCPG_OPTS%LXTGST, YDCPG_OPTS%LXXGST, YDPHY, YDPHY2, YDTOPH, & + & YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, YDMF_PHYS%OUT%UCLS, YDMF_PHYS%OUT%VCLS, & + & YDMF_PHYS_BASE_STATE%U, YDMF_PHYS_BASE_STATE%V, YDMF_PHYS%OUT%CAPE, ZDCAPE, ZTKE1, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDVARS%GEOMETRY%OROG%T0, YDMF_PHYS%OUT%UGST, YDMF_PHYS%OUT%VGST, ZBLH, IMOC_CLPH) + YDMF_PHYS%OUT%CLPH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=MIN(XMAXLM,MAX(XMINLM,ZBLH(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA))) + ENDIF + + IF (LXVISI.OR.LXVISI2) THEN + ZQGM(:,:)=ZEPSNEB + CALL ACVISIH(YDCST, YDMODEL%YRML_PHY_MF%YRPHY%YRDVISI, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, & + & YDCPG_OPTS%KTDIA, YDCPG_OPTS%KFLEVG, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%R, & + & YDCPG_MISC%QLI, YDCPG_MISC%QICE, ZQR, ZQS, ZQGM, YDMF_PHYS%OUT%VISICLD, YDMF_PHYS%OUT%VISIHYD, & + & YDMF_PHYS%OUT%MXCLWC ) + ENDIF + + !------------------------------------------------- + ! Check if fluxes are different from NaN. + !------------------------------------------------- + IF (YDPHY%LGCHECKNAN) THEN + CALL CHECKNAN(YDRIP,YDPHY0,YDPHY2, YDCPG_OPTS%NINDAT, & + & YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, YDCPG_OPTS%KSTEP, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF, & + & YDVARS%GEOMETRY%GELAM%T0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), YDVARS%GEOMETRY%GEMU%T0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), & + & ZRDG_MU0(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA), YDMF_PHYS_SURF%GSD_VF%PLSM, & + & YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%Q, ZFLU_QSAT, YDMF_PHYS_BASE_STATE%YGSP_RR%T, & + & YDMF_PHYS%OUT%DIFCQLC, YDMF_PHYS%OUT%DIFCQIC, YDMF_PHYS%OUT%FIMCC, & + & YDMF_PHYS%OUT%FEDQLC, YDMF_PHYS%OUT%FEDQIC, YDMF_PHYS%OUT%FEDQRC, YDMF_PHYS%OUT%FEDQSC, & + & YDMF_PHYS%OUT%FCNEGQLC, YDMF_PHYS%OUT%FCNEGQIC, YDMF_PHYS%OUT%FCNEGQRC, YDMF_PHYS%OUT%FCNEGQSC, & + & ZPFL_FPLCH, & + & YDMF_PHYS%OUT%DIFCQ, YDMF_PHYS%OUT%DIFCQN, YDMF_PHYS%OUT%DIFCQL, & + & YDMF_PHYS%OUT%DIFCS, YDMF_PHYS%OUT%DIFTQ, YDMF_PHYS%OUT%DIFTQN, YDMF_PHYS%OUT%DIFTQL, YDMF_PHYS%OUT%DIFTS, & + & YDMF_PHYS%OUT%FCCQL, YDMF_PHYS%OUT%FCCQN, YDMF_PHYS%OUT%FCSQL, YDMF_PHYS%OUT%FCSQN, YDMF_PHYS%OUT%FCQNG, & + & YDMF_PHYS%OUT%FCQNNG, YDMF_PHYS%OUT%FCQLNG, YDMF_PHYS%OUT%FCQRNG, YDMF_PHYS%OUT%FCQSNG, & + & YDMF_PHYS%OUT%FPLCL, YDMF_PHYS%OUT%FPLCN, YDMF_PHYS%OUT%FPLCG, & + & YDMF_PHYS%OUT%FPLSL, YDMF_PHYS%OUT%FPLSN, YDMF_PHYS%OUT%FPLSG, & + & YDMF_PHYS%OUT%STRCU, YDMF_PHYS%OUT%STRCV, YDMF_PHYS%OUT%STRDU, YDMF_PHYS%OUT%STRDV, & + & YDMF_PHYS%OUT%STRTU, YDMF_PHYS%OUT%STRTV, YDMF_PHYS%OUT%STRMU, YDMF_PHYS%OUT%STRMV, & + & YDMF_PHYS%OUT%FRMH, ZMSC_FRMQ, YDMF_PHYS%OUT%FCHOZ, & + & YDMF_PHYS%OUT%FPFPSL, YDMF_PHYS%OUT%FPFPSN, YDMF_PHYS%OUT%FPFPCL, YDMF_PHYS%OUT%FPFPCN, & + & YDMF_PHYS%OUT%FPEVPSL, YDMF_PHYS%OUT%FPEVPSN, YDMF_PHYS%OUT%FPEVPCL, YDMF_PHYS%OUT%FPEVPCN) + ENDIF +ENDIF !LMPHYS +!---------------------------------------------------- +! CALCUL DE DEPOT HUMIDE POUR LES AEROSOLS DESERTIQUES +!---------------------------------------------------- +IF (LMDUST.AND.(NGFL_EXT/=0).AND.LRDEPOS) THEN + +IKRR=6 +ISPLITR=1 +ZEVAP=0.0_JPRB +ZZDEP=0.0_JPRB + + DO JLEV = 1 , YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZZDEP(JLON,1,JLEV)=ZZI_APHI(JLON,JLEV)*ZINVG + ENDDO + ENDDO + + + DO JLEV=1,YDCPG_OPTS%KFLEVG + DO JLON= YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA + ZQDM(JLON,JLEV)=1._JPRB-ZQV(JLON,JLEV)-ZQL(JLON,JLEV)-ZQR(JLON,JLEV) & + & -ZQI(JLON,JLEV)-ZQS(JLON,JLEV) + ENDDO + ENDDO + + DO JLEV = 1, YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZZI_RM(JLON,1,JLEV,2)=ZQL(JLON,JLEV)& + & /ZQDM(JLON,JLEV) + ENDDO + ENDDO + + DO JLEV = 1, YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZZI_RM(JLON,1,JLEV,3)=ZQR(JLON,JLEV)& + & /ZQDM(JLON,JLEV) + ENDDO + ENDDO + + DO JLEV = 1, YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZEVAP(JLON,1,JLEV)=YDMF_PHYS%OUT%FPEVPSL(JLON,JLEV)& + & +YDMF_PHYS%OUT%FPEVPCL(JLON,JLEV) + ENDDO + ENDDO + + DO JGFL=1,NGFL_EXT + DO JLON=1,YDCPG_OPTS%KLON + DO JLEV=1,YDCPG_OPTS%KFLEVG + ZZI_SVM(JLON,1,JLEV,JGFL)=MAX(0._JPRB,ZSVM(JLON,JLEV,JGFL)) + ENDDO + ENDDO + ENDDO + + CALL ARO_WETDEP(ILONMNH, YDCPG_OPTS%KFLEVG, NGFL_EXT, IKRR, YDCPG_OPTS%ZDTPHY, ZZI_SVM(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, :, :, 1:NGFL_EXT), & + & ZZDEP(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, :, :), ZZI_PABSM(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, :, :), & + & ZZI_THM(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, :, :), ZZI_RHODREFM(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, :, :), & + & YDCPG_OPTS%KSTEP+1, ZZI_RM(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, :, :, :), ZEVAP(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, :, :), & + & ISPLITR ) +! return to tendency + DO JGFL=1,NGFL_EXT + DO JLON=1,YDCPG_OPTS%KLON + DO JLEV=1,YDCPG_OPTS%KFLEVG + ZPSV(JLON,JLEV,JGFL)=ZZI_SVM(JLON,1,JLEV,JGFL) + ENDDO + ENDDO + ENDDO + + DO JGFL=1,NGFL_EXT + DO JLON=1,YDCPG_OPTS%KLON + DO JLEV=1,YDCPG_OPTS%KFLEVG + ZTENDEXT_DEP(JLON,JLEV,JGFL)=(ZPSV(JLON,JLEV,JGFL)-ZSVM(JLON,JLEV,JGFL))*ZINVDT + ENDDO + ENDDO + ENDDO + +ENDIF ! ENDIF (LMDUST & NGFL_EXT & LRDEPOS) + +IF(LMUSCLFA) THEN + DO JLEV=0,YDCPG_OPTS%KFLEVG + DO JLON=1,YDCPG_OPTS%KLON + ZFPLS(JLON,JLEV)=YDMF_PHYS%OUT%FPLSL(JLON,JLEV)+YDMF_PHYS%OUT%FPLSN(JLON,JLEV) + ZFPLC(JLON,JLEV)=YDMF_PHYS%OUT%FPLCL(JLON,JLEV)+YDMF_PHYS%OUT%FPLCN(JLON,JLEV) + ZFPL (JLON,JLEV)=ZFPLC (JLON,JLEV)+ZFPLS (JLON,JLEV) + ENDDO + ENDDO + CALL WRSCMR(NMUSCLFA, 'ZFPLS', ZFPLS, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG+1) + CALL WRSCMR(NMUSCLFA, 'ZFPLC', ZFPLC, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG+1) + CALL WRSCMR(NMUSCLFA, 'ZFPL', ZFPL, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG+1) +ENDIF + +! ------------------------------------------------------------------ + +! BAYRAD +! Compute convective hydrometeors mixing ratio from diagnistic fluxes +!-------------------------------------------------------------------- +IF ( (.NOT. LGPCMT) ) THEN + + ! Convert from flux [kg/m2/s] to density [kg/m3] using old RTTOV-SCATT + ! a b ! RR = a * LWC^b, [RR]=mm/h, [LWC]=g/m^3 + ! 20.89 1.15 ! rain + ! 29.51 1.10 ! snow + + ZBAY_QRCONV(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) = 0.0_JPRB + ZBAY_QSCONV(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) = 0.0_JPRB + + + DO JLEV=1,YDCPG_OPTS%KFLEVG + DO JLON= YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA + ZBAY_QRCONV(JLON,JLEV) = 0.001_JPRB * ( (ABS(YDMF_PHYS%OUT%FPLCL(JLON,JLEV)) * YDPHY0%RCOEFRAIN(1)) ** YDPHY0%RCOEFRAIN(2) ) + ZBAY_QSCONV(JLON,JLEV) = 0.001_JPRB * ( (ABS(YDMF_PHYS%OUT%FPLCN(JLON,JLEV)) * YDPHY0%RCOEFSNOW(1)) ** YDPHY0%RCOEFSNOW(2) ) + ENDDO + ENDDO + + + ! Convert density [kg/m3] to mixing ratio [kg/kg] + ! R_dry (dry air constant) + + ZDE2MR(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) = RD * YDMF_PHYS_BASE_STATE%T(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) / YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) + ZBAY_QRCONV(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) = ZBAY_QRCONV(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) * ZDE2MR(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) + ZBAY_QSCONV(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) = ZBAY_QSCONV(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) * ZDE2MR(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,:) + +ENDIF + + +! Precipitation Type + +! Compute wet-bulb temperature at 2 meters (suppose homogeneity of qv/ql/qi ) +!ZPCLS(KIDIA:KFDIA)=PAPRS(KIDIA:KFDIA,KLEV)-2._JPRB/ZZZF(KIDIA:KFDIA,1,KLEV)*& +! &(PAPRS(KIDIA:KFDIA,KLEV)-PAPRSF(KIDIA:KFDIA,KLEV)) +CALL PPWETPOINT(YDCST, YDPHY, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, ZPCLS, YDMF_PHYS%OUT%TCLS, & +& YDMF_PHYS_BASE_STATE%Q(:, YDCPG_OPTS%KFLEVG), YDMF_PHYS_BASE_STATE%L(:, YDCPG_OPTS%KFLEVG), YDMF_PHYS_BASE_STATE%I(:, YDCPG_OPTS%KFLEVG), & +& YDMF_PHYS%OUT%TPWCLS & +& ) + + +IF (LDPRECIPS .OR. LDPRECIPS2) THEN + ! Defined precipitation type + ! + ! Compute wet-bulb temperature + DO JLEV=1,YDCPG_OPTS%KFLEVG + CALL PPWETPOINT(YDCST, YDPHY, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYDF(:, JLEV), & + & YDMF_PHYS_BASE_STATE%T(:, JLEV), YDMF_PHYS_BASE_STATE%Q(:, JLEV), YDMF_PHYS_BASE_STATE%L(:, JLEV), & + & YDMF_PHYS_BASE_STATE%I(:, JLEV), ZTW(:, JLEV)) + ENDDO + + DO JLON=1,YDCPG_OPTS%KLON + ZFPLS(JLON,YDCPG_OPTS%KFLEVG)=YDMF_PHYS%OUT%FPLCN(JLON,YDCPG_OPTS%KFLEVG)+YDMF_PHYS%OUT%FPLSN(JLON,YDCPG_OPTS%KFLEVG) + ZFPLC(JLON,YDCPG_OPTS%KFLEVG)=YDMF_PHYS%OUT%FPLCL(JLON,YDCPG_OPTS%KFLEVG)+YDMF_PHYS%OUT%FPLSL(JLON,YDCPG_OPTS%KFLEVG) + ZFPLSG(JLON,YDCPG_OPTS%KFLEVG)=0._JPRB + ENDDO + + !initialisation de ZZZ + DO JLEV = 1,YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZZZ(JLON,1,JLEV)=YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI(JLON,JLEV)*ZINVG + ENDDO + ENDDO + + !initialisation de ZDZZ + DO JLEV = 2, YDCPG_OPTS%KFLEVG + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZDZZ(JLON,1,JLEV)=ZZZ(JLON,1,JLEV-1)-ZZZ(JLON,1,JLEV) + ENDDO + ENDDO + DO JLON = YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZDZZ(JLON,1,1)=YDMF_PHYS_BASE_STATE%YCPG_DYN%PHI(JLON,0)*ZINVG-ZZZ(JLON,1,1) + ENDDO + + IF (LDPRECIPS) THEN + + CALL DPRECIPS (YDCST, YDPHY%YRDPRECIPS, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, & + & YDVARS%GEOMETRY%OROG%T0, YDMF_PHYS%OUT%TPWCLS, YDMF_PHYS%OUT%DIAGH, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & ZDZZ, ZTW, YDMF_PHYS_BASE_STATE%L, ZFPLC(:, YDCPG_OPTS%KFLEVG), ZFPLS(:, YDCPG_OPTS%KFLEVG), ZFPLSG(:, YDCPG_OPTS%KFLEVG), & + & ZPRC_DPRECIPS(:, YDCPG_OPTS%NDTPRECCUR)) + + ENDIF + + IF (LDPRECIPS2) THEN + + !Idem for an other time step and an other period + + CALL DPRECIPS(YDCST, YDPHY%YRDPRECIPS, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KLON, YDCPG_OPTS%KFLEVG, & + & YDVARS%GEOMETRY%OROG%T0, YDMF_PHYS%OUT%TPWCLS, YDMF_PHYS%OUT%DIAGH, YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, & + & ZDZZ, ZTW, YDMF_PHYS_BASE_STATE%L, ZFPLC(:, YDCPG_OPTS%KFLEVG), ZFPLS(:, YDCPG_OPTS%KFLEVG), ZFPLSG(:, YDCPG_OPTS%KFLEVG), & + & ZPRC_DPRECIPS2(:, YDCPG_OPTS%NDTPRECCUR2)) + + ENDIF +ENDIF + +IF (LAJUCV) THEN + DO JLEV=1,YDCPG_OPTS%KFLEVG + DO JROF=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDVARS%T%T0(JROF,JLEV)=ZADJ_TAUX(JROF,JLEV) + ENDDO + ENDDO + DO JLEV=1,YDCPG_OPTS%KFLEVG + DO JROF=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS_NEXT_STATE%T (JROF, JLEV) = YDMF_PHYS_NEXT_STATE%T (JROF, JLEV) + ZADJ_DTAJU(JROF,JLEV) + ENDDO + ENDDO +ENDIF + +! convert to flexible interface structure +IF (LINTFLEX) THEN + CALL APLPAR2INTFLEX(YGFL, YDPHY, YDCPG_OPTS%KLON, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG, & + & YDMF_PHYS%OUT%DIFCQ, YDMF_PHYS%OUT%DIFCQN, YDMF_PHYS%OUT%DIFCQL, YDMF_PHYS%OUT%DIFCS, ZDIFEXT, YDMF_PHYS%OUT%DIFTQ, & + & YDMF_PHYS%OUT %DIFTQN, YDMF_PHYS%OUT%DIFTQL, YDMF_PHYS%OUT%DIFTS, YDMF_PHYS%OUT%FCCQL, YDMF_PHYS%OUT%FCCQN, & + & YDMF_PHYS%OUT%FCSQL, YDMF_PHYS%OUT%FCSQN, YDMF_PHYS%OUT%FPLSL, YDMF_PHYS%OUT%FPLSN, YDMF_PHYS%OUT%FPLCL, & + & YDMF_PHYS%OUT%FPLCN, YDMF_PHYS%OUT%FPEVPSL, YDMF_PHYS%OUT%FPEVPSN, YDMF_PHYS%OUT%FPEVPCL, YDMF_PHYS%OUT%FPEVPCN, & + & YDMF_PHYS%OUT%FPFPSL, YDMF_PHYS%OUT%FPFPSN, YDMF_PHYS%OUT%FPFPCL, YDMF_PHYS%OUT%FPFPCN, YDMF_PHYS%OUT%FCQLNG, & + & YDMF_PHYS%OUT%FCQNNG, YDMF_PHYS%OUT%FCQRNG, YDMF_PHYS%OUT%FCQSNG, YDMF_PHYS%OUT%FCQNG, YDMF_PHYS%OUT%FRMH, & + & ZMSC_FRMQ, YDMF_PHYS%OUT%FRSO, YDMF_PHYS%OUT%FRTH, YDMF_PHYS%OUT%STRCU, YDMF_PHYS%OUT%STRCV, YDMF_PHYS%OUT%STRDU, & + & YDMF_PHYS%OUT%STRDV, YDMF_PHYS%OUT%STRTU, YDMF_PHYS%OUT%STRTV, YDMF_PHYS%OUT%STRMU, YDMF_PHYS%OUT%STRMV, & + & YDMF_PHYS%OUT%DIFCQLC, YDMF_PHYS%OUT%DIFCQIC, YDMF_PHYS%OUT%FIMCC, YDMF_PHYS%OUT%FEDQLC, YDMF_PHYS%OUT%FEDQIC, & + & YDMF_PHYS%OUT%FEDQRC, YDMF_PHYS%OUT%FEDQSC, YDMF_PHYS%OUT%FCNEGQLC, YDMF_PHYS%OUT%FCNEGQIC, YDMF_PHYS%OUT%FCNEGQRC, & + & YDMF_PHYS%OUT%FCNEGQSC, ZPFL_FTKE, ZTENDPTKE, ZTENDEXT, ZTENDEXT_DEP, YLPROCSET ) +ENDIF + +! 2.3 Computes MOCON in the CLP. +! -------------------------- +CALL MF_PHYS_MOCON (YDCPG_BNDS, YDCPG_OPTS, ZRDG_LCVQ, IMOC_CLPH, YDMF_PHYS, YDMF_PHYS_BASE_STATE) + +! Store surface water flux P and E for water conservation +IF (LCORWAT) THEN + CALL MF_PHYS_CORWAT (YDCPG_BNDS, YDCPG_OPTS, YDMF_PHYS%OUT%FEVL, YDMF_PHYS%OUT%FEVN, YDMF_PHYS%OUT%FPLCL, & + & YDMF_PHYS%OUT%FPLCN, YDMF_PHYS%OUT%FPLSL, YDMF_PHYS%OUT%FPLSN, YDMF_PHYS_SURF%GSD_VH%PEVA, YDMF_PHYS_SURF%GSD_VH%PPCL, & + & YDMF_PHYS_SURF%GSD_VH%PPCN, YDMF_PHYS_SURF%GSD_VH%PPSL, YDMF_PHYS_SURF%GSD_VH%PPSN) +ENDIF + +! 2.4 Stores radiation coefficients. +! ------------------------------ + +! * writes grid-point transmission coefficients for simplified physics. + + +IF (LRCOEF.AND.(YDCPG_OPTS%KSTEP == 1)) THEN + IFIELDSS=NG3SR*YDCPG_OPTS%KFLEVG + CALL WRRADCOEF(YDGEOMETRY, YDRCOEF, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_BNDS%KSTGLO, & + & IFIELDSS, ZRDT_COR, ZRDT_RAB3C, ZRDT_RAB3N, ZRDT_RAB4C, ZRDT_RAB4N, ZRDT_RAB6C, ZRDT_RAB6N, & + & ZRDT_RAT1C, ZRDT_RAT1N, ZRDT_RAT2C, ZRDT_RAT2N, ZRDT_RAT3C, ZRDT_RAT3N, ZRDT_RAT4C, ZRDT_RAT4N, & + & ZRDT_RAT5C, ZRDT_RAT5N, ZAC_HC) +ENDIF + +! 2.5 Ozone +! ----- + + +IF (LOZONE) THEN + ! * Caution: this part has not been yet validated relative + ! to the GFL implementation, and LOZONE (the setup of + ! which has not yet been updated) can be true only if + ! the GFL ozone is activated as a prognostic and advected + ! variable. + CALL CPOZO (YDCPG_OPTS%KLON, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG, YDCPG_OPTS%ZDTPHY, YDMF_PHYS%OUT%FCHOZ, & + & YDMF_PHYS_NEXT_STATE%O3 (:, 1:YDCPG_OPTS%KFLEVG), YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP) +ENDIF + +! 2.5.1 Chemical species +! ---------------- +IF (LCHEM_ARPCLIM) THEN + ! Processes described in my_phys ARPEGE-Climat 6.3 : to be added later here + ! Modify also calls in CPTEND_NEW, etc.. as done ARPEGE-Climat 6.3. +ENDIF + +! 2.6 surface specific humidity necessary to compute the vertical +! advection of q in the case "delta m=1" (unlagged physics only). +! --------------------------------------------------------------- + +IF (NDPSFI == 1) THEN + CALL CPQSOL(YDCST, YDGEOMETRY%YRDIMV, YDPHY, YDCPG_OPTS%KLON, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_PHY0%PREHYD, & + & YDMF_PHYS_SURF%GSP_RR%PT_T0, YDCPG_MISC%QS, ZFLU_QSATS, YDCPG_MISC%QSOL) +ENDIF + +! 2.7 Computation of tendencies T,u,v and Q. +! -------------------------------------- + +! Set GFL tendencies to 0 + +ZTENDGFL(:,:,:) = 0.0_JPRB + +! * CPTEND+CPUTQY = Old( CPATY + CPDUP + CPDTHP ) +! Calcul des tendances de T , U et de Q et modifications +! eventuelles de W et de OMEGA/P + +IF (LINTFLEX.AND.(.NOT.YDCPG_OPTS%LCONFX)) THEN + CALL CPTEND_FLEX( YDLDDH, YDMDDH, YGFL, YDPHY, YDCPG_OPTS%KLON, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, & + & YDCPG_OPTS%KFLEVG, YDVARS%GEOMETRY%GNORDL%T0, YDVARS%GEOMETRY%GNORDM%T0, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, & + & YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, YDMF_PHYS_BASE_STATE%U, & + & YDMF_PHYS_BASE_STATE%V, YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%YGSP_RR%T, PGFL, YLPROCSET, & + & YDMF_PHYS%OUT%TENDU, YDMF_PHYS%OUT%TENDV, ZTENDH, ZTENDGFL, YDMF_PHYS%OUT%FHSCL, YDMF_PHYS%OUT%FHSCN, & + & YDMF_PHYS%OUT%FHSSL, YDMF_PHYS%OUT%FHSSN, YDMF_PHYS%OUT%FHPCL, YDMF_PHYS%OUT%FHPCN, YDMF_PHYS%OUT%FHPSL, & + & YDMF_PHYS%OUT%FHPSN, PFHP=ZMSC_FHP, PFP=ZPFL_FP, PFEPFP=YDMF_PHYS%OUT%FEPFP, PFCMPCQ=YDMF_PHYS%OUT%FCMPCQ, & + & PFCMPSN=YDMF_PHYS%OUT%FCMPSN, PFCMPSL=YDMF_PHYS%OUT%FCMPSL, YDDDH=YDDDH) +ELSE + CALL CPTEND_NEW(YDCST, YDMODEL, YDCPG_OPTS%KLON, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG, YDVARS%GEOMETRY%GNORDL%T0, & + & YDVARS%GEOMETRY%GNORDM%T0, YDMF_PHYS%OUT%DIFCQ, YDMF_PHYS%OUT%DIFCQN, YDMF_PHYS%OUT%DIFCQL, YDMF_PHYS%OUT%DIFCS, & + & ZDIFEXT, YDMF_PHYS%OUT%DIFTQ, YDMF_PHYS%OUT%DIFTQN, YDMF_PHYS%OUT%DIFTQL, YDMF_PHYS%OUT%DIFTS, YDMF_PHYS%OUT%FCCQL, & + & YDMF_PHYS%OUT%FCCQN, YDMF_PHYS%OUT%FCSQL, YDMF_PHYS%OUT%FCSQN, YDMF_PHYS%OUT%FPLSL, YDMF_PHYS%OUT%FPLSN, & + & YDMF_PHYS%OUT%FPLSG, YDMF_PHYS%OUT%FPLCL, YDMF_PHYS%OUT%FPLCN, YDMF_PHYS%OUT%FPLCG, YDMF_PHYS%OUT%FPEVPSL, & + & YDMF_PHYS%OUT%FPEVPSN, YDMF_PHYS%OUT%FPEVPSG, YDMF_PHYS%OUT%FPEVPCL, YDMF_PHYS%OUT%FPEVPCN, YDMF_PHYS%OUT%FPEVPCG, & + & YDMF_PHYS%OUT%FPFPSL, YDMF_PHYS%OUT%FPFPSN, YDMF_PHYS%OUT%FPFPSG, YDMF_PHYS%OUT%FPFPCL, YDMF_PHYS%OUT%FPFPCN, & + & YDMF_PHYS%OUT%FCQLNG, YDMF_PHYS%OUT%FCQNNG, YDMF_PHYS%OUT%FCQRNG, YDMF_PHYS%OUT%FCQSNG, YDMF_PHYS%OUT%FCQGNG, & + & YDMF_PHYS%OUT%FCQNG, YDMF_PHYS%OUT%FRMH, ZMSC_FRMQ, YDMF_PHYS%OUT%FRSO, YDMF_PHYS%OUT%FRTH, YDMF_PHYS%OUT%STRCU, & + & YDMF_PHYS%OUT%STRCV, YDMF_PHYS%OUT%STRDU, YDMF_PHYS%OUT%STRDV, YDMF_PHYS%OUT%STRTU, YDMF_PHYS%OUT%STRTV, & + & YDMF_PHYS%OUT%STRMU, YDMF_PHYS%OUT%STRMV, YDMF_PHYS%OUT%DIFCQLC, YDMF_PHYS%OUT%DIFCQIC, YDMF_PHYS%OUT%FIMCC, & + & YDMF_PHYS%OUT%FEDQLC, YDMF_PHYS%OUT%FEDQIC, YDMF_PHYS%OUT%FEDQRC, YDMF_PHYS%OUT%FEDQSC, YDMF_PHYS%OUT%FCNEGQLC, & + & YDMF_PHYS%OUT%FCNEGQIC, YDMF_PHYS%OUT%FCNEGQRC, YDMF_PHYS%OUT%FCNEGQSC, ZPFL_FTKE, ZPFL_FTKEI, & + & ZPFL_FEFB1, ZPFL_FEFB2, ZPFL_FEFB3, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%DELP, YDMF_PHYS_BASE_STATE%YCPG_PHY%XYB%RDELP, & + & YDMF_PHYS_BASE_STATE%YCPG_DYN%PHIF, YDMF_PHYS_BASE_STATE%YCPG_DYN%RCP%CP, YDMF_PHYS_BASE_STATE%U, & + & YDMF_PHYS_BASE_STATE%V, YDMF_PHYS_BASE_STATE%T, YDMF_PHYS_BASE_STATE%Q, YDMF_PHYS_BASE_STATE%I, YDMF_PHYS_BASE_STATE%L, & + & YDVARS%LCONV%T0, YDVARS%ICONV%T0, YDVARS%RCONV%T0, YDVARS%SCONV%T0, YDMF_PHYS_BASE_STATE%R, YDMF_PHYS_BASE_STATE%S, & + & YDMF_PHYS_BASE_STATE%G, ZDSA_CPS, YDMF_PHYS_BASE_STATE%YGSP_RR%T, YDMF_PHYS%OUT%FHSCL, YDMF_PHYS%OUT%FHSCN, & + & YDMF_PHYS%OUT%FHSSL, YDMF_PHYS%OUT%FHSSN, YDMF_PHYS%OUT%FHSSG, YDMF_PHYS%OUT%FHPCL, YDMF_PHYS%OUT%FHPCN, & + & YDMF_PHYS%OUT%FHPCG, YDMF_PHYS%OUT%FHPSL, YDMF_PHYS%OUT%FHPSN, YDMF_PHYS%OUT%FHPSG, ZMSC_FHP, & + & ZPFL_FP, YDMF_PHYS%OUT%FEPFP, YDMF_PHYS%OUT%FCMPCQ, YDMF_PHYS%OUT%FCMPSN, YDMF_PHYS%OUT%FCMPSL, YDMF_PHYS%OUT%TENDU, & + & YDMF_PHYS%OUT%TENDV, ZTENDU, ZTENDV, ZTENDH, ZPTENDQ1, ZPTENDI1, ZPTENDL1, ZPTENDLCONV1, & + & ZPTENDICONV1, ZPTENDRCONV1, ZPTENDSCONV1, ZPTENDR1, ZPTENDS1, ZPTENDG1, ZPTENDTKE1, ZPTENDEFB11, & + & ZPTENDEFB21, ZPTENDEFB31, ZTENDEXT, YDDDH) +ENDIF + +IF (LTWOTL) THEN + +ELSE + + IF ( L3MT.OR.LSTRAPRO.OR.(NDPSFI==1)) THEN +! PFEPFP was ZFEPFP in CPTEND_NEW, before, ZFEPFP still in CPFHPFS + DO JLEV= 0, YDCPG_OPTS%KFLEVG + DO JROF = 1, YDCPG_OPTS%KLON + YDMF_PHYS%OUT%FEPFP(JROF,JLEV) = 0.0_JPRB + YDMF_PHYS%OUT%FCMPCQ(JROF,JLEV) = 0.0_JPRB + YDMF_PHYS%OUT%FCMPSN(JROF,JLEV) = 0.0_JPRB + YDMF_PHYS%OUT%FCMPSL(JROF,JLEV) = 0.0_JPRB + ENDDO + ENDDO + ENDIF + +ENDIF + + + +! 2.7.1 Diagnostics on physical tendencies +! ---------------------------------- + +IF (.NOT.YDCPG_OPTS%LCONFX) THEN + IF ((GCHETN%LFREQD).OR.(GCHETN%LCOORD).OR.(GCHETN%LPROFV)) THEN + CALL CPCHET (YDMF_PHYS, YDMF_PHYS_BASE_STATE, YDCPG_MISC, YDRIP, YDPHY, YDCPG_OPTS%KLON, YDCPG_BNDS%KIDIA, & + & YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG, YDCPG_OPTS%KSTEP, ZMSC_FRMQ, ZDSA_CPS, ZTENDH, ZPTENDQ1, & + & ZPTENDI1, ZPTENDL1, ZPTENDR1, ZPTENDS1, YDVARS%GEOMETRY%GEMU%T0, YDVARS%GEOMETRY%GELAM%T0) + ENDIF + + IF (GCHETN%LPROFV)& + & CALL PROFILECHET(YDGEOMETRY, YDCPG_MISC, YDMF_PHYS, ZRDG_CVGQ, ZRDG_LCVQ, ZRDG_MU0, YDCPG_DYN0, & + & YDMF_PHYS_SURF, YDVARS, YDSURF, YDDPHY, YDRIP, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KFDIA, YDVARS%GEOMETRY%GELAM%T0, & + & YDVARS%GEOMETRY%GEMU%T0, YDVARS%GEOMETRY%GM%T0, YDVARS%GEOMETRY%OROG%T0, YDVARS%GEOMETRY%RCORI%T0, & + & YDVARS%GEOMETRY%RATATH%T0, YDVARS%GEOMETRY%RATATX%T0) + +ENDIF + +! 2.8 Modification of vertical velocities +! by some physics output when required. +! ------------------------------------- + + +! * MODIFICATION DE LA VITESSE VERTICALE ET DE LA TENDANCE DE +! PRESSION DE SURFACE SI NDPSFI=1 ( MASSE VARIABLE ). +! Ajout de la physique dans l'equation de continuite/Add physics +! in continuity equation. + +IF (NDPSFI == 1) THEN + CALL CPMVVPS(YDCST, YDVAB, YDCPG_OPTS%KLON, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG, YDCPG_OPTS%ZDTPHY, & + & ZPFL_FP, YDMF_PHYS_BASE_STATE%YCPG_PHY%PREHYD(:, YDCPG_OPTS%KFLEVG), YDMF_PHYS%OUT%FEVL, YDMF_PHYS%OUT%FEVN, & + & YDCPG_DYN0%CTY%EVEL, YDCPG_DYN0%CTY%PSDVBC, YDMF_PHYS_NEXT_STATE%SP) +ENDIF + +! 2.9 Computation of evolution of T, u, v and Q. +! ------------------------------------------ + +! ALARO does not respect the coding rules, tendency of pseudo-TKE is computed in APLPAR and not +! in CPTEND_NEW. To use the new version of cputqy it is then necessary to write it in GFL tendencies array. +! This memory transfer is not necessary, please respect coding rules to avoid it. + +! Not necessary for intflex: already done in aplpar2intflex +IF (.NOT.(LINTFLEX.AND.(.NOT.YDCPG_OPTS%LCONFX))) THEN + IF (LPTKE) THEN + DO JLEV=1,YDCPG_OPTS%KFLEVG + DO JROF=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZPTENDTKE1(JROF,JLEV) = ZTENDPTKE(JROF,JLEV) + ENDDO + ENDDO + ENDIF + ! Extra-GFL + IF(LMDUST.AND.(NGFL_EXT/=0)) THEN + DO JGFL=1, NGFL_EXT + DO JLEV=1,YDCPG_OPTS%KFLEVG + DO JROF=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZTENDGFL(JROF,JLEV,YEXT(JGFL)%MP1) = ZTENDEXT(JROF,JLEV,JGFL)+&! turbulent tendency + & ZTENDEXT_DEP(JROF,JLEV,JGFL) ! moist tendency + ENDDO + ENDDO + ENDDO + ENDIF +ENDIF + +! ky: non-zero option not yet coded for the time being. +ZTENDD=0.0_JPRB + +! Calcul de T , Q et du Vent a l'instant 1 + +IF (LHOOK) CALL DR_HOOK ('CPUTQY',0,ZHOOK_HANDLE_1) + +CALL CPUTQY_APLPAR_EXPL(YDCST, YDCPG_BNDS, YDCPG_OPTS, YDMF_PHYS_NEXT_STATE, YDMF_PHYS_BASE_STATE, YDVARS, & +& YDPHY, YDCPG_OPTS%ZDTPHY, ZTENDH, YDMF_PHYS%OUT%TENDU, YDMF_PHYS%OUT%TENDV, ZTENDU, ZTENDV, ZTENDD, & +& ZPTENDEFB11, ZPTENDEFB21, ZPTENDEFB31, ZPTENDG1, ZPTENDICONV1, ZPTENDI1, ZPTENDLCONV1, ZPTENDL1, & +& ZPTENDQ1, ZPTENDRCONV1, ZPTENDR1, ZPTENDSCONV1, ZPTENDS1, ZPTENDTKE1, YDMF_PHYS%OUT%FDIS) + +CALL CPUTQY_APLPAR_LOOP(YDMODEL%YRML_DYN%YRDYN, YDGEOMETRY%YRDIMV, YDGMV, YGFL, YDPTRSLB1, YDPHY, YDCPG_OPTS%KLON, & +& YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG, YDCPG_OPTS%ZDTPHY, ZTENDGFL, YDCPG_SL1%ZVIEW, PGMVT1, & +& PGFLT1) + +IF (LHOOK) CALL DR_HOOK ('CPUTQY',1,ZHOOK_HANDLE_1) + +CALL MF_PHYS_FPL_PART2 (YDCPG_BNDS, YDCPG_OPTS, ZPFL_FPLCH, ZPFL_FPLSH, YDVARS%CPF%T1, YDVARS%SPF%T1, & +& YDMODEL) + +! 2.9b Prognostic convection etc. +! -------------------------- + +! TRANSFER NOT ADVECTED VARIABLES INTO PGFLT1 +CALL MF_PHYS_TRANSFER (YDCPG_BNDS, YDCPG_OPTS, YDVARS, YDMODEL%YRML_PHY_MF%YRPHY, YDMODEL%YRML_GCONF%YGFL) + +! 2.10 Surface variables. +! ------------------ + +IF ((.NOT.LSFORCS)) THEN + + IF (.NOT.LMSE) THEN + DO JLEV=0,YDCPG_OPTS%KFLEVG + DO JROF=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + ZPFL_FPLSN(JROF,JLEV)=YDMF_PHYS%OUT%FPLSN(JROF,JLEV)+YDMF_PHYS%OUT%FPLSG(JROF,JLEV) + ENDDO + ENDDO + CALL CPTENDS(YDCST, YDMODEL%YRML_PHY_MF, YDCPG_OPTS%KLON, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, YDCPG_OPTS%KFLEVG, & + & YSP_SBD%NLEVS, YDCPG_OPTS%ZDTPHY, YDMF_PHYS%OUT%FPLCL, YDMF_PHYS%OUT%FPLSL, YDMF_PHYS%OUT%FPLCN, & + & ZPFL_FPLSN, YDMF_PHYS %OUT%FRSO, YDMF_PHYS%OUT%FRTH, YDMF_PHYS_SURF%GSP_SG%PA_T1, YDMF_PHYS%OUT%CT, & + & ZDSA_C1, ZDSA_C2, YDMF_PHYS%OUT%FCHSP, YDMF_PHYS%OUT%FCLL, YDMF_PHYS %OUT%FCLN, YDMF_PHYS%OUT%FCS, & + & ZFLU_FEVI, YDMF_PHYS%OUT%FEVL, YDMF_PHYS%OUT %FEVN, YDMF_PHYS%OUT%FEVV, YDMF_PHYS%OUT%FGEL, YDMF_PHYS%OUT%FGELS, & + & YDMF_PHYS%OUT%FLWSP, YDMF_PHYS%OUT%FONTE, YDMF_PHYS%OUT%FTR, YDMF_PHYS_SURF%GSD_VF%PLSM, YDMF_PHYS_SURF%GSP_SG%PR_T1, & + & YDMF_PHYS%OUT%RUISL, YDMF_PHYS%OUT%RUISP, YDMF_PHYS%OUT%RUISS, YDMF_PHYS_SURF%GSP_SG%PF_T1, & + & ZFLU_VEG, ZTDS_TDTS, ZTDS_TDTP, ZTDS_TDWS, ZTDS_TDWSI, ZTDS_TDWP, ZTDS_TDWPI, ZTDS_TDWL, & + & ZTDS_TDSNS, ZTDS_TDALBNS, ZTDS_TDRHONS) + + CALL CPWTS(YDCST, YDCPG_OPTS, YDMODEL%YRML_AOC%YRMCC, YDPHY, YDMODEL%YRML_PHY_MF%YRPHY1, YDCPG_OPTS%KLON, YDCPG_BNDS%KIDIA, & + & YDCPG_BNDS%KFDIA, YSP_SBD%NLEVS, YDCPG_OPTS%ZDTPHY, ZTDS_TDTS, ZTDS_TDTP, ZTDS_TDWS, ZTDS_TDWSI, & + & ZTDS_TDWP, ZTDS_TDWPI, ZTDS_TDWL, ZTDS_TDSNS, ZTDS_TDALBNS, ZTDS_TDRHONS, YDMF_PHYS_SURF%GSD_VP%PTPC, & + & YDMF_PHYS_SURF%GSD_VP%PWPC, YDMF_PHYS_SURF%GSD_VF%PLSM, YDMF_PHYS_SURF%GSD_VV%PIVEG, YDMF_PHYS_SURF%GSP_RR%PT_T1, & + & YDMF_PHYS_SURF%GSP_SB%PT_T1, YDMF_PHYS_SURF%GSP_RR%PW_T1, YDMF_PHYS_SURF%GSP_RR%PIC_T1, YDMF_PHYS_SURF%GSP_SB%PQ_T1, & + & YDMF_PHYS_SURF%GSP_SB%PTL_T1, YDMF_PHYS_SURF%GSP_RR%PFC_T1, YDMF_PHYS_SURF%GSP_SG%PF_T1, YDMF_PHYS_SURF%GSP_SG%PA_T1, & + & YDMF_PHYS_SURF%GSP_SG%PR_T1 ) + ELSE + IF (YDCPG_OPTS%LCONFX) THEN + DO JROF=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS_SURF%GSP_RR%PT_T0(JROF)=YDCPG_GPAR%VTS(JROF) + ENDDO + ELSE + DO JROF=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDMF_PHYS_SURF%GSP_RR%PT_T1(JROF)=YDCPG_GPAR%VTS(JROF) + ENDDO + ENDIF + ENDIF + IF(LNUDG)THEN + CALL CPNUDG ( YDCPG_OPTS%KLON, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, NFNUDG, YDCPG_OPTS%KFLEVG, YDCPG_BNDS%KBL, & + & XPNUDG, YDMF_PHYS_SURF%GSD_VF%PNUDM, YDMF_PHYS_SURF%GSP_RR%PT_T1, YDMF_PHYS_SURF%GSP_RR%PW_T1, & + & YDMF_PHYS_SURF%GSP_SB%PQ_T1, YDMF_PHYS_SURF%GSP_SG%PF_T1, YDMF_PHYS_NEXT_STATE%T (:, 1:YDCPG_OPTS%KFLEVG), & + & YDMF_PHYS_NEXT_STATE%Q (:, 1:YDCPG_OPTS%KFLEVG), YDMF_PHYS_NEXT_STATE%U (:, 1:YDCPG_OPTS%KFLEVG), & + & YDMF_PHYS_NEXT_STATE%V (:, 1:YDCPG_OPTS%KFLEVG), YDMF_PHYS_NEXT_STATE%SP, YDVARS%T%T0, YDVARS%Q%T0, & + & YDVARS%U%T0, YDVARS%V%T0, YDCPG_PHY0%PREHYD(:, YDCPG_OPTS%KFLEVG), YDVARS%GEOMETRY%GM%T0, YDMF_PHYS_SURF%GSD_VF%PLSM& + & ) + ENDIF +ENDIF + + +IF(YDMODEL%YRML_PHY_MF%YRPHY%LCVPGY) THEN + CALL MF_PHYS_CVV (YDCPG_BNDS, YDCPG_OPTS, YDVARS%CVV%T0, YDVARS%CVV%T1) +ENDIF + +! 3.3 Store the model trajectory at t-dt (leap-frog) or t (sl2tl). +! ------------------------------------------------------------ + +IF (LTRAJPS) THEN + PTRAJ_PHYS%PQSSMF(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=YDCPG_MISC%QS(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA) + PTRAJ_PHYS%PTSMF(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA) =YDMF_PHYS_BASE_STATE%YGSP_RR%T(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA) + PTRAJ_PHYS%PSNSMF(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA)=YDMF_PHYS_BASE_STATE%YGSP_SG%F(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,1) + + IF (.NOT. LTWOTL) THEN + CALL WRPHTRAJM(YDGEOMETRY, YDSIMPHL, YDCPG_BNDS%KIDIA, YDCPG_BNDS%KFDIA, PTRAJ_PHYS, YDVARS%U%T9, & + & YDVARS%V%T9, YDVARS%T%T9, YDVARS%Q%T9, YDVARS%L%T9, YDVARS%I%T9, YDVARS%SP%T9) + ENDIF + + IF (LPRTTRAJ.AND.PTRAJ_PHYS%LASTCHUNK) WRITE(NULOUT,*)'GREPTRAJ STORE TRAJ_PHYS in APLPAR' +ENDIF + +! ------------------------------------------------------------------ + +!* 5. Final calculations. +! ------------------- + +! * Restore the initial value of some pseudo-historical surface buffers +! if relevant. +IF (LL_SAVE_PHSURF) THEN + CALL MF_PHYS_SAVE_PHSURF_PART2 (YDCPG_BNDS, YDCPG_OPTS, ZSAV_DDAL, ZSAV_DDOM, ZSAV_ENTCH, & + & ZSAV_FHPS, ZSAV_GZ0F, ZSAV_GZ0HF, ZSAV_HV, ZSAV_PBLH, ZSAV_QSH, ZSAV_UDAL, ZSAV_UDGRO, ZSAV_UDOM, & + & ZSAV_UNEBH, YDMF_PHYS_SURF%GSD_VF%PZ0F, YDMF_PHYS_SURF%GSD_VH%PPBLH, YDMF_PHYS_SURF%GSD_VH%PQSH, & + & YDMF_PHYS_SURF%GSD_VH%PSPSH, YDMF_PHYS_SURF%GSD_VK%PUDGRO, YDMF_PHYS_SURF%GSD_VV%PHV, YDMF_PHYS_SURF%GSD_VV%PZ0H, & + & YDVARS%DAL%T0, YDVARS%DOM%T0, YDVARS%UAL%T0, YDVARS%UEN%T0, YDVARS%UNEBH%T0, YDVARS%UOM%T0, & + & YDMODEL) +ENDIF + +! Store horizontal exchange coefficients (3D turbulence) to SL2 buffers +IF (L3DTURB) THEN + DO JLEV=1,YDCPG_OPTS%KFLEVG + YDCPG_SL2%KAPPAM (YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, JLEV) = ZKUR_KUROV_H(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JLEV) + YDCPG_SL2%KAPPAH (YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA, JLEV) = ZKUR_KTROV_H(YDCPG_BNDS%KIDIA:YDCPG_BNDS%KFDIA,JLEV) + ENDDO +ENDIF + +CALL MF_PHYS_BAYRAD (YDCPG_BNDS, YDCPG_OPTS, ZBAY_QRCONV, ZBAY_QSCONV, YDVARS%RCONV%T1, YDVARS%SCONV%T1, & +& YDMODEL) + + +!------------------------------------------------- +! Extract Single Column Model profiles from 3D run or +! write LFA file for MUSC (1D model) +!------------------------------------------------- +IF(LGSCM.OR.LMUSCLFA) THEN + IF (LAROME) THEN + DO JLEV=1,YDCPG_OPTS%KFLEVG + DO JROF=YDCPG_BNDS%KIDIA,YDCPG_BNDS%KFDIA + YDCPG_MISC%NEB(JROF,JLEV)=YDVARS%A%T1(JROF,JLEV) + ENDDO + ENDDO + ENDIF + CALL WRITEPHYSIO(YDGEOMETRY, YDCPG_MISC, YDCPG_PHY0, YDMF_PHYS, YDCPG_DYN0, YDMF_PHYS_SURF, YDVARS, & + & YDSURF, YDDPHY, YDRIP, YDMODEL%YRML_PHY_MF, YDCPG_BNDS%KFDIA, YDCPG_BNDS%KIDIA, YDCPG_OPTS%KGL1, & + & YDCPG_OPTS%KGL2, YDCPG_BNDS%KSTGLO, YDCPG_OPTS%KSTEP, NTSSG, YSP_SBD%NLEVS, YDVARS%GEOMETRY%GELAM%T0, & + & YDVARS%GEOMETRY%GEMU%T0, YDVARS%GEOMETRY%GM%T0, YDVARS%GEOMETRY%OROG%T0, YDVARS%GEOMETRY%RCORI%T0, & + & YDVARS%GEOMETRY%RATATH%T0, YDVARS%GEOMETRY%RATATX%T0, YDVARS%GEOMETRY%GECLO%T0, YDVARS%GEOMETRY%GESLO%T0, & + & ZRDG_CVGQ, ZRDG_LCVQ, ZRDG_MU0, ZDSA_C1, ZDSA_C2, ZDSA_CPS, ZDSA_LHS, ZDSA_RS, ZFLU_CD, ZFLU_CDN, & + & ZFLU_CH, ZFLU_EMIS, ZFLU_FEVI, ZFLU_NEIJ, ZFLU_QSAT, ZFLU_QSATS, ZFLU_VEG, IMOC_CLPH, ZMSC_FRMQ, & + & ZMSC_LH, ZMSC_LSCPE, ZMSC_QW, ZMSC_TW, ZPFL_FEFB1, ZPFL_FEFB2, ZPFL_FEFB3, ZPFL_FPLCH, & + & ZPFL_FPLSH, ZPFL_FTKE ) +ENDIF + +IF (LEDR) THEN + YDMF_PHYS_SURF%GSD_DI%PXEDR(:,:)=YDMF_PHYS%OUT%EDR(:,:) +ENDIF + +CALL MF_PHYS_PRECIPS (YDCPG_BNDS, YDCPG_OPTS, ZPRC_DPRECIPS, ZPRC_DPRECIPS2, YDMF_PHYS_SURF%GSD_XP%PPRECIP, & +& YDMF_PHYS_SURF%GSD_XP2%PPRECIP2, YDMODEL) + +! ------------------------------------------------------------------ + +! 6. destructor for procset +IF (LINTFLEX) CALL CLEANINTPROCSET(YLPROCSET) + +! ------------------------------------------------------------------ + +END ASSOCIATE +END ASSOCIATE +IF (LHOOK) CALL DR_HOOK('APLPAR',1,ZHOOK_HANDLE) +END SUBROUTINE APLPAR diff --git a/src/arome/ext/aro_adjust.F90 b/src/arome/ext/aro_adjust.F90 index 71d307a6e69d3e056f2b6f9e160b0f4b0c2c3b9e..ed3db928fefa28ef216dc2bfe0c1002bf3bdba72 100644 --- a/src/arome/ext/aro_adjust.F90 +++ b/src/arome/ext/aro_adjust.F90 @@ -1,8 +1,8 @@ ! ######spl - SUBROUTINE ARO_ADJUST(KLON,KIDIA,KFDIA,KLEV, KRR, & - HFRAC_ICE, HCONDENS, HLAMBDA3, OSUBG_COND, & - OSIGMAS, CMICRO, OCND2, LHGT_QS, HSUBG_MF_PDF, & - PTSTEP, PSIGQSAT, & + SUBROUTINE ARO_ADJUST(PHYEX, & + KLON,KIDIA,KFDIA,KLEV, KRR, & + CMICRO, & + PTSTEP, & PZZF, PRHODJ, PEXNREF, PRHODREF,& PPABSM, PTHT, PRT, PSIGS, & PMFCONV, PRC_MF, PRI_MF, PCF_MF, & @@ -85,11 +85,8 @@ !* 0. DECLARATIONS ! ------------ ! -USE MODD_CST, ONLY: CST -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM -USE MODD_NEB, ONLY: NEB -USE MODD_TURB_n, ONLY: TURBN -USE MODD_BUDGET, ONLY: TBUDGETDATA, NBUDGET_RI, TBUCONF +USE MODD_PHYEX, ONLY: PHYEX_t +USE MODD_BUDGET, ONLY: TBUDGETDATA, NBUDGET_RI USE SPP_MOD_TYPE, ONLY : TSPP_CONFIG_TYPE, CLEAR_SPP_TYPE, APPLY_SPP USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t ! @@ -108,24 +105,14 @@ IMPLICIT NONE ! ! +TYPE(PHYEX_t), INTENT(IN) :: PHYEX INTEGER, INTENT(IN) :: KLON ! array length (NPROMA) INTEGER, INTENT(IN) :: KIDIA !start index (=1) INTEGER, INTENT(IN) :: KFDIA !end index (=KLON only if block is full) INTEGER, INTENT(IN) :: KLEV !Number of vertical levels INTEGER, INTENT(IN) :: KRR ! Number of moist variables -CHARACTER*1, INTENT(IN) :: HFRAC_ICE -CHARACTER*80, INTENT(IN) :: HCONDENS -CHARACTER*4, INTENT(IN) :: HLAMBDA3 ! formulation for lambda3 coeff -LOGICAL, INTENT(IN) :: OSUBG_COND ! Switch for Subgrid Cond. -LOGICAL, INTENT(IN) :: OSIGMAS ! Switch for Sigma_s: - ! use values computed in CONDENSATION - ! or that from turbulence scheme CHARACTER (LEN=4), INTENT(IN) :: CMICRO ! Microphysics scheme -LOGICAL, INTENT(IN) :: OCND2 -LOGICAL, INTENT(IN) :: LHGT_QS -CHARACTER*80, INTENT(IN) :: HSUBG_MF_PDF REAL, INTENT(IN) :: PTSTEP ! Time step -REAL, INTENT(IN) :: PSIGQSAT ! coeff applied to qsat variance contribution ! ! REAL, DIMENSION(KLON,1,KLEV), INTENT(IN) :: PZZF ! Height (z) @@ -209,15 +196,15 @@ CALL FILL_DIMPHYEX(YLDIMPHYEX, KLON, 1, KLEV, 0, KFDIA) ! IF (YSPP_PSIGQSAT%LPERT) THEN - CALL APPLY_SPP(YSPP_PSIGQSAT,KLON,1,KLON,PSIGQSAT,ZSIGQSAT) + CALL APPLY_SPP(YSPP_PSIGQSAT,KLON,1,KLON,PHYEX%NEBN%VSIGQSAT,ZSIGQSAT) ELSE - ZSIGQSAT(:,:) = PSIGQSAT + ZSIGQSAT(:,:) = PHYEX%NEBN%VSIGQSAT ENDIF IF (YSPP_ICE_CLD_WGT%LPERT) THEN - CALL APPLY_SPP(YSPP_ICE_CLD_WGT,KLON,1,KLON,RAIN_ICE_PARAM%XFRMIN(21),ZICE_CLD_WGT) + CALL APPLY_SPP(YSPP_ICE_CLD_WGT,KLON,1,KLON,PHYEX%RAIN_ICE_PARAMN%XFRMIN(21),ZICE_CLD_WGT) ELSE - ZICE_CLD_WGT(:,:) = RAIN_ICE_PARAM%XFRMIN(21) + ZICE_CLD_WGT(:,:) = PHYEX%RAIN_ICE_PARAMN%XFRMIN(21) ENDIF HBUNAME='DEPI' @@ -240,8 +227,7 @@ HBUNAME='DEPI' !* 3.1 Non local correction for precipitating species (Rood 87) ! IF (CMICRO == 'KESS' .OR. CMICRO == 'ICE3' .OR. CMICRO == 'ICE2' & - .OR. CMICRO == 'C2R2' .OR. CMICRO == 'C3R5'.OR. CMICRO == 'ICE4' & - .OR. CMICRO == 'OLD3' .OR. CMICRO == 'OLD4') THEN + .OR. CMICRO == 'C2R2' .OR. CMICRO == 'C3R5'.OR. CMICRO == 'ICE4') THEN DO JRR = 3,KRR SELECT CASE (JRR) @@ -280,15 +266,15 @@ ZTWOTSTEP=2.*PTSTEP SELECT CASE ( CMICRO ) ! ! - CASE('ICE2','ICE3','ICE4', 'OLD3', 'OLD4') + CASE('ICE2','ICE3','ICE4') DO JLEV=1,KLEV DO JLON=KIDIA,KFDIA ZT = PTHT(JLON,1,JLEV)*PEXNREF(JLON,1,JLEV) - ZLV(JLON)=CST%XLVTT +(CST%XCPV-CST%XCL) *(ZT-CST%XTT) - ZLS(JLON)=CST%XLSTT +(CST%XCPV-CST%XCI) *(ZT-CST%XTT) - ZCPH(JLON)=CST%XCPD +CST%XCPV*2.*PTSTEP*PRS(JLON,1,JLEV,1) + ZLV(JLON)=PHYEX%CST%XLVTT +(PHYEX%CST%XCPV-PHYEX%CST%XCL) *(ZT-PHYEX%CST%XTT) + ZLS(JLON)=PHYEX%CST%XLSTT +(PHYEX%CST%XCPV-PHYEX%CST%XCI) *(ZT-PHYEX%CST%XTT) + ZCPH(JLON)=PHYEX%CST%XCPD +PHYEX%CST%XCPV*2.*PTSTEP*PRS(JLON,1,JLEV,1) ENDDO DO JLON=KIDIA,KFDIA @@ -392,18 +378,18 @@ ZZZ(KIDIA:KFDIA,:,:) = PZZF(KIDIA:KFDIA,:,:) !* 9.2 Perform the saturation adjustment over cloud ice and cloud water ! IF (KRR==6) THEN - CALL ICE_ADJUST ( YLDIMPHYEX, CST=CST, ICEP=RAIN_ICE_PARAM, NEB=NEB, TURBN=TURBN, BUCONF=TBUCONF, KRR=KRR,& - & HFRAC_ICE=HFRAC_ICE, HBUNAME=HBUNAME, & - & OCND2=OCND2, LHGT_QS=LHGT_QS, & + CALL ICE_ADJUST ( YLDIMPHYEX, CST=PHYEX%CST, ICEP=PHYEX%RAIN_ICE_PARAMN, NEBN=PHYEX%NEBN, TURBN=PHYEX%TURBN, & + & PARAMI=PHYEX%PARAM_ICEN, BUCONF=PHYEX%MISC%TBUCONF, KRR=KRR,& + & HBUNAME=HBUNAME, & & PTSTEP=ZTWOTSTEP,PSIGQSAT=ZSIGQSAT, & & PRHODJ=PRHODJ ,PEXNREF=PEXNREF, PRHODREF=PRHODREF, & - & PSIGS=PSIGS, LMFCONV=.TRUE., PMFCONV=PMFCONV, PPABST=PPABSM, PZZ=ZZZ, & + & PSIGS=PSIGS, LMFCONV=PHYEX%MISC%LMFCONV, PMFCONV=PMFCONV, PPABST=PPABSM, PZZ=ZZZ, & & PEXN=PEXNREF, PCF_MF=PCF_MF,PRC_MF=PRC_MF,PRI_MF=PRI_MF, & & PICLDFR=PICLDFR, PWCLDFR=PWCLDFR, & & PSSIO=PSSIO, PSSIU=PSSIU, PIFR=PIFR, & & PRV=ZRS(:,:,:,1), PRC=ZRS(:,:,:,2), & & PRVS=PRS(:,:,:,1), PRCS=PRS(:,:,:,2), & - & PTH=ZRS(:,:,:,0), PTHS=PTHS,OCOMPUTE_SRC=.TRUE.,PSRCS=PSRCS, PCLDFR=PCLDFR, & + & PTH=ZRS(:,:,:,0), PTHS=PTHS,OCOMPUTE_SRC=PHYEX%MISC%OCOMPUTE_SRC,PSRCS=PSRCS, PCLDFR=PCLDFR, & & PRR=ZRS(:,:,:,3), & & PRI=ZRS(:,:,:,4), PRIS=PRS(:,:,:,4), & & PRS=ZRS(:,:,:,5), & @@ -413,18 +399,18 @@ IF (KRR==6) THEN & PHLC_HRC=PHLC_HRC(:,:,:), PHLC_HCF=PHLC_HCF(:,:,:), & & PHLI_HRI=PHLI_HRI(:,:,:), PHLI_HCF=PHLI_HCF(:,:,:)) ELSE - CALL ICE_ADJUST ( YLDIMPHYEX, CST=CST, ICEP=RAIN_ICE_PARAM, NEB=NEB, TURBN=TURBN, BUCONF=TBUCONF, KRR=KRR,& - & HFRAC_ICE=HFRAC_ICE, HBUNAME=HBUNAME, & - & OCND2=OCND2, LHGT_QS=LHGT_QS, & + CALL ICE_ADJUST ( YLDIMPHYEX, CST=PHYEX%CST, ICEP=PHYEX%RAIN_ICE_PARAMN, NEBN=PHYEX%NEBN, TURBN=PHYEX%TURBN, & + & PARAMI=PHYEX%PARAM_ICEN, BUCONF=PHYEX%MISC%TBUCONF, KRR=KRR,& + & HBUNAME=HBUNAME, & & PTSTEP=ZTWOTSTEP,PSIGQSAT=ZSIGQSAT, & & PRHODJ=PRHODJ ,PEXNREF=PEXNREF, PRHODREF=PRHODREF, & - & PSIGS=PSIGS, LMFCONV=.TRUE., PMFCONV=PMFCONV, PPABST=PPABSM, PZZ=ZZZ, & + & PSIGS=PSIGS, LMFCONV=PHYEX%MISC%LMFCONV, PMFCONV=PMFCONV, PPABST=PPABSM, PZZ=ZZZ, & & PEXN=PEXNREF, PCF_MF=PCF_MF,PRC_MF=PRC_MF,PRI_MF=PRI_MF, & & PICLDFR=PICLDFR, PWCLDFR=PWCLDFR, & & PSSIO=PSSIO, PSSIU=PSSIU, PIFR=PIFR, & & PRV=ZRS(:,:,:,1), PRC=ZRS(:,:,:,2), & & PRVS=PRS(:,:,:,1), PRCS=PRS(:,:,:,2), & - & PTH=ZRS(:,:,:,0), PTHS=PTHS,OCOMPUTE_SRC=.TRUE.,PSRCS=PSRCS, PCLDFR=PCLDFR, & + & PTH=ZRS(:,:,:,0), PTHS=PTHS,OCOMPUTE_SRC=PHYEX%MISC%OCOMPUTE_SRC,PSRCS=PSRCS, PCLDFR=PCLDFR, & & PRR=ZRS(:,:,:,3), & & PRI=ZRS(:,:,:,4), PRIS=PRS(:,:,:,4), & & PRS=ZRS(:,:,:,5), & diff --git a/src/arome/ext/aro_adjust.h b/src/arome/ext/aro_adjust.h index 24e35dc5c45c739bc31dbc6051b26864823c86fb..4df200e39900d6686ea8d7007bf2c86d6b776230 100644 --- a/src/arome/ext/aro_adjust.h +++ b/src/arome/ext/aro_adjust.h @@ -1,8 +1,8 @@ INTERFACE - SUBROUTINE ARO_ADJUST(KLON,KIDIA,KFDIA,KLEV, KRR,& - & HFRAC_ICE, HCONDENS, HLAMBDA3, OSUBG_COND, & - & OSIGMAS, CMICRO, OCND2, LHGT_QS, HSUBG_MF_PDF,& - & PTSTEP, PSIGQSAT, PZZF, PRHODJ, PEXNREF, PRHODREF,& + SUBROUTINE ARO_ADJUST(PHYEX, & + & KLON,KIDIA,KFDIA,KLEV, KRR,& + & CMICRO, & + & PTSTEP, PZZF, PRHODJ, PEXNREF, PRHODREF,& & PPABSM, PTHT, PRT, PSIGS,& & PMFCONV, PRC_MF, PRI_MF, PCF_MF,& & PTHS, PRS, PSRCS, PCLDFR, & @@ -10,27 +10,22 @@ INTERFACE & PHLC_HRC, PHLC_HCF, PHLI_HRI, PHLI_HCF, & & YDDDH,YDLDDH,YDMDDH,& & YSPP_PSIGQSAT,YSPP_ICE_CLD_WGT) + USE PARKIND1 ,ONLY : JPIM ,JPRB USE SPP_MOD_TYPE, ONLY : TSPP_CONFIG_TYPE USE DDH_MIX, ONLY : TYP_DDH USE YOMLDDH, ONLY : TLDDH USE YOMMDDH, ONLY : TMDDH +USE MODD_PHYEX, ONLY: PHYEX_t + +TYPE(PHYEX_t), INTENT(IN) :: PHYEX INTEGER(KIND=JPIM), INTENT(IN) :: KLON INTEGER(KIND=JPIM), INTENT(IN) :: KIDIA INTEGER(KIND=JPIM), INTENT(IN) :: KFDIA INTEGER(KIND=JPIM), INTENT(IN) :: KLEV INTEGER(KIND=JPIM), INTENT(IN) :: KRR -CHARACTER*1, INTENT(IN) :: HFRAC_ICE -CHARACTER(LEN=80), INTENT(IN) :: HCONDENS -CHARACTER*4, INTENT(IN) :: HLAMBDA3 -LOGICAL, INTENT(IN) :: OSUBG_COND -LOGICAL, INTENT(IN) :: OSIGMAS CHARACTER(LEN=4), INTENT(IN) :: CMICRO -LOGICAL, INTENT(IN) :: OCND2 -LOGICAL, INTENT(IN) :: LHGT_QS -CHARACTER(LEN=80), INTENT(IN) :: HSUBG_MF_PDF REAL(KIND=JPRB), INTENT(IN) :: PTSTEP -REAL(KIND=JPRB), INTENT(IN) :: PSIGQSAT REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV), INTENT(IN) :: PZZF REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV), INTENT(IN) :: PRHODJ REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV), INTENT(IN) :: PEXNREF diff --git a/src/arome/ext/aro_adjust_lima.F90 b/src/arome/ext/aro_adjust_lima.F90 index 0e5c9cdc389a016340c2ef7c7f1f6766c2afd0a8..0b006cca64ed0b16ec7adb6cace0b30b89974dd0 100644 --- a/src/arome/ext/aro_adjust_lima.F90 +++ b/src/arome/ext/aro_adjust_lima.F90 @@ -1,6 +1,7 @@ ! ######spl - SUBROUTINE ARO_ADJUST_LIMA(KKA,KKU,KKL,KLON,KLEV,KFDIA, KRR, KSV, KTCOUNT, & - OSUBG_COND, OSIGMAS, OCND2, HCONDENS, HLAMBDA3, & + SUBROUTINE ARO_ADJUST_LIMA(PHYEX, & + KKA,KKU,KKL,KLON,KLEV,KFDIA, KRR, KSV, KTCOUNT, & + OSUBG_COND, OSIGMAS, & PTSTEP, PSIGQSAT, & PZZF, PRHODJ, PRHODREF, PEXNREF,& PPABSM, PTHT, PRT, PSVT, PSIGS, & @@ -79,9 +80,8 @@ ! ------------ ! USE MODD_CONF -USE MODD_CST +USE MODD_PHYEX, ONLY: PHYEX_t USE MODD_PARAMETERS -USE MODD_RAIN_ICE_DESCR USE MODD_BUDGET, ONLY: TBUDGETDATA, NBUDGET_SV1, TBUCONF ! USE MODD_PARAM_LIMA @@ -106,6 +106,7 @@ IMPLICIT NONE ! ! +TYPE(PHYEX_t), INTENT(IN) :: PHYEX 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 @@ -119,9 +120,6 @@ LOGICAL, INTENT(IN) :: OSUBG_COND ! Switch for Subgrid Cond. LOGICAL, INTENT(IN) :: OSIGMAS ! Switch for Sigma_s: ! use values computed in CONDENSATION ! or that from turbulence scheme -LOGICAL, INTENT(IN) :: OCND2 -CHARACTER*80, INTENT(IN) :: HCONDENS -CHARACTER*4, INTENT(IN) :: HLAMBDA3 ! formulation for lambda3 coeff REAL, INTENT(IN) :: PTSTEP ! Time step REAL, INTENT(IN) :: PSIGQSAT ! coeff applied to qsat variance contribution ! @@ -220,9 +218,9 @@ CALL FILL_DIMPHYEX(YLDIMPHYEX, KLON, 1, KLEV, 0, KFDIA) ! computing time ! ZT(:,:,:)= PTHT(:,:,:)*PEXNREF(:,:,:) -ZLV(:,:,:)=XLVTT +(XCPV-XCL) *(ZT(:,:,:)-XTT) -ZLS(:,:,:)=XLSTT +(XCPV-XCI) *(ZT(:,:,:)-XTT) -ZCPH(:,:,:)=XCPD +XCPV*2.*PTSTEP*PRS(:,:,:,1) +ZLV(:,:,:)=PHYEX%CST%XLVTT +(PHYEX%CST%XCPV-PHYEX%CST%XCL) *(ZT(:,:,:)-PHYEX%CST%XTT) +ZLS(:,:,:)=PHYEX%CST%XLSTT +(PHYEX%CST%XCPV-PHYEX%CST%XCI) *(ZT(:,:,:)-PHYEX%CST%XTT) +ZCPH(:,:,:)=PHYEX%CST%XCPD +PHYEX%CST%XCPV*2.*PTSTEP*PRS(:,:,:,1) !set concentration for LIMA PRS = PRS * 2.*PTSTEP @@ -352,8 +350,8 @@ ENDDO ! ZZZ = PZZF - CALL LIMA_ADJUST_SPLIT(D=YLDIMPHYEX, CST=CST, BUCONF=TBUCONF, TBUDGETS=YLBUDGET, KBUDGETS=SIZE(YLBUDGET), & - KRR=KRR, KMI=KMI, HCONDENS=HCONDENS, HLAMBDA3=HLAMBDA3, & + CALL LIMA_ADJUST_SPLIT(D=YLDIMPHYEX, CST=PHYEX%CST, BUCONF=TBUCONF, TBUDGETS=YLBUDGET, KBUDGETS=SIZE(YLBUDGET), & + KRR=KRR, KMI=KMI, HCONDENS=PHYEX%NEBN%CCONDENS, HLAMBDA3=PHYEX%NEBN%CLAMBDA3, & OSUBG_COND=OSUBG_COND, OSIGMAS=OSIGMAS, PTSTEP=2*PTSTEP, PSIGQSAT=PSIGQSAT, & PRHODREF=PRHODREF, PRHODJ=PRHODJ, PEXNREF=PEXNREF, PSIGS=PSIGS, PMFCONV=PMFCONV, & PPABST=PPABSM, PPABSTT=PPABSM, PZZ=ZZZ, PDTHRAD=PDTHRAD, PW_NU=PW_NU, & diff --git a/src/arome/ext/aro_adjust_lima.h b/src/arome/ext/aro_adjust_lima.h index 1686f98b2e16439bc664fa27bfe8a97ca12a5274..cf6d78e95ddafbef11404f55bc8efa753e053fff 100644 --- a/src/arome/ext/aro_adjust_lima.h +++ b/src/arome/ext/aro_adjust_lima.h @@ -1,6 +1,7 @@ INTERFACE -SUBROUTINE ARO_ADJUST_LIMA(KKA,KKU,KKL,KLON,KLEV,KFDIA, KRR, KSV, KTCOUNT,& - & OSUBG_COND, OSIGMAS,OCND2, HCONDENS, HLAMBDA3,& +SUBROUTINE ARO_ADJUST_LIMA(PHYEX, & + & KKA,KKU,KKL,KLON,KLEV,KFDIA, KRR, KSV, KTCOUNT,& + & OSUBG_COND, OSIGMAS,& & PTSTEP, PSIGQSAT,& & PZZF, PRHODJ, PRHODREF, PEXNREF,& & PPABSM, PTHT, PRT, PSVT, PSIGS,& @@ -12,6 +13,8 @@ USE PARKIND1 ,ONLY : JPIM ,JPRB USE DDH_MIX, ONLY : TYP_DDH USE YOMLDDH, ONLY : TLDDH USE YOMMDDH, ONLY : TMDDH +USE MODD_PHYEX, ONLY: PHYEX_t +TYPE(PHYEX_t), INTENT(IN) :: PHYEX INTEGER(KIND=JPIM), INTENT(IN) :: KKA INTEGER(KIND=JPIM), INTENT(IN) :: KKU INTEGER(KIND=JPIM), INTENT(IN) :: KKL @@ -23,9 +26,6 @@ INTEGER(KIND=JPIM), INTENT(IN) :: KSV INTEGER(KIND=JPIM), INTENT(IN) :: KTCOUNT LOGICAL, INTENT(IN) :: OSUBG_COND LOGICAL, INTENT(IN) :: OSIGMAS -LOGICAL, INTENT(IN) :: OCND2 -CHARACTER*80, INTENT(IN) :: HCONDENS -CHARACTER*4, INTENT(IN) :: HLAMBDA3 REAL(KIND=JPRB), INTENT(IN) :: PTSTEP REAL(KIND=JPRB), INTENT(IN) :: PSIGQSAT REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV), INTENT(IN) :: PZZF diff --git a/src/arome/ext/aro_lima.F90 b/src/arome/ext/aro_lima.F90 index 20f39a3b7578ec039b5e1126165b538fac3f6b2f..c07bc9466700a208df368b2d4aa76a9a0bc60308 100644 --- a/src/arome/ext/aro_lima.F90 +++ b/src/arome/ext/aro_lima.F90 @@ -1,5 +1,5 @@ ! ######spl - SUBROUTINE ARO_LIMA(KKA,KKU,KKL,KLON,KLEV,KFDIA,KRR, KSV, KTCOUNT, KSPLITR, KSPLITG, & + SUBROUTINE ARO_LIMA(PHYEX,KKA,KKU,KKL,KLON,KLEV,KFDIA,KRR, KSV, KSPLITR, KSPLITG, & PTSTEP, PDZZ, PRHODJ, PRHODREF, PEXNREF,& PPABSM, PW_NU, PDTHRAD, PTHT, PRT, PSVT, & PTHS, PRS, PSVS, PEVAP, & @@ -42,11 +42,9 @@ USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t ! USE MODD_CONF -USE MODD_CST +USE MODD_PHYEX, ONLY: PHYEX_t USE MODD_PARAMETERS -USE MODD_RAIN_ICE_DESCR ! -USE MODD_PARAM_ICE USE MODD_PARAM_LIMA USE MODD_NSV ! @@ -67,6 +65,7 @@ IMPLICIT NONE ! ! +TYPE(PHYEX_t), INTENT(IN) :: PHYEX 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 @@ -75,7 +74,6 @@ INTEGER, INTENT(IN) :: KLEV !Number of vertical levels INTEGER, INTENT(IN) :: KFDIA ! INTEGER, INTENT(IN) :: KRR ! Number of moist variables INTEGER, INTENT(IN) :: KSV ! Number of LIMA variables -INTEGER, INTENT(IN) :: KTCOUNT ! Temporal loop counter INTEGER, INTENT(IN) :: KSPLITR ! Number of small time step ! integrations for rain sedimendation INTEGER, INTENT(IN) :: KSPLITG ! Number of small time step @@ -184,9 +182,9 @@ PINPRH=0. ! computing time ! ZT(:,:,:)= PTHT(:,:,:)*PEXNREF(:,:,:) -ZLV(:,:,:)=XLVTT +(XCPV-XCL) *(ZT(:,:,:)-XTT) -ZLS(:,:,:)=XLSTT +(XCPV-XCI) *(ZT(:,:,:)-XTT) -ZCPH(:,:,:)=XCPD +XCPV*2.*PTSTEP*PRS(:,:,:,1) +ZLV(:,:,:)=PHYEX%CST%XLVTT +(PHYEX%CST%XCPV-PHYEX%CST%XCL) *(ZT(:,:,:)-PHYEX%CST%XTT) +ZLS(:,:,:)=PHYEX%CST%XLSTT +(PHYEX%CST%XCPV-PHYEX%CST%XCI) *(ZT(:,:,:)-PHYEX%CST%XTT) +ZCPH(:,:,:)=PHYEX%CST%XCPD +PHYEX%CST%XCPV*2.*PTSTEP*PRS(:,:,:,1) ! ! @@ -300,7 +298,7 @@ ENDDO ! ! ! -CALL LIMA (D=YLDIMPHYEX, CST=CST, BUCONF=TBUCONF, TBUDGETS=YLBUDGET, KBUDGETS=SIZE(YLBUDGET), & +CALL LIMA (D=YLDIMPHYEX, CST=PHYEX%CST, BUCONF=TBUCONF, TBUDGETS=YLBUDGET, KBUDGETS=SIZE(YLBUDGET), & PTSTEP=2*PTSTEP, & PRHODREF=PRHODREF, PEXNREF=PEXNREF, PDZZ=PDZZ, & PRHODJ=PRHODJ, PPABST=PPABSM, & diff --git a/src/arome/ext/aro_lima.h b/src/arome/ext/aro_lima.h index 82f32109aa6ee135e9dde8f7d75e4612e38179a6..e111e58f3e2cf9a7ebf8f39b42824cbda12d8cd8 100644 --- a/src/arome/ext/aro_lima.h +++ b/src/arome/ext/aro_lima.h @@ -1,5 +1,5 @@ INTERFACE -SUBROUTINE ARO_LIMA(KKA,KKU,KKL,KLON,KLEV, KFDIA, KRR, KSV, KTCOUNT, KSPLITR, KSPLITG, & +SUBROUTINE ARO_LIMA(PHYEX,KKA,KKU,KKL,KLON,KLEV, KFDIA, KRR, KSV, KSPLITR, KSPLITG, & & PTSTEP, PDZZ, PRHODJ, PRHODREF, PEXNREF,& & PPABSM, PW_NU, PDTHRAD, PTHT, PRT, PSVT, & & PTHS, PRS, PSVS, PEVAP,& @@ -11,6 +11,8 @@ USE PARKIND1 ,ONLY : JPIM ,JPRB USE DDH_MIX, ONLY : TYP_DDH USE YOMLDDH, ONLY : TLDDH USE YOMMDDH, ONLY : TMDDH +USE MODD_PHYEX, ONLY: PHYEX_t +TYPE(PHYEX_t), INTENT(IN) :: PHYEX INTEGER(KIND=JPIM), INTENT(IN) :: KKA INTEGER(KIND=JPIM), INTENT(IN) :: KKU INTEGER(KIND=JPIM), INTENT(IN) :: KKL @@ -19,7 +21,6 @@ INTEGER(KIND=JPIM), INTENT(IN) :: KLEV INTEGER(KIND=JPIM), INTENT(IN) :: KFDIA INTEGER(KIND=JPIM), INTENT(IN) :: KRR INTEGER(KIND=JPIM), INTENT(IN) :: KSV -INTEGER(KIND=JPIM), INTENT(IN) :: KTCOUNT INTEGER(KIND=JPIM), INTENT(IN) :: KSPLITR INTEGER(KIND=JPIM), INTENT(IN) :: KSPLITG REAL(KIND=JPRB), INTENT(IN) :: PTSTEP diff --git a/src/arome/ext/aro_rain_ice.F90 b/src/arome/ext/aro_rain_ice.F90 index a22cb6da8e117aef7b43c3111fea0fa505e53fbd..dd83db6e9d6f21e94eb3b4c73aae56380dab6381 100644 --- a/src/arome/ext/aro_rain_ice.F90 +++ b/src/arome/ext/aro_rain_ice.F90 @@ -1,12 +1,13 @@ ! ######spl - SUBROUTINE ARO_RAIN_ICE(KPROMA,KKA,KKU,KKL,KLON,KLEV, KFDIA, KRR, KTCOUNT, KSPLITR,& - OSUBG_COND, CSUBG_AUCV_RC, CSUBG_AUCV_RI,OSEDIC, CSEDIM, CMICRO, & + SUBROUTINE ARO_RAIN_ICE(PHYEX, & + KKA,KKU,KKL,KLON,KLEV, KFDIA, KRR, & + CMICRO, & PTSTEP, PDZZ, PRHODJ, PRHODREF, PEXNREF,& PPABSM, PHLC_HRC, PHLC_HCF, PHLI_HRI, PHLI_HCF, PTHT, PRT, PSIGS,PCLDFR, & PTHS, PRS, PEVAP, & - PCIT, OWARM, PSEA, PTOWN, & + PCIT, PSEA, PTOWN, & PICLDFR, PWCLDFR, PSSIO, PSSIU, PIFR, & - OCND2, LKOGAN, LMODICEDEP,& + LKOGAN, LMODICEDEP,& PINPRR,PINPRS,PINPRG,PINPRH,PFPR, & YDDDH, YDLDDH, YDMDDH, & YSPP_ICENU,YSPP_KGN_ACON,YSPP_KGN_SBGR) @@ -86,15 +87,12 @@ !* 0. DECLARATIONS ! ------------ ! -USE MODD_CONF -USE MODD_CST, ONLY: CST -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM -USE MODD_PARAM_ICE, ONLY: PARAM_ICE +USE MODD_PHYEX, ONLY: PHYEX_t USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t ! -USE MODD_BUDGET, ONLY: TBUDGETDATA, NBUDGET_RH, TBUCONF +USE MODD_BUDGET, ONLY: TBUDGETDATA, NBUDGET_RH USE MODE_BUDGET_PHY, ONLY: BUDGET_DDH +USE MODD_LES, ONLY: TLES, LES_ASSOCIATE !only used by rain_ice_old USE MODE_FILL_DIMPHYEX, ONLY: FILL_DIMPHYEX ! USE MODI_RAIN_ICE @@ -114,7 +112,7 @@ IMPLICIT NONE ! ! -INTEGER, INTENT(IN) :: KPROMA !internal cache-blocking factor for microphysic loop in rain_ice +TYPE(PHYEX_t), INTENT(IN) :: PHYEX 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 @@ -122,17 +120,6 @@ INTEGER, INTENT(IN) :: KLON !NPROMA under CPG INTEGER, INTENT(IN) :: KLEV !Number of vertical levels INTEGER, INTENT(IN) :: KFDIA INTEGER, INTENT(IN) :: KRR ! Number of moist variables -INTEGER, INTENT(IN) :: KTCOUNT ! Temporal loop counter -INTEGER, INTENT(IN) :: KSPLITR ! Number of small time step - ! integrations for rain sedimendation -LOGICAL, INTENT(IN) :: OSUBG_COND ! Switch for Subgrid Cond. -CHARACTER (LEN=4), INTENT(IN) :: CSUBG_AUCV_RC - ! type of subgrid rc->rr autoconvertion scheme -CHARACTER (LEN=80), INTENT(IN) :: CSUBG_AUCV_RI - ! type of subgrid ri->rs autoconvertion scheme -LOGICAL, INTENT(IN) :: OSEDIC ! Switch for cloud sedim. -CHARACTER (LEN=4), INTENT(IN) :: CSEDIM ! Sedimentation scheme - ! (STAT or EULE) CHARACTER (LEN=4), INTENT(IN) :: CMICRO ! Microphysics scheme REAL, INTENT(IN) :: PTSTEP ! Time step ! @@ -172,10 +159,6 @@ REAL, DIMENSION(KLON,1,KLEV), INTENT(INOUT) :: PEVAP ! Rain evap profile REAL, DIMENSION(KLON,1,KLEV), INTENT(INOUT) :: PCIT ! Pristine ice number ! concentration at time t -LOGICAL, INTENT(IN) :: OWARM ! Control of the rain formation - ! by slow warm microphysical - ! processes -LOGICAL, INTENT(IN) :: OCND2 ! Logical switch to separate liquid and ice LOGICAL, INTENT(IN) :: LKOGAN! Logical switch for using Kogan autoconversion of liquid LOGICAL, INTENT(IN) :: LMODICEDEP ! Logical switch for alternative dep/evap of ice REAL, DIMENSION(KLON,1), INTENT(IN) :: PSEA ! Land sea mask @@ -210,6 +193,7 @@ REAL :: ZMASSTOT ! total mass for one water category REAL :: ZMASSPOS ! total mass for one water category ! after removing the negative values REAL :: ZRATIO ! ZMASSTOT / ZMASSCOR +REAL :: ZTWOTSTEP TYPE(TBUDGETDATA), DIMENSION(NBUDGET_RH) :: YLBUDGET !NBUDGET_RH is the one with the highest number TYPE(DIMPHYEX_t) :: YLDIMPHYEX @@ -229,13 +213,19 @@ IF (LHOOK) CALL DR_HOOK('ARO_RAIN_ICE',0,ZHOOK_HANDLE) !Dimensions CALL FILL_DIMPHYEX(YLDIMPHYEX, KLON, 1, KLEV, 0, KFDIA) +!LES init (only for rain_ice_old) +CALL LES_ASSOCIATE() +TLES%LLES=.FALSE. +TLES%LLES_CALL=.FALSE. + +ZTWOTSTEP=2*PTSTEP ZINPRC=0. PINPRH=0. !Mask to limit computation IF ( KRR == 7 ) THEN - IF (CMICRO /= 'ICE4' .AND. CMICRO /= 'OLD4') THEN - CALL ABOR1('ARO_RAIN_ICE : KRR==7 NOT COMPATIBLE WITH CMICRO /= ICE4 OR OLD4') + IF (CMICRO /= 'ICE4') THEN + CALL ABOR1('ARO_RAIN_ICE : KRR==7 NOT COMPATIBLE WITH CMICRO /= ICE4') ENDIF END IF @@ -253,9 +243,9 @@ END IF ! computing time ! ZT(:,:,:)= PTHT(:,:,:)*PEXNREF(:,:,:) -ZLV(:,:,:)=CST%XLVTT +(CST%XCPV-CST%XCL) *(ZT(:,:,:)-CST%XTT) -ZLS(:,:,:)=CST%XLSTT +(CST%XCPV-CST%XCI) *(ZT(:,:,:)-CST%XTT) -ZCPH(:,:,:)=CST%XCPD +CST%XCPV*2.*PTSTEP*PRS(:,:,:,1) +ZLV(:,:,:)=PHYEX%CST%XLVTT +(PHYEX%CST%XCPV-PHYEX%CST%XCL) *(ZT(:,:,:)-PHYEX%CST%XTT) +ZLS(:,:,:)=PHYEX%CST%XLSTT +(PHYEX%CST%XCPV-PHYEX%CST%XCI) *(ZT(:,:,:)-PHYEX%CST%XTT) +ZCPH(:,:,:)=PHYEX%CST%XCPD +PHYEX%CST%XCPV*2.*PTSTEP*PRS(:,:,:,1) ! ! !* 3. REMOVE NEGATIVE VALUES @@ -264,8 +254,7 @@ ZCPH(:,:,:)=CST%XCPD +CST%XCPV*2.*PTSTEP*PRS(:,:,:,1) !* 3.1 Non local correction for precipitating species (Rood 87) ! IF (CMICRO == 'KESS' .OR. CMICRO == 'ICE3' .OR. CMICRO == 'ICE2' & - .OR. CMICRO == 'C2R2' .OR. CMICRO == 'C3R5'.OR. CMICRO == 'ICE4' .OR. & - CMICRO == 'OLD3' .OR. CMICRO == 'OLD4') THEN + .OR. CMICRO == 'C2R2' .OR. CMICRO == 'C3R5'.OR. CMICRO == 'ICE4') THEN DO JRR = 3,KRR SELECT CASE (JRR) @@ -301,7 +290,7 @@ END IF SELECT CASE ( CMICRO ) ! ! - CASE('ICE2','ICE3','ICE4', 'OLD3', 'OLD4') + CASE('ICE2','ICE3','ICE4') WHERE (PRS(:,:,:,4) < 0.) PRS(:,:,:,1) = PRS(:,:,:,1) + PRS(:,:,:,4) PTHS(:,:,:) = PTHS(:,:,:) - PRS(:,:,:,4) * ZLS(:,:,:) / & @@ -341,14 +330,14 @@ END SELECT ! !* 3.3 STORE THE BUDGET TERMS ! ---------------------- -IF (TBUCONF%LBUDGET_RV) CALL BUDGET_DDH (PRS(:,:,:,1) * PRHODJ(:,:,:), 6,'NEGA_BU_RRV',YDDDH, YDLDDH, YDMDDH) -IF (TBUCONF%LBUDGET_RC) CALL BUDGET_DDH (PRS(:,:,:,2) * PRHODJ(:,:,:), 7,'NEGA_BU_RRC',YDDDH, YDLDDH, YDMDDH) -IF (TBUCONF%LBUDGET_RR) CALL BUDGET_DDH (PRS(:,:,:,3) * PRHODJ(:,:,:), 8,'NEGA_BU_RRR',YDDDH, YDLDDH, YDMDDH) -IF (TBUCONF%LBUDGET_RI) CALL BUDGET_DDH (PRS(:,:,:,4) * PRHODJ(:,:,:) ,9,'NEGA_BU_RRI',YDDDH, YDLDDH, YDMDDH) -IF (TBUCONF%LBUDGET_RS) CALL BUDGET_DDH (PRS(:,:,:,5) * PRHODJ(:,:,:),10,'NEGA_BU_RRS',YDDDH, YDLDDH, YDMDDH) -IF (TBUCONF%LBUDGET_RG) CALL BUDGET_DDH (PRS(:,:,:,6) * PRHODJ(:,:,:),11,'NEGA_BU_RRG',YDDDH, YDLDDH, YDMDDH) -IF (TBUCONF%LBUDGET_RH .AND. KRR==7) CALL BUDGET_DDH (PRS(:,:,:,7) * PRHODJ(:,:,:),12,'NEGA_BU_RRH',YDDDH, YDLDDH, YDMDDH) -IF (TBUCONF%LBUDGET_TH) CALL BUDGET_DDH (PTHS(:,:,:) * PRHODJ(:,:,:), 4,'NEGA_BU_RTH',YDDDH, YDLDDH, YDMDDH) +IF (PHYEX%MISC%TBUCONF%LBUDGET_RV) CALL BUDGET_DDH (PRS(:,:,:,1) * PRHODJ(:,:,:), 6,'NEGA_BU_RRV',YDDDH, YDLDDH, YDMDDH) +IF (PHYEX%MISC%TBUCONF%LBUDGET_RC) CALL BUDGET_DDH (PRS(:,:,:,2) * PRHODJ(:,:,:), 7,'NEGA_BU_RRC',YDDDH, YDLDDH, YDMDDH) +IF (PHYEX%MISC%TBUCONF%LBUDGET_RR) CALL BUDGET_DDH (PRS(:,:,:,3) * PRHODJ(:,:,:), 8,'NEGA_BU_RRR',YDDDH, YDLDDH, YDMDDH) +IF (PHYEX%MISC%TBUCONF%LBUDGET_RI) CALL BUDGET_DDH (PRS(:,:,:,4) * PRHODJ(:,:,:) ,9,'NEGA_BU_RRI',YDDDH, YDLDDH, YDMDDH) +IF (PHYEX%MISC%TBUCONF%LBUDGET_RS) CALL BUDGET_DDH (PRS(:,:,:,5) * PRHODJ(:,:,:),10,'NEGA_BU_RRS',YDDDH, YDLDDH, YDMDDH) +IF (PHYEX%MISC%TBUCONF%LBUDGET_RG) CALL BUDGET_DDH (PRS(:,:,:,6) * PRHODJ(:,:,:),11,'NEGA_BU_RRG',YDDDH, YDLDDH, YDMDDH) +IF (PHYEX%MISC%TBUCONF%LBUDGET_RH .AND. KRR==7) CALL BUDGET_DDH (PRS(:,:,:,7) * PRHODJ(:,:,:),12,'NEGA_BU_RRH',YDDDH, YDLDDH, YDMDDH) +IF (PHYEX%MISC%TBUCONF%LBUDGET_TH) CALL BUDGET_DDH (PTHS(:,:,:) * PRHODJ(:,:,:), 4,'NEGA_BU_RTH',YDDDH, YDLDDH, YDMDDH) DO JRR=1, NBUDGET_RH YLBUDGET(JRR)%NBUDGET=JRR @@ -368,13 +357,10 @@ ENDDO ! ! ! -IF (CMICRO=='ICE4') THEN - CALL RAIN_ICE( YLDIMPHYEX, CST, PARAM_ICE, RAIN_ICE_PARAM, & - & RAIN_ICE_DESCR, TBUCONF, & - & KPROMA, & - & OCND2=OCND2, & - & HSUBG_AUCV_RC=CSUBG_AUCV_RC, HSUBG_AUCV_RI=CSUBG_AUCV_RI,& - & PTSTEP=2*PTSTEP, & +IF (CMICRO=='ICE4' .AND. PHYEX%PARAM_ICEN%LRED) THEN + CALL RAIN_ICE( YLDIMPHYEX, PHYEX%CST, PHYEX%PARAM_ICEN, PHYEX%RAIN_ICE_PARAMN, & + & PHYEX%RAIN_ICE_DESCRN, PHYEX%MISC%TBUCONF, & + & PTSTEP=ZTWOTSTEP, & & KRR=KRR, PEXN=PEXNREF, & & PDZZ=PDZZ, PRHODJ=PRHODJ, PRHODREF=PRHODREF, PEXNREF=PEXNREF,& & PPABST=PPABSM, PCIT=PCIT, PCLDFR=PCLDFR, & @@ -393,13 +379,10 @@ IF (CMICRO=='ICE4') THEN & TBUDGETS=YLBUDGET, KBUDGETS=SIZE(YLBUDGET), & & PSEA=PSEA, PTOWN=PTOWN, & & PRHT=PRT(:,:,:,7), PRHS=PRS(:,:,:,7), PINPRH=PINPRH, PFPR=PFPR) -ELSEIF (CMICRO=='ICE3') THEN - CALL RAIN_ICE( YLDIMPHYEX, CST, PARAM_ICE, RAIN_ICE_PARAM, & - & RAIN_ICE_DESCR, TBUCONF, & - & KPROMA, & - & OCND2=OCND2, & - & HSUBG_AUCV_RC=CSUBG_AUCV_RC, HSUBG_AUCV_RI=CSUBG_AUCV_RI,& - & PTSTEP=2*PTSTEP, & +ELSEIF (CMICRO=='ICE3' .AND. PHYEX%PARAM_ICEN%LRED) THEN + CALL RAIN_ICE( YLDIMPHYEX, PHYEX%CST, PHYEX%PARAM_ICEN, PHYEX%RAIN_ICE_PARAMN, & + & PHYEX%RAIN_ICE_DESCRN, PHYEX%MISC%TBUCONF, & + & PTSTEP=ZTWOTSTEP, & & KRR=KRR, PEXN=PEXNREF, & & PDZZ=PDZZ, PRHODJ=PRHODJ, PRHODREF=PRHODREF,PEXNREF=PEXNREF,& & PPABST=PPABSM, PCIT=PCIT, PCLDFR=PCLDFR, & @@ -417,37 +400,37 @@ ELSEIF (CMICRO=='ICE3') THEN & PSIGS=PSIGS, & & TBUDGETS=YLBUDGET, KBUDGETS=SIZE(YLBUDGET), & & PSEA=PSEA, PTOWN=PTOWN, PFPR=PFPR) -ELSEIF (CMICRO=='OLD4') THEN +ELSEIF (CMICRO=='ICE4' .AND. .NOT. PHYEX%PARAM_ICEN%LRED) THEN IF (YSPP_ICENU%LPERT) THEN - CALL APPLY_SPP(YSPP_ICENU,KLON,1,KLON,RAIN_ICE_PARAM%XFRMIN(9),ZICENU) + CALL APPLY_SPP(YSPP_ICENU,KLON,1,KLON,PHYEX%RAIN_ICE_PARAMN%XFRMIN(9),ZICENU) ELSE - ZICENU(:,:) = RAIN_ICE_PARAM%XFRMIN(9) + ZICENU(:,:) = PHYEX%RAIN_ICE_PARAMN%XFRMIN(9) ENDIF IF (YSPP_KGN_ACON%LPERT) THEN - CALL APPLY_SPP(YSPP_KGN_ACON,KLON,1,KLON,RAIN_ICE_PARAM%XFRMIN(10),ZKGN_ACON) + CALL APPLY_SPP(YSPP_KGN_ACON,KLON,1,KLON,PHYEX%RAIN_ICE_PARAMN%XFRMIN(10),ZKGN_ACON) ELSE - ZKGN_ACON(:,:) = RAIN_ICE_PARAM%XFRMIN(10) + ZKGN_ACON(:,:) = PHYEX%RAIN_ICE_PARAMN%XFRMIN(10) ENDIF IF (YSPP_KGN_SBGR%LPERT) THEN - CALL APPLY_SPP(YSPP_KGN_SBGR,KLON,1,KLON,RAIN_ICE_PARAM%XFRMIN(11),ZKGN_SBGR) + CALL APPLY_SPP(YSPP_KGN_SBGR,KLON,1,KLON,PHYEX%RAIN_ICE_PARAMN%XFRMIN(11),ZKGN_SBGR) ELSE - ZKGN_SBGR(:,:) = RAIN_ICE_PARAM%XFRMIN(11) + ZKGN_SBGR(:,:) = PHYEX%RAIN_ICE_PARAMN%XFRMIN(11) ENDIF - LLMICRO(:,:,:)=PRT(:,:,:,2)>RAIN_ICE_DESCR%XRTMIN(2) .OR. & - PRT(:,:,:,3)>RAIN_ICE_DESCR%XRTMIN(3) .OR. & - PRT(:,:,:,4)>RAIN_ICE_DESCR%XRTMIN(4) .OR. & - PRT(:,:,:,5)>RAIN_ICE_DESCR%XRTMIN(5) .OR. & - PRT(:,:,:,6)>RAIN_ICE_DESCR%XRTMIN(6) .OR. & - PRT(:,:,:,7)>RAIN_ICE_DESCR%XRTMIN(7) + LLMICRO(:,:,:)=PRT(:,:,:,2)>PHYEX%RAIN_ICE_DESCRN%XRTMIN(2) .OR. & + PRT(:,:,:,3)>PHYEX%RAIN_ICE_DESCRN%XRTMIN(3) .OR. & + PRT(:,:,:,4)>PHYEX%RAIN_ICE_DESCRN%XRTMIN(4) .OR. & + PRT(:,:,:,5)>PHYEX%RAIN_ICE_DESCRN%XRTMIN(5) .OR. & + PRT(:,:,:,6)>PHYEX%RAIN_ICE_DESCRN%XRTMIN(6) .OR. & + PRT(:,:,:,7)>PHYEX%RAIN_ICE_DESCRN%XRTMIN(7) ISIZE=COUNT(LLMICRO) - CALL RAIN_ICE_OLD(YLDIMPHYEX, CST, PARAM_ICE, RAIN_ICE_PARAM, & - & RAIN_ICE_DESCR, TBUCONF, & - & OSEDIC=OSEDIC, OCND2=OCND2, LKOGAN=LKOGAN, LMODICEDEP=LMODICEDEP, & - & HSEDIM=CSEDIM, HSUBG_AUCV_RC=CSUBG_AUCV_RC, & - & OWARM=OWARM,KKA=KKA,KKU=KKU,KKL=KKL,KSPLITR=KSPLITR, & - & PTSTEP=2*PTSTEP, KRR=KRR, KSIZE=ISIZE, GMICRO=LLMICRO, & + CALL RAIN_ICE_OLD(YLDIMPHYEX, PHYEX%CST, PHYEX%PARAM_ICEN, PHYEX%RAIN_ICE_PARAMN, & + & PHYEX%RAIN_ICE_DESCRN, PHYEX%MISC%TBUCONF, & + & OSEDIC=PHYEX%PARAM_ICEN%LSEDIC, OCND2=PHYEX%PARAM_ICEN%LOCND2, LKOGAN=LKOGAN, LMODICEDEP=LMODICEDEP, & + & HSEDIM=PHYEX%PARAM_ICEN%CSEDIM, HSUBG_AUCV_RC=PHYEX%PARAM_ICEN%CSUBG_AUCV_RC, & + & OWARM=PHYEX%PARAM_ICEN%LWARM,KKA=KKA,KKU=KKU,KKL=KKL,KSPLITR=PHYEX%CLOUDPARN%NSPLITR, & + & PTSTEP=ZTWOTSTEP, KRR=KRR, KSIZE=ISIZE, GMICRO=LLMICRO, & & PDZZ=PDZZ, PRHODJ=PRHODJ, PRHODREF=PRHODREF, PEXNREF=PEXNREF,& & PPABST=PPABSM, PCIT=PCIT, PCLDFR=PCLDFR, & & PICLDFR=PICLDFR, & !PWCLDFR=PWCLDFR, & @@ -470,34 +453,34 @@ ELSEIF (CMICRO=='OLD4') THEN & PKGN_SBGR=ZKGN_SBGR) ELSE IF (YSPP_ICENU%LPERT) THEN - CALL APPLY_SPP(YSPP_ICENU,KLON,1,KLON,RAIN_ICE_PARAM%XFRMIN(9),ZICENU) + CALL APPLY_SPP(YSPP_ICENU,KLON,1,KLON,PHYEX%RAIN_ICE_PARAMN%XFRMIN(9),ZICENU) ELSE - ZICENU(:,:) = RAIN_ICE_PARAM%XFRMIN(9) + ZICENU(:,:) = PHYEX%RAIN_ICE_PARAMN%XFRMIN(9) ENDIF IF (YSPP_KGN_ACON%LPERT) THEN - CALL APPLY_SPP(YSPP_KGN_ACON,KLON,1,KLON,RAIN_ICE_PARAM%XFRMIN(10),ZKGN_ACON) + CALL APPLY_SPP(YSPP_KGN_ACON,KLON,1,KLON,PHYEX%RAIN_ICE_PARAMN%XFRMIN(10),ZKGN_ACON) ELSE - ZKGN_ACON(:,:) = RAIN_ICE_PARAM%XFRMIN(10) + ZKGN_ACON(:,:) = PHYEX%RAIN_ICE_PARAMN%XFRMIN(10) ENDIF IF (YSPP_KGN_SBGR%LPERT) THEN - CALL APPLY_SPP(YSPP_KGN_SBGR,KLON,1,KLON,RAIN_ICE_PARAM%XFRMIN(11),ZKGN_SBGR) + CALL APPLY_SPP(YSPP_KGN_SBGR,KLON,1,KLON,PHYEX%RAIN_ICE_PARAMN%XFRMIN(11),ZKGN_SBGR) ELSE - ZKGN_SBGR(:,:) = RAIN_ICE_PARAM%XFRMIN(11) + ZKGN_SBGR(:,:) = PHYEX%RAIN_ICE_PARAMN%XFRMIN(11) ENDIF - LLMICRO(:,:,:)=PRT(:,:,:,2)>RAIN_ICE_DESCR%XRTMIN(2) .OR. & - PRT(:,:,:,3)>RAIN_ICE_DESCR%XRTMIN(3) .OR. & - PRT(:,:,:,4)>RAIN_ICE_DESCR%XRTMIN(4) .OR. & - PRT(:,:,:,5)>RAIN_ICE_DESCR%XRTMIN(5) .OR. & - PRT(:,:,:,6)>RAIN_ICE_DESCR%XRTMIN(6) + LLMICRO(:,:,:)=PRT(:,:,:,2)>PHYEX%RAIN_ICE_DESCRN%XRTMIN(2) .OR. & + PRT(:,:,:,3)>PHYEX%RAIN_ICE_DESCRN%XRTMIN(3) .OR. & + PRT(:,:,:,4)>PHYEX%RAIN_ICE_DESCRN%XRTMIN(4) .OR. & + PRT(:,:,:,5)>PHYEX%RAIN_ICE_DESCRN%XRTMIN(5) .OR. & + PRT(:,:,:,6)>PHYEX%RAIN_ICE_DESCRN%XRTMIN(6) ISIZE=COUNT(LLMICRO) - CALL RAIN_ICE_OLD(YLDIMPHYEX, CST, PARAM_ICE, RAIN_ICE_PARAM, & - & RAIN_ICE_DESCR, TBUCONF, & - & OSEDIC=OSEDIC, OCND2=OCND2, LKOGAN=LKOGAN, LMODICEDEP=LMODICEDEP, & - & HSEDIM=CSEDIM, HSUBG_AUCV_RC=CSUBG_AUCV_RC, & - & OWARM=OWARM,KKA=KKA,KKU=KKU,KKL=KKL,KSPLITR=KSPLITR, & - & PTSTEP=2*PTSTEP, KRR=KRR, KSIZE=ISIZE, GMICRO=LLMICRO, & + CALL RAIN_ICE_OLD(YLDIMPHYEX, PHYEX%CST, PHYEX%PARAM_ICEN, PHYEX%RAIN_ICE_PARAMN, & + & PHYEX%RAIN_ICE_DESCRN, PHYEX%MISC%TBUCONF, & + & OSEDIC=PHYEX%PARAM_ICEN%LSEDIC, OCND2=PHYEX%PARAM_ICEN%LOCND2, LKOGAN=LKOGAN, LMODICEDEP=LMODICEDEP, & + & HSEDIM=PHYEX%PARAM_ICEN%CSEDIM, HSUBG_AUCV_RC=PHYEX%PARAM_ICEN%CSUBG_AUCV_RC, & + & OWARM=PHYEX%PARAM_ICEN%LWARM,KKA=KKA,KKU=KKU,KKL=KKL,KSPLITR=PHYEX%CLOUDPARN%NSPLITR, & + & PTSTEP=ZTWOTSTEP, KRR=KRR, KSIZE=ISIZE, GMICRO=LLMICRO, & & PDZZ=PDZZ, PRHODJ=PRHODJ, PRHODREF=PRHODREF, PEXNREF=PEXNREF,& & PPABST=PPABSM, PCIT=PCIT, PCLDFR=PCLDFR, & & PICLDFR=PICLDFR, & !PWCLDFR=PWCLDFR, & diff --git a/src/arome/ext/aro_rain_ice.h b/src/arome/ext/aro_rain_ice.h index 8f60c9152470d408cbf8ccb8ebccde3f6fbcbcfe..02417d226eeaadce9348e7022b10315f62d395d0 100644 --- a/src/arome/ext/aro_rain_ice.h +++ b/src/arome/ext/aro_rain_ice.h @@ -1,12 +1,13 @@ INTERFACE - SUBROUTINE ARO_RAIN_ICE(KPROMA,KKA,KKU,KKL,KLON,KLEV, KFDIA,KRR, KTCOUNT, KSPLITR,& - & OSUBG_COND, CSUBG_AUCV_RC, CSUBG_AUCV_RI, OSEDIC,CSEDIM,CMICRO,& + SUBROUTINE ARO_RAIN_ICE(PHYEX, & + & KKA,KKU,KKL,KLON,KLEV, KFDIA,KRR, & + & CMICRO,& & PTSTEP, PDZZ, PRHODJ, PRHODREF, PEXNREF,& & PPABSM, PHLC_HRC, PHLC_HCF, PHLI_HRI, PHLI_HCF, PTHT, PRT, PSIGS,PCLDFR,& & PTHS, PRS, PEVAP,& - & PCIT, OWARM, PSEA, PTOWN, & + & PCIT, PSEA, PTOWN, & & PICLDFR, PWCLDFR, PSSIO, PSSIU, PIFR, & - & OCND2, LKOGAN, LMODICEDEP,& + & LKOGAN, LMODICEDEP,& & PINPRR,PINPRS,& & PINPRG,PINPRH,PFPR,& & YDDDH,YDLDDH,YDMDDH,& @@ -16,7 +17,8 @@ USE DDH_MIX, ONLY : TYP_DDH USE SPP_MOD_TYPE, ONLY : TSPP_CONFIG_TYPE USE YOMLDDH, ONLY : TLDDH USE YOMMDDH, ONLY : TMDDH -INTEGER, INTENT(IN) :: KPROMA +USE MODD_PHYEX, ONLY: PHYEX_t +TYPE(PHYEX_t), INTENT(IN) :: PHYEX INTEGER(KIND=JPIM), INTENT(IN) :: KKA INTEGER(KIND=JPIM), INTENT(IN) :: KKU INTEGER(KIND=JPIM), INTENT(IN) :: KKL @@ -24,13 +26,6 @@ INTEGER(KIND=JPIM), INTENT(IN) :: KLON INTEGER(KIND=JPIM), INTENT(IN) :: KLEV INTEGER(KIND=JPIM), INTENT(IN) :: KFDIA INTEGER(KIND=JPIM), INTENT(IN) :: KRR -INTEGER(KIND=JPIM), INTENT(IN) :: KTCOUNT -INTEGER(KIND=JPIM), INTENT(IN) :: KSPLITR -LOGICAL, INTENT(IN) :: OSUBG_COND -CHARACTER(LEN=4), INTENT(IN) :: CSUBG_AUCV_RC -CHARACTER(LEN=80), INTENT(IN) :: CSUBG_AUCV_RI -LOGICAL, INTENT(IN) :: OSEDIC -CHARACTER(LEN=4), INTENT(IN) :: CSEDIM CHARACTER(LEN=4), INTENT(IN) :: CMICRO REAL(KIND=JPRB), INTENT(IN) :: PTSTEP REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV), INTENT(IN) :: PDZZ @@ -50,7 +45,6 @@ REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV), INTENT(INOUT) :: PTHS REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV,KRR), INTENT(INOUT) :: PRS REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV), INTENT(INOUT) :: PEVAP REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV), INTENT(INOUT) :: PCIT -LOGICAL, INTENT(IN) :: OWARM REAL(KIND=JPRB), DIMENSION(KLON,1), INTENT(IN) :: PSEA REAL(KIND=JPRB), DIMENSION(KLON,1), INTENT(IN) :: PTOWN REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV), INTENT(IN) :: PICLDFR @@ -58,7 +52,6 @@ REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV), INTENT(IN) :: PWCLDFR REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV), INTENT(IN) :: PSSIO REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV), INTENT(IN) :: PSSIU REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV), INTENT(IN) :: PIFR -LOGICAL, INTENT(IN) :: OCND2 LOGICAL, INTENT(IN) :: LKOGAN LOGICAL, INTENT(IN) :: LMODICEDEP REAL(KIND=JPRB), DIMENSION(KLON,1), INTENT(INOUT) :: PINPRR diff --git a/src/arome/ext/aro_shallow_mf.F90 b/src/arome/ext/aro_shallow_mf.F90 index 76830cf650ccc252a2de46dbd4d868e21d67a318..1b30c02c183dc98d35e2925b6b19941487a9cde5 100644 --- a/src/arome/ext/aro_shallow_mf.F90 +++ b/src/arome/ext/aro_shallow_mf.F90 @@ -1,8 +1,8 @@ ! ######spl - SUBROUTINE ARO_SHALLOW_MF(KKL, KLON, KLEV, KFDIA, KRR, KRRL, KRRI,KSV,& - HMF_UPDRAFT, HMF_CLOUD, HFRAC_ICE, OMIXUV, & - ONOMIXLG,KSV_LGBEG,KSV_LGEND, & - KTCOUNT, PTSTEP, PDX, PDY, & + SUBROUTINE ARO_SHALLOW_MF(PHYEX,& + KKL, KLON, KLEV, KFDIA, KRR, KRRL, KRRI,KSV,& + KSV_LGBEG,KSV_LGEND, & + PTSTEP, PDX, PDY, & PZZ, PZZF, PDZZF, & PRHODJ, PRHODREF, & PPABSM, PEXNM, & @@ -65,12 +65,8 @@ ! ------------ ! USE MODD_PARAMETERS, ONLY: JPVEXT -USE MODD_BUDGET, ONLY: NBUDGET_SV1, TBUDGETDATA, TBUCONF -USE MODD_CST, ONLY: CST -USE MODD_NEB, ONLY: NEB -USE MODD_TURB_n, ONLY: TURBN -USE MODD_CTURB, ONLY: CSTURB -USE MODD_PARAM_MFSHALL_n, ONLY: PARAM_MFSHALLN +USE MODD_BUDGET, ONLY: NBUDGET_SV1, TBUDGETDATA +USE MODD_PHYEX, ONLY: PHYEX_t USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t ! USE MODI_SHALLOW_MF @@ -86,6 +82,7 @@ IMPLICIT NONE ! ! ! +TYPE(PHYEX_t), INTENT(IN) :: PHYEX INTEGER, INTENT(IN) :: KKL ! +1 if grid goes from ground to ! atmosphere top, -1 otherwise INTEGER, INTENT(IN) :: KLON !NPROMA under CPG @@ -96,16 +93,9 @@ INTEGER, INTENT(IN) :: KRRL ! Number of liquide water var INTEGER, INTENT(IN) :: KRRI ! Number of ice variables INTEGER, INTENT(IN) :: KSV ! Number of passive scalar variables ! -CHARACTER (LEN=4), INTENT(IN) :: HMF_UPDRAFT ! Type of Mass Flux Scheme -CHARACTER (LEN=4), INTENT(IN) :: HMF_CLOUD ! Type of statistical cloud scheme -CHARACTER*1, INTENT(IN) :: HFRAC_ICE ! partition liquid/ice scheme -LOGICAL, INTENT(IN) :: OMIXUV ! True if mixing of momentum -! -LOGICAL, INTENT(IN) :: ONOMIXLG ! False if mixing of lagrangian tracer INTEGER, INTENT(IN) :: KSV_LGBEG ! first index of lag. tracer INTEGER, INTENT(IN) :: KSV_LGEND ! last index of lag. tracer -INTEGER, INTENT(IN) :: KTCOUNT ! Temporal loop counter REAL, INTENT(IN) :: PTSTEP ! Time step REAL, INTENT(IN) :: PDX ! grid size along x-axis REAL, INTENT(IN) :: PDY ! grid size along y-axis @@ -158,13 +148,11 @@ TYPE(TMDDH), INTENT(IN), TARGET :: YDMDDH ! !* 0.2 Declarations of local variables : ! -LOGICAL :: OSTATNW TYPE(TBUDGETDATA), DIMENSION(NBUDGET_SV1) :: YLBUDGET !NBUDGET_SV1 is the one with the highest number needed for shallow_mf INTEGER, DIMENSION(size(PRHODJ,1)) :: IKLCL,IKETL,IKCTL REAL,DIMENSION(size(PRHODJ,1),size(PRHODJ,2)) :: ZFLXZTHMF,ZFLXZRMF,ZFLXZUMF,ZFLXZVMF REAL,DIMENSION(size(PRHODJ,1),size(PRHODJ,2)) :: ZDETR,ZENTR TYPE(DIMPHYEX_t) :: YLDIMPHYEX -REAL :: ZIMPL ! degree of implicitness REAL(KIND=JPRB) :: ZHOOK_HANDLE INTEGER :: JBU ! Loop index for budgets ! @@ -188,8 +176,6 @@ CALL FILL_DIMPHYEX(YLDIMPHYEX, KLON, 1, KLEV, JPVEXT, KFDIA) ! --------------- -ZIMPL=1. -!ZIMPL=0. ! tableau a recalculer a chaque pas de temps ! attention, ZDZZ est l'altitude entre deux niveaux (et pas l'�paisseur de la couche) @@ -220,11 +206,10 @@ ENDDO ! ! --------------------------------- ! -TURBN%LSTATNW = .FALSE. - CALL SHALLOW_MF(YLDIMPHYEX, CST, NEB, PARAM_MFSHALLN, TURBN, CSTURB, & + CALL SHALLOW_MF(YLDIMPHYEX, PHYEX%CST, PHYEX%NEBN, PHYEX%PARAM_MFSHALLN, PHYEX%TURBN, PHYEX%CSTURB, & &KRR=KRR, KRRL=KRRL, KRRI=KRRI, KSV=KSV, & - &HFRAC_ICE=HFRAC_ICE, ONOMIXLG=ONOMIXLG,KSV_LGBEG=KSV_LGBEG,KSV_LGEND=KSV_LGEND, & - &PIMPL_MF=ZIMPL, PTSTEP=PTSTEP, & + &ONOMIXLG=PHYEX%MISC%ONOMIXLG,KSV_LGBEG=KSV_LGBEG,KSV_LGEND=KSV_LGEND, & + &PTSTEP=PTSTEP, & &PDZZ=PDZZF,PZZ=PZZ, & &PRHODJ=PRHODJ,PRHODREF=PRHODREF, & &PPABSM=PPABSM,PEXNM=PEXNM, & @@ -238,7 +223,7 @@ TURBN%LSTATNW = .FALSE. &PU_UP=PU_UP, PV_UP=PV_UP, PTHV_UP=PTHV_UP, PW_UP=PW_UP, & &PFRAC_UP=PFRAC_UP,PEMF=PEMF,PDETR=ZDETR,PENTR=ZENTR, & &KKLCL=IKLCL,KKETL=IKETL,KKCTL=IKCTL,PDX=PDX,PDY=PDY, & - &BUCONF=TBUCONF, TBUDGETS=YLBUDGET, KBUDGETS=SIZE(YLBUDGET) ) + &BUCONF=PHYEX%MISC%TBUCONF, TBUDGETS=YLBUDGET, KBUDGETS=SIZE(YLBUDGET) ) ! ! !------------------------------------------------------------------------------ diff --git a/src/arome/ext/aro_shallow_mf.h b/src/arome/ext/aro_shallow_mf.h index 4e3ea02da92831f711b473ae52f7e73e9c4a99ff..b8633723c5933bd28c93e3fd422fd1be8f4a5b07 100644 --- a/src/arome/ext/aro_shallow_mf.h +++ b/src/arome/ext/aro_shallow_mf.h @@ -1,8 +1,8 @@ INTERFACE - SUBROUTINE ARO_SHALLOW_MF(KKL, KLON, KLEV, KFDIA, KRR, KRRL, KRRI,KSV,& - & HMF_UPDRAFT, HMF_CLOUD, HFRAC_ICE, OMIXUV,& - & ONOMIXLG,KSV_LGBEG,KSV_LGEND,& - & KTCOUNT, PTSTEP, PDX, PDY,& + SUBROUTINE ARO_SHALLOW_MF(PHYEX, & + & KKL, KLON, KLEV, KFDIA, KRR, KRRL, KRRI,KSV,& + & KSV_LGBEG,KSV_LGEND,& + & PTSTEP, PDX, PDY,& & PZZ, PZZF,PDZZF,& & PRHODJ, PRHODREF,& & PPABSM, PEXNM,& @@ -19,6 +19,8 @@ USE PARKIND1 ,ONLY : JPIM ,JPRB USE DDH_MIX, ONLY : TYP_DDH USE YOMLDDH, ONLY : TLDDH USE YOMMDDH, ONLY : TMDDH +USE MODD_PHYEX, ONLY: PHYEX_t +TYPE(PHYEX_t), INTENT(IN) :: PHYEX INTEGER(KIND=JPIM), INTENT(IN) :: KKL INTEGER(KIND=JPIM), INTENT(IN) :: KLON INTEGER(KIND=JPIM), INTENT(IN) :: KLEV @@ -27,14 +29,8 @@ INTEGER(KIND=JPIM), INTENT(IN) :: KRR INTEGER(KIND=JPIM), INTENT(IN) :: KRRL INTEGER(KIND=JPIM), INTENT(IN) :: KRRI INTEGER(KIND=JPIM), INTENT(IN) :: KSV -CHARACTER (LEN=4), INTENT(IN) :: HMF_UPDRAFT -CHARACTER (LEN=4), INTENT(IN) :: HMF_CLOUD -CHARACTER*1, INTENT(IN) :: HFRAC_ICE -LOGICAL, INTENT(IN) :: OMIXUV -LOGICAL, INTENT(IN) :: ONOMIXLG INTEGER(KIND=JPIM), INTENT(IN) :: KSV_LGBEG INTEGER(KIND=JPIM), INTENT(IN) :: KSV_LGEND -INTEGER(KIND=JPIM), INTENT(IN) :: KTCOUNT REAL(KIND=JPRB), INTENT(IN) :: PTSTEP REAL(KIND=JPRB), INTENT(IN) :: PDX REAL(KIND=JPRB), INTENT(IN) :: PDY diff --git a/src/arome/ext/aro_turb_mnh.F90 b/src/arome/ext/aro_turb_mnh.F90 index 552070615f2cd7a2e0667def6a9263933666cea9..648cdcf7fd9cd07ce2b9a92a693e13413adf55a1 100644 --- a/src/arome/ext/aro_turb_mnh.F90 +++ b/src/arome/ext/aro_turb_mnh.F90 @@ -1,13 +1,14 @@ ! ######spl - SUBROUTINE ARO_TURB_MNH( KKA,KKU,KKL,KLON,KLEV,KRR,KRRL,KRRI,KSV, & - KTCOUNT, KGRADIENTS, LDHARATU, CMICRO, PTSTEP, & + SUBROUTINE ARO_TURB_MNH(PHYEX, & + KKA,KKU,KKL,KLON,KLEV,KRR,KRRL,KRRI,KSV, & + KGRADIENTS, CMICRO, PTSTEP, & PZZ, PZZF, PZZTOP, & - PRHODJ, PTHVREF,HINST_SFU, & + PRHODJ, PTHVREF, & PSFTH,PSFRV,PSFSV,PSFU,PSFV, & PPABSM,PUM,PVM,PWM,PTKEM,PEPSM,PSVM,PSRCM, & PTHM,PRM, & PRUS,PRVS,PRWS,PRTHS,PRRS,PRSVSIN,PRSVS,PRTKES,PRTKES_OUT,PREPSS, & - PHGRAD,PSIGS,OSUBG_COND, & + PHGRAD,PSIGS, & PFLXZTHVMF,PLENGTHM,PLENGTHH,MFMOIST, & PDRUS_TURB,PDRVS_TURB, & PDRTHLS_TURB,PDRRTS_TURB,PDRSVS_TURB, & @@ -68,15 +69,12 @@ !* 0. DECLARATIONS ! ------------ ! -USE MODD_CONF -USE MODD_CST, ONLY:CST -USE MODD_CTURB, ONLY:CSTURB -USE MODD_LES, ONLY:TLES -USE MODD_PARAMETERS +USE MODD_PHYEX, ONLY: PHYEX_t +USE MODD_LES, ONLY: TLES_t +USE MODD_PARAMETERS, ONLY: JPVEXT_TURB USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_IO, ONLY: TFILEDATA USE MODD_BUDGET, ONLY: NBUDGET_RI, TBUDGETDATA, TBUCONF -USE MODD_TURB_n, ONLY: TURBN ! USE MODI_TURB ! @@ -93,6 +91,7 @@ IMPLICIT NONE ! ! ! +TYPE(PHYEX_t), INTENT(IN) :: PHYEX INTEGER, INTENT(IN) :: KLON !KFDIA under CPG INTEGER, INTENT(IN) :: KLEV !Number of vertical levels INTEGER, INTENT(IN) :: KKA !Index of point near ground @@ -102,9 +101,7 @@ INTEGER, INTENT(IN) :: KRR ! Number of moist variables INTEGER, INTENT(IN) :: KRRL ! Number of liquide water variables INTEGER, INTENT(IN) :: KRRI ! Number of ice variables INTEGER, INTENT(IN) :: KSV ! Number of passive scalar -INTEGER, INTENT(IN) :: KTCOUNT ! Temporal loop counter INTEGER, INTENT(IN) :: KGRADIENTS ! Number of stored horizontal gradients -LOGICAL, INTENT(IN) :: LDHARATU ! HARATU scheme active CHARACTER (LEN=4), INTENT(IN) :: CMICRO ! Microphysics scheme REAL, INTENT(IN) :: PTSTEP ! Time step ! @@ -118,8 +115,6 @@ REAL, DIMENSION(KLON,1,KLEV+2), INTENT(INOUT) :: PRHODJ !Dry density * Jaco REAL, DIMENSION(KLON,1,KLEV+2), INTENT(INOUT) :: MFMOIST !Moist mass flux from Dual scheme REAL, DIMENSION(KLON,1,KLEV+2), INTENT(INOUT) :: PTHVREF ! Virtual Potential ! Temperature of the reference state -CHARACTER(LEN=1) , INTENT(IN) :: HINST_SFU ! temporal location of the - ! surface friction flux ! REAL, DIMENSION(KLON,1), INTENT(INOUT) :: PSFTH,PSFRV ! normal surface fluxes of theta and Rv @@ -169,8 +164,6 @@ REAL, DIMENSION(KLON,1,KLEV,KSV), INTENT(OUT) :: PDRSVS_TURB ! evolution of REAL, DIMENSION(KLON,1,KLEV+2), INTENT(INOUT) :: PFLXZTHVMF REAL, DIMENSION(KLON,1,KLEV+2), INTENT(OUT) :: PEDR ! EDR ! -LOGICAL , INTENT(IN) :: OSUBG_COND ! switch -! !for SUBGrid CONDensation REAL, DIMENSION(KLON,1,KLEV+2), INTENT(OUT) :: PDP, PTP, PTPMF, PTDIFF, PTDISS ! !for TKE DDH budgets ! @@ -184,34 +177,11 @@ TYPE(TFILEDATA) :: ZTFILE !I/O for MesoNH !* 0.2 Declarations of local variables : ! INTEGER :: JRR,JSV ! Loop index for the moist and scalar variables -INTEGER :: IIB ! Define the physical domain -INTEGER :: IIE ! -INTEGER :: IJB ! -INTEGER :: IJE ! -INTEGER :: IKB ! -INTEGER :: IKE ! -INTEGER :: IKTB ! -INTEGER :: IKTE ! -INTEGER :: IKT ! INTEGER :: JL, JK, JLON ! INTEGER ::II ! ! -INTEGER :: IMI ! model index number - -CHARACTER(LEN=4),DIMENSION(2) :: HLBCX, HLBCY ! X- and Y-direc LBC - -INTEGER :: ISPLIT ! number of time-splitting - -LOGICAL :: OOCEAN,ODEEPOC! switch for OCEAN version of turbulence scheme -LOGICAL :: OCOUPLES ! switch for ocean-atm LES coupling -LOGICAL :: OBLOWSNOW ! switch for prognostic blow snow scheme -LOGICAL :: OCOMPUTE_SRC ! flag to define dimensions of SIGS and SRCT variables -CHARACTER(LEN=6) :: HPROGRAM ! Program (AROME or MESONH prog) -LOGICAL :: OFLAT ! Logical for zero ororography -LOGICAL :: ONOMIXLG ! to use turbulence for lagrangian variables (modd_conf) -LOGICAL :: O2D ! Logical for 2D model version (modd_conf) INTEGER :: KSV_LGBEG, KSV_LGEND ! number of scalar variables ! REAL, DIMENSION(KLON,1,KLEV+2) :: ZDXX,ZDYY,ZDZZ,ZDZX,ZDZY @@ -224,7 +194,6 @@ REAL, POINTER :: ZCOSSLOPE(:,:) ! cosinus of the anglebetween i and the sl REAL, POINTER :: ZSINSLOPE(:,:) ! sinus of the angle between i and the slope vector REAL,DIMENSION(KLON,1,KLEV+2) :: ZCEI -REAL :: ZCEI_MIN,ZCEI_MAX,ZCOEF_AMPL_SAT REAL, DIMENSION(KLON,1) :: ZBL_DEPTH, ZSBL_DEPTH REAL,DIMENSION(KLON,1,KLEV+2) :: ZWTH ! heat flux REAL,DIMENSION(KLON,1,KLEV+2) :: ZWRC ! cloud water flux @@ -234,8 +203,10 @@ REAL,DIMENSION(KLON,1,KLEV+2,KRR) :: ZRM,ZRRS REAL,DIMENSION(KLON,1,KLEV+2,KGRADIENTS) :: PHGRAD ! Horizontal Gradients ! REAL, DIMENSION(KLON,1), TARGET :: ZERO, ZONE +REAL :: ZTWOTSTEP ! TYPE(DIMPHYEX_t) :: YLDIMPHYEX +TYPE(TLES_t) :: YLTLES ! !------------------------------------------------------------------------------ ! @@ -244,55 +215,24 @@ TYPE(DIMPHYEX_t) :: YLDIMPHYEX ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('ARO_TURB_MNH',0,ZHOOK_HANDLE) -IIB=1+JPHEXT -IIE=SIZE(PZZ,1) - JPHEXT -IJB=1+JPHEXT -IJE=SIZE(PZZ,2) - JPHEXT -IKTB=1+JPVEXT_TURB -IKT=SIZE(PZZ,3)+2*JPVEXT_TURB -IKTE=IKT - JPVEXT_TURB -IKB=KKA+JPVEXT_TURB*KKL -IKE=KKU-JPVEXT_TURB*KKL CALL FILL_DIMPHYEX(YLDIMPHYEX, KLON, 1, KLEV+2, JPVEXT_TURB, KLON) +YLTLES%LLES=.FALSE. +YLTLES%LLES_CALL=.FALSE. +ZTWOTSTEP=2*PTSTEP ! ! ! !------------------------------------------------------------------------------ ! !* 2. INITIALISATION (CAS DU MODELE 1D) -! ! --------------------------------- -! Numero du modele si grid nestind, toujours egal a 1 -IMI=1 - +! ! Fichier I/O pour MesoNH (non-utilise dans AROME) ZTFILE%LOPENED=.FALSE. -! Type de condition � la limite. En 1D, sans importance. A etudier en 3D. -HLBCX(:)='CYCL' -HLBCY(:)='CYCL' - -! en dur a 1 dans MNH -ISPLIT=1 - -!Version Ocean du schema de turbulence -OOCEAN=.FALSE. -ODEEPOC=.FALSE. - -HPROGRAM='AROME ' - -! no orography for mesonh -OFLAT=.FALSE. ! 2D version of turbulence -O2D=.FALSE. -! Lagragian diag for mesonh -ONOMIXLG=.FALSE. KSV_LGBEG=0 KSV_LGEND=0 -! blowsnow scheme with mesonh -OBLOWSNOW=.FALSE. -! ocean-atmo LES interactive coupling -OCOUPLES=.FALSE. ! tableau a recalculer a chaque pas de temps ! attention, ZDZZ est l'altitude entre deux niveaux (et pas l'�paisseur de la couche) @@ -302,19 +242,19 @@ OCOUPLES=.FALSE. -ZZZ(IIB:IIE,1,2:KLEV+1)=PZZ(IIB:IIE,1,1:KLEV) -ZZZ(IIB:IIE,1,1) = PZZTOP(IIB:IIE) -ZDZZ(IIB:IIE,1,KLEV+2)=-999. +ZZZ(YLDIMPHYEX%NIB:YLDIMPHYEX%NIE,1,2:KLEV+1)=PZZ(YLDIMPHYEX%NIB:YLDIMPHYEX%NIE,1,1:KLEV) +ZZZ(YLDIMPHYEX%NIB:YLDIMPHYEX%NIE,1,1) = PZZTOP(YLDIMPHYEX%NIB:YLDIMPHYEX%NIE) +ZDZZ(YLDIMPHYEX%NIB:YLDIMPHYEX%NIE,1,KLEV+2)=-999. DO JK = 2 , KLEV - DO JL = IIB,IIE + DO JL = YLDIMPHYEX%NIB,YLDIMPHYEX%NIE ZDZZ(JL,1,JK)=PZZF(JL,1,JK-1)-PZZF(JL,1,JK) ENDDO ENDDO -DO JL = IIB,IIE +DO JL = YLDIMPHYEX%NIB,YLDIMPHYEX%NIE ZZZ(JL,1,KLEV+2) = 2*PZZ(JL,1,KLEV)-PZZ(JL,1,KLEV-1) - ZDZZ(JL,1,1)=ZZZ(JL,1,KKU)-ZZZ(JL,1,IKE) + ZDZZ(JL,1,1)=ZZZ(JL,1,KKU)-ZZZ(JL,1,YLDIMPHYEX%NKE) ZDZZ(JL,1,KLEV+1)=PZZF(JL,1,KLEV)-(1.5*ZZZ(JL,1,KLEV+1)-0.5*ZZZ(JL,1,KLEV)) ENDDO @@ -395,7 +335,7 @@ PSRCM(:,:,1)=0. PSRCM(:,:,KLEV+2)=0. CALL VERTICAL_EXTEND(PTHM) CALL VERTICAL_EXTEND(PFLXZTHVMF) -IF (LDHARATU) THEN +IF (PHYEX%TURBN%LHARAT) THEN CALL VERTICAL_EXTEND(PLENGTHM) CALL VERTICAL_EXTEND(PLENGTHH) ENDIF @@ -413,10 +353,7 @@ CALL VERTICAL_EXTEND(PRTKES_OUT) ! ! --------------------------------- !pour AROME, on n'utilise pas les modifs de Mireille pour la turb au bord des nuages -ZCEI_MAX=1.0 -ZCEI_MIN=0.0 ZCEI=0.0 -ZCOEF_AMPL_SAT=0.0 DO JRR=1, NBUDGET_RI YLBUDGET(JRR)%NBUDGET=JRR @@ -424,16 +361,15 @@ DO JRR=1, NBUDGET_RI YLBUDGET(JRR)%YDLDDH=>YDLDDH YLBUDGET(JRR)%YDMDDH=>YDMDDH ENDDO -OCOMPUTE_SRC=SIZE(PSIGS, 3)/=0 -CALL TURB (CST,CSTURB,TBUCONF,TURBN, YLDIMPHYEX,TLES,& - & IMI, KRR, KRRL, KRRI, HLBCX, HLBCY, KGRADIENTS,1, & - & ISPLIT,IMI, KSV, KSV_LGBEG, KSV_LGEND, HPROGRAM,& +CALL TURB (PHYEX%CST,PHYEX%CSTURB,TBUCONF,PHYEX%TURBN, PHYEX%NEBN, YLDIMPHYEX,YLTLES,& + & PHYEX%MISC%KMI, KRR, KRRL, KRRI, PHYEX%MISC%HLBCX, PHYEX%MISC%HLBCY, KGRADIENTS,1, & + & PHYEX%MISC%KSPLIT,PHYEX%MISC%KMI, KSV, KSV_LGBEG, KSV_LGEND, PHYEX%MISC%CPROGRAM,& & NSV_LIMA_NR, NSV_LIMA_NS, NSV_LIMA_NG, NSV_LIMA_NH, & - & O2D, ONOMIXLG, OFLAT, OCOUPLES,OBLOWSNOW,.FALSE.,& - & .FALSE., OCOMPUTE_SRC, 1.0, & - & OOCEAN,ODEEPOC, .FALSE., & - & 'NONE',CMICRO, & - & 2*PTSTEP,ZTFILE, & + & PHYEX%MISC%O2D, PHYEX%MISC%ONOMIXLG, PHYEX%MISC%OFLAT, PHYEX%MISC%OCOUPLES, PHYEX%MISC%OBLOWSNOW,& + & PHYEX%MISC%OIBM, PHYEX%MISC%OFLYER, PHYEX%MISC%OCOMPUTE_SRC, PHYEX%MISC%XRSNOW, & + & PHYEX%MISC%OOCEAN,PHYEX%MISC%ODEEPOC, PHYEX%MISC%ODIAG_IN_RUN, & + & PHYEX%MISC%HTURBLEN_CL, CMICRO, & + & ZTWOTSTEP,ZTFILE, & & ZDXX,ZDYY,ZDZZ,ZDZX,ZDZY,ZZZ, & & ZDIRCOSXW,ZDIRCOSYW,ZDIRCOSZW,ZCOSSLOPE,ZSINSLOPE, & & PRHODJ,PTHVREF,PHGRAD,PZS, & @@ -441,7 +377,7 @@ CALL TURB (CST,CSTURB,TBUCONF,TURBN, YLDIMPHYEX,TLES,& & PPABSM,PUM,PVM,PWM,PTKEM,ZSVM,PSRCM, & & PLENGTHM,PLENGTHH,MFMOIST, & & ZBL_DEPTH,ZSBL_DEPTH, & - & ZCEI,ZCEI_MIN,ZCEI_MAX,ZCOEF_AMPL_SAT, & + & ZCEI, PHYEX%MISC%XCEI_MIN, PHYEX%MISC%XCEI_MAX, PHYEX%MISC%XCOEF_AMPL_SAT, & & PTHM,ZRM, & & PRUS,PRVS,PRWS,PRTHS,ZRRS,ZRSVS,PRTKES_OUT, & & PSIGS, & diff --git a/src/arome/ext/aro_turb_mnh.h b/src/arome/ext/aro_turb_mnh.h index bf20e5b9bdaaec12ecdce19101f7c1559dedc09b..44b720a66c11f3be7b8ecda637fd5708ed9ca75d 100644 --- a/src/arome/ext/aro_turb_mnh.h +++ b/src/arome/ext/aro_turb_mnh.h @@ -1,13 +1,14 @@ INTERFACE - SUBROUTINE ARO_TURB_MNH( KKA,KKU,KKL,KLON,KLEV, KRR, KRRL, KRRI,KSV,& - & KTCOUNT,KGRADIENTS, LDHARATU, CMICRO, PTSTEP,& + SUBROUTINE ARO_TURB_MNH(PHYEX, & + & KKA,KKU,KKL,KLON,KLEV, KRR, KRRL, KRRI,KSV,& + & KGRADIENTS, CMICRO, PTSTEP,& & PZZ, PZZF, PZZTOP,& - & PRHODJ, PTHVREF,HINST_SFU,& + & PRHODJ, PTHVREF,& & PSFTH,PSFRV,PSFSV,PSFU,PSFV,& & PPABSM,PUM,PVM,PWM,PTKEM,PEPSM,PSVM,PSRCM,& & PTHM,PRM,& & PRUS,PRVS,PRWS,PRTHS,PRRS,PRSVSIN,PRSVS,PRTKES,PRTKES_OUT,PREPSS,& - & PHGRAD,PSIGS,OSUBG_COND,& + & PHGRAD,PSIGS,& & PFLXZTHVMF,PLENGTHM,PLENGTHH,MFMOIST,& & PDRUS_TURB,PDRVS_TURB,& & PDRTHLS_TURB,PDRRTS_TURB,PDRSVS_TURB,& @@ -17,7 +18,9 @@ USE PARKIND1 ,ONLY : JPIM ,JPRB USE DDH_MIX, ONLY : TYP_DDH USE YOMLDDH, ONLY : TLDDH USE YOMMDDH, ONLY : TMDDH +USE MODD_PHYEX, ONLY: PHYEX_t +TYPE(PHYEX_t), INTENT(IN) :: PHYEX INTEGER(KIND=JPIM), INTENT(IN) :: KLON INTEGER(KIND=JPIM), INTENT(IN) :: KLEV INTEGER(KIND=JPIM), INTENT(IN) :: KKA !Index of nearest point to ground @@ -29,9 +32,7 @@ INTEGER(KIND=JPIM), INTENT(IN) :: KRR INTEGER(KIND=JPIM), INTENT(IN) :: KRRL INTEGER(KIND=JPIM), INTENT(IN) :: KRRI INTEGER(KIND=JPIM), INTENT(IN) :: KSV -INTEGER(KIND=JPIM), INTENT(IN) :: KTCOUNT INTEGER(KIND=JPIM), INTENT(IN) :: KGRADIENTS ! Number of stored horizontal gradients -LOGICAL, INTENT(IN) :: LDHARATU ! HARATU scheme active CHARACTER(LEN=4), INTENT(IN) :: CMICRO ! Microphysics scheme REAL(KIND=JPRB), INTENT(IN) :: PTSTEP REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV), INTENT(IN) :: PZZ @@ -40,7 +41,6 @@ REAL(KIND=JPRB), DIMENSION(KLON), INTENT(IN) :: PZZTOP REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV+2), INTENT(INOUT) :: PRHODJ REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV+2), INTENT(INOUT) :: MFMOIST REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV+2), INTENT(INOUT) :: PTHVREF -CHARACTER*1 , INTENT(IN) :: HINST_SFU REAL(KIND=JPRB), DIMENSION(KLON,1), INTENT(INOUT) :: PSFTH,PSFRV REAL(KIND=JPRB), DIMENSION(KLON,1), INTENT(INOUT) :: PSFU,PSFV REAL(KIND=JPRB), DIMENSION(KLON,1,KSV), INTENT(INOUT) :: PSFSV @@ -69,7 +69,6 @@ REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV+2), INTENT(OUT) :: PDRTHLS_TURB REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV+2), INTENT(OUT) :: PDRRTS_TURB REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV,KSV), INTENT(OUT) :: PDRSVS_TURB REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV+2), INTENT(INOUT) :: PFLXZTHVMF -LOGICAL , INTENT(IN) :: OSUBG_COND REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV+2), INTENT(OUT) :: PDP REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV+2), INTENT(OUT) :: PTP REAL(KIND=JPRB), DIMENSION(KLON,1,KLEV+2), INTENT(OUT) :: PTPMF diff --git a/src/arome/ext/aroini_mfshal.F90 b/src/arome/ext/aroini_mfshal.F90 deleted file mode 100644 index 330738fed823cf7531b703af510b303dcf2ca679..0000000000000000000000000000000000000000 --- a/src/arome/ext/aroini_mfshal.F90 +++ /dev/null @@ -1,93 +0,0 @@ -SUBROUTINE AROINI_MFSHAL(PALP_PERT,PABUO,PBENTR,PBDETR,PCMF,PENTR_MF,PCRAD_MF,PENTR_DRY,& - & PDETR_DRY,PDETR_LUP,PKCF_MF,PKRC_MF,PTAUSIGMF,PPRES_UV,PFRAC_UP_MAX,& - & PALPHA_MF,PSIGMA_MF,PA1,PB,PC,PBETA1,PR,PLAMBDA,HMF_UPDRAFT,HMF_CLOUD,OMIXUV) - -USE PARKIND1, ONLY : JPRB -USE YOMHOOK , ONLY : LHOOK, DR_HOOK -!**** *AROINI_MFSHAL* - -! Purpose. -! -------- -! Call Méso-NH routine INI_CMFSHALL -! (setup of constants for Mass Flux scheme of Pergaud et al) -! -!** Interface. -! ---------- -! *CALL* *AROINI_MFSHAL - -! Explicit arguments : -! -------------------- -! None - -! Implicit arguments : -! -------------------- -! - -! Method. -! ------- -! See documentation - -! Externals. -! ---------- - -! Reference. -! ---------- -! Documentation AROME - -! Author. -! ------- -! S. Malardel - -! Modifications. -! -------------- -! Original : 07-10-30 -! ------------------------------------------------------------------ - -USE MODI_INI_CMFSHALL -USE MODD_PARAM_MFSHALL_n, ONLY: LMIXUV, CMF_UPDRAFT, CMF_CLOUD - -IMPLICIT NONE - -REAL, INTENT(IN) :: PALP_PERT -REAL, INTENT(IN) :: PABUO -REAL, INTENT(IN) :: PBENTR -REAL, INTENT(IN) :: PBDETR -REAL, INTENT(IN) :: PCMF -REAL, INTENT(IN) :: PENTR_MF -REAL, INTENT(IN) :: PCRAD_MF -REAL, INTENT(IN) :: PENTR_DRY -REAL, INTENT(IN) :: PDETR_DRY -REAL, INTENT(IN) :: PDETR_LUP -REAL, INTENT(IN) :: PKCF_MF -REAL, INTENT(IN) :: PKRC_MF -REAL, INTENT(IN) :: PTAUSIGMF -REAL, INTENT(IN) :: PPRES_UV -REAL, INTENT(IN) :: PFRAC_UP_MAX -REAL, INTENT(IN) :: PALPHA_MF -REAL, INTENT(IN) :: PSIGMA_MF -REAL, INTENT(IN) :: PA1 -REAL, INTENT(IN) :: PB -REAL, INTENT(IN) :: PC -REAL, INTENT(IN) :: PBETA1 -REAL, INTENT(IN) :: PR -REAL, INTENT(IN) :: PLAMBDA -CHARACTER (LEN=4), INTENT(IN) :: HMF_UPDRAFT -CHARACTER (LEN=4), INTENT(IN) :: HMF_CLOUD -LOGICAL, INTENT(IN) :: OMIXUV - -! ------------------------------------------------------------------ - -! 1. Set implicit default values for MODD_CMFSHALL - -REAL(KIND=JPRB) :: ZHOOK_HANDLE -IF (LHOOK) CALL DR_HOOK('AROINI_MFSHAL',0,ZHOOK_HANDLE) -CALL INI_CMFSHALL(PALP_PERT,PABUO,PBENTR,PBDETR,PCMF,PENTR_MF,PCRAD_MF,PENTR_DRY,& - & PDETR_DRY,PDETR_LUP,PKCF_MF,PKRC_MF,PTAUSIGMF,PPRES_UV,PFRAC_UP_MAX,& - & PALPHA_MF,PSIGMA_MF,PA1,PB,PC,PBETA1,PR,PLAMBDA) -! -LMIXUV=OMIXUV -CMF_UPDRAFT=HMF_UPDRAFT -CMF_CLOUD=HMF_CLOUD -! ------------------------------------------------------------------ -IF (LHOOK) CALL DR_HOOK('AROINI_MFSHAL',1,ZHOOK_HANDLE) -RETURN -END SUBROUTINE AROINI_MFSHAL diff --git a/src/arome/ext/aroini_mfshal.h b/src/arome/ext/aroini_mfshal.h deleted file mode 100644 index 82164a5aa809096909ed0387a1d50097ab8ca486..0000000000000000000000000000000000000000 --- a/src/arome/ext/aroini_mfshal.h +++ /dev/null @@ -1,36 +0,0 @@ -INTERFACE -SUBROUTINE AROINI_MFSHAL(PALP_PERT,PABUO,PBENTR,PBDETR,PCMF,PENTR_MF,PCRAD_MF,PENTR_DRY,& - & PDETR_DRY,PDETR_LUP,PKCF_MF,PKRC_MF,PTAUSIGMF,PPRES_UV,PFRAC_UP_MAX,& - & PALPHA_MF,PSIGMA_MF,PA1,PB,PC,PBETA1,PR,PLAMBDA,HMF_UPDRAFT,HMF_CLOUD,OMIXUV) - - USE PARKIND1, ONLY : JPRB - USE YOMHOOK , ONLY : LHOOK, DR_HOOK - -REAL(KIND=JPRB), INTENT(IN) :: PALP_PERT -REAL(KIND=JPRB), INTENT(IN) :: PABUO -REAL(KIND=JPRB), INTENT(IN) :: PBENTR -REAL(KIND=JPRB), INTENT(IN) :: PBDETR -REAL(KIND=JPRB), INTENT(IN) :: PCMF -REAL(KIND=JPRB), INTENT(IN) :: PENTR_MF -REAL(KIND=JPRB), INTENT(IN) :: PCRAD_MF -REAL(KIND=JPRB), INTENT(IN) :: PENTR_DRY -REAL(KIND=JPRB), INTENT(IN) :: PDETR_DRY -REAL(KIND=JPRB), INTENT(IN) :: PDETR_LUP -REAL(KIND=JPRB), INTENT(IN) :: PKCF_MF -REAL(KIND=JPRB), INTENT(IN) :: PKRC_MF -REAL(KIND=JPRB), INTENT(IN) :: PTAUSIGMF -REAL(KIND=JPRB), INTENT(IN) :: PPRES_UV -REAL(KIND=JPRB), INTENT(IN) :: PFRAC_UP_MAX -REAL(KIND=JPRB), INTENT(IN) :: PALPHA_MF -REAL(KIND=JPRB), INTENT(IN) :: PSIGMA_MF -REAL(KIND=JPRB), INTENT(IN) :: PA1 -REAL(KIND=JPRB), INTENT(IN) :: PB -REAL(KIND=JPRB), INTENT(IN) :: PC -REAL(KIND=JPRB), INTENT(IN) :: PBETA1 -REAL(KIND=JPRB), INTENT(IN) :: PR -REAL(KIND=JPRB), INTENT(IN) :: PLAMBDA -CHARACTER (LEN=4), INTENT(IN) :: HMF_UPDRAFT -CHARACTER (LEN=4), INTENT(IN) :: HMF_CLOUD -LOGICAL, INTENT(IN) :: OMIXUV -END SUBROUTINE AROINI_MFSHAL -END INTERFACE diff --git a/src/arome/ext/aroini_micro.F90 b/src/arome/ext/aroini_micro.F90 deleted file mode 100644 index faee8673b2c34a565823c4a3fa2ef3d7a7c668b8..0000000000000000000000000000000000000000 --- a/src/arome/ext/aroini_micro.F90 +++ /dev/null @@ -1,204 +0,0 @@ -! ######spl -SUBROUTINE AROINI_MICRO(KULOUT,PTSTEP,LDWARM,CMICRO,KSPLITR,CCSEDIM,LDCRIAUTI,& - PCRIAUTI,PT0CRIAUTI,PCRIAUTC,PTSTEP_TS, CCSNOWRIMING, PMRSTEP, KMAXITER, & - LDFEEDBACKT, LDEVLIMIT, LDNULLWETG, LDWETGPOST, LDNULLWETH, LDWETHPOST, & - PFRACM90, LDCONVHG, CCSUBG_RC_RR_ACCR, CCSUBG_RR_EVAP, CCSUBG_PR_PDF, & - LDCRFLIMIT, CCFRAC_ICE_ADJUST, PSPLIT_MAXCFL,& - CCFRAC_ICE_SHALLOW_MF, LDSEDIM_AFTER,LDDEPOSC,PVDEPOSC, PFRMIN,& - LDDEPSG,PRDEPSRED,PRDEPGRED,LDSEDIC) - -USE PARKIND1, ONLY : JPRB -USE YOMHOOK , ONLY : LHOOK, DR_HOOK -!**** *INI_MICRO* - Initialize common meso_NH MODD_ used in microphysics for AROME - -! Purpose. -! -------- -! Initialize -! MODD_RAIN_ICE_DESCR, MODD_RAIN_ICE_PARAM and MODD_PARAM_ICE -! parameters used in AROME microphysics - -!** Interface. -! ---------- -! *CALL* *INI_MICRO (KULOUT,KSTEP,KSPLITR) - -! Explicit arguments : -! -------------------- -! KULOUT : Logical unit for the output -! PTSTEP : Time step -! KSPLITR : Number of small time step interation for rain sedimentation -! LDWARM : value assigned to LWARM - -! Implicit arguments : -! -------------------- -! - -! Method. -! ------- -! See documentation - -! Externals. -! ---------- - -! Reference. -! ---------- -! Documentation AROME - -! Author. -! ------- -! Y. Seity - -! Modifications. -! -------------- -! Original : 03-12-12 -! 05-08-25 Kovacic added LDWARM -! Jan 2015 S. Riette: LFEEDBACKT, LEVLIMIT, LNULLWETG, LWETGPOST, CSNOWRIMING, -! XFRACM90, NMRSITER, XMRSTEP, LSIMULSG, XTSTEP_TS -! LNULLWETH, LWETHPOST added -! Oct 2016 S. Riette: LDCRFLIMIT, CCFRAC_ICE_ADJUST -! and CCFRAC_ICE_SHALLOW_MF added -! Dec 2020 Y. Seity : Add Fog deposition term -! Jan 2020 C.Wittmann: Add LDDEPSG,PRDEPSRED,PRDEPGRED -! ------------------------------------------------------------------ - -USE MODD_RAIN_ICE_DESCR -USE MODD_RAIN_ICE_PARAM -USE MODD_PARAM_ICE -USE MODD_PARAM_C1R3 - -USE MODI_INI_RAIN_ICE -USE MODI_INI_TIWMX - -IMPLICIT NONE -! ----------------------------------------------------------------------- -! DUMMY INTEGER SCALARS -INTEGER, INTENT (IN) :: KULOUT -REAL, INTENT (IN) :: PTSTEP -LOGICAL, INTENT (IN) :: LDWARM -CHARACTER(4), INTENT (IN) :: CMICRO -CHARACTER(4), INTENT (IN) :: CCSEDIM -INTEGER, INTENT (OUT) :: KSPLITR -LOGICAL, INTENT (IN) :: LDCRIAUTI -REAL, INTENT (IN) :: PCRIAUTI -REAL, INTENT (IN) :: PT0CRIAUTI -REAL, INTENT (IN) :: PCRIAUTC -REAL, INTENT (IN) :: PTSTEP_TS -CHARACTER(4), INTENT (IN) :: CCSNOWRIMING -REAL, INTENT (IN) :: PMRSTEP -INTEGER, INTENT (IN) :: KMAXITER -LOGICAL, INTENT (IN) :: LDFEEDBACKT -LOGICAL, INTENT (IN) :: LDEVLIMIT -LOGICAL, INTENT (IN) :: LDNULLWETG -LOGICAL, INTENT (IN) :: LDWETGPOST -LOGICAL, INTENT (IN) :: LDNULLWETH -LOGICAL, INTENT (IN) :: LDWETHPOST -REAL, INTENT (IN) :: PFRACM90 -LOGICAL, INTENT (IN) :: LDCONVHG -CHARACTER(LEN=80), INTENT(IN) :: CCSUBG_RC_RR_ACCR -CHARACTER(LEN=80), INTENT(IN) :: CCSUBG_RR_EVAP -CHARACTER(LEN=80), INTENT(IN) :: CCSUBG_PR_PDF -LOGICAL, INTENT (IN) :: LDCRFLIMIT -CHARACTER(LEN=1), INTENT(IN) :: CCFRAC_ICE_ADJUST -REAL, INTENT (IN) :: PSPLIT_MAXCFL -CHARACTER(LEN=1), INTENT(IN) :: CCFRAC_ICE_SHALLOW_MF -LOGICAL, INTENT (IN) :: LDSEDIM_AFTER -LOGICAL, INTENT (IN) :: LDDEPOSC -REAL, INTENT(IN):: PVDEPOSC -REAL, OPTIONAL, INTENT (IN) :: PFRMIN(40) -LOGICAL, INTENT (IN) :: LDDEPSG -LOGICAL, INTENT(IN) :: LDSEDIC -REAL, INTENT (IN) :: PRDEPSRED, PRDEPGRED - -!----------------------------------------------------------------------- -! LOCAL VARIABLES -REAL :: ZCRI0, ZTCRI0 -REAL(KIND=JPRB) :: ZHOOK_HANDLE -! ----------------------------------------------------------------------- -! 1. Set implicit default values for MODD_PARAM_ICE - -IF (LHOOK) CALL DR_HOOK('AROINI_MICRO',0,ZHOOK_HANDLE) -CALL PARAM_ICE_ASSOCIATE() -! -LWARM=LDWARM -CPRISTINE_ICE='PLAT' -CPRISTINE_ICE_C1R3='PLAT' -CHEVRIMED_ICE_C1R3='GRAU' -CSEDIM=CCSEDIM -CSUBG_RC_RR_ACCR=CCSUBG_RC_RR_ACCR -CSUBG_RR_EVAP=CCSUBG_RR_EVAP -CSUBG_PR_PDF=CCSUBG_PR_PDF -LFEEDBACKT=LDFEEDBACKT ! When .TRUE. feed back on temperature is taken into account -LEVLIMIT=LDEVLIMIT ! When .TRUE. water vapour pressure is limited by saturation -LNULLWETG=LDNULLWETG ! When .TRUE. graupel wet growth is activated with null rate (to allow water shedding) -LWETGPOST=LDWETGPOST ! When .TRUE. graupel wet growth is activated with positive temperature (to allow water shedding) -LNULLWETH=LDNULLWETH ! Same as LNULLWETG but for hail -LWETHPOST=LDWETHPOST ! Same as LWETGPOST but for hail -CSNOWRIMING=CCSNOWRIMING ! OLD or M90 for Murakami 1990 formulation -XFRACM90=PFRACM90 ! Fraction used for the Murakami 1990 formulation -NMAXITER=KMAXITER ! Maximum number of iterations for mixing ratio or time splitting -XMRSTEP=PMRSTEP ! maximum mixing ratio step for mixing ratio splitting -LCONVHG=LDCONVHG ! TRUE to allow the conversion from hail to graupel -LCRFLIMIT=LDCRFLIMIT !True to limit rain contact freezing to possible heat exchange -CFRAC_ICE_ADJUST=CCFRAC_ICE_ADJUST !Choice of solid/liquid partition in adjustements -CFRAC_ICE_SHALLOW_MF=CCFRAC_ICE_SHALLOW_MF !Choice of solid/liquid partition in shallow_mf -XSPLIT_MAXCFL=PSPLIT_MAXCFL -LSEDIM_AFTER=LDSEDIM_AFTER ! sedimentation done before or after microphysics -! -XTSTEP_TS=PTSTEP_TS ! Approximative time step for time-splitting (0 for no time-splitting) -LSEDIC=LDSEDIC -! -! 2. Set implicit default values for MODD_RAIN_ICE_DESCR -! et MODD_RAIN_ICE_PARAM -LSNOW_T=.FALSE. -LRED=CMICRO=='ICE3' .OR. CMICRO=='ICE4' -LPACK_INTERP=.TRUE. -LPACK_MICRO=.TRUE. -CALL INI_RAIN_ICE (KULOUT, PTSTEP, 20.,KSPLITR,CMICRO) -CALL INI_TIWMX - -IF(PRESENT(PFRMIN))THEN - XFRMIN = PFRMIN - WRITE(UNIT=KULOUT,FMT='('' UPDATED VALUES OF XFRMIN FROM NAMPARAR :'')') - WRITE(UNIT=KULOUT,FMT='('' XFRMIN = '',40E10.3)') XFRMIN - IF(XFRMIN(16) > 0.) THEN - CALL INI_SNOW(KULOUT) ! Recalculate snow parameters : XCCS = XFRMIN(16),XCXS = XFRMIN(17) - ENDIF -ENDIF - -!update values from namparar -LDEPOSC=LDDEPOSC -XVDEPOSC=PVDEPOSC -IF (LDCRIAUTI) THEN - - XCRIAUTI=PCRIAUTI - XCRIAUTC=PCRIAUTC - XT0CRIAUTI=PT0CRIAUTI - !second point to determine 10**(aT+b) law - ZTCRI0=-40.0 - ZCRI0=1.25E-6 - - XBCRIAUTI=-( LOG10(XCRIAUTI) - LOG10(ZCRI0)*PT0CRIAUTI/ZTCRI0 )& - *ZTCRI0/(XT0CRIAUTI-ZTCRI0) - XACRIAUTI=(LOG10(ZCRI0)-XBCRIAUTI)/ZTCRI0 - - ! 3. Write NSPLITR,updated CRIAUTI - - WRITE(UNIT=KULOUT,FMT='('' NSPLITR = '',I8.4)')KSPLITR - WRITE(UNIT=KULOUT,FMT='('' UPDATED VALUES FROM NAMPARAR :'')') - WRITE(UNIT=KULOUT,FMT='('' LCRIAUTI = '',L5)')LDCRIAUTI - WRITE(UNIT=KULOUT,FMT='('' XCRIAUTI = '',E13.6)')XCRIAUTI - WRITE(UNIT=KULOUT,FMT='('' XACRIAUTI = '',E13.6)')XACRIAUTI - WRITE(UNIT=KULOUT,FMT='('' XBCRIAUTI = '',E13.6)')XBCRIAUTI - WRITE(UNIT=KULOUT,FMT='('' XT0CRIAUTI = '',E13.6)')XT0CRIAUTI - WRITE(UNIT=KULOUT,FMT='('' XCRIAUTC = '',E13.6)')XCRIAUTC - WRITE(UNIT=KULOUT,FMT='('' XVDEPOSC = '',E13.6)')XVDEPOSC - WRITE(UNIT=KULOUT,FMT='('' LDEPOSC = '',L5)')LDEPOSC -ENDIF - -XRDEPSRED=PRDEPSRED -XRDEPGRED=PRDEPGRED - -! ----------------------------------------------------------------------- - -IF (LHOOK) CALL DR_HOOK('AROINI_MICRO',1,ZHOOK_HANDLE) -RETURN -END SUBROUTINE AROINI_MICRO diff --git a/src/arome/ext/aroini_micro.h b/src/arome/ext/aroini_micro.h deleted file mode 100644 index a5dd62fbf0e4fb9dcdfbce11972f7c4f51664a5c..0000000000000000000000000000000000000000 --- a/src/arome/ext/aroini_micro.h +++ /dev/null @@ -1,47 +0,0 @@ -INTERFACE -SUBROUTINE AROINI_MICRO(KULOUT,PTSTEP,LDWARM,CMICRO,KSPLITR,CCSEDIM,LDCRIAUTI,& - & PCRIAUTI,PT0CRIAUTI,PCRIAUTC,PTSTEP_TS,CCSNOWRIMING, PMRSTEP,KMAXITER,& - & LDFEEDBACKT, LDEVLIMIT, LDNULLWETG, LDWETGPOST, LDNULLWETH, LDWETHPOST, & - & PFRACM90, LDCONVHG, CCSUBG_RC_RR_ACCR, CCSUBG_RR_EVAP, CCSUBG_PR_PDF, & - & LDCRFLIMIT, CCFRAC_ICE_ADJUST, PSPLIT_MAXCFL,& - & CCFRAC_ICE_SHALLOW_MF, LDSEDIM_AFTER,LDDEPOSC, PVDEPOSC, PFRMIN,& - & LDDEPSG,PRDEPSRED,PRDEPGRED,LDSEDIC) -USE PARKIND1 ,ONLY : JPIM ,JPRB -INTEGER(KIND=JPIM), INTENT (IN) :: KULOUT -REAL(KIND=JPRB), INTENT (IN) :: PTSTEP -LOGICAL, INTENT (IN) :: LDWARM -CHARACTER (LEN=4), INTENT (IN) :: CMICRO -CHARACTER(4), INTENT (IN) :: CCSEDIM -INTEGER(KIND=JPIM), INTENT (OUT) :: KSPLITR -LOGICAL, INTENT (IN) :: LDCRIAUTI -REAL(KIND=JPRB), INTENT (IN) :: PCRIAUTI -REAL(KIND=JPRB), INTENT (IN) :: PT0CRIAUTI -REAL(KIND=JPRB), INTENT (IN) :: PCRIAUTC -REAL(KIND=JPRB), INTENT (IN) :: PTSTEP_TS -CHARACTER(4), INTENT (IN) :: CCSNOWRIMING -REAL(KIND=JPRB), INTENT (IN) :: PMRSTEP -INTEGER(KIND=JPIM), INTENT (IN) :: KMAXITER -LOGICAL, INTENT (IN) :: LDFEEDBACKT -LOGICAL, INTENT (IN) :: LDEVLIMIT -LOGICAL, INTENT (IN) :: LDNULLWETG -LOGICAL, INTENT (IN) :: LDWETGPOST -LOGICAL, INTENT (IN) :: LDNULLWETH -LOGICAL, INTENT (IN) :: LDWETHPOST -REAL(KIND=JPRB), INTENT (IN) :: PFRACM90 -LOGICAL, INTENT (IN) :: LDCONVHG -CHARACTER(LEN=80), INTENT(IN) :: CCSUBG_RC_RR_ACCR -CHARACTER(LEN=80), INTENT(IN) :: CCSUBG_RR_EVAP -CHARACTER(LEN=80), INTENT(IN) :: CCSUBG_PR_PDF -LOGICAL, INTENT (IN) :: LDCRFLIMIT -CHARACTER(LEN=1), INTENT(IN) :: CCFRAC_ICE_ADJUST -REAL(KIND=JPRB), INTENT (IN) :: PSPLIT_MAXCFL -CHARACTER(LEN=1), INTENT(IN) :: CCFRAC_ICE_SHALLOW_MF -LOGICAL, INTENT (IN) :: LDSEDIM_AFTER -LOGICAL, INTENT (IN) :: LDDEPOSC -REAL(KIND=JPRB), INTENT (IN) :: PVDEPOSC -REAL(KIND=JPRB), OPTIONAL, INTENT (IN) :: PFRMIN(40) -LOGICAL, INTENT (IN) :: LDDEPSG -LOGICAL, INTENT(IN) :: LDSEDIC -REAL(KIND=JPRB), INTENT (IN) :: PRDEPSRED, PRDEPGRED -END SUBROUTINE AROINI_MICRO -END INTERFACE diff --git a/src/arome/ext/aroini_micro_lima.F90 b/src/arome/ext/aroini_micro_lima.F90 index 9aeebbcdc8a5b55112afb2cbe2097d41c51e6ff8..a119def722cc3eed7351e765d3707540b4aff7cb 100644 --- a/src/arome/ext/aroini_micro_lima.F90 +++ b/src/arome/ext/aroini_micro_lima.F90 @@ -1,6 +1,5 @@ ! ######spl -SUBROUTINE AROINI_MICRO_LIMA(KULOUT,KULNAM,PTSTEP,LDWARM,CMICRO,KSPLITR,KSPLITG,CCSEDIM,LDCRIAUTI,& - PCRIAUTI,PT0CRIAUTI,PCRIAUTC) +SUBROUTINE AROINI_MICRO_LIMA(KULOUT,KULNAM,PTSTEP,CMICRO,KSPLITR,KSPLITG) USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK @@ -21,7 +20,6 @@ USE YOMHOOK , ONLY : LHOOK, DR_HOOK ! KULOUT : Logical unit for the output ! PTSTEP : Time step ! KSPLITR : Number of small time step interation for rain sedimentation -! LDWARM : value assigned to LWARM_LIMA ! Implicit arguments : ! -------------------- @@ -65,15 +63,9 @@ IMPLICIT NONE INTEGER, INTENT (IN) :: KULOUT INTEGER, INTENT (IN) :: KULNAM REAL, INTENT (IN) :: PTSTEP -LOGICAL, INTENT (IN) :: LDWARM CHARACTER(4), INTENT (IN) :: CMICRO -CHARACTER(4), INTENT (IN) :: CCSEDIM INTEGER, INTENT (OUT) :: KSPLITR INTEGER, INTENT (OUT) :: KSPLITG -LOGICAL, INTENT (IN) :: LDCRIAUTI -REAL, INTENT (IN) :: PCRIAUTI -REAL, INTENT (IN) :: PT0CRIAUTI -REAL, INTENT (IN) :: PCRIAUTC !----------------------------------------------------------------------- ! LOCAL VARIABLES REAL :: ZCRI0, ZTCRI0 diff --git a/src/arome/ext/aroini_micro_lima.h b/src/arome/ext/aroini_micro_lima.h index 66a01c117f5fe8f3c5662f152bfd61b662faa618..bb6464239616b2df39c44de5ed08628093258f61 100644 --- a/src/arome/ext/aroini_micro_lima.h +++ b/src/arome/ext/aroini_micro_lima.h @@ -1,18 +1,11 @@ INTERFACE -SUBROUTINE AROINI_MICRO_LIMA(KULOUT,KULNAM,PTSTEP,LDWARM,CMICRO,KSPLITR,KSPLITG,CCSEDIM,LDCRIAUTI,& - PCRIAUTI,PT0CRIAUTI,PCRIAUTC) +SUBROUTINE AROINI_MICRO_LIMA(KULOUT,KULNAM,PTSTEP,CMICRO,KSPLITR,KSPLITG) USE PARKIND1 ,ONLY : JPIM ,JPRB INTEGER(KIND=JPIM), INTENT (IN) :: KULOUT INTEGER(KIND=JPIM), INTENT (IN) :: KULNAM REAL(KIND=JPRB), INTENT (IN) :: PTSTEP -LOGICAL, INTENT (IN) :: LDWARM CHARACTER (LEN=4), INTENT (IN) :: CMICRO -CHARACTER(4), INTENT (IN) :: CCSEDIM INTEGER(KIND=JPIM), INTENT (OUT) :: KSPLITR INTEGER(KIND=JPIM), INTENT (OUT) :: KSPLITG -LOGICAL, INTENT (IN) :: LDCRIAUTI -REAL(KIND=JPRB), INTENT (IN) :: PCRIAUTI -REAL(KIND=JPRB), INTENT (IN) :: PT0CRIAUTI -REAL(KIND=JPRB), INTENT (IN) :: PCRIAUTC END SUBROUTINE AROINI_MICRO_LIMA END INTERFACE diff --git a/src/arome/ext/aroini_turb.F90 b/src/arome/ext/aroini_turb.F90 deleted file mode 100644 index f68cd33028477e14b1163ddd669f09dfa9a3bc1b..0000000000000000000000000000000000000000 --- a/src/arome/ext/aroini_turb.F90 +++ /dev/null @@ -1,104 +0,0 @@ -! ######spl -SUBROUTINE AROINI_TURB(PLINI,OHARATU,OSTATNW,OSUBG_COND,HCONDENS,HLAMBDA3,HSUBG_MF_PDF,OSIGMAS) -USE PARKIND1, ONLY : JPRB -USE YOMHOOK , ONLY : LHOOK, DR_HOOK -!**** *INI_TURB* - Initialize common meso_NH MODD_ used in Turbulence scheme -! for AROME -! Purpose. -! -------- -! Initialize MODD_LES and MODD_TKE -! parameters used in AROME turbulence scheme - -!** Interface. -! ---------- -! *CALL* *INI_TURB - -! Explicit arguments : -! -------------------- -! None - -! Implicit arguments : -! -------------------- -! - -! Method. -! ------- -! See documentation - -! Externals. -! ---------- - -! Reference. -! ---------- -! Documentation AROME - -! Author. -! ------- -! Y. Seity - -! Modifications. -! -------------- -! Original : 03-12-12 -! ------------------------------------------------------------------ - -USE MODD_LES, ONLY : TLES, LES_ASSOCIATE -USE MODD_CTURB, ONLY : XLINI -USE MODD_TURB_n, ONLY: LHARAT, LSTATNW, CTURBLEN, TURB_GOTO_MODEL, LTURB_FLX, LTURB_DIAG, & - LSUBG_COND, LRMC01, CTURBDIM, XIMPL, CTOM, CCONDENS, CLAMBDA3, & - CSUBG_MF_PDF, LSIGMAS -USE MODI_INI_CTURB - -IMPLICIT NONE -! -!* 0.1 Declarations of dummy arguments : -! -! -REAL, INTENT(IN) :: PLINI ! minimum bl89 mixing length -LOGICAL,INTENT(IN) :: OHARATU ! switch HARATU -LOGICAL,INTENT(IN) :: OSTATNW ! switch LSTATNW -LOGICAL,INTENT(IN) :: OSUBG_COND ! switch of subgrid condensation -CHARACTER(LEN=80),INTENT(IN) :: HCONDENS ! subrgrid condensation PDF -CHARACTER(LEN=4),INTENT(IN) :: HLAMBDA3 ! lambda3 choice for subgrid cloud scheme -CHARACTER(LEN=80),INTENT(IN) :: HSUBG_MF_PDF ! PDF to use for MF cloud autoconversions -LOGICAL, INTENT(IN) :: OSIGMAS -! -! ------------------------------------------------------------------ - -! 1. Set implicit default values for MODD_CTURB - -REAL(KIND=JPRB) :: ZHOOK_HANDLE -IF (LHOOK) CALL DR_HOOK('AROINI_TURB',0,ZHOOK_HANDLE) -! -CALL TURB_GOTO_MODEL(1,1) -! -CALL INI_CTURB -! 1bis. Modification of MODD_CTURB values -XLINI=PLINI -LHARAT=OHARATU -LSTATNW=OSTATNW - -! 2. Set implicit default values for MODD_LES - -CALL LES_ASSOCIATE() -TLES%LLES=.FALSE. -TLES%LLES_CALL=.FALSE. - -! 3. Set implicit default values for MODD_TURB_n - -CTURBLEN = 'BL89' -CTURBDIM = '1DIM' -LTURB_FLX = .FALSE. -LTURB_DIAG = .FALSE. -LSIGMAS=OSIGMAS -XIMPL = 1. -LSUBG_COND = OSUBG_COND -CCONDENS=HCONDENS -CLAMBDA3=HLAMBDA3 -CSUBG_MF_PDF=HSUBG_MF_PDF -LRMC01 = .FALSE. -CTOM = 'NONE' - -! ------------------------------------------------------------------ -IF (LHOOK) CALL DR_HOOK('AROINI_TURB',1,ZHOOK_HANDLE) -RETURN -END SUBROUTINE AROINI_TURB diff --git a/src/arome/ext/aroini_turb.h b/src/arome/ext/aroini_turb.h deleted file mode 100644 index 558ab519aa04f7ad9b732d69c66f554653214516..0000000000000000000000000000000000000000 --- a/src/arome/ext/aroini_turb.h +++ /dev/null @@ -1,14 +0,0 @@ -INTERFACE -SUBROUTINE AROINI_TURB(PLINI,OHARATU,OSTATNW,OSUBG_COND,HCONDENS,HLAMBDA3,HSUBG_MF_PDF, & - OSIGMAS) -USE PARKIND1 ,ONLY : JPRB -REAL(KIND=JPRB),INTENT(IN)::PLINI -LOGICAL, INTENT(IN) ::OHARATU -LOGICAL, INTENT(IN) ::OSTATNW -LOGICAL, INTENT(IN) :: OSUBG_COND -CHARACTER(LEN=80),INTENT(IN) :: HCONDENS -CHARACTER(LEN=4),INTENT(IN) :: HLAMBDA3 -CHARACTER(LEN=80),INTENT(IN) :: HSUBG_MF_PDF -LOGICAL, INTENT(IN) :: OSIGMAS -END SUBROUTINE AROINI_TURB -END INTERFACE diff --git a/src/arome/ext/arp_shallow_mf.F90 b/src/arome/ext/arp_shallow_mf.F90 index 6386824b9788fefd3b215465db0d81ac7e988b64..18cab9e1fc360d6451041ac21d5097903752ad37 100644 --- a/src/arome/ext/arp_shallow_mf.F90 +++ b/src/arome/ext/arp_shallow_mf.F90 @@ -1,5 +1,5 @@ ! ######spl - SUBROUTINE ARP_SHALLOW_MF(KIDIA,KFDIA,KLON,KTDIA,KLEV,PIMPL,TSPHY,PZZ,PZZF,PR,PCP, & + SUBROUTINE ARP_SHALLOW_MF(KIDIA,KFDIA,KLON,KTDIA,KLEV,TSPHY,PZZ,PZZF,PR,PCP, & & CMF_UPDRAFT,CMF_CLOUD,LMIXUV, & & PU, PV, PT,PQV,PQL,PQI,PQR,PQS,PTKE,PAPRSF, & & PDELP,PDIFTQ,PDIFTS,PSTRTU,PSTRTV,PSFTH,PSFRV,& @@ -57,7 +57,7 @@ USE YOMCST , ONLY : RG, RATM, RKAPPA, RD, RCPD, RCPV !USE MODD_PARAMETERS ! USE MODD_CST, ONLY: CST -USE MODD_NEB, ONLY: NEB +USE MODD_NEB_n, ONLY: NEBN USE MODD_TURB_n, ONLY: TURBN USE MODD_CTURB, ONLY: CSTURB USE MODD_PARAM_MFSHALL_n, ONLY: PARAM_MFSHALLN @@ -81,7 +81,6 @@ INTEGER, INTENT(IN) :: KLON !NPROMA under CPG INTEGER, INTENT(IN) :: KLEV !Number of vertical levels (bottom of atmosphere in ARP) INTEGER, INTENT(IN) :: KTDIA !Top of atmosphere in ARPEGE REAL, INTENT(IN) :: TSPHY ! Time step -REAL, INTENT(IN) :: PIMPL CHARACTER (LEN=4), INTENT(IN) :: CMF_UPDRAFT ! Type of Mass Flux Scheme CHARACTER (LEN=4), INTENT(IN) :: CMF_CLOUD ! Type of statistical cloud scheme @@ -191,7 +190,6 @@ REAL, DIMENSION(KIDIA:KFDIA,KLEV+2) :: ZU REAL, DIMENSION(KIDIA:KFDIA,KLEV+2) :: ZV REAL, DIMENSION(KIDIA:KFDIA,KLEV+2) :: ZZZF TYPE(DIMPHYEX_t) :: YLDIMPHYEX -LOGICAL :: OSTATNW #include "abor1.intfb.h" !------------------------------------------------------------------------------ @@ -391,11 +389,10 @@ ZDRTDT_MF(:,:) = 0. !* 4. APPEL DE LA TURBULENCE MESONH ! ! --------------------------------- -OSTATNW = .FALSE. - CALL SHALLOW_MF(YLDIMPHYEX, CST, NEB, PARAM_MFSHALLN, TURBN, CSTURB, & - KRR=IKR,KRRL=IKRL,KRRI=IKRI, KSV=1,HFRAC_ICE='N', & + CALL SHALLOW_MF(YLDIMPHYEX, CST, NEBN, PARAM_MFSHALLN, TURBN, CSTURB, & + KRR=IKR,KRRL=IKRL,KRRI=IKRI, KSV=1, & ONOMIXLG=LLONOMIXLG,KSV_LGBEG=ISV_LGBEG,KSV_LGEND=ISV_LGEND, & - PIMPL_MF=PIMPL, PTSTEP=ZDT, & + PTSTEP=ZDT, & PDZZ=ZDZZ,PZZ=ZZZ, & PRHODJ=ZHRODJ,PRHODREF=ZHRODREF, & PPABSM=ZAPRSF,PEXNM=ZEXNER, & diff --git a/src/arome/ext/cpg_opts_type_mod.fypp b/src/arome/ext/cpg_opts_type_mod.fypp new file mode 100644 index 0000000000000000000000000000000000000000..4738600331ddb1c9901b8374dda47660ab6d9e98 --- /dev/null +++ b/src/arome/ext/cpg_opts_type_mod.fypp @@ -0,0 +1,439 @@ +#:mute +#:set config_file = os.path.dirname(_THIS_FILE_) + '/field_config.yaml' +#:set config = field_config.VariableConfiguration(config_file) +#:set gfl = config.groups['GFL'] +#:set surf_config_file = os.path.dirname(_THIS_FILE_) + '/surface_fields_config.yaml' +#:set surf_config = field_config.VariableConfiguration(surf_config_file) +#:set prognostic = [field_config.VariableGroup(**group) for group in surf_config.schema['prognostic']] +#:set diagnostic = [field_config.VariableGroup(**group) for group in surf_config.schema['diagnostic']] +#:set variable_groups = prognostic + diagnostic + +#:endmute +MODULE CPG_OPTS_TYPE_MOD + +USE PARKIND1, ONLY : JPIM, JPRB +USE GEOMETRY_MOD, ONLY : GEOMETRY +USE YOMCT3, ONLY : NSTEP +USE YOMCLI, ONLY : TCLI, YRCLI +USE SURFACE_FIELDS_MIX , ONLY : TYPE_SURF_GEN + +IMPLICIT NONE + +TYPE CPG_DIM_VAR_TYPE + INTEGER(KIND=JPIM) :: ILEVT1I + INTEGER(KIND=JPIM) :: ILEVT1F +END TYPE + +#:def cpg_dim_var_decl (var) + TYPE (CPG_DIM_VAR_TYPE) :: ${var}$ +#:enddef + +TYPE CPG_DIMS_VARS_TYPE +$:cpg_dim_var_decl ("U") +$:cpg_dim_var_decl ("V") +$:cpg_dim_var_decl ("T") +$:cpg_dim_var_decl ("SVD") +#:for v in gfl.variables + #:if v.array + #:elif v.dim == 3 +$:cpg_dim_var_decl (v.name) + #:endif +#:endfor +CONTAINS + PROCEDURE :: INIT => CPG_DIMS_VARS_TYPE_INIT +END TYPE CPG_DIMS_VARS_TYPE + +TYPE CPG_DIMS_SURF_TYPE +#:for group in prognostic + TYPE (TYPE_SURF_GEN) :: YSP_${group.short}$D +#:endfor +#:for group in diagnostic + TYPE (TYPE_SURF_GEN) :: YSD_${group.short}$D +#:endfor +CONTAINS + PROCEDURE :: INIT => CPG_DIMS_SURF_TYPE_INIT +END TYPE + +TYPE CPG_BNDS_TYPE + INTEGER(KIND=JPIM) :: KIDIA + INTEGER(KIND=JPIM) :: KFDIA + INTEGER(KIND=JPIM) :: KFDIE + INTEGER(KIND=JPIM) :: KIDIE + INTEGER(KIND=JPIM) :: KBL + INTEGER(KIND=JPIM) :: KSTGLO + + INTEGER(KIND=JPIM), PRIVATE :: KLON + INTEGER(KIND=JPIM), PRIVATE :: KGPTOT + INTEGER(KIND=JPIM), PRIVATE :: KGPCOMP + +CONTAINS + PROCEDURE :: INIT => CPG_BNDS_TYPE_INIT + PROCEDURE :: UPDATE => CPG_BNDS_TYPE_UPDATE +END TYPE CPG_BNDS_TYPE + +#:for group in prognostic + #:for v in group.variables + #:if v.array + #:else +TYPE CPG_SURF_${group.short}$_${v.name}$P_OPTS_TYPE + LOGICAL :: LSET = .FALSE. +END TYPE + #:endif + + #:endfor +TYPE CPG_SURF_${group.short}$P_OPTS_TYPE + #:for v in group.variables + #:if v.array + #:else + TYPE (CPG_SURF_${group.short}$_${v.name}$P_OPTS_TYPE) :: Y${v.name}$ + #:endif + #:endfor +END TYPE + +#:endfor +#:for group in diagnostic + #:for v in group.variables + #:if v.array + #:else +TYPE CPG_SURF_${group.short}$_${v.name}$D_OPTS_TYPE + LOGICAL :: LSET = .FALSE. +END TYPE + #:endif + + #:endfor +TYPE CPG_SURF_${group.short}$D_OPTS_TYPE + #:for v in group.variables + #:if v.array + #:else + TYPE (CPG_SURF_${group.short}$_${v.name}$D_OPTS_TYPE) :: Y${v.name}$ + #:endif + #:endfor +END TYPE + +#:endfor + +TYPE CPG_OPTS_SURF_TYPE + +#:for group in prognostic + TYPE (CPG_SURF_${group.short}$P_OPTS_TYPE) :: YSP_${group.short}$ +#:endfor +#:for group in diagnostic + TYPE (CPG_SURF_${group.short}$D_OPTS_TYPE) :: YSD_${group.short}$ +#:endfor +CONTAINS + PROCEDURE :: INIT => CPG_OPTS_SURF_TYPE_INIT +END TYPE + +TYPE CPG_OPTS_TYPE + + INTEGER(KIND=JPIM) :: KLON + INTEGER(KIND=JPIM) :: KFLEVG + INTEGER(KIND=JPIM) :: KGPTOT + INTEGER(KIND=JPIM) :: KGPBLKS + INTEGER(KIND=JPIM) :: KGPCOMP + INTEGER(KIND=JPIM) :: KGL1 + INTEGER(KIND=JPIM) :: KGL2 + INTEGER(KIND=JPIM) :: KSTEP + INTEGER(KIND=JPIM) :: KTDIA + INTEGER(KIND=JPIM) :: KVCLIS + INTEGER(KIND=JPIM) :: NDTPREC + INTEGER(KIND=JPIM) :: NDTPREC2 + INTEGER(KIND=JPIM) :: NDTPRECCUR + INTEGER(KIND=JPIM) :: NDTPRECCUR2 + INTEGER(KIND=JPIM) :: KTSSG + INTEGER(KIND=JPIM) :: KGRADIENTS + INTEGER(KIND=JPIM) :: KMAXDRAFT + INTEGER(KIND=JPIM) :: KSW + + TYPE (CPG_OPTS_SURF_TYPE) :: YRSURF_OPTS + TYPE (CPG_DIMS_SURF_TYPE) :: YRSURF_DIMS + TYPE (CPG_DIMS_VARS_TYPE) :: YRVARS_DIMS + + LOGICAL :: LCONFX, L_DFISTEP, LFSTEP, LDIAB, LSLPHY, LUSEPB1 + REAL(KIND=JPRB) :: ZDT, ZDTPHY, ZTE, ZBETADT + + TYPE (TCLI) :: YRCLI + + ! CFU + LOGICAL :: LFLASH + ! XFU + LOGICAL :: LXCLP + LOGICAL :: LXTGST + LOGICAL :: LXXGST + + LOGICAL :: L3DTURB + LOGICAL :: LAROME + LOGICAL :: LCALLSFX + LOGICAL :: LCORWAT + LOGICAL :: LELAM + LOGICAL :: LNHDYN + LOGICAL :: LSFORCS + LOGICAL :: LTWOTL + LOGICAL :: LVERTFE + INTEGER (KIND=JPIM) :: NINDAT + REAL (KIND=JPRB) :: RPLDARE + REAL (KIND=JPRB) :: RPLRG + +CONTAINS + PROCEDURE :: INIT => CPG_OPTS_TYPE_INIT +END TYPE CPG_OPTS_TYPE + +CONTAINS + + SUBROUTINE CPG_OPTS_TYPE_INIT (SELF, YDGEOMETRY, YDMODEL, YDFIELDS, CDCONF, LD_DFISTEP) + + USE YOMDYNA, ONLY : LPC_FULL, LPC_CHEAP, L3DTURB + USE YOMCT0, ONLY : LSLAG, LAROME, LCORWAT, LELAM, LSFORCS, LNHDYN, LTWOTL, LAROME, LCALLSFX + USE YOMCVER, ONLY : LVERTFE + USE YOMDYNCORE, ONLY : RPLDARE, RPLRG + USE YOMLUN, ONLY : NULOUT + USE TYPE_MODEL, ONLY : MODEL + USE YOMCT3, ONLY : NSTEP + USE FIELDS_MOD, ONLY : FIELDS + USE YOMRIP0, ONLY : NINDAT + CLASS(CPG_OPTS_TYPE) :: SELF + TYPE(MODEL) , INTENT(IN) :: YDMODEL + TYPE(GEOMETRY), INTENT(IN) :: YDGEOMETRY + TYPE(FIELDS), INTENT(IN) :: YDFIELDS + CHARACTER*1, INTENT(IN) :: CDCONF + LOGICAL, INTENT(IN) :: LD_DFISTEP + +#include "abor1.intfb.h" + + REAL(KIND=JPRB) :: ZSTATI + LOGICAL :: LLCT, LLCTC + + SELF%LFLASH = YDFIELDS%YRCFU%LFLASH + SELF%LXCLP = YDFIELDS%YRXFU%LXCLP + SELF%LXTGST = YDFIELDS%YRXFU%LXTGST + SELF%LXXGST = YDFIELDS%YRXFU%LXXGST + + SELF%L3DTURB = L3DTURB + SELF%LAROME = LAROME + SELF%LAROME = LAROME + SELF%LCALLSFX = LCALLSFX + SELF%LCORWAT = LCORWAT + SELF%LELAM = LELAM + SELF%LNHDYN = LNHDYN + SELF%LSFORCS = LSFORCS + SELF%LSFORCS = LSFORCS + SELF%LTWOTL = LTWOTL + SELF%LVERTFE = LVERTFE + SELF%NINDAT = NINDAT + SELF%RPLDARE = RPLDARE + SELF%RPLRG = RPLRG + + SELF%YRCLI = YRCLI + + SELF%L_DFISTEP = LD_DFISTEP + + LLCT =LPC_FULL.AND.(YDMODEL%YRML_DYN%YRDYN%NCURRENT_ITER > 0) + LLCTC=LPC_CHEAP.AND.(YDMODEL%YRML_DYN%YRDYN%NCURRENT_ITER > 0) + IF(NSTEP > 0) THEN + SELF%LFSTEP=.FALSE. + ELSE + SELF%LFSTEP=.TRUE. + ENDIF + + ! Physics is called in CPG + SELF%LDIAB= (YDMODEL%YRML_PHY_MF%YRPHY%LMPHYS.OR.YDMODEL%YRML_PHY_EC%YREPHY%LEPHYS) .AND. .NOT. YDMODEL%YRML_PHY_EC%YREPHY%LAGPHY .AND. (YDMODEL%YRML_DYN%YRDYN%NCURRENT_ITER == 0) + SELF%LSLPHY = YDMODEL%YRML_PHY_EC%YREPHY%LSLPHY.AND.LSLAG.AND.(.NOT.LLCTC) + ! Initial fluxes + IF (CDCONF == 'X') THEN + SELF%LFSTEP=.TRUE. + ENDIF + + IF (LSLAG .AND. ((YDMODEL%YRML_DYN%YRDYN%NCURRENT_ITER == 0).OR.(LLCT.AND.(.NOT.LLCTC))) ) THEN + SELF%LUSEPB1=.TRUE. + ELSE + SELF%LUSEPB1=.FALSE. + ENDIF + + IF (CDCONF == 'A'.OR.CDCONF == 'B') THEN + ! usual time-step + SELF%ZDT=YDMODEL%YRML_GCONF%YRRIP%TDT + SELF%ZDTPHY=YDMODEL%YRML_GCONF%YRRIP%TDT + SELF%ZTE=1.0_JPRB + SELF%ZBETADT=YDMODEL%YRML_DYN%YRDYN%BETADT + SELF%LCONFX=.FALSE. + ELSEIF (CDCONF == 'X') THEN + ! usual time-step for diagnostics but no SI scheme. + SELF%ZDT=YDMODEL%YRML_GCONF%YRRIP%TDT + SELF%ZDTPHY=YDMODEL%YRML_GCONF%YRRIP%TDT + SELF%ZTE=1.0_JPRB + SELF%ZBETADT=0.0_JPRB + SELF%LCONFX=.TRUE. + ELSE + WRITE(NULOUT,*)'*********ERROR ON CDCONF' + CALL ABOR1('CPG_DRV: ABOR1 CALLED') + ENDIF + + SELF%KLON = YDGEOMETRY%YRDIM%NPROMA + SELF%KFLEVG = YDGEOMETRY%YRDIMV%NFLEVG + SELF%KGPTOT = YDGEOMETRY%YRGEM%NGPTOT + SELF%KGPBLKS = YDGEOMETRY%YRDIM%NGPBLKS + SELF%KGPCOMP = YDGEOMETRY%YRGEM%NGPTOT_CAP + SELF%KSTEP = NSTEP + SELF%KGL1 = 1 + SELF%KGL2 = YDGEOMETRY%YRDIM%NDGENL + SELF%KTDIA = 1 + SELF%KVCLIS = YDMODEL%YRML_PHY_G%YRDPHY%NVCLIS + SELF%NDTPREC = YDMODEL%YRML_PHY_MF%YRPHY%YRDPRECIPS%NDTPREC + SELF%NDTPREC2 = YDMODEL%YRML_PHY_MF%YRPHY%YRDPRECIPS%NDTPREC2 + SELF%KTSSG = YDMODEL%YRML_PHY_G%YRDPHY%NTSSG + SELF%KGRADIENTS = YDMODEL%YRML_PHY_MF%YRARPHY%NGRADIENTS + + IF (YDMODEL%YRML_PHY_MF%YRARPHY%LMFSHAL .AND. YDMODEL%YRML_PHY_MF%YRPARAR%PHYEX%PARAM_MFSHALLN%CMF_UPDRAFT=='DUAL') THEN + SELF%KMAXDRAFT=3 + ELSE + SELF%KMAXDRAFT=0 + ENDIF + + IF (YDMODEL%YRML_PHY_MF%YRPHY%LRAY) THEN + SELF%KSW = 1 + ELSE + SELF%KSW = YDMODEL%YRML_PHY_RAD%YRERAD%NSW + ENDIF + + IF (SELF%LCONFX) THEN + ZSTATI=REAL(YDMODEL%YRML_GCONF%YRRIP%RSTATI,JPRB)-0.01_JPRB/2._JPRB + ELSE + ZSTATI=REAL(YDMODEL%YRML_GCONF%YRRIP%RSTATI,JPRB) + ENDIF + + IF (YDMODEL%YRML_PHY_MF%YRPHY%LDPRECIPS) THEN + SELF%NDTPRECCUR = INT(MOD(ZSTATI/YDMODEL%YRML_GCONF%YRRIP%TSTEP,REAL(YDMODEL%YRML_PHY_MF%YRPHY%YRDPRECIPS%NDTPREC))) +1_JPIM + ENDIF + IF (YDMODEL%YRML_PHY_MF%YRPHY%LDPRECIPS2) THEN + SELF%NDTPRECCUR2 = INT(MOD(ZSTATI/YDMODEL%YRML_GCONF%YRRIP%TSTEP,REAL(YDMODEL%YRML_PHY_MF%YRPHY%YRDPRECIPS%NDTPREC2)))+1_JPIM + ENDIF + + CALL SELF%YRSURF_OPTS%INIT (YDGEOMETRY, YDMODEL, YDFIELDS) + CALL SELF%YRSURF_DIMS%INIT (YDGEOMETRY, YDMODEL, YDFIELDS) + CALL SELF%YRVARS_DIMS%INIT (YDGEOMETRY, YDMODEL, YDFIELDS%VARIABLES) + + END SUBROUTINE CPG_OPTS_TYPE_INIT + + SUBROUTINE CPG_OPTS_SURF_TYPE_INIT (SELF, YDGEOMETRY, YDMODEL, YDFIELDS) + USE TYPE_MODEL, ONLY : MODEL + USE FIELDS_MOD, ONLY : FIELDS + CLASS(CPG_OPTS_SURF_TYPE) :: SELF + TYPE(MODEL) , INTENT(IN) :: YDMODEL + TYPE(GEOMETRY), INTENT(IN) :: YDGEOMETRY + TYPE(FIELDS), INTENT(IN) :: YDFIELDS + +#:for group in prognostic + #:for v in group.variables + #:if v.array + #:else + IF (ASSOCIATED (YDFIELDS%YRSURF%YSP_${group.short}$%Y${v.name}$)) & + & SELF%YSP_${group.short}$%Y${v.name}$%LSET = YDFIELDS%YRSURF%YSP_${group.short}$%Y${v.name}$%LSET + #:endif + #:endfor +#:endfor +#:for group in diagnostic + #:for v in group.variables + #:if v.array + #:else + IF (ASSOCIATED (YDFIELDS%YRSURF%YSD_${group.short}$%Y${v.name}$)) & + & SELF%YSD_${group.short}$%Y${v.name}$%LSET = YDFIELDS%YRSURF%YSD_${group.short}$%Y${v.name}$%LSET + #:endif + #:endfor +#:endfor + + END SUBROUTINE CPG_OPTS_SURF_TYPE_INIT + + SUBROUTINE CPG_BNDS_TYPE_INIT(SELF, YDGEOMETRY, YDMODEL, YDFIELDS) + USE TYPE_MODEL, ONLY : MODEL + USE FIELDS_MOD, ONLY : FIELDS + USE YOMCT0, ONLY : LSLAG, LTWOTL + CLASS(CPG_BNDS_TYPE) :: SELF + TYPE(MODEL) , INTENT(IN) :: YDMODEL + TYPE(GEOMETRY), INTENT(IN) :: YDGEOMETRY + TYPE(FIELDS), INTENT(IN) :: YDFIELDS + + SELF%KBL = 1 + SELF%KLON = YDGEOMETRY%YRDIM%NPROMA + SELF%KIDIA = 1 + SELF%KIDIE = 1 + SELF%KFDIA = YDGEOMETRY%YRDIM%NPROMA + SELF%KFDIE = YDGEOMETRY%YRDIM%NPROMA + SELF%KGPTOT = YDGEOMETRY%YRGEM%NGPTOT + SELF%KGPCOMP = YDGEOMETRY%YRGEM%NGPTOT_CAP + + END SUBROUTINE CPG_BNDS_TYPE_INIT + + SUBROUTINE CPG_DIMS_SURF_TYPE_INIT (SELF, YDGEOMETRY, YDMODEL, YDFIELDS) + USE TYPE_MODEL, ONLY : MODEL + USE FIELDS_MOD, ONLY : FIELDS + CLASS(CPG_DIMS_SURF_TYPE) :: SELF + TYPE(MODEL) , INTENT(IN) :: YDMODEL + TYPE(GEOMETRY), INTENT(IN) :: YDGEOMETRY + TYPE(FIELDS), INTENT(IN) :: YDFIELDS + +#:for group in prognostic + SELF%YSP_${group.short}$D = YDFIELDS%YRSURF%YSP_${group.short}$D +#:endfor +#:for group in diagnostic + SELF%YSD_${group.short}$D = YDFIELDS%YRSURF%YSD_${group.short}$D +#:endfor + + END SUBROUTINE CPG_DIMS_SURF_TYPE_INIT + + SUBROUTINE CPG_BNDS_TYPE_UPDATE(SELF, IBL) + CLASS(CPG_BNDS_TYPE) :: SELF + INTEGER(KIND=JPIM), INTENT(IN) :: IBL + + SELF%KBL = IBL + SELF%KSTGLO = 1 + (IBL - 1) * SELF%KLON + SELF%KFDIA = MIN (SELF%KLON, SELF%KGPCOMP - SELF%KSTGLO + 1) + SELF%KFDIE = MIN (SELF%KLON, SELF%KGPTOT - SELF%KSTGLO + 1) + + END SUBROUTINE CPG_BNDS_TYPE_UPDATE + + SUBROUTINE CPG_DIMS_VARS_TYPE_INIT (SELF, YDGEOMETRY, YDMODEL, YDVARS) + USE TYPE_MODEL, ONLY : MODEL + USE FIELD_VARIABLES_MOD, ONLY: FIELD_VARIABLES + USE YOMCT0, ONLY : LSLAG, LTWOTL + CLASS(CPG_DIMS_VARS_TYPE) :: SELF + TYPE(MODEL) , INTENT(IN) :: YDMODEL + TYPE(GEOMETRY), INTENT(IN) :: YDGEOMETRY + TYPE(FIELD_VARIABLES), INTENT(IN) :: YDVARS + + IF (LSLAG) THEN + + SELF%U = CPG_DIM_VAR_TYPE (0, YDGEOMETRY%YRDIMV%NFLEVG+1) + SELF%V = CPG_DIM_VAR_TYPE (0, YDGEOMETRY%YRDIMV%NFLEVG+1) + SELF%T = CPG_DIM_VAR_TYPE (0, YDGEOMETRY%YRDIMV%NFLEVG+1) + SELF%SVD = CPG_DIM_VAR_TYPE (0, YDGEOMETRY%YRDIMV%NFLEVG+1) + +#:for v in gfl.variables + #:if v.array + #:elif v.dim == 3 + IF (YDVARS%${v.name}$%LADV) THEN + SELF%${v.name}$ = CPG_DIM_VAR_TYPE (0, YDGEOMETRY%YRDIMV%NFLEVG+1) + ELSE + SELF%${v.name}$ = CPG_DIM_VAR_TYPE (1, YDGEOMETRY%YRDIMV%NFLEVG) + ENDIF + #:endif +#:endfor + + ELSE + + SELF%U = CPG_DIM_VAR_TYPE (1, YDGEOMETRY%YRDIMV%NFLEVG) + SELF%V = CPG_DIM_VAR_TYPE (1, YDGEOMETRY%YRDIMV%NFLEVG) + SELF%T = CPG_DIM_VAR_TYPE (1, YDGEOMETRY%YRDIMV%NFLEVG) + SELF%SVD = CPG_DIM_VAR_TYPE (1, YDGEOMETRY%YRDIMV%NFLEVG) + +#:for v in gfl.variables + #:if v.array + #:elif v.dim == 3 + SELF%${v.name}$ = CPG_DIM_VAR_TYPE (1, YDGEOMETRY%YRDIMV%NFLEVG) + #:endif +#:endfor + + ENDIF + + END SUBROUTINE + +END MODULE CPG_OPTS_TYPE_MOD diff --git a/src/arome/ext/namparar.nam.h b/src/arome/ext/namparar.nam.h index c3c90b342dc2fe3583071ce87a702fd86540e0af..16f9ceea77f48b8485040ae68e6df3f63d8c77e2 100644 --- a/src/arome/ext/namparar.nam.h +++ b/src/arome/ext/namparar.nam.h @@ -1,19 +1,9 @@ ! ------------------------------------------------------------------ -NAMELIST/NAMPARAR/LOSUBG_COND,CSUBG_AUCV_RC,CSUBG_AUCV_RI,LOSIGMAS,NSWB_MNH,NPRINTFR,LSQUALL,& - &NREFROI1,NREFROI2,VSQUALL,NPTP,LDIAGWMAX,NDIAGWMAX,CMICRO,CSEDIM,& - &LAROBU_ENABLE,CMF_UPDRAFT,CMF_CLOUD,LMIXUV,LLCRIT,LTOTPREC,& - <OTPRECL,LHGT_QS,LOSEDIC,& - &VSIGQSAT,XLINI,LOLSMC,LOTOWNC,LOCND2,LKOGAN,LMODICEDEP,& - &LICERAD,RFRMIN,RADGR,RADSN,LSTATNW,LHARATU,NPROMICRO,& - &XALP_PERT,XABUO,XBENTR,XBDETR,XCMF,XENTR_MF,XCRAD_MF,XENTR_DRY,& - &XDETR_DRY,XDETR_LUP,XKCF_MF,XKRC_MF,XTAUSIGMF,XPRES_UV,XFRAC_UP_MAX,& - &XALPHA_MF,XSIGMA_MF,XA1,XB,XC,XBETA1,LTHETAS,& - &CSUBG_RC_RR_ACCR,CSUBG_RR_EVAP,CSUBG_PR_PDF,RCRIAUTI,RCRIAUTC,& - &RT0CRIAUTI,LCRIAUTI,XCQVR,GQVPLIM,GQVTOP,LQVTOP,LFPREC3D, & - &XTSTEP_TS, CSNOWRIMING, XMRSTEP, NMAXITER_MICRO, & - &LFEEDBACKT,LEVLIMIT,LNULLWETG,LWETGPOST,LNULLWETH,LWETHPOST, & - &XFRACM90, LCONVHG, LCRFLIMIT, & - &CFRAC_ICE_ADJUST, XSPLIT_MAXCFL, CFRAC_ICE_SHALLOW_MF, LSEDIM_AFTER,& - &LDEPOSC, XVDEPOSC, CCONDENS, CLAMBDA3, CSUBG_MF_PDF,& - &LDEPSG,RDEPSRED,RDEPGRED +NAMELIST/NAMPARAR/NSWB_MNH,NPRINTFR,LSQUALL,& + &NREFROI1,NREFROI2,VSQUALL,NPTP,LDIAGWMAX,NDIAGWMAX,CMICRO,& + &CTURB,LAROBU_ENABLE,LLCRIT,LTOTPREC,& + <OTPRECL,& + &LOLSMC,LOTOWNC,LKOGAN,LMODICEDEP,& + &LICERAD,RADGR,RADSN,& + &XCQVR,GQVPLIM,GQVTOP,LQVTOP,LFPREC3D ! ------------------------------------------------------------------ diff --git a/src/arome/ext/su0yomb.F90 b/src/arome/ext/su0yomb.F90 new file mode 100644 index 0000000000000000000000000000000000000000..ce54f09d5079a427a5feb4c7e85168e16aa02993 --- /dev/null +++ b/src/arome/ext/su0yomb.F90 @@ -0,0 +1,1059 @@ +SUBROUTINE SU0YOMB(YDFPOS,YDGEOMETRY,YDFIELDS,YDMTRAJ,YDMODEL,YDJOT,YDVARBC,YDTCV,YDTCV_BGC,YDODB) + +!**** *SU0YOMB* - INITIALIZE LEVEL 0 COMMONS AND SOME HIGHER (PART 2) + +! PURPOSE. +! -------- +! INITIALIZE LEVEL 0 COMMONS (CONSTANT ALONG ALL THE JOB) +! AND SOME HIGHER LEVEL COMMONS. CALLS ROUTINES THAT PERFORM +! ALL THE PREPARATIONS NEEDED TO EXECUTE MODEL. THE TASK OF +! INITIALIZING THE COMMONS IS DIVIDED BETWEEN TWO ROUTINES +! (SU0YOMA AND SU0YOMB) TO AVOID PROBLEMS WITH USING POINTER +! ARRAYS WHOSE DIMENSIONS ARE NOT DEFINED UNTIL AFTER CALLING SUDIM. + +! ky: some constraints to be known for future code reorganisation (this list is not comprehensive): +! - SUPPVI does not depend on geometry and could be called earlier in the set-up (somewhere in SU0YOMA) +! - SUPP must be called after SUGFL and partly uses horizontal geometry. +! - SUIOS does not depend on geometry and could be called earlier in the set-up (somewhere in SU0YOMA) +! - SUPTRTC does not depend on geometry. +! - SUDFI could probably be called earlier; requires to know TSTEP. +! - SUSPNG could be called inside SUDYN, like calls to SU(E)HDF and SURAYFRIC (diffusive processes). +! - SUVAREPS must be called before SUGRIB. + +! INTERFACE. +! ---------- +! *CALL* *SU0YOMB* + +! EXPLICIT ARGUMENTS +! -------------------- +! NONE + +! IMPLICIT ARGUMENTS +! -------------------- +! NONE + +! METHOD. +! ------- +! SEE DOCUMENTATION + +! EXTERNALS. +! ---------- +! see below + +! REFERENCE. +! ---------- +! ECMWF Research Department documentation of the IFS + +! AUTHOR. +! ------- +! MATS HAMRUD AND PHILIPPE COURTIER *ECMWF* +! ORIGINAL : 87-10-15 + +! MODIFICATIONS. +! -------------- +! R. El Khatib : 31-Aug-2007 Initialise uninitialised variable +! B. Strajnar : 06-02-08 Allow call to SUINFCE for LSPFCE=.F. +! B. Chapnik : 15-06-08 Add setup of Jk modulation wrt/ level and parameter +! R. El Khatib : 24-Oct-2008 Merge sueoph and suoph +! K. Yessad : 09-09-08 No recalc of Gaussian lat and weights in SUDIL +! K. Yessad : 15-09-08 Prune conf 951. +! A. Deckmyn : 01-10-08 LAM wavelets +! P. Termonia : 22-12-08 move the call to SUDFI here (from SUINI) +! A. Dethof : 17-11-08 LOG NOX JB +! K. Yessad (Aug 2009): add call to SUPPVI. +! K. Yessad (Aug 2009): prune conf 912, externalise conf 911. +! K.Yessad (Feb 2010): use YM_RADTC and RFORADTC +! R. El Khatib 13-Jul-2010 Move surfex allocations below suphmse +! R. El Khatib 13-Jul-2010 Move surfex allocations below suphmse +! K. Yessad (Sep 2010): organigramme simplification. +! K. Yessad (Jan 2011): new architecture for LBC modules and set-up. +! P. Marguinaud 01-Jan-2011 IO server setup (send parameters with MPI) +! G. Kerdraon : Feb 2011 Call SU_GRIB_API if NOT LELAM +! K. Yessad (jul 2011): reorder calculations in order to use new structures in LAM models. +! T.Wilhelmsson (Aug 2011) SUSC2B => SUSC2B + SUSC2C +! M. Fisher 7-March-2012 Move Jb setup here (from SU0YOMA) +! K. Yessad (dec 2011): various contributions. +! R. El Khatib 09-Mar-2012 : Unconditional call to sualdyn_ddh +! R. El Khatib 23-Mar-2012 : Fix bounds checking issue +! B. Bochenek (Apr 2012): call to SUNDDH moved from SU0YOMA +! R. El Khatib 26-Jul-2012 : SUVV1 (previously part of SUVERT) +! + SUFPG (previously part of SUBFPOS) +! M.Fisher 15-Feb-2013 Introduce CVA_STRUCT, SCALP_STRUCT, CVA_DATA +! K. Yessad (july 2013): various modifications for geometry set-up. +! T. Wilhelmsson and K. Yessad (Oct 2013) Geometry and setup refactoring. +! D. Degrauwe, 2013-11 : Setup of flexible interface (INTFLEX). +! R. El Khatib 04-Jul-2014 call sualspa1 before sualspa to facilitate the +! subsequent allocation of the spectral structure by alloc_spec +! K. Yessad (july 2014): some reorganisation in set-up. +! R. El Khatib 04-Aug-2014 Pruning of the conf. 927/928 +! P. Marguinaud 10-Oct-2014 Add LGRIB_API +! R. El Khatib : 03-Dec-2014 skeleton of the configuration 903 +! A. Geer 27-Jul-2015 VarBC is now an object, for OOPS +! P. Lopez Dec 2015 Skip Jb allocations for configuration 501 (TL test). +! M. Leutbecher & S.-J. Lock (Jan 2016) Introduced SPP scheme (LSPP) +! SJ Lock : Jan-2016 Cleaning SPPT routines +! R. El Khatib 17-Aug-2016 move suoph up to su0yoma +! O.Marsden Aug 2016 Removed use of SPA3 +! K. Yessad (Dec 2016): Prune obsolete options. +! B.Bochenek(Feb 2017): Fix for 601 - CALL SUSPSDT before SUSCAL/SUESCAL +! B.Bochenek(Feb 2017): Temporary fix for AROME in ALLOCATE_SPEC +! J. Hawkes 22-Nov-2017 Initialize part of wave model for IO server +! Y. Michel, MF, June 2018 Extension of the control variable for sqrt EnVar +! S. Massart 19-Feb-2019 Augmented control variable +! Y. Michel, MF, Mar 2019 Extention of the control variable for sqrt EnVar +! C. Lupu 29-Mar-2019 Allow call to SUINSKTE +! R. El Khatib 20-Sep-2021 Manage dependency between post-processor and surface fields objects +! L. Descamps, MF, Feb 2020 : Add a call to random parameters scheme for PEARP +! R. El Khatib 18-Jul-2022 LAPL_ARPEGE in YRPHY +! ------------------------------------------------------------------ + +USE TYPE_MODEL , ONLY : MODEL +USE GEOMETRY_MOD , ONLY : GEOMETRY +USE VARIABLES_MOD , ONLY : VARIABLES, VARIABLES_CREATE, VARIABLES_DELETE +USE FIELDS_MOD , ONLY : FIELDS, FIELDS_CREATE, FIELDS_DELETE, FIELDS_CONTAIN +USE MTRAJ_MOD , ONLY : MTRAJ +USE PARKIND1 , ONLY : JPIM, JPRB +USE YOMHOOK , ONLY : LHOOK, DR_HOOK +USE YOMLUN , ONLY : NULOUT +USE JO_TABLE_MOD , ONLY : JO_TABLE +USE YOMCT0 , ONLY : LR2D ,NCONF, LBACKG, LSPBSBAL, LELAM,LARPEGEF,& + & LOBS, LOBSC1, LSCREEN, LIFSTRAJ, LIFSMIN, NFPOS,& + & NFRCO, LGRIB_API +USE YOMARG , ONLY : NGRIBFILE +USE YOMVAR , ONLY : LMODERR , LVARBC, LJCDFI, LMONITOR_FCDEPAR,LBACKGERENORM, LACV,LENSCV +USE ALGORITHM_STATE_MOD , ONLY : GET_NUPTRA +USE YOMJG , ONLY : JB_STRUCT +USE YOMJQ , ONLY : LSTATMERR +USE YOMLCZ , ONLY : L_SUBSPACE_SVS, LFORCEWR +USE YOMCVA , ONLY : CVA_STRUCT, SCALP_STRUCT, CVA_DATA +USE YOMSKTER , ONLY : YGSKTER +USE TRAJECTORY_MOD , ONLY : LTRAJRESET, LTRAJHR, ALLOCATE_TRAJECTORY,& + & READ_TRAJECTORY, GET_TRAJ_GRID, LREADGPTRAJ, LTRAJHR_ALTI +USE YOMGWDIAG , ONLY : SETUP_GWDIAG +USE YEMJK , ONLY : LEJK +USE YOMINI , ONLY : LDFI +USE YOMSPSDT , ONLY : YSPPT_CONFIG, YSPPT +USE YOE_CUCONVCA , ONLY : INI_CUCONVCA +USE MODULE_RADTC_MIX, ONLY : YM_RADTC ,SUPTRTC +USE YEMLBC_MODEL , ONLY : SUELBC_MODEL +USE YEMLBC_FIELDS , ONLY : SUELBC_FIELDS +USE YOMIO_SERV , ONLY : IO_SERV_C001 +USE YOM_GRIB_CODES , ONLY : NGRBNOXLOG +USE SPNG_MOD , ONLY : SUSPNG +USE YOMTRAJ , ONLY : LTRAJALLOC, TRAJEC +USE YOMMP0 , ONLY : NPROC +USE TESTVAR_MIX , ONLY : SETUP_TESTVAR +USE SPP_MOD , ONLY : YSPP_CONFIG, YSPP +USE VARBC_CLASS , ONLY : CLASS_VARBC +USE TOVSCV_MOD , ONLY : TOVSCV,CREATE_TOVSCV +USE TOVSCV_BGC_MOD , ONLY : TOVSCV_BGC,CREATE_TOVSCV_BGC +USE YOMSPJB , ONLY : BACKGROUND, ALLOCATE_JB_REF_STATE +USE YOMJBACV , ONLY : LJB_HYBRID_ACV, LPAROPTIACV, READ_FG_ACV +USE YOMJBPAR1DACV , ONLY : SUPARACVMIN +USE MPL_MODULE , ONLY : MPL_END, MPL_BARRIER +USE IOSTREAM_MIX , ONLY : IOSTREAM_STATS,YGBH +USE DBASE_MOD , ONLY : DBASE +USE FULLPOS , ONLY : TFPOS +USE YOMCFU , ONLY : TCFU_KEYS +USE YOMXFU , ONLY : TXFU_KEYS +USE YOMFP_SERV, ONLY : FP_SERV_C001 +USE CONTROL_VECTORS_MOD +USE SPECTRAL_FIELDS_MOD + + + +!This line should be removed, see comment before AROINI_BUDGET call +USE MODD_BUDGET, ONLY : TBUCONF + +! ------------------------------------------------------------------ + +IMPLICIT NONE + +TYPE(TFPOS), INTENT(OUT) :: YDFPOS +TYPE(GEOMETRY), INTENT(INOUT) :: YDGEOMETRY +TYPE(FIELDS), INTENT(INOUT) :: YDFIELDS +TYPE(MTRAJ), INTENT(INOUT) :: YDMTRAJ +TYPE(MODEL), INTENT(INOUT) :: YDMODEL +TYPE(JO_TABLE), INTENT(INOUT) :: YDJOT +TYPE(CLASS_VARBC), INTENT(INOUT) :: YDVARBC +TYPE(TOVSCV), INTENT(INOUT) :: YDTCV +TYPE(TOVSCV_BGC), INTENT(INOUT) :: YDTCV_BGC +CLASS(DBASE), INTENT(OUT) :: YDODB + +CHARACTER (LEN = 35) :: CLINE +CHARACTER(LEN=40) :: CLFILE +CHARACTER (LEN=3) :: CLMAX + +INTEGER(KIND=JPIM) :: ICONF + +LOGICAL :: LLDIMO, LL_ALLOC_RLANBUF + +INTEGER(KIND=JPIM) :: JGFL, ISTEP, JSTGLO, ICEND, IBL, ISIZEG, IWINLEN, IVCLIX, IPPEDR +INTEGER(KIND=JPIM) :: IGRIB(YDMODEL%YRML_GCONF%YRDIMF%NS3D+YDMODEL%YRML_GCONF%YRDIMF%NS2D) +LOGICAL :: LLASTRAJ +REAL(KIND=JPRB), ALLOCATABLE :: ZGMV5(:,:,:,:) +REAL(KIND=JPRB), ALLOCATABLE :: ZGMV5S(:,:,:) +REAL(KIND=JPRB), ALLOCATABLE :: ZGFL5(:,:,:,:) + +TYPE(TCFU_KEYS) :: YLCFU_KEYS +TYPE(TXFU_KEYS) :: YLXFU_KEYS +TYPE(CONTROL_VECTOR) :: YLTEMP +TYPE(VARIABLES) :: YL_VARS, YNLVARS +TYPE(FIELDS) :: YL_TRAJ, YLINFCE +!!$CHARACTER(LEN=9) :: CLCONF + +REAL(KIND=JPRB) :: ZHOOK_HANDLE +! ------------------------------------------------------------------ + +#include "get_spp_conf.intfb.h" +#include "gstats_output_ifs.intfb.h" +#include "ini_spp.intfb.h" +#include "inifger.intfb.h" +#include "sualcan.intfb.h" +#include "sualcos.intfb.h" +#include "sualctv.intfb.h" +#include "sualctv_ens.intfb.h" +#include "sualdyn_ddh.intfb.h" +#include "sualgco.intfb.h" +#include "sualges.intfb.h" +#include "suallt.intfb.h" +#include "sualmdh.intfb.h" +#include "suspvariables.intfb.h" +#include "sualspa.intfb.h" +#include "sualnud.intfb.h" +#include "suanebuf.intfb.h" +#include "sualtdh.intfb.h" +#include "subfpos.intfb.h" +#include "sufpcfu.intfb.h" +#include "sufpxfu.intfb.h" +#include "sufpsurf.intfb.h" +#include "sumts.intfb.h" +#include "mts_rtsetup.intfb.h" +#include "sucfu.intfb.h" +#include "sudfi.intfb.h" +#include "sudimo.intfb.h" +#include "sudyn.intfb.h" +#include "suecges.intfb.h" +#include "suejbbal.intfb.h" +#include "suejbcov.intfb.h" +#include "suejk.intfb.h" +#include "suejknorm.intfb.h" +#include "suelges.intfb.h" +#include "suelljk.intfb.h" +#include "suemodjk.intfb.h" +#include "suescal.intfb.h" +#include "suevargp.intfb.h" +#include "sugrib.intfb.h" +#include "su_grib_api.intfb.h" +#include "suiau.intfb.h" +#include "sunudglh.intfb.h" +#include "suinfce.intfb.h" +#include "suinskte.intfb.h" +#include "sueinfce.intfb.h" +#include "suensdim.intfb.h" +#include "suenscov.intfb.h" +#include "sufw.intfb.h" +#include "suios.intfb.h" +#include "suiostream.intfb.h" +#include "sujb.intfb.h" +#include "sujbbal.intfb.h" +#include "sujbcov.intfb.h" +#include "sujbwavelet0.intfb.h" +#include "sujbwavelet.intfb.h" +#include "sujbwavelet_stdevs.intfb.h" +#include "sujbwavrenorm.intfb.h" +#include "sujbwavstats.intfb.h" +#include "sujbwavtrans.intfb.h" +#include "sujq.intfb.h" +#include "sujbchvar.intfb.h" +#include "sulcz.intfb.h" +#include "sulsforc.intfb.h" +#include "sumcclag.intfb.h" +#include "sumddh.intfb.h" +#include "sumoderr.intfb.h" +#include "sunddh.intfb.h" +#include "suphy.intfb.h" +#include "supp.intfb.h" +#include "surand1.intfb.h" +#include "sures.intfb.h" +#include "surlx.intfb.h" +#include "susc2b.intfb.h" +#include "susc2c.intfb.h" +#include "suscal.intfb.h" +#include "susimpr.intfb.h" +#include "suspsdt.intfb.h" +#include "suvareps.intfb.h" +#include "suxfu.intfb.h" +#include "su_subspace.intfb.h" +#include "sumcuf.intfb.h" +#include "suoaf.intfb.h" +#include "sualobs.intfb.h" +#include "suejbwavelet.intfb.h" +#include "suejbwavelet_bmatrix.intfb.h" +#include "io_serv_suiosctmpl.intfb.h" +#include "allocate_empty_trajectory.intfb.h" +#include "suintflex.intfb.h" +#include "suallr.intfb.h" +#include "fp_serv_suiosctmpl.intfb.h" +#include "fp_serv_cpfpfilter.intfb.h" +#include "setjbhybacv.intfb.h" +#include "suapl_arpege.intfb.h" +#include "supertpar.intfb.h" +#include "su_surf_flds.intfb.h" +!!$#include "transinvh.intfb.h" +!!$#include "suinif.intfb.h" + + + +!This line should be removed, see comment before AROINI_BUDGET call +#include "aroini_budget.h" + +! ------------------------------------------------------------------ + +IF (LHOOK) CALL DR_HOOK('SU0YOMB',0,ZHOOK_HANDLE) +ASSOCIATE(YDGFL5=>YDMTRAJ%YRGFL5,YDGMV5=>YDMTRAJ%YRGMV5, YDGFL=>YDFIELDS%YRGFL,YDGMV=>YDFIELDS%YRGMV, & + & YDSURF=>YDFIELDS%YRSURF, & + & YDDIM=>YDGEOMETRY%YRDIM, YDDIMV=>YDGEOMETRY%YRDIMV, YDGEM=>YDGEOMETRY%YRGEM, YDMP=>YDGEOMETRY%YRMP, & + & YDLAP=>YDGEOMETRY%YRLAP, YDSTA=>YDGEOMETRY%YRSTA, YDVAB=>YDGEOMETRY%YRVAB, & + & YDSIMPHL=>YDMODEL%YRML_PHY_MF%YRSIMPHL,YDLDDH=>YDMODEL%YRML_DIAG%YRLDDH, YDML_LBC=>YDMODEL%YRML_LBC, & + & YDEWCOU=>YDMODEL%YREWCOU, & + & YDRCOEF=>YDMODEL%YRML_PHY_RAD%YRRCOEF,YGFL=>YDMODEL%YRML_GCONF%YGFL,YDDIMF=>YDMODEL%YRML_GCONF%YRDIMF) + +ASSOCIATE(NCHEM_ASSIM=>YGFL%NCHEM_ASSIM, NDIM5=>YGFL%NDIM5, YCOMP=>YGFL%YCOMP, & + & NCMAX=>YDDIM%NCMAX, NGPBLKS=>YDDIM%NGPBLKS, NMSMAX=>YDDIM%NMSMAX, & + & NPROMA=>YDDIM%NPROMA, NRESOL=>YDDIM%NRESOL, NSMAX=>YDDIM%NSMAX, & + & NUMP=>YDDIM%NUMP, & + & NS2D=>YDDIMF%NS2D, NS3D=>YDDIMF%NS3D, & + & NFLEVG=>YDDIMV%NFLEVG, NFLEVL=>YDDIMV%NFLEVL, & + & NGPTOT=>YDGEM%NGPTOT, RSTRET=>YDGEM%RSTRET, & + & YT5=>YDGMV5%YT5, & + & MYMS=>YDLAP%MYMS, & + & LSDDH=>YDLDDH%LSDDH, & + & NALLMS=>YDMP%NALLMS, NPTRLL=>YDMP%NPTRLL, NPTRMS=>YDMP%NPTRMS, & + & NUMLL=>YDMP%NUMLL, NPSURF=>YDMP%NPSURF, & + & LWCOU=>YDEWCOU%LWCOU, & + & LRCOEF=>YDRCOEF%LRCOEF, & + & LRAYSP=>YDSIMPHL%LRAYSP) +! ------------------------------------------------------------------ +CALL GSTATS(39,0) +CLINE='----------------------------------' + +ICONF=NCONF/100 + +!* Initialize post-processing +WRITE(NULOUT,*) '---- Set up post-processing ---------',CLINE +CALL SUPP(YGFL,YDMODEL%YRML_PHY_MF%YRPHY,YDMODEL%YRML_PHY_RAD%YREAERATM) + +!* Initialize I/O-scheme +WRITE(NULOUT,*) '---- Set up I/O scheme --------------',CLINE +CALL SUIOS + +!* Initialize Aladin Jk handling +IF (LELAM.AND.(ICONF == 1)) THEN + WRITE(NULOUT,*) '---- Set up Aladin Jk handling -',CLINE + CALL SUEJK +ELSE + LEJK=.FALSE. +ENDIF + +IF (LBACKG .OR. LOBSC1 .OR. NCONF == 401 .OR. NCONF == 501 .OR. NCONF == 601 .OR. NCONF == 801 .OR. NCONF == 701) THEN + + IF (.NOT.LR2D) THEN + WRITE(NULOUT,*) '------ Set up Jb parameters ------------',CLINE + ALLOCATE(JB_STRUCT) + ALLOCATE(CVA_DATA) + CALL SUJB(YDGEOMETRY,YDMODEL%YRML_GCONF%YRDIMACV,YGFL,JB_STRUCT,CVA_DATA) + ENDIF +ENDIF + +WRITE(NULOUT,*) ' LIFSMIN = ', LIFSMIN +IF(ASSOCIATED(JB_STRUCT)) THEN + LLDIMO=.NOT. JB_STRUCT%WJBCONF%LJBWSTATS .OR. .NOT. LIFSMIN + WRITE(NULOUT,*) ' JB_STRUCT%WJBCONF%LJBWAVSTATS = ', JB_STRUCT%WJBCONF%LJBWSTATS +ELSE + LLDIMO=.NOT. LIFSMIN +ENDIF + +IF (LLDIMO) THEN ! OBSERVATION SETUP CAN BE SKIPPED WHEN COMPUTING JB + WRITE(NULOUT,*) '---- Initialize dimensions for obs. processing...' + + ! Initialize dimensions for obs. processing, Jo and Jg related arrays + + IWINLEN = YDMODEL%YRML_GCONF%YRRIP%NSTOP*YDMODEL%YRML_GCONF%YRRIP%TSTEP + CALL SUDIMO(YDGEOMETRY,IWINLEN,NULOUT,YDODB) + + ! Setup observation array format + IF (LOBS) THEN + WRITE(NULOUT,*) '------ Set up observation format ---',CLINE + CALL SUOAF + CALL SUALOBS ! was originally in ./ifs/setup/suallo.F90 + ENDIF + + ! Set up for variational bias correction. For now, do not allow + ! any other parameters to be part of the control vector. + IF(ASSOCIATED(CVA_DATA)) CVA_DATA%NVAPARAM=0 + IF (LOBS .AND. LVARBC) THEN + IF (IABS(NCONF/100)==1) THEN + IF (.NOT.ASSOCIATED(CVA_DATA)) CALL ABOR1('CVA_DATA has not been set up') + CALL YDVARBC%SETUP_MIN(CVA_DATA%NVAPARAM) + ENDIF + ENDIF + IF (LOBS) THEN + IF (IABS(NCONF/100)==1) THEN + CALL CREATE_TOVSCV(YDTCV) + CALL CREATE_TOVSCV_BGC(YDTCV_BGC) + ENDIF + ENDIF +ENDIF + +!* Allocate spectral arrays +WRITE(NULOUT,*) '-- Set up spectral arrays allocation-',CLINE +CALL SUSPVARIABLES(YDMODEL%YRML_GCONF) +IF(NCONF /= 901.AND.NCONF /= 923) THEN + IGRIB(1:NS3D)=YDMODEL%YRML_GCONF%YRDIMF%NGRBSP3(:) + IGRIB(NS3D+1:NS3D+NS2D)=YDMODEL%YRML_GCONF%YRDIMF%NGRBSP2(:) + WRITE(NULOUT,*)'-- Calling ALLOCATE_SPEC ',IGRIB(1:NS3D+NS2D) + CALL ALLOCATE_SPEC(YDFIELDS%YRSPEC, NFLEVL, NFLEVG, NUMP, MYMS, NSMAX, NMSMAX, NALLMS,& + & NPTRMS, NUMLL, NPTRLL, NPSURF, NS3D, NS2D, IGRIB) + CALL SUALSPA(YDGEOMETRY) +ELSE + WRITE(NULOUT,*) 'SU0YOMB: No call for SUALSPA1' +ENDIF + +!* Allocate nudging arrays +WRITE(NULOUT,*) '-- Set up nudging arrays allocation-',CLINE +CALL SUALNUD(YDGEOMETRY,YGFL) + +IF ( NCONF == 701 ) THEN + CALL SUALCOS(YDGEOMETRY,YDDIMF) + CALL SUALGES(YDGEOMETRY,JB_STRUCT,CVA_DATA) + IF (LELAM) CALL SUELGES(YDGEOMETRY,JB_STRUCT) +ENDIF + +!* Initialize Jb + +SETUP_JB: IF (LBACKG .OR. LOBSC1 .OR. NCONF == 401 .OR. NCONF == 501 .OR. NCONF == 601 .OR. NCONF == 801) THEN + +! Setup cost function arrays + WRITE(NULOUT,*) '------ Set up cost functions -----------',CLINE + CALL SUALCOS(YDGEOMETRY,YDDIMF) + +! Allocate Jb spectral arrays + + WRITE(NULOUT,*) '------ Allocate Jb spectral arrays -----',CLINE + IF (NCONF==131 .OR. NCONF/100==4 .OR. NCONF/100==5 .OR. NCONF/100==6 .OR. NCONF/100==8 .OR.& + & (LTRAJHR .AND. LIFSTRAJ)) THEN + ALLOCATE(BACKGROUND) + ENDIF + CALL ALLOCATE_SPEC(JB_STRUCT%JB_DATA%SPJB, YDGEOMETRY, JB_STRUCT%CONFIG%SPVARS) + IF(NCONF == 801)CALL SUALLR(YDGEOMETRY,JB_STRUCT) + +! Setup dimensioning for wavelet Jb + WRITE(NULOUT,*) '------ Setup Wavelet Jb dimensioning ---',CLINE +IF (ASSOCIATED(JB_STRUCT)) THEN + IF (JB_STRUCT%WJBCONF%LJBWAVELET) THEN + IF (LELAM) THEN + WRITE(NULOUT,*) '-- Setup Aladin wavelet Jb: preliminaries' + WRITE(NULOUT,*) '(I have to do this before getting to the Control Vector setup!)' + CALL SUEJBWAVELET(YDDIMV,JB_STRUCT) + JB_STRUCT%WJBCONF%N_WAVELET_SCALES=0 ! We don't use it, so for safety, set it to 0 + ELSE + WRITE(NULOUT,*) '-- Setup spectral filters for wavelet Jb' + CALL SUJBWAVELET0(YDDIM,JB_STRUCT,CDFILE='wavelet.cv') + WRITE(NULOUT,*) '-- Define multiple-resolution transforms for wavelet Jb' + CALL SUJBWAVTRANS(YDDIM,JB_STRUCT) + ENDIF + ELSE + JB_STRUCT%WJBCONF%N_WAVELET_SCALES=0 + ENDIF +ENDIF + + WRITE(NULOUT,*) '------- Allocate Jb arrays ----------',CLINE + CALL SUALGES(YDGEOMETRY,JB_STRUCT,CVA_DATA) + IF (LELAM) CALL SUELGES(YDGEOMETRY,JB_STRUCT) + +!* Initialize gridpoint buffers for analysis errors + IF (NCONF /= 901) THEN + WRITE(NULOUT,*) '---- Set up gridpoint buffers for analysis errors ---',CLINE + CALL SUANEBUF(YDGEOMETRY,YGFL,JB_STRUCT) + ENDIF +ENDIF SETUP_JB + +! Define pointers for transmission coefficients (simp. radiation). +WRITE(NULOUT,*) '-- Set up pointers for transmission coefficients-',CLINE +IF (LRCOEF) THEN + CALL SUPTRTC(.TRUE.,YM_RADTC) +ELSE + CALL SUPTRTC(.FALSE.,YM_RADTC) +ENDIF + +!* Initialize geometry parameters for gridpoint +! error standard deviations in Aladin C+I zone (YEMVARGP) +IF (LELAM) THEN + WRITE(NULOUT,*) '---- Set up Aladin geometry: YEMVARGP -',CLINE + IF (ICONF == 1) CALL SUEVARGP(YDGEOMETRY) +ENDIF + +!* Set up DFI (we need geometry for SSDFI) +IF (LDFI .OR. LJCDFI) THEN + WRITE(NULOUT,*) '---- Set up DFI: SUDFI -----',CLINE + CALL SUDFI(YDMODEL%YRML_PHY_EC%YREPHY,YDMODEL%YRML_GCONF%YRRIP,YDMODEL%YRML_PHY_MF%YRPHY) +ENDIF + +!* Allocate OI CANARI grid points arrays +IF(ICONF == 7) THEN + WRITE(NULOUT,*) '------- Allocate CANARI arrays ----',CLINE + CALL SUALCAN(YDGEOMETRY) +ENDIF + +!* Allocate YOMGCO arrays. +IF(NFRCO /= 0) THEN + WRITE(NULOUT,*) '---- Allocate YOMGCO arrays --------',CLINE + CALL SUALGCO(YDGEM,YDMODEL%YRML_PHY_G%YRDPHY) +ENDIF + +!* Setup TESTVAR. +WRITE(NULOUT,*) '---- Set up TESTVAR ----------',CLINE +CALL SETUP_TESTVAR(YDMODEL%YRML_GCONF%YRRIP) + +! Initialize model: + +!* Initialize Dynamics +WRITE(NULOUT,*) '---- Set up model dynamics ----------',CLINE +CALL SUDYN(YDGEOMETRY,YDMODEL,NULOUT) + +!* Initialize Relaxation +WRITE(NULOUT,*) '------ Set up Relaxation ',CLINE +CALL SURLX(YDDIM,YDDIMV,YDMODEL%YRML_GCONF%YRRIP,NULOUT) + +!* Initialize new sponge +WRITE(NULOUT,*) '---- Set up new sponge ----------',CLINE +CALL SUSPNG(YDMODEL%YRML_DYN%YRSPNG,YDMODEL%YRML_GCONF%YRRIP,YDDIMV%NFLEVG,YDSTA%STZ) + +!* Initialize control of DFI: SUFW +IF (LDFI .OR. LJCDFI ) THEN + WRITE(NULOUT,*) '---- Set up DFI initialization: SUFW ',CLINE + CALL SUFW(YDLAP,YDDIM,YDGEOMETRY%YREGEO,YDGEOMETRY%YRELAP) +ENDIF + +!* Initialize Large Scale Forcings +WRITE(NULOUT,*) '---- Set up large scale forcings ----------',CLINE +CALL SULSFORC(YDMODEL%YRML_GCONF,NULOUT) + + +IF (.NOT.LR2D) THEN + !* Initialize Physics + WRITE(NULOUT,*) '---- Set up model physics -----------',CLINE + CALL SUPHY(YDGEOMETRY,YDMODEL,NULOUT) + +! Fields for physics + CALL YDFIELDS%YEC_PHYS_FIELDS%CREATE(YDGEOMETRY,YDMODEL%YRML_PHY_G%YRDPHY) + + !* Initialize special keys for the climate version 2nd part + WRITE(NULOUT,*) '---- Set up MCC climate model keys (lagged part) --',CLINE + CALL SUMCCLAG(YDGEM,YDMODEL%YRML_GCONF,YDMODEL%YRML_AOC,YDMODEL%YRML_CHEM%YRCOMPO, & + & YDMODEL%YRML_CHEM%YRCHEM, YDMODEL%YRML_PHY_EC%YREPHY, NULOUT, YDSURF=YDSURF) +ENDIF + +!* Initialize variables for VAREPS (NB: must be called before SUGRIB) +WRITE(NULOUT,*) '- Set up VAREPS configuration',CLINE +CALL SUVAREPS(YDMODEL%YRML_GCONF%YRRIP) + +!* Initialize filter for monitoring the coupling updates +WRITE(NULOUT,*) '------ Set up monitoring coupling-updates',CLINE +CALL SUMCUF(YDFIELDS%YMCUF,YDDIM,YDMODEL%YRML_GCONF%YRRIP) + +!* Initialise restart mechanism +WRITE(NULOUT,*) '---- Set up restart mechanism ------',CLINE +CALL SURES(YDMODEL%YRML_GCONF%YRRIP,NULOUT) + +!* Initialize buffers for gridpoint scanning, part B +IF (NCONF /= 901 .AND. NCONF /= 903) THEN + WRITE(NULOUT,*) '---- Set up gridpoint scanning, part B ----',CLINE + CALL SUSC2B(YDGEOMETRY,YDMODEL) +ENDIF + +!* Initialize IAU handling +WRITE(NULOUT,*) '---- Set up IAU handling -',CLINE +CALL SUIAU(YDMODEL%YRML_GCONF%YRRIP) + +!* Initialize NUDGLH handling +WRITE(NULOUT,*) '---- Set up NUDGLH handling -',CLINE +CALL SUNUDGLH(YDMODEL%YRML_GCONF%YRRIP) + +!* Initialize GRIB coding parameters +WRITE(NULOUT,*) '---- Set up files : GRIB parameters -',CLINE +CALL SUGRIB(YDDIM,YDMODEL%YRML_PHY_EC%YREPHY,YDMODEL%YRML_PHY_G%YRDPHY,YDMODEL%YRML_PHY_MF%YRPHY) + +!* Full Post-processing (2nd part) +IPPEDR=0 +IVCLIX=0 +IF (NFPOS /= 0) THEN + + WRITE(NULOUT,*) '- Set up F-post processing, bundled part',CLINE + CALL SUBFPOS(YDFPOS,YDGEOMETRY,YDMODEL,NFPOS) + CALL SUFPCFU(YDFPOS,YLCFU_KEYS) + CALL SUFPXFU(YDFPOS,YLXFU_KEYS) + CALL SUFPSURF(YDFPOS,IPPEDR,IVCLIX) + + ! Setup RTTOV for simulated satellite images + CALL SUMTS(YDMODEL%YRML_GCONF,YDFPOS) + CALL MTS_RTSETUP + + !* Initialize GRIB API templates from Fullpos geometry + IF (NGRIBFILE==1 .OR..NOT.LARPEGEF) THEN + IF (LGRIB_API) THEN + WRITE(NULOUT,'('' == Full-Pos constructor : setup GRIB API templates == '')') + CALL SU_GRIB_API(YDGEOMETRY,YDFPOS%YFPVAB,YDMODEL%YRML_AOC%YRMCC%LMCC04,YGBH, & + & YDFPUSERGEO=YDFPOS%YFPGEOMETRY%YFPUSERGEO(1)) + ELSE + WRITE(NULOUT,'(''Call to SU_GRIB_API switched off'')') + ENDIF + ENDIF + + !* Initialize the I/O server for Fullpos + WRITE(NULOUT,'('' == Full-Pos constructor : setup io server file templates == '')') + CALL IO_SERV_SUIOSCTMPL(IO_SERV_C001, YDGEOMETRY=YDGEOMETRY,PTSTEP=YDMODEL%YRML_GCONF%YRRIP%TSTEP, & + & YDEWCOU=YDMODEL%YREWCOU,YDFPGEOMETRY=YDFPOS%YFPGEOMETRY,YDFPOPH=YDFPOS%YFPIOH%YFPOPH) + + !* Initialize Fullpos server + ! Perhaps the client don't need to construct YDFPOS (possibly apart from YFPFILTERS) ? + IF (FP_SERV_C001%LFP_CLIENT .OR. FP_SERV_C001%LFP_SERVER) THEN + CALL FP_SERV_SUIOSCTMPL (FP_SERV_C001, YDGEOMETRY) + IF (FP_SERV_C001%LFP_SERVER_FPMTS) THEN + IF (.NOT. LELAM) CALL FP_SERV_CPFPFILTER (FP_SERV_C001, YDGEOMETRY, YDFPOS%YFPFILTERS) + ENDIF + ENDIF + +ELSE + !* GRIB API + IF (LGRIB_API) THEN + WRITE(NULOUT,*) '- Set up GRIB API usage',CLINE + CALL SU_GRIB_API(YDGEOMETRY,YDGEOMETRY%YRVAB,YDMODEL%YRML_AOC%YRMCC%LMCC04,YGBH) + ELSE + WRITE(NULOUT,*) 'Call to SU_GRIB_API switched off',CLINE + ENDIF + +ENDIF +IF (IPPEDR==1 .AND. YDMODEL%YRML_GCONF%YRRIP%NSTOP==0) THEN + IPPEDR=2 ! to read the model field of EDR in input +ENDIF + +CALL VARIABLES_CREATE(YNLVARS, .FALSE.) +!* Set up for surface grid-point fields +WRITE(NULOUT,*) '---- Set up for surface grid-point fields ----',CLINE +CALL SU_SURF_FLDS(YDGEOMETRY%YRDIMV,YDFIELDS%YRSURF,YDMODEL,KPPVCLIX=IVCLIX,KPPEDR=IPPEDR) + +!* Initialize DDH (Horizontal domains diagnostics) +WRITE(NULOUT,*) '------ Set up DDH diagnostics --------',CLINE +CALL SUNDDH(YDGEOMETRY,YDFIELDS%YRSURF,YDMODEL) + +!The call to SUNDDH is too late because the LSDDH key is needed in SUPHMPA +!The folowing lines are a workaround for this problem (the call to +!aroini_budget has already been done in suphmpa but with a possibly wrong +!value for LSDDH): +YDMODEL%YRML_PHY_MF%YRPARAR%LAROBU_ENABLE=YDMODEL%YRML_PHY_MF%YRARPHY%LMPA.AND.LSDDH +CALL AROINI_BUDGET(YDMODEL%YRML_PHY_MF%YRPARAR%LAROBU_ENABLE) +YDMODEL%YRML_PHY_MF%YRPARAR%PHYEX%MISC%TBUCONF = TBUCONF + +!* Initialize domains and masks for DDH + +CALL SUALMDH(YDGEM,YDMODEL%YRML_DIAG) + +IF ( LSDDH ) THEN + WRITE(NULOUT,*) '---- Set up DDH diagnostic domains ',CLINE + CALL SUMDDH(YDGEOMETRY,YDMODEL%YRML_DIAG) +ENDIF + +IF (.NOT.LSDDH.AND.LRAYSP) THEN + WRITE(NULOUT,*) '---- Set up for simp.rad.if not ddh',CLINE + CALL SUSIMPR(YDGEOMETRY,YDMODEL%YRML_DIAG%YRMDDH) +ENDIF + +!* Initialize buffers for gridpoint scanning, part C +WRITE(NULOUT,*) '---- Set up gridpoint scanning, part C ----',CLINE +CALL SUSC2C(YDGEOMETRY,YDMODEL%YRML_PHY_EC%YREPHY,YDMODEL%YRML_GCONF,YDMODEL%YRML_PHY_MF%YRPHY,YNLVARS,YDFIELDS%YRGFL, & + & YDFIELDS%YRGMV,YDFIELDS%YRSURF) +CALL VARIABLES_DELETE(YNLVARS) + +!* Initialize forcing by coarser model: part C +IF (LELAM) THEN + WRITE(NULOUT,*) '--- Set up forcing by coarser model part C ---------',CLINE + CALL SUELBC_FIELDS(YDFIELDS%YRELBC_FIELDS,YDGEOMETRY,YDFIELDS%YRGMV,YDMODEL%YRML_GCONF%YGFL,YDDIMF%NFD2D,YDDIMF%NS3D) +ENDIF + +!* Initialize forcing by coarser model: part B +IF (LELAM) THEN + WRITE(NULOUT,*) '--- Set up forcing by coarser model part B ---------',CLINE + CALL SUELBC_MODEL(YDMODEL%YRML_LBC,YDFIELDS%YRELBC_FIELDS,YDGEOMETRY,YDFIELDS%YRGMV,YDMODEL%YRML_GCONF) +ENDIF + +!* Initialize cumulated fluxes requests +WRITE(NULOUT,*) '------ Set up cumulated fluxes diags ---',CLINE +CALL SUCFU(YDGEOMETRY,YDFIELDS%YRCFU,YDMODEL%YRML_GCONF%YRRIP,YDMODEL%YRML_PHY_RAD%YRERAD,YDMODEL%YRML_PHY_MF%YRPHY, & + & NULOUT,YDCFUPP=YLCFU_KEYS) + +!* Initialize instantaneous fluxes requests +WRITE(NULOUT,*) '------ Set up instantaneous fluxes diags ',CLINE +CALL SUXFU(YDGEOMETRY,YDFIELDS%YRXFU,YDMODEL%YRML_GCONF%YRRIP,YDMODEL%YRML_PHY_MF%YRPHY,NULOUT,YDXFUPP=YLXFU_KEYS) + +! IOSTREAM +CALL SUIOSTREAM + +!* Memory allocation for cumulated DDH arrays (horizontal domains diags) +WRITE(NULOUT,*) '---- Set up DDH diags allocation --',CLINE +CALL SUALTDH(YDDIMV,YDMODEL%YRML_DIAG,YDMODEL%YRML_PHY_MF%YRARPHY,YDMODEL%YRML_PHY_MF%YRPHY) + +!* Memory allocation for dynamical DDH tendencies arrays +WRITE(NULOUT,*) '---- Set up dynamical DDH arrays allocation --',CLINE +CALL SUALDYN_DDH(YDGEOMETRY,YDMODEL%YRML_DIAG,YDMODEL%YRML_GCONF) + +! Setup model error arrays +IF (LMODERR.OR.LSTATMERR) THEN + WRITE(NULOUT,*) '-- Setup model error arrays-',CLINE + CALL SUMODERR(YDGEOMETRY,YDFIELDS%YRGMV,YDMODEL%YRML_GCONF) +ENDIF + +! Allocate space for control variable +IF (NCONF/100 /= 9 .AND. NCONF /= 1 .AND. NCONF /= 302 .AND. NCONF /= 201 .AND. NCONF /= 701) THEN + IF(ASSOCIATED(JB_STRUCT)) THEN + IF (.NOT.ASSOCIATED(CVA_DATA)) CALL ABOR1('Call SUALCTV, but CVA_DATA is not set up') + IF (LPAROPTIACV) THEN + CVA_DATA%NVPARACV=YDMODEL%YRML_GCONF%YRDIMACV%NACV_1D + ELSE + CVA_DATA%NVPARACV=0 + ENDIF + IF (LENSCV) THEN + WRITE(NULOUT,*) '-- Allocate ens. control variable-',CLINE + !* SUALCTV_ENS needs to know about ens. size in sqrt. Envar scheme + CALL SUENSDIM(YDGEOMETRY) + ALLOCATE(CTLVEC_STRUCT_ENS) + !* change here if ensemble geometry is different + CALL SUALCTV_ENS(YDGEOMETRY,CTLVEC_STRUCT_ENS,CVA_DATA) + ENDIF + WRITE(NULOUT,*) '-- Allocate static control variable-',CLINE + ALLOCATE(CTLVEC_STRUCT) + CALL SUALCTV(YDGEOMETRY,CTLVEC_STRUCT,CVA_DATA,JB_STRUCT,YDMODEL%YRML_GCONF%YRDIMACV) + ELSE + CALL ABOR1(' SU0YOMB: case where JB_STRUCT is used, but is not yet set up') + ENDIF + + +ENDIF + +!* Initialize control of the Lanczos algorithm +LFORCEWR=.FALSE. +IF(.NOT.(ICONF == 0.OR.ICONF == 2.OR.NCONF == 302.OR.NCONF == 903)) THEN + WRITE(NULOUT,*) '---- Set up Lanczos algorithm -------',CLINE + LL_ALLOC_RLANBUF=(NCONF/100 == 6) + IF(LL_ALLOC_RLANBUF) THEN + CALL ALLOCATE_CTLVEC(YLTEMP) + ISIZEG=YLTEMP%NSIZEG + CALL DEALLOCATE_CTLVEC(YLTEMP) + ELSE + ISIZEG=0 + ENDIF + CALL SULCZ(YDGEOMETRY,YDFIELDS,YDMTRAJ,YDMODEL,LL_ALLOC_RLANBUF,ISIZEG) +ENDIF + +!* Allocate the trajectory +IF(NCONF/100 == 1.OR.NCONF == 401.OR.NCONF == 501.OR.NCONF == 801.OR.NCONF == 601) THEN + WRITE(NULOUT,*) '---- Allocate trajectory: SUALLT -------',CLINE + CALL SUALLT(YDGEOMETRY,YDMTRAJ,YDFIELDS%YRGMV,YDFIELDS%YRSURF,YDMODEL) + LTRAJRESET=.TRUE. +ENDIF + +IF (LTRAJHR .AND. LIFSTRAJ) THEN + WRITE(NULOUT,*) '---- Allocate trajectory: ALLOCATE_TRAJECTORY -------',CLINE + CALL ALLOCATE_TRAJECTORY(YDGEOMETRY,YDGMV,YDGMV5,YDSURF,YDMODEL) +ENDIF + +!* Get trajectory values for NOX LOG variable +IF (LLDIMO) THEN !JEB avoid calculating this with wavelet + IF(( NCHEM_ASSIM>0) .AND. NGRBNOXLOG> 0) THEN + WRITE(NULOUT,*) '---- Get trajectory values for NOX LOG variable -------',CLINE + IF (LIFSMIN.AND.(LTRAJHR.AND.LTRAJHR_ALTI) ) THEN + + ISTEP = 0 + LLASTRAJ = .FALSE. + CALL READ_TRAJECTORY(YDGEOMETRY,YDFIELDS,YDMTRAJ,YDMODEL,ISTEP,LLASTRAJ,LREADGPTRAJ) + + IF (LREADGPTRAJ) THEN + + ALLOCATE (ZGMV5(NPROMA,NFLEVG,YT5%NDIM,NGPBLKS)) + ALLOCATE (ZGMV5S(NPROMA,YT5%NDIMS,NGPBLKS)) + ALLOCATE (ZGFL5(NPROMA,NFLEVG,NDIM5,NGPBLKS)) + + ZGMV5=0._JPRB + ZGMV5S=0._JPRB + ZGFL5=0._JPRB + + CALL GET_TRAJ_GRID(YDGEOMETRY,YDMODEL%YRML_GCONF,TRAJEC(0),YDGMV,YDGMV5,ZGMV5,ZGMV5S,ZGFL5,1) + + DO JGFL=1,NDIM5 + IF (YCOMP(JGFL)%LTRAJIO) THEN + YDGFL5%GFL5(:,:,YCOMP(JGFL)%MP,:)=ZGFL5(:,:,YCOMP(JGFL)%MP,:) + DO JSTGLO=1,NGPTOT,NPROMA + ICEND=MIN(NPROMA,NGPTOT-JSTGLO+1) + IBL=(JSTGLO-1)/NPROMA+1 + YDGFL5%GFL5(1:ICEND,1:NFLEVG,YCOMP(JGFL)%MP,IBL)=ZGFL5(1:ICEND,1:NFLEVG,YCOMP(JGFL)%MP,IBL) + YDGFL5%GFL5(ICEND+1:NPROMA,1:NFLEVG,YCOMP(JGFL)%MP,IBL)=0.0_JPRB + ENDDO + ENDIF + ENDDO + + DEALLOCATE(ZGFL5) + DEALLOCATE(ZGMV5) + DEALLOCATE(ZGMV5S) + + ENDIF + + ENDIF + ENDIF +ENDIF + +!* Allocate Jb linearisation state +IF (NCONF==131 .OR. NCONF/100==6 .OR. NCONF/100==8 .OR.& + & (LTRAJHR .AND. LIFSTRAJ)) THEN +! Not needed for NCONF=401? + WRITE(NULOUT,*) '---- Allocate Jb linearisation state -------',CLINE + IF (.NOT.ASSOCIATED(BACKGROUND)) THEN + CALL ABOR1 ('BACKGROUND HAS NOT BEEN ALLOCATED') + ENDIF + CALL ALLOCATE_JB_REF_STATE(YDGEOMETRY,YGFL,BACKGROUND,YDGMV,YDGMV5) +ENDIF + +!* Initialize Jb error covariance model +!* Set up coefficients for humidity change of variable +IF (LBACKG .OR. LOBSC1) THEN + WRITE(NULOUT,*) '---- Set up coefficients for humidity change of variable --',CLINE + CALL SUJBCHVAR(YDVAB,YDDIMV,JB_STRUCT) +ENDIF + +IF (LBACKG.OR.LSPBSBAL) THEN + IF (LSPBSBAL.OR..NOT.JB_STRUCT%CONFIG%LJBENER) THEN + WRITE(NULOUT,*) '---- Set up Jb balance operators --',CLINE + IF(LELAM) THEN + CALL SUEJBBAL(YDGEOMETRY,'STABAL96 ',JB_STRUCT) + ELSE + CALL SUJBBAL(YDGEOMETRY,'STABAL96 ',JB_STRUCT) + ENDIF + ENDIF +ENDIF + +IF (LBACKG) THEN + WRITE(NULOUT,*) '---- Set up Jb error covariances --',CLINE + +!* Copy trajectory into a FIELDS structure + + CALL VARIABLES_CREATE(YL_VARS, .TRUE.) + CALL FIELDS_CREATE(YL_TRAJ,YDGEOMETRY,YDMODEL,YL_VARS) + CALL VARIABLES_DELETE(YL_VARS) + + CALL GET_TRAJ_GRID(YDGEOMETRY,YDMODEL%YRML_GCONF,TRAJEC(0),YDGMV,YDGMV5,& + & YL_TRAJ%YRGMV%GMV,YL_TRAJ%YRGMV%GMVS,& + & YL_TRAJ%YRGFL%GFL,GET_NUPTRA()) + + IF(LELAM) THEN + IF (JB_STRUCT%WJBCONF%LJBWAVELET) THEN + WRITE(NULOUT,*) 'Wavelet Jb in Aladin: good luck!' + CALL SUEJBWAVELET_BMATRIX(YDDIMV) + ELSE + CALL SUEJBCOV(YDGEOMETRY,YDFIELDS,YL_TRAJ,JB_STRUCT) + !* Envar : ens. data and localization setup + IF (LENSCV) CALL SUENSCOV(YDGEOMETRY,YDFIELDS,YDMODEL) + ENDIF + ELSE + IF (JB_STRUCT%WJBCONF%LJBWAVELET) THEN + IF ((.NOT.JB_STRUCT%WJBCONF%LJBWSTATS).OR.(JB_STRUCT%WJBCONF%LHYBRID_JB)) THEN + ! sujbwavelet must be called before sujbwavstats if LHYBRID_JB=T + CLFILE='wavelet.cv' + CALL SUJBWAVELET(YDGEOMETRY,YDFIELDS,YL_TRAJ,JB_STRUCT,CLFILE) + CALL SUJBWAVELET_STDEVS(YDGEOMETRY,YDMODEL%YRML_GCONF,YDMODEL%YRML_CHEM%YRCHEM,JB_STRUCT) + ENDIF + + IF (JB_STRUCT%WJBCONF%LJBWSTATS) THEN + WRITE(NULOUT,*) '---- Calculate Wavelet Jb error covariances --',CLINE + CALL SUJBWAVSTATS(YDGEOMETRY,YDFIELDS,YDMTRAJ,YDMODEL,JB_STRUCT) + + IF(LBACKGERENORM)THEN + ! Option to reload the matrix and to compute renormalisation coeffs of wavelet B + WRITE(CLMAX,'(I3)') NSMAX + CLFILE='wavelet_out_T'//TRIM(ADJUSTL(CLMAX))//'.cv' + CALL SUJBWAVELET(YDGEOMETRY,YDFIELDS,YL_TRAJ,JB_STRUCT,CLFILE) + CALL SUJBWAVELET_STDEVS(YDGEOMETRY,YDMODEL%YRML_GCONF,YDMODEL%YRML_CHEM%YRCHEM,JB_STRUCT) + WRITE(NULOUT,*) '---- Variational job: Compute renormalisation coefficient',& + & 'for the variance -------------------' + CALL SUJBWAVRENORM(YDGEOMETRY,YDFIELDS,YDMTRAJ,YDMODEL%YRML_GCONF,JB_STRUCT) + ENDIF + + ! The statistics file has been written and closed. + ! Normal exit + WRITE (NULOUT,*) 'Jb stats file has been written' + WRITE (NULOUT,*) 'Normal exit' + CALL IOSTREAM_STATS + CALL GSTATS(0,1) + CALL GSTATS_OUTPUT_IFS(YDMODEL%YRML_GCONF%YRRIP) + IF (NPROC > 1) THEN + CALL MPL_BARRIER(CDSTRING='SU0YOMB') + ENDIF + CALL MPL_END() + STOP + ENDIF + + ELSE + IF (.NOT.ASSOCIATED(BACKGROUND)) THEN + CALL ABOR1 ('BACKGROUND HAS NOT BEEN ALLOCATED') + ENDIF + CALL SUJBCOV(YDGEOMETRY,YDFIELDS,YDDIMF,YDMODEL%YRML_DYN%YRDYN,YL_TRAJ,JB_STRUCT) + IF (NCONF==801.AND. .NOT.LBACKG) THEN + CALL SUECGES(YDGEOMETRY,YDFIELDS,YDMTRAJ,YDMODEL,BACKGROUND,JB_STRUCT) + ENDIF + ENDIF + ENDIF + + IF (LELAM) THEN + IF (LEJK) THEN + WRITE(NULOUT,*) '---- Set up Jk error covariances --',CLINE + CALL SUELLJK(YDGEOMETRY,YDDIMF,NULOUT) + CALL SUEJKNORM(YDDIMV,JB_STRUCT) + WRITE(NULOUT,*) '---- Set up Jk modulation wrt level and param --',CLINE + CALL SUEMODJK(YDSTA,YDDIMV,YDDIMF) + ENDIF + ENDIF + + IF(.NOT.(ICONF == 8) .AND..NOT.(ICONF == 6)) THEN + WRITE(NULOUT,*) '---- Set up Background fields --',CLINE + IF (.NOT.ASSOCIATED(BACKGROUND)) THEN + CALL ABOR1 ('BACKGROUND HAS NOT BEEN ALLOCATED') + ENDIF + CALL SUECGES(YDGEOMETRY,YDFIELDS,YDMTRAJ,YDMODEL,BACKGROUND,JB_STRUCT) + + IF(.NOT.LELAM .OR. .NOT.JB_STRUCT%CONFIG%LSPFCE) THEN + CALL VARIABLES_CREATE(YL_VARS, .FALSE.) + CALL FIELDS_CREATE(YLINFCE,YDGEOMETRY,YDMODEL,YL_VARS) + CALL VARIABLES_DELETE(YL_VARS) +!!$ IF(LTRAJHR) THEN + CALL GET_TRAJ_GRID(YDGEOMETRY,YDMODEL%YRML_GCONF,BACKGROUND,YDGMV,YDGMV5,YLINFCE%YRGMV%GMV,& + & YLINFCE%YRGMV%GMVS,YLINFCE%YRGFL%GFL,GET_NUPTRA()) +!!$ ELSE +!!$ CALL SUINIF(YDGEOMETRY,YLINFCE%YRGFL,YLINFCE%YRSURF,0,YLINFCE%YRSPEC) +!!$ CLCONF(1:9)='0AAX00000' +!!$ CALL TRANSINVH(YLINFCE%GEOM,YLINFCE%YRGFL,YLINFCE%YRGMV,CLCONF,YLINFCE%YRSPEC) +!!$ ENDIF + WRITE(NULOUT,*) '---- Set up Jb gridpoint background error stdev --',CLINE + IF (LELAM) THEN + CALL SUEINFCE(YDGEOMETRY,JB_STRUCT) + ELSE + CALL SUINFCE(YDGEOMETRY,YDMODEL%YRML_GCONF,YLINFCE,JB_STRUCT) + ENDIF + CALL FIELDS_DELETE(YLINFCE) + ENDIF + IF (.NOT.LELAM .AND. LACV .AND. IABS(NCONF/100)==1) THEN + WRITE(NULOUT,*) '---- Set up JB augmented control variable --',CLINE + CALL READ_FG_ACV(YDGEOMETRY,YDMODEL%YRML_GCONF%YRDIMACV,LDBCK=.TRUE.) + CALL READ_FG_ACV(YDGEOMETRY,YDMODEL%YRML_GCONF%YRDIMACV) + IF (LPAROPTIACV) CALL SUPARACVMIN(YDGEOMETRY) + IF (LJB_HYBRID_ACV) CALL SETJBHYBACV(YDGEOMETRY, YDMTRAJ, YDFIELDS, YDMODEL, BACKGROUND, JB_STRUCT) + ENDIF + + + ENDIF + +!* Initialize Jq error covariances + IF (LMODERR) THEN + WRITE(NULOUT,*) '---- Set up Jq error covariances --',CLINE + CALL SUJQ(YDGEOMETRY,YDMODEL%YRML_GCONF%YRRIP) + ENDIF + +!* Delete temporary FIELDS-type trajectory structure + CALL FIELDS_DELETE(YL_TRAJ) + +ENDIF +! Set up spectral stochastic diabatic tendencies +WRITE(NULOUT,'(A72)') '--- Set up stochastically perturbed parametrization tendencies '//CLINE +WRITE(NULOUT,*) ' SPPT a.k.a. stochastic physics with spectral pattern' +CALL SUSPSDT(YDGEOMETRY,YDMODEL%YRML_GCONF%YRRIP,YSPPT_CONFIG,YSPPT) +CALL SUPERTPAR(YDMODEL%YRML_PHY_MF,YDMODEL%YRML_PHY_EC%YRECUMF,YDMODEL%YRML_PHY_RAD%YRERAD) + +!* Initialize scalar product +IF(.NOT.(NCONF == 1.OR.NCONF == 302.OR.ICONF == 2.OR.ICONF == 9.OR.ICONF == 7 )) THEN + WRITE(NULOUT,*) '---- Set up scalar product --------',CLINE + IF (LELAM) THEN + ALLOCATE (SCALP_STRUCT) + CALL SUESCAL(YDGEOMETRY,YDFIELDS,YDMTRAJ,YDMODEL,SCALP_STRUCT,YDVARBC,JB_STRUCT,YDTCV) + ELSE + ALLOCATE (SCALP_STRUCT) + CALL SUSCAL(YDGEOMETRY,YDFIELDS,YDMTRAJ,YDMODEL,SCALP_STRUCT,YDVARBC,JB_STRUCT) + ENDIF +ENDIF + +!* Initialize subspace +IF(.NOT.(ICONF == 0.OR.ICONF == 2.OR.NCONF == 302).AND.L_SUBSPACE_SVS) THEN + WRITE(NULOUT,*) '---- Set up subspace for SV computation -------',CLINE + CALL SU_SUBSPACE(YDGEOMETRY,YDDIMF) +ENDIF + +! Read in SKT forecast errors +IF (LSCREEN .AND. .NOT. LMONITOR_FCDEPAR) THEN + WRITE(NULOUT,*) '---- Read in SKT EDA errors ---',CLINE + CALL SUINSKTE(YGSKTER) +ENDIF + +! Read in forecast errors +IF (LSCREEN .AND. .NOT. LMONITOR_FCDEPAR) THEN + WRITE(NULOUT,*) '---- Read in forecast errors ---',CLINE + CALL INIFGER +ENDIF + +! If required allocate empty skeleton of trajectory structure +IF (.NOT. LTRAJALLOC .AND. ((NCONF /= 401).AND.(NCONF /= 501).AND. (& + & NCONF /= 601).AND.(NCONF /= 801) )) THEN + CALL ALLOCATE_EMPTY_TRAJECTORY(YDDIM,YDMODEL%YRML_GCONF%YRRIP) + ! ltrajalloc=.true. +ENDIF + +WRITE(NULOUT,'(A72)') '--- Set up stochastic physics, SPBS, CABS '//CLINE +CALL INI_CUCONVCA(YDGEOMETRY,YDMODEL%YRML_PHY_EC%YRECUCONVCA,YDMODEL%YRML_DYN%YRSL) +CALL SURAND1(YDGEOMETRY,YDMODEL%YRML_PHY_STOCH,YDMODEL%YRML_DYN%YRDYN,YDMODEL%YRML_GCONF%YRRIP, & + & YDMODEL%YRML_PHY_EC%YRECUCONVCA) +! Set up stochastically perturbed parameterisation scheme + +WRITE(NULOUT,*) '--- Set up stochastically perturbed parametrization scheme (SPP) ',CLINE +CALL GET_SPP_CONF(YDMODEL%YRML_GCONF%YRRIP,YSPP_CONFIG) +CALL INI_SPP(YDGEOMETRY,YDMODEL%YRML_GCONF%YRRIP,YSPP_CONFIG,YSPP) + +! provide optional GEOMETRY argument here, since these are MODEL processes rather than IO_SERV ones +WRITE(NULOUT,*) '---- Create io server file templates --',CLINE +IF (NFPOS == 0) THEN + CALL IO_SERV_SUIOSCTMPL(IO_SERV_C001,YDGEOMETRY=YDGEOMETRY,PTSTEP=YDMODEL%YRML_GCONF%YRRIP%TSTEP, & + & YDEWCOU=YDMODEL%YREWCOU) +ENDIF + +! Set up gravity wave diagnostics +CALL SETUP_GWDIAG(YDDIM) +! Set up flexible physics-dynamics interface +WRITE(NULOUT,*) '---- Set up flexible physics-dynamics interface --',CLINE +CALL SUINTFLEX(YGFL,YDMODEL%YRML_PHY_MF%YRARPHY,YDMODEL%YRML_PHY_MF%YRPHY) +CALL FIELDS_CONTAIN(YDFIELDS,YDGEOMETRY) + +IF (YDMODEL%YRML_PHY_MF%YRPHY%LAPL_ARPEGE) THEN + ! Check LAPL_ARPEGE consistency + WRITE(NULOUT,*) '------ Set up : LAPL_ARPEGE consistency ------',CLINE + CALL SUAPL_ARPEGE (YDMODEL, YDFIELDS%YRXFU, NULOUT) +ENDIF + +WRITE(NULOUT,*) '-------------------------------------',CLINE +WRITE(NULOUT,*) '------ END OF SETUPS at level 0 -----',CLINE +WRITE(NULOUT,*) '-------------------------------------',CLINE +WRITE(NULOUT,*) ' ' +WRITE(NULOUT,*) ' ' +CALL FLUSH(NULOUT) +CALL GSTATS(39,1) + +! ------------------------------------------------------------------ + +END ASSOCIATE +END ASSOCIATE +IF (LHOOK) CALL DR_HOOK('SU0YOMB',1,ZHOOK_HANDLE) +END SUBROUTINE SU0YOMB diff --git a/src/arome/ext/suparar.F90 b/src/arome/ext/suparar.F90 index 08755f90e26f9e0d6b790c64a517940494521edc..4b2bd560e42a808c7897ca65b6cbeffc596837f3 100644 --- a/src/arome/ext/suparar.F90 +++ b/src/arome/ext/suparar.F90 @@ -87,100 +87,32 @@ REAL(KIND=JPRB) :: ZHOOK_HANDLE #include "posnam.intfb.h" -REAL(KIND=JPRB) , POINTER :: XABUO LOGICAL , POINTER :: LOTOWNC -REAL(KIND=JPRB) , POINTER :: XBENTR LOGICAL , POINTER :: LAROBU_ENABLE -REAL(KIND=JPRB) , POINTER :: XBETA1 -REAL(KIND=JPRB) , POINTER :: XCRAD_MF -REAL(KIND=JPRB) , POINTER :: XA1 LOGICAL , POINTER :: LOLSMC LOGICAL , POINTER :: LFPREC3D -REAL(KIND=JPRB) , POINTER :: XDETR_DRY -CHARACTER (LEN=4) :: CMF_UPDRAFT -LOGICAL , POINTER :: LMIXUV LOGICAL , POINTER :: LLCRIT INTEGER(KIND=JPIM) , POINTER :: NREFROI1 -REAL(KIND=JPRB) , POINTER :: XTAUSIGMF -LOGICAL , POINTER :: LCRIAUTI -REAL(KIND=JPRB) , POINTER :: XB -REAL(KIND=JPRB) , POINTER :: XENTR_MF REAL(KIND=JPRB) , POINTER :: VSQUALL -LOGICAL , POINTER :: LOSEDIC -REAL(KIND=JPRB) , POINTER :: VSIGQSAT -REAL(KIND=JPRB) , POINTER :: XKRC_MF INTEGER(KIND=JPIM) , POINTER :: NDIAGWMAX -CHARACTER(LEN=80) :: CSUBG_PR_PDF -CHARACTER(LEN=80) :: CSUBG_MF_PDF -REAL(KIND=JPRB) , POINTER :: XFRAC_UP_MAX -CHARACTER(LEN=80) :: CSUBG_RR_EVAP -REAL(KIND=JPRB) , POINTER :: XCMF INTEGER(KIND=JPIM) , POINTER :: NSWB_MNH LOGICAL , POINTER :: LDIAGWMAX -REAL(KIND=JPRB) , POINTER :: XPRES_UV -CHARACTER (LEN=4) :: CSUBG_AUCV_RC -CHARACTER (LEN=80) :: CSUBG_AUCV_RI -REAL(KIND=JPRB) , POINTER :: XALP_PERT -LOGICAL , POINTER :: LOCND2 -LOGICAL , POINTER :: LSTATNW -LOGICAL , POINTER :: LHARATU LOGICAL , POINTER :: LKOGAN -LOGICAL , POINTER :: LHGT_QS LOGICAL , POINTER :: LMODICEDEP LOGICAL , POINTER :: LICERAD LOGICAL , POINTER :: LTOTPREC LOGICAL , POINTER :: LTOTPRECL -REAL(KIND=JPRB), DIMENSION(:), POINTER :: RFRMIN INTEGER(KIND=JPIM) , POINTER :: NPRINTFR REAL(KIND=JPRB) , POINTER :: XCQVR CHARACTER(LEN=4) :: CMICRO -CHARACTER(LEN=80) :: CCONDENS -CHARACTER(LEN=4) :: CLAMBDA3 -REAL(KIND=JPRB) , POINTER :: XDETR_LUP +CHARACTER(LEN=4) :: CTURB REAL(KIND=JPRB) , POINTER :: GQVTOP REAL(KIND=JPRB) , POINTER :: GQVPLIM -REAL(KIND=JPRB) , POINTER :: XLINI -REAL(KIND=JPRB) , POINTER :: XENTR_DRY LOGICAL , POINTER :: LQVTOP INTEGER(KIND=JPIM) , POINTER :: NREFROI2 -LOGICAL , POINTER :: LTHETAS -REAL(KIND=JPRB) , POINTER :: XBDETR -REAL(KIND=JPRB) , POINTER :: XALPHA_MF LOGICAL , POINTER :: LSQUALL -CHARACTER(LEN=80) :: CSUBG_RC_RR_ACCR -CHARACTER (LEN=4) :: CMF_CLOUD -REAL(KIND=JPRB) , POINTER :: XC -LOGICAL , POINTER :: LOSUBG_COND INTEGER(KIND=JPIM) , POINTER :: NPTP -LOGICAL , POINTER :: LOSIGMAS -CHARACTER(LEN=4) :: CSEDIM -REAL(KIND=JPRB) , POINTER :: XSIGMA_MF -REAL(KIND=JPRB) , POINTER :: RCRIAUTI, RCRIAUTC, RT0CRIAUTI -REAL(KIND=JPRB) , POINTER :: XKCF_MF REAL(KIND=JPRB) , POINTER :: RADGR,RADSN -REAL(KIND=JPRB) , POINTER :: XTSTEP_TS -REAL(KIND=JPRB) , POINTER :: XMRSTEP -INTEGER(KIND=JPIM) , POINTER :: NMAXITER_MICRO -CHARACTER (LEN=4) :: CSNOWRIMING -REAL(KIND=JPRB) , POINTER :: XFRACM90 -LOGICAL , POINTER :: LNULLWETG -LOGICAL , POINTER :: LWETGPOST -LOGICAL , POINTER :: LNULLWETH -LOGICAL , POINTER :: LWETHPOST -LOGICAL , POINTER :: LFEEDBACKT -LOGICAL , POINTER :: LEVLIMIT -LOGICAL , POINTER :: LCONVHG -LOGICAL , POINTER :: LCRFLIMIT -CHARACTER(LEN=1) :: CFRAC_ICE_ADJUST -CHARACTER(LEN=1) :: CFRAC_ICE_SHALLOW_MF -LOGICAL , POINTER :: LSEDIM_AFTER -REAL(KIND=JPRB) , POINTER :: XSPLIT_MAXCFL -LOGICAL , POINTER :: LDEPOSC -REAL(KIND=JPRB) , POINTER :: XVDEPOSC -INTEGER(KIND=JPIM) , POINTER :: NPROMICRO -LOGICAL, POINTER :: LDEPSG -REAL(KIND=JPRB), POINTER :: RDEPSRED -REAL(KIND=JPRB), POINTER :: RDEPGRED #include "namparar.nam.h" #include "abor1.intfb.h" @@ -190,15 +122,14 @@ IF (LHOOK) CALL DR_HOOK('SUPARAR',0,ZHOOK_HANDLE) !Associate for variables not in the include namelists nor allocated in the routine ASSOCIATE(MACPRS=>YDML_PHY_MF%YRPARAR%MACPRS, MACPRR=>YDML_PHY_MF%YRPARAR%MACPRR, & & MINPRR=>YDML_PHY_MF%YRPARAR%MINPRR, MINPRS=>YDML_PHY_MF%YRPARAR%MINPRS, & - & XSW_BANDS=>YDML_PHY_MF%YRPARAR%XSW_BANDS, MALBSCA=>YDML_PHY_MF%YRPARAR%MALBSCA, & - & MVQS=>YDML_PHY_MF%YRPARAR%MVQS, MINPRG=>YDML_PHY_MF%YRPARAR%MINPRG,XLAMBDA=>YDML_PHY_MF%YRPARAR%XLAMBDA, & - & NGPAR=>YDML_PHY_MF%YRPARAR%NGPAR, LOWARM=>YDML_PHY_MF%YRPARAR%LOWARM, & + & MVQS=>YDML_PHY_MF%YRPARAR%MVQS, MINPRG=>YDML_PHY_MF%YRPARAR%MINPRG, & + & NGPAR=>YDML_PHY_MF%YRPARAR%NGPAR, & & NSPLITR=>YDML_PHY_MF%YRPARAR%NSPLITR, NRRI=>YDML_PHY_MF%YRPARAR%NRRI, NRRL=>YDML_PHY_MF%YRPARAR%NRRL, & & MSWDIF=>YDML_PHY_MF%YRPARAR%MSWDIF, MALBDIR=>YDML_PHY_MF%YRPARAR%MALBDIR, NSV=>YDML_PHY_MF%YRPARAR%NSV, & & MLSM=>YDML_PHY_MF%YRPARAR%MLSM, MVTS=>YDML_PHY_MF%YRPARAR%MVTS, MGZ0H=>YDML_PHY_MF%YRPARAR%MGZ0H, & & MCD=>YDML_PHY_MF%YRPARAR%MCD, & - & XR=>YDML_PHY_MF%YRPARAR%XR, MGZ0=>YDML_PHY_MF%YRPARAR%MGZ0, MACPRG=>YDML_PHY_MF%YRPARAR%MACPRG, & + & MGZ0=>YDML_PHY_MF%YRPARAR%MGZ0, MACPRG=>YDML_PHY_MF%YRPARAR%MACPRG, & & MSWDIR=>YDML_PHY_MF%YRPARAR%MSWDIR, MSNOW=>YDML_PHY_MF%YRPARAR%MSNOW, & & NDTCHEM=>YDML_PHY_MF%YRPARAR%NDTCHEM, MRAIN=>YDML_PHY_MF%YRPARAR%MRAIN, MVEMIS=>YDML_PHY_MF%YRPARAR%MVEMIS, & & NRR=>YDML_PHY_MF%YRPARAR%NRR, & @@ -207,88 +138,31 @@ ASSOCIATE(MACPRS=>YDML_PHY_MF%YRPARAR%MACPRS, MACPRR=>YDML_PHY_MF%YRPARAR%MACPRR & LRAY=>YDML_PHY_MF%YRPHY%LRAY, LRAYFM15=>YDML_PHY_MF%YRPHY%LRAYFM15, LRAYFM=>YDML_PHY_MF%YRPHY%LRAYFM, & & YDPARAR=>YDML_PHY_MF%YRPARAR) !include namelists variables, or variables allocated in the routine -XDETR_LUP => YDPARAR%XDETR_LUP -XCMF => YDPARAR%XCMF VSQUALL => YDPARAR%VSQUALL GQVPLIM => YDPARAR%GQVPLIM -XBDETR => YDPARAR%XBDETR -RCRIAUTC => YDPARAR%RCRIAUTC LSQUALL => YDPARAR%LSQUALL -VSIGQSAT => YDPARAR%VSIGQSAT -XLINI => YDPARAR%XLINI -XABUO => YDPARAR%XABUO LOTOWNC => YDPARAR%LOTOWNC -RT0CRIAUTI => YDPARAR%RT0CRIAUTI -XKCF_MF => YDPARAR%XKCF_MF RADSN => YDPARAR%RADSN -LOSEDIC => YDPARAR%LOSEDIC LDIAGWMAX => YDPARAR%LDIAGWMAX -XSIGMA_MF => YDPARAR%XSIGMA_MF -XA1 => YDPARAR%XA1 NPRINTFR => YDPARAR%NPRINTFR -XENTR_DRY => YDPARAR%XENTR_DRY -XENTR_MF => YDPARAR%XENTR_MF LQVTOP => YDPARAR%LQVTOP -XBETA1 => YDPARAR%XBETA1 NPTP => YDPARAR%NPTP -LOCND2 => YDPARAR%LOCND2 LKOGAN => YDPARAR%LKOGAN -LHGT_QS => YDPARAR%LHGT_QS LMODICEDEP => YDPARAR%LMODICEDEP LICERAD => YDPARAR%LICERAD LTOTPREC => YDPARAR%LTOTPREC LTOTPRECL => YDPARAR%LTOTPRECL -RFRMIN => YDPARAR%RFRMIN XCQVR => YDPARAR%XCQVR -XFRAC_UP_MAX => YDPARAR%XFRAC_UP_MAX -XB => YDPARAR%XB -XC => YDPARAR%XC NREFROI2 => YDPARAR%NREFROI2 NREFROI1 => YDPARAR%NREFROI1 -XTAUSIGMF => YDPARAR%XTAUSIGMF -XKRC_MF => YDPARAR%XKRC_MF -XDETR_DRY => YDPARAR%XDETR_DRY -RCRIAUTI => YDPARAR%RCRIAUTI -XALP_PERT => YDPARAR%XALP_PERT -XBENTR => YDPARAR%XBENTR -LTHETAS => YDPARAR%LTHETAS -XCRAD_MF => YDPARAR%XCRAD_MF LAROBU_ENABLE => YDPARAR%LAROBU_ENABLE -LCRIAUTI => YDPARAR%LCRIAUTI NSWB_MNH => YDPARAR%NSWB_MNH -LOSIGMAS => YDPARAR%LOSIGMAS GQVTOP => YDPARAR%GQVTOP -LMIXUV => YDPARAR%LMIXUV LLCRIT => YDPARAR%LLCRIT -XALPHA_MF => YDPARAR%XALPHA_MF -XPRES_UV => YDPARAR%XPRES_UV LOLSMC => YDPARAR%LOLSMC NDIAGWMAX => YDPARAR%NDIAGWMAX -LOSUBG_COND => YDPARAR%LOSUBG_COND RADGR => YDPARAR%RADGR LFPREC3D => YDPARAR%LFPREC3D -LSTATNW => YDPARAR%LSTATNW -LHARATU => YDPARAR%LHARATU -XTSTEP_TS => YDPARAR%XTSTEP_TS -XMRSTEP => YDPARAR%XMRSTEP -NMAXITER_MICRO => YDPARAR%NMAXITER_MICRO -XFRACM90 => YDPARAR%XFRACM90 -LNULLWETG => YDPARAR%LNULLWETG -LWETGPOST => YDPARAR%LWETGPOST -LNULLWETH => YDPARAR%LNULLWETH -LWETHPOST => YDPARAR%LWETHPOST -LFEEDBACKT => YDPARAR%LFEEDBACKT -LEVLIMIT => YDPARAR%LEVLIMIT -LCONVHG => YDPARAR%LCONVHG -LCRFLIMIT => YDPARAR%LCRFLIMIT -LSEDIM_AFTER => YDPARAR%LSEDIM_AFTER -XSPLIT_MAXCFL => YDPARAR%XSPLIT_MAXCFL -LDEPOSC => YDPARAR%LDEPOSC -XVDEPOSC => YDPARAR%XVDEPOSC -NPROMICRO => YDPARAR%NPROMICRO -LDEPSG => YDPARAR%LDEPSG -RDEPSRED => YDPARAR%RDEPSRED -RDEPGRED => YDPARAR%RDEPGRED ! ------------------------------------------------------------------ @@ -296,38 +170,22 @@ RDEPGRED => YDPARAR%RDEPGRED ! certaines � mettre en namelist ? ! for microphysics !default for time splitting in microphysics -CSEDIM='STAT' -!autoconversions threshold -RCRIAUTI=0.2E-4 -RT0CRIAUTI=( LOG10(RCRIAUTI) + 3.5 ) / 0.06 -RCRIAUTC=0.5E-3 -LCRIAUTI=.FALSE. -XTSTEP_TS=0._JPRB ! Approximative time step for microphysics time-splitting (0 for no time-splitting) -XMRSTEP=0. ! Maximum mixing ratio change before computing again micro-physical tendencies -NMAXITER_MICRO=5 ! Maximum number of iterations for mixing ratio or time splitting LFPREC3D=.FALSE. -CMICRO='OLD3' -NPROMICRO=0 - +CMICRO='ICE3' +CTURB='TKEL' IF (YH%LACTIVE) THEN NRR=7 NRRL=2 NRRI=4 - CMICRO='OLD4' + CMICRO='ICE4' ELSE NRR=6 NRRL=2 NRRI=3 ENDIF -LOSUBG_COND=.FALSE. -VSIGQSAT=0._JPRB -LOSIGMAS=.FALSE. -LOSEDIC=.FALSE. NSWB_MNH=6 NPRINTFR=3600*36 -CCONDENS='CB02' -CLAMBDA3='CB' ! for squall line academic case LSQUALL=.FALSE. NREFROI1=1 @@ -336,127 +194,26 @@ VSQUALL=0._JPRB NPTP=1 LDIAGWMAX=.FALSE. NDIAGWMAX=1 -LOWARM=.TRUE. LOLSMC=.FALSE. LOTOWNC=.FALSE. -LOCND2=.FALSE. LKOGAN=.FALSE. -LHGT_QS=.FALSE. LMODICEDEP=.FALSE. LICERAD=.FALSE. RADGR=0._JPRB RADSN=0._JPRB -! Tuning and modication of graupeln etc: -RFRMIN(1:6)=0. -RFRMIN(7:9)=1. -RFRMIN(10) =10. -RFRMIN(11) =1. -RFRMIN(12) =0. -RFRMIN(13) =1.0E-15 -RFRMIN(14) =120. -RFRMIN(15) =1.0E-4 -RFRMIN(16:20)=0. -RFRMIN(21:22)=1. -RFRMIN(23)=0.5 -RFRMIN(24)=1.5 -RFRMIN(25)=30. -RFRMIN(26:38)=0. -RFRMIN(39)=0.25 -RFRMIN(40)=0.15 - -! default option for Mass Flux Scheme (Pergaud et al) -CMF_UPDRAFT = 'EDKF' -! DIRE ou STAT -CMF_CLOUD ='DIRE' -LMIXUV= .TRUE. - !default option in EDMFm mass-flux scheme: LLCRIT=.FALSE. LTOTPREC=.FALSE. LTOTPRECL=.FALSE. -! Default for Mass Flux Scheme tuning variables - -XALP_PERT = 0.3_JPRB ! coefficient for the perturbation of - ! theta_l and r_t at the first level of - ! the updraft -XABUO = 1._JPRB ! coefficient of the buoyancy term in the w_up equation -XBENTR = 1._JPRB ! coefficient of the entrainment term in the w_up equation -XBDETR = 0._JPRB ! coefficient of the detrainment term in the w_up equation -XCMF = 0.065_JPRB! coefficient for the mass flux at the first level - ! of the updraft (closure) -XENTR_MF = 0.035_JPRB! entrainment constant (m/Pa) = 0.2 (m) -XCRAD_MF = 50._JPRB ! cloud radius in cloudy part -XENTR_DRY = 0.55_JPRB ! coefficient for entrainment in dry part -XDETR_DRY = 10._JPRB ! coefficient for detrainment in dry part -XDETR_LUP = 1._JPRB ! coefficient for detrainment in dry part -XKCF_MF = 2.75_JPRB ! coefficient for cloud fraction -XKRC_MF = 1._JPRB ! coefficient for convective rc -XTAUSIGMF = 600._JPRB -XPRES_UV = 0.5_JPRB ! coefficient for pressure term in wind mixing -XFRAC_UP_MAX= 0.33_JPRB ! maximum Updraft fraction -XALPHA_MF = 2._JPRB ! coefficient for updraft fraction in STA2 cloud scheme -XSIGMA_MF = 20._JPRB ! coefficient for sigma in STA2 cloud scheme - -! tuning variables for compute_updraft_rhcj10 - -XA1 = 2._JPRB/3._JPRB ! Value Rio et al 2010 -XB = 0.002_JPRB ! Value Rio et al 2010 -XC = 0.012_JPRB ! Value Rio et al 2010 -XBETA1 = 0.9_JPRB ! Value Rio et al 2010 - -! Parameters for closure assumption of Hourdin et al 2002 - -XR = 2._JPRB ! Aspect ratio of updraft, value Hourdin et al 2002 - -! Thermodynamic parameter - -XLAMBDA = 0._JPRB ! Lambda to compute ThetaS1 from ThetaL -LTHETAS = .FALSE. ! Switch to use Thetas insteed of Thetal (TRUE for Thetas) - ! default value for chemical time step factor NDTCHEM=1_JPIM ! default value for Budget LAROBU_ENABLE=.FALSE. ! Subgrid rain scheme -CSUBG_AUCV_RC='PDF' -CSUBG_AUCV_RI='NONE' -CSUBG_RC_RR_ACCR='NONE' -CSUBG_RR_EVAP='NONE' -CSUBG_PR_PDF='SIGM' -CSUBG_MF_PDF='TRIANGLE' -! Snow riming -CSNOWRIMING='M90 ' -XFRACM90=0.1 ! Fraction used for the Murakami 1990 formulation ! -LFEEDBACKT=.TRUE. ! When .TRUE. feed back on temperature is taken into account -LEVLIMIT=.TRUE. ! When .TRUE. water vapour pressure is limited by saturation -LNULLWETG=.TRUE. ! When .TRUE. graupel wet growth is activated with null rate (to allow water shedding) -LWETGPOST=.TRUE. ! When .TRUE. graupel wet growth is activated with positive temperature (to allow water shedding) -LNULLWETH=.TRUE. ! Same as LNULLWETG but for hail -LWETHPOST=.TRUE. ! Same as LWETGPOST but for hail -LCONVHG=.TRUE. ! TRUE to allow the conversion from hail to graupel -LCRFLIMIT=.TRUE. !True to limit rain contact freezing to possible heat exchange -CFRAC_ICE_ADJUST='T' ! Ice/liquid partition rule to use in adjustment -CFRAC_ICE_SHALLOW_MF='T' ! Ice/liquid partition rule to use in shallow_mf -LSEDIM_AFTER=.FALSE. ! Sedimentation done after microphysics -XSPLIT_MAXCFL=0.8 -LDEPOSC=.FALSE. ! water deposition on vegetation -XVDEPOSC=0.02 ! deposition speed (2 cm.s-1) -LDEPSG=.FALSE. ! activate tuning of deposition of snow/graupel (RDEPSRED,RDEPGRED) -RDEPSRED=1.0 -RDEPGRED=1.0 - -! -! set up cloud scheme -LSTATNW=.FALSE. - -! for turbulence scheme -XLINI=0._JPRB ! 0.1 in Meso-NH -LHARATU=.FALSE. - XCQVR = 0.0_JPRB GQVPLIM=10000._JPRB GQVTOP=3.75E-6_JPRB @@ -466,107 +223,25 @@ LQVTOP=.FALSE. CALL POSNAM(NULNAM,'NAMPARAR') READ (NULNAM,NAMPARAR) -! Ensure consistency -IF (.NOT.LOCND2) THEN - RADGR=0._JPRB - RADSN=0._JPRB -ENDIF -IF (LHARATU .AND. CMF_UPDRAFT == 'EDKF') THEN - CALL ABOR1('Combination LHARATU and EDKF not valid!') -ENDIF -IF (.NOT. LHARATU .AND. LSTATNW ) THEN - CALL ABOR1('LSTATNW only tested in combination with HARATU and EDMFm!') -ENDIF - ! Work-around for PGI compiler bug -YDPARAR%CMF_UPDRAFT=CMF_UPDRAFT -YDPARAR%CMF_CLOUD=CMF_CLOUD -YDPARAR%CSUBG_PR_PDF=CSUBG_PR_PDF -YDPARAR%CSUBG_RR_EVAP=CSUBG_RR_EVAP -YDPARAR%CSUBG_AUCV_RC=CSUBG_AUCV_RC -YDPARAR%CSUBG_AUCV_RI=CSUBG_AUCV_RI -YDPARAR%CSUBG_MF_PDF=CSUBG_MF_PDF -YDPARAR%CSUBG_RC_RR_ACCR=CSUBG_RC_RR_ACCR YDPARAR%CMICRO=CMICRO -YDPARAR%CCONDENS=CCONDENS -YDPARAR%CLAMBDA3=CLAMBDA3 -YDPARAR%CSEDIM=CSEDIM -YDPARAR%CSNOWRIMING=CSNOWRIMING -YDPARAR%CFRAC_ICE_ADJUST=CFRAC_ICE_ADJUST -YDPARAR%CFRAC_ICE_SHALLOW_MF=CFRAC_ICE_SHALLOW_MF +YDPARAR%CTURB=CTURB -NPROMICRO=MAX(0,NPROMICRO) - -IF (LTHETAS) XLAMBDA = 5.87_JPRB IF (.NOT.LMSE.AND..NOT.LRAYFM.AND..NOT.LRAYFM15) THEN NSWB_MNH=1 ENDIF -IF ( CMICRO /= 'ICE3' .AND. CMICRO /= 'ICE4' .AND. & - & CMICRO /= 'LIMA' .AND. CMICRO /= 'OLD3' .AND. CMICRO /= 'OLD4') THEN - CALL ABOR1("AROME Microphysics must be ICE3, ICE4, LIMA, OLD3 or OLD4") -ENDIF -IF ( (CMICRO == 'ICE4' .OR. CMICRO == 'OLD4') .AND. .NOT.YH%LACTIVE ) THEN - CALL ABOR1("ICE4 and OLD4 microphysics requires activation of YH in NAMGFL") -ENDIF -IF ( CCONDENS /= 'CB02' .AND. CCONDENS /= 'GAUS') THEN - CALL ABOR1("CCONDENS must be CB02 or GAUS") -ENDIF -IF ( CLAMBDA3 /= 'CB' .AND. CLAMBDA3 /= 'NONE') THEN - CALL ABOR1("CLAMNDA3 must be CB or NONE") +IF ( CMICRO /= 'ICE3' .AND. CMICRO /= 'ICE4' .AND. CMICRO /= 'LIMA') THEN + CALL ABOR1("AROME Microphysics (CMICRO) must be ICE3, ICE4 or LIMA") ENDIF -IF ( CSEDIM /= 'SPLI' .AND. CSEDIM /= 'STAT' ) THEN - CALL ABOR1("AROME Microphysics sedimentation must be EULE or STAT") -ENDIF -IF ( CSUBG_AUCV_RC /= 'PDF ' .AND. CSUBG_AUCV_RC /= 'CLFR' .AND.& - & CSUBG_AUCV_RC /= 'NONE' .AND. CSUBG_AUCV_RC /= 'ADJU' ) THEN - CALL ABOR1("switch for autoconvertion CSUBG_AUCV_RC must be 'PDF ', 'ADJU', 'CLFR' or 'NONE'") -ENDIF -IF ( CSUBG_AUCV_RI /= 'NONE' .AND. CSUBG_AUCV_RI /= 'CLFR' .AND.& - & CSUBG_AUCV_RI /= 'ADJU') THEN - CALL ABOR1("switch for autoconvertion CSUBG_AUCV_RI must be 'CLFR', 'ADJU' or 'NONE'") -ENDIF -IF ((CSUBG_AUCV_RC == 'ADJU' .OR. CSUBG_AUCV_RI == 'ADJU') .AND.& - & CCONDENS /= 'GAUS') THEN - CALL ABOR1("CSUBG_AUCV_RC and/or CSUBG_AUCV_RI cannot be 'ADJU' if CCONDENS is not 'GAUS'") -ENDIF -IF ( CSUBG_RC_RR_ACCR(1:4)/='NONE' .AND. CSUBG_RC_RR_ACCR(1:4)/='PRFR' ) THEN - CALL ABOR1("switch for rc rr accretion (CSUBG_RC_RR_ACCR) must be NONE or PRFR") -ENDIF -IF ( CSUBG_RR_EVAP(1:4)/='NONE' .AND. CSUBG_RR_EVAP(1:4)/='CLFR' .AND.& - & CSUBG_RR_EVAP(1:4)/='PRFR' ) THEN - CALL ABOR1("switch for rr evaporation (CSUBG_RR_EVAP) must be NONE, CLFR or PRFR") -ENDIF -IF ( CSUBG_PR_PDF(1:4)/= 'SIGM' .AND. CSUBG_PR_PDF(1:9) /= 'HLCRECTPD' .AND.& - & CSUBG_PR_PDF(1:12) /= 'HLCTRIANGPDF' .AND. CSUBG_PR_PDF(1:12) /= 'HLCQUADRAPDF'& - & .AND. CSUBG_PR_PDF(1:12) /= 'HLCISOTRIPDF' ) THEN - CALL ABOR1("CSUBG_PR_PDF must be SIGM, HLCRECTPD, HLCTRIANGPDF, HLCQUADRAPDF or HLCISOTRIPDF") -ENDIF -IF ( CSUBG_MF_PDF(1:4)/= 'NONE' .AND. CSUBG_MF_PDF(1:8)/= 'TRIANGLE' ) THEN - CALL ABOR1("CSUBG_MF_PDF must be NONE or TRIANGLE") -ENDIF -IF(XTSTEP_TS<0._JPRB) THEN - CALL ABOR1("XTSTEP_TS must be positive or null") -ENDIF -IF (CSNOWRIMING/='OLD ' .AND. CSNOWRIMING/='M90 ') THEN - CALL ABOR1("CSNOWRIMING must be 'OLD ' or 'M90 '") -ENDIF -IF (CFRAC_ICE_ADJUST/='T' .AND. CFRAC_ICE_ADJUST/='O' .AND. & - &CFRAC_ICE_ADJUST/='N' .AND. CFRAC_ICE_ADJUST/='S') THEN - CALL ABOR1("CFRAC_ICE_ADJUST must be 'T' or 'O' or 'N' or 'S'") -ENDIF -IF (CFRAC_ICE_SHALLOW_MF/='T' .AND. CFRAC_ICE_SHALLOW_MF/='O' .AND. & - &CFRAC_ICE_SHALLOW_MF/='N' .AND. CFRAC_ICE_SHALLOW_MF/='S') THEN - CALL ABOR1("CFRAC_ICE_SHALLOW_MF must be 'T' or 'O' or 'N' or 'S'") -ENDIF -IF(XSPLIT_MAXCFL<=0._JPRB .OR. XSPLIT_MAXCFL>1.) THEN - CALL ABOR1("XSPLIT_MAXCFL must be positive and inferior to 1.") +IF ( (CMICRO == 'ICE4') .AND. .NOT.YH%LACTIVE ) THEN + CALL ABOR1("ICE4 microphysics requires activation of YH in NAMGFL") ENDIF IF (LFPREC3D.AND.YGFL%NGFL_EZDIAG < 4) THEN CALL ABOR1 ("With LFPREC3D NGFL_EZDIAG should be >= 4 !") ENDIF -IF (LOCND2 .AND. LDEPSG) THEN - CALL ABOR1 ("LDEPSG must not be activated together with LOCND2") -ENDIF +IF ( CTURB /= 'TKEL' .AND. CTURB /= 'NONE') THEN + CALL ABOR1("AROME turbulence (CTURB) must be TKEL or NONE") +ENDIF ! 3.Initialisation du buffer contenant les variables pseudo-historiques @@ -645,15 +320,8 @@ ENDIF ! 4. Write in kulout WRITE(UNIT=KULOUT,FMT='('' COMMON YOMPARAR '')') -WRITE(UNIT=KULOUT,FMT='('' LOSUBG_COND = '',L5,'' CSUBG_AUCV_RC = '',A4,'' CSUBG_AUCV_RI = '',A4,& - & '' LOSEDIC = '',L5,'' LOSIGMAS ='',L5,'' LSQUALL = '',L5,& - & '' LOLSMC = '',L5,'' LOTOWNC = '',L5,'' VSIGQSAT = '',F6.2)')& - & LOSUBG_COND, CSUBG_AUCV_RC, CSUBG_AUCV_RI, LOSEDIC, LOSIGMAS,LSQUALL,LOLSMC,LOTOWNC,VSIGQSAT -WRITE(UNIT=KULOUT,FMT='('' CSUBG_RC_RR_ACCR = '',A80,& -& '' CSUBG_RR_EVAP = '',A80, '' CSUBG_PR_PDF = '',A80, '' CCONDENS = '', A80, '' CSUBG_MF_PDF = '', A80)')& -& CSUBG_RC_RR_ACCR, CSUBG_RR_EVAP, CSUBG_PR_PDF, CCONDENS, CSUBG_MF_PDF -WRITE(UNIT=KULOUT,FMT='('' CLAMBDA3 = '',A80)')& -& CLAMBDA3 +WRITE(UNIT=KULOUT,FMT='('' LSQUALL = '',L5,'' LOLSMC = '',L5,'' LOTOWNC = '',L5)')& + & LSQUALL,LOLSMC,LOTOWNC WRITE(UNIT=KULOUT,FMT='('' NREFROI1 = '',I3,& & '' NREFROI2 = '',I3,'' VSQUALL = '',E13.6)')NREFROI1, NREFROI2,VSQUALL WRITE(UNIT=KULOUT,FMT='('' NGPAR = '',I3,& @@ -675,64 +343,19 @@ WRITE(UNIT=KULOUT,FMT='('' LDIAGWMAX = '',L5,& WRITE(UNIT=KULOUT,FMT='('' NRR = '',I3,& & '' NRRL = '',I3,'' NRRI = '',I3)')& & NRR, NRRL, NRRI -WRITE(UNIT=KULOUT,FMT='(& - & '' CMICRO = '',A4,'' CSEDIM = '',A4,'' LCRIAUTI = '',L5,'' LFPREC3D = '',L5)')& - & CMICRO,CSEDIM,LCRIAUTI,LFPREC3D -WRITE(UNIT=KULOUT,FMT='(& - & '' RCRIAUTI = '',E13.6,'' RT0CRIAUTI = '',E13.6,'' RCRIAUTC = '',E13.6)')& - & RCRIAUTI,RT0CRIAUTI,RCRIAUTC -WRITE(UNIT=KULOUT,FMT='('' CMF_UPDRAFT = '',A4,& - & '' CMF_CLOUD = '',A4)')& - & CMF_UPDRAFT,CMF_CLOUD - -WRITE(UNIT=KULOUT,FMT='(''Mass Flux Scheme tuning variables :'')') -WRITE(UNIT=KULOUT,FMT='(''XALP_PERT = '',F6.3,'' XABUO = '',F6.3,'' XBENTR = '',F6.3,& -&'' XBDETR = '',F6.3,'' XCMF = '',F6.3,'' XENTR_MF = '',F6.3,'' XCRAD_MF = '',F6.3,& -&'' XENTR_DRY = '',F6.3,'' XDETR_DRY = '',F6.3,'' XDETR_LUP = '',F6.3,& -&'' XKCF_MF = '',F6.3,'' XKCF_MF = '',F6.3,'' XTAUSIGMF = '',F6.2,'' XPRES_UV = '',F6.3,& -&'' XFRAC_UP_MAX = '',F6.3,'' XALPHA_MF = '',F6.3,'' XSIGMA_MF = '',F6.3)')& -&XALP_PERT,XABUO,XBENTR,XBDETR,XCMF,XENTR_MF,XCRAD_MF,XENTR_DRY,XDETR_DRY,XDETR_LUP,& -&XKCF_MF,XKCF_MF,XTAUSIGMF,XPRES_UV,XFRAC_UP_MAX,XALPHA_MF,XSIGMA_MF - -WRITE(UNIT=KULOUT,FMT='(''Tuning variables for compute_updraft_rhcj10 :'')') -WRITE(UNIT=KULOUT,FMT='(''XA1 = '',F6.3,'' XB = '',F6.3,'' XC = '',F6.3,& -&'' XBETA1 = '',F6.3,'' XR = '',F6.3,'' XLAMBDA = '',F6.3)')& -&XA1,XB,XC,XBETA1,XR,XLAMBDA - - -WRITE(UNIT=KULOUT,FMT='('' XLINI = '',E13.6)') XLINI -WRITE(UNIT=KULOUT,FMT='('' XTSTEP_TS = '',E13.6)') XTSTEP_TS -WRITE(UNIT=KULOUT,FMT='('' CSNOWRIMING = '',A4,''XFRACM90 = '',E13.6)') CSNOWRIMING, XFRACM90 -WRITE(UNIT=KULOUT,FMT='('' XMRSTEP = '',E13.6)') XMRSTEP -WRITE(UNIT=KULOUT,FMT='('' NMAXITER_MICRO = '',I3)') NMAXITER_MICRO -WRITE(UNIT=KULOUT,FMT='('' LFEEDBACKT= '',L5,'' LEVLIMIT= '',L5,'' LNULLWETG= '',L5,& -&'' LWETGPOST= '',L5,'' LNULLWETH= '',L5,'' LWETHPOST= '',L5,& -&'' LCONVHG= '',L5,'' LCFRLIMIT= '',L5)') LFEEDBACKT, LEVLIMIT, LNULLWETG, & -&LWETGPOST, LNULLWETH, LWETHPOST, LCONVHG, LCRFLIMIT -WRITE(UNIT=KULOUT,FMT='('' CFRAC_ICE_ADJUST = '',A1,& -&'' CFRAC_ICE_SHALLOW_MF = '',A1)') CFRAC_ICE_ADJUST, CFRAC_ICE_SHALLOW_MF -WRITE(UNIT=KULOUT,FMT='('' XSPLIT_MAXCFL = '',E13.6)') XSPLIT_MAXCFL -WRITE(UNIT=KULOUT,FMT='('' LSEDIM_AFTER = '',L5)') LSEDIM_AFTER +WRITE(UNIT=KULOUT,FMT='('' CTURB = '',A4,& + & '' CMICRO = '',A4,'' LFPREC3D = '',L5)')& + & CTURB,CMICRO,LFPREC3D + WRITE(UNIT=KULOUT,FMT=*) 'XCQVR=',XCQVR,' GQVPLIM=',GQVPLIM,' GQVTOP=',GQVTOP,' LQVTOP=',LQVTOP WRITE(UNIT=KULOUT,FMT='('' LLCRIT = '',L5)') LLCRIT WRITE(UNIT=KULOUT,FMT='('' LTOTPREC = '',L5)') LTOTPREC WRITE(UNIT=KULOUT,FMT='('' LTOTPRECL = '',L5)') LTOTPRECL -WRITE(UNIT=KULOUT,FMT='('' LOCND2 = '',L5)') LOCND2 WRITE(UNIT=KULOUT,FMT='('' LKOGAN = '',L5)') LKOGAN -WRITE(UNIT=KULOUT,FMT='('' LHGT_QS = '',L5)') LHGT_QS -WRITE(UNIT=KULOUT,FMT='('' LSTATNW = '',L5)') LSTATNW WRITE(UNIT=KULOUT,FMT='('' LMODICEDEP = '',L5)') LMODICEDEP WRITE(UNIT=KULOUT,FMT='('' RADSN = '',f6.2)') RADSN WRITE(UNIT=KULOUT,FMT='('' RADGR = '',f6.2)') RADGR -WRITE(UNIT=KULOUT,FMT='('' RFRMIN = '',40E10.3)') RFRMIN -WRITE(UNIT=KULOUT,FMT='('' LHARATU = '',L2)') LHARATU WRITE(UNIT=KULOUT,FMT='('' LICERAD = '',L5)') LICERAD -WRITE(UNIT=KULOUT,FMT='('' LDEPOSC = '',L5)') LDEPOSC -WRITE(UNIT=KULOUT,FMT='('' XVDEPOSC = '',E13.6)') XVDEPOSC -WRITE(UNIT=KULOUT,FMT='('' LDEPSG = '',L2,'' RDEPSRED = '',F6.2,'' RDEPGRED = '',F6.2& -&)') LDEPSG,RDEPSRED,RDEPGRED - -WRITE(UNIT=KULOUT,FMT='('' NPROMICRO = '',I4)') NPROMICRO ! ----------------------------------------------------------------------- END ASSOCIATE diff --git a/src/arome/ext/suphmpa.F90 b/src/arome/ext/suphmpa.F90 index 9eb491545c55dfb1053f61f0e5004b72e2942014..9149301b6ac4fc010afdf5957237ac09b4a496a7 100644 --- a/src/arome/ext/suphmpa.F90 +++ b/src/arome/ext/suphmpa.F90 @@ -53,12 +53,13 @@ USE MODEL_PHYSICS_MF_MOD , ONLY : MODEL_PHYSICS_MF_TYPE USE GEOMETRY_MOD , ONLY : GEOMETRY USE PARKIND1 ,ONLY : JPIM ,JPRB USE YOMHOOK ,ONLY : LHOOK, DR_HOOK - +USE YOMLUN ,ONLY : NULNAM USE YOMLDDH , ONLY : TLDDH USE YOMCT0 ,ONLY : LTWOTL, LELAM -USE MODD_BUDGET, ONLY : TBUCONF_ASSOCIATE +USE MODD_BUDGET, ONLY : TBUCONF_ASSOCIATE, TBUCONF +USE MODI_INI_PHYEX, ONLY: INI_PHYEX ! ------------------------------------------------------------------ @@ -73,124 +74,92 @@ INTEGER(KIND=JPIM),INTENT(IN) :: KULOUT ! ------------------------------------------------------------------ -REAL(KIND=JPRB) :: ZTSTEP +REAL(KIND=JPRB) :: ZTSTEP, ZDZMIN REAL(KIND=JPRB) :: ZHOOK_HANDLE +CHARACTER(LEN=4) :: CSCONV -LOGICAL :: LLNOTMAP ! ------------------------------------------------------------------ #include "sucvmnh.intfb.h" -#include "aroini_cstmnh.h" -#include "aroini_micro.h" #include "aroini_budget.h" -#include "aroini_turb.h" #include "abor1.intfb.h" -#include "aroini_mfshal.h" - #include "aroini_micro_lima.h" IF (LHOOK) CALL DR_HOOK('SUPHMPA',0,ZHOOK_HANDLE) ASSOCIATE(YDDIM=>YDGEOMETRY%YRDIM,YDDIMV=>YDGEOMETRY%YRDIMV,YDGEM=>YDGEOMETRY%YRGEM, YDMP=>YDGEOMETRY%YRMP, & & YDPHY=>YDML_PHY_MF%YRPHY,YDRIP=>YDML_GCONF%YRRIP,YDARPHY=>YDML_PHY_MF%YRARPHY,YDPARAR=>YDML_PHY_MF%YRPARAR) -ASSOCIATE(XDETR_LUP=>YDPARAR%XDETR_LUP, XCMF=>YDPARAR%XCMF, & - & XBDETR=>YDPARAR%XBDETR, XLINI=>YDPARAR%XLINI, XABUO=>YDPARAR%XABUO, & - & XLAMBDA=>YDPARAR%XLAMBDA, RT0CRIAUTI=>YDPARAR%RT0CRIAUTI, & - & XKCF_MF=>YDPARAR%XKCF_MF, XALP_PERT=>YDPARAR%XALP_PERT, & - & NSPLITR=>YDPARAR%NSPLITR, NSPLITG=>YDPARAR%NSPLITG, XSIGMA_MF=>YDPARAR%XSIGMA_MF, XA1=>YDPARAR%XA1, & - & CMICRO=>YDPARAR%CMICRO, XENTR_DRY=>YDPARAR%XENTR_DRY, & - & XENTR_MF=>YDPARAR%XENTR_MF, CSEDIM=>YDPARAR%CSEDIM, NSV=>YDPARAR%NSV, & - & XFRAC_UP_MAX=>YDPARAR%XFRAC_UP_MAX, XB=>YDPARAR%XB, XC=>YDPARAR%XC, & - & XTAUSIGMF=>YDPARAR%XTAUSIGMF, RCRIAUTC=>YDPARAR%RCRIAUTC, & - & XDETR_DRY=>YDPARAR%XDETR_DRY, XR=>YDPARAR%XR, RCRIAUTI=>YDPARAR%RCRIAUTI, & - & LOWARM=>YDPARAR%LOWARM, XBENTR=>YDPARAR%XBENTR, XBETA1=>YDPARAR%XBETA1, & - & LAROBU_ENABLE=>YDPARAR%LAROBU_ENABLE, LCRIAUTI=>YDPARAR%LCRIAUTI, & - & XKRC_MF=>YDPARAR%XKRC_MF, XALPHA_MF=>YDPARAR%XALPHA_MF, & - & XPRES_UV=>YDPARAR%XPRES_UV, NRR=>YDPARAR%NRR, XCRAD_MF=>YDPARAR%XCRAD_MF, & - & CMF_UPDRAFT=>YDPARAR%CMF_UPDRAFT, LHARATU=>YDPARAR%LHARATU, LOSUBG_COND=>YDPARAR%LOSUBG_COND,& - & LSTATNW=>YDPARAR%LSTATNW, & +ASSOCIATE(NSPLITR=>YDPARAR%NSPLITR, NSPLITG=>YDPARAR%NSPLITG, & + & CMICRO=>YDPARAR%CMICRO, CTURB=>YDPARAR%CTURB, NSV=>YDPARAR%NSV, & + & LAROBU_ENABLE=>YDPARAR%LAROBU_ENABLE, & + & NRR=>YDPARAR%NRR,& & LMPA=>YDARPHY%LMPA, LKFBCONV=>YDARPHY%LKFBCONV, LMFSHAL=>YDARPHY%LMFSHAL, & & LGRADHPHY=>YDARPHY%LGRADHPHY, & & NPROMA=>YDDIM%NPROMA, & & LEDKF=>YDPHY%LEDKF, LCVPPKF=>YDPHY%LCVPPKF, & & NFLEVG=>YDDIMV%NFLEVG, & - & LSDDH=>YDLDDH%LSDDH, TSTEP=>YDRIP%TSTEP, RFRMIN=>YDPARAR%RFRMIN, & - & XTSTEP_TS=>YDPARAR%XTSTEP_TS, CSNOWRIMING=>YDPARAR%CSNOWRIMING, XMRSTEP=>YDPARAR%XMRSTEP,& - & NMAXITER_MICRO=>YDPARAR%NMAXITER_MICRO, LFEEDBACKT=>YDPARAR%LFEEDBACKT, LEVLIMIT=>YDPARAR%LEVLIMIT, & - & LNULLWETG=>YDPARAR%LNULLWETG, LWETGPOST=>YDPARAR%LWETGPOST, LNULLWETH=>YDPARAR%LNULLWETH,& - & LWETHPOST=>YDPARAR%LWETHPOST, XFRACM90=>YDPARAR%XFRACM90, LCONVHG=>YDPARAR%LCONVHG, & - & CSUBG_RC_RR_ACCR=>YDPARAR%CSUBG_RC_RR_ACCR, CSUBG_RR_EVAP=>YDPARAR%CSUBG_RR_EVAP, & - & CSUBG_PR_PDF=>YDPARAR%CSUBG_PR_PDF, LCRFLIMIT=>YDPARAR%LCRFLIMIT, & - & CFRAC_ICE_ADJUST=>YDPARAR%CFRAC_ICE_ADJUST, XSPLIT_MAXCFL=>YDPARAR%XSPLIT_MAXCFL,& - & CFRAC_ICE_SHALLOW_MF=>YDPARAR%CFRAC_ICE_SHALLOW_MF, LSEDIM_AFTER=>YDPARAR%LSEDIM_AFTER,& - & LDEPOSC=>YDPARAR%LDEPOSC, XVDEPOSC=>YDPARAR%XVDEPOSC,& - & LDEPSG=>YDPARAR%LDEPSG,RDEPSRED=>YDPARAR%RDEPSRED,RDEPGRED=>YDPARAR%RDEPGRED,& - & LMIXUV=>YDPARAR%LMIXUV,CMF_CLOUD=>YDPARAR%CMF_CLOUD,CCONDENS=>YDPARAR%CCONDENS,& - & CLAMBDA3=>YDPARAR%CLAMBDA3,CSUBG_MF_PDF=>YDPARAR%CSUBG_MF_PDF,LSIGMAS=>YDPARAR%LOSIGMAS,& - & LOSEDIC=>YDPARAR%LOSEDIC ) + & LSDDH=>YDLDDH%LSDDH, TSTEP=>YDRIP%TSTEP, & + & RADGR=>YDPARAR%RADGR, RADSN=>YDPARAR%RADSN,& + & PHYEX=>YDPARAR%PHYEX) ! ------------------------------------------------------------------ ! ------------------------------------------------------------------ ! 1. Initialisation of MesoNH constantes - -IF (LELAM) THEN - LLNOTMAP=.NOT.YDGEOMETRY%YREGEO%LMAP +! Initialisation for microphysics scheme +! Initialisation of Mass Flux Shallow convection scheme +! +ZTSTEP=TSTEP +ZDZMIN=20. +IF(LMFSHAL.OR.LEDKF) THEN + CSCONV='EDKF' ELSE - LLNOTMAP=.TRUE. + CSCONV='NONE' +ENDIF +CALL INI_PHYEX(PHYEX%MISC%CPROGRAM, NULNAM, .TRUE., KULOUT, 0, 1, & + ZTSTEP, ZDZMIN, & + CMICRO, CSCONV, CTURB, & + KPRINT=2, & + PHYEX_OUT=PHYEX) + +! Ensure consistency +IF (.NOT. PHYEX%PARAM_ICEN%LOCND2) THEN + RADGR=0._JPRB + RADSN=0._JPRB ENDIF -CALL AROINI_CSTMNH (KULOUT,LTWOTL,LLNOTMAP) - -! 2. Initialisation for microphysics scheme -ZTSTEP=TSTEP IF (CMICRO == 'LIMA') THEN - CALL AROINI_MICRO (KULOUT,ZTSTEP,LOWARM,'ICE3',NSPLITR,CSEDIM,LCRIAUTI,& - & RCRIAUTI,RT0CRIAUTI,RCRIAUTC, XTSTEP_TS, CSNOWRIMING, XMRSTEP,& - & NMAXITER_MICRO, LFEEDBACKT, LEVLIMIT, LNULLWETG, LWETGPOST, LNULLWETH,& - & LWETHPOST, XFRACM90, LCONVHG, CSUBG_RC_RR_ACCR, CSUBG_RR_EVAP, CSUBG_PR_PDF,& - & LCRFLIMIT, CFRAC_ICE_ADJUST, XSPLIT_MAXCFL,& - & CFRAC_ICE_SHALLOW_MF, LSEDIM_AFTER, LDEPOSC, XVDEPOSC, RFRMIN,& - & LDEPSG,RDEPSRED,RDEPGRED,LOSEDIC) - CALL AROINI_MICRO_LIMA (KULOUT,4,ZTSTEP,LOWARM,CMICRO,NSPLITR,NSPLITG,CSEDIM,LCRIAUTI,& - & RCRIAUTI,RT0CRIAUTI,RCRIAUTC) -ELSE -CALL AROINI_MICRO (KULOUT,ZTSTEP,LOWARM,CMICRO,NSPLITR,CSEDIM,LCRIAUTI,& - & RCRIAUTI,RT0CRIAUTI,RCRIAUTC, XTSTEP_TS, CSNOWRIMING, XMRSTEP,& - & NMAXITER_MICRO, LFEEDBACKT, LEVLIMIT, LNULLWETG, LWETGPOST, LNULLWETH,& - & LWETHPOST, XFRACM90, LCONVHG, CSUBG_RC_RR_ACCR, CSUBG_RR_EVAP, CSUBG_PR_PDF,& - & LCRFLIMIT, CFRAC_ICE_ADJUST, XSPLIT_MAXCFL,& - & CFRAC_ICE_SHALLOW_MF, LSEDIM_AFTER, LDEPOSC, XVDEPOSC, RFRMIN,& - & LDEPSG,RDEPSRED,RDEPGRED,LOSEDIC) - ENDIF + CALL AROINI_MICRO_LIMA (KULOUT,NULNAM,ZTSTEP,CMICRO,NSPLITR,NSPLITG) +ENDIF ! 3. Initialisation of Budget LAROBU_ENABLE=LMPA.AND.LSDDH CALL AROINI_BUDGET(LAROBU_ENABLE) - -! 4. Initialisation of Turbulence scheme - -CALL AROINI_TURB(XLINI,LHARATU,LSTATNW,LOSUBG_COND,CCONDENS,CLAMBDA3,CSUBG_MF_PDF,LSIGMAS) - -! 5. Initialisation of Mass Flux Shallow convection scheme - -IF(LMFSHAL.OR.LEDKF) CALL AROINI_MFSHAL(XALP_PERT,XABUO,XBENTR,XBDETR,XCMF,XENTR_MF,XCRAD_MF,XENTR_DRY,& - & XDETR_DRY,XDETR_LUP,XKCF_MF,XKRC_MF,XTAUSIGMF,XPRES_UV,XFRAC_UP_MAX,& - & XALPHA_MF,XSIGMA_MF,XA1,XB,XC,XBETA1,XR,XLAMBDA,CMF_UPDRAFT,CMF_CLOUD,LMIXUV) +! 4. PHYEX%MISC +PHYEX%MISC%TBUCONF = TBUCONF +IF (LELAM) THEN + PHYEX%MISC%OFLAT=.NOT.YDGEOMETRY%YREGEO%LMAP +ELSE + PHYEX%MISC%OFLAT=.TRUE. +ENDIF IF (LMFSHAL.AND.YDML_GCONF%YGFL%NGFL_EZDIAG < 3) THEN CALL ABOR1 ("With LMFSHAL NGFL_EZDIAG should be >= 3 !") ENDIF +IF (PHYEX%TURBN%LHARAT .AND. PHYEX%PARAM_MFSHALLN%CMF_UPDRAFT == 'EDKF') THEN + CALL ABOR1('Combination LHARATU and EDKF not valid!') +ENDIF + +IF (PHYEX%TURBN%CTURBDIM == '3DIM') THEN + CALL ABOR1('TURBDIM cannot be 3DIM with AROME') +ENDIF + ! 6. Initialisation of Convection scheme IF(LKFBCONV.OR.LCVPPKF) THEN CALL SUCVMNH(YDML_PHY_MF,KULOUT) ENDIF -! 7. Initialisation of nebulosity computation - -CALL AROINI_NEB - ! 8. Initialisation of The Horizontal Gradient on Z levels for 3D turbulence ! Quand il y aura des initialisations IF (LGRADHPHY .AND. .NOT. LELAM) THEN diff --git a/src/arome/ext/vdfhghtnhl.F90 b/src/arome/ext/vdfhghtnhl.F90 index 169b233f5a1709606bd327726123b2b85fc2fae4..b71613613737f39ce31a87b7e161e0404f8864f6 100644 --- a/src/arome/ext/vdfhghtnhl.F90 +++ b/src/arome/ext/vdfhghtnhl.F90 @@ -146,8 +146,8 @@ USE YOEVDF , ONLY : TVDF !for optimation USE MODD_CST -USE MODD_RAIN_ICE_DESCR -USE MODD_RAIN_ICE_PARAM +USE MODD_RAIN_ICE_DESCR_n +USE MODD_RAIN_ICE_PARAM_n USE MODE_TIWMX_TAB USE MODE_TIWMX @@ -329,7 +329,7 @@ ASSOCIATE(RTAUMEL=>YDECUMF%RTAUMEL, & & R5ALSCP=>YDTHF%R5ALSCP, RALVDCP=>YDTHF%RALVDCP, RALSDCP=>YDTHF%RALSDCP, & & RTWAT=>YDTHF%RTWAT, RTICE=>YDTHF%RTICE, RTICECU=>YDTHF%RTICECU, RTWAT_RTICE_R=>YDTHF%RTWAT_RTICE_R, & & RTWAT_RTICECU_R=>YDTHF%RTWAT_RTICECU_R, & - & YSURF=>YDEPHY%YSURF,LHARATU=>YDPARAR%LHARATU, & + & YSURF=>YDEPHY%YSURF,LHARATU=>YDPARAR%PHYEX%TURBN%LHARAT, & & LTOTPREC=>YDPARAR%LTOTPREC,LTOTPRECL=>YDPARAR%LTOTPRECL) ZWL= 200._JPRB diff --git a/src/arome/ext/yomparar.F90 b/src/arome/ext/yomparar.F90 index 808083cd3ba6fd2c3f191e7afe02aaf3f5de40ba..246b6f042c3f8503c5de47e928a7152e1e84f71d 100644 --- a/src/arome/ext/yomparar.F90 +++ b/src/arome/ext/yomparar.F90 @@ -1,6 +1,8 @@ MODULE YOMPARAR USE PARKIND1 ,ONLY : JPIM ,JPRB +! +USE MODD_PHYEX, ONLY: PHYEX_t IMPLICIT NONE @@ -13,10 +15,10 @@ TYPE TPARAR ! VARIABLES pour utiliser la PHYSIQUE de meso_NH : ! VARIABLES to use the MESO-NH physics: -CHARACTER(LEN=4) :: CMICRO ! Microphysics scheme ('OLD3', 'OLD4', 'ICE3', - ! 'ICE4' or 'LIMA') -CHARACTER(LEN=4) :: CSEDIM ! Microphysics sedimentation scheme - ! (SPLI or STAT) +CHARACTER(LEN=4) :: CMICRO !< Microphysics scheme ('ICE3', 'ICE4' or 'LIMA') +CHARACTER(LEN=4) :: CTURB !< Turbulence scheme ('TKEL', 'NONE') +TYPE(PHYEX_t) :: PHYEX !< PHYEX constants +! INTEGER(KIND=JPIM) :: NSPLITR ! Time splitting for Eulerian sedimentation INTEGER(KIND=JPIM) :: NSPLITG ! Time splitting for Eulerian sedimentation INTEGER(KIND=JPIM) :: NRR, NRRL, NRRI !number of microphysical species @@ -48,15 +50,9 @@ INTEGER(KIND=JPIM) :: MCD !pointer on drag coefficient REAL(KIND=JPRB), DIMENSION(:), ALLOCATABLE :: XSW_BANDS !SW spectral bands ! for ext. surface scheme -LOGICAL :: LOSUBG_COND ! switch to activate subgrid condensation -LOGICAL :: LOSEDIC ! activate cloud sedimentation -LOGICAL :: LOWARM ! see OWARM in mesoNH -LOGICAL :: LOSIGMAS ! activate calculation of variance of departure to - ! saturation in turb scheme (to be used in subgrid condensation) LOGICAL :: LOLSMC ! Land/sea mask for cloud droplet number conc. LOGICAL :: LOTOWNC ! Town mask for cloud droplet number conc. -LOGICAL :: LOCND2 ! Separate solid and liquid phase LOGICAL :: LKOGAN ! Use Kogan autocoversion of liquid LOGICAL :: LMODICEDEP ! Logical switch for alternative dep/evap of ice LOGICAL :: LICERAD ! Assume higher fraction of condensate for @@ -65,67 +61,12 @@ LOGICAL :: LICERAD ! Assume higher fraction of condensate for REAL(KIND=JPRB) :: RADGR ! Tuning of ice for radiation, TO BE REMOVED REAL(KIND=JPRB) :: RADSN ! Tuning of ice for radiation, TO BE REMOVED -REAL(KIND=JPRB) :: VSIGQSAT ! coeff applied to qsat variance contribution - ! for subgrid condensation - -! Constants / tuning parameters for possible modifying some processes related to -! graupeln in RFRMIN(1:8), IN - concentration in RFRMIN(9) and Kogan -! autoconversion in RFRMIN(10:11). -REAL(KIND=JPRB) :: RFRMIN(40) - -! switches for MF scheme (Pergaud et al) -CHARACTER (LEN=4) :: CMF_UPDRAFT ! Type of Mass Flux Scheme - ! 'NONE','DUAL', 'EDKF', 'RHCJ' or 'RAHA' -CHARACTER (LEN=4) :: CMF_CLOUD ! type of cloud scheme associated with MF Scheme - ! 'NONE', 'DIRE' or 'STAT' -LOGICAL :: LMIXUV ! True if mixing of momentum - LOGICAL :: LLCRIT ! True if temperature dependent ! critical condensation in EDMFm LOGICAL :: LTOTPREC ! True if precipitation tendencies ! from the sub-grid scheme are ! added to the total precip tendencies. LOGICAL :: LTOTPRECL ! As LTOTPREC but updraft fraction untouched -LOGICAL :: LHGT_QS ! Switch for height dependent VQSIGSAT - -! Tuning variables for MF scheme - -REAL(KIND=JPRB) :: XALP_PERT ! coefficient for the perturbation of - ! theta_l and r_t at the first level of - ! the updraft -REAL(KIND=JPRB) :: XABUO ! coefficient of the buoyancy term in the w_up equation -REAL(KIND=JPRB) :: XBENTR ! coefficient of the entrainment term in the w_up equation -REAL(KIND=JPRB) :: XBDETR ! coefficient of the detrainment term in the w_up equation -REAL(KIND=JPRB) :: XCMF ! coefficient for the mass flux at the first level - ! of the updraft (closure) -REAL(KIND=JPRB) :: XENTR_MF ! entrainment constant (m/Pa) = 0.2 (m) -REAL(KIND=JPRB) :: XCRAD_MF ! cloud radius in cloudy part -REAL(KIND=JPRB) :: XENTR_DRY ! coefficient for entrainment in dry part -REAL(KIND=JPRB) :: XDETR_DRY ! coefficient for detrainment in dry part -REAL(KIND=JPRB) :: XDETR_LUP ! coefficient for detrainment in dry part -REAL(KIND=JPRB) :: XKCF_MF ! coefficient for cloud fraction -REAL(KIND=JPRB) :: XKRC_MF ! coefficient for convective rc -REAL(KIND=JPRB) :: XTAUSIGMF ! typical eddy turnover time for the STAT cloud scheme of EDMF -REAL(KIND=JPRB) :: XPRES_UV ! coefficient for pressure term in wind mixing -REAL(KIND=JPRB) :: XFRAC_UP_MAX ! maximum Updraft fraction -REAL(KIND=JPRB) :: XALPHA_MF ! coefficient for updraft fraction in STA2 cloud scheme -REAL(KIND=JPRB) :: XSIGMA_MF ! coefficient for sigma in STA2 cloud scheme - -! Tuning variables for RHCJ10 updraft : - -REAL(KIND=JPRB) :: XA1 ! Tuning variables for RHCJ10 updraft -REAL(KIND=JPRB) :: XB ! Tuning variables for RHCJ10 updraft -REAL(KIND=JPRB) :: XC ! Tuning variables for RHCJ10 updraft -REAL(KIND=JPRB) :: XBETA1 ! Tuning variables for RHCJ10 updraft - -! Tuning parameter for Hourdin et al closure - -REAL(KIND=JPRB) :: XR ! Tuning parameter for Hourdin et al closure - -! Thermodynamic constant to compute thetas from thetal - -REAL(KIND=JPRB) :: XLAMBDA ! Thermodynamic constant to compute thetas from thetal -LOGICAL :: LTHETAS ! TRUE to use Thetas, FALSE to use Thetal ! * for the squall line case: LOGICAL :: LSQUALL ! use for the squall line case @@ -147,61 +88,6 @@ INTEGER(KIND=JPIM) :: NDIAGWMAX ! frequency of preceding prints (in time step) INTEGER(KIND=JPIM) :: NDTCHEM ! time step factor for chemical scheme !* for MNH budget anlysis LOGICAL :: LAROBU_ENABLE ! for MNH budget anlysis -!* for turbulence scheme -REAL(KIND=JPRB) :: XLINI ! minimum bl89 mixing length -LOGICAL :: LSTATNW ! updated full statistical cloud scheme - ! (yet only to be used in combination with EDMFm convection (DUAL)) -LOGICAL :: LHARATU ! if true RACMO turbulence is used - ! (yet only to be used in combination with EDMFm convection (DUAL)) -!* Subgrid precipitation scheme -CHARACTER (LEN=4) :: CSUBG_AUCV_RC ! type of rc->rr autoconversion scheme - ! 'CLFR', 'PDF' or 'NONE' -CHARACTER(LEN=80) :: CSUBG_RC_RR_ACCR ! type of rc rc autoconversion - ! 'PRFR' or 'NONE' -CHARACTER(LEN=80) :: CSUBG_RR_EVAP ! type of evaporation scheme - ! 'PRFR, 'CLFR' or 'NONE' -CHARACTER(LEN=80) :: CSUBG_PR_PDF ! PDF chosen for precipitation production - ! (NONE, SIGM, HLCRECTPD, HLCTRIANGPDF, HLCQUADRAPDF or HLCISOTRIPDF) -CHARACTER(LEN=80) :: CSUBG_AUCV_RI ! type of ri->rs autoconversion scheme - ! 'NONE', 'CLFR' or 'ADJU' -CHARACTER(LEN=80) :: CSUBG_MF_PDF ! PDF to use on MF cloud to retrieve low and high cloud parts - ! 'NONE' or 'TRIANGLE' - -!* for autoconversion qi,qc -REAL(KIND=JPRB) :: RCRIAUTI ! ice autoconversion threshold -REAL(KIND=JPRB) :: RCRIAUTC ! cloud water autoconversion threshold -REAL(KIND=JPRB) :: RT0CRIAUTI ! temperature threshold for ice autoconversion -LOGICAL :: LCRIAUTI ! to activate use of namelists parameters for ice autoconversion -REAL(KIND=JPRB) :: XTSTEP_TS ! Approximative time step for microphysics time-splitting (0 for no time-splitting) -REAL(KIND=JPRB) :: XMRSTEP ! Maximum mixing ratio change before computing again microphysical tendencies -INTEGER(KIND=JPIM) :: NMAXITER_MICRO ! Maximum number of iterations for mixing ratio or time splitting -!* for the snow riming -CHARACTER (LEN=4) :: CSNOWRIMING ! choice of the snow riming parameterisation - ! 'OLD' or 'M90' (Murakami 1990) -REAL(KIND=JPRB) :: XFRACM90 ! Fraction used for the Murakami 1990 formulation -!* for the graupel and the hail growth -LOGICAL :: LNULLWETG ! When .TRUE. graupel wet growth is activated with null rate (to allow water shedding) -LOGICAL :: LWETGPOST ! When .TRUE. graupel wet growth is activated with positive temperature (to allow water shedding) -LOGICAL :: LNULLWETH ! Same as LNULLWETG but for hail -LOGICAL :: LWETHPOST ! Same as LWETGPOST but for hail -! -LOGICAL :: LFEEDBACKT ! When .TRUE. feed back on temperature is taken into account -LOGICAL :: LEVLIMIT ! When .TRUE. water vapour pressure is limited by saturation -LOGICAL :: LCONVHG ! TRUE to allow the conversion from hail to graupel -! -LOGICAL :: LCRFLIMIT !True to limit rain contact freezing to possible heat exchange -LOGICAL :: LDEPOSC !True to switch on water deposition on vegetation (DEPO_ICE3) -CHARACTER(LEN=1) :: CFRAC_ICE_ADJUST ! Rule to compute ice/liquid fraction in adjustments -CHARACTER(LEN=1) :: CFRAC_ICE_SHALLOW_MF ! Rule to compute ice/liquid fraction in shallow_mf -LOGICAL :: LSEDIM_AFTER !Sedimentation done after microphysics (.TRUE.) or before (.FALSE.) -! -REAL(KIND=JPRB) :: XSPLIT_MAXCFL ! Maximum CFL number allowed for SPLIT sedimentation scheme -REAL(KIND=JPRB) :: XVDEPOSC ! Water deposition speed on vegetation (LDEPOSC) (DEPO_ICE3) -! -! for negative deposition (=sublimation) of qs,qg - LOGICAL :: LDEPSG ! activate namelist read of sublimation factors -REAL(KIND=JPRB) :: RDEPSRED ! tuning factor of sublimation of snow -REAL(KIND=JPRB) :: RDEPGRED ! tuning factor of sublimation of graupel ! !* For total cumulative 3D prec flux for MOCAGE LOGICAL :: LFPREC3D ! Switch on total cumulative 3D prec flux output (for MOCAGE use) @@ -211,11 +97,6 @@ REAL(KIND=JPRB) :: GQVPLIM ! pressure value over which qv is damped towards 0 fo REAL(KIND=JPRB) :: GQVTOP ! qv value at the top of the atmopshere. LOGICAL :: LQVTOP ! to activate modification of qv in input to radiation. -INTEGER(KIND=JPIM) :: NPROMICRO ! special cache-blocking factor for microphysics - -CHARACTER(LEN=80) :: CCONDENS !condensation formulation. 'GAUS' or 'CB02' -CHARACTER(LEN=4) :: CLAMBDA3 !formulation for the lambda3 coeff used with s'r'. 'CB' or 'NONE' - END TYPE TPARAR !!TYPE(TPARAR), POINTER :: YRPARAR => NULL() diff --git a/src/arome/gmkpack_ignored_files b/src/arome/gmkpack_ignored_files index 6e945e64a75096fe07c7c65072b845e83fa31591..6b5c73333b85509f08e5f7e22042f20fee7d08a0 100644 --- a/src/arome/gmkpack_ignored_files +++ b/src/arome/gmkpack_ignored_files @@ -266,3 +266,29 @@ phyex/micro/nrcolss.f90 phyex/micro/nscolrg.f90 phyex/micro/nzcolx.f90 phyex/micro/set_conc_lima.f90 +mpa/micro/interface/aroini_micro.h +mpa/micro/externals/aroini_micro.F90 +phyex/micro/modi_ini_rain_ice.F90 +phyex/micro/ini_rain_ice.F90 +phyex/micro/modi_ini_tiwmx.F90 +phyex/micro/ini_tiwmx.F90 +phyex/micro/modi_ini_snow.F90 +phyex/micro/ini_snow.F90 +phyex/aux/modi_ini_cst.F90 +phyex/aux/ini_cst.F90 +mpa/micro/externals/aroini_cstmnh.F90 +mpa/micro/interface/aroini_cstmnh.h +phyex/turb/ini_cmfshall.F90 +phyex/turb/modi_ini_cmfshall.F90 +mpa/turb/externals/aroini_mfshal.F90 +mpa/turb/interface/aroini_mfshal.h +mpa/turb/externals/aroini_turb.F90 +mpa/turb/interface/aroini_turb.h +phyex/turb/ini_cturb.F90 +phyex/turb/modi_ini_cturb.F90 +phyex/micro/modd_rain_ice_param.F90 +phyex/micro/ini_neb.F90 +phyex/micro/modi_ini_neb.F90 +mpa/micro/externals/aroini_neb.F90 +mpa/micro/interface/aroini_neb.h +phyex/turb/modd_diag_in_run.F90 diff --git a/src/arome/ial_version.json b/src/arome/ial_version.json index 655712265303cf1fabcc6df67952ab8d4a5ac8c3..87da05993efe386022bd5c2be23ce4e7d12f1bfa 100644 --- a/src/arome/ial_version.json +++ b/src/arome/ial_version.json @@ -1,5 +1,6 @@ { "cycle":"48t3", "branch":"main", -"version":"01" +"version":"01", +"scripttag":"_nam7" } diff --git a/src/arome/micro/modi_ini_rain_ice.F90 b/src/arome/micro/modi_ini_rain_ice.F90 deleted file mode 100644 index 24dd0d68de12ce2b27d5d2ef3f0a9e60f1978fa1..0000000000000000000000000000000000000000 --- a/src/arome/micro/modi_ini_rain_ice.F90 +++ /dev/null @@ -1,23 +0,0 @@ -! ######spl - MODULE MODI_INI_RAIN_ICE -! ######################## -! -INTERFACE - SUBROUTINE INI_RAIN_ICE ( KLUOUT, PTSTEP, PDZMIN, KSPLITR, HCLOUD ) -! -INTEGER, INTENT(IN) :: KLUOUT ! Logical unit number for prints -INTEGER, INTENT(OUT):: KSPLITR ! Number of small time step - ! integration for rain - ! sedimendation -! -REAL, INTENT(IN) :: PTSTEP ! Effective Time step -! -REAL, INTENT(IN) :: PDZMIN ! minimun vertical mesh size -! -CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! Indicator of the cloud scheme -! -END SUBROUTINE INI_RAIN_ICE -! -END INTERFACE -! -END MODULE MODI_INI_RAIN_ICE diff --git a/src/arome/turb/ini_cmfshall.F90 b/src/arome/turb/ini_cmfshall.F90 deleted file mode 100644 index be8bbfc007e971b855346474292edb41e2ae88a5..0000000000000000000000000000000000000000 --- a/src/arome/turb/ini_cmfshall.F90 +++ /dev/null @@ -1,121 +0,0 @@ -! ######spl - SUBROUTINE INI_CMFSHALL(PALP_PERT,PABUO,PBENTR,PBDETR,PCMF,PENTR_MF,PCRAD_MF,PENTR_DRY,& - & PDETR_DRY,PDETR_LUP,PKCF_MF,PKRC_MF,PTAUSIGMF,PPRES_UV,PFRAC_UP_MAX,& - & PALPHA_MF,PSIGMA_MF,PA1,PB,PC,PBETA1,PR,PLAMBDA) - USE PARKIND1, ONLY : JPRB - USE YOMHOOK , ONLY : LHOOK, DR_HOOK -! ####################### -! -!!**** *INI_CMFSHALL* - routine to initialize the mass flux scheme -!! constants. -!! -!! PURPOSE -!! ------- -! The purpose of this routine is to initialize the mass flux -! scheme constants that are stored in module MODD_PARAM_MFSHALL_n -! -!! METHOD -!! ------ -!! The constants are set to their numerical values -!! -!! EXTERNAL -!! -------- -!! NONE -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! Module MODD_CTURB -!! -!! REFERENCE -!! --------- -!! -!! AUTHOR -!! ------ -!! S. Malardel, J. Pergaud (Meteo France) -!! -!! MODIFICATIONS -!! ------------- -!! S. Riette april 2011 : XALPHA and XSIGMA added -!! S. Riette Jan 2022: Merge with Méso-NH: MODD_MCFSHALL -> MODD_PARAM_MFSHALL_n -!! -------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_PARAM_MFSHALL_n -! -IMPLICIT NONE - -REAL, INTENT(IN) :: PALP_PERT -REAL, INTENT(IN) :: PABUO -REAL, INTENT(IN) :: PBENTR -REAL, INTENT(IN) :: PBDETR -REAL, INTENT(IN) :: PCMF -REAL, INTENT(IN) :: PENTR_MF -REAL, INTENT(IN) :: PCRAD_MF -REAL, INTENT(IN) :: PENTR_DRY -REAL, INTENT(IN) :: PDETR_DRY -REAL, INTENT(IN) :: PDETR_LUP -REAL, INTENT(IN) :: PKCF_MF -REAL, INTENT(IN) :: PKRC_MF -REAL, INTENT(IN) :: PTAUSIGMF -REAL, INTENT(IN) :: PPRES_UV -REAL, INTENT(IN) :: PFRAC_UP_MAX -REAL, INTENT(IN) :: PALPHA_MF -REAL, INTENT(IN) :: PSIGMA_MF -REAL, INTENT(IN) :: PA1 -REAL, INTENT(IN) :: PB -REAL, INTENT(IN) :: PC -REAL, INTENT(IN) :: PBETA1 -REAL, INTENT(IN) :: PR -REAL, INTENT(IN) :: PLAMBDA - -! -! --------------------------------------------------------------------------- -! -! 1. SETTING THE NUMERICAL VALUES -! -REAL(KIND=JPRB) :: ZHOOK_HANDLE -IF (LHOOK) CALL DR_HOOK('INI_CMFSHALL',0,ZHOOK_HANDLE) - -CALL PARAM_MFSHALL_GOTO_MODEL(1, 1) - -XALP_PERT = PALP_PERT ! coefficient for the perturbation of - ! theta_l and r_t at the first level of - ! the updraft -XABUO = PABUO ! coefficient of the buoyancy term in the w_up equation -XBENTR = PBENTR ! coefficient of the entrainment term in the w_up equation -XBDETR = PBDETR ! coefficient of the detrainment term in the w_up equation -XCMF = PCMF ! coefficient for the mass flux at the first level - ! of the updraft (closure) -XENTR_MF = PENTR_MF ! entrainment constant (m/Pa) = 0.2 (m) -XCRAD_MF = PCRAD_MF ! cloud radius in cloudy part -XENTR_DRY = PENTR_DRY ! coefficient for entrainment in dry part -XDETR_DRY = PDETR_DRY ! coefficient for detrainment in dry part -XDETR_LUP = PDETR_LUP ! coefficient for detrainment in dry part -XKCF_MF = PKCF_MF ! coefficient for cloud fraction -XKRC_MF = PKRC_MF ! coefficient for convective rc -XTAUSIGMF = PTAUSIGMF -XPRES_UV = PPRES_UV ! coefficient for pressure term in wind mixing -! -XFRAC_UP_MAX= PFRAC_UP_MAX ! maximum Updraft fraction -! -XALPHA_MF = PALPHA_MF ! coefficient for updraft fraction in STA2 cloud scheme -XSIGMA_MF = PSIGMA_MF ! coefficient for sigma in STA2 cloud scheme - -! tuning variables for compute_updraft_rhcj10 -XA1 = PA1 ! Value Rio et al 2010 -XB = PB ! Value Rio et al 2010 -XC = PC ! Value Rio et al 2010 -XBETA1 = PBETA1 ! Value Rio et al 2010 - -! Parameters for closure assumption of Hourdin et al 2002 - -XR = PR ! Aspect ratio of updraft - -! Thermodynamic parameter - -XLAMBDA_MF = PLAMBDA ! Lambda to compute ThetaS1 from ThetaL - -IF (LHOOK) CALL DR_HOOK('INI_CMFSHALL',1,ZHOOK_HANDLE) -END SUBROUTINE INI_CMFSHALL diff --git a/src/arome/turb/ini_cturb.F90 b/src/arome/turb/ini_cturb.F90 deleted file mode 100644 index 89d469163832a44a71629b3dd87078b351419e90..0000000000000000000000000000000000000000 --- a/src/arome/turb/ini_cturb.F90 +++ /dev/null @@ -1,244 +0,0 @@ -! ######spl - SUBROUTINE INI_CTURB -! #################### -! -!!**** *INI_CTURB* - routine to initialize the turbulence scheme -!! constants. -!! -!! PURPOSE -!! ------- -! The purpose of this routine is to initialize the turbulence -! scheme constants that are stored in module MODD_CTURB -! -!! METHOD -!! ------ -!! The constants are set to their numerical values -!! -!! EXTERNAL -!! -------- -!! NONE -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! Module MODD_CTURB -!! -!! REFERENCE -!! --------- -!! Book 2 of Meso-NH documentation (module INI_CTURB) -!! Book 1 of Meso-NH documentation (Chapter Turbulence) -!! -!! AUTHOR -!! ------ -!! Joan Cuxart * INM and Meteo-France * -!! -!! MODIFICATIONS -!! ------------- -!! Original 08/08/94 -!! J.Cuxart 15/06/95 document more precisely the Shuman cts -!! P.Jabouille 20/10/99 XCET=0.4 -!! V.Masson 13/11/02 XALPSBL and XASBL -!! 05/06 Remove KEPS -!! Q.Rodier 01/19 -!! Remove XASBL (not used) -!! -------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_CST -USE MODD_TURB_n, ONLY : LSTATNW -USE MODD_CTURB -! -USE PARKIND1, ONLY : JPRB -USE YOMHOOK , ONLY : LHOOK, DR_HOOK -! -IMPLICIT NONE -! -REAL(KIND=JPRB) :: ZHOOK_HANDLE -! -IF (LHOOK) CALL DR_HOOK('INI_CTURB',0,ZHOOK_HANDLE) -! -CALL CTURB_ASSOCIATE() -! -! --------------------------------------------------------------------------- -! -! 1. SETTING THE NUMERICAL VALUES -! ---------------------------- -! -! 1.1 Constant for dissipation of Tke -! -! -!XCED = 0.70 -XCED = 0.85 -! Redelsperger-Sommeria (1981) = 0.70 -! Schmidt-Schumann (1989) = 0.845 -! Cheng-Canuto-Howard (2002) = 0.845 -! Rodier, Masson, Couvreux, Paci (2017) = 0.34 -! -! -! 1.2 Constant for wind pressure-correlations -! -!XCEP = 4. -XCEP = 2.11 -! Redelsperger-Sommeria (1981) = 4. -! Schmidt-Schumann (1989) = 3.5 -! Cheng-Canuto-Howard (2002) = 2.11 -! -! -! 1.3 Constant a0 for wind pressure-correlations -! -XA0 = 0.6 -! Redelsperger-Sommeria (1981) = 0.6 -! Schmidt-Schumann (1989) = 0.55 -! Cheng-Canuto-Howard (2002) = 0.6 -! -! -! 1.4 Constant a2 for wind pressure-correlations -! -XA2 = 1. -! Redelsperger-Sommeria (1981) = 1. -! Schmidt-Schumann (1989) = 1. -! Cheng-Canuto-Howard (2002) = 0.57 -! -! -! 1.5 Constant a3 for wind pressure-correlations -! -XA3 = 0. -! Redelsperger-Sommeria (1981) = 0. -! Schmidt-Schumann (1989) = 0.45 -! Cheng-Canuto-Howard (2002) = 0.5 -! -! -! 1.6 Constant for dissipation of th'2, r'2, th'r' -! -XCTD = 1.2 -! Redelsperger-Sommeria (1981) = 1.2 -! Schmidt-Schumann (1989) = 1.01 -! Cheng-Canuto-Howard (2002) = 0.98 -! -! -! 1.7 Constant for temperature and vapor pressure-correlations -! -!wc in STATNW consistent use of Redelsperger-Sommeria for (co)variances -IF (LSTATNW) THEN - XCTP = 4.0 - ELSE - XCTP = 4.65 -ENDIF -! Redelsperger-Sommeria (1981) = 4. -! Schmidt-Schumann (1989) = 3.25 -! Cheng-Canuto-Howard (2002) = 4.65 -! -! -! 1.8 Constant a5 for temperature pressure-correlations -! -XA5 = 1./3. -! Redelsperger-Sommeria (1981) = 1./3. -! Schmidt-Schumann (1989) = 0. -! Cheng-Canuto-Howard (2002) = 1./3. -! -! -! 1.9 Values in the evolution equation of the TKE -! -XCET = 0.40 -! -! Redelsperger-Sommeria (1981) = 0.20 -! Schmidt-Schumann (1989) = 0.33 -! Krettenauer-Schumann (1992) = 0.33 -! Bougeault and Lacarrere(1989)= 0.40 -! -! -! 1.10 Value related to the TKE universal function within SBL -! -XALPSBL = 4.63 -! Redelsperger et al 2001 = 4.63 -! Wyngaard et al. 1974 = 3.75 -! Stull 1988 = 4.75 -! -! -! 1.11 Value related to the shear term in mixing length computation -! -XRM17 = 0.5 ! Rodier et al 2017 -! -! -! 2. Derivated constants -! ------------------- -! -! 2.1 Constant in fluxes equations -! -XCMFS= 2./3./XCEP*(1.-XA0) !Constant for the momentum flux due to shear (RS) -! -! Redelsperger-Sommeria (1981) ......... 0.066 -! Schmidt-Schumann (1989) ......... 0.086 -! -! -XCSHF= 2./3./XCTP !Constant for the sensible heat flux(RS) -! -! Redelsperger-Sommeria (1981) ......... 0.167 -! Schmidt-Schumann (1989) ......... 0.204 -! -! -XCHF= XCSHF !Constant for the humidity flux(RS) -! -! 2.2 Constant in variances and covariances equations -! -XCTV= 2./3./XCTP/XCTD !Constant for the temperature variance(RS) -! -! Redelsperger-Sommeria (1981) ......... 0.139 -! Schmidt-Schumann (1989) ......... 0.202 -! -XCHV= XCTV !Constant for the humidity variance(RS) -! -! Redelsperger-Sommeria (1981) ......... 0.139 -! -! -XCHT1= XCTV/2. !Constants for the temperature-humidity correlation(RS) -XCHT2= XCTV/2. -! -! 2.3 Constant in Prandtl numbers -! -XCPR1= XCTV !Constants for the turbulent Prandtl and Schmidt numbers -XCPR2= XCHT1 -XCPR3= XCPR2 ! used only for the Schmidt number for scalar variables -XCPR4= XCPR2 -XCPR5= XCPR2 -! -! 3. MINIMUM VALUES -! -------------- -! -XTKEMIN=1.E-6 -! -!XLINI=10. ! BL mixing length -XLINI=0.1 ! BL mixing length -XLINF=1.E-10! to prevent division by zero -! -! -! 4. MAXIMUM VALUES -! -------------- -! -XPHI_LIM = 3. -! -! -! 5. Constants in K-eps scheme -! ------------------------- -! -! 1.3 Values in the evolution equation of the dissipation of TKE -XCDP = 1.46 -! Duynkerke (1988) = 1.46 -! -XCDD = 1.83 -! Duynkerke (1988) = 1.83 -! -XCDT = 0.42 -! Duynkerke (1988) = 1./(2.38) -! -! -! 6. Constants in RMC01 -! ------------------ -! -XSBL_O_BL = 0.05 ! SBL height / BL height ratio -XFTOP_O_FSURF = 0.05 ! Fraction of surface (heat or momentum) flux used to define top of BL -! -! -IF (LHOOK) CALL DR_HOOK('INI_CTURB',1,ZHOOK_HANDLE) -END SUBROUTINE INI_CTURB diff --git a/src/arome/turb/modd_diag_in_run.F90 b/src/arome/turb/modd_diag_in_run.F90 deleted file mode 100644 index ca9ce53a698a3a458f5ac777353e5d23518faa78..0000000000000000000000000000000000000000 --- a/src/arome/turb/modd_diag_in_run.F90 +++ /dev/null @@ -1,38 +0,0 @@ -!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 MODD_DIAG_IN_RUN -! Modifications -!! 02/2018 Q.Libois ECRAD -!! Bielli S. 02/2019 Sea salt : significant sea wave height influences salt emission; 5 salt modes -! -!* stores instantaneous diagnostic arrays for the current time-step -! -IMPLICIT NONE - -LOGICAL :: LDIAG_IN_RUN=.FALSE. ! flag for diagnostics -! -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_RN ! net radiation -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_H ! sensible heat flux -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_LE ! Total latent heat flux -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_LEI ! Solid latent heat flux -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_GFLUX ! ground flux -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_LWD ! incoming longwave at the surface -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_LWU ! outcoming longwave at the surface -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_SWD ! incoming Shortwave at the surface -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_SWU ! outcoming Shortwave at the surface -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_SWDIR ! incoming Shortwave direct at the surface -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_SWDIFF! incoming Shortwave diffuse at the surface -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_T2M ! temperature at 2m -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_Q2M ! humidity at 2m -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_HU2M ! relative humidity at 2m -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_ZON10M! zonal wind at 10m -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_MER10M! meridian wind at 10m -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_DSTAOD! dust aerosol optical depth -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_SFCO2 ! CO2 Surface flux -REAL, DIMENSION(:,:,:), ALLOCATABLE :: XCURRENT_TKE_DISS ! Tke dissipation rate -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_SLTAOD ! Salt aerosol optical depth -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_ZWS ! Significant height of waves -END MODULE MODD_DIAG_IN_RUN diff --git a/src/arome/turb/modi_ini_cmfshall.F90 b/src/arome/turb/modi_ini_cmfshall.F90 deleted file mode 100644 index 4826d03f35e16ff661382892a93d0455f49479ef..0000000000000000000000000000000000000000 --- a/src/arome/turb/modi_ini_cmfshall.F90 +++ /dev/null @@ -1,39 +0,0 @@ -! ######spl - MODULE MODI_INI_CMFSHALL -! ##################### -! -INTERFACE -! -SUBROUTINE INI_CMFSHALL(PALP_PERT,PABUO,PBENTR,PBDETR,PCMF,PENTR_MF,PCRAD_MF,PENTR_DRY,& - & PDETR_DRY,PDETR_LUP,PKCF_MF,PKRC_MF,PTAUSIGMF,PPRES_UV,PFRAC_UP_MAX,& - & PALPHA_MF,PSIGMA_MF,PA1,PB,PC,PBETA1,PR,PLAMBDA) -! -REAL, INTENT(IN) :: PALP_PERT -REAL, INTENT(IN) :: PABUO -REAL, INTENT(IN) :: PBENTR -REAL, INTENT(IN) :: PBDETR -REAL, INTENT(IN) :: PCMF -REAL, INTENT(IN) :: PENTR_MF -REAL, INTENT(IN) :: PCRAD_MF -REAL, INTENT(IN) :: PENTR_DRY -REAL, INTENT(IN) :: PDETR_DRY -REAL, INTENT(IN) :: PDETR_LUP -REAL, INTENT(IN) :: PKCF_MF -REAL, INTENT(IN) :: PKRC_MF -REAL, INTENT(IN) :: PTAUSIGMF -REAL, INTENT(IN) :: PPRES_UV -REAL, INTENT(IN) :: PFRAC_UP_MAX -REAL, INTENT(IN) :: PALPHA_MF -REAL, INTENT(IN) :: PSIGMA_MF -REAL, INTENT(IN) :: PA1 -REAL, INTENT(IN) :: PB -REAL, INTENT(IN) :: PC -REAL, INTENT(IN) :: PBETA1 -REAL, INTENT(IN) :: PR -REAL, INTENT(IN) :: PLAMBDA - -END SUBROUTINE INI_CMFSHALL - -END INTERFACE -! -END MODULE MODI_INI_CMFSHALL diff --git a/src/arome/turb/modi_ini_cturb.F90 b/src/arome/turb/modi_ini_cturb.F90 deleted file mode 100644 index a9331bb72852e542224bce41b872a41a6bf14abf..0000000000000000000000000000000000000000 --- a/src/arome/turb/modi_ini_cturb.F90 +++ /dev/null @@ -1,12 +0,0 @@ -! ######spl - MODULE MODI_INI_CTURB -! ##################### -! -INTERFACE -! -SUBROUTINE INI_CTURB -END SUBROUTINE INI_CTURB -! -END INTERFACE -! -END MODULE MODI_INI_CTURB diff --git a/src/common/aux/ini_phyex.F90 b/src/common/aux/ini_phyex.F90 new file mode 100644 index 0000000000000000000000000000000000000000..9a5323f9119f0b36dbc24adb280f6227ce5bac6f --- /dev/null +++ b/src/common/aux/ini_phyex.F90 @@ -0,0 +1,208 @@ +SUBROUTINE INI_PHYEX(HPROGRAM, KUNITNML, LDNEEDNAM, KLUOUT, KFROM, KTO, & + &PTSTEP, PDZMIN, & + &CMICRO, CSCONV, CTURB, & + &LDCHANGEMODEL, LDDEFAULTVAL, LDREADNAM, LDCHECK, KPRINT, LDINIT, & + &PHYEX_IN, PHYEX_OUT) +! +USE MODD_PHYEX, ONLY: PHYEX_t +USE MODD_CST, ONLY: CST, CST_t, PRINT_CST +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_GOTO_MODEL, PARAM_ICEN_INIT, PARAM_ICEN, PARAM_ICE_t, & + & CSUBG_AUCV_RC, CSUBG_AUCV_RI +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_GOTO_MODEL, RAIN_ICE_DESCRN, RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_GOTO_MODEL, RAIN_ICE_PARAMN, RAIN_ICE_PARAM_t +USE MODD_CLOUDPAR_N, ONLY: CLOUDPAR_GOTO_MODEL, CLOUDPARN, CLOUDPAR_t +USE MODD_PARAM_MFSHALL_N,ONLY: PARAM_MFSHALLN, PARAM_MFSHALL_t, PARAM_MFSHALLN_INIT, PARAM_MFSHALL_GOTO_MODEL +USE MODD_TURB_N, ONLY: TURBN, TURB_t, TURBN_INIT, TURB_GOTO_MODEL, LHARAT +USE MODD_CTURB, ONLY: CSTURB, CSTURB_t, CTURB_ASSOCIATE +USE MODD_NEB_N, ONLY: NEBN, NEB_t, NEBN_INIT, NEB_GOTO_MODEL, CCONDENS, LSTATNW +! +USE MODE_INI_CST, ONLY: INI_CST +USE MODE_INI_RAIN_ICE, ONLY: INI_RAIN_ICE +USE MODE_INI_TIWMX, ONLY: INI_TIWMX +USE MODE_INI_SNOW, ONLY: INI_SNOW +USE MODE_INI_MFSHALL, ONLY: INI_MFSHALL +USE MODE_INI_TURB, ONLY: INI_TURB +! +USE MODE_MSG, ONLY: PRINT_MSG, NVERB_FATAL +! +!! +!! *INI_PHYEX* - PHYEX initialisation routine +!! +!! PURPOSE +!! ------- +!! The purpose of this routine is to initialise (default values, namelist, checks, prints) +!! the different modules used by the physics +!! +!! +!! AUTHOR +!! ------ +!! S. Riette +!! +!! MODIFICATIONS +!! ------------- +!! +!! - Original Fev 2023 +!! +!------------------------------------------------------------------------------- +! +!** DECLARATIONS +! +IMPLICIT NONE + +CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM !< Current program +INTEGER, INTENT(IN) :: KUNITNML !< Logical unit to access the namelist +LOGICAL, INTENT(IN) :: LDNEEDNAM !< True to abort if namelist is absent +INTEGER, INTENT(IN) :: KLUOUT !< Logical unit for outputs +INTEGER, INTENT(IN) :: KFROM !< Old model number +INTEGER, INTENT(IN) :: KTO !< New model number +REAL, INTENT(IN) :: PTSTEP !< Timestep +REAL, INTENT(IN) :: PDZMIN !< Minimum thickness +CHARACTER(LEN=4), INTENT(IN) :: CMICRO !< Microphysical scheme to use +CHARACTER(LEN=4), INTENT(IN) :: CTURB !< Turbulence scheme to use +CHARACTER(LEN=4), INTENT(IN) :: CSCONV !< Shallow convection scheme to use +LOGICAL, OPTIONAL, INTENT(IN) :: LDCHANGEMODEL!< Must we change the active model +LOGICAL, OPTIONAL, INTENT(IN) :: LDDEFAULTVAL !< Must we initialize variables with default values (defaults to .TRUE.) +LOGICAL, OPTIONAL, INTENT(IN) :: LDREADNAM !< Must we read the namelist (defaults to .TRUE.) +LOGICAL, OPTIONAL, INTENT(IN) :: LDCHECK !< Must we perform some checks on values (defaults to .TRUE.) +INTEGER, OPTIONAL, INTENT(IN) :: KPRINT !< Print level (defaults to 0): 0 for no print, 1 to safely print namelist, + !! 2 to print informative messages +LOGICAL, OPTIONAL, INTENT(IN) :: LDINIT !< Must we call the init routines +TYPE(PHYEX_t), OPTIONAL, INTENT(IN) :: PHYEX_IN !< Structure for constants (IN) +TYPE(PHYEX_t), OPTIONAL, INTENT(INOUT) :: PHYEX_OUT !< Structure for constants (OUT) + +!IMPORTANT NOTE on PHYEX_OUT arguments. +!Logically this argument should be declared with INTENT(OUT) but in this case ifort (at least) breaks the +!execution when the same structure is given for the PHYEX_IN and the PHYEX_OUT argument. +!When INITENT(INOUT) is used, execution is OK on ifort. + +LOGICAL :: LLINIT, LLCHANGEMODEL, LLCHECK +INTEGER :: IPRINT +! +!** ARGUMENTS +! +LLINIT=.TRUE. +IF(PRESENT(LDINIT)) LLINIT=LDINIT +LLCHECK=.TRUE. +IF(PRESENT(LDCHECK)) LLCHECK=LDCHECK +LLCHANGEMODEL=.TRUE. +IF(PRESENT(LDCHANGEMODEL)) LLCHANGEMODEL=LDCHANGEMODEL +IPRINT=0 +IF(PRESENT(KPRINT)) IPRINT=KPRINT +! +!** CST +! +IF(LLINIT) THEN + IF(IPRINT==2) WRITE(UNIT=KLUOUT,FMT='('' MODD_CST '')') + IF(PRESENT(PHYEX_IN)) CST=PHYEX_IN%CST + CALL INI_CST() + IF(IPRINT==2) CALL PRINT_CST(KLUOUT) + IF(PRESENT(PHYEX_OUT)) PHYEX_OUT%CST=CST +ENDIF +! +!** MICROPHYSICS SCHEME +! +IF(CMICRO=='ICE3' .OR. CMICRO=='ICE4' .OR. CMICRO=='LIMA') THEN + IF(IPRINT==2) WRITE(UNIT=KLUOUT,FMT='('' MODD_PARAM_ICEN, MODD_RAIN_ICE_DESCRN, MODD_RAIN_ICE_PARAMN, MODD_CLOUDPARN '')') + IF(LLCHANGEMODEL) THEN + CALL CLOUDPAR_GOTO_MODEL(KFROM, KTO) + CALL PARAM_ICE_GOTO_MODEL(KFROM, KTO) + CALL RAIN_ICE_DESCR_GOTO_MODEL(KFROM, KTO) + CALL RAIN_ICE_PARAM_GOTO_MODEL(KFROM, KTO) + ENDIF + IF(PRESENT(PHYEX_IN)) THEN + PARAM_ICEN=PHYEX_IN%PARAM_ICEN + RAIN_ICE_DESCRN=PHYEX_IN%RAIN_ICE_DESCRN + RAIN_ICE_PARAMN=PHYEX_IN%RAIN_ICE_PARAMN + CLOUDPARN=PHYEX_IN%CLOUDPARN + ENDIF + + CALL PARAM_ICEN_INIT(HPROGRAM, KUNITNML, LDNEEDNAM, KLUOUT, & + &LDDEFAULTVAL, LDREADNAM, LDCHECK, KPRINT) + IF(LLINIT) THEN + CALL INI_RAIN_ICE(KLUOUT, PTSTEP, PDZMIN, CLOUDPARN%NSPLITR, CMICRO) + CALL INI_TIWMX + + IF(RAIN_ICE_PARAMN%XFRMIN(16) > 0.) THEN + CALL INI_SNOW(KLUOUT) ! Recalculate snow parameters : XCCS = XFRMIN(16),XCXS = XFRMIN(17) + ENDIF + ENDIF + + IF(PRESENT(PHYEX_OUT)) THEN + PHYEX_OUT%PARAM_ICEN=PARAM_ICEN + PHYEX_OUT%RAIN_ICE_DESCRN=RAIN_ICE_DESCRN + PHYEX_OUT%RAIN_ICE_PARAMN=RAIN_ICE_PARAMN + PHYEX_OUT%CLOUDPARN=CLOUDPARN + ENDIF +ENDIF +! +!** SHALLOW CONVECTION SCHEME +! +IF(CSCONV=='EDKF') THEN + IF(IPRINT==2) WRITE(UNIT=KLUOUT,FMT='('' MODD_PARAM_MFSHALL_n '')') + IF(LLCHANGEMODEL) CALL PARAM_MFSHALL_GOTO_MODEL(KFROM, KTO) + IF(PRESENT(PHYEX_IN)) PARAM_MFSHALLN=PHYEX_IN%PARAM_MFSHALLN + + CALL PARAM_MFSHALLN_INIT(HPROGRAM, KUNITNML, LDNEEDNAM, KLUOUT, & + &LDDEFAULTVAL, LDREADNAM, LDCHECK, KPRINT) + IF(LLINIT) THEN + CALL INI_MFSHALL() + ENDIF + + IF(PRESENT(PHYEX_OUT)) PHYEX_OUT%PARAM_MFSHALLN=PARAM_MFSHALLN +ENDIF +! +!** CLOUD SCHEME +! +IF(.TRUE.) THEN !Placeholder for configuration without cloud scheme or a different one + IF(IPRINT==2) WRITE(UNIT=KLUOUT,FMT='('' MODD_NEB_n '')') + IF(LLCHANGEMODEL) CALL NEB_GOTO_MODEL(KFROM, KTO) + IF(PRESENT(PHYEX_IN)) NEBN=PHYEX_IN%NEBN + + CALL NEBN_INIT(HPROGRAM, KUNITNML, LDNEEDNAM, KLUOUT, & + &LDDEFAULTVAL, LDREADNAM, LDCHECK, KPRINT) + IF(LLINIT) THEN + !Nothing to do, everything is read from namelist + ENDIF + + IF(PRESENT(PHYEX_OUT)) PHYEX_OUT%NEBN=NEBN +ENDIF +! +!** TURBULENCE SCHEME +! +IF(CTURB=='TKEL') THEN + IF(IPRINT==2) WRITE(UNIT=KLUOUT,FMT='('' MODD_TURB_n MODD_CTURB '')') + IF(LLCHANGEMODEL) CALL TURB_GOTO_MODEL(KFROM, KTO) + IF(PRESENT(PHYEX_IN)) THEN + TURBN=PHYEX_IN%TURBN + CSTURB=PHYEX_IN%CSTURB + ENDIF + + CALL CTURB_ASSOCIATE() + CALL TURBN_INIT(HPROGRAM, KUNITNML, LDNEEDNAM, KLUOUT, & + &LDDEFAULTVAL, LDREADNAM, LDCHECK, KPRINT) + IF(LLINIT) THEN + CALL INI_TURB(HPROGRAM) + ENDIF + + IF(PRESENT(PHYEX_OUT)) THEN + PHYEX_OUT%TURBN=TURBN + PHYEX_OUT%CSTURB=CSTURB + ENDIF +ENDIF +! +!** GLOBAL CONSISTENCY TESTS +! +IF(LLCHECK) THEN + IF((CMICRO=='ICE3' .OR. CMICRO=='ICE4' .OR. CMICRO=='LIMA') .AND. CTURB=='TKEL') THEN + IF ((CSUBG_AUCV_RC == 'ADJU' .OR. CSUBG_AUCV_RI == 'ADJU') .AND. CCONDENS /= 'GAUS') THEN + CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'INI_PHYEX', & + &"CSUBG_AUCV_RC and/or CSUBG_AUCV_RI cannot be 'ADJU' if CCONDENS is not 'GAUS'") + ENDIF + IF (.NOT. LHARAT .AND. LSTATNW) THEN + CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'INI_PHYEX', & + &'LSTATNW only tested in combination with HARATU and EDMFm!') + ENDIF + ENDIF +ENDIF + +END SUBROUTINE INI_PHYEX diff --git a/src/common/aux/modd_cst.F90 b/src/common/aux/modd_cst.F90 index cb0aed25e632bec67853d370ac79198d944051e4..35ae497930324b5dd9f586e3380c13966da0cad4 100644 --- a/src/common/aux/modd_cst.F90 +++ b/src/common/aux/modd_cst.F90 @@ -51,72 +51,84 @@ IMPLICIT NONE REAL, PARAMETER :: XLAM_CRAD = 3.154E-3 ! RASTA cloud radar wavelength (m) <=> 95.04 GHz TYPE CST_t - REAL :: XPI ! Pi ! - REAL :: XDAY,XSIYEA,XSIDAY ! day duration, sideral year duration, sideral day duration + !* 1. FUNDAMENTAL CONSTANTS + ! --------------------- + REAL :: XPI !< Pi + REAL :: XKARMAN !< von karman constant + REAL :: XLIGHTSPEED !< light speed + REAL :: XPLANCK !< Planck constant + REAL :: XBOLTZ !< Boltzman constant + REAL :: XAVOGADRO !< Avogadro number ! - REAL :: XKARMAN ! von karman constant - REAL :: XLIGHTSPEED ! light speed - REAL :: XPLANCK ! Planck constant - REAL :: XBOLTZ ! Boltzman constant - REAL :: XAVOGADRO ! Avogadro number + !* 2. ASTRONOMICAL CONSTANTS + ! ---------------------- + REAL :: XDAY,XSIYEA,XSIDAY !< day duration, sideral year duration, sideral day duration + INTEGER :: NDAYSEC !< Number of seconds in a day + REAL :: XOMEGA !< Earth rotation ! - REAL :: XRADIUS,XOMEGA ! Earth radius, earth rotation - REAL :: XG ! Gravity constant + !* 3. TERRESTRIAL GEOIDE CONSTANTS + ! ---------------------------- + REAL :: XRADIUS !< Earth radius + REAL :: XG !< Gravity constant ! - REAL :: XP00 ! Reference pressure - REAL :: XP00OCEAN ! Reference pressure for ocean model - REAL :: XRH00OCEAN ! Reference density for ocean model + !* 4. REFERENCE PRESSURE + ! ------------------- + REAL :: XP00 !< Reference pressure + REAL :: XP00OCEAN !< Reference pressure for ocean model + REAL :: XRH00OCEAN !< Reference density for ocean model + REAL :: XTH00 !< reference value for the potential temperature + REAL :: XTH00OCEAN !< Ref value for pot temp in ocean model + REAL :: XSA00OCEAN !< Ref value for SAlinity in ocean model ! - REAL :: XSTEFAN,XI0 ! Stefan-Boltzman constant, solar constant + !* 5. RADIATION CONSTANTS + ! ------------------- + REAL :: XSTEFAN,XI0 !< Stefan-Boltzman constant, solar constant ! - REAL :: XMD,XMV ! Molar mass of dry air and molar mass of vapor - REAL :: XRD,XRV ! Gaz constant for dry air, gaz constant for vapor - REAL :: XEPSILO ! XMV/XMD - REAL :: XCPD,XCPV ! Cpd (dry air), Cpv (vapor) - REAL :: XRHOLW ! Volumic mass of liquid water - REAL :: XCL,XCI ! Cl (liquid), Ci (ice) - REAL :: XTT ! Triple point temperature - REAL :: XLVTT ! Vaporization heat constant - REAL :: XLSTT ! Sublimation heat constant - REAL :: XLMTT ! Melting heat constant - REAL :: XESTT ! Saturation vapor pressure at triple point temperature - REAL :: XALPW,XBETAW,XGAMW ! Constants for saturation vapor pressure function - REAL :: XALPI,XBETAI,XGAMI ! Constants for saturation vapor pressure function over solid ice - REAL :: XCONDI ! thermal conductivity of ice (W m-1 K-1) - REAL :: XALPHAOC ! thermal expansion coefficient for ocean (K-1) - REAL :: XBETAOC ! Haline contraction coeff for ocean (S-1) - REAL :: XTH00 ! reference value for the potential temperature - REAL :: XTH00OCEAN ! Ref value for pot temp in ocean model - REAL :: XSA00OCEAN ! Ref value for SAlinity in ocean model - REAL :: XROC=0.69! 3 coeffs for SW penetration in Ocean (Hoecker et al) - REAL :: XD1=1.1 - REAL :: XD2=23. + !* 6. THERMODYNAMIC CONSTANTS + ! ----------------------- + REAL :: XMD,XMV !< Molar mass of dry air and molar mass of vapor + REAL :: XRD,XRV !< Gaz constant for dry air, gaz constant for vapor + REAL :: XEPSILO !< XMV/XMD + REAL :: XCPD,XCPV !< Cpd (dry air), Cpv (vapor) + REAL :: XRHOLW !< Volumic mass of liquid water + REAL :: XCL,XCI !< Cl (liquid), Ci (ice) + REAL :: XTT !< Triple point temperature + REAL :: XLVTT !< Vaporization heat constant + REAL :: XLSTT !< Sublimation heat constant + REAL :: XLMTT !< Melting heat constant + REAL :: XESTT !< Saturation vapor pressure at triple point temperature + REAL :: XALPW,XBETAW,XGAMW !< Constants for saturation vapor pressure function + REAL :: XALPI,XBETAI,XGAMI !< Constants for saturation vapor pressure function over solid ice + REAL :: XCONDI !< thermal conductivity of ice (W m-1 K-1) + REAL :: XALPHAOC !< thermal expansion coefficient for ocean (K-1) + REAL :: XBETAOC !< Haline contraction coeff for ocean (S-1) + REAL :: XROC=0.69 !< coeff for SW penetration in Ocean (Hoecker et al) + REAL :: XD1=1.1 !< coeff for SW penetration in Ocean (Hoecker et al) + REAL :: XD2=23. !< coeff for SW penetration in Ocean (Hoecker et al) ! Values used in SURFEX CMO !REAL :: XROC=0.58 !REAL :: XD1=0.35 !REAL :: XD2=23. - - REAL :: XRHOLI ! Volumic mass of ice - ! - INTEGER :: NDAYSEC ! Number of seconds in a day + REAL :: XRHOLI !< Volumic mass of ice ! - REAL :: RDSRV ! XRD/XRV - REAL :: RDSCPD ! XRD/XCPD - REAL :: RINVXP00 ! 1./XP00 + !* 7. PRECOMPUTED CONSTANTS + ! --------------------- + REAL :: RDSRV !< XRD/XRV + REAL :: RDSCPD !< XRD/XCPD + REAL :: RINVXP00 !< 1./XP00 ! - ! Some machine precision value depending of real4/8 use - ! - REAL :: XMNH_TINY ! minimum real on this machine - REAL :: XMNH_TINY_12 ! sqrt(minimum real on this machine) - REAL :: XMNH_EPSILON ! minimum space with 1.0 - REAL :: XMNH_HUGE ! maximum real on this machine - REAL :: XMNH_HUGE_12_LOG ! maximum log(sqrt(real)) on this machine - - REAL :: XEPS_DT ! default value for DT test - REAL :: XRES_FLAT_CART ! default flat&cart residual tolerance - REAL :: XRES_OTHER ! default not flat&cart residual tolerance - REAL :: XRES_PREP ! default prep residual tolerance + !* 8. MACHINE PRECISION VALUE DEPENDING of REAL4/8 USE + ! --------------------- + REAL :: XMNH_TINY !< minimum real on this machine + REAL :: XMNH_TINY_12 !< sqrt(minimum real on this machine) + REAL :: XMNH_EPSILON !< minimum space with 1.0 + REAL :: XMNH_HUGE !< maximum real on this machine + REAL :: XMNH_HUGE_12_LOG !< maximum log(sqrt(real)) on this machine + REAL :: XEPS_DT !< default value for DT test + REAL :: XRES_FLAT_CART !< default flat&cart residual tolerance + REAL :: XRES_OTHER !< default not flat&cart residual tolerance + REAL :: XRES_PREP !< default prep residual tolerance END TYPE CST_t TYPE(CST_t), TARGET, SAVE :: CST @@ -238,5 +250,68 @@ SUBROUTINE CST_ASSOCIATE() XRES_PREP=>CST%XRES_PREP END SUBROUTINE CST_ASSOCIATE ! +SUBROUTINE PRINT_CST(KULOUT) +INTEGER, INTENT(IN) :: KULOUT + +WRITE(UNIT=KULOUT,FMT='('' MODD_CST: FUNDAMENTAL CONSTANTS '')') +WRITE(UNIT=KULOUT,FMT='('' XPI = '',E10.4,'' XKARMAN = '',E10.4,'' XLIGHTSPEED = '',E10.4,/, & + &'' XPLANCK = '',E10.4,'' XBOLTZ = '',E10.4,'' XAVOGADRO = '',E10.4)')& + &XPI,XKARMAN,XLIGHTSPEED,& + &XPLANCK,XBOLTZ,XAVOGADRO + +WRITE(UNIT=KULOUT,FMT='('' MODD_CST: ASTRONOMICAL CONSTANTS '')') +WRITE(UNIT=KULOUT,FMT='('' XDAY = '',E10.4,'' XSIYEA = '',E10.4,'' XSIDAY = '',E10.4,/,& + &'' XOMEGA = '',E10.4,'' NDAYSEC = '', I6)')& + &XDAY,XSIYEA,XSIDAY,& + &XOMEGA,NDAYSEC + +WRITE(UNIT=KULOUT,FMT='('' MODD_CST: TERRESTRIAL GEOIDE CONSTANTS '')') +WRITE(UNIT=KULOUT,FMT='('' XRADIUS = '',E10.4,'' XG = '',E10.4)')& + &XRADIUS,XG + +WRITE(UNIT=KULOUT,FMT='('' MODD_CST: REFERENCE '')') +WRITE(UNIT=KULOUT,FMT='('' XRH00OCEAN = '',E10.4,'' XTH00OCEAN = '',E10.4,'' XSA00OCEAN = '',E10.4,/,& + &'' XP00OCEAN = '',E10.4,'' XP00 = '',E10.4,'' XTH00 = '',E10.4)')& + &XRH00OCEAN,XTH00OCEAN,XSA00OCEAN,& + &XP00OCEAN,XP00,XTH00 + +WRITE(UNIT=KULOUT,FMT='('' MODD_CST: RADIATION CONSTANTS '')') +WRITE(UNIT=KULOUT,FMT='('' XSTEFAN = '',E10.4,'' XIO = '',E10.4)')& + &XSTEFAN,XI0 + +WRITE(UNIT=KULOUT,FMT='('' MODD_CST: THERMODYNAMIC CONSTANTS '')') +WRITE(UNIT=KULOUT,FMT='('' XMD = '',E10.4,'' XMV = '',E10.4,'' XRD = '',E10.4,/,& + &'' XRV = '',E10.4,'' XEPSILO = '',E10.4,'' XCPD = '',E10.4,/,& + &'' XCPV = '',E10.4,'' XRHOLW = '',E10.4,'' XRHOLI = '',E10.4,/,& + &'' XCONDI = '',E10.4,'' XCL = '',E10.4,'' XCI = '',E10.4,/,& + &'' XTT = '',E10.4,'' XLVTT = '',E10.4,'' XLSTT = '',E10.4,/,& + &'' XLMTT = '',E10.4,'' XESTT = '',E10.4,'' XGAMW = '',E10.4,/,& + &'' XBETAW = '',E10.4,'' XALPW = '',E10.4,'' XGAMI = '',E10.4,/,& + &'' XBETAI = '',E10.4,'' XALPI = '',E10.4,'' XALPHAOC = '',E10.4,/,& + &'' XBETAOC = '',E10.4)')& + &XMD,XMV,XRD,& + &XRV,XEPSILO,XCPD,& + &XCPV,XRHOLW,XRHOLI,& + &XCONDI,XCL,XCI,& + &XTT,XLVTT,XLSTT,& + &XLMTT,XESTT,XGAMW,& + &XBETAW,XALPW,XGAMI,& + &XBETAI,XALPI,XALPHAOC,& + &XBETAOC + +WRITE(UNIT=KULOUT,FMT='('' MODD_CST: PRECOMPUTED CONSTANTS '')') +WRITE(UNIT=KULOUT,FMT='('' RDSRV = '',E10.4,'' RDSCPD = '',E10.4,'' RINVXP00 = '',E10.4)')& + &RDSRV,RDSCPD,RINVXP00 + +WRITE(UNIT=KULOUT,FMT='('' MODD_CST: MACHINE PRECISION VALUE DEPENDING of REAL4/8 USE '')') +WRITE(UNIT=KULOUT,FMT='('' XMNH_EPSILON = '',E10.4,'' XMNH_HUGE = '',E10.4,'' XMNH_HUGE_12_LOG = '',E10.4,/,& + &'' XMNH_TINY = '',E10.4,'' XEPS_DT '',E10.4,'' XRES_FLAT_CART = '',E10.4,/,& + &'' XRES_OTHER = '',E10.4,'' XRES_PREP = '',E10.4,'' XMNH_TINY_12 = '',E10.4)')& + &XMNH_EPSILON,XMNH_HUGE,XMNH_HUGE_12_LOG,& + &XMNH_TINY,XEPS_DT,XRES_FLAT_CART,& + &XRES_OTHER,XRES_PREP,XMNH_TINY_12 +! +END SUBROUTINE PRINT_CST +! END MODULE MODD_CST diff --git a/src/common/aux/modd_misc.F90 b/src/common/aux/modd_misc.F90 new file mode 100644 index 0000000000000000000000000000000000000000..4947773b5260f6089cdf52d0230c1800cc3e7ab5 --- /dev/null +++ b/src/common/aux/modd_misc.F90 @@ -0,0 +1,5 @@ +MODULE MODD_MISC +IMPLICIT NONE +TYPE MISC_t +END TYPE MISC_t +END MODULE MODD_MISC diff --git a/src/common/aux/modd_phyex.F90 b/src/common/aux/modd_phyex.F90 new file mode 100644 index 0000000000000000000000000000000000000000..25bed949d1c5a65938934540915034cea457ea1e --- /dev/null +++ b/src/common/aux/modd_phyex.F90 @@ -0,0 +1,51 @@ +MODULE MODD_PHYEX +! +!> @file +!! MODD_PHYEX - decalration of the PHYEX structure gathering all the parametrisation strucutres of PHYEX +!! +!! PURPOSE +!! ------- +!! The purpose of this declarative module is to declare the +!! the PHYEX type that allows to gather all the different structures used +!! by the paramteriation available in PHYEX +!! +!! AUTHOR +!! ------ +!! S. Riette +!! +!! MODIFICATIONS +!! ------------- +!! Original Mar 2023 +!! +!------------------------------------------------------------------------------- +! +USE MODD_CST, ONLY: CST_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t +USE MODD_CLOUDPAR_N, ONLY: CLOUDPAR_t +USE MODD_PARAM_MFSHALL_N, ONLY: PARAM_MFSHALL_t +USE MODD_TURB_n, ONLY: TURB_t +USE MODD_CTURB, ONLY: CSTURB_t +USE MODD_NEB_n, ONLY: NEB_t +USE MODD_MISC, ONLY: MISC_t +! +IMPLICIT NONE +! +TYPE PHYEX_t + ! Structures for the different parametrisations + TYPE(CST_t) :: CST !< Physical constants + TYPE(PARAM_ICE_t) :: PARAM_ICEN !< Control parameters for microphysics + TYPE(RAIN_ICE_DESCR_t) :: RAIN_ICE_DESCRN !< Microphysical descriptive constants + TYPE(RAIN_ICE_PARAM_t) :: RAIN_ICE_PARAMN !< Microphysical factors + TYPE(CLOUDPAR_t) :: CLOUDPARN !< Some other microphysical values + TYPE(PARAM_MFSHALL_t) :: PARAM_MFSHALLN !< Mass flux scheme free parameters + TYPE(CSTURB_t) :: CSTURB !< Turbulence scheme constants + TYPE(TURB_t) :: TURBN !< Turbulence scheme constants set by namelist + TYPE(NEB_t) :: NEBN !< Cloud scheme constants + ! + ! Supplementary strucuture to hold model specific values + TYPE(MISC_t) :: MISC !< Model specific values +END TYPE PHYEX_t +! +END MODULE MODD_PHYEX diff --git a/src/common/aux/mode_check_nam_val.F90 b/src/common/aux/mode_check_nam_val.F90 new file mode 100644 index 0000000000000000000000000000000000000000..1d706ac877f9e8d445d2e87e2b03f105e26cb908 --- /dev/null +++ b/src/common/aux/mode_check_nam_val.F90 @@ -0,0 +1,297 @@ +MODULE MODE_CHECK_NAM_VAL +!> @file +!! *MODE_CHECK_NAM_VAL" - Module containing the routines to control the different kind of variables +!! read from namelist +!! +USE MODE_MSG, ONLY: PRINT_MSG, NVERB_FATAL +CONTAINS +SUBROUTINE CHECK_NAM_VAL_CHAR(KLUOUT, HNAME, HVAR, HVALUE1, HVALUE2, HVALUE3, HVALUE4, HVALUE5, & + &HVALUE6, HVALUE7, HVALUE8, HVALUE9, HVALUE10, HVALUE11, HVALUE12) +!! +!! *CHECK_NAM_VAL* - Control of CHARACTER variables +!! +!! PURPOSE +!! ------- +!! The purpose of this routine is to control the validity of CHARACTER variables +!! +!! +!! AUTHOR +!! ------ +!! S. Riette +!! +!! MODIFICATIONS +!! ------------- +!! +!! - Original Feb 2023, from Méso-NH code +!! +!------------------------------------------------------------------------------- +! +!** DECLARATIONS +! +IMPLICIT NONE +INTEGER, INTENT(IN) :: KLUOUT !< output listing logical unit +CHARACTER(LEN=*), INTENT(IN) :: HNAME !< name of the variable to test +CHARACTER(LEN=*), INTENT(IN) :: HVAR !< variable to test +CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: HVALUE1 !< Authorised value 1 +CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: HVALUE2 !< Authorised value 2 +CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: HVALUE3 !< Authorised value 3 +CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: HVALUE4 !< Authorised value 4 +CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: HVALUE5 !< Authorised value 5 +CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: HVALUE6 !< Authorised value 6 +CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: HVALUE7 !< Authorised value 7 +CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: HVALUE8 !< Authorised value 8 +CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: HVALUE9 !< Authorised value 9 +CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: HVALUE10 !< Authorised value 10 +CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: HVALUE11 !< Authorised value 11 +CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: HVALUE12 !< Authorised value 12 +! +!** CONTROLS +! +IF ( PRESENT (HVALUE1) ) THEN + IF ( HVAR==HVALUE1 ) RETURN +END IF +! +IF ( PRESENT (HVALUE2) ) THEN + IF ( HVAR==HVALUE2 ) RETURN +END IF +! +IF ( PRESENT (HVALUE3) ) THEN + IF ( HVAR==HVALUE3 ) RETURN +END IF +! +IF ( PRESENT (HVALUE4) ) THEN + IF ( HVAR==HVALUE4 ) RETURN +END IF +! +IF ( PRESENT (HVALUE5) ) THEN + IF ( HVAR==HVALUE5 ) RETURN +END IF +! +IF ( PRESENT (HVALUE6) ) THEN + IF ( HVAR==HVALUE6 ) RETURN +END IF +! +IF ( PRESENT (HVALUE7) ) THEN + IF ( HVAR==HVALUE7 ) RETURN +END IF +! +IF ( PRESENT (HVALUE8) ) THEN + IF ( HVAR==HVALUE8 ) RETURN +END IF +! +IF ( PRESENT (HVALUE9) ) THEN + IF ( HVAR==HVALUE9 ) RETURN +END IF +! +IF ( PRESENT (HVALUE10) ) THEN + IF ( HVAR==HVALUE10 ) RETURN +END IF +! +IF ( PRESENT (HVALUE11) ) THEN + IF ( HVAR==HVALUE11 ) RETURN +END IF +! +IF ( PRESENT (HVALUE12) ) THEN + IF ( HVAR==HVALUE12 ) RETURN +END IF +! +!** PRINTS AND ABORT +! +WRITE (KLUOUT,*) ' ' +WRITE (KLUOUT,*) 'FATAL ERROR:' +WRITE (KLUOUT,*) '-----------' +WRITE (KLUOUT,*) ' ' +WRITE (KLUOUT,*) 'Value "', HVAR, '" is not allowed for variable ', HNAME +WRITE (KLUOUT,*) ' ' +WRITE (KLUOUT,*) 'Possible values are:' +IF ( PRESENT (HVALUE1) ) WRITE (KLUOUT,*) '"',HVALUE1,'"' +IF ( PRESENT (HVALUE2) ) WRITE (KLUOUT,*) '"',HVALUE2,'"' +IF ( PRESENT (HVALUE3) ) WRITE (KLUOUT,*) '"',HVALUE3,'"' +IF ( PRESENT (HVALUE4) ) WRITE (KLUOUT,*) '"',HVALUE4,'"' +IF ( PRESENT (HVALUE5) ) WRITE (KLUOUT,*) '"',HVALUE5,'"' +IF ( PRESENT (HVALUE6) ) WRITE (KLUOUT,*) '"',HVALUE6,'"' +IF ( PRESENT (HVALUE7) ) WRITE (KLUOUT,*) '"',HVALUE7,'"' +IF ( PRESENT (HVALUE8) ) WRITE (KLUOUT,*) '"',HVALUE8,'"' +IF ( PRESENT (HVALUE9) ) WRITE (KLUOUT,*) '"',HVALUE9,'"' +IF ( PRESENT (HVALUE10) ) WRITE (KLUOUT,*) '"',HVALUE10,'"' +IF ( PRESENT (HVALUE11) ) WRITE (KLUOUT,*) '"',HVALUE11,'"' +IF ( PRESENT (HVALUE12) ) WRITE (KLUOUT,*) '"',HVALUE12,'"' +FLUSH(UNIT=KLUOUT) +! +CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'CHECK_NAM_VAL_CHAR', TRIM(HVAR) // ' is not allowed for variable ' // TRIM(HNAME)) +! +END SUBROUTINE CHECK_NAM_VAL_CHAR + +SUBROUTINE CHECK_NAM_VAL_REAL(KLUOUT, HNAME, PVALUE, CDSIGN1, PVAL1, CDSIGN2, PVAL2) +!! +!! *CHECK_NAM_VAL* - Control of CHARACTER variables +!! +!! PURPOSE +!! ------- +!! The purpose of this routine is to control the validity of REAL variables +!! +!! +!! AUTHOR +!! ------ +!! S. Riette +!! +!! MODIFICATIONS +!! ------------- +!! +!! - Original Feb 2023 +!! +!------------------------------------------------------------------------------- +! +!** DECLARATIONS +! +IMPLICIT NONE +INTEGER, INTENT(IN) :: KLUOUT !< output listing logical unit +CHARACTER(LEN=*), INTENT(IN) :: HNAME !< name of the variable to test +REAL, INTENT(IN) :: PVALUE !< variable to test +CHARACTER(LEN=*), INTENT(IN) :: CDSIGN1 !< sign for the first verification +REAL, INTENT(IN) :: PVAL1 !< bound for the first verification +CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: CDSIGN2 !< sign for the second verification +REAL, INTENT(IN), OPTIONAL :: PVAL2 !< bound for the second verification + +INTEGER :: II, INUM +REAL :: ZVAL +CHARACTER(LEN=2) :: CSIGN +LOGICAL :: LOK +CHARACTER(LEN=10) :: CHAR_VAL +! +!** CONTROLS +! +LOK=.TRUE. +INUM=1 +IF(PRESENT(CDSIGN2)) INUM=2 +DO II=1, INUM + IF(II==1) THEN + ZVAL=PVAL1 + CSIGN=CDSIGN1(1:MIN(2, LEN(CDSIGN1))) + ELSE + ZVAL=PVAL2 + CSIGN=CDSIGN2(1:MIN(2, LEN(CDSIGN2))) + ENDIF + SELECT CASE (CSIGN) + CASE ('<') + LOK=LOK .AND. PVALUE < ZVAL + CASE ('<=') + LOK=LOK .AND. PVALUE <= ZVAL + CASE ('>') + LOK=LOK .AND. PVALUE > ZVAL + CASE ('>=') + LOK=LOK .AND. PVALUE >= ZVAL + CASE ('==') + LOK=LOK .AND. PVALUE == ZVAL + CASE DEFAULT + CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'CHECK_NAM_VAL_REAL', TRIM(CSIGN) // ' is not allowed as comparator') + END SELECT +ENDDO +! +!** PRINTS AND ABORT +! +IF(.NOT. LOK) THEN + WRITE(KLUOUT,*) ' ' + WRITE(KLUOUT,*) 'FATAL ERROR:' + WRITE(KLUOUT,*) '-----------' + WRITE(KLUOUT,*) ' ' + WRITE(KLUOUT,*) 'Value "', PVALUE, '" is not allowed for variable ', HNAME + WRITE(KLUOUT,*) ' ' + WRITE(KLUOUT,*) 'Possible values are such as:' + WRITE(KLUOUT,*) CDSIGN1, PVAL1 + IF (PRESENT(CDSIGN2)) WRITE(KLUOUT, *) CDSIGN2, PVAL2 + FLUSH(UNIT=KLUOUT) + ! + WRITE(UNIT=CHAR_VAL, FMT=*) PVALUE + CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'CHECK_NAM_VAL_REAL', TRIM(CHAR_VAL) // ' is not allowed for variable ' // TRIM(HNAME)) +ENDIF +! +END SUBROUTINE CHECK_NAM_VAL_REAL + +SUBROUTINE CHECK_NAM_VAL_INT(KLUOUT, HNAME, KVALUE, CDSIGN1, KVAL1, CDSIGN2, KVAL2) +!! +!! *CHECK_NAM_VAL* - Control of CHARACTER variables +!! +!! PURPOSE +!! ------- +!! The purpose of this routine is to control the validity of REAL variables +!! +!! +!! AUTHOR +!! ------ +!! S. Riette +!! +!! MODIFICATIONS +!! ------------- +!! +!! - Original Feb 2023 +!! +!------------------------------------------------------------------------------- +! +!** DECLARATIONS +! +IMPLICIT NONE +INTEGER, INTENT(IN) :: KLUOUT !< output listing logical unit +CHARACTER(LEN=*), INTENT(IN) :: HNAME !< name of the variable to test +INTEGER, INTENT(IN) :: KVALUE !< variable to test +CHARACTER(LEN=*), INTENT(IN) :: CDSIGN1 !< sign for the first verification +INTEGER, INTENT(IN) :: KVAL1 !< bound for the first verification +CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: CDSIGN2 !< sign for the second verification +INTEGER, INTENT(IN), OPTIONAL :: KVAL2 !< bound for the second verification + +INTEGER :: II, INUM +INTEGER :: IVAL +CHARACTER(LEN=2) :: CSIGN +LOGICAL :: LOK +CHARACTER(LEN=10) :: CHAR_VAL +! +!** CONTROLS +! +LOK=.TRUE. +INUM=1 +IF(PRESENT(CDSIGN2)) INUM=2 +DO II=1, INUM + IF(II==1) THEN + IVAL=KVAL1 + CSIGN=CDSIGN1(1:MIN(2, LEN(CDSIGN1))) + ELSE + IVAL=KVAL2 + CSIGN=CDSIGN2(1:MIN(2, LEN(CDSIGN2))) + ENDIF + SELECT CASE (CSIGN) + CASE ('<') + LOK=LOK .AND. KVALUE < IVAL + CASE ('<=') + LOK=LOK .AND. KVALUE <= IVAL + CASE ('>') + LOK=LOK .AND. KVALUE > IVAL + CASE ('>=') + LOK=LOK .AND. KVALUE >= IVAL + CASE ('==') + LOK=LOK .AND. KVALUE == IVAL + CASE DEFAULT + CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'CHECK_NAM_VAL_REAL', TRIM(CSIGN) // ' is not allowed as comparator') + END SELECT +ENDDO +! +!** PRINTS AND ABORT +! +IF(.NOT. LOK) THEN + WRITE(KLUOUT,*) ' ' + WRITE(KLUOUT,*) 'FATAL ERROR:' + WRITE(KLUOUT,*) '-----------' + WRITE(KLUOUT,*) ' ' + WRITE(KLUOUT,*) 'Value "', KVALUE, '" is not allowed for variable ', HNAME + WRITE(KLUOUT,*) ' ' + WRITE(KLUOUT,*) 'Possible values are such as:' + WRITE(KLUOUT,*) CDSIGN1, KVAL1 + IF (PRESENT(CDSIGN2)) WRITE(KLUOUT, *) CDSIGN2, KVAL2 + FLUSH(UNIT=KLUOUT) + ! + WRITE(UNIT=CHAR_VAL, FMT=*) KVALUE + CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'CHECK_NAM_VAL_REAL', TRIM(CHAR_VAL) // ' is not allowed for variable ' // TRIM(HNAME)) +ENDIF +! +END SUBROUTINE CHECK_NAM_VAL_INT +! +END MODULE MODE_CHECK_NAM_VAL diff --git a/src/common/aux/ini_cst.F90 b/src/common/aux/mode_ini_cst.F90 similarity index 94% rename from src/common/aux/ini_cst.F90 rename to src/common/aux/mode_ini_cst.F90 index c51e7149fe22b573f6e8ee1e3d048c155d86c059..124cde9d185ed19c5ac870c1dfcc9eb5c6a2a25e 100644 --- a/src/common/aux/ini_cst.F90 +++ b/src/common/aux/mode_ini_cst.F90 @@ -3,6 +3,9 @@ !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt !MNH_LIC for details. version 1. ! ################## +MODULE MODE_INI_CST +IMPLICIT NONE +CONTAINS SUBROUTINE INI_CST ! ################## ! @@ -69,7 +72,7 @@ REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('INI_CST',0,ZHOOK_HANDLE) CALL CST_ASSOCIATE() ! -!* 1. FUNDAMENTAL CONSTANTS +!* 1. FUNDAMENTAL CONSTANTS ! --------------------- ! XPI = 2.*ASIN(1.) @@ -101,7 +104,7 @@ XG = 9.80665 ! !------------------------------------------------------------------------------- ! -!* 4. REFERENCE PRESSURE +!* 4. REFERENCE PRESSURE ! ------------------- ! ! Ocean model cst same as in 1D/CMO SURFEX @@ -115,7 +118,7 @@ XP00 = 1.E5 XTH00 = 300. !------------------------------------------------------------------------------- ! -!* 5. RADIATION CONSTANTS +!* 5. RADIATION CONSTANTS ! ------------------- ! ! Original: XSTEFAN = 2.* XPI**5 * XBOLTZ**4 / (15.* XLIGHTSPEED**2 * XPLANCK**3) @@ -127,7 +130,7 @@ XI0 = 1370. ! !------------------------------------------------------------------------------- ! -!* 6. THERMODYNAMIC CONSTANTS +!* 6. THERMODYNAMIC CONSTANTS ! ----------------------- ! XMD = 28.9644E-3 @@ -159,14 +162,15 @@ XALPHAOC = 1.9E-4 ! Coeff of Haline contraction coeff (S-1) XBETAOC= 7.7475E-4 ! -!* 7. PRECOMPUTED CONSTANTS +!* 7. PRECOMPUTED CONSTANTS ! --------------------- ! RDSRV = XRD/XRV RDSCPD = XRD/XCPD RINVXP00 = 1./XP00 ! -! Some machine precision value depending of real4/8 use +!* 8. MACHINE PRECISION VALUE DEPENDING of REAL4/8 USE +! --------------------- ! XMNH_EPSILON = EPSILON (XMNH_EPSILON ) XMNH_HUGE = HUGE (XMNH_HUGE ) @@ -193,3 +197,5 @@ XMNH_TINY_12 = SQRT (XMNH_TINY ) ! IF (LHOOK) CALL DR_HOOK('INI_CST',1,ZHOOK_HANDLE) END SUBROUTINE INI_CST + +END MODULE MODE_INI_CST diff --git a/src/common/aux/mode_posnam_phy.F90 b/src/common/aux/mode_posnam_phy.F90 new file mode 100644 index 0000000000000000000000000000000000000000..06a6d49bc62b4bba3487b87af125848b8d868b6e --- /dev/null +++ b/src/common/aux/mode_posnam_phy.F90 @@ -0,0 +1,74 @@ +MODULE MODE_POSNAM_PHY +IMPLICIT NONE +PRIVATE +PUBLIC :: POSNAM_PHY +CONTAINS +SUBROUTINE POSNAM_PHY(KULNAM, CDNAML, LDNEEDNAM, LDFOUND, KLUOUT) + +!To position namelist file at correct place for reading namelists +!Code adapted from different sources (ECMWF, ARPIFS, MESO-NH) + +USE MODE_MSG, ONLY: NVERB_FATAL, NVERB_WARNING, PRINT_MSG + +IMPLICIT NONE + +INTEGER, INTENT(IN) :: KULNAM !< Logical unit to access the namelist +CHARACTER(LEN=*), INTENT(IN) :: CDNAML !< Namelist name +LOGICAL, INTENT(IN) :: LDNEEDNAM !< True to abort if namelist is absent +LOGICAL, INTENT(OUT) :: LDFOUND !< True if namelist has been found +INTEGER, INTENT(IN) :: KLUOUT !< Logical unit for output + +INTEGER :: IVERB, ILEN, ISTATUS, ISCAN, IND +CHARACTER(LEN=120) :: CLINE +CHARACTER(LEN=1) :: CLTEST + +REWIND(KULNAM) +ILEN=LEN(CDNAML) +LDFOUND=.TRUE. +ISTATUS=0 +ISCAN=0 +CLINE=' ' +DO WHILE(ISTATUS==0 .AND. ISCAN==0) + READ(KULNAM,'(A)',IOSTAT=ISTATUS) CLINE + IF(ISTATUS<=-1) THEN + !End of file + LDFOUND=.FALSE. + IF(LDNEEDNAM) THEN + IVERB=NVERB_FATAL + ELSE + IVERB=NVERB_WARNING + ENDIF + CALL PRINT_MSG(IVERB, 'GEN', 'POSNAM_PHY', 'CANNOT LOCATE '//CDNAML) + ELSEIF(ISTATUS>=1) THEN + !Error + CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'POSNAM_PHY', 'AN ERROR HAPPENED WHILE READING THE NAMELIST') + ELSE !ISTATUS==0 + !Normal line + IND=INDEX(TO_UPPER(CLINE), '&'//TO_UPPER(CDNAML)) + IF(IND/=0) THEN + CLTEST=CLINE(IND+ILEN+1:IND+ILEN+1) + IF (.NOT. ((LGE(CLTEST,'0').AND.LLE(CLTEST,'9')) .OR. & + &(LGE(CLTEST,'A').AND.LLE(CLTEST,'Z')))) THEN + ISCAN=1 + ENDIF + ENDIF + ENDIF +ENDDO +BACKSPACE(KULNAM) + +END SUBROUTINE POSNAM_PHY + +PURE FUNCTION TO_UPPER(CSTRING) RESULT(CUPPER_STRING) + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: CSTRING !< Input string to be put in upper case + CHARACTER(LEN=LEN(CSTRING)) :: CUPPER_STRING !< Resulting string + CHARACTER(LEN=26), PARAMETER :: UPPER_CHAR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + CHARACTER(LEN=26), PARAMETER :: LOWER_CHAR = 'abcdefghijklmnopqrstuvwxyz' + INTEGER :: II, IX + CUPPER_STRING=CSTRING + DO II=1, LEN(CUPPER_STRING) + IX=INDEX(LOWER_CHAR, CUPPER_STRING(II:II)) + IF(IX/= 0) CUPPER_STRING(II:II)=UPPER_CHAR(IX:IX) + END DO +END FUNCTION TO_UPPER +END MODULE MODE_POSNAM_PHY diff --git a/src/common/aux/modi_ini_cst.F90 b/src/common/aux/modi_ini_cst.F90 deleted file mode 100644 index 08f587f77df0ce8b2b6db1b487af365ea20cf9d5..0000000000000000000000000000000000000000 --- a/src/common/aux/modi_ini_cst.F90 +++ /dev/null @@ -1,12 +0,0 @@ -! ######spl - MODULE MODI_INI_CST -! ################### -! -INTERFACE -! -SUBROUTINE INI_CST -END SUBROUTINE INI_CST -! -END INTERFACE -! -END MODULE MODI_INI_CST diff --git a/src/common/aux/modi_ini_phyex.F90 b/src/common/aux/modi_ini_phyex.F90 new file mode 100644 index 0000000000000000000000000000000000000000..f051e36ef5bbb5c26eacb2fe5cf655b961d7f8c5 --- /dev/null +++ b/src/common/aux/modi_ini_phyex.F90 @@ -0,0 +1,53 @@ +MODULE MODI_INI_PHYEX +INTERFACE +SUBROUTINE INI_PHYEX(HPROGRAM, KUNITNML, LDNEEDNAM, KLUOUT, KFROM, KTO, & + &PTSTEP, PDZMIN, & + &CMICRO, CSCONV, CTURB, & + &LDCHANGEMODEL, LDDEFAULTVAL, LDREADNAM, LDCHECK, KPRINT, LDINIT, & + &PHYEX_IN, PHYEX_OUT) +! +USE MODD_PHYEX, ONLY: PHYEX_t +USE MODD_CST, ONLY: CST_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t +USE MODD_CLOUDPAR_N, ONLY: CLOUDPAR_t +USE MODD_PARAM_MFSHALL_N,ONLY: PARAM_MFSHALL_t +USE MODD_TURB_N, ONLY: TURB_t +USE MODD_CTURB, ONLY: CSTURB_t +USE MODD_NEB_N, ONLY: NEB_t +! +IMPLICIT NONE + +CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM !< Current program +INTEGER, INTENT(IN) :: KUNITNML !< Logical unit to access the namelist +LOGICAL, INTENT(IN) :: LDNEEDNAM !< True to abort if namelist is absent +INTEGER, INTENT(IN) :: KLUOUT !< Logical unit for outputs +INTEGER, INTENT(IN) :: KFROM !< Old model number +INTEGER, INTENT(IN) :: KTO !< New model number +REAL, INTENT(IN) :: PTSTEP !< Timestep +REAL, INTENT(IN) :: PDZMIN !< Minimum thickness +CHARACTER(LEN=4), INTENT(IN) :: CMICRO !< Microphysical scheme to use +CHARACTER(LEN=4), INTENT(IN) :: CTURB !< Turbulence scheme to use +CHARACTER(LEN=4), INTENT(IN) :: CSCONV !< Shallow convection scheme to use +LOGICAL, OPTIONAL, INTENT(IN) :: LDCHANGEMODEL!< Must we change the active model +LOGICAL, OPTIONAL, INTENT(IN) :: LDDEFAULTVAL !< Must we initialize variables with default values (defaults to .TRUE.) +LOGICAL, OPTIONAL, INTENT(IN) :: LDREADNAM !< Must we read the namelist (defaults to .TRUE.) +LOGICAL, OPTIONAL, INTENT(IN) :: LDCHECK !< Must we perform some checks on values (defaults to .TRUE.) +INTEGER, OPTIONAL, INTENT(IN) :: KPRINT !< Print level (defaults to 0): 0 for no print, 1 to safely print namelist, + !! 2 to print informative messages +LOGICAL, OPTIONAL, INTENT(IN) :: LDINIT !< Must we call the init routines +TYPE(PHYEX_t), OPTIONAL, INTENT(IN) :: PHYEX_IN !< Structure for constants (IN) +TYPE(PHYEX_t), OPTIONAL, INTENT(INOUT) :: PHYEX_OUT !< Structure for constants (OUT) + +!IMPORTANT NOTE on PHYEX_OUT arguments. +!Logically this argument should be declared with INTENT(OUT) but in this case ifort (at least) breaks the +!execution when the same structure is given for the PHYEX_IN and the PHYEX_OUT argument. +!When INITENT(INOUT) is used, execution is OK on ifort. + + + + +END SUBROUTINE INI_PHYEX +END INTERFACE +END MODULE MODI_INI_PHYEX diff --git a/src/common/micro/compute_frac_ice.func.h b/src/common/micro/compute_frac_ice.func.h index 8c6d4e617d519e2277d3a7defe3b11c95513cafc..b425ef0f928e8829fc33f2cc8438fb2e765e8c30 100644 --- a/src/common/micro/compute_frac_ice.func.h +++ b/src/common/micro/compute_frac_ice.func.h @@ -2,7 +2,7 @@ !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. - ELEMENTAL SUBROUTINE COMPUTE_FRAC_ICE(HFRAC_ICE,NEB,PFRAC_ICE,PT,KERR) + ELEMENTAL SUBROUTINE COMPUTE_FRAC_ICE(HFRAC_ICE,NEBN,PFRAC_ICE,PT,KERR) ! ******* TO BE INCLUDED IN THE *CONTAINS* OF A SUBROUTINE, IN ORDER TO EASE AUTOMATIC INLINING ****** ! => Don't use drHook !!! @@ -21,13 +21,13 @@ !! R. El Khatib 12-Aug-2021 written as a include file ! !! -------------------------------------------------------------------------- -USE MODD_NEB, ONLY : NEB_t +USE MODD_NEB_n, ONLY : NEB_t USE MODD_CST, ONLY : XTT ! IMPLICIT NONE ! CHARACTER(LEN=1), INTENT(IN) :: HFRAC_ICE ! scheme to use -TYPE(NEB_t), INTENT(IN) :: NEB +TYPE(NEB_t), INTENT(IN) :: NEBN REAL, INTENT(IN) :: PT ! temperature REAL, INTENT(INOUT) :: PFRAC_ICE ! Ice fraction (1 for ice only, 0 for liquid only) INTEGER, OPTIONAL, INTENT(OUT) :: KERR ! Error code in return @@ -39,7 +39,7 @@ INTEGER, OPTIONAL, INTENT(OUT) :: KERR ! Error code in retur IF (PRESENT(KERR)) KERR=0 SELECT CASE(HFRAC_ICE) CASE ('T') !using Temperature - PFRAC_ICE = MAX( 0., MIN(1., (( NEB%XTMAXMIX - PT ) / ( NEB%XTMAXMIX - NEB%XTMINMIX )) ) ) ! freezing interval + PFRAC_ICE = MAX( 0., MIN(1., (( NEBN%XTMAXMIX - PT ) / ( NEBN%XTMAXMIX - NEBN%XTMINMIX )) ) ) ! freezing interval CASE ('O') !using Temperature with old formulae PFRAC_ICE = MAX( 0., MIN(1., (( XTT - PT ) / 40.) ) ) ! freezing interval CASE ('N') !No ice diff --git a/src/common/micro/condensation.F90 b/src/common/micro/condensation.F90 index 3504e967afd7768d4cb11218b0a31e64dee82b10..5bca21974ee8b939718632a7286c4686045f2745 100644 --- a/src/common/micro/condensation.F90 +++ b/src/common/micro/condensation.F90 @@ -4,11 +4,11 @@ !MNH_LIC for details. version 1. !----------------------------------------------------------------- ! ######spl - SUBROUTINE CONDENSATION(D, CST, ICEP, NEB, TURBN, & + SUBROUTINE CONDENSATION(D, CST, ICEP, NEBN, TURBN, & &HFRAC_ICE, HCONDENS, HLAMBDA3, & &PPABS, PZZ, PRHODREF, PT, PRV_IN, PRV_OUT, PRC_IN, PRC_OUT, PRI_IN, PRI_OUT, & &PRR, PRS, PRG, PSIGS, LMFCONV, PMFCONV, PCLDFR, PSIGRC, OUSERI, & - &OSIGMAS, OCND2, LHGT_QS, & + &OSIGMAS, OCND2, & &PICLDFR, PWCLDFR, PSSIO, PSSIU, PIFR, PSIGQSAT, & &PLV, PLS, PCPH, & &PHLC_HRC, PHLC_HCF, PHLI_HRI, PHLI_HCF, & @@ -90,8 +90,8 @@ USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_CST, ONLY: CST_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t -USE MODD_NEB, ONLY: NEB_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t +USE MODD_NEB_n, ONLY: NEB_t USE MODD_TURB_n, ONLY: TURB_t USE MODE_TIWMX, ONLY : ESATW, ESATI USE MODE_ICECLOUD, ONLY : ICECLOUD @@ -104,7 +104,7 @@ IMPLICIT NONE TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST TYPE(RAIN_ICE_PARAM_t), INTENT(IN) :: ICEP -TYPE(NEB_t), INTENT(IN) :: NEB +TYPE(NEB_t), INTENT(IN) :: NEBN TYPE(TURB_t), INTENT(IN) :: TURBN CHARACTER(LEN=1), INTENT(IN) :: HFRAC_ICE CHARACTER(LEN=4), INTENT(IN) :: HCONDENS @@ -136,7 +136,6 @@ LOGICAL, INTENT(IN) :: OSIGMAS! use present global Sigma ! or that from turbulence scheme LOGICAL, INTENT(IN) :: OCND2 ! logical switch to sparate liquid and ice ! more rigid (DEFALT value : .FALSE.) -LOGICAL, INTENT(IN) :: LHGT_QS! logical switch for height dependent VQSIGSAT REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PICLDFR ! ice cloud fraction REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PWCLDFR ! water or mixed-phase cloud fraction REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PSSIO ! Super-saturation with respect to ice in the @@ -354,7 +353,7 @@ DO JK=IKTB,IKTE ENDIF END DO DO JIJ=IIJB,IIJE - CALL COMPUTE_FRAC_ICE(HFRAC_ICE, NEB, ZFRAC(JIJ), PT(JIJ,JK), IERR) !error code IERR cannot be checked here to not break vectorization + CALL COMPUTE_FRAC_ICE(HFRAC_ICE, NEBN, ZFRAC(JIJ), PT(JIJ,JK), IERR) !error code IERR cannot be checked here to not break vectorization ENDDO ENDIF DO JIJ=IIJB,IIJE @@ -379,18 +378,18 @@ DO JK=IKTB,IKTE DO JIJ=IIJB,IIJE IF (PSIGQSAT(JIJ)/=0.) THEN ZDZFACT = 1. - IF(LHGT_QS .AND. JK+1 <= IKTE)THEN + IF(NEBN%LHGT_QS .AND. JK+1 <= IKTE)THEN ZDZFACT= MAX(ICEP%XFRMIN(23),MIN(ICEP%XFRMIN(24),(PZZ(JIJ,JK) - PZZ(JIJ,JK+1))/ZDZREF)) - ELSEIF(LHGT_QS)THEN + ELSEIF(NEBN%LHGT_QS)THEN ZDZFACT= MAX(ICEP%XFRMIN(23),MIN(ICEP%XFRMIN(24),((PZZ(JIJ,JK-1) - PZZ(JIJ,JK)))*0.8/ZDZREF)) ENDIF - IF (TURBN%LSTATNW) THEN + IF (NEBN%LSTATNW) THEN ZSIGMA(JIJ) = SQRT((PSIGS(JIJ,JK))**2 + (PSIGQSAT(JIJ)*ZDZFACT*ZQSL(JIJ)*ZA(JIJ))**2) ELSE ZSIGMA(JIJ) = SQRT((2*PSIGS(JIJ,JK))**2 + (PSIGQSAT(JIJ)*ZQSL(JIJ)*ZA(JIJ))**2) ENDIF ELSE - IF (TURBN%LSTATNW) THEN + IF (NEBN%LSTATNW) THEN ZSIGMA(JIJ) = PSIGS(JIJ,JK) ELSE ZSIGMA(JIJ) = 2*PSIGS(JIJ,JK) diff --git a/src/common/micro/ice_adjust.F90 b/src/common/micro/ice_adjust.F90 index e2981ff0107fa5d87b62c408022608aa35e95ca8..9db6f08fed52d23e7780b8fa2b53d185abfeb223 100644 --- a/src/common/micro/ice_adjust.F90 +++ b/src/common/micro/ice_adjust.F90 @@ -4,8 +4,8 @@ !MNH_LIC for details. version 1. !----------------------------------------------------------------- ! ########################################################################## - SUBROUTINE ICE_ADJUST (D, CST, ICEP, NEB, TURBN, BUCONF, KRR, & - &HFRAC_ICE, HBUNAME, OCND2, LHGT_QS, & + SUBROUTINE ICE_ADJUST (D, CST, ICEP, NEBN, TURBN, PARAMI, BUCONF, KRR, & + &HBUNAME, & &PTSTEP, PSIGQSAT, & &PRHODJ, PEXNREF, PRHODREF, PSIGS, LMFCONV, PMFCONV,& &PPABST, PZZ, & @@ -113,10 +113,11 @@ USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_CST, ONLY: CST_t -USE MODD_NEB, ONLY: NEB_t +USE MODD_NEB_n, ONLY: NEB_t USE MODD_TURB_n, ONLY: TURB_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t USE MODD_BUDGET, ONLY: TBUDGETDATA, TBUDGETCONF_t, NBUDGET_TH, NBUDGET_RV, NBUDGET_RC, NBUDGET_RI -USE MODD_RAIN_ICE_PARAM, ONLY : RAIN_ICE_PARAM_t +USE MODD_RAIN_ICE_PARAM_n, ONLY : RAIN_ICE_PARAM_t ! USE MODE_BUDGET_PHY, ONLY: BUDGET_STORE_INIT_PHY, BUDGET_STORE_END_PHY ! @@ -131,16 +132,12 @@ IMPLICIT NONE TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST TYPE(RAIN_ICE_PARAM_t), INTENT(IN) :: ICEP -TYPE(NEB_t), INTENT(IN) :: NEB +TYPE(NEB_t), INTENT(IN) :: NEBN TYPE(TURB_t), INTENT(IN) :: TURBN +TYPE(PARAM_ICE_t), INTENT(IN) :: PARAMI TYPE(TBUDGETCONF_t), INTENT(IN) :: BUCONF INTEGER, INTENT(IN) :: KRR ! Number of moist variables -CHARACTER(LEN=1), INTENT(IN) :: HFRAC_ICE CHARACTER(LEN=4), INTENT(IN) :: HBUNAME ! Name of the budget -LOGICAL, INTENT(IN) :: OCND2 ! logical switch to separate liquid - ! and ice - ! more rigid (DEFAULT value : .FALSE.) -LOGICAL, INTENT(IN) :: LHGT_QS ! logical switch for height dependent VQSIGSAT REAL, INTENT(IN) :: PTSTEP ! Double Time step ! (single if cold start) REAL, DIMENSION(D%NIJT), INTENT(IN) :: PSIGQSAT ! coeff applied to qsat variance contribution @@ -149,8 +146,8 @@ REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRHODJ ! Dry density * Jacobia REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PEXNREF ! Reference Exner function REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRHODREF ! -REAL, DIMENSION(MERGE(D%NIJT,0,TURBN%LSUBG_COND),& - MERGE(D%NKT,0,TURBN%LSUBG_COND)), INTENT(IN) :: PSIGS ! Sigma_s at time t +REAL, DIMENSION(MERGE(D%NIJT,0,NEBN%LSUBG_COND),& + MERGE(D%NKT,0,NEBN%LSUBG_COND)), INTENT(IN) :: PSIGS ! Sigma_s at time t LOGICAL, INTENT(IN) :: LMFCONV ! =SIZE(PMFCONV)!=0 REAL, DIMENSION(MERGE(D%NIJT,0,LMFCONV),& MERGE(D%NKT,0,LMFCONV)), INTENT(IN) :: PMFCONV ! convective mass flux @@ -311,7 +308,7 @@ DO JK=IKTB,IKTE ! !* 5.2 compute the cloud fraction PCLDFR ! - IF ( .NOT. TURBN%LSUBG_COND ) THEN + IF ( .NOT. NEBN%LSUBG_COND ) THEN DO JIJ=IIJB,IIJE IF (PRCS(JIJ,JK) + PRIS(JIJ,JK) > 1.E-12 / PTSTEP) THEN PCLDFR(JIJ,JK) = 1. @@ -322,7 +319,7 @@ DO JK=IKTB,IKTE PSRCS(JIJ,JK) = PCLDFR(JIJ,JK) END IF ENDDO - ELSE !TURBN%LSUBG_COND case + ELSE !NEBN%LSUBG_COND case DO JIJ=IIJB,IIJE !We limit PRC_MF+PRI_MF to PRVS*PTSTEP to avoid negative humidity ZW1=PRC_MF(JIJ,JK)/PTSTEP @@ -340,12 +337,12 @@ DO JK=IKTB,IKTE ! IF(PRESENT(PHLC_HRC) .AND. PRESENT(PHLC_HCF)) THEN ZCRIAUT=ICEP%XCRIAUTC/PRHODREF(JIJ,JK) - IF(TURBN%CSUBG_MF_PDF=='NONE')THEN + IF(PARAMI%CSUBG_MF_PDF=='NONE')THEN IF(ZW1*PTSTEP>PCF_MF(JIJ,JK) * ZCRIAUT) THEN PHLC_HRC(JIJ,JK)=PHLC_HRC(JIJ,JK)+ZW1*PTSTEP PHLC_HCF(JIJ,JK)=MIN(1.,PHLC_HCF(JIJ,JK)+PCF_MF(JIJ,JK)) ENDIF - ELSEIF(TURBN%CSUBG_MF_PDF=='TRIANGLE')THEN + ELSEIF(PARAMI%CSUBG_MF_PDF=='TRIANGLE')THEN !ZHCF is the precipitating part of the *cloud* and not of the grid cell IF(ZW1*PTSTEP>PCF_MF(JIJ,JK)*ZCRIAUT) THEN ZHCF=1.-.5*(ZCRIAUT*PCF_MF(JIJ,JK) / MAX(1.E-20, ZW1*PTSTEP))**2 @@ -368,12 +365,12 @@ DO JK=IKTB,IKTE ENDIF IF(PRESENT(PHLI_HRI) .AND. PRESENT(PHLI_HCF)) THEN ZCRIAUT=MIN(ICEP%XCRIAUTI,10**(ICEP%XACRIAUTI*(ZT(JIJ,JK)-CST%XTT)+ICEP%XBCRIAUTI)) - IF(TURBN%CSUBG_MF_PDF=='NONE')THEN + IF(PARAMI%CSUBG_MF_PDF=='NONE')THEN IF(ZW2*PTSTEP>PCF_MF(JIJ,JK) * ZCRIAUT) THEN PHLI_HRI(JIJ,JK)=PHLI_HRI(JIJ,JK)+ZW2*PTSTEP PHLI_HCF(JIJ,JK)=MIN(1.,PHLI_HCF(JIJ,JK)+PCF_MF(JIJ,JK)) ENDIF - ELSEIF(TURBN%CSUBG_MF_PDF=='TRIANGLE')THEN + ELSEIF(PARAMI%CSUBG_MF_PDF=='TRIANGLE')THEN !ZHCF is the precipitating part of the *cloud* and not of the grid cell IF(ZW2*PTSTEP>PCF_MF(JIJ,JK)*ZCRIAUT) THEN ZHCF=1.-.5*(ZCRIAUT*PCF_MF(JIJ,JK) / (ZW2*PTSTEP))**2 @@ -409,7 +406,7 @@ DO JK=IKTB,IKTE (ZW1 * ZLV(JIJ,JK) + ZW2 * ZLS(JIJ,JK)) / ZCPH(JIJ,JK) ENDDO ENDIF - ENDIF !TURBN%LSUBG_COND + ENDIF !NEBN%LSUBG_COND ENDDO ! IF(PRESENT(POUT_RV)) POUT_RV=ZRV @@ -466,18 +463,18 @@ DO JK=IKTB,IKTE ENDDO ENDDO ! -IF ( TURBN%LSUBG_COND ) THEN +IF ( NEBN%LSUBG_COND ) THEN ! !* 3. SUBGRID CONDENSATION SCHEME ! --------------------------- ! ! PSRC= s'rci'/Sigma_s^2 ! ZT is INOUT - CALL CONDENSATION(D, CST, ICEP, NEB, TURBN, & - HFRAC_ICE,TURBN%CCONDENS, TURBN%CLAMBDA3, & + CALL CONDENSATION(D, CST, ICEP, NEBN, TURBN, & + NEBN%CFRAC_ICE_ADJUST,NEBN%CCONDENS, NEBN%CLAMBDA3, & PPABST, PZZ, PRHODREF, ZT, PRV_IN, PRV_OUT, PRC_IN, PRC_OUT, PRI_IN, PRI_OUT, & PRR, PRS, PRG, PSIGS, LMFCONV, PMFCONV, PCLDFR, & - PSRCS, .TRUE., TURBN%LSIGMAS,OCND2, LHGT_QS, & + PSRCS, .TRUE., NEBN%LSIGMAS, PARAMI%LOCND2, & PICLDFR, PWCLDFR, PSSIO, PSSIU, PIFR, PSIGQSAT, & PLV=ZLV, PLS=ZLS, PCPH=ZCPH, & PHLC_HRC=PHLC_HRC, PHLC_HCF=PHLC_HCF, PHLI_HRI=PHLI_HRI, PHLI_HCF=PHLI_HCF,& @@ -492,11 +489,11 @@ ELSE ZSIGQSAT(:)=0. !We use ZSRCS because in Méso-NH, PSRCS can be a zero-length array in this case !ZT is INOUT - CALL CONDENSATION(D, CST, ICEP, NEB, TURBN, & - HFRAC_ICE,TURBN%CCONDENS, TURBN%CLAMBDA3, & + CALL CONDENSATION(D, CST, ICEP, NEBN, TURBN, & + NEBN%CFRAC_ICE_ADJUST,NEBN%CCONDENS, NEBN%CLAMBDA3, & PPABST, PZZ, PRHODREF, ZT, PRV_IN, PRV_OUT, PRC_IN, PRC_OUT, PRI_IN, PRI_OUT, & PRR, PRS, PRG, ZSIGS, LMFCONV, PMFCONV, PCLDFR, & - ZSRCS, .TRUE., .TRUE., OCND2, LHGT_QS, & + ZSRCS, .TRUE., .TRUE., PARAMI%LOCND2, & PICLDFR, PWCLDFR, PSSIO, PSSIU, PIFR, ZSIGQSAT, & PLV=ZLV, PLS=ZLS, PCPH=ZCPH, & PHLC_HRC=PHLC_HRC, PHLC_HCF=PHLC_HCF, PHLI_HRI=PHLI_HRI, PHLI_HCF=PHLI_HCF,& diff --git a/src/common/micro/ini_neb.F90 b/src/common/micro/ini_neb.F90 deleted file mode 100644 index 0a36664e96fdd44e8fd287d9bd48bb39af288a15..0000000000000000000000000000000000000000 --- a/src/common/micro/ini_neb.F90 +++ /dev/null @@ -1,63 +0,0 @@ -!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. -! ######spl - SUBROUTINE INI_NEB -! ####################### -! -!!**** *INI_NEB* - routine to initialize the nebulosity computation -!! constants. -!! -!! PURPOSE -!! ------- -! The purpose of this routine is to initialize -! constants used for nebulosity computation -! -!! METHOD -!! ------ -!! The constants are set to their numerical values -!! -!! EXTERNAL -!! -------- -!! NONE -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! Module MODD_NEB -!! -!! REFERENCE -!! --------- -!! -!! AUTHOR -!! ------ -!! S. Riette (Meteo France) -!! -!! MODIFICATIONS -!! ------------- -!! Original 24 Aug 2011 -!! -------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_NEB -USE PARKIND1, ONLY : JPRB -USE YOMHOOK , ONLY : LHOOK, DR_HOOK -! -IMPLICIT NONE -REAL(KIND=JPRB) :: ZHOOK_HANDLE -! -! --------------------------------------------------------------------------- -! -! 1. SETTING THE NUMERICAL VALUES -! -IF (LHOOK) CALL DR_HOOK('INI_NEB',0,ZHOOK_HANDLE) -! -CALL NEB_ASSOCIATE() -! -!Freezing between 0 and -20. Other possibilities are 0/-40 or -5/-25 -XTMAXMIX = 273.16 -XTMINMIX = 253.16 -IF (LHOOK) CALL DR_HOOK('INI_NEB',1,ZHOOK_HANDLE) -END SUBROUTINE INI_NEB diff --git a/src/common/micro/ini_rain_ice.F90 b/src/common/micro/ini_rain_ice.F90 deleted file mode 100644 index 1eecbaf21f410f4625851fc5f67963f77025ac4a..0000000000000000000000000000000000000000 --- a/src/common/micro/ini_rain_ice.F90 +++ /dev/null @@ -1,1484 +0,0 @@ -!MNH_LIC Copyright 1995-2019 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. -!----------------------------------------------------------------- -! ######spl - SUBROUTINE INI_RAIN_ICE ( KLUOUT, HCLOUD ) -! ########################################################### -! -!!**** *INI_RAIN_ICE * - initialize the constants necessary for the warm and -!! cold microphysical schemes. -!! -!! PURPOSE -!! ------- -!! The purpose of this routine is to initialize the constants used to -!! resolve the mixed phase microphysical scheme. The collection kernels of -!! the precipitating particles are recomputed if necessary if some parameters -!! defining the ice categories have been modified. The number of small -!! time steps leading to stable scheme for the rain, ice, snow and ggraupeln -!! sedimentation is also computed (time-splitting technique). -!! -!!** METHOD -!! ------ -!! The constants are initialized to their numerical values and the number -!! of small time step is computed by dividing the 2* Deltat time interval of -!! the Leap-frog scheme so that the stability criterion for the rain -!! sedimentation is fulfilled for a Raindrop maximal fall velocity equal -!! VTRMAX. The parameters defining the collection kernels are read and are -!! checked against the new ones. If any change occurs, these kernels are -!! recomputed and their numerical values are written in the output listing. -!! -!! EXTERNAL -!! -------- -!! GAMMA : gamma function -!! -!! -!! IMPLICIT ARGUMENTS -!! ------------------ -!! Module MODD_CST -!! XPI ! -!! XP00 ! Reference pressure -!! XRD ! Gaz constant for dry air -!! XRHOLW ! Liquid water density -!! Module MODD_REF -!! XTHVREFZ ! Reference virtual pot.temp. without orography -!! Module MODD_PARAMETERS -!! JPVEXT ! -!! Module MODD_RAIN_ICE_DESCR -!! Module MODD_RAIN_ICE_PARAM -!! -!! REFERENCE -!! --------- -!! Book2 of documentation ( routine INI_RAIN_ICE ) -!! -!! AUTHOR -!! ------ -!! J.-P. Pinty * Laboratoire d'Aerologie* -!! -!! MODIFICATIONS -!! ------------- -!! Original 04/12/95 -!! J.-P. Pinty 05/04/96 Add automatic control and regeneration of the -!! collection kernels -!! J.-P. Pinty 10/05/96 Correction of ZRATE and computations of RIM -!! J.-P. Pinty 24/11/97 Sedimentation of ice made for Columns and bug for XAG -!! J.-P. Lafore 23/11/98 Back to Lin et al. 83 formulation for RIAUTS -!! with a Critical ice content set to .5 g/Kg -!! N. Asencio 13/08/98 parallel code: PDZMIN is computed outside in ini_modeln -!! J.-P. Lafore 12/8/98 In case of nesting microphysics constants of -!! MODD_RAIN_ICE_PARAM are computed only once. -!! Only KSPLTR is computed for each model. -!! J. Stein 20/04/99 remove 2 unused local variables -!! G Molinie 21/05/99 Bug in XEXRCFRI and XRCFRI -!! J.-P. Pinty 24/06/00 Bug in RCRIMS -!! J.-P. Pinty 24/12/00 Update hail case -!! J.-P. Chaboureau & J.-P. Pinty -!! 24/03/01 Update XCRIAUTI for cirrus cases -!! J.-P. Pinty 24/11/01 Update ICE3/ICE4 options -!! S. Riette 2016-11: new ICE3/ICE4 options -!! P. Wautelet 22/01/2019 bug correction: incorrect write -! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function -! J. Wurtz 03/2022: New snow characteristics with LSNOW_T -! -!------------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -USE MODD_CST -USE MODD_PARAMETERS -USE MODD_PARAM_ICE -USE MODD_RAIN_ICE_DESCR -USE MODD_RAIN_ICE_PARAM -! -USE MODI_GAMMA -USE MODI_GAMMA_INC -USE MODE_RRCOLSS, ONLY: RRCOLSS -USE MODE_RZCOLX, ONLY: RZCOLX -USE MODE_RSCOLRG, ONLY: RSCOLRG -USE MODE_READ_XKER_RACCS, ONLY: READ_XKER_RACCS -USE MODE_READ_XKER_SDRYG, ONLY: READ_XKER_SDRYG -USE MODE_READ_XKER_RDRYG, ONLY: READ_XKER_RDRYG -USE MODE_READ_XKER_SWETH, ONLY: READ_XKER_SWETH -USE MODE_READ_XKER_GWETH, ONLY: READ_XKER_GWETH -USE MODE_READ_XKER_RWETH, ONLY: READ_XKER_RWETH -! -USE PARKIND1, ONLY : JPRB -USE YOMHOOK , ONLY : LHOOK, DR_HOOK -! -IMPLICIT NONE -! -!* 0.1 Declarations of dummy arguments : -! -! -INTEGER, INTENT(IN) :: KLUOUT ! Logical unit number for prints -! -CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! Indicator of the cloud scheme -! -! -! -!* 0.2 Declarations of local variables : -! -INTEGER :: IKB ! Coordinates of the first physical - ! points along z -INTEGER :: J1,J2 ! Internal loop indexes -REAL :: ZT ! Work variable -REAL :: ZVTRMAX ! Raindrop maximal fall velocity -REAL :: ZRHO00 ! Surface reference air density -REAL :: ZE, ZRV ! Work array for ZRHO00 computation -REAL :: ZRATE ! Geometrical growth of Lbda in the tabulated - ! functions and kernels -REAL :: ZBOUND ! XDCSLIM*Lbda_s: upper bound for the partial - ! integration of the riming rate of the aggregates -REAL :: ZEGS, ZEGR, ZEHS, & ! Bulk collection efficiencies - & ZEHG, ZEHR -! -INTEGER :: IND ! Number of interval to integrate the kernels -REAL :: ZESR ! Mean efficiency of rain-aggregate collection -REAL :: ZFDINFTY ! Factor used to define the "infinite" diameter -! -! -! -LOGICAL :: GFLAG ! Logical flag for printing the constatnts on the output - ! listing -REAL :: ZCONC_MAX ! Maximal concentration for snow -REAL :: ZGAMC,ZGAMC2 ! parameters - ! involving various moments of the generalized gamma law -REAL :: ZFACT_NUCL! Amplification factor for the minimal ice concentration -REAL :: ZXR ! Value of x_r in N_r = C_r lambda_r ** x_r -! -INTEGER :: KND -INTEGER :: KACCLBDAS,KACCLBDAR,KDRYLBDAG,KDRYLBDAS,KDRYLBDAR -INTEGER :: KWETLBDAS,KWETLBDAG,KWETLBDAR,KWETLBDAH -REAL :: PALPHAR,PALPHAS,PALPHAG,PALPHAH -REAL :: PNUR,PNUS,PNUG,PNUH -REAL :: PBR,PBS,PBG -REAL :: PCR,PCS,PCG,PCH -REAL :: PDR,PDS,PFVELOS,PDG,PDH -REAL :: PESR,PEGS,PEGR,PEHS,PEHG,PEHR -REAL :: PFDINFTY -REAL :: PACCLBDAS_MAX,PACCLBDAR_MAX,PACCLBDAS_MIN,PACCLBDAR_MIN -REAL :: PDRYLBDAG_MAX,PDRYLBDAS_MAX,PDRYLBDAG_MIN,PDRYLBDAS_MIN -REAL :: PDRYLBDAR_MAX,PDRYLBDAR_MIN -REAL :: PWETLBDAS_MAX,PWETLBDAG_MAX,PWETLBDAS_MIN,PWETLBDAG_MIN -REAL :: PWETLBDAR_MAX,PWETLBDAH_MAX,PWETLBDAR_MIN,PWETLBDAH_MIN -! -REAL(KIND=JPRB) :: ZHOOK_HANDLE -!------------------------------------------------------------------------------- -IF (LHOOK) CALL DR_HOOK('INI_RAIN_ICE',0,ZHOOK_HANDLE) -! -IF(.NOT.ASSOCIATED(XCEXVT)) CALL RAIN_ICE_DESCR_ASSOCIATE() -IF(.NOT.ASSOCIATED(XFSEDC)) CALL RAIN_ICE_PARAM_ASSOCIATE() -! -! -!* 0. FUNCTION STATEMENTS -! ------------------- -! -! -!* 0.1 p_moment of the Generalized GAMMA function -! -! -! -! -IF (ASSOCIATED(XRTMIN)) THEN ! In case of nesting microphysics constants of - ! MODD_RAIN_ICE_PARAM are computed only once, - ! but if INI_RAIN_ICE has been called already - ! one must change the XRTMIN size. - CALL RAIN_ICE_DESCR_DEALLOCATE() -END IF -! -IF (HCLOUD == 'ICE4') THEN - CALL RAIN_ICE_DESCR_ALLOCATE(7) -ELSE IF (HCLOUD == 'ICE3') THEN - CALL RAIN_ICE_DESCR_ALLOCATE(6) -END IF -! -XRTMIN(1) = 1.0E-20 -XRTMIN(2) = 1.0E-20 -XRTMIN(3) = 1.0E-20 -XRTMIN(4) = 1.0E-20 -XRTMIN(5) = 1.0E-15 -XRTMIN(6) = 1.0E-15 -IF (HCLOUD == 'ICE4') XRTMIN(7) = 1.0E-15 -! -!------------------------------------------------------------------------------- -! -!* 2. CHARACTERISTICS OF THE SPECIES -! ------------------------------ -! -! -!* 2.1 Cloud droplet and Raindrop characteristics -! -XAC = (XPI/6.0)*XRHOLW -XBC = 3.0 -XCC = XRHOLW*XG/(18.0*1.7E-5) ! Stokes flow (Pruppacher p 322 for T=273K) -XDC = 2.0 -! -! -XAR = (XPI/6.0)*XRHOLW -XBR = 3.0 -XCR = 842. -XDR = 0.8 -! -!XCCR = 1.E7 ! N0_r = XCXR * lambda_r ** ZXR -XCCR = 8.E6 ! N0_r = XCXR * lambda_r ** ZXR -ZXR = -1. ! -! -XF0R = 1.00 -XF1R = 0.26 -! -XC1R = 1./2. -! -! -!* 2.2 Ice crystal characteristics -! -! -SELECT CASE (CPRISTINE_ICE) - CASE('PLAT') - XAI = 0.82 ! Plates - XBI = 2.5 ! Plates - XC_I = 800. ! Plates - XDI = 1.0 ! Plates - XC1I = 1./XPI ! Plates - CASE('COLU') - XAI = 2.14E-3 ! Columns - XBI = 1.7 ! Columns - XC_I = 2.1E5 ! Columns - XDI = 1.585 ! Columns - XC1I = 0.8 ! Columns - CASE('BURO') - XAI = 44.0 ! Bullet rosettes - XBI = 3.0 ! Bullet rosettes - XC_I = 4.3E5 ! Bullet rosettes - XDI = 1.663 ! Bullet rosettes - XC1I = 0.5 ! Bullet rosettes -END SELECT -! -! Note that XCCI=N_i (a locally predicted value) and XCXI=0.0, implicitly -! -XF0I = 1.00 -XF2I = 0.14 -! -! -!* 2.3 Snowflakes/aggregates characteristics -! -! -XAS = 0.02 -XBS = 1.9 -IF (LSNOW_T) THEN - !Cas Gamma generalisee - XCS = 11.52 - XDS = 0.39 - XFVELOS =0.097 - !Cas MP - !XCS = 13.2 - !XDS = 0.423 - !XFVELOS = 25.14 -ELSE - XCS = 5.1 - XDS = 0.27 - XFVELOS = 0. -END IF -! -IF (.NOT. LSNOW_T) THEN - XCCS = 5.0 - XCXS = 1.0 -END IF -! -XF0S = 0.86 -XF1S = 0.28 -! -XC1S = 1./XPI -! -! -!* 2.4 Graupel/Frozen drop characteristics -! -! -XAG = 19.6 ! Lump graupel case -XBG = 2.8 ! Lump graupel case -XCG = 124. ! Lump graupel case -XDG = 0.66 ! Lump graupel case -! -XCCG = 5.E5 -XCXG = -0.5 -! XCCG = 4.E4 ! Test of Ziegler (1988) -! XCXG = -1.0 ! Test of Ziegler (1988) -! -XF0G = 0.86 -XF1G = 0.28 -! -XC1G = 1./2. -! -! -!* 2.5 Hailstone characteristics -! -! -XAH = 470. -XBH = 3.0 -XCH = 207. -XDH = 0.64 -! -!XCCH = 5.E-4 -!XCXH = 2.0 -!!!!!!!!!!!! - XCCH = 4.E4 ! Test of Ziegler (1988) - XCXH = -1.0 ! Test of Ziegler (1988) -!!! XCCH = 5.E5 ! Graupel_like -!!! XCXH = -0.5 ! Graupel_like -!!!!!!!!!!!! -! -XF0H = 0.86 -XF1H = 0.28 -! -XC1H = 1./2. -! -!------------------------------------------------------------------------------- -! -!* 3. DIMENSIONAL DISTRIBUTIONS OF THE SPECIES -! ---------------------------------------- -! -! -! 3.1 Cloud droplet distribution -! -! Over land -XALPHAC = 1.0 ! Gamma law of the Cloud droplet (here volume-like distribution) -XNUC = 3.0 ! Gamma law with little dispersion -! -! -! Over sea -XALPHAC2 = 3.0 ! Gamma law of the Cloud droplet (here volume-like distribution) -XNUC2 = 1.0 ! Gamma law with little dispersion -! -!* 3.2 Raindrops distribution -! -XALPHAR = 1.0 ! Exponential law -XNUR = 1.0 ! Exponential law -! -!* 3.3 Ice crystal distribution -! -XALPHAI = 3.0 ! Gamma law for the ice crystal volume -XNUI = 3.0 ! Gamma law with little dispersion -! -IF (LSNOW_T) THEN -!Cas GAMMAGEN - XALPHAS = .214 ! Generalized gamma law - XNUS = 43.7 ! Generalized gamma law - XTRANS_MP_GAMMAS = SQRT( ( GAMMA(XNUS + 2./XALPHAS)*GAMMA(XNUS + 4./XALPHAS) ) / & - ( 8.* GAMMA(XNUS + 1./XALPHAS)*GAMMA(XNUS + 3./XALPHAS) ) ) -ELSE - XALPHAS = 1.0 ! Exponential law - XNUS = 1.0 ! Exponential law - XTRANS_MP_GAMMAS = 1. -END IF -! -XALPHAG = 1.0 ! Exponential law -XNUG = 1.0 ! Exponential law -! -XALPHAH = 1.0 ! Gamma law -XNUH = 8.0 ! Gamma law with little dispersion -! -!* 3.4 Constants for shape parameter -! -ZGAMC = MOMG(XALPHAC,XNUC,3.) -ZGAMC2 = MOMG(XALPHAC2,XNUC2,3.) -XLBC(1) = XAR*ZGAMC -XLBC(2) = XAR*ZGAMC2 -XLBEXC = 1.0/XBC -! -XLBEXR = 1.0/(-1.0-XBR) -XLBR = ( XAR*XCCR*MOMG(XALPHAR,XNUR,XBR) )**(-XLBEXR) -! -XLBEXI = 1.0/(-XBI) -XLBI = ( XAI*MOMG(XALPHAI,XNUI,XBI) )**(-XLBEXI) -! -#if defined(REPRO48) -#else -XNS = 1.0/(XAS*MOMG(XALPHAS,XNUS,XBS)) -#endif -XLBEXS = 1.0/(XCXS-XBS) -XLBS = ( XAS*XCCS*MOMG(XALPHAS,XNUS,XBS) )**(-XLBEXS) -! -XLBEXG = 1.0/(XCXG-XBG) -XLBG = ( XAG*XCCG*MOMG(XALPHAG,XNUG,XBG) )**(-XLBEXG) -! -XLBEXH = 1.0/(XCXH-XBH) -XLBH = ( XAH*XCCH*MOMG(XALPHAH,XNUH,XBH) )**(-XLBEXH) -! -!* 3.5 Minimal values allowed for the mixing ratios -! -XLBDAR_MAX = 100000.0 -XLBDAS_MAX = 100000.0 -XLBDAG_MAX = 100000.0 -! -ZCONC_MAX = 1.E6 ! Maximal concentration for falling particules set to 1 per cc -#if defined(REPRO48) -IF(XCCS>0. .AND. XCXS>0. )XLBDAS_MAX = ( ZCONC_MAX/XCCS )**(1./XCXS) -#else -XLBDAS_MAX = 1.E6 -XLBDAS_MIN = 1000. -#endif -! -XCONC_SEA=1E8 ! 100/cm3 -XCONC_LAND=3E8 ! 300/cm3 -XCONC_URBAN=5E8 ! 500/cm3 -! -!------------------------------------------------------------------------------- -! -!* 4. CONSTANTS FOR THE SEDIMENTATION -! ------------------------------- -! -! -!* 4.1 Exponent of the fall-speed air density correction -! -XCEXVT = 0.4 -! -IKB = 1 + JPVEXT -!ZRHO00 = XP00/(XRD*XTHVREFZ(IKB)) -!According to Foote and Du Toit (1969) and List (1958), ZRHO00 must be computed for Hu=50%, P=101325Pa and T=293.15K -ZE = (50./100.) * EXP(XALPW-XBETAW/293.15-XGAMW*LOG(293.15)) -ZRV = (XRD/XRV) * ZE / (101325.-ZE) -ZRHO00 = 101325.*(1.+ZRV)/(XRD+ZRV*XRV)/293.15 -! -!* 4.2 Constants for sedimentation -! -XFSEDC(1) = GAMMA(XNUC+(XDC+3.)/XALPHAC)/GAMMA(XNUC+3./XALPHAC)* & - (ZRHO00)**XCEXVT -XFSEDC(2) = GAMMA(XNUC2+(XDC+3.)/XALPHAC2)/GAMMA(XNUC2+3./XALPHAC2)* & - (ZRHO00)**XCEXVT -! -XEXSEDR = (XBR+XDR+1.0)/(XBR+1.0) -XFSEDR = XCR*XAR*XCCR*MOMG(XALPHAR,XNUR,XBR+XDR)* & - (XAR*XCCR*MOMG(XALPHAR,XNUR,XBR))**(-XEXSEDR)*(ZRHO00)**XCEXVT -! -XEXRSEDI = (XBI+XDI)/XBI -XEXCSEDI = 1.0-XEXRSEDI -XFSEDI = (4.*XPI*900.)**(-XEXCSEDI) * & - XC_I*XAI*MOMG(XALPHAI,XNUI,XBI+XDI) * & - ((XAI*MOMG(XALPHAI,XNUI,XBI)))**(-XEXRSEDI) * & - (ZRHO00)**XCEXVT -!When we do not use computations for columns, I think we must uncomment line just below -!XEXCSEDI = XEXCSEDI * 3. to be checked -! -! Computations made for Columns -! -XEXRSEDI = 1.9324 -XEXCSEDI =-0.9324 -XFSEDI = 3.89745E11*MOMG(XALPHAI,XNUI,3.285)* & - MOMG(XALPHAI,XNUI,1.7)**(-XEXRSEDI)*(ZRHO00)**XCEXVT -XEXCSEDI =-0.9324*3.0 -WRITE (KLUOUT,FMT=*)' PRISTINE ICE SEDIMENTATION for columns XFSEDI =',XFSEDI -! -! -#if defined(REPRO48) -XEXSEDS = (XBS+XDS-XCXS)/(XBS-XCXS) -XFSEDS = XCS*XAS*XCCS*MOMG(XALPHAS,XNUS,XBS+XDS)* & - (XAS*XCCS*MOMG(XALPHAS,XNUS,XBS))**(-XEXSEDS)*(ZRHO00)**XCEXVT -#else -IF (HCLOUD == 'ICE3' .OR. HCLOUD == 'ICE4') THEN - XEXSEDS = -XDS-XBS - XFSEDS = XCS*MOMG(XALPHAS,XNUS,XBS+XDS)/(MOMG(XALPHAS,XNUS,XBS)) & - *(ZRHO00)**XCEXVT -ELSE - XEXSEDS = (XBS+XDS-XCXS)/(XBS-XCXS) - XFSEDS = XCS*XAS*XCCS*MOMG(XALPHAS,XNUS,XBS+XDS)* & - (XAS*XCCS*MOMG(XALPHAS,XNUS,XBS))**(-XEXSEDS)*(ZRHO00)**XCEXVT -END IF -#endif -! -XEXSEDG = (XBG+XDG-XCXG)/(XBG-XCXG) -XFSEDG = XCG*XAG*XCCG*MOMG(XALPHAG,XNUG,XBG+XDG)* & - (XAG*XCCG*MOMG(XALPHAG,XNUG,XBG))**(-XEXSEDG)*(ZRHO00)**XCEXVT -! -XEXSEDH = (XBH+XDH-XCXH)/(XBH-XCXH) -XFSEDH = XCH*XAH*XCCH*MOMG(XALPHAH,XNUH,XBH+XDH)* & - (XAH*XCCH*MOMG(XALPHAH,XNUH,XBH))**(-XEXSEDH)*(ZRHO00)**XCEXVT -! -! -!------------------------------------------------------------------------------- -! -!* 5. CONSTANTS FOR THE SLOW COLD PROCESSES -! ------------------------------------- -! -! -!* 5.1 Constants for ice nucleation -! -SELECT CASE (CPRISTINE_ICE) - CASE('PLAT') - ZFACT_NUCL = 1.0 ! Plates - CASE('COLU') - ZFACT_NUCL = 25.0 ! Columns - CASE('BURO') - ZFACT_NUCL = 17.0 ! Bullet rosettes -END SELECT -! -XNU10 = 50.*ZFACT_NUCL -XALPHA1 = 4.5 -XBETA1 = 0.6 -! -XNU20 = 1000.*ZFACT_NUCL -XALPHA2 = 12.96 -XBETA2 = 0.639 -! -XMNU0 = 6.88E-13 -! -GFLAG = .TRUE. -IF (GFLAG) THEN - WRITE(UNIT=KLUOUT,FMT='(" Heterogeneous nucleation")') - WRITE(UNIT=KLUOUT,FMT='(" NU10=",E13.6," ALPHA1=",E13.6," BETA1=",E13.6)') & - XNU10,XALPHA1,XBETA1 - WRITE(UNIT=KLUOUT,FMT='(" NU20=",E13.6," ALPHA2=",E13.6," BETA2=",E13.6)') & - XNU20,XALPHA2,XBETA2 - WRITE(UNIT=KLUOUT,FMT='(" mass of embryo XMNU0=",E13.6)') XMNU0 -END IF -! -XALPHA3 = -3.075 -XBETA3 = 81.00356 -XHON = (XPI/6.)*((2.0*3.0*4.0*5.0*6.0)/(2.0*3.0))*(1.1E5)**(-3.0) ! - ! Pi/6 * (G_c(6)/G_c(3)) * (1/Lbda_c**3) - ! avec Lbda_c=1.1E5 m^-1 - ! the formula is equivalent to - ! rho_dref * r_c G(6) - ! Pi/6 * -------------- * --------- - ! rho_lw * N_c G(3)*G(3) -! -GFLAG = .TRUE. -IF (GFLAG) THEN - WRITE(UNIT=KLUOUT,FMT='(" Homogeneous nucleation")') - WRITE(UNIT=KLUOUT,FMT='(" ALPHA3=",E13.6," BETA3=",E13.6)') XALPHA3,XBETA3 - WRITE(UNIT=KLUOUT,FMT='(" constant XHON=",E13.6)') XHON -END IF -! -! -!* 5.2 Constants for vapor deposition on ice -! -XSCFAC = (0.63**(1./3.))*SQRT((ZRHO00)**XCEXVT) ! One assumes Sc=0.63 -! -X0DEPI = (4.0*XPI)*XC1I*XF0I*MOMG(XALPHAI,XNUI,1.) -X2DEPI = (4.0*XPI)*XC1I*XF2I*XC_I*MOMG(XALPHAI,XNUI,XDI+2.0) -! -#if defined(REPRO48) -X0DEPS = (4.0*XPI)*XCCS*XC1S*XF0S*MOMG(XALPHAS,XNUS,1.) -X1DEPS = (4.0*XPI)*XCCS*XC1S*XF1S*SQRT(XCS)*MOMG(XALPHAS,XNUS,0.5*XDS+1.5) -XEX0DEPS = XCXS-1.0 -XEX1DEPS = XCXS-0.5*(XDS+3.0) -#else -X0DEPS = XNS*(4.0*XPI)*XC1S*XF0S*MOMG(XALPHAS,XNUS,1.) -X1DEPS = XNS*(4.0*XPI)*XC1S*XF1S*SQRT(XCS)*MOMG(XALPHAS,XNUS,0.5*XDS+1.5) -XEX0DEPS = -1.0 -XEX1DEPS = -0.5*(XDS+3.0) -#endif -XRDEPSRED = 1.0 -! -X0DEPG = (4.0*XPI)*XCCG*XC1G*XF0G*MOMG(XALPHAG,XNUG,1.) -X1DEPG = (4.0*XPI)*XCCG*XC1G*XF1G*SQRT(XCG)*MOMG(XALPHAG,XNUG,0.5*XDG+1.5) -XEX0DEPG = XCXG-1.0 -XEX1DEPG = XCXG-0.5*(XDG+3.0) -XRDEPGRED = 1.0 -! -X0DEPH = (4.0*XPI)*XCCH*XC1H*XF0H*MOMG(XALPHAH,XNUH,1.) -X1DEPH = (4.0*XPI)*XCCH*XC1H*XF1H*SQRT(XCH)*MOMG(XALPHAH,XNUH,0.5*XDH+1.5) -XEX0DEPH = XCXH-1.0 -XEX1DEPH = XCXH-0.5*(XDH+3.0) - -GFLAG = .TRUE. -IF (GFLAG) THEN - WRITE(UNIT=KLUOUT,FMT='(" factors sublimation snow/groupel")') - WRITE(UNIT=KLUOUT,FMT='(" mod sublim snow =",E13.6)') XRDEPSRED - WRITE(UNIT=KLUOUT,FMT='(" mod sublim graupel =",E13.6)') XRDEPGRED -END IF - -! -!* 5.3 Constants for pristine ice autoconversion -! -XTIMAUTI = 1.E-3 ! Time constant at T=T_t -XTEXAUTI = 0.015 ! Temperature factor of the I+I collection efficiency -!!XCRIAUTI = 0.25E-3 ! Critical ice content for the autoconversion to occur -XCRIAUTI = 0.2E-4 ! Critical ice content for the autoconversion to occur - ! Revised value by Chaboureau et al. (2001) -XACRIAUTI=0.06 -XBCRIAUTI=-3.5 -XT0CRIAUTI=(LOG10(XCRIAUTI)-XBCRIAUTI)/0.06 - -! -GFLAG = .TRUE. -IF (GFLAG) THEN - WRITE(UNIT=KLUOUT,FMT='(" pristine ice autoconversion")') - WRITE(UNIT=KLUOUT,FMT='(" Time constant XTIMAUTI=",E13.6)') XTIMAUTI - WRITE(UNIT=KLUOUT,FMT='(" Temp. factor XTEXAUTI=",E13.6)') XTEXAUTI - WRITE(UNIT=KLUOUT,FMT='(" Crit. ice cont. XCRIAUTI=",E13.6)') XCRIAUTI - WRITE(UNIT=KLUOUT,FMT='(" A Coef. for cirrus law XACRIAUTI=",E13.6)')XACRIAUTI - WRITE(UNIT=KLUOUT,FMT='(" B Coef. for cirrus law XBCRIAUTI=",E13.6)')XBCRIAUTI - WRITE(UNIT=KLUOUT,FMT='(" Temp degC at which cirrus law starts to be used=",E13.6)') XT0CRIAUTI -END IF -! -! -!* 5.4 Constants for snow aggregation -! -XCOLIS = 0.25 ! Collection efficiency of I+S -XCOLEXIS = 0.05 ! Temperature factor of the I+S collection efficiency -#if defined(REPRO48) -XFIAGGS = (XPI/4.0)*XCOLIS*XCCS*XCS*(ZRHO00**XCEXVT)*MOMG(XALPHAS,XNUS,XDS+2.0) -XEXIAGGS = XCXS-XDS-2.0 -#else -XFIAGGS = XNS*(XPI/4.0)*XCOLIS*XCS*(ZRHO00**XCEXVT)*MOMG(XALPHAS,XNUS,XDS+2.0) -XEXIAGGS = -XDS - 2.0 ! GAMMGEN LH_EXTENDED -#endif -! -GFLAG = .TRUE. -IF (GFLAG) THEN - WRITE(UNIT=KLUOUT,FMT='(" snow aggregation")') - WRITE(UNIT=KLUOUT,FMT='(" Coll. efficiency XCOLIS=",E13.6)') XCOLIS - WRITE(UNIT=KLUOUT,FMT='(" Temp. factor XCOLEXIS=",E13.6)') XCOLEXIS -END IF -! -! -!------------------------------------------------------------------------------- -! -!* 6. CONSTANTS FOR THE SLOW WARM PROCESSES -! ------------------------------------- -! -! -!* 6.1 Constants for the cloud droplets autoconversion -! -XTIMAUTC = 1.E-3 -XCRIAUTC = 0.5E-3 -! -GFLAG = .TRUE. -IF (GFLAG) THEN - WRITE(UNIT=KLUOUT,FMT='(" cloud droplets autoconversion")') - WRITE(UNIT=KLUOUT,FMT='(" Time constant XTIMAUTC=",E13.6)') XTIMAUTC - WRITE(UNIT=KLUOUT,FMT='(" Crit. ice cont. XCRIAUTC=",E13.6)') XCRIAUTC -END IF -! -!* 6.2 Constants for the accretion of cloud droplets by raindrops -! -XFCACCR = (XPI/4.0)*XCCR*XCR*(ZRHO00**XCEXVT)*MOMG(XALPHAR,XNUR,XDR+2.0) -XEXCACCR = -XDR-3.0 -! -!* 6.3 Constants for the evaporation of the raindrops -! -X0EVAR = (4.0*XPI)*XCCR*XC1R*XF0R*MOMG(XALPHAR,XNUR,1.) -X1EVAR = (4.0*XPI)*XCCR*XC1R*XF1R*SQRT(XCR)*MOMG(XALPHAR,XNUR,0.5*XDR+1.5) -XEX0EVAR = -2.0 -XEX1EVAR = -1.0-0.5*(XDR+3.0) -! -! -!------------------------------------------------------------------------------- -! -!* 7. CONSTANTS FOR THE FAST COLD PROCESSES FOR THE AGGREGATES -! -------------------------------------------------------- -! -! -!* 7.1 Constants for the riming of the aggregates -! -XDCSLIM = 0.007 ! D_cs^lim = 7 mm as suggested by Farley et al. (1989) -XCOLCS = 1.0 -#if defined(REPRO48) -XEXCRIMSS= XCXS-XDS-2.0 -XCRIMSS = (XPI/4.0)*XCOLCS*XCCS*XCS*(ZRHO00**XCEXVT)*MOMG(XALPHAS,XNUS,XDS+2.0) -#else -XEXCRIMSS= -XDS-2.0 -XCRIMSS = XNS * (XPI/4.0)*XCOLCS*XCS*(ZRHO00**XCEXVT)*MOMG(XALPHAS,XNUS,XDS+2.0) -#endif -XEXCRIMSG= XEXCRIMSS -XCRIMSG = XCRIMSS -#if defined(REPRO48) -XSRIMCG = XCCS*XAS*MOMG(XALPHAS,XNUS,XBS) -XEXSRIMCG= XCXS-XBS -XSRIMCG2 = XCCS*XAG*MOMG(XALPHAS,XNUS,XBG) -XSRIMCG3 = XFRACM90 -XEXSRIMCG2=XCXS-XBG -#else -XSRIMCG = XNS*XAS*MOMG(XALPHAS,XNUS,XBS) -XEXSRIMCG = -XBS -XSRIMCG2 = XNS*XAG*MOMG(XALPHAS,XNUS,XBG) -XSRIMCG3 = XFRACM90 -XEXSRIMCG2=XBS-XBG -#endif -! -GFLAG = .TRUE. -IF (GFLAG) THEN - WRITE(UNIT=KLUOUT,FMT='(" riming of the aggregates")') - WRITE(UNIT=KLUOUT,FMT='(" D_cs^lim (Farley et al.) XDCSLIM=",E13.6)') XDCSLIM - WRITE(UNIT=KLUOUT,FMT='(" Coll. efficiency XCOLCS=",E13.6)') XCOLCS -END IF -! -NGAMINC = 80 -XGAMINC_BOUND_MIN = 1.0E-1 ! Minimal value of (Lbda * D_cs^lim)**alpha -XGAMINC_BOUND_MAX = 1.0E7 ! Maximal value of (Lbda * D_cs^lim)**alpha -ZRATE = EXP(LOG(XGAMINC_BOUND_MAX/XGAMINC_BOUND_MIN)/REAL(NGAMINC-1)) -! -IF( .NOT.ASSOCIATED(XGAMINC_RIM1) ) CALL RAIN_ICE_PARAM_ALLOCATE('XGAMINC_RIM1', NGAMINC) -IF( .NOT.ASSOCIATED(XGAMINC_RIM2) ) CALL RAIN_ICE_PARAM_ALLOCATE('XGAMINC_RIM2', NGAMINC) -IF( .NOT.ASSOCIATED(XGAMINC_RIM4) ) CALL RAIN_ICE_PARAM_ALLOCATE('XGAMINC_RIM4', NGAMINC) -! -DO J1=1,NGAMINC - ZBOUND = XGAMINC_BOUND_MIN*ZRATE**(J1-1) - XGAMINC_RIM1(J1) = GAMMA_INC(XNUS+(2.0+XDS)/XALPHAS,ZBOUND) - XGAMINC_RIM2(J1) = GAMMA_INC(XNUS+XBS/XALPHAS ,ZBOUND) - XGAMINC_RIM4(J1) = GAMMA_INC(XNUS+XBG/XALPHAS ,ZBOUND) -END DO -! -XRIMINTP1 = XALPHAS / LOG(ZRATE) -XRIMINTP2 = 1.0 + XRIMINTP1*LOG( XDCSLIM/(XGAMINC_BOUND_MIN)**(1.0/XALPHAS) ) -! -!* 7.2 Constants for the accretion of raindrops onto aggregates -! -#if defined(REPRO48) -XFRACCSS = ((XPI**2)/24.0)*XCCS*XCCR*XRHOLW*(ZRHO00**XCEXVT) -#else -XFRACCSS = XNS*((XPI**2)/24.0)*XCCR*XRHOLW*(ZRHO00**XCEXVT) -#endif -! -XLBRACCS1 = MOMG(XALPHAS,XNUS,2.)*MOMG(XALPHAR,XNUR,3.) -XLBRACCS2 = 2.*MOMG(XALPHAS,XNUS,1.)*MOMG(XALPHAR,XNUR,4.) -XLBRACCS3 = MOMG(XALPHAR,XNUR,5.) -! -#if defined(REPRO48) -XFSACCRG = (XPI/4.0)*XAS*XCCS*XCCR*(ZRHO00**XCEXVT) -#else -XFSACCRG = XNS*(XPI/4.0)*XAS*XCCR*(ZRHO00**XCEXVT) -#endif -! -XLBSACCR1 = MOMG(XALPHAR,XNUR,2.)*MOMG(XALPHAS,XNUS,XBS) -XLBSACCR2 = 2.*MOMG(XALPHAR,XNUR,1.)*MOMG(XALPHAS,XNUS,XBS+1.) -XLBSACCR3 = MOMG(XALPHAS,XNUS,XBS+2.) -! -!* 7.2.1 Defining the ranges for the computation of the kernels -! -! Notice: One magnitude of lambda discretized over 10 points for rain -! Notice: One magnitude of lambda discretized over 10 points for snow -! -NACCLBDAS = 40 -XACCLBDAS_MIN = 5.0E1 ! Minimal value of Lbda_s to tabulate XKER_RACCS -XACCLBDAS_MAX = 5.0E5 ! Maximal value of Lbda_s to tabulate XKER_RACCS -ZRATE = LOG(XACCLBDAS_MAX/XACCLBDAS_MIN)/REAL(NACCLBDAS-1) -XACCINTP1S = 1.0 / ZRATE -XACCINTP2S = 1.0 - LOG( XACCLBDAS_MIN ) / ZRATE -NACCLBDAR = 40 -XACCLBDAR_MIN = 1.0E3 ! Minimal value of Lbda_r to tabulate XKER_RACCS -XACCLBDAR_MAX = 1.0E7 ! Maximal value of Lbda_r to tabulate XKER_RACCS -ZRATE = LOG(XACCLBDAR_MAX/XACCLBDAR_MIN)/REAL(NACCLBDAR-1) -XACCINTP1R = 1.0 / ZRATE -XACCINTP2R = 1.0 - LOG( XACCLBDAR_MIN ) / ZRATE -! -!* 7.2.2 Computations of the tabulated normalized kernels -! -IND = 50 ! Interval number, collection efficiency and infinite diameter -ZESR = 1.0 ! factor used to integrate the dimensional distributions when -ZFDINFTY = 20.0 ! computing the kernels XKER_RACCSS, XKER_RACCS and XKER_SACCRG -! -IF( .NOT.ASSOCIATED(XKER_RACCSS) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_RACCSS', NACCLBDAS,NACCLBDAR) -IF( .NOT.ASSOCIATED(XKER_RACCS ) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_RACCS', NACCLBDAS,NACCLBDAR) -IF( .NOT.ASSOCIATED(XKER_SACCRG) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_SACCRG', NACCLBDAR,NACCLBDAS) -! -CALL READ_XKER_RACCS (KACCLBDAS,KACCLBDAR,KND, & - PALPHAS,PNUS,PALPHAR,PNUR,PESR,PBS,PBR,PCS,PDS,PFVELOS,PCR,PDR, & - PACCLBDAS_MAX,PACCLBDAR_MAX,PACCLBDAS_MIN,PACCLBDAR_MIN, & - PFDINFTY ) -IF( (KACCLBDAS/=NACCLBDAS) .OR. (KACCLBDAR/=NACCLBDAR) .OR. (KND/=IND) .OR. & - (PALPHAS/=XALPHAS) .OR. (PNUS/=XNUS) .OR. & - (PALPHAR/=XALPHAR) .OR. (PNUR/=XNUR) .OR. & - (PESR/=ZESR) .OR. (PBS/=XBS) .OR. (PBR/=XBR) .OR. & - (PCS/=XCS) .OR. (PDS/=XDS) .OR. (PFVELOS/=XFVELOS) .OR. (PCR/=XCR) .OR. (PDR/=XDR) .OR. & - (PACCLBDAS_MAX/=XACCLBDAS_MAX) .OR. (PACCLBDAR_MAX/=XACCLBDAR_MAX) .OR. & - (PACCLBDAS_MIN/=XACCLBDAS_MIN) .OR. (PACCLBDAR_MIN/=XACCLBDAR_MIN) .OR. & - (PFDINFTY/=ZFDINFTY) ) THEN - CALL RRCOLSS ( IND, XALPHAS, XNUS, XALPHAR, XNUR, & - ZESR, XBR, XCS, XDS, XFVELOS, XCR, XDR, & - XACCLBDAS_MAX, XACCLBDAR_MAX, XACCLBDAS_MIN, XACCLBDAR_MIN, & - ZFDINFTY, XKER_RACCSS, XAG, XBS, XAS ) - CALL RZCOLX ( IND, XALPHAS, XNUS, XALPHAR, XNUR, & - ZESR, XBR, XCS, XDS, XFVELOS, XCR, XDR, 0., & - XACCLBDAS_MAX, XACCLBDAR_MAX, XACCLBDAS_MIN, XACCLBDAR_MIN, & - ZFDINFTY, XKER_RACCS ) - CALL RSCOLRG ( IND, XALPHAS, XNUS, XALPHAR, XNUR, & - ZESR, XBS, XCS, XDS, XFVELOS, XCR, XDR, & - XACCLBDAS_MAX, XACCLBDAR_MAX, XACCLBDAS_MIN, XACCLBDAR_MIN, & - ZFDINFTY, XKER_SACCRG, XAG, XBS, XAS ) - WRITE(UNIT=KLUOUT,FMT='("*****************************************")') - WRITE(UNIT=KLUOUT,FMT='("**** UPDATE NEW SET OF RACSS KERNELS ****")') - WRITE(UNIT=KLUOUT,FMT='("**** UPDATE NEW SET OF RACS KERNELS ****")') - WRITE(UNIT=KLUOUT,FMT='("**** UPDATE NEW SET OF SACRG KERNELS ****")') - WRITE(UNIT=KLUOUT,FMT='("*****************************************")') - WRITE(UNIT=KLUOUT,FMT='("!")') - WRITE(UNIT=KLUOUT,FMT='("KND=",I3)') IND - WRITE(UNIT=KLUOUT,FMT='("KACCLBDAS=",I3)') NACCLBDAS - WRITE(UNIT=KLUOUT,FMT='("KACCLBDAR=",I3)') NACCLBDAR - WRITE(UNIT=KLUOUT,FMT='("PALPHAS=",E13.6)') XALPHAS - WRITE(UNIT=KLUOUT,FMT='("PNUS=",E13.6)') XNUS - WRITE(UNIT=KLUOUT,FMT='("PALPHAR=",E13.6)') XALPHAR - WRITE(UNIT=KLUOUT,FMT='("PNUR=",E13.6)') XNUR - WRITE(UNIT=KLUOUT,FMT='("PESR=",E13.6)') ZESR - WRITE(UNIT=KLUOUT,FMT='("PBS=",E13.6)') XBS - WRITE(UNIT=KLUOUT,FMT='("PBR=",E13.6)') XBR - WRITE(UNIT=KLUOUT,FMT='("PCS=",E13.6)') XCS - WRITE(UNIT=KLUOUT,FMT='("PDS=",E13.6)') XDS - WRITE(UNIT=KLUOUT,FMT='("PFVELOS=",E13.6)') XFVELOS - WRITE(UNIT=KLUOUT,FMT='("PCR=",E13.6)') XCR - WRITE(UNIT=KLUOUT,FMT='("PDR=",E13.6)') XDR - WRITE(UNIT=KLUOUT,FMT='("PACCLBDAS_MAX=",E13.6)') & - XACCLBDAS_MAX - WRITE(UNIT=KLUOUT,FMT='("PACCLBDAR_MAX=",E13.6)') & - XACCLBDAR_MAX - WRITE(UNIT=KLUOUT,FMT='("PACCLBDAS_MIN=",E13.6)') & - XACCLBDAS_MIN - WRITE(UNIT=KLUOUT,FMT='("PACCLBDAR_MIN=",E13.6)') & - XACCLBDAR_MIN - WRITE(UNIT=KLUOUT,FMT='("PFDINFTY=",E13.6)') ZFDINFTY - WRITE(UNIT=KLUOUT,FMT='("!")') - WRITE(UNIT=KLUOUT,FMT='("IF( PRESENT(PKER_RACCSS) ) THEN")') - DO J1 = 1 , NACCLBDAS - DO J2 = 1 , NACCLBDAR - WRITE(UNIT=KLUOUT,FMT='(" PKER_RACCSS(",I3,",",I3,") = ",E13.6)') & - J1,J2,XKER_RACCSS(J1,J2) - END DO - END DO - WRITE(UNIT=KLUOUT,FMT='("END IF")') - WRITE(UNIT=KLUOUT,FMT='("!")') - WRITE(UNIT=KLUOUT,FMT='("IF( PRESENT(PKER_RACCS ) ) THEN")') - DO J1 = 1 , NACCLBDAS - DO J2 = 1 , NACCLBDAR - WRITE(UNIT=KLUOUT,FMT='(" PKER_RACCS (",I3,",",I3,") = ",E13.6)') & - J1,J2,XKER_RACCS (J1,J2) - END DO - END DO - WRITE(UNIT=KLUOUT,FMT='("END IF")') - WRITE(UNIT=KLUOUT,FMT='("!")') - WRITE(UNIT=KLUOUT,FMT='("IF( PRESENT(PKER_SACCRG) ) THEN")') - DO J1 = 1 , NACCLBDAR - DO J2 = 1 , NACCLBDAS - WRITE(UNIT=KLUOUT,FMT='(" PKER_SACCRG(",I3,",",I3,") = ",E13.6)') & - J1,J2,XKER_SACCRG(J1,J2) - END DO - END DO - WRITE(UNIT=KLUOUT,FMT='("END IF")') - ELSE - CALL READ_XKER_RACCS (KACCLBDAS,KACCLBDAR,KND, & - PALPHAS,PNUS,PALPHAR,PNUR,PESR,PBS,PBR,PCS,PDS,PFVELOS,PCR,PDR, & - PACCLBDAS_MAX,PACCLBDAR_MAX,PACCLBDAS_MIN,PACCLBDAR_MIN, & - PFDINFTY,XKER_RACCSS,XKER_RACCS,XKER_SACCRG ) - WRITE(UNIT=KLUOUT,FMT='(" Read XKER_RACCSS")') - WRITE(UNIT=KLUOUT,FMT='(" Read XKER_RACCS ")') - WRITE(UNIT=KLUOUT,FMT='(" Read XKER_SACCRG")') -END IF -! -!* 7.3 Constant for the conversion-melting rate -! -XFSCVMG = 2.0 -! -GFLAG = .TRUE. -IF (GFLAG) THEN - WRITE(UNIT=KLUOUT,FMT='(" conversion-melting of the aggregates")') - WRITE(UNIT=KLUOUT,FMT='(" Conv. factor XFSCVMG=",E13.6)') XFSCVMG -END IF -! -! -!------------------------------------------------------------------------------- -! -!* 8. CONSTANTS FOR THE FAST COLD PROCESSES FOR THE GRAUPELN -! ------------------------------------------------------ -! -! -!* 8.1 Constants for the rain contact freezing -! -XCOLIR = 1.0 -! -XEXRCFRI = -XDR-5.0+ZXR -XRCFRI = ((XPI**2)/24.0)*XCCR*XRHOLW*XCOLIR*XCR*(ZRHO00**XCEXVT) & - *MOMG(XALPHAR,XNUR,XDR+5.0) -XEXICFRR = -XDR-2.0+ZXR -XICFRR = (XPI/4.0)*XCOLIR*XCR*(ZRHO00**XCEXVT) & - *XCCR*MOMG(XALPHAR,XNUR,XDR+2.0) -! -GFLAG = .TRUE. -IF (GFLAG) THEN - WRITE(UNIT=KLUOUT,FMT='(" rain contact freezing")') - WRITE(UNIT=KLUOUT,FMT='(" Coll. efficiency XCOLIR=",E13.6)') XCOLIR -END IF -! -! -!* 8.2 Constants for the dry growth of the graupeln -! -!* 8.2.1 Constants for the cloud droplet collection by the graupeln -! -XFCDRYG = (XPI/4.0)*XCCG*XCG*(ZRHO00**XCEXVT)*MOMG(XALPHAG,XNUG,XDG+2.0) -! -!* 8.2.2 Constants for the cloud ice collection by the graupeln -! -XCOLIG = 0.25 ! Collection efficiency of I+G -XCOLEXIG = 0.05 ! Temperature factor of the I+G collection efficiency -XCOLIG = 0.01 ! Collection efficiency of I+G -XCOLEXIG = 0.1 ! Temperature factor of the I+G collection efficiency -WRITE (KLUOUT, FMT=*) ' NEW Constants for the cloud ice collection by the graupeln' -WRITE (KLUOUT, FMT=*) ' XCOLIG, XCOLEXIG = ',XCOLIG,XCOLEXIG -XFIDRYG = (XPI/4.0)*XCOLIG*XCCG*XCG*(ZRHO00**XCEXVT)*MOMG(XALPHAG,XNUG,XDG+2.0) -XEXFIDRYG=(XCXG-XDG-2.)/(XCXG-XBG) -XFIDRYG2=XFIDRYG/XCOLIG*(XAG*XCCG*MOMG(XALPHAG,XNUG,XBG))**(-XEXFIDRYG) -! -GFLAG = .TRUE. -IF (GFLAG) THEN - WRITE(UNIT=KLUOUT,FMT='(" cloud ice collection by the graupeln")') - WRITE(UNIT=KLUOUT,FMT='(" Coll. efficiency XCOLIG=",E13.6)') XCOLIG - WRITE(UNIT=KLUOUT,FMT='(" Temp. factor XCOLEXIG=",E13.6)') XCOLEXIG -END IF -! -!* 8.2.3 Constants for the aggregate collection by the graupeln -! -XCOLSG = 0.25 ! Collection efficiency of S+G -XCOLEXSG = 0.05 ! Temperature factor of the S+G collection efficiency -XCOLSG = 0.01 ! Collection efficiency of S+G -XCOLEXSG = 0.1 ! Temperature factor of the S+G collection efficiency -WRITE (KLUOUT, FMT=*) ' NEW Constants for the aggregate collection by the graupeln' -WRITE (KLUOUT, FMT=*) ' XCOLSG, XCOLEXSG = ',XCOLSG,XCOLEXSG -#if defined(REPRO48) -XFSDRYG = (XPI/4.0)*XCOLSG*XCCG*XCCS*XAS*(ZRHO00**XCEXVT) -#else -XFSDRYG = XNS*(XPI/4.0)*XCOLSG*XCCG*XAS*(ZRHO00**XCEXVT) -#endif -! -XLBSDRYG1 = MOMG(XALPHAG,XNUG,2.)*MOMG(XALPHAS,XNUS,XBS) -XLBSDRYG2 = 2.*MOMG(XALPHAG,XNUG,1.)*MOMG(XALPHAS,XNUS,XBS+1.) -XLBSDRYG3 = MOMG(XALPHAS,XNUS,XBS+2.) -! -GFLAG = .TRUE. -IF (GFLAG) THEN - WRITE(UNIT=KLUOUT,FMT='(" aggregate collection by the graupeln")') - WRITE(UNIT=KLUOUT,FMT='(" Coll. efficiency XCOLSG=",E13.6)') XCOLSG - WRITE(UNIT=KLUOUT,FMT='(" Temp. factor XCOLEXSG=",E13.6)') XCOLEXSG -END IF -! -!* 8.2.4 Constants for the raindrop collection by the graupeln -! -XFRDRYG = ((XPI**2)/24.0)*XCCG*XCCR*XRHOLW*(ZRHO00**XCEXVT) -! -XLBRDRYG1 = MOMG(XALPHAG,XNUG,2.)*MOMG(XALPHAR,XNUR,3.) -XLBRDRYG2 = 2.*MOMG(XALPHAG,XNUG,1.)*MOMG(XALPHAR,XNUR,4.) -XLBRDRYG3 = MOMG(XALPHAR,XNUR,5.) -! -! Notice: One magnitude of lambda discretized over 10 points -! -NDRYLBDAR = 40 -XDRYLBDAR_MIN = 1.0E3 ! Minimal value of Lbda_r to tabulate XKER_RDRYG -XDRYLBDAR_MAX = 1.0E7 ! Maximal value of Lbda_r to tabulate XKER_RDRYG -ZRATE = LOG(XDRYLBDAR_MAX/XDRYLBDAR_MIN)/REAL(NDRYLBDAR-1) -XDRYINTP1R = 1.0 / ZRATE -XDRYINTP2R = 1.0 - LOG( XDRYLBDAR_MIN ) / ZRATE -NDRYLBDAS = 80 -XDRYLBDAS_MIN = 2.5E1 ! Minimal value of Lbda_s to tabulate XKER_SDRYG -XDRYLBDAS_MAX = 2.5E9 ! Maximal value of Lbda_s to tabulate XKER_SDRYG -ZRATE = LOG(XDRYLBDAS_MAX/XDRYLBDAS_MIN)/REAL(NDRYLBDAS-1) -XDRYINTP1S = 1.0 / ZRATE -XDRYINTP2S = 1.0 - LOG( XDRYLBDAS_MIN ) / ZRATE -NDRYLBDAG = 40 -XDRYLBDAG_MIN = 1.0E3 ! Min value of Lbda_g to tabulate XKER_SDRYG,XKER_RDRYG -XDRYLBDAG_MAX = 1.0E7 ! Max value of Lbda_g to tabulate XKER_SDRYG,XKER_RDRYG -ZRATE = LOG(XDRYLBDAG_MAX/XDRYLBDAG_MIN)/REAL(NDRYLBDAG-1) -XDRYINTP1G = 1.0 / ZRATE -XDRYINTP2G = 1.0 - LOG( XDRYLBDAG_MIN ) / ZRATE -! -!* 8.2.5 Computations of the tabulated normalized kernels -! -IND = 50 ! Interval number, collection efficiency and infinite diameter -ZEGS = 1.0 ! factor used to integrate the dimensional distributions when -ZFDINFTY = 20.0 ! computing the kernels XKER_SDRYG -! -IF( .NOT.ASSOCIATED(XKER_SDRYG) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_SDRYG', NDRYLBDAG,NDRYLBDAS) -! -CALL READ_XKER_SDRYG (KDRYLBDAG,KDRYLBDAS,KND, & - PALPHAG,PNUG,PALPHAS,PNUS,PEGS,PBS,PCG,PDG,PCS,PDS,PFVELOS, & - PDRYLBDAG_MAX,PDRYLBDAS_MAX,PDRYLBDAG_MIN,PDRYLBDAS_MIN, & - PFDINFTY ) -IF( (KDRYLBDAG/=NDRYLBDAG) .OR. (KDRYLBDAS/=NDRYLBDAS) .OR. (KND/=IND) .OR. & - (PALPHAG/=XALPHAG) .OR. (PNUG/=XNUG) .OR. & - (PALPHAS/=XALPHAS) .OR. (PNUS/=XNUS) .OR. & - (PEGS/=ZEGS) .OR. (PBS/=XBS) .OR. & - (PCG/=XCG) .OR. (PDG/=XDG) .OR. (PCS/=XCS) .OR. (PDS/=XDS) .OR. (PFVELOS/=XFVELOS) .OR. & - (PDRYLBDAG_MAX/=XDRYLBDAG_MAX) .OR. (PDRYLBDAS_MAX/=XDRYLBDAS_MAX) .OR. & - (PDRYLBDAG_MIN/=XDRYLBDAG_MIN) .OR. (PDRYLBDAS_MIN/=XDRYLBDAS_MIN) .OR. & - (PFDINFTY/=ZFDINFTY) ) THEN - CALL RZCOLX ( IND, XALPHAG, XNUG, XALPHAS, XNUS, & - ZEGS, XBS, XCG, XDG, 0., XCS, XDS, XFVELOS, & - XDRYLBDAG_MAX, XDRYLBDAS_MAX, XDRYLBDAG_MIN, XDRYLBDAS_MIN, & - ZFDINFTY, XKER_SDRYG ) - WRITE(UNIT=KLUOUT,FMT='("*****************************************")') - WRITE(UNIT=KLUOUT,FMT='("**** UPDATE NEW SET OF SDRYG KERNELS ****")') - WRITE(UNIT=KLUOUT,FMT='("*****************************************")') - WRITE(UNIT=KLUOUT,FMT='("!")') - WRITE(UNIT=KLUOUT,FMT='("KND=",I3)') IND - WRITE(UNIT=KLUOUT,FMT='("KDRYLBDAG=",I3)') NDRYLBDAG - WRITE(UNIT=KLUOUT,FMT='("KDRYLBDAS=",I3)') NDRYLBDAS - WRITE(UNIT=KLUOUT,FMT='("PALPHAG=",E13.6)') XALPHAG - WRITE(UNIT=KLUOUT,FMT='("PNUG=",E13.6)') XNUG - WRITE(UNIT=KLUOUT,FMT='("PALPHAS=",E13.6)') XALPHAS - WRITE(UNIT=KLUOUT,FMT='("PNUS=",E13.6)') XNUS - WRITE(UNIT=KLUOUT,FMT='("PEGS=",E13.6)') ZEGS - WRITE(UNIT=KLUOUT,FMT='("PBS=",E13.6)') XBS - WRITE(UNIT=KLUOUT,FMT='("PCG=",E13.6)') XCG - WRITE(UNIT=KLUOUT,FMT='("PDG=",E13.6)') XDG - WRITE(UNIT=KLUOUT,FMT='("PCS=",E13.6)') XCS - WRITE(UNIT=KLUOUT,FMT='("PDS=",E13.6)') XDS - WRITE(UNIT=KLUOUT,FMT='("PFVELOS=",E13.6)') XFVELOS - WRITE(UNIT=KLUOUT,FMT='("PDRYLBDAG_MAX=",E13.6)') & - XDRYLBDAG_MAX - WRITE(UNIT=KLUOUT,FMT='("PDRYLBDAS_MAX=",E13.6)') & - XDRYLBDAS_MAX - WRITE(UNIT=KLUOUT,FMT='("PDRYLBDAG_MIN=",E13.6)') & - XDRYLBDAG_MIN - WRITE(UNIT=KLUOUT,FMT='("PDRYLBDAS_MIN=",E13.6)') & - XDRYLBDAS_MIN - WRITE(UNIT=KLUOUT,FMT='("PFDINFTY=",E13.6)') ZFDINFTY - WRITE(UNIT=KLUOUT,FMT='("!")') - WRITE(UNIT=KLUOUT,FMT='("IF( PRESENT(PKER_SDRYG) ) THEN")') - DO J1 = 1 , NDRYLBDAG - DO J2 = 1 , NDRYLBDAS - WRITE(UNIT=KLUOUT,FMT='("PKER_SDRYG(",I3,",",I3,") = ",E13.6)') & - J1,J2,XKER_SDRYG(J1,J2) - END DO - END DO - WRITE(UNIT=KLUOUT,FMT='("END IF")') - ELSE - CALL READ_XKER_SDRYG (KDRYLBDAG,KDRYLBDAS,KND, & - PALPHAG,PNUG,PALPHAS,PNUS,PEGS,PBS,PCG,PDG,PCS,PDS,PFVELOS, & - PDRYLBDAG_MAX,PDRYLBDAS_MAX,PDRYLBDAG_MIN,PDRYLBDAS_MIN, & - PFDINFTY,XKER_SDRYG ) - WRITE(UNIT=KLUOUT,FMT='(" Read XKER_SDRYG")') -END IF -! -! -IND = 50 ! Number of interval used to integrate the dimensional -ZEGR = 1.0 ! distributions when computing the kernel XKER_RDRYG -ZFDINFTY = 20.0 -! -IF( .NOT.ASSOCIATED(XKER_RDRYG) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_RDRYG', NDRYLBDAG,NDRYLBDAR) -! -CALL READ_XKER_RDRYG (KDRYLBDAG,KDRYLBDAR,KND, & - PALPHAG,PNUG,PALPHAR,PNUR,PEGR,PBR,PCG,PDG,PCR,PDR, & - PDRYLBDAG_MAX,PDRYLBDAR_MAX,PDRYLBDAG_MIN,PDRYLBDAR_MIN, & - PFDINFTY ) -IF( (KDRYLBDAG/=NDRYLBDAG) .OR. (KDRYLBDAR/=NDRYLBDAR) .OR. (KND/=IND) .OR. & - (PALPHAG/=XALPHAG) .OR. (PNUG/=XNUG) .OR. & - (PALPHAR/=XALPHAR) .OR. (PNUR/=XNUR) .OR. & - (PEGR/=ZEGR) .OR. (PBR/=XBR) .OR. & - (PCG/=XCG) .OR. (PDG/=XDG) .OR. (PCR/=XCR) .OR. (PDR/=XDR) .OR. & - (PDRYLBDAG_MAX/=XDRYLBDAG_MAX) .OR. (PDRYLBDAR_MAX/=XDRYLBDAR_MAX) .OR. & - (PDRYLBDAG_MIN/=XDRYLBDAG_MIN) .OR. (PDRYLBDAR_MIN/=XDRYLBDAR_MIN) .OR. & - (PFDINFTY/=ZFDINFTY) ) THEN - CALL RZCOLX ( IND, XALPHAG, XNUG, XALPHAR, XNUR, & - ZEGR, XBR, XCG, XDG, 0., XCR, XDR, 0., & - XDRYLBDAG_MAX, XDRYLBDAR_MAX, XDRYLBDAG_MIN, XDRYLBDAR_MIN, & - ZFDINFTY, XKER_RDRYG ) - WRITE(UNIT=KLUOUT,FMT='("*****************************************")') - WRITE(UNIT=KLUOUT,FMT='("**** UPDATE NEW SET OF RDRYG KERNELS ****")') - WRITE(UNIT=KLUOUT,FMT='("*****************************************")') - WRITE(UNIT=KLUOUT,FMT='("!")') - WRITE(UNIT=KLUOUT,FMT='("KND=",I3)') IND - WRITE(UNIT=KLUOUT,FMT='("KDRYLBDAG=",I3)') NDRYLBDAG - WRITE(UNIT=KLUOUT,FMT='("KDRYLBDAR=",I3)') NDRYLBDAR - WRITE(UNIT=KLUOUT,FMT='("PALPHAG=",E13.6)') XALPHAG - WRITE(UNIT=KLUOUT,FMT='("PNUG=",E13.6)') XNUG - WRITE(UNIT=KLUOUT,FMT='("PALPHAR=",E13.6)') XALPHAR - WRITE(UNIT=KLUOUT,FMT='("PNUR=",E13.6)') XNUR - WRITE(UNIT=KLUOUT,FMT='("PEGR=",E13.6)') ZEGR - WRITE(UNIT=KLUOUT,FMT='("PBR=",E13.6)') XBR - WRITE(UNIT=KLUOUT,FMT='("PCG=",E13.6)') XCG - WRITE(UNIT=KLUOUT,FMT='("PDG=",E13.6)') XDG - WRITE(UNIT=KLUOUT,FMT='("PCR=",E13.6)') XCR - WRITE(UNIT=KLUOUT,FMT='("PDR=",E13.6)') XDR - WRITE(UNIT=KLUOUT,FMT='("PDRYLBDAG_MAX=",E13.6)') & - XDRYLBDAG_MAX - WRITE(UNIT=KLUOUT,FMT='("PDRYLBDAR_MAX=",E13.6)') & - XDRYLBDAR_MAX - WRITE(UNIT=KLUOUT,FMT='("PDRYLBDAG_MIN=",E13.6)') & - XDRYLBDAG_MIN - WRITE(UNIT=KLUOUT,FMT='("PDRYLBDAR_MIN=",E13.6)') & - XDRYLBDAR_MIN - WRITE(UNIT=KLUOUT,FMT='("PFDINFTY=",E13.6)') ZFDINFTY - WRITE(UNIT=KLUOUT,FMT='("!")') - WRITE(UNIT=KLUOUT,FMT='("IF( PRESENT(PKER_RDRYG) ) THEN")') - DO J1 = 1 , NDRYLBDAG - DO J2 = 1 , NDRYLBDAR - WRITE(UNIT=KLUOUT,FMT='("PKER_RDRYG(",I3,",",I3,") = ",E13.6)') & - J1,J2,XKER_RDRYG(J1,J2) - END DO - END DO - WRITE(UNIT=KLUOUT,FMT='("END IF")') - ELSE - CALL READ_XKER_RDRYG (KDRYLBDAG,KDRYLBDAR,KND, & - PALPHAG,PNUG,PALPHAR,PNUR,PEGR,PBR,PCG,PDG,PCR,PDR, & - PDRYLBDAG_MAX,PDRYLBDAR_MAX,PDRYLBDAG_MIN,PDRYLBDAR_MIN, & - PFDINFTY,XKER_RDRYG ) - WRITE(UNIT=KLUOUT,FMT='(" Read XKER_RDRYG")') -END IF - -! 8.2.6 Constants for possible modifying some processes related to -! graupeln in XFRMIN(1:8), IN - concentration in XFRMIN(9) and Kogan -! autoconversion in XFRMIN(10:11). May be used for e.g. ensemble spread - XFRMIN(1:6)=0. - XFRMIN(7:9)=1. - XFRMIN(10) =10. - XFRMIN(11) =1. - XFRMIN(12) =100. !0 in suparar - XFRMIN(13) =1.0E-15 - XFRMIN(14) =120. - XFRMIN(15) =1.0E-4 - XFRMIN(16:20)=0. - XFRMIN(21:22)=1. - XFRMIN(23)=0.5 - XFRMIN(24)=1.5 - XFRMIN(25)=30. - XFRMIN(26:38)=0. - XFRMIN(39)=0.25 - XFRMIN(40)=0.15 -! -! -!------------------------------------------------------------------------------- -! -!* 9. CONSTANTS FOR THE FAST COLD PROCESSES FOR THE HAILSTONES -! -------------------------------------------------------- -! -!* 9.2 Constants for the wet growth of the hailstones -! -! -!* 9.2.1 Constant for the cloud droplet and cloud ice collection -! by the hailstones -! -XCOLIH = 0.01 ! Collection efficiency of I+H -XCOLEXIH = 0.1 ! Temperature factor of the I+H collection efficiency -XFWETH = (XPI/4.0)*XCCH*XCH*(ZRHO00**XCEXVT)*MOMG(XALPHAH,XNUH,XDH+2.0) -! -!* 9.2.2 Constants for the aggregate collection by the hailstones -! -XCOLSH = 0.01 ! Collection efficiency of S+H -XCOLEXSH = 0.1 ! Temperature factor of the S+H collection efficiency -#if defined(REPRO48) -XFSWETH = (XPI/4.0)*XCCH*XCCS*XAS*(ZRHO00**XCEXVT) -#else -XFSWETH = XNS*(XPI/4.0)*XCCH*XAS*(ZRHO00**XCEXVT) ! Wurtz -#endif -! -XLBSWETH1 = MOMG(XALPHAH,XNUH,2.)*MOMG(XALPHAS,XNUS,XBS) -XLBSWETH2 = 2.*MOMG(XALPHAH,XNUH,1.)*MOMG(XALPHAS,XNUS,XBS+1.) -XLBSWETH3 = MOMG(XALPHAS,XNUS,XBS+2.) -! -!* 9.2.3 Constants for the graupel collection by the hailstones -! -XCOLGH = 0.01 ! Collection efficiency of G+H -XCOLEXGH = 0.1 ! Temperature factor of the G+H collection efficiency -XFGWETH = (XPI/4.0)*XCCH*XCCG*XAG*(ZRHO00**XCEXVT) -! -XLBGWETH1 = MOMG(XALPHAH,XNUH,2.)*MOMG(XALPHAG,XNUG,XBG) -XLBGWETH2 = 2.*MOMG(XALPHAH,XNUH,1.)*MOMG(XALPHAG,XNUG,XBG+1.) -XLBGWETH3 = MOMG(XALPHAG,XNUG,XBG+2.) -! -!* 9.2.3 bis Constants for the rain collection by the hailstones -! -XFRWETH = (XPI/4.0)*XCCH*XCCR*XAR*(ZRHO00**XCEXVT) -! -XLBRWETH1 = MOMG(XALPHAH,XNUH,2.)*MOMG(XALPHAR,XNUR,XBR) -XLBRWETH2 = 2.*MOMG(XALPHAH,XNUH,1.)*MOMG(XALPHAR,XNUR,XBR+1.) -XLBRWETH3 = MOMG(XALPHAR,XNUR,XBR+2.) -! -! Notice: One magnitude of lambda discretized over 10 points -! -NWETLBDAS = 80 -XWETLBDAS_MIN = 2.5E1 ! Minimal value of Lbda_s to tabulate XKER_SWETH -XWETLBDAS_MAX = 2.5E9 ! Maximal value of Lbda_s to tabulate XKER_SWETH -ZRATE = LOG(XWETLBDAS_MAX/XWETLBDAS_MIN)/REAL(NWETLBDAS-1) -XWETINTP1S = 1.0 / ZRATE -XWETINTP2S = 1.0 - LOG( XWETLBDAS_MIN ) / ZRATE -NWETLBDAG = 40 -XWETLBDAG_MIN = 1.0E3 ! Min value of Lbda_g to tabulate XKER_GWETH -XWETLBDAG_MAX = 1.0E7 ! Max value of Lbda_g to tabulate XKER_GWETH -ZRATE = LOG(XWETLBDAG_MAX/XWETLBDAG_MIN)/REAL(NWETLBDAG-1) -XWETINTP1G = 1.0 / ZRATE -XWETINTP2G = 1.0 - LOG( XWETLBDAG_MIN ) / ZRATE -NWETLBDAR = 40 -XWETLBDAR_MIN = 1.0E3 ! Minimal value of Lbda_r to tabulate XKER_RWETH -XWETLBDAR_MAX = 1.0E7 ! Maximal value of Lbda_r to tabulate XKER_RWETH -ZRATE = LOG(XWETLBDAR_MAX/XWETLBDAR_MIN)/REAL(NWETLBDAR-1) -XWETINTP1R = 1.0 / ZRATE -XWETINTP2R = 1.0 - LOG( XWETLBDAR_MIN ) / ZRATE -NWETLBDAH = 40 -XWETLBDAH_MIN = 1.0E3 ! Min value of Lbda_h to tabulate XKER_SWETH,XKER_GWETH,XKER_RWETH -XWETLBDAH_MAX = 1.0E7 ! Max value of Lbda_h to tabulate XKER_SWETH,XKER_GWETH,XKER_RWETH -ZRATE = LOG(XWETLBDAH_MAX/XWETLBDAH_MIN)/REAL(NWETLBDAH-1) -XWETINTP1H = 1.0 / ZRATE -XWETINTP2H = 1.0 - LOG( XWETLBDAH_MIN ) / ZRATE -! -!* 9.2.4 Computations of the tabulated normalized kernels -! -IND = 50 ! Interval number, collection efficiency and infinite diameter -ZEHS = 1.0 ! factor used to integrate the dimensional distributions when -ZFDINFTY = 20.0 ! computing the kernels XKER_SWETH -! -IF( .NOT.ASSOCIATED(XKER_SWETH) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_SWETH', NWETLBDAH,NWETLBDAS) -! -CALL READ_XKER_SWETH (KWETLBDAH,KWETLBDAS,KND, & - PALPHAH,PNUH,PALPHAS,PNUS,PEHS,PBS,PCH,PDH,PCS,PDS,PFVELOS, & - PWETLBDAH_MAX,PWETLBDAS_MAX,PWETLBDAH_MIN,PWETLBDAS_MIN, & - PFDINFTY ) -IF( (KWETLBDAH/=NWETLBDAH) .OR. (KWETLBDAS/=NWETLBDAS) .OR. (KND/=IND) .OR. & - (PALPHAH/=XALPHAH) .OR. (PNUH/=XNUH) .OR. & - (PALPHAS/=XALPHAS) .OR. (PNUS/=XNUS) .OR. & - (PEHS/=ZEHS) .OR. (PBS/=XBS) .OR. & - (PCH/=XCH) .OR. (PDH/=XDH) .OR. (PCS/=XCS) .OR. (PDS/=XDS) .OR. (PFVELOS/=XFVELOS) .OR. & - (PWETLBDAH_MAX/=XWETLBDAH_MAX) .OR. (PWETLBDAS_MAX/=XWETLBDAS_MAX) .OR. & - (PWETLBDAH_MIN/=XWETLBDAH_MIN) .OR. (PWETLBDAS_MIN/=XWETLBDAS_MIN) .OR. & - (PFDINFTY/=ZFDINFTY) ) THEN - CALL RZCOLX ( IND, XALPHAH, XNUH, XALPHAS, XNUS, & - ZEHS, XBS, XCH, XDH, 0., XCS, XDS, XFVELOS, & - XWETLBDAH_MAX, XWETLBDAS_MAX, XWETLBDAH_MIN, XWETLBDAS_MIN, & - ZFDINFTY, XKER_SWETH ) - WRITE(UNIT=KLUOUT,FMT='("*****************************************")') - WRITE(UNIT=KLUOUT,FMT='("**** UPDATE NEW SET OF SWETH KERNELS ****")') - WRITE(UNIT=KLUOUT,FMT='("*****************************************")') - WRITE(UNIT=KLUOUT,FMT='("!")') - WRITE(UNIT=KLUOUT,FMT='("KND=",I3)') IND - WRITE(UNIT=KLUOUT,FMT='("KWETLBDAH=",I3)') NWETLBDAH - WRITE(UNIT=KLUOUT,FMT='("KWETLBDAS=",I3)') NWETLBDAS - WRITE(UNIT=KLUOUT,FMT='("PALPHAH=",E13.6)') XALPHAH - WRITE(UNIT=KLUOUT,FMT='("PNUH=",E13.6)') XNUH - WRITE(UNIT=KLUOUT,FMT='("PALPHAS=",E13.6)') XALPHAS - WRITE(UNIT=KLUOUT,FMT='("PNUS=",E13.6)') XNUS - WRITE(UNIT=KLUOUT,FMT='("PEHS=",E13.6)') ZEHS - WRITE(UNIT=KLUOUT,FMT='("PBS=",E13.6)') XBS - WRITE(UNIT=KLUOUT,FMT='("PCH=",E13.6)') XCH - WRITE(UNIT=KLUOUT,FMT='("PDH=",E13.6)') XDH - WRITE(UNIT=KLUOUT,FMT='("PCS=",E13.6)') XCS - WRITE(UNIT=KLUOUT,FMT='("PDS=",E13.6)') XDS - WRITE(UNIT=KLUOUT,FMT='("PFVELOS=",E13.6)') XFVELOS - WRITE(UNIT=KLUOUT,FMT='("PWETLBDAH_MAX=",E13.6)') & - XWETLBDAH_MAX - WRITE(UNIT=KLUOUT,FMT='("PWETLBDAS_MAX=",E13.6)') & - XWETLBDAS_MAX - WRITE(UNIT=KLUOUT,FMT='("PWETLBDAH_MIN=",E13.6)') & - XWETLBDAH_MIN - WRITE(UNIT=KLUOUT,FMT='("PWETLBDAS_MIN=",E13.6)') & - XWETLBDAS_MIN - WRITE(UNIT=KLUOUT,FMT='("PFDINFTY=",E13.6)') ZFDINFTY - WRITE(UNIT=KLUOUT,FMT='("!")') - WRITE(UNIT=KLUOUT,FMT='("IF( PRESENT(PKER_SWETH) ) THEN")') - DO J1 = 1 , NWETLBDAH - DO J2 = 1 , NWETLBDAS - WRITE(UNIT=KLUOUT,FMT='("PKER_SWETH(",I3,",",I3,") = ",E13.6)') & - J1,J2,XKER_SWETH(J1,J2) - END DO - END DO - WRITE(UNIT=KLUOUT,FMT='("END IF")') - ELSE - CALL READ_XKER_SWETH (KWETLBDAH,KWETLBDAS,KND, & - PALPHAH,PNUH,PALPHAS,PNUS,PEHS,PBS,PCH,PDH,PCS,PDS,PFVELOS, & - PWETLBDAH_MAX,PWETLBDAS_MAX,PWETLBDAH_MIN,PWETLBDAS_MIN, & - PFDINFTY,XKER_SWETH ) - WRITE(UNIT=KLUOUT,FMT='(" Read XKER_SWETH")') -END IF -! -! -IND = 50 ! Number of interval used to integrate the dimensional -ZEHG = 1.0 ! distributions when computing the kernel XKER_GWETH -ZFDINFTY = 20.0 -! -IF( .NOT.ASSOCIATED(XKER_GWETH) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_GWETH', NWETLBDAH,NWETLBDAG) -! -CALL READ_XKER_GWETH (KWETLBDAH,KWETLBDAG,KND, & - PALPHAH,PNUH,PALPHAG,PNUG,PEHG,PBG,PCH,PDH,PCG,PDG, & - PWETLBDAH_MAX,PWETLBDAG_MAX,PWETLBDAH_MIN,PWETLBDAG_MIN, & - PFDINFTY ) -IF( (KWETLBDAH/=NWETLBDAH) .OR. (KWETLBDAG/=NWETLBDAG) .OR. (KND/=IND) .OR. & - (PALPHAH/=XALPHAH) .OR. (PNUH/=XNUH) .OR. & - (PALPHAG/=XALPHAG) .OR. (PNUG/=XNUG) .OR. & - (PEHG/=ZEHG) .OR. (PBG/=XBG) .OR. & - (PCH/=XCH) .OR. (PDH/=XDH) .OR. (PCG/=XCG) .OR. (PDG/=XDG) .OR. & - (PWETLBDAH_MAX/=XWETLBDAH_MAX) .OR. (PWETLBDAG_MAX/=XWETLBDAG_MAX) .OR. & - (PWETLBDAH_MIN/=XWETLBDAH_MIN) .OR. (PWETLBDAG_MIN/=XWETLBDAG_MIN) .OR. & - (PFDINFTY/=ZFDINFTY) ) THEN - CALL RZCOLX ( IND, XALPHAH, XNUH, XALPHAG, XNUG, & - ZEHG, XBG, XCH, XDH, 0., XCG, XDG, 0., & - XWETLBDAH_MAX, XWETLBDAG_MAX, XWETLBDAH_MIN, XWETLBDAG_MIN, & - ZFDINFTY, XKER_GWETH ) - WRITE(UNIT=KLUOUT,FMT='("*****************************************")') - WRITE(UNIT=KLUOUT,FMT='("**** UPDATE NEW SET OF GWETH KERNELS ****")') - WRITE(UNIT=KLUOUT,FMT='("*****************************************")') - WRITE(UNIT=KLUOUT,FMT='("!")') - WRITE(UNIT=KLUOUT,FMT='("KND=",I3)') IND - WRITE(UNIT=KLUOUT,FMT='("KWETLBDAH=",I3)') NWETLBDAH - WRITE(UNIT=KLUOUT,FMT='("KWETLBDAG=",I3)') NWETLBDAG - WRITE(UNIT=KLUOUT,FMT='("PALPHAH=",E13.6)') XALPHAH - WRITE(UNIT=KLUOUT,FMT='("PNUH=",E13.6)') XNUH - WRITE(UNIT=KLUOUT,FMT='("PALPHAG=",E13.6)') XALPHAG - WRITE(UNIT=KLUOUT,FMT='("PNUG=",E13.6)') XNUG - WRITE(UNIT=KLUOUT,FMT='("PEHG=",E13.6)') ZEHG - WRITE(UNIT=KLUOUT,FMT='("PBG=",E13.6)') XBG - WRITE(UNIT=KLUOUT,FMT='("PCH=",E13.6)') XCH - WRITE(UNIT=KLUOUT,FMT='("PDH=",E13.6)') XDH - WRITE(UNIT=KLUOUT,FMT='("PCG=",E13.6)') XCG - WRITE(UNIT=KLUOUT,FMT='("PDG=",E13.6)') XDG - WRITE(UNIT=KLUOUT,FMT='("PWETLBDAH_MAX=",E13.6)') & - XWETLBDAH_MAX - WRITE(UNIT=KLUOUT,FMT='("PWETLBDAG_MAX=",E13.6)') & - XWETLBDAG_MAX - WRITE(UNIT=KLUOUT,FMT='("PWETLBDAH_MIN=",E13.6)') & - XWETLBDAH_MIN - WRITE(UNIT=KLUOUT,FMT='("PWETLBDAG_MIN=",E13.6)') & - XWETLBDAG_MIN - WRITE(UNIT=KLUOUT,FMT='("PFDINFTY=",E13.6)') ZFDINFTY - WRITE(UNIT=KLUOUT,FMT='("!")') - WRITE(UNIT=KLUOUT,FMT='("IF( PRESENT(PKER_GWETH) ) THEN")') - DO J1 = 1 , NWETLBDAH - DO J2 = 1 , NWETLBDAG - WRITE(UNIT=KLUOUT,FMT='("PKER_GWETH(",I3,",",I3,") = ",E13.6)') & - J1,J2,XKER_GWETH(J1,J2) - END DO - END DO - WRITE(UNIT=KLUOUT,FMT='("END IF")') - ELSE - CALL READ_XKER_GWETH (KWETLBDAH,KWETLBDAG,KND, & - PALPHAH,PNUH,PALPHAG,PNUG,PEHG,PBG,PCH,PDH,PCG,PDG, & - PWETLBDAH_MAX,PWETLBDAG_MAX,PWETLBDAH_MIN,PWETLBDAG_MIN, & - PFDINFTY,XKER_GWETH ) - WRITE(UNIT=KLUOUT,FMT='(" Read XKER_GWETH")') -END IF -! -! -IND = 50 ! Number of interval used to integrate the dimensional -ZEHR = 1.0 ! distributions when computing the kernel XKER_RWETH -ZFDINFTY = 20.0 -! -IF( .NOT.ASSOCIATED(XKER_RWETH) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_RWETH', NWETLBDAH,NWETLBDAR) -! -CALL READ_XKER_RWETH (KWETLBDAH,KWETLBDAR,KND, & - PALPHAH,PNUH,PALPHAR,PNUR,PEHR,PBR,PCH,PDH,PCR,PDR, & - PWETLBDAH_MAX,PWETLBDAR_MAX,PWETLBDAH_MIN,PWETLBDAR_MIN, & - PFDINFTY ) -IF( (KWETLBDAH/=NWETLBDAH) .OR. (KWETLBDAR/=NWETLBDAR) .OR. (KND/=IND) .OR. & - (PALPHAH/=XALPHAH) .OR. (PNUH/=XNUH) .OR. & - (PALPHAR/=XALPHAR) .OR. (PNUR/=XNUR) .OR. & - (PEHR/=ZEHR) .OR. (PBR/=XBR) .OR. & - (PCH/=XCH) .OR. (PDH/=XDH) .OR. (PCR/=XCR) .OR. (PDR/=XDR) .OR. & - (PWETLBDAH_MAX/=XWETLBDAH_MAX) .OR. (PWETLBDAR_MAX/=XWETLBDAR_MAX) .OR. & - (PWETLBDAH_MIN/=XWETLBDAH_MIN) .OR. (PWETLBDAR_MIN/=XWETLBDAR_MIN) .OR. & - (PFDINFTY/=ZFDINFTY) ) THEN - CALL RZCOLX ( IND, XALPHAH, XNUH, XALPHAR, XNUR, & - ZEHR, XBR, XCH, XDH, 0., XCR, XDR, 0., & - XWETLBDAH_MAX, XWETLBDAR_MAX, XWETLBDAH_MIN, XWETLBDAR_MIN, & - ZFDINFTY, XKER_RWETH ) - WRITE(UNIT=KLUOUT,FMT='("*****************************************")') - WRITE(UNIT=KLUOUT,FMT='("**** UPDATE NEW SET OF RWETH KERNELS ****")') - WRITE(UNIT=KLUOUT,FMT='("*****************************************")') - WRITE(UNIT=KLUOUT,FMT='("!")') - WRITE(UNIT=KLUOUT,FMT='("KND=",I3)') IND - WRITE(UNIT=KLUOUT,FMT='("KWETLBDAH=",I3)') NWETLBDAH - WRITE(UNIT=KLUOUT,FMT='("KWETLBDAR=",I3)') NWETLBDAR - WRITE(UNIT=KLUOUT,FMT='("PALPHAH=",E13.6)') XALPHAH - WRITE(UNIT=KLUOUT,FMT='("PNUH=",E13.6)') XNUH - WRITE(UNIT=KLUOUT,FMT='("PALPHAR=",E13.6)') XALPHAR - WRITE(UNIT=KLUOUT,FMT='("PNUR=",E13.6)') XNUR - WRITE(UNIT=KLUOUT,FMT='("PEHR=",E13.6)') ZEHR - WRITE(UNIT=KLUOUT,FMT='("PBR=",E13.6)') XBR - WRITE(UNIT=KLUOUT,FMT='("PCH=",E13.6)') XCH - WRITE(UNIT=KLUOUT,FMT='("PDH=",E13.6)') XDH - WRITE(UNIT=KLUOUT,FMT='("PCR=",E13.6)') XCR - WRITE(UNIT=KLUOUT,FMT='("PDR=",E13.6)') XDR - WRITE(UNIT=KLUOUT,FMT='("PWETLBDAH_MAX=",E13.6)') & - XWETLBDAH_MAX - WRITE(UNIT=KLUOUT,FMT='("PWETLBDAR_MAX=",E13.6)') & - XWETLBDAR_MAX - WRITE(UNIT=KLUOUT,FMT='("PWETLBDAH_MIN=",E13.6)') & - XWETLBDAH_MIN - WRITE(UNIT=KLUOUT,FMT='("PWETLBDAR_MIN=",E13.6)') & - XWETLBDAR_MIN - WRITE(UNIT=KLUOUT,FMT='("PFDINFTY=",E13.6)') ZFDINFTY - WRITE(UNIT=KLUOUT,FMT='("!")') - WRITE(UNIT=KLUOUT,FMT='("IF( PRESENT(PKER_RWETH) ) THEN")') - DO J1 = 1 , NWETLBDAH - DO J2 = 1 , NWETLBDAR - WRITE(UNIT=KLUOUT,FMT='("PKER_RWETH(",I3,",",I3,") = ",E13.6)') & - J1,J2,XKER_RWETH(J1,J2) - END DO - END DO - WRITE(UNIT=KLUOUT,FMT='("END IF")') - ELSE - CALL READ_XKER_RWETH (KWETLBDAH,KWETLBDAR,KND, & - PALPHAH,PNUH,PALPHAR,PNUR,PEHR,PBR,PCH,PDH,PCR,PDR, & - PWETLBDAH_MAX,PWETLBDAR_MAX,PWETLBDAH_MIN,PWETLBDAR_MIN, & - PFDINFTY,XKER_RWETH ) - WRITE(UNIT=KLUOUT,FMT='(" Read XKER_RWETH")') -END IF -! -! -!------------------------------------------------------------------------------- -! -!* 10. SOME PRINTS FOR CONTROL -! ----------------------- -! -! -GFLAG = .TRUE. -IF (GFLAG) THEN - WRITE(UNIT=KLUOUT,FMT='(" Summary of the ice particule characteristics")') - WRITE(UNIT=KLUOUT,FMT='(" PRISTINE ICE")') - WRITE(UNIT=KLUOUT,FMT='(" masse: A=",E13.6," B=",E13.6)') & - XAI,XBI - WRITE(UNIT=KLUOUT,FMT='(" vitesse: C=",E13.6," D=",E13.6)') & - XC_I,XDI - WRITE(UNIT=KLUOUT,FMT='(" distribution:AL=",E13.6,"NU=",E13.6)') & - XALPHAI,XNUI - WRITE(UNIT=KLUOUT,FMT='(" SNOW")') - WRITE(UNIT=KLUOUT,FMT='(" masse: A=",E13.6," B=",E13.6)') & - XAS,XBS - WRITE(UNIT=KLUOUT,FMT='(" vitesse: C=",E13.6," D=",E13.6)') & - XCS,XDS - WRITE(UNIT=KLUOUT,FMT='(" concentration:CC=",E13.6," x=",E13.6)') & - XCCS,XCXS - WRITE(UNIT=KLUOUT,FMT='(" distribution:AL=",E13.6,"NU=",E13.6)') & - XALPHAS,XNUS - WRITE(UNIT=KLUOUT,FMT='(" GRAUPEL")') - WRITE(UNIT=KLUOUT,FMT='(" masse: A=",E13.6," B=",E13.6)') & - XAG,XBG - WRITE(UNIT=KLUOUT,FMT='(" vitesse: C=",E13.6," D=",E13.6)') & - XCG,XDG - WRITE(UNIT=KLUOUT,FMT='(" concentration:CC=",E13.6," x=",E13.6)') & - XCCG,XCXG - WRITE(UNIT=KLUOUT,FMT='(" distribution:AL=",E13.6,"NU=",E13.6)') & - XALPHAG,XNUG - WRITE(UNIT=KLUOUT,FMT='(" HAIL")') - WRITE(UNIT=KLUOUT,FMT='(" masse: A=",E13.6," B=",E13.6)') & - XAH,XBH - WRITE(UNIT=KLUOUT,FMT='(" vitesse: C=",E13.6," D=",E13.6)') & - XCH,XDH - WRITE(UNIT=KLUOUT,FMT='(" concentration:CC=",E13.6," x=",E13.6)') & - XCCH,XCXH - WRITE(UNIT=KLUOUT,FMT='(" distribution:AL=",E13.6,"NU=",E13.6)') & - XALPHAH,XNUH -END IF -IF (LHOOK) CALL DR_HOOK('INI_RAIN_ICE',1,ZHOOK_HANDLE) -CONTAINS -! -!------------------------------------------------------------------------------ -! - FUNCTION MOMG(PALPHA,PNU,PP) RESULT (PMOMG) -! -! auxiliary routine used to compute the Pth moment order of the generalized -! gamma law -! - USE MODI_GAMMA -! - IMPLICIT NONE -! - REAL :: PALPHA ! first shape parameter of the dimensionnal distribution - REAL :: PNU ! second shape parameter of the dimensionnal distribution - REAL :: PP ! order of the moment - REAL :: PMOMG ! result: moment of order ZP -! -!------------------------------------------------------------------------------ -! -! - PMOMG = GAMMA(PNU+PP/PALPHA)/GAMMA(PNU) -! - END FUNCTION MOMG -! -!------------------------------------------------------------------------------- -! -! -END SUBROUTINE INI_RAIN_ICE diff --git a/src/common/micro/lima_adjust_split.F90 b/src/common/micro/lima_adjust_split.F90 index e5d164e8b825675385fa1f301ef88dd305706440..b4d996249e50c8021e479ac475024b691d4beba2 100644 --- a/src/common/micro/lima_adjust_split.F90 +++ b/src/common/micro/lima_adjust_split.F90 @@ -98,8 +98,8 @@ USE MODD_PARAM_LIMA USE MODD_PARAM_LIMA_COLD USE MODD_PARAM_LIMA_MIXED USE MODD_PARAM_LIMA_WARM -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM -USE MODD_NEB, ONLY: NEB +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAMN +USE MODD_NEB_n, ONLY: NEBN USE MODD_TURB_n, ONLY: TURBN USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t ! @@ -467,11 +467,11 @@ DO JITER =1,ITERMAX END IF IF (LADJ) THEN - CALL CONDENSATION(D, CST, RAIN_ICE_PARAM, NEB, TURBN, & + CALL CONDENSATION(D, CST, RAIN_ICE_PARAMN, NEBN, TURBN, & 'S', HCONDENS, HLAMBDA3, & PPABST, PZZ, PRHODREF, ZT, ZRV_IN, ZRV, ZRC_IN, ZRC, ZRI_IN, ZRI, & PRRS*PTSTEP,PRSS*PTSTEP, PRGS*PTSTEP, & - Z_SIGS, .FALSE., PMFCONV, PCLDFR, Z_SRCS, GUSERI, G_SIGMAS, .FALSE., .FALSE.,& + Z_SIGS, .FALSE., PMFCONV, PCLDFR, Z_SRCS, GUSERI, G_SIGMAS, .FALSE., & ZDUM, ZDUM, ZDUM, ZDUM, ZDUM, & ZSIGQSAT2D, PLV=ZLV, PLS=ZLS, PCPH=ZCPH ) END IF diff --git a/src/common/micro/modd_cloudparn.F90 b/src/common/micro/modd_cloudparn.F90 new file mode 100644 index 0000000000000000000000000000000000000000..fd8f2297149c9eab2daf277cac9f4bf9baecfefa --- /dev/null +++ b/src/common/micro/modd_cloudparn.F90 @@ -0,0 +1,79 @@ +!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. +!----------------------------------------------------------------- +!--------------- special set of characters for RCS information +!----------------------------------------------------------------- +! $Source$ $Revision$ +! MASDEV4_7 modd 2006/05/18 13:07:25 +!----------------------------------------------------------------- +! ###################### + MODULE MODD_CLOUDPAR_n +! ###################### +! +!!**** *MODD_CLOUDPAR$n* - declaration of the model-n dependant Microphysics +!! constants +!! +!! PURPOSE +!! ------- +! The purpose of this declarative module is to declare the +! model-n dependant Microhysics constants. +! +!! +!!** IMPLICIT ARGUMENTS +!! ------------------ +!! None +!! +!! REFERENCE +!! --------- +!! Book2 of documentation of Meso-NH (MODD_CLOUDPARn) +!! +!! AUTHOR +!! ------ +!! E. Richard *Laboratoire d'Aerologie* +!! +!! MODIFICATIONS +!! ------------- +!! Original 20/12/95 +!! J.-P. Pinty 29/11/02 add C3R5, ICE2, ICE4, ELEC +!! +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_PARAMETERS, ONLY: JPMODELMAX +IMPLICIT NONE + +TYPE CLOUDPAR_t +! + INTEGER :: NSPLITR !< Number of required small time step integration + !! for rain sedimentation computation + INTEGER :: NSPLITG !< Number of required small time step integration + !! for ice hydrometeor sedimentation computation +! +! +END TYPE CLOUDPAR_t + +TYPE(CLOUDPAR_t), DIMENSION(JPMODELMAX), TARGET, SAVE :: CLOUDPAR_MODEL +TYPE(CLOUDPAR_t), POINTER, SAVE :: CLOUDPARN => NULL() +INTEGER, POINTER :: NSPLITR=>NULL() +INTEGER, POINTER :: NSPLITG=>NULL() + +CONTAINS + +SUBROUTINE CLOUDPAR_GOTO_MODEL(KFROM, KTO) +INTEGER, INTENT(IN) :: KFROM, KTO +! +CLOUDPARN => CLOUDPAR_MODEL(KTO) +! +! Save current state for allocated arrays +! +! Current model is set to model KTO +NSPLITR=>CLOUDPAR_MODEL(KTO)%NSPLITR +NSPLITG=>CLOUDPAR_MODEL(KTO)%NSPLITG + +END SUBROUTINE CLOUDPAR_GOTO_MODEL + +END MODULE MODD_CLOUDPAR_n diff --git a/src/common/micro/modd_neb.F90 b/src/common/micro/modd_neb.F90 deleted file mode 100644 index ebca8d22354bb6009ad39ce5a5ba7abe5440485b..0000000000000000000000000000000000000000 --- a/src/common/micro/modd_neb.F90 +++ /dev/null @@ -1,56 +0,0 @@ -!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. -! ######spl - MODULE MODD_NEB -! ############################# -! -!!**** *MODD_NEB* - Declaration of nebulosity constants -!! -!! PURPOSE -!! ------- -!! The purpose of this declarative module is to declare some -!! constants for nebulosity calculation -! -!! -!!** IMPLICIT ARGUMENTS -!! ------------------ -!! None -!! -!! REFERENCE -!! --------- -!! -!! -!! AUTHOR -!! ------ -!! S. Riette (Meteo France) -!! -!! MODIFICATIONS -!! ------------- -!! Original 24 Aug 2011 -!------------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -IMPLICIT NONE -! -TYPE NEB_t - REAL :: XTMINMIX ! minimum temperature of mixed phase - REAL :: XTMAXMIX ! maximum temperature of mixed phase -END TYPE NEB_t - -TYPE(NEB_t), SAVE, TARGET :: NEB - -REAL, POINTER :: XTMINMIX=>NULL(), & - XTMAXMIX=>NULL() -! -CONTAINS -SUBROUTINE NEB_ASSOCIATE() - IMPLICIT NONE - XTMINMIX => NEB%XTMINMIX - XTMAXMIX => NEB%XTMAXMIX -END SUBROUTINE NEB_ASSOCIATE -! -END MODULE MODD_NEB diff --git a/src/common/micro/modd_nebn.F90 b/src/common/micro/modd_nebn.F90 new file mode 100644 index 0000000000000000000000000000000000000000..f1dc34df0ef32a8fe2daa2559a2af6afaedb3a4e --- /dev/null +++ b/src/common/micro/modd_nebn.F90 @@ -0,0 +1,217 @@ +!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. +! ######spl + MODULE MODD_NEB_n +! ############################# +!> @file +!!**** *MODD_NEB_n* - Declaration of nebulosity constants +!! +!! PURPOSE +!! ------- +!! The purpose of this declarative module is to declare some +!! constants for nebulosity calculation +! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! None +!! +!! REFERENCE +!! --------- +!! +!! +!! AUTHOR +!! ------ +!! S. Riette (Meteo France) +!! +!! MODIFICATIONS +!! ------------- +!! Original 24 Aug 2011 +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_PARAMETERS, ONLY: JPMODELMAX +IMPLICIT NONE +! +TYPE NEB_t + REAL :: XTMINMIX !< minimum temperature of mixed phase + REAL :: XTMAXMIX !< maximum temperature of mixed phase + LOGICAL :: LHGT_QS !< Switch for height dependent VQSIGSAT + CHARACTER(LEN=1) :: CFRAC_ICE_ADJUST !< ice fraction for adjustments + CHARACTER(LEN=1) :: CFRAC_ICE_SHALLOW_MF !< ice fraction for shallow_mf + REAL :: VSIGQSAT !< coeff applied to qsat variance contribution + CHARACTER(LEN=80) :: CCONDENS !< subrgrid condensation PDF + CHARACTER(LEN=4) :: CLAMBDA3 !< lambda3 choice for subgrid cloud scheme + LOGICAL :: LSTATNW !< updated full statistical cloud scheme + LOGICAL :: LSIGMAS !< Switch for using Sigma_s from turbulence scheme + LOGICAL :: LSUBG_COND !< Switch for subgrid condensation +END TYPE NEB_t + +TYPE(NEB_t), DIMENSION(JPMODELMAX), SAVE, TARGET :: NEB_MODEL +TYPE(NEB_t), POINTER, SAVE :: NEBN => NULL() + +REAL, POINTER :: XTMINMIX=>NULL(), & + XTMAXMIX=>NULL() +LOGICAL, POINTER :: LHGT_QS=>NULL() +CHARACTER(LEN=1), POINTER :: CFRAC_ICE_ADJUST => NULL() +CHARACTER(LEN=1), POINTER :: CFRAC_ICE_SHALLOW_MF => NULL() +REAL, POINTER :: VSIGQSAT=>NULL() +CHARACTER(LEN=80),POINTER :: CCONDENS=>NULL() +CHARACTER(LEN=4),POINTER :: CLAMBDA3=>NULL() +LOGICAL, POINTER :: LSTATNW=>NULL() +LOGICAL, POINTER :: LSIGMAS=>NULL() +LOGICAL, POINTER :: LSUBG_COND=>NULL() +! +NAMELIST/NAM_NEBn/XTMINMIX, XTMAXMIX, LHGT_QS, CFRAC_ICE_ADJUST, CFRAC_ICE_SHALLOW_MF, & + &VSIGQSAT, CCONDENS, CLAMBDA3, LSTATNW, LSIGMAS, LSUBG_COND +! +!------------------------------------------------------------------------------- +! +CONTAINS +SUBROUTINE NEB_GOTO_MODEL(KFROM, KTO) +!! This subroutine associate all the pointers to the right component of +!! the right strucuture. A value can be accessed through the structure NEBN +!! or through the strucuture NEB_MODEL(KTO) or directly through these pointers. +IMPLICIT NONE +INTEGER, INTENT(IN) :: KFROM, KTO +! +IF(.NOT. ASSOCIATED(NEBN, NEB_MODEL(KTO))) THEN + ! + NEBN => NEB_MODEL(KTO) + ! + XTMINMIX => NEBN%XTMINMIX + XTMAXMIX => NEBN%XTMAXMIX + LHGT_QS => NEBN%LHGT_QS + CFRAC_ICE_ADJUST => NEBN%CFRAC_ICE_ADJUST + CFRAC_ICE_SHALLOW_MF => NEBN%CFRAC_ICE_SHALLOW_MF + VSIGQSAT => NEBN%VSIGQSAT + CCONDENS => NEBN%CCONDENS + CLAMBDA3 => NEBN%CLAMBDA3 + LSTATNW => NEBN%LSTATNW + LSIGMAS => NEBN%LSIGMAS + LSUBG_COND => NEBN%LSUBG_COND + ! +ENDIF +END SUBROUTINE NEB_GOTO_MODEL +! +SUBROUTINE NEBN_INIT(HPROGRAM, KUNITNML, LDNEEDNAM, KLUOUT, & + &LDDEFAULTVAL, LDREADNAM, LDCHECK, KPRINT) +!!*** *NEBN_INIT* - Code needed to initialize the MODD_NEB_n module +!! +!!* PURPOSE +!! ------- +!! Sets the default values, reads the namelist, performs the checks and prints +!! +!!* METHOD +!! ------ +!! 0. Declarations +!! 1. Declaration of arguments +!! 2. Declaration of local variables +!! 1. Default values +!! 2. Namelist +!! 3. Checks +!! 4. Prints +!! +!! AUTHOR +!! ------ +!! S. Riette +!! +!! MODIFICATIONS +!! ------------- +!! Original Mar 2023 +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! --------------- +! +USE MODE_POSNAM_PHY, ONLY: POSNAM_PHY +USE MODE_MSG, ONLY: PRINT_MSG, NVERB_FATAL +USE MODE_CHECK_NAM_VAL, ONLY: CHECK_NAM_VAL_CHAR, CHECK_NAM_VAL_REAL, CHECK_NAM_VAL_INT +! +IMPLICIT NONE +! +!* 0.1. Declaration of arguments +! ------------------------ +! +CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM !< Name of the calling program +INTEGER, INTENT(IN) :: KUNITNML !< Logical unit to access the namelist +LOGICAL, INTENT(IN) :: LDNEEDNAM !< True to abort if namelist is absent +INTEGER, INTENT(IN) :: KLUOUT !< Logical unit for outputs +LOGICAL, OPTIONAL, INTENT(IN) :: LDDEFAULTVAL !< Must we initialize variables with default values (defaults to .TRUE.) +LOGICAL, OPTIONAL, INTENT(IN) :: LDREADNAM !< Must we read the namelist (defaults to .TRUE.) +LOGICAL, OPTIONAL, INTENT(IN) :: LDCHECK !< Must we perform some checks on values (defaults to .TRUE.) +INTEGER, OPTIONAL, INTENT(IN) :: KPRINT !< Print level (defaults to 0): 0 for no print, 1 to safely print namelist, + !! 2 to print informative messages +! +!* 0.2 Declaration of local variables +! ------------------------------ +! +LOGICAL :: LLDEFAULTVAL, LLREADNAM, LLCHECK, LLFOUND +INTEGER :: IPRINT + +LLDEFAULTVAL=.TRUE. +LLREADNAM=.TRUE. +LLCHECK=.TRUE. +IPRINT=0 +IF(PRESENT(LDDEFAULTVAL)) LLDEFAULTVAL=LDDEFAULTVAL +IF(PRESENT(LDREADNAM )) LLREADNAM =LDREADNAM +IF(PRESENT(LDCHECK )) LLCHECK =LDCHECK +IF(PRESENT(KPRINT )) IPRINT =KPRINT +! +!* 1. DEFAULT VALUES +! ----------------- +! +IF(LLDEFAULTVAL) THEN + !Freezing between 0 and -20. Other possibilities are 0/-40 or -5/-25 + XTMAXMIX = 273.16 + XTMINMIX = 253.16 + LHGT_QS = .FALSE. + CFRAC_ICE_ADJUST='S' + CFRAC_ICE_SHALLOW_MF='S' + VSIGQSAT = 0.02 + CCONDENS='CB02' + CLAMBDA3='CB' + LSUBG_COND=.FALSE. + LSIGMAS =.TRUE. + LSTATNW=.FALSE. + + IF(HPROGRAM=='AROME') THEN + CFRAC_ICE_ADJUST='T' + CFRAC_ICE_SHALLOW_MF='T' + VSIGQSAT=0. + LSIGMAS=.FALSE. + ENDIF +ENDIF +! +!* 2. NAMELIST +! ----------- +! +IF(LLREADNAM) THEN + CALL POSNAM_PHY(KUNITNML, 'NAM_NEBN', LDNEEDNAM, LLFOUND, KLUOUT) + IF(LLFOUND) READ(UNIT=KUNITNML, NML=NAM_NEBn) +ENDIF +! +!* 3. CHECKS +! --------- +! +IF(LLCHECK) THEN + CALL CHECK_NAM_VAL_CHAR(KLUOUT, 'CFRAC_ICE_ADJUST', CFRAC_ICE_ADJUST, 'T', 'O', 'N', 'S') + CALL CHECK_NAM_VAL_CHAR(KLUOUT, 'CFRAC_ICE_SHALLOW_MF', CFRAC_ICE_SHALLOW_MF, 'T', 'O', 'N', 'S') + CALL CHECK_NAM_VAL_CHAR(KLUOUT, 'CCONDENS', CCONDENS, 'CB02', 'GAUS') + CALL CHECK_NAM_VAL_CHAR(KLUOUT, 'CLAMBDA3', CLAMBDA3, 'CB', 'NONE') +ENDIF +! +!* 3. PRINTS +! --------- +! +IF(IPRINT>=1) THEN + WRITE(UNIT=KLUOUT,NML=NAM_NEBn) +ENDIF +! +END SUBROUTINE NEBN_INIT +! +END MODULE MODD_NEB_n diff --git a/src/common/micro/modd_param_ice.F90 b/src/common/micro/modd_param_ice.F90 deleted file mode 100644 index 8f7ea8f52195660c051d6204d788300fc215c487..0000000000000000000000000000000000000000 --- a/src/common/micro/modd_param_ice.F90 +++ /dev/null @@ -1,166 +0,0 @@ -!MNH_LIC Copyright 1995-2019 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. -!----------------------------------------------------------------- -! ######spl - MODULE MODD_PARAM_ICE -! ##################### -! -!!**** *MODD_PARAM_ICE* - declaration of the control parameters for the -!! mixed phase cloud parameterization -!! -!! PURPOSE -!! ------- -!! The purpose of this declarative module is to define the set of space -!! and time control parameters for the microphysics. -!! -!! -!!** IMPLICIT ARGUMENTS -!! ------------------ -!! None -!! -!! REFERENCE -!! --------- -!! Book2 of documentation of Meso-NH (module MODD_PARAM_ICE) -!! -!! AUTHOR -!! ------ -!! J.-P. Pinty *Laboratoire d'Aerologie* -!! -!! MODIFICATIONS -!! ------------- -!! Original 14/12/95 -!! Jan 2015 S. Riette: new ICE3/ICE4 parameters -!! 01/10/16 (C.Lac) Add droplet deposition for fog -!! -!------------------------------------------------------------------------------- -! -!* 0. DECLARATIONS -! ------------ -! -IMPLICIT NONE -! -TYPE PARAM_ICE_t -LOGICAL :: LWARM ! When .TRUE. activates the formation of rain by - ! the warm microphysical processes -LOGICAL :: LSEDIC ! TRUE to enable the droplet sedimentation -LOGICAL :: LDEPOSC ! TRUE to enable cloud droplet deposition -REAL :: XVDEPOSC ! Droplet deposition velocity -! -CHARACTER(LEN=4) :: CPRISTINE_ICE ! Pristine ice type PLAT, COLU or BURO -CHARACTER(LEN=4) :: CSEDIM ! Sedimentation calculation mode -! -LOGICAL :: LRED ! To use modified ICE3/ICE4 to reduce time step dependency -LOGICAL :: LFEEDBACKT ! When .TRUE. feed back on temperature is taken into account -LOGICAL :: LEVLIMIT ! When .TRUE. water vapour pressure is limited by saturation -LOGICAL :: LNULLWETG ! When .TRUE. graupel wet growth is activated with null rate (to allow water shedding) -LOGICAL :: LWETGPOST ! When .TRUE. graupel wet growth is activated with positive temperature (to allow water shedding) -LOGICAL :: LNULLWETH ! Same as LNULLWETG but for hail -LOGICAL :: LWETHPOST ! Same as LWETGPOST but for hail -CHARACTER(LEN=4) :: CSNOWRIMING ! OLD or M90 for Murakami 1990 formulation -REAL :: XFRACM90 ! Fraction used for the Murakami 1990 formulation -INTEGER :: NMAXITER ! Maximum number of iterations for mixing ratio or time splitting -REAL :: XMRSTEP ! maximum mixing ratio step for mixing ratio splitting -LOGICAL :: LCONVHG ! TRUE to allow the conversion from hail to graupel -LOGICAL :: LCRFLIMIT !True to limit rain contact freezing to possible heat exchange -! -REAL :: XTSTEP_TS ! Approximative time step for time-splitting (0 for no time-splitting) -! -CHARACTER(LEN=80) :: CSUBG_RC_RR_ACCR ! subgrid rc-rr accretion -CHARACTER(LEN=80) :: CSUBG_RR_EVAP ! subgrid rr evaporation -CHARACTER(LEN=80) :: CSUBG_PR_PDF ! pdf for subgrid precipitation -! -LOGICAL :: LADJ_BEFORE ! must we perform an adjustment before rain_ice call -LOGICAL :: LADJ_AFTER ! must we perform an adjustment after rain_ice call -CHARACTER(LEN=1) :: CFRAC_ICE_ADJUST ! ice fraction for adjustments -CHARACTER(LEN=1) :: CFRAC_ICE_SHALLOW_MF ! ice fraction for shallow_mf -LOGICAL :: LSEDIM_AFTER ! sedimentation done before (.FALSE.) or after (.TRUE.) microphysics -! -REAL :: XSPLIT_MAXCFL ! Maximum CFL number allowed for SPLIT scheme -LOGICAL :: LSNOW_T ! Snow parameterization from Wurtz (2021) -! -LOGICAL :: LPACK_INTERP !To pack arrays before computing the different interpolations (kernels and other) -LOGICAL :: LPACK_MICRO !To pack arrays before computing the process tendencies -END TYPE PARAM_ICE_t -! -TYPE(PARAM_ICE_t), SAVE, TARGET :: PARAM_ICE -! -LOGICAL, POINTER :: LWARM => NULL(), & - LSEDIC => NULL(), & - LDEPOSC => NULL(), & - LRED => NULL(), & - LFEEDBACKT => NULL(), & - LEVLIMIT => NULL(), & - LNULLWETG => NULL(), & - LWETGPOST => NULL(), & - LNULLWETH => NULL(), & - LWETHPOST => NULL(), & - LCONVHG => NULL(), & - LCRFLIMIT => NULL(), & - LADJ_BEFORE => NULL(), & - LADJ_AFTER => NULL(), & - LSEDIM_AFTER => NULL(),& - LSNOW_T => NULL(),& - LPACK_INTERP => NULL(),& - LPACK_MICRO => NULL() - -REAL, POINTER :: XVDEPOSC => NULL(), & - XFRACM90 => NULL(), & - XMRSTEP => NULL(), & - XTSTEP_TS => NULL(), & - XSPLIT_MAXCFL => NULL() - -INTEGER, POINTER :: NMAXITER => NULL() - -CHARACTER(LEN=1), POINTER :: CFRAC_ICE_ADJUST => NULL() -CHARACTER(LEN=1), POINTER :: CFRAC_ICE_SHALLOW_MF => NULL() -CHARACTER(LEN=4), POINTER :: CPRISTINE_ICE => NULL() -CHARACTER(LEN=4), POINTER :: CSEDIM => NULL() -CHARACTER(LEN=4), POINTER :: CSNOWRIMING => NULL() -CHARACTER(LEN=80),POINTER :: CSUBG_RC_RR_ACCR => NULL() -CHARACTER(LEN=80),POINTER :: CSUBG_RR_EVAP => NULL() -CHARACTER(LEN=80),POINTER :: CSUBG_PR_PDF => NULL() -! -!------------------------------------------------------------------------------- -! -CONTAINS -SUBROUTINE PARAM_ICE_ASSOCIATE() - IMPLICIT NONE - LWARM => PARAM_ICE%LWARM - LSEDIC => PARAM_ICE%LSEDIC - LDEPOSC => PARAM_ICE%LDEPOSC - LRED => PARAM_ICE%LRED - LFEEDBACKT => PARAM_ICE%LFEEDBACKT - LEVLIMIT => PARAM_ICE%LEVLIMIT - LNULLWETG => PARAM_ICE%LNULLWETG - LWETGPOST => PARAM_ICE%LWETGPOST - LNULLWETH => PARAM_ICE%LNULLWETH - LWETHPOST => PARAM_ICE%LWETHPOST - LCONVHG => PARAM_ICE%LCONVHG - LCRFLIMIT => PARAM_ICE%LCRFLIMIT - LADJ_BEFORE => PARAM_ICE%LADJ_BEFORE - LADJ_AFTER => PARAM_ICE%LADJ_AFTER - LSEDIM_AFTER => PARAM_ICE%LSEDIM_AFTER - LSNOW_T => PARAM_ICE%LSNOW_T - LPACK_INTERP => PARAM_ICE%LPACK_INTERP - LPACK_MICRO => PARAM_ICE%LPACK_MICRO - ! - XVDEPOSC => PARAM_ICE%XVDEPOSC - XFRACM90 => PARAM_ICE%XFRACM90 - XMRSTEP => PARAM_ICE%XMRSTEP - XTSTEP_TS => PARAM_ICE%XTSTEP_TS - XSPLIT_MAXCFL => PARAM_ICE%XSPLIT_MAXCFL - ! - NMAXITER => PARAM_ICE%NMAXITER - ! - CFRAC_ICE_ADJUST => PARAM_ICE%CFRAC_ICE_ADJUST - CFRAC_ICE_SHALLOW_MF => PARAM_ICE%CFRAC_ICE_SHALLOW_MF - CPRISTINE_ICE => PARAM_ICE%CPRISTINE_ICE - CSEDIM => PARAM_ICE%CSEDIM - CSNOWRIMING => PARAM_ICE%CSNOWRIMING - CSUBG_RC_RR_ACCR => PARAM_ICE%CSUBG_RC_RR_ACCR - CSUBG_RR_EVAP => PARAM_ICE%CSUBG_RR_EVAP - CSUBG_PR_PDF => PARAM_ICE%CSUBG_PR_PDF -END SUBROUTINE PARAM_ICE_ASSOCIATE -END MODULE MODD_PARAM_ICE diff --git a/src/common/micro/modd_param_icen.F90 b/src/common/micro/modd_param_icen.F90 new file mode 100644 index 0000000000000000000000000000000000000000..78100cba203bd7c09ec7c9dd083fbd34edc79522 --- /dev/null +++ b/src/common/micro/modd_param_icen.F90 @@ -0,0 +1,427 @@ +!MNH_LIC Copyright 1995-2019 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. +!----------------------------------------------------------------- +! ######spl + MODULE MODD_PARAM_ICE_n +! ##################### +!> @file +!! *MODD_PARAM_ICE_n* - declaration of the control parameters for the +!! mixed phase cloud parameterization +!! +!! PURPOSE +!! ------- +!! The purpose of this declarative module is to define the set of space +!! and time control parameters for the microphysics. +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! None +!! +!! REFERENCE +!! --------- +!! Book2 of documentation of Meso-NH (module MODD_PARAM_ICE) +!! +!! AUTHOR +!! ------ +!! J.-P. Pinty *Laboratoire d'Aerologie* +!! +!! MODIFICATIONS +!! ------------- +!! +!! - Original 14/12/95 +!! - Jan 2015 S. Riette: new ICE3/ICE4 parameters +!! - 01/10/16 (C.Lac) Add droplet deposition for fog +!! +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_PARAMETERS, ONLY: JPMODELMAX +IMPLICIT NONE +! +TYPE PARAM_ICE_t +LOGICAL :: LWARM !< When .TRUE. activates the formation of rain by + !! the warm microphysical processes +LOGICAL :: LSEDIC !< TRUE to enable the droplet sedimentation +LOGICAL :: LDEPOSC !< TRUE to enable cloud droplet deposition +REAL :: XVDEPOSC !< Droplet deposition velocity +! +CHARACTER(LEN=4) :: CPRISTINE_ICE !< Pristine ice type PLAT, COLU or BURO +CHARACTER(LEN=4) :: CSEDIM !< Sedimentation calculation mode +! +LOGICAL :: LRED !< To use modified ICE3/ICE4 to reduce time step dependency +LOGICAL :: LFEEDBACKT !< When .TRUE. feed back on temperature is taken into account +LOGICAL :: LEVLIMIT !< When .TRUE. water vapour pressure is limited by saturation +LOGICAL :: LNULLWETG !< When .TRUE. graupel wet growth is activated with null rate (to allow water shedding) +LOGICAL :: LWETGPOST !< When .TRUE. graupel wet growth is activated with positive temperature (to allow water shedding) +LOGICAL :: LNULLWETH !< Same as LNULLWETG but for hail +LOGICAL :: LWETHPOST !< Same as LWETGPOST but for hail +CHARACTER(LEN=4) :: CSNOWRIMING !< OLD or M90 for Murakami 1990 formulation +REAL :: XFRACM90 !< Fraction used for the Murakami 1990 formulation +INTEGER :: NMAXITER_MICRO !< Maximum number of iterations for mixing ratio or time splitting +REAL :: XMRSTEP !< maximum mixing ratio step for mixing ratio splitting +LOGICAL :: LCONVHG !< TRUE to allow the conversion from hail to graupel +LOGICAL :: LCRFLIMIT !< True to limit rain contact freezing to possible heat exchange +! +REAL :: XTSTEP_TS !< Approximative time step for time-splitting (0 for no time-splitting) +! +CHARACTER(LEN=80) :: CSUBG_RC_RR_ACCR !< subgrid rc-rr accretion +CHARACTER(LEN=80) :: CSUBG_RR_EVAP !< subgrid rr evaporation +CHARACTER(LEN=80) :: CSUBG_PR_PDF !< pdf for subgrid precipitation +CHARACTER(LEN=4) :: CSUBG_AUCV_RC !< type of subgrid rc->rr autoconv. method +CHARACTER(LEN=80) :: CSUBG_AUCV_RI !< type of subgrid ri->rs autoconv. method +CHARACTER(LEN=80) :: CSUBG_MF_PDF !< PDF to use for MF cloud autoconversions +! +LOGICAL :: LADJ_BEFORE !< must we perform an adjustment before rain_ice call +LOGICAL :: LADJ_AFTER !< must we perform an adjustment after rain_ice call +LOGICAL :: LSEDIM_AFTER !< sedimentation done before (.FALSE.) or after (.TRUE.) microphysics +! +REAL :: XSPLIT_MAXCFL !< Maximum CFL number allowed for SPLIT scheme +LOGICAL :: LSNOW_T !< Snow parameterization from Wurtz (2021) +! +LOGICAL :: LPACK_INTERP !< To pack arrays before computing the different interpolations (kernels and other) +LOGICAL :: LPACK_MICRO !< To pack arrays before computing the process tendencies +! +INTEGER :: NPROMICRO !< Size of cache-blocking bloc (0 to deactivate) +! +LOGICAL :: LCRIAUTI !< .T. to compute XACRIAUTI and XBCRIAUTI (from XCRIAUTI and XT0CRIAUTI); + !! .F. to compute XT0CRIAUTI (from XCRIAUTI and XBCRIAUTI) +REAL :: XCRIAUTI_NAM !< Minimum value for the ice->snow autoconversion threshold +REAL :: XT0CRIAUTI_NAM !< Threshold temperature (???) for the ice->snow autoconversion threshold +REAL :: XBCRIAUTI_NAM !< B barameter for the ice->snow autoconversion 10**(aT+b) law +REAL :: XACRIAUTI_NAM !< A barameter for the ice->snow autoconversion 10**(aT+b) law +REAL :: XCRIAUTC_NAM !< Threshold for liquid cloud -> rain autoconversion (kg/m**3) +REAL :: XRDEPSRED_NAM !< Tuning factor of sublimation of snow +REAL :: XRDEPGRED_NAM !< Tuning factor of sublimation of graupel +! +LOGICAL :: LOCND2 !< Logical switch to separate liquid and ice +REAL, DIMENSION(40) :: XFRMIN_NAM +! +END TYPE PARAM_ICE_t +! +TYPE(PARAM_ICE_t), DIMENSION(JPMODELMAX), TARGET, SAVE :: PARAM_ICE_MODEL +TYPE(PARAM_ICE_t), POINTER, SAVE :: PARAM_ICEN => NULL() +! +LOGICAL, POINTER :: LWARM => NULL(), & + LSEDIC => NULL(), & + LDEPOSC => NULL(), & + LRED => NULL(), & + LFEEDBACKT => NULL(), & + LEVLIMIT => NULL(), & + LNULLWETG => NULL(), & + LWETGPOST => NULL(), & + LNULLWETH => NULL(), & + LWETHPOST => NULL(), & + LCONVHG => NULL(), & + LCRFLIMIT => NULL(), & + LADJ_BEFORE => NULL(), & + LADJ_AFTER => NULL(), & + LSEDIM_AFTER => NULL(), & + LSNOW_T => NULL(), & + LPACK_INTERP => NULL(), & + LPACK_MICRO => NULL(), & + LCRIAUTI => NULL(), & + LOCND2 => NULL() + +REAL, POINTER :: XVDEPOSC => NULL(), & + XFRACM90 => NULL(), & + XMRSTEP => NULL(), & + XTSTEP_TS => NULL(), & + XSPLIT_MAXCFL => NULL(), & + XCRIAUTI_NAM => NULL(), & + XT0CRIAUTI_NAM => NULL(), & + XBCRIAUTI_NAM => NULL(), & + XACRIAUTI_NAM => NULL(), & + XCRIAUTC_NAM => NULL(), & + XRDEPSRED_NAM => NULL(), & + XRDEPGRED_NAM => NULL() +REAL, DIMENSION(:), POINTER :: XFRMIN_NAM => NULL() + +INTEGER, POINTER :: NMAXITER_MICRO => NULL(), & + NPROMICRO => NULL() + +CHARACTER(LEN=4), POINTER :: CPRISTINE_ICE => NULL() +CHARACTER(LEN=4), POINTER :: CSEDIM => NULL() +CHARACTER(LEN=4), POINTER :: CSNOWRIMING => NULL() +CHARACTER(LEN=80),POINTER :: CSUBG_RC_RR_ACCR => NULL() +CHARACTER(LEN=80),POINTER :: CSUBG_RR_EVAP => NULL() +CHARACTER(LEN=80),POINTER :: CSUBG_PR_PDF => NULL() +CHARACTER(LEN=4),POINTER :: CSUBG_AUCV_RC=>NULL() +CHARACTER(LEN=80),POINTER :: CSUBG_AUCV_RI=>NULL() +CHARACTER(LEN=80),POINTER :: CSUBG_MF_PDF=>NULL() +! +NAMELIST/NAM_PARAM_ICEn/LWARM,LSEDIC,LCONVHG,CPRISTINE_ICE,CSEDIM,LDEPOSC,XVDEPOSC, & + LRED, LFEEDBACKT, & + LEVLIMIT,LNULLWETG,LWETGPOST,LNULLWETH,LWETHPOST, & + CSNOWRIMING,XFRACM90,NMAXITER_MICRO,XMRSTEP,XTSTEP_TS, & + LADJ_BEFORE, LADJ_AFTER, LCRFLIMIT, & + XSPLIT_MAXCFL, LSEDIM_AFTER, LSNOW_T, & + LPACK_INTERP, LPACK_MICRO, NPROMICRO, CSUBG_RC_RR_ACCR, & + CSUBG_RR_EVAP, CSUBG_PR_PDF, CSUBG_AUCV_RC, CSUBG_AUCV_RI, & + LCRIAUTI, XCRIAUTI_NAM, XT0CRIAUTI_NAM, XBCRIAUTI_NAM, & + XACRIAUTI_NAM, XCRIAUTC_NAM, XRDEPSRED_NAM, XRDEPGRED_NAM, & + LOCND2, XFRMIN_NAM, CSUBG_MF_PDF +! +!------------------------------------------------------------------------------- +! +CONTAINS +SUBROUTINE PARAM_ICE_GOTO_MODEL(KFROM, KTO) +!! This subroutine associate all the pointers to the right component of +!! the right strucuture. A value can be accessed through the structure PARAM_ICEN +!! or through the strucuture PARAM_ICE_MODEL(KTO) or directly through these pointers. +IMPLICIT NONE +INTEGER, INTENT(IN) :: KFROM, KTO +! +IF(.NOT. ASSOCIATED(PARAM_ICEN, PARAM_ICE_MODEL(KTO))) THEN + ! + PARAM_ICEN => PARAM_ICE_MODEL(KTO) + ! + LWARM => PARAM_ICEN%LWARM + LSEDIC => PARAM_ICEN%LSEDIC + LDEPOSC => PARAM_ICEN%LDEPOSC + LRED => PARAM_ICEN%LRED + LFEEDBACKT => PARAM_ICEN%LFEEDBACKT + LEVLIMIT => PARAM_ICEN%LEVLIMIT + LNULLWETG => PARAM_ICEN%LNULLWETG + LWETGPOST => PARAM_ICEN%LWETGPOST + LNULLWETH => PARAM_ICEN%LNULLWETH + LWETHPOST => PARAM_ICEN%LWETHPOST + LCONVHG => PARAM_ICEN%LCONVHG + LCRFLIMIT => PARAM_ICEN%LCRFLIMIT + LADJ_BEFORE => PARAM_ICEN%LADJ_BEFORE + LADJ_AFTER => PARAM_ICEN%LADJ_AFTER + LSEDIM_AFTER => PARAM_ICEN%LSEDIM_AFTER + LSNOW_T => PARAM_ICEN%LSNOW_T + LPACK_INTERP => PARAM_ICEN%LPACK_INTERP + LPACK_MICRO => PARAM_ICEN%LPACK_MICRO + LCRIAUTI => PARAM_ICEN%LCRIAUTI + LOCND2 => PARAM_ICEN%LOCND2 + ! + XVDEPOSC => PARAM_ICEN%XVDEPOSC + XFRACM90 => PARAM_ICEN%XFRACM90 + XMRSTEP => PARAM_ICEN%XMRSTEP + XTSTEP_TS => PARAM_ICEN%XTSTEP_TS + XSPLIT_MAXCFL => PARAM_ICEN%XSPLIT_MAXCFL + XCRIAUTI_NAM => PARAM_ICEN%XCRIAUTI_NAM + XT0CRIAUTI_NAM => PARAM_ICEN%XT0CRIAUTI_NAM + XBCRIAUTI_NAM => PARAM_ICEN%XBCRIAUTI_NAM + XACRIAUTI_NAM => PARAM_ICEN%XACRIAUTI_NAM + XCRIAUTC_NAM => PARAM_ICEN%XCRIAUTC_NAM + XRDEPSRED_NAM => PARAM_ICEN%XRDEPSRED_NAM + XRDEPGRED_NAM => PARAM_ICEN%XRDEPGRED_NAM + XFRMIN_NAM => PARAM_ICEN%XFRMIN_NAM + ! + NMAXITER_MICRO => PARAM_ICEN%NMAXITER_MICRO + NPROMICRO => PARAM_ICEN%NPROMICRO + ! + CPRISTINE_ICE => PARAM_ICEN%CPRISTINE_ICE + CSEDIM => PARAM_ICEN%CSEDIM + CSNOWRIMING => PARAM_ICEN%CSNOWRIMING + CSUBG_RC_RR_ACCR => PARAM_ICEN%CSUBG_RC_RR_ACCR + CSUBG_RR_EVAP => PARAM_ICEN%CSUBG_RR_EVAP + CSUBG_PR_PDF => PARAM_ICEN%CSUBG_PR_PDF + CSUBG_AUCV_RC=>PARAM_ICEN%CSUBG_AUCV_RC + CSUBG_AUCV_RI=>PARAM_ICEN%CSUBG_AUCV_RI + CSUBG_MF_PDF=>PARAM_ICEN%CSUBG_MF_PDF +ENDIF +END SUBROUTINE PARAM_ICE_GOTO_MODEL +! +SUBROUTINE PARAM_ICEN_INIT(HPROGRAM, KUNITNML, LDNEEDNAM, KLUOUT, & + &LDDEFAULTVAL, LDREADNAM, LDCHECK, KPRINT) +!!*** *PARAM_ICEN_INIT* - Code needed to initialize the MODD_PARAM_ICE_n module +!! +!!* PURPOSE +!! ------- +!! Sets the default values, reads the namelist, performs the checks and prints +!! +!!* METHOD +!! ------ +!! 0. Declarations +!! 1. Declaration of arguments +!! 2. Declaration of local variables +!! 1. Default values +!! 2. Namelist +!! 3. Checks +!! 4. Prints +!! +!! AUTHOR +!! ------ +!! S. Riette +!! +!! MODIFICATIONS +!! ------------- +!! Original Feb 2023 +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! --------------- +! +USE MODE_POSNAM_PHY, ONLY: POSNAM_PHY +USE MODE_MSG, ONLY: PRINT_MSG, NVERB_FATAL +USE MODE_CHECK_NAM_VAL, ONLY: CHECK_NAM_VAL_CHAR, CHECK_NAM_VAL_REAL, CHECK_NAM_VAL_INT +! +IMPLICIT NONE +! +!* 0.1. Declaration of arguments +! ------------------------ +! +CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM !< Name of the calling program +INTEGER, INTENT(IN) :: KUNITNML !< Logical unit to access the namelist +LOGICAL, INTENT(IN) :: LDNEEDNAM !< True to abort if namelist is absent +INTEGER, INTENT(IN) :: KLUOUT !< Logical unit for outputs +LOGICAL, OPTIONAL, INTENT(IN) :: LDDEFAULTVAL !< Must we initialize variables with default values (defaults to .TRUE.) +LOGICAL, OPTIONAL, INTENT(IN) :: LDREADNAM !< Must we read the namelist (defaults to .TRUE.) +LOGICAL, OPTIONAL, INTENT(IN) :: LDCHECK !< Must we perform some checks on values (defaults to .TRUE.) +INTEGER, OPTIONAL, INTENT(IN) :: KPRINT !< Print level (defaults to 0): 0 for no print, 1 to safely print namelist, + !! 2 to print informative messages +! +!* 0.2 Declaration of local variables +! ------------------------------ +! +LOGICAL :: LLDEFAULTVAL, LLREADNAM, LLCHECK, LLFOUND +INTEGER :: IPRINT + +LLDEFAULTVAL=.TRUE. +LLREADNAM=.TRUE. +LLCHECK=.TRUE. +IPRINT=0 +IF(PRESENT(LDDEFAULTVAL)) LLDEFAULTVAL=LDDEFAULTVAL +IF(PRESENT(LDREADNAM )) LLREADNAM =LDREADNAM +IF(PRESENT(LDCHECK )) LLCHECK =LDCHECK +IF(PRESENT(KPRINT )) IPRINT =KPRINT +! +!* 1. DEFAULT VALUES +! ----------------- +! +IF(LLDEFAULTVAL) THEN + LWARM=.TRUE. + LSEDIC=.TRUE. + LDEPOSC=.FALSE. + XVDEPOSC= 0.02 ! 2 cm/s + CPRISTINE_ICE='PLAT' + CSEDIM='SPLI' + LRED=.TRUE. + LFEEDBACKT=.TRUE. + LEVLIMIT=.TRUE. + LNULLWETG=.TRUE. + LWETGPOST=.TRUE. + LNULLWETH=.TRUE. + LWETHPOST=.TRUE. + CSNOWRIMING='M90' + XFRACM90=0.1 + NMAXITER_MICRO=5 + XMRSTEP=0.00005 + LCONVHG=.FALSE. + LCRFLIMIT=.TRUE. + XTSTEP_TS=0. + CSUBG_RC_RR_ACCR='NONE' + CSUBG_RR_EVAP='NONE' + CSUBG_PR_PDF='SIGM' + CSUBG_AUCV_RC='NONE' + CSUBG_AUCV_RI='NONE' + CSUBG_MF_PDF='TRIANGLE' + LADJ_BEFORE=.TRUE. + LADJ_AFTER=.TRUE. + LSEDIM_AFTER=.FALSE. + XSPLIT_MAXCFL=0.8 + LSNOW_T=.FALSE. + LPACK_INTERP=.TRUE. + LPACK_MICRO=.TRUE. + NPROMICRO=0 + LCRIAUTI=.FALSE. + !!XCRIAUTIi_NAM = 0.25E-3 ! Critical ice content for the autoconversion to occur + XCRIAUTI_NAM = 0.2E-4 ! Revised value by Chaboureau et al. (2001) + XACRIAUTI_NAM=0.06 + XBCRIAUTI_NAM=-3.5 + XT0CRIAUTI_NAM=(LOG10(XCRIAUTI_NAM)-XBCRIAUTI_NAM)/0.06 + XCRIAUTC_NAM=0.5E-3 + XRDEPSRED_NAM=1. + XRDEPGRED_NAM=1. + LOCND2=.FALSE. + ! Tuning and modication of graupeln etc: + XFRMIN_NAM(1:6)=0. + XFRMIN_NAM(7:9)=1. + XFRMIN_NAM(10) =10. + XFRMIN_NAM(11) =1. + XFRMIN_NAM(12) =0. + XFRMIN_NAM(13) =1.0E-15 + XFRMIN_NAM(14) =120. + XFRMIN_NAM(15) =1.0E-4 + XFRMIN_NAM(16:20)=0. + XFRMIN_NAM(21:22)=1. + XFRMIN_NAM(23)=0.5 + XFRMIN_NAM(24)=1.5 + XFRMIN_NAM(25)=30. + XFRMIN_NAM(26:38)=0. + XFRMIN_NAM(39)=0.25 + XFRMIN_NAM(40)=0.15 + + IF(HPROGRAM=='AROME') THEN + LCONVHG=.TRUE. + LADJ_BEFORE=.TRUE. + LADJ_AFTER=.FALSE. + LRED=.FALSE. + CSEDIM='STAT' + LSEDIC=.FALSE. + XMRSTEP=0. + CSUBG_AUCV_RC='PDF' + ENDIF +ENDIF +! +!* 2. NAMELIST +! ----------- +! +IF(LLREADNAM) THEN + CALL POSNAM_PHY(KUNITNML, 'NAM_PARAM_ICEN', LDNEEDNAM, LLFOUND, KLUOUT) + IF(LLFOUND) READ(UNIT=KUNITNML, NML=NAM_PARAM_ICEn) +ENDIF +! +!* 3. CHECKS +! --------- +! +IF(LLCHECK) THEN + CALL CHECK_NAM_VAL_CHAR(KLUOUT, 'CPRISTINE_ICE', CPRISTINE_ICE, 'PLAT', 'COLU', 'BURO') + CALL CHECK_NAM_VAL_CHAR(KLUOUT, 'CSEDIM', CSEDIM, 'SPLI', 'STAT', 'NONE') + CALL CHECK_NAM_VAL_CHAR(KLUOUT, 'CSUBG_RC_RR_ACCR', CSUBG_RC_RR_ACCR, 'NONE', 'PRFR') + CALL CHECK_NAM_VAL_CHAR(KLUOUT, 'CSUBG_RR_EVAP', CSUBG_RR_EVAP, 'NONE', 'CLFR', 'PRFR') + CALL CHECK_NAM_VAL_CHAR(KLUOUT, 'CSUBG_PR_PDF', CSUBG_PR_PDF, 'SIGM', 'HLCRECTPD', 'HLCTRIANGPDF', & + 'HLCQUADRAPDF', 'HLCISOTRIPDF') + CALL CHECK_NAM_VAL_CHAR(KLUOUT, 'CSUBG_AUCV_RC', CSUBG_AUCV_RC, 'PDF ', 'CLFR', 'NONE', 'ADJU', 'SIGM') + CALL CHECK_NAM_VAL_CHAR(KLUOUT, 'CSUBG_AUCV_RI', CSUBG_AUCV_RI, 'NONE', 'CLFR', 'ADJU') + CALL CHECK_NAM_VAL_CHAR(KLUOUT, 'CSUBG_MF_PDF', CSUBG_MF_PDF, 'NONE', 'TRIANGLE') + CALL CHECK_NAM_VAL_CHAR(KLUOUT, 'CSNOWRIMING', CSNOWRIMING, 'OLD ', 'M90 ') + CALL CHECK_NAM_VAL_REAL(KLUOUT, 'XTSTEP_TS', XTSTEP_TS, '>=', 0.) + CALL CHECK_NAM_VAL_REAL(KLUOUT, 'XSPLIT_MAXCFL', XSPLIT_MAXCFL, '>', 0., '<=', 1.) + CALL CHECK_NAM_VAL_REAL(KLUOUT, 'XVDEPOSC', XVDEPOSC, '>=', 0.) + CALL CHECK_NAM_VAL_REAL(KLUOUT, 'XFRACM90', XFRACM90, '>=', 0., '<=', 1.) + CALL CHECK_NAM_VAL_REAL(KLUOUT, 'XMRSTEP', XMRSTEP, '>=', 0.) + CALL CHECK_NAM_VAL_INT(KLUOUT, 'NPROMICRO', NPROMICRO, '>=', 0) + + IF (LOCND2 .AND. (XRDEPSRED_NAM /= 1 .OR. XRDEPGRED_NAM /= 1)) THEN + CALL ABOR1 ("XRDESRED_NAM and XRDEGRED_NAM must not be activated together with LOCND2") + ENDIF + + IF(HPROGRAM=='AROME') THEN + IF(.NOT. (LADJ_BEFORE .AND. .NOT. LADJ_AFTER)) THEN + CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'MODD_PARAM_ICE_n', 'With AROME, LADJ_BEFORE must be .T. and LADJ_AFTER must be .F.') + ENDIF + ELSEIF(HPROGRAM=='MESONH') THEN + IF(.NOT. LPACK_MICRO) THEN + CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'MODD_PARAM_ICE_n', 'With MESONH, LPACK_MICRO must be .T.') + ENDIF + ENDIF +ENDIF +! +!* 3. PRINTS +! --------- +! +IF(IPRINT>=1) THEN + WRITE(UNIT=KLUOUT,NML=NAM_PARAM_ICEn) +ENDIF +! +END SUBROUTINE PARAM_ICEN_INIT +! +END MODULE MODD_PARAM_ICE_n diff --git a/src/common/micro/modd_rain_ice_descr.F90 b/src/common/micro/modd_rain_ice_descrn.F90 similarity index 64% rename from src/common/micro/modd_rain_ice_descr.F90 rename to src/common/micro/modd_rain_ice_descrn.F90 index a7b8113de349c3a565fde4d35868393d618d8890..c34d41fa90ebd451f8c3536550803086a4893445 100644 --- a/src/common/micro/modd_rain_ice_descr.F90 +++ b/src/common/micro/modd_rain_ice_descrn.F90 @@ -3,11 +3,11 @@ !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt !MNH_LIC for details. version 1. ! ########################## - MODULE MODD_RAIN_ICE_DESCR + MODULE MODD_RAIN_ICE_DESCR_n ! ########################## -! -!!**** *MODD_RAIN_ICE_DESCR* - declaration of the microphysical descriptive -!! constants for use in the warm and cold schemes. +!> @file +!!**** *MODD_RAIN_ICE_DESCR_n* - declaration of the microphysical descriptive +!! constants for use in the warm and cold schemes. !! !! PURPOSE !! ------- @@ -52,6 +52,7 @@ !* 0. DECLARATIONS ! ------------ ! +USE MODD_PARAMETERS, ONLY: JPMODELMAX IMPLICIT NONE TYPE RAIN_ICE_DESCR_t REAL :: XCEXVT ! air density fall speed correction @@ -82,7 +83,8 @@ REAL :: XCONC_LAND ! Diagnostic concentration of droplets over land REAL :: XCONC_URBAN ! Diagnostic concentration of droplets over urban area END TYPE RAIN_ICE_DESCR_t ! -TYPE(RAIN_ICE_DESCR_t), SAVE, TARGET :: RAIN_ICE_DESCR +TYPE(RAIN_ICE_DESCR_t), DIMENSION(JPMODELMAX), TARGET, SAVE :: RAIN_ICE_DESCR_MODEL +TYPE(RAIN_ICE_DESCR_t), POINTER, SAVE :: RAIN_ICE_DESCRN => NULL() ! REAL,DIMENSION(:),POINTER :: XLBC=>NULL(), XRTMIN=>NULL() REAL, POINTER :: XCEXVT => NULL(), & @@ -169,104 +171,114 @@ REAL, POINTER :: XCEXVT => NULL(), & XLBDAS_MIN => NULL() ! CONTAINS -SUBROUTINE RAIN_ICE_DESCR_ASSOCIATE() - IMPLICIT NONE - XCEXVT => RAIN_ICE_DESCR%XCEXVT - XAC => RAIN_ICE_DESCR%XAC - XBC => RAIN_ICE_DESCR%XBC - XCC => RAIN_ICE_DESCR%XCC - XDC => RAIN_ICE_DESCR%XDC - XAR => RAIN_ICE_DESCR%XAR - XBR => RAIN_ICE_DESCR%XBR - XCR => RAIN_ICE_DESCR%XCR - XDR => RAIN_ICE_DESCR%XDR - XCCR => RAIN_ICE_DESCR%XCCR - XF0R => RAIN_ICE_DESCR%XF0R - XF1R => RAIN_ICE_DESCR%XF1R - XC1R => RAIN_ICE_DESCR%XC1R - XAI => RAIN_ICE_DESCR%XAI - XBI => RAIN_ICE_DESCR%XBI - XC_I => RAIN_ICE_DESCR%XC_I - XDI => RAIN_ICE_DESCR%XDI - XF0I => RAIN_ICE_DESCR%XF0I - XF2I => RAIN_ICE_DESCR%XF2I - XC1I => RAIN_ICE_DESCR%XC1I - XAS => RAIN_ICE_DESCR%XAS - XBS => RAIN_ICE_DESCR%XBS - XCS => RAIN_ICE_DESCR%XCS - XDS => RAIN_ICE_DESCR%XDS - XCCS => RAIN_ICE_DESCR%XCCS - XCXS => RAIN_ICE_DESCR%XCXS - XF0S => RAIN_ICE_DESCR%XF0S - XF1S => RAIN_ICE_DESCR%XF1S - XC1S => RAIN_ICE_DESCR%XC1S - XAG => RAIN_ICE_DESCR%XAG - XBG => RAIN_ICE_DESCR%XBG - XCG => RAIN_ICE_DESCR%XCG - XDG => RAIN_ICE_DESCR%XDG - XCCG => RAIN_ICE_DESCR%XCCG - XCXG => RAIN_ICE_DESCR%XCXG - XF0G => RAIN_ICE_DESCR%XF0G - XF1G => RAIN_ICE_DESCR%XF1G - XC1G => RAIN_ICE_DESCR%XC1G - XAH => RAIN_ICE_DESCR%XAH - XBH => RAIN_ICE_DESCR%XBH - XCH => RAIN_ICE_DESCR%XCH - XDH => RAIN_ICE_DESCR%XDH - XCCH => RAIN_ICE_DESCR%XCCH - XCXH => RAIN_ICE_DESCR%XCXH - XF0H => RAIN_ICE_DESCR%XF0H - XF1H => RAIN_ICE_DESCR%XF1H - XC1H => RAIN_ICE_DESCR%XC1H - XALPHAC => RAIN_ICE_DESCR%XALPHAC - XNUC => RAIN_ICE_DESCR%XNUC - XALPHAC2 => RAIN_ICE_DESCR%XALPHAC2 - XNUC2 => RAIN_ICE_DESCR%XNUC2 - XLBEXC => RAIN_ICE_DESCR%XLBEXC - XALPHAR => RAIN_ICE_DESCR%XALPHAR - XNUR => RAIN_ICE_DESCR%XNUR - XLBEXR => RAIN_ICE_DESCR%XLBEXR - XLBR => RAIN_ICE_DESCR%XLBR - XALPHAI => RAIN_ICE_DESCR%XALPHAI - XNUI => RAIN_ICE_DESCR%XNUI - XLBEXI => RAIN_ICE_DESCR%XLBEXI - XLBI => RAIN_ICE_DESCR%XLBI - XALPHAS => RAIN_ICE_DESCR%XALPHAS - XNUS => RAIN_ICE_DESCR%XNUS - XLBEXS => RAIN_ICE_DESCR%XLBEXS - XLBS => RAIN_ICE_DESCR%XLBS - XALPHAG => RAIN_ICE_DESCR%XALPHAG - XNUG => RAIN_ICE_DESCR%XNUG - XLBEXG => RAIN_ICE_DESCR%XLBEXG - XLBG => RAIN_ICE_DESCR%XLBG - XALPHAH => RAIN_ICE_DESCR%XALPHAH - XNUH => RAIN_ICE_DESCR%XNUH - XLBEXH => RAIN_ICE_DESCR%XLBEXH - XLBH => RAIN_ICE_DESCR%XLBH - XLBDAR_MAX => RAIN_ICE_DESCR%XLBDAR_MAX - XLBDAS_MAX => RAIN_ICE_DESCR%XLBDAS_MAX - XLBDAG_MAX => RAIN_ICE_DESCR%XLBDAG_MAX - XCONC_SEA => RAIN_ICE_DESCR%XCONC_SEA - XCONC_LAND => RAIN_ICE_DESCR%XCONC_LAND - XCONC_URBAN => RAIN_ICE_DESCR%XCONC_URBAN - XNS => RAIN_ICE_DESCR%XNS - XFVELOS => RAIN_ICE_DESCR%XFVELOS - XTRANS_MP_GAMMAS => RAIN_ICE_DESCR%XTRANS_MP_GAMMAS - XLBDAS_MIN => RAIN_ICE_DESCR%XLBDAS_MIN -END SUBROUTINE +SUBROUTINE RAIN_ICE_DESCR_GOTO_MODEL(KFROM, KTO) +!! This subroutine associate all the pointers to the right component of +!! the right strucuture. A value can be accessed through the structure RAIN_ICE_DESCRN +!! or through the strucuture RAIN_ICE_DESCR_MODEL(KTO) or directly through these pointers. +IMPLICIT NONE +INTEGER, INTENT(IN) :: KFROM, KTO +! +IF(.NOT. ASSOCIATED(RAIN_ICE_DESCRN, RAIN_ICE_DESCR_MODEL(KTO))) THEN + ! + RAIN_ICE_DESCRN => RAIN_ICE_DESCR_MODEL(KTO) + ! + XCEXVT => RAIN_ICE_DESCRN%XCEXVT + XAC => RAIN_ICE_DESCRN%XAC + XBC => RAIN_ICE_DESCRN%XBC + XCC => RAIN_ICE_DESCRN%XCC + XDC => RAIN_ICE_DESCRN%XDC + XAR => RAIN_ICE_DESCRN%XAR + XBR => RAIN_ICE_DESCRN%XBR + XCR => RAIN_ICE_DESCRN%XCR + XDR => RAIN_ICE_DESCRN%XDR + XCCR => RAIN_ICE_DESCRN%XCCR + XF0R => RAIN_ICE_DESCRN%XF0R + XF1R => RAIN_ICE_DESCRN%XF1R + XC1R => RAIN_ICE_DESCRN%XC1R + XAI => RAIN_ICE_DESCRN%XAI + XBI => RAIN_ICE_DESCRN%XBI + XC_I => RAIN_ICE_DESCRN%XC_I + XDI => RAIN_ICE_DESCRN%XDI + XF0I => RAIN_ICE_DESCRN%XF0I + XF2I => RAIN_ICE_DESCRN%XF2I + XC1I => RAIN_ICE_DESCRN%XC1I + XAS => RAIN_ICE_DESCRN%XAS + XBS => RAIN_ICE_DESCRN%XBS + XCS => RAIN_ICE_DESCRN%XCS + XDS => RAIN_ICE_DESCRN%XDS + XCCS => RAIN_ICE_DESCRN%XCCS + XCXS => RAIN_ICE_DESCRN%XCXS + XF0S => RAIN_ICE_DESCRN%XF0S + XF1S => RAIN_ICE_DESCRN%XF1S + XC1S => RAIN_ICE_DESCRN%XC1S + XAG => RAIN_ICE_DESCRN%XAG + XBG => RAIN_ICE_DESCRN%XBG + XCG => RAIN_ICE_DESCRN%XCG + XDG => RAIN_ICE_DESCRN%XDG + XCCG => RAIN_ICE_DESCRN%XCCG + XCXG => RAIN_ICE_DESCRN%XCXG + XF0G => RAIN_ICE_DESCRN%XF0G + XF1G => RAIN_ICE_DESCRN%XF1G + XC1G => RAIN_ICE_DESCRN%XC1G + XAH => RAIN_ICE_DESCRN%XAH + XBH => RAIN_ICE_DESCRN%XBH + XCH => RAIN_ICE_DESCRN%XCH + XDH => RAIN_ICE_DESCRN%XDH + XCCH => RAIN_ICE_DESCRN%XCCH + XCXH => RAIN_ICE_DESCRN%XCXH + XF0H => RAIN_ICE_DESCRN%XF0H + XF1H => RAIN_ICE_DESCRN%XF1H + XC1H => RAIN_ICE_DESCRN%XC1H + XALPHAC => RAIN_ICE_DESCRN%XALPHAC + XNUC => RAIN_ICE_DESCRN%XNUC + XALPHAC2 => RAIN_ICE_DESCRN%XALPHAC2 + XNUC2 => RAIN_ICE_DESCRN%XNUC2 + XLBEXC => RAIN_ICE_DESCRN%XLBEXC + XALPHAR => RAIN_ICE_DESCRN%XALPHAR + XNUR => RAIN_ICE_DESCRN%XNUR + XLBEXR => RAIN_ICE_DESCRN%XLBEXR + XLBR => RAIN_ICE_DESCRN%XLBR + XALPHAI => RAIN_ICE_DESCRN%XALPHAI + XNUI => RAIN_ICE_DESCRN%XNUI + XLBEXI => RAIN_ICE_DESCRN%XLBEXI + XLBI => RAIN_ICE_DESCRN%XLBI + XALPHAS => RAIN_ICE_DESCRN%XALPHAS + XNUS => RAIN_ICE_DESCRN%XNUS + XLBEXS => RAIN_ICE_DESCRN%XLBEXS + XLBS => RAIN_ICE_DESCRN%XLBS + XALPHAG => RAIN_ICE_DESCRN%XALPHAG + XNUG => RAIN_ICE_DESCRN%XNUG + XLBEXG => RAIN_ICE_DESCRN%XLBEXG + XLBG => RAIN_ICE_DESCRN%XLBG + XALPHAH => RAIN_ICE_DESCRN%XALPHAH + XNUH => RAIN_ICE_DESCRN%XNUH + XLBEXH => RAIN_ICE_DESCRN%XLBEXH + XLBH => RAIN_ICE_DESCRN%XLBH + XLBDAR_MAX => RAIN_ICE_DESCRN%XLBDAR_MAX + XLBDAS_MAX => RAIN_ICE_DESCRN%XLBDAS_MAX + XLBDAG_MAX => RAIN_ICE_DESCRN%XLBDAG_MAX + XCONC_SEA => RAIN_ICE_DESCRN%XCONC_SEA + XCONC_LAND => RAIN_ICE_DESCRN%XCONC_LAND + XCONC_URBAN => RAIN_ICE_DESCRN%XCONC_URBAN + XNS => RAIN_ICE_DESCRN%XNS + XFVELOS => RAIN_ICE_DESCRN%XFVELOS + XTRANS_MP_GAMMAS => RAIN_ICE_DESCRN%XTRANS_MP_GAMMAS + XLBDAS_MIN => RAIN_ICE_DESCRN%XLBDAS_MIN +ENDIF +END SUBROUTINE RAIN_ICE_DESCR_GOTO_MODEL ! SUBROUTINE RAIN_ICE_DESCR_ALLOCATE(KRR) IMPLICIT NONE INTEGER, INTENT(IN) :: KRR - ALLOCATE(RAIN_ICE_DESCR%XRTMIN(KRR)) - XRTMIN=>RAIN_ICE_DESCR%XRTMIN - XLBC=>RAIN_ICE_DESCR%XLBC + ALLOCATE(RAIN_ICE_DESCRN%XRTMIN(KRR)) + XRTMIN=>RAIN_ICE_DESCRN%XRTMIN + XLBC=>RAIN_ICE_DESCRN%XLBC END SUBROUTINE RAIN_ICE_DESCR_ALLOCATE ! SUBROUTINE RAIN_ICE_DESCR_DEALLOCATE() IMPLICIT NONE XRTMIN=>NULL() - DEALLOCATE(RAIN_ICE_DESCR%XRTMIN) + DEALLOCATE(RAIN_ICE_DESCRN%XRTMIN) END SUBROUTINE RAIN_ICE_DESCR_DEALLOCATE ! -END MODULE MODD_RAIN_ICE_DESCR +END MODULE MODD_RAIN_ICE_DESCR_n diff --git a/src/common/micro/modd_rain_ice_param.F90 b/src/common/micro/modd_rain_ice_paramn.F90 similarity index 64% rename from src/common/micro/modd_rain_ice_param.F90 rename to src/common/micro/modd_rain_ice_paramn.F90 index 40acb8f56888d5193c2fc09e7acc36993814beb2..c3919cf7d4b44a015bcc86ed55fb38b6d849ce62 100644 --- a/src/common/micro/modd_rain_ice_param.F90 +++ b/src/common/micro/modd_rain_ice_paramn.F90 @@ -3,11 +3,11 @@ !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt !MNH_LIC for details. version 1. ! ######spl - MODULE MODD_RAIN_ICE_PARAM + MODULE MODD_RAIN_ICE_PARAM_n ! ########################## -! -!!**** *MODD_RAIN_ICE_PARAM* - declaration of some microphysical factors -!! extensively used in the warm and cold schemes. +!> @file +!!**** *MODD_RAIN_ICE_PARAM_n* - declaration of some microphysical factors +!! extensively used in the warm and cold schemes. !! !! PURPOSE !! ------- @@ -38,6 +38,7 @@ !* 0. DECLARATIONS ! ------------ ! +USE MODD_PARAMETERS, ONLY: JPMODELMAX IMPLICIT NONE ! TYPE RAIN_ICE_PARAM_t @@ -187,7 +188,8 @@ REAL,DIMENSION(:,:), ALLOCATABLE & REAL, DIMENSION(40) :: XFRMIN ! Parmeters to modify melt and growth of graupels etc. END TYPE RAIN_ICE_PARAM_t ! -TYPE(RAIN_ICE_PARAM_t), SAVE, TARGET :: RAIN_ICE_PARAM +TYPE(RAIN_ICE_PARAM_t), DIMENSION(JPMODELMAX), TARGET, SAVE :: RAIN_ICE_PARAM_MODEL +TYPE(RAIN_ICE_PARAM_t), POINTER, SAVE :: RAIN_ICE_PARAMN => NULL() ! REAL,DIMENSION(:),POINTER :: XFSEDC => NULL() REAL,DIMENSION(:),POINTER :: XFRMIN => NULL() @@ -373,179 +375,224 @@ REAL,DIMENSION(:,:), POINTER :: XKER_RACCSS => NULL(), & XKER_GWETH => NULL(), & XKER_RWETH => NULL() CONTAINS -SUBROUTINE RAIN_ICE_PARAM_ASSOCIATE() - IMPLICIT NONE - XFSEDC => RAIN_ICE_PARAM%XFSEDC - XFRMIN => RAIN_ICE_PARAM%XFRMIN +SUBROUTINE RAIN_ICE_PARAM_GOTO_MODEL(KFROM, KTO) +!! This subroutine associate all the pointers to the right component of +!! the right strucuture. A value can be accessed through the structure RAIN_ICE_PARAMN +!! or through the strucuture RAIN_ICE_PARAM_MODEL(KTO) or directly through these pointers. +IMPLICIT NONE +INTEGER, INTENT(IN) :: KFROM, KTO +! +IF(.NOT. ASSOCIATED(RAIN_ICE_PARAMN, RAIN_ICE_PARAM_MODEL(KTO))) THEN + ! + RAIN_ICE_PARAMN => RAIN_ICE_PARAM_MODEL(KTO) + ! + XFSEDC => RAIN_ICE_PARAMN%XFSEDC + XFRMIN => RAIN_ICE_PARAMN%XFRMIN + ! + XFSEDR => RAIN_ICE_PARAMN%XFSEDR + XEXSEDR => RAIN_ICE_PARAMN%XEXSEDR + XFSEDI => RAIN_ICE_PARAMN%XFSEDI + XEXCSEDI => RAIN_ICE_PARAMN%XEXCSEDI + XEXRSEDI => RAIN_ICE_PARAMN%XEXRSEDI + XFSEDS => RAIN_ICE_PARAMN%XFSEDS + XEXSEDS => RAIN_ICE_PARAMN%XEXSEDS + XFSEDG => RAIN_ICE_PARAMN%XFSEDG + XEXSEDG => RAIN_ICE_PARAMN%XEXSEDG + XNU10 => RAIN_ICE_PARAMN%XNU10 + XALPHA1 => RAIN_ICE_PARAMN%XALPHA1 + XBETA1 => RAIN_ICE_PARAMN%XBETA1 + XNU20 => RAIN_ICE_PARAMN%XNU20 + XALPHA2 => RAIN_ICE_PARAMN%XALPHA2 + XBETA2 => RAIN_ICE_PARAMN%XBETA2 + XMNU0 => RAIN_ICE_PARAMN%XMNU0 + XALPHA3 => RAIN_ICE_PARAMN%XALPHA3 + XBETA3 => RAIN_ICE_PARAMN%XBETA3 + XHON => RAIN_ICE_PARAMN%XHON + XSCFAC => RAIN_ICE_PARAMN%XSCFAC + X0EVAR => RAIN_ICE_PARAMN%X0EVAR + X1EVAR => RAIN_ICE_PARAMN%X1EVAR + XEX0EVAR => RAIN_ICE_PARAMN%XEX0EVAR + XEX1EVAR => RAIN_ICE_PARAMN%XEX1EVAR + X0DEPI => RAIN_ICE_PARAMN%X0DEPI + X2DEPI => RAIN_ICE_PARAMN%X2DEPI + X0DEPS => RAIN_ICE_PARAMN%X0DEPS + X1DEPS => RAIN_ICE_PARAMN%X1DEPS + XEX0DEPS => RAIN_ICE_PARAMN%XEX0DEPS + XEX1DEPS => RAIN_ICE_PARAMN%XEX1DEPS + XRDEPSRED => RAIN_ICE_PARAMN%XRDEPSRED + X0DEPG => RAIN_ICE_PARAMN%X0DEPG + X1DEPG => RAIN_ICE_PARAMN%X1DEPG + XEX0DEPG => RAIN_ICE_PARAMN%XEX0DEPG + XEX1DEPG => RAIN_ICE_PARAMN%XEX1DEPG + XRDEPGRED => RAIN_ICE_PARAMN%XRDEPGRED + XTIMAUTI => RAIN_ICE_PARAMN%XTIMAUTI + XTEXAUTI => RAIN_ICE_PARAMN%XTEXAUTI + XCRIAUTI => RAIN_ICE_PARAMN%XCRIAUTI + XT0CRIAUTI => RAIN_ICE_PARAMN%XT0CRIAUTI + XACRIAUTI => RAIN_ICE_PARAMN%XACRIAUTI + XBCRIAUTI => RAIN_ICE_PARAMN%XBCRIAUTI + XCOLIS => RAIN_ICE_PARAMN%XCOLIS + XCOLEXIS => RAIN_ICE_PARAMN%XCOLEXIS + XFIAGGS => RAIN_ICE_PARAMN%XFIAGGS + XEXIAGGS => RAIN_ICE_PARAMN%XEXIAGGS + XTIMAUTC => RAIN_ICE_PARAMN%XTIMAUTC + XCRIAUTC => RAIN_ICE_PARAMN%XCRIAUTC + XFCACCR => RAIN_ICE_PARAMN%XFCACCR + XEXCACCR => RAIN_ICE_PARAMN%XEXCACCR + XDCSLIM => RAIN_ICE_PARAMN%XDCSLIM + XCOLCS => RAIN_ICE_PARAMN%XCOLCS + XEXCRIMSS => RAIN_ICE_PARAMN%XEXCRIMSS + XCRIMSS => RAIN_ICE_PARAMN%XCRIMSS + XEXCRIMSG => RAIN_ICE_PARAMN%XEXCRIMSG + XCRIMSG => RAIN_ICE_PARAMN%XCRIMSG + XEXSRIMCG => RAIN_ICE_PARAMN%XEXSRIMCG + XSRIMCG => RAIN_ICE_PARAMN%XSRIMCG + XEXSRIMCG2 => RAIN_ICE_PARAMN%XEXSRIMCG2 + XSRIMCG2 => RAIN_ICE_PARAMN%XSRIMCG2 + XSRIMCG3 => RAIN_ICE_PARAMN%XSRIMCG3 + XGAMINC_BOUND_MIN => RAIN_ICE_PARAMN%XGAMINC_BOUND_MIN + XGAMINC_BOUND_MAX => RAIN_ICE_PARAMN%XGAMINC_BOUND_MAX + XRIMINTP1 => RAIN_ICE_PARAMN%XRIMINTP1 + XRIMINTP2 => RAIN_ICE_PARAMN%XRIMINTP2 + XFRACCSS => RAIN_ICE_PARAMN%XFRACCSS + XLBRACCS1 => RAIN_ICE_PARAMN%XLBRACCS1 + XLBRACCS2 => RAIN_ICE_PARAMN%XLBRACCS2 + XLBRACCS3 => RAIN_ICE_PARAMN%XLBRACCS3 + XFSACCRG => RAIN_ICE_PARAMN%XFSACCRG + XLBSACCR1 => RAIN_ICE_PARAMN%XLBSACCR1 + XLBSACCR2 => RAIN_ICE_PARAMN%XLBSACCR2 + XLBSACCR3 => RAIN_ICE_PARAMN%XLBSACCR3 + XACCLBDAS_MIN => RAIN_ICE_PARAMN%XACCLBDAS_MIN + XACCLBDAS_MAX => RAIN_ICE_PARAMN%XACCLBDAS_MAX + XACCLBDAR_MIN => RAIN_ICE_PARAMN%XACCLBDAR_MIN + XACCLBDAR_MAX => RAIN_ICE_PARAMN%XACCLBDAR_MAX + XACCINTP1S => RAIN_ICE_PARAMN%XACCINTP1S + XACCINTP2S => RAIN_ICE_PARAMN%XACCINTP2S + XACCINTP1R => RAIN_ICE_PARAMN%XACCINTP1R + XACCINTP2R => RAIN_ICE_PARAMN%XACCINTP2R + XFSCVMG => RAIN_ICE_PARAMN%XFSCVMG + XCOLIR => RAIN_ICE_PARAMN%XCOLIR + XEXRCFRI => RAIN_ICE_PARAMN%XEXRCFRI + XRCFRI => RAIN_ICE_PARAMN%XRCFRI + XEXICFRR => RAIN_ICE_PARAMN%XEXICFRR + XICFRR => RAIN_ICE_PARAMN%XICFRR + XFCDRYG => RAIN_ICE_PARAMN%XFCDRYG + XCOLIG => RAIN_ICE_PARAMN%XCOLIG + XCOLEXIG => RAIN_ICE_PARAMN%XCOLEXIG + XFIDRYG => RAIN_ICE_PARAMN%XFIDRYG + XFIDRYG2 => RAIN_ICE_PARAMN%XFIDRYG2 + XEXFIDRYG => RAIN_ICE_PARAMN%XEXFIDRYG + XCOLSG => RAIN_ICE_PARAMN%XCOLSG + XCOLEXSG => RAIN_ICE_PARAMN%XCOLEXSG + XFSDRYG => RAIN_ICE_PARAMN%XFSDRYG + XLBSDRYG1 => RAIN_ICE_PARAMN%XLBSDRYG1 + XLBSDRYG2 => RAIN_ICE_PARAMN%XLBSDRYG2 + XLBSDRYG3 => RAIN_ICE_PARAMN%XLBSDRYG3 + XFRDRYG => RAIN_ICE_PARAMN%XFRDRYG + XLBRDRYG1 => RAIN_ICE_PARAMN%XLBRDRYG1 + XLBRDRYG2 => RAIN_ICE_PARAMN%XLBRDRYG2 + XLBRDRYG3 => RAIN_ICE_PARAMN%XLBRDRYG3 + XDRYLBDAR_MIN => RAIN_ICE_PARAMN%XDRYLBDAR_MIN + XDRYLBDAR_MAX => RAIN_ICE_PARAMN%XDRYLBDAR_MAX + XDRYLBDAS_MIN => RAIN_ICE_PARAMN%XDRYLBDAS_MIN + XDRYLBDAS_MAX => RAIN_ICE_PARAMN%XDRYLBDAS_MAX + XDRYLBDAG_MIN => RAIN_ICE_PARAMN%XDRYLBDAG_MIN + XDRYLBDAG_MAX => RAIN_ICE_PARAMN%XDRYLBDAG_MAX + XDRYINTP1R => RAIN_ICE_PARAMN%XDRYINTP1R + XDRYINTP2R => RAIN_ICE_PARAMN%XDRYINTP2R + XDRYINTP1S => RAIN_ICE_PARAMN%XDRYINTP1S + XDRYINTP2S => RAIN_ICE_PARAMN%XDRYINTP2S + XDRYINTP1G => RAIN_ICE_PARAMN%XDRYINTP1G + XDRYINTP2G => RAIN_ICE_PARAMN%XDRYINTP2G + XFSEDH => RAIN_ICE_PARAMN%XFSEDH + XEXSEDH => RAIN_ICE_PARAMN%XEXSEDH + X0DEPH => RAIN_ICE_PARAMN%X0DEPH + X1DEPH => RAIN_ICE_PARAMN%X1DEPH + XEX0DEPH => RAIN_ICE_PARAMN%XEX0DEPH + XEX1DEPH => RAIN_ICE_PARAMN%XEX1DEPH + XCOLIH => RAIN_ICE_PARAMN%XCOLIH + XCOLEXIH => RAIN_ICE_PARAMN%XCOLEXIH + XCOLSH => RAIN_ICE_PARAMN%XCOLSH + XCOLEXSH => RAIN_ICE_PARAMN%XCOLEXSH + XCOLGH => RAIN_ICE_PARAMN%XCOLGH + XCOLEXGH => RAIN_ICE_PARAMN%XCOLEXGH + XFWETH => RAIN_ICE_PARAMN%XFWETH + XFSWETH => RAIN_ICE_PARAMN%XFSWETH + XLBSWETH1 => RAIN_ICE_PARAMN%XLBSWETH1 + XLBSWETH2 => RAIN_ICE_PARAMN%XLBSWETH2 + XLBSWETH3 => RAIN_ICE_PARAMN%XLBSWETH3 + XFGWETH => RAIN_ICE_PARAMN%XFGWETH + XLBGWETH1 => RAIN_ICE_PARAMN%XLBGWETH1 + XLBGWETH2 => RAIN_ICE_PARAMN%XLBGWETH2 + XLBGWETH3 => RAIN_ICE_PARAMN%XLBGWETH3 + XFRWETH => RAIN_ICE_PARAMN%XFRWETH + XLBRWETH1 => RAIN_ICE_PARAMN%XLBRWETH1 + XLBRWETH2 => RAIN_ICE_PARAMN%XLBRWETH2 + XLBRWETH3 => RAIN_ICE_PARAMN%XLBRWETH3 + XWETLBDAS_MIN => RAIN_ICE_PARAMN%XWETLBDAS_MIN + XWETLBDAS_MAX => RAIN_ICE_PARAMN%XWETLBDAS_MAX + XWETLBDAG_MIN => RAIN_ICE_PARAMN%XWETLBDAG_MIN + XWETLBDAG_MAX => RAIN_ICE_PARAMN%XWETLBDAG_MAX + XWETLBDAR_MIN => RAIN_ICE_PARAMN%XWETLBDAR_MIN + XWETLBDAR_MAX => RAIN_ICE_PARAMN%XWETLBDAR_MAX + XWETLBDAH_MIN => RAIN_ICE_PARAMN%XWETLBDAH_MIN + XWETLBDAH_MAX => RAIN_ICE_PARAMN%XWETLBDAH_MAX + XWETINTP1S => RAIN_ICE_PARAMN%XWETINTP1S + XWETINTP2S => RAIN_ICE_PARAMN%XWETINTP2S + XWETINTP1G => RAIN_ICE_PARAMN%XWETINTP1G + XWETINTP2G => RAIN_ICE_PARAMN%XWETINTP2G + XWETINTP1R => RAIN_ICE_PARAMN%XWETINTP1R + XWETINTP2R => RAIN_ICE_PARAMN%XWETINTP2R + XWETINTP1H => RAIN_ICE_PARAMN%XWETINTP1H + XWETINTP2H => RAIN_ICE_PARAMN%XWETINTP2H ! - XFSEDR => RAIN_ICE_PARAM%XFSEDR - XEXSEDR => RAIN_ICE_PARAM%XEXSEDR - XFSEDI => RAIN_ICE_PARAM%XFSEDI - XEXCSEDI => RAIN_ICE_PARAM%XEXCSEDI - XEXRSEDI => RAIN_ICE_PARAM%XEXRSEDI - XFSEDS => RAIN_ICE_PARAM%XFSEDS - XEXSEDS => RAIN_ICE_PARAM%XEXSEDS - XFSEDG => RAIN_ICE_PARAM%XFSEDG - XEXSEDG => RAIN_ICE_PARAM%XEXSEDG - XNU10 => RAIN_ICE_PARAM%XNU10 - XALPHA1 => RAIN_ICE_PARAM%XALPHA1 - XBETA1 => RAIN_ICE_PARAM%XBETA1 - XNU20 => RAIN_ICE_PARAM%XNU20 - XALPHA2 => RAIN_ICE_PARAM%XALPHA2 - XBETA2 => RAIN_ICE_PARAM%XBETA2 - XMNU0 => RAIN_ICE_PARAM%XMNU0 - XALPHA3 => RAIN_ICE_PARAM%XALPHA3 - XBETA3 => RAIN_ICE_PARAM%XBETA3 - XHON => RAIN_ICE_PARAM%XHON - XSCFAC => RAIN_ICE_PARAM%XSCFAC - X0EVAR => RAIN_ICE_PARAM%X0EVAR - X1EVAR => RAIN_ICE_PARAM%X1EVAR - XEX0EVAR => RAIN_ICE_PARAM%XEX0EVAR - XEX1EVAR => RAIN_ICE_PARAM%XEX1EVAR - X0DEPI => RAIN_ICE_PARAM%X0DEPI - X2DEPI => RAIN_ICE_PARAM%X2DEPI - X0DEPS => RAIN_ICE_PARAM%X0DEPS - X1DEPS => RAIN_ICE_PARAM%X1DEPS - XEX0DEPS => RAIN_ICE_PARAM%XEX0DEPS - XEX1DEPS => RAIN_ICE_PARAM%XEX1DEPS - XRDEPSRED => RAIN_ICE_PARAM%XRDEPSRED - X0DEPG => RAIN_ICE_PARAM%X0DEPG - X1DEPG => RAIN_ICE_PARAM%X1DEPG - XEX0DEPG => RAIN_ICE_PARAM%XEX0DEPG - XEX1DEPG => RAIN_ICE_PARAM%XEX1DEPG - XRDEPGRED => RAIN_ICE_PARAM%XRDEPGRED - XTIMAUTI => RAIN_ICE_PARAM%XTIMAUTI - XTEXAUTI => RAIN_ICE_PARAM%XTEXAUTI - XCRIAUTI => RAIN_ICE_PARAM%XCRIAUTI - XT0CRIAUTI => RAIN_ICE_PARAM%XT0CRIAUTI - XACRIAUTI => RAIN_ICE_PARAM%XACRIAUTI - XBCRIAUTI => RAIN_ICE_PARAM%XBCRIAUTI - XCOLIS => RAIN_ICE_PARAM%XCOLIS - XCOLEXIS => RAIN_ICE_PARAM%XCOLEXIS - XFIAGGS => RAIN_ICE_PARAM%XFIAGGS - XEXIAGGS => RAIN_ICE_PARAM%XEXIAGGS - XTIMAUTC => RAIN_ICE_PARAM%XTIMAUTC - XCRIAUTC => RAIN_ICE_PARAM%XCRIAUTC - XFCACCR => RAIN_ICE_PARAM%XFCACCR - XEXCACCR => RAIN_ICE_PARAM%XEXCACCR - XDCSLIM => RAIN_ICE_PARAM%XDCSLIM - XCOLCS => RAIN_ICE_PARAM%XCOLCS - XEXCRIMSS => RAIN_ICE_PARAM%XEXCRIMSS - XCRIMSS => RAIN_ICE_PARAM%XCRIMSS - XEXCRIMSG => RAIN_ICE_PARAM%XEXCRIMSG - XCRIMSG => RAIN_ICE_PARAM%XCRIMSG - XEXSRIMCG => RAIN_ICE_PARAM%XEXSRIMCG - XSRIMCG => RAIN_ICE_PARAM%XSRIMCG - XEXSRIMCG2 => RAIN_ICE_PARAM%XEXSRIMCG2 - XSRIMCG2 => RAIN_ICE_PARAM%XSRIMCG2 - XSRIMCG3 => RAIN_ICE_PARAM%XSRIMCG3 - XGAMINC_BOUND_MIN => RAIN_ICE_PARAM%XGAMINC_BOUND_MIN - XGAMINC_BOUND_MAX => RAIN_ICE_PARAM%XGAMINC_BOUND_MAX - XRIMINTP1 => RAIN_ICE_PARAM%XRIMINTP1 - XRIMINTP2 => RAIN_ICE_PARAM%XRIMINTP2 - XFRACCSS => RAIN_ICE_PARAM%XFRACCSS - XLBRACCS1 => RAIN_ICE_PARAM%XLBRACCS1 - XLBRACCS2 => RAIN_ICE_PARAM%XLBRACCS2 - XLBRACCS3 => RAIN_ICE_PARAM%XLBRACCS3 - XFSACCRG => RAIN_ICE_PARAM%XFSACCRG - XLBSACCR1 => RAIN_ICE_PARAM%XLBSACCR1 - XLBSACCR2 => RAIN_ICE_PARAM%XLBSACCR2 - XLBSACCR3 => RAIN_ICE_PARAM%XLBSACCR3 - XACCLBDAS_MIN => RAIN_ICE_PARAM%XACCLBDAS_MIN - XACCLBDAS_MAX => RAIN_ICE_PARAM%XACCLBDAS_MAX - XACCLBDAR_MIN => RAIN_ICE_PARAM%XACCLBDAR_MIN - XACCLBDAR_MAX => RAIN_ICE_PARAM%XACCLBDAR_MAX - XACCINTP1S => RAIN_ICE_PARAM%XACCINTP1S - XACCINTP2S => RAIN_ICE_PARAM%XACCINTP2S - XACCINTP1R => RAIN_ICE_PARAM%XACCINTP1R - XACCINTP2R => RAIN_ICE_PARAM%XACCINTP2R - XFSCVMG => RAIN_ICE_PARAM%XFSCVMG - XCOLIR => RAIN_ICE_PARAM%XCOLIR - XEXRCFRI => RAIN_ICE_PARAM%XEXRCFRI - XRCFRI => RAIN_ICE_PARAM%XRCFRI - XEXICFRR => RAIN_ICE_PARAM%XEXICFRR - XICFRR => RAIN_ICE_PARAM%XICFRR - XFCDRYG => RAIN_ICE_PARAM%XFCDRYG - XCOLIG => RAIN_ICE_PARAM%XCOLIG - XCOLEXIG => RAIN_ICE_PARAM%XCOLEXIG - XFIDRYG => RAIN_ICE_PARAM%XFIDRYG - XFIDRYG2 => RAIN_ICE_PARAM%XFIDRYG2 - XEXFIDRYG => RAIN_ICE_PARAM%XEXFIDRYG - XCOLSG => RAIN_ICE_PARAM%XCOLSG - XCOLEXSG => RAIN_ICE_PARAM%XCOLEXSG - XFSDRYG => RAIN_ICE_PARAM%XFSDRYG - XLBSDRYG1 => RAIN_ICE_PARAM%XLBSDRYG1 - XLBSDRYG2 => RAIN_ICE_PARAM%XLBSDRYG2 - XLBSDRYG3 => RAIN_ICE_PARAM%XLBSDRYG3 - XFRDRYG => RAIN_ICE_PARAM%XFRDRYG - XLBRDRYG1 => RAIN_ICE_PARAM%XLBRDRYG1 - XLBRDRYG2 => RAIN_ICE_PARAM%XLBRDRYG2 - XLBRDRYG3 => RAIN_ICE_PARAM%XLBRDRYG3 - XDRYLBDAR_MIN => RAIN_ICE_PARAM%XDRYLBDAR_MIN - XDRYLBDAR_MAX => RAIN_ICE_PARAM%XDRYLBDAR_MAX - XDRYLBDAS_MIN => RAIN_ICE_PARAM%XDRYLBDAS_MIN - XDRYLBDAS_MAX => RAIN_ICE_PARAM%XDRYLBDAS_MAX - XDRYLBDAG_MIN => RAIN_ICE_PARAM%XDRYLBDAG_MIN - XDRYLBDAG_MAX => RAIN_ICE_PARAM%XDRYLBDAG_MAX - XDRYINTP1R => RAIN_ICE_PARAM%XDRYINTP1R - XDRYINTP2R => RAIN_ICE_PARAM%XDRYINTP2R - XDRYINTP1S => RAIN_ICE_PARAM%XDRYINTP1S - XDRYINTP2S => RAIN_ICE_PARAM%XDRYINTP2S - XDRYINTP1G => RAIN_ICE_PARAM%XDRYINTP1G - XDRYINTP2G => RAIN_ICE_PARAM%XDRYINTP2G - XFSEDH => RAIN_ICE_PARAM%XFSEDH - XEXSEDH => RAIN_ICE_PARAM%XEXSEDH - X0DEPH => RAIN_ICE_PARAM%X0DEPH - X1DEPH => RAIN_ICE_PARAM%X1DEPH - XEX0DEPH => RAIN_ICE_PARAM%XEX0DEPH - XEX1DEPH => RAIN_ICE_PARAM%XEX1DEPH - XCOLIH => RAIN_ICE_PARAM%XCOLIH - XCOLEXIH => RAIN_ICE_PARAM%XCOLEXIH - XCOLSH => RAIN_ICE_PARAM%XCOLSH - XCOLEXSH => RAIN_ICE_PARAM%XCOLEXSH - XCOLGH => RAIN_ICE_PARAM%XCOLGH - XCOLEXGH => RAIN_ICE_PARAM%XCOLEXGH - XFWETH => RAIN_ICE_PARAM%XFWETH - XFSWETH => RAIN_ICE_PARAM%XFSWETH - XLBSWETH1 => RAIN_ICE_PARAM%XLBSWETH1 - XLBSWETH2 => RAIN_ICE_PARAM%XLBSWETH2 - XLBSWETH3 => RAIN_ICE_PARAM%XLBSWETH3 - XFGWETH => RAIN_ICE_PARAM%XFGWETH - XLBGWETH1 => RAIN_ICE_PARAM%XLBGWETH1 - XLBGWETH2 => RAIN_ICE_PARAM%XLBGWETH2 - XLBGWETH3 => RAIN_ICE_PARAM%XLBGWETH3 - XFRWETH => RAIN_ICE_PARAM%XFRWETH - XLBRWETH1 => RAIN_ICE_PARAM%XLBRWETH1 - XLBRWETH2 => RAIN_ICE_PARAM%XLBRWETH2 - XLBRWETH3 => RAIN_ICE_PARAM%XLBRWETH3 - XWETLBDAS_MIN => RAIN_ICE_PARAM%XWETLBDAS_MIN - XWETLBDAS_MAX => RAIN_ICE_PARAM%XWETLBDAS_MAX - XWETLBDAG_MIN => RAIN_ICE_PARAM%XWETLBDAG_MIN - XWETLBDAG_MAX => RAIN_ICE_PARAM%XWETLBDAG_MAX - XWETLBDAR_MIN => RAIN_ICE_PARAM%XWETLBDAR_MIN - XWETLBDAR_MAX => RAIN_ICE_PARAM%XWETLBDAR_MAX - XWETLBDAH_MIN => RAIN_ICE_PARAM%XWETLBDAH_MIN - XWETLBDAH_MAX => RAIN_ICE_PARAM%XWETLBDAH_MAX - XWETINTP1S => RAIN_ICE_PARAM%XWETINTP1S - XWETINTP2S => RAIN_ICE_PARAM%XWETINTP2S - XWETINTP1G => RAIN_ICE_PARAM%XWETINTP1G - XWETINTP2G => RAIN_ICE_PARAM%XWETINTP2G - XWETINTP1R => RAIN_ICE_PARAM%XWETINTP1R - XWETINTP2R => RAIN_ICE_PARAM%XWETINTP2R - XWETINTP1H => RAIN_ICE_PARAM%XWETINTP1H - XWETINTP2H => RAIN_ICE_PARAM%XWETINTP2H + NGAMINC => RAIN_ICE_PARAMN%NGAMINC + NACCLBDAS => RAIN_ICE_PARAMN%NACCLBDAS + NACCLBDAR => RAIN_ICE_PARAMN%NACCLBDAR + NDRYLBDAR => RAIN_ICE_PARAMN%NDRYLBDAR + NDRYLBDAS => RAIN_ICE_PARAMN%NDRYLBDAS + NDRYLBDAG => RAIN_ICE_PARAMN%NDRYLBDAG + NWETLBDAS => RAIN_ICE_PARAMN%NWETLBDAS + NWETLBDAG => RAIN_ICE_PARAMN%NWETLBDAG + NWETLBDAR => RAIN_ICE_PARAMN%NWETLBDAR + NWETLBDAH => RAIN_ICE_PARAMN%NWETLBDAH ! - NGAMINC => RAIN_ICE_PARAM%NGAMINC - NACCLBDAS => RAIN_ICE_PARAM%NACCLBDAS - NACCLBDAR => RAIN_ICE_PARAM%NACCLBDAR - NDRYLBDAR => RAIN_ICE_PARAM%NDRYLBDAR - NDRYLBDAS => RAIN_ICE_PARAM%NDRYLBDAS - NDRYLBDAG => RAIN_ICE_PARAM%NDRYLBDAG - NWETLBDAS => RAIN_ICE_PARAM%NWETLBDAS - NWETLBDAG => RAIN_ICE_PARAM%NWETLBDAG - NWETLBDAR => RAIN_ICE_PARAM%NWETLBDAR - NWETLBDAH => RAIN_ICE_PARAM%NWETLBDAH -END SUBROUTINE RAIN_ICE_PARAM_ASSOCIATE + CALL HELPER1(XGAMINC_RIM1, RAIN_ICE_PARAMN%XGAMINC_RIM1) + CALL HELPER1(XGAMINC_RIM2, RAIN_ICE_PARAMN%XGAMINC_RIM2) + CALL HELPER1(XGAMINC_RIM4, RAIN_ICE_PARAMN%XGAMINC_RIM4) + CALL HELPER2(XKER_RACCSS, RAIN_ICE_PARAMN%XKER_RACCSS) + CALL HELPER2(XKER_RACCS, RAIN_ICE_PARAMN%XKER_RACCS) + CALL HELPER2(XKER_SACCRG, RAIN_ICE_PARAMN%XKER_SACCRG) + CALL HELPER2(XKER_SDRYG, RAIN_ICE_PARAMN%XKER_SDRYG) + CALL HELPER2(XKER_RDRYG, RAIN_ICE_PARAMN%XKER_RDRYG) + CALL HELPER2(XKER_SWETH, RAIN_ICE_PARAMN%XKER_SWETH) + CALL HELPER2(XKER_GWETH, RAIN_ICE_PARAMN%XKER_GWETH) + CALL HELPER2(XKER_RWETH, RAIN_ICE_PARAMN%XKER_RWETH) + +ENDIF +END SUBROUTINE RAIN_ICE_PARAM_GOTO_MODEL +! +SUBROUTINE HELPER1(XPT, XARR) + IMPLICIT NONE + REAL, POINTER, DIMENSION(:), INTENT(INOUT) :: XPT + REAL, DIMENSION(:), ALLOCATABLE, TARGET, INTENT(INOUT) :: XARR + IF(ALLOCATED(XARR)) THEN + XPT => XARR + ELSE + XPT => NULL() + ENDIF +END SUBROUTINE HELPER1 +! +SUBROUTINE HELPER2(XPT, XARR) + IMPLICIT NONE + REAL, POINTER, DIMENSION(:,:), INTENT(INOUT) :: XPT + REAL, DIMENSION(:,:), ALLOCATABLE, TARGET, INTENT(INOUT) :: XARR + IF(ALLOCATED(XARR)) THEN + XPT => XARR + ELSE + XPT => NULL() + ENDIF +END SUBROUTINE HELPER2 ! SUBROUTINE RAIN_ICE_PARAM_ALLOCATE(HNAME, KDIM1, KDIM2) IMPLICIT NONE @@ -556,57 +603,59 @@ SUBROUTINE RAIN_ICE_PARAM_ALLOCATE(HNAME, KDIM1, KDIM2) SELECT CASE(TRIM(HNAME)) !1D arrays CASE('XGAMINC_RIM1') - ALLOCATE(RAIN_ICE_PARAM%XGAMINC_RIM1(KDIM1)) - XGAMINC_RIM1 => RAIN_ICE_PARAM%XGAMINC_RIM1 + ALLOCATE(RAIN_ICE_PARAMN%XGAMINC_RIM1(KDIM1)) + XGAMINC_RIM1 => RAIN_ICE_PARAMN%XGAMINC_RIM1 CASE('XGAMINC_RIM2') - ALLOCATE(RAIN_ICE_PARAM%XGAMINC_RIM2(KDIM1)) - XGAMINC_RIM2 => RAIN_ICE_PARAM%XGAMINC_RIM2 + ALLOCATE(RAIN_ICE_PARAMN%XGAMINC_RIM2(KDIM1)) + XGAMINC_RIM2 => RAIN_ICE_PARAMN%XGAMINC_RIM2 CASE('XGAMINC_RIM4') - ALLOCATE(RAIN_ICE_PARAM%XGAMINC_RIM4(KDIM1)) - XGAMINC_RIM4 => RAIN_ICE_PARAM%XGAMINC_RIM4 + ALLOCATE(RAIN_ICE_PARAMN%XGAMINC_RIM4(KDIM1)) + XGAMINC_RIM4 => RAIN_ICE_PARAMN%XGAMINC_RIM4 ! !2D arrays CASE('XKER_RACCSS') - ALLOCATE(RAIN_ICE_PARAM%XKER_RACCSS(KDIM1, KDIM2)) - XKER_RACCSS=> RAIN_ICE_PARAM%XKER_RACCSS + ALLOCATE(RAIN_ICE_PARAMN%XKER_RACCSS(KDIM1, KDIM2)) + XKER_RACCSS=> RAIN_ICE_PARAMN%XKER_RACCSS CASE('XKER_RACCS') - ALLOCATE(RAIN_ICE_PARAM%XKER_RACCS(KDIM1, KDIM2)) - XKER_RACCS=> RAIN_ICE_PARAM%XKER_RACCS + ALLOCATE(RAIN_ICE_PARAMN%XKER_RACCS(KDIM1, KDIM2)) + XKER_RACCS=> RAIN_ICE_PARAMN%XKER_RACCS CASE('XKER_SACCRG') - ALLOCATE(RAIN_ICE_PARAM%XKER_SACCRG(KDIM1, KDIM2)) - XKER_SACCRG=> RAIN_ICE_PARAM%XKER_SACCRG + ALLOCATE(RAIN_ICE_PARAMN%XKER_SACCRG(KDIM1, KDIM2)) + XKER_SACCRG=> RAIN_ICE_PARAMN%XKER_SACCRG CASE('XKER_SDRYG') - ALLOCATE(RAIN_ICE_PARAM%XKER_SDRYG(KDIM1, KDIM2)) - XKER_SDRYG=> RAIN_ICE_PARAM%XKER_SDRYG + ALLOCATE(RAIN_ICE_PARAMN%XKER_SDRYG(KDIM1, KDIM2)) + XKER_SDRYG=> RAIN_ICE_PARAMN%XKER_SDRYG CASE('XKER_RDRYG') - ALLOCATE(RAIN_ICE_PARAM%XKER_RDRYG(KDIM1, KDIM2)) - XKER_RDRYG=> RAIN_ICE_PARAM%XKER_RDRYG + ALLOCATE(RAIN_ICE_PARAMN%XKER_RDRYG(KDIM1, KDIM2)) + XKER_RDRYG=> RAIN_ICE_PARAMN%XKER_RDRYG CASE('XKER_SWETH') - ALLOCATE(RAIN_ICE_PARAM%XKER_SWETH(KDIM1, KDIM2)) - XKER_SWETH=> RAIN_ICE_PARAM%XKER_SWETH + ALLOCATE(RAIN_ICE_PARAMN%XKER_SWETH(KDIM1, KDIM2)) + XKER_SWETH=> RAIN_ICE_PARAMN%XKER_SWETH CASE('XKER_GWETH') - ALLOCATE(RAIN_ICE_PARAM%XKER_GWETH(KDIM1, KDIM2)) - XKER_GWETH=> RAIN_ICE_PARAM%XKER_GWETH + ALLOCATE(RAIN_ICE_PARAMN%XKER_GWETH(KDIM1, KDIM2)) + XKER_GWETH=> RAIN_ICE_PARAMN%XKER_GWETH CASE('XKER_RWETH') - ALLOCATE(RAIN_ICE_PARAM%XKER_RWETH(KDIM1, KDIM2)) - XKER_RWETH=> RAIN_ICE_PARAM%XKER_RWETH + ALLOCATE(RAIN_ICE_PARAMN%XKER_RWETH(KDIM1, KDIM2)) + XKER_RWETH=> RAIN_ICE_PARAMN%XKER_RWETH END SELECT END SUBROUTINE RAIN_ICE_PARAM_ALLOCATE +! SUBROUTINE RAIN_ICE_PARAM_DEALLOCATE() IMPLICIT NONE XGAMINC_RIM1=>NULL() - DEALLOCATE(RAIN_ICE_PARAM%XGAMINC_RIM1) + DEALLOCATE(RAIN_ICE_PARAMN%XGAMINC_RIM1) XGAMINC_RIM2=>NULL() - DEALLOCATE(RAIN_ICE_PARAM%XGAMINC_RIM2) + DEALLOCATE(RAIN_ICE_PARAMN%XGAMINC_RIM2) XKER_RACCSS=>NULL() - DEALLOCATE(RAIN_ICE_PARAM%XKER_RACCSS) + DEALLOCATE(RAIN_ICE_PARAMN%XKER_RACCSS) XKER_RACCS=>NULL() - DEALLOCATE(RAIN_ICE_PARAM%XKER_RACCS) + DEALLOCATE(RAIN_ICE_PARAMN%XKER_RACCS) XKER_SACCRG=>NULL() - DEALLOCATE(RAIN_ICE_PARAM%XKER_SACCRG) + DEALLOCATE(RAIN_ICE_PARAMN%XKER_SACCRG) XKER_SDRYG=>NULL() - DEALLOCATE(RAIN_ICE_PARAM%XKER_SDRYG) + DEALLOCATE(RAIN_ICE_PARAMN%XKER_SDRYG) XKER_RDRYG=>NULL() - DEALLOCATE(RAIN_ICE_PARAM%XKER_RDRYG) + DEALLOCATE(RAIN_ICE_PARAMN%XKER_RDRYG) END SUBROUTINE RAIN_ICE_PARAM_DEALLOCATE -END MODULE MODD_RAIN_ICE_PARAM +! +END MODULE MODD_RAIN_ICE_PARAM_n diff --git a/src/common/micro/mode_ice4_budgets.F90 b/src/common/micro/mode_ice4_budgets.F90 index e2d91bd8c7adb3221a2fd53b3655df6f6af066a2..47d1df99ae28ec879b5458d0b8cc942195cdfa2b 100644 --- a/src/common/micro/mode_ice4_budgets.F90 +++ b/src/common/micro/mode_ice4_budgets.F90 @@ -21,7 +21,7 @@ USE YOMHOOK , ONLY : LHOOK, DR_HOOK USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_BUDGET, ONLY: TBUDGETDATA, TBUDGETCONF_t, NBUDGET_TH, NBUDGET_RV, NBUDGET_RC, & NBUDGET_RI, NBUDGET_RR, NBUDGET_RS, NBUDGET_RG, NBUDGET_RH -USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t ! USE MODD_FIELDS_ADDRESS ! index number for prognostic (theta and mixing ratios) and budgets ! diff --git a/src/common/micro/mode_ice4_compute_pdf.F90 b/src/common/micro/mode_ice4_compute_pdf.F90 index 7ccb88c1274867edbcff476743ebf920ea8dc2cc..5ef44c079c2811b75ff9092a319587434ae70773 100644 --- a/src/common/micro/mode_ice4_compute_pdf.F90 +++ b/src/common/micro/mode_ice4_compute_pdf.F90 @@ -29,8 +29,8 @@ SUBROUTINE ICE4_COMPUTE_PDF(CST, ICEP, ICED, KSIZE, HSUBG_AUCV_RC, HSUBG_AUCV_RI ! ! USE MODD_CST, ONLY: CST_t -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK ! diff --git a/src/common/micro/mode_ice4_correct_negativities.F90 b/src/common/micro/mode_ice4_correct_negativities.F90 index 12f8b08aa4eed8fc9565d2fc7462d48cf92eabff..637c73612e7179e2c8cc1f496ac55830372215bc 100644 --- a/src/common/micro/mode_ice4_correct_negativities.F90 +++ b/src/common/micro/mode_ice4_correct_negativities.F90 @@ -13,7 +13,7 @@ SUBROUTINE ICE4_CORRECT_NEGATIVITIES(D, ICED, KRR, PRV, PRC, PRR, & USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t ! IMPLICIT NONE ! diff --git a/src/common/micro/mode_ice4_fast_rg.F90 b/src/common/micro/mode_ice4_fast_rg.F90 index 0b7a6ef508cdf6b5677b49a01a0b47ea731e62cc..33c14921788b371b835b3ff1cb9e761df19b082a 100644 --- a/src/common/micro/mode_ice4_fast_rg.F90 +++ b/src/common/micro/mode_ice4_fast_rg.F90 @@ -37,9 +37,9 @@ SUBROUTINE ICE4_FAST_RG(CST, PARAMI, ICEP, ICED, KPROMA, KSIZE, LDSOFT, LDCOMPUT ! ------------ ! USE MODD_CST, ONLY: CST_t -USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK ! diff --git a/src/common/micro/mode_ice4_fast_rh.F90 b/src/common/micro/mode_ice4_fast_rh.F90 index 8ac5a7b7e13ffb73eca7f232b86e679d2868936d..44112410a19c7e557182136c7cddc71a84c60b70 100644 --- a/src/common/micro/mode_ice4_fast_rh.F90 +++ b/src/common/micro/mode_ice4_fast_rh.F90 @@ -35,9 +35,9 @@ SUBROUTINE ICE4_FAST_RH(CST, PARAMI, ICEP, ICED, KPROMA, KSIZE, LDSOFT, LDCOMPUT ! ------------ ! USE MODD_CST, ONLY: CST_t -USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t ! USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK diff --git a/src/common/micro/mode_ice4_fast_ri.F90 b/src/common/micro/mode_ice4_fast_ri.F90 index abd41bdce2a1db4fef6343c43eaf4612020537e7..934ad5f66e67152e044f04b976770bad79e86641 100644 --- a/src/common/micro/mode_ice4_fast_ri.F90 +++ b/src/common/micro/mode_ice4_fast_ri.F90 @@ -30,8 +30,8 @@ SUBROUTINE ICE4_FAST_RI(ICEP, ICED, KPROMA, KSIZE, LDSOFT, LDCOMPUTE, & !* 0. DECLARATIONS ! ------------ ! -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK ! diff --git a/src/common/micro/mode_ice4_fast_rs.F90 b/src/common/micro/mode_ice4_fast_rs.F90 index 5e4dabf6e4380049a2c98584cac5957003dc7740..8b06a34bfb937435f6a80664650ed632469db4c2 100644 --- a/src/common/micro/mode_ice4_fast_rs.F90 +++ b/src/common/micro/mode_ice4_fast_rs.F90 @@ -37,9 +37,9 @@ SUBROUTINE ICE4_FAST_RS(CST, PARAMI, ICEP, ICED, KPROMA, KSIZE, LDSOFT, LDCOMPUT ! ------------ ! USE MODD_CST, ONLY: CST_t -USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK ! diff --git a/src/common/micro/mode_ice4_nucleation.F90 b/src/common/micro/mode_ice4_nucleation.F90 index 3135a3a67a5588859110b0d52e796029b25e9e56..4209d5f209f8beb1083dda607ceeac40b11ff08b 100644 --- a/src/common/micro/mode_ice4_nucleation.F90 +++ b/src/common/micro/mode_ice4_nucleation.F90 @@ -29,9 +29,9 @@ SUBROUTINE ICE4_NUCLEATION(CST, PARAMI, ICEP, ICED, KSIZE, ODCOMPUTE, & ! ------------ ! USE MODD_CST, ONLY: CST_t -USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK ! diff --git a/src/common/micro/mode_ice4_pack.F90 b/src/common/micro/mode_ice4_pack.F90 index e955a223d98f4629b532d6cdd68f71539e59fa05..5e6a03346f77608db5b8bf76b7245fc5f9670ce9 100644 --- a/src/common/micro/mode_ice4_pack.F90 +++ b/src/common/micro/mode_ice4_pack.F90 @@ -8,7 +8,6 @@ IMPLICIT NONE CONTAINS SUBROUTINE ICE4_PACK(D, CST, PARAMI, ICEP, ICED, BUCONF, & KPROMA, KSIZE, KSIZE2, & - HSUBG_AUCV_RC, HSUBG_AUCV_RI, & PTSTEP, KRR, ODMICRO, PEXN, & PRHODJ, PRHODREF, PEXNREF, PPABST, PCIT, PCLDFR, & PHLC_HRC, PHLC_HCF, PHLI_HRI, PHLI_HCF, & @@ -30,9 +29,9 @@ USE YOMHOOK , ONLY : LHOOK, DR_HOOK USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_BUDGET, ONLY: TBUDGETDATA, TBUDGETCONF_t USE MODD_CST, ONLY: CST_t -USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t USE MODD_FIELDS_ADDRESS, ONLY : & ! common fields adress & ITH, & ! Potential temperature & IRV, & ! Water vapor @@ -82,8 +81,6 @@ TYPE(TBUDGETCONF_t), INTENT(IN) :: BUCONF INTEGER, INTENT(IN) :: KPROMA ! cache-blocking factor for microphysic loop INTEGER, INTENT(IN) :: KSIZE INTEGER, INTENT(IN) :: KSIZE2 -CHARACTER(LEN=4), INTENT(IN) :: HSUBG_AUCV_RC ! Kind of Subgrid autoconversion method -CHARACTER(LEN=80), INTENT(IN) :: HSUBG_AUCV_RI ! Kind of Subgrid autoconversion method REAL, INTENT(IN) :: PTSTEP ! Double Time step (single if cold start) INTEGER, INTENT(IN) :: KRR ! Number of moist variable LOGICAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: ODMICRO ! mask to limit computation @@ -175,8 +172,8 @@ IKTE=D%NKTE IIJB=D%NIJB IIJE=D%NIJE GEXT_TEND=.TRUE. -LLSIGMA_RC=(HSUBG_AUCV_RC=='PDF ' .AND. PARAMI%CSUBG_PR_PDF=='SIGM') -LL_AUCV_ADJU=(HSUBG_AUCV_RC=='ADJU' .OR. HSUBG_AUCV_RI=='ADJU') +LLSIGMA_RC=(PARAMI%CSUBG_AUCV_RC=='PDF ' .AND. PARAMI%CSUBG_PR_PDF=='SIGM') +LL_AUCV_ADJU=(PARAMI%CSUBG_AUCV_RC=='ADJU' .OR. PARAMI%CSUBG_AUCV_RI=='ADJU') ! IF(PARAMI%LPACK_MICRO) THEN IF(KPROMA /= KSIZE) THEN @@ -305,7 +302,6 @@ IF(PARAMI%LPACK_MICRO) THEN &LLSIGMA_RC, LL_AUCV_ADJU, GEXT_TEND, & &KPROMA, IMICRO, LLMICRO, PTSTEP, & &KRR, & - &HSUBG_AUCV_RC, HSUBG_AUCV_RI, & &ZEXN, ZRHODREF, I1, I2, & &ZPRES, ZCF, ZSIGMA_RC, & &ZCIT, & @@ -381,7 +377,6 @@ ELSE ! PARAMI%LPACK_MICRO &LLSIGMA_RC, LL_AUCV_ADJU, GEXT_TEND, & &KSIZE, KSIZE, ODMICRO, PTSTEP, & &KRR, & - &HSUBG_AUCV_RC, HSUBG_AUCV_RI, & &PEXN, PRHODREF, I1TOT, I2TOT, & &PPABST, PCLDFR, ZSIGMA_RC, & &PCIT, & diff --git a/src/common/micro/mode_ice4_rainfr_vert.F90 b/src/common/micro/mode_ice4_rainfr_vert.F90 index e432813b1424aad05eb1261d89cce1eb707da6fe..38e3f495c8f2c9434861db97c4a49960f7e5eccd 100644 --- a/src/common/micro/mode_ice4_rainfr_vert.F90 +++ b/src/common/micro/mode_ice4_rainfr_vert.F90 @@ -28,7 +28,7 @@ SUBROUTINE ICE4_RAINFR_VERT(D, ICED, PPRFR, PRR, PRS, PRG, PRH) USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t -USE MODD_RAIN_ICE_DESCR, ONLY : RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_DESCR_n, ONLY : RAIN_ICE_DESCR_t ! IMPLICIT NONE ! diff --git a/src/common/micro/mode_ice4_rimltc.F90 b/src/common/micro/mode_ice4_rimltc.F90 index 012add3b46b1313eda451dc2b12103694eaf7e63..52914d30fe740bd5fc19b6a6c874d39fc8b8837f 100644 --- a/src/common/micro/mode_ice4_rimltc.F90 +++ b/src/common/micro/mode_ice4_rimltc.F90 @@ -30,7 +30,7 @@ SUBROUTINE ICE4_RIMLTC(CST, PARAMI, KPROMA, KSIZE, LDCOMPUTE, & ! ------------ ! USE MODD_CST, ONLY: CST_t -USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK ! diff --git a/src/common/micro/mode_ice4_rrhong.F90 b/src/common/micro/mode_ice4_rrhong.F90 index ba318d1d69b7d5f1a11df9afed41818e92d57781..a7ade9ab088a5ecce6d1ae7de6c7f29b578690d9 100644 --- a/src/common/micro/mode_ice4_rrhong.F90 +++ b/src/common/micro/mode_ice4_rrhong.F90 @@ -29,8 +29,8 @@ SUBROUTINE ICE4_RRHONG(CST, PARAMI, ICED, KPROMA, KSIZE, LDCOMPUTE, & ! ------------ ! USE MODD_CST, ONLY: CST_t -USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK ! diff --git a/src/common/micro/mode_ice4_rsrimcg_old.F90 b/src/common/micro/mode_ice4_rsrimcg_old.F90 index a273dbd9441c356db8b744d40778a8a12945bd56..dde4a8311301052f4f4ceba816e87bbbdc76193f 100644 --- a/src/common/micro/mode_ice4_rsrimcg_old.F90 +++ b/src/common/micro/mode_ice4_rsrimcg_old.F90 @@ -31,9 +31,9 @@ SUBROUTINE ICE4_RSRIMCG_OLD(CST, PARAMI, ICEP, ICED, KPROMA, KSIZE, LDSOFT, LDCO ! ------------ ! USE MODD_CST, ONLY: CST_t -USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK ! diff --git a/src/common/micro/mode_ice4_sedimentation.F90 b/src/common/micro/mode_ice4_sedimentation.F90 index c110a81f1cdf5e8616d6b5d1fd52d14ab7948ddc..eddcadf26246a3e5c5da8734b407fc492ad01c08 100644 --- a/src/common/micro/mode_ice4_sedimentation.F90 +++ b/src/common/micro/mode_ice4_sedimentation.F90 @@ -37,9 +37,9 @@ USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_BUDGET, ONLY: TBUDGETDATA, TBUDGETCONF_t, NBUDGET_TH, NBUDGET_RV, NBUDGET_RC, & NBUDGET_RI, NBUDGET_RR, NBUDGET_RS, NBUDGET_RG, NBUDGET_RH USE MODD_CST, ONLY: CST_t -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t -USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t ! USE MODE_MSG, ONLY: PRINT_MSG, NVERB_FATAL USE MODE_BUDGET_PHY, ONLY: BUDGET_STORE_INIT_PHY, BUDGET_STORE_END_PHY diff --git a/src/common/micro/mode_ice4_sedimentation_split.F90 b/src/common/micro/mode_ice4_sedimentation_split.F90 index 6a10f8d398e3413573063b42bf29bfd77e908c69..83402d58a628da9f48122fd9f5a7b532c0dbb743 100644 --- a/src/common/micro/mode_ice4_sedimentation_split.F90 +++ b/src/common/micro/mode_ice4_sedimentation_split.F90 @@ -37,9 +37,9 @@ USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_CST, ONLY: CST_t -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t -USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t ! USE MODE_MSG, ONLY: PRINT_MSG, NVERB_FATAL ! @@ -279,9 +279,9 @@ SUBROUTINE INTERNAL_SEDIM_SPLI(D, CST, ICEP, ICED, PARAMI, KRR, & ! ------------ ! USE MODD_CST, ONLY: CST_t -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t -USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t ! IMPLICIT NONE ! diff --git a/src/common/micro/mode_ice4_sedimentation_stat.F90 b/src/common/micro/mode_ice4_sedimentation_stat.F90 index bf5a71b554dca4a76a0df8c346eb36cc865e6420..1c43850476aa65b8f3cb6564ef439f51543b8815 100644 --- a/src/common/micro/mode_ice4_sedimentation_stat.F90 +++ b/src/common/micro/mode_ice4_sedimentation_stat.F90 @@ -42,9 +42,9 @@ USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_CST, ONLY: CST_t -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t -USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t USE MODI_GAMMA, ONLY: GAMMA ! IMPLICIT NONE diff --git a/src/common/micro/mode_ice4_slow.F90 b/src/common/micro/mode_ice4_slow.F90 index 78aa35289b34904b586917b3c80d8428469cf587..cdf1e056e9cf988e7067363b76db7179719985e3 100644 --- a/src/common/micro/mode_ice4_slow.F90 +++ b/src/common/micro/mode_ice4_slow.F90 @@ -31,8 +31,8 @@ SUBROUTINE ICE4_SLOW(CST, ICEP, ICED, KPROMA, KSIZE, LDSOFT, LDCOMPUTE, PRHODREF ! ------------ ! USE MODD_CST, ONLY: CST_t -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK ! diff --git a/src/common/micro/mode_ice4_stepping.F90 b/src/common/micro/mode_ice4_stepping.F90 index b4879faa523564249664c799dee5384d6bf26c9c..6cb5d7421b0a7ab9c1e96bbfc1ce09d7044b6a3c 100644 --- a/src/common/micro/mode_ice4_stepping.F90 +++ b/src/common/micro/mode_ice4_stepping.F90 @@ -10,7 +10,6 @@ SUBROUTINE ICE4_STEPPING(D, CST, PARAMI, ICEP, ICED, BUCONF, & &LDSIGMA_RC, LDAUCV_ADJU, LDEXT_TEND, & &KPROMA, KMICRO, LDMICRO, PTSTEP, & &KRR, & - &HSUBG_AUCV_RC, HSUBG_AUCV_RI, & &PEXN, PRHODREF, K1, K2, & &PPRES, PCF, PSIGMA_RC, & &PCIT, & @@ -30,9 +29,9 @@ USE YOMHOOK , ONLY : LHOOK, DR_HOOK USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_BUDGET, ONLY: TBUDGETCONF_t USE MODD_CST, ONLY: CST_t -USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t USE MODD_FIELDS_ADDRESS, ONLY : & ! common fields adress & ITH, & ! Potential temperature & IRV, & ! Water vapor @@ -69,8 +68,6 @@ INTEGER, INTENT(IN) :: KMICRO ! Case r_x>0 locations LOGICAL, DIMENSION(KPROMA), INTENT(IN) :: LDMICRO REAL, INTENT(IN) :: PTSTEP ! Double Time step (single if cold start) INTEGER, INTENT(IN) :: KRR ! Number of moist variable -CHARACTER(LEN=4), INTENT(IN) :: HSUBG_AUCV_RC ! Kind of Subgrid autoconversion method -CHARACTER(LEN=80), INTENT(IN) :: HSUBG_AUCV_RI ! Kind of Subgrid autoconversion method ! REAL, DIMENSION(KPROMA), INTENT(IN) :: PEXN ! Exner function REAL, DIMENSION(KPROMA), INTENT(IN) :: PRHODREF! Reference density @@ -153,11 +150,11 @@ ENDIF !Maximum number of iterations !We only count real iterations (those for which we *compute* tendencies) -INB_ITER_MAX=PARAMI%NMAXITER +INB_ITER_MAX=PARAMI%NMAXITER_MICRO IF(PARAMI%XTSTEP_TS/=0.)THEN INB_ITER_MAX=MAX(1, INT(PTSTEP/PARAMI%XTSTEP_TS)) !At least the number of iterations needed for the time-splitting ZTSTEP=PTSTEP/INB_ITER_MAX - INB_ITER_MAX=MAX(PARAMI%NMAXITER, INB_ITER_MAX) !For the case XMRSTEP/=0. at the same time + INB_ITER_MAX=MAX(PARAMI%NMAXITER_MICRO, INB_ITER_MAX) !For the case XMRSTEP/=0. at the same time ENDIF IF (LDEXT_TEND) THEN @@ -242,7 +239,6 @@ DO WHILE(ANY(ZTIME(1:KMICRO)<PTSTEP)) ! Loop to *really* compute tendencies CALL ICE4_TENDENCIES(D, CST, PARAMI, ICEP, ICED, BUCONF, & &KPROMA, KMICRO, & &KRR, LSOFT, LLCOMPUTE, & - &HSUBG_AUCV_RC, HSUBG_AUCV_RI, & &PEXN, PRHODREF, ZLVFACT, ZLSFACT, K1, K2, & &PPRES, PCF, PSIGMA_RC, & &PCIT, & diff --git a/src/common/micro/mode_ice4_tendencies.F90 b/src/common/micro/mode_ice4_tendencies.F90 index 9fd4e80d874b90518b77ce7284caeeef02438cbf..6c93e484a50600e14ab8df288f7791da47b1c320 100644 --- a/src/common/micro/mode_ice4_tendencies.F90 +++ b/src/common/micro/mode_ice4_tendencies.F90 @@ -8,7 +8,6 @@ IMPLICIT NONE CONTAINS SUBROUTINE ICE4_TENDENCIES(D, CST, PARAMI, ICEP, ICED, BUCONF, KPROMA, KSIZE, & &KRR, ODSOFT, LDCOMPUTE, & - &HSUBG_AUCV_RC, HSUBG_AUCV_RI, & &PEXN, PRHODREF, PLVFACT, PLSFACT, K1, K2, & &PPRES, PCF, PSIGMA_RC, & &PCIT, & @@ -42,9 +41,9 @@ USE MODD_BUDGET, ONLY: TBUDGETCONF_t USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODE_MSG, ONLY: PRINT_MSG, NVERB_FATAL USE MODD_CST, ONLY: CST_t -USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t ! USE MODD_FIELDS_ADDRESS USE MODE_ICE4_RRHONG, ONLY: ICE4_RRHONG @@ -77,8 +76,6 @@ INTEGER, INTENT(IN) :: KPROMA, KSIZE INTEGER, INTENT(IN) :: KRR LOGICAL, INTENT(IN) :: ODSOFT LOGICAL, DIMENSION(KPROMA), INTENT(IN) :: LDCOMPUTE -CHARACTER(LEN=4), INTENT(IN) :: HSUBG_AUCV_RC -CHARACTER(LEN=80), INTENT(IN) :: HSUBG_AUCV_RI REAL, DIMENSION(KPROMA), INTENT(IN) :: PEXN REAL, DIMENSION(KPROMA), INTENT(IN) :: PRHODREF REAL, DIMENSION(KPROMA), INTENT(IN) :: PLVFACT @@ -240,7 +237,7 @@ ELSE ENDIF ! ODSOFT ! !Cloud water split between high and low content part is done here -CALL ICE4_COMPUTE_PDF(CST, ICEP, ICED, KSIZE, HSUBG_AUCV_RC, HSUBG_AUCV_RI, PARAMI%CSUBG_PR_PDF,& +CALL ICE4_COMPUTE_PDF(CST, ICEP, ICED, KSIZE, PARAMI%CSUBG_AUCV_RC, PARAMI%CSUBG_AUCV_RI, PARAMI%CSUBG_PR_PDF,& PRHODREF, ZVART(:,IRC), ZVART(:,IRI), PCF, ZT, PSIGMA_RC, & PHLC_HCF, PHLC_LCF, PHLC_HRC, PHLC_LRC, & PHLI_HCF, PHLI_LCF, PHLI_HRI, PHLI_LRI, ZRAINFR) diff --git a/src/common/micro/mode_ice4_warm.F90 b/src/common/micro/mode_ice4_warm.F90 index 317b57839b7f503e05bbde975eedec0c74713d54..ea37debb12964f114f89e1a7245cb3cd09488691 100644 --- a/src/common/micro/mode_ice4_warm.F90 +++ b/src/common/micro/mode_ice4_warm.F90 @@ -32,8 +32,8 @@ SUBROUTINE ICE4_WARM(CST, ICEP, ICED, KPROMA, KSIZE, LDSOFT, LDCOMPUTE, HSUBG_RC ! ------------ ! USE MODD_CST, ONLY: CST_t -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t ! USE MODE_MSG USE PARKIND1, ONLY : JPRB diff --git a/src/arome/micro/ini_rain_ice.F90 b/src/common/micro/mode_ini_rain_ice.F90 similarity index 82% rename from src/arome/micro/ini_rain_ice.F90 rename to src/common/micro/mode_ini_rain_ice.F90 index bae21e6770f6cda2fb4245c7ea34d6e74c2be3aa..cd274bb0a9776fed0dc0a7a0090fc3cbcec396ba 100644 --- a/src/arome/micro/ini_rain_ice.F90 +++ b/src/common/micro/mode_ini_rain_ice.F90 @@ -4,6 +4,8 @@ !MNH_LIC for details. version 1. !----------------------------------------------------------------- ! ######spl +MODULE MODE_INI_RAIN_ICE +CONTAINS SUBROUTINE INI_RAIN_ICE ( KLUOUT, PTSTEP, PDZMIN, KSPLITR, HCLOUD ) ! ########################################################### ! @@ -91,12 +93,11 @@ ! ------------ ! USE MODD_CST -USE MODD_LUNIT -USE MODD_PARAMETERS -USE MODD_PARAM_ICE -USE MODD_RAIN_ICE_DESCR -USE MODD_RAIN_ICE_PARAM - +USE MODD_PARAM_ICE_n, ONLY: LSNOW_T, CSEDIM, LRED, CPRISTINE_ICE, & + & LCRIAUTI, XACRIAUTI_NAM, XBCRIAUTI_NAM, XCRIAUTC_NAM, XCRIAUTI_NAM, XT0CRIAUTI_NAM, & + & XFRACM90, XFRMIN_NAM, XRDEPGRED_NAM, XRDEPSRED_NAM +USE MODD_RAIN_ICE_DESCR_n +USE MODD_RAIN_ICE_PARAM_n ! USE MODI_GAMMA USE MODI_GAMMA_INC @@ -133,8 +134,6 @@ CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! Indicator of the cloud scheme ! !* 0.2 Declarations of local variables : ! -INTEGER :: IKB ! Coordinates of the first physical - ! points along z INTEGER :: J1,J2 ! Internal loop indexes REAL :: ZT ! Work variable REAL :: ZVTRMAX ! Raindrop maximal fall velocity @@ -151,6 +150,8 @@ INTEGER :: IND ! Number of interval to integrate the kernels REAL :: ZESR ! Mean efficiency of rain-aggregate collection REAL :: ZFDINFTY ! Factor used to define the "infinite" diameter ! +REAL :: ZCRI0, ZTCRI0 ! Second point to determine 10**(aT+b) law of ri->rs autoconversion +! ! ! LOGICAL :: GFLAG ! Logical flag for printing the constatnts on the output @@ -181,8 +182,6 @@ REAL(KIND=JPRB) :: ZHOOK_HANDLE !------------------------------------------------------------------------------- IF (LHOOK) CALL DR_HOOK('INI_RAIN_ICE',0,ZHOOK_HANDLE) ! -IF(.NOT.ASSOCIATED(XCEXVT)) CALL RAIN_ICE_DESCR_ASSOCIATE() -IF(.NOT.ASSOCIATED(XFSEDC)) CALL RAIN_ICE_PARAM_ASSOCIATE() ! ! !* 0. FUNCTION STATEMENTS @@ -198,10 +197,10 @@ IF(.NOT.ASSOCIATED(XFSEDC)) CALL RAIN_ICE_PARAM_ASSOCIATE() ! !* 1.1 Set the hailstones maximum fall velocity ! -IF (CSEDIM == 'SPLI') THEN - IF (HCLOUD == 'OLD4') THEN +IF (CSEDIM == 'SPLI' .AND. .NOT. LRED) THEN + IF (HCLOUD == 'ICE4' .OR. HCLOUD=='LIMA') THEN ZVTRMAX = 40. - ELSE IF (HCLOUD == 'OLD3') THEN + ELSE IF (HCLOUD == 'ICE3') THEN ZVTRMAX = 10. END IF END IF @@ -209,7 +208,7 @@ END IF !* 1.2 Compute the number of small time step integration ! KSPLITR = 1 -IF (CSEDIM == 'SPLI' .AND. HCLOUD(1:3)=='OLD') THEN +IF (CSEDIM == 'SPLI' .AND. .NOT. LRED) THEN SPLIT : DO ZT = PTSTEP / REAL(KSPLITR) IF ( ZT * ZVTRMAX / PDZMIN .LT. 1.) EXIT SPLIT @@ -217,16 +216,9 @@ IF (CSEDIM == 'SPLI' .AND. HCLOUD(1:3)=='OLD') THEN END DO SPLIT END IF ! -IF (ASSOCIATED(XRTMIN)) THEN ! In case of nesting microphysics constants of - ! MODD_RAIN_ICE_PARAM are computed only once, - ! but if INI_RAIN_ICE has been called already - ! one must change the XRTMIN size. - CALL RAIN_ICE_DESCR_DEALLOCATE() -END IF -! -IF (HCLOUD == 'ICE4' .OR. HCLOUD == 'OLD4') THEN +IF (HCLOUD == 'ICE4' .OR. HCLOUD=='LIMA') THEN CALL RAIN_ICE_DESCR_ALLOCATE(7) -ELSE IF (HCLOUD == 'ICE3' .OR. HCLOUD == 'OLD3') THEN +ELSE IF (HCLOUD == 'ICE3') THEN CALL RAIN_ICE_DESCR_ALLOCATE(6) END IF ! @@ -236,7 +228,7 @@ XRTMIN(3) = 1.0E-20 XRTMIN(4) = 1.0E-20 XRTMIN(5) = 1.0E-15 XRTMIN(6) = 1.0E-15 -IF (HCLOUD == 'ICE4' .OR. HCLOUD == 'OLD4') XRTMIN(7) = 1.0E-15 +IF (HCLOUD == 'ICE4' .OR. HCLOUD=='LIMA') XRTMIN(7) = 1.0E-15 ! !------------------------------------------------------------------------------- ! @@ -469,8 +461,7 @@ XCONC_URBAN=5E8 ! 500/cm3 ! XCEXVT = 0.4 ! -IKB = 1 + JPVEXT -!ZRHO00 = XP00/(XRD*XTHVREFZ(IKB)) +!ZRHO00 = XP00/(XRD*XTHVREFZ(1+JPVEXT)) !According to Foote and Du Toit (1969) and List (1958), ZRHO00 must be computed for Hu=50%, P=101325Pa and T=293.15K ZE = (50./100.) * EXP(XALPW-XBETAW/293.15-XGAMW*LOG(293.15)) ZRV = (XRD/XRV) * ZE / (101325.-ZE) @@ -511,7 +502,7 @@ XEXSEDS = (XBS+XDS-XCXS)/(XBS-XCXS) XFSEDS = XCS*XAS*XCCS*MOMG(XALPHAS,XNUS,XBS+XDS)* & (XAS*XCCS*MOMG(XALPHAS,XNUS,XBS))**(-XEXSEDS)*(ZRHO00)**XCEXVT #else -IF (HCLOUD == 'ICE3' .OR. HCLOUD == 'ICE4') THEN +IF (LRED) THEN XEXSEDS = -XDS-XBS XFSEDS = XCS*MOMG(XALPHAS,XNUS,XBS+XDS)/(MOMG(XALPHAS,XNUS,XBS)) & *(ZRHO00)**XCEXVT @@ -604,13 +595,13 @@ X1DEPS = XNS*(4.0*XPI)*XC1S*XF1S*SQRT(XCS)*MOMG(XALPHAS,XNUS,0.5*XDS+1.5) XEX0DEPS = -1.0 XEX1DEPS = -0.5*(XDS+3.0) #endif -XRDEPSRED = 1.0 +XRDEPSRED = XRDEPSRED_NAM ! X0DEPG = (4.0*XPI)*XCCG*XC1G*XF0G*MOMG(XALPHAG,XNUG,1.) X1DEPG = (4.0*XPI)*XCCG*XC1G*XF1G*SQRT(XCG)*MOMG(XALPHAG,XNUG,0.5*XDG+1.5) XEX0DEPG = XCXG-1.0 XEX1DEPG = XCXG-0.5*(XDG+3.0) -XRDEPGRED = 1.0 +XRDEPGRED = XRDEPGRED_NAM ! X0DEPH = (4.0*XPI)*XCCH*XC1H*XF0H*MOMG(XALPHAH,XNUH,1.) X1DEPH = (4.0*XPI)*XCCH*XC1H*XF1H*SQRT(XCH)*MOMG(XALPHAH,XNUH,0.5*XDH+1.5) @@ -629,13 +620,20 @@ END IF ! XTIMAUTI = 1.E-3 ! Time constant at T=T_t XTEXAUTI = 0.015 ! Temperature factor of the I+I collection efficiency -!!XCRIAUTI = 0.25E-3 ! Critical ice content for the autoconversion to occur -XCRIAUTI = 0.2E-4 ! Critical ice content for the autoconversion to occur - ! Revised value by Chaboureau et al. (2001) -XACRIAUTI=0.06 -XBCRIAUTI=-3.5 -XT0CRIAUTI=(LOG10(XCRIAUTI)-XBCRIAUTI)/0.06 - +XCRIAUTI = XCRIAUTI_NAM +IF(LCRIAUTI) THEN + XT0CRIAUTI = XT0CRIAUTI_NAM + !second point to determine 10**(aT+b) law + ZTCRI0=-40.0 + ZCRI0=1.25E-6 + XBCRIAUTI=-( LOG10(XCRIAUTI) - LOG10(ZCRI0)*XT0CRIAUTI/ZTCRI0 )& + *ZTCRI0/(XT0CRIAUTI-ZTCRI0) + XACRIAUTI=(LOG10(ZCRI0)-XBCRIAUTI)/ZTCRI0 +ELSE + XACRIAUTI=XACRIAUTI_NAM + XBCRIAUTI=XBCRIAUTI_NAM + XT0CRIAUTI=(LOG10(XCRIAUTI)-XBCRIAUTI)/0.06 +ENDIF ! GFLAG = .TRUE. IF (GFLAG) THEN @@ -678,7 +676,7 @@ END IF !* 6.1 Constants for the cloud droplets autoconversion ! XTIMAUTC = 1.E-3 -XCRIAUTC = 0.5E-3 +XCRIAUTC = XCRIAUTC_NAM ! GFLAG = .TRUE. IF (GFLAG) THEN @@ -740,24 +738,24 @@ IF (GFLAG) THEN WRITE(UNIT=KLUOUT,FMT='(" Coll. efficiency XCOLCS=",E13.6)') XCOLCS END IF ! -RAIN_ICE_PARAM%NGAMINC = 80 -RAIN_ICE_PARAM%XGAMINC_BOUND_MIN = 1.0E-1 ! Minimal value of (Lbda * D_cs^lim)**alpha -RAIN_ICE_PARAM%XGAMINC_BOUND_MAX = 1.0E7 ! Maximal value of (Lbda * D_cs^lim)**alpha -ZRATE = EXP(LOG(RAIN_ICE_PARAM%XGAMINC_BOUND_MAX/RAIN_ICE_PARAM%XGAMINC_BOUND_MIN)/REAL(RAIN_ICE_PARAM%NGAMINC-1)) +RAIN_ICE_PARAMN%NGAMINC = 80 +RAIN_ICE_PARAMN%XGAMINC_BOUND_MIN = 1.0E-1 ! Minimal value of (Lbda * D_cs^lim)**alpha +RAIN_ICE_PARAMN%XGAMINC_BOUND_MAX = 1.0E7 ! Maximal value of (Lbda * D_cs^lim)**alpha +ZRATE = EXP(LOG(RAIN_ICE_PARAMN%XGAMINC_BOUND_MAX/RAIN_ICE_PARAMN%XGAMINC_BOUND_MIN)/REAL(RAIN_ICE_PARAMN%NGAMINC-1)) ! -IF( .NOT.ASSOCIATED(XGAMINC_RIM1) ) CALL RAIN_ICE_PARAM_ALLOCATE('XGAMINC_RIM1', RAIN_ICE_PARAM%NGAMINC) -IF( .NOT.ASSOCIATED(XGAMINC_RIM2) ) CALL RAIN_ICE_PARAM_ALLOCATE('XGAMINC_RIM2', RAIN_ICE_PARAM%NGAMINC) -IF( .NOT.ASSOCIATED(XGAMINC_RIM4) ) CALL RAIN_ICE_PARAM_ALLOCATE('XGAMINC_RIM4', RAIN_ICE_PARAM%NGAMINC) +IF( .NOT.ASSOCIATED(XGAMINC_RIM1) ) CALL RAIN_ICE_PARAM_ALLOCATE('XGAMINC_RIM1', RAIN_ICE_PARAMN%NGAMINC) +IF( .NOT.ASSOCIATED(XGAMINC_RIM2) ) CALL RAIN_ICE_PARAM_ALLOCATE('XGAMINC_RIM2', RAIN_ICE_PARAMN%NGAMINC) +IF( .NOT.ASSOCIATED(XGAMINC_RIM4) ) CALL RAIN_ICE_PARAM_ALLOCATE('XGAMINC_RIM4', RAIN_ICE_PARAMN%NGAMINC) ! -DO J1=1,RAIN_ICE_PARAM%NGAMINC - ZBOUND = RAIN_ICE_PARAM%XGAMINC_BOUND_MIN*ZRATE**(J1-1) +DO J1=1,RAIN_ICE_PARAMN%NGAMINC + ZBOUND = RAIN_ICE_PARAMN%XGAMINC_BOUND_MIN*ZRATE**(J1-1) XGAMINC_RIM1(J1) = GAMMA_INC(XNUS+(2.0+XDS)/XALPHAS,ZBOUND) XGAMINC_RIM2(J1) = GAMMA_INC(XNUS+XBS/XALPHAS ,ZBOUND) XGAMINC_RIM4(J1) = GAMMA_INC(XNUS+XBG/XALPHAS ,ZBOUND) END DO ! -RAIN_ICE_PARAM%XRIMINTP1 = XALPHAS / LOG(ZRATE) -RAIN_ICE_PARAM%XRIMINTP2 = 1.0 + RAIN_ICE_PARAM%XRIMINTP1*LOG( XDCSLIM/(RAIN_ICE_PARAM%XGAMINC_BOUND_MIN)**(1.0/XALPHAS) ) +RAIN_ICE_PARAMN%XRIMINTP1 = XALPHAS / LOG(ZRATE) +RAIN_ICE_PARAMN%XRIMINTP2 = 1.0 + RAIN_ICE_PARAMN%XRIMINTP1*LOG( XDCSLIM/(RAIN_ICE_PARAMN%XGAMINC_BOUND_MIN)**(1.0/XALPHAS) ) ! !* 7.2 Constants for the accretion of raindrops onto aggregates ! @@ -786,18 +784,18 @@ XLBSACCR3 = MOMG(XALPHAS,XNUS,XBS+2.) ! Notice: One magnitude of lambda discretized over 10 points for rain ! Notice: One magnitude of lambda discretized over 10 points for snow ! -RAIN_ICE_PARAM%NACCLBDAS = 40 -RAIN_ICE_PARAM%XACCLBDAS_MIN = 5.0E1 ! Minimal value of Lbda_s to tabulate XKER_RACCS -RAIN_ICE_PARAM%XACCLBDAS_MAX = 5.0E5 ! Maximal value of Lbda_s to tabulate XKER_RACCS -ZRATE = LOG(RAIN_ICE_PARAM%XACCLBDAS_MAX/RAIN_ICE_PARAM%XACCLBDAS_MIN)/REAL(RAIN_ICE_PARAM%NACCLBDAS-1) -RAIN_ICE_PARAM%XACCINTP1S = 1.0 / ZRATE -RAIN_ICE_PARAM%XACCINTP2S = 1.0 - LOG( RAIN_ICE_PARAM%XACCLBDAS_MIN ) / ZRATE -RAIN_ICE_PARAM%NACCLBDAR = 40 -RAIN_ICE_PARAM%XACCLBDAR_MIN = 1.0E3 ! Minimal value of Lbda_r to tabulate XKER_RACCS -RAIN_ICE_PARAM%XACCLBDAR_MAX = 1.0E7 ! Maximal value of Lbda_r to tabulate XKER_RACCS -ZRATE = LOG(RAIN_ICE_PARAM%XACCLBDAR_MAX/RAIN_ICE_PARAM%XACCLBDAR_MIN)/REAL(RAIN_ICE_PARAM%NACCLBDAR-1) -RAIN_ICE_PARAM%XACCINTP1R = 1.0 / ZRATE -RAIN_ICE_PARAM%XACCINTP2R = 1.0 - LOG( RAIN_ICE_PARAM%XACCLBDAR_MIN ) / ZRATE +RAIN_ICE_PARAMN%NACCLBDAS = 40 +RAIN_ICE_PARAMN%XACCLBDAS_MIN = 5.0E1 ! Minimal value of Lbda_s to tabulate XKER_RACCS +RAIN_ICE_PARAMN%XACCLBDAS_MAX = 5.0E5 ! Maximal value of Lbda_s to tabulate XKER_RACCS +ZRATE = LOG(RAIN_ICE_PARAMN%XACCLBDAS_MAX/RAIN_ICE_PARAMN%XACCLBDAS_MIN)/REAL(RAIN_ICE_PARAMN%NACCLBDAS-1) +RAIN_ICE_PARAMN%XACCINTP1S = 1.0 / ZRATE +RAIN_ICE_PARAMN%XACCINTP2S = 1.0 - LOG( RAIN_ICE_PARAMN%XACCLBDAS_MIN ) / ZRATE +RAIN_ICE_PARAMN%NACCLBDAR = 40 +RAIN_ICE_PARAMN%XACCLBDAR_MIN = 1.0E3 ! Minimal value of Lbda_r to tabulate XKER_RACCS +RAIN_ICE_PARAMN%XACCLBDAR_MAX = 1.0E7 ! Maximal value of Lbda_r to tabulate XKER_RACCS +ZRATE = LOG(RAIN_ICE_PARAMN%XACCLBDAR_MAX/RAIN_ICE_PARAMN%XACCLBDAR_MIN)/REAL(RAIN_ICE_PARAMN%NACCLBDAR-1) +RAIN_ICE_PARAMN%XACCINTP1R = 1.0 / ZRATE +RAIN_ICE_PARAMN%XACCINTP2R = 1.0 - LOG( RAIN_ICE_PARAMN%XACCLBDAR_MIN ) / ZRATE ! !* 7.2.2 Computations of the tabulated normalized kernels ! @@ -805,36 +803,36 @@ IND = 50 ! Interval number, collection efficiency and infinite diameter ZESR = 1.0 ! factor used to integrate the dimensional distributions when ZFDINFTY = 20.0 ! computing the kernels XKER_RACCSS, XKER_RACCS and XKER_SACCRG ! -IF( .NOT.ASSOCIATED(XKER_RACCSS) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_RACCSS', RAIN_ICE_PARAM%NACCLBDAS,RAIN_ICE_PARAM%NACCLBDAR) -IF( .NOT.ASSOCIATED(XKER_RACCS ) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_RACCS', RAIN_ICE_PARAM%NACCLBDAS,RAIN_ICE_PARAM%NACCLBDAR) -IF( .NOT.ASSOCIATED(XKER_SACCRG) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_SACCRG', RAIN_ICE_PARAM%NACCLBDAR,RAIN_ICE_PARAM%NACCLBDAS) +IF( .NOT.ASSOCIATED(XKER_RACCSS) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_RACCSS', RAIN_ICE_PARAMN%NACCLBDAS,RAIN_ICE_PARAMN%NACCLBDAR) +IF( .NOT.ASSOCIATED(XKER_RACCS ) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_RACCS', RAIN_ICE_PARAMN%NACCLBDAS,RAIN_ICE_PARAMN%NACCLBDAR) +IF( .NOT.ASSOCIATED(XKER_SACCRG) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_SACCRG', RAIN_ICE_PARAMN%NACCLBDAR,RAIN_ICE_PARAMN%NACCLBDAS) ! CALL READ_XKER_RACCS (KACCLBDAS,KACCLBDAR,KND, & PALPHAS,PNUS,PALPHAR,PNUR,PESR,PBS,PBR,PCS,PDS,PFVELOS,PCR,PDR, & PACCLBDAS_MAX,PACCLBDAR_MAX,PACCLBDAS_MIN,PACCLBDAR_MIN, & PFDINFTY ) -IF( (KACCLBDAS/=RAIN_ICE_PARAM%NACCLBDAS) .OR. (KACCLBDAR/=RAIN_ICE_PARAM%NACCLBDAR) .OR. (KND/=IND) .OR. & +IF( (KACCLBDAS/=RAIN_ICE_PARAMN%NACCLBDAS) .OR. (KACCLBDAR/=RAIN_ICE_PARAMN%NACCLBDAR) .OR. (KND/=IND) .OR. & (PALPHAS/=XALPHAS) .OR. (PNUS/=XNUS) .OR. & (PALPHAR/=XALPHAR) .OR. (PNUR/=XNUR) .OR. & (PESR/=ZESR) .OR. (PBS/=XBS) .OR. (PBR/=XBR) .OR. & (PCS/=XCS) .OR. (PDS/=XDS) .OR. (PFVELOS/=XFVELOS) .OR. (PCR/=XCR) .OR. (PDR/=XDR) .OR. & - (PACCLBDAS_MAX/=RAIN_ICE_PARAM%XACCLBDAS_MAX) .OR. (PACCLBDAR_MAX/=RAIN_ICE_PARAM%XACCLBDAR_MAX) .OR. & - (PACCLBDAS_MIN/=RAIN_ICE_PARAM%XACCLBDAS_MIN) .OR. (PACCLBDAR_MIN/=RAIN_ICE_PARAM%XACCLBDAR_MIN) .OR. & + (PACCLBDAS_MAX/=RAIN_ICE_PARAMN%XACCLBDAS_MAX) .OR. (PACCLBDAR_MAX/=RAIN_ICE_PARAMN%XACCLBDAR_MAX) .OR. & + (PACCLBDAS_MIN/=RAIN_ICE_PARAMN%XACCLBDAS_MIN) .OR. (PACCLBDAR_MIN/=RAIN_ICE_PARAMN%XACCLBDAR_MIN) .OR. & (PFDINFTY/=ZFDINFTY) ) THEN CALL RRCOLSS ( IND, XALPHAS, XNUS, XALPHAR, XNUR, & ZESR, XBR, XCS, XDS, XFVELOS, XCR, XDR, & - RAIN_ICE_PARAM%XACCLBDAS_MAX, RAIN_ICE_PARAM%XACCLBDAR_MAX, & - RAIN_ICE_PARAM%XACCLBDAS_MIN, RAIN_ICE_PARAM%XACCLBDAR_MIN, & + RAIN_ICE_PARAMN%XACCLBDAS_MAX, RAIN_ICE_PARAMN%XACCLBDAR_MAX, & + RAIN_ICE_PARAMN%XACCLBDAS_MIN, RAIN_ICE_PARAMN%XACCLBDAR_MIN, & ZFDINFTY, XKER_RACCSS, XAG, XBS, XAS ) CALL RZCOLX ( IND, XALPHAS, XNUS, XALPHAR, XNUR, & ZESR, XBR, XCS, XDS, XFVELOS, XCR, XDR, 0., & - RAIN_ICE_PARAM%XACCLBDAS_MAX, RAIN_ICE_PARAM%XACCLBDAR_MAX, & - RAIN_ICE_PARAM%XACCLBDAS_MIN, RAIN_ICE_PARAM%XACCLBDAR_MIN, & + RAIN_ICE_PARAMN%XACCLBDAS_MAX, RAIN_ICE_PARAMN%XACCLBDAR_MAX, & + RAIN_ICE_PARAMN%XACCLBDAS_MIN, RAIN_ICE_PARAMN%XACCLBDAR_MIN, & ZFDINFTY, XKER_RACCS ) CALL RSCOLRG ( IND, XALPHAS, XNUS, XALPHAR, XNUR, & ZESR, XBS, XCS, XDS, XFVELOS, XCR, XDR, & - RAIN_ICE_PARAM%XACCLBDAS_MAX, RAIN_ICE_PARAM%XACCLBDAR_MAX, & - RAIN_ICE_PARAM%XACCLBDAS_MIN, RAIN_ICE_PARAM%XACCLBDAR_MIN, & + RAIN_ICE_PARAMN%XACCLBDAS_MAX, RAIN_ICE_PARAMN%XACCLBDAR_MAX, & + RAIN_ICE_PARAMN%XACCLBDAS_MIN, RAIN_ICE_PARAMN%XACCLBDAR_MIN, & ZFDINFTY, XKER_SACCRG, XAG, XBS, XAS ) WRITE(UNIT=KLUOUT,FMT='("*****************************************")') WRITE(UNIT=KLUOUT,FMT='("**** UPDATE NEW SET OF RACSS KERNELS ****")') @@ -843,8 +841,8 @@ IF( (KACCLBDAS/=RAIN_ICE_PARAM%NACCLBDAS) .OR. (KACCLBDAR/=RAIN_ICE_PARAM%NACCLB WRITE(UNIT=KLUOUT,FMT='("*****************************************")') WRITE(UNIT=KLUOUT,FMT='("!")') WRITE(UNIT=KLUOUT,FMT='("KND=",I3)') IND - WRITE(UNIT=KLUOUT,FMT='("KACCLBDAS=",I3)') RAIN_ICE_PARAM%NACCLBDAS - WRITE(UNIT=KLUOUT,FMT='("KACCLBDAR=",I3)') RAIN_ICE_PARAM%NACCLBDAR + WRITE(UNIT=KLUOUT,FMT='("KACCLBDAS=",I3)') RAIN_ICE_PARAMN%NACCLBDAS + WRITE(UNIT=KLUOUT,FMT='("KACCLBDAR=",I3)') RAIN_ICE_PARAMN%NACCLBDAR WRITE(UNIT=KLUOUT,FMT='("PALPHAS=",E13.6)') XALPHAS WRITE(UNIT=KLUOUT,FMT='("PNUS=",E13.6)') XNUS WRITE(UNIT=KLUOUT,FMT='("PALPHAR=",E13.6)') XALPHAR @@ -858,18 +856,18 @@ IF( (KACCLBDAS/=RAIN_ICE_PARAM%NACCLBDAS) .OR. (KACCLBDAR/=RAIN_ICE_PARAM%NACCLB WRITE(UNIT=KLUOUT,FMT='("PCR=",E13.6)') XCR WRITE(UNIT=KLUOUT,FMT='("PDR=",E13.6)') XDR WRITE(UNIT=KLUOUT,FMT='("PACCLBDAS_MAX=",E13.6)') & - RAIN_ICE_PARAM%XACCLBDAS_MAX + RAIN_ICE_PARAMN%XACCLBDAS_MAX WRITE(UNIT=KLUOUT,FMT='("PACCLBDAR_MAX=",E13.6)') & - RAIN_ICE_PARAM%XACCLBDAR_MAX + RAIN_ICE_PARAMN%XACCLBDAR_MAX WRITE(UNIT=KLUOUT,FMT='("PACCLBDAS_MIN=",E13.6)') & - RAIN_ICE_PARAM%XACCLBDAS_MIN + RAIN_ICE_PARAMN%XACCLBDAS_MIN WRITE(UNIT=KLUOUT,FMT='("PACCLBDAR_MIN=",E13.6)') & - RAIN_ICE_PARAM%XACCLBDAR_MIN + RAIN_ICE_PARAMN%XACCLBDAR_MIN WRITE(UNIT=KLUOUT,FMT='("PFDINFTY=",E13.6)') ZFDINFTY WRITE(UNIT=KLUOUT,FMT='("!")') WRITE(UNIT=KLUOUT,FMT='("IF( PRESENT(PKER_RACCSS) ) THEN")') - DO J1 = 1 , RAIN_ICE_PARAM%NACCLBDAS - DO J2 = 1 , RAIN_ICE_PARAM%NACCLBDAR + DO J1 = 1 , RAIN_ICE_PARAMN%NACCLBDAS + DO J2 = 1 , RAIN_ICE_PARAMN%NACCLBDAR WRITE(UNIT=KLUOUT,FMT='(" PKER_RACCSS(",I3,",",I3,") = ",E13.6)') & J1,J2,XKER_RACCSS(J1,J2) END DO @@ -877,8 +875,8 @@ IF( (KACCLBDAS/=RAIN_ICE_PARAM%NACCLBDAS) .OR. (KACCLBDAR/=RAIN_ICE_PARAM%NACCLB WRITE(UNIT=KLUOUT,FMT='("END IF")') WRITE(UNIT=KLUOUT,FMT='("!")') WRITE(UNIT=KLUOUT,FMT='("IF( PRESENT(PKER_RACCS ) ) THEN")') - DO J1 = 1 , RAIN_ICE_PARAM%NACCLBDAS - DO J2 = 1 , RAIN_ICE_PARAM%NACCLBDAR + DO J1 = 1 , RAIN_ICE_PARAMN%NACCLBDAS + DO J2 = 1 , RAIN_ICE_PARAMN%NACCLBDAR WRITE(UNIT=KLUOUT,FMT='(" PKER_RACCS (",I3,",",I3,") = ",E13.6)') & J1,J2,XKER_RACCS (J1,J2) END DO @@ -886,8 +884,8 @@ IF( (KACCLBDAS/=RAIN_ICE_PARAM%NACCLBDAS) .OR. (KACCLBDAR/=RAIN_ICE_PARAM%NACCLB WRITE(UNIT=KLUOUT,FMT='("END IF")') WRITE(UNIT=KLUOUT,FMT='("!")') WRITE(UNIT=KLUOUT,FMT='("IF( PRESENT(PKER_SACCRG) ) THEN")') - DO J1 = 1 , RAIN_ICE_PARAM%NACCLBDAR - DO J2 = 1 , RAIN_ICE_PARAM%NACCLBDAS + DO J1 = 1 , RAIN_ICE_PARAMN%NACCLBDAR + DO J2 = 1 , RAIN_ICE_PARAMN%NACCLBDAS WRITE(UNIT=KLUOUT,FMT='(" PKER_SACCRG(",I3,",",I3,") = ",E13.6)') & J1,J2,XKER_SACCRG(J1,J2) END DO @@ -998,24 +996,24 @@ XLBRDRYG3 = MOMG(XALPHAR,XNUR,5.) ! ! Notice: One magnitude of lambda discretized over 10 points ! -RAIN_ICE_PARAM%NDRYLBDAR = 40 -RAIN_ICE_PARAM%XDRYLBDAR_MIN = 1.0E3 ! Minimal value of Lbda_r to tabulate XKER_RDRYG -RAIN_ICE_PARAM%XDRYLBDAR_MAX = 1.0E7 ! Maximal value of Lbda_r to tabulate XKER_RDRYG -ZRATE = LOG(RAIN_ICE_PARAM%XDRYLBDAR_MAX/RAIN_ICE_PARAM%XDRYLBDAR_MIN)/REAL(RAIN_ICE_PARAM%NDRYLBDAR-1) -RAIN_ICE_PARAM%XDRYINTP1R = 1.0 / ZRATE -RAIN_ICE_PARAM%XDRYINTP2R = 1.0 - LOG( RAIN_ICE_PARAM%XDRYLBDAR_MIN ) / ZRATE -RAIN_ICE_PARAM%NDRYLBDAS = 80 -RAIN_ICE_PARAM%XDRYLBDAS_MIN = 2.5E1 ! Minimal value of Lbda_s to tabulate XKER_SDRYG -RAIN_ICE_PARAM%XDRYLBDAS_MAX = 2.5E9 ! Maximal value of Lbda_s to tabulate XKER_SDRYG -ZRATE = LOG(RAIN_ICE_PARAM%XDRYLBDAS_MAX/RAIN_ICE_PARAM%XDRYLBDAS_MIN)/REAL(RAIN_ICE_PARAM%NDRYLBDAS-1) -RAIN_ICE_PARAM%XDRYINTP1S = 1.0 / ZRATE -RAIN_ICE_PARAM%XDRYINTP2S = 1.0 - LOG( RAIN_ICE_PARAM%XDRYLBDAS_MIN ) / ZRATE -RAIN_ICE_PARAM%NDRYLBDAG = 40 -RAIN_ICE_PARAM%XDRYLBDAG_MIN = 1.0E3 ! Min value of Lbda_g to tabulate XKER_SDRYG,XKER_RDRYG -RAIN_ICE_PARAM%XDRYLBDAG_MAX = 1.0E7 ! Max value of Lbda_g to tabulate XKER_SDRYG,XKER_RDRYG -ZRATE = LOG(RAIN_ICE_PARAM%XDRYLBDAG_MAX/RAIN_ICE_PARAM%XDRYLBDAG_MIN)/REAL(RAIN_ICE_PARAM%NDRYLBDAG-1) -RAIN_ICE_PARAM%XDRYINTP1G = 1.0 / ZRATE -RAIN_ICE_PARAM%XDRYINTP2G = 1.0 - LOG( RAIN_ICE_PARAM%XDRYLBDAG_MIN ) / ZRATE +RAIN_ICE_PARAMN%NDRYLBDAR = 40 +RAIN_ICE_PARAMN%XDRYLBDAR_MIN = 1.0E3 ! Minimal value of Lbda_r to tabulate XKER_RDRYG +RAIN_ICE_PARAMN%XDRYLBDAR_MAX = 1.0E7 ! Maximal value of Lbda_r to tabulate XKER_RDRYG +ZRATE = LOG(RAIN_ICE_PARAMN%XDRYLBDAR_MAX/RAIN_ICE_PARAMN%XDRYLBDAR_MIN)/REAL(RAIN_ICE_PARAMN%NDRYLBDAR-1) +RAIN_ICE_PARAMN%XDRYINTP1R = 1.0 / ZRATE +RAIN_ICE_PARAMN%XDRYINTP2R = 1.0 - LOG( RAIN_ICE_PARAMN%XDRYLBDAR_MIN ) / ZRATE +RAIN_ICE_PARAMN%NDRYLBDAS = 80 +RAIN_ICE_PARAMN%XDRYLBDAS_MIN = 2.5E1 ! Minimal value of Lbda_s to tabulate XKER_SDRYG +RAIN_ICE_PARAMN%XDRYLBDAS_MAX = 2.5E9 ! Maximal value of Lbda_s to tabulate XKER_SDRYG +ZRATE = LOG(RAIN_ICE_PARAMN%XDRYLBDAS_MAX/RAIN_ICE_PARAMN%XDRYLBDAS_MIN)/REAL(RAIN_ICE_PARAMN%NDRYLBDAS-1) +RAIN_ICE_PARAMN%XDRYINTP1S = 1.0 / ZRATE +RAIN_ICE_PARAMN%XDRYINTP2S = 1.0 - LOG( RAIN_ICE_PARAMN%XDRYLBDAS_MIN ) / ZRATE +RAIN_ICE_PARAMN%NDRYLBDAG = 40 +RAIN_ICE_PARAMN%XDRYLBDAG_MIN = 1.0E3 ! Min value of Lbda_g to tabulate XKER_SDRYG,XKER_RDRYG +RAIN_ICE_PARAMN%XDRYLBDAG_MAX = 1.0E7 ! Max value of Lbda_g to tabulate XKER_SDRYG,XKER_RDRYG +ZRATE = LOG(RAIN_ICE_PARAMN%XDRYLBDAG_MAX/RAIN_ICE_PARAMN%XDRYLBDAG_MIN)/REAL(RAIN_ICE_PARAMN%NDRYLBDAG-1) +RAIN_ICE_PARAMN%XDRYINTP1G = 1.0 / ZRATE +RAIN_ICE_PARAMN%XDRYINTP2G = 1.0 - LOG( RAIN_ICE_PARAMN%XDRYLBDAG_MIN ) / ZRATE ! !* 8.2.5 Computations of the tabulated normalized kernels ! @@ -1023,32 +1021,32 @@ IND = 50 ! Interval number, collection efficiency and infinite diameter ZEGS = 1.0 ! factor used to integrate the dimensional distributions when ZFDINFTY = 20.0 ! computing the kernels XKER_SDRYG ! -IF( .NOT.ASSOCIATED(XKER_SDRYG) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_SDRYG', RAIN_ICE_PARAM%NDRYLBDAG,RAIN_ICE_PARAM%NDRYLBDAS) +IF( .NOT.ASSOCIATED(XKER_SDRYG) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_SDRYG', RAIN_ICE_PARAMN%NDRYLBDAG,RAIN_ICE_PARAMN%NDRYLBDAS) ! CALL READ_XKER_SDRYG (KDRYLBDAG,KDRYLBDAS,KND, & PALPHAG,PNUG,PALPHAS,PNUS,PEGS,PBS,PCG,PDG,PCS,PDS,PFVELOS, & PDRYLBDAG_MAX,PDRYLBDAS_MAX,PDRYLBDAG_MIN,PDRYLBDAS_MIN, & PFDINFTY ) -IF( (KDRYLBDAG/=RAIN_ICE_PARAM%NDRYLBDAG) .OR. (KDRYLBDAS/=RAIN_ICE_PARAM%NDRYLBDAS) .OR. (KND/=IND) .OR. & +IF( (KDRYLBDAG/=RAIN_ICE_PARAMN%NDRYLBDAG) .OR. (KDRYLBDAS/=RAIN_ICE_PARAMN%NDRYLBDAS) .OR. (KND/=IND) .OR. & (PALPHAG/=XALPHAG) .OR. (PNUG/=XNUG) .OR. & (PALPHAS/=XALPHAS) .OR. (PNUS/=XNUS) .OR. & (PEGS/=ZEGS) .OR. (PBS/=XBS) .OR. & (PCG/=XCG) .OR. (PDG/=XDG) .OR. (PCS/=XCS) .OR. (PDS/=XDS) .OR. (PFVELOS/=XFVELOS) .OR. & - (PDRYLBDAG_MAX/=RAIN_ICE_PARAM%XDRYLBDAG_MAX) .OR. (PDRYLBDAS_MAX/=RAIN_ICE_PARAM%XDRYLBDAS_MAX) .OR. & - (PDRYLBDAG_MIN/=RAIN_ICE_PARAM%XDRYLBDAG_MIN) .OR. (PDRYLBDAS_MIN/=RAIN_ICE_PARAM%XDRYLBDAS_MIN) .OR. & + (PDRYLBDAG_MAX/=RAIN_ICE_PARAMN%XDRYLBDAG_MAX) .OR. (PDRYLBDAS_MAX/=RAIN_ICE_PARAMN%XDRYLBDAS_MAX) .OR. & + (PDRYLBDAG_MIN/=RAIN_ICE_PARAMN%XDRYLBDAG_MIN) .OR. (PDRYLBDAS_MIN/=RAIN_ICE_PARAMN%XDRYLBDAS_MIN) .OR. & (PFDINFTY/=ZFDINFTY) ) THEN CALL RZCOLX ( IND, XALPHAG, XNUG, XALPHAS, XNUS, & ZEGS, XBS, XCG, XDG, 0., XCS, XDS, XFVELOS, & - RAIN_ICE_PARAM%XDRYLBDAG_MAX, RAIN_ICE_PARAM%XDRYLBDAS_MAX, & - RAIN_ICE_PARAM%XDRYLBDAG_MIN, RAIN_ICE_PARAM%XDRYLBDAS_MIN, & + RAIN_ICE_PARAMN%XDRYLBDAG_MAX, RAIN_ICE_PARAMN%XDRYLBDAS_MAX, & + RAIN_ICE_PARAMN%XDRYLBDAG_MIN, RAIN_ICE_PARAMN%XDRYLBDAS_MIN, & ZFDINFTY, XKER_SDRYG ) WRITE(UNIT=KLUOUT,FMT='("*****************************************")') WRITE(UNIT=KLUOUT,FMT='("**** UPDATE NEW SET OF SDRYG KERNELS ****")') WRITE(UNIT=KLUOUT,FMT='("*****************************************")') WRITE(UNIT=KLUOUT,FMT='("!")') WRITE(UNIT=KLUOUT,FMT='("KND=",I3)') IND - WRITE(UNIT=KLUOUT,FMT='("KDRYLBDAG=",I3)') RAIN_ICE_PARAM%NDRYLBDAG - WRITE(UNIT=KLUOUT,FMT='("KDRYLBDAS=",I3)') RAIN_ICE_PARAM%NDRYLBDAS + WRITE(UNIT=KLUOUT,FMT='("KDRYLBDAG=",I3)') RAIN_ICE_PARAMN%NDRYLBDAG + WRITE(UNIT=KLUOUT,FMT='("KDRYLBDAS=",I3)') RAIN_ICE_PARAMN%NDRYLBDAS WRITE(UNIT=KLUOUT,FMT='("PALPHAG=",E13.6)') XALPHAG WRITE(UNIT=KLUOUT,FMT='("PNUG=",E13.6)') XNUG WRITE(UNIT=KLUOUT,FMT='("PALPHAS=",E13.6)') XALPHAS @@ -1061,18 +1059,18 @@ IF( (KDRYLBDAG/=RAIN_ICE_PARAM%NDRYLBDAG) .OR. (KDRYLBDAS/=RAIN_ICE_PARAM%NDRYLB WRITE(UNIT=KLUOUT,FMT='("PDS=",E13.6)') XDS WRITE(UNIT=KLUOUT,FMT='("PFVELOS=",E13.6)') XFVELOS WRITE(UNIT=KLUOUT,FMT='("PDRYLBDAG_MAX=",E13.6)') & - RAIN_ICE_PARAM%XDRYLBDAG_MAX + RAIN_ICE_PARAMN%XDRYLBDAG_MAX WRITE(UNIT=KLUOUT,FMT='("PDRYLBDAS_MAX=",E13.6)') & - RAIN_ICE_PARAM%XDRYLBDAS_MAX + RAIN_ICE_PARAMN%XDRYLBDAS_MAX WRITE(UNIT=KLUOUT,FMT='("PDRYLBDAG_MIN=",E13.6)') & - RAIN_ICE_PARAM%XDRYLBDAG_MIN + RAIN_ICE_PARAMN%XDRYLBDAG_MIN WRITE(UNIT=KLUOUT,FMT='("PDRYLBDAS_MIN=",E13.6)') & - RAIN_ICE_PARAM%XDRYLBDAS_MIN + RAIN_ICE_PARAMN%XDRYLBDAS_MIN WRITE(UNIT=KLUOUT,FMT='("PFDINFTY=",E13.6)') ZFDINFTY WRITE(UNIT=KLUOUT,FMT='("!")') WRITE(UNIT=KLUOUT,FMT='("IF( PRESENT(PKER_SDRYG) ) THEN")') - DO J1 = 1 , RAIN_ICE_PARAM%NDRYLBDAG - DO J2 = 1 , RAIN_ICE_PARAM%NDRYLBDAS + DO J1 = 1 , RAIN_ICE_PARAMN%NDRYLBDAG + DO J2 = 1 , RAIN_ICE_PARAMN%NDRYLBDAS WRITE(UNIT=KLUOUT,FMT='("PKER_SDRYG(",I3,",",I3,") = ",E13.6)') & J1,J2,XKER_SDRYG(J1,J2) END DO @@ -1091,32 +1089,32 @@ IND = 50 ! Number of interval used to integrate the dimensional ZEGR = 1.0 ! distributions when computing the kernel XKER_RDRYG ZFDINFTY = 20.0 ! -IF( .NOT.ASSOCIATED(XKER_RDRYG) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_RDRYG', RAIN_ICE_PARAM%NDRYLBDAG,RAIN_ICE_PARAM%NDRYLBDAR) +IF( .NOT.ASSOCIATED(XKER_RDRYG) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_RDRYG', RAIN_ICE_PARAMN%NDRYLBDAG,RAIN_ICE_PARAMN%NDRYLBDAR) ! CALL READ_XKER_RDRYG (KDRYLBDAG,KDRYLBDAR,KND, & PALPHAG,PNUG,PALPHAR,PNUR,PEGR,PBR,PCG,PDG,PCR,PDR, & PDRYLBDAG_MAX,PDRYLBDAR_MAX,PDRYLBDAG_MIN,PDRYLBDAR_MIN, & PFDINFTY ) -IF( (KDRYLBDAG/=RAIN_ICE_PARAM%NDRYLBDAG) .OR. (KDRYLBDAR/=RAIN_ICE_PARAM%NDRYLBDAR) .OR. (KND/=IND) .OR. & +IF( (KDRYLBDAG/=RAIN_ICE_PARAMN%NDRYLBDAG) .OR. (KDRYLBDAR/=RAIN_ICE_PARAMN%NDRYLBDAR) .OR. (KND/=IND) .OR. & (PALPHAG/=XALPHAG) .OR. (PNUG/=XNUG) .OR. & (PALPHAR/=XALPHAR) .OR. (PNUR/=XNUR) .OR. & (PEGR/=ZEGR) .OR. (PBR/=XBR) .OR. & (PCG/=XCG) .OR. (PDG/=XDG) .OR. (PCR/=XCR) .OR. (PDR/=XDR) .OR. & - (PDRYLBDAG_MAX/=RAIN_ICE_PARAM%XDRYLBDAG_MAX) .OR. (PDRYLBDAR_MAX/=RAIN_ICE_PARAM%XDRYLBDAR_MAX) .OR. & - (PDRYLBDAG_MIN/=RAIN_ICE_PARAM%XDRYLBDAG_MIN) .OR. (PDRYLBDAR_MIN/=RAIN_ICE_PARAM%XDRYLBDAR_MIN) .OR. & + (PDRYLBDAG_MAX/=RAIN_ICE_PARAMN%XDRYLBDAG_MAX) .OR. (PDRYLBDAR_MAX/=RAIN_ICE_PARAMN%XDRYLBDAR_MAX) .OR. & + (PDRYLBDAG_MIN/=RAIN_ICE_PARAMN%XDRYLBDAG_MIN) .OR. (PDRYLBDAR_MIN/=RAIN_ICE_PARAMN%XDRYLBDAR_MIN) .OR. & (PFDINFTY/=ZFDINFTY) ) THEN CALL RZCOLX ( IND, XALPHAG, XNUG, XALPHAR, XNUR, & ZEGR, XBR, XCG, XDG, 0., XCR, XDR, 0., & - RAIN_ICE_PARAM%XDRYLBDAG_MAX, RAIN_ICE_PARAM%XDRYLBDAR_MAX, & - RAIN_ICE_PARAM%XDRYLBDAG_MIN, RAIN_ICE_PARAM%XDRYLBDAR_MIN, & + RAIN_ICE_PARAMN%XDRYLBDAG_MAX, RAIN_ICE_PARAMN%XDRYLBDAR_MAX, & + RAIN_ICE_PARAMN%XDRYLBDAG_MIN, RAIN_ICE_PARAMN%XDRYLBDAR_MIN, & ZFDINFTY, XKER_RDRYG ) WRITE(UNIT=KLUOUT,FMT='("*****************************************")') WRITE(UNIT=KLUOUT,FMT='("**** UPDATE NEW SET OF RDRYG KERNELS ****")') WRITE(UNIT=KLUOUT,FMT='("*****************************************")') WRITE(UNIT=KLUOUT,FMT='("!")') WRITE(UNIT=KLUOUT,FMT='("KND=",I3)') IND - WRITE(UNIT=KLUOUT,FMT='("KDRYLBDAG=",I3)') RAIN_ICE_PARAM%NDRYLBDAG - WRITE(UNIT=KLUOUT,FMT='("KDRYLBDAR=",I3)') RAIN_ICE_PARAM%NDRYLBDAR + WRITE(UNIT=KLUOUT,FMT='("KDRYLBDAG=",I3)') RAIN_ICE_PARAMN%NDRYLBDAG + WRITE(UNIT=KLUOUT,FMT='("KDRYLBDAR=",I3)') RAIN_ICE_PARAMN%NDRYLBDAR WRITE(UNIT=KLUOUT,FMT='("PALPHAG=",E13.6)') XALPHAG WRITE(UNIT=KLUOUT,FMT='("PNUG=",E13.6)') XNUG WRITE(UNIT=KLUOUT,FMT='("PALPHAR=",E13.6)') XALPHAR @@ -1128,18 +1126,18 @@ IF( (KDRYLBDAG/=RAIN_ICE_PARAM%NDRYLBDAG) .OR. (KDRYLBDAR/=RAIN_ICE_PARAM%NDRYLB WRITE(UNIT=KLUOUT,FMT='("PCR=",E13.6)') XCR WRITE(UNIT=KLUOUT,FMT='("PDR=",E13.6)') XDR WRITE(UNIT=KLUOUT,FMT='("PDRYLBDAG_MAX=",E13.6)') & - RAIN_ICE_PARAM%XDRYLBDAG_MAX + RAIN_ICE_PARAMN%XDRYLBDAG_MAX WRITE(UNIT=KLUOUT,FMT='("PDRYLBDAR_MAX=",E13.6)') & - RAIN_ICE_PARAM%XDRYLBDAR_MAX + RAIN_ICE_PARAMN%XDRYLBDAR_MAX WRITE(UNIT=KLUOUT,FMT='("PDRYLBDAG_MIN=",E13.6)') & - RAIN_ICE_PARAM%XDRYLBDAG_MIN + RAIN_ICE_PARAMN%XDRYLBDAG_MIN WRITE(UNIT=KLUOUT,FMT='("PDRYLBDAR_MIN=",E13.6)') & - RAIN_ICE_PARAM%XDRYLBDAR_MIN + RAIN_ICE_PARAMN%XDRYLBDAR_MIN WRITE(UNIT=KLUOUT,FMT='("PFDINFTY=",E13.6)') ZFDINFTY WRITE(UNIT=KLUOUT,FMT='("!")') WRITE(UNIT=KLUOUT,FMT='("IF( PRESENT(PKER_RDRYG) ) THEN")') - DO J1 = 1 , RAIN_ICE_PARAM%NDRYLBDAG - DO J2 = 1 , RAIN_ICE_PARAM%NDRYLBDAR + DO J1 = 1 , RAIN_ICE_PARAMN%NDRYLBDAG + DO J2 = 1 , RAIN_ICE_PARAMN%NDRYLBDAR WRITE(UNIT=KLUOUT,FMT='("PKER_RDRYG(",I3,",",I3,") = ",E13.6)') & J1,J2,XKER_RDRYG(J1,J2) END DO @@ -1156,22 +1154,7 @@ END IF ! 8.2.6 Constants for possible modifying some processes related to ! graupeln in XFRMIN(1:8), IN - concentration in XFRMIN(9) and Kogan ! autoconversion in XFRMIN(10:11). May be used for e.g. ensemble spread - XFRMIN(1:6)=0. - XFRMIN(7:9)=1. - XFRMIN(10) =10. - XFRMIN(11) =1. - XFRMIN(12) =100. !0 in suparar - XFRMIN(13) =1.0E-15 - XFRMIN(14) =120. - XFRMIN(15) =1.0E-4 - XFRMIN(16:20)=0. - XFRMIN(21:22)=1. - XFRMIN(23)=0.5 - XFRMIN(24)=1.5 - XFRMIN(25)=30. - XFRMIN(26:38)=0. - XFRMIN(39)=0.25 - XFRMIN(40)=0.15 + XFRMIN=XFRMIN_NAM ! ! !------------------------------------------------------------------------------- @@ -1223,30 +1206,30 @@ XLBRWETH3 = MOMG(XALPHAR,XNUR,XBR+2.) ! ! Notice: One magnitude of lambda discretized over 10 points ! -RAIN_ICE_PARAM%NWETLBDAS = 80 -RAIN_ICE_PARAM%XWETLBDAS_MIN = 2.5E1 ! Minimal value of Lbda_s to tabulate XKER_SWETH -RAIN_ICE_PARAM%XWETLBDAS_MAX = 2.5E9 ! Maximal value of Lbda_s to tabulate XKER_SWETH -ZRATE = LOG(RAIN_ICE_PARAM%XWETLBDAS_MAX/RAIN_ICE_PARAM%XWETLBDAS_MIN)/REAL(RAIN_ICE_PARAM%NWETLBDAS-1) -RAIN_ICE_PARAM%XWETINTP1S = 1.0 / ZRATE -RAIN_ICE_PARAM%XWETINTP2S = 1.0 - LOG( RAIN_ICE_PARAM%XWETLBDAS_MIN ) / ZRATE -RAIN_ICE_PARAM%NWETLBDAG = 40 -RAIN_ICE_PARAM%XWETLBDAG_MIN = 1.0E3 ! Min value of Lbda_g to tabulate XKER_GWETH -RAIN_ICE_PARAM%XWETLBDAG_MAX = 1.0E7 ! Max value of Lbda_g to tabulate XKER_GWETH -ZRATE = LOG(RAIN_ICE_PARAM%XWETLBDAG_MAX/RAIN_ICE_PARAM%XWETLBDAG_MIN)/REAL(RAIN_ICE_PARAM%NWETLBDAG-1) -RAIN_ICE_PARAM%XWETINTP1G = 1.0 / ZRATE -RAIN_ICE_PARAM%XWETINTP2G = 1.0 - LOG( RAIN_ICE_PARAM%XWETLBDAG_MIN ) / ZRATE -RAIN_ICE_PARAM%NWETLBDAR = 40 -RAIN_ICE_PARAM%XWETLBDAR_MIN = 1.0E3 ! Minimal value of Lbda_r to tabulate XKER_RWETH -RAIN_ICE_PARAM%XWETLBDAR_MAX = 1.0E7 ! Maximal value of Lbda_r to tabulate XKER_RWETH -ZRATE = LOG(RAIN_ICE_PARAM%XWETLBDAR_MAX/RAIN_ICE_PARAM%XWETLBDAR_MIN)/REAL(RAIN_ICE_PARAM%NWETLBDAR-1) -RAIN_ICE_PARAM%XWETINTP1R = 1.0 / ZRATE -RAIN_ICE_PARAM%XWETINTP2R = 1.0 - LOG( RAIN_ICE_PARAM%XWETLBDAR_MIN ) / ZRATE -RAIN_ICE_PARAM%NWETLBDAH = 40 -RAIN_ICE_PARAM%XWETLBDAH_MIN = 1.0E3 ! Min value of Lbda_h to tabulate XKER_SWETH,XKER_GWETH,XKER_RWETH -RAIN_ICE_PARAM%XWETLBDAH_MAX = 1.0E7 ! Max value of Lbda_h to tabulate XKER_SWETH,XKER_GWETH,XKER_RWETH -ZRATE = LOG(RAIN_ICE_PARAM%XWETLBDAH_MAX/RAIN_ICE_PARAM%XWETLBDAH_MIN)/REAL(RAIN_ICE_PARAM%NWETLBDAH-1) -RAIN_ICE_PARAM%XWETINTP1H = 1.0 / ZRATE -RAIN_ICE_PARAM%XWETINTP2H = 1.0 - LOG( RAIN_ICE_PARAM%XWETLBDAH_MIN ) / ZRATE +RAIN_ICE_PARAMN%NWETLBDAS = 80 +RAIN_ICE_PARAMN%XWETLBDAS_MIN = 2.5E1 ! Minimal value of Lbda_s to tabulate XKER_SWETH +RAIN_ICE_PARAMN%XWETLBDAS_MAX = 2.5E9 ! Maximal value of Lbda_s to tabulate XKER_SWETH +ZRATE = LOG(RAIN_ICE_PARAMN%XWETLBDAS_MAX/RAIN_ICE_PARAMN%XWETLBDAS_MIN)/REAL(RAIN_ICE_PARAMN%NWETLBDAS-1) +RAIN_ICE_PARAMN%XWETINTP1S = 1.0 / ZRATE +RAIN_ICE_PARAMN%XWETINTP2S = 1.0 - LOG( RAIN_ICE_PARAMN%XWETLBDAS_MIN ) / ZRATE +RAIN_ICE_PARAMN%NWETLBDAG = 40 +RAIN_ICE_PARAMN%XWETLBDAG_MIN = 1.0E3 ! Min value of Lbda_g to tabulate XKER_GWETH +RAIN_ICE_PARAMN%XWETLBDAG_MAX = 1.0E7 ! Max value of Lbda_g to tabulate XKER_GWETH +ZRATE = LOG(RAIN_ICE_PARAMN%XWETLBDAG_MAX/RAIN_ICE_PARAMN%XWETLBDAG_MIN)/REAL(RAIN_ICE_PARAMN%NWETLBDAG-1) +RAIN_ICE_PARAMN%XWETINTP1G = 1.0 / ZRATE +RAIN_ICE_PARAMN%XWETINTP2G = 1.0 - LOG( RAIN_ICE_PARAMN%XWETLBDAG_MIN ) / ZRATE +RAIN_ICE_PARAMN%NWETLBDAR = 40 +RAIN_ICE_PARAMN%XWETLBDAR_MIN = 1.0E3 ! Minimal value of Lbda_r to tabulate XKER_RWETH +RAIN_ICE_PARAMN%XWETLBDAR_MAX = 1.0E7 ! Maximal value of Lbda_r to tabulate XKER_RWETH +ZRATE = LOG(RAIN_ICE_PARAMN%XWETLBDAR_MAX/RAIN_ICE_PARAMN%XWETLBDAR_MIN)/REAL(RAIN_ICE_PARAMN%NWETLBDAR-1) +RAIN_ICE_PARAMN%XWETINTP1R = 1.0 / ZRATE +RAIN_ICE_PARAMN%XWETINTP2R = 1.0 - LOG( RAIN_ICE_PARAMN%XWETLBDAR_MIN ) / ZRATE +RAIN_ICE_PARAMN%NWETLBDAH = 40 +RAIN_ICE_PARAMN%XWETLBDAH_MIN = 1.0E3 ! Min value of Lbda_h to tabulate XKER_SWETH,XKER_GWETH,XKER_RWETH +RAIN_ICE_PARAMN%XWETLBDAH_MAX = 1.0E7 ! Max value of Lbda_h to tabulate XKER_SWETH,XKER_GWETH,XKER_RWETH +ZRATE = LOG(RAIN_ICE_PARAMN%XWETLBDAH_MAX/RAIN_ICE_PARAMN%XWETLBDAH_MIN)/REAL(RAIN_ICE_PARAMN%NWETLBDAH-1) +RAIN_ICE_PARAMN%XWETINTP1H = 1.0 / ZRATE +RAIN_ICE_PARAMN%XWETINTP2H = 1.0 - LOG( RAIN_ICE_PARAMN%XWETLBDAH_MIN ) / ZRATE ! !* 9.2.4 Computations of the tabulated normalized kernels ! @@ -1254,32 +1237,32 @@ IND = 50 ! Interval number, collection efficiency and infinite diameter ZEHS = 1.0 ! factor used to integrate the dimensional distributions when ZFDINFTY = 20.0 ! computing the kernels XKER_SWETH ! -IF( .NOT.ASSOCIATED(XKER_SWETH) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_SWETH', RAIN_ICE_PARAM%NWETLBDAH,RAIN_ICE_PARAM%NWETLBDAS) +IF( .NOT.ASSOCIATED(XKER_SWETH) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_SWETH', RAIN_ICE_PARAMN%NWETLBDAH,RAIN_ICE_PARAMN%NWETLBDAS) ! CALL READ_XKER_SWETH (KWETLBDAH,KWETLBDAS,KND, & PALPHAH,PNUH,PALPHAS,PNUS,PEHS,PBS,PCH,PDH,PCS,PDS,PFVELOS, & PWETLBDAH_MAX,PWETLBDAS_MAX,PWETLBDAH_MIN,PWETLBDAS_MIN, & PFDINFTY ) -IF( (KWETLBDAH/=RAIN_ICE_PARAM%NWETLBDAH) .OR. (KWETLBDAS/=RAIN_ICE_PARAM%NWETLBDAS) .OR. (KND/=IND) .OR. & +IF( (KWETLBDAH/=RAIN_ICE_PARAMN%NWETLBDAH) .OR. (KWETLBDAS/=RAIN_ICE_PARAMN%NWETLBDAS) .OR. (KND/=IND) .OR. & (PALPHAH/=XALPHAH) .OR. (PNUH/=XNUH) .OR. & (PALPHAS/=XALPHAS) .OR. (PNUS/=XNUS) .OR. & (PEHS/=ZEHS) .OR. (PBS/=XBS) .OR. & (PCH/=XCH) .OR. (PDH/=XDH) .OR. (PCS/=XCS) .OR. (PDS/=XDS) .OR. (PFVELOS/=XFVELOS) .OR. & - (PWETLBDAH_MAX/=RAIN_ICE_PARAM%XWETLBDAH_MAX) .OR. (PWETLBDAS_MAX/=RAIN_ICE_PARAM%XWETLBDAS_MAX) .OR. & - (PWETLBDAH_MIN/=RAIN_ICE_PARAM%XWETLBDAH_MIN) .OR. (PWETLBDAS_MIN/=RAIN_ICE_PARAM%XWETLBDAS_MIN) .OR. & + (PWETLBDAH_MAX/=RAIN_ICE_PARAMN%XWETLBDAH_MAX) .OR. (PWETLBDAS_MAX/=RAIN_ICE_PARAMN%XWETLBDAS_MAX) .OR. & + (PWETLBDAH_MIN/=RAIN_ICE_PARAMN%XWETLBDAH_MIN) .OR. (PWETLBDAS_MIN/=RAIN_ICE_PARAMN%XWETLBDAS_MIN) .OR. & (PFDINFTY/=ZFDINFTY) ) THEN CALL RZCOLX ( IND, XALPHAH, XNUH, XALPHAS, XNUS, & ZEHS, XBS, XCH, XDH, 0., XCS, XDS, XFVELOS, & - RAIN_ICE_PARAM%XWETLBDAH_MAX, RAIN_ICE_PARAM%XWETLBDAS_MAX, & - RAIN_ICE_PARAM%XWETLBDAH_MIN, RAIN_ICE_PARAM%XWETLBDAS_MIN, & + RAIN_ICE_PARAMN%XWETLBDAH_MAX, RAIN_ICE_PARAMN%XWETLBDAS_MAX, & + RAIN_ICE_PARAMN%XWETLBDAH_MIN, RAIN_ICE_PARAMN%XWETLBDAS_MIN, & ZFDINFTY, XKER_SWETH ) WRITE(UNIT=KLUOUT,FMT='("*****************************************")') WRITE(UNIT=KLUOUT,FMT='("**** UPDATE NEW SET OF SWETH KERNELS ****")') WRITE(UNIT=KLUOUT,FMT='("*****************************************")') WRITE(UNIT=KLUOUT,FMT='("!")') WRITE(UNIT=KLUOUT,FMT='("KND=",I3)') IND - WRITE(UNIT=KLUOUT,FMT='("KWETLBDAH=",I3)') RAIN_ICE_PARAM%NWETLBDAH - WRITE(UNIT=KLUOUT,FMT='("KWETLBDAS=",I3)') RAIN_ICE_PARAM%NWETLBDAS + WRITE(UNIT=KLUOUT,FMT='("KWETLBDAH=",I3)') RAIN_ICE_PARAMN%NWETLBDAH + WRITE(UNIT=KLUOUT,FMT='("KWETLBDAS=",I3)') RAIN_ICE_PARAMN%NWETLBDAS WRITE(UNIT=KLUOUT,FMT='("PALPHAH=",E13.6)') XALPHAH WRITE(UNIT=KLUOUT,FMT='("PNUH=",E13.6)') XNUH WRITE(UNIT=KLUOUT,FMT='("PALPHAS=",E13.6)') XALPHAS @@ -1292,18 +1275,18 @@ IF( (KWETLBDAH/=RAIN_ICE_PARAM%NWETLBDAH) .OR. (KWETLBDAS/=RAIN_ICE_PARAM%NWETLB WRITE(UNIT=KLUOUT,FMT='("PDS=",E13.6)') XDS WRITE(UNIT=KLUOUT,FMT='("PFVELOS=",E13.6)') XFVELOS WRITE(UNIT=KLUOUT,FMT='("PWETLBDAH_MAX=",E13.6)') & - RAIN_ICE_PARAM%XWETLBDAH_MAX + RAIN_ICE_PARAMN%XWETLBDAH_MAX WRITE(UNIT=KLUOUT,FMT='("PWETLBDAS_MAX=",E13.6)') & - RAIN_ICE_PARAM%XWETLBDAS_MAX + RAIN_ICE_PARAMN%XWETLBDAS_MAX WRITE(UNIT=KLUOUT,FMT='("PWETLBDAH_MIN=",E13.6)') & - RAIN_ICE_PARAM%XWETLBDAH_MIN + RAIN_ICE_PARAMN%XWETLBDAH_MIN WRITE(UNIT=KLUOUT,FMT='("PWETLBDAS_MIN=",E13.6)') & - RAIN_ICE_PARAM%XWETLBDAS_MIN + RAIN_ICE_PARAMN%XWETLBDAS_MIN WRITE(UNIT=KLUOUT,FMT='("PFDINFTY=",E13.6)') ZFDINFTY WRITE(UNIT=KLUOUT,FMT='("!")') WRITE(UNIT=KLUOUT,FMT='("IF( PRESENT(PKER_SWETH) ) THEN")') - DO J1 = 1 , RAIN_ICE_PARAM%NWETLBDAH - DO J2 = 1 , RAIN_ICE_PARAM%NWETLBDAS + DO J1 = 1 , RAIN_ICE_PARAMN%NWETLBDAH + DO J2 = 1 , RAIN_ICE_PARAMN%NWETLBDAS WRITE(UNIT=KLUOUT,FMT='("PKER_SWETH(",I3,",",I3,") = ",E13.6)') & J1,J2,XKER_SWETH(J1,J2) END DO @@ -1322,32 +1305,32 @@ IND = 50 ! Number of interval used to integrate the dimensional ZEHG = 1.0 ! distributions when computing the kernel XKER_GWETH ZFDINFTY = 20.0 ! -IF( .NOT.ASSOCIATED(XKER_GWETH) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_GWETH', RAIN_ICE_PARAM%NWETLBDAH,RAIN_ICE_PARAM%NWETLBDAG) +IF( .NOT.ASSOCIATED(XKER_GWETH) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_GWETH', RAIN_ICE_PARAMN%NWETLBDAH,RAIN_ICE_PARAMN%NWETLBDAG) ! CALL READ_XKER_GWETH (KWETLBDAH,KWETLBDAG,KND, & PALPHAH,PNUH,PALPHAG,PNUG,PEHG,PBG,PCH,PDH,PCG,PDG, & PWETLBDAH_MAX,PWETLBDAG_MAX,PWETLBDAH_MIN,PWETLBDAG_MIN, & PFDINFTY ) -IF( (KWETLBDAH/=RAIN_ICE_PARAM%NWETLBDAH) .OR. (KWETLBDAG/=RAIN_ICE_PARAM%NWETLBDAG) .OR. (KND/=IND) .OR. & +IF( (KWETLBDAH/=RAIN_ICE_PARAMN%NWETLBDAH) .OR. (KWETLBDAG/=RAIN_ICE_PARAMN%NWETLBDAG) .OR. (KND/=IND) .OR. & (PALPHAH/=XALPHAH) .OR. (PNUH/=XNUH) .OR. & (PALPHAG/=XALPHAG) .OR. (PNUG/=XNUG) .OR. & (PEHG/=ZEHG) .OR. (PBG/=XBG) .OR. & (PCH/=XCH) .OR. (PDH/=XDH) .OR. (PCG/=XCG) .OR. (PDG/=XDG) .OR. & - (PWETLBDAH_MAX/=RAIN_ICE_PARAM%XWETLBDAH_MAX) .OR. (PWETLBDAG_MAX/=RAIN_ICE_PARAM%XWETLBDAG_MAX) .OR. & - (PWETLBDAH_MIN/=RAIN_ICE_PARAM%XWETLBDAH_MIN) .OR. (PWETLBDAG_MIN/=RAIN_ICE_PARAM%XWETLBDAG_MIN) .OR. & + (PWETLBDAH_MAX/=RAIN_ICE_PARAMN%XWETLBDAH_MAX) .OR. (PWETLBDAG_MAX/=RAIN_ICE_PARAMN%XWETLBDAG_MAX) .OR. & + (PWETLBDAH_MIN/=RAIN_ICE_PARAMN%XWETLBDAH_MIN) .OR. (PWETLBDAG_MIN/=RAIN_ICE_PARAMN%XWETLBDAG_MIN) .OR. & (PFDINFTY/=ZFDINFTY) ) THEN CALL RZCOLX ( IND, XALPHAH, XNUH, XALPHAG, XNUG, & ZEHG, XBG, XCH, XDH, 0., XCG, XDG, 0., & - RAIN_ICE_PARAM%XWETLBDAH_MAX, RAIN_ICE_PARAM%XWETLBDAG_MAX, & - RAIN_ICE_PARAM%XWETLBDAH_MIN, RAIN_ICE_PARAM%XWETLBDAG_MIN, & + RAIN_ICE_PARAMN%XWETLBDAH_MAX, RAIN_ICE_PARAMN%XWETLBDAG_MAX, & + RAIN_ICE_PARAMN%XWETLBDAH_MIN, RAIN_ICE_PARAMN%XWETLBDAG_MIN, & ZFDINFTY, XKER_GWETH ) WRITE(UNIT=KLUOUT,FMT='("*****************************************")') WRITE(UNIT=KLUOUT,FMT='("**** UPDATE NEW SET OF GWETH KERNELS ****")') WRITE(UNIT=KLUOUT,FMT='("*****************************************")') WRITE(UNIT=KLUOUT,FMT='("!")') WRITE(UNIT=KLUOUT,FMT='("KND=",I3)') IND - WRITE(UNIT=KLUOUT,FMT='("KWETLBDAH=",I3)') RAIN_ICE_PARAM%NWETLBDAH - WRITE(UNIT=KLUOUT,FMT='("KWETLBDAG=",I3)') RAIN_ICE_PARAM%NWETLBDAG + WRITE(UNIT=KLUOUT,FMT='("KWETLBDAH=",I3)') RAIN_ICE_PARAMN%NWETLBDAH + WRITE(UNIT=KLUOUT,FMT='("KWETLBDAG=",I3)') RAIN_ICE_PARAMN%NWETLBDAG WRITE(UNIT=KLUOUT,FMT='("PALPHAH=",E13.6)') XALPHAH WRITE(UNIT=KLUOUT,FMT='("PNUH=",E13.6)') XNUH WRITE(UNIT=KLUOUT,FMT='("PALPHAG=",E13.6)') XALPHAG @@ -1359,18 +1342,18 @@ IF( (KWETLBDAH/=RAIN_ICE_PARAM%NWETLBDAH) .OR. (KWETLBDAG/=RAIN_ICE_PARAM%NWETLB WRITE(UNIT=KLUOUT,FMT='("PCG=",E13.6)') XCG WRITE(UNIT=KLUOUT,FMT='("PDG=",E13.6)') XDG WRITE(UNIT=KLUOUT,FMT='("PWETLBDAH_MAX=",E13.6)') & - RAIN_ICE_PARAM%XWETLBDAH_MAX + RAIN_ICE_PARAMN%XWETLBDAH_MAX WRITE(UNIT=KLUOUT,FMT='("PWETLBDAG_MAX=",E13.6)') & - RAIN_ICE_PARAM%XWETLBDAG_MAX + RAIN_ICE_PARAMN%XWETLBDAG_MAX WRITE(UNIT=KLUOUT,FMT='("PWETLBDAH_MIN=",E13.6)') & - RAIN_ICE_PARAM%XWETLBDAH_MIN + RAIN_ICE_PARAMN%XWETLBDAH_MIN WRITE(UNIT=KLUOUT,FMT='("PWETLBDAG_MIN=",E13.6)') & - RAIN_ICE_PARAM%XWETLBDAG_MIN + RAIN_ICE_PARAMN%XWETLBDAG_MIN WRITE(UNIT=KLUOUT,FMT='("PFDINFTY=",E13.6)') ZFDINFTY WRITE(UNIT=KLUOUT,FMT='("!")') WRITE(UNIT=KLUOUT,FMT='("IF( PRESENT(PKER_GWETH) ) THEN")') - DO J1 = 1 , RAIN_ICE_PARAM%NWETLBDAH - DO J2 = 1 , RAIN_ICE_PARAM%NWETLBDAG + DO J1 = 1 , RAIN_ICE_PARAMN%NWETLBDAH + DO J2 = 1 , RAIN_ICE_PARAMN%NWETLBDAG WRITE(UNIT=KLUOUT,FMT='("PKER_GWETH(",I3,",",I3,") = ",E13.6)') & J1,J2,XKER_GWETH(J1,J2) END DO @@ -1389,32 +1372,32 @@ IND = 50 ! Number of interval used to integrate the dimensional ZEHR = 1.0 ! distributions when computing the kernel XKER_RWETH ZFDINFTY = 20.0 ! -IF( .NOT.ASSOCIATED(XKER_RWETH) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_RWETH', RAIN_ICE_PARAM%NWETLBDAH,RAIN_ICE_PARAM%NWETLBDAR) +IF( .NOT.ASSOCIATED(XKER_RWETH) ) CALL RAIN_ICE_PARAM_ALLOCATE('XKER_RWETH', RAIN_ICE_PARAMN%NWETLBDAH,RAIN_ICE_PARAMN%NWETLBDAR) ! CALL READ_XKER_RWETH (KWETLBDAH,KWETLBDAR,KND, & PALPHAH,PNUH,PALPHAR,PNUR,PEHR,PBR,PCH,PDH,PCR,PDR, & PWETLBDAH_MAX,PWETLBDAR_MAX,PWETLBDAH_MIN,PWETLBDAR_MIN, & PFDINFTY ) -IF( (KWETLBDAH/=RAIN_ICE_PARAM%NWETLBDAH) .OR. (KWETLBDAR/=RAIN_ICE_PARAM%NWETLBDAR) .OR. (KND/=IND) .OR. & +IF( (KWETLBDAH/=RAIN_ICE_PARAMN%NWETLBDAH) .OR. (KWETLBDAR/=RAIN_ICE_PARAMN%NWETLBDAR) .OR. (KND/=IND) .OR. & (PALPHAH/=XALPHAH) .OR. (PNUH/=XNUH) .OR. & (PALPHAR/=XALPHAR) .OR. (PNUR/=XNUR) .OR. & (PEHR/=ZEHR) .OR. (PBR/=XBR) .OR. & (PCH/=XCH) .OR. (PDH/=XDH) .OR. (PCR/=XCR) .OR. (PDR/=XDR) .OR. & - (PWETLBDAH_MAX/=RAIN_ICE_PARAM%XWETLBDAH_MAX) .OR. (PWETLBDAR_MAX/=RAIN_ICE_PARAM%XWETLBDAR_MAX) .OR. & - (PWETLBDAH_MIN/=RAIN_ICE_PARAM%XWETLBDAH_MIN) .OR. (PWETLBDAR_MIN/=RAIN_ICE_PARAM%XWETLBDAR_MIN) .OR. & + (PWETLBDAH_MAX/=RAIN_ICE_PARAMN%XWETLBDAH_MAX) .OR. (PWETLBDAR_MAX/=RAIN_ICE_PARAMN%XWETLBDAR_MAX) .OR. & + (PWETLBDAH_MIN/=RAIN_ICE_PARAMN%XWETLBDAH_MIN) .OR. (PWETLBDAR_MIN/=RAIN_ICE_PARAMN%XWETLBDAR_MIN) .OR. & (PFDINFTY/=ZFDINFTY) ) THEN CALL RZCOLX ( IND, XALPHAH, XNUH, XALPHAR, XNUR, & ZEHR, XBR, XCH, XDH, 0., XCR, XDR, 0., & - RAIN_ICE_PARAM%XWETLBDAH_MAX, RAIN_ICE_PARAM%XWETLBDAR_MAX, & - RAIN_ICE_PARAM%XWETLBDAH_MIN, RAIN_ICE_PARAM%XWETLBDAR_MIN, & + RAIN_ICE_PARAMN%XWETLBDAH_MAX, RAIN_ICE_PARAMN%XWETLBDAR_MAX, & + RAIN_ICE_PARAMN%XWETLBDAH_MIN, RAIN_ICE_PARAMN%XWETLBDAR_MIN, & ZFDINFTY, XKER_RWETH ) WRITE(UNIT=KLUOUT,FMT='("*****************************************")') WRITE(UNIT=KLUOUT,FMT='("**** UPDATE NEW SET OF RWETH KERNELS ****")') WRITE(UNIT=KLUOUT,FMT='("*****************************************")') WRITE(UNIT=KLUOUT,FMT='("!")') WRITE(UNIT=KLUOUT,FMT='("KND=",I3)') IND - WRITE(UNIT=KLUOUT,FMT='("KWETLBDAH=",I3)') RAIN_ICE_PARAM%NWETLBDAH - WRITE(UNIT=KLUOUT,FMT='("KWETLBDAR=",I3)') RAIN_ICE_PARAM%NWETLBDAR + WRITE(UNIT=KLUOUT,FMT='("KWETLBDAH=",I3)') RAIN_ICE_PARAMN%NWETLBDAH + WRITE(UNIT=KLUOUT,FMT='("KWETLBDAR=",I3)') RAIN_ICE_PARAMN%NWETLBDAR WRITE(UNIT=KLUOUT,FMT='("PALPHAH=",E13.6)') XALPHAH WRITE(UNIT=KLUOUT,FMT='("PNUH=",E13.6)') XNUH WRITE(UNIT=KLUOUT,FMT='("PALPHAR=",E13.6)') XALPHAR @@ -1426,18 +1409,18 @@ IF( (KWETLBDAH/=RAIN_ICE_PARAM%NWETLBDAH) .OR. (KWETLBDAR/=RAIN_ICE_PARAM%NWETLB WRITE(UNIT=KLUOUT,FMT='("PCR=",E13.6)') XCR WRITE(UNIT=KLUOUT,FMT='("PDR=",E13.6)') XDR WRITE(UNIT=KLUOUT,FMT='("PWETLBDAH_MAX=",E13.6)') & - RAIN_ICE_PARAM%XWETLBDAH_MAX + RAIN_ICE_PARAMN%XWETLBDAH_MAX WRITE(UNIT=KLUOUT,FMT='("PWETLBDAR_MAX=",E13.6)') & - RAIN_ICE_PARAM%XWETLBDAR_MAX + RAIN_ICE_PARAMN%XWETLBDAR_MAX WRITE(UNIT=KLUOUT,FMT='("PWETLBDAH_MIN=",E13.6)') & - RAIN_ICE_PARAM%XWETLBDAH_MIN + RAIN_ICE_PARAMN%XWETLBDAH_MIN WRITE(UNIT=KLUOUT,FMT='("PWETLBDAR_MIN=",E13.6)') & - RAIN_ICE_PARAM%XWETLBDAR_MIN + RAIN_ICE_PARAMN%XWETLBDAR_MIN WRITE(UNIT=KLUOUT,FMT='("PFDINFTY=",E13.6)') ZFDINFTY WRITE(UNIT=KLUOUT,FMT='("!")') WRITE(UNIT=KLUOUT,FMT='("IF( PRESENT(PKER_RWETH) ) THEN")') - DO J1 = 1 , RAIN_ICE_PARAM%NWETLBDAH - DO J2 = 1 , RAIN_ICE_PARAM%NWETLBDAR + DO J1 = 1 , RAIN_ICE_PARAMN%NWETLBDAH + DO J2 = 1 , RAIN_ICE_PARAMN%NWETLBDAR WRITE(UNIT=KLUOUT,FMT='("PKER_RWETH(",I3,",",I3,") = ",E13.6)') & J1,J2,XKER_RWETH(J1,J2) END DO @@ -1526,3 +1509,4 @@ CONTAINS ! ! END SUBROUTINE INI_RAIN_ICE +END MODULE MODE_INI_RAIN_ICE diff --git a/src/common/micro/ini_snow.F90 b/src/common/micro/mode_ini_snow.F90 similarity index 97% rename from src/common/micro/ini_snow.F90 rename to src/common/micro/mode_ini_snow.F90 index c61f54a0d762adf2110157acc003e05d11335e4f..004f64cf4628eda4d1cbd2d11fc6f3f51a21da65 100644 --- a/src/common/micro/ini_snow.F90 +++ b/src/common/micro/mode_ini_snow.F90 @@ -1,4 +1,6 @@ ! ######spl +MODULE MODE_INI_SNOW +CONTAINS SUBROUTINE INI_SNOW ( KLUOUT ) USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK @@ -47,9 +49,9 @@ ! USE MODD_CST USE MODD_PARAMETERS -USE MODD_PARAM_ICE -USE MODD_RAIN_ICE_DESCR -USE MODD_RAIN_ICE_PARAM +USE MODD_PARAM_ICE_n +USE MODD_RAIN_ICE_DESCR_n +USE MODD_RAIN_ICE_PARAM_n ! USE MODI_GAMMA USE MODI_GAMMA_INC @@ -161,3 +163,4 @@ CONTAINS ! ! END SUBROUTINE INI_SNOW +END MODULE MODE_INI_SNOW diff --git a/src/common/micro/ini_tiwmx.F90 b/src/common/micro/mode_ini_tiwmx.F90 similarity index 96% rename from src/common/micro/ini_tiwmx.F90 rename to src/common/micro/mode_ini_tiwmx.F90 index 2e3209a38d5bd88f21ac0fa68d98172da3692d99..7d88b22d568cd61d0ef9999fffbdca1079873abb 100644 --- a/src/common/micro/ini_tiwmx.F90 +++ b/src/common/micro/mode_ini_tiwmx.F90 @@ -1,3 +1,5 @@ +MODULE MODE_INI_TIWMX +CONTAINS SUBROUTINE INI_TIWMX USE PARKIND1, ONLY : JPRB USE MODD_CST, ONLY : XALPW,XBETAW,XGAMW,XALPI,XBETAI,XGAMI, & @@ -53,3 +55,4 @@ SUBROUTINE INI_TIWMX IF (LHOOK) CALL DR_HOOK('INI_TIWMX',1,ZHOOK_HANDLE) END SUBROUTINE INI_TIWMX +END MODULE MODE_INI_TIWMX diff --git a/src/common/micro/mode_lima_ccn_activation.F90 b/src/common/micro/mode_lima_ccn_activation.F90 index 36a2d7384f87d78995a0a580a5dcc07bbb88d1be..cb3ed2cd0577211420da0b5ec6dc254186182757 100644 --- a/src/common/micro/mode_lima_ccn_activation.F90 +++ b/src/common/micro/mode_lima_ccn_activation.F90 @@ -74,7 +74,7 @@ USE MODD_PARAM_LIMA, ONLY: LADJ, LACTIT, NMOD_CCN, XCTMIN, XKHEN_MULTI, XRT USE MODD_PARAM_LIMA_WARM, ONLY: XWMIN, NAHEN, NHYP, XAHENINTP1, XAHENINTP2, XCSTDCRIT, XHYPF12, & XHYPINTP1, XHYPINTP2, XTMIN, XHYPF32, XPSI3, XAHENG, XAHENG2, XPSI1, & XLBC, XLBEXC -USE MODD_TURB_n, ONLY: LSUBG_COND +USE MODD_NEB_n, ONLY: LSUBG_COND !USE MODE_IO_FIELD_WRITE, only: IO_Field_write use mode_tools, only: Countjv diff --git a/src/common/micro/mode_lima_nucleation_procs.F90 b/src/common/micro/mode_lima_nucleation_procs.F90 index 25da0089e5af66db5eac9d953eb9b35d100082f4..453471901775ba71fb7fe018652c0cdf5dd2b31c 100644 --- a/src/common/micro/mode_lima_nucleation_procs.F90 +++ b/src/common/micro/mode_lima_nucleation_procs.F90 @@ -45,7 +45,7 @@ USE MODD_NSV, ONLY : NSV_LIMA_NC, NSV_LIMA_NR, NSV_LIMA_CCN_FREE, NSV_LIM NSV_LIMA_NI, NSV_LIMA_IFN_FREE, NSV_LIMA_IFN_NUCL, NSV_LIMA_IMM_NUCL, NSV_LIMA_HOM_HAZE USE MODD_PARAM_LIMA, ONLY : LNUCL, LMEYERS, LACTI, LHHONI, & NMOD_CCN, NMOD_IFN, NMOD_IMM, XCTMIN, XRTMIN, LSPRO, NMOM_I, NMOM_C -USE MODD_TURB_n, ONLY : LSUBG_COND +USE MODD_NEB_n, ONLY : LSUBG_COND USE MODE_BUDGET_PHY, ONLY: BUDGET_STORE_ADD_PHY, BUDGET_STORE_INIT_PHY, BUDGET_STORE_END_PHY diff --git a/src/common/micro/mode_nrcolss.F90 b/src/common/micro/mode_nrcolss.F90 index 3da87d0a49abb048b03c968b8334228ac906dd62..85d083bb430cb7a33f13abc9fa02e0fea7d8a36c 100644 --- a/src/common/micro/mode_nrcolss.F90 +++ b/src/common/micro/mode_nrcolss.F90 @@ -87,7 +87,7 @@ CONTAINS USE MODI_GENERAL_GAMMA ! USE MODD_CST -USE MODD_RAIN_ICE_DESCR +USE MODD_RAIN_ICE_DESCR_n ! IMPLICIT NONE ! diff --git a/src/common/micro/mode_nscolrg.F90 b/src/common/micro/mode_nscolrg.F90 index 593d838d6951769c140653ea40fecdaac2352948..f3d3a8e911c69bc2b473ce5b6d35ec80cf52bb84 100644 --- a/src/common/micro/mode_nscolrg.F90 +++ b/src/common/micro/mode_nscolrg.F90 @@ -86,7 +86,7 @@ CONTAINS USE MODI_GENERAL_GAMMA ! USE MODD_CST -USE MODD_RAIN_ICE_DESCR +USE MODD_RAIN_ICE_DESCR_n ! IMPLICIT NONE ! diff --git a/src/common/micro/mode_rain_ice_old_fast_rg.F90 b/src/common/micro/mode_rain_ice_old_fast_rg.F90 index 3b17c5903c06a3cfe628e8d323425aab39858d5c..77c17fac252bb67ee7a8d99a274d7153762e5097 100644 --- a/src/common/micro/mode_rain_ice_old_fast_rg.F90 +++ b/src/common/micro/mode_rain_ice_old_fast_rg.F90 @@ -25,8 +25,8 @@ MODULE MODE_RAIN_ICE_OLD_FAST_RG USE YOMHOOK, ONLY: LHOOK, DR_HOOK USE MODD_DIMPHYEX, ONLY: DIMPHYEX_T USE MODD_CST, ONLY: CST_T - USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_T - USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_T + USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_T + USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_T USE MODE_BUDGET_PHY, ONLY: BUDGET_STORE_INIT_PHY, BUDGET_STORE_END_PHY USE MODD_BUDGET, ONLY: TBUDGETDATA, TBUDGETCONF_t, LBU_ENABLE, NBUDGET_TH, NBUDGET_RG, NBUDGET_RR, NBUDGET_RC, & diff --git a/src/common/micro/mode_rain_ice_old_fast_rh.F90 b/src/common/micro/mode_rain_ice_old_fast_rh.F90 index 0416986331ab47c8a34d744cdadcd078c59bb089..838e8526ab2a7f7b5526af9524bd9bf8aa5a767d 100644 --- a/src/common/micro/mode_rain_ice_old_fast_rh.F90 +++ b/src/common/micro/mode_rain_ice_old_fast_rh.F90 @@ -25,8 +25,8 @@ MODULE MODE_RAIN_ICE_OLD_FAST_RH USE YOMHOOK, ONLY: LHOOK, DR_HOOK USE MODD_DIMPHYEX, ONLY: DIMPHYEX_T USE MODD_CST, ONLY: CST_T - USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_T - USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_T + USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_T + USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_T USE MODE_BUDGET_PHY, ONLY: BUDGET_STORE_INIT_PHY, BUDGET_STORE_END_PHY USE MODD_BUDGET, ONLY: TBUDGETDATA, TBUDGETCONF_t, LBU_ENABLE, NBUDGET_TH, NBUDGET_RG, NBUDGET_RR, NBUDGET_RC, & diff --git a/src/common/micro/mode_rain_ice_old_fast_ri.F90 b/src/common/micro/mode_rain_ice_old_fast_ri.F90 index 16cdc370e02bf8bb902a84587bbd73cf62471fa3..ad746a45d2f54e6705a82084a3cc6f24eb6fb7e5 100644 --- a/src/common/micro/mode_rain_ice_old_fast_ri.F90 +++ b/src/common/micro/mode_rain_ice_old_fast_ri.F90 @@ -28,8 +28,8 @@ MODULE MODE_RAIN_ICE_OLD_FAST_RI USE YOMHOOK, ONLY: LHOOK, DR_HOOK USE MODD_DIMPHYEX, ONLY: DIMPHYEX_T USE MODD_CST, ONLY: CST_T - USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_T - USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_T + USE MODD_RAIN_ICE_PARAM_N, ONLY: RAIN_ICE_PARAM_T + USE MODD_RAIN_ICE_DESCR_N, ONLY: RAIN_ICE_DESCR_T USE MODE_RAIN_ICE_OLD_ICENUMBER2, ONLY: ICENUMBER2 diff --git a/src/common/micro/mode_rain_ice_old_fast_rs.F90 b/src/common/micro/mode_rain_ice_old_fast_rs.F90 index 4fc69b2169f665fdebd9ea1b2b2a9f347510a32e..82ddf721d67506307012e0f7bfe8032d309161eb 100644 --- a/src/common/micro/mode_rain_ice_old_fast_rs.F90 +++ b/src/common/micro/mode_rain_ice_old_fast_rs.F90 @@ -23,8 +23,8 @@ MODULE MODE_RAIN_ICE_OLD_FAST_RS USE YOMHOOK, ONLY: LHOOK, DR_HOOK USE MODD_DIMPHYEX, ONLY: DIMPHYEX_T USE MODD_CST, ONLY: CST_T - USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_T - USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_T + USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_T + USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_T USE MODE_BUDGET_PHY, ONLY: BUDGET_STORE_INIT_PHY, BUDGET_STORE_END_PHY USE MODD_BUDGET, ONLY: TBUDGETDATA, TBUDGETCONF_t, & diff --git a/src/common/micro/mode_rain_ice_old_nucleation.F90 b/src/common/micro/mode_rain_ice_old_nucleation.F90 index ae9d0a0f317e1a85c4b997b00c42b911f7a58a61..16c9d233fe2769938336897bd1a6edcf3560ebce 100644 --- a/src/common/micro/mode_rain_ice_old_nucleation.F90 +++ b/src/common/micro/mode_rain_ice_old_nucleation.F90 @@ -21,7 +21,7 @@ MODULE MODE_RAIN_ICE_OLD_NUCLEATION USE MODD_DIMPHYEX, ONLY: DIMPHYEX_T USE MODD_CST, ONLY: CST_T USE MODE_TIWMX, ONLY: ESATI, ESATW, AM3, REDIN - USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_T + USE MODD_RAIN_ICE_PARAM_N,ONLY: RAIN_ICE_PARAM_T ! !* 0. DECLARATIONS ! ------------ diff --git a/src/common/micro/mode_rain_ice_old_sedimentation_split.F90 b/src/common/micro/mode_rain_ice_old_sedimentation_split.F90 index e8282060c9307f1f23ed3910a515664f4081f680..2732156dad6c0df4a7aec869e083777c2137b9db 100644 --- a/src/common/micro/mode_rain_ice_old_sedimentation_split.F90 +++ b/src/common/micro/mode_rain_ice_old_sedimentation_split.F90 @@ -22,8 +22,8 @@ MODULE MODE_RAIN_ICE_OLD_SEDIMENTATION_SPLIT USE YOMHOOK , ONLY: LHOOK, DR_HOOK USE MODD_DIMPHYEX, ONLY: DIMPHYEX_T USE MODD_CST, ONLY: CST_T - USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_T - USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_T + USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_T + USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_T ! !* 0. DECLARATIONS ! ------------ diff --git a/src/common/micro/mode_rain_ice_old_sedimentation_stat.F90 b/src/common/micro/mode_rain_ice_old_sedimentation_stat.F90 index ea89a3626600ff763f09976e2a467e5962e0a594..5a9b9975b45dab1de96d09b939d041b1ba52e211 100644 --- a/src/common/micro/mode_rain_ice_old_sedimentation_stat.F90 +++ b/src/common/micro/mode_rain_ice_old_sedimentation_stat.F90 @@ -22,8 +22,8 @@ MODULE MODE_RAIN_ICE_OLD_SEDIMENTATION_STAT USE YOMHOOK , ONLY: LHOOK, DR_HOOK USE MODD_DIMPHYEX, ONLY: DIMPHYEX_T USE MODD_CST, ONLY: CST_T - USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_T - USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_T + USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_T + USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_T USE YOMHOOK, ONLY: LHOOK, DR_HOOK !* 0. DECLARATIONS diff --git a/src/common/micro/mode_rain_ice_old_slow.F90 b/src/common/micro/mode_rain_ice_old_slow.F90 index 0b26730c45e9dc48cb0e31ecf5c2c8cbf93b1f63..c96f8c34b64d571d16584c72a12dc30a8d24d875 100644 --- a/src/common/micro/mode_rain_ice_old_slow.F90 +++ b/src/common/micro/mode_rain_ice_old_slow.F90 @@ -27,8 +27,8 @@ MODULE MODE_RAIN_ICE_OLD_SLOW USE YOMHOOK, ONLY: LHOOK, DR_HOOK USE MODD_DIMPHYEX, ONLY: DIMPHYEX_T USE MODD_CST, ONLY: CST_T - USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_T - USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_T + USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_T + USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_T USE MODE_BUDGET_PHY, ONLY: BUDGET_STORE_INIT_PHY, BUDGET_STORE_END_PHY diff --git a/src/common/micro/mode_rain_ice_old_warm.F90 b/src/common/micro/mode_rain_ice_old_warm.F90 index 17d6754de51e037044e9ffb3ff9e39253f7e1d42..b65a822211546ca4afd5e382fdf8c06b5f40a5b7 100644 --- a/src/common/micro/mode_rain_ice_old_warm.F90 +++ b/src/common/micro/mode_rain_ice_old_warm.F90 @@ -27,9 +27,9 @@ MODULE MODE_RAIN_ICE_OLD_WARM USE YOMHOOK, ONLY: LHOOK, DR_HOOK USE MODD_DIMPHYEX, ONLY: DIMPHYEX_T USE MODD_CST, ONLY: CST_T - USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t - USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_T - USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_T + USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t + USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_T + USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_T USE MODE_TIWMX, ONLY: ESATW, AA2W, BB3W diff --git a/src/common/micro/mode_rrcolss.F90 b/src/common/micro/mode_rrcolss.F90 index bfeaa1adb56745853e3da69cb13334c27da8e29f..a0b726e64353f3e2c7a7d0024159d947813ebc0d 100644 --- a/src/common/micro/mode_rrcolss.F90 +++ b/src/common/micro/mode_rrcolss.F90 @@ -92,7 +92,7 @@ CONTAINS USE MODI_GENERAL_GAMMA ! USE MODD_CST -USE MODD_RAIN_ICE_DESCR +USE MODD_RAIN_ICE_DESCR_n ! IMPLICIT NONE ! diff --git a/src/common/micro/mode_rscolrg.F90 b/src/common/micro/mode_rscolrg.F90 index 77e00251fce73e7531074f6bf3bd382245cf8f1e..99d241aad8c5767506e008f85f8e92d16d952191 100644 --- a/src/common/micro/mode_rscolrg.F90 +++ b/src/common/micro/mode_rscolrg.F90 @@ -91,7 +91,7 @@ CONTAINS USE MODI_GENERAL_GAMMA ! USE MODD_CST -USE MODD_RAIN_ICE_DESCR +USE MODD_RAIN_ICE_DESCR_n ! IMPLICIT NONE ! diff --git a/src/common/micro/modi_condensation.F90 b/src/common/micro/modi_condensation.F90 index 812dae784eb9a29e7c860111520c12e6fc82a32c..687e026925a107cd7f3d0ca2325295aed8171d3c 100644 --- a/src/common/micro/modi_condensation.F90 +++ b/src/common/micro/modi_condensation.F90 @@ -4,11 +4,11 @@ ! INTERFACE ! - SUBROUTINE CONDENSATION(D, CST, ICEP, NEB, TURBN, & + SUBROUTINE CONDENSATION(D, CST, ICEP, NEBN, TURBN, & &HFRAC_ICE, HCONDENS, HLAMBDA3, & &PPABS, PZZ, PRHODREF, PT, PRV_IN, PRV_OUT, PRC_IN, PRC_OUT, PRI_IN, PRI_OUT, & &PRR, PRS, PRG, PSIGS, LMFCONV, PMFCONV, PCLDFR, PSIGRC, OUSERI, & - &OSIGMAS, OCND2, LHGT_QS, & + &OSIGMAS, OCND2, & &PICLDFR, PWCLDFR, PSSIO, PSSIU, PIFR, PSIGQSAT, & &PLV, PLS, PCPH, & &PHLC_HRC, PHLC_HCF, PHLI_HRI, PHLI_HCF, & @@ -16,14 +16,14 @@ INTERFACE ! USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_CST, ONLY: CST_t -USE MODD_NEB, ONLY: NEB_t +USE MODD_NEB_n, ONLY: NEB_t USE MODD_TURB_n, ONLY: TURB_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t ! TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST TYPE(RAIN_ICE_PARAM_t), INTENT(IN) :: ICEP -TYPE(NEB_t), INTENT(IN) :: NEB +TYPE(NEB_t), INTENT(IN) :: NEBN TYPE(TURB_t), INTENT(IN) :: TURBN CHARACTER(LEN=1), INTENT(IN) :: HFRAC_ICE CHARACTER(LEN=4), INTENT(IN) :: HCONDENS @@ -55,7 +55,6 @@ LOGICAL, INTENT(IN) :: OSIGMAS! use present global Sigma ! or that from turbulence scheme LOGICAL, INTENT(IN) :: OCND2 ! logical switch to sparate liquid and ice ! more rigid (DEFALT value : .FALSE.) -LOGICAL, INTENT(IN) :: LHGT_QS! logical switch for height dependent VQSIGSAT REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PICLDFR ! ice cloud fraction REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PWCLDFR ! water or mixed-phase cloud fraction REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PSSIO ! Super-saturation with respect to ice in the diff --git a/src/common/micro/modi_ice_adjust.F90 b/src/common/micro/modi_ice_adjust.F90 index 95680b082309ec4a6e00eb196b0028a770c96550..ccad15ce7e97602b7056317bf23f094af97eef6e 100644 --- a/src/common/micro/modi_ice_adjust.F90 +++ b/src/common/micro/modi_ice_adjust.F90 @@ -4,9 +4,8 @@ ! INTERFACE ! - SUBROUTINE ICE_ADJUST (D, CST, ICEP, NEB, TURBN, BUCONF, KRR, & - &HFRAC_ICE, & - &HBUNAME, OCND2, LHGT_QS, & + SUBROUTINE ICE_ADJUST (D, CST, ICEP, NEBN, TURBN, PARAMI, BUCONF, KRR, & + &HBUNAME, & &PTSTEP, PSIGQSAT, & &PRHODJ, PEXNREF, PRHODREF, PSIGS, LMFCONV, PMFCONV,& &PPABST, PZZ, & @@ -21,9 +20,10 @@ INTERFACE &PHLC_HRC, PHLC_HCF, PHLI_HRI, PHLI_HCF) USE MODD_BUDGET, ONLY: TBUDGETDATA, TBUDGETCONF_t USE MODD_CST, ONLY: CST_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t -USE MODD_NEB, ONLY: NEB_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t +USE MODD_NEB_n, ONLY: NEB_t USE MODD_TURB_n, ONLY: TURB_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t IMPLICIT NONE ! @@ -34,16 +34,12 @@ IMPLICIT NONE TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST TYPE(RAIN_ICE_PARAM_t), INTENT(IN) :: ICEP -TYPE(NEB_t), INTENT(IN) :: NEB +TYPE(NEB_t), INTENT(IN) :: NEBN TYPE(TURB_t), INTENT(IN) :: TURBN +TYPE(PARAM_ICE_t), INTENT(IN) :: PARAMI TYPE(TBUDGETCONF_t), INTENT(IN) :: BUCONF INTEGER, INTENT(IN) :: KRR ! Number of moist variables -CHARACTER(LEN=1), INTENT(IN) :: HFRAC_ICE CHARACTER(LEN=4), INTENT(IN) :: HBUNAME ! Name of the budget -LOGICAL, INTENT(IN) :: OCND2 ! logical switch to separate liquid - ! and ice - ! more rigid (DEFAULT value : .FALSE.) -LOGICAL, INTENT(IN) :: LHGT_QS ! logical switch for height dependent VQSIGSAT REAL, INTENT(IN) :: PTSTEP ! Double Time step ! (single if cold start) REAL, DIMENSION(D%NIJT), INTENT(IN) :: PSIGQSAT ! coeff applied to qsat variance contribution @@ -52,8 +48,8 @@ REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRHODJ ! Dry density * Jacobia REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PEXNREF ! Reference Exner function REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRHODREF ! -REAL, DIMENSION(MERGE(D%NIJT,0,TURBN%LSUBG_COND),& - MERGE(D%NKT,0,TURBN%LSUBG_COND)), INTENT(IN) :: PSIGS ! Sigma_s at time t +REAL, DIMENSION(MERGE(D%NIJT,0,NEBN%LSUBG_COND),& + MERGE(D%NKT,0,NEBN%LSUBG_COND)), INTENT(IN) :: PSIGS ! Sigma_s at time t LOGICAL, INTENT(IN) :: LMFCONV ! =SIZE(PMFCONV)!=0 REAL, DIMENSION(MERGE(D%NIJT,0,LMFCONV),& MERGE(D%NKT,0,LMFCONV)), INTENT(IN) :: PMFCONV ! convective mass flux diff --git a/src/common/micro/modi_ini_neb.F90 b/src/common/micro/modi_ini_neb.F90 deleted file mode 100644 index eaa71d814aba5264d69e8de759b00ce5f52d9190..0000000000000000000000000000000000000000 --- a/src/common/micro/modi_ini_neb.F90 +++ /dev/null @@ -1,16 +0,0 @@ -!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. -! ######spl - MODULE MODI_INI_NEB -! ##################### -! -INTERFACE -! -SUBROUTINE INI_NEB -END SUBROUTINE INI_NEB -! -END INTERFACE -! -END MODULE MODI_INI_NEB diff --git a/src/common/micro/modi_ini_rain_ice.F90 b/src/common/micro/modi_ini_rain_ice.F90 deleted file mode 100644 index 85d302d80f2e0bcf28573eeaafc582a0487f1053..0000000000000000000000000000000000000000 --- a/src/common/micro/modi_ini_rain_ice.F90 +++ /dev/null @@ -1,16 +0,0 @@ -! ######spl - MODULE MODI_INI_RAIN_ICE -! ######################## -! -INTERFACE - SUBROUTINE INI_RAIN_ICE ( KLUOUT, HCLOUD ) -! -INTEGER, INTENT(IN) :: KLUOUT ! Logical unit number for prints -! -CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! Indicator of the cloud scheme -! -END SUBROUTINE INI_RAIN_ICE -! -END INTERFACE -! -END MODULE MODI_INI_RAIN_ICE diff --git a/src/common/micro/modi_ini_snow.F90 b/src/common/micro/modi_ini_snow.F90 deleted file mode 100644 index 788ec7c9a8f216a921b5ddcbba27ab78195188b0..0000000000000000000000000000000000000000 --- a/src/common/micro/modi_ini_snow.F90 +++ /dev/null @@ -1,15 +0,0 @@ -! ######spl - MODULE MODI_INI_SNOW -! ######################## -! -INTERFACE - SUBROUTINE INI_SNOW ( KLUOUT ) -! -INTEGER, INTENT(IN) :: KLUOUT ! Logical unit number for prints - -! -END SUBROUTINE INI_SNOW -! -END INTERFACE -! -END MODULE MODI_INI_SNOW diff --git a/src/common/micro/modi_ini_tiwmx.F90 b/src/common/micro/modi_ini_tiwmx.F90 deleted file mode 100644 index 9ef7e6409e537b13fe57af01140bc353dddfe029..0000000000000000000000000000000000000000 --- a/src/common/micro/modi_ini_tiwmx.F90 +++ /dev/null @@ -1,16 +0,0 @@ -!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. -! ######spl - MODULE MODI_INI_TIWMX -! ##################### -! -INTERFACE -! -SUBROUTINE INI_TIWMX -END SUBROUTINE INI_TIWMX -! -END INTERFACE -! -END MODULE MODI_INI_TIWMX diff --git a/src/common/micro/modi_rain_ice.F90 b/src/common/micro/modi_rain_ice.F90 index bf65a39d521a0b9ce389d053524d36f815a21f44..96a81c4c9f02a12507ca7ef07109defa79b2a6fa 100644 --- a/src/common/micro/modi_rain_ice.F90 +++ b/src/common/micro/modi_rain_ice.F90 @@ -4,7 +4,6 @@ ! INTERFACE SUBROUTINE RAIN_ICE ( D, CST, PARAMI, ICEP, ICED, BUCONF, & - KPROMA, OCND2, HSUBG_AUCV_RC, HSUBG_AUCV_RI, & PTSTEP, KRR, PEXN, & PDZZ, PRHODJ, PRHODREF, PEXNREF, PPABST, PCIT, PCLDFR,& PHLC_HRC, PHLC_HCF, PHLI_HRI, PHLI_HCF, & @@ -18,9 +17,10 @@ INTERFACE ! USE MODD_BUDGET, ONLY: TBUDGETDATA, TBUDGETCONF_t USE MODD_CST, ONLY: CST_t -USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_TURB_n, ONLY: TURB_t USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t ! IMPLICIT NONE @@ -31,10 +31,6 @@ TYPE(PARAM_ICE_t), INTENT(IN) :: PARAMI TYPE(RAIN_ICE_PARAM_t), INTENT(IN) :: ICEP TYPE(RAIN_ICE_DESCR_t), INTENT(IN) :: ICED TYPE(TBUDGETCONF_t), INTENT(IN) :: BUCONF -INTEGER, INTENT(IN) :: KPROMA ! cache-blocking factor for microphysic loop -LOGICAL :: OCND2 ! Logical switch to separate liquid and ice -CHARACTER(LEN=4), INTENT(IN) :: HSUBG_AUCV_RC ! Kind of Subgrid autoconversion method -CHARACTER(LEN=80), INTENT(IN) :: HSUBG_AUCV_RI ! Kind of Subgrid autoconversion method REAL, INTENT(IN) :: PTSTEP ! Double Time step (single if cold start) INTEGER, INTENT(IN) :: KRR ! Number of moist variable ! diff --git a/src/common/micro/modi_rain_ice_old.F90 b/src/common/micro/modi_rain_ice_old.F90 index 8e4d4c289011fd02befd2d739019a3dc64581e96..65af0d96fb5cebee4252bc028a6277b6581294ee 100644 --- a/src/common/micro/modi_rain_ice_old.F90 +++ b/src/common/micro/modi_rain_ice_old.F90 @@ -21,9 +21,9 @@ INTERFACE USE MODD_BUDGET, ONLY: TBUDGETDATA, TBUDGETCONF_t USE MODD_DIMPHYEX, ONLY: DIMPHYEX_T USE MODD_CST, ONLY: CST_T -USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_T -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_T +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_T +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_T ! TYPE(DIMPHYEX_T), INTENT(IN) :: D TYPE(CST_T), INTENT(IN) :: CST diff --git a/src/common/micro/rain_ice.F90 b/src/common/micro/rain_ice.F90 index a07d16b212fae884cf74a21a71f3480afba2ed41..d7574bb83f4afd5811c46e975b22b4b06262e3c4 100644 --- a/src/common/micro/rain_ice.F90 +++ b/src/common/micro/rain_ice.F90 @@ -5,7 +5,6 @@ !----------------------------------------------------------------- ! ######spl SUBROUTINE RAIN_ICE ( D, CST, PARAMI, ICEP, ICED, BUCONF, & - KPROMA, OCND2, HSUBG_AUCV_RC, HSUBG_AUCV_RI, & PTSTEP, KRR, PEXN, & PDZZ, PRHODJ, PRHODREF, PEXNREF, PPABST, PCIT, PCLDFR,& PHLC_HRC, PHLC_HCF, PHLI_HRI, PHLI_HCF, & @@ -184,9 +183,10 @@ USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_BUDGET, ONLY: TBUDGETDATA, TBUDGETCONF_t, NBUDGET_TH, NBUDGET_RV, NBUDGET_RC, & NBUDGET_RI, NBUDGET_RR, NBUDGET_RS, NBUDGET_RG, NBUDGET_RH USE MODD_CST, ONLY: CST_t -USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t -USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_t -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_t +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICE_t +USE MODD_RAIN_ICE_DESCR_n, ONLY: RAIN_ICE_DESCR_t +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAM_t +USE MODD_TURB_n, ONLY: TURB_t USE MODD_FIELDS_ADDRESS, ONLY : & ! common fields adress & ITH, & ! Potential temperature & IRV, & ! Water vapor @@ -218,10 +218,6 @@ TYPE(PARAM_ICE_t), INTENT(IN) :: PARAMI TYPE(RAIN_ICE_PARAM_t), INTENT(IN) :: ICEP TYPE(RAIN_ICE_DESCR_t), INTENT(IN) :: ICED TYPE(TBUDGETCONF_t), INTENT(IN) :: BUCONF -INTEGER, INTENT(IN) :: KPROMA ! cache-blocking factor for microphysic loop -LOGICAL :: OCND2 ! Logical switch to separate liquid and ice -CHARACTER(LEN=4), INTENT(IN) :: HSUBG_AUCV_RC ! Kind of Subgrid autoconversion method -CHARACTER(LEN=80), INTENT(IN) :: HSUBG_AUCV_RI ! Kind of Subgrid autoconversion method REAL, INTENT(IN) :: PTSTEP ! Double Time step (single if cold start) INTEGER, INTENT(IN) :: KRR ! Number of moist variable ! @@ -311,8 +307,8 @@ IIJB=D%NIJB IIJE=D%NIJE !------------------------------------------------------------------------------- ! -IF(OCND2) THEN - CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'RAIN_ICE', 'OCND2 OPTION NOT CODED IN THIS RAIN_ICE VERSION') +IF(PARAMI%LOCND2) THEN + CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'RAIN_ICE', 'LOCND2 OPTION NOT CODED IN THIS RAIN_ICE VERSION') END IF ZINV_TSTEP=1./PTSTEP ! @@ -432,13 +428,13 @@ ENDDO ! IF(PARAMI%LPACK_MICRO) THEN ISIZE=COUNT(LLMICRO) ! Number of points with active microphysics - !KPROMA is the requested size for cache_blocking loop + !PARAMI%NPROMICRO is the requested size for cache_blocking loop !IPROMA is the effective size !This parameter must be computed here because it is used for array dimensioning in ice4_pack - IF (KPROMA > 0 .AND. ISIZE > 0) THEN + IF (PARAMI%NPROMICRO > 0 .AND. ISIZE > 0) THEN ! Cache-blocking is active ! number of chunks : - IGPBLKS = (ISIZE-1)/MIN(KPROMA,ISIZE)+1 + IGPBLKS = (ISIZE-1)/MIN(PARAMI%NPROMICRO,ISIZE)+1 ! Adjust IPROMA to limit the number of small chunks IPROMA=(ISIZE-1)/IGPBLKS+1 ELSE @@ -453,7 +449,6 @@ ENDIF !This part is put in another routine to separate pack/unpack operations from computations CALL ICE4_PACK(D, CST, PARAMI, ICEP, ICED, BUCONF, & IPROMA, ISIZE, ISIZE2, & - HSUBG_AUCV_RC, HSUBG_AUCV_RI, & PTSTEP, KRR, LLMICRO, PEXN, & PRHODJ, PRHODREF, PEXNREF, PPABST, PCIT, PCLDFR, & PHLC_HRC, PHLC_HCF, PHLI_HRI, PHLI_HCF, & diff --git a/src/common/micro/rain_ice_old.F90 b/src/common/micro/rain_ice_old.F90 index 1d792dbd9b5a77252a12939baba73be5a2b51440..10e830dc31f81b18c041ad4ec42db8effde81214 100644 --- a/src/common/micro/rain_ice_old.F90 +++ b/src/common/micro/rain_ice_old.F90 @@ -18,9 +18,9 @@ USE YOMHOOK, ONLY: LHOOK, DR_HOOK USE MODD_DIMPHYEX, ONLY: DIMPHYEX_T USE MODD_CST, ONLY: CST_T - USE MODD_PARAM_ICE, ONLY: PARAM_ICE_t - USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM_T - USE MODD_RAIN_ICE_DESCR, ONLY: RAIN_ICE_DESCR_T + USE MODD_PARAM_ICE_N, ONLY: PARAM_ICE_t + USE MODD_RAIN_ICE_PARAM_N, ONLY: RAIN_ICE_PARAM_T + USE MODD_RAIN_ICE_DESCR_N, ONLY: RAIN_ICE_DESCR_T ! ###################################################################### ! !!**** * - compute the explicit microphysical sources diff --git a/src/common/turb/modd_cturb.F90 b/src/common/turb/modd_cturb.F90 index 10b21c7580b75424c1eca936247d1f46ff4c7635..166228d89a0d09d8a716800e22f77c512ee902f4 100644 --- a/src/common/turb/modd_cturb.F90 +++ b/src/common/turb/modd_cturb.F90 @@ -44,30 +44,20 @@ TYPE CSTURB_t ! REAL :: XCMFS ! constant for the momentum flux due to shear REAL :: XCMFB ! constant for the momentum flux due to buoyancy -REAL :: XCSHF ! constant for the sensible heat flux -REAL :: XCHF ! constant for the humidity flux -REAL :: XCTV ! constant for the temperature variance -REAL :: XCHV ! constant for the humidity variance -REAL :: XCHT1 ! first ct. for the humidity-temperature correlation -REAL :: XCHT2 ! second ct. for the humidity-temperature correlation -! -REAL :: XCPR1 ! first ct. for the turbulent Prandtl numbers +! REAL :: XCPR2 ! second ct. for the turbulent Prandtl numbers REAL :: XCPR3 ! third ct. for the turbulent Prandtl numbers REAL :: XCPR4 ! fourth ct. for the turbulent Prandtl numbers REAL :: XCPR5 ! fifth ct. for the turbulent Prandtl numbers ! REAL :: XCET ! constant into the transport term of the TKE eq. -REAL :: XCED ! constant into the dissipation term of the TKE eq. ! REAL :: XCDP ! ct. for the production term in the dissipation eq. REAL :: XCDD ! ct. for the destruction term in the dissipation eq. REAL :: XCDT ! ct. for the transport term in the dissipation eq. ! -REAL :: XTKEMIN ! mimimum value for the TKE REAL :: XRM17 ! Rodier et al 2017 constant in shear term for mixing length ! -REAL :: XLINI ! initial value for BL mixing length REAL :: XLINF ! to prevent division by zero in the BL algorithm ! REAL :: XALPSBL ! constant linking TKE and friction velocity in the SBL @@ -78,7 +68,6 @@ REAL :: XA2 ! Constant a2 for wind pressure-correlations REAL :: XA3 ! Constant a3 for wind pressure-correlations REAL :: XA5 ! Constant a5 for temperature pressure-correlations REAL :: XCTD ! Constant for temperature and vapor dissipation -REAL :: XCTP ! Constant for temperature and vapor pressure-correlations ! REAL :: XPHI_LIM ! Threshold value for Phi3 and Psi3 REAL :: XSBL_O_BL ! SBL height / BL height ratio @@ -90,30 +79,20 @@ TYPE(CSTURB_t), TARGET, SAVE :: CSTURB ! REAL,POINTER :: XCMFS => NULL() REAL,POINTER :: XCMFB => NULL() -REAL,POINTER :: XCSHF => NULL() -REAL,POINTER :: XCHF => NULL() -REAL,POINTER :: XCTV => NULL() -REAL,POINTER :: XCHV => NULL() -REAL,POINTER :: XCHT1 => NULL() -REAL,POINTER :: XCHT2 => NULL() -! -REAL,POINTER :: XCPR1 => NULL() +! REAL,POINTER :: XCPR2 => NULL() REAL,POINTER :: XCPR3 => NULL() REAL,POINTER :: XCPR4 => NULL() REAL,POINTER :: XCPR5 => NULL() ! REAL,POINTER :: XCET => NULL() -REAL,POINTER :: XCED => NULL() ! REAL,POINTER :: XCDP => NULL() REAL,POINTER :: XCDD => NULL() REAL,POINTER :: XCDT => NULL() ! -REAL,POINTER :: XTKEMIN => NULL() REAL,POINTER :: XRM17 => NULL() ! -REAL,POINTER :: XLINI => NULL() REAL,POINTER :: XLINF => NULL() ! REAL,POINTER :: XALPSBL => NULL() @@ -124,7 +103,6 @@ REAL,POINTER :: XA2 => NULL() REAL,POINTER :: XA3 => NULL() REAL,POINTER :: XA5 => NULL() REAL,POINTER :: XCTD => NULL() -REAL,POINTER :: XCTP => NULL() ! REAL,POINTER :: XPHI_LIM => NULL() REAL,POINTER :: XSBL_O_BL => NULL() @@ -135,30 +113,20 @@ SUBROUTINE CTURB_ASSOCIATE() IMPLICIT NONE XCMFS=>CSTURB%XCMFS XCMFB=>CSTURB%XCMFB - XCSHF=>CSTURB%XCSHF - XCHF=>CSTURB%XCHF - XCTV=>CSTURB%XCTV - XCHV=>CSTURB%XCHV - XCHT1=>CSTURB%XCHT1 - XCHT2=>CSTURB%XCHT2 ! - XCPR1=>CSTURB%XCPR1 XCPR2=>CSTURB%XCPR2 XCPR3=>CSTURB%XCPR3 XCPR4=>CSTURB%XCPR4 XCPR5=>CSTURB%XCPR5 ! XCET=>CSTURB%XCET - XCED=>CSTURB%XCED ! XCDP=>CSTURB%XCDP XCDD=>CSTURB%XCDD XCDT=>CSTURB%XCDT ! - XTKEMIN=>CSTURB%XTKEMIN XRM17=>CSTURB%XRM17 ! - XLINI=>CSTURB%XLINI XLINF=>CSTURB%XLINF ! XALPSBL=>CSTURB%XALPSBL @@ -169,7 +137,6 @@ IMPLICIT NONE XA3=>CSTURB%XA3 XA5=>CSTURB%XA5 XCTD=>CSTURB%XCTD - XCTP=>CSTURB%XCTP ! XPHI_LIM=>CSTURB%XPHI_LIM XSBL_O_BL=>CSTURB%XSBL_O_BL diff --git a/src/common/turb/modd_diag_in_run.F90 b/src/common/turb/modd_diag_in_run.F90 deleted file mode 100644 index 6f9829570ec8a9f75685491317b5adc86b18e623..0000000000000000000000000000000000000000 --- a/src/common/turb/modd_diag_in_run.F90 +++ /dev/null @@ -1,38 +0,0 @@ -!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 MODD_DIAG_IN_RUN -! Modifications -!! 02/2018 Q.Libois ECRAD -!! Bielli S. 02/2019 Sea salt : significant sea wave height influences salt emission; 5 salt modes -! -!* stores instantaneous diagnostic arrays for the current time-step -! -IMPLICIT NONE - -LOGICAL :: LDIAG_IN_RUN ! flag for diagnostics -! -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_RN ! net radiation -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_H ! sensible heat flux -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_LE ! Total latent heat flux -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_LEI ! Solid latent heat flux -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_GFLUX ! ground flux -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_LWD ! incoming longwave at the surface -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_LWU ! outcoming longwave at the surface -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_SWD ! incoming Shortwave at the surface -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_SWU ! outcoming Shortwave at the surface -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_SWDIR ! incoming Shortwave direct at the surface -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_SWDIFF! incoming Shortwave diffuse at the surface -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_T2M ! temperature at 2m -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_Q2M ! humidity at 2m -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_HU2M ! relative humidity at 2m -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_ZON10M! zonal wind at 10m -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_MER10M! meridian wind at 10m -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_DSTAOD! dust aerosol optical depth -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_SFCO2 ! CO2 Surface flux -REAL, DIMENSION(:,:,:), ALLOCATABLE :: XCURRENT_TKE_DISS ! Tke dissipation rate -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_SLTAOD ! Salt aerosol optical depth -REAL, DIMENSION(:,:), ALLOCATABLE :: XCURRENT_ZWS ! Significant height of waves -END MODULE MODD_DIAG_IN_RUN diff --git a/src/common/turb/modd_param_mfshalln.F90 b/src/common/turb/modd_param_mfshalln.F90 index 72a5644bf955b2cf90266ebeed7b161564f081bc..05e586f47d3c73d86e00a1fb01b0c4fd055fb942 100644 --- a/src/common/turb/modd_param_mfshalln.F90 +++ b/src/common/turb/modd_param_mfshalln.F90 @@ -1,21 +1,21 @@ !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 version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt !MNH_LIC for details. version 1. !----------------------------------------------------------------- !----------------------------------------------------------------- ! ############################# MODULE MODD_PARAM_MFSHALL_n ! ############################# -! -!!**** *MODD_PARAM_MFSHALL_n* - Declaration of Mass flux scheme free parameters +!> @file +!! *MODD_PARAM_MFSHALL_n* - Declaration of Mass flux scheme free parameters !! !! PURPOSE !! ------- !! The purpose of this declarative module is to declare the !! variables that may be set by namelist for the mass flux scheme !! -!!** IMPLICIT ARGUMENTS +!! IMPLICIT ARGUMENTS !! ------------------ !! None !! @@ -42,54 +42,46 @@ IMPLICIT NONE TYPE PARAM_MFSHALL_t -REAL :: XIMPL_MF ! degre of implicitness +REAL :: XIMPL_MF !< degre of implicitness -CHARACTER (LEN=4) :: CMF_UPDRAFT ! Type of Mass Flux Scheme - ! 'NONE' if no parameterization -CHARACTER (LEN=4) :: CMF_CLOUD +CHARACTER (LEN=4) :: CMF_UPDRAFT !< Type of Mass Flux Scheme + !! 'NONE' if no parameterization +CHARACTER (LEN=4) :: CMF_CLOUD !< Type of cloud scheme associated -LOGICAL :: LMIXUV ! True if mixing of momentum -LOGICAL :: LMF_FLX ! logical switch for the storage of - ! the mass flux fluxes -REAL :: XALP_PERT ! coefficient for the perturbation of - ! theta_l and r_t at the first level of - ! the updraft -REAL :: XABUO ! coefficient of the buoyancy term in the w_up equation -REAL :: XBENTR ! coefficient of the entrainment term in the w_up equation -REAL :: XBDETR ! coefficient of the detrainment term in the w_up equation -REAL :: XCMF ! coefficient for the mass flux at the first level - ! of the updraft (closure) -REAL :: XENTR_MF ! entrainment constant (m/Pa) = 0.2 (m) -REAL :: XCRAD_MF ! cloud radius in cloudy part -REAL :: XENTR_DRY ! coefficient for entrainment in dry part -REAL :: XDETR_DRY ! coefficient for detrainment in dry part -REAL :: XDETR_LUP ! coefficient for detrainment in dry part -REAL :: XKCF_MF ! coefficient for cloud fraction -REAL :: XKRC_MF ! coefficient for convective rc +LOGICAL :: LMIXUV !< True if mixing of momentum +LOGICAL :: LMF_FLX !< logical switch for the storage of the mass flux fluxes +REAL :: XALP_PERT !< coefficient for the perturbation of + !! theta_l and r_t at the first level of the updraft +REAL :: XABUO !< coefficient of the buoyancy term in the w_up equation +REAL :: XBENTR !< coefficient of the entrainment term in the w_up equation +REAL :: XBDETR !< coefficient of the detrainment term in the w_up equation +REAL :: XCMF !< coefficient for the mass flux at the first level of the updraft (closure) +REAL :: XENTR_MF !< entrainment constant (m/Pa) = 0.2 (m) +REAL :: XCRAD_MF !< cloud radius in cloudy part +REAL :: XENTR_DRY !< coefficient for entrainment in dry part +REAL :: XDETR_DRY !< coefficient for detrainment in dry part +REAL :: XDETR_LUP !< coefficient for detrainment in dry part +REAL :: XKCF_MF !< coefficient for cloud fraction +REAL :: XKRC_MF !< coefficient for convective rc REAL :: XTAUSIGMF -REAL :: XPRES_UV ! coefficient for pressure term in wind - ! mixing -REAL :: XALPHA_MF ! coefficient for cloudy fraction -REAL :: XSIGMA_MF ! coefficient for sigma computation -REAL :: XFRAC_UP_MAX! maximum Updraft fraction -! -! Parameter for Rio et al (2010) formulation for entrainment and detrainment (RHCJ10) -REAL :: XA1 -REAL :: XB -REAL :: XC -REAL :: XBETA1 -! -! Parameters for closure assumption of Hourdin et al 2002 - -REAL :: XR ! Aspect ratio of updraft +REAL :: XPRES_UV !< coefficient for pressure term in wind mixing +REAL :: XALPHA_MF !< coefficient for cloudy fraction +REAL :: XSIGMA_MF !< coefficient for sigma computation +REAL :: XFRAC_UP_MAX!< maximum Updraft fraction +! +REAL :: XA1 !< Parameter for Rio et al (2010) formulation for entrainment and detrainment (RHCJ10) +REAL :: XB !! +REAL :: XC !! +REAL :: XBETA1 !! ! -! Grey Zone -LOGICAL :: LGZ ! Grey Zone Surface Closure -REAL :: XGZ ! Tuning of the surface initialisation +REAL :: XR !< Parameter for closure assumption of Hourdin et al (2002): aspect ratio of updraft ! -! Thermodynamic parameter -REAL :: XLAMBDA_MF ! Lambda to compute ThetaS1 from ThetaL +LOGICAL :: LGZ !< Grey Zone Surface Closure +REAL :: XGZ !< Tuning of the surface initialisation for Grey Zone +! +LOGICAL :: LTHETAS_MF !< .TRUE. to use ThetaS1 instead of ThetaL +REAL :: XLAMBDA_MF !< Thermodynamic parameter: Lambda to compute ThetaS1 from ThetaL END TYPE PARAM_MFSHALL_t @@ -124,14 +116,29 @@ REAL, POINTER :: XB=>NULL() REAL, POINTER :: XC=>NULL() REAL, POINTER :: XBETA1=>NULL() REAL, POINTER :: XR=>NULL() +LOGICAL, POINTER :: LTHETAS_MF=>NULL() REAL, POINTER :: XLAMBDA_MF=>NULL() LOGICAL, POINTER :: LGZ=>NULL() REAL, POINTER :: XGZ=>NULL() +! +NAMELIST/NAM_PARAM_MFSHALLn/XIMPL_MF,CMF_UPDRAFT,CMF_CLOUD,LMIXUV,LMF_FLX,& + XALP_PERT,XABUO,XBENTR,XBDETR,XCMF,XENTR_MF,& + XCRAD_MF,XENTR_DRY,XDETR_DRY,XDETR_LUP,XKCF_MF,& + XKRC_MF,XTAUSIGMF,XPRES_UV,XALPHA_MF,XSIGMA_MF,& + XFRAC_UP_MAX,XA1,XB,XC,XBETA1,XR,LTHETAS_MF,LGZ,XGZ +! +!------------------------------------------------------------------------------- +! CONTAINS SUBROUTINE PARAM_MFSHALL_GOTO_MODEL(KFROM, KTO) +!! This subroutine associate all the pointers to the right component of +!! the right strucuture. A value can be accessed through the structure PARAM_MFSHALLN +!! or through the strucuture PARAM_MFSHALL_MODEL(KTO) or directly through these pointers. INTEGER, INTENT(IN) :: KFROM, KTO ! +IF(.NOT. ASSOCIATED(PARAM_MFSHALLN, PARAM_MFSHALL_MODEL(KTO))) THEN +! PARAM_MFSHALLN => PARAM_MFSHALL_MODEL(KTO) ! ! Save current state for allocated arrays @@ -165,10 +172,139 @@ XB=>PARAM_MFSHALL_MODEL(KTO)%XB XC=>PARAM_MFSHALL_MODEL(KTO)%XC XBETA1=>PARAM_MFSHALL_MODEL(KTO)%XBETA1 XR=>PARAM_MFSHALL_MODEL(KTO)%XR +LTHETAS_MF=>PARAM_MFSHALL_MODEL(KTO)%LTHETAS_MF XLAMBDA_MF=>PARAM_MFSHALL_MODEL(KTO)%XLAMBDA_MF LGZ=>PARAM_MFSHALL_MODEL(KTO)%LGZ XGZ=>PARAM_MFSHALL_MODEL(KTO)%XGZ ! +ENDIF +! END SUBROUTINE PARAM_MFSHALL_GOTO_MODEL +SUBROUTINE PARAM_MFSHALLN_INIT(HPROGRAM, KUNITNML, LDNEEDNAM, KLUOUT, & + &LDDEFAULTVAL, LDREADNAM, LDCHECK, KPRINT) +!!*** *PARAM_MFSHALLN* - Code needed to initialize the MODD_PARAM_MFSHALL_n module +!! +!!* PURPOSE +!! ------- +!! Sets the default values, reads the namelist, performs the checks and prints +!! +!!* METHOD +!! ------ +!! 0. Declarations +!! 1. Declaration of arguments +!! 2. Declaration of local variables +!! 1. Default values +!! 2. Namelist +!! 3. Checks +!! 4. Prints +!! +!! AUTHOR +!! ------ +!! S. Riette +!! +!! MODIFICATIONS +!! ------------- +!! Original Feb 2023 +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! --------------- +! +USE MODE_POSNAM_PHY, ONLY: POSNAM_PHY +USE MODE_MSG, ONLY: PRINT_MSG, NVERB_FATAL +USE MODE_CHECK_NAM_VAL, ONLY: CHECK_NAM_VAL_CHAR, CHECK_NAM_VAL_REAL, CHECK_NAM_VAL_INT +! +IMPLICIT NONE +! +!* 0.1. Declaration of arguments +! ------------------------ +! +CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM !< Name of the calling program +INTEGER, INTENT(IN) :: KUNITNML !< Logical unit to access the namelist +LOGICAL, INTENT(IN) :: LDNEEDNAM !< True to abort if namelist is absent +INTEGER, INTENT(IN) :: KLUOUT !< Logical unit for outputs +LOGICAL, OPTIONAL, INTENT(IN) :: LDDEFAULTVAL !< Must we initialize variables with default values (defaults to .TRUE.) +LOGICAL, OPTIONAL, INTENT(IN) :: LDREADNAM !< Must we read the namelist (defaults to .TRUE.) +LOGICAL, OPTIONAL, INTENT(IN) :: LDCHECK !< Must we perform some checks on values (defaults to .TRUE.) +INTEGER, OPTIONAL, INTENT(IN) :: KPRINT !< Print level (defaults to 0): 0 for no print, 1 to safely print namelist, + !! 2 to print informative messages +! +!* 0.2 Declaration of local variables +! ------------------------------ +! +LOGICAL :: LLDEFAULTVAL, LLREADNAM, LLCHECK, LLFOUND +INTEGER :: IPRINT + +LLDEFAULTVAL=.TRUE. +LLREADNAM=.TRUE. +LLCHECK=.TRUE. +IPRINT=0 +IF(PRESENT(LDDEFAULTVAL)) LLDEFAULTVAL=LDDEFAULTVAL +IF(PRESENT(LDREADNAM )) LLREADNAM =LDREADNAM +IF(PRESENT(LDCHECK )) LLCHECK =LDCHECK +IF(PRESENT(KPRINT )) IPRINT =KPRINT +! +!* 1. DEFAULT VALUES +! ----------------- +! +IF(LLDEFAULTVAL) THEN + XIMPL_MF=1. + CMF_UPDRAFT='EDKF' + CMF_CLOUD='DIRE' + LMIXUV=.TRUE. + LMF_FLX=.FALSE. + XALP_PERT=0.3 + XABUO=1. + XBENTR=1. + XBDETR=0. + XCMF=0.065 + XENTR_MF=0.035 + XCRAD_MF=50. + XENTR_DRY=0.55 + XDETR_DRY=10. + XDETR_LUP=1. + XKCF_MF=2.75 + XKRC_MF=1. + XTAUSIGMF=600. + XPRES_UV=0.5 + XALPHA_MF=2. + XSIGMA_MF=20. + XFRAC_UP_MAX=0.33 + XA1=2./3. + XB=0.002 + XC=0.012 + XBETA1=0.9 + XR=2. + LTHETAS_MF=.FALSE. + XLAMBDA_MF=0. + LGZ=.FALSE. + XGZ=1.83 ! between 1.83 and 1.33 +ENDIF +! +!* 2. NAMELIST +! ----------- +! +IF(LLREADNAM) THEN + CALL POSNAM_PHY(KUNITNML, 'NAM_PARAM_MFSHALLN', LDNEEDNAM, LLFOUND, KLUOUT) + IF(LLFOUND) READ(UNIT=KUNITNML, NML=NAM_PARAM_MFSHALLn) +ENDIF +! +!* 3. CHECKS +! --------- +! +IF(LLCHECK) THEN + CALL CHECK_NAM_VAL_CHAR(KLUOUT, 'CMF_CLOUD', CMF_CLOUD, 'NONE', 'STAT', 'DIRE', 'BIGA') + CALL CHECK_NAM_VAL_CHAR(KLUOUT, 'CMF_UPDRAFT', CMF_UPDRAFT, 'NONE', 'EDKF', 'RHCJ', 'RAHA') +ENDIF +! +!* 3. PRINTS +! --------- +! +IF(IPRINT>=1) THEN + WRITE(UNIT=KLUOUT,NML=NAM_PARAM_MFSHALLn) +ENDIF +! +END SUBROUTINE PARAM_MFSHALLN_INIT +! END MODULE MODD_PARAM_MFSHALL_n diff --git a/src/common/turb/modd_turbn.F90 b/src/common/turb/modd_turbn.F90 index defaab643b41917ccd50e45c98c533aee266b3bf..3cf66c444e04955f9cede89b85d4d21f78a0fba5 100644 --- a/src/common/turb/modd_turbn.F90 +++ b/src/common/turb/modd_turbn.F90 @@ -6,7 +6,7 @@ ! ################## MODULE MODD_TURB_n ! ################## -! +!> @file !!**** *MODD_TURB$n* - declaration of turbulence scheme free parameters !! !! PURPOSE @@ -53,90 +53,84 @@ IMPLICIT NONE TYPE TURB_t ! ! - REAL :: XIMPL ! implicitness degree for the vertical terms of - ! the turbulence scheme - REAL :: XKEMIN ! mimimum value for the TKE - REAL :: XCEDIS ! Constant for dissipation of Tke - REAL :: XCADAP ! Coefficient for ADAPtative mixing length - CHARACTER (LEN=4) :: CTURBLEN ! type of length used for the closure - ! 'BL89' Bougeault and Lacarrere scheme - ! 'DELT' length = ( volum) ** 1/3 - CHARACTER (LEN=4) :: CTURBDIM ! dimensionality of the turbulence scheme - ! '1DIM' for purely vertical computations - ! '3DIM' for computations in the 3 - ! directions - LOGICAL :: LTURB_FLX ! logical switch for the storage of all - ! the turbulent fluxes - LOGICAL :: LTURB_DIAG! logical switch for the storage of some - ! turbulence related diagnostics - LOGICAL :: LSUBG_COND! Switch for subgrid condensation - LOGICAL :: LSIGMAS ! Switch for using Sigma_s from turbulence scheme - LOGICAL :: LSIG_CONV ! Switch for computing Sigma_s due to convection -! - LOGICAL :: LHARAT - LOGICAL :: LSTATNW ! SWITCH LSTATNW - LOGICAL :: LRMC01 ! Switch for computing separate mixing -! ! and dissipative length in the SBL -! ! according to Redelsperger, Mahe & -! ! Carlotti 2001 - CHARACTER(LEN=4) :: CTOM ! type of Third Order Moments - ! 'NONE' none - ! 'TM06' Tomas Masson 2006 - CHARACTER(LEN=4) :: CSUBG_AUCV ! type of subgrid rc->rr autoconv. method - CHARACTER(LEN=80) :: CSUBG_AUCV_RI ! type of subgrid ri->rs autoconv. method - CHARACTER(LEN=80) :: CCONDENS ! subrgrid condensation PDF - CHARACTER(LEN=4) :: CLAMBDA3 ! lambda3 choice for subgrid cloud scheme - CHARACTER(LEN=80) :: CSUBG_MF_PDF ! PDF to use for MF cloud autoconversions + REAL :: XIMPL !< implicitness degree for the vertical terms of the turbulence scheme + REAL :: XTKEMIN !< mimimum value for the TKE + REAL :: XCED !< Constant for dissipation of Tke + REAL :: XCTP !< Constant for temperature and vapor pressure-correlations + REAL :: XCSHF !< constant for the sensible heat flux + REAL :: XCHF !< constant for the humidity flux + REAL :: XCTV !< constant for the temperature variance + REAL :: XCHV !< constant for the humidity variance + REAL :: XCHT1 !< first ct. for the humidity-temperature correlation + REAL :: XCHT2 !< second ct. for the humidity-temperature correlation + REAL :: XCPR1 !< first ct. for the turbulent Prandtl numbers + REAL :: XCADAP !< Coefficient for ADAPtative mixing length + CHARACTER (LEN=4) :: CTURBLEN !< type of length used for the closure: + !! 'BL89' Bougeault and Lacarrere scheme; + !! 'DELT' length = ( volum) ** 1/3 + CHARACTER (LEN=4) :: CTURBDIM !< dimensionality of the turbulence scheme: + !! '1DIM' for purely vertical computations; + !! '3DIM' for computations in the 3 directions + LOGICAL :: LTURB_FLX !< logical switch for the storage of all the turbulent fluxes + LOGICAL :: LTURB_DIAG !< logical switch for the storage of some turbulence related diagnostics + LOGICAL :: LSIG_CONV !< Switch for computing Sigma_s due to convection +! + LOGICAL :: LHARAT !< if true RACMO turbulence is used + LOGICAL :: LRMC01 !< Switch for computing separate mixing and dissipative length in the SBL + !! according to Redelsperger, Mahe & Carlotti 2001 + CHARACTER(LEN=4) :: CTOM !< type of Third Order Moments: + !! 'NONE' none; + !! 'TM06' Tomas Masson 2006 ! REAL, DIMENSION(:,:), POINTER :: XBL_DEPTH=>NULL() ! BL depth for TOMS computations ! REAL, DIMENSION(:,:), POINTER :: XSBL_DEPTH=>NULL()! SurfaceBL depth for RMC01 computations ! REAL, DIMENSION(:,:,:), POINTER :: XWTHVMF=>NULL()! Mass Flux vert. transport of buoyancy - REAL :: VSIGQSAT ! coeff applied to qsat variance contribution - REAL, DIMENSION(:,:,:), POINTER :: XDYP=>NULL() ! Dynamical production of Kinetic energy - REAL, DIMENSION(:,:,:), POINTER :: XTHP=>NULL() ! Thermal production of Kinetic energy - REAL, DIMENSION(:,:,:), POINTER :: XTR=>NULL() ! Transport production of Kinetic energy - REAL, DIMENSION(:,:,:), POINTER :: XDISS=>NULL() ! Dissipation of Kinetic energy - REAL, DIMENSION(:,:,:), POINTER :: XLEM=>NULL() ! Mixing length - REAL, DIMENSION(:,:,:), POINTER :: XSSUFL_C=>NULL() ! O-A interface flux for u - REAL, DIMENSION(:,:,:), POINTER :: XSSVFL_C=>NULL() ! O-A interface flux for v - REAL, DIMENSION(:,:,:), POINTER :: XSSTFL_C=>NULL() ! O-A interface flux for theta - REAL, DIMENSION(:,:,:), POINTER :: XSSRFL_C=>NULL() ! O-A interface flux for vapor - LOGICAL :: LLEONARD ! logical switch for the computation of the Leornard Terms - REAL :: XCOEFHGRADTHL ! coeff applied to thl contribution - REAL :: XCOEFHGRADRM ! coeff applied to mixing ratio contribution - REAL :: XALTHGRAD ! altitude from which to apply the Leonard terms - REAL :: XCLDTHOLD ! cloud threshold to apply the Leonard terms - ! negative value : applied everywhere - ! 0.000001 applied only inside the clouds ri+rc > 10**-6 kg/kg -! + REAL, DIMENSION(:,:,:), POINTER :: XDYP=>NULL() !< Dynamical production of Kinetic energy + REAL, DIMENSION(:,:,:), POINTER :: XTHP=>NULL() !< Thermal production of Kinetic energy + REAL, DIMENSION(:,:,:), POINTER :: XTR=>NULL() !< Transport production of Kinetic energy + REAL, DIMENSION(:,:,:), POINTER :: XDISS=>NULL() !< Dissipation of Kinetic energy + REAL, DIMENSION(:,:,:), POINTER :: XLEM=>NULL() !< Mixing length + REAL, DIMENSION(:,:,:), POINTER :: XSSUFL_C=>NULL() !< O-A interface flux for u + REAL, DIMENSION(:,:,:), POINTER :: XSSVFL_C=>NULL() !< O-A interface flux for v + REAL, DIMENSION(:,:,:), POINTER :: XSSTFL_C=>NULL() !< O-A interface flux for theta + REAL, DIMENSION(:,:,:), POINTER :: XSSRFL_C=>NULL() !< O-A interface flux for vapor + LOGICAL :: LLEONARD !< logical switch for the computation of the Leornard Terms + REAL :: XCOEFHGRADTHL !< coeff applied to thl contribution + REAL :: XCOEFHGRADRM !< coeff applied to mixing ratio contribution + REAL :: XALTHGRAD !< altitude from which to apply the Leonard terms + REAL :: XCLDTHOLD !< cloud threshold to apply the Leonard terms: + !! negative value to apply everywhere; + !! 0.000001 applied only inside the clouds ri+rc > 10**-6 kg/kg + REAL :: XLINI !< initial value for BL mixing length +! END TYPE TURB_t TYPE(TURB_t), DIMENSION(JPMODELMAX), TARGET, SAVE :: TURB_MODEL TYPE(TURB_t), POINTER, SAVE :: TURBN => NULL() +! REAL, POINTER :: XIMPL=>NULL() -REAL, POINTER :: XKEMIN=>NULL() -REAL, POINTER :: XCEDIS=>NULL() +REAL, POINTER :: XTKEMIN=>NULL() +REAL, POINTER :: XCED=>NULL() +REAL, POINTER :: XCTP=>NULL() +REAL, POINTER :: XCSHF=>NULL() +REAL, POINTER :: XCHF=>NULL() +REAL, POINTER :: XCTV=>NULL() +REAL, POINTER :: XCHV=>NULL() +REAL, POINTER :: XCHT1=>NULL() +REAL, POINTER :: XCHT2=>NULL() +REAL, POINTER :: XCPR1=>NULL() REAL, POINTER :: XCADAP=>NULL() CHARACTER (LEN=4), POINTER :: CTURBLEN=>NULL() CHARACTER (LEN=4), POINTER :: CTURBDIM=>NULL() LOGICAL, POINTER :: LTURB_FLX=>NULL() LOGICAL, POINTER :: LTURB_DIAG=>NULL() -LOGICAL, POINTER :: LSUBG_COND=>NULL() -LOGICAL, POINTER :: LSIGMAS=>NULL() LOGICAL, POINTER :: LSIG_CONV=>NULL() LOGICAL, POINTER :: LRMC01=>NULL() LOGICAL, POINTER :: LHARAT=>NULL() -LOGICAL, POINTER :: LSTATNW=>NULL() CHARACTER(LEN=4),POINTER :: CTOM=>NULL() -CHARACTER(LEN=4),POINTER :: CSUBG_AUCV=>NULL() -CHARACTER(LEN=80),POINTER :: CSUBG_AUCV_RI=>NULL() -CHARACTER(LEN=80),POINTER :: CCONDENS=>NULL() -CHARACTER(LEN=4),POINTER :: CLAMBDA3=>NULL() -CHARACTER(LEN=80),POINTER :: CSUBG_MF_PDF=>NULL() REAL, DIMENSION(:,:), POINTER :: XBL_DEPTH=>NULL() REAL, DIMENSION(:,:), POINTER :: XSBL_DEPTH=>NULL() REAL, DIMENSION(:,:,:), POINTER :: XWTHVMF=>NULL() -REAL, POINTER :: VSIGQSAT=>NULL() REAL, DIMENSION(:,:,:), POINTER :: XDYP=>NULL() REAL, DIMENSION(:,:,:), POINTER :: XTHP=>NULL() REAL, DIMENSION(:,:,:), POINTER :: XTR=>NULL() @@ -151,54 +145,70 @@ REAL, POINTER :: XCOEFHGRADTHL=>NULL() REAL, POINTER :: XCOEFHGRADRM=>NULL() REAL, POINTER :: XALTHGRAD=>NULL() REAL, POINTER :: XCLDTHOLD=>NULL() - +REAL, POINTER :: XLINI=>NULL() +! +NAMELIST/NAM_TURBn/XIMPL,CTURBLEN,CTURBDIM,LTURB_FLX,LTURB_DIAG, & + LSIG_CONV,LRMC01,CTOM,& + XTKEMIN,XCED,XCTP,XCADAP,& + LLEONARD,XCOEFHGRADTHL, XCOEFHGRADRM, & + XALTHGRAD, XCLDTHOLD, XLINI, LHARAT +! +!------------------------------------------------------------------------------- +! CONTAINS SUBROUTINE TURB_GOTO_MODEL(KFROM, KTO) +!! This subroutine associate all the pointers to the right component of +!! the right strucuture. A value can be accessed through the structure TURBN +!! or through the strucuture TURB_MODEL(KTO) or directly through these pointers. +IMPLICIT NONE INTEGER, INTENT(IN) :: KFROM, KTO ! +IF(.NOT. ASSOCIATED(TURBN, TURB_MODEL(KTO))) THEN +! TURBN => TURB_MODEL(KTO) ! ! Save current state for allocated arrays ! -!TURB_MODEL(KFROM)%XBL_DEPTH=>XBL_DEPTH !Done in FIELDLIST_GOTO_MODEL -!TURB_MODEL(KFROM)%XSBL_DEPTH=>XSBL_DEPTH !Done in FIELDLIST_GOTO_MODEL -!TURB_MODEL(KFROM)%XWTHVMF=>XWTHVMF !Done in FIELDLIST_GOTO_MODEL -TURB_MODEL(KFROM)%XDYP=>XDYP -TURB_MODEL(KFROM)%XTHP=>XTHP -TURB_MODEL(KFROM)%XTR=>XTR -TURB_MODEL(KFROM)%XDISS=>XDISS -TURB_MODEL(KFROM)%XLEM=>XLEM -TURB_MODEL(KFROM)%XSSUFL_C=>XSSUFL_C -TURB_MODEL(KFROM)%XSSVFL_C=>XSSVFL_C -TURB_MODEL(KFROM)%XSSTFL_C=>XSSTFL_C -TURB_MODEL(KFROM)%XSSRFL_C=>XSSRFL_C +IF(KFROM>0 .AND. KFROM<=JPMODELMAX) THEN + !TURB_MODEL(KFROM)%XBL_DEPTH=>XBL_DEPTH !Done in FIELDLIST_GOTO_MODEL + !TURB_MODEL(KFROM)%XSBL_DEPTH=>XSBL_DEPTH !Done in FIELDLIST_GOTO_MODEL + !TURB_MODEL(KFROM)%XWTHVMF=>XWTHVMF !Done in FIELDLIST_GOTO_MODEL + TURB_MODEL(KFROM)%XDYP=>XDYP + TURB_MODEL(KFROM)%XTHP=>XTHP + TURB_MODEL(KFROM)%XTR=>XTR + TURB_MODEL(KFROM)%XDISS=>XDISS + TURB_MODEL(KFROM)%XLEM=>XLEM + TURB_MODEL(KFROM)%XSSUFL_C=>XSSUFL_C + TURB_MODEL(KFROM)%XSSVFL_C=>XSSVFL_C + TURB_MODEL(KFROM)%XSSTFL_C=>XSSTFL_C + TURB_MODEL(KFROM)%XSSRFL_C=>XSSRFL_C +ENDIF ! ! Current model is set to model KTO XIMPL=>TURB_MODEL(KTO)%XIMPL -XKEMIN=>TURB_MODEL(KTO)%XKEMIN -XCEDIS=>TURB_MODEL(KTO)%XCEDIS +XTKEMIN=>TURB_MODEL(KTO)%XTKEMIN +XCED=>TURB_MODEL(KTO)%XCED +XCTP=>TURB_MODEL(KTO)%XCTP +XCSHF=>TURB_MODEL(KTO)%XCSHF +XCHF=>TURB_MODEL(KTO)%XCHF +XCTV=>TURB_MODEL(KTO)%XCTV +XCHV=>TURB_MODEL(KTO)%XCHV +XCHT1=>TURB_MODEL(KTO)%XCHT1 +XCHT2=>TURB_MODEL(KTO)%XCHT2 +XCPR1=>TURB_MODEL(KTO)%XCPR1 XCADAP=>TURB_MODEL(KTO)%XCADAP CTURBLEN=>TURB_MODEL(KTO)%CTURBLEN CTURBDIM=>TURB_MODEL(KTO)%CTURBDIM LTURB_FLX=>TURB_MODEL(KTO)%LTURB_FLX LHARAT=>TURB_MODEL(KTO)%LHARAT -LSTATNW=>TURB_MODEL(KTO)%LSTATNW LTURB_DIAG=>TURB_MODEL(KTO)%LTURB_DIAG -LSUBG_COND=>TURB_MODEL(KTO)%LSUBG_COND -LSIGMAS=>TURB_MODEL(KTO)%LSIGMAS LSIG_CONV=>TURB_MODEL(KTO)%LSIG_CONV LRMC01=>TURB_MODEL(KTO)%LRMC01 CTOM=>TURB_MODEL(KTO)%CTOM -CSUBG_AUCV=>TURB_MODEL(KTO)%CSUBG_AUCV -CSUBG_AUCV_RI=>TURB_MODEL(KTO)%CSUBG_AUCV_RI -CCONDENS=>TURB_MODEL(KTO)%CCONDENS -CLAMBDA3=>TURB_MODEL(KTO)%CLAMBDA3 -CSUBG_MF_PDF=>TURB_MODEL(KTO)%CSUBG_MF_PDF !XBL_DEPTH=>TURB_MODEL(KTO)%XBL_DEPTH !Done in FIELDLIST_GOTO_MODEL !XSBL_DEPTH=>TURB_MODEL(KTO)%XSBL_DEPTH !Done in FIELDLIST_GOTO_MODEL !XWTHVMF=>TURB_MODEL(KTO)%XWTHVMF !Done in FIELDLIST_GOTO_MODEL -VSIGQSAT=>TURB_MODEL(KTO)%VSIGQSAT XDYP=>TURB_MODEL(KTO)%XDYP XTHP=>TURB_MODEL(KTO)%XTHP XTR=>TURB_MODEL(KTO)%XTR @@ -213,7 +223,131 @@ XCOEFHGRADTHL=>TURB_MODEL(KTO)%XCOEFHGRADTHL XCOEFHGRADRM=>TURB_MODEL(KTO)%XCOEFHGRADRM XALTHGRAD=>TURB_MODEL(KTO)%XALTHGRAD XCLDTHOLD=>TURB_MODEL(KTO)%XCLDTHOLD - +XLINI=>TURB_MODEL(KTO)%XLINI +! +ENDIF +! END SUBROUTINE TURB_GOTO_MODEL +SUBROUTINE TURBN_INIT(HPROGRAM, KUNITNML, LDNEEDNAM, KLUOUT, & + &LDDEFAULTVAL, LDREADNAM, LDCHECK, KPRINT) +!!*** *TURBN_INIT* - Code needed to initialize the MODD_TURB_n module +!! +!!* PURPOSE +!! ------- +!! Sets the default values, reads the namelist, performs the checks and prints +!! +!!* METHOD +!! ------ +!! 0. Declarations +!! 1. Declaration of arguments +!! 2. Declaration of local variables +!! 1. Default values +!! 2. Namelist +!! 3. Checks +!! 4. Prints +!! +!! AUTHOR +!! ------ +!! S. Riette +!! +!! MODIFICATIONS +!! ------------- +!! Original Feb 2023 +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! --------------- +! +USE MODE_POSNAM_PHY, ONLY: POSNAM_PHY +USE MODE_MSG, ONLY: PRINT_MSG, NVERB_FATAL +USE MODE_CHECK_NAM_VAL, ONLY: CHECK_NAM_VAL_CHAR, CHECK_NAM_VAL_REAL, CHECK_NAM_VAL_INT +USE MODD_PARAMETERS, ONLY: XUNDEF +! +IMPLICIT NONE +! +!* 0.1. Declaration of arguments +! ------------------------ +! +CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM !< Name of the calling program +INTEGER, INTENT(IN) :: KUNITNML !< Logical unit to access the namelist +LOGICAL, INTENT(IN) :: LDNEEDNAM !< True to abort if namelist is absent +INTEGER, INTENT(IN) :: KLUOUT !< Logical unit for outputs +LOGICAL, OPTIONAL, INTENT(IN) :: LDDEFAULTVAL !< Must we initialize variables with default values (defaults to .TRUE.) +LOGICAL, OPTIONAL, INTENT(IN) :: LDREADNAM !< Must we read the namelist (defaults to .TRUE.) +LOGICAL, OPTIONAL, INTENT(IN) :: LDCHECK !< Must we perform some checks on values (defaults to .TRUE.) +INTEGER, OPTIONAL, INTENT(IN) :: KPRINT !< Print level (defaults to 0): 0 for no print, 1 to safely print namelist, + !! 2 to print informative messages +! +!* 0.2 Declaration of local variables +! ------------------------------ +! +LOGICAL :: LLDEFAULTVAL, LLREADNAM, LLCHECK, LLFOUND +INTEGER :: IPRINT + +LLDEFAULTVAL=.TRUE. +LLREADNAM=.TRUE. +LLCHECK=.TRUE. +IPRINT=0 +IF(PRESENT(LDDEFAULTVAL)) LLDEFAULTVAL=LDDEFAULTVAL +IF(PRESENT(LDREADNAM )) LLREADNAM =LDREADNAM +IF(PRESENT(LDCHECK )) LLCHECK =LDCHECK +IF(PRESENT(KPRINT )) IPRINT =KPRINT +! +!* 1. DEFAULT VALUES +! ----------------- +! +IF(LLDEFAULTVAL) THEN + XIMPL = 1. + XTKEMIN = 0.01 + XCED = XUNDEF + XCTP = XUNDEF + XCADAP = 0.5 + CTURBLEN = 'BL89' + CTURBDIM = '1DIM' + LTURB_FLX =.FALSE. + LTURB_DIAG=.FALSE. + LSIG_CONV =.FALSE. + LRMC01 =.FALSE. + CTOM ='NONE' + LLEONARD =.FALSE. + XCOEFHGRADTHL = 1.0 + XCOEFHGRADRM = 1.0 + XALTHGRAD = 2000.0 + XCLDTHOLD = -1.0 + XLINI=0.1 !old value: 10. + LHARAT=.FALSE. + + IF(HPROGRAM=='AROME') THEN + XTKEMIN=1.E-6 + XLINI=0. + ENDIF +ENDIF +! +!* 2. NAMELIST +! ----------- +! +IF(LLREADNAM) THEN + CALL POSNAM_PHY(KUNITNML, 'NAM_TURBN', LDNEEDNAM, LLFOUND, KLUOUT) + IF(LLFOUND) READ(UNIT=KUNITNML, NML=NAM_TURBn) +ENDIF +! +!* 3. CHECKS +! --------- +! +IF(LLCHECK) THEN + CALL CHECK_NAM_VAL_CHAR(KLUOUT, 'CTURBDIM', CTURBDIM, '1DIM', '3DIM') + CALL CHECK_NAM_VAL_CHAR(KLUOUT, 'CTURBLEN', CTURBLEN, 'DELT', 'BL89', 'RM17', 'DEAR', 'BLKR', 'ADAP') + CALL CHECK_NAM_VAL_CHAR(KLUOUT, 'CTOM', CTOM, 'NONE', 'TM06') +ENDIF +! +!* 3. PRINTS +! --------- +! +IF(IPRINT>=1) THEN + WRITE(UNIT=KLUOUT,NML=NAM_TURBn) +ENDIF +! +END SUBROUTINE TURBN_INIT +! END MODULE MODD_TURB_n diff --git a/src/common/turb/mode_bl89.F90 b/src/common/turb/mode_bl89.F90 index 8291ef9a6f90dcbcfc0cb455f7a70865324c9839..72c752c074d8a49d07a13550181ab8899640740a 100644 --- a/src/common/turb/mode_bl89.F90 +++ b/src/common/turb/mode_bl89.F90 @@ -6,7 +6,7 @@ MODULE MODE_BL89 IMPLICIT NONE CONTAINS ! ######spl - SUBROUTINE BL89(D,CST,CSTURB,PZZ,PDZZ,PTHVREF,PTHLM,KRR,PRM,PTKEM,PSHEAR,PLM,OOCEAN,HPROGRAM) + SUBROUTINE BL89(D,CST,CSTURB,TURBN,PZZ,PDZZ,PTHVREF,PTHLM,KRR,PRM,PTKEM,PSHEAR,PLM,OOCEAN,HPROGRAM) USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK ! ######################################################### @@ -58,6 +58,7 @@ CONTAINS ! USE MODD_CST, ONLY: CST_t USE MODD_CTURB, ONLY: CSTURB_t +USE MODD_TURB_n, ONLY: TURB_t USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_PARAMETERS, ONLY: JPVEXT_TURB USE MODD_PRECISION, ONLY: MNHREAL @@ -71,6 +72,7 @@ IMPLICIT NONE TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST TYPE(CSTURB_t), INTENT(IN) :: CSTURB +TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN),TARGET :: PZZ REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN),TARGET :: PDZZ REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN),TARGET :: PTHVREF @@ -158,8 +160,8 @@ END IF ZSQRT_TKE(IIJB:IIJE,1:IKT) = SQRT(PTKEM(IIJB:IIJE,1:IKT)) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! -!ZBL89EXP is defined here because (and not in ini_cturb) because CSTURB%XCED is defined in read_exseg (depending on BL89/RM17) -ZBL89EXP = LOG(16.)/(4.*LOG(CST%XKARMAN)+LOG(CSTURB%XCED)-3.*LOG(CSTURB%XCMFS)) +!ZBL89EXP is defined here because (and not in ini_cturb) because TURBN%XCED was defined in read_exseg (depending on BL89/RM17) +ZBL89EXP = LOG(16.)/(4.*LOG(CST%XKARMAN)+LOG(TURBN%XCED)-3.*LOG(CSTURB%XCMFS)) ZUSRBL89 = 1./ZBL89EXP !------------------------------------------------------------------------------- ! @@ -325,7 +327,7 @@ DO JK=IKTB,IKTE ZLWORK2=1.d0 + ZPOTE**ZBL89EXP PLM(JIJ,JK) = ZLWORK1*(2./ZLWORK2)**ZUSRBL89 #endif - PLM(JIJ,JK)=MAX(PLM(JIJ,JK),CSTURB%XLINI) + PLM(JIJ,JK)=MAX(PLM(JIJ,JK),TURBN%XLINI) END DO diff --git a/src/common/turb/mode_compute_mf_cloud.F90 b/src/common/turb/mode_compute_mf_cloud.F90 index c1ee0cfd6d86aca723cc05f4b4f8d73582ef19df..86f921d12e63c414c6730468dde108c2ddefdc6b 100644 --- a/src/common/turb/mode_compute_mf_cloud.F90 +++ b/src/common/turb/mode_compute_mf_cloud.F90 @@ -11,7 +11,7 @@ IMPLICIT NONE CONTAINS ! ! ######spl - SUBROUTINE COMPUTE_MF_CLOUD(D, CST, CSTURB, PARAMMF, OSTATNW, & + SUBROUTINE COMPUTE_MF_CLOUD(D, CST, TURBN, PARAMMF, OSTATNW, & KRR, KRRL, KRRI, & PFRAC_ICE, & PRC_UP,PRI_UP,PEMF, & @@ -63,7 +63,7 @@ CONTAINS ! USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_CST, ONLY: CST_t -USE MODD_CTURB, ONLY: CSTURB_t +USE MODD_TURB_n, ONLY: TURB_t USE MODD_PARAM_MFSHALL_n, ONLY: PARAM_MFSHALL_t ! USE MODE_MSG @@ -83,7 +83,7 @@ IMPLICIT NONE ! TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST -TYPE(CSTURB_t), INTENT(IN) :: CSTURB +TYPE(TURB_t), INTENT(IN) :: TURBN TYPE(PARAM_MFSHALL_t), INTENT(IN) :: PARAMMF INTEGER, INTENT(IN) :: KRR ! number of moist var. INTEGER, INTENT(IN) :: KRRL ! number of liquid water var. @@ -132,7 +132,7 @@ IF (PARAMMF%CMF_CLOUD == 'DIRE') THEN ELSEIF (PARAMMF%CMF_CLOUD == 'STAT') THEN !Statistical scheme using the PDF proposed by Bougeault (81, 82) and !Bechtold et al (95). - CALL COMPUTE_MF_CLOUD_STAT(D, CST, CSTURB, PARAMMF, & + CALL COMPUTE_MF_CLOUD_STAT(D, CST, TURBN, PARAMMF, & &KRR, KRRL, KRRI, OSTATNW, & &PFRAC_ICE,& &PTHLM, PRTM, PPABSM, PRM,& diff --git a/src/common/turb/mode_compute_mf_cloud_stat.F90 b/src/common/turb/mode_compute_mf_cloud_stat.F90 index 3c562015e63667859aa1862c251baf0493e0e948..7ec25db412e4096fa4d06dc5569ca755863d971b 100644 --- a/src/common/turb/mode_compute_mf_cloud_stat.F90 +++ b/src/common/turb/mode_compute_mf_cloud_stat.F90 @@ -9,7 +9,7 @@ IMPLICIT NONE CONTAINS ! ######spl - SUBROUTINE COMPUTE_MF_CLOUD_STAT(D, CST, CSTURB, PARAMMF, & + SUBROUTINE COMPUTE_MF_CLOUD_STAT(D, CST, TURBN, PARAMMF, & &KRR, KRRL, KRRI, OSTATNW, & &PFRAC_ICE,& &PTHLM, PRTM, PPABSM, PRM,& @@ -58,7 +58,7 @@ CONTAINS USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_CST, ONLY: CST_t USE MODD_PARAM_MFSHALL_n, ONLY: PARAM_MFSHALL_t -USE MODD_CTURB, ONLY: CSTURB_t +USE MODD_TURB_n, ONLY: TURB_t ! USE MODI_SHUMAN_MF, ONLY: MZF_MF, MZM_MF, GZ_M_W_MF @@ -73,7 +73,7 @@ IMPLICIT NONE ! TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST -TYPE(CSTURB_t), INTENT(IN) :: CSTURB +TYPE(TURB_t), INTENT(IN) :: TURBN TYPE(PARAM_MFSHALL_t), INTENT(IN) :: PARAMMF LOGICAL, INTENT(IN) :: OSTATNW ! cloud scheme inclues convect. covar. contrib INTEGER, INTENT(IN) :: KRR ! number of moist var. @@ -131,7 +131,7 @@ IF (KRRL > 0) THEN CALL GZ_M_W_MF(D, PTHLM(:,:), PDZZ(:,:), ZWK(:,:)) IF (OSTATNW) THEN !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - ZFLXZ(IIJB:IIJE,1:IKT) = -2 * CSTURB%XCTV* PARAMMF%XTAUSIGMF * PEMF(IIJB:IIJE,1:IKT)* & + ZFLXZ(IIJB:IIJE,1:IKT) = -2 * TURBN%XCTV* PARAMMF%XTAUSIGMF * PEMF(IIJB:IIJE,1:IKT)* & & (PTHL_UP(IIJB:IIJE,1:IKT)-ZFLXZ(IIJB:IIJE,1:IKT)) * ZWK(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ELSE @@ -163,7 +163,7 @@ IF (KRRL > 0) THEN CALL GZ_M_W_MF(D, PRTM(:,:), PDZZ(:,:), ZWK2(:,:)) IF (OSTATNW) THEN !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - ZFLXZ2(IIJB:IIJE,1:IKT) = -2 * CSTURB%XCTV * PARAMMF%XTAUSIGMF * PEMF(IIJB:IIJE,1:IKT)* & + ZFLXZ2(IIJB:IIJE,1:IKT) = -2 * TURBN%XCTV * PARAMMF%XTAUSIGMF * PEMF(IIJB:IIJE,1:IKT)* & & (PRT_UP(IIJB:IIJE,1:IKT)-ZFLXZ2(IIJB:IIJE,1:IKT)) * ZWK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ELSE @@ -187,7 +187,7 @@ IF (KRRL > 0) THEN ! ! 1.2.2 contribution from <Rnp Thl> !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - ZFLXZ3(IIJB:IIJE,1:IKT) = - CSTURB%XCTV * PARAMMF%XTAUSIGMF * & + ZFLXZ3(IIJB:IIJE,1:IKT) = - TURBN%XCTV * PARAMMF%XTAUSIGMF * & (PEMF(IIJB:IIJE,1:IKT)*(PRT_UP(IIJB:IIJE,1:IKT)-ZFLXZ2(IIJB:IIJE,1:IKT)) * & ZWK(IIJB:IIJE,1:IKT) + & PEMF(IIJB:IIJE,1:IKT)*(PTHL_UP(IIJB:IIJE,1:IKT)-ZFLXZ(IIJB:IIJE,1:IKT)) * & diff --git a/src/common/turb/mode_compute_updraft.F90 b/src/common/turb/mode_compute_updraft.F90 index 7e4a36ebe5a3a6dde201b152b6483424fbca0b97..399400297f75f4261c5950d77033cbdbad226a6a 100644 --- a/src/common/turb/mode_compute_updraft.F90 +++ b/src/common/turb/mode_compute_updraft.F90 @@ -9,8 +9,8 @@ ! IMPLICIT NONE CONTAINS - SUBROUTINE COMPUTE_UPDRAFT(D,CST,NEB,PARAMMF,TURBN,CSTURB, & - KSV, HFRAC_ICE, & + SUBROUTINE COMPUTE_UPDRAFT(D,CST,NEBN,PARAMMF,TURBN,CSTURB, & + KSV, & OENTR_DETR, & ONOMIXLG,KSV_LGBEG,KSV_LGEND, & PZZ,PDZZ, & @@ -69,7 +69,7 @@ CONTAINS ! USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_CST, ONLY: CST_t -USE MODD_NEB, ONLY: NEB_t +USE MODD_NEB_n, ONLY: NEB_t USE MODD_PARAM_MFSHALL_n, ONLY: PARAM_MFSHALL_t USE MODD_TURB_n, ONLY: TURB_t USE MODD_CTURB, ONLY: CSTURB_t @@ -89,12 +89,11 @@ IMPLICIT NONE ! TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST -TYPE(NEB_t), INTENT(IN) :: NEB +TYPE(NEB_t), INTENT(IN) :: NEBN TYPE(PARAM_MFSHALL_t), INTENT(IN) :: PARAMMF TYPE(TURB_t), INTENT(IN) :: TURBN TYPE(CSTURB_t), INTENT(IN) :: CSTURB INTEGER, INTENT(IN) :: KSV -CHARACTER(LEN=1), INTENT(IN) :: HFRAC_ICE ! partition liquid/ice scheme LOGICAL, INTENT(IN) :: OENTR_DETR! flag to recompute entrainment, detrainment and mass flux LOGICAL, INTENT(IN) :: ONOMIXLG ! False if mixing of lagrangian tracer INTEGER, INTENT(IN) :: KSV_LGBEG ! first index of lag. tracer @@ -354,7 +353,7 @@ IF (OENTR_DETR) THEN PRC_UP(:,IKB)=0. PRI_UP(:,IKB)=0. !$mnh_end_expand_array(JIJ=IIJB:IIJE) - CALL TH_R_FROM_THL_RT(CST, NEB, D%NIJT, HFRAC_ICE,PFRAC_ICE_UP(:,IKB),ZPRES_F(:,IKB), & + CALL TH_R_FROM_THL_RT(CST, NEBN, D%NIJT, NEBN%CFRAC_ICE_SHALLOW_MF,PFRAC_ICE_UP(:,IKB),ZPRES_F(:,IKB), & PTHL_UP(:,IKB),PRT_UP(:,IKB),ZTH_UP(:,IKB), & PRV_UP(:,IKB),PRC_UP(:,IKB),PRI_UP(:,IKB),ZRSATW(:),ZRSATI(:), OOCEAN=.FALSE., & PBUF=ZBUF(:,:), KB=D%NIJB, KE=D%NIJE) @@ -472,7 +471,7 @@ DO JK=IKB,IKE-IKL,IKL ZRI_MIX(IIJB:IIJE,JK) = ZRI_MIX(IIJB:IIJE,JK-IKL) ! guess of Ri of mixture !$mnh_end_expand_array(JIJ=IIJB:IIJE) ENDIF - CALL COMPUTE_ENTR_DETR(D, CST, NEB, PARAMMF, JK,IKB,IKE,IKL,GTEST,GTESTLCL,HFRAC_ICE,PFRAC_ICE_UP(:,JK),& + CALL COMPUTE_ENTR_DETR(D, CST, NEBN, PARAMMF, JK,IKB,IKE,IKL,GTEST,GTESTLCL,PFRAC_ICE_UP(:,JK),& PRHODREF(:,JK),ZPRES_F(:,JK),ZPRES_F(:,JK+IKL),& PZZ(:,:),PDZZ(:,:),ZTHVM(:,:), & PTHLM(:,:),PRTM(:,:),ZW_UP2(:,:),ZTH_UP(:,JK), & @@ -584,7 +583,7 @@ DO JK=IKB,IKE-IKL,IKL ZRC_UP(IIJB:IIJE)=PRC_UP(IIJB:IIJE,JK) ! guess = level just below ZRI_UP(IIJB:IIJE)=PRI_UP(IIJB:IIJE,JK) ! guess = level just below !$mnh_end_expand_array(JIJ=IIJB:IIJE) - CALL TH_R_FROM_THL_RT(CST, NEB, D%NIJT, HFRAC_ICE,PFRAC_ICE_UP(:,JK+IKL),ZPRES_F(:,JK+IKL), & + CALL TH_R_FROM_THL_RT(CST, NEBN, D%NIJT, NEBN%CFRAC_ICE_SHALLOW_MF,PFRAC_ICE_UP(:,JK+IKL),ZPRES_F(:,JK+IKL), & PTHL_UP(:,JK+IKL),PRT_UP(:,JK+IKL),ZTH_UP(:,JK+IKL), & ZRV_UP(:),ZRC_UP(:),ZRI_UP(:),ZRSATW(:),ZRSATI(:), OOCEAN=.FALSE., & PBUF=ZBUF(:,:), KB=D%NIJB, KE=D%NIJE) @@ -703,9 +702,9 @@ IF (LHOOK) CALL DR_HOOK('COMPUTE_UPDRAFT',1,ZHOOK_HANDLE) CONTAINS INCLUDE "th_r_from_thl_rt.func.h" INCLUDE "compute_frac_ice.func.h" - SUBROUTINE COMPUTE_ENTR_DETR(D, CST, NEB, PARAMMF,& + SUBROUTINE COMPUTE_ENTR_DETR(D, CST, NEBN, PARAMMF,& KK,KKB,KKE,KKL,OTEST,OTESTLCL,& - HFRAC_ICE,PFRAC_ICE,PRHODREF,& + PFRAC_ICE,PRHODREF,& PPRE_MINUS_HALF,& PPRE_PLUS_HALF,PZZ,PDZZ,& PTHVM,PTHLM,PRTM,PW_UP2,PTH_UP,& @@ -770,7 +769,7 @@ INCLUDE "compute_frac_ice.func.h" ! USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_CST, ONLY: CST_t -USE MODD_NEB, ONLY: NEB_t +USE MODD_NEB_n, ONLY: NEB_t USE MODD_PARAM_MFSHALL_n, ONLY: PARAM_MFSHALL_t ! IMPLICIT NONE @@ -781,7 +780,7 @@ IMPLICIT NONE ! TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST -TYPE(NEB_t), INTENT(IN) :: NEB +TYPE(NEB_t), INTENT(IN) :: NEBN TYPE(PARAM_MFSHALL_t), INTENT(IN) :: PARAMMF ! INTEGER, INTENT(IN) :: KK @@ -790,9 +789,6 @@ INTEGER, INTENT(IN) :: KKE ! uppest atmosphere physica INTEGER, INTENT(IN) :: KKL ! +1 if grid goes from ground to atmosphere top, -1 otherwise LOGICAL,DIMENSION(D%NIJT), INTENT(IN) :: OTEST ! test to see if updraft is running LOGICAL,DIMENSION(D%NIJT), INTENT(IN) :: OTESTLCL !test of condensation -CHARACTER(LEN=1), INTENT(IN) :: HFRAC_ICE ! frac_ice can be compute using - ! Temperature (T) or prescribed - ! (Y) REAL, DIMENSION(D%NIJT), INTENT(IN) :: PFRAC_ICE ! fraction of ice ! ! prognostic variables at t- deltat @@ -949,7 +945,7 @@ ENDDO ZRCMIX(IIJB:IIJE)=PRC_UP(IIJB:IIJE) ZRIMIX(IIJB:IIJE)=PRI_UP(IIJB:IIJE) !$mnh_end_expand_array(JIJ=IIJB:IIJE) -CALL TH_R_FROM_THL_RT(CST,NEB,D%NIJT,HFRAC_ICE,ZFRAC_ICE,& +CALL TH_R_FROM_THL_RT(CST,NEBN,D%NIJT,NEBN%CFRAC_ICE_SHALLOW_MF,ZFRAC_ICE,& PPRE_PLUS_HALF,PTHL_UP,PRT_UP,& ZTHMIX,ZRVMIX,ZRCMIX,ZRIMIX,& ZRSATW_ED, ZRSATI_ED,OOCEAN=.FALSE.,& @@ -1025,7 +1021,7 @@ DO JIJ=IIJB,IIJE ZMIXRT(JIJ) = 0.1 ENDIF ENDDO -CALL TH_R_FROM_THL_RT(CST,NEB,D%NIJT,HFRAC_ICE,ZFRAC_ICE,& +CALL TH_R_FROM_THL_RT(CST,NEBN,D%NIJT,NEBN%CFRAC_ICE_SHALLOW_MF,ZFRAC_ICE,& ZPRE,ZMIXTHL,ZMIXRT,& ZTHMIX,ZRVMIX,PRC_MIX,PRI_MIX,& ZRSATW_ED, ZRSATI_ED,OOCEAN=.FALSE.,& @@ -1039,7 +1035,7 @@ ZMIXTHL(IIJB:IIJE) = ZKIC_INIT * 0.5*(PTHLM(IIJB:IIJE,KK)+PTHLM(IIJB:IIJE,KK+KKL ZMIXRT(IIJB:IIJE) = ZKIC_INIT * 0.5*(PRTM(IIJB:IIJE,KK)+PRTM(IIJB:IIJE,KK+KKL))+& & (1. - ZKIC_INIT)*PRT_UP(IIJB:IIJE) !$mnh_end_expand_array(JIJ=IIJB:IIJE) -CALL TH_R_FROM_THL_RT(CST,NEB,D%NIJT,HFRAC_ICE,ZFRAC_ICE,& +CALL TH_R_FROM_THL_RT(CST,NEBN,D%NIJT,NEBN%CFRAC_ICE_SHALLOW_MF,ZFRAC_ICE,& PPRE_PLUS_HALF,ZMIXTHL,ZMIXRT,& ZTHMIX,ZRVMIX,PRC_MIX,PRI_MIX,& ZRSATW_ED, ZRSATI_ED,OOCEAN=.FALSE.,& diff --git a/src/common/turb/mode_compute_updraft_raha.F90 b/src/common/turb/mode_compute_updraft_raha.F90 index 042afa8ffb717fd0f20f8cca318a6d38c9b49054..e87194468cf524abdf9f6ceb8194639b7eac2b5c 100644 --- a/src/common/turb/mode_compute_updraft_raha.F90 +++ b/src/common/turb/mode_compute_updraft_raha.F90 @@ -9,8 +9,8 @@ ! IMPLICIT NONE CONTAINS - SUBROUTINE COMPUTE_UPDRAFT_RAHA(D, CST, NEB, PARAMMF, & - KSV, HFRAC_ICE, OENTR_DETR, & + SUBROUTINE COMPUTE_UPDRAFT_RAHA(D, CST, NEBN, PARAMMF, & + KSV, OENTR_DETR, & ONOMIXLG,KSV_LGBEG,KSV_LGEND, & PZZ,PDZZ, & PSFTH,PSFRV, & @@ -60,7 +60,7 @@ CONTAINS ! ------------ USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_CST, ONLY: CST_t -USE MODD_NEB, ONLY: NEB_t +USE MODD_NEB_n, ONLY: NEB_t USE MODD_PARAM_MFSHALL_n, ONLY: PARAM_MFSHALL_t ! USE MODI_SHUMAN_MF, ONLY: MZM_MF @@ -76,10 +76,9 @@ IMPLICIT NONE ! TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST -TYPE(NEB_t), INTENT(IN) :: NEB +TYPE(NEB_t), INTENT(IN) :: NEBN TYPE(PARAM_MFSHALL_t), INTENT(IN) :: PARAMMF INTEGER, INTENT(IN) :: KSV -CHARACTER(LEN=1), INTENT(IN) :: HFRAC_ICE ! partition liquid/ice scheme LOGICAL, INTENT(IN) :: OENTR_DETR! flag to recompute entrainment, detrainment and mass flux LOGICAL, INTENT(IN) :: ONOMIXLG ! False if mixing of lagrangian tracer INTEGER, INTENT(IN) :: KSV_LGBEG ! first index of lag. tracer @@ -316,7 +315,7 @@ PRC_UP(IIJB:IIJE,IKB)=0. PRI_UP(IIJB:IIJE,IKB)=0. !$mnh_end_expand_array(JIJ=IIJB:IIJE) -CALL TH_R_FROM_THL_RT(CST, NEB, D%NIJT, HFRAC_ICE,PFRAC_ICE_UP(:,IKB),ZPRES_F(:,IKB), & +CALL TH_R_FROM_THL_RT(CST, NEBN, D%NIJT, NEBN%CFRAC_ICE_SHALLOW_MF,PFRAC_ICE_UP(:,IKB),ZPRES_F(:,IKB), & PTHL_UP(:,IKB),PRT_UP(:,IKB),ZTH_UP(:,IKB), & PRV_UP(:,IKB),PRC_UP(:,IKB),PRI_UP(:,IKB),ZRSATW(:),ZRSATI(:),OOCEAN=.FALSE.,& PBUF=ZBUF, KB=D%NIJB, KE=D%NIJE) @@ -512,7 +511,7 @@ DO JK=IKB,IKE-IKL,IKL ZRI_UP(IIJB:IIJE)=PRI_UP(IIJB:IIJE,JK) ! guess = level just below ZRV_UP(IIJB:IIJE)=PRV_UP(IIJB:IIJE,JK) !$mnh_end_expand_where(JIJ=IIJB:IIJE) - CALL TH_R_FROM_THL_RT(CST,NEB, D%NIJT, HFRAC_ICE,PFRAC_ICE_UP(:,JK+IKL),ZPRES_F(:,JK+IKL), & + CALL TH_R_FROM_THL_RT(CST,NEBN, D%NIJT, NEBN%CFRAC_ICE_SHALLOW_MF,PFRAC_ICE_UP(:,JK+IKL),ZPRES_F(:,JK+IKL), & PTHL_UP(:,JK+IKL),PRT_UP(:,JK+IKL),ZTH_UP(:,JK+IKL), & ZRV_UP(:),ZRC_UP(:),ZRI_UP(:),ZRSATW(:),ZRSATI(:),OOCEAN=.FALSE.,& PBUF=ZBUF, KB=D%NIJB, KE=D%NIJE) diff --git a/src/common/turb/mode_compute_updraft_rhcj10.F90 b/src/common/turb/mode_compute_updraft_rhcj10.F90 index 5a4a9cfa0a5ff4edf72b4f626614bc0498528d00..4d1a51e6415e8e20890a6fe1ad5fe77894745d7e 100644 --- a/src/common/turb/mode_compute_updraft_rhcj10.F90 +++ b/src/common/turb/mode_compute_updraft_rhcj10.F90 @@ -10,8 +10,8 @@ IMPLICIT NONE CONTAINS ! -SUBROUTINE COMPUTE_UPDRAFT_RHCJ10(D,CST,NEB,PARAMMF,TURBN,CSTURB, & - KSV, HFRAC_ICE, & +SUBROUTINE COMPUTE_UPDRAFT_RHCJ10(D,CST,NEBN,PARAMMF,TURBN,CSTURB,& + KSV, & OENTR_DETR, & ONOMIXLG,KSV_LGBEG,KSV_LGEND, & PZZ,PDZZ, & @@ -63,7 +63,7 @@ SUBROUTINE COMPUTE_UPDRAFT_RHCJ10(D,CST,NEB,PARAMMF,TURBN,CSTURB, & ! USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_CST, ONLY: CST_t -USE MODD_NEB, ONLY: NEB_t +USE MODD_NEB_n, ONLY: NEB_t USE MODD_PARAM_MFSHALL_n, ONLY: PARAM_MFSHALL_t USE MODD_TURB_n, ONLY: TURB_t USE MODD_CTURB, ONLY: CSTURB_t @@ -82,12 +82,11 @@ IMPLICIT NONE ! TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST -TYPE(NEB_t), INTENT(IN) :: NEB +TYPE(NEB_t), INTENT(IN) :: NEBN TYPE(PARAM_MFSHALL_t), INTENT(IN) :: PARAMMF TYPE(TURB_t), INTENT(IN) :: TURBN TYPE(CSTURB_t), INTENT(IN) :: CSTURB INTEGER, INTENT(IN) :: KSV -CHARACTER(LEN=1), INTENT(IN) :: HFRAC_ICE ! partition liquid/ice scheme LOGICAL, INTENT(IN) :: OENTR_DETR! flag to recompute entrainment, detrainment and mass flux LOGICAL, INTENT(IN) :: ONOMIXLG ! False if mixing of lagrangian tracer INTEGER, INTENT(IN) :: KSV_LGBEG ! first index of lag. tracer @@ -327,7 +326,7 @@ ZW_UP2(IIJB:IIJE,IKB) = MAX(0.0001,(2./3.)*ZTKEM_F(IIJB:IIJE,IKB)) PRC_UP(IIJB:IIJE,IKB)=0. PRI_UP(IIJB:IIJE,IKB)=0. !$mnh_end_expand_array(JIJ=IIJB:IIJE) -CALL TH_R_FROM_THL_RT(CST,NEB,D%NIJT,HFRAC_ICE,PFRAC_ICE_UP(:,IKB),ZPRES_F(:,IKB), & +CALL TH_R_FROM_THL_RT(CST,NEBN,D%NIJT,NEBN%CFRAC_ICE_SHALLOW_MF,PFRAC_ICE_UP(:,IKB),ZPRES_F(:,IKB), & PTHL_UP(:,IKB),PRT_UP(:,IKB),ZTH_UP(:,IKB), & PRV_UP(:,IKB),PRC_UP(:,IKB),PRI_UP(:,IKB),ZRSATW(:),ZRSATI(:),OOCEAN=.FALSE.,& PBUF=ZBUF, KB=D%NIJB, KE=D%NIJE) @@ -446,7 +445,7 @@ DO JK=IKB,IKE-IKL,IKL ZRI_UP(IIJB:IIJE) =PRI_UP(IIJB:IIJE,JK) ! guess ZRV_UP(IIJB:IIJE) =PRV_UP(IIJB:IIJE,JK) !$mnh_end_expand_array(JIJ=IIJB:IIJE) - CALL TH_R_FROM_THL_RT(CST,NEB, D%NIJT, HFRAC_ICE,PFRAC_ICE_UP(:,JK),& + CALL TH_R_FROM_THL_RT(CST,NEBN, D%NIJT, NEBN%CFRAC_ICE_SHALLOW_MF,PFRAC_ICE_UP(:,JK),& PPABSM(:,JK),PTHL_UP(:,JK),PRT_UP(:,JK),& ZTH_UP(:,JK),ZRV_UP,ZRC_UP,ZRI_UP,ZRSATW(:),ZRSATI(:),OOCEAN=.FALSE.,& PBUF=ZBUF, KB=D%NIJB, KE=D%NIJE) @@ -549,7 +548,7 @@ DO JK=IKB,IKE-IKL,IKL ZRI_UP(IIJB:IIJE)=PRI_UP(IIJB:IIJE,JK) ! guess = level just below ZRV_UP(IIJB:IIJE)=PRV_UP(IIJB:IIJE,JK) !$mnh_end_expand_array(JIJ=IIJB:IIJE) - CALL TH_R_FROM_THL_RT(CST,NEB, D%NIJT, HFRAC_ICE,PFRAC_ICE_UP(:,JK+IKL),ZPRES_F(:,JK+IKL), & + CALL TH_R_FROM_THL_RT(CST,NEBN, D%NIJT, NEBN%CFRAC_ICE_SHALLOW_MF,PFRAC_ICE_UP(:,JK+IKL),ZPRES_F(:,JK+IKL), & PTHL_UP(:,JK+IKL),PRT_UP(:,JK+IKL),ZTH_UP(:,JK+IKL), & ZRV_UP(:),ZRC_UP(:),ZRI_UP(:),ZRSATW(:),ZRSATI(:),OOCEAN=.FALSE.,& PBUF=ZBUF, KB=D%NIJB, KE=D%NIJE) diff --git a/src/common/turb/mode_ini_mfshall.F90 b/src/common/turb/mode_ini_mfshall.F90 new file mode 100644 index 0000000000000000000000000000000000000000..774f4ed0683bbe2153dcee5966da630fad600d20 --- /dev/null +++ b/src/common/turb/mode_ini_mfshall.F90 @@ -0,0 +1,67 @@ +MODULE MODE_INI_MFSHALL +IMPLICIT NONE +CONTAINS +SUBROUTINE INI_MFSHALL() +! ########################################################### +! +!!**** *INI_MFSHALL * - initialize the constants necessary for the +!! shallow convection scheme. +!! +!! PURPOSE +!! ------- +!! The purpose of this routine is to initialize the constants used by +!! the shallow convection scheme. +!! +!!** METHOD +!! ------ +!! The constants are initialized to their numerical values. +!! +!! EXTERNAL +!! -------- +!! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! +!! MODIFICATIONS +!! ------------- +!! +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_PARAM_MFSHALL_n, ONLY: LTHETAS_MF, XLAMBDA_MF +USE PARKIND1, ONLY : JPRB +USE YOMHOOK , ONLY : LHOOK, DR_HOOK +! +IMPLICIT NONE +! +!* 0.1 Declarations of dummy arguments : +! +! + +! +!* 0.2 Declarations of local variables : +! +REAL(KIND=JPRB) :: ZHOOK_HANDLE +!------------------------------------------------------------------------------- +IF (LHOOK) CALL DR_HOOK('INI_MFSHALL',0,ZHOOK_HANDLE) +! +IF(LTHETAS_MF) THEN + XLAMBDA_MF=5.87 +ELSE + XLAMBDA_MF=0. +ENDIF +! +IF (LHOOK) CALL DR_HOOK('INI_MFSHALL',1,ZHOOK_HANDLE) +! +END SUBROUTINE INI_MFSHALL +! +END MODULE MODE_INI_MFSHALL diff --git a/src/mesonh/turb/ini_cturb.f90 b/src/common/turb/mode_ini_turb.F90 similarity index 80% rename from src/mesonh/turb/ini_cturb.f90 rename to src/common/turb/mode_ini_turb.F90 index ea3f0c70d937df63992fde48dba3347e5f6b5fd4..81ca343230079e99da1b2a332cde66cebb950378 100644 --- a/src/mesonh/turb/ini_cturb.f90 +++ b/src/common/turb/mode_ini_turb.F90 @@ -2,38 +2,20 @@ !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. -!----------------------------------------------------------------- -!--------------- special set of characters for RCS information -!----------------------------------------------------------------- -! $Source$ $Revision$ $Date$ -!----------------------------------------------------------------- -!----------------------------------------------------------------- -! ##################### - MODULE MODI_INI_CTURB -! ##################### -! -INTERFACE -! -SUBROUTINE INI_CTURB -END SUBROUTINE INI_CTURB -! -END INTERFACE -! -END MODULE MODI_INI_CTURB -! -! -! +MODULE MODE_INI_TURB +IMPLICIT NONE +CONTAINS ! #################### - SUBROUTINE INI_CTURB + SUBROUTINE INI_TURB(HPROGRAM) ! #################### ! -!!**** *INI_CTURB* - routine to initialize the turbulence scheme +!!**** *INI_TURB* - routine to initialize the turbulence scheme !! constants. !! !! PURPOSE !! ------- ! The purpose of this routine is to initialize the turbulence -! scheme constants that are stored in module MODD_CTURB +! scheme constants that are stored in module MODD_CTURB and MODD_TURBN ! !! METHOD !! ------ @@ -63,24 +45,27 @@ END MODULE MODI_INI_CTURB !! P.Jabouille 20/10/99 XCET=0.4 !! V.Masson 13/11/02 XALPSBL and XASBL !! 05/06 Remove KEPS -!! Q.Rodier 01/19 XCED replaced by XCEDIS in read_exsegn.f90 and ini_modeln.f90 -!! Remove XASBL (not used) +!! Q.Rodier 01/19 Remove XASBL (not used) !! -------------------------------------------------------------------------- ! !* 0. DECLARATIONS ! ------------ ! USE MODD_CST -USE MODD_CTURB +USE MODD_TURB_n, ONLY : XCTP, XCED, XCSHF, XCHF, XCTV, XCHV, XCHT1, XCHT2, XCPR1, CTURBLEN +USE MODD_NEB_n, ONLY: LSTATNW +USE MODD_CTURB ! For true constants (not tunable) +USE MODD_PARAMETERS, ONLY : XUNDEF ! USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK ! IMPLICIT NONE ! +CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM REAL(KIND=JPRB) :: ZHOOK_HANDLE ! -IF (LHOOK) CALL DR_HOOK('INI_CTURB',0,ZHOOK_HANDLE) +IF (LHOOK) CALL DR_HOOK('INI_TURB',0,ZHOOK_HANDLE) ! CALL CTURB_ASSOCIATE() ! @@ -91,13 +76,22 @@ CALL CTURB_ASSOCIATE() ! ! 1.1 Constant for dissipation of Tke ! -!XCED is now replaced by XCEDIS -!XCED = 0.70 -!XCED = 0.84 -! Redelsperger-Sommeria (1981) = 0.70 -! Schmidt-Schumann (1989) = 0.845 -! Cheng-Canuto-Howard (2002) = 0.845 -! Rodier, Masson, Couvreux, Paci (2017) = 0.34 +! +IF(XCED == XUNDEF) THEN + ! Redelsperger-Sommeria (1981) = 0.70 + ! Schmidt-Schumann (1989) = 0.845 + ! Cheng-Canuto-Howard (2002) = 0.845 + ! Rodier, Masson, Couvreux, Paci (2017) = 0.34 + IF(CTURBLEN=='RM17' .OR. CTURBLEN=='ADAP') THEN + XCED=0.34 + ELSE + IF(HPROGRAM=='AROME') THEN + XCED=0.85 + ELSE + XCED=0.84 + END IF + ENDIF +ENDIF ! ! ! 1.2 Constant for wind pressure-correlations @@ -143,7 +137,14 @@ XCTD = 1.2 ! ! 1.7 Constant for temperature and vapor pressure-correlations ! -XCTP = 4.65 +IF(XCTP == XUNDEF) THEN + IF (LSTATNW) THEN + !wc in STATNW consistent use of Redelsperger-Sommeria for (co)variances + XCTP = 4.0 + ELSE + XCTP = 4.65 + ENDIF +ENDIF ! Redelsperger-Sommeria (1981) = 4. ! Schmidt-Schumann (1989) = 3.25 ! Cheng-Canuto-Howard (2002) = 4.65 @@ -225,10 +226,6 @@ XCPR5= XCPR2 ! 3. MINIMUM VALUES ! -------------- ! -XTKEMIN=0.01 ! This value is replaced by XKEMIN in &NAM_TURBn -! -!XLINI=10. ! BL mixing length -XLINI=0.1 ! BL mixing length XLINF=1.E-10! to prevent division by zero ! ! @@ -259,5 +256,6 @@ XSBL_O_BL = 0.05 ! SBL height / BL height ratio XFTOP_O_FSURF = 0.05 ! Fraction of surface (heat or momentum) flux used to define top of BL ! ! -IF (LHOOK) CALL DR_HOOK('INI_CTURB',1,ZHOOK_HANDLE) -END SUBROUTINE INI_CTURB +IF (LHOOK) CALL DR_HOOK('INI_TURB',1,ZHOOK_HANDLE) +END SUBROUTINE INI_TURB +END MODULE MODE_INI_TURB diff --git a/src/common/turb/mode_prandtl.F90 b/src/common/turb/mode_prandtl.F90 index f911cba340f766ae9cb41483fdb0fbed6072bb3b..5cd31ef51bca042422da7dcdc1c026676a1b1870 100644 --- a/src/common/turb/mode_prandtl.F90 +++ b/src/common/turb/mode_prandtl.F90 @@ -14,6 +14,7 @@ ! 05/2020 V. Masson and C. Lac : bug in D_PHI3DTDZ2_O_DDTDZ ! USE MODD_CTURB, ONLY : CSTURB_t +USE MODD_TURB_n, ONLY : TURB_t USE MODD_DIMPHYEX, ONLY : DIMPHYEX_t USE MODD_PARAMETERS, ONLY : JPVEXT_TURB ! @@ -23,7 +24,7 @@ IMPLICIT NONE !---------------------------------------------------------------------------- CONTAINS !---------------------------------------------------------------------------- - SUBROUTINE PRANDTL(D,CST,CSTURB,KRR,KSV,KRRI,OTURB_DIAG,& + SUBROUTINE PRANDTL(D,CST,CSTURB,TURBN,KRR,KSV,KRRI,OTURB_DIAG,& HTURBDIM,OOCEAN,OHARAT,O2D,OCOMPUTE_SRC,& TPFILE, OFLAT, & PDXX,PDYY,PDZZ,PDZX,PDZY, & @@ -87,7 +88,7 @@ CONTAINS !! !! Module MODD_CTURB: contains the set of constants for !! the turbulence scheme -!! CSTURB%XCTV,XCPR2 : constants for the turbulent prandtl numbers +!! TURBN%XCTV,XCPR2 : constants for the turbulent prandtl numbers !! XTKEMIN : minimum value allowed for the TKE !! !! Module MODD_PARAMETERS @@ -148,6 +149,7 @@ USE MODD_CST, ONLY: CST_t USE MODD_CTURB, ONLY: CSTURB_t USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_FIELD, ONLY: TFIELDMETADATA, TYPEREAL +USE MODD_TURB_n, ONLY: TURB_t USE MODD_IO, ONLY: TFILEDATA USE MODD_PARAMETERS, ONLY: JPVEXT_TURB ! @@ -164,6 +166,7 @@ IMPLICIT NONE TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST TYPE(CSTURB_t), INTENT(IN) :: CSTURB +TYPE(TURB_t), INTENT(IN) :: TURBN INTEGER, INTENT(IN) :: KSV ! number of scalar variables INTEGER, INTENT(IN) :: KRR ! number of moist var. @@ -290,21 +293,21 @@ CALL GZ_M_W_PHY(D,PTHLM,PDZZ,ZWORK1) ! IF (OOCEAN) THEN !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - PREDTH1(IIJB:IIJE,1:IKT)= CSTURB%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT)*ZWORK1(IIJB:IIJE,1:IKT) + PREDTH1(IIJB:IIJE,1:IKT)= TURBN%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT)*ZWORK1(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PREDR1(:,:) = 0. ELSE IF (KRR /= 0) THEN ! moist case CALL GZ_M_W_PHY(D,PRM(:,:,1),PDZZ,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - PREDTH1(IIJB:IIJE,1:IKT)= CSTURB%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT) * PETHETA(IIJB:IIJE,1:IKT) & + PREDTH1(IIJB:IIJE,1:IKT)= TURBN%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT) * PETHETA(IIJB:IIJE,1:IKT) & * ZWORK1(IIJB:IIJE,1:IKT) - PREDR1(IIJB:IIJE,1:IKT) = CSTURB%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT) * PEMOIST(IIJB:IIJE,1:IKT) & + PREDR1(IIJB:IIJE,1:IKT) = TURBN%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT) * PEMOIST(IIJB:IIJE,1:IKT) & * ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ELSE ! dry case !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - PREDTH1(IIJB:IIJE,1:IKT)= CSTURB%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT) * ZWORK1(IIJB:IIJE,1:IKT) + PREDTH1(IIJB:IIJE,1:IKT)= TURBN%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT) * ZWORK1(IIJB:IIJE,1:IKT) PREDR1(IIJB:IIJE,1:IKT) = 0. !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) END IF @@ -371,7 +374,7 @@ ENDDO DO JSV=1,KSV CALL GZ_M_W_PHY(D,PSVM(:,:,JSV),PDZZ,ZWORK1) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - PREDS1(IIJB:IIJE,1:IKT,JSV)=CSTURB%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT)*ZWORK1(IIJB:IIJE,1:IKT) + PREDS1(IIJB:IIJE,1:IKT,JSV)=TURBN%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT)*ZWORK1(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) END DO ! @@ -425,13 +428,13 @@ ELSE IF (O2D) THEN ! 3D case in a 2D model CALL MZM_PHY(D,ZWORK1,ZWORK4) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - PRED2TH3(IIJB:IIJE,1:IKT)= PREDTH1(IIJB:IIJE,1:IKT)**2+(CSTURB%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT) & + PRED2TH3(IIJB:IIJE,1:IKT)= PREDTH1(IIJB:IIJE,1:IKT)**2+(TURBN%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT) & *PETHETA(IIJB:IIJE,1:IKT) )**2 * ZWORK2(IIJB:IIJE,1:IKT) ! - PRED2R3(IIJB:IIJE,1:IKT)= PREDR1(IIJB:IIJE,1:IKT)**2 + (CSTURB%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT) & + PRED2R3(IIJB:IIJE,1:IKT)= PREDR1(IIJB:IIJE,1:IKT)**2 + (TURBN%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT) & * PEMOIST(IIJB:IIJE,1:IKT))**2 * ZWORK3(IIJB:IIJE,1:IKT) ! - PRED2THR3(IIJB:IIJE,1:IKT)= PREDR1(IIJB:IIJE,1:IKT) * PREDTH1(IIJB:IIJE,1:IKT) + CSTURB%XCTV**2 & + PRED2THR3(IIJB:IIJE,1:IKT)= PREDR1(IIJB:IIJE,1:IKT) * PREDTH1(IIJB:IIJE,1:IKT) + TURBN%XCTV**2 & * PBLL_O_E(IIJB:IIJE,1:IKT)**2 & * PEMOIST(IIJB:IIJE,1:IKT) * PETHETA(IIJB:IIJE,1:IKT) & * ZWORK4(IIJB:IIJE,1:IKT) @@ -443,7 +446,7 @@ ELSE IF (O2D) THEN ! 3D case in a 2D model ! ELSE ! dry 3D case in a 2D model !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - PRED2TH3(IIJB:IIJE,1:IKT) = PREDTH1(IIJB:IIJE,1:IKT)**2 + CSTURB%XCTV**2 & + PRED2TH3(IIJB:IIJE,1:IKT) = PREDTH1(IIJB:IIJE,1:IKT)**2 + TURBN%XCTV**2 & * PBLL_O_E(IIJB:IIJE,1:IKT)**2 * ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PRED2TH3(IIJB:IIJE,IKB)=PRED2TH3(IIJB:IIJE,IKB+IKL) @@ -478,13 +481,13 @@ ELSE ! 3D case in a 3D model CALL MZM_PHY(D,ZWORK1,ZWORK4) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - PRED2TH3(IIJB:IIJE,1:IKT)= PREDTH1(IIJB:IIJE,1:IKT)**2 + ( CSTURB%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT) & + PRED2TH3(IIJB:IIJE,1:IKT)= PREDTH1(IIJB:IIJE,1:IKT)**2 + ( TURBN%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT) & * PETHETA(IIJB:IIJE,1:IKT) )**2 * ZWORK2(IIJB:IIJE,1:IKT) ! - PRED2R3(IIJB:IIJE,1:IKT)= PREDR1(IIJB:IIJE,1:IKT)**2 + (CSTURB%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT) & + PRED2R3(IIJB:IIJE,1:IKT)= PREDR1(IIJB:IIJE,1:IKT)**2 + (TURBN%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT) & * PEMOIST(IIJB:IIJE,1:IKT))**2 * ZWORK3(IIJB:IIJE,1:IKT) ! - PRED2THR3(IIJB:IIJE,1:IKT)= PREDR1(IIJB:IIJE,1:IKT) * PREDTH1(IIJB:IIJE,1:IKT) + CSTURB%XCTV**2 & + PRED2THR3(IIJB:IIJE,1:IKT)= PREDR1(IIJB:IIJE,1:IKT) * PREDTH1(IIJB:IIJE,1:IKT) + TURBN%XCTV**2 & * PBLL_O_E(IIJB:IIJE,1:IKT)**2 * & PEMOIST(IIJB:IIJE,1:IKT) * PETHETA(IIJB:IIJE,1:IKT) * ZWORK4(IIJB:IIJE,1:IKT) @@ -496,7 +499,7 @@ ELSE ! 3D case in a 3D model ! ELSE ! dry 3D case in a 3D model !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - PRED2TH3(IIJB:IIJE,1:IKT) = PREDTH1(IIJB:IIJE,1:IKT)**2 + CSTURB%XCTV**2 & + PRED2TH3(IIJB:IIJE,1:IKT) = PREDTH1(IIJB:IIJE,1:IKT)**2 + TURBN%XCTV**2 & * PBLL_O_E(IIJB:IIJE,1:IKT)**2 * ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! @@ -733,9 +736,10 @@ ENDIF ! (Done only if OHARAT is FALSE) IF (LHOOK) CALL DR_HOOK('PRANDTL',1,ZHOOK_HANDLE) END SUBROUTINE PRANDTL ! -SUBROUTINE SMOOTH_TURB_FUNCT(D,CSTURB,PPHI3,PF_LIM,PF) +SUBROUTINE SMOOTH_TURB_FUNCT(D,CSTURB,TURBN,PPHI3,PF_LIM,PF) ! TYPE(CSTURB_t), INTENT(IN) :: CSTURB +TYPE(TURB_t), INTENT(IN) :: TURBN TYPE(DIMPHYEX_t), INTENT(IN) :: D REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PPHI3 ! Phi3 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PF_LIM ! Value of F when Phi3 is @@ -763,8 +767,9 @@ PF(IIJB:IIJE,1:IKT) = ZCOEF(IIJB:IIJE,1:IKT) * PF(IIJB:IIJE,1:IKT) & ! END SUBROUTINE SMOOTH_TURB_FUNCT !---------------------------------------------------------------------------- -SUBROUTINE PHI3(D,CSTURB,PREDTH1,PREDR1,PRED2TH3,PRED2R3,PRED2THR3,HTURBDIM,OUSERV,PPHI3) +SUBROUTINE PHI3(D,CSTURB,TURBN,PREDTH1,PREDR1,PRED2TH3,PRED2R3,PRED2THR3,HTURBDIM,OUSERV,PPHI3) TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN TYPE(DIMPHYEX_t), INTENT(IN) :: D REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 @@ -836,8 +841,9 @@ PPHI3(IIJB:IIJE,IKE+1)=PPHI3(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:PHI3',1,ZHOOK_HANDLE) END SUBROUTINE PHI3 !---------------------------------------------------------------------------- -SUBROUTINE PSI_SV(D,CSTURB,KSV,PREDTH1,PREDR1,PREDS1,PRED2THS,PRED2RS,PPHI3,PPSI3,PPSI_SV) +SUBROUTINE PSI_SV(D,CSTURB,TURBN,KSV,PREDTH1,PREDR1,PREDS1,PRED2THS,PRED2RS,PPHI3,PPSI3,PPSI_SV) TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN TYPE(DIMPHYEX_t), INTENT(IN) :: D INTEGER, INTENT(IN) :: KSV REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 @@ -891,8 +897,9 @@ END DO IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:PSI_SV',1,ZHOOK_HANDLE) END SUBROUTINE PSI_SV !---------------------------------------------------------------------------- -SUBROUTINE D_PHI3DTDZ_O_DDTDZ(D,CSTURB,PPHI3,PREDTH1,PREDR1,PRED2TH3,PRED2THR3,HTURBDIM,OUSERV,PD_PHI3DTDZ_O_DDTDZ) +SUBROUTINE D_PHI3DTDZ_O_DDTDZ(D,CSTURB,TURBN,PPHI3,PREDTH1,PREDR1,PRED2TH3,PRED2THR3,HTURBDIM,OUSERV,PD_PHI3DTDZ_O_DDTDZ) TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN TYPE(DIMPHYEX_t), INTENT(IN) :: D REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PPHI3 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 @@ -975,7 +982,7 @@ END IF #ifdef REPRO48 #else !* smoothing -CALL SMOOTH_TURB_FUNCT(D,CSTURB,PPHI3,PPHI3,PD_PHI3DTDZ_O_DDTDZ) +CALL SMOOTH_TURB_FUNCT(D,CSTURB,TURBN,PPHI3,PPHI3,PD_PHI3DTDZ_O_DDTDZ) #endif ! PD_PHI3DTDZ_O_DDTDZ(IIJB:IIJE,IKB-1)=PD_PHI3DTDZ_O_DDTDZ(IIJB:IIJE,IKB) @@ -984,8 +991,9 @@ PD_PHI3DTDZ_O_DDTDZ(IIJB:IIJE,IKE+1)=PD_PHI3DTDZ_O_DDTDZ(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_PHI3DTDZ_O_DDTDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_PHI3DTDZ_O_DDTDZ !---------------------------------------------------------------------------- -SUBROUTINE D_PHI3DRDZ_O_DDRDZ(D,CSTURB,PPHI3,PREDTH1,PREDR1,PRED2TH3,PRED2THR3,HTURBDIM,OUSERV,PD_PHI3DRDZ_O_DDRDZ) +SUBROUTINE D_PHI3DRDZ_O_DDRDZ(D,CSTURB,TURBN,PPHI3,PREDTH1,PREDR1,PRED2TH3,PRED2THR3,HTURBDIM,OUSERV,PD_PHI3DRDZ_O_DDRDZ) TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN TYPE(DIMPHYEX_t), INTENT(IN) :: D REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PPHI3 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 @@ -1052,7 +1060,7 @@ END IF #ifdef REPRO48 #else !* smoothing -CALL SMOOTH_TURB_FUNCT(D,CSTURB,PPHI3,PPHI3,PD_PHI3DRDZ_O_DDRDZ) +CALL SMOOTH_TURB_FUNCT(D,CSTURB,TURBN,PPHI3,PPHI3,PD_PHI3DRDZ_O_DDRDZ) #endif ! PD_PHI3DRDZ_O_DDRDZ(IIJB:IIJE,IKB-1)=PD_PHI3DRDZ_O_DDRDZ(IIJB:IIJE,IKB) @@ -1061,8 +1069,9 @@ PD_PHI3DRDZ_O_DDRDZ(IIJB:IIJE,IKE+1)=PD_PHI3DRDZ_O_DDRDZ(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_PHI3DRDZ_O_DDRDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_PHI3DRDZ_O_DDRDZ !---------------------------------------------------------------------------- -SUBROUTINE D_PHI3DTDZ2_O_DDTDZ(D,CSTURB,PPHI3,PREDTH1,PREDR1,PRED2TH3,PRED2THR3,PDTDZ,HTURBDIM,OUSERV,PD_PHI3DTDZ2_O_DDTDZ) +SUBROUTINE D_PHI3DTDZ2_O_DDTDZ(D,CSTURB,TURBN,PPHI3,PREDTH1,PREDR1,PRED2TH3,PRED2THR3,PDTDZ,HTURBDIM,OUSERV,PD_PHI3DTDZ2_O_DDTDZ) TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN TYPE(DIMPHYEX_t), INTENT(IN) :: D REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PPHI3 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 @@ -1087,7 +1096,7 @@ IKT=D%NKT ! IF (HTURBDIM=='3DIM') THEN ! by derivation of (phi3 dtdz) * dtdz according to dtdz we obtain: - CALL D_PHI3DTDZ_O_DDTDZ(D,CSTURB,PPHI3,PREDTH1,PREDR1,PRED2TH3,PRED2THR3,HTURBDIM,OUSERV,ZWORK1) + CALL D_PHI3DTDZ_O_DDTDZ(D,CSTURB,TURBN,PPHI3,PREDTH1,PREDR1,PRED2TH3,PRED2THR3,HTURBDIM,OUSERV,ZWORK1) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PD_PHI3DTDZ2_O_DDTDZ(IIJB:IIJE,1:IKT) = PDTDZ(IIJB:IIJE,1:IKT) & * (PPHI3(IIJB:IIJE,1:IKT) + ZWORK1(IIJB:IIJE,1:IKT)) @@ -1111,7 +1120,7 @@ END IF #ifdef REPRO48 #else !* smoothing -CALL SMOOTH_TURB_FUNCT(D,CSTURB,PPHI3,PPHI3*2.*PDTDZ,PD_PHI3DTDZ2_O_DDTDZ) +CALL SMOOTH_TURB_FUNCT(D,CSTURB,TURBN,PPHI3,PPHI3*2.*PDTDZ,PD_PHI3DTDZ2_O_DDTDZ) #endif ! ! @@ -1121,9 +1130,10 @@ PD_PHI3DTDZ2_O_DDTDZ(IIJB:IIJE,IKE+1)=PD_PHI3DTDZ2_O_DDTDZ(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_PHI3DTDZ2_O_DDTDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_PHI3DTDZ2_O_DDTDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_WTH_WTH2(D,CSTURB,PREDTH1,PREDR1,PD,PBLL_O_E,PETHETA,PM3_WTH_WTH2) +SUBROUTINE M3_WTH_WTH2(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PBLL_O_E,PETHETA,PM3_WTH_WTH2) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -1141,7 +1151,7 @@ IIJB=D%NIJB IKT=D%NKT ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) -PM3_WTH_WTH2(IIJB:IIJE,1:IKT) = CSTURB%XCSHF*PBLL_O_E(IIJB:IIJE,1:IKT)& +PM3_WTH_WTH2(IIJB:IIJE,1:IKT) = TURBN%XCSHF*PBLL_O_E(IIJB:IIJE,1:IKT)& * PETHETA(IIJB:IIJE,1:IKT)*0.5/CSTURB%XCTD & * (1.+0.5*PREDTH1(IIJB:IIJE,1:IKT)+PREDR1(IIJB:IIJE,1:IKT)) / PD(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -1151,9 +1161,10 @@ PM3_WTH_WTH2(IIJB:IIJE,IKE+1)=PM3_WTH_WTH2(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_WTH_WTH2',1,ZHOOK_HANDLE) END SUBROUTINE M3_WTH_WTH2 !---------------------------------------------------------------------------- -SUBROUTINE D_M3_WTH_WTH2_O_DDTDZ(D,CSTURB,PM3_WTH_WTH2,PREDTH1,PREDR1,PD,PBLL_O_E,PETHETA,PD_M3_WTH_WTH2_O_DDTDZ) +SUBROUTINE D_M3_WTH_WTH2_O_DDTDZ(D,CSTURB,TURBN,PM3_WTH_WTH2,PREDTH1,PREDR1,PD,PBLL_O_E,PETHETA,PD_M3_WTH_WTH2_O_DDTDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PM3_WTH_WTH2 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 @@ -1173,10 +1184,10 @@ IKT=D%NKT ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PD_M3_WTH_WTH2_O_DDTDZ(IIJB:IIJE,1:IKT) = & -(0.5*CSTURB%XCSHF*PBLL_O_E(IIJB:IIJE,1:IKT)*PETHETA(IIJB:IIJE,1:IKT)*0.5/CSTURB%XCTD/PD(IIJB:IIJE,1:IKT) & +(0.5*TURBN%XCSHF*PBLL_O_E(IIJB:IIJE,1:IKT)*PETHETA(IIJB:IIJE,1:IKT)*0.5/CSTURB%XCTD/PD(IIJB:IIJE,1:IKT) & - PM3_WTH_WTH2(IIJB:IIJE,1:IKT)/PD(IIJB:IIJE,1:IKT)& *(1.5+PREDTH1(IIJB:IIJE,1:IKT)+PREDR1(IIJB:IIJE,1:IKT)) )& -* PBLL_O_E(IIJB:IIJE,1:IKT) * PETHETA(IIJB:IIJE,1:IKT) * CSTURB%XCTV +* PBLL_O_E(IIJB:IIJE,1:IKT) * PETHETA(IIJB:IIJE,1:IKT) * TURBN%XCTV !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! PD_M3_WTH_WTH2_O_DDTDZ(IIJB:IIJE,IKB-1)=PD_M3_WTH_WTH2_O_DDTDZ(IIJB:IIJE,IKB) @@ -1185,9 +1196,10 @@ PD_M3_WTH_WTH2_O_DDTDZ(IIJB:IIJE,IKE+1)=PD_M3_WTH_WTH2_O_DDTDZ(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_WTH_WTH2_O_DDTDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_WTH_WTH2_O_DDTDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_WTH_W2TH(D,CSTURB,PREDTH1,PREDR1,PD,PKEFF,PTKE,PM3_WTH_W2TH) +SUBROUTINE M3_WTH_W2TH(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PKEFF,PTKE,PM3_WTH_W2TH) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -1207,7 +1219,7 @@ IKT=D%NKT ! CALL MZM_PHY(D,PTKE,ZWORK1) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) -PM3_WTH_W2TH(IIJB:IIJE,1:IKT) = CSTURB%XCSHF*PKEFF(IIJB:IIJE,1:IKT)*1.5/ZWORK1(IIJB:IIJE,1:IKT) & +PM3_WTH_W2TH(IIJB:IIJE,1:IKT) = TURBN%XCSHF*PKEFF(IIJB:IIJE,1:IKT)*1.5/ZWORK1(IIJB:IIJE,1:IKT) & * (1. - 0.5*PREDR1(IIJB:IIJE,1:IKT)*(1.+PREDR1(IIJB:IIJE,1:IKT))/PD(IIJB:IIJE,1:IKT) ) & / (1.+PREDTH1(IIJB:IIJE,1:IKT)) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -1218,9 +1230,10 @@ PM3_WTH_W2TH(IIJB:IIJE,IKE+1)=PM3_WTH_W2TH(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_WTH_W2TH',1,ZHOOK_HANDLE) END SUBROUTINE M3_WTH_W2TH !---------------------------------------------------------------------------- -SUBROUTINE D_M3_WTH_W2TH_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,PD,PBLL_O_E,PETHETA,PKEFF,PTKE,PD_M3_WTH_W2TH_O_DDTDZ) +SUBROUTINE D_M3_WTH_W2TH_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PBLL_O_E,PETHETA,PKEFF,PTKE,PD_M3_WTH_W2TH_O_DDTDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -1243,8 +1256,8 @@ IKT=D%NKT CALL MZM_PHY(D,PTKE,ZWORK1) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PD_M3_WTH_W2TH_O_DDTDZ(IIJB:IIJE,1:IKT) = & - - CSTURB%XCSHF*PKEFF(IIJB:IIJE,1:IKT)*1.5/ZWORK1(IIJB:IIJE,1:IKT)/(1.+PREDTH1(IIJB:IIJE,1:IKT))**2 & - * CSTURB%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT)*PETHETA(IIJB:IIJE,1:IKT) & + - TURBN%XCSHF*PKEFF(IIJB:IIJE,1:IKT)*1.5/ZWORK1(IIJB:IIJE,1:IKT)/(1.+PREDTH1(IIJB:IIJE,1:IKT))**2 & + * TURBN%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT)*PETHETA(IIJB:IIJE,1:IKT) & * (1. - 0.5*PREDR1(IIJB:IIJE,1:IKT)*(1.+PREDR1(IIJB:IIJE,1:IKT))/PD(IIJB:IIJE,1:IKT)* & ( 1.+(1.+PREDTH1(IIJB:IIJE,1:IKT))*(1.5+PREDR1(IIJB:IIJE,1:IKT)+PREDTH1(IIJB:IIJE,1:IKT))& /PD(IIJB:IIJE,1:IKT)) ) @@ -1256,9 +1269,10 @@ PD_M3_WTH_W2TH_O_DDTDZ(IIJB:IIJE,IKE+1)=PD_M3_WTH_W2TH_O_DDTDZ(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_WTH_W2TH_O_DDTDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_WTH_W2TH_O_DDTDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_WTH_W2R(D,CSTURB,PD,PKEFF,PTKE,PBLL_O_E,PEMOIST,PDTDZ,PM3_WTH_W2R) +SUBROUTINE M3_WTH_W2R(D,CSTURB,TURBN,PD,PKEFF,PTKE,PBLL_O_E,PEMOIST,PDTDZ,PM3_WTH_W2R) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PKEFF REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PTKE @@ -1280,7 +1294,7 @@ IKT=D%NKT CALL MZM_PHY(D,PTKE,ZWORK1) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PM3_WTH_W2R(IIJB:IIJE,1:IKT) = & - - CSTURB%XCSHF*PKEFF(IIJB:IIJE,1:IKT)*0.75*CSTURB%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT) & + - TURBN%XCSHF*PKEFF(IIJB:IIJE,1:IKT)*0.75*TURBN%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT) & /ZWORK1(IIJB:IIJE,1:IKT)*PEMOIST(IIJB:IIJE,1:IKT)*PDTDZ(IIJB:IIJE,1:IKT)/PD(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! @@ -1290,9 +1304,10 @@ PM3_WTH_W2R(IIJB:IIJE,IKE+1)=PM3_WTH_W2R(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_WTH_W2R',1,ZHOOK_HANDLE) END SUBROUTINE M3_WTH_W2R !---------------------------------------------------------------------------- -SUBROUTINE D_M3_WTH_W2R_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,PD,PKEFF,PTKE,PBLL_O_E,PEMOIST,PD_M3_WTH_W2R_O_DDTDZ) +SUBROUTINE D_M3_WTH_W2R_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PKEFF,PTKE,PBLL_O_E,PEMOIST,PD_M3_WTH_W2R_O_DDTDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -1315,7 +1330,7 @@ IKT=D%NKT CALL MZM_PHY(D,PTKE,ZWORK1) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PD_M3_WTH_W2R_O_DDTDZ(IIJB:IIJE,1:IKT) = & -- CSTURB%XCSHF*PKEFF(IIJB:IIJE,1:IKT)*0.75*CSTURB%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT) & +- TURBN%XCSHF*PKEFF(IIJB:IIJE,1:IKT)*0.75*TURBN%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT) & /ZWORK1(IIJB:IIJE,1:IKT)*PEMOIST(IIJB:IIJE,1:IKT)/PD(IIJB:IIJE,1:IKT) & * (1. - PREDTH1(IIJB:IIJE,1:IKT)*(1.5+PREDTH1(IIJB:IIJE,1:IKT)& +PREDR1(IIJB:IIJE,1:IKT))/PD(IIJB:IIJE,1:IKT)) @@ -1327,9 +1342,10 @@ PD_M3_WTH_W2R_O_DDTDZ(IIJB:IIJE,IKE+1)=PD_M3_WTH_W2R_O_DDTDZ(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_WTH_W2R_O_DDTDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_WTH_W2R_O_DDTDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_WTH_WR2(D,CSTURB,PD,PKEFF,PTKE,PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PEMOIST,PDTDZ,PM3_WTH_WR2) +SUBROUTINE M3_WTH_WR2(D,CSTURB,TURBN,PD,PKEFF,PTKE,PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PEMOIST,PDTDZ,PM3_WTH_WR2) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PKEFF REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PTKE @@ -1357,8 +1373,8 @@ ZWORK1(IIJB:IIJE,1:IKT) = PBETA(IIJB:IIJE,1:IKT)*PLEPS(IIJB:IIJE,1:IKT) & !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) CALL MZM_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) -PM3_WTH_WR2(IIJB:IIJE,1:IKT) = - CSTURB%XCSHF*PKEFF(IIJB:IIJE,1:IKT)& - *0.25*PBLL_O_E(IIJB:IIJE,1:IKT)*CSTURB%XCTV*PEMOIST(IIJB:IIJE,1:IKT)**2 & +PM3_WTH_WR2(IIJB:IIJE,1:IKT) = - TURBN%XCSHF*PKEFF(IIJB:IIJE,1:IKT)& + *0.25*PBLL_O_E(IIJB:IIJE,1:IKT)*TURBN%XCTV*PEMOIST(IIJB:IIJE,1:IKT)**2 & *ZWORK2(IIJB:IIJE,1:IKT)/CSTURB%XCTD*PDTDZ(IIJB:IIJE,1:IKT)/PD(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! @@ -1368,9 +1384,11 @@ PM3_WTH_WR2(IIJB:IIJE,IKE+1)=PM3_WTH_WR2(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_WTH_WR2',1,ZHOOK_HANDLE) END SUBROUTINE M3_WTH_WR2 !---------------------------------------------------------------------------- -SUBROUTINE D_M3_WTH_WR2_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,PD,PKEFF,PTKE,PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PEMOIST,PD_M3_WTH_WR2_O_DDTDZ) +SUBROUTINE D_M3_WTH_WR2_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PKEFF,PTKE,PSQRT_TKE,PBLL_O_E,& + &PBETA,PLEPS,PEMOIST,PD_M3_WTH_WR2_O_DDTDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -1399,8 +1417,8 @@ ZWORK1(IIJB:IIJE,1:IKT) = PBETA(IIJB:IIJE,1:IKT)*PLEPS(IIJB:IIJE,1:IKT)& !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) CALL MZM_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) -PD_M3_WTH_WR2_O_DDTDZ(IIJB:IIJE,1:IKT) = - CSTURB%XCSHF*PKEFF(IIJB:IIJE,1:IKT)& - *0.25*PBLL_O_E(IIJB:IIJE,1:IKT)*CSTURB%XCTV*PEMOIST(IIJB:IIJE,1:IKT)**2 & +PD_M3_WTH_WR2_O_DDTDZ(IIJB:IIJE,1:IKT) = - TURBN%XCSHF*PKEFF(IIJB:IIJE,1:IKT)& + *0.25*PBLL_O_E(IIJB:IIJE,1:IKT)*TURBN%XCTV*PEMOIST(IIJB:IIJE,1:IKT)**2 & *ZWORK2(IIJB:IIJE,1:IKT)/CSTURB%XCTD/PD(IIJB:IIJE,1:IKT) & * (1. - PREDTH1(IIJB:IIJE,1:IKT)* & (1.5+PREDTH1(IIJB:IIJE,1:IKT)+PREDR1(IIJB:IIJE,1:IKT))/PD(IIJB:IIJE,1:IKT)) @@ -1412,9 +1430,10 @@ PD_M3_WTH_WR2_O_DDTDZ(IIJB:IIJE,IKE+1)=PD_M3_WTH_WR2_O_DDTDZ(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_WTH_WR2_O_DDTDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_WTH_WR2_O_DDTDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_WTH_WTHR(D,CSTURB,PREDR1,PD,PKEFF,PTKE,PSQRT_TKE,PBETA,PLEPS,PEMOIST,PM3_WTH_WTHR) +SUBROUTINE M3_WTH_WTHR(D,CSTURB,TURBN,PREDR1,PD,PKEFF,PTKE,PSQRT_TKE,PBETA,PLEPS,PEMOIST,PM3_WTH_WTHR) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PKEFF @@ -1442,7 +1461,7 @@ ZWORK1(IIJB:IIJE,1:IKT) = PBETA(IIJB:IIJE,1:IKT)*PLEPS(IIJB:IIJE,1:IKT)& CALL MZM_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PM3_WTH_WTHR(IIJB:IIJE,1:IKT) = & - CSTURB%XCSHF*PKEFF(IIJB:IIJE,1:IKT)*PEMOIST(IIJB:IIJE,1:IKT)*ZWORK2(IIJB:IIJE,1:IKT) & + TURBN%XCSHF*PKEFF(IIJB:IIJE,1:IKT)*PEMOIST(IIJB:IIJE,1:IKT)*ZWORK2(IIJB:IIJE,1:IKT) & *0.5*PLEPS(IIJB:IIJE,1:IKT)/CSTURB%XCTD*(1+PREDR1(IIJB:IIJE,1:IKT))/PD(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! @@ -1452,9 +1471,10 @@ PM3_WTH_WTHR(IIJB:IIJE,IKE+1)=PM3_WTH_WTHR(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_WTH_WTHR',1,ZHOOK_HANDLE) END SUBROUTINE M3_WTH_WTHR !---------------------------------------------------------------------------- -SUBROUTINE D_M3_WTH_WTHR_O_DDTDZ(D,CSTURB,PM3_WTH_WTHR,PREDTH1,PREDR1,PD,PBLL_O_E,PETHETA,PD_M3_WTH_WTHR_O_DDTDZ) +SUBROUTINE D_M3_WTH_WTHR_O_DDTDZ(D,CSTURB,TURBN,PM3_WTH_WTHR,PREDTH1,PREDR1,PD,PBLL_O_E,PETHETA,PD_M3_WTH_WTHR_O_DDTDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PM3_WTH_WTHR REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 @@ -1475,7 +1495,7 @@ IKT=D%NKT !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PD_M3_WTH_WTHR_O_DDTDZ(IIJB:IIJE,1:IKT) = & - PM3_WTH_WTHR(IIJB:IIJE,1:IKT) * (1.5+PREDTH1(IIJB:IIJE,1:IKT)+PREDR1(IIJB:IIJE,1:IKT))& - /PD(IIJB:IIJE,1:IKT)*CSTURB%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT)*PETHETA(IIJB:IIJE,1:IKT) + /PD(IIJB:IIJE,1:IKT)*TURBN%XCTV*PBLL_O_E(IIJB:IIJE,1:IKT)*PETHETA(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! PD_M3_WTH_WTHR_O_DDTDZ(IIJB:IIJE,IKB-1)=PD_M3_WTH_WTHR_O_DDTDZ(IIJB:IIJE,IKB) @@ -1484,9 +1504,10 @@ PD_M3_WTH_WTHR_O_DDTDZ(IIJB:IIJE,IKE+1)=PD_M3_WTH_WTHR_O_DDTDZ(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_WTH_WTHR_O_DDTDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_WTH_WTHR_O_DDTDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_TH2_W2TH(D,CSTURB,PREDTH1,PREDR1,PD,PDTDZ,PLM,PLEPS,PTKE,PM3_TH2_W2TH) +SUBROUTINE M3_TH2_W2TH(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PDTDZ,PLM,PLEPS,PTKE,PM3_TH2_W2TH) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -1513,7 +1534,7 @@ ZWORK1(IIJB:IIJE,1:IKT) = (1.-0.5*PREDR1(IIJB:IIJE,1:IKT)*(1.+PREDR1(IIJB:IIJE,1 CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PM3_TH2_W2TH(IIJB:IIJE,1:IKT) = - ZWORK2(IIJB:IIJE,1:IKT) & - * 1.5*PLM(IIJB:IIJE,1:IKT)*PLEPS(IIJB:IIJE,1:IKT)/PTKE(IIJB:IIJE,1:IKT)*CSTURB%XCTV + * 1.5*PLM(IIJB:IIJE,1:IKT)*PLEPS(IIJB:IIJE,1:IKT)/PTKE(IIJB:IIJE,1:IKT)*TURBN%XCTV !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! PM3_TH2_W2TH(IIJB:IIJE,IKB-1)=PM3_TH2_W2TH(IIJB:IIJE,IKB) @@ -1522,9 +1543,10 @@ PM3_TH2_W2TH(IIJB:IIJE,IKE+1)=PM3_TH2_W2TH(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_TH2_W2TH',1,ZHOOK_HANDLE) END SUBROUTINE M3_TH2_W2TH !---------------------------------------------------------------------------- -SUBROUTINE D_M3_TH2_W2TH_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,PD,PLM,PLEPS,PTKE,OUSERV,PD_M3_TH2_W2TH_O_DDTDZ) +SUBROUTINE D_M3_TH2_W2TH_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PLM,PLEPS,PTKE,OUSERV,PD_M3_TH2_W2TH_O_DDTDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -1545,7 +1567,7 @@ IIJB=D%NIJB IKT=D%NKT ! IF (OUSERV) THEN -! D_M3_TH2_W2TH_O_DDTDZ(IIJB:IIJE,1:IKT) = - 1.5*PLM*PLEPS/PTKE*CSTURB%XCTV * MZF( & +! D_M3_TH2_W2TH_O_DDTDZ(IIJB:IIJE,1:IKT) = - 1.5*PLM*PLEPS/PTKE*TURBN%XCTV * MZF( & ! (1.-0.5*PREDR1*(1.+PREDR1)/PD)*(1.-(1.5+PREDTH1+PREDR1)*(1.+PREDTH1)/PD ) & ! / (1.+PREDTH1)**2, IKA, IKU, IKL) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -1557,7 +1579,7 @@ IF (OUSERV) THEN CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PD_M3_TH2_W2TH_O_DDTDZ(IIJB:IIJE,1:IKT) = - 1.5*PLM(IIJB:IIJE,1:IKT)*PLEPS(IIJB:IIJE,1:IKT) & - /PTKE(IIJB:IIJE,1:IKT)*CSTURB%XCTV * ZWORK2(IIJB:IIJE,1:IKT) + /PTKE(IIJB:IIJE,1:IKT)*TURBN%XCTV * ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ELSE !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -1566,7 +1588,7 @@ ELSE CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PD_M3_TH2_W2TH_O_DDTDZ(IIJB:IIJE,1:IKT) = - 1.5*PLM(IIJB:IIJE,1:IKT)*PLEPS(IIJB:IIJE,1:IKT) & - /PTKE(IIJB:IIJE,1:IKT)*CSTURB%XCTV * ZWORK2(IIJB:IIJE,1:IKT) + /PTKE(IIJB:IIJE,1:IKT)*TURBN%XCTV * ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) END IF ! @@ -1576,9 +1598,10 @@ PD_M3_TH2_W2TH_O_DDTDZ(IIJB:IIJE,IKE+1)=PD_M3_TH2_W2TH_O_DDTDZ(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_TH2_W2TH_O_DDTDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_TH2_W2TH_O_DDTDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_TH2_WTH2(D,CSTURB,PREDTH1,PREDR1,PD,PLEPS,PSQRT_TKE,PM3_TH2_WTH2) +SUBROUTINE M3_TH2_WTH2(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PLEPS,PSQRT_TKE,PM3_TH2_WTH2) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -1612,9 +1635,10 @@ PM3_TH2_WTH2(IIJB:IIJE,IKE+1)=PM3_TH2_WTH2(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_TH2_WTH2',1,ZHOOK_HANDLE) END SUBROUTINE M3_TH2_WTH2 !---------------------------------------------------------------------------- -SUBROUTINE D_M3_TH2_WTH2_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PD_M3_TH2_WTH2_O_DDTDZ) +SUBROUTINE D_M3_TH2_WTH2_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PD_M3_TH2_WTH2_O_DDTDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -1643,7 +1667,7 @@ ZWORK1(IIJB:IIJE,1:IKT) = PBLL_O_E(IIJB:IIJE,1:IKT)*PETHETA(IIJB:IIJE,1:IKT) & CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PD_M3_TH2_WTH2_O_DDTDZ(IIJB:IIJE,1:IKT) = PLEPS(IIJB:IIJE,1:IKT) & - *0.5/CSTURB%XCTD/PSQRT_TKE(IIJB:IIJE,1:IKT)*CSTURB%XCTV * ZWORK2(IIJB:IIJE,1:IKT) + *0.5/CSTURB%XCTD/PSQRT_TKE(IIJB:IIJE,1:IKT)*TURBN%XCTV * ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! PD_M3_TH2_WTH2_O_DDTDZ(IIJB:IIJE,IKB-1)=PD_M3_TH2_WTH2_O_DDTDZ(IIJB:IIJE,IKB) @@ -1652,9 +1676,10 @@ PD_M3_TH2_WTH2_O_DDTDZ(IIJB:IIJE,IKE+1)=PD_M3_TH2_WTH2_O_DDTDZ(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_TH2_WTH2_O_DDTDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_TH2_WTH2_O_DDTDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_TH2_W2R(D,CSTURB,PD,PLM,PLEPS,PTKE,PBLL_O_E,PEMOIST,PDTDZ,PM3_TH2_W2R) +SUBROUTINE M3_TH2_W2R(D,CSTURB,TURBN,PD,PLM,PLEPS,PTKE,PBLL_O_E,PEMOIST,PDTDZ,PM3_TH2_W2R) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLM REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLEPS @@ -1680,7 +1705,7 @@ ZWORK1(IIJB:IIJE,1:IKT) = PBLL_O_E(IIJB:IIJE,1:IKT)*PEMOIST(IIJB:IIJE,1:IKT) & !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) -PM3_TH2_W2R(IIJB:IIJE,1:IKT) = 0.75*CSTURB%XCTV**2*ZWORK2(IIJB:IIJE,1:IKT) & +PM3_TH2_W2R(IIJB:IIJE,1:IKT) = 0.75*TURBN%XCTV**2*ZWORK2(IIJB:IIJE,1:IKT) & *PLM(IIJB:IIJE,1:IKT)*PLEPS(IIJB:IIJE,1:IKT)/PTKE(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! @@ -1690,9 +1715,10 @@ PM3_TH2_W2R(IIJB:IIJE,IKE+1)=PM3_TH2_W2R(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_TH2_W2R',1,ZHOOK_HANDLE) END SUBROUTINE M3_TH2_W2R !---------------------------------------------------------------------------- -SUBROUTINE D_M3_TH2_W2R_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,PD,PLM,PLEPS,PTKE,PBLL_O_E,PEMOIST,PDTDZ,PD_M3_TH2_W2R_O_DDTDZ) +SUBROUTINE D_M3_TH2_W2R_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PLM,PLEPS,PTKE,PBLL_O_E,PEMOIST,PDTDZ,PD_M3_TH2_W2R_O_DDTDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -1721,7 +1747,7 @@ ZWORK1(IIJB:IIJE,1:IKT) = PBLL_O_E(IIJB:IIJE,1:IKT)*PEMOIST(IIJB:IIJE,1:IKT)& !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) -PD_M3_TH2_W2R_O_DDTDZ(IIJB:IIJE,1:IKT) = 0.75*CSTURB%XCTV**2*PLM(IIJB:IIJE,1:IKT) *PLEPS(IIJB:IIJE,1:IKT) & +PD_M3_TH2_W2R_O_DDTDZ(IIJB:IIJE,1:IKT) = 0.75*TURBN%XCTV**2*PLM(IIJB:IIJE,1:IKT) *PLEPS(IIJB:IIJE,1:IKT) & /PTKE(IIJB:IIJE,1:IKT) * ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! @@ -1731,9 +1757,10 @@ PD_M3_TH2_W2R_O_DDTDZ(IIJB:IIJE,IKE+1)=PD_M3_TH2_W2R_O_DDTDZ(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_TH2_W2R_O_DDTDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_TH2_W2R_O_DDTDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_TH2_WR2(D,CSTURB,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTDZ,PM3_TH2_WR2) +SUBROUTINE M3_TH2_WR2(D,CSTURB,TURBN,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTDZ,PM3_TH2_WR2) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLEPS REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PSQRT_TKE @@ -1758,7 +1785,7 @@ ZWORK1(IIJB:IIJE,1:IKT) = (PBLL_O_E(IIJB:IIJE,1:IKT)*PEMOIST(IIJB:IIJE,1:IKT)& !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) -PM3_TH2_WR2(IIJB:IIJE,1:IKT) = 0.25*CSTURB%XCTV**2*ZWORK2(IIJB:IIJE,1:IKT)& +PM3_TH2_WR2(IIJB:IIJE,1:IKT) = 0.25*TURBN%XCTV**2*ZWORK2(IIJB:IIJE,1:IKT)& *PLEPS(IIJB:IIJE,1:IKT)/PSQRT_TKE(IIJB:IIJE,1:IKT)/CSTURB%XCTD !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! @@ -1768,9 +1795,10 @@ PM3_TH2_WR2(IIJB:IIJE,IKE+1)=PM3_TH2_WR2(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_TH2_WR2',1,ZHOOK_HANDLE) END SUBROUTINE M3_TH2_WR2 !---------------------------------------------------------------------------- -SUBROUTINE D_M3_TH2_WR2_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTDZ,PD_M3_TH2_WR2_O_DDTDZ) +SUBROUTINE D_M3_TH2_WR2_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTDZ,PD_M3_TH2_WR2_O_DDTDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -1798,7 +1826,7 @@ ZWORK1(IIJB:IIJE,1:IKT) = (PBLL_O_E(IIJB:IIJE,1:IKT)*PEMOIST(IIJB:IIJE,1:IKT))** !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) -PD_M3_TH2_WR2_O_DDTDZ(IIJB:IIJE,1:IKT) = 0.25*CSTURB%XCTV**2*PLEPS(IIJB:IIJE,1:IKT) & +PD_M3_TH2_WR2_O_DDTDZ(IIJB:IIJE,1:IKT) = 0.25*TURBN%XCTV**2*PLEPS(IIJB:IIJE,1:IKT) & / PSQRT_TKE(IIJB:IIJE,1:IKT)/CSTURB%XCTD * ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! @@ -1808,9 +1836,10 @@ PD_M3_TH2_WR2_O_DDTDZ(IIJB:IIJE,IKE+1)=PD_M3_TH2_WR2_O_DDTDZ(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_TH2_WR2_O_DDTDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_TH2_WR2_O_DDTDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_TH2_WTHR(D,CSTURB,PREDR1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTDZ,PM3_TH2_WTHR) +SUBROUTINE M3_TH2_WTHR(D,CSTURB,TURBN,PREDR1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTDZ,PM3_TH2_WTHR) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLEPS @@ -1836,7 +1865,7 @@ ZWORK1(IIJB:IIJE,1:IKT) = PBLL_O_E(IIJB:IIJE,1:IKT)*PEMOIST(IIJB:IIJE,1:IKT) & !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) -PM3_TH2_WTHR(IIJB:IIJE,1:IKT) = - 0.5*CSTURB%XCTV*PLEPS(IIJB:IIJE,1:IKT) & +PM3_TH2_WTHR(IIJB:IIJE,1:IKT) = - 0.5*TURBN%XCTV*PLEPS(IIJB:IIJE,1:IKT) & / PSQRT_TKE(IIJB:IIJE,1:IKT)/CSTURB%XCTD * ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! @@ -1846,9 +1875,10 @@ PM3_TH2_WTHR(IIJB:IIJE,IKE+1)=PM3_TH2_WTHR(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_TH2_WTHR',1,ZHOOK_HANDLE) END SUBROUTINE M3_TH2_WTHR !---------------------------------------------------------------------------- -SUBROUTINE D_M3_TH2_WTHR_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTDZ,PD_M3_TH2_WTHR_O_DDTDZ) +SUBROUTINE D_M3_TH2_WTHR_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTDZ,PD_M3_TH2_WTHR_O_DDTDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -1876,7 +1906,7 @@ ZWORK1(IIJB:IIJE,1:IKT) = PBLL_O_E(IIJB:IIJE,1:IKT)*PEMOIST(IIJB:IIJE,1:IKT)* & !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) -PD_M3_TH2_WTHR_O_DDTDZ(IIJB:IIJE,1:IKT) = - 0.5*CSTURB%XCTV*PLEPS(IIJB:IIJE,1:IKT) & +PD_M3_TH2_WTHR_O_DDTDZ(IIJB:IIJE,1:IKT) = - 0.5*TURBN%XCTV*PLEPS(IIJB:IIJE,1:IKT) & / PSQRT_TKE(IIJB:IIJE,1:IKT)/CSTURB%XCTD * ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! @@ -1886,9 +1916,10 @@ PD_M3_TH2_WTHR_O_DDTDZ(IIJB:IIJE,IKE+1)=PD_M3_TH2_WTHR_O_DDTDZ(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_TH2_WTHR_O_DDTDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_TH2_WTHR_O_DDTDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_THR_WTHR(D,CSTURB,PREDTH1,PREDR1,PD,PLEPS,PSQRT_TKE,PM3_THR_WTHR) +SUBROUTINE M3_THR_WTHR(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PLEPS,PSQRT_TKE,PM3_THR_WTHR) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -1922,9 +1953,10 @@ PM3_THR_WTHR(IIJB:IIJE,IKE+1)=PM3_THR_WTHR(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_THR_WTHR',1,ZHOOK_HANDLE) END SUBROUTINE M3_THR_WTHR !---------------------------------------------------------------------------- -SUBROUTINE D_M3_THR_WTHR_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PD_M3_THR_WTHR_O_DDTDZ) +SUBROUTINE D_M3_THR_WTHR_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PD_M3_THR_WTHR_O_DDTDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -1952,7 +1984,7 @@ ZWORK1(IIJB:IIJE,1:IKT) = PETHETA(IIJB:IIJE,1:IKT)*PBLL_O_E(IIJB:IIJE,1:IKT)/PD( CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PD_M3_THR_WTHR_O_DDTDZ(IIJB:IIJE,1:IKT) = 0.5*PLEPS(IIJB:IIJE,1:IKT)/PSQRT_TKE(IIJB:IIJE,1:IKT) & - / CSTURB%XCTD * CSTURB%XCTV * ZWORK2(IIJB:IIJE,1:IKT) + / CSTURB%XCTD * TURBN%XCTV * ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! PD_M3_THR_WTHR_O_DDTDZ(IIJB:IIJE,IKB-1)=PD_M3_THR_WTHR_O_DDTDZ(IIJB:IIJE,IKB) @@ -1961,9 +1993,10 @@ PD_M3_THR_WTHR_O_DDTDZ(IIJB:IIJE,IKE+1)=PD_M3_THR_WTHR_O_DDTDZ(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_THR_WTHR_O_DDTDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_THR_WTHR_O_DDTDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_THR_WTH2(D,CSTURB,PREDR1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PM3_THR_WTH2) +SUBROUTINE M3_THR_WTH2(D,CSTURB,TURBN,PREDR1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PM3_THR_WTH2) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLEPS @@ -1990,7 +2023,7 @@ ZWORK1(IIJB:IIJE,1:IKT) = (1.+PREDR1(IIJB:IIJE,1:IKT))*PBLL_O_E(IIJB:IIJE,1:IKT) CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PM3_THR_WTH2(IIJB:IIJE,1:IKT) = - 0.25*PLEPS(IIJB:IIJE,1:IKT) & - / PSQRT_TKE(IIJB:IIJE,1:IKT)/CSTURB%XCTD*CSTURB%XCTV * ZWORK2(IIJB:IIJE,1:IKT) + / PSQRT_TKE(IIJB:IIJE,1:IKT)/CSTURB%XCTD*TURBN%XCTV * ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! PM3_THR_WTH2(IIJB:IIJE,IKB-1)=PM3_THR_WTH2(IIJB:IIJE,IKB) @@ -1999,9 +2032,10 @@ PM3_THR_WTH2(IIJB:IIJE,IKE+1)=PM3_THR_WTH2(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_THR_WTH2',1,ZHOOK_HANDLE) END SUBROUTINE M3_THR_WTH2 !---------------------------------------------------------------------------- -SUBROUTINE D_M3_THR_WTH2_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PD_M3_THR_WTH2_O_DDTDZ) +SUBROUTINE D_M3_THR_WTH2_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PD_M3_THR_WTH2_O_DDTDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2031,7 +2065,7 @@ ZWORK1(IIJB:IIJE,1:IKT) = -(1.+PREDR1(IIJB:IIJE,1:IKT))*(PBLL_O_E(IIJB:IIJE,1:IK CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PD_M3_THR_WTH2_O_DDTDZ(IIJB:IIJE,1:IKT) = - 0.25*PLEPS(IIJB:IIJE,1:IKT) & - /PSQRT_TKE(IIJB:IIJE,1:IKT)/CSTURB%XCTD*CSTURB%XCTV**2 * ZWORK2(IIJB:IIJE,1:IKT) + /PSQRT_TKE(IIJB:IIJE,1:IKT)/CSTURB%XCTD*TURBN%XCTV**2 * ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! PD_M3_THR_WTH2_O_DDTDZ(IIJB:IIJE,IKB-1)=PD_M3_THR_WTH2_O_DDTDZ(IIJB:IIJE,IKB) @@ -2040,9 +2074,10 @@ PD_M3_THR_WTH2_O_DDTDZ(IIJB:IIJE,IKE+1)=PD_M3_THR_WTH2_O_DDTDZ(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_THR_WTH2_O_DDTDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_THR_WTH2_O_DDTDZ !---------------------------------------------------------------------------- -SUBROUTINE D_M3_THR_WTH2_O_DDRDZ(D,CSTURB,PREDTH1,PREDR1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PD_M3_THR_WTH2_O_DDRDZ) +SUBROUTINE D_M3_THR_WTH2_O_DDRDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PD_M3_THR_WTH2_O_DDRDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2070,7 +2105,7 @@ ZWORK1(IIJB:IIJE,1:IKT) = PBLL_O_E(IIJB:IIJE,1:IKT)*PETHETA(IIJB:IIJE,1:IKT)/PD( CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PD_M3_THR_WTH2_O_DDRDZ(IIJB:IIJE,1:IKT) = - 0.25*PLEPS(IIJB:IIJE,1:IKT)/PSQRT_TKE(IIJB:IIJE,1:IKT)& - / CSTURB%XCTD*CSTURB%XCTV * ZWORK2(IIJB:IIJE,1:IKT) + / CSTURB%XCTD*TURBN%XCTV * ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! PD_M3_THR_WTH2_O_DDRDZ(IIJB:IIJE,IKB-1)=PD_M3_THR_WTH2_O_DDRDZ(IIJB:IIJE,IKB) @@ -2079,9 +2114,10 @@ PD_M3_THR_WTH2_O_DDRDZ(IIJB:IIJE,IKE+1)=PD_M3_THR_WTH2_O_DDRDZ(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_THR_WTH2_O_DDRDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_THR_WTH2_O_DDRDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_THR_W2TH(D,CSTURB,PREDR1,PD,PLM,PLEPS,PTKE,PDRDZ,PM3_THR_W2TH) +SUBROUTINE M3_THR_W2TH(D,CSTURB,TURBN,PREDR1,PD,PLM,PLEPS,PTKE,PDRDZ,PM3_THR_W2TH) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLM @@ -2106,7 +2142,7 @@ ZWORK1(IIJB:IIJE,1:IKT) = (1.+PREDR1(IIJB:IIJE,1:IKT))*PDRDZ(IIJB:IIJE,1:IKT)/PD CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PM3_THR_W2TH(IIJB:IIJE,1:IKT) = - 0.75*PLM(IIJB:IIJE,1:IKT)*PLEPS(IIJB:IIJE,1:IKT)& - / PTKE(IIJB:IIJE,1:IKT) * CSTURB%XCTV * ZWORK2(IIJB:IIJE,1:IKT) + / PTKE(IIJB:IIJE,1:IKT) * TURBN%XCTV * ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! PM3_THR_W2TH(IIJB:IIJE,IKB-1)=PM3_THR_W2TH(IIJB:IIJE,IKB) @@ -2115,9 +2151,10 @@ PM3_THR_W2TH(IIJB:IIJE,IKE+1)=PM3_THR_W2TH(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_THR_W2TH',1,ZHOOK_HANDLE) END SUBROUTINE M3_THR_W2TH !---------------------------------------------------------------------------- -SUBROUTINE D_M3_THR_W2TH_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,PD,PLM,PLEPS,PTKE,PBLL_O_E,PDRDZ,PETHETA,PD_M3_THR_W2TH_O_DDTDZ) +SUBROUTINE D_M3_THR_W2TH_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PLM,PLEPS,PTKE,PBLL_O_E,PDRDZ,PETHETA,PD_M3_THR_W2TH_O_DDTDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2147,7 +2184,7 @@ ZWORK1(IIJB:IIJE,1:IKT) = -PETHETA(IIJB:IIJE,1:IKT)*PBLL_O_E(IIJB:IIJE,1:IKT)*& CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PD_M3_THR_W2TH_O_DDTDZ(IIJB:IIJE,1:IKT) = - 0.75*PLM(IIJB:IIJE,1:IKT)*PLEPS(IIJB:IIJE,1:IKT)& - / PTKE(IIJB:IIJE,1:IKT) * CSTURB%XCTV**2 * ZWORK1(IIJB:IIJE,1:IKT) + / PTKE(IIJB:IIJE,1:IKT) * TURBN%XCTV**2 * ZWORK1(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! PD_M3_THR_W2TH_O_DDTDZ(IIJB:IIJE,IKB-1)=PD_M3_THR_W2TH_O_DDTDZ(IIJB:IIJE,IKB) @@ -2156,9 +2193,10 @@ PD_M3_THR_W2TH_O_DDTDZ(IIJB:IIJE,IKE+1)=PD_M3_THR_W2TH_O_DDTDZ(IIJB:IIJE,IKE) IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_THR_W2TH_O_DDTDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_THR_W2TH_O_DDTDZ !---------------------------------------------------------------------------- -SUBROUTINE D_M3_THR_W2TH_O_DDRDZ(D,CSTURB,PREDTH1,PREDR1,PD,PLM,PLEPS,PTKE,PD_M3_THR_W2TH_O_DDRDZ) +SUBROUTINE D_M3_THR_W2TH_O_DDRDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PLM,PLEPS,PTKE,PD_M3_THR_W2TH_O_DDRDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2185,7 +2223,7 @@ ZWORK1(IIJB:IIJE,1:IKT) = -(1.+PREDR1(IIJB:IIJE,1:IKT))*PREDR1(IIJB:IIJE,1:IKT) CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PD_M3_THR_W2TH_O_DDRDZ(IIJB:IIJE,1:IKT) = - 0.75*PLM(IIJB:IIJE,1:IKT)*PLEPS(IIJB:IIJE,1:IKT)& - / PTKE(IIJB:IIJE,1:IKT) * CSTURB%XCTV * ZWORK2(IIJB:IIJE,1:IKT) + / PTKE(IIJB:IIJE,1:IKT) * TURBN%XCTV * ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! PD_M3_THR_W2TH_O_DDRDZ(IIJB:IIJE,IKB-1)=PD_M3_THR_W2TH_O_DDRDZ(IIJB:IIJE,IKB) @@ -2197,9 +2235,10 @@ END SUBROUTINE D_M3_THR_W2TH_O_DDRDZ !---------------------------------------------------------------------------- !---------------------------------------------------------------------------- ! -SUBROUTINE PSI3(D,CSTURB,PREDR1,PREDTH1,PRED2R3,PRED2TH3,PRED2THR3,HTURBDIM,OUSERV,PPSI3) +SUBROUTINE PSI3(D,CSTURB,TURBN,PREDR1,PREDTH1,PRED2R3,PRED2TH3,PRED2THR3,HTURBDIM,OUSERV,PPSI3) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRED2TH3 @@ -2211,14 +2250,15 @@ SUBROUTINE PSI3(D,CSTURB,PREDR1,PREDTH1,PRED2R3,PRED2TH3,PRED2THR3,HTURBDIM,OUSE ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:PSI3',0,ZHOOK_HANDLE) -CALL PHI3(D,CSTURB,PREDR1,PREDTH1,PRED2R3,PRED2TH3,PRED2THR3,HTURBDIM,OUSERV,PPSI3) +CALL PHI3(D,CSTURB,TURBN,PREDR1,PREDTH1,PRED2R3,PRED2TH3,PRED2THR3,HTURBDIM,OUSERV,PPSI3) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:PSI3',1,ZHOOK_HANDLE) END SUBROUTINE PSI3 !---------------------------------------------------------------------------- -SUBROUTINE D_PSI3DRDZ_O_DDRDZ(D,CSTURB,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,HTURBDIM,OUSERV,PD_PSI3DRDZ_O_DDRDZ) +SUBROUTINE D_PSI3DRDZ_O_DDRDZ(D,CSTURB,TURBN,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,HTURBDIM,OUSERV,PD_PSI3DRDZ_O_DDRDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PPSI3 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 @@ -2230,16 +2270,17 @@ SUBROUTINE D_PSI3DRDZ_O_DDRDZ(D,CSTURB,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,HT REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_PSI3DRDZ_O_DDRDZ',0,ZHOOK_HANDLE) -CALL D_PHI3DTDZ_O_DDTDZ(D,CSTURB,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,HTURBDIM,OUSERV,PD_PSI3DRDZ_O_DDRDZ) +CALL D_PHI3DTDZ_O_DDTDZ(D,CSTURB,TURBN,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,HTURBDIM,OUSERV,PD_PSI3DRDZ_O_DDRDZ) ! !C'est ok?! ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_PSI3DRDZ_O_DDRDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_PSI3DRDZ_O_DDRDZ !---------------------------------------------------------------------------- -SUBROUTINE D_PSI3DTDZ_O_DDTDZ(D,CSTURB,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,HTURBDIM,OUSERV,PD_PSI3DTDZ_O_DDTDZ) +SUBROUTINE D_PSI3DTDZ_O_DDTDZ(D,CSTURB,TURBN,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,HTURBDIM,OUSERV,PD_PSI3DTDZ_O_DDTDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PPSI3 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 @@ -2251,14 +2292,15 @@ SUBROUTINE D_PSI3DTDZ_O_DDTDZ(D,CSTURB,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,HT ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_PSI3DTDZ_O_DDTDZ',0,ZHOOK_HANDLE) -CALL D_PHI3DRDZ_O_DDRDZ(D,CSTURB,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,HTURBDIM,OUSERV,PD_PSI3DTDZ_O_DDTDZ) +CALL D_PHI3DRDZ_O_DDRDZ(D,CSTURB,TURBN,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,HTURBDIM,OUSERV,PD_PSI3DTDZ_O_DDTDZ) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_PSI3DTDZ_O_DDTDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_PSI3DTDZ_O_DDTDZ !---------------------------------------------------------------------------- -SUBROUTINE D_PSI3DRDZ2_O_DDRDZ(D,CSTURB,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,PDRDZ,HTURBDIM,OUSERV,PD_PSI3DRDZ2_O_DDRDZ) +SUBROUTINE D_PSI3DRDZ2_O_DDRDZ(D,CSTURB,TURBN,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,PDRDZ,HTURBDIM,OUSERV,PD_PSI3DRDZ2_O_DDRDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PPSI3 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 @@ -2271,14 +2313,15 @@ SUBROUTINE D_PSI3DRDZ2_O_DDRDZ(D,CSTURB,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,P ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_PSI3DRDZ2_O_DDRDZ',0,ZHOOK_HANDLE) -CALL D_PHI3DTDZ2_O_DDTDZ(D,CSTURB,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,PDRDZ,HTURBDIM,OUSERV,PD_PSI3DRDZ2_O_DDRDZ) +CALL D_PHI3DTDZ2_O_DDTDZ(D,CSTURB,TURBN,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,PDRDZ,HTURBDIM,OUSERV,PD_PSI3DRDZ2_O_DDRDZ) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_PSI3DRDZ2_O_DDRDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_PSI3DRDZ2_O_DDRDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_WR_WR2(D,CSTURB,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,PM3_WR_WR2) +SUBROUTINE M3_WR_WR2(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,PM3_WR_WR2) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2288,14 +2331,15 @@ SUBROUTINE M3_WR_WR2(D,CSTURB,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,PM3_WR_WR2) ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_WR_WR2',0,ZHOOK_HANDLE) -CALL M3_WTH_WTH2(D,CSTURB,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,PM3_WR_WR2) +CALL M3_WTH_WTH2(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,PM3_WR_WR2) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_WR_WR2',1,ZHOOK_HANDLE) END SUBROUTINE M3_WR_WR2 !---------------------------------------------------------------------------- -SUBROUTINE D_M3_WR_WR2_O_DDRDZ(D,CSTURB,PM3_WR_WR2,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,PD_M3_WR_WR2_O_DDRDZ) +SUBROUTINE D_M3_WR_WR2_O_DDRDZ(D,CSTURB,TURBN,PM3_WR_WR2,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,PD_M3_WR_WR2_O_DDRDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PM3_WR_WR2 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 @@ -2306,14 +2350,15 @@ SUBROUTINE D_M3_WR_WR2_O_DDRDZ(D,CSTURB,PM3_WR_WR2,PREDR1,PREDTH1,PD,PBLL_O_E,PE ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_WR_WR2_O_DDRDZ',0,ZHOOK_HANDLE) -CALL D_M3_WTH_WTH2_O_DDTDZ(D,CSTURB,PM3_WR_WR2,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,PD_M3_WR_WR2_O_DDRDZ) +CALL D_M3_WTH_WTH2_O_DDTDZ(D,CSTURB,TURBN,PM3_WR_WR2,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,PD_M3_WR_WR2_O_DDRDZ) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_WR_WR2_O_DDRDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_WR_WR2_O_DDRDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_WR_W2R(D,CSTURB,PREDR1,PREDTH1,PD,PKEFF,PTKE,PM3_WR_W2R) +SUBROUTINE M3_WR_W2R(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PKEFF,PTKE,PM3_WR_W2R) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2323,14 +2368,15 @@ SUBROUTINE M3_WR_W2R(D,CSTURB,PREDR1,PREDTH1,PD,PKEFF,PTKE,PM3_WR_W2R) ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_WR_W2R',0,ZHOOK_HANDLE) -CALL M3_WTH_W2TH(D,CSTURB,PREDR1,PREDTH1,PD,PKEFF,PTKE,PM3_WR_W2R) +CALL M3_WTH_W2TH(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PKEFF,PTKE,PM3_WR_W2R) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_WR_W2R',1,ZHOOK_HANDLE) END SUBROUTINE M3_WR_W2R !---------------------------------------------------------------------------- -SUBROUTINE D_M3_WR_W2R_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,PKEFF,PTKE,PD_M3_WR_W2R_O_DDRDZ) +SUBROUTINE D_M3_WR_W2R_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,PKEFF,PTKE,PD_M3_WR_W2R_O_DDRDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2342,14 +2388,15 @@ SUBROUTINE D_M3_WR_W2R_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,PKEFF ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_WR_W2R_O_DDRDZ',0,ZHOOK_HANDLE) -CALL D_M3_WTH_W2TH_O_DDTDZ(D,CSTURB,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,PKEFF,PTKE,PD_M3_WR_W2R_O_DDRDZ) +CALL D_M3_WTH_W2TH_O_DDTDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,PKEFF,PTKE,PD_M3_WR_W2R_O_DDRDZ) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_WR_W2R_O_DDRDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_WR_W2R_O_DDRDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_WR_W2TH(D,CSTURB,PD,PKEFF,PTKE,PBLL_O_E,PETHETA,PDRDZ,PM3_WR_W2TH) +SUBROUTINE M3_WR_W2TH(D,CSTURB,TURBN,PD,PKEFF,PTKE,PBLL_O_E,PETHETA,PDRDZ,PM3_WR_W2TH) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PKEFF REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PTKE @@ -2360,14 +2407,15 @@ SUBROUTINE M3_WR_W2TH(D,CSTURB,PD,PKEFF,PTKE,PBLL_O_E,PETHETA,PDRDZ,PM3_WR_W2TH) ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_WR_W2TH',0,ZHOOK_HANDLE) -CALL M3_WTH_W2R(D,CSTURB,PD,PKEFF,PTKE,PBLL_O_E,PETHETA,PDRDZ,PM3_WR_W2TH) +CALL M3_WTH_W2R(D,CSTURB,TURBN,PD,PKEFF,PTKE,PBLL_O_E,PETHETA,PDRDZ,PM3_WR_W2TH) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_WR_W2TH',1,ZHOOK_HANDLE) END SUBROUTINE M3_WR_W2TH !---------------------------------------------------------------------------- -SUBROUTINE D_M3_WR_W2TH_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PKEFF,PTKE,PBLL_O_E,PETHETA,PD_M3_WR_W2TH_O_DDRDZ) +SUBROUTINE D_M3_WR_W2TH_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PKEFF,PTKE,PBLL_O_E,PETHETA,PD_M3_WR_W2TH_O_DDRDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2379,14 +2427,15 @@ SUBROUTINE D_M3_WR_W2TH_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PKEFF,PTKE,PBLL_O_E,P ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_WR_W2TH_O_DDRDZ',0,ZHOOK_HANDLE) -CALL D_M3_WTH_W2R_O_DDTDZ(D,CSTURB,PREDR1,PREDTH1,PD,PKEFF,PTKE,PBLL_O_E,PETHETA,PD_M3_WR_W2TH_O_DDRDZ) +CALL D_M3_WTH_W2R_O_DDTDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PKEFF,PTKE,PBLL_O_E,PETHETA,PD_M3_WR_W2TH_O_DDRDZ) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_WR_W2TH_O_DDRDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_WR_W2TH_O_DDRDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_WR_WTH2(D,CSTURB,PD,PKEFF,PTKE,PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PETHETA,PDRDZ,PM3_WR_WTH2) +SUBROUTINE M3_WR_WTH2(D,CSTURB,TURBN,PD,PKEFF,PTKE,PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PETHETA,PDRDZ,PM3_WR_WTH2) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PKEFF REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PTKE @@ -2400,14 +2449,16 @@ SUBROUTINE M3_WR_WTH2(D,CSTURB,PD,PKEFF,PTKE,PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PETH ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_WR_WTH2',0,ZHOOK_HANDLE) -CALL M3_WTH_WR2(D,CSTURB,PD,PKEFF,PTKE,PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PETHETA,PDRDZ,PM3_WR_WTH2) +CALL M3_WTH_WR2(D,CSTURB,TURBN,PD,PKEFF,PTKE,PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PETHETA,PDRDZ,PM3_WR_WTH2) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_WR_WTH2',1,ZHOOK_HANDLE) END SUBROUTINE M3_WR_WTH2 !---------------------------------------------------------------------------- -SUBROUTINE D_M3_WR_WTH2_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PKEFF,PTKE,PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PETHETA,PD_M3_WR_WTH2_O_DDRDZ) +SUBROUTINE D_M3_WR_WTH2_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PKEFF,PTKE,PSQRT_TKE,PBLL_O_E,& + &PBETA,PLEPS,PETHETA,PD_M3_WR_WTH2_O_DDRDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2422,14 +2473,15 @@ SUBROUTINE D_M3_WR_WTH2_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PKEFF,PTKE,PSQRT_TKE, ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_WR_WTH2_O_DDRDZ',0,ZHOOK_HANDLE) -CALL D_M3_WTH_WR2_O_DDTDZ(D,CSTURB,PREDR1,PREDTH1,PD,PKEFF,PTKE,PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PETHETA,PD_M3_WR_WTH2_O_DDRDZ) +CALL D_M3_WTH_WR2_O_DDTDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PKEFF,PTKE,PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PETHETA,PD_M3_WR_WTH2_O_DDRDZ) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_WR_WTH2_O_DDRDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_WR_WTH2_O_DDRDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_WR_WTHR(D,CSTURB,PREDTH1,PD,PKEFF,PTKE,PSQRT_TKE,PBETA,PLEPS,PETHETA,PM3_WR_WTHR) +SUBROUTINE M3_WR_WTHR(D,CSTURB,TURBN,PREDTH1,PD,PKEFF,PTKE,PSQRT_TKE,PBETA,PLEPS,PETHETA,PM3_WR_WTHR) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PKEFF @@ -2442,14 +2494,15 @@ SUBROUTINE M3_WR_WTHR(D,CSTURB,PREDTH1,PD,PKEFF,PTKE,PSQRT_TKE,PBETA,PLEPS,PETHE ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_WR_WTHR',0,ZHOOK_HANDLE) -CALL M3_WTH_WTHR(D,CSTURB,PREDTH1,PD,PKEFF,PTKE,PSQRT_TKE,PBETA,PLEPS,PETHETA,PM3_WR_WTHR) +CALL M3_WTH_WTHR(D,CSTURB,TURBN,PREDTH1,PD,PKEFF,PTKE,PSQRT_TKE,PBETA,PLEPS,PETHETA,PM3_WR_WTHR) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_WR_WTHR',1,ZHOOK_HANDLE) END SUBROUTINE M3_WR_WTHR !---------------------------------------------------------------------------- -SUBROUTINE D_M3_WR_WTHR_O_DDRDZ(D,CSTURB,PM3_WR_WTHR,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,PD_M3_WR_WTHR_O_DDRDZ) +SUBROUTINE D_M3_WR_WTHR_O_DDRDZ(D,CSTURB,TURBN,PM3_WR_WTHR,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,PD_M3_WR_WTHR_O_DDRDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PM3_WR_WTHR REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 @@ -2460,14 +2513,15 @@ SUBROUTINE D_M3_WR_WTHR_O_DDRDZ(D,CSTURB,PM3_WR_WTHR,PREDR1,PREDTH1,PD,PBLL_O_E, ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_WR_WTHR_O_DDRDZ',0,ZHOOK_HANDLE) -CALL D_M3_WTH_WTHR_O_DDTDZ(D,CSTURB,PM3_WR_WTHR,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,PD_M3_WR_WTHR_O_DDRDZ) +CALL D_M3_WTH_WTHR_O_DDTDZ(D,CSTURB,TURBN,PM3_WR_WTHR,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,PD_M3_WR_WTHR_O_DDRDZ) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_WR_WTHR_O_DDRDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_WR_WTHR_O_DDRDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_R2_W2R(D,CSTURB,PREDR1,PREDTH1,PD,PDRDZ,PLM,PLEPS,PTKE,PM3_R2_W2R) +SUBROUTINE M3_R2_W2R(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PDRDZ,PLM,PLEPS,PTKE,PM3_R2_W2R) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2479,14 +2533,15 @@ SUBROUTINE M3_R2_W2R(D,CSTURB,PREDR1,PREDTH1,PD,PDRDZ,PLM,PLEPS,PTKE,PM3_R2_W2R) ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_R2_W2R',0,ZHOOK_HANDLE) -CALL M3_TH2_W2TH(D,CSTURB,PREDR1,PREDTH1,PD,PDRDZ,PLM,PLEPS,PTKE,PM3_R2_W2R) +CALL M3_TH2_W2TH(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PDRDZ,PLM,PLEPS,PTKE,PM3_R2_W2R) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_R2_W2R',1,ZHOOK_HANDLE) END SUBROUTINE M3_R2_W2R !---------------------------------------------------------------------------- -SUBROUTINE D_M3_R2_W2R_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,OUSERV,PD_M3_R2_W2R_O_DDRDZ) +SUBROUTINE D_M3_R2_W2R_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,OUSERV,PD_M3_R2_W2R_O_DDRDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2498,14 +2553,15 @@ SUBROUTINE D_M3_R2_W2R_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,OUSERV, ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_R2_W2R_O_DDRDZ',0,ZHOOK_HANDLE) -CALL D_M3_TH2_W2TH_O_DDTDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,OUSERV,PD_M3_R2_W2R_O_DDRDZ) +CALL D_M3_TH2_W2TH_O_DDTDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,OUSERV,PD_M3_R2_W2R_O_DDRDZ) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_R2_W2R_O_DDRDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_R2_W2R_O_DDRDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_R2_WR2(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PM3_R2_WR2) +SUBROUTINE M3_R2_WR2(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PM3_R2_WR2) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2515,14 +2571,15 @@ SUBROUTINE M3_R2_WR2(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PM3_R2_WR2) ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_R2_WR2',0,ZHOOK_HANDLE) -CALL M3_TH2_WTH2(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PM3_R2_WR2) +CALL M3_TH2_WTH2(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PM3_R2_WR2) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_R2_WR2',1,ZHOOK_HANDLE) END SUBROUTINE M3_R2_WR2 !---------------------------------------------------------------------------- -SUBROUTINE D_M3_R2_WR2_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PD_M3_R2_WR2_O_DDRDZ) +SUBROUTINE D_M3_R2_WR2_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PD_M3_R2_WR2_O_DDRDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2534,14 +2591,15 @@ SUBROUTINE D_M3_R2_WR2_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_R2_WR2_O_DDRDZ',0,ZHOOK_HANDLE) -CALL D_M3_TH2_WTH2_O_DDTDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PD_M3_R2_WR2_O_DDRDZ) +CALL D_M3_TH2_WTH2_O_DDTDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PD_M3_R2_WR2_O_DDRDZ) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_R2_WR2_O_DDRDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_R2_WR2_O_DDRDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_R2_W2TH(D,CSTURB,PD,PLM,PLEPS,PTKE,PBLL_O_E,PETHETA,PDRDZ,PM3_R2_W2TH) +SUBROUTINE M3_R2_W2TH(D,CSTURB,TURBN,PD,PLM,PLEPS,PTKE,PBLL_O_E,PETHETA,PDRDZ,PM3_R2_W2TH) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLM REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLEPS @@ -2553,14 +2611,15 @@ SUBROUTINE M3_R2_W2TH(D,CSTURB,PD,PLM,PLEPS,PTKE,PBLL_O_E,PETHETA,PDRDZ,PM3_R2_W ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_R2_W2TH',0,ZHOOK_HANDLE) -CALL M3_TH2_W2R(D,CSTURB,PD,PLM,PLEPS,PTKE,PBLL_O_E,PETHETA,PDRDZ,PM3_R2_W2TH) +CALL M3_TH2_W2R(D,CSTURB,TURBN,PD,PLM,PLEPS,PTKE,PBLL_O_E,PETHETA,PDRDZ,PM3_R2_W2TH) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_R2_W2TH',1,ZHOOK_HANDLE) END SUBROUTINE M3_R2_W2TH !---------------------------------------------------------------------------- -SUBROUTINE D_M3_R2_W2TH_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,PBLL_O_E,PETHETA,PDRDZ,PD_M3_R2_W2TH_O_DDRDZ) +SUBROUTINE D_M3_R2_W2TH_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,PBLL_O_E,PETHETA,PDRDZ,PD_M3_R2_W2TH_O_DDRDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2574,14 +2633,15 @@ SUBROUTINE D_M3_R2_W2TH_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,PBLL_O ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_R2_W2TH_O_DDRDZ',0,ZHOOK_HANDLE) -CALL D_M3_TH2_W2R_O_DDTDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,PBLL_O_E,PETHETA,PDRDZ,PD_M3_R2_W2TH_O_DDRDZ) +CALL D_M3_TH2_W2R_O_DDTDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,PBLL_O_E,PETHETA,PDRDZ,PD_M3_R2_W2TH_O_DDRDZ) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_R2_W2TH_O_DDRDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_R2_W2TH_O_DDRDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_R2_WTH2(D,CSTURB,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PM3_R2_WTH2) +SUBROUTINE M3_R2_WTH2(D,CSTURB,TURBN,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PM3_R2_WTH2) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLEPS REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PSQRT_TKE @@ -2592,14 +2652,15 @@ SUBROUTINE M3_R2_WTH2(D,CSTURB,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PM3_R2_ ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_R2_WTH2',0,ZHOOK_HANDLE) -CALL M3_TH2_WR2(D,CSTURB,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PM3_R2_WTH2) +CALL M3_TH2_WR2(D,CSTURB,TURBN,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PM3_R2_WTH2) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_R2_WTH2',1,ZHOOK_HANDLE) END SUBROUTINE M3_R2_WTH2 !---------------------------------------------------------------------------- -SUBROUTINE D_M3_R2_WTH2_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PD_M3_R2_WTH2_O_DDRDZ) +SUBROUTINE D_M3_R2_WTH2_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PD_M3_R2_WTH2_O_DDRDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2612,14 +2673,15 @@ SUBROUTINE D_M3_R2_WTH2_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_ ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_R2_WTH2_O_DDRDZ',0,ZHOOK_HANDLE) -CALL D_M3_TH2_WR2_O_DDTDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PD_M3_R2_WTH2_O_DDRDZ) +CALL D_M3_TH2_WR2_O_DDTDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PD_M3_R2_WTH2_O_DDRDZ) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_R2_WTH2_O_DDRDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_R2_WTH2_O_DDRDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_R2_WTHR(D,CSTURB,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PM3_R2_WTHR) +SUBROUTINE M3_R2_WTHR(D,CSTURB,TURBN,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PM3_R2_WTHR) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLEPS @@ -2631,14 +2693,15 @@ SUBROUTINE M3_R2_WTHR(D,CSTURB,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_R2_WTHR',0,ZHOOK_HANDLE) -CALL M3_TH2_WTHR(D,CSTURB,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PM3_R2_WTHR) +CALL M3_TH2_WTHR(D,CSTURB,TURBN,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PM3_R2_WTHR) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_R2_WTHR',1,ZHOOK_HANDLE) END SUBROUTINE M3_R2_WTHR !---------------------------------------------------------------------------- -SUBROUTINE D_M3_R2_WTHR_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PD_M3_R2_WTHR_O_DDRDZ) +SUBROUTINE D_M3_R2_WTHR_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PD_M3_R2_WTHR_O_DDRDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2651,14 +2714,15 @@ SUBROUTINE D_M3_R2_WTHR_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_ ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_R2_WTHR_O_DDRDZ',0,ZHOOK_HANDLE) -CALL D_M3_TH2_WTHR_O_DDTDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PD_M3_R2_WTHR_O_DDRDZ) +CALL D_M3_TH2_WTHR_O_DDTDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDRDZ,PD_M3_R2_WTHR_O_DDRDZ) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_R2_WTHR_O_DDRDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_R2_WTHR_O_DDRDZ !---------------------------------------------------------------------------- -SUBROUTINE D_M3_THR_WTHR_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PD_M3_THR_WTHR_O_DDRDZ) +SUBROUTINE D_M3_THR_WTHR_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PD_M3_THR_WTHR_O_DDRDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2670,14 +2734,15 @@ SUBROUTINE D_M3_THR_WTHR_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_THR_WTHR_O_DDRDZ',0,ZHOOK_HANDLE) -CALL D_M3_THR_WTHR_O_DDTDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PD_M3_THR_WTHR_O_DDRDZ) +CALL D_M3_THR_WTHR_O_DDTDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PD_M3_THR_WTHR_O_DDRDZ) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_THR_WTHR_O_DDRDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_THR_WTHR_O_DDRDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_THR_WR2(D,CSTURB,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTDZ,PM3_THR_WR2) +SUBROUTINE M3_THR_WR2(D,CSTURB,TURBN,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTDZ,PM3_THR_WR2) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLEPS @@ -2689,14 +2754,15 @@ SUBROUTINE M3_THR_WR2(D,CSTURB,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTDZ ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_THR_WR2',0,ZHOOK_HANDLE) -CALL M3_THR_WTH2(D,CSTURB,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTDZ,PM3_THR_WR2) +CALL M3_THR_WTH2(D,CSTURB,TURBN,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTDZ,PM3_THR_WR2) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_THR_WR2',1,ZHOOK_HANDLE) END SUBROUTINE M3_THR_WR2 !---------------------------------------------------------------------------- -SUBROUTINE D_M3_THR_WR2_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTDZ,PD_M3_THR_WR2_O_DDRDZ) +SUBROUTINE D_M3_THR_WR2_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTDZ,PD_M3_THR_WR2_O_DDRDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2709,14 +2775,15 @@ SUBROUTINE D_M3_THR_WR2_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_ ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_THR_WR2_O_DDRDZ',0,ZHOOK_HANDLE) -CALL D_M3_THR_WTH2_O_DDTDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTDZ,PD_M3_THR_WR2_O_DDRDZ) +CALL D_M3_THR_WTH2_O_DDTDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTDZ,PD_M3_THR_WR2_O_DDRDZ) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_THR_WR2_O_DDRDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_THR_WR2_O_DDRDZ !---------------------------------------------------------------------------- -SUBROUTINE D_M3_THR_WR2_O_DDTDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PD_M3_THR_WR2_O_DDTDZ) +SUBROUTINE D_M3_THR_WR2_O_DDTDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PD_M3_THR_WR2_O_DDTDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2728,14 +2795,15 @@ SUBROUTINE D_M3_THR_WR2_O_DDTDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_ ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_THR_WR2_O_DDTDZ',0,ZHOOK_HANDLE) -CALL D_M3_THR_WTH2_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PD_M3_THR_WR2_O_DDTDZ) +CALL D_M3_THR_WTH2_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PD_M3_THR_WR2_O_DDTDZ) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_THR_WR2_O_DDTDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_THR_WR2_O_DDTDZ !---------------------------------------------------------------------------- -SUBROUTINE M3_THR_W2R(D,CSTURB,PREDTH1,PD,PLM,PLEPS,PTKE,PDTDZ,PM3_THR_W2R) +SUBROUTINE M3_THR_W2R(D,CSTURB,TURBN,PREDTH1,PD,PLM,PLEPS,PTKE,PDTDZ,PM3_THR_W2R) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLM @@ -2746,14 +2814,15 @@ SUBROUTINE M3_THR_W2R(D,CSTURB,PREDTH1,PD,PLM,PLEPS,PTKE,PDTDZ,PM3_THR_W2R) ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_THR_W2R',0,ZHOOK_HANDLE) -CALL M3_THR_W2TH(D,CSTURB,PREDTH1,PD,PLM,PLEPS,PTKE,PDTDZ,PM3_THR_W2R) +CALL M3_THR_W2TH(D,CSTURB,TURBN,PREDTH1,PD,PLM,PLEPS,PTKE,PDTDZ,PM3_THR_W2R) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:M3_THR_W2R',1,ZHOOK_HANDLE) END SUBROUTINE M3_THR_W2R !---------------------------------------------------------------------------- -SUBROUTINE D_M3_THR_W2R_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,PBLL_O_E,PDTDZ,PEMOIST,PD_M3_THR_W2R_O_DDRDZ) +SUBROUTINE D_M3_THR_W2R_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,PBLL_O_E,PDTDZ,PEMOIST,PD_M3_THR_W2R_O_DDRDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2767,14 +2836,15 @@ SUBROUTINE D_M3_THR_W2R_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,PBLL_O ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_THR_W2R_O_DDRDZ',0,ZHOOK_HANDLE) -CALL D_M3_THR_W2TH_O_DDTDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,PBLL_O_E,PDTDZ,PEMOIST,PD_M3_THR_W2R_O_DDRDZ) +CALL D_M3_THR_W2TH_O_DDTDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,PBLL_O_E,PDTDZ,PEMOIST,PD_M3_THR_W2R_O_DDRDZ) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_THR_W2R_O_DDRDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_THR_W2R_O_DDRDZ !---------------------------------------------------------------------------- -SUBROUTINE D_M3_THR_W2R_O_DDTDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,PD_M3_THR_W2R_O_DDTDZ) +SUBROUTINE D_M3_THR_W2R_O_DDTDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,PD_M3_THR_W2R_O_DDTDZ) TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CSTURB_t), INTENT(IN) :: CSTURB + TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDR1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PREDTH1 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PD @@ -2785,7 +2855,7 @@ SUBROUTINE D_M3_THR_W2R_O_DDTDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,PD_M3_ ! REAL(KIND=JPRB) :: ZHOOK_HANDLE IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_THR_W2R_O_DDTDZ',0,ZHOOK_HANDLE) -CALL D_M3_THR_W2TH_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,PD_M3_THR_W2R_O_DDTDZ) +CALL D_M3_THR_W2TH_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLM,PLEPS,PTKE,PD_M3_THR_W2R_O_DDTDZ) ! IF (LHOOK) CALL DR_HOOK('MODE_PRANDTL:D_M3_THR_W2R_O_DDTDZ',1,ZHOOK_HANDLE) END SUBROUTINE D_M3_THR_W2R_O_DDTDZ diff --git a/src/common/turb/mode_rmc01.F90 b/src/common/turb/mode_rmc01.F90 index 59f254a0d4af720a86f3692144d7fcad68e4d806..ab2be9c6cf10a496e81004fe3cbe6bfcf7cb6485 100644 --- a/src/common/turb/mode_rmc01.F90 +++ b/src/common/turb/mode_rmc01.F90 @@ -5,7 +5,7 @@ MODULE MODE_RMC01 IMPLICIT NONE CONTAINS -SUBROUTINE RMC01(D,CST,CSTURB,HTURBLEN,PZZ,PDXX,PDYY,PDZZ,PDIRCOSZW,PSBL_DEPTH,PLMO,PLK,PLEPS) +SUBROUTINE RMC01(D,CST,CSTURB,TURBN,PZZ,PDXX,PDYY,PDZZ,PDIRCOSZW,PSBL_DEPTH,PLMO,PLK,PLEPS) USE PARKIND1, ONLY : JPRB USE YOMHOOK , ONLY : LHOOK, DR_HOOK ! ############################################################## @@ -49,6 +49,7 @@ USE MODD_PARAMETERS, ONLY: XUNDEF USE MODD_CST, ONLY : CST_t USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_CTURB, ONLY: CSTURB_t +USE MODD_TURB_n, ONLY: TURB_t ! USE MODE_UPDATE_IIJU_PHY, ONLY: UPDATE_IIJU_PHY USE MODE_SBL_PHY, ONLY: BUSINGER_PHIM, BUSINGER_PHIE @@ -63,7 +64,7 @@ IMPLICIT NONE TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST TYPE(CSTURB_t), INTENT(IN) :: CSTURB -CHARACTER(LEN=4), INTENT(IN) :: HTURBLEN ! type of mixing length +TYPE(TURB_t), INTENT(IN) :: TURBN REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PZZ ! altitude of flux points REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PDXX ! width of grid mesh (X dir) REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PDYY ! width of grid mesh (Y dir) @@ -157,7 +158,7 @@ CALL BUSINGER_PHIM(D,ZZ_O_LMO,ZPHIM) CALL BUSINGER_PHIE(D,CSTURB,ZZ_O_LMO,ZPHIE) ! !------------------------------------------------------------------------------- -SELECT CASE (HTURBLEN) +SELECT CASE (TURBN%CTURBLEN) !------------------------------------------------------------------------------- ! !* 3. altitude where turbulence is isotropic inside a layer of given width (3D case) @@ -269,7 +270,7 @@ PLK(IIJB:IIJE,IKU) = PLK(IIJB:IIJE,IKE) ! -------------------------------------- ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) -ZL(IIJB:IIJE,1:IKT) = ZL(IIJB:IIJE,1:IKT) * (CSTURB%XALPSBL**(3./2.)*CST%XKARMAN*CSTURB%XCED) & +ZL(IIJB:IIJE,1:IKT) = ZL(IIJB:IIJE,1:IKT) * (CSTURB%XALPSBL**(3./2.)*CST%XKARMAN*TURBN%XCED) & / (CST%XKARMAN/SQRT(CSTURB%XALPSBL)/CSTURB%XCMFS) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! diff --git a/src/common/turb/mode_tke_eps_sources.F90 b/src/common/turb/mode_tke_eps_sources.F90 index 1ca962693ed6b5b15547b841bf664cc0328871a9..2b8bb97ab40f14a60a578ddb262631ea1b706652 100644 --- a/src/common/turb/mode_tke_eps_sources.F90 +++ b/src/common/turb/mode_tke_eps_sources.F90 @@ -7,7 +7,7 @@ MODULE MODE_TKE_EPS_SOURCES IMPLICIT NONE CONTAINS SUBROUTINE TKE_EPS_SOURCES(D,CST,CSTURB,BUCONF,TURBN,TLES, & - & HPROGRAM, KMI,PTKEM,PLM,PLEPS,PDP, & + & HPROGRAM, PTKEM,PLM,PLEPS,PDP, & & PTRH,PRHODJ,PDZZ,PDXX,PDYY,PDZX,PDZY,PZZ, & & PTSTEP,PEXPL, & & TPFILE,ODIAG_IN_RUN,OOCEAN, & @@ -60,10 +60,10 @@ CONTAINS !! Module MODD_CTURB: contains the set of constants for !! the turbulence scheme !! -!! CSTURB%XCET,CSTURB%XCED : transport and dissipation cts. for the TKE +!! CSTURB%XCET,TURBN%XCED : transport and dissipation cts. for the TKE !! XCDP,XCDD,XCDT: constants from the parameterization of !! the K-epsilon equation -!! CSTURB%XTKEMIN,XEPSMIN : minimum values for the TKE and its +!! TURBN%XTKEMIN,XEPSMIN : minimum values for the TKE and its !! dissipation !! !! Module MODD_PARAMETERS: @@ -164,7 +164,6 @@ TYPE(TBUDGETCONF_t), INTENT(IN) :: BUCONF TYPE(TURB_t), INTENT(IN) :: TURBN TYPE(TLES_t), INTENT(INOUT):: TLES CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! CPROGRAM is the program currently running (modd_conf) -INTEGER, INTENT(IN) :: KMI ! model index number REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PTKEM ! TKE at t-deltat REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLM ! mixing length REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PLEPS ! dissipative length @@ -281,7 +280,7 @@ CALL MZM_PHY(D,ZKEFF,ZMWORK1) CALL MZM_PHY(D,PRHODJ,ZMWORK2) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) -ZFLX(IIJB:IIJE,1:IKT) = CSTURB%XCED * SQRT(PTKEM(IIJB:IIJE,1:IKT)) / PLEPS(IIJB:IIJE,1:IKT) +ZFLX(IIJB:IIJE,1:IKT) = TURBN%XCED * SQRT(PTKEM(IIJB:IIJE,1:IKT)) / PLEPS(IIJB:IIJE,1:IKT) ZSOURCE(IIJB:IIJE,1:IKT) = ( PRTKES(IIJB:IIJE,1:IKT) + PRTKEMS(IIJB:IIJE,1:IKT) ) & / PRHODJ(IIJB:IIJE,1:IKT) - PTKEM(IIJB:IIJE,1:IKT) / PTSTEP & + PDP(IIJB:IIJE,1:IKT) + PTP(IIJB:IIJE,1:IKT) + ZTR(IIJB:IIJE,1:IKT) & @@ -329,9 +328,9 @@ ENDIF ! CL : Now done at the end of the time step in ADVECTION_METSV for MesoNH IF(HPROGRAM/='MESONH') THEN !$mnh_expand_where(JIJ=IIJB:IIJE,JK=1:IKT) - GTKENEG(IIJB:IIJE,1:IKT) = ZRES(IIJB:IIJE,1:IKT) <= CSTURB%XTKEMIN + GTKENEG(IIJB:IIJE,1:IKT) = ZRES(IIJB:IIJE,1:IKT) <= TURBN%XTKEMIN WHERE ( GTKENEG(IIJB:IIJE,1:IKT) ) - ZRES(IIJB:IIJE,1:IKT) = CSTURB%XTKEMIN + ZRES(IIJB:IIJE,1:IKT) = TURBN%XTKEMIN END WHERE !$mnh_end_expand_where(JIJ=IIJB:IIJE,JK=1:IKT) END IF @@ -399,7 +398,7 @@ IF (BUCONF%LBUDGET_TKE) THEN ! ! Dissipation !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - ZMWORK1(IIJB:IIJE,1:IKT) = -CSTURB%XCED * SQRT(PTKEM(IIJB:IIJE,1:IKT))/PLEPS(IIJB:IIJE,1:IKT) * & + ZMWORK1(IIJB:IIJE,1:IKT) = -TURBN%XCED * SQRT(PTKEM(IIJB:IIJE,1:IKT))/PLEPS(IIJB:IIJE,1:IKT) * & (PEXPL*PTKEM(IIJB:IIJE,1:IKT) + TURBN%XIMPL*ZRES(IIJB:IIJE,1:IKT))*PRHODJ(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) CALL BUDGET_STORE_ADD_PHY(D, TBUDGETS(NBUDGET_TKE), 'DISS',ZMWORK1) @@ -414,13 +413,13 @@ END IF IF (BUCONF%LBUDGET_TKE) THEN PRTKES(IIJB:IIJE,1:IKT) = PRTKES(IIJB:IIJE,1:IKT) + PDP(IIJB:IIJE,1:IKT) * PRHODJ(IIJB:IIJE,1:IKT) PRTKES(IIJB:IIJE,1:IKT) = PRTKES(IIJB:IIJE,1:IKT) + PTP(IIJB:IIJE,1:IKT) * PRHODJ(IIJB:IIJE,1:IKT) -PRTKES(IIJB:IIJE,1:IKT) = PRTKES(IIJB:IIJE,1:IKT) - CSTURB%XCED * SQRT(PTKEM(IIJB:IIJE,1:IKT)) / PLEPS(IIJB:IIJE,1:IKT) * & +PRTKES(IIJB:IIJE,1:IKT) = PRTKES(IIJB:IIJE,1:IKT) - TURBN%XCED * SQRT(PTKEM(IIJB:IIJE,1:IKT)) / PLEPS(IIJB:IIJE,1:IKT) * & (PEXPL*PTKEM(IIJB:IIJE,1:IKT) + TURBN%XIMPL*ZRES(IIJB:IIJE,1:IKT)) * PRHODJ(IIJB:IIJE,1:IKT) END IF #else PRTKES(IIJB:IIJE,1:IKT) = PRTKES(IIJB:IIJE,1:IKT) + PRHODJ(IIJB:IIJE,1:IKT) * & ( PDP(IIJB:IIJE,1:IKT) + PTP(IIJB:IIJE,1:IKT) & - - CSTURB%XCED * SQRT(PTKEM(IIJB:IIJE,1:IKT)) / PLEPS(IIJB:IIJE,1:IKT) & + - TURBN%XCED * SQRT(PTKEM(IIJB:IIJE,1:IKT)) / PLEPS(IIJB:IIJE,1:IKT) & * ( PEXPL*PTKEM(IIJB:IIJE,1:IKT) + TURBN%XIMPL*ZRES(IIJB:IIJE,1:IKT) ) ) #endif ! @@ -447,7 +446,7 @@ IF (BUCONF%LBUDGET_TKE) CALL BUDGET_STORE_END_PHY(D, TBUDGETS(NBUDGET_TKE), 'TR' ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PRTHLS(IIJB:IIJE,1:IKT) = PRTHLS(IIJB:IIJE,1:IKT) + & - CSTURB%XCED * SQRT(PTKEM(IIJB:IIJE,1:IKT)) / PLEPS(IIJB:IIJE,1:IKT) * & + TURBN%XCED * SQRT(PTKEM(IIJB:IIJE,1:IKT)) / PLEPS(IIJB:IIJE,1:IKT) * & (PEXPL*PTKEM(IIJB:IIJE,1:IKT) + TURBN%XIMPL*ZRES(IIJB:IIJE,1:IKT)) & * PRHODJ(IIJB:IIJE,1:IKT) * PCOEF_DISS(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -459,13 +458,13 @@ PRTHLS(IIJB:IIJE,1:IKT) = PRTHLS(IIJB:IIJE,1:IKT) + & IF(PRESENT(PTR)) PTR=ZTR IF(PRESENT(PDISS)) THEN !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - PDISS(IIJB:IIJE,1:IKT) = -CSTURB%XCED * (PTKEM(IIJB:IIJE,1:IKT)**1.5) / PLEPS(IIJB:IIJE,1:IKT) + PDISS(IIJB:IIJE,1:IKT) = -TURBN%XCED * (PTKEM(IIJB:IIJE,1:IKT)**1.5) / PLEPS(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) END IF ! IF(PRESENT(PEDR)) THEN !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - PEDR(IIJB:IIJE,1:IKT) = CSTURB%XCED * (PTKEM(IIJB:IIJE,1:IKT)**1.5) / PLEPS(IIJB:IIJE,1:IKT) + PEDR(IIJB:IIJE,1:IKT) = TURBN%XCED * (PTKEM(IIJB:IIJE,1:IKT)**1.5) / PLEPS(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) END IF ! diff --git a/src/common/turb/mode_turb_hor.F90 b/src/common/turb/mode_turb_hor.F90 index c4a03a1be51710935bc3defb4f7827c96137c079..490fca72344b1c225eb75d798e721eec403c2b7f 100644 --- a/src/common/turb/mode_turb_hor.F90 +++ b/src/common/turb/mode_turb_hor.F90 @@ -5,7 +5,7 @@ MODULE MODE_TURB_HOR IMPLICIT NONE CONTAINS - SUBROUTINE TURB_HOR(D,CST,CSTURB,TURBN,TLES, & + SUBROUTINE TURB_HOR(D,CST,CSTURB,TURBN,NEBN,TLES, & KSPLT, KRR, KRRL, KRRI, PTSTEP, & KSV, KSV_LGBEG, KSV_LGEND, OFLAT,O2D,ONOMIXLG, & OOCEAN,OCOMPUTE_SRC,OBLOWSNOW, & @@ -141,6 +141,7 @@ CONTAINS USE MODD_CST, ONLY : CST_t USE MODD_CTURB, ONLY : CSTURB_t USE MODD_TURB_n, ONLY: TURB_t +USE MODD_NEB_n, ONLY: NEB_t USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_IO, ONLY: TFILEDATA USE MODD_PARAMETERS @@ -165,6 +166,7 @@ TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST TYPE(CSTURB_t), INTENT(IN) :: CSTURB TYPE(TURB_t), INTENT(IN) :: TURBN +TYPE(NEB_t), INTENT(IN) :: NEBN TYPE(TLES_t), INTENT(INOUT):: TLES ! modd_les structure INTEGER, INTENT(IN) :: KSPLT ! current split index INTEGER, INTENT(IN) :: KRR ! number of moist var. @@ -277,7 +279,7 @@ REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSIGS !* 8. TURBULENT CORRELATIONS : <THl THl>, <THl Rnp>, <Rnp Rnp>, Sigma_s ! IF (KSPLT==1) & - CALL TURB_HOR_THERMO_CORR(D,CST,TURBN,TLES, & + CALL TURB_HOR_THERMO_CORR(D,CST,TURBN,NEBN,TLES, & KRR, KRRL, KRRI, & OOCEAN,OCOMPUTE_SRC,O2D, & TPFILE, & @@ -367,7 +369,7 @@ REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSIGS PRSVS ) ! IF (KSPLT==1 .AND. TLES%LLES_CALL) & - CALL TURB_HOR_SV_CORR(D,CST,CSTURB,TLES, & + CALL TURB_HOR_SV_CORR(D,CST,CSTURB,TURBN,TLES, & KSV,KSV_LGBEG,KSV_LGEND, & KRR,KRRL,KRRI,OOCEAN,OCOMPUTE_SRC,OBLOWSNOW, & ONOMIXLG,O2D, & diff --git a/src/common/turb/mode_turb_hor_splt.F90 b/src/common/turb/mode_turb_hor_splt.F90 index 83fdd1ed2d39f76780a3613955029e4f50e1dfa5..ffddea4605ad7a54dd37b1a09111a4d950e40ff6 100644 --- a/src/common/turb/mode_turb_hor_splt.F90 +++ b/src/common/turb/mode_turb_hor_splt.F90 @@ -5,7 +5,7 @@ MODULE MODE_TURB_HOR_SPLT IMPLICIT NONE CONTAINS - SUBROUTINE TURB_HOR_SPLT(D,CST,CSTURB,TURBN,TLES, & + SUBROUTINE TURB_HOR_SPLT(D,CST,CSTURB,TURBN,NEBN,TLES, & KSPLIT, KRR,KRRL,KRRI,KSV, KSV_LGBEG,KSV_LGEND,& PTSTEP,HLBCX,HLBCY, OFLAT, O2D, ONOMIXLG, & OOCEAN,OCOMPUTE_SRC,OBLOWSNOW,PRSNOW, & @@ -162,6 +162,7 @@ USE MODD_CTURB, ONLY: CSTURB_t USE MODD_DIMPHYEX, ONLY : DIMPHYEX_t USE MODD_LES, ONLY: TLES_t USE MODD_TURB_n, ONLY: TURB_t +USE MODD_NEB_n, ONLY: NEB_t ! USE MODD_IO, ONLY: TFILEDATA USE MODD_PARAMETERS @@ -183,6 +184,7 @@ TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST TYPE(CSTURB_t), INTENT(IN) :: CSTURB TYPE(TURB_t), INTENT(IN) :: TURBN +TYPE(NEB_t), INTENT(IN) :: NEBN TYPE(TLES_t), INTENT(INOUT):: TLES ! modd_les structure INTEGER, INTENT(IN) :: KSPLIT ! number of time splitting INTEGER, INTENT(IN) :: KRR ! number of moist var. @@ -372,7 +374,7 @@ IF (KSPLIT>1 .AND. HPROGRAM=='MESONH') THEN DO JSPLT=1,KSPLIT ! ! compute the turbulent tendencies for the small time step - CALL TURB_HOR(D,CST,CSTURB,TURBN,TLES, & + CALL TURB_HOR(D,CST,CSTURB,TURBN,NEBN,TLES, & JSPLT, KRR, KRRL, KRRI, PTSTEP, & KSV, KSV_LGBEG, KSV_LGEND, OFLAT,O2D, ONOMIXLG,& OOCEAN,OCOMPUTE_SRC,OBLOWSNOW, & @@ -515,7 +517,7 @@ IF (KSPLIT>1 .AND. HPROGRAM=='MESONH') THEN ! ELSE ! - CALL TURB_HOR(D,CST,CSTURB,TURBN,TLES, & + CALL TURB_HOR(D,CST,CSTURB,TURBN,NEBN,TLES, & 1, KRR, KRRL, KRRI, PTSTEP, & KSV, KSV_LGBEG, KSV_LGEND, OFLAT,O2D, ONOMIXLG,& OOCEAN,OCOMPUTE_SRC,OBLOWSNOW, & diff --git a/src/common/turb/mode_turb_hor_sv_corr.F90 b/src/common/turb/mode_turb_hor_sv_corr.F90 index 1ebc83f7fdef805bfb4504376260aecb9009c9bb..35878c3d4420c2b43ff987a97cb78f4d15c55bac 100644 --- a/src/common/turb/mode_turb_hor_sv_corr.F90 +++ b/src/common/turb/mode_turb_hor_sv_corr.F90 @@ -5,7 +5,7 @@ MODULE MODE_TURB_HOR_SV_CORR IMPLICIT NONE CONTAINS - SUBROUTINE TURB_HOR_SV_CORR(D,CST,CSTURB,TLES,KSV,KSV_LGBEG,KSV_LGEND,& + SUBROUTINE TURB_HOR_SV_CORR(D,CST,CSTURB,TURBN,TLES,KSV,KSV_LGBEG,KSV_LGEND,& KRR,KRRL,KRRI,OOCEAN,OCOMPUTE_SRC,OBLOWSNOW, & ONOMIXLG,O2D, & PDXX,PDYY,PDZZ,PDZX,PDZY,PRSNOW, & @@ -51,6 +51,7 @@ CONTAINS ! USE MODD_CST, ONLY: CST_t USE MODD_CTURB, ONLY : CSTURB_t +USE MODD_TURB_n, ONLY: TURB_t USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_PARAMETERS USE MODD_LES, ONLY: TLES_t @@ -76,6 +77,7 @@ IMPLICIT NONE TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST TYPE(CSTURB_t), INTENT(IN) :: CSTURB +TYPE(TURB_t), INTENT(IN) :: TURBN TYPE(TLES_t), INTENT(INOUT) :: TLES ! modd_les structure INTEGER, INTENT(IN) :: KRR ! number of moist var. INTEGER, INTENT(IN) :: KRRL ! number of liquid var. @@ -127,9 +129,9 @@ CALL SECOND_MNH(ZTIME1) ! IF(OBLOWSNOW) THEN ! See Vionnet (PhD, 2012) for a complete discussion around the value of the Schmidt number for blowing snow variables - ZCSV= CSTURB%XCHF/PRSNOW + ZCSV= TURBN%XCHF/PRSNOW ELSE - ZCSV= CSTURB%XCHF + ZCSV= TURBN%XCHF ENDIF ! DO JSV=1,KSV @@ -160,11 +162,11 @@ DO JSV=1,KSV ZFLX(:,:,:)= PLM(:,:,:) * PLEPS(:,:,:) & * ( GX_M_M(PTHLM,PDXX,PDZZ,PDZX) * GX_M_M(PSVM(:,:,:,JSV),PDXX,PDZZ,PDZX) & + GY_M_M(PTHLM,PDYY,PDZZ,PDZY) * GY_M_M(PSVM(:,:,:,JSV),PDYY,PDZZ,PDZY) & - ) * (CSTURB%XCSHF+ZCSV) / (2.*ZCTSVD) + ) * (TURBN%XCSHF+ZCSV) / (2.*ZCTSVD) ELSE ZFLX(:,:,:)= PLM(:,:,:) * PLEPS(:,:,:) & * GX_M_M(PTHLM,PDXX,PDZZ,PDZX) * GX_M_M(PSVM(:,:,:,JSV),PDXX,PDZZ,PDZX) & - * (CSTURB%XCSHF+ZCSV) / (2.*ZCTSVD) + * (TURBN%XCSHF+ZCSV) / (2.*ZCTSVD) END IF CALL LES_MEAN_SUBGRID( ZA*ZFLX, TLES%X_LES_SUBGRID_SvThv(:,:,:,JSV) , .TRUE.) CALL LES_MEAN_SUBGRID( -CST%XG/PTHVREF/3.*ZA*ZFLX, TLES%X_LES_SUBGRID_SvPz(:,:,:,JSV), .TRUE. ) @@ -175,11 +177,11 @@ DO JSV=1,KSV ZFLX(:,:,:)= PLM(:,:,:) * PLEPS(:,:,:) & * ( GX_M_M(PRM(:,:,:,1),PDXX,PDZZ,PDZX) * GX_M_M(PSVM(:,:,:,JSV),PDXX,PDZZ,PDZX) & + GY_M_M(PRM(:,:,:,1),PDYY,PDZZ,PDZY) * GY_M_M(PSVM(:,:,:,JSV),PDYY,PDZZ,PDZY) & - ) * (CSTURB%XCHF+ZCSV) / (2.*ZCQSVD) + ) * (TURBN%XCHF+ZCSV) / (2.*ZCQSVD) ELSE ZFLX(:,:,:)= PLM(:,:,:) * PLEPS(:,:,:) & * GX_M_M(PRM(:,:,:,1),PDXX,PDZZ,PDZX) * GX_M_M(PSVM(:,:,:,JSV),PDXX,PDZZ,PDZX) & - * (CSTURB%XCHF+ZCSV) / (2.*ZCQSVD) + * (TURBN%XCHF+ZCSV) / (2.*ZCQSVD) END IF CALL LES_MEAN_SUBGRID( ZA*ZFLX, TLES%X_LES_SUBGRID_SvThv(:,:,:,JSV) , .TRUE.) CALL LES_MEAN_SUBGRID( -CST%XG/PTHVREF/3.*ZA*ZFLX, TLES%X_LES_SUBGRID_SvPz(:,:,:,JSV), .TRUE. ) diff --git a/src/common/turb/mode_turb_hor_sv_flux.F90 b/src/common/turb/mode_turb_hor_sv_flux.F90 index db1b033eb0a08f2670ba8cc52706c4b97b8bf8f1..b5544d926c44d03342fe0775a790cc1550f57bc7 100644 --- a/src/common/turb/mode_turb_hor_sv_flux.F90 +++ b/src/common/turb/mode_turb_hor_sv_flux.F90 @@ -156,9 +156,9 @@ ISV = SIZE(PSVM,4) ! IF(OBLOWSNOW) THEN ! See Vionnet (PhD, 2012) for a complete discussion around the value of the Schmidt number for blowing snow variables - ZCSV= XCHF/PRSNOW + ZCSV= TURBN%XCHF/PRSNOW ELSE - ZCSV= XCHF + ZCSV= TURBN%XCHF ENDIF ! ! compute the coefficients for the uncentred gradient computation near the diff --git a/src/common/turb/mode_turb_hor_thermo_corr.F90 b/src/common/turb/mode_turb_hor_thermo_corr.F90 index 268f923931607513832a9af54690e02638893bde..cded77fc60b907ffcad81edf3ffe289d86dac95a 100644 --- a/src/common/turb/mode_turb_hor_thermo_corr.F90 +++ b/src/common/turb/mode_turb_hor_thermo_corr.F90 @@ -6,7 +6,7 @@ MODULE MODE_TURB_HOR_THERMO_CORR IMPLICIT NONE CONTAINS - SUBROUTINE TURB_HOR_THERMO_CORR(D,CST,TURBN,TLES, & + SUBROUTINE TURB_HOR_THERMO_CORR(D,CST,TURBN,NEBN,TLES, & KRR, KRRL, KRRI, & OOCEAN,OCOMPUTE_SRC,O2D, & TPFILE, & @@ -63,6 +63,7 @@ USE MODD_CST, ONLY : CST_t USE MODD_CTURB USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_FIELD, ONLY: TFIELDMETADATA, TYPEREAL +USE MODD_NEB_n, ONLY: NEB_t USE MODD_IO, ONLY: TFILEDATA USE MODD_LES, ONLY: TLES_t USE MODD_PARAMETERS @@ -92,6 +93,7 @@ IMPLICIT NONE TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST TYPE(TURB_t), INTENT(IN) :: TURBN +TYPE(NEB_t), INTENT(IN) :: NEBN TYPE(TLES_t), INTENT(INOUT):: TLES ! modd_les structure INTEGER, INTENT(IN) :: KRR ! number of moist var. INTEGER, INTENT(IN) :: KRRL ! number of liquid water var. @@ -169,24 +171,24 @@ ZCOEFF(:,:,IKB)= - (PDZZ(:,:,IKB+2)+2.*PDZZ(:,:,IKB+1)) / & ! ! ! -IF ( ( KRRL > 0 .AND. TURBN%LSUBG_COND) .OR. ( TURBN%LTURB_FLX .AND. TPFILE%LOPENED ) & +IF ( ( KRRL > 0 .AND. NEBN%LSUBG_COND) .OR. ( TURBN%LTURB_FLX .AND. TPFILE%LOPENED ) & .OR. ( TLES%LLES_CALL ) ) THEN ! !* 8.1 <THl THl> ! ! Computes the horizontal variance <THl THl> IF (.NOT. O2D) THEN - ZFLX(:,:,:) = XCTV * PLM(:,:,:) * PLEPS(:,:,:) * & + ZFLX(:,:,:) = TURBN%XCTV * PLM(:,:,:) * PLEPS(:,:,:) * & ( GX_M_M(PTHLM,PDXX,PDZZ,PDZX)**2 + GY_M_M(PTHLM,PDYY,PDZZ,PDZY)**2 ) ELSE - ZFLX(:,:,:) = XCTV * PLM(:,:,:) * PLEPS(:,:,:) * & + ZFLX(:,:,:) = TURBN%XCTV * PLM(:,:,:) * PLEPS(:,:,:) * & GX_M_M(PTHLM,PDXX,PDZZ,PDZX)**2 END IF ! ! Compute the flux at the first inner U-point with an uncentred vertical ! gradient ! - ZFLX(:,:,IKB:IKB) = XCTV * PLM(:,:,IKB:IKB) & + ZFLX(:,:,IKB:IKB) = TURBN%XCTV * PLM(:,:,IKB:IKB) & * PLEPS(:,:,IKB:IKB) * ( & ( MXF(DXM(PTHLM(:,:,IKB:IKB)) * PINV_PDXX(:,:,IKB:IKB)) & - ( ZCOEFF(:,:,IKB+2:IKB+2)*PTHLM(:,:,IKB+2:IKB+2) & @@ -249,18 +251,18 @@ IF ( ( KRRL > 0 .AND. TURBN%LSUBG_COND) .OR. ( TURBN%LTURB_FLX .AND. TPFILE%LOPE PLM(:,:,:) * PLEPS(:,:,:) * & (GX_M_M(PTHLM,PDXX,PDZZ,PDZX) * GX_M_M(PRM(:,:,:,1),PDXX,PDZZ,PDZX) & + GY_M_M(PTHLM,PDYY,PDZZ,PDZY) * GY_M_M(PRM(:,:,:,1),PDYY,PDZZ,PDZY) & - ) * (XCHT1+XCHT2) + ) * (TURBN%XCHT1+TURBN%XCHT2) ELSE ZFLX(:,:,:)= & PLM(:,:,:) * PLEPS(:,:,:) * & (GX_M_M(PTHLM,PDXX,PDZZ,PDZX) * GX_M_M(PRM(:,:,:,1),PDXX,PDZZ,PDZX) & - ) * (XCHT1+XCHT2) + ) * (TURBN%XCHT1+TURBN%XCHT2) END IF ! ! Compute the flux at the first inner U-point with an uncentred vertical ! gradient - ZFLX(:,:,IKB:IKB) = (XCHT1+XCHT2) * PLM(:,:,IKB:IKB) & + ZFLX(:,:,IKB:IKB) = (TURBN%XCHT1+TURBN%XCHT2) * PLM(:,:,IKB:IKB) & * PLEPS(:,:,IKB:IKB) * ( & ( MXF(DXM(PTHLM(:,:,IKB:IKB)) * PINV_PDXX(:,:,IKB:IKB)) & - ( ZCOEFF(:,:,IKB+2:IKB+2)*PTHLM(:,:,IKB+2:IKB+2) & @@ -334,17 +336,17 @@ IF ( ( KRRL > 0 .AND. TURBN%LSUBG_COND) .OR. ( TURBN%LTURB_FLX .AND. TPFILE%LOPE ! ! Computes the horizontal variance <Rnp Rnp> IF (.NOT. O2D) THEN - ZFLX(:,:,:) = XCHV * PLM(:,:,:) * PLEPS(:,:,:) * & + ZFLX(:,:,:) = TURBN%XCHV * PLM(:,:,:) * PLEPS(:,:,:) * & ( GX_M_M(PRM(:,:,:,1),PDXX,PDZZ,PDZX)**2 + & GY_M_M(PRM(:,:,:,1),PDYY,PDZZ,PDZY)**2 ) ELSE - ZFLX(:,:,:) = XCHV * PLM(:,:,:) * PLEPS(:,:,:) * & + ZFLX(:,:,:) = TURBN%XCHV * PLM(:,:,:) * PLEPS(:,:,:) * & ( GX_M_M(PRM(:,:,:,1),PDXX,PDZZ,PDZX)**2 ) END IF ! ! Compute the flux at the first inner U-point with an uncentred vertical ! gradient - ZFLX(:,:,IKB:IKB) = XCHV * PLM(:,:,IKB:IKB) & + ZFLX(:,:,IKB:IKB) = TURBN%XCHV * PLM(:,:,IKB:IKB) & * PLEPS(:,:,IKB:IKB) * ( & ( MXF(DXM(PRM(:,:,IKB:IKB,1)) * PINV_PDXX(:,:,IKB:IKB)) & - ( ZCOEFF(:,:,IKB+2:IKB+2)*PRM(:,:,IKB+2:IKB+2,1) & diff --git a/src/common/turb/mode_turb_hor_thermo_flux.F90 b/src/common/turb/mode_turb_hor_thermo_flux.F90 index 0654ed9918e6e044ccc1c1ee87988a1e6d9e674c..67ac0255e117b590fc449aaa72d633576f3e5089 100644 --- a/src/common/turb/mode_turb_hor_thermo_flux.F90 +++ b/src/common/turb/mode_turb_hor_thermo_flux.F90 @@ -173,12 +173,12 @@ ZCOEFF(:,:,IKB)= - (PDZZ(:,:,IKB+2)+2.*PDZZ(:,:,IKB+1)) / & ! -------------- ! ! -ZFLX(:,:,:) = -XCSHF * MXM( PK ) * GX_M_U(1,IKU,1,PTHLM,PDXX,PDZZ,PDZX) +ZFLX(:,:,:) = -TURBN%XCSHF * MXM( PK ) * GX_M_U(1,IKU,1,PTHLM,PDXX,PDZZ,PDZX) ZFLX(:,:,IKE+1) = ZFLX(:,:,IKE) ! ! Compute the flux at the first inner U-point with an uncentred vertical ! gradient -ZFLX(:,:,IKB:IKB) = -XCSHF * MXM( PK(:,:,IKB:IKB) ) * & +ZFLX(:,:,IKB:IKB) = -TURBN%XCSHF * MXM( PK(:,:,IKB:IKB) ) * & ( DXM(PTHLM(:,:,IKB:IKB)) * PINV_PDXX(:,:,IKB:IKB) & -MXM( ZCOEFF(:,:,IKB+2:IKB+2)*PTHLM(:,:,IKB+2:IKB+2) & +ZCOEFF(:,:,IKB+1:IKB+1)*PTHLM(:,:,IKB+1:IKB+1) & @@ -279,12 +279,12 @@ END IF ! ----------- IF (KRR/=0) THEN ! - ZFLX(:,:,:) = -XCHF * MXM( PK ) * GX_M_U(1,IKU,1,PRM(:,:,:,1),PDXX,PDZZ,PDZX) + ZFLX(:,:,:) = -TURBN%XCHF * MXM( PK ) * GX_M_U(1,IKU,1,PRM(:,:,:,1),PDXX,PDZZ,PDZX) ZFLX(:,:,IKE+1) = ZFLX(:,:,IKE) ! ! Compute the flux at the first inner U-point with an uncentred vertical ! gradient - ZFLX(:,:,IKB:IKB) = -XCHF * MXM( PK(:,:,IKB:IKB) ) * & + ZFLX(:,:,IKB:IKB) = -TURBN%XCHF * MXM( PK(:,:,IKB:IKB) ) * & ( DXM(PRM(:,:,IKB:IKB,1)) * PINV_PDXX(:,:,IKB:IKB) & -MXM( ZCOEFF(:,:,IKB+2:IKB+2)*PRM(:,:,IKB+2:IKB+2,1) & +ZCOEFF(:,:,IKB+1:IKB+1)*PRM(:,:,IKB+1:IKB+1,1) & @@ -424,7 +424,7 @@ END IF ! ! IF (.NOT. O2D) THEN - ZFLX(:,:,:) = -XCSHF * MYM( PK ) * GY_M_V(1,IKU,1,PTHLM,PDYY,PDZZ,PDZY) + ZFLX(:,:,:) = -TURBN%XCSHF * MYM( PK ) * GY_M_V(1,IKU,1,PTHLM,PDYY,PDZZ,PDZY) ZFLX(:,:,IKE+1) = ZFLX(:,:,IKE) ELSE ZFLX(:,:,:) = 0. @@ -433,7 +433,7 @@ END IF ! ! Compute the flux at the first inner U-point with an uncentred vertical ! gradient -ZFLX(:,:,IKB:IKB) = -XCSHF * MYM( PK(:,:,IKB:IKB) ) * & +ZFLX(:,:,IKB:IKB) = -TURBN%XCSHF * MYM( PK(:,:,IKB:IKB) ) * & ( DYM(PTHLM(:,:,IKB:IKB)) * PINV_PDYY(:,:,IKB:IKB) & -MYM( ZCOEFF(:,:,IKB+2:IKB+2)*PTHLM(:,:,IKB+2:IKB+2) & +ZCOEFF(:,:,IKB+1:IKB+1)*PTHLM(:,:,IKB+1:IKB+1) & @@ -540,7 +540,7 @@ END IF IF (KRR/=0) THEN ! IF (.NOT. O2D) THEN - ZFLX(:,:,:) = -XCHF * MYM( PK ) * GY_M_V(1,IKU,1,PRM(:,:,:,1),PDYY,PDZZ,PDZY) + ZFLX(:,:,:) = -TURBN%XCHF * MYM( PK ) * GY_M_V(1,IKU,1,PRM(:,:,:,1),PDYY,PDZZ,PDZY) ZFLX(:,:,IKE+1) = ZFLX(:,:,IKE) ELSE ZFLX(:,:,:) = 0. @@ -548,7 +548,7 @@ IF (KRR/=0) THEN ! ! Compute the flux at the first inner U-point with an uncentred vertical ! gradient - ZFLX(:,:,IKB:IKB) = -XCHF * MYM( PK(:,:,IKB:IKB) ) * & + ZFLX(:,:,IKB:IKB) = -TURBN%XCHF * MYM( PK(:,:,IKB:IKB) ) * & ( DYM(PRM(:,:,IKB:IKB,1)) * PINV_PDYY(:,:,IKB:IKB) & -MYM( ZCOEFF(:,:,IKB+2:IKB+2)*PRM(:,:,IKB+2:IKB+2,1) & +ZCOEFF(:,:,IKB+1:IKB+1)*PRM(:,:,IKB+1:IKB+1,1) & diff --git a/src/common/turb/mode_turb_ver.F90 b/src/common/turb/mode_turb_ver.F90 index 6847c703e900270816207ad37a90eec4e25386e7..8553a63ea8ec07bd7afa5556c90da7f55578ef2f 100644 --- a/src/common/turb/mode_turb_ver.F90 +++ b/src/common/turb/mode_turb_ver.F90 @@ -6,7 +6,8 @@ MODULE MODE_TURB_VER IMPLICIT NONE CONTAINS -SUBROUTINE TURB_VER(D,CST,CSTURB,TURBN,TLES,KRR,KRRL,KRRI,KGRADIENTS,& +SUBROUTINE TURB_VER(D,CST,CSTURB,TURBN,NEBN,TLES, & + KRR,KRRL,KRRI,KGRADIENTS, & OOCEAN,ODEEPOC,OCOMPUTE_SRC, & KSV,KSV_LGBEG,KSV_LGEND, & PEXPL, HPROGRAM, O2D, ONOMIXLG, OFLAT, & @@ -221,6 +222,7 @@ USE MODD_IO, ONLY: TFILEDATA USE MODD_PARAMETERS, ONLY: JPVEXT_TURB USE MODD_LES, ONLY: TLES_t USE MODD_TURB_n, ONLY: TURB_t +USE MODD_NEB_n, ONLY: NEB_t ! USE MODE_EMOIST, ONLY: EMOIST USE MODE_ETHETA, ONLY: ETHETA @@ -245,6 +247,7 @@ TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST TYPE(CSTURB_t), INTENT(IN) :: CSTURB TYPE(TURB_t), INTENT(IN) :: TURBN +TYPE(NEB_t), INTENT(IN) :: NEBN TYPE(TLES_t), INTENT(INOUT):: TLES ! modd_les structure INTEGER, INTENT(IN) :: KGRADIENTS ! Number of stored horizontal gradients INTEGER, INTENT(IN) :: KRR ! number of moist var. @@ -408,7 +411,7 @@ IIJB=D%NIJB ! 3D Redelsperger numbers ! ! -CALL PRANDTL(D,CST,CSTURB,KRR,KSV,KRRI,TURBN%LTURB_FLX, & +CALL PRANDTL(D,CST,CSTURB,TURBN, KRR,KSV,KRRI,TURBN%LTURB_FLX, & TURBN%CTURBDIM,OOCEAN,TURBN%LHARAT,O2D,OCOMPUTE_SRC,& TPFILE, OFLAT, & PDXX,PDYY,PDZZ,PDZX,PDZY, & @@ -462,13 +465,13 @@ ENDIF ! GUSERV = KRR/=0 ! -CALL PHI3(D,CSTURB,ZREDTH1,ZREDR1,ZRED2TH3,ZRED2R3,ZRED2THR3,TURBN%CTURBDIM,GUSERV,ZPHI3) +CALL PHI3(D,CSTURB,TURBN,ZREDTH1,ZREDR1,ZRED2TH3,ZRED2R3,ZRED2THR3,TURBN%CTURBDIM,GUSERV,ZPHI3) IF(KRR/=0) & -CALL PSI3(D,CSTURB,ZREDR1,ZREDTH1,ZRED2R3,ZRED2TH3,ZRED2THR3,TURBN%CTURBDIM,GUSERV,ZPSI3) +CALL PSI3(D,CSTURB,TURBN,ZREDR1,ZREDTH1,ZRED2R3,ZRED2TH3,ZRED2THR3,TURBN%CTURBDIM,GUSERV,ZPSI3) ! ! Prandtl numbers for scalars ! -CALL PSI_SV(D,CSTURB,KSV,ZREDTH1,ZREDR1,ZREDS1,ZRED2THS,ZRED2RS,ZPHI3,ZPSI3,ZPSI_SV) +CALL PSI_SV(D,CSTURB,TURBN,KSV,ZREDTH1,ZREDR1,ZREDS1,ZRED2THS,ZRED2RS,ZPHI3,ZPSI3,ZPSI_SV) ! ! LES diagnostics ! @@ -521,7 +524,7 @@ ENDIF PRTHLS,PRRS,ZTHLP,ZRP,PTP,PWTH,PWRC, & PSSTFL, PSSTFL_C, PSSRFL_C ) ! - CALL TURB_VER_THERMO_CORR(D,CST,CSTURB,TURBN,TLES, & + CALL TURB_VER_THERMO_CORR(D,CST,CSTURB,TURBN,NEBN,TLES, & KRR,KRRL,KRRI,KSV, & OCOMPUTE_SRC, & OCOUPLES, & @@ -588,7 +591,7 @@ CALL TURB_VER_SV_FLUX(D,CST,CSTURB,TURBN,TLES,ONOMIXLG, & ! ! IF (KSV>0 .AND. TLES%LLES_CALL) & -CALL TURB_VER_SV_CORR(D,CST,CSTURB,TLES,KRR,KRRL,KRRI,OOCEAN, & +CALL TURB_VER_SV_CORR(D,CST,CSTURB,TURBN,TLES,KRR,KRRL,KRRI,OOCEAN,& PDZZ,KSV,KSV_LGBEG,KSV_LGEND,ONOMIXLG, & OBLOWSNOW,OCOMPUTE_SRC,PRSNOW, & PTHLM,PRM,PTHVREF, & diff --git a/src/common/turb/mode_turb_ver_sv_corr.F90 b/src/common/turb/mode_turb_ver_sv_corr.F90 index 64acbc7f83418a05b71b816b7d6cf9cb86b452fa..3e4604d23f919e77416c0d2942c7ecd31b718b53 100644 --- a/src/common/turb/mode_turb_ver_sv_corr.F90 +++ b/src/common/turb/mode_turb_ver_sv_corr.F90 @@ -5,7 +5,7 @@ MODULE MODE_TURB_VER_SV_CORR IMPLICIT NONE CONTAINS -SUBROUTINE TURB_VER_SV_CORR(D,CST,CSTURB,TLES,KRR,KRRL,KRRI,OOCEAN, & +SUBROUTINE TURB_VER_SV_CORR(D,CST,CSTURB,TURBN,TLES,KRR,KRRL,KRRI,OOCEAN, & PDZZ,KSV,KSV_LGBEG,KSV_LGEND,ONOMIXLG, & OBLOWSNOW,OCOMPUTE_SRC,PRSNOW, & PTHLM,PRM,PTHVREF, & @@ -58,6 +58,7 @@ USE YOMHOOK , ONLY : LHOOK, DR_HOOK ! USE MODD_CST, ONLY: CST_t USE MODD_CTURB, ONLY: CSTURB_t +USE MODD_TURB_n, ONLY: TURB_t USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_PARAMETERS, ONLY: JPVEXT_TURB USE MODD_LES, ONLY: TLES_t @@ -79,6 +80,7 @@ IMPLICIT NONE TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST TYPE(CSTURB_t), INTENT(IN) :: CSTURB +TYPE(TURB_t), INTENT(IN) :: TURBN TYPE(TLES_t), INTENT(INOUT):: TLES ! modd_les structure INTEGER, INTENT(IN) :: KSV, KSV_LGBEG, KSV_LGEND ! number of scalar variables LOGICAL, INTENT(IN) :: OOCEAN ! switch for Ocean model version @@ -142,9 +144,9 @@ CALL SECOND_MNH(ZTIME1) ! IF(OBLOWSNOW) THEN ! See Vionnet (PhD, 2012) for a complete discussion around the value of the Schmidt number for blowing snow variables - ZCSV= CSTURB%XCHF/PRSNOW + ZCSV= TURBN%XCHF/PRSNOW ELSE - ZCSV= CSTURB%XCHF + ZCSV= TURBN%XCHF ENDIF ! DO JSV=1,KSV @@ -178,7 +180,7 @@ DO JSV=1,KSV CALL GZ_M_W_PHY(D,PSVM(:,:,JSV),PDZZ,ZWORK2) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - ZFLXZ(IIJB:IIJE,1:IKT)= ( CSTURB%XCSHF * PPHI3(IIJB:IIJE,1:IKT) + ZCSV * PPSI_SV(IIJB:IIJE,1:IKT,JSV) ) & + ZFLXZ(IIJB:IIJE,1:IKT)= ( TURBN%XCSHF * PPHI3(IIJB:IIJE,1:IKT) + ZCSV * PPSI_SV(IIJB:IIJE,1:IKT,JSV) ) & * ZWORK1(IIJB:IIJE,1:IKT) * ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ! diff --git a/src/common/turb/mode_turb_ver_sv_flux.F90 b/src/common/turb/mode_turb_ver_sv_flux.F90 index 40a52e4ce77ea68335688a57bdc43324495a7207..3655723bf51d497a9057ba1002e64b9a1b16f866 100644 --- a/src/common/turb/mode_turb_ver_sv_flux.F90 +++ b/src/common/turb/mode_turb_ver_sv_flux.F90 @@ -337,9 +337,9 @@ ENDIF ! IF(OBLOWSNOW) THEN ! See Vionnet (PhD, 2012) for a complete discussion around the value of the Schmidt number for blowing snow variables - ZCSV=CSTURB%XCHF/PRSNOW + ZCSV=TURBN%XCHF/PRSNOW ELSE - ZCSV=CSTURB%XCHF + ZCSV=TURBN%XCHF ENDIF !---------------------------------------------------------------------------- ! diff --git a/src/common/turb/mode_turb_ver_thermo_corr.F90 b/src/common/turb/mode_turb_ver_thermo_corr.F90 index 8a53e4917a552ea1eda3b790e8ee7dcc90a5887a..d4f9ec5d6a2c94afa07e0a9242e9f2273cbb20bd 100644 --- a/src/common/turb/mode_turb_ver_thermo_corr.F90 +++ b/src/common/turb/mode_turb_ver_thermo_corr.F90 @@ -6,7 +6,7 @@ MODULE MODE_TURB_VER_THERMO_CORR IMPLICIT NONE CONTAINS -SUBROUTINE TURB_VER_THERMO_CORR(D,CST,CSTURB,TURBN,TLES, & +SUBROUTINE TURB_VER_THERMO_CORR(D,CST,CSTURB,TURBN,NEBN,TLES, & KRR,KRRL,KRRI,KSV, & OCOMPUTE_SRC,OCOUPLES, & PEXPL,TPFILE, & @@ -140,7 +140,7 @@ SUBROUTINE TURB_VER_THERMO_CORR(D,CST,CSTURB,TURBN,TLES, & !! CSTURB%XCMFS,XCMFB : cts for the momentum flux !! CSTURB%XCSHF : ct for the sensible heat flux !! CSTURB%XCHF : ct for the moisture flux -!! CSTURB%XCTV,CSTURB%XCHV : cts for the T and moisture variances +!! TURBN%XCTV,TURBN%XCHV : cts for the T and moisture variances !! !! Module MODD_PARAMETERS !! @@ -216,6 +216,7 @@ USE MODD_IO, ONLY: TFILEDATA USE MODD_LES, ONLY: TLES_t USE MODD_PARAMETERS, ONLY: JPVEXT_TURB USE MODD_TURB_n, ONLY: TURB_t +USE MODD_NEB_n, ONLY: NEB_t ! USE MODE_IO_FIELD_WRITE_PHY, ONLY: IO_FIELD_WRITE_PHY USE MODE_PRANDTL @@ -233,6 +234,7 @@ TYPE(DIMPHYEX_t), INTENT(IN) :: D TYPE(CST_t), INTENT(IN) :: CST TYPE(CSTURB_t), INTENT(IN) :: CSTURB TYPE(TURB_t), INTENT(IN) :: TURBN +TYPE(NEB_t), INTENT(IN) :: NEBN TYPE(TLES_t), INTENT(INOUT):: TLES ! modd_les structure INTEGER, INTENT(IN) :: KRR ! number of moist var. INTEGER, INTENT(IN) :: KSV ! number of scalar var. @@ -382,7 +384,7 @@ ZCOEFF(IIJB:IIJE,IKB)= - (PDZZ(IIJB:IIJE,IKB+2*IKL)+2.*PDZZ(IIJB:IIJE,IKB+IKL)) IF (TURBN%LHARAT) THEN CALL MZF_PHY(D,PLM,PLMF) !wc Part of the new statistical cloud scheme set up - IF (TURBN%LSTATNW) THEN + IF (NEBN%LSTATNW) THEN CALL MZF_PHY(D,PLEPS,PLEPSF) ELSE PLEPSF(:,:)=PLMF(:,:) @@ -435,9 +437,9 @@ END IF ZWORK1(IIJB:IIJE,1:IKT)=PDTH_DZ(IIJB:IIJE,1:IKT)**2 !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) CALL MZF_PHY(D,ZWORK1,ZWORK2) - IF (TURBN%LSTATNW) THEN + IF (NEBN%LSTATNW) THEN !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - ZF(IIJB:IIJE,1:IKT) = CSTURB%XCTV * & + ZF(IIJB:IIJE,1:IKT) = TURBN%XCTV * & PLMF(IIJB:IIJE,1:IKT)*PLEPSF(IIJB:IIJE,1:IKT)*ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ELSE @@ -451,7 +453,7 @@ END IF !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - ZF(IIJB:IIJE,1:IKT) = CSTURB%XCTV*PLM(IIJB:IIJE,1:IKT)*PLEPS(IIJB:IIJE,1:IKT)& + ZF(IIJB:IIJE,1:IKT) = TURBN%XCTV*PLM(IIJB:IIJE,1:IKT)*PLEPS(IIJB:IIJE,1:IKT)& * ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ENDIF @@ -461,8 +463,8 @@ END IF ! ! d(w'th'2)/dz IF (GFTH2) THEN - CALL M3_TH2_WTH2(D,CSTURB,PREDTH1,PREDR1,PD,PLEPS,PSQRT_TKE,ZWORK1) - CALL D_M3_TH2_WTH2_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,& + CALL M3_TH2_WTH2(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PLEPS,PSQRT_TKE,ZWORK1) + CALL D_M3_TH2_WTH2_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,& & PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,ZWORK2) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -475,10 +477,10 @@ END IF ! ! d(w'2th')/dz IF (GFWTH) THEN - CALL M3_TH2_W2TH(D,CSTURB,PREDTH1,PREDR1,PD,PDTH_DZ,& + CALL M3_TH2_W2TH(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PDTH_DZ,& & PLM,PLEPS,PTKEM,ZWORK1) CALL MZF_PHY(D,PFWTH,ZWORK2) - CALL D_M3_TH2_W2TH_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,PD,& + CALL D_M3_TH2_W2TH_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,& & PLM,PLEPS,PTKEM,GUSERV,ZWORK3) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -492,9 +494,9 @@ END IF IF (KRR/=0) THEN ! d(w'r'2)/dz IF (GFR2) THEN - CALL M3_TH2_WR2(D,CSTURB,PD,PLEPS,PSQRT_TKE,PBLL_O_E,& + CALL M3_TH2_WR2(D,CSTURB,TURBN,PD,PLEPS,PSQRT_TKE,PBLL_O_E,& & PEMOIST,PDTH_DZ,ZWORK1) - CALL D_M3_TH2_WR2_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,PD,& + CALL D_M3_TH2_WR2_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,& & PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTH_DZ,ZWORK2) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -507,10 +509,10 @@ END IF ! ! d(w'2r')/dz IF (GFWR) THEN - CALL M3_TH2_W2R(D,CSTURB,PD,PLM,PLEPS,PTKEM,PBLL_O_E,& + CALL M3_TH2_W2R(D,CSTURB,TURBN,PD,PLM,PLEPS,PTKEM,PBLL_O_E,& & PEMOIST,PDTH_DZ,ZWORK1) CALL MZF_PHY(D,PFWR,ZWORK2) - CALL D_M3_TH2_W2R_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,PD,& + CALL D_M3_TH2_W2R_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,& & PLM,PLEPS,PTKEM,PBLL_O_E,PEMOIST,PDTH_DZ,ZWORK3) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -523,9 +525,9 @@ END IF ! ! d(w'th'r')/dz IF (GFTHR) THEN - CALL M3_TH2_WTHR(D,CSTURB,PREDR1,PD,PLEPS,PSQRT_TKE,& + CALL M3_TH2_WTHR(D,CSTURB,TURBN,PREDR1,PD,PLEPS,PSQRT_TKE,& & PBLL_O_E,PEMOIST,PDTH_DZ,ZWORK1) - CALL D_M3_TH2_WTHR_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,& + CALL D_M3_TH2_WTHR_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,& & PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTH_DZ,ZWORK2) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -567,14 +569,14 @@ END IF +ZCOEFF(IIJB:IIJE,IKB )*PTHLP(IIJB:IIJE,IKB ) )**2 & ) !$mnh_end_expand_array(JIJ=IIJB:IIJE) - IF (TURBN%LSTATNW) THEN + IF (NEBN%LSTATNW) THEN !$mnh_expand_array(JIJ=IIJB:IIJE) - ZFLXZ(IIJB:IIJE,IKB) = CSTURB%XCTV * ZFLXZ(IIJB:IIJE,IKB) + ZFLXZ(IIJB:IIJE,IKB) = TURBN%XCTV * ZFLXZ(IIJB:IIJE,IKB) !$mnh_end_expand_array(JIJ=IIJB:IIJE) - END IF + END IF ELSE !$mnh_expand_array(JIJ=IIJB:IIJE) - ZFLXZ(IIJB:IIJE,IKB) = CSTURB%XCTV * PPHI3(IIJB:IIJE,IKB+IKL) * PLM(IIJB:IIJE,IKB) & + ZFLXZ(IIJB:IIJE,IKB) = TURBN%XCTV * PPHI3(IIJB:IIJE,IKB+IKL) * PLM(IIJB:IIJE,IKB) & * PLEPS(IIJB:IIJE,IKB) & *( PEXPL * & ( ZCOEFF(IIJB:IIJE,IKB+2*IKL)*PTHLM(IIJB:IIJE,IKB+2*IKL) & @@ -592,7 +594,7 @@ END IF ZFLXZ(IIJB:IIJE,IKA) = ZFLXZ(IIJB:IIJE,IKB) !$mnh_end_expand_array(JIJ=IIJB:IIJE) ! - IF (TURBN%LSTATNW) THEN + IF (NEBN%LSTATNW) THEN !wc The variance from the budget eq should be multiplied by 2 here ! thl'2=2*L*LEPS*(dthl/dz**2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -674,9 +676,9 @@ END IF ZWORK1(IIJB:IIJE,1:IKT) = PDTH_DZ(IIJB:IIJE,1:IKT)*PDR_DZ(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) CALL MZF_PHY(D,ZWORK1,ZWORK2) - IF (TURBN%LSTATNW) THEN + IF (NEBN%LSTATNW) THEN !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - ZF(IIJB:IIJE,1:IKT) = CSTURB%XCTV * & + ZF(IIJB:IIJE,1:IKT) = TURBN%XCTV * & PLMF(IIJB:IIJE,1:IKT)*PLEPSF(IIJB:IIJE,1:IKT)*ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ELSE @@ -691,7 +693,7 @@ END IF !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - ZF(IIJB:IIJE,1:IKT) = CSTURB%XCTV*PLM(IIJB:IIJE,1:IKT)*PLEPS(IIJB:IIJE,1:IKT)& + ZF(IIJB:IIJE,1:IKT) = TURBN%XCTV*PLM(IIJB:IIJE,1:IKT)*PLEPS(IIJB:IIJE,1:IKT)& * ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ENDIF @@ -702,11 +704,11 @@ END IF ! ! d(w'th'2)/dz IF (GFTH2) THEN - CALL M3_THR_WTH2(D,CSTURB,PREDR1,PD,PLEPS,PSQRT_TKE,& + CALL M3_THR_WTH2(D,CSTURB,TURBN,PREDR1,PD,PLEPS,PSQRT_TKE,& & PBLL_O_E,PETHETA,PDR_DZ,ZWORK1) - CALL D_M3_THR_WTH2_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,& + CALL D_M3_THR_WTH2_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,& & PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDR_DZ,ZWORK2) - CALL D_M3_THR_WTH2_O_DDRDZ(D,CSTURB,PREDTH1,PREDR1,& + CALL D_M3_THR_WTH2_O_DDRDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,& & PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,ZWORK3) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -721,11 +723,11 @@ END IF ! d(w'2th')/dz IF (GFWTH) THEN CALL MZF_PHY(D,PFWTH,ZWORK1) - CALL M3_THR_W2TH(D,CSTURB,PREDR1,PD,PLM,PLEPS,PTKEM,& + CALL M3_THR_W2TH(D,CSTURB,TURBN,PREDR1,PD,PLM,PLEPS,PTKEM,& & PDR_DZ,ZWORK2) - CALL D_M3_THR_W2TH_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,& + CALL D_M3_THR_W2TH_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,& & PD,PLM,PLEPS,PTKEM,PBLL_O_E,PDR_DZ,PETHETA,ZWORK3) - CALL D_M3_THR_W2TH_O_DDRDZ(D,CSTURB,PREDTH1,PREDR1,& + CALL D_M3_THR_W2TH_O_DDRDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,& & PD,PLM,PLEPS,PTKEM,ZWORK4) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -740,11 +742,11 @@ END IF ! ! d(w'r'2)/dz IF (GFR2) THEN - CALL M3_THR_WR2(D,CSTURB,PREDTH1,PD,PLEPS,PSQRT_TKE,& + CALL M3_THR_WR2(D,CSTURB,TURBN,PREDTH1,PD,PLEPS,PSQRT_TKE,& & PBLL_O_E,PEMOIST,PDTH_DZ,ZWORK1) - CALL D_M3_THR_WR2_O_DDTDZ(D,CSTURB,PREDR1,PREDTH1,PD,& + CALL D_M3_THR_WR2_O_DDTDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,& & PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,ZWORK2) - CALL D_M3_THR_WR2_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,& + CALL D_M3_THR_WR2_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,& & PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,PDTH_DZ,ZWORK3) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -759,11 +761,11 @@ END IF ! d(w'2r')/dz IF (GFWR) THEN CALL MZF_PHY(D,PFWR,ZWORK1) - CALL M3_THR_W2R(D,CSTURB,PREDTH1,PD,PLM,PLEPS,PTKEM,& + CALL M3_THR_W2R(D,CSTURB,TURBN,PREDTH1,PD,PLM,PLEPS,PTKEM,& & PDTH_DZ,ZWORK2) - CALL D_M3_THR_W2R_O_DDTDZ(D,CSTURB,PREDR1,PREDTH1,PD,& + CALL D_M3_THR_W2R_O_DDTDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,& & PLM,PLEPS,PTKEM,ZWORK3) - CALL D_M3_THR_W2R_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,& + CALL D_M3_THR_W2R_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,& & PLM,PLEPS,PTKEM,PBLL_O_E,PDTH_DZ,PEMOIST,ZWORK4) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -777,11 +779,11 @@ END IF ! ! d(w'th'r')/dz IF (GFTHR) THEN - CALL M3_THR_WTHR(D,CSTURB,PREDTH1,PREDR1,PD,PLEPS,& + CALL M3_THR_WTHR(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PLEPS,& & PSQRT_TKE,ZWORK1) - CALL D_M3_THR_WTHR_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,& + CALL D_M3_THR_WTHR_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,& & PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,ZWORK2) - CALL D_M3_THR_WTHR_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,& + CALL D_M3_THR_WTHR_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,& & PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,ZWORK3) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -821,19 +823,19 @@ END IF + TURBN%XIMPL * ZDFDDTDZ(IIJB:IIJE,1:IKT) * ZWORK7(IIJB:IIJE,1:IKT) & + TURBN%XIMPL * ZDFDDRDZ(IIJB:IIJE,1:IKT) * ZWORK8(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - IF (TURBN%LSTATNW) THEN + IF (NEBN%LSTATNW) THEN !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - ZFLXZ(IIJB:IIJE,1:IKT) = CSTURB%XCTV * ZFLXZ(IIJB:IIJE,1:IKT) + ZFLXZ(IIJB:IIJE,1:IKT) = TURBN%XCTV * ZFLXZ(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) END IF ELSE - CALL D_PHI3DTDZ_O_DDTDZ(D,CSTURB,PPHI3,PREDTH1,PREDR1,PRED2TH3,PRED2THR3,TURBN%CTURBDIM,GUSERV,ZWKPHIPSI1) + CALL D_PHI3DTDZ_O_DDTDZ(D,CSTURB,TURBN,PPHI3,PREDTH1,PREDR1,PRED2TH3,PRED2THR3,TURBN%CTURBDIM,GUSERV,ZWKPHIPSI1) ! d(phi3*dthdz)/ddthdz term - CALL D_PSI3DTDZ_O_DDTDZ(D,CSTURB,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,TURBN%CTURBDIM,GUSERV,ZWKPHIPSI2) + CALL D_PSI3DTDZ_O_DDTDZ(D,CSTURB,TURBN,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,TURBN%CTURBDIM,GUSERV,ZWKPHIPSI2) ! d(psi3*dthdz)/ddthdz term - CALL D_PHI3DRDZ_O_DDRDZ(D,CSTURB,PPHI3,PREDTH1,PREDR1,PRED2TH3,PRED2THR3,TURBN%CTURBDIM,GUSERV,ZWKPHIPSI3) + CALL D_PHI3DRDZ_O_DDRDZ(D,CSTURB,TURBN,PPHI3,PREDTH1,PREDR1,PRED2TH3,PRED2THR3,TURBN%CTURBDIM,GUSERV,ZWKPHIPSI3) ! d(phi3*drdz )/ddrdz term - CALL D_PSI3DRDZ_O_DDRDZ(D,CSTURB,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,TURBN%CTURBDIM,GUSERV,ZWKPHIPSI4) + CALL D_PSI3DRDZ_O_DDRDZ(D,CSTURB,TURBN,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,TURBN%CTURBDIM,GUSERV,ZWKPHIPSI4) ! d(psi3*drdz )/ddrdz term !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -846,7 +848,7 @@ END IF !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ZFLXZ(IIJB:IIJE,1:IKT) = ZF(IIJB:IIJE,1:IKT) & - + TURBN%XIMPL * CSTURB%XCTV*PLM(IIJB:IIJE,1:IKT)*PLEPS(IIJB:IIJE,1:IKT)*0.5 & + + TURBN%XIMPL * TURBN%XCTV*PLM(IIJB:IIJE,1:IKT)*PLEPS(IIJB:IIJE,1:IKT)*0.5 & * ZWORK6(IIJB:IIJE,1:IKT) & + TURBN%XIMPL * ZDFDDTDZ(IIJB:IIJE,1:IKT) * ZWORK7(IIJB:IIJE,1:IKT) & + TURBN%XIMPL * ZDFDDRDZ(IIJB:IIJE,1:IKT) * ZWORK8(IIJB:IIJE,1:IKT) @@ -874,15 +876,15 @@ END IF +ZCOEFF(IIJB:IIJE,IKB )*PRP(IIJB:IIJE,IKB )) & ) !$mnh_end_expand_array(JIJ=IIJB:IIJE) - IF (TURBN%LSTATNW) THEN + IF (NEBN%LSTATNW) THEN !$mnh_expand_array(JIJ=IIJB:IIJE) - ZFLXZ(IIJB:IIJE,IKB) = (CSTURB%XCHT1 + CSTURB%XCHT2) * ZFLXZ(IIJB:IIJE,IKB) + ZFLXZ(IIJB:IIJE,IKB) = (TURBN%XCHT1 + TURBN%XCHT2) * ZFLXZ(IIJB:IIJE,IKB) !$mnh_end_expand_array(JIJ=IIJB:IIJE) END IF ELSE !$mnh_expand_array(JIJ=IIJB:IIJE) ZFLXZ(IIJB:IIJE,IKB) = & - (CSTURB%XCHT1 * PPHI3(IIJB:IIJE,IKB+IKL) + CSTURB%XCHT2 * PPSI3(IIJB:IIJE,IKB+IKL)) & + (TURBN%XCHT1 * PPHI3(IIJB:IIJE,IKB+IKL) + TURBN%XCHT2 * PPSI3(IIJB:IIJE,IKB+IKL)) & *( PEXPL * & ( ZCOEFF(IIJB:IIJE,IKB+2*IKL)*PTHLM(IIJB:IIJE,IKB+2*IKL) & +ZCOEFF(IIJB:IIJE,IKB+IKL )*PTHLM(IIJB:IIJE,IKB+IKL ) & @@ -905,7 +907,7 @@ END IF ZFLXZ(IIJB:IIJE,IKA) = ZFLXZ(IIJB:IIJE,IKB) !$mnh_end_expand_array(JIJ=IIJB:IIJE) ! - IF (TURBN%LSTATNW) THEN + IF (NEBN%LSTATNW) THEN !wc The variance from the budget eq should be multiplied by 2 here ! e.g. thl'2=2*L*LEPS*(cab)^-1 *(dthl/dz**2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -913,7 +915,7 @@ END IF !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ENDIF IF ( KRRL > 0 ) THEN - IF (TURBN%LSTATNW) THEN + IF (NEBN%LSTATNW) THEN !wc Part of the new statistical cloud scheme set up. Normal notation so - sign !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) PSIGS(IIJB:IIJE,1:IKT) = PSIGS(IIJB:IIJE,1:IKT) - & @@ -1001,9 +1003,9 @@ IF (TURBN%LHARAT) THEN !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ZF(IIJB:IIJE,1:IKT) = PLMF(IIJB:IIJE,1:IKT)*PLEPSF(IIJB:IIJE,1:IKT)*ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - IF (TURBN%LSTATNW) THEN + IF (NEBN%LSTATNW) THEN !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - ZF(IIJB:IIJE,1:IKT) = CSTURB%XCTV * ZF(IIJB:IIJE,1:IKT) + ZF(IIJB:IIJE,1:IKT) = TURBN%XCTV * ZF(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) END IF ELSE @@ -1012,7 +1014,7 @@ ELSE !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) CALL MZF_PHY(D,ZWORK1,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - ZF(IIJB:IIJE,1:IKT) = CSTURB%XCTV*PLM(IIJB:IIJE,1:IKT)*PLEPS(IIJB:IIJE,1:IKT)& + ZF(IIJB:IIJE,1:IKT) = TURBN%XCTV*PLM(IIJB:IIJE,1:IKT)*PLEPS(IIJB:IIJE,1:IKT)& *ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ENDIF @@ -1022,9 +1024,9 @@ ENDIF ! ! d(w'r'2)/dz IF (GFR2) THEN - CALL M3_R2_WR2(D,CSTURB,PREDR1,PREDTH1,PD,PLEPS,& + CALL M3_R2_WR2(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PLEPS,& & PSQRT_TKE,ZWORK1) - CALL D_M3_R2_WR2_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,& + CALL D_M3_R2_WR2_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,& & PD,PLEPS,PSQRT_TKE,PBLL_O_E,PEMOIST,ZWORK2) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -1037,9 +1039,9 @@ ENDIF ! d(w'2r')/dz IF (GFWR) THEN CALL MZF_PHY(D,PFWR,ZWORK1) - CALL M3_R2_W2R(D,CSTURB,PREDR1,PREDTH1,PD,PDR_DZ,& + CALL M3_R2_W2R(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PDR_DZ,& & PLM,PLEPS,PTKEM,ZWORK2) - CALL D_M3_R2_W2R_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,& + CALL D_M3_R2_W2R_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,& & PD,PLM,PLEPS,PTKEM,GUSERV,ZWORK3) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -1052,9 +1054,9 @@ ENDIF IF (KRR/=0) THEN ! d(w'r'2)/dz IF (GFTH2) THEN - CALL M3_R2_WTH2(D,CSTURB,PD,PLEPS,PSQRT_TKE,& + CALL M3_R2_WTH2(D,CSTURB,TURBN,PD,PLEPS,PSQRT_TKE,& & PBLL_O_E,PETHETA,PDR_DZ,ZWORK1) - CALL D_M3_R2_WTH2_O_DDRDZ(D,CSTURB,PREDR1,& + CALL D_M3_R2_WTH2_O_DDRDZ(D,CSTURB,TURBN,PREDR1,& & PREDTH1,PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDR_DZ,ZWORK2) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -1067,9 +1069,9 @@ ENDIF ! d(w'2r')/dz IF (GFWTH) THEN CALL MZF_PHY(D,PFWTH,ZWORK1) - CALL M3_R2_W2TH(D,CSTURB,PD,PLM,PLEPS,PTKEM,& + CALL M3_R2_W2TH(D,CSTURB,TURBN,PD,PLM,PLEPS,PTKEM,& & PBLL_O_E,PETHETA,PDR_DZ,ZWORK2) - CALL D_M3_R2_W2TH_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,& + CALL D_M3_R2_W2TH_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,& & PD,PLM,PLEPS,PTKEM,PBLL_O_E,PETHETA,PDR_DZ,ZWORK3) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -1081,9 +1083,9 @@ ENDIF ! ! d(w'th'r')/dz IF (GFTHR) THEN - CALL M3_R2_WTHR(D,CSTURB,PREDTH1,PD,PLEPS,& + CALL M3_R2_WTHR(D,CSTURB,TURBN,PREDTH1,PD,PLEPS,& & PSQRT_TKE,PBLL_O_E,PETHETA,PDR_DZ,ZWORK1) - CALL D_M3_R2_WTHR_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,& + CALL D_M3_R2_WTHR_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,& & PD,PLEPS,PSQRT_TKE,PBLL_O_E,PETHETA,PDR_DZ,ZWORK2) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -1114,13 +1116,13 @@ ENDIF * ZWORK4(IIJB:IIJE,1:IKT) & + TURBN%XIMPL * ZDFDDRDZ(IIJB:IIJE,1:IKT) * ZWORK6(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - IF (TURBN%LSTATNW) THEN + IF (NEBN%LSTATNW) THEN !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - ZFLXZ(IIJB:IIJE,1:IKT) = CSTURB%XCTV * ZFLXZ(IIJB:IIJE,1:IKT) + ZFLXZ(IIJB:IIJE,1:IKT) = TURBN%XCTV * ZFLXZ(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) END IF ELSE - CALL D_PSI3DRDZ2_O_DDRDZ(D,CSTURB,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,PDR_DZ,TURBN%CTURBDIM,GUSERV,ZWKPHIPSI1) + CALL D_PSI3DRDZ2_O_DDRDZ(D,CSTURB,TURBN,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,PDR_DZ,TURBN%CTURBDIM,GUSERV,ZWKPHIPSI1) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ZWORK1(IIJB:IIJE,1:IKT) = ZWKPHIPSI1(IIJB:IIJE,1:IKT)*ZWORK2(IIJB:IIJE,1:IKT) & / PDZZ(IIJB:IIJE,1:IKT) @@ -1134,7 +1136,7 @@ ENDIF ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ZFLXZ(IIJB:IIJE,1:IKT) = ZF(IIJB:IIJE,1:IKT) & - + TURBN%XIMPL * CSTURB%XCTV*PLM(IIJB:IIJE,1:IKT) *PLEPS(IIJB:IIJE,1:IKT) & + + TURBN%XIMPL * TURBN%XCTV*PLM(IIJB:IIJE,1:IKT) *PLEPS(IIJB:IIJE,1:IKT) & * ZWORK3(IIJB:IIJE,1:IKT) & + TURBN%XIMPL * ZDFDDRDZ(IIJB:IIJE,1:IKT) * ZWORK5(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -1155,14 +1157,14 @@ ENDIF +ZCOEFF(IIJB:IIJE,IKB )*PRP(IIJB:IIJE,IKB ))**2 & ) !$mnh_end_expand_array(JIJ=IIJB:IIJE) - IF (TURBN%LSTATNW) THEN + IF (NEBN%LSTATNW) THEN !$mnh_expand_array(JIJ=IIJB:IIJE) - ZFLXZ(IIJB:IIJE,IKB) = CSTURB%XCHV * ZFLXZ(IIJB:IIJE,IKB) + ZFLXZ(IIJB:IIJE,IKB) = TURBN%XCHV * ZFLXZ(IIJB:IIJE,IKB) !$mnh_end_expand_array(JIJ=IIJB:IIJE) END IF ELSE !$mnh_expand_array(JIJ=IIJB:IIJE) - ZFLXZ(IIJB:IIJE,IKB) = CSTURB%XCHV * PPSI3(IIJB:IIJE,IKB+IKL) * PLM(IIJB:IIJE,IKB) & + ZFLXZ(IIJB:IIJE,IKB) = TURBN%XCHV * PPSI3(IIJB:IIJE,IKB+IKL) * PLM(IIJB:IIJE,IKB) & * PLEPS(IIJB:IIJE,IKB) & *( PEXPL * & ( ZCOEFF(IIJB:IIJE,IKB+2*IKL)*PRM(IIJB:IIJE,IKB+2*IKL,1) & @@ -1179,7 +1181,7 @@ ENDIF !$mnh_expand_array(JIJ=IIJB:IIJE) ZFLXZ(IIJB:IIJE,IKA) = ZFLXZ(IIJB:IIJE,IKB) !$mnh_end_expand_array(JIJ=IIJB:IIJE) - IF (TURBN%LSTATNW) THEN + IF (NEBN%LSTATNW) THEN !wc The variance from the budget eq should be multiplied by 2 here ! thl'2=2*L*LEPS*(dthl/dz**2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) diff --git a/src/common/turb/mode_turb_ver_thermo_flux.F90 b/src/common/turb/mode_turb_ver_thermo_flux.F90 index b537219ac83a63aa4ce0eb5a3cc0f8d7e95bade1..c1d10b037f3a98aaebd08b2f4e2a30468acbcac3 100644 --- a/src/common/turb/mode_turb_ver_thermo_flux.F90 +++ b/src/common/turb/mode_turb_ver_thermo_flux.F90 @@ -147,9 +147,9 @@ SUBROUTINE TURB_VER_THERMO_FLUX(D,CST,CSTURB,TURBN,TLES, & !! the turbulence scheme !! !! CSTURB%XCMFS,XCMFB : cts for the momentum flux -!! CSTURB%XCSHF : ct for the sensible heat flux +!! TURBN%XCSHF : ct for the sensible heat flux !! CSTURB%XCHF : ct for the moisture flux -!! CSTURB%XCTV,CSTURB%XCHV : cts for the T and moisture variances +!! TURBN%XCTV,CSTURB%XCHV : cts for the T and moisture variances !! !! Module MODD_PARAMETERS !! @@ -469,7 +469,7 @@ END IF ! Compute the turbulent flux F and F' at time t-dt. ! CALL DZM_PHY(D,PTHLM,ZWORK1) -CALL D_PHI3DTDZ_O_DDTDZ(D,CSTURB,PPHI3,PREDTH1,PREDR1,PRED2TH3,PRED2THR3,TURBN%CTURBDIM,GUSERV,ZWORK2) +CALL D_PHI3DTDZ_O_DDTDZ(D,CSTURB,TURBN,PPHI3,PREDTH1,PREDR1,PRED2TH3,PRED2THR3,TURBN%CTURBDIM,GUSERV,ZWORK2) IF (TURBN%LHARAT) THEN !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ZF(IIJB:IIJE,1:IKT) = -ZKEFF(IIJB:IIJE,1:IKT)*ZWORK1(IIJB:IIJE,1:IKT)/PDZZ(IIJB:IIJE,1:IKT) @@ -477,9 +477,9 @@ IF (TURBN%LHARAT) THEN !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ELSE !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - ZF(IIJB:IIJE,1:IKT) = -CSTURB%XCSHF*PPHI3(IIJB:IIJE,1:IKT)*ZKEFF(IIJB:IIJE,1:IKT)& + ZF(IIJB:IIJE,1:IKT) = -TURBN%XCSHF*PPHI3(IIJB:IIJE,1:IKT)*ZKEFF(IIJB:IIJE,1:IKT)& *ZWORK1(IIJB:IIJE,1:IKT)/PDZZ(IIJB:IIJE,1:IKT) - ZDFDDTDZ(IIJB:IIJE,1:IKT) = -CSTURB%XCSHF*ZKEFF(IIJB:IIJE,1:IKT)*ZWORK2(IIJB:IIJE,1:IKT) + ZDFDDTDZ(IIJB:IIJE,1:IKT) = -TURBN%XCSHF*ZKEFF(IIJB:IIJE,1:IKT)*ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) END IF ! @@ -500,8 +500,8 @@ END IF ! ! d(w'2th')/dz IF (GFWTH) THEN - CALL M3_WTH_W2TH(D,CSTURB,PREDTH1,PREDR1,PD,ZKEFF,PTKEM,Z3RDMOMENT) - CALL D_M3_WTH_W2TH_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,& + CALL M3_WTH_W2TH(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,ZKEFF,PTKEM,Z3RDMOMENT) + CALL D_M3_WTH_W2TH_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,& & PD,PBLL_O_E,PETHETA,ZKEFF,PTKEM,ZWORK1) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -513,8 +513,8 @@ END IF ! ! d(w'th'2)/dz IF (GFTH2) THEN - CALL M3_WTH_WTH2(D,CSTURB,PREDTH1,PREDR1,PD,PBLL_O_E,PETHETA,Z3RDMOMENT) - CALL D_M3_WTH_WTH2_O_DDTDZ(D,CSTURB,Z3RDMOMENT,PREDTH1,PREDR1,& + CALL M3_WTH_WTH2(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,PBLL_O_E,PETHETA,Z3RDMOMENT) + CALL D_M3_WTH_WTH2_O_DDTDZ(D,CSTURB,TURBN,Z3RDMOMENT,PREDTH1,PREDR1,& & PD,PBLL_O_E,PETHETA,ZWORK1) CALL MZM_PHY(D,PFTH2,ZWORK2) ! @@ -528,8 +528,8 @@ END IF ! ! d(w'2r')/dz IF (GFWR) THEN - CALL M3_WTH_W2R(D,CSTURB,PD,ZKEFF,PTKEM,PBLL_O_E,PEMOIST,PDTH_DZ,ZWORK1) - CALL D_M3_WTH_W2R_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,PD,ZKEFF,PTKEM,PBLL_O_E,PEMOIST,ZWORK2) + CALL M3_WTH_W2R(D,CSTURB,TURBN,PD,ZKEFF,PTKEM,PBLL_O_E,PEMOIST,PDTH_DZ,ZWORK1) + CALL D_M3_WTH_W2R_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,ZKEFF,PTKEM,PBLL_O_E,PEMOIST,ZWORK2) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ZF(IIJB:IIJE,1:IKT) = ZF(IIJB:IIJE,1:IKT) + ZWORK1(IIJB:IIJE,1:IKT) * PFWR(IIJB:IIJE,1:IKT) @@ -540,9 +540,9 @@ END IF ! ! d(w'r'2)/dz IF (GFR2) THEN - CALL M3_WTH_WR2(D,CSTURB,PD,ZKEFF,PTKEM,PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PEMOIST,PDTH_DZ,ZWORK1) + CALL M3_WTH_WR2(D,CSTURB,TURBN,PD,ZKEFF,PTKEM,PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PEMOIST,PDTH_DZ,ZWORK1) CALL MZM_PHY(D,PFR2,ZWORK2) - CALL D_M3_WTH_WR2_O_DDTDZ(D,CSTURB,PREDTH1,PREDR1,PD,& + CALL D_M3_WTH_WR2_O_DDTDZ(D,CSTURB,TURBN,PREDTH1,PREDR1,PD,& & ZKEFF,PTKEM,PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PEMOIST,ZWORK3) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -554,9 +554,9 @@ END IF ! ! d(w'th'r')/dz IF (GFTHR) THEN - CALL M3_WTH_WTHR(D,CSTURB,PREDR1,PD,ZKEFF,PTKEM,PSQRT_TKE,PBETA,& + CALL M3_WTH_WTHR(D,CSTURB,TURBN,PREDR1,PD,ZKEFF,PTKEM,PSQRT_TKE,PBETA,& & PLEPS,PEMOIST,Z3RDMOMENT) - CALL D_M3_WTH_WTHR_O_DDTDZ(D,CSTURB,Z3RDMOMENT,PREDTH1,PREDR1,PD,PBLL_O_E,PETHETA,ZWORK1) + CALL D_M3_WTH_WTHR_O_DDTDZ(D,CSTURB,TURBN,Z3RDMOMENT,PREDTH1,PREDR1,PD,PBLL_O_E,PETHETA,ZWORK1) CALL MZM_PHY(D,PFTHR, ZWORK2) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -813,7 +813,7 @@ IF (TLES%LLES_CALL) THEN CALL LES_MEAN_SUBGRID_PHY(D,TLES,ZWORK4, TLES%X_LES_SUBGRID_WThv , .TRUE. ) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - ZWORK2(IIJB:IIJE,1:IKT) = -CSTURB%XCTP*PSQRT_TKE(IIJB:IIJE,1:IKT)/PLM(IIJB:IIJE,1:IKT) & + ZWORK2(IIJB:IIJE,1:IKT) = -TURBN%XCTP*PSQRT_TKE(IIJB:IIJE,1:IKT)/PLM(IIJB:IIJE,1:IKT) & *ZWORK1(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) CALL LES_MEAN_SUBGRID_PHY(D,TLES,ZWORK2, TLES%X_LES_SUBGRID_ThlPz ) @@ -837,7 +837,7 @@ IF (TLES%LLES_CALL) THEN ZA(IIJB:IIJE,1:IKT) = - ZFLXZ(IIJB:IIJE,1:IKT) / ZA(IIJB:IIJE,1:IKT) * PDZZ(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) !$mnh_expand_array(JIJ=IIJB:IIJE) - ZA(IIJB:IIJE,IKB) = CSTURB%XCSHF*PPHI3(IIJB:IIJE,IKB)*ZKEFF(IIJB:IIJE,IKB) + ZA(IIJB:IIJE,IKB) = TURBN%XCSHF*PPHI3(IIJB:IIJE,IKB)*ZKEFF(IIJB:IIJE,IKB) !$mnh_end_expand_array(JIJ=IIJB:IIJE) CALL MZF_PHY(D,ZA,ZA) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -873,11 +873,11 @@ IF (KRR /= 0) THEN ZDFDDRDZ(IIJB:IIJE,1:IKT) = -ZKEFF(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ELSE - CALL D_PSI3DRDZ_O_DDRDZ(D,CSTURB,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,TURBN%CTURBDIM,GUSERV,ZWORK2) + CALL D_PSI3DRDZ_O_DDRDZ(D,CSTURB,TURBN,PPSI3,PREDR1,PREDTH1,PRED2R3,PRED2THR3,TURBN%CTURBDIM,GUSERV,ZWORK2) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - ZF(IIJB:IIJE,1:IKT) = -CSTURB%XCSHF*PPSI3(IIJB:IIJE,1:IKT)*ZKEFF(IIJB:IIJE,1:IKT)& + ZF(IIJB:IIJE,1:IKT) = -TURBN%XCSHF*PPSI3(IIJB:IIJE,1:IKT)*ZKEFF(IIJB:IIJE,1:IKT)& *ZWORK1(IIJB:IIJE,1:IKT)/PDZZ(IIJB:IIJE,1:IKT) - ZDFDDRDZ(IIJB:IIJE,1:IKT) = -CSTURB%XCSHF*ZKEFF(IIJB:IIJE,1:IKT)*ZWORK2(IIJB:IIJE,1:IKT) + ZDFDDRDZ(IIJB:IIJE,1:IKT) = -TURBN%XCSHF*ZKEFF(IIJB:IIJE,1:IKT)*ZWORK2(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ENDIF ! @@ -898,8 +898,8 @@ IF (KRR /= 0) THEN ! ! d(w'2r')/dz IF (GFWR) THEN - CALL M3_WR_W2R(D,CSTURB,PREDR1,PREDTH1,PD,ZKEFF,PTKEM,Z3RDMOMENT) - CALL D_M3_WR_W2R_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,& + CALL M3_WR_W2R(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,ZKEFF,PTKEM,Z3RDMOMENT) + CALL D_M3_WR_W2R_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,& & PBLL_O_E,PEMOIST,ZKEFF,PTKEM,ZWORK1) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -911,9 +911,9 @@ IF (KRR /= 0) THEN ! ! d(w'r'2)/dz IF (GFR2) THEN - CALL M3_WR_WR2(D,CSTURB,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,Z3RDMOMENT) + CALL M3_WR_WR2(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,PBLL_O_E,PEMOIST,Z3RDMOMENT) CALL MZM_PHY(D,PFR2,ZWORK1) - CALL D_M3_WR_WR2_O_DDRDZ(D,CSTURB,Z3RDMOMENT,PREDR1,& + CALL D_M3_WR_WR2_O_DDRDZ(D,CSTURB,TURBN,Z3RDMOMENT,PREDR1,& & PREDTH1,PD,PBLL_O_E,PEMOIST,ZWORK2) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -926,9 +926,9 @@ IF (KRR /= 0) THEN ! ! d(w'2th')/dz IF (GFWTH) THEN - CALL M3_WR_W2TH(D,CSTURB,PD,ZKEFF,& + CALL M3_WR_W2TH(D,CSTURB,TURBN,PD,ZKEFF,& & PTKEM,PBLL_O_E,PETHETA,PDR_DZ,ZWORK1) - CALL D_M3_WR_W2TH_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,& + CALL D_M3_WR_W2TH_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,& & PD,ZKEFF,PTKEM,PBLL_O_E,PETHETA,ZWORK2) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -941,9 +941,9 @@ IF (KRR /= 0) THEN ! d(w'th'2)/dz IF (GFTH2) THEN CALL MZM_PHY(D,PFTH2,ZWORK1) - CALL M3_WR_WTH2(D,CSTURB,PD,ZKEFF,PTKEM,& + CALL M3_WR_WTH2(D,CSTURB,TURBN,PD,ZKEFF,PTKEM,& & PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PETHETA,PDR_DZ,ZWORK2) - CALL D_M3_WR_WTH2_O_DDRDZ(D,CSTURB,PREDR1,PREDTH1,PD,& + CALL D_M3_WR_WTH2_O_DDRDZ(D,CSTURB,TURBN,PREDR1,PREDTH1,PD,& &ZKEFF,PTKEM,PSQRT_TKE,PBLL_O_E,PBETA,PLEPS,PETHETA,ZWORK3) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -955,10 +955,10 @@ IF (KRR /= 0) THEN ! ! d(w'th'r')/dz IF (GFTHR) THEN - CALL M3_WR_WTHR(D,CSTURB,PREDTH1,PD,ZKEFF,PTKEM,PSQRT_TKE,PBETA,& + CALL M3_WR_WTHR(D,CSTURB,TURBN,PREDTH1,PD,ZKEFF,PTKEM,PSQRT_TKE,PBETA,& & PLEPS,PETHETA,Z3RDMOMENT) CALL MZM_PHY(D,PFTHR,ZWORK1) - CALL D_M3_WR_WTHR_O_DDRDZ(D,CSTURB,Z3RDMOMENT,PREDR1, & + CALL D_M3_WR_WTHR_O_DDRDZ(D,CSTURB,TURBN,Z3RDMOMENT,PREDR1, & & PREDTH1,PD,PBLL_O_E,PEMOIST,ZWORK2) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) @@ -1209,7 +1209,7 @@ END IF CALL LES_MEAN_SUBGRID_PHY(D,TLES,ZWORK4, TLES%X_LES_SUBGRID_WThv , .TRUE. ) ! !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - ZWORK2(IIJB:IIJE,1:IKT) = -CSTURB%XCTP*PSQRT_TKE(IIJB:IIJE,1:IKT)/PLM(IIJB:IIJE,1:IKT) & + ZWORK2(IIJB:IIJE,1:IKT) = -TURBN%XCTP*PSQRT_TKE(IIJB:IIJE,1:IKT)/PLM(IIJB:IIJE,1:IKT) & *ZWORK1(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) CALL LES_MEAN_SUBGRID_PHY(D,TLES,ZWORK2, TLES%X_LES_SUBGRID_RtPz ) @@ -1249,7 +1249,7 @@ IF ( ((TURBN%LTURB_FLX .AND. TPFILE%LOPENED) .OR. TLES%LLES_CALL) .AND. (KRRL > CALL MZM_PHY(D,ZWORK1,ZWORK3) !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ZA(IIJB:IIJE,1:IKT) = ZWORK2(IIJB:IIJE,1:IKT)/ PDZZ(IIJB:IIJE,1:IKT) * & - (-PPHI3(IIJB:IIJE,1:IKT)*ZWORK3(IIJB:IIJE,1:IKT)) * CSTURB%XCSHF + (-PPHI3(IIJB:IIJE,1:IKT)*ZWORK3(IIJB:IIJE,1:IKT)) * TURBN%XCSHF !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ENDIF !$mnh_expand_array(JIJ=IIJB:IIJE) diff --git a/src/common/turb/modi_shallow_mf.F90 b/src/common/turb/modi_shallow_mf.F90 index 564fdaa0927adf939bf8dc0a2066d54dc7b24d42..cc92b87597d8dfe0e4796d386db6689ac9483db8 100644 --- a/src/common/turb/modi_shallow_mf.F90 +++ b/src/common/turb/modi_shallow_mf.F90 @@ -4,10 +4,10 @@ ! INTERFACE ! ################################################################# - SUBROUTINE SHALLOW_MF(D, CST, NEB, PARAMMF, TURBN, CSTURB, & + SUBROUTINE SHALLOW_MF(D, CST, NEBN, PARAMMF, TURBN, CSTURB, & KRR, KRRL, KRRI, KSV, & - HFRAC_ICE,ONOMIXLG,KSV_LGBEG,KSV_LGEND, & - PIMPL_MF, PTSTEP, & + ONOMIXLG,KSV_LGBEG,KSV_LGEND, & + PTSTEP, & PDZZ, PZZ, & PRHODJ, PRHODREF, & PPABSM, PEXNM, & @@ -27,7 +27,7 @@ INTERFACE USE MODD_BUDGET, ONLY: TBUDGETCONF_t, TBUDGETDATA USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_CST, ONLY: CST_t -USE MODD_NEB, ONLY: NEB_t +USE MODD_NEB_n, ONLY: NEB_t USE MODD_PARAM_MFSHALL_n, ONLY: PARAM_MFSHALL_t USE MODD_TURB_n, ONLY: TURB_t USE MODD_CTURB, ONLY: CSTURB_t @@ -38,7 +38,7 @@ USE MODD_PARAMETERS, ONLY: JPSVMAX ! TYPE(DIMPHYEX_t), INTENT(IN) :: D ! PHYEX variables dimensions structure TYPE(CST_t), INTENT(IN) :: CST ! modd_cst general constant structure -TYPE(NEB_t), INTENT(IN) :: NEB +TYPE(NEB_t), INTENT(IN) :: NEBN TYPE(PARAM_MFSHALL_t), INTENT(IN) :: PARAMMF TYPE(TURB_t), INTENT(IN) :: TURBN ! modn_turbn (turb namelist) structure TYPE(CSTURB_t), INTENT(IN) :: CSTURB ! modd_csturb turb constant structure @@ -46,11 +46,9 @@ 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. INTEGER, INTENT(IN) :: KSV ! number of scalar var. -CHARACTER*1, INTENT(IN) :: HFRAC_ICE ! partition liquid/ice scheme LOGICAL, INTENT(IN) :: ONOMIXLG ! False if mixing of lagrangian tracer INTEGER, INTENT(IN) :: KSV_LGBEG ! first index of lag. tracer INTEGER, INTENT(IN) :: KSV_LGEND ! last index of lag. tracer -REAL, INTENT(IN) :: PIMPL_MF ! degre of implicitness REAL, INTENT(IN) :: PTSTEP ! Dynamical timestep REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PZZ ! Height of flux point REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PDZZ ! Metric coefficients @@ -62,7 +60,7 @@ REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PEXNM ! Exner function at REAL, DIMENSION(D%NIJT), INTENT(IN) :: PSFTH,PSFRV ! normal surface fluxes of theta and Rv REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PTHM ! Theta at t-dt -REAL, DIMENSION(D%NIJT,KRR), INTENT(IN) :: PRM ! water var. at t-dt +REAL, DIMENSION(D%NIJT,D%NKT,KRR), INTENT(IN) :: PRM ! water var. at t-dt REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PUM,PVM ! wind components at t-dt REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PTKEM ! tke at t-dt REAL, DIMENSION(D%NIJT,D%NKT,KSV), INTENT(IN) :: PSVM ! scalar variable a t-dt @@ -73,7 +71,7 @@ REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT):: PDTHLDT_MF ! tendency of thl b REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT):: PDRTDT_MF ! tendency of rt by massflux scheme REAL, DIMENSION(D%NIJT,D%NKT,KSV), INTENT(OUT):: PDSVDT_MF ! tendency of Sv by massflux scheme -REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PSIGMF,PRC_MF,PRI_MF,PCF_MF ! cloud info for the cloud scheme +REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PSIGMF,PRC_MF,PRI_MF,PCF_MF ! cloud info for the cloud scheme REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PFLXZTHVMF ! Thermal production for TKE scheme REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PFLXZTHMF REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PFLXZRMF @@ -81,7 +79,7 @@ REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PFLXZUMF REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PFLXZVMF REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PTHL_UP ! Thl updraft characteristics REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PRT_UP ! Rt updraft characteristics -REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PRV_UP ! Vapor updraft characteristics +REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PRV_UP ! Vapor updraft characteristics REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PU_UP ! U wind updraft characteristics REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PV_UP ! V wind updraft characteristics REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PRC_UP ! cloud content updraft characteristics @@ -93,12 +91,12 @@ REAL, DIMENSION(D%NIJT,D%NKT), INTENT(INOUT) :: PEMF ! updraft mass flux REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PDETR ! updraft detrainment REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT) :: PENTR ! updraft entrainment INTEGER,DIMENSION(D%NIJT), INTENT(OUT) :: KKLCL,KKETL,KKCTL ! level of LCL,ETL and CTL -REAL, INTENT(IN) :: PDX, PDY +REAL, INTENT(IN) :: PDX, PDY REAL, DIMENSION(D%NIJT,D%NKT,KSV), INTENT(IN),OPTIONAL :: PRSVS ! sources of sv (for Budgets with lagrangian tracer) TYPE(TBUDGETCONF_t), INTENT(IN),OPTIONAL :: BUCONF ! budget structure INTEGER, INTENT(IN) :: KBUDGETS ! option. because not used in arpifs TYPE(TBUDGETDATA), DIMENSION(KBUDGETS), INTENT(INOUT),OPTIONAL :: TBUDGETS -REAL,DIMENSION(JPSVMAX),INTENT(IN),OPTIONAL :: PSVMIN ! minimum value for SV variables +REAL,DIMENSION(JPSVMAX),INTENT(IN),OPTIONAL :: PSVMIN ! minimum value for SV variables (for Budgets) END SUBROUTINE SHALLOW_MF diff --git a/src/common/turb/modi_turb.F90 b/src/common/turb/modi_turb.F90 index 747f10538154c6456a3824f929eff22814de4330..fe6c1c9f5379b3ccd6350ea725a1413f1e561a82 100644 --- a/src/common/turb/modi_turb.F90 +++ b/src/common/turb/modi_turb.F90 @@ -4,7 +4,7 @@ ! INTERFACE ! - SUBROUTINE TURB(CST,CSTURB,BUCONF,TURBN,D,TLES, & + SUBROUTINE TURB(CST,CSTURB,BUCONF,TURBN,NEBN,D,TLES, & & KMI,KRR,KRRL,KRRI,HLBCX,HLBCY,KGRADIENTS,KHALO, & & KSPLIT,KMODEL_CL,KSV,KSV_LGBEG,KSV_LGEND,HPROGRAM, & & KSV_LIMA_NR, KSV_LIMA_NS, KSV_LIMA_NG, KSV_LIMA_NH, & @@ -38,6 +38,7 @@ USE MODD_IO, ONLY : TFILEDATA USE MODD_CST, ONLY: CST_t USE MODD_CTURB, ONLY: CSTURB_t USE MODD_TURB_n, ONLY: TURB_t +USE MODD_NEB_n, ONLY: NEB_t USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_LES, ONLY: TLES_t ! @@ -46,7 +47,8 @@ TYPE(CST_t), INTENT(IN) :: CST ! modd_cst general constan TYPE(CSTURB_t), INTENT(IN) :: CSTURB ! modd_csturb turb constant structure TYPE(TBUDGETCONF_t), INTENT(IN) :: BUCONF ! budget structure TYPE(TURB_t), INTENT(IN) :: TURBN ! modn_turbn (turb namelist) structure -TYPE(TLES_t), INTENT(IN) :: TLES ! modd_les structure +TYPE(NEB_t), INTENT(IN) :: NEBN ! modd_nebn structure +TYPE(TLES_t), INTENT(INOUT) :: TLES ! modd_les structure INTEGER, INTENT(IN) :: KGRADIENTS ! Number of stored horizontal gradients INTEGER, INTENT(IN) :: KMI ! model index number INTEGER, INTENT(IN) :: KRR ! number of moist var. @@ -178,8 +180,8 @@ REAL, DIMENSION(D%NIJT), INTENT(IN),OPTIONAL :: PSSVFL_C ! REAL, DIMENSION(D%NIJT), INTENT(IN),OPTIONAL :: PSSUFL REAL, DIMENSION(D%NIJT), INTENT(IN),OPTIONAL :: PSSVFL ! ! -REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN), OPTIONAL :: PIBM_XMUT ! IBM turbulent viscosity -REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN), OPTIONAL :: PIBM_LS ! IBM Level-set function +REAL, DIMENSION(D%NIJT,D%NKT), INTENT(OUT), OPTIONAL :: PIBM_XMUT ! IBM turbulent viscosity +REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN), OPTIONAL :: PIBM_LS ! IBM Level-set function ! !------------------------------------------------------------------------------- ! diff --git a/src/common/turb/shallow_mf.F90 b/src/common/turb/shallow_mf.F90 index 0eaa8b4056af502c876fde0cc385a7c7f277c8ec..a45803ce867d058edf1d6b205c3c2ff05d0a79c4 100644 --- a/src/common/turb/shallow_mf.F90 +++ b/src/common/turb/shallow_mf.F90 @@ -3,11 +3,11 @@ !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt !MNH_LIC for details. version 1. !----------------------------------------------------------------- -! ################################################################ - SUBROUTINE SHALLOW_MF(D, CST, NEB, PARAMMF, TURBN, CSTURB, & +! ################################################################# + SUBROUTINE SHALLOW_MF(D, CST, NEBN, PARAMMF, TURBN, CSTURB, & KRR, KRRL, KRRI, KSV, & - HFRAC_ICE,ONOMIXLG,KSV_LGBEG,KSV_LGEND, & - PIMPL_MF, PTSTEP, & + ONOMIXLG,KSV_LGBEG,KSV_LGEND, & + PTSTEP, & PDZZ, PZZ, & PRHODJ, PRHODREF, & PPABSM, PEXNM, & @@ -22,7 +22,6 @@ PFRAC_UP,PEMF,PDETR,PENTR, & KKLCL,KKETL,KKCTL,PDX,PDY,PRSVS,PSVMIN, & BUCONF, TBUDGETS, KBUDGETS ) - ! ################################################################# !! !!**** *SHALLOW_MF* - @@ -80,7 +79,7 @@ USE MODD_BUDGET, ONLY: TBUDGETCONF_t, TBUDGETDATA, NBUDGET_U, NBUDGET_ NBUDGET_TH, NBUDGET_RV, NBUDGET_SV1 USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t USE MODD_CST, ONLY: CST_t -USE MODD_NEB, ONLY: NEB_t +USE MODD_NEB_n, ONLY: NEB_t USE MODD_PARAM_MFSHALL_n, ONLY: PARAM_MFSHALL_t USE MODD_TURB_n, ONLY: TURB_t USE MODD_CTURB, ONLY: CSTURB_t @@ -104,7 +103,7 @@ IMPLICIT NONE ! TYPE(DIMPHYEX_t), INTENT(IN) :: D ! PHYEX variables dimensions structure TYPE(CST_t), INTENT(IN) :: CST ! modd_cst general constant structure -TYPE(NEB_t), INTENT(IN) :: NEB +TYPE(NEB_t), INTENT(IN) :: NEBN TYPE(PARAM_MFSHALL_t), INTENT(IN) :: PARAMMF TYPE(TURB_t), INTENT(IN) :: TURBN ! modn_turbn (turb namelist) structure TYPE(CSTURB_t), INTENT(IN) :: CSTURB ! modd_csturb turb constant structure @@ -112,11 +111,9 @@ 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. INTEGER, INTENT(IN) :: KSV ! number of scalar var. -CHARACTER(LEN=1), INTENT(IN) :: HFRAC_ICE ! partition liquid/ice scheme LOGICAL, INTENT(IN) :: ONOMIXLG ! False if mixing of lagrangian tracer INTEGER, INTENT(IN) :: KSV_LGBEG ! first index of lag. tracer INTEGER, INTENT(IN) :: KSV_LGEND ! last index of lag. tracer -REAL, INTENT(IN) :: PIMPL_MF ! degre of implicitness REAL, INTENT(IN) :: PTSTEP ! Dynamical timestep REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PZZ ! Height of flux point REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PDZZ ! Metric coefficients @@ -221,7 +218,7 @@ ENDIF !$mnh_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ZWK(IIJB:IIJE,1:IKT)=PTHM(IIJB:IIJE,1:IKT)*PEXNM(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) -CALL COMPUTE_FRAC_ICE(HFRAC_ICE,NEB,ZFRAC_ICE(:,:),ZWK(:,:), IERR(:,:)) +CALL COMPUTE_FRAC_ICE(NEBN%CFRAC_ICE_SHALLOW_MF,NEBN,ZFRAC_ICE(:,:),ZWK(:,:), IERR(:,:)) ! Conservative variables at t-dt CALL THL_RT_FROM_TH_R_MF(D, CST, KRR,KRRL,KRRI, & @@ -239,8 +236,8 @@ ZTHVM(IIJB:IIJE,1:IKT) = PTHM(IIJB:IIJE,1:IKT)*& ! IF (PARAMMF%CMF_UPDRAFT == 'EDKF') THEN GENTR_DETR = .TRUE. - CALL COMPUTE_UPDRAFT(D, CST, NEB, PARAMMF, TURBN, CSTURB, & - KSV, HFRAC_ICE, GENTR_DETR, & + CALL COMPUTE_UPDRAFT(D, CST, NEBN, PARAMMF, TURBN, CSTURB, & + KSV, GENTR_DETR, & ONOMIXLG,KSV_LGBEG,KSV_LGEND, & PZZ,PDZZ, & PSFTH,PSFRV,PPABSM,PRHODREF, & @@ -253,8 +250,8 @@ IF (PARAMMF%CMF_UPDRAFT == 'EDKF') THEN PDX,PDY) ELSEIF (PARAMMF%CMF_UPDRAFT == 'RHCJ') THEN GENTR_DETR = .TRUE. - CALL COMPUTE_UPDRAFT_RHCJ10(D, CST, NEB, PARAMMF, TURBN, CSTURB,& - KSV, HFRAC_ICE, GENTR_DETR, & + CALL COMPUTE_UPDRAFT_RHCJ10(D, CST, NEBN, PARAMMF, TURBN, CSTURB,& + KSV, GENTR_DETR, & ONOMIXLG,KSV_LGBEG,KSV_LGEND, & PZZ,PDZZ, & PSFTH,PSFRV,PPABSM,PRHODREF, & @@ -265,8 +262,8 @@ ELSEIF (PARAMMF%CMF_UPDRAFT == 'RHCJ') THEN PFRAC_UP,ZFRAC_ICE_UP,ZRSAT_UP,PEMF,PDETR,& PENTR,ZBUO_INTEG,KKLCL,KKETL,KKCTL,ZDEPTH ) ELSEIF (PARAMMF%CMF_UPDRAFT == 'RAHA') THEN - CALL COMPUTE_UPDRAFT_RAHA(D, CST, NEB, PARAMMF, & - KSV, HFRAC_ICE, GENTR_DETR, & + CALL COMPUTE_UPDRAFT_RAHA(D, CST, NEBN, PARAMMF, & + KSV, GENTR_DETR, & ONOMIXLG,KSV_LGBEG,KSV_LGEND, & PZZ,PDZZ, & PSFTH,PSFRV, & @@ -288,7 +285,7 @@ ENDIF !!! 5. Compute diagnostic convective cloud fraction and content !!! -------------------------------------------------------- ! -CALL COMPUTE_MF_CLOUD(D,CST,CSTURB,PARAMMF,TURBN%LSTATNW,& +CALL COMPUTE_MF_CLOUD(D,CST,TURBN,PARAMMF,NEBN%LSTATNW, & KRR, KRRL, KRRI, & ZFRAC_ICE, & PRC_UP,PRI_UP,PEMF, & @@ -308,10 +305,10 @@ CALL COMPUTE_MF_CLOUD(D,CST,CSTURB,PARAMMF,TURBN%LSTATNW,& ZEMF_O_RHODREF(IIJB:IIJE,1:IKT)=PEMF(IIJB:IIJE,1:IKT)/PRHODREF(IIJB:IIJE,1:IKT) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) -IF ( PIMPL_MF > 1.E-10 ) THEN +IF ( PARAMMF%XIMPL_MF > 1.E-10 ) THEN CALL MF_TURB(D, KSV, PARAMMF%LMIXUV, & ONOMIXLG,KSV_LGBEG,KSV_LGEND, & - PIMPL_MF, PTSTEP, & + PARAMMF%XIMPL_MF, PTSTEP, & PDZZ, & PRHODJ, & ZTHLM,ZTHVM,ZRTM,PUM,PVM,PSVM, & diff --git a/src/common/turb/th_r_from_thl_rt.func.h b/src/common/turb/th_r_from_thl_rt.func.h index 5a571b688d6ca46c05818bd43cc87947491f043a..eec2bdc634a3029c78818e0bd5e8d3ab5f155638 100644 --- a/src/common/turb/th_r_from_thl_rt.func.h +++ b/src/common/turb/th_r_from_thl_rt.func.h @@ -2,7 +2,7 @@ !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. - SUBROUTINE TH_R_FROM_THL_RT(CST, NEB, KT, HFRAC_ICE,PFRAC_ICE,PP, & + SUBROUTINE TH_R_FROM_THL_RT(CST, NEBN, KT, HFRAC_ICE,PFRAC_ICE,PP, & PTHL, PRT, PTH, PRV, PRL, PRI, & PRSATW, PRSATI, PRR, PRS, PRG, PRH, OOCEAN,& PBUF, KB, KE) @@ -50,7 +50,7 @@ ! ------------ ! USE MODD_CST, ONLY : CST_t -USE MODD_NEB, ONLY : NEB_t +USE MODD_NEB_n, ONLY : NEB_t ! IMPLICIT NONE ! @@ -58,7 +58,7 @@ IMPLICIT NONE !* 0.1 declarations of arguments ! TYPE(CST_t), INTENT(IN) :: CST -TYPE(NEB_t), INTENT(IN) :: NEB +TYPE(NEB_t), INTENT(IN) :: NEBN INTEGER, INTENT(IN) :: KT CHARACTER(LEN=1), INTENT(IN) :: HFRAC_ICE LOGICAL, INTENT(IN) :: OOCEAN ! switch for Ocean model version @@ -139,7 +139,7 @@ DO II=1,JITER PFRAC_ICE(J) = PRI(J) / (PRL(J)+PRI(J)) ENDIF ENDDO - CALL COMPUTE_FRAC_ICE(HFRAC_ICE,NEB,PFRAC_ICE(IB:IE),PBUF(IB:IE, IT)) + CALL COMPUTE_FRAC_ICE(HFRAC_ICE,NEBN,PFRAC_ICE(IB:IE),PBUF(IB:IE, IT)) !Computation of Rvsat and dRsat/dT !In this version QSAT, QSATI, DQSAT and DQASATI functions are not used diff --git a/src/common/turb/turb.F90 b/src/common/turb/turb.F90 index 3cf7afa999a48d7087cbd67d7c483183f9ed3804..7d6a6ecbccd37841b2eb70a625b7e73ed764fe10 100644 --- a/src/common/turb/turb.F90 +++ b/src/common/turb/turb.F90 @@ -3,7 +3,7 @@ !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt !MNH_LIC for details. version 1. !----------------------------------------------------------------- - SUBROUTINE TURB(CST,CSTURB,BUCONF,TURBN,D,TLES, & + SUBROUTINE TURB(CST,CSTURB,BUCONF,TURBN,NEBN,D,TLES, & & KMI,KRR,KRRL,KRRI,HLBCX,HLBCY,KGRADIENTS,KHALO, & & KSPLIT,KMODEL_CL,KSV,KSV_LGBEG,KSV_LGEND,HPROGRAM, & & KSV_LIMA_NR, KSV_LIMA_NS, KSV_LIMA_NG, KSV_LIMA_NH, & @@ -254,6 +254,7 @@ USE MODD_IO, ONLY: TFILEDATA USE MODD_LES, ONLY: TLES_t USE MODD_PARAMETERS, ONLY: JPVEXT_TURB, XUNDEF USE MODD_TURB_n, ONLY: TURB_t +USE MODD_NEB_n, ONLY: NEB_t ! USE MODE_BL89, ONLY: BL89 USE MODE_BUDGET_PHY, ONLY: BUDGET_STORE_INIT_PHY, BUDGET_STORE_END_PHY @@ -290,6 +291,7 @@ TYPE(CST_t), INTENT(IN) :: CST ! modd_cst general constan TYPE(CSTURB_t), INTENT(IN) :: CSTURB ! modd_csturb turb constant structure TYPE(TBUDGETCONF_t), INTENT(IN) :: BUCONF ! budget structure TYPE(TURB_t), INTENT(IN) :: TURBN ! modn_turbn (turb namelist) structure +TYPE(NEB_t), INTENT(IN) :: NEBN ! modd_nebn structure TYPE(TLES_t), INTENT(INOUT) :: TLES ! modd_les structure INTEGER, INTENT(IN) :: KGRADIENTS ! Number of stored horizontal gradients INTEGER, INTENT(IN) :: KMI ! model index number @@ -301,6 +303,7 @@ INTEGER, INTENT(IN) :: KSV_LIMA_NR,KSV_LIMA_NS,KSV_LIMA_NG,KSV_ CHARACTER(LEN=4),DIMENSION(2),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 +INTEGER, INTENT(IN) :: KHALO ! Size of the halo for parallel distribution LOGICAL, INTENT(IN) :: OCOMPUTE_SRC ! flag to define dimensions of SIGS and SRCT variables LOGICAL, INTENT(IN) :: OOCEAN ! switch for Ocean model version LOGICAL, INTENT(IN) :: ODEEPOC ! activates sfc forcing for ideal ocean deep conv @@ -312,8 +315,6 @@ LOGICAL, INTENT(IN) :: ODIAG_IN_RUN ! switch to activate onlin LOGICAL, INTENT(IN) :: OIBM ! switch to modity mixing length near building with IBM CHARACTER(LEN=4), INTENT(IN) :: HTURBLEN_CL ! kind of cloud mixing length CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! Kind of microphysical scheme -INTEGER, INTENT(IN) :: KHALO ! Size of the halo for parallel distribution - REAL, INTENT(IN) :: PRSNOW ! Ratio for diffusion coeff. scalar (blowing snow) REAL, INTENT(IN) :: PTSTEP ! timestep TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file @@ -333,6 +334,7 @@ REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PRHODJ ! dry density * Gri REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: MFMOIST ! moist mass flux dual scheme REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PTHVREF ! Virtual Potential ! Temperature of the reference state +REAL, DIMENSION(D%NIJT,D%NKT,KGRADIENTS), INTENT(IN) :: PHGRAD ! horizontal gradients ! REAL, DIMENSION(D%NIJT), INTENT(IN) :: PSFTH,PSFRV, & ! normal surface fluxes of theta and Rv @@ -340,7 +342,6 @@ REAL, DIMENSION(D%NIJT), INTENT(IN) :: PSFTH,PSFRV, & ! normal surface fluxes of (u,v) parallel to the orography REAL, DIMENSION(D%NIJT,KSV), INTENT(IN) :: PSFSV ! normal surface fluxes of Scalar var. -REAL, DIMENSION(D%NIJT,D%NKT,KGRADIENTS), INTENT(IN) :: PHGRAD ! horizontal gradients ! ! prognostic variables at t- deltat REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PPABST ! Pressure at time t @@ -600,7 +601,7 @@ IF (KRRL >=1) THEN !* 2.5 Lv/Cph/Exn ! IF ( KRRI >= 1 ) THEN - IF (TURBN%LSTATNW) THEN + IF (NEBN%LSTATNW) THEN !wc call new functions depending on statnew CALL COMPUTE_FUNCTION_THERMO_NEW_STAT(CST%XALPW,CST%XBETAW,CST%XGAMW,CST%XLVTT,CST%XCL,ZT,ZEXN,ZCP, & ZLVOCPEXNM,ZAMOIST,ZATHETA) @@ -630,7 +631,7 @@ IF (KRRL >=1) THEN !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) ELSE !wc call new stat functions or not - IF (TURBN%LSTATNW) THEN + IF (NEBN%LSTATNW) THEN CALL COMPUTE_FUNCTION_THERMO_NEW_STAT(CST%XALPW,CST%XBETAW,CST%XGAMW,CST%XLVTT,CST%XCL,ZT,ZEXN,ZCP, & ZLOCPEXNM,ZAMOIST,ZATHETA) ELSE @@ -727,7 +728,7 @@ SELECT CASE (TURBN%CTURBLEN) CASE ('BL89') ZSHEAR(:,:)=0. - CALL BL89(D,CST,CSTURB,PZZ,PDZZ,PTHVREF,ZTHLM,KRR,ZRM,PTKET,ZSHEAR,ZLM,OOCEAN,HPROGRAM) + CALL BL89(D,CST,CSTURB,TURBN,PZZ,PDZZ,PTHVREF,ZTHLM,KRR,ZRM,PTKET,ZSHEAR,ZLM,OOCEAN,HPROGRAM) ! !* 3.2 RM17 mixing length ! ------------------ @@ -745,7 +746,7 @@ SELECT CASE (TURBN%CTURBLEN) ZSHEAR(IIJB:IIJE,1:IKT) = SQRT(ZDUDZ(IIJB:IIJE,1:IKT)*ZDUDZ(IIJB:IIJE,1:IKT) & + ZDVDZ(IIJB:IIJE,1:IKT)*ZDVDZ(IIJB:IIJE,1:IKT)) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - CALL BL89(D,CST,CSTURB,PZZ,PDZZ,PTHVREF,ZTHLM,KRR,ZRM,PTKET,ZSHEAR,ZLM,OOCEAN,HPROGRAM) + CALL BL89(D,CST,CSTURB,TURBN,PZZ,PDZZ,PTHVREF,ZTHLM,KRR,ZRM,PTKET,ZSHEAR,ZLM,OOCEAN,HPROGRAM) ! !* 3.3 Grey-zone combined RM17 & Deardorff mixing lengths ! -------------------------------------------------- @@ -763,7 +764,7 @@ SELECT CASE (TURBN%CTURBLEN) ZSHEAR(IIJB:IIJE,1:IKT) = SQRT(ZDUDZ(IIJB:IIJE,1:IKT)*ZDUDZ(IIJB:IIJE,1:IKT) & + ZDVDZ(IIJB:IIJE,1:IKT)*ZDVDZ(IIJB:IIJE,1:IKT)) !$mnh_end_expand_array(JIJ=IIJB:IIJE,JK=1:IKT) - CALL BL89(D,CST,CSTURB,PZZ,PDZZ,PTHVREF,ZTHLM,KRR,ZRM,PTKET,ZSHEAR,ZLM,OOCEAN,HPROGRAM) + CALL BL89(D,CST,CSTURB,TURBN,PZZ,PDZZ,PTHVREF,ZTHLM,KRR,ZRM,PTKET,ZSHEAR,ZLM,OOCEAN,HPROGRAM) CALL DELT(ZLMW,ODZ=.FALSE.) ! The minimum mixing length is chosen between Horizontal grid mesh (not taking into account the vertical grid mesh) and RM17. @@ -850,7 +851,7 @@ IF (TURBN%LRMC01) THEN ZSFRV(:)=0. CALL LMO(D,CST,ZUSTAR,ZTHLM(:,IKB),ZRVM,PSFTH,ZSFRV,ZLMO) END IF - CALL RMC01(D,CST,CSTURB,TURBN%CTURBLEN,PZZ,PDXX,PDYY,PDZZ,PDIRCOSZW,PSBL_DEPTH,ZLMO,ZLM,ZLEPS) + CALL RMC01(D,CST,CSTURB,TURBN,PZZ,PDXX,PDYY,PDZZ,PDIRCOSZW,PSBL_DEPTH,ZLMO,ZLM,ZLEPS) END IF ! !RMC01 is only applied on RM17 in HM21 @@ -1003,7 +1004,7 @@ IF( BUCONF%LBUDGET_SV ) THEN END DO END IF -CALL TURB_VER(D,CST,CSTURB,TURBN,TLES, & +CALL TURB_VER(D,CST,CSTURB,TURBN,NEBN,TLES, & KRR,KRRL,KRRI,KGRADIENTS, & OOCEAN, ODEEPOC, OCOMPUTE_SRC, & KSV,KSV_LGBEG,KSV_LGEND, & @@ -1108,7 +1109,7 @@ IF( TURBN%CTURBDIM == '3DIM' ) THEN !à supprimer une fois le précédent ifdef REPRO48 validé #ifdef REPRO48 #else - CALL TURB_HOR_SPLT(D,CST,CSTURB, TURBN, TLES, & + CALL TURB_HOR_SPLT(D,CST,CSTURB, TURBN, NEBN, TLES, & KSPLIT, KRR, KRRL, KRRI, KSV,KSV_LGBEG,KSV_LGEND, & PTSTEP,HLBCX,HLBCY, OFLAT,O2D, ONOMIXLG, & OOCEAN,OCOMPUTE_SRC,OBLOWSNOW,PRSNOW, & @@ -1211,7 +1212,7 @@ ELSE END IF ! CALL TKE_EPS_SOURCES(D,CST,CSTURB,BUCONF,TURBN,TLES,HPROGRAM, & - & KMI,PTKET,ZLM,ZLEPS,PDP,ZTRH, & + & PTKET,ZLM,ZLEPS,PDP,ZTRH, & & PRHODJ,PDZZ,PDXX,PDYY,PDZX,PDZY,PZZ, & & PTSTEP,ZEXPL, & & TPFILE,ODIAG_IN_RUN,OOCEAN, & @@ -1958,7 +1959,7 @@ ELSE ! ------------------ CASE ('BL89','RM17','HM21') ZSHEAR(:,:)=0. - CALL BL89(D,CST,CSTURB,PZZ,PDZZ,PTHVREF,ZTHLM,KRR,ZRM,PTKET,ZSHEAR,ZLM_CLOUD,OOCEAN,HPROGRAM) + CALL BL89(D,CST,CSTURB,TURBN,PZZ,PDZZ,PTHVREF,ZTHLM,KRR,ZRM,PTKET,ZSHEAR,ZLM_CLOUD,OOCEAN,HPROGRAM) ! !* 3.2 Delta mixing length ! ------------------- diff --git a/src/mesonh/aux/mode_posnam_phy.F90 b/src/mesonh/aux/mode_posnam_phy.F90 new file mode 100644 index 0000000000000000000000000000000000000000..692ade32693b100f3b984d76bf0d0acc487cb84d --- /dev/null +++ b/src/mesonh/aux/mode_posnam_phy.F90 @@ -0,0 +1,26 @@ +MODULE MODE_POSNAM_PHY +IMPLICIT NONE +PRIVATE +PUBLIC :: POSNAM_PHY +CONTAINS +SUBROUTINE POSNAM_PHY(KULNAM, CDNAML, LDNEEDNAM, LDFOUND, KLUOUT) + +!Wrapper to call the Meso-NH version of posnam + +USE MODE_MSG, ONLY: NVERB_FATAL, PRINT_MSG +USE MODE_POS, ONLY: POSNAM + +IMPLICIT NONE + +INTEGER, INTENT(IN) :: KULNAM !< Logical unit to access the namelist +CHARACTER(LEN=*), INTENT(IN) :: CDNAML !< Namelist name +LOGICAL, INTENT(IN) :: LDNEEDNAM !< True to abort if namelist is absent +LOGICAL, INTENT(OUT) :: LDFOUND !< True if namelist has been found +INTEGER, INTENT(IN) :: KLUOUT !< Logical unit for output + +CALL POSNAM(KULNAM, CDNAML, LDFOUND, KLUOUT) +IF(LDNEEDNAM .AND. .NOT. LDFOUND) CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'POSNAM_PHY', 'CANNOT LOCATE '//CDNAML) + +END SUBROUTINE POSNAM_PHY + +END MODULE MODE_POSNAM_PHY diff --git a/src/mesonh/ext/advection_metsv.f90 b/src/mesonh/ext/advection_metsv.f90 new file mode 100644 index 0000000000000000000000000000000000000000..b3d451f5621a45c08d84d751b127ecbb4aa8cdfb --- /dev/null +++ b/src/mesonh/ext/advection_metsv.f90 @@ -0,0 +1,713 @@ +!MNH_LIC Copyright 1994-2021 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_ADVECTION_METSV +! ########################### +! +INTERFACE + SUBROUTINE ADVECTION_METSV (TPFILE, HUVW_ADV_SCHEME, & + HMET_ADV_SCHEME,HSV_ADV_SCHEME, HCLOUD, KSPLIT, & + OSPLIT_CFL, PSPLIT_CFL, OCFL_WRIT, & + HLBCX, HLBCY, KRR, KSV, TPDTCUR, PTSTEP, & + PUT, PVT, PWT, PTHT, PRT, PTKET, PSVT, PPABST, & + PTHVREF, PRHODJ, PDXX, PDYY, PDZZ, PDZX, PDZY, & + PRTHS, PRRS, PRTKES, PRSVS, & + PRTHS_CLD, PRRS_CLD, PRSVS_CLD, PRTKES_ADV ) +! +USE MODD_IO, ONLY: TFILEDATA +USE MODD_TYPE_DATE, ONLY: DATE_TIME +! +TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file +CHARACTER(LEN=6), INTENT(IN) :: HMET_ADV_SCHEME, & ! Control of the + HSV_ADV_SCHEME, & ! scheme applied + HUVW_ADV_SCHEME +CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! Kind of cloud parameterization +! +INTEGER, INTENT(INOUT):: KSPLIT ! Number of time splitting + ! for PPM advection +LOGICAL, INTENT(IN) :: OSPLIT_CFL ! flag to automatically chose number of iterations +REAL, INTENT(IN) :: PSPLIT_CFL ! maximum CFL to automatically chose number of iterations +LOGICAL, INTENT(IN) :: OCFL_WRIT ! flag to write CFL fields in output files +! +CHARACTER(LEN=4),DIMENSION(2),INTENT(IN):: HLBCX, HLBCY ! X- and Y-direc LBC +! +INTEGER, INTENT(IN) :: KRR ! Number of moist variables +INTEGER, INTENT(IN) :: KSV ! Number of Scalar Variables +! +TYPE (DATE_TIME), INTENT(IN) :: TPDTCUR ! current date and time +REAL, INTENT(IN) :: PTSTEP +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PUT , PVT , PWT +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHT, PTKET, PRHODJ +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABST +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRT , PSVT + ! Variables at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! Virtual Temperature + ! of the reference state +REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX,PDYY,PDZZ,PDZX,PDZY + ! metric coefficients +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRTHS, PRTKES +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRS , PRSVS + ! Sources terms +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRTHS_CLD +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRRS_CLD,PRSVS_CLD +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PRTKES_ADV ! Advection TKE source term +! +END SUBROUTINE ADVECTION_METSV +! +END INTERFACE +! +END MODULE MODI_ADVECTION_METSV +! ########################################################################## + SUBROUTINE ADVECTION_METSV (TPFILE, HUVW_ADV_SCHEME, & + HMET_ADV_SCHEME,HSV_ADV_SCHEME, HCLOUD, KSPLIT, & + OSPLIT_CFL, PSPLIT_CFL, OCFL_WRIT, & + HLBCX, HLBCY, KRR, KSV, TPDTCUR, PTSTEP, & + PUT, PVT, PWT, PTHT, PRT, PTKET, PSVT, PPABST, & + PTHVREF, PRHODJ, PDXX, PDYY, PDZZ, PDZX, PDZY, & + PRTHS, PRRS, PRTKES, PRSVS, & + PRTHS_CLD, PRRS_CLD, PRSVS_CLD, PRTKES_ADV ) +! ########################################################################## +! +!!**** *ADVECTION_METSV * - routine to call the specialized advection routines +!! +!! PURPOSE +!! ------- +!! The purpose of this routine is to control the advection routines. +!! For that, it is first necessary to compute the metric coefficients +!! and the contravariant components of the momentum. +!! +!!** METHOD +!! ------ +!! Once the scheme is selected, it is applied to the following group of +!! variables: METeorologicals (temperature, water substances, TKE, +!! dissipation TKE) and Scalar Variables. It is possible to select different +!! advection schemes for each group of variables. +!! +!! EXTERNAL +!! -------- +!! CONTRAV : computes the contravariant components. +!! ADVECUVW : computes the advection terms for momentum. +!! ADVECSCALAR : computes the advection terms for scalar fields. +!! ADD3DFIELD_ll : add a field to 3D-list +!! ADVEC_4TH_ORDER : 4th order advection scheme +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! NONE +!! +!! REFERENCE +!! --------- +!! Book1 and book2 ( routine ADVECTION ) +!! +!! AUTHOR +!! ------ +!! J.-P. Pinty * Laboratoire d'Aerologie* +!! J.-P. Lafore * Meteo France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 06/07/94 +!! 01/04/95 (Ph. Hereil J. Nicolau) add the model number +!! 23/10/95 (J. Vila and JP Lafore) advection schemes scalar +!! 16/01/97 (JP Pinty) change presentation +!! 30/04/98 (J. Stein P Jabouille) extrapolation for the cyclic +!! case and parallelisation +!! 24/06/99 (P Jabouille) case of NHALO>1 +!! 25/10/05 (JP Pinty) 4th order scheme +!! 24/04/06 (C.Lac) Split scalar and passive +!! tracer routines +!! 08/06 (T.Maric) PPM scheme +!! 04/2011 (V.Masson & C. Lac) splits the routine and add time splitting +!! 04/2014 (C.Lac) adaptation of time +!! splitting for L1D and L2D +!! 09/2014 (G.Delautier) close OUTPUT_LISTING before STOP +!! 04/2015 (J.Escobar) remove/commente some NHALO=1 test +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! J.Escobar : 01/10/2015 : add computation of CFL for L1D case +!! 04/2016 (C.Lac) : correction of negativity for KHKO +!! 10/2016 (C.Lac) Correction on the flag for Strang splitting +!! to insure reproducibility between START and RESTA +! V. Vionnet 07/2017: add advection of 2D variables at the surface for the blowing snow scheme +! P. Wautelet 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 02/2020: use the new data structures and subroutines for budgets +! B. Vie 03/2020: LIMA negativity checks after turbulence, advection and microphysics budgets +! P. Wautelet 20/05/2019: add name argument to ADDnFIELD_ll + new ADD4DFIELD_ll subroutine +! P. Wautelet 11/06/2020: bugfix: correct PRSVS array indices +! P. Wautelet + Benoît Vié 06/2020: improve removal of negative scalar variables + adapt the corresponding budgets +! P. Wautelet 30/06/2020: move removal of negative scalar variables to Sources_neg_correct +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +use modd_budget, only: lbudget_th, lbudget_tke, lbudget_rv, lbudget_rc, & + lbudget_rr, lbudget_ri, lbudget_rs, lbudget_rg, lbudget_rh, lbudget_sv, & + NBUDGET_TH, NBUDGET_TKE, NBUDGET_RV, NBUDGET_RC, & + NBUDGET_RR, NBUDGET_RI, NBUDGET_RS, NBUDGET_RG, NBUDGET_RH, NBUDGET_SV1, & + tbudgets +USE MODD_CST +USE MODD_TURB_n, ONLY: XTKEMIN +USE MODD_CONF, ONLY: LNEUTRAL,NHALO,L1D, L2D +use modd_field, only: tfielddata, TYPEREAL +USE MODD_IBM_PARAM_n, ONLY: LIBM,XIBM_LS,XIBM_EPSI +USE MODD_IO, ONLY: TFILEDATA +USE MODD_LUNIT_n, ONLY: TLUOUT +USE MODD_NSV +USE MODD_PARAM_LIMA +USE MODD_PARAM_n +USE MODD_TYPE_DATE, ONLY: DATE_TIME +USE MODD_BLOWSNOW +USE MODD_BLOWSNOW_n +USE MODD_PARAMETERS +USE MODD_REF_n, ONLY: XRHODJ,XRHODREF +! +use mode_budget, only: Budget_store_init, Budget_store_end +USE MODE_IO_FIELD_WRITE, only: IO_Field_write +USE MODE_ll +USE MODE_MSG +use mode_sources_neg_correct, only: Sources_neg_correct +! +USE MODI_ADV_BOUNDARIES +USE MODI_CONTRAV +USE MODI_GET_HALO +USE MODI_PPM_RHODJ +USE MODI_PPM_MET +USE MODI_PPM_SCALAR +! +! +!------------------------------------------------------------------------------- +! +IMPLICIT NONE +! +!* 0.1 Declarations of dummy arguments : +! +TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file +CHARACTER(LEN=6), INTENT(IN) :: HMET_ADV_SCHEME, & ! Control of the + HSV_ADV_SCHEME, & ! scheme applied + HUVW_ADV_SCHEME +CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! Kind of cloud parameterization +! +INTEGER, INTENT(INOUT):: KSPLIT ! Number of time splitting + ! for PPM advection +LOGICAL, INTENT(IN) :: OSPLIT_CFL ! flag to automatically chose number of iterations +REAL, INTENT(IN) :: PSPLIT_CFL ! maximum CFL to automatically chose number of iterations +LOGICAL, INTENT(IN) :: OCFL_WRIT ! flag to write CFL fields in output files +! +CHARACTER(LEN=4),DIMENSION(2),INTENT(IN):: HLBCX, HLBCY ! X- and Y-direc LBC +! +INTEGER, INTENT(IN) :: KRR ! Number of moist variables +INTEGER, INTENT(IN) :: KSV ! Number of Scalar Variables +! +TYPE (DATE_TIME), INTENT(IN) :: TPDTCUR ! current date and time +REAL, INTENT(IN) :: PTSTEP +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PUT , PVT , PWT +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHT, PTKET, PRHODJ +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABST +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRT , PSVT + ! Variables at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! Virtual Temperature + ! of the reference state +REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX,PDYY,PDZZ,PDZX,PDZY + ! metric coefficients +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRTHS, PRTKES +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRS , PRSVS + ! Sources terms +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRTHS_CLD +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRRS_CLD, PRSVS_CLD +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PRTKES_ADV ! Advection TKE source term +! +! +!* 0.2 declarations of local variables +! +! +REAL, DIMENSION(SIZE(PUT,1),SIZE(PUT,2),SIZE(PUT,3)) :: ZRUCPPM +REAL, DIMENSION(SIZE(PUT,1),SIZE(PUT,2),SIZE(PUT,3)) :: ZRVCPPM +REAL, DIMENSION(SIZE(PUT,1),SIZE(PUT,2),SIZE(PUT,3)) :: ZRWCPPM + ! contravariant + ! components + ! of momentum +REAL, DIMENSION(SIZE(PUT,1),SIZE(PUT,2),SIZE(PUT,3)) :: ZCFLU +REAL, DIMENSION(SIZE(PUT,1),SIZE(PUT,2),SIZE(PUT,3)) :: ZCFLV +REAL, DIMENSION(SIZE(PUT,1),SIZE(PUT,2),SIZE(PUT,3)) :: ZCFLW +! ! CFL numbers on each direction +REAL, DIMENSION(SIZE(PUT,1),SIZE(PUT,2),SIZE(PUT,3)) :: ZCFL +! ! CFL number +! +REAL :: ZCFLU_MAX, ZCFLV_MAX, ZCFLW_MAX, ZCFL_MAX ! maximum CFL numbers +! +REAL, DIMENSION(SIZE(PTHT,1), SIZE(PTHT,2), SIZE(PTHT,3) ) :: ZTH +REAL, DIMENSION(SIZE(PTKET,1),SIZE(PTKET,2),SIZE(PTKET,3)) :: ZTKE +REAL, DIMENSION(SIZE(PTHT,1), SIZE(PTHT,2), SIZE(PTHT,3) ) :: ZRTHS_OTHER +REAL, DIMENSION(SIZE(PTKET,1),SIZE(PTKET,2),SIZE(PTKET,3)) :: ZRTKES_OTHER +REAL, DIMENSION(SIZE(PTHT,1), SIZE(PTHT,2), SIZE(PTHT,3) ) :: ZRTHS_PPM +REAL, DIMENSION(SIZE(PTKET,1),SIZE(PTKET,2),SIZE(PTKET,3)) :: ZRTKES_PPM +REAL, DIMENSION(SIZE(PRT,1), SIZE(PRT,2), SIZE(PRT,3), SIZE(PRT,4) ) :: ZR +REAL, DIMENSION(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3),SIZE(PSVT,4)) :: ZSV +REAL, DIMENSION(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3), NBLOWSNOW_2D) :: ZSNWC +REAL, DIMENSION(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3), NBLOWSNOW_2D) :: ZSNWC_INIT +REAL, DIMENSION(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3), NBLOWSNOW_2D) :: ZRSNWCS +! Guess at the sub time step +REAL, DIMENSION(SIZE(PRT,1), SIZE(PRT,2), SIZE(PRT,3), SIZE(PRT,4) ) :: ZRRS_OTHER +REAL, DIMENSION(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3),SIZE(PSVT,4)) :: ZRSVS_OTHER +REAL, DIMENSION(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3),NBLOWSNOW_2D) :: ZRSNWCS_OTHER +! Tendencies since the beginning of the time step +REAL, DIMENSION(SIZE(PRT,1), SIZE(PRT,2), SIZE(PRT,3), SIZE(PRT,4) ) :: ZRRS_PPM +REAL, DIMENSION(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3),SIZE(PSVT,4)) :: ZRSVS_PPM +REAL, DIMENSION(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3),NBLOWSNOW_2D) :: ZRSNWCS_PPM +! Guess at the end of the sub time step +REAL, DIMENSION(SIZE(PUT,1),SIZE(PUT,2),SIZE(PUT,3)) :: ZRHOX1,ZRHOX2 +REAL, DIMENSION(SIZE(PUT,1),SIZE(PUT,2),SIZE(PUT,3)) :: ZRHOY1,ZRHOY2 +REAL, DIMENSION(SIZE(PUT,1),SIZE(PUT,2),SIZE(PUT,3)) :: ZRHOZ1,ZRHOZ2 +REAL, DIMENSION(SIZE(PUT,1),SIZE(PUT,2),SIZE(PUT,3)):: ZT,ZEXN,ZLV,ZLS,ZCPH,ZCOR +! Temporary advected rhodj for PPM routines +! +INTEGER :: JS,JR,JSV,JSPL, JI, JJ ! Loop index +REAL :: ZTSTEP_PPM ! Sub Time step +LOGICAL :: GTKE +! +INTEGER :: IINFO_ll ! return code of parallel routine +TYPE(LIST_ll), POINTER :: TZFIELDS0_ll ! list of fields to exchange +TYPE(LIST_ll), POINTER :: TZFIELDS1_ll ! list of fields to exchange +! +! +INTEGER :: IRESP ! Return code of FM routines +INTEGER :: ILUOUT ! logical unit +INTEGER :: ISPLIT_PPM ! temporal time splitting +INTEGER :: IIB, IIE, IJB, IJE,IKB,IKE +TYPE(TFIELDDATA) :: TZFIELD +!------------------------------------------------------------------------------- +! +!* 0. INITIALIZATION +! -------------- + +GTKE=(SIZE(PTKET)/=0) + +if ( lbudget_th ) call Budget_store_init( tbudgets(NBUDGET_TH ), 'ADV', prths (:, :, :) ) +if ( lbudget_tke ) call Budget_store_init( tbudgets(NBUDGET_TKE), 'ADV', prtkes(:, :, :) ) +if ( lbudget_rv ) call Budget_store_init( tbudgets(NBUDGET_RV ), 'ADV', prrs (:, :, :, 1) ) +if ( lbudget_rc ) call Budget_store_init( tbudgets(NBUDGET_RC ), 'ADV', prrs (:, :, :, 2) ) +if ( lbudget_rr ) call Budget_store_init( tbudgets(NBUDGET_RR ), 'ADV', prrs (:, :, :, 3) ) +if ( lbudget_ri ) call Budget_store_init( tbudgets(NBUDGET_RI ), 'ADV', prrs (:, :, :, 4) ) +if ( lbudget_rs ) call Budget_store_init( tbudgets(NBUDGET_RS ), 'ADV', prrs (:, :, :, 5) ) +if ( lbudget_rg ) call Budget_store_init( tbudgets(NBUDGET_RG ), 'ADV', prrs (:, :, :, 6) ) +if ( lbudget_rh ) call Budget_store_init( tbudgets(NBUDGET_RH ), 'ADV', prrs (:, :, :, 7) ) +if ( lbudget_sv) then + do jsv = 1, ksv + call Budget_store_init( tbudgets(NBUDGET_SV1 - 1 + jsv ), 'ADV', prsvs(:, :, :, jsv) ) + end do +end if + +ILUOUT = TLUOUT%NLU +! +CALL GET_INDICE_ll(IIB,IJB,IIE,IJE) +IKB=1+JPVEXT +IKE=SIZE(PSVT,3) - JPVEXT +! +IF(LBLOWSNOW) THEN ! Put 2D Canopy blowing snow variables into a 3D array for advection + ZSNWC_INIT = 0. + ZRSNWCS = 0. + + DO JSV=1,(NBLOWSNOW_2D) + ZSNWC_INIT(:,:,IKB,JSV) = XSNWCANO(:,:,JSV) + ZRSNWCS(:,:,IKB,JSV) = XRSNWCANOS(:,:,JSV) + END DO +ENDIF +! +! +!------------------------------------------------------------------------------- +! +!* 2. COMPUTES THE CONTRAVARIANT COMPONENTS (FOR PPM ONLY) +! -------------------------------------- +! +!* 2.1 computes contravariant components +! +IF (HUVW_ADV_SCHEME=='CEN2ND' ) THEN + CALL CONTRAV (HLBCX,HLBCY,PUT,PVT,PWT,PDXX,PDYY,PDZZ,PDZX,PDZY,ZRUCPPM,ZRVCPPM,ZRWCPPM,2) +ELSE + CALL CONTRAV (HLBCX,HLBCY,PUT,PVT,PWT,PDXX,PDYY,PDZZ,PDZX,PDZY,ZRUCPPM,ZRVCPPM,ZRWCPPM,4) +END IF +! +! +!* 2.2 computes CFL numbers +! + +IF (.NOT. L1D) THEN + ZCFLU = 0.0 ; ZCFLV = 0.0 ; ZCFLW = 0.0 + ZCFLU(IIB:IIE,IJB:IJE,:) = ABS(ZRUCPPM(IIB:IIE,IJB:IJE,:) * PTSTEP) + ZCFLV(IIB:IIE,IJB:IJE,:) = ABS(ZRVCPPM(IIB:IIE,IJB:IJE,:) * PTSTEP) + ZCFLW(IIB:IIE,IJB:IJE,:) = ABS(ZRWCPPM(IIB:IIE,IJB:IJE,:) * PTSTEP) + IF (LIBM) THEN + ZCFLU(IIB:IIE,IJB:IJE,:) = ZCFLU(IIB:IIE,IJB:IJE,:)*(1.-exp(-(XIBM_LS(IIB:IIE,IJB:IJE,:,2)/& + (XRHODJ(IIB:IIE,IJB:IJE,:)/XRHODREF(IIB:IIE,IJB:IJE,:))**(1./3.))**2.)) + ZCFLV(IIB:IIE,IJB:IJE,:) = ZCFLV(IIB:IIE,IJB:IJE,:)*(1.-exp(-(XIBM_LS(IIB:IIE,IJB:IJE,:,3)/& + (XRHODJ(IIB:IIE,IJB:IJE,:)/XRHODREF(IIB:IIE,IJB:IJE,:))**(1./3.))**2.)) + ZCFLW(IIB:IIE,IJB:IJE,:) = ZCFLW(IIB:IIE,IJB:IJE,:)*(1.-exp(-(XIBM_LS(IIB:IIE,IJB:IJE,:,4)/& + (XRHODJ(IIB:IIE,IJB:IJE,:)/XRHODREF(IIB:IIE,IJB:IJE,:))**(1./3.))**2.)) + WHERE (XIBM_LS(IIB:IIE,IJB:IJE,:,2).GT.(-XIBM_EPSI)) ZCFLU(IIB:IIE,IJB:IJE,:)=0. + WHERE (XIBM_LS(IIB:IIE,IJB:IJE,:,3).GT.(-XIBM_EPSI)) ZCFLV(IIB:IIE,IJB:IJE,:)=0. + WHERE (XIBM_LS(IIB:IIE,IJB:IJE,:,4).GT.(-XIBM_EPSI)) ZCFLW(IIB:IIE,IJB:IJE,:)=0. + ENDIF + IF (.NOT. L2D) THEN + ZCFL = SQRT(ZCFLU**2+ZCFLV**2+ZCFLW**2) + ELSE + ZCFL = SQRT(ZCFLU**2+ZCFLW**2) + END IF +ELSE + ZCFLU = 0.0 ; ZCFLV = 0.0 ; ZCFLW = 0.0 + ZCFLW(IIB:IIE,IJB:IJE,:) = ABS(ZRWCPPM(IIB:IIE,IJB:IJE,:) * PTSTEP) + ZCFL = SQRT(ZCFLW**2) +END IF +! +!* prints in the file the 3D Courant numbers (one should flag this) +! +IF ( tpfile%lopened .AND. OCFL_WRIT .AND. (.NOT. L1D) ) THEN + TZFIELD%CMNHNAME = 'CFLU' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'CFLU' + TZFIELD%CUNITS = '1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_CFLU' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZCFLU) +! + IF (.NOT. L2D) THEN + TZFIELD%CMNHNAME = 'CFLV' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'CFLV' + TZFIELD%CUNITS = '1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_CFLV' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZCFLV) + END IF +! + TZFIELD%CMNHNAME = 'CFLW' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'CFLW' + TZFIELD%CUNITS = '1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_CFLW' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZCFLW) +! + TZFIELD%CMNHNAME = 'CFL' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'CFL' + TZFIELD%CUNITS = '1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_CFL' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZCFL) +END IF +! +!* prints in the output file the maximum CFL +! +ZCFLU_MAX = MAX_ll(ZCFLU,IINFO_ll) +ZCFLV_MAX = MAX_ll(ZCFLV,IINFO_ll) +ZCFLW_MAX = MAX_ll(ZCFLW,IINFO_ll) +ZCFL_MAX = MAX_ll(ZCFL,IINFO_ll) +! +WRITE(ILUOUT,FMT='(A24,F10.2,A5,F10.2,A5,F10.2,A9,F10.2)') & + 'Max. CFL number for U : ',ZCFLU_MAX, & + ' V : ',ZCFLV_MAX,' W : ', ZCFLW_MAX,& + 'global : ',ZCFL_MAX +! +! +!* 2.3 updates time step splitting loop +! +IF (OSPLIT_CFL .AND. (.NOT.L1D) ) THEN +! + ISPLIT_PPM = INT(ZCFL_MAX/PSPLIT_CFL)+1 + IF ( KSPLIT /= ISPLIT_PPM ) & + WRITE(ILUOUT,FMT='(A37,I2,A4,I2,A11)') & + 'PPM time spliting loop changed from ', & + KSPLIT,' to ',ISPLIT_PPM, ' iterations' +! + KSPLIT = ISPLIT_PPM +! +END IF +! --------------------------------------------------------------- +IF (( (ZCFLU_MAX>=3.) .AND. (.NOT.L1D) ) .OR. & + ( (ZCFLV_MAX>=3.) .AND. (.NOT.L1D) .AND. (.NOT.L2D) ) .OR. & + ( (ZCFLW_MAX>=8.) .AND. (.NOT.L1D) ) ) THEN + WRITE(ILUOUT,*) ' ' + WRITE(ILUOUT,*) ' +---------------------------------------------------+' + WRITE(ILUOUT,*) ' | MODEL ERROR |' + WRITE(ILUOUT,*) ' +---------------------------------------------------+' + WRITE(ILUOUT,*) ' | |' + WRITE(ILUOUT,*) ' | The model wind speed becomes too high |' + WRITE(ILUOUT,*) ' | |' + IF ( ZCFLU_MAX>=3. .OR. ZCFLV_MAX>=3. ) & + WRITE(ILUOUT,*) ' | The horizontal CFL value reaches 3. or more |' + IF ( ZCFLW_MAX>=8. ) & + WRITE(ILUOUT,*) ' | The vertical CFL value reaches 8. or more |' + WRITE(ILUOUT,*) ' | |' + WRITE(ILUOUT,*) ' | This can be due either to : |' + WRITE(ILUOUT,*) ' | - a numerical explosion of the model |' + WRITE(ILUOUT,*) ' | - or a too high wind speed for an |' + WRITE(ILUOUT,*) ' | acceptable accuracy of the advection |' + WRITE(ILUOUT,*) ' | |' + WRITE(ILUOUT,*) ' | Please decrease your time-step |' + WRITE(ILUOUT,*) ' | |' + WRITE(ILUOUT,*) ' +---------------------------------------------------+' + WRITE(ILUOUT,*) ' ' + WRITE(ILUOUT,*) ' +---------------------------------------------------+' + WRITE(ILUOUT,*) ' | MODEL STOPS |' + WRITE(ILUOUT,*) ' +---------------------------------------------------+' + CALL PRINT_MSG(NVERB_FATAL,'GEN','ADVECTION_METSV','') +END IF +! +! +ZTSTEP_PPM = PTSTEP / REAL(KSPLIT) +! +! +!* 2.4 normalized contravariant components for split PPM time-step +! +ZRUCPPM = ZRUCPPM*ZTSTEP_PPM +ZRVCPPM = ZRVCPPM*ZTSTEP_PPM +ZRWCPPM = ZRWCPPM*ZTSTEP_PPM +! +! +!------------------------------------------------------------------------------- +! +! +!* 3. COMPUTES THE TENDENCIES SINCE THE BEGINNING OF THE TIME STEP +! ------------------------------------------------------------ +! +!* This represent the effects of all OTHER processes +! Clouds related processes from previous time-step are taken into account in PRTHS_CLD +! Advection related processes from previous time-step will be taken into account in ZRTHS_PPM +! +ZRTHS_OTHER = PRTHS - PTHT * PRHODJ / PTSTEP +IF (GTKE) ZRTKES_OTHER = PRTKES - PTKET * PRHODJ / PTSTEP +DO JR = 1, KRR + ZRRS_OTHER(:,:,:,JR) = PRRS(:,:,:,JR) - PRT(:,:,:,JR) * PRHODJ(:,:,:) / PTSTEP +END DO +DO JSV = 1, KSV + ZRSVS_OTHER(:,:,:,JSV) = PRSVS(:,:,:,JSV) - PSVT(:,:,:,JSV) * PRHODJ / PTSTEP +END DO +IF(LBLOWSNOW) THEN + DO JSV = 1, (NBLOWSNOW_2D) + ZRSNWCS_OTHER(:,:,:,JSV) = ZRSNWCS(:,:,:,JSV) - ZSNWC_INIT(:,:,:,JSV) * PRHODJ / PTSTEP + END DO +ENDIF +! +! Top and bottom Boundaries +! +CALL ADV_BOUNDARIES (HLBCX, HLBCY, ZRTHS_OTHER) +IF (GTKE) CALL ADV_BOUNDARIES (HLBCX, HLBCY, ZRTKES_OTHER) +DO JR = 1, KRR + CALL ADV_BOUNDARIES (HLBCX, HLBCY, ZRRS_OTHER(:,:,:,JR)) +END DO +DO JSV = 1, KSV + CALL ADV_BOUNDARIES (HLBCX, HLBCY, ZRSVS_OTHER(:,:,:,JSV)) +END DO +IF(LBLOWSNOW) THEN + DO JSV = 1, (NBLOWSNOW_2D) + CALL ADV_BOUNDARIES (HLBCX, HLBCY, ZRSNWCS_OTHER(:,:,:,JSV)) + END DO +END IF +! +! Exchanges on processors +! +NULLIFY(TZFIELDS0_ll) +!!$IF(NHALO == 1) THEN + CALL ADD3DFIELD_ll( TZFIELDS0_ll, ZRTHS_OTHER, 'ADVECTION_METSV::ZRTHS_OTHER' ) + IF (GTKE) CALL ADD3DFIELD_ll( TZFIELDS0_ll, ZRTKES_OTHER, 'ADVECTION_METSV::ZRTKES_OTHER' ) + IF ( KRR>0 ) CALL ADD4DFIELD_ll( TZFIELDS0_ll, ZRRS_OTHER(:,:,:,1:KRR), 'ADVECTION_METSV::ZRRS_OTHER' ) + IF ( KSV>0 ) CALL ADD4DFIELD_ll( TZFIELDS0_ll, ZRSVS_OTHER(:,:,:,1:KSV), 'ADVECTION_METSV::ZRSVS_OTHER' ) + IF(LBLOWSNOW) CALL ADD4DFIELD_ll( TZFIELDS0_ll, ZRSNWCS_OTHER(:,:,:,1:NBLOWSNOW_2D), 'ADVECTION_METSV::ZRSNWCS_OTHER' ) + CALL UPDATE_HALO_ll(TZFIELDS0_ll,IINFO_ll) + CALL CLEANLIST_ll(TZFIELDS0_ll) +!!$END IF +! +! + +!------------------------------------------------------------------------------- +! +!* 4. CALLS THE PPM ADVECTION INSIDE A TIME SPLITTING +! -------------------------------------- +! +CALL PPM_RHODJ(HLBCX,HLBCY, ZRUCPPM, ZRVCPPM, ZRWCPPM, & + ZTSTEP_PPM, PRHODJ, ZRHOX1, ZRHOX2, ZRHOY1, ZRHOY2, & + ZRHOZ1, ZRHOZ2 ) +! +!* values of the fields at the beginning of the time splitting loop +ZTH = PTHT +ZTKE = PTKET +IF (KRR /=0 ) ZR = PRT +IF (KSV /=0 ) ZSV = PSVT +IF(LBLOWSNOW) THEN + DO JSV = 1, (NBLOWSNOW_2D) + ZSNWC(:,:,:,JSV) = ZRSNWCS(:,:,:,JSV)* PTSTEP/ PRHODJ + CALL ADV_BOUNDARIES (HLBCX, HLBCY, ZSNWC(:,:,:,JSV)) + END DO + ZSNWC_INIT=ZSNWC +ENDIF +! +IF (GTKE) PRTKES_ADV(:,:,:) = 0. +! +!* time splitting loop +DO JSPL=1,KSPLIT +! + !ZRTHS_PPM(:,:,:) = 0. + !ZRTKES_PPM(:,:,:) = 0. + !IF (KRR /=0) ZRRS_PPM(:,:,:,:) = 0. + !IF (KSV /=0) ZRSVS_PPM(:,:,:,:) = 0. +! + IF (LNEUTRAL) ZTH=ZTH-PTHVREF !* To be removed with the new PPM scheme ? + CALL PPM_MET (HLBCX,HLBCY, KRR, TPDTCUR,ZRUCPPM, ZRVCPPM, ZRWCPPM, PTSTEP,ZTSTEP_PPM, & + PRHODJ, ZRHOX1, ZRHOX2, ZRHOY1, ZRHOY2, ZRHOZ1, ZRHOZ2, & + ZTH, ZTKE, ZR, ZRTHS_PPM, ZRTKES_PPM, ZRRS_PPM, HMET_ADV_SCHEME) + IF (LNEUTRAL) ZTH=ZTH+PTHVREF !* To be removed with the new PPM scheme ? +! + CALL PPM_SCALAR (HLBCX,HLBCY, KSV, TPDTCUR, ZRUCPPM, ZRVCPPM, ZRWCPPM, PTSTEP, & + ZTSTEP_PPM, PRHODJ, ZRHOX1, ZRHOX2, ZRHOY1, ZRHOY2, ZRHOZ1, ZRHOZ2, & + ZSV, ZRSVS_PPM, HSV_ADV_SCHEME ) +! +! Tendencies of PPM +! + PRTHS(:,:,:) = PRTHS (:,:,:) + ZRTHS_PPM (:,:,:) / KSPLIT + IF (GTKE) PRTKES_ADV(:,:,:) = PRTKES_ADV(:,:,:) + ZRTKES_PPM(:,:,:) / KSPLIT + IF (KRR /=0) PRRS (:,:,:,:) = PRRS (:,:,:,:) + ZRRS_PPM (:,:,:,:) / KSPLIT + IF (KSV /=0 ) PRSVS (:,:,:,:) = PRSVS (:,:,:,:) + ZRSVS_PPM (:,:,:,:) / KSPLIT +! + IF (JSPL<KSPLIT) THEN +! +! Guesses of the field inside the time splitting loop +! + ZTH = ZTH + ( ZRTHS_PPM(:,:,:) + ZRTHS_OTHER(:,:,:) + PRTHS_CLD(:,:,:)) * & + ZTSTEP_PPM / PRHODJ(:,:,:) + IF (GTKE) ZTKE = ZTKE + ( ZRTKES_PPM(:,:,:) + ZRTKES_OTHER(:,:,:) ) * ZTSTEP_PPM / PRHODJ(:,:,:) + DO JR = 1, KRR + ZR(:,:,:,JR) = ZR(:,:,:,JR) + ( ZRRS_PPM(:,:,:,JR) + ZRRS_OTHER(:,:,:,JR) + PRRS_CLD(:,:,:,JR) ) & + * ZTSTEP_PPM / PRHODJ(:,:,:) + END DO + DO JSV = 1, KSV + ZSV(:,:,:,JSV) = ZSV(:,:,:,JSV) + ( ZRSVS_PPM(:,:,:,JSV) + ZRSVS_OTHER(:,:,:,JSV) + & + PRSVS_CLD(:,:,:,JSV) ) * ZTSTEP_PPM / PRHODJ(:,:,:) + END DO +! +! Top and bottom Boundaries and LBC for the guesses +! + CALL ADV_BOUNDARIES (HLBCX, HLBCY, ZTH, PTHT ) + IF (GTKE) CALL ADV_BOUNDARIES (HLBCX, HLBCY, ZTKE, PTKET) + DO JR = 1, KRR + CALL ADV_BOUNDARIES (HLBCX, HLBCY, ZR(:,:,:,JR), PRT(:,:,:,JR)) + END DO + DO JSV = 1, KSV + CALL ADV_BOUNDARIES (HLBCX, HLBCY, ZSV(:,:,:,JSV), PSVT(:,:,:,JSV)) + END DO + + IF(LBLOWSNOW) THEN ! Advection of Canopy mass at the 1st atmospheric level + ZRSNWCS_PPM(:,:,:,:) = 0. + ! + + CALL PPM_SCALAR (HLBCX,HLBCY, NBLOWSNOW_2D, TPDTCUR, ZRUCPPM, ZRVCPPM, ZRWCPPM,PTSTEP, & + ZTSTEP_PPM, PRHODJ, ZRHOX1, ZRHOX2, ZRHOY1, ZRHOY2, ZRHOZ1, ZRHOZ2, & + ZSNWC, ZRSNWCS_PPM, HSV_ADV_SCHEME) + + +! Tendencies of PPM + ZRSNWCS(:,:,:,:) = ZRSNWCS(:,:,:,:) + ZRSNWCS_PPM (:,:,:,:) / KSPLIT +! Guesses of the field inside the time splitting loop + DO JSV = 1, ( NBLOWSNOW_2D) + ZSNWC(:,:,:,JSV) = ZSNWC(:,:,:,JSV) + ZRSNWCS_PPM(:,:,:,JSV)*ZTSTEP_PPM/ PRHODJ(:,:,:) + END DO + +! Top and bottom Boundaries and LBC for the guesses + DO JSV = 1, (NBLOWSNOW_2D) + CALL ADV_BOUNDARIES (HLBCX, HLBCY, ZSNWC(:,:,:,JSV), ZSNWC_INIT(:,:,:,JSV)) + END DO + END IF +! +! Exchanges fields between processors +! + NULLIFY(TZFIELDS1_ll) +!!$ IF(NHALO == 1) THEN + CALL ADD3DFIELD_ll( TZFIELDS1_ll, ZTH, 'ZTH' ) + IF (GTKE) CALL ADD3DFIELD_ll( TZFIELDS1_ll, ZTKE, 'ADVECTION_METSV::ZTKE' ) + IF ( KRR>0 ) CALL ADD4DFIELD_ll( TZFIELDS1_ll, ZR (:,:,:,1:KRR), 'ADVECTION_METSV::ZR' ) + IF ( KSV>0 ) CALL ADD4DFIELD_ll( TZFIELDS1_ll, ZSV(:,:,:,1:KSV), 'ADVECTION_METSV::ZSV' ) + IF ( LBLOWSNOW ) CALL ADD4DFIELD_ll( TZFIELDS1_ll, ZSNWC(:,:,:,1:NBLOWSNOW_2D), 'ADVECTION_METSV::ZSNWC' ) + CALL UPDATE_HALO_ll(TZFIELDS1_ll,IINFO_ll) + CALL CLEANLIST_ll(TZFIELDS1_ll) +!!$ END IF + END IF +! +END DO +! +!------------------------------------------------------------------------------- +! +! TKE special case: advection is the last process for TKE +! +! TKE must be greater than its minimum value +! (previously done in tke_eps_sources) +! +IF (GTKE) THEN + PRTKES(:,:,:) = PRTKES(:,:,:) + PRTKES_ADV(:,:,:) + PRTKES(:,:,:) = MAX (PRTKES(:,:,:) , XTKEMIN * PRHODJ(:,:,:) / PTSTEP ) +END IF +! +! +!------------------------------------------------------------------------------- +! Update tendency for cano variables : from 3D to 2D +! +IF(LBLOWSNOW) THEN + + DO JSV=1,(NBLOWSNOW_2D) + DO JI=1,SIZE(PSVT,1) + DO JJ=1,SIZE(PSVT,2) + XRSNWCANOS(JI,JJ,JSV) = SUM(ZRSNWCS(JI,JJ,IKB:IKE,JSV)) + END DO + END DO + END DO +IF(LWEST_ll()) XRSNWCANOS(IIB,:,:) = ZRSNWCS(IIB,:,IKB,:) +IF(LEAST_ll()) XRSNWCANOS(IIE,:,:) = ZRSNWCS(IIE,:,IKB,:) +IF(LSOUTH_ll()) XRSNWCANOS(:,IJB,:) = ZRSNWCS(:,IJB,IKB,:) +IF(LNORTH_ll()) XRSNWCANOS(:,IJE,:) = ZRSNWCS(:,IJE,IKB,:) + +END IF +!------------------------------------------------------------------------------- +! +!* 5. BUDGETS +! ------- +! +if ( lbudget_th ) call Budget_store_end( tbudgets(NBUDGET_TH ), 'ADV', prths (:, :, :) ) +if ( lbudget_tke ) call Budget_store_end( tbudgets(NBUDGET_TKE), 'ADV', prtkes(:, :, :) ) +if ( lbudget_rv ) call Budget_store_end( tbudgets(NBUDGET_RV ), 'ADV', prrs (:, :, :, 1) ) +if ( lbudget_rc ) call Budget_store_end( tbudgets(NBUDGET_RC ), 'ADV', prrs (:, :, :, 2) ) +if ( lbudget_rr ) call Budget_store_end( tbudgets(NBUDGET_RR ), 'ADV', prrs (:, :, :, 3) ) +if ( lbudget_ri ) call Budget_store_end( tbudgets(NBUDGET_RI ), 'ADV', prrs (:, :, :, 4) ) +if ( lbudget_rs ) call Budget_store_end( tbudgets(NBUDGET_RS ), 'ADV', prrs (:, :, :, 5) ) +if ( lbudget_rg ) call Budget_store_end( tbudgets(NBUDGET_RG ), 'ADV', prrs (:, :, :, 6) ) +if ( lbudget_rh ) call Budget_store_end( tbudgets(NBUDGET_RH ), 'ADV', prrs (:, :, :, 7) ) +if ( lbudget_sv) then + do jsv = 1, ksv + call Budget_store_end( tbudgets(NBUDGET_SV1 - 1 + jsv ), 'ADV', prsvs(:, :, :, jsv) ) + end do +end if + +! Remove non-physical negative values (unnecessary in a perfect world) + corresponding budgets +call Sources_neg_correct( hcloud, 'NEADV', krr, ptstep, ppabst, ptht, prt, prths, prrs, prsvs ) + +!------------------------------------------------------------------------------- +! +END SUBROUTINE ADVECTION_METSV diff --git a/src/mesonh/ext/aer_effic.f90 b/src/mesonh/ext/aer_effic.f90 new file mode 100644 index 0000000000000000000000000000000000000000..0f3a2a7738251356886ad1faa1498baeafaf269a --- /dev/null +++ b/src/mesonh/ext/aer_effic.f90 @@ -0,0 +1,211 @@ +!ORILAM_LIC Copyright 1994-2018 CNRS, Meteo-France and Universite Paul Sabatier +!ORILAM_LIC This is part of the ORILAM software governed by the CeCILL-C licence +!ORILAM_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt +!ORILAM_LIC for details. +! ######spl + MODULE MODI_AER_EFFIC +!! ######################## +!! +! +INTERFACE +!! +SUBROUTINE AER_EFFIC(PRG,PVGG, & !aerosol radius/fall speed (m/s) + PRHODREF, & !Air density + PMUW, PMU, & !mu water/air + PDPG, PEFC, & !diffusivity, efficiency + PRRS, & ! Rain water m.r. at time + KMODE, & ! Number of aerosol modes + PTEMP, PCOR, & ! air temp, cunningham corr factor + PDENSITY_AER ) ! aerosol density +! +IMPLICIT NONE +REAL, DIMENSION(:,:), INTENT(IN) :: PRG, PVGG +REAL, DIMENSION(:), INTENT(IN) :: PRHODREF +REAL, DIMENSION(:,:), INTENT(IN) :: PDPG +REAL, DIMENSION(:), INTENT(IN) :: PMU, PMUW +REAL, DIMENSION(:,:), INTENT(INOUT) :: PEFC +REAL, DIMENSION(:), INTENT(IN) :: PRRS +REAL, DIMENSION(:), INTENT(IN) :: PTEMP +REAL, DIMENSION(:,:), INTENT(IN) :: PCOR +INTEGER, INTENT(IN) :: KMODE +REAL, DIMENSION(:,:), INTENT(IN) :: PDENSITY_AER + + +END SUBROUTINE AER_EFFIC +!! +END INTERFACE +END MODULE MODI_AER_EFFIC +! ######spl +SUBROUTINE AER_EFFIC(PRG,PVGG, & !aerosol radius/fall speed (m/s) + PRHODREF, & !Air density + PMUW, PMU, & !mu water/air + PDPG, PEFC, & !diffusivity, efficiency + PRRS, & ! Rain water m.r. at time t + KMODE, & ! Number of aerosol modes + PTEMP, PCOR, & ! air temp, cunningham corr factor + PDENSITY_AER ) ! aerosol density +!! ####################################### +!!**********AER_EFFIC********** +!! PURPOSE +!! ------- +!! Calculate the collection efficiency of +! a falling drop interacting with a dust aerosol +! for use with aer_wet_dep_kmt_warm.f90 +!! +!!** METHOD +!! ------ +!! Using basic theory, and the one dimensional variables sent +!! from aer_wet_dep_kmt_warm.f90, calculation of the average +!! fall speed calculations, chapter 17.3.4, MESONH Handbook +!! droplet number based on the Marshall_Palmer distribution +!! and Stokes number, Reynolds number, etc. based on theory +!! (S&P, p.1019) +!! +!! REFERENCE +!! --------- +!! Seinfeld and Pandis p.1019 +!! MESONH Handbook chapter 17.3.4 +!! +!! AUTHOR +!! ------ +!! K. Crahan Kaku / P. Tulet (CNRM/GMEI) +!! +!! MODIFICATIONS +!! ------------- +!! Philippe Wautelet 28/05/2018: corrected truncated integer division (1/12 -> 1./12.) +!! +!----------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_RAIN_ICE_PARAM_n +USE MODD_RAIN_ICE_DESCR_n +USE MODD_CST, ONLY : XPI, XRHOLW, XP00, XRD +USE MODD_PARAMETERS , ONLY : JPVEXT +USE MODD_REF, ONLY : XTHVREFZ +! +IMPLICIT NONE +! +!* 0.1 declarations of arguments +REAL, DIMENSION(:,:), INTENT(IN) :: PRG, PVGG +REAL, DIMENSION(:), INTENT(IN) :: PRHODREF +REAL, DIMENSION(:,:), INTENT(IN) :: PDPG +REAL, DIMENSION(:), INTENT(IN) :: PMU, PMUW +REAL, DIMENSION(:,:), INTENT(INOUT) :: PEFC +REAL, DIMENSION(:), INTENT(IN) :: PRRS +REAL, DIMENSION(:), INTENT(IN) :: PTEMP +REAL, DIMENSION(:,:), INTENT(IN) :: PCOR +INTEGER, INTENT(IN) :: KMODE +REAL, DIMENSION(:,:), INTENT(IN) :: PDENSITY_AER +! +! +!* 0.2 declaration of local variables +! +INTEGER :: IKB ! Coordinates of the first physical + ! points along z +REAL :: ZRHO00 ! Surface reference air density +!viscosity ratio, Reynolds number +REAL, DIMENSION(SIZE(PRG,1)) :: ZOMG, ZREY +!rain radius, m, and rain fall speed, m/s; aerosol radius (m), +REAL, DIMENSION(SIZE(PRG,1)) :: ZRR, ZVR +!lambda, number concentration according to marshall palmer, +REAL, DIMENSION(SIZE(PRG,1)) :: ZNT, ZLBDA +! Rain water m.r. source +REAL, DIMENSION(SIZE(PRG,1)) :: ZRRS +!RHO_dref*r_r, Rain LWC +REAL, DIMENSION(SIZE(PRG,1)) :: RLWC +! schmidts number +REAL, DIMENSION(SIZE(PRG,1),KMODE) :: ZSCH +! +!Stokes number, ratio of diameters,aerosol radius +REAL, DIMENSION(SIZE(PRG,1),KMODE) :: ZSTO, ZPHI, ZRG +! S Star Term +REAL, DIMENSION(SIZE(PRG,1)) :: ZSTA, ZDIFF, ZTAU +! +!Term 1, Term 2, Term 3, Term 4 such that +! E = Term1 * Term 2 + Term 3 + Term 4 +REAL, DIMENSION(SIZE(PRG,1),KMODE) :: ZT1, ZT2 +REAL, DIMENSION(SIZE(PRG,1),KMODE) :: ZT3, ZT4 +! +INTEGER :: JI,JK +! +!----------------------------------------------------------------- +ZRRS(:)=PRRS(:) +IKB = 1 + JPVEXT +ZRHO00 = XP00/(XRD*XTHVREFZ(IKB)) +ZRG(:,:)=PRG(:,:)*1.E-6 !change units to meters +! +!Fall Speed calculations +!similar to rain_ice.f90, chapter 17.3.4, MESONH Handbook +! +ZVR (:)= XFSEDR * ZRRS(:)**(XEXSEDR-1) * & + PRHODREF(:)**(XEXSEDR-XCEXVT-1) +! Drop Radius calculation in m +!lbda = pi*No*rho(lwc)/(rho(dref)*rain rate) p.212 MESONH Handbook +! compute the slope parameter Lbda_r +ZLBDA(:) = XLBR*( PRHODREF(:)* ZRRS(:) )**XLBEXR +!Number concentration NT=No/lbda p. 415 Jacobson +ZNT (:) = XCCR/ZLBDA (:) +!rain lwc (kg/m3) = rain m.r.(kg/kg) * rho_air(kg/m3) +RLWC(:)=ZRRS(:)*PRHODREF(:) +!4/3 *pi *r³*NT*rho_eau(kg/m3) =rho(lwc)=rho(air)* qc(kg/kg) +ZRR(:) = (RLWC(:)/(XRHOLW*ZNT(:)*4./3.*XPI))**(1./3.) +! +!Fall speed cannot be faster than 7 m/s +ZVR (:)=MIN(ZVR (:),7.) + +!Ref SEINFELD AND PANDIS p.1019 +! Viscosity Ratio +ZOMG(:)=PMUW(:)/PMU(:) +!!Reynolds number +ZREY(:)=ZRR(:)*ZVR(:)*PRHODREF(:)/PMU(:) +ZREY(:)= MAX(ZREY(:), 1E-2) + +!S Star +ZSTA(:)=(1.2+1./12.*LOG(1.+ZREY(:)))/(1.+LOG(1.+ZREY(:))) +PEFC(:,:)=0.0 +DO JI=1,KMODE +! +!Scmidts number + ZSCH(:,JI)=PMU(:)/PRHODREF(:)/PDPG(:,JI) +! Rain-Aerosol relative velocity + ZDIFF(:) = MAX(ZVR(:)-PVGG(:,JI),0.) +! Relaxation time + ZTAU(:) = (ZRG(:,JI)*2.)**2. * PDENSITY_AER(:,JI) * PCOR(:,JI) / (18.*PMU(:)) +! Stockes number + ZSTO(:,JI)= ZTAU(:) * ZDIFF(:) / ZRR(:) +!Ratio of diameters + ZPHI(:,JI)=ZRG(:,JI)/ZRR(:) + ZPHI(:,JI)=MIN(ZPHI(:,JI), 1.) +!Term 1 + ZT1(:,JI)=4.0/ZREY(:)/ZSCH(:,JI) +!Term 2 + ZT2(:,JI)=1.0+0.4*ZREY(:)**(0.5)*ZSCH(:,JI)**(1./3.)+ & + 0.16*ZREY(:)**(0.5)*ZSCH(:,JI)**(0.5) + +!Brownian diffusion + ZT1(:,JI)= ZT1(:,JI)*ZT2(:,JI) +!Term 3 - interception + ZT3(:,JI)=4.*ZPHI(:,JI)*(1./ZOMG(:)+ & + (1.0+2.0*ZREY(:)**0.5)*ZPHI(:,JI)) + + ZT4(:,JI)=0.0 + WHERE(ZSTO(:,JI).GT.ZSTA(:)) +!Term 4 - impaction + ZT4(:,JI)=((ZSTO(:,JI)-ZSTA(:))/ & + (ZSTO(:,JI)-ZSTA(:)+2./3.))**(3./2.) & + *(XRHOLW/PDENSITY_AER(:,JI))**(1./2.) + + END WHERE +!Collision Efficiancy + PEFC(:,JI)=ZT1(:,JI)+ ZT3(:,JI)+ZT4(:,JI) +! Physical radius of a rain collector droplet up than 20 um +WHERE (ZRR(:) .LE. 20.E-6) + PEFC(:,JI)= 0. +END WHERE +ENDDO +PEFC(:,:)=MIN(PEFC(:,:),1.0) +PEFC(:,:)=MAX(PEFC(:,:),0.0) + +END SUBROUTINE AER_EFFIC diff --git a/src/mesonh/ext/aer_effic3D.f90 b/src/mesonh/ext/aer_effic3D.f90 new file mode 100644 index 0000000000000000000000000000000000000000..102279ad9152d9eddd01eed6a9f5d67086c4201f --- /dev/null +++ b/src/mesonh/ext/aer_effic3D.f90 @@ -0,0 +1,225 @@ +!ORILAM_LIC Copyright 1994-2018 CNRS, Meteo-France and Universite Paul Sabatier +!ORILAM_LIC This is part of the ORILAM software governed by the CeCILL-C licence +!ORILAM_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt +!ORILAM_LIC for details. +! +! ######spll + MODULE MODI_AER_EFFIC3D +!! ######################## +!! +! +INTERFACE +!! +SUBROUTINE AER_EFFIC3D(PRG,PVGG, & !aerosol radius/fall speed (m/s) + PRHODREF, & !Air density + PMUW, PMU, & !mu water/air + PDPG, & !diffusivity + PURR, & ! Rain water m.r. at time t + NMODE_DST, & ! Number of aerosol modes + PTEMP, PCOR, & ! air temp, cunningham corr factor + PDENSITY_AER, & ! aerosol density + PEFFIC ) ! scavenging efficiency +! +IMPLICIT NONE +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRG, PVGG +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PDPG +REAL, DIMENSION(:,:,:), INTENT(IN) :: PMU, PMUW +REAL, DIMENSION(:,:,:), INTENT(IN) :: PURR +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTEMP +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PCOR +INTEGER, INTENT(IN) :: NMODE_DST +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PDENSITY_AER +REAL, DIMENSION(:,:,:,:), INTENT(INOUT):: PEFFIC + + + +END SUBROUTINE AER_EFFIC3D +!! +END INTERFACE +END MODULE MODI_AER_EFFIC3D +! ######spll +SUBROUTINE AER_EFFIC3D(PRG,PVGG, & !aerosol radius/fall speed (m/s) + PRHODREF, & !Air density + PMUW, PMU, & !mu water/air + PDPG, & !diffusivity + PURR, & ! Rain water m.r. at time t + NMODE_DST, & ! Number of aerosol modes + PTEMP, PCOR, & ! air temp, cunningham corr factor + PDENSITY_AER, & ! aerosol density + PEFFIC ) ! scavenging efficiency +!! ####################################### +!!**********AER_EFFIC3D********** +!! PURPOSE +!! ------- +!! Calculate the collection efficiency of +! a falling drop interacting with a dust aerosol +! for use with aer_wet_dep_kmt_warm.f90 +!! +!!** METHOD +!! ------ +!! Using basic theory, and the one dimensional variables sent +!! from aer_wet_dep_kmt_warm.f90, calculation of the average +!! fall speed calculations, chapter 17.3.4, MESONH Handbook +!! droplet number based on the Marshall_Palmer distribution +!! and Stokes number, Reynolds number, etc. based on theory +!! (S&P, p.1019) +!! +!! REFERENCE +!! --------- +!! Seinfeld and Pandis p.1019 +!! MESONH Handbook chapter 17.3.4 +!! +!! AUTHOR +!! ------ +!! K. Crahan Kaku / P. Tulet (CNRM/GMEI) +!! +!! MODIFICATIONS +!! ------------- +!! Philippe Wautelet 28/05/2018: corrected truncated integer division (1/12 -> 1./12.) +!! +!----------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_RAIN_ICE_PARAM_n +USE MODD_RAIN_ICE_DESCR_n +USE MODD_CST, ONLY : XPI, XRHOLW, XP00, XRD +USE MODD_PARAMETERS , ONLY : JPVEXT +USE MODD_REF, ONLY : XTHVREFZ +! +IMPLICIT NONE +! +!* 0.1 declarations of arguments +! +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRG, PVGG +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PDPG +REAL, DIMENSION(:,:,:), INTENT(IN) :: PMU, PMUW +REAL, DIMENSION(:,:,:), INTENT(IN) :: PURR +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTEMP +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PCOR +INTEGER, INTENT(IN) :: NMODE_DST +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PDENSITY_AER +REAL, DIMENSION(:,:,:,:), INTENT(INOUT):: PEFFIC +! +!* 0.2 declaration of local variables +! +INTEGER :: IKB ! Coordinates of the first physical + ! points along z +REAL :: ZRHO00 ! Surface reference air density +!viscosity ratio, Reynolds number +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3)) :: ZOMG, ZREY +!rain radius, m, and rain fall speed, m/s; aerosol radius (m), +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3)) :: ZRR, ZVR +!lambda, number concentration according to marshall palmer, +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3)) :: ZNT, ZLBDA +! Rain water m.r. source +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3)) :: ZRRS +!RHO_dref*r_r, Rain LWC +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3)) :: ZRLWC +! schmidts number +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3),NMODE_DST) :: ZSCH +! +!Stokes number, ratio of diameters,aerosol radius +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3),NMODE_DST) :: ZSTO, ZPHI, ZRG +! S Star Term +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3)) :: ZSTA, ZDIFF, ZTAU +! +!Term 1, Term 2, Term 3, Term 4 such that +! E = Term1 * Term 2 + Term 3 + Term 4 +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3),NMODE_DST) :: ZT1, ZT2 +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3),NMODE_DST) :: ZT3, ZT4 +! +INTEGER :: JI,JK +! +!----------------------------------------------------------------- +ZLBDA = 1E20 +ZNT = 1E-20 +ZRR = 10E-6 +ZRRS(:,:,:)=PURR(:,:,:) +IKB = 1 + JPVEXT +ZRHO00 = XP00/(XRD*XTHVREFZ(IKB)) +ZRG(:,:,:,:)=PRG(:,:,:,:)*1.E-6 !change units to meters +! +!Fall Speed calculations +!similar to rain_ice.f90, chapter 17.3.4, MESONH Handbook +! +ZVR (:,:,:)= XFSEDR * ZRRS(:,:,:)**(XEXSEDR-1) * & + PRHODREF(:,:,:)**(XEXSEDR-XCEXVT-1) + +! Drop Radius calculation in m +!lbda = pi*No*rho(lwc)/(rho(dref)*rain rate) p.212 MESONH Handbook +! compute the slope parameter Lbda_r + +WHERE((ZRRS(:,:,:).GT. 0.).AND.(PRHODREF(:,:,:) .GT. 0.)) + +ZLBDA(:,:,:) = XLBR*(PRHODREF(:,:,:)*ZRRS(:,:,:))**XLBEXR +!Number concentration NT=No/lbda p. 415 Jacobson +ZNT(:,:,:) = XCCR/ZLBDA(:,:,:) +!rain lwc (kg/m3) = rain m.r.(kg/kg) * rho_air(kg/m3) +ZRLWC(:,:,:)=ZRRS(:,:,:)*PRHODREF(:,:,:) +!4/3 *pi *r³*NT*rho_eau(kg/m3) =rho(lwc)=rho(air)* qc(kg/kg) +ZRR(:,:,:) = (ZRLWC(:,:,:)/(XRHOLW*ZNT(:,:,:)*4./3.*XPI))**(1./3.) +END WHERE + +ZRR(:,:,:) = MIN(ZRR(:,:,:), 100.E-6) +!Fall speed cannot be faster than 7 m/s +ZVR (:,:,:)=MIN(ZVR (:,:,:),7.) + +!Ref SEINFELD AND PANDIS p.1019 +! Viscosity Ratio +ZOMG(:,:,:)=PMUW(:,:,:)/PMU(:,:,:) +!!Reynolds number +ZREY(:,:,:)=ZRR(:,:,:)*ZVR(:,:,:)*PRHODREF(:,:,:)/PMU(:,:,:) +ZREY(:,:,:)= MAX(ZREY(:,:,:), 1E-2) + + +!S Star +ZSTA(:,:,:)=(1.2+(1./12.)*LOG(1.+ZREY(:,:,:)))/(1.+LOG(1.+ZREY(:,:,:))) +PEFFIC(:,:,:,:)=0.0 +DO JI=1,NMODE_DST +! +!Scmidts number + ZSCH(:,:,:,JI)=PMU(:,:,:)/PRHODREF(:,:,:)/PDPG(:,:,:,JI) +! Rain-Aerosol relative velocity + ZDIFF(:,:,:) = MAX(ZVR(:,:,:)-PVGG(:,:,:,JI),0.) +! Relaxation time + ZTAU(:,:,:) = (ZRG(:,:,:,JI)*2.)**2. * PDENSITY_AER(:,:,:,JI) * PCOR(:,:,:,JI) / (18.*PMU(:,:,:)) +! Stockes number + ZSTO(:,:,:,JI)= ZTAU(:,:,:) * ZDIFF(:,:,:) / ZRR(:,:,:) +!Ratio of diameters + ZPHI(:,:,:,JI)=ZRG(:,:,:,JI)/ZRR(:,:,:) + ZPHI(:,:,:,JI)=MIN(ZPHI(:,:,:,JI), 1.) +!Term 1 + ZT1(:,:,:,JI)=4.0/ZREY(:,:,:)/ZSCH(:,:,:,JI) +!Term 2 + ZT2(:,:,:,JI)=1.0+(0.4*ZREY(:,:,:)**(0.5)*ZSCH(:,:,:,JI)**(1./3.))+ & + (0.16*ZREY(:,:,:)**(0.5)*ZSCH(:,:,:,JI)**(0.5)) + +!Brownian diffusion + ZT1(:,:,:,JI)= ZT1(:,:,:,JI)*ZT2(:,:,:,JI) +!Term 3 - interception + ZT3(:,:,:,JI)=4.*ZPHI(:,:,:,JI)*(1./ZOMG(:,:,:)+ & + (1.0+(2.0*ZREY(:,:,:)**0.5))*ZPHI(:,:,:,JI)) + + ZT4(:,:,:,JI)=0.0 + WHERE(ZSTO(:,:,:,JI).GT.ZSTA(:,:,:)) +!Term 4 - impaction + ZT4(:,:,:,JI)=((ZSTO(:,:,:,JI)-ZSTA(:,:,:))/ & + (ZSTO(:,:,:,JI)-ZSTA(:,:,:)+2./3.))**(3./2.) & + *((XRHOLW/PDENSITY_AER(:,:,:,JI))**(1./2.)) + + END WHERE +!Collision Efficiancy + PEFFIC(:,:,:,JI)=ZT1(:,:,:,JI)+ ZT3(:,:,:,JI)+ZT4(:,:,:,JI) +! Physical radius of a rain collector droplet up than 20 um +WHERE (ZRR(:,:,:) .LE. 9.9E-6) + PEFFIC(:,:,:,JI)= 0. +END WHERE +ENDDO +PEFFIC(:,:,:,:)=MIN(PEFFIC(:,:,:,:),1.0) +PEFFIC(:,:,:,:)=MAX(PEFFIC(:,:,:,:),0.0) + +END SUBROUTINE AER_EFFIC3D diff --git a/src/mesonh/ext/aer_wet_dep_kmt_warm.f90 b/src/mesonh/ext/aer_wet_dep_kmt_warm.f90 new file mode 100644 index 0000000000000000000000000000000000000000..021646aec1a2a05bb90174b3e9840273ed2f4808 --- /dev/null +++ b/src/mesonh/ext/aer_wet_dep_kmt_warm.f90 @@ -0,0 +1,776 @@ +!ORILAM_LIC Copyright 2007-2019 CNRS, Meteo-France and Universite Paul Sabatier +!ORILAM_LIC This is part of the ORILAM software governed by the CeCILL-C licence +!ORILAM_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt +!ORILAM_LIC for details. +!----------------------------------------------------------------- +! ################################ + MODULE MODI_AER_WET_DEP_KMT_WARM +!! ################################ +!! +! +INTERFACE +!! +SUBROUTINE AER_WET_DEP_KMT_WARM(KSPLITR, PTSTEP, PZZ, PRHODREF, & + PRCT, PRRT, & + PRCS, PRRS, PSVT, PTHT, & + PPABST, PRGAER, PEVAP3D, KMODE, & + PDENSITY_AER, PMASSMIN, PSEA, PTOWN, & + PCCT, PCRT ) +! +IMPLICIT NONE +INTEGER, INTENT(IN) :: KSPLITR ! Number of small time step + ! integration for rain sedimendation +REAL, INTENT(IN) :: PTSTEP ! Time step +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! Height (z) +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF! Reference [kg/m3] air density +! +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRCT ! Cloud water m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRRT ! Rain water m.r. at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PSVT ! Tracer m.r. at t +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRCS ! Cloud water conc derived from source term +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRRS ! Rain water conc derifed from source term +REAL, DIMENSION(:,:,:), INTENT(IN) :: PEVAP3D ! Instantaneous 3D Rain Evaporation flux (KG/KG/S) +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHT !Potential temp +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABST ! [Pa] pressure +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRGAER ! Aerosol radius (um) +INTEGER, INTENT(IN) :: KMODE ! Nb aerosols mode +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PDENSITY_AER ! Begin Index for aerosol in cloud +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PMASSMIN ! Aerosol mass minimum value +REAL, DIMENSION(:,:),OPTIONAL, INTENT(IN) :: PSEA ! Sea mask +REAL, DIMENSION(:,:),OPTIONAL, INTENT(IN) :: PTOWN ! Town mask +REAL, DIMENSION(:,:,:),OPTIONAL, INTENT(IN) :: PCCT ! Cloud water concentration +REAL, DIMENSION(:,:,:),OPTIONAL, INTENT(IN) :: PCRT ! Rain water concentration +! +END SUBROUTINE AER_WET_DEP_KMT_WARM +!! +END INTERFACE +END MODULE MODI_AER_WET_DEP_KMT_WARM + +! ############################################################### + SUBROUTINE AER_WET_DEP_KMT_WARM (KSPLITR, PTSTEP, PZZ, & + PRHODREF, PRCT, PRRT, & + PRCS, PRRS, PSVT, PTHT, & + PPABST, PRGAER, PEVAP3D, KMODE, & + PDENSITY_AER, PMASSMIN, PSEA, PTOWN, & + PCCT, PCRT ) +! ############################################################### +! +!!**** * - compute the explicit microphysical processes involved in the +!!*** * - wet deposition of aerosols species in mixed clouds +!! +!! PURPOSE +!! ------- +!! +!! The purpose of this subroutine is to calculate the mass transfer +!! of aerosol species between cloud hydrometeors. +!! +!! +!! +!!** METHOD +!! ------ +!! Aerosols mass are dissolved into the cloud water and rain +!! drops, it is subject to transfer through the microphysical processes +!! that affect the parent hydrometeor [Rutledge et al., 1986]. +!! Aerosol mass transfer has been computed using scavenging coefficient +!! and brownian nucleation scavenging coefficient (Seinfeld and Pandis, +!! 1998; Tost et al, 2006). +!! +!! The sedimentation rate is computed with a time spliting technique and +!! an upstream scheme, written as a difference of non-advective fluxes. +!! +!! KMODE: Number of aerosol modes (lognormal, bin..) +!! PSVT : 1 => KMODE : dry aerosol mass +!! PSVT : KMODE+1 => 2*KMODE : aerosol mass in cloud +!! PSVT : 2*KMODE+1 => 3*KMODE: aerosol mass in rain + +!! +!! EXTERNAL +!! -------- +!! None +!! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODD_CST +!! XP00 ! Reference pressure +!! XRD,XRV ! Gaz constant for dry air, vapor +!! XMD,XMV ! Molecular weight for dry air, vapor +!! XCPD ! Cpd (dry air) +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! P. Tulet & K. Crahan-Kaku * CNRM * +!! +!! Based on rain_ice.f90 and ch_wet_dep_kmt_warm.f90 +!! from C. Mari & J.P. Pinty * LA* +!! +!! +!! MODIFICATIONS +!! ------------- +!! Original 09/05/07 +! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function +! P. Wautelet 28/05/2019: move COUNTJV function to tools.f90 +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_CST +USE MODD_RAIN_ICE_PARAM_n +USE MODD_RAIN_ICE_DESCR_n +USE MODD_PRECIP_n +USE MODI_AER_VELGRAV +USE MODI_AER_EFFIC +USE MODI_GAMMA +! +IMPLICIT NONE +! +!* 0.1 Declarations of dummy arguments : +! +INTEGER, INTENT(IN) :: KSPLITR ! Number of small time step + ! integration for rain sedimendation +REAL, INTENT(IN) :: PTSTEP ! Time step +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! Height (z) +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF! Reference [kg/m3] air density +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRCT ! Cloud water m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRRT ! Rain water m.r. at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PSVT ! Tracer m.r. at t +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRCS ! Cloud water m.r. from source term +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRRS ! Rain water m.r. from source term +REAL, DIMENSION(:,:,:), INTENT(IN) :: PEVAP3D ! Instantaneous 3D Rain Evaporation flux (KG/KG/S) +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHT ! Potential temp +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABST ! [Pa] pressure +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRGAER ! Aerosols radius (um) +INTEGER, INTENT(IN) :: KMODE ! Nb aerosols mode +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PDENSITY_AER ! Begin Index for aerosol in cloud +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PMASSMIN ! Aerosol mass minimum value +REAL, DIMENSION(:,:),OPTIONAL, INTENT(IN) :: PSEA ! Sea mask +REAL, DIMENSION(:,:),OPTIONAL, INTENT(IN) :: PTOWN ! Town mask +REAL, DIMENSION(:,:,:),OPTIONAL, INTENT(IN) :: PCCT ! Cloud water concentration +REAL, DIMENSION(:,:,:),OPTIONAL, INTENT(IN) :: PCRT ! Rain water concentration + +! +!* 0.2 Declarations of local variables : +! +INTEGER :: JK ! Vertical loop index for the rain sedimentation +INTEGER :: JN ! Temporal loop index for the rain sedimentation +INTEGER :: JJ ! Loop index for the interpolation +! +REAL :: ZTSPLITR ! Small time step for rain sedimentation +! +REAL, DIMENSION(:,:), ALLOCATABLE :: ZEFC !efficiency factor [unitless] +! +!Declaration of Dust Variables +! +INTEGER :: ICLOUD, IRAIN +! Case number of sedimentation, T>0 (for HEN) + ! and r_x>0 locations +LOGICAL, DIMENSION(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3)) & + :: GRAIN, GCLOUD ! Test where to compute all processes + ! Test where to compute the SED/EVAP processes +REAL, DIMENSION(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3)) & + :: ZW, ZZW1, ZZW2, ZZW4 ! work array +REAL, DIMENSION(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3)) & + :: ZWEVAP ! sedimentation fluxes +REAL, DIMENSION(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3)+1) & + :: ZWSED ! sedimentation fluxes +REAL, DIMENSION(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3)) :: ZLBDAR +! Slope parameter of the raindrop distribution +REAL, DIMENSION(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3)) & + :: ZZRCT, ZZEVAP, ZMASK +REAL, DIMENSION(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3)) & + :: ZRAY, & ! Mean radius + ZNRT, & ! Number of rain droplets + ZLBC , & ! XLBC weighted by sea fraction + ZFSEDC +REAL, DIMENSION(SIZE(PSVT,1),SIZE(PSVT,2)) :: ZCONC_TMP +REAL, DIMENSION(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3)) :: ZCONC +REAL, DIMENSION(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3)) :: ZRRS +! +REAL, DIMENSION(:,:), ALLOCATABLE :: ZSVT ! Tracer m.r. concentration +! +REAL, DIMENSION(:,:), ALLOCATABLE :: ZVGG, ZDPG !aerosol velocity [m/s], diffusivity [m2/s] +REAL, DIMENSION(:,:), ALLOCATABLE :: ZRG !Dust R[µm] +REAL, DIMENSION(:,:), ALLOCATABLE :: ZCOR !Cunningham correction factor [unitless] +REAL, DIMENSION(:,:), ALLOCATABLE :: ZMASSMIN ! Aerosol mass minimum value +REAL, DIMENSION(:,:), ALLOCATABLE :: ZDENSITY_AER ! Aerosol density +! +REAL, DIMENSION(:), ALLOCATABLE & + :: ZRHODREF, & ! RHO Dry REFerence + ZTHT, & ! Potential temp + ZPABST, & ! Pressure [Pa] + ZZW, & ! Work array + ZTEMP, & ! Air Temp [K] + ZRC, & ! Cloud radius [m] + ZRCT, & ! Cloud water + ZRR, & ! Rain radius [m] + ZNT, & ! Rain droplets number + ZRRT, & ! Rain water + ZMU,ZMUW, & ! viscosity aerosol, water [Pa s] + ZFLUX, & ! Effective precipitation flux (kg.m-2.s-1) + ZCONC1D, & ! Weighted droplets concentration + ZWLBDC, & ! Slope parameter of the droplet distribution + ZGAMMA ! scavenging coefficient +REAL, DIMENSION(:), ALLOCATABLE :: ZW1 ! Work arrays +REAL, DIMENSION(SIZE(XRTMIN)) :: ZRTMIN + +INTEGER :: JL ! and PACK intrinsics +! +INTEGER :: JKAQ, JSV +! +REAL :: A0, A1, A2, A3 ! Constants for computing viscocity +INTEGER :: IKE + +! +!------------------------------------------------------------------------------- +! +!* 0. Initialize work array +! --------------------- +! +! Compute Effective cloud radius +ZRAY(:,:,:) = 0. +ZLBC(:,:,:) = 0. +IF (PRESENT(PCCT)) THEN ! case KHKO, C2R2, C3R5 (two moments schemes) + ZRAY(:,:,:) = 3.* PRCT(:,:,:) / (4.*XPI*XRHOLW*PCCT(:,:,:)) + ZRAY(:,:,:) = ZRAY(:,:,:)**(1./3.) ! Cloud mean radius in m +ELSE IF (PRESENT(PSEA)) THEN ! Case ICE3, RAVE, KESS, .. +ZLBC(:,:,:) = XLBC(1) +ZFSEDC(:,:,:) = XFSEDC(1) +ZCONC(:,:,:) = XCONC_LAND +ZCONC_TMP(:,:)=PSEA(:,:)*XCONC_SEA+(1.-PSEA(:,:))*XCONC_LAND +DO JK=1,SIZE(PRHODREF,3) + ZLBC(:,:,JK) = PSEA(:,:)*XLBC(2)+(1.-PSEA(:,:))*XLBC(1) + ZFSEDC(:,:,JK) = (PSEA(:,:)*XFSEDC(2)+(1.-PSEA(:,:))*XFSEDC(1)) + ZFSEDC(:,:,JK) = MAX(MIN(XFSEDC(1),XFSEDC(2)),ZFSEDC(:,:,JK)) + ZCONC(:,:,JK) = (1.-PTOWN(:,:))*ZCONC_TMP(:,:)+PTOWN(:,:)*XCONC_URBAN + ZRAY(:,:,JK) = 0.5*((1.-PSEA(:,:))*GAMMA(XNUC+1.0/XALPHAC)/(GAMMA(XNUC)) + & + PSEA(:,:)*GAMMA(XNUC2+1.0/XALPHAC2)/(GAMMA(XNUC2))) +END DO +ZRAY(:,:,:) = MAX(1.,ZRAY(:,:,:)) +ZLBC(:,:,:) = MAX(MIN(XLBC(1),XLBC(2)),ZLBC(:,:,:)) +ELSE +ZRAY(:,:,:) = 30. ! default value for cloud radius +END IF +! +ZNRT(:,:,:) = 0. +IF (PRESENT(PCRT)) THEN ! case KHKO, C2R2, C3R5 +! Transfert Number of rain droplets + ZNRT(:,:,:) = PCRT(:,:,:) +END IF +!------------------------------------------------------------------------------- +! +!* 1. COMPUTE THE AEROSOL/CLOUD-RAIN MASS TRANSFER +! ---------------------------------------------- +CALL AER_WET_MASS_TRANSFER +!------------------------------------------------------------------------------- +! +!* 2. COMPUTE THE SEDIMENTATION (RS) SOURCE +! ------------------------------------- +! +CALL AER_WET_DEP_KMT_WARM_SEDIMENT +! +!------------------------------------------------------------------------------- +!! +!!* 3. COMPUTES THE SLOW WARM PROCESS SOURCES +!! -------------------------------------- +!! +CALL AER_WET_DEP_KMT_ICE_WARM + +! +!------------------------------------------------------------------------------- +!!* 4. COMPUTES EVAPORATION PROCESS +!! ---------------------------- +!! +CALL AER_WET_DEP_KMT_EVAP +! + +!------------------------------------------------------------------------------- +! +! +CONTAINS +! +! +!------------------------------------------------------------------------------- +! +SUBROUTINE AER_WET_MASS_TRANSFER +! +!* 0. DECLARATIONS +! ------------ +! +use mode_tools, only: Countjv + +IMPLICIT NONE +! +!* 0.2 declaration of local variables +! +! +INTEGER , DIMENSION(SIZE(GCLOUD)) :: I1C,I2C,I3C! Used to replace the COUNT +INTEGER , DIMENSION(SIZE(GRAIN)) :: I1R,I2R,I3R ! Used to replace the COUNT +INTEGER :: JL ! and PACK intrinsics +INTEGER :: JKAQ ! counter for chemistry +! +! +! 1 Mass transfer Aerosol to cloud (Tost et al., 2006) +! +GCLOUD(:,:,:) = .FALSE. +GCLOUD(:,:,:) = PRCS(:,:,:)>XRTMIN(2) +ICLOUD = COUNTJV( GCLOUD(:,:,:),I1C(:),I2C(:),I3C(:)) +IF( ICLOUD >= 1 ) THEN +ALLOCATE(ZSVT(ICLOUD,KMODE*3)) +ALLOCATE(ZRHODREF(ICLOUD)) +ALLOCATE(ZTHT(ICLOUD)) +ALLOCATE(ZRC(ICLOUD)) +ALLOCATE(ZPABST(ICLOUD)) +ALLOCATE(ZRG(ICLOUD,KMODE)) +ALLOCATE(ZTEMP(ICLOUD)) +ALLOCATE(ZMU(ICLOUD)) +ALLOCATE(ZRCT(ICLOUD)) +ALLOCATE(ZVGG(ICLOUD,KMODE)) +ALLOCATE(ZDPG(ICLOUD,KMODE)) +ALLOCATE(ZGAMMA(ICLOUD)) +ALLOCATE(ZW1(ICLOUD)) +ALLOCATE(ZCOR(ICLOUD,KMODE)) +ALLOCATE(ZMASSMIN(ICLOUD,KMODE)) +ALLOCATE(ZWLBDC(ICLOUD)) +ALLOCATE(ZCONC1D(ICLOUD)) +ALLOCATE(ZDENSITY_AER(ICLOUD,KMODE)) +ZSVT(:,:) = 0. +DO JL=1,ICLOUD + DO JKAQ = 1, KMODE + ZRG(JL,JKAQ) = PRGAER(I1C(JL),I2C(JL),I3C(JL),JKAQ) + ENDDO + DO JKAQ = 1, KMODE*3 + ZSVT(JL,JKAQ) = PSVT(I1C(JL),I2C(JL),I3C(JL),JKAQ) + END DO + ! + ZTHT(JL) = PTHT(I1C(JL),I2C(JL),I3C(JL)) + ZRC(JL) = ZRAY(I1C(JL),I2C(JL),I3C(JL)) + ZPABST(JL) = PPABST(I1C(JL),I2C(JL),I3C(JL)) + ZRCT(JL) = PRCS(I1C(JL),I2C(JL),I3C(JL)) + ZRHODREF(JL) = PRHODREF(I1C(JL),I2C(JL),I3C(JL)) + ZMASSMIN(JL,:) = PMASSMIN(I1C(JL),I2C(JL),I3C(JL),:) + ZWLBDC(JL) = ZLBC(I1C(JL),I2C(JL),I3C(JL)) + ZCONC1D(JL) = ZCONC(I1C(JL),I2C(JL),I3C(JL)) + ZDENSITY_AER(JL,:) = PDENSITY_AER(I1C(JL),I2C(JL),I3C(JL),:) +END DO +IF (ANY(ZWLBDC(:)/=0.)) THEN ! case one moments + ! On calcule Rc a partir de M(3) car c'est le seul moment indt de alpha et nu + ! Rho_air * Rc / (Pi/6 * Rho_eau * Nc) = M(3) = 1/ (Lambda**3 * rapport des + ! gamma) + ZWLBDC(:) = ZWLBDC(:) * ZCONC1D(:) / (ZRHODREF(:) * ZRCT(:)) + ZWLBDC(:) = ZWLBDC(:)**XLBEXC + ZRC(:) = ZRC(:) / ZWLBDC(:) +END IF + +! +! initialize temperature + ZTEMP(:)=ZTHT(:)*(ZPABST(:)/XP00)**(XRD/XCPD) + +! compute diffusion and gravitation velocity + + CALL AER_VELGRAV(ZRG(:,:), ZPABST(:), & + KMODE, ZMU(:), ZVGG(:,:), & + ZDPG(:,:),ZTEMP(:),ZCOR(:,:), & + ZDENSITY_AER(:,:)) + +DO JKAQ = 1, KMODE +! Browninan nucleation scavenging (Pruppacher and Klett, 2000, p723) + ZGAMMA(:) = 1.35 * ZRCT(:)*ZRHODREF(:)*1.E-3 * ZDPG(:,JKAQ) /& + (ZRC(:)*ZRC(:)) + + ZW1(:) = ZSVT(:,JKAQ) * EXP(-ZGAMMA(:) * PTSTEP) + ZW1(:) = MAX(ZW1(:), ZMASSMIN(:,JKAQ)) + ZW1(:) = MIN(ZW1(:),ZSVT(:,JKAQ)) +! Aerosol mass in cloud + ZSVT(:,KMODE+JKAQ) = ZSVT(:,KMODE+JKAQ) + ZSVT(:,JKAQ) - ZW1(:) +! New aerosol mass + ZSVT(:,JKAQ) = ZW1(:) +! Return in 3D + PSVT(:,:,:,JKAQ) = & + UNPACK(ZSVT(:,JKAQ),MASK=GCLOUD(:,:,:),FIELD=PSVT(:,:,:,JKAQ)) + PSVT(:,:,:,KMODE+JKAQ) = & + UNPACK(ZSVT(:,KMODE+JKAQ),MASK=GCLOUD(:,:,:),FIELD=PSVT(:,:,:,KMODE+JKAQ)) +ENDDO +DEALLOCATE(ZSVT) +DEALLOCATE(ZRHODREF) +DEALLOCATE(ZTHT) +DEALLOCATE(ZRC) +DEALLOCATE(ZPABST) +DEALLOCATE(ZRG) +DEALLOCATE(ZTEMP) +DEALLOCATE(ZMU) +DEALLOCATE(ZRCT) +DEALLOCATE(ZVGG) +DEALLOCATE(ZDPG) +DEALLOCATE(ZGAMMA) +DEALLOCATE(ZW1) +DEALLOCATE(ZCOR) +DEALLOCATE(ZMASSMIN) +DEALLOCATE(ZWLBDC) +DEALLOCATE(ZCONC1D) +DEALLOCATE(ZDENSITY_AER) +END IF +! +! 2 Mass transfer Aerosol to Rain (Seinfeld and Pandis, 1998, Tost et al., 2006) +! +GRAIN(:,:,:) = .FALSE. +GRAIN(:,:,:) = PRRS(:,:,:)>XRTMIN(3) +IRAIN = COUNTJV( GRAIN(:,:,:),I1R(:),I2R(:),I3R(:)) +IF( IRAIN >= 1 ) THEN +! + ALLOCATE(ZRRT(IRAIN)) + ALLOCATE(ZSVT(IRAIN,3*KMODE)) + ALLOCATE(ZRHODREF(IRAIN)) + ALLOCATE(ZTHT(IRAIN)) + ALLOCATE(ZRR(IRAIN)) + ALLOCATE(ZNT(IRAIN)) + ALLOCATE(ZPABST(IRAIN)) + ALLOCATE(ZRG(IRAIN,KMODE)) + ALLOCATE(ZCOR(IRAIN,KMODE)) + ALLOCATE(ZTEMP(IRAIN)) + ALLOCATE(ZMU(IRAIN)) + ALLOCATE(ZVGG(IRAIN,KMODE)) + ALLOCATE(ZDPG(IRAIN,KMODE)) + ALLOCATE(ZMUW(IRAIN)) + ALLOCATE(ZEFC(IRAIN,KMODE)) + ALLOCATE(ZW1(IRAIN)) + ALLOCATE(ZFLUX(IRAIN)) + ALLOCATE(ZGAMMA(IRAIN)) + ALLOCATE(ZMASSMIN(IRAIN,KMODE)) + ALLOCATE(ZDENSITY_AER(IRAIN,KMODE)) + + ZSVT(:,:) = 0. + DO JL=1,IRAIN + DO JKAQ = 1, KMODE + ZRG(JL,JKAQ) = PRGAER(I1R(JL),I2R(JL),I3R(JL),JKAQ ) + ZSVT(JL,JKAQ) = PSVT(I1R(JL),I2R(JL),I3R(JL),JKAQ) + ZSVT(JL,KMODE*2+JKAQ) = PSVT(I1R(JL),I2R(JL),I3R(JL),KMODE*2+JKAQ) + END DO + ! + ZTHT(JL) = PTHT(I1R(JL),I2R(JL),I3R(JL)) + ZPABST(JL) = PPABST(I1R(JL),I2R(JL),I3R(JL)) + ZRRT(JL) = PRRS(I1R(JL),I2R(JL),I3R(JL)) + ZRHODREF(JL) = PRHODREF(I1R(JL),I2R(JL),I3R(JL)) + ZMASSMIN(JL,:) = PMASSMIN(I1R(JL),I2R(JL),I3R(JL),:) + ZNT(JL) = ZNRT(I1R(JL),I2R(JL),I3R(JL)) + ZDENSITY_AER(JL,:) = PDENSITY_AER(I1R(JL),I2R(JL),I3R(JL),:) + ENDDO +! +CALL AER_WET_DEP_KMT_EFFIC + +! Compute scavenging coefficient +ZFLUX(:) = 0. +ZRRT(:) = MAX(ZRRT(:), 0.) +! Effective precipitation flux (kg.m-2.s-1) +ZFLUX(:) = XFSEDR * ZRRT(:)**(XEXSEDR ) & + * ZRHODREF(:)**(XEXSEDR-XCEXVT) +ZFLUX(:) = MAX(ZFLUX(:), 0.) + +IF (ALL(ZNT(:) == 0.)) THEN ! case one moments +!Number concentration NT=No/lbda p. 415 Jacobson +!4/3 *pi *r³*NT*rho_eau(kg/m3) =rho(lwc)=rho(air)* qc(kg/kg) +ZNT (:) = XCCR/(XLBR*( ZRHODREF(:)* ZRRT(:) )**XLBEXR) +END IF + +ZRR(:) = (ZRRT(:)*ZRHODREF(:)/(XRHOLW*ZNT(:)*4./3.*XPI))**(1./3.) + +DO JKAQ = 1, KMODE + ! Tost et al, 2006 + ZGAMMA(:) = 0.75 * ZEFC(:,JKAQ) * ZFLUX(:) / (ZRR(:)*1E3) + ZW1(:) = ZSVT(:,JKAQ) * EXP(-ZGAMMA(:) * PTSTEP) + ZW1(:) = MAX(ZW1(:), ZMASSMIN(:,JKAQ)) + ZW1(:) = MIN(ZW1(:),ZSVT(:,JKAQ)) + + ! Aerosol mass in rain + ZSVT(:,KMODE*2+JKAQ) = ZSVT(:,KMODE*2+JKAQ) + ZSVT(:,JKAQ) - ZW1(:) + ! New aerosol mass + ZSVT(:,JKAQ) = ZW1(:) + + ! Return to 3D + PSVT(:,:,:,JKAQ) = & + UNPACK(ZSVT(:,JKAQ),MASK=GRAIN(:,:,:),FIELD=PSVT(:,:,:,JKAQ)) + PSVT(:,:,:,KMODE*2+JKAQ) = & + UNPACK(ZSVT(:,KMODE*2+JKAQ),MASK=GRAIN(:,:,:),FIELD=PSVT(:,:,:,KMODE*2+JKAQ)) +ENDDO + DEALLOCATE(ZRRT) + DEALLOCATE(ZSVT) + DEALLOCATE(ZRHODREF) + DEALLOCATE(ZTHT) + DEALLOCATE(ZRR) + DEALLOCATE(ZNT) + DEALLOCATE(ZPABST) + DEALLOCATE(ZRG) + DEALLOCATE(ZCOR) + DEALLOCATE(ZTEMP) + DEALLOCATE(ZMU) + DEALLOCATE(ZVGG) + DEALLOCATE(ZDPG) + DEALLOCATE(ZMUW) + DEALLOCATE(ZEFC) + DEALLOCATE(ZW1) + DEALLOCATE(ZFLUX) + DEALLOCATE(ZGAMMA) + DEALLOCATE(ZMASSMIN) + DEALLOCATE(ZDENSITY_AER) + END IF +END SUBROUTINE AER_WET_MASS_TRANSFER +! +SUBROUTINE AER_WET_DEP_KMT_WARM_SEDIMENT +! +!* Sedimentation of aerosol in rain droplets +! +!* 0. DECLARATIONS +! ------------ +! +IMPLICIT NONE +! +!* declaration of local variables +! +! +INTEGER :: JL ! and PACK intrinsics +INTEGER :: JKAQ ! counter for acquous aerosols +! +!------------------------------------------------------------------------------- +! +!* Time splitting initialization +ZTSPLITR = PTSTEP / REAL(KSPLITR) +! +ZW(:,:,:)=0. +ZRRS(:,:,:) = MAX(PRRS(:,:,:), 0.) +IKE = SIZE(PRCS,3) + +DO JK = 1 , SIZE(PZZ,3)-1 + ZW(:,:,JK) =ZTSPLITR/(( PZZ(:,:,JK+1)-PZZ(:,:,JK) )) +END DO +WHERE (ZRRS(:,:,:)<=XRTMIN(3)) + ZW(:,:,:)=0. +END WHERE +! +ZWSED(:,:,IKE+1) = 0. + +! Flux mass aerosol in rain droplets = +! Flux mass rain water * Mass aerosol in rain / Mass rain water +DO JKAQ = 1,KMODE + + DO JN = 1 , KSPLITR + ZWSED(:,:,1:IKE) = XFSEDR & + * (ZRRS(:,:,:))**(XEXSEDR-1.) & + * PRHODREF(:,:,:)**(XEXSEDR-XCEXVT) & + * PSVT(:,:,:,KMODE*2+JKAQ) + DO JK = 1, IKE + PSVT(:,:,JK,KMODE*2+JKAQ)= PSVT(:,:,JK,KMODE*2+JKAQ) + & + ZW(:,:,JK)*(ZWSED(:,:,JK+1)-ZWSED(:,:,JK)) + ! Aerosol mass in rain droplets need to be positive + PSVT(:,:,JK,KMODE*2+JKAQ)= MAX(PSVT(:,:,JK,KMODE*2+JKAQ), 0.) + END DO + END DO + +END DO +! + END SUBROUTINE AER_WET_DEP_KMT_WARM_SEDIMENT +! +!------------------------------------------------------------------------------- +! + SUBROUTINE AER_WET_DEP_KMT_ICE_WARM +! +!* 0. DECLARATIONS +! +IMPLICIT NONE +!------------------------------------------------------------------------------- +! +!* 1. compute the autoconversion of r_c for r_r production: RCAUTR +! +ZZW4(:,:,:)=0.0 +! to be sure no division by zero in case of ZZRCT = 0. +ZZRCT(:,:,:) = PRCT(:,:,:) +ZZRCT(:,:,:) = MAX(ZZRCT(:,:,:), XRTMIN(2)/2.) + +WHERE( (ZZRCT(:,:,:)>XRTMIN(2)) .AND. (PRCS(:,:,:)>0.0 ) ) + ZZW4(:,:,:) = MIN( PRCS(:,:,:),XTIMAUTC* & + MAX((ZZRCT(:,:,:)-XCRIAUTC/ PRHODREF(:,:,:)),0.0)) +END WHERE + +DO JKAQ = 1,KMODE + ZZW2(:,:,:) =0.0 + ZZW2(:,:,:)=ZZW4(:,:,:) * PSVT(:,:,:,KMODE+JKAQ)/ZZRCT(:,:,:) * PTSTEP + ZZW2(:,:,:) = MAX(MIN( ZZW2(:,:,:), PSVT(:,:,:,KMODE+JKAQ)),0.0) + +! For rain - Increase the aerosol conc in rain + PSVT(:,:,:,KMODE*2+JKAQ) = & + PSVT(:,:,:,KMODE*2+JKAQ) + ZZW2(:,:,:) +! For Cloud Decrease the aerosol conc in cloud + PSVT(:,:,:,KMODE+JKAQ) = & + PSVT(:,:,:,KMODE+JKAQ) - ZZW2(:,:,:) +ENDDO + + +! +!* 2. compute the accretion of r_c for r_r production: RCACCR +! +ZZW4(:,:,:)=0.0 +ZLBDAR(:,:,:)=0.0 +WHERE ( (ZZRCT(:,:,:)>XRTMIN(2)) .AND. (PRRT(:,:,:)>XRTMIN(3)) & + .AND. (PRCS(:,:,:)> 0.0 ) ) + ZLBDAR(:,:,:) = XLBR*( PRHODREF(:,:,:)* PRRT(:,:,:) )**XLBEXR + ZZW4(:,:,:) = MIN( PRCS(:,:,:),XFCACCR * ZZRCT(:,:,:) & + * ZLBDAR(:,:,:)**XEXCACCR & + * PRHODREF(:,:,:)**(-XCEXVT) ) +END WHERE +! +DO JKAQ = 1,KMODE + ZZW2(:,:,:)=0.0 + ZZW2(:,:,:)=ZZW4(:,:,:) * PSVT(:,:,:,KMODE+JKAQ)/ZZRCT(:,:,:) * PTSTEP + ZZW2(:,:,:) = MAX(MIN(ZZW2(:,:,:),PSVT(:,:,:,KMODE+JKAQ)), 0.0) + +!* 3. compute the new acquous aerosol mass +! +! For rain - Increase the aerosol conc in rain + PSVT(:,:,:,KMODE*2+JKAQ) = PSVT(:,:,:,KMODE*2+JKAQ) + ZZW2(:,:,:) +! For Cloud Decrease the aerosol conc in cloud + PSVT(:,:,:,KMODE+JKAQ) = PSVT(:,:,:,KMODE+JKAQ) - ZZW2(:,:,:) +ENDDO + + END SUBROUTINE AER_WET_DEP_KMT_ICE_WARM +!--------------------------------------------------------------------------------------- + SUBROUTINE AER_WET_DEP_KMT_EVAP +! +!* COMPUTES THE EVAPORATION OF CLOUD-RAIN FOR THE +!* RE-RELEASE OF AER INTO THE ENVIRONMENT +! -------------------------------------- +! + +! +!* 0. DECLARATIONS +! ------------ +! +IMPLICIT NONE +!* declaration of local variables +! +INTEGER :: JKAQ ! counter for aerosols + +!* 1. compute the evaporation of r_r: RREVAV + +!When partial reevaporation of precip takes place, the fraction of +!tracer precipitating form above is reevaporated is equal to +!half of the evaporation rate of water +! +! Rain water evaporated during PTSTEP in kg/kg +ZZEVAP(:,:,:) = PEVAP3D(:,:,:) * PTSTEP +! Fraction of rain water evaporated +! at this stage (bulk), we consider that the flux of evaporated aerosol +! is a ratio of the evaporated rain water. +! It will interested to calculate with a two moment scheme (C2R2 or C3R5) +! the complete evaporation of rain droplet to use it for the compuation +! of the evaporated aerosol flux. +ZWEVAP(:,:,:)=0.0 +WHERE( PRRT(:,:,:) .GT. XRTMIN(3) ) + ZWEVAP(:,:,:) = ZZEVAP(:,:,:)/(PRRT(:,:,:)) +END WHERE +ZWEVAP(:,:,:)=MIN(ZWEVAP(:,:,:),1.0) +ZWEVAP(:,:,:)=MAX(ZWEVAP(:,:,:),0.0) + +!* 2. compute the mask of r_c evaporation : all cloud is evaporated +! no partial cloud evaporation at this stage +ZMASK(:,:,:) = 0. +WHERE( PRCS(:,:,:) .LT. XRTMIN(2) ) + ZMASK(:,:,:) = 1. +END WHERE +! +! +DO JKAQ = 1,KMODE + ZZW1(:,:,:) = ZMASK(:,:,:)*PSVT(:,:,:,KMODE+JKAQ) + + ZZW2(:,:,:) = ZWEVAP(:,:,:)*PSVT(:,:,:,KMODE*2+JKAQ) + +! 3. New dry aerosol mass +! + PSVT(:,:,:,JKAQ) = PSVT(:,:,:,JKAQ) + ZZW2(:,:,:) + ZZW1(:,:,:) +! 4. New cloud aerosol mass +! + PSVT(:,:,:,KMODE+JKAQ) = PSVT(:,:,:,KMODE+JKAQ) - ZZW1(:,:,:) + +! 5. New rain aerosol mass +! + PSVT(:,:,:,KMODE*2+JKAQ) = PSVT(:,:,:,KMODE*2+JKAQ) - ZZW2(:,:,:) +END DO +! +! + END SUBROUTINE AER_WET_DEP_KMT_EVAP +!--------------------------------------------------------------------------------------- + SUBROUTINE AER_WET_DEP_KMT_EFFIC +! +!* COMPUTES THE EFFICIENCY FACTOR +! ------------------------------ +! +! +!* 0. DECLARATIONS +! ------------ +! +IMPLICIT NONE +! +! +!* 1. COMPUTES THE EFFICIENCY FACTOR +! -------------------------------------- +! +!* 1.1 compute gravitational velocities +! +!initialize + ZTEMP(:)=ZTHT(:)*(ZPABST(:)/XP00)**(XRD/XCPD) + ZTEMP(:)=MAX(ZTEMP(:),1.e-12) + + CALL AER_VELGRAV(ZRG(:,:), ZPABST(:), KMODE, & + ZMU(:), ZVGG(:,:), & + ZDPG(:,:),ZTEMP(:), & + ZCOR(:,:), ZDENSITY_AER(:,:)) + +! Above gives mu (ZMU), v(aerosol)(PVGG, m/s), diffusion (ZDPG, m2/s) +! +!* 1.2 Compute Water Viscocity in kg/m/s Prup. & Klett, p.95 +! +! + A0=1.76 + A1=-5.5721e-2 + A2=-1.3943e-3 + A3=-4.3015e-5 + ZMUW(:)=A0*EXP(A1*(ZTEMP(:)-273.15) & + +A2*(ZTEMP(:)-273.15) + A3*(ZTEMP(:)-273.15))*1.e-3 + + A1=-3.5254e-2 + A2=4.7163e-4 + A3=-6.0667e-6 + + WHERE (ZTEMP(:)>273.15) + ZMUW(:)=A0*EXP(A1*(ZTEMP(:)-273.15) & + +A2*(ZTEMP(:)-273.15) + A3*(ZTEMP(:)-273.15))*1.e-3 + END WHERE + ZMUW(:)=MAX(ZMUW(:),1.e-12) + +! +!* 1.3 compute efficiency factor +! +! This gives aerosol collection efficiency by calculating Reynolds number +! schmidt number, stokes number, etc + CALL AER_EFFIC(ZRG(:,:), ZVGG(:,:), & !aerosol radius/velocity + ZRHODREF(:), & !Air density + ZMUW(:), ZMU(:), & !mu water/air + ZDPG(:,:), ZEFC(:,:), & !diffusivity, efficiency + ZRRT(:), KMODE, & !Rain water, nb aerosols modes + ZTEMP(:),ZCOR(:,:), & ! Temperature, Cunnimgham coeff + ZDENSITY_AER(:,:)) ! aerosol density +! +END SUBROUTINE AER_WET_DEP_KMT_EFFIC +! +!------------------------------------------------------------------------------- +! +END SUBROUTINE AER_WET_DEP_KMT_WARM diff --git a/src/mesonh/ext/aero_effic3D.f90 b/src/mesonh/ext/aero_effic3D.f90 new file mode 100644 index 0000000000000000000000000000000000000000..4c592f493e45455bb9308f780c0933bdfe16ba17 --- /dev/null +++ b/src/mesonh/ext/aero_effic3D.f90 @@ -0,0 +1,247 @@ +!MNH_LIC Copyright 1994-2018 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. +! +! ######spll + MODULE MODI_AERO_EFFIC3D +!! ######################## +!! +! +INTERFACE +!! +SUBROUTINE AERO_EFFIC3D(PRG,PVGG, & !aerosol radius/fall speed (m/s) + PRHODREF, & !Air density + PMUW, PMU, & !mu water/air + PDPG, & !diffusivity + PURR, & ! Rain water m.r. at time t + KMODE, & ! Number of aerosol modes + PTEMP, PCOR, & ! air temp, cunningham corr factor + PDENSITY_AER, & ! aerosol density + PEFFIC_AER ) ! scavenging efficiency for aerosol +! +IMPLICIT NONE +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRG, PVGG +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PDPG +REAL, DIMENSION(:,:,:), INTENT(IN) :: PMU, PMUW +REAL, DIMENSION(:,:,:), INTENT(IN) :: PURR +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTEMP +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PCOR +INTEGER, INTENT(IN) :: KMODE +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PDENSITY_AER +REAL, DIMENSION(:,:,:,:), INTENT(INOUT):: PEFFIC_AER + + + +END SUBROUTINE AERO_EFFIC3D +!! +END INTERFACE +END MODULE MODI_AERO_EFFIC3D +! ######spll +SUBROUTINE AERO_EFFIC3D(PRG,PVGG, & !aerosol radius/fall speed (m/s) + PRHODREF, & !Air density + PMUW, PMU, & !mu water/air + PDPG, & !diffusivity + PURR, & ! Rain water m.r. at time t + KMODE, & ! Number of aerosol modes + PTEMP, PCOR, & ! air temp, cunningham corr factor + PDENSITY_AER, & ! aerosol density + PEFFIC_AER ) ! scavenging efficiency for aerosol +!! ####################################### +!!**********AERO_EFFIC3D********** +!! PURPOSE +!! ------- +!! Calculate the collection efficiency of +! a falling drop interacting with a dust aerosol +! for use with aer_wet_dep_kmt_warm.f90 +!! +!!** METHOD +!! ------ +!! Using basic theory, and the one dimensional variables sent +!! from aer_wet_dep_kmt_warm.f90, calculation of the average +!! fall speed calculations, chapter 17.3.4, MESONH Handbook +!! droplet number based on the Marshall_Palmer distribution +!! and Stokes number, Reynolds number, etc. based on theory +!! (S&P, p.1019) +!! +!! REFERENCE +!! --------- +!! Seinfeld and Pandis p.1019 +!! MESONH Handbook chapter 17.3.4 +!! +!! AUTHOR +!! ------ +!! K. Crahan Kaku / P. Tulet (CNRM/GMEI) +!! +!! MODIFICATIONS +!! ------------- +!! Philippe Wautelet 28/05/2018: corrected truncated integer division (1/12 -> 1./12.) +!! +!----------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_RAIN_ICE_PARAM_n +USE MODD_RAIN_ICE_DESCR_n +USE MODD_CST, ONLY : XPI, XRHOLW, XP00, XRD +USE MODD_PARAMETERS , ONLY : JPVEXT +USE MODD_REF, ONLY : XTHVREFZ +! +IMPLICIT NONE +! +!* 0.1 declarations of arguments +! +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRG, PVGG +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PDPG +REAL, DIMENSION(:,:,:), INTENT(IN) :: PMU, PMUW +REAL, DIMENSION(:,:,:), INTENT(IN) :: PURR +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTEMP +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PCOR +INTEGER, INTENT(IN) :: KMODE +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PDENSITY_AER +REAL, DIMENSION(:,:,:,:), INTENT(INOUT):: PEFFIC_AER +! +!* 0.2 declaration of local variables +! +INTEGER :: IKB ! Coordinates of the first physical + ! points along z +REAL :: ZRHO00 ! Surface reference air density +!viscosity ratio, Reynolds number +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3)) :: ZOMG, ZREY +!rain radius, m, and rain fall speed, m/s; aerosol radius (m), +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3)) :: ZRR, ZVR +!lambda, number concentration according to marshall palmer, +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3)) :: ZNT, ZLBDA +! Rain water m.r. source +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3)) :: ZRRS +!RHO_dref*r_r, Rain LWC +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3)) :: ZRLWC +! schmidts number +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3),KMODE) :: ZSCH +! +!Stokes number, ratio of diameters,aerosol radius +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3),KMODE) :: ZSTO, ZPHI, ZRG +! S Star Term +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3)) :: ZSTA, ZDIFF, ZTAU +! +!Term 1, Term 2, Term 3, Term 4 such that +! E = Term1 * Term 2 + Term 3 + Term 4 +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3),KMODE) :: ZT1, ZT2 +REAL, DIMENSION(SIZE(PRG,1),SIZE(PRG,2),SIZE(PRG,3),KMODE) :: ZT3, ZT4 +! +INTEGER :: JI,JK +! +!----------------------------------------------------------------- +ZLBDA = 1E20 +ZNT = 1E-20 +ZRR = 10E-6 +ZRRS(:,:,:)=PURR(:,:,:) +IKB = 1 + JPVEXT +ZRHO00 = XP00/(XRD*XTHVREFZ(IKB)) +ZRG(:,:,:,:)=PRG(:,:,:,:)*1.E-6 !change units to meters +! +!Fall Speed calculations +!similar to rain_ice.f90, chapter 17.3.4, MESONH Handbook +! +ZVR (:,:,:)= XFSEDR * ZRRS(:,:,:)**(XEXSEDR-1) * & + PRHODREF(:,:,:)**(XEXSEDR-XCEXVT-1) + +! Drop Radius calculation in m +!lbda = pi*No*rho(lwc)/(rho(dref)*rain rate) p.212 MESONH Handbook +! compute the slope parameter Lbda_r + +WHERE((ZRRS(:,:,:).GT. 0.).AND.(PRHODREF(:,:,:) .GT. 0.)) + +ZLBDA(:,:,:) = XLBR*(PRHODREF(:,:,:)*ZRRS(:,:,:))**XLBEXR +!Number concentration NT=No/lbda p. 415 Jacobson +ZNT(:,:,:) = XCCR/ZLBDA(:,:,:) +!rain lwc (kg/m3) = rain m.r.(kg/kg) * rho_air(kg/m3) +ZRLWC(:,:,:)=ZRRS(:,:,:)*PRHODREF(:,:,:) +!4/3 *pi *r³*NT*rho_eau(kg/m3) =rho(lwc)=rho(air)* qc(kg/kg) +ZRR(:,:,:) = (ZRLWC(:,:,:)/(XRHOLW*ZNT(:,:,:)*4./3.*XPI))**(1./3.) +END WHERE + +ZRR(:,:,:) = MIN(ZRR(:,:,:), 100.E-6) + + +!Fall speed cannot be faster than 7 m/s +ZVR (:,:,:)=MIN(ZVR (:,:,:),7.) + + +!Ref SEINFELD AND PANDIS p.1019 +! Viscosity Ratio +ZOMG(:,:,:)=PMUW(:,:,:)/PMU(:,:,:) +!!Reynolds number +ZREY(:,:,:)=ZRR(:,:,:)*ZVR(:,:,:)*PRHODREF(:,:,:)/PMU(:,:,:) +ZREY(:,:,:)= MAX(ZREY(:,:,:), 1E-2) + + +!S Star +ZSTA(:,:,:)=(1.2+(1./12.)*LOG(1.+ZREY(:,:,:)))/(1.+LOG(1.+ZREY(:,:,:))) + +PEFFIC_AER(:,:,:,:)=0.0 + +DO JI=1,KMODE + +! +!Scmidts number + ZSCH(:,:,:,JI)=PMU(:,:,:)/PRHODREF(:,:,:)/PDPG(:,:,:,JI) +! Rain-Aerosol relative velocity + ZDIFF(:,:,:) = MAX(ZVR(:,:,:)-PVGG(:,:,:,JI),0.) + + +! Relaxation time + ZTAU(:,:,:) = (ZRG(:,:,:,JI)*2.)**2. * PDENSITY_AER(:,:,:,JI) * PCOR(:,:,:,JI) / (18.*PMU(:,:,:)) + + +! Stockes number + ZSTO(:,:,:,JI)= ZTAU(:,:,:) * ZDIFF(:,:,:) / ZRR(:,:,:) + + + +!Ratio of diameters + ZPHI(:,:,:,JI)=ZRG(:,:,:,JI)/ZRR(:,:,:) + ZPHI(:,:,:,JI)=MIN(ZPHI(:,:,:,JI), 1.) +!Term 1 + ZT1(:,:,:,JI)=4.0/ZREY(:,:,:)/ZSCH(:,:,:,JI) + +!Term 2 + ZT2(:,:,:,JI)=1.0+(0.4*ZREY(:,:,:)**(0.5)*ZSCH(:,:,:,JI)**(1./3.))+ & + (0.16*ZREY(:,:,:)**(0.5)*ZSCH(:,:,:,JI)**(0.5)) + +!Brownian diffusion + ZT1(:,:,:,JI)= ZT1(:,:,:,JI)*ZT2(:,:,:,JI) + +!Term 3 - interception + ZT3(:,:,:,JI)=4.*ZPHI(:,:,:,JI)*(1./ZOMG(:,:,:)+ & + (1.0+(2.0*ZREY(:,:,:)**0.5))*ZPHI(:,:,:,JI)) + + ZT4(:,:,:,JI)=0.0 + WHERE(ZSTO(:,:,:,JI).GT.ZSTA(:,:,:)) +!Term 4 - impaction + ZT4(:,:,:,JI)=((ZSTO(:,:,:,JI)-ZSTA(:,:,:))/ & + (ZSTO(:,:,:,JI)-ZSTA(:,:,:)+2./3.))**(3./2.) & + *((XRHOLW/PDENSITY_AER(:,:,:,JI))**(1./2.)) + + END WHERE + +!Collision Efficiancy + + + PEFFIC_AER(:,:,:,JI)=ZT1(:,:,:,JI)+ ZT3(:,:,:,JI)+ZT4(:,:,:,JI) + +! Physical radius of a rain collector droplet up than 20 um + +WHERE (ZRR(:,:,:) .LE. 9.9E-6) + PEFFIC_AER(:,:,:,JI)= 0. +END WHERE + +ENDDO + +PEFFIC_AER(:,:,:,:)=MIN(PEFFIC_AER(:,:,:,:),1.0) +PEFFIC_AER(:,:,:,:)=MAX(PEFFIC_AER(:,:,:,:),0.0) + +END SUBROUTINE AERO_EFFIC3D diff --git a/src/mesonh/ext/aircraft_balloon_evol.f90 b/src/mesonh/ext/aircraft_balloon_evol.f90 new file mode 100644 index 0000000000000000000000000000000000000000..4d7612cc68004227745d96853592431b3c72e0d2 --- /dev/null +++ b/src/mesonh/ext/aircraft_balloon_evol.f90 @@ -0,0 +1,1743 @@ +!MNH_LIC Copyright 2000-2021 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_AIRCRAFT_BALLOON_EVOL +! ########################## +! +INTERFACE +! + SUBROUTINE AIRCRAFT_BALLOON_EVOL(PTSTEP, & + PXHAT, PYHAT, PZ, & + PMAP, PLONOR, PLATOR, & + PU, PV, PW, PP, PTH, PR, PSV, PTKE, & + PTS, PRHODREF, PCIT,TPFLYER, PSEA ) +! +USE MODD_AIRCRAFT_BALLOON +! +REAL, INTENT(IN) :: PTSTEP ! time step +REAL, DIMENSION(:), INTENT(IN) :: PXHAT ! x coordinate +REAL, DIMENSION(:), INTENT(IN) :: PYHAT ! y coordinate +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZ ! z array +REAL, DIMENSION(:,:), INTENT(IN) :: PMAP ! map factor +REAL, INTENT(IN) :: PLONOR ! origine longitude +REAL, INTENT(IN) :: PLATOR ! origine latitude +REAL, DIMENSION(:,:,:), INTENT(IN) :: PU ! horizontal wind X component +REAL, DIMENSION(:,:,:), INTENT(IN) :: PV ! horizontal wind Y component +REAL, DIMENSION(:,:,:), INTENT(IN) :: PW ! vertical wind +REAL, DIMENSION(:,:,:), INTENT(IN) :: PP ! pressure +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTH ! potential temperature +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PR ! water mixing ratios +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSV ! Scalar variables +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKE ! turbulent kinetic energy +REAL, DIMENSION(:,:), INTENT(IN) :: PTS ! surface temperature +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF ! dry air density of the reference state +REAL, DIMENSION(:,:,:), INTENT(IN) :: PCIT ! pristine ice concentration +! +TYPE(FLYER), INTENT(INOUT) :: TPFLYER! balloon/aircraft +REAL, DIMENSION(:,:),OPTIONAL,INTENT(IN) :: PSEA +! +!------------------------------------------------------------------------------- +! +END SUBROUTINE AIRCRAFT_BALLOON_EVOL +! +END INTERFACE +! +END MODULE MODI_AIRCRAFT_BALLOON_EVOL +! +! ######################################################## + SUBROUTINE AIRCRAFT_BALLOON_EVOL(PTSTEP, & + PXHAT, PYHAT, PZ, & + PMAP, PLONOR, PLATOR, & + PU, PV, PW, PP, PTH, PR, PSV, PTKE, & + PTS, PRHODREF, PCIT,TPFLYER, PSEA ) +! ######################################################## +! +! +!!**** *AIRCRAFT_BALLOON_EVOL* - (advects and) stores +!! balloons/aircrafts in the model +!! +!! PURPOSE +!! ------- +! +! +!!** METHOD +!! ------ +!! +!! 1) All the balloons are tested. If the current balloon is +!! a) in the current model +!! b) not crashed +!! the following computations are done. +!! +!! 2) The balloon position is computed. +!! Interpolations at balloon positions are performed according to mass +!! points (because density is computed here for iso-density balloons). +!! Therefore, all model variables are used at mass points. Shuman averaging +!! are performed on X, Y, Z, U, V, W. +!! +!! 3) Storage of balloon data +!! If storage is asked for this time-step, the data are recorded in the +!! balloon time-series. +!! +!! 4) Balloon advection +!! If the balloon is launched, it is advected according its type +!! a) iso-density balloons are advected following horizontal wind. +!! the slope of the iso-density surfaces is neglected. +!! b) radio-sounding balloons are advected according to all wind velocities. +!! the vertical ascent speed is added to the vertical wind speed. +!! c) Constant Volume balloons are advected according to all wind velocities. +!! the vertical ascent speed is computed using the balloon equation +!! +!! +!! EXTERNAL +!! -------- +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! Valery Masson * Meteo-France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 15/05/2000 +!! Apr,19, 2001 (G.Jaubert) add CVBALL type +!! March, 2008 (P.Lacarrere) Add 3D fluxes +!! Dec,12, 2008 (M. Leriche) move ZTDIST out from if.not.(tpflyer%fly) +!! Dec,15, 2008 (V. Masson) correct do while aircraft move +!! March, 2013 (O.Caumont) add radar reflectivities +!! April, 2014 (C.Lac) allow RARE calculation only if CCLOUD=ICE3 +!! May, 2014 (O.Caumont) modify RARE for hydrometeors containing ice +!! add bright band calculation for RARE +!! Feb, 2015 (C.Lac) Correction to prevent aircraft crash +!! July, 2015 (O.Nuissier/F.Duffourg) Add microphysics diagnostic for +!! aircraft, ballon and profiler +!! October, 2016 (G.DELAUTIER) LIMA +!! March,28, 2018 (P. Wautelet) replace TEMPORAL_DIST by DATETIME_DISTANCE +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 13/09/2019: budget: simplify and modernize date/time management +! P. Wautelet 01/10/2020: bugfix: initialize GSTORE +! P. Wautelet 14/01/2021: bugfixes: -ZXCOEF and ZYCOEF were not computed if CVBALL +! -PCIT was used if CCLOUD/=ICEx (not allocated) +! -PSEA was always used even if not allocated (CSURF/=EXTE) +! -do not use PMAP if cartesian domain +! +!! -------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_AIRCRAFT_BALLOON +USE MODD_CONF +USE MODD_CST +USE MODD_DIAG_IN_RUN +USE MODD_GRID +USE MODD_LUNIT_n, ONLY: TLUOUT +USE MODD_NESTING +USE MODD_NSV, ONLY : NSV_LIMA_NI,NSV_LIMA_NR,NSV_LIMA_NC +USE MODD_PARAMETERS +USE MODD_PARAM_LIMA, ONLY: XALPHAR_L=>XALPHAR,XNUR_L=>XNUR,XALPHAS_L=>XALPHAS,XNUS_L=>XNUS,& + XALPHAG_L=>XALPHAG,XNUG_L=>XNUG, XALPHAI_L=>XALPHAI,XNUI_L=>XNUI,& + XRTMIN_L=>XRTMIN,XALPHAC_L=>XALPHAC,XNUC_L=>XNUC,LSNOW_T_L=>LSNOW_T +USE MODD_PARAM_LIMA_COLD, ONLY: XDI_L=>XDI,XLBEXI_L=>XLBEXI,XLBI_L=>XLBI,XAI_L=>XAI,XBI_L=>XBI,XC_I_L=>XC_I,& + XLBEXS_L=>XLBEXS,XLBS_L=>XLBS,XCCS_L=>XCCS,& + XAS_L=>XAS,XBS_L=>XBS,XCXS_L=>XCXS,XNS_L=>XNS, & + XLBDAS_MAX,XLBDAS_MIN +USE MODD_PARAM_LIMA_MIXED, ONLY: XDG_L=>XDG,XLBEXG_L=>XLBEXG,XLBG_L=>XLBG,XCCG_L=>XCCG,& + XAG_L=>XAG,XBG_L=>XBG,XCXG_L=>XCXG,XCG_L=>XCG +USE MODD_PARAM_LIMA_WARM, ONLY: XLBEXR_L=>XLBEXR,XLBR_L=>XLBR,XBR_L=>XBR,XAR_L=>XAR,& + XBC_L=>XBC,XAC_L=>XAC +USE MODD_PARAM_n, ONLY: CCLOUD, CSURF +USE MODD_PARAM_ICE_n, ONLY: LSNOW_T_I=>LSNOW_T +USE MODD_RAIN_ICE_DESCR_n, ONLY: XALPHAR_I=>XALPHAR,XNUR_I=>XNUR,XLBEXR_I=>XLBEXR,& + XLBR_I=>XLBR,XCCR_I=>XCCR,XBR_I=>XBR,XAR_I=>XAR,& + XALPHAC_I=>XALPHAC,XNUC_I=>XNUC,& + XLBC_I=>XLBC,XBC_I=>XBC,XAC_I=>XAC,& + XALPHAC2_I=>XALPHAC2,XNUC2_I=>XNUC2,& + XALPHAS_I=>XALPHAS,XNUS_I=>XNUS,XLBEXS_I=>XLBEXS,& + XLBS_I=>XLBS,XCCS_I=>XCCS,XAS_I=>XAS,XBS_I=>XBS,XCXS_I=>XCXS,XNS_I=>XNS,& + XALPHAG_I=>XALPHAG,XNUG_I=>XNUG,XDG_I=>XDG,XLBEXG_I=>XLBEXG,& + XLBG_I=>XLBG,XCCG_I=>XCCG,XAG_I=>XAG,XBG_I=>XBG,XCXG_I=>XCXG,XCG_I=>XCG,& + XALPHAI_I=>XALPHAI,XNUI_I=>XNUI,XDI_I=>XDI,XLBEXI_I=>XLBEXI,& + XLBI_I=>XLBI,XAI_I=>XAI,XBI_I=>XBI,XC_I_I=>XC_I,& + XRTMIN_I=>XRTMIN,XCONC_LAND,XCONC_SEA +USE MODD_REF_n, ONLY: XRHODREF +USE MODD_TIME, only: tdtexp +USE MODD_TIME_n, only: tdtcur +USE MODD_TURB_FLUX_AIRCRAFT_BALLOON +! +USE MODE_DATETIME +USE MODE_FGAU, ONLY: GAULAG +USE MODE_FSCATTER, ONLY: QEPSW,QEPSI,BHMIE,MOMG,MG +USE MODE_GRIDPROJ +USE MODE_ll +USE MODE_MSG +! +USE MODI_GAMMA, ONLY: GAMMA +USE MODI_WATER_SUM +! +IMPLICIT NONE +! +! +!* 0.1 declarations of arguments +! +! +REAL, INTENT(IN) :: PTSTEP ! time step +REAL, DIMENSION(:), INTENT(IN) :: PXHAT ! x coordinate +REAL, DIMENSION(:), INTENT(IN) :: PYHAT ! y coordinate +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZ ! z array +REAL, DIMENSION(:,:), INTENT(IN) :: PMAP ! map factor +REAL, INTENT(IN) :: PLONOR ! origine longitude +REAL, INTENT(IN) :: PLATOR ! origine latitude +REAL, DIMENSION(:,:,:), INTENT(IN) :: PU ! horizontal wind X component +REAL, DIMENSION(:,:,:), INTENT(IN) :: PV ! horizontal wind Y component +REAL, DIMENSION(:,:,:), INTENT(IN) :: PW ! vertical wind +REAL, DIMENSION(:,:,:), INTENT(IN) :: PP ! pressure +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTH ! potential temperature +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PR ! water mixing ratios +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSV ! Scalar variables +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKE ! turbulent kinetic energy +REAL, DIMENSION(:,:), INTENT(IN) :: PTS ! surface temperature +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF ! dry air density of the reference state +REAL, DIMENSION(:,:,:), INTENT(IN) :: PCIT ! pristine ice concentration +! +TYPE(FLYER), INTENT(INOUT) :: TPFLYER! balloon/aircraft +REAL, DIMENSION(:,:), INTENT(IN) :: PSEA +! +!------------------------------------------------------------------------------- +! +! 0.2 declaration of local variables +! +! +INTEGER :: IMI ! model index +REAL :: ZTHIS_PROC ! 1 if balloon is currently treated by this proc., else 0 +! +INTEGER :: IIB ! current processor domain sizes +INTEGER :: IJB +INTEGER :: IIE +INTEGER :: IJE +INTEGER :: IIU +INTEGER :: IJU +INTEGER :: IKB +INTEGER :: IKE +INTEGER :: IKU +! +INTEGER :: JK ! loop index +! +REAL, DIMENSION(SIZE(PXHAT)) :: ZXHATM ! mass point coordinates +REAL, DIMENSION(SIZE(PYHAT)) :: ZYHATM ! mass point coordinates +! +REAL, DIMENSION(2,2,SIZE(PZ,3)) :: ZZM ! mass point coordinates +REAL, DIMENSION(2,2,SIZE(PZ,3)) :: ZZU ! U points z coordinates +REAL, DIMENSION(2,2,SIZE(PZ,3)) :: ZZV ! V points z coordinates +REAL, DIMENSION(2,2,SIZE(PZ,3)) :: ZWM ! mass point wind +! +REAL, DIMENSION(2,2,SIZE(PTH,3)) :: ZTHV ! virtual potential temperature +REAL, DIMENSION(2,2,SIZE(PTH,3)) :: ZTV ! virtual temperature +REAL, DIMENSION(2,2,SIZE(PTH,3)) :: ZTEMP ! temperature +REAL, DIMENSION(2,2,SIZE(PTH,3)) :: ZEXN ! Exner function +REAL, DIMENSION(2,2,SIZE(PTH,3)) :: ZRHO ! air density +REAL :: ZFLYER_EXN ! balloon/aircraft Exner func. +REAL, DIMENSION(2,2,SIZE(PTH,3)) :: ZTHW_FLUX ! +REAL, DIMENSION(2,2,SIZE(PTH,3)) :: ZRCW_FLUX ! +REAL, DIMENSION(2,2,SIZE(PSV,3),SIZE(PSV,4)) :: ZSVW_FLUX +! +REAL :: ZTDIST ! time until launch (sec) +LOGICAL :: GLAUNCH ! launch/takeoff is effective at this time-step (if true) +LOGICAL :: GSTORE ! storage occurs at this time step +! +INTEGER :: II ! mass balloon position (x index) +INTEGER :: IJ ! mass balloon position (y index) +INTEGER :: IU ! U flux point balloon position (x index) +INTEGER :: IV ! V flux point balloon position (y index) +INTEGER :: IDU ! difference between IU and II +INTEGER :: IDV ! difference between IV and IJ +! +INTEGER :: IK00 ! balloon position for II , IJ +INTEGER :: IK01 ! balloon position for II , IJ+1 +INTEGER :: IK10 ! balloon position for II+1, IJ +INTEGER :: IK11 ! balloon position for II+1, IJ+1 +INTEGER :: IU00 ! balloon position for IU , IJ +INTEGER :: IU01 ! balloon position for IU , IJ+1 +INTEGER :: IU10 ! balloon position for IU+1, IJ +INTEGER :: IU11 ! balloon position for IU+1, IJ+1 +INTEGER :: IV00 ! balloon position for II , IV +INTEGER :: IV01 ! balloon position for II , IV+1 +INTEGER :: IV10 ! balloon position for II+1, IV +INTEGER :: IV11 ! balloon position for II+1, IV+1 +! +REAL :: ZXCOEF ! X direction interpolation coefficient +REAL :: ZUCOEF ! X direction interpolation coefficient (for U) +REAL :: ZYCOEF ! Y direction interpolation coefficient +REAL :: ZVCOEF ! Y direction interpolation coefficient (for V) +! +REAL :: ZZCOEF00 ! Z direction interpolation coefficient for II , IJ +REAL :: ZZCOEF01 ! Z direction interpolation coefficient for II , IJ+1 +REAL :: ZZCOEF10 ! Z direction interpolation coefficient for II+1, IJ +REAL :: ZZCOEF11 ! Z direction interpolation coefficient for II+1, IJ+1 +REAL :: ZUCOEF00 ! Z direction interpolation coefficient for IU , IJ +REAL :: ZUCOEF01 ! Z direction interpolation coefficient for IU , IJ+1 +REAL :: ZUCOEF10 ! Z direction interpolation coefficient for IU+1, IJ +REAL :: ZUCOEF11 ! Z direction interpolation coefficient for IU+1, IJ+1 +REAL :: ZVCOEF00 ! Z direction interpolation coefficient for II , IV +REAL :: ZVCOEF01 ! Z direction interpolation coefficient for II , IV+1 +REAL :: ZVCOEF10 ! Z direction interpolation coefficient for II+1, IV +REAL :: ZVCOEF11 ! Z direction interpolation coefficient for II+1, IV+1 +! +INTEGER :: IN ! time index +INTEGER :: JLOOP,JLOOP2 ! loop counter +! +REAL :: ZU_BAL ! horizontal wind speed at balloon location (along x) +REAL :: ZV_BAL ! horizontal wind speed at balloon location (along y) +REAL :: ZW_BAL ! vertical wind speed at balloon location (along z) +REAL :: ZMAP ! map factor at balloon location +REAL :: ZGAM ! rotation between meso-nh base and spherical lat-lon base. +INTEGER :: IL ! flight segment index +REAL :: ZSEG_FRAC! fraction of flight in the current segment +REAL :: ZRO_BAL ! air density at balloon location +! +INTEGER :: IINFO_ll ! return code +INTEGER :: ILUOUT ! logical unit +INTEGER :: IRESP ! return code +! +! specific to cloud radar +REAL, DIMENSION(SIZE(PR,3)) :: ZTEMPZ! vertical profile of temperature +REAL, DIMENSION(SIZE(PR,3)) :: ZRHODREFZ ! vertical profile of dry air density of the reference state +REAL, DIMENSION(SIZE(PR,3)) :: ZCIT ! pristine ice concentration +REAL, DIMENSION(SIZE(PR,3)) :: ZCCI,ZCCR,ZCCC ! ICE,RAIN CLOUD concentration (LIMA) +REAL, DIMENSION(SIZE(PR,1),SIZE(PR,2),SIZE(PR,3)) :: ZR +REAL, DIMENSION(SIZE(PR,3),SIZE(PR,4)+1) :: ZRZ ! vertical profile of hydrometeor mixing ratios +REAL :: ZA,ZB,ZCC,ZCX,ZALPHA,ZNU,ZLB,ZLBEX,ZNS,ZRHOHYD ! generic microphysical parameters +INTEGER :: JJ ! loop counter for quadrature +COMPLEX :: QMW,QMI,QM,QB,QEPSIW,QEPSWI ! dielectric parameter +REAL :: ZAETOT,ZAETMP,ZREFLOC,ZQSCA,ZQBACK,ZQEXT ! temporary scattering parameters +REAL,DIMENSION(:),ALLOCATABLE :: ZAELOC,ZZMZ ! temporary arrays +INTEGER :: JPTS_GAULAG=7 ! number of points for Gauss-Laguerre quadrature +REAL :: ZLBDA ! slope distribution parameter +REAL :: ZN ! number concentration +REAL :: ZFRAC_ICE ! ice water fraction +REAL :: ZDELTA_EQUIV ! mass-equivalent Gauss-Laguerre point +REAL :: ZFW ! liquid fraction +REAL :: ZFPW ! weight for mixed-phase reflectivity +REAL,DIMENSION(:),ALLOCATABLE :: ZX,ZW ! Gauss-Laguerre points and weights +REAL,DIMENSION(:),ALLOCATABLE :: ZRTMIN ! local values for XRTMIN +LOGICAL :: GCALC +!---------------------------------------------------------------------------- +! +!* 1. PRELIMINARIES +! ------------- +! +IF(.NOT. ALLOCATED(XTHW_FLUX)) & +ALLOCATE(XTHW_FLUX(SIZE(PTH,1),SIZE(PTH,2),SIZE(PTH,3))) +IF(.NOT. ALLOCATED(XRCW_FLUX)) & +ALLOCATE(XRCW_FLUX(SIZE(PTH,1),SIZE(PTH,2),SIZE(PTH,3))) +IF(.NOT. ALLOCATED(XSVW_FLUX)) & +ALLOCATE(XSVW_FLUX(SIZE(PSV,1),SIZE(PSV,2),SIZE(PSV,3),SIZE(PSV,4))) +ILUOUT = TLUOUT%NLU +! +ZR = 0. +GSTORE = .FALSE. +! +!* 1.0 initialization of processor test +! -------------------------------- +! +ZTHIS_PROC=0. +! +! +!* 1.1 test on the model +! ----------------- +! +CALL GET_MODEL_NUMBER_ll (IMI) +! +! +IF (TPFLYER%MODEL /= 'FIX' .AND. COUNT(NDAD(:) == IMI) /= 0 & + .AND. ( TPFLYER%NMODEL == IMI .OR. NDAD(TPFLYER%NMODEL) == IMI ) & + .AND. TPFLYER%X_CUR /= XUNDEF .AND. TPFLYER%Y_CUR /= XUNDEF & + .AND. TPFLYER%FLY .AND. .NOT. TPFLYER%CRASH & + .AND. CPROGRAM == 'MESONH' ) THEN + CALL FLYER_CHANGE_MODEL(IMI) +ENDIF +! +IF ( TPFLYER%NMODEL /= IMI ) RETURN +! +!---------------------------------------------------------------------------- +! +!* 2. PRELIMINARIES-2 +! ------------- +! +!* 2.1 Indices +! ------- +! +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +IKB = 1 + JPVEXT +IKE = SIZE(PZ,3) - JPVEXT +IKU = SIZE(PZ,3) +! +! +!* 2.2 Interpolations of model variables to mass points +! ------------------------------------------------ +! +IIU=SIZE(PXHAT) +IJU=SIZE(PYHAT) +! +ZXHATM(1:IIU-1)=0.5*PXHAT(1:IIU-1)+0.5*PXHAT(2:IIU ) +ZXHATM( IIU )=1.5*PXHAT( IIU )-0.5*PXHAT( IIU-1) +! +ZYHATM(1:IJU-1)=0.5*PYHAT(1:IJU-1)+0.5*PYHAT(2:IJU ) +ZYHATM( IJU )=1.5*PYHAT( IJU )-0.5*PYHAT( IJU-1) +!---------------------------------------------------------------------------- +! +!* 2.3 Compute time until launch by comparison of dates and times +! ---------------------------------------------------------- +! +CALL DATETIME_DISTANCE(TPFLYER%LAUNCH,TDTCUR,ZTDIST) +! +!* 3. LAUNCH +! ------ +! +GLAUNCH = .FALSE. +! +! +IF (.NOT. TPFLYER%FLY) THEN +! +! +!* 3.1 comparison of dates and times +! ----------------------------- +! +! CALL DATETIME_DISTANCE(TPFLYER%LAUNCH,TDTCUR,ZTDIST) +! +!* 3.2 launch/takeoff is effective +! --------------------------- +! + IF (ZTDIST >= - PTSTEP ) THEN + IF (TPFLYER%TYPE=='AIRCRA') THEN +! +!* 3.2.1 Determination of flight segment +! ------------------------------- +! + TPFLYER%SEGCURN = 1 + IL = TPFLYER%SEGCURN + ! + TPFLYER%SEGCURT = ZTDIST + ! + DO WHILE (TPFLYER%SEGCURT>TPFLYER%SEGTIME(IL) .AND. IL <= TPFLYER%SEG) + TPFLYER%SEGCURN = TPFLYER%SEGCURN + 1 + IL = TPFLYER%SEGCURN + TPFLYER%SEGCURT = TPFLYER%SEGCURT - TPFLYER%SEGTIME(IL-1) + IF (IL>TPFLYER%SEG) EXIT + END DO + ! + !* end of flight + ! + IF (IL > TPFLYER%SEG) THEN + TPFLYER%FLY=.FALSE. + ELSE + TPFLYER%FLY = .TRUE. + GLAUNCH = .TRUE. + TPFLYER%CRASH=.FALSE. + IF (ZTDIST <= PTSTEP ) THEN + WRITE(ILUOUT,*) '-------------------------------------------------------------------' + WRITE(ILUOUT,*) 'Aircraft ',TPFLYER%TITLE,' takes off the ', & + TDTCUR%nday,'/',TDTCUR%nmonth,'/', & + TDTCUR%nyear,' at ',NINT(TDTCUR%xtime),' sec.' + WRITE(ILUOUT,*) '-------------------------------------------------------------------' + ENDIF + ENDIF + ELSE IF (ZTDIST <= PTSTEP ) THEN + TPFLYER%FLY = .TRUE. + GLAUNCH = .TRUE. + WRITE(ILUOUT,*) '-------------------------------------------------------------------' + WRITE(ILUOUT,*) 'Balloon ',TPFLYER%TITLE,' is launched the ', & + TDTCUR%nday,'/',TDTCUR%nmonth,'/', & + TDTCUR%nyear,' at ',NINT(TDTCUR%xtime),' sec.' + WRITE(ILUOUT,*) '-------------------------------------------------------------------' + END IF +! +!* 3.3 Initial horizontal positions +! ---------------------------- +! + IF (TPFLYER%TYPE=='RADIOS' .OR. TPFLYER%TYPE=='ISODEN' .OR. TPFLYER%TYPE=='CVBALL') THEN + TPFLYER%X_CUR = TPFLYER%XLAUNCH + TPFLYER%Y_CUR = TPFLYER%YLAUNCH + END IF + IF (TPFLYER%TYPE=='AIRCRA') THEN +! +! +!* 3.3.2 Determination of initial position +! ----------------------------- +! + IF (TPFLYER%FLY) THEN + ZSEG_FRAC = TPFLYER%SEGCURT / TPFLYER%SEGTIME(IL) + ! + TPFLYER%X_CUR = (1.-ZSEG_FRAC) * TPFLYER%SEGX(IL ) & + + ZSEG_FRAC * TPFLYER%SEGX(IL+1) + TPFLYER%Y_CUR = (1.-ZSEG_FRAC) * TPFLYER%SEGY(IL ) & + + ZSEG_FRAC * TPFLYER%SEGY(IL+1) + END IF +! + END IF + END IF +END IF +! +!* 3.4 instant of storage +! ------------------ +! +IF ( TPFLYER%T_CUR == XUNDEF ) TPFLYER%T_CUR = TPFLYER%STEP - PTSTEP +! +TPFLYER%T_CUR = TPFLYER%T_CUR + PTSTEP +! +IF ( TPFLYER%T_CUR >= TPFLYER%STEP - 1.E-10 ) THEN + GSTORE = .TRUE. + TPFLYER%T_CUR = TPFLYER%T_CUR - TPFLYER%STEP + TPFLYER%N_CUR = TPFLYER%N_CUR + 1 +END IF +! +IF (GSTORE) THEN + IN = TPFLYER%N_CUR +#if 0 + tpflyer%tpdates(in)%nyear = tdtexp%nyear + tpflyer%tpdates(in)%nmonth = tdtexp%nmonth + tpflyer%tpdates(in)%nday = tdtexp%nday + tpflyer%tpdates(in)%xtime = tdtexp%xtime + ( in - 1 ) * tpflyer%step +#else + tpflyer%tpdates(in) = tdtcur +#endif +END IF +! +IF ( TPFLYER%FLY) THEN +! +!---------------------------------------------------------------------------- +! +!* 4. FLYER POSITION +! -------------- +! +!* 4.1 X position +! ---------- +! + IU=COUNT( PXHAT (:)<=TPFLYER%X_CUR ) + II=COUNT( ZXHATM(:)<=TPFLYER%X_CUR ) +! + IF (IU<IIB .AND. LWEST_ll()) THEN + IF (TPFLYER%MODEL == 'FIX' .OR. TPFLYER%NMODEL == 1 ) THEN + TPFLYER%CRASH=.TRUE. + ELSE + II=IIB + IU=IIB + END IF + END IF + IF (IU>IIE .AND. LEAST_ll()) THEN + IF (TPFLYER%MODEL == 'FIX' .OR. TPFLYER%NMODEL == 1) THEN + TPFLYER%CRASH=.TRUE. + ELSE + II=IIE + IU=IIE + END IF + END IF +! +! +!* 4.2 Y position +! ---------- +! + IV=COUNT( PYHAT (:)<=TPFLYER%Y_CUR ) + IJ=COUNT( ZYHATM(:)<=TPFLYER%Y_CUR ) +! + IF (IV<IJB .AND. LSOUTH_ll()) THEN + IF (TPFLYER%MODEL == 'FIX' .OR. TPFLYER%NMODEL == 1) THEN + TPFLYER%CRASH=.TRUE. + ELSE + IJ=IJB + IV=IJB + END IF + END IF + IF (IV>IJE .AND. LNORTH_ll()) THEN + IF (TPFLYER%MODEL == 'FIX' .OR. TPFLYER%NMODEL == 1) THEN + TPFLYER%CRASH=.TRUE. + ELSE + IJ=IJE + IV=IJE + END IF + END IF +! +! +!* 4.3 Position of balloon according to processors +! ------------------------------------------- +! + IF (IU>=IIB .AND. IU<=IIE .AND. IV>=IJB .AND. IV<=IJE) ZTHIS_PROC=1. +! +! +!* 4.4 Computations only on correct processor +! -------------------------------------- +! +!---------------------------------------------------------------------------- + IF (ZTHIS_PROC>0. .AND. .NOT. TPFLYER%CRASH) THEN +!---------------------------------------------------------------------------- +! +!* 4.5 Interpolations of model variables to mass points +! ------------------------------------------------ +! + + ZZM(:,:,1:IKU-1)=0.5 *PZ(II :II+1,IJ :IJ+1,1:IKU-1)+0.5 *PZ(II :II+1,IJ :IJ+1,2:IKU ) + ZZM(:,:, IKU )=1.5 *PZ(II :II+1,IJ :IJ+1, IKU-1)-0.5 *PZ(II :II+1,IJ :IJ+1, IKU-2) +! + IDU = IU - II + ZZU(:,:,1:IKU-1)=0.25*PZ(IDU+II-1:IDU+II, IJ :IJ+1,1:IKU-1)+0.25*PZ(IDU+II-1:IDU+II ,IJ :IJ+1,2:IKU ) & + +0.25*PZ(IDU+II :IDU+II+1,IJ :IJ+1,1:IKU-1)+0.25*PZ(IDU+II :IDU+II+1,IJ :IJ+1,2:IKU ) + ZZU(:,:, IKU )=0.75*PZ(IDU+II-1:IDU+II ,IJ :IJ+1, IKU-1)-0.25*PZ(IDU+II-1:IDU+II ,IJ :IJ+1, IKU-2) & + +0.75*PZ(IDU+II :IDU+II+1,IJ :IJ+1, IKU-1)-0.25*PZ(IDU+II :IDU+II+1,IJ :IJ+1, IKU-2) + + IDV = IV - IJ + ZZV(:,:,1:IKU-1)=0.25*PZ(II :II+1,IDV+IJ-1:IDV+IJ ,1:IKU-1)+0.25*PZ(II :II+1,IDV+IJ-1:IDV+IJ ,2:IKU ) & + +0.25*PZ(II :II+1,IDV+IJ :IDV+IJ+1,1:IKU-1)+0.25*PZ(II :II+1,IDV+IJ :IDV+IJ+1,2:IKU ) + ZZV(:,:, IKU )=0.75*PZ(II :II+1,IDV+IJ-1:IDV+IJ , IKU-1)-0.25*PZ(II :II+1,IDV+IJ-1:IDV+IJ , IKU-2) & + +0.75*PZ(II :II+1,IDV+IJ :IDV+IJ+1, IKU-1)-0.25*PZ(II :II+1,IDV+IJ :IDV+IJ+1, IKU-2) +! +! + ZWM(:,:,1:IKU-1)=0.5*PW(II:II+1,IJ:IJ+1,1:IKU-1)+0.5*PW(II:II+1,IJ:IJ+1,2:IKU ) + ZWM(:,:, IKU )=1.5*PW(II:II+1,IJ:IJ+1, IKU-1)-0.5*PW(II:II+1,IJ:IJ+1, IKU-2) +! +!---------------------------------------------------------------------------- +! +!* 5. BALLOON/AIRCRAFT VERTICAL POSITION +! ---------------------------------- +! +! +!* 5.1 Density +! ------- +! + ZEXN(:,:,: ) = (PP(II:II+1,IJ:IJ+1,:)/XP00)**(XRD/XCPD) + DO JK=IKB-1,1,-1 + ZEXN(:,:,JK) = 1.5 * ZEXN(:,:,JK+1) - 0.5 * ZEXN(:,:,JK+2) + END DO + DO JK=IKE+1,IKU + ZEXN(:,:,JK) = 1.5 * ZEXN(:,:,JK-1) - 0.5 * ZEXN(:,:,JK-2) + END DO + ! + IF (TPFLYER%TYPE=='ISODEN' .OR. TPFLYER%TYPE=='CVBALL' & + .OR. TPFLYER%TYPE=='AIRCRA' ) THEN + ZTHV(:,:,:) = PTH(II:II+1,IJ:IJ+1,:) + IF (SIZE(PR,4)>0) & + ZTHV(:,:,:) = ZTHV(:,:,:) * ( 1. + XRV/XRD*PR(II:II+1,IJ:IJ+1,:,1) ) & + / ( 1. + WATER_SUM(PR(II:II+1,IJ:IJ+1,:,:)) ) + ! + ZTV (:,:,:) = ZTHV(:,:,:) * ZEXN(:,:,:) + ZRHO(:,:,:) = PP(II:II+1,IJ:IJ+1,:) / (XRD*ZTV(:,:,:)) + DO JK=IKB-1,1,-1 + ZRHO(:,:,JK) = 1.5 * ZRHO(:,:,JK+1) - 0.5 * ZRHO(:,:,JK+2) + END DO + DO JK=IKE+1,IKU + ZRHO(:,:,JK) = 1.5 * ZRHO(:,:,JK-1) - 0.5 * ZRHO(:,:,JK-2) + END DO + ZTHW_FLUX(:,:,:) = ZRHO(:,:,:)*XCPD *XTHW_FLUX(II:II+1,IJ:IJ+1,:) + ZRCW_FLUX(:,:,:) = ZRHO(:,:,:)*XLVTT*XRCW_FLUX(II:II+1,IJ:IJ+1,:) + ZSVW_FLUX(:,:,:,:) = XSVW_FLUX(II:II+1,IJ:IJ+1,:,:) + END IF + +! +!* 5.2 Initial vertical positions +! -------------------------- +! + IF (GLAUNCH) THEN +! +!* 5.2.1 Iso-density balloon +! + IF (TPFLYER%TYPE=='ISODEN') THEN + ZXCOEF = (TPFLYER%X_CUR - ZXHATM(II)) / (ZXHATM(II+1) - ZXHATM(II)) + ZXCOEF = MAX (0.,MIN(ZXCOEF,1.)) + ZYCOEF = (TPFLYER%Y_CUR - ZYHATM(IJ)) / (ZYHATM(IJ+1) - ZYHATM(IJ)) + ZYCOEF = MAX (0.,MIN(ZYCOEF,1.)) + IF ( TPFLYER%ALT /= XUNDEF ) THEN + IK00 = MAX ( COUNT (TPFLYER%ALT >= ZZM(1,1,:)), 1) + IK01 = MAX ( COUNT (TPFLYER%ALT >= ZZM(1,2,:)), 1) + IK10 = MAX ( COUNT (TPFLYER%ALT >= ZZM(2,1,:)), 1) + IK11 = MAX ( COUNT (TPFLYER%ALT >= ZZM(2,2,:)), 1) + ZZCOEF00 = (TPFLYER%ALT - ZZM(1,1,IK00)) / ( ZZM(1,1,IK00+1) - ZZM(1,1,IK00)) + ZZCOEF01 = (TPFLYER%ALT - ZZM(1,2,IK01)) / ( ZZM(1,2,IK01+1) - ZZM(1,2,IK01)) + ZZCOEF10 = (TPFLYER%ALT - ZZM(2,1,IK10)) / ( ZZM(2,1,IK10+1) - ZZM(2,1,IK10)) + ZZCOEF11 = (TPFLYER%ALT - ZZM(2,2,IK11)) / ( ZZM(2,2,IK11+1) - ZZM(2,2,IK11)) + TPFLYER%RHO = FLYER_INTERP(ZRHO) + ELSE IF ( TPFLYER%PRES /= XUNDEF ) THEN + ZFLYER_EXN = (TPFLYER%PRES/XP00)**(XRD/XCPD) + IK00 = MAX ( COUNT (ZFLYER_EXN <= ZEXN(1,1,:)), 1) + IK01 = MAX ( COUNT (ZFLYER_EXN <= ZEXN(1,2,:)), 1) + IK10 = MAX ( COUNT (ZFLYER_EXN <= ZEXN(2,1,:)), 1) + IK11 = MAX ( COUNT (ZFLYER_EXN <= ZEXN(2,2,:)), 1) + ZZCOEF00 = (ZFLYER_EXN - ZEXN(1,1,IK00)) / ( ZEXN(1,1,IK00+1) - ZEXN(1,1,IK00)) + ZZCOEF01 = (ZFLYER_EXN - ZEXN(1,2,IK01)) / ( ZEXN(1,2,IK01+1) - ZEXN(1,2,IK01)) + ZZCOEF10 = (ZFLYER_EXN - ZEXN(2,1,IK10)) / ( ZEXN(2,1,IK10+1) - ZEXN(2,1,IK10)) + ZZCOEF11 = (ZFLYER_EXN - ZEXN(2,2,IK11)) / ( ZEXN(2,2,IK11+1) - ZEXN(2,2,IK11)) + TPFLYER%RHO = FLYER_INTERP(ZRHO) + ELSE + WRITE(ILUOUT,*) 'Error in balloon initial position (balloon ',TPFLYER%TITLE,' )' + WRITE(ILUOUT,*) 'neither initial ALTITUDE or PRESsure is given' + WRITE(ILUOUT,*) 'Check your INI_BALLOON routine' +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','AIRCRAFT_BALLOON_EVOL','') + END IF + END IF +! +!* 5.2.2 Radiosounding balloon +! + IF (TPFLYER%TYPE=='RADIOS') THEN + TPFLYER%Z_CUR = TPFLYER%ALT + TPFLYER%Z_CUR = MAX ( TPFLYER%Z_CUR , ZZM(1,1,IKB) ) + TPFLYER%Z_CUR = MAX ( TPFLYER%Z_CUR , ZZM(2,1,IKB) ) + TPFLYER%Z_CUR = MAX ( TPFLYER%Z_CUR , ZZM(1,2,IKB) ) + TPFLYER%Z_CUR = MAX ( TPFLYER%Z_CUR , ZZM(2,2,IKB) ) + END IF + +!* 5.2.3 Aircraft +! + IF (TPFLYER%TYPE=='AIRCRA') THEN + IF (TPFLYER%ALTDEF) THEN + TPFLYER%P_CUR = (1.-ZSEG_FRAC) * TPFLYER%SEGP(IL ) & + + ZSEG_FRAC * TPFLYER%SEGP(IL+1) + ELSE + TPFLYER%Z_CUR = (1.-ZSEG_FRAC) * TPFLYER%SEGZ(IL ) & + + ZSEG_FRAC * TPFLYER%SEGZ(IL +1 ) + END IF + END IF +! +!* 5.2.4 Constant Volume Balloon +! + IF (TPFLYER%TYPE=='CVBALL') THEN + ZXCOEF = (TPFLYER%X_CUR - ZXHATM(II)) / (ZXHATM(II+1) - ZXHATM(II)) + ZXCOEF = MAX (0.,MIN(ZXCOEF,1.)) + ZYCOEF = (TPFLYER%Y_CUR - ZYHATM(IJ)) / (ZYHATM(IJ+1) - ZYHATM(IJ)) + ZYCOEF = MAX (0.,MIN(ZYCOEF,1.)) + IF ( TPFLYER%ALT /= XUNDEF ) THEN + IK00 = MAX ( COUNT (TPFLYER%ALT >= ZZM(1,1,:)), 1) + IK01 = MAX ( COUNT (TPFLYER%ALT >= ZZM(1,2,:)), 1) + IK10 = MAX ( COUNT (TPFLYER%ALT >= ZZM(2,1,:)), 1) + IK11 = MAX ( COUNT (TPFLYER%ALT >= ZZM(2,2,:)), 1) + IF (IK00*IK01*IK10*IK11 .EQ. 0) THEN + TPFLYER%Z_CUR = TPFLYER%ALT + TPFLYER%Z_CUR = MAX ( TPFLYER%Z_CUR , ZZM(1,1,IKB) ) + TPFLYER%Z_CUR = MAX ( TPFLYER%Z_CUR , ZZM(2,1,IKB) ) + TPFLYER%Z_CUR = MAX ( TPFLYER%Z_CUR , ZZM(1,2,IKB) ) + TPFLYER%Z_CUR = MAX ( TPFLYER%Z_CUR , ZZM(2,2,IKB) ) + ELSE + ZZCOEF00 = (TPFLYER%ALT - ZZM(1,1,IK00)) / ( ZZM(1,1,IK00+1) - ZZM(1,1,IK00)) + ZZCOEF01 = (TPFLYER%ALT - ZZM(1,2,IK01)) / ( ZZM(1,2,IK01+1) - ZZM(1,2,IK01)) + ZZCOEF10 = (TPFLYER%ALT - ZZM(2,1,IK10)) / ( ZZM(2,1,IK10+1) - ZZM(2,1,IK10)) + ZZCOEF11 = (TPFLYER%ALT - ZZM(2,2,IK11)) / ( ZZM(2,2,IK11+1) - ZZM(2,2,IK11)) + TPFLYER%RHO = FLYER_INTERP(ZRHO) + TPFLYER%Z_CUR = FLYER_INTERP(ZZM) + END IF + ELSE IF ( TPFLYER%PRES /= XUNDEF ) THEN + ZFLYER_EXN = (TPFLYER%PRES/XP00)**(XRD/XCPD) + IK00 = MAX ( COUNT (ZFLYER_EXN <= ZEXN(1,1,:)), 1) + IK01 = MAX ( COUNT (ZFLYER_EXN <= ZEXN(1,2,:)), 1) + IK10 = MAX ( COUNT (ZFLYER_EXN <= ZEXN(2,1,:)), 1) + IK11 = MAX ( COUNT (ZFLYER_EXN <= ZEXN(2,2,:)), 1) + IF (IK00*IK01*IK10*IK11 .EQ. 0) THEN + TPFLYER%Z_CUR = ZZM(1,1,IKB) + TPFLYER%Z_CUR = MAX ( TPFLYER%Z_CUR , ZZM(2,1,IKB) ) + TPFLYER%Z_CUR = MAX ( TPFLYER%Z_CUR , ZZM(1,2,IKB) ) + TPFLYER%Z_CUR = MAX ( TPFLYER%Z_CUR , ZZM(2,2,IKB) ) + ELSE + ZZCOEF00 = (ZFLYER_EXN - ZEXN(1,1,IK00)) / ( ZEXN(1,1,IK00+1) - ZEXN(1,1,IK00)) + ZZCOEF01 = (ZFLYER_EXN - ZEXN(1,2,IK01)) / ( ZEXN(1,2,IK01+1) - ZEXN(1,2,IK01)) + ZZCOEF10 = (ZFLYER_EXN - ZEXN(2,1,IK10)) / ( ZEXN(2,1,IK10+1) - ZEXN(2,1,IK10)) + ZZCOEF11 = (ZFLYER_EXN - ZEXN(2,2,IK11)) / ( ZEXN(2,2,IK11+1) - ZEXN(2,2,IK11)) + TPFLYER%RHO = FLYER_INTERP(ZRHO) + TPFLYER%Z_CUR = FLYER_INTERP(ZZM) + END IF + ELSE + TPFLYER%RHO = TPFLYER%MASS / TPFLYER%VOLUME + IK00 = MAX ( COUNT (TPFLYER%RHO <= ZRHO(1,1,:)), 1) + IK01 = MAX ( COUNT (TPFLYER%RHO <= ZRHO(1,2,:)), 1) + IK10 = MAX ( COUNT (TPFLYER%RHO <= ZRHO(2,1,:)), 1) + IK11 = MAX ( COUNT (TPFLYER%RHO <= ZRHO(2,2,:)), 1) + IF (IK00*IK01*IK10*IK11 .EQ. 0) THEN + TPFLYER%Z_CUR = ZZM(1,1,IKB) + TPFLYER%Z_CUR = MAX ( TPFLYER%Z_CUR , ZZM(2,1,IKB) ) + TPFLYER%Z_CUR = MAX ( TPFLYER%Z_CUR , ZZM(1,2,IKB) ) + TPFLYER%Z_CUR = MAX ( TPFLYER%Z_CUR , ZZM(2,2,IKB) ) + ELSE + ZZCOEF00 = (TPFLYER%RHO - ZRHO(1,1,IK00)) / ( ZRHO(1,1,IK00+1) - ZRHO(1,1,IK00)) + ZZCOEF01 = (TPFLYER%RHO - ZRHO(1,2,IK01)) / ( ZRHO(1,2,IK01+1) - ZRHO(1,2,IK01)) + ZZCOEF10 = (TPFLYER%RHO - ZRHO(2,1,IK10)) / ( ZRHO(2,1,IK10+1) - ZRHO(2,1,IK10)) + ZZCOEF11 = (TPFLYER%RHO - ZRHO(2,2,IK11)) / ( ZRHO(2,2,IK11+1) - ZRHO(2,2,IK11)) + TPFLYER%Z_CUR = FLYER_INTERP(ZZM) + END IF + END IF + END IF + END IF +! +! +! +!* 5.3 Vertical position +! ----------------- +! + IF (TPFLYER%TYPE=='ISODEN') THEN + IK00 = MAX ( COUNT (TPFLYER%RHO <= ZRHO(1,1,:)), 1) + IK01 = MAX ( COUNT (TPFLYER%RHO <= ZRHO(1,2,:)), 1) + IK10 = MAX ( COUNT (TPFLYER%RHO <= ZRHO(2,1,:)), 1) + IK11 = MAX ( COUNT (TPFLYER%RHO <= ZRHO(2,2,:)), 1) + ELSE IF (TPFLYER%TYPE=='RADIOS' .OR. TPFLYER%TYPE=='CVBALL') THEN + IK00 = MAX ( COUNT (TPFLYER%Z_CUR >= ZZM(1,1,:)), 1) + IK01 = MAX ( COUNT (TPFLYER%Z_CUR >= ZZM(1,2,:)), 1) + IK10 = MAX ( COUNT (TPFLYER%Z_CUR >= ZZM(2,1,:)), 1) + IK11 = MAX ( COUNT (TPFLYER%Z_CUR >= ZZM(2,2,:)), 1) + ELSE IF (TPFLYER%TYPE=='AIRCRA') THEN + IF (TPFLYER%ALTDEF) THEN + ZFLYER_EXN = (TPFLYER%P_CUR/XP00)**(XRD/XCPD) + IK00 = MAX ( COUNT (ZFLYER_EXN <= ZEXN(1,1,:)), 1) + IK01 = MAX ( COUNT (ZFLYER_EXN <= ZEXN(1,2,:)), 1) + IK10 = MAX ( COUNT (ZFLYER_EXN <= ZEXN(2,1,:)), 1) + IK11 = MAX ( COUNT (ZFLYER_EXN <= ZEXN(2,2,:)), 1) + ELSE + IK00 = MAX ( COUNT (TPFLYER%Z_CUR >= ZZM(1,1,:)), 1) + IK01 = MAX ( COUNT (TPFLYER%Z_CUR >= ZZM(1,2,:)), 1) + IK10 = MAX ( COUNT (TPFLYER%Z_CUR >= ZZM(2,1,:)), 1) + IK11 = MAX ( COUNT (TPFLYER%Z_CUR >= ZZM(2,2,:)), 1) + END IF + END IF + IK00 = MAX ( IK00, IKB ) + IK01 = MAX ( IK01, IKB ) + IK10 = MAX ( IK10, IKB ) + IK11 = MAX ( IK11, IKB ) +! +! +!* 5.4 Crash of the balloon +! -------------------- +! +! + IF (IK00 < IKB .OR. IK01 < IKB .OR. IK10 < IKB .OR. IK11 < IKB .OR. & + IK00 >= IKE .OR. IK01 >= IKE .OR. IK10 >= IKE .OR. IK11 >= IKE ) THEN + TPFLYER%CRASH=.TRUE. + END IF +! + END IF +! +! + IF (TPFLYER%CRASH) THEN + TPFLYER%FLY = .FALSE. + IF (TPFLYER%TYPE=='AIRCRA' .AND. .NOT. GLAUNCH ) THEN + WRITE(ILUOUT,*) 'Aircraft ',TPFLYER%TITLE,' flew out of the domain the ', & + TDTCUR%nday,'/',TDTCUR%nmonth,'/', & + TDTCUR%nyear,' at ',TDTCUR%xtime,' sec.' + ELSE IF (TPFLYER%TYPE /= 'AIRCRA') THEN + WRITE(ILUOUT,*) 'Balloon ',TPFLYER%TITLE,' crashed the ', & + TDTCUR%nday,'/',TDTCUR%nmonth,'/', & + TDTCUR%nyear,' at ',TDTCUR%xtime,' sec.' + END IF + ELSE + IF (TPFLYER%TYPE=='AIRCRA' .AND. .NOT. GLAUNCH .AND. ZTDIST > PTSTEP ) THEN + WRITE(ILUOUT,*) '-------------------------------------------------------------------' + WRITE(ILUOUT,*) 'Aircraft ',TPFLYER%TITLE,' flies in leg',TPFLYER%SEGCURN ,' the ', & + TDTCUR%nday,'/',TDTCUR%nmonth,'/', & + TDTCUR%nyear,' at ',NINT(TDTCUR%xtime),' sec.' + WRITE(ILUOUT,*) '-------------------------------------------------------------------' + ENDIF +! +!---------------------------------------------------------------------------- + IF (ZTHIS_PROC>0.) THEN +!---------------------------------------------------------------------------- +! +!* 6. INITIALIZATIONS FOR INTERPOLATIONS +! ---------------------------------- +! +!* 6.1 Interpolation coefficient for X +! ------------------------------- +! + ZXCOEF = (TPFLYER%X_CUR - ZXHATM(II)) / (ZXHATM(II+1) - ZXHATM(II)) + ZXCOEF = MAX (0.,MIN(ZXCOEF,1.)) +! +! +!* 6.2 Interpolation coefficient for y +! ------------------------------- +! + ZYCOEF = (TPFLYER%Y_CUR - ZYHATM(IJ)) / (ZYHATM(IJ+1) - ZYHATM(IJ)) + ZYCOEF = MAX (0.,MIN(ZYCOEF,1.)) +! +! +!* 6.3 Interpolation coefficients for the 4 suroundings verticals +! ---------------------------------------------------------- +! + IF (TPFLYER%TYPE=='ISODEN') THEN + ZZCOEF00 = (TPFLYER%RHO - ZRHO(1,1,IK00)) / ( ZRHO(1,1,IK00+1) - ZRHO(1,1,IK00) ) + ZZCOEF01 = (TPFLYER%RHO - ZRHO(1,2,IK01)) / ( ZRHO(1,2,IK01+1) - ZRHO(1,2,IK01) ) + ZZCOEF10 = (TPFLYER%RHO - ZRHO(2,1,IK10)) / ( ZRHO(2,1,IK10+1) - ZRHO(2,1,IK10) ) + ZZCOEF11 = (TPFLYER%RHO - ZRHO(2,2,IK11)) / ( ZRHO(2,2,IK11+1) - ZRHO(2,2,IK11) ) + TPFLYER%Z_CUR = FLYER_INTERP(ZZM) + ELSE IF (TPFLYER%TYPE=='RADIOS' .OR. TPFLYER%TYPE=='CVBALL') THEN + ZZCOEF00 = (TPFLYER%Z_CUR - ZZM(1,1,IK00)) / ( ZZM(1,1,IK00+1) - ZZM(1,1,IK00) ) + ZZCOEF01 = (TPFLYER%Z_CUR - ZZM(1,2,IK01)) / ( ZZM(1,2,IK01+1) - ZZM(1,2,IK01) ) + ZZCOEF10 = (TPFLYER%Z_CUR - ZZM(2,1,IK10)) / ( ZZM(2,1,IK10+1) - ZZM(2,1,IK10) ) + ZZCOEF11 = (TPFLYER%Z_CUR - ZZM(2,2,IK11)) / ( ZZM(2,2,IK11+1) - ZZM(2,2,IK11) ) + ELSE IF (TPFLYER%TYPE=='AIRCRA') THEN + IF (TPFLYER%ALTDEF) THEN + ZZCOEF00 = (ZFLYER_EXN - ZEXN(1,1,IK00)) / ( ZEXN(1,1,IK00+1) - ZEXN(1,1,IK00) ) + ZZCOEF01 = (ZFLYER_EXN - ZEXN(1,2,IK01)) / ( ZEXN(1,2,IK01+1) - ZEXN(1,2,IK01) ) + ZZCOEF10 = (ZFLYER_EXN - ZEXN(2,1,IK10)) / ( ZEXN(2,1,IK10+1) - ZEXN(2,1,IK10) ) + ZZCOEF11 = (ZFLYER_EXN - ZEXN(2,2,IK11)) / ( ZEXN(2,2,IK11+1) - ZEXN(2,2,IK11) ) + TPFLYER%Z_CUR = FLYER_INTERP(ZZM) + ELSE + ZZCOEF00 = (TPFLYER%Z_CUR - ZZM(1,1,IK00)) / ( ZZM(1,1,IK00+1) - ZZM(1,1,IK00) ) + ZZCOEF01 = (TPFLYER%Z_CUR - ZZM(1,2,IK01)) / ( ZZM(1,2,IK01+1) - ZZM(1,2,IK01) ) + ZZCOEF10 = (TPFLYER%Z_CUR - ZZM(2,1,IK10)) / ( ZZM(2,1,IK10+1) - ZZM(2,1,IK10) ) + ZZCOEF11 = (TPFLYER%Z_CUR - ZZM(2,2,IK11)) / ( ZZM(2,2,IK11+1) - ZZM(2,2,IK11) ) + TPFLYER%P_CUR = FLYER_INTERP(PP) + END IF + END IF +! +!---------------------------------------------------------------------------- +! +!* 7. INITIALIZATIONS FOR INTERPOLATIONS OF U AND V +! --------------------------------------------- +! +!* 7.1 Interpolation coefficient for X (for U) +! ------------------------------- +! + ZUCOEF = (TPFLYER%X_CUR - PXHAT(IU)) / (PXHAT(IU+1) - PXHAT(IU)) + ZUCOEF = MAX(0.,MIN(ZUCOEF,1.)) +! +! +!* 7.2 Interpolation coefficient for y (for V) +! ------------------------------- +! + ZVCOEF = (TPFLYER%Y_CUR - PYHAT(IV)) / (PYHAT(IV+1) - PYHAT(IV)) + ZVCOEF = MAX(0.,MIN(ZVCOEF,1.)) +! +! +!* 7.3 Interpolation coefficients for the 4 suroundings verticals (for U) +! ---------------------------------------------------------- +! + IU00 = MAX( COUNT (TPFLYER%Z_CUR >= ZZU(1,1,:)), 1) + IU01 = MAX( COUNT (TPFLYER%Z_CUR >= ZZU(1,2,:)), 1) + IU10 = MAX( COUNT (TPFLYER%Z_CUR >= ZZU(2,1,:)), 1) + IU11 = MAX( COUNT (TPFLYER%Z_CUR >= ZZU(2,2,:)), 1) + ZUCOEF00 = (TPFLYER%Z_CUR - ZZU(1,1,IU00)) / ( ZZU(1,1,IU00+1) - ZZU(1,1,IU00) ) + ZUCOEF01 = (TPFLYER%Z_CUR - ZZU(1,2,IU01)) / ( ZZU(1,2,IU01+1) - ZZU(1,2,IU01) ) + ZUCOEF10 = (TPFLYER%Z_CUR - ZZU(2,1,IU10)) / ( ZZU(2,1,IU10+1) - ZZU(2,1,IU10) ) + ZUCOEF11 = (TPFLYER%Z_CUR - ZZU(2,2,IU11)) / ( ZZU(2,2,IU11+1) - ZZU(2,2,IU11) ) +! +! +!* 7.4 Interpolation coefficients for the 4 suroundings verticals (for V) +! ---------------------------------------------------------- +! + + IV00 = MAX ( COUNT (TPFLYER%Z_CUR >= ZZV(1,1,:)), 1) + IV01 = MAX ( COUNT (TPFLYER%Z_CUR >= ZZV(1,2,:)), 1) + IV10 = MAX ( COUNT (TPFLYER%Z_CUR >= ZZV(2,1,:)), 1) + IV11 = MAX ( COUNT (TPFLYER%Z_CUR >= ZZV(2,2,:)), 1) + ZVCOEF00 = (TPFLYER%Z_CUR - ZZV(1,1,IV00)) / ( ZZV(1,1,IV00+1) - ZZV(1,1,IV00) ) + ZVCOEF01 = (TPFLYER%Z_CUR - ZZV(1,2,IV01)) / ( ZZV(1,2,IV01+1) - ZZV(1,2,IV01) ) + ZVCOEF10 = (TPFLYER%Z_CUR - ZZV(2,1,IV10)) / ( ZZV(2,1,IV10+1) - ZZV(2,1,IV10) ) + ZVCOEF11 = (TPFLYER%Z_CUR - ZZV(2,2,IV11)) / ( ZZV(2,2,IV11+1) - ZZV(2,2,IV11) ) +! +!---------------------------------------------------------------------------- +! +!* 8. DATA RECORDING +! -------------- +! + IF ( GSTORE ) THEN + TPFLYER%X (IN) = TPFLYER%X_CUR + TPFLYER%Y (IN) = TPFLYER%Y_CUR + TPFLYER%Z (IN) = TPFLYER%Z_CUR + ! + CALL SM_LATLON(PLATOR,PLONOR, & + TPFLYER%X_CUR, TPFLYER%Y_CUR, & + TPFLYER%YLAT(IN), TPFLYER%XLON(IN) ) + ! + ZU_BAL = FLYER_INTERP_U(PU) + ZV_BAL = FLYER_INTERP_V(PV) + ZGAM = (XRPK * (TPFLYER%XLON(IN) - XLON0) - XBETA)*(XPI/180.) + TPFLYER%ZON (IN) = ZU_BAL * COS(ZGAM) + ZV_BAL * SIN(ZGAM) + TPFLYER%MER (IN) = - ZU_BAL * SIN(ZGAM) + ZV_BAL * COS(ZGAM) + ! + TPFLYER%W (IN) = FLYER_INTERP(ZWM) + TPFLYER%TH (IN) = FLYER_INTERP(PTH) + ! + ZFLYER_EXN = FLYER_INTERP(ZEXN) + TPFLYER%P (IN) = XP00 * ZFLYER_EXN**(XCPD/XRD) + ! + DO JLOOP=1,SIZE(PR,4) + TPFLYER%R (IN,JLOOP) = FLYER_INTERP(PR(:,:,:,JLOOP)) + IF (JLOOP>=2) ZR(:,:,:) = ZR(:,:,:) + PR(:,:,:,JLOOP) + END DO + DO JLOOP=1,SIZE(PSV,4) + TPFLYER%SV (IN,JLOOP) = FLYER_INTERP(PSV(:,:,:,JLOOP)) + END DO + TPFLYER%RTZ (IN,:) = FLYER_INTERPZ(ZR(:,:,:)) + DO JLOOP=1,SIZE(PR,4) + TPFLYER%RZ (IN,:,JLOOP) = FLYER_INTERPZ(PR(:,:,:,JLOOP)) + END DO + ! Fin Modifs ON + TPFLYER%FFZ (IN,:) = FLYER_INTERPZ(SQRT(PU**2+PV**2)) + IF (CCLOUD=="LIMA") THEN + TPFLYER%CIZ (IN,:) = FLYER_INTERPZ(PSV(:,:,:,NSV_LIMA_NI)) + TPFLYER%CCZ (IN,:) = FLYER_INTERPZ(PSV(:,:,:,NSV_LIMA_NC)) + TPFLYER%CRZ (IN,:) = FLYER_INTERPZ(PSV(:,:,:,NSV_LIMA_NR)) + ELSE IF ( CCLOUD=="ICE3" .OR. CCLOUD=="ICE4" ) THEN + TPFLYER%CIZ (IN,:) = FLYER_INTERPZ(PCIT(:,:,:)) + ENDIF + ! initialization CRARE and CRARE_ATT + LWC and IWC + TPFLYER%CRARE(IN,:) = 0. + TPFLYER%CRARE_ATT(IN,:) = 0. + TPFLYER%LWCZ (IN,:) = 0. + TPFLYER%IWCZ (IN,:) = 0. + IF (CCLOUD=="LIMA" .OR. CCLOUD=="ICE3" ) THEN ! only for ICE3 and LIMA + TPFLYER%LWCZ (IN,:) = FLYER_INTERPZ((PR(:,:,:,2)+PR(:,:,:,3))*PRHODREF(:,:,:)) + TPFLYER%IWCZ (IN,:) = FLYER_INTERPZ((PR(:,:,:,4)+PR(:,:,:,5)+PR(:,:,:,6))*PRHODREF(:,:,:)) + ZTEMPZ(:)=FLYER_INTERPZ(PTH(II:II+1,IJ:IJ+1,:) * ZEXN(:,:,:)) + ZRHODREFZ(:)=FLYER_INTERPZ(PRHODREF(:,:,:)) + IF (CCLOUD=="LIMA") THEN + ZCCI(:)=FLYER_INTERPZ(PSV(:,:,:,NSV_LIMA_NI)) + ZCCR(:)=FLYER_INTERPZ(PSV(:,:,:,NSV_LIMA_NR)) + ZCCC(:)=FLYER_INTERPZ(PSV(:,:,:,NSV_LIMA_NC)) + ELSE + ZCIT(:)=FLYER_INTERPZ(PCIT(:,:,:)) + ENDIF + DO JLOOP=3,6 + ZRZ(:,JLOOP)=FLYER_INTERPZ(PR(:,:,:,JLOOP)) + END DO + if ( csurf == 'EXTE' ) then + DO JK=1,IKU + ZRZ(JK,2)=FLYER_INTERP_2D(PR(:,:,JK,2)*PSEA(:,:)) ! becomes cloud mixing ratio over sea + ZRZ(JK,7)=FLYER_INTERP_2D(PR(:,:,JK,2)*(1.-PSEA(:,:))) ! becomes cloud mixing ratio over land + END DO + else + !if csurf/='EXTE', psea is not allocated + DO JK=1,IKU + ZRZ(JK,2)=FLYER_INTERP_2D(PR(:,:,JK,2)) + ZRZ(JK,7) = 0. + END DO + end if + ALLOCATE(ZAELOC(IKU)) + ! + ZAELOC(:)=0. + ! initialization of quadrature points and weights + ALLOCATE(ZX(JPTS_GAULAG),ZW(JPTS_GAULAG)) + CALL GAULAG(JPTS_GAULAG,ZX,ZW) ! for integration over diameters + ! initialize minimum values + ALLOCATE(ZRTMIN(SIZE(PR,4)+1)) + IF (CCLOUD == 'LIMA') THEN + ZRTMIN(2)=XRTMIN_L(2) ! cloud water over sea + ZRTMIN(3)=XRTMIN_L(3) + ZRTMIN(4)=XRTMIN_L(4) + ZRTMIN(5)=1E-10 + ZRTMIN(6)=XRTMIN_L(6) + ZRTMIN(7)=XRTMIN_L(2) ! cloud water over land + ELSE + ZRTMIN(2)=XRTMIN_I(2) ! cloud water over sea + ZRTMIN(3)=XRTMIN_I(3) + ZRTMIN(4)=XRTMIN_I(4) + ZRTMIN(5)=1E-10 + ZRTMIN(6)=XRTMIN_I(6) + ZRTMIN(7)=XRTMIN_I(2) ! cloud water over land + ENDIF + ! compute cloud radar reflectivity from vertical profiles of temperature and mixing ratios + DO JK=1,IKU + QMW=SQRT(QEPSW(ZTEMPZ(JK),XLIGHTSPEED/XLAM_CRAD)) + QMI=SQRT(QEPSI(ZTEMPZ(JK),XLIGHTSPEED/XLAM_CRAD)) + DO JLOOP=2,7 + IF (CCLOUD == 'LIMA') THEN + GCALC=(ZRZ(JK,JLOOP)>ZRTMIN(JLOOP).AND.(JLOOP.NE.4.OR.ZCCI(JK)>0.).AND.& + (JLOOP.NE.3.OR.ZCCR(JK)>0.).AND.((JLOOP.NE.2.AND. JLOOP.NE.7).OR.ZCCC(JK)>0.)) + ELSE + GCALC=(ZRZ(JK,JLOOP)>ZRTMIN(JLOOP).AND.(JLOOP.NE.4.OR.ZCIT(JK)>0.)) + ENDIF + IF(GCALC) THEN + SELECT CASE(JLOOP) + CASE(2) ! cloud water over sea + IF (CCLOUD == 'LIMA') THEN + ZA=XAC_L + ZB=XBC_L + ZCC=ZCCC(JK)*ZRHODREFZ(JK) + ZCX=0. + ZALPHA=XALPHAC_L + ZNU=XNUC_L + ZLBEX=1.0/(ZCX-ZB) + ZLB=( ZA*ZCC*MOMG(ZALPHA,ZNU,ZB) )**(-ZLBEX) + ELSE + ZA=XAC_I + ZB=XBC_I + ZCC=XCONC_SEA + ZCX=0. + ZALPHA=XALPHAC2_I + ZNU=XNUC2_I + ZLBEX=1.0/(ZCX-ZB) + ZLB=( ZA*ZCC*MOMG(ZALPHA,ZNU,ZB) )**(-ZLBEX) + ENDIF + CASE(3) ! rain water + IF (CCLOUD == 'LIMA') THEN + ZA=XAR_L + ZB=XBR_L + ZCC=ZCCR(JK)*ZRHODREFZ(JK) + ZCX=0. + ZALPHA=XALPHAR_L + ZNU=XNUR_L + ZLBEX=1.0/(ZCX-ZB) + ZLB=( ZA*ZCC*MOMG(ZALPHA,ZNU,ZB) )**(-ZLBEX) + ELSE + ZA=XAR_I + ZB=XBR_I + ZCC=XCCR_I + ZCX=-1. + ZALPHA=XALPHAR_I + ZNU=XNUR_I + ZLB=XLBR_I + ZLBEX=XLBEXR_I + ENDIF + CASE(4) ! pristine ice + IF (CCLOUD == 'LIMA') THEN + ZA=XAI_L + ZB=XBI_L + ZCC=ZCCI(JK)*ZRHODREFZ(JK) + ZCX=0. + ZALPHA=XALPHAI_L + ZNU=XNUI_L + ZLBEX=1.0/(ZCX-ZB) + ZLB=( ZA*ZCC*MOMG(ZALPHA,ZNU,ZB) )**(-ZLBEX) ! because ZCC not included in XLBI + ZFW=0 + ELSE + ZA=XAI_I + ZB=XBI_I + ZCC=ZCIT(JK) + ZCX=0. + ZALPHA=XALPHAI_I + ZNU=XNUI_I + ZLBEX=XLBEXI_I + ZLB=XLBI_I*ZCC**(-ZLBEX) ! because ZCC not included in XLBI + ZFW=0 + ENDIF + CASE(5) ! snow + IF (CCLOUD == 'LIMA') THEN + ZA=XAS_L + ZB=XBS_L + ZCC=XCCS_L + ZCX=XCXS_L + ZALPHA=XALPHAS_L + ZNU=XNUS_L + ZNS=XNS_L + ZLB=XLBS_L + ZLBEX=XLBEXS_L + ZFW=0 + ELSE + ZA=XAS_I + ZB=XBS_I + ZCC=XCCS_I + ZCX=XCXS_I + ZALPHA=XALPHAS_I + ZNU=XNUS_I + ZNS=XNS_I + ZLB=XLBS_I + ZLBEX=XLBEXS_I + ZFW=0 + ENDIF + CASE(6) ! graupel + !If temperature between -10 and 10°C and Mr and Mg over min threshold: melting graupel + ! with liquid water fraction Fw=Mr/(Mr+Mg) else dry graupel (Fw=0) + IF( ZTEMPZ(JK) > XTT-10 .AND. ZTEMPZ(JK) < XTT+10 & + .AND. ZRZ(JK,3) > ZRTMIN(3) ) THEN + ZFW=ZRZ(JK,3)/(ZRZ(JK,3)+ZRZ(JK,JLOOP)) + ELSE + ZFW=0 + ENDIF + IF (CCLOUD == 'LIMA') THEN + ZA=XAG_L + ZB=XBG_L + ZCC=XCCG_L + ZCX=XCXG_L + ZALPHA=XALPHAG_L + ZNU=XNUG_L + ZLB=XLBG_L + ZLBEX=XLBEXG_L + ELSE + ZA=XAG_I + ZB=XBG_I + ZCC=XCCG_I + ZCX=XCXG_I + ZALPHA=XALPHAG_I + ZNU=XNUG_I + ZLB=XLBG_I + ZLBEX=XLBEXG_I + ENDIF + CASE(7) ! cloud water over land + IF (CCLOUD == 'LIMA') THEN + ZA=XAC_L + ZB=XBC_L + ZCC=ZCCC(JK)*ZRHODREFZ(JK) + ZCX=0. + ZALPHA=XALPHAC_L + ZNU=XNUC_L + ZLBEX=1.0/(ZCX-ZB) + ZLB=( ZA*ZCC*MOMG(ZALPHA,ZNU,ZB) )**(-ZLBEX) + ELSE + ZA=XAC_I + ZB=XBC_I + ZCC=XCONC_LAND + ZCX=0. + ZALPHA=XALPHAC_I + ZNU=XNUC_I + ZLBEX=1.0/(ZCX-ZB) + ZLB=( ZA*ZCC*MOMG(ZALPHA,ZNU,ZB) )**(-ZLBEX) + ENDIF + END SELECT + IF (JLOOP.EQ.5 .AND. ( (CCLOUD=='LIMA'.AND.LSNOW_T_L).OR. & + (CCLOUD=='ICE3'.AND.LSNOW_T_I) ) ) THEN + IF (ZTEMPZ(JK)>-10.) THEN + ZLBDA = MAX(MIN(XLBDAS_MAX, 10**(14.554-0.0423*(ZTEMPZ(JK)+273.15))),XLBDAS_MIN) + ELSE + ZLBDA = MAX(MIN(XLBDAS_MAX, 10**(6.226-0.0106*(ZTEMPZ(JK)+273.15))),XLBDAS_MIN) + END IF + ZN=ZNS*ZRHODREFZ(JK)*ZRZ(JK,JLOOP)*ZLBDA**ZB + ELSE + ZLBDA=ZLB*(ZRHODREFZ(JK)*ZRZ(JK,JLOOP))**ZLBEX + ZN=ZCC*ZLBDA**ZCX + END IF + ZREFLOC=0. + ZAETMP=0. + DO JJ=1,JPTS_GAULAG ! Gauss-Laguerre quadrature + ZDELTA_EQUIV=ZX(JJ)**(1./ZALPHA)/ZLBDA + SELECT CASE(JLOOP) + CASE(2,3,7) + QM=QMW + CASE(4,5,6) + ! pristine ice, snow, dry graupel + ZRHOHYD=MIN(6.*ZA*ZDELTA_EQUIV**(ZB-3.)/XPI,.92*XRHOLW) + QM=sqrt(MG(QMI**2,CMPLX(1,0),ZRHOHYD/.92/XRHOLW)) + + ! water inclusions in ice in air + QEPSWI=MG(QMW**2,QM**2,ZFW) + ! ice in air inclusions in water + QEPSIW=MG(QM**2,QMW**2,1.-ZFW) + + !MG weighted rule (Matrosov 2008) + IF(ZFW .LT. 0.37) THEN + ZFPW=0 + ELSE IF(ZFW .GT. 0.63) THEN + ZFPW=1 + ELSE + ZFPW=(ZFW-0.37)/(0.63-0.37) + ENDIF + QM=sqrt(QEPSWI*(1.-ZFPW)+QEPSIW*ZFPW) + END SELECT + CALL BHMIE(XPI/XLAM_CRAD*ZDELTA_EQUIV,QM,ZQEXT,ZQSCA,ZQBACK) + ZREFLOC=ZREFLOC+ZQBACK*ZX(JJ)**(ZNU-1)*ZDELTA_EQUIV**2*ZW(JJ) + ZAETMP =ZAETMP +ZQEXT *ZX(JJ)**(ZNU-1)*ZDELTA_EQUIV**2*ZW(JJ) + END DO + ZREFLOC=ZREFLOC*(XLAM_CRAD/XPI)**4*ZN/(4.*GAMMA(ZNU)*.93) + ZAETMP=ZAETMP * XPI *ZN/(4.*GAMMA(ZNU)) + TPFLYER%CRARE(IN,JK)=TPFLYER%CRARE(IN,JK)+ZREFLOC + ZAELOC(JK)=ZAELOC(JK)+ZAETMP + END IF + + END DO + + END DO + + ! apply attenuation + ALLOCATE(ZZMZ(IKU)) + ZZMZ(:)=FLYER_INTERPZ(ZZM(:,:,:)) + ! nadir + ZAETOT=1. + DO JK=COUNT(TPFLYER%Z_CUR >= ZZMZ(:)),1,-1 + IF(JK.EQ.COUNT(TPFLYER%Z_CUR >= ZZMZ(:))) THEN + IF(TPFLYER%Z_CUR<=ZZMZ(JK)+.5*(ZZMZ(JK+1)-ZZMZ(JK))) THEN + ! only attenuation from ZAELOC(JK) + ZAETOT=ZAETOT*EXP(-2.*(ZAELOC(JK)*(TPFLYER%Z_CUR-ZZMZ(JK)))) + ELSE + ! attenuation from ZAELOC(JK) and ZAELOC(JK+1) + ZAETOT=ZAETOT*EXP(-2.*(ZAELOC(JK+1)*(TPFLYER%Z_CUR-.5*(ZZMZ(JK+1)+ZZMZ(JK))) & + +ZAELOC(JK)*.5*(ZZMZ(JK+1)-ZZMZ(JK)))) + END IF + ELSE + ! attenuation from ZAELOC(JK) and ZAELOC(JK+1) + ZAETOT=ZAETOT*EXP(-(ZAELOC(JK+1)+ZAELOC(JK))*(ZZMZ(JK+1)-ZZMZ(JK))) + END IF + TPFLYER%CRARE_ATT(IN,JK)=TPFLYER%CRARE(IN,JK)*ZAETOT + END DO + ! zenith + ZAETOT=1. + DO JK = MAX(COUNT(TPFLYER%Z_CUR >= ZZMZ(:)),1)+1,IKU + IF ( JK .EQ. (MAX(COUNT(TPFLYER%Z_CUR >= ZZMZ(:)),1)+1) ) THEN + IF(TPFLYER%Z_CUR>=ZZMZ(JK)-.5*(ZZMZ(JK)-ZZMZ(JK-1))) THEN + ! only attenuation from ZAELOC(JK) + ZAETOT=ZAETOT*EXP(-2.*(ZAELOC(JK)*(ZZMZ(JK)-TPFLYER%Z_CUR))) + ELSE + ! attenuation from ZAELOC(JK) and ZAELOC(JK-1) + ZAETOT=ZAETOT*EXP(-2.*(ZAELOC(JK-1)*(.5*(ZZMZ(JK)+ZZMZ(JK-1))-TPFLYER%Z_CUR) & + +ZAELOC(JK)*.5*(ZZMZ(JK)-ZZMZ(JK-1)))) + END IF + ELSE + ! attenuation from ZAELOC(JK) and ZAELOC(JK-1) + ZAETOT=ZAETOT*EXP(-(ZAELOC(JK-1)+ZAELOC(JK))*(ZZMZ(JK)-ZZMZ(JK-1))) + END IF + TPFLYER%CRARE_ATT(IN,JK)=TPFLYER%CRARE(IN,JK)*ZAETOT + END DO + TPFLYER%ZZ (IN,:) = ZZMZ(:) + DEALLOCATE(ZZMZ,ZAELOC) + ! m^3 → mm^6/m^3 → dBZ + WHERE(TPFLYER%CRARE(IN,:)>0) + TPFLYER%CRARE(IN,:)=10.*LOG10(1.E18*TPFLYER%CRARE(IN,:)) + ELSEWHERE + TPFLYER%CRARE(IN,:)=XUNDEF + END WHERE + WHERE(TPFLYER%CRARE_ATT(IN,:)>0) + TPFLYER%CRARE_ATT(IN,:)=10.*LOG10(1.E18*TPFLYER%CRARE_ATT(IN,:)) + ELSEWHERE + TPFLYER%CRARE_ATT(IN,:)=XUNDEF + END WHERE + DEALLOCATE(ZX,ZW,ZRTMIN) + END IF ! end LOOP ICE3 + ! vertical wind + TPFLYER%WZ (IN,:) = FLYER_INTERPZ(ZWM(:,:,:)) + IF (SIZE(PTKE)>0) TPFLYER%TKE (IN) = FLYER_INTERP(PTKE) + IF (SIZE(PTS) >0) TPFLYER%TSRAD(IN) = FLYER_INTERP_2D(PTS) + IF (LDIAG_IN_RUN) TPFLYER%TKE_DISS(IN) = FLYER_INTERP(XCURRENT_TKE_DISS) + TPFLYER%ZS(IN) = FLYER_INTERP_2D(PZ(:,:,1+JPVEXT)) + TPFLYER%THW_FLUX(IN) = FLYER_INTERP(ZTHW_FLUX) + TPFLYER%RCW_FLUX(IN) = FLYER_INTERP(ZRCW_FLUX) + DO JLOOP=1,SIZE(PSV,4) + TPFLYER%SVW_FLUX(IN,JLOOP) = FLYER_INTERP(ZSVW_FLUX(:,:,:,JLOOP)) + END DO + END IF +! +!---------------------------------------------------------------------------- +! +!* 9. BALLOON ADVECTION +! ----------------- +! + IF (TPFLYER%TYPE=='RADIOS' .OR. TPFLYER%TYPE=='ISODEN' .OR. TPFLYER%TYPE=='CVBALL') THEN + ZU_BAL = FLYER_INTERP_U(PU) + ZV_BAL = FLYER_INTERP_V(PV) + if ( .not. lcartesian ) then + ZMAP = FLYER_INTERP_2D(PMAP) + else + ZMAP = 1. + end if + ! + TPFLYER%X_CUR = TPFLYER%X_CUR + ZU_BAL * PTSTEP * ZMAP + TPFLYER%Y_CUR = TPFLYER%Y_CUR + ZV_BAL * PTSTEP * ZMAP + END IF + ! + IF (TPFLYER%TYPE=='RADIOS') THEN + ZW_BAL = FLYER_INTERP(ZWM) + TPFLYER%Z_CUR = TPFLYER%Z_CUR + ( ZW_BAL + TPFLYER%WASCENT ) * PTSTEP + END IF + ! + IF (TPFLYER%TYPE=='CVBALL') THEN + ZW_BAL = FLYER_INTERP(ZWM) + ZRO_BAL = FLYER_INTERP(ZRHO) + ! calculation with a time step of 1 second or less + IF (INT(PTSTEP) .GT. 1 ) THEN + DO JK=1,INT(PTSTEP) + TPFLYER%WASCENT = TPFLYER%WASCENT & + - ( 1. / (1. + TPFLYER%INDDRAG ) ) * 1. * & + ( XG * ( ( TPFLYER%MASS / TPFLYER%VOLUME ) - ZRO_BAL ) / ( TPFLYER%MASS / TPFLYER%VOLUME ) & + + TPFLYER%WASCENT * ABS ( TPFLYER%WASCENT ) * & + TPFLYER%DIAMETER * TPFLYER%AERODRAG / ( 2. * TPFLYER%VOLUME ) & + ) + TPFLYER%Z_CUR = TPFLYER%Z_CUR + ( ZW_BAL + TPFLYER%WASCENT ) * 1. + END DO + END IF + IF (PTSTEP .GT. INT(PTSTEP)) THEN + TPFLYER%WASCENT = TPFLYER%WASCENT & + - ( 1. / (1. + TPFLYER%INDDRAG ) ) * (PTSTEP-INT(PTSTEP)) * & + ( XG * ( ( TPFLYER%MASS / TPFLYER%VOLUME ) - ZRO_BAL ) / ( TPFLYER%MASS / TPFLYER%VOLUME ) & + + TPFLYER%WASCENT * ABS ( TPFLYER%WASCENT ) * & + TPFLYER%DIAMETER * TPFLYER%AERODRAG / ( 2. * TPFLYER%VOLUME ) & + ) + TPFLYER%Z_CUR = TPFLYER%Z_CUR + ( ZW_BAL + TPFLYER%WASCENT ) * (PTSTEP-INT(PTSTEP)) + END IF + END IF +! +!---------------------------------------------------------------------------- + END IF +!---------------------------------------------------------------------------- +! +!* 10. AIRCRAFT MOVE (computations done on all processors, to limit exchanges) +! ------------- +! + IF (TPFLYER%TYPE=='AIRCRA') THEN +! +! +!* 10.1 Determination of flight segment +! ------------------------------- +! + IL = TPFLYER%SEGCURN + ! + TPFLYER%SEGCURT = TPFLYER%SEGCURT + PTSTEP + ! + DO WHILE (TPFLYER%SEGCURT>TPFLYER%SEGTIME(IL)) + TPFLYER%SEGCURN = TPFLYER%SEGCURN + 1 + IL = TPFLYER%SEGCURN + TPFLYER%SEGCURT = TPFLYER%SEGCURT - TPFLYER%SEGTIME(IL-1) + IF (IL>TPFLYER%SEG) EXIT + END DO +! DO WHILE (TPFLYER%SEGCURT>TPFLYER%SEGTIME(IL) .AND. IL <= TPFLYER%SEG) +! TPFLYER%SEGCURN = TPFLYER%SEGCURN + 1 +! IL = TPFLYER%SEGCURN +! TPFLYER%SEGCURT = TPFLYER%SEGCURT - TPFLYER%SEGTIME(IL-1) +! END DO + ! + !* end of flight + ! + IF (IL > TPFLYER%SEG) TPFLYER%FLY=.FALSE. +! +! +!* 10.2 Determination of new position +! ----------------------------- +! + IF (TPFLYER%FLY) THEN + ZSEG_FRAC = TPFLYER%SEGCURT / TPFLYER%SEGTIME(IL) + ! + TPFLYER%X_CUR = (1.-ZSEG_FRAC) * TPFLYER%SEGX(IL ) & + + ZSEG_FRAC * TPFLYER%SEGX(IL+1) + TPFLYER%Y_CUR = (1.-ZSEG_FRAC) * TPFLYER%SEGY(IL ) & + + ZSEG_FRAC * TPFLYER%SEGY(IL+1) + IF (TPFLYER%ALTDEF) THEN + TPFLYER%P_CUR = (1.-ZSEG_FRAC) * TPFLYER%SEGP(IL ) & + + ZSEG_FRAC * TPFLYER%SEGP(IL+1) + ELSE + TPFLYER%Z_CUR = (1.-ZSEG_FRAC) * TPFLYER%SEGZ(IL ) & + + ZSEG_FRAC * TPFLYER%SEGZ(IL+1) + END IF + END IF + ! + END IF + ! + END IF +! +END IF +! +!---------------------------------------------------------------------------- +! +!* 11. EXCHANGE OF INFORMATION BETWEEN PROCESSORS +! ------------------------------------------ +! +!* 11.1 current position +! ---------------- +! +CALL DISTRIBUTE_FLYER_L(TPFLYER%FLY) +CALL DISTRIBUTE_FLYER_L(TPFLYER%CRASH) +CALL DISTRIBUTE_FLYER(TPFLYER%X_CUR) +CALL DISTRIBUTE_FLYER(TPFLYER%Y_CUR) +IF (TPFLYER%TYPE=='CVBALL') THEN + CALL DISTRIBUTE_FLYER(TPFLYER%Z_CUR) + CALL DISTRIBUTE_FLYER(TPFLYER%WASCENT) +ELSE + IF (TPFLYER%TYPE=='RADIOS') CALL DISTRIBUTE_FLYER(TPFLYER%Z_CUR) + IF (TPFLYER%TYPE=='AIRCRA') THEN + IF (TPFLYER%ALTDEF) THEN + CALL DISTRIBUTE_FLYER(TPFLYER%P_CUR) + ELSE + CALL DISTRIBUTE_FLYER(TPFLYER%Z_CUR) + ENDIF + END IF + IF (TPFLYER%TYPE=='ISODEN' ) CALL DISTRIBUTE_FLYER(TPFLYER%RHO) +END IF +! +!* 11.2 data stored +! ----------- +! +IF ( GSTORE ) THEN + CALL DISTRIBUTE_FLYER(TPFLYER%X (IN)) + CALL DISTRIBUTE_FLYER(TPFLYER%Y (IN)) + CALL DISTRIBUTE_FLYER(TPFLYER%Z (IN)) + CALL DISTRIBUTE_FLYER(TPFLYER%XLON(IN)) + CALL DISTRIBUTE_FLYER(TPFLYER%YLAT(IN)) + CALL DISTRIBUTE_FLYER(TPFLYER%ZON (IN)) + CALL DISTRIBUTE_FLYER(TPFLYER%MER (IN)) + CALL DISTRIBUTE_FLYER(TPFLYER%W (IN)) + CALL DISTRIBUTE_FLYER(TPFLYER%P (IN)) + CALL DISTRIBUTE_FLYER(TPFLYER%TH (IN)) + DO JLOOP=1,SIZE(PR,4) + CALL DISTRIBUTE_FLYER(TPFLYER%R (IN,JLOOP)) + END DO + DO JLOOP=1,SIZE(PSV,4) + CALL DISTRIBUTE_FLYER(TPFLYER%SV (IN,JLOOP)) + END DO + DO JLOOP=1,IKU + CALL DISTRIBUTE_FLYER(TPFLYER%RTZ (IN,JLOOP)) + DO JLOOP2=1,SIZE(PR,4) + CALL DISTRIBUTE_FLYER(TPFLYER%RZ (IN,JLOOP,JLOOP2)) + ENDDO + CALL DISTRIBUTE_FLYER(TPFLYER%FFZ (IN,JLOOP)) + CALL DISTRIBUTE_FLYER(TPFLYER%CIZ (IN,JLOOP)) + IF (CCLOUD== 'LIMA' ) THEN + CALL DISTRIBUTE_FLYER(TPFLYER%CRZ (IN,JLOOP)) + CALL DISTRIBUTE_FLYER(TPFLYER%CCZ (IN,JLOOP)) + ENDIF + CALL DISTRIBUTE_FLYER(TPFLYER%IWCZ (IN,JLOOP)) + CALL DISTRIBUTE_FLYER(TPFLYER%LWCZ (IN,JLOOP)) + CALL DISTRIBUTE_FLYER(TPFLYER%CRARE (IN,JLOOP)) + CALL DISTRIBUTE_FLYER(TPFLYER%CRARE_ATT (IN,JLOOP)) + CALL DISTRIBUTE_FLYER(TPFLYER%WZ (IN,JLOOP)) + CALL DISTRIBUTE_FLYER(TPFLYER%ZZ (IN,JLOOP)) + END DO + IF (SIZE(PTKE)>0) CALL DISTRIBUTE_FLYER(TPFLYER%TKE (IN)) + IF (SIZE(PTS) >0) CALL DISTRIBUTE_FLYER(TPFLYER%TSRAD(IN)) + CALL DISTRIBUTE_FLYER(TPFLYER%ZS (IN)) + CALL DISTRIBUTE_FLYER(TPFLYER%THW_FLUX(IN)) + CALL DISTRIBUTE_FLYER(TPFLYER%RCW_FLUX(IN)) + DO JLOOP=1,SIZE(PSV,4) + CALL DISTRIBUTE_FLYER(TPFLYER%SVW_FLUX(IN,JLOOP)) + END DO +END IF +! +!---------------------------------------------------------------------------- +!---------------------------------------------------------------------------- +! +CONTAINS +! +!---------------------------------------------------------------------------- +!---------------------------------------------------------------------------- +FUNCTION FLYER_INTERP(PA) RESULT(PB) +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PA +REAL :: PB +! +INTEGER :: JI, JJ +! +IF (SIZE(PA,1)==2) THEN + JI=1 + JJ=1 +ELSE + JI=II + JJ=IJ +END IF +! +PB = (1.- ZYCOEF) * (1.-ZXCOEF) * ( (1.-ZZCOEF00) * PA(JI ,JJ ,IK00) + ZZCOEF00 * PA(JI ,JJ ,IK00+1)) & + + (1.- ZYCOEF) * ( ZXCOEF) * ( (1.-ZZCOEF10) * PA(JI+1,JJ ,IK10) + ZZCOEF10 * PA(JI+1,JJ ,IK10+1)) & + + ( ZYCOEF) * (1.-ZXCOEF) * ( (1.-ZZCOEF01) * PA(JI ,JJ+1,IK01) + ZZCOEF01 * PA(JI ,JJ+1,IK01+1)) & + + ( ZYCOEF) * ( ZXCOEF) * ( (1.-ZZCOEF11) * PA(JI+1,JJ+1,IK11) + ZZCOEF11 * PA(JI+1,JJ+1,IK11+1)) +! +END FUNCTION FLYER_INTERP +!---------------------------------------------------------------------------- +FUNCTION FLYER_INTERPZ(PA) RESULT(PB) +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PA +REAL, DIMENSION(SIZE(PA,3)) :: PB +! +INTEGER :: JI, JJ, JK +! +IF (SIZE(PA,1)==2) THEN + JI=1 + JJ=1 +ELSE + JI=II + JJ=IJ +END IF +! +! +DO JK=1,SIZE(PA,3) + IF ( (PA(JI,JJ,JK) /= XUNDEF) .AND. (PA(JI+1,JJ,JK) /= XUNDEF) .AND. & + (PA(JI,JJ+1,JK) /= XUNDEF) .AND. (PA(JI+1,JJ+1,JK) /= XUNDEF) ) THEN + PB(JK) = (1.-ZYCOEF) * (1.-ZXCOEF) * PA(JI,JJ,JK) + & + (1.-ZYCOEF) * (ZXCOEF) * PA(JI+1,JJ,JK) + & + (ZYCOEF) * (1.-ZXCOEF) * PA(JI,JJ+1,JK) + & + (ZYCOEF) * (ZXCOEF) * PA(JI+1,JJ+1,JK) + ELSE + PB(JK) = XUNDEF + END IF +END DO +! +END FUNCTION FLYER_INTERPZ +!---------------------------------------------------------------------------- +FUNCTION FLYER_INTERP_U(PA) RESULT(PB) +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PA +REAL :: PB +! +INTEGER :: JI, JJ +! +IF (SIZE(PA,1)==2) THEN + JI=1 + JJ=1 +ELSE + JI=IU + JJ=IJ +END IF +! +PB = (1.- ZYCOEF) * (1.-ZUCOEF) * ( (1.-ZUCOEF00) * PA(JI ,JJ ,IU00) + ZUCOEF00 * PA(JI ,JJ ,IU00+1)) & + + (1.- ZYCOEF) * ( ZUCOEF) * ( (1.-ZUCOEF10) * PA(JI+1,JJ ,IU10) + ZUCOEF10 * PA(JI+1,JJ ,IU10+1)) & + + ( ZYCOEF) * (1.-ZUCOEF) * ( (1.-ZUCOEF01) * PA(JI ,JJ+1,IU01) + ZUCOEF01 * PA(JI ,JJ+1,IU01+1)) & + + ( ZYCOEF) * ( ZUCOEF) * ( (1.-ZUCOEF11) * PA(JI+1,JJ+1,IU11) + ZUCOEF11 * PA(JI+1,JJ+1,IU11+1)) +! +END FUNCTION FLYER_INTERP_U +!---------------------------------------------------------------------------- +!---------------------------------------------------------------------------- +FUNCTION FLYER_INTERP_V(PA) RESULT(PB) +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PA +REAL :: PB +! +INTEGER :: JI, JJ +! +IF (SIZE(PA,1)==2) THEN + JI=1 + JJ=1 +ELSE + JI=II + JJ=IV +END IF +! +PB = (1.- ZVCOEF) * (1.-ZXCOEF) * ( (1.-ZVCOEF00) * PA(JI ,JJ ,IV00) + ZVCOEF00 * PA(JI ,JJ ,IV00+1)) & + + (1.- ZVCOEF) * ( ZXCOEF) * ( (1.-ZVCOEF10) * PA(JI+1,JJ ,IV10) + ZVCOEF10 * PA(JI+1,JJ ,IV10+1)) & + + ( ZVCOEF) * (1.-ZXCOEF) * ( (1.-ZVCOEF01) * PA(JI ,JJ+1,IV01) + ZVCOEF01 * PA(JI ,JJ+1,IV01+1)) & + + ( ZVCOEF) * ( ZXCOEF) * ( (1.-ZVCOEF11) * PA(JI+1,JJ+1,IV11) + ZVCOEF11 * PA(JI+1,JJ+1,IV11+1)) +! +END FUNCTION FLYER_INTERP_V +!---------------------------------------------------------------------------- +!---------------------------------------------------------------------------- +FUNCTION FLYER_INTERP_2D(PA) RESULT(PB) +! +REAL, DIMENSION(:,:), INTENT(IN) :: PA +REAL :: PB +! +INTEGER :: JI, JJ +! +IF (SIZE(PA,1)==2) THEN + JI=1 + JJ=1 +ELSE + JI=II + JJ=IJ +END IF +! +PB = (1.- ZYCOEF) * (1.-ZXCOEF) * PA(JI ,JJ ) & + + (1.- ZYCOEF) * ( ZXCOEF) * PA(JI+1,JJ ) & + + ( ZYCOEF) * (1.-ZXCOEF) * PA(JI ,JJ+1) & + + ( ZYCOEF) * ( ZXCOEF) * PA(JI+1,JJ+1) +! +END FUNCTION FLYER_INTERP_2D +!---------------------------------------------------------------------------- +!---------------------------------------------------------------------------- +SUBROUTINE DISTRIBUTE_FLYER(PA) +! +REAL, INTENT(INOUT) :: PA +! +PA = PA * ZTHIS_PROC +CALL REDUCESUM_ll(PA,IINFO_ll) +! +END SUBROUTINE DISTRIBUTE_FLYER +!---------------------------------------------------------------------------- +!---------------------------------------------------------------------------- +SUBROUTINE DISTRIBUTE_FLYER_N(KA) +! +INTEGER, INTENT(INOUT) :: KA +REAL :: ZA +! +ZA=KA +! +ZA = ZA * ZTHIS_PROC +CALL REDUCESUM_ll(ZA,IINFO_ll) +! +IF (NINT(ZA)/=0) KA=NINT(ZA) +! +END SUBROUTINE DISTRIBUTE_FLYER_N +!---------------------------------------------------------------------------- +!---------------------------------------------------------------------------- +SUBROUTINE DISTRIBUTE_FLYER_L(OA) +! +LOGICAL, INTENT(INOUT) :: OA +REAL :: ZA +! +ZA=0. +IF (OA) ZA=1. +! +CALL REDUCESUM_ll(ZA,IINFO_ll) +! +IF (ZA==0.) THEN + OA=.FALSE. +ELSE + OA=.TRUE. +END IF +! +END SUBROUTINE DISTRIBUTE_FLYER_L +!---------------------------------------------------------------------------- +!---------------------------------------------------------------------------- +SUBROUTINE FLYER_CHANGE_MODEL(IMI) +! +INTEGER, INTENT(IN) :: IMI ! model index +! +INTEGER :: IMK ! kid model index +INTEGER :: IMODEL ! TPFLYER model index at the beginning of the subroutine +INTEGER :: IU ! U flux point balloon position (x index) +INTEGER :: IV ! V flux point balloon position (y index) +INTEGER :: IU_ABS ! U flux point balloon position (in the model) +INTEGER :: IV_ABS ! V flux point balloon position (in the model) +INTEGER :: IXOR ! Origin's coordinates of the extended 2 way subdomain +INTEGER :: IYOR ! Origin's coordinates of the extended 2 way subdomain +INTEGER :: IIB ! current processor domain sizes +INTEGER :: IJB +INTEGER :: IIE +INTEGER :: IJE +! +! +IMODEL=TPFLYER%NMODEL +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +IU=COUNT( PXHAT (:)<=TPFLYER%X_CUR ) +IV=COUNT( PYHAT (:)<=TPFLYER%Y_CUR ) +ZTHIS_PROC=0. +IF (IU>=IIB .AND. IU<=IIE .AND. IV>=IJB .AND. IV<=IJE) ZTHIS_PROC=1. +IF (ZTHIS_PROC .EQ. 1) THEN + CALL GET_OR_LL('B',IXOR,IYOR) + IU_ABS=IU + IXOR - 1 + IV_ABS=IV + IYOR - 1 + ! + IF (TPFLYER%NMODEL == IMI) THEN + ! + ! go to the kid model if the flyer location is inside + ! ------------------ + ! + DO IMK=IMI+1,NMODEL + IF (NDAD(IMK) == IMI .AND. & + IU_ABS>=NXOR_ALL(IMK) .AND. IU_ABS<=NXEND_ALL(IMK) .AND. & + IV_ABS>=NYOR_ALL(IMK) .AND. IV_ABS<=NYEND_ALL(IMK) ) THEN + TPFLYER%NMODEL = IMK + ! + END IF + END DO + ! + ELSE + ! + ! come from the kid model if the flyer location is outside + ! ------------------ + ! + IMK = TPFLYER%NMODEL + IF (IU_ABS<NXOR_ALL(IMK) .OR. IU_ABS>NXEND_ALL(IMK) .OR. & + IV_ABS<NYOR_ALL(IMK) .OR. IV_ABS>NYEND_ALL(IMK) ) THEN + TPFLYER%NMODEL = IMI + ! + END IF + END IF +END IF +! +! send the information to all the processors +! ---------------------------------------- +! +CALL DISTRIBUTE_FLYER_N(TPFLYER%NMODEL) +ZTHIS_PROC=0. +! +! print if the model changes +!--------------------------------- +IF (TPFLYER%NMODEL /= IMODEL) THEN + IF (NDAD(IMODEL) == TPFLYER%NMODEL) THEN + WRITE(ILUOUT,*) '-------------------------------------------------------------------' + WRITE(ILUOUT,*) TPFLYER%TITLE,' comes from model ',IMODEL,' in model ',& + TPFLYER%NMODEL,' at ',NINT(TDTCUR%xtime),' sec.' + WRITE(ILUOUT,*) '-------------------------------------------------------------------' + ELSE + WRITE(ILUOUT,*) '-------------------------------------------------------------------' + WRITE(ILUOUT,*) TPFLYER%TITLE,' goes from model ',IMODEL,' to model ',& + TPFLYER%NMODEL,' at ',NINT(TDTCUR%xtime),' sec.' + WRITE(ILUOUT,*) '-------------------------------------------------------------------' + ENDIF +ENDIF +! +! +END SUBROUTINE FLYER_CHANGE_MODEL +!---------------------------------------------------------------------------- +!---------------------------------------------------------------------------- +END SUBROUTINE AIRCRAFT_BALLOON_EVOL diff --git a/src/mesonh/ext/boundaries.f90 b/src/mesonh/ext/boundaries.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ba834d678924433ee579b935b13e87fcb1d29fac --- /dev/null +++ b/src/mesonh/ext/boundaries.f90 @@ -0,0 +1,1281 @@ +!MNH_LIC Copyright 1994-2021 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_BOUNDARIES +!##################### +! +INTERFACE +! + SUBROUTINE BOUNDARIES ( & + PTSTEP,HLBCX,HLBCY,KRR,KSV,KTCOUNT, & + PLBXUM,PLBXVM,PLBXWM,PLBXTHM,PLBXTKEM,PLBXRM,PLBXSVM, & + PLBYUM,PLBYVM,PLBYWM,PLBYTHM,PLBYTKEM,PLBYRM,PLBYSVM, & + PLBXUS,PLBXVS,PLBXWS,PLBXTHS,PLBXTKES,PLBXRS,PLBXSVS, & + PLBYUS,PLBYVS,PLBYWS,PLBYTHS,PLBYTKES,PLBYRS,PLBYSVS, & + PRHODJ,PRHODREF, & + PUT,PVT,PWT,PTHT,PTKET,PRT,PSVT,PSRCT ) +! +REAL, INTENT(IN) :: PTSTEP ! time step dt +CHARACTER(LEN=4), DIMENSION(2), INTENT(IN) :: HLBCX,HLBCY ! X and Y-direc. LBC type +! +INTEGER, INTENT(IN) :: KRR ! Number of moist variables +INTEGER, INTENT(IN) :: KSV ! Number of Scalar Variables +INTEGER, INTENT(IN) :: KTCOUNT ! Temporal loop COUNTer + ! (=1 at the segment beginning) +! +! Lateral Boundary fields at time t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBXUM,PLBXVM,PLBXWM ! Wind +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBXTHM ! Mass +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBYUM,PLBYVM,PLBYWM ! Wind +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBYTHM ! Mass +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBXTKEM ! TKE +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBYTKEM +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PLBXRM ,PLBXSVM ! Moisture and SV +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PLBYRM ,PLBYSVM ! in x and y-dir. +! temporal derivative of the Lateral Boundary fields +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBXUS,PLBXVS,PLBXWS ! Wind +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBXTHS ! Mass +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBYUS,PLBYVS,PLBYWS ! Wind +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBYTHS ! Mass +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBXTKES ! TKE +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBYTKES +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PLBXRS ,PLBXSVS ! Moisture and SV +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PLBYRS ,PLBYSVS ! in x and y-dir. +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Jacobian * dry density of + ! the reference state +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PUT,PVT,PWT,PTHT,PTKET,PSRCT +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRT,PSVT + ! Variables at t +! +END SUBROUTINE BOUNDARIES +! +END INTERFACE +! + +END MODULE MODI_BOUNDARIES +! +! +! #################################################################### + SUBROUTINE BOUNDARIES ( & + PTSTEP,HLBCX,HLBCY,KRR,KSV,KTCOUNT, & + PLBXUM,PLBXVM,PLBXWM,PLBXTHM,PLBXTKEM,PLBXRM,PLBXSVM, & + PLBYUM,PLBYVM,PLBYWM,PLBYTHM,PLBYTKEM,PLBYRM,PLBYSVM, & + PLBXUS,PLBXVS,PLBXWS,PLBXTHS,PLBXTKES,PLBXRS,PLBXSVS, & + PLBYUS,PLBYVS,PLBYWS,PLBYTHS,PLBYTKES,PLBYRS,PLBYSVS, & + PRHODJ,PRHODREF, & + PUT,PVT,PWT,PTHT,PTKET,PRT,PSVT,PSRCT ) +! #################################################################### +! +!!**** *BOUNDARIES* - routine to prepare the Lateral Boundary Conditions for +!! all variables at a scalar localization relative to the +!! considered boundary. +!! +!! PURPOSE +!! ------- +! Fill up the left and right lateral EXTernal zones, for all prognostic +! variables, at time t and t-dt, to avoid particular cases close to +! the Lateral Boundaries in routines computing the evolution terms, in +! particular in the advection routines. +! +!!** METHOD +!! ------ +!! 3 different options are proposed: 'WALL' 'CYCL' 'OPEN' +!! to define the Boundary Condition type, +!! though the variables HLBCX and HLBCY (for the X and Y-directions +!! respectively). +!! For the 'OPEN' type of LBC, the treatment depends +!! on the flow configuration: i.e. INFLOW or OUTFLOW conditions. +!! +!! EXTERNAL +!! -------- +!! GET_INDICE_ll : get physical sub-domain bounds +!! LWEAST_ll,LEAST_ll,LNORTH_ll,LSOUTH_ll : position functions +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODD_PARAMETERS : +!! JPHEXT ,JPVEXT +!! +!! Module MODD_CONF : +!! CCONF +!! +!! Module MODE_UPDATE_NSV : +!! NSV_CHEM, NSV_CHEMBEG, NSV_CHEMEND +!! +!! Module MODD_CTURB : +!! XTKEMIN +!! +!! REFERENCE +!! --------- +!! Book1 and book2 of documentation (routine BOUNDARIES) +!! +!! AUTHOR +!! ------ +!! J.-P. Lafore J. Stein * Meteo France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 17/10/94 +!! Modification 02/11/94 (J.Stein) copy for t-dt at the external points +!! + change the copy formulation +!! Modification 18/11/94 (J.Stein) bug correction in the normal velocity +!! prescription in the WALL cases +!! Modification 13/02/95 (Lafore) to account for the OPEN case and +!! for the LS fields introduction +!! Modification 03/03/95 (Mallet) corrections in variables names in +!! the Y-OPEN case +!! 16/03/95 (J.Stein) remove R from the historical variables +!! Modification 31/05/95 (Lafore) MASTER_DEV2.1 preparation after the +!! LBC tests performed by I. Mallet +!! Modification 15/03/96 (Richard) bug correction for OPEN CASE: (TOP Y-LBC) +!! Rv case +!! Modification 15/03/96 (Shure) bug correction for SV variable in +!! open x right case +!! Modification 24/10/96 (Masson) initialization of outer points in +!! wall cases for spawning interpolations +!! Modification 13/03/97 (Lafore) "surfacic" LS-fields introduction +!! Modification 10/04/97 (Lafore) proper treatment of minima for TKE and EPS +!! Modification 01/09/97 (Masson) minimum value for water and passive +!! scalars set to zero at instants M,T +!! Modification 20/10/97 (Lafore) introduction of DAVI type of lbc +!! suppression of NEST type +!! Modification 12/11/97 ( Stein ) use the lB fields +!! Modification 02/06/98 (Lafore) declaration of local variables (PLBXUM +!! and PLBXWM do'nt have the same size) +!! Modification 24/08/98 (Jabouille) parallelize the code +!! Modification 20/04/99 ( Stein ) use the same conditions for times t +!! and t-dt +!! Modification 11/04/00 (Mari) special conditions for chemical variables +!! Modification 10/01/01 (Tulet) update for MOCAGE boundary conditions +!! Modification 22/01/01 (Gazen) use NSV_CHEM,NSV_CHEMBEG,NSV_CHEMEND variables +!! Modification 22/06/01(Jabouille) use XSVMIN +!! Modification 20/11/01(Gazen & Escobar) rewrite GCHBOUNDARY for portability +!! Modification 14/03/05 (Tulet) bug : in case of CYCL do not call ch_boundaries +!! Modification 14/05/05 (Tulet) add aerosols / dust +!! Modification 05/06 Suppression of DAVI type of lbc +!! Modification 05/06 Remove EPS +!! Modification 12/2010 (Chong) Add boundary condition for ions +!! (fair weather profiles) +!! Modification 07/2013 (Bosseur & Filippi) adds Forefire +!! Modification 04/2013 (C.Lac) Remove instant M +!! Modification 01/2015 (JL Redelsperger) Introduction of ponderation +!! for non normal velocity and potential temp +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! Redelsperger & Pianezze : 08/2015 : add XPOND coefficient +!! Modification 01/2016 (JP Pinty) Add LIMA that is LBC for CCN and IFN +!! Modification 18/07/17 (Vionnet) Add blowing snow variables +!! Modification 01/2018 (JL Redelsperger) Correction for TKE treatment +!! Modification 03/02/2020 (B. Vié) Correction for SV with LIMA +! P. Wautelet 04/06/2020: correct call to Set_conc_lima +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! +USE MODD_BLOWSNOW, ONLY : LBLOWSNOW,NBLOWSNOW_2D +USE MODD_BLOWSNOW_n +USE MODD_CH_AEROSOL , ONLY : LORILAM +USE MODD_CH_MNHC_n, ONLY : LUSECHEM, LUSECHIC +USE MODD_CONDSAMP, ONLY : LCONDSAMP +USE MODD_CONF +USE MODD_TURB_n, ONLY : XTKEMIN +USE MODD_DUST +USE MODD_GRID_n, ONLY : XZZ +USE MODD_ELEC_DESCR +USE MODD_ELEC_n +#ifdef MNH_FOREFIRE +USE MODD_FOREFIRE, ONLY : LFOREFIRE +#endif +USE MODD_LBC_n, ONLY : XPOND +USE MODE_ll +USE MODD_NESTING, ONLY : NDAD +USE MODD_NSV +USE MODD_PARAMETERS +USE MODD_PARAM_LIMA, ONLY : NMOD_CCN, NMOD_IFN, LBOUND, LWARM, LCOLD +USE MODD_PARAM_n, ONLY : CELEC,CCLOUD +USE MODD_PASPOL, ONLY : LPASPOL +USE MODD_PRECISION, ONLY: MNHREAL32 +USE MODD_REF_n +USE MODD_SALT, ONLY : LSALT + +USE MODE_MODELN_HANDLER +USE MODE_SET_CONC_LIMA + +USE MODI_CH_BOUNDARIES +USE MODI_INIT_AEROSOL_CONCENTRATION +USE MODI_ION_BOUNDARIES + +IMPLICIT NONE +! +! +!* 0.1 declarations of arguments +! +! +! +! +REAL, INTENT(IN) :: PTSTEP ! time step dt +CHARACTER(LEN=4), DIMENSION(2), INTENT(IN) :: HLBCX,HLBCY ! X and Y-direc. LBC type +! +INTEGER, INTENT(IN) :: KRR ! Number of moist variables +INTEGER, INTENT(IN) :: KSV ! Number of Scalar Variables +INTEGER, INTENT(IN) :: KTCOUNT ! Temporal loop COUNTer + ! (=1 at the segment beginning) +! +! Lateral Boundary fields at time t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBXUM,PLBXVM,PLBXWM ! Wind +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBXTHM ! Mass +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBYUM,PLBYVM,PLBYWM ! Wind +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBYTHM ! Mass +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBXTKEM ! TKE +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBYTKEM +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PLBXRM ,PLBXSVM ! Moisture and SV +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PLBYRM ,PLBYSVM ! in x and y-dir. +! temporal derivative of the Lateral Boundary fields +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBXUS,PLBXVS,PLBXWS ! Wind +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBXTHS ! Mass +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBYUS,PLBYVS,PLBYWS ! Wind +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBYTHS ! Mass +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBXTKES ! TKE +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBYTKES +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PLBXRS ,PLBXSVS ! Moisture and SV +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PLBYRS ,PLBYSVS ! in x and y-dir. +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Jacobian * dry density of + ! the reference state +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PUT,PVT,PWT,PTHT,PTKET,PSRCT +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRT,PSVT + ! Variables at t +! +!* 0.2 declarations of local variables +! +INTEGER :: IIB ! indice I Beginning in x direction +INTEGER :: IJB ! indice J Beginning in y direction +INTEGER :: IKB ! indice K Beginning in z direction +INTEGER :: IIE ! indice I End in x direction +INTEGER :: IJE ! indice J End in y direction +INTEGER :: IKE ! indice K End in z direction +INTEGER :: JEXT ! Loop index for EXTernal points +INTEGER :: JRR ! Loop index for RR variables (water) +INTEGER :: JSV ! Loop index for Scalar Variables +INTEGER :: IMI ! Model Index +REAL :: ZTSTEP ! effective time step +REAL :: ZPOND ! Coeff PONDERATION LS +INTEGER :: ILBX,ILBY ! size of LB fields' arrays +LOGICAL, SAVE, DIMENSION(:), ALLOCATABLE :: GCHBOUNDARY, GAERBOUNDARY,& + GDSTBOUNDARY, GSLTBOUNDARY, GPPBOUNDARY, & + GCSBOUNDARY, GICBOUNDARY, GLIMABOUNDARY,GSNWBOUNDARY +LOGICAL, SAVE :: GFIRSTCALL1 = .TRUE. +LOGICAL, SAVE :: GFIRSTCALL2 = .TRUE. +LOGICAL, SAVE :: GFIRSTCALL3 = .TRUE. +LOGICAL, SAVE :: GFIRSTCALL5 = .TRUE. +LOGICAL, SAVE :: GFIRSTCALLPP = .TRUE. +LOGICAL, SAVE :: GFIRSTCALLCS = .TRUE. +LOGICAL, SAVE :: GFIRSTCALLIC = .TRUE. +LOGICAL, SAVE :: GFIRSTCALLLIMA = .TRUE. +! +REAL, DIMENSION(SIZE(PLBXWM,1),SIZE(PLBXWM,2),SIZE(PLBXWM,3)) :: & + ZLBXVT,ZLBXWT,ZLBXTHT +REAL, DIMENSION(SIZE(PLBYWM,1),SIZE(PLBYWM,2),SIZE(PLBYWM,3)) :: & + ZLBYUT,ZLBYWT,ZLBYTHT +REAL, DIMENSION(SIZE(PLBXTKEM,1),SIZE(PLBXTKEM,2),SIZE(PLBXTKEM,3)) :: & + ZLBXTKET +REAL, DIMENSION(SIZE(PLBYTKEM,1),SIZE(PLBYTKEM,2),SIZE(PLBYTKEM,3)) :: & + ZLBYTKET +REAL, DIMENSION(SIZE(PLBXRM,1),SIZE(PLBXRM,2),SIZE(PLBXRM,3),SIZE(PLBXRM,4)) :: & + ZLBXRT +REAL, DIMENSION(SIZE(PLBYRM,1),SIZE(PLBYRM,2),SIZE(PLBYRM,3),SIZE(PLBYRM,4)) :: & + ZLBYRT +REAL, DIMENSION(SIZE(PLBXSVM,1),SIZE(PLBXSVM,2),SIZE(PLBXSVM,3),SIZE(PLBXSVM,4)) :: & + ZLBXSVT +REAL, DIMENSION(SIZE(PLBYSVM,1),SIZE(PLBYSVM,2),SIZE(PLBYSVM,3),SIZE(PLBYSVM,4)) :: & + ZLBYSVT +LOGICAL :: GCHTMP +LOGICAL :: GPPTMP +LOGICAL :: GCSTMP +! +LOGICAL, SAVE :: GFIRSTCALL4 = .TRUE. +! +#ifdef MNH_FOREFIRE +LOGICAL, SAVE, DIMENSION(:), ALLOCATABLE :: GFFBOUNDARY +LOGICAL, SAVE :: GFIRSTCALLFF = .TRUE. +LOGICAL :: GFFTMP +#endif +! +INTEGER :: JI,JJ +! +REAL, DIMENSION(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3),SIZE(PSVT,4)) :: ZSVT +REAL, DIMENSION(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3),SIZE(PRT,4)) :: ZRT +! +!------------------------------------------------------------------------------- +! +!* 1. COMPUTE DIMENSIONS OF ARRAYS AND OTHER INDICES: +! ---------------------------------------------- +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +IKB = 1 + JPVEXT +IKE = SIZE(PUT,3) - JPVEXT +IMI = GET_CURRENT_MODEL_INDEX() +! +!------------------------------------------------------------------------------- +! +!* 2. UPPER AND LOWER BC FILLING: +! --------------------------- +! +!* 2.1 COMPUTE THE FIELD EXTRAPOLATIONS AT THE GROUND +! + +! +! at the instant t +! +IF(SIZE(PUT) /= 0) PUT (:,:,IKB-1) = PUT (:,:,IKB) +IF(SIZE(PVT) /= 0) PVT (:,:,IKB-1) = PVT (:,:,IKB) +IF(SIZE(PWT) /= 0) PWT (:,:,IKB-1) = PWT (:,:,IKB) +IF(SIZE(PTHT) /= 0) PTHT (:,:,IKB-1) = PTHT (:,:,IKB) +IF(SIZE(PTKET) /= 0) PTKET(:,:,IKB-1) = PTKET(:,:,IKB) +IF(SIZE(PRT) /= 0) PRT (:,:,IKB-1,:)= PRT (:,:,IKB,:) +IF(SIZE(PSVT)/= 0) PSVT (:,:,IKB-1,:)= PSVT (:,:,IKB,:) +IF(SIZE(PSRCT) /= 0) PSRCT(:,:,IKB-1) = PSRCT(:,:,IKB) +! +! +!* 2.2 COMPUTE THE FIELD EXTRAPOLATIONS AT THE TOP +! +! at the instant t +! +IF(SIZE(PWT) /= 0) PWT (:,:,IKE+1) = 0. +IF(SIZE(PUT) /= 0) PUT (:,:,IKE+1) = PUT (:,:,IKE) +IF(SIZE(PVT) /= 0) PVT (:,:,IKE+1) = PVT (:,:,IKE) +IF(SIZE(PTHT) /= 0) PTHT (:,:,IKE+1) = PTHT (:,:,IKE) +IF(SIZE(PTKET) /= 0) PTKET(:,:,IKE+1) = PTKET(:,:,IKE) +IF(SIZE(PRT) /= 0) PRT (:,:,IKE+1,:) = PRT (:,:,IKE,:) +IF(SIZE(PSVT)/= 0) PSVT (:,:,IKE+1,:) = PSVT (:,:,IKE,:) +IF(SIZE(PSRCT) /= 0) PSRCT(:,:,IKE+1) = PSRCT(:,:,IKE) + +! specific for positive and negative ions mixing ratios (1/kg) + +IF (NSV_ELEC .NE. 0) THEN +! + IF (SIZE(PWT) /= 0) THEN + WHERE ( PWT(:,:,IKE+1) .GE. 0.) ! Outflow + PSVT (:,:,IKE+1,NSV_ELECBEG) = 2.*PSVT (:,:,IKE,NSV_ELECBEG) - & + PSVT (:,:,IKE-1,NSV_ELECBEG) + PSVT (:,:,IKE+1,NSV_ELECEND) = 2.*PSVT (:,:,IKE,NSV_ELECEND) - & + PSVT (:,:,IKE-1,NSV_ELECEND) + ELSE WHERE ! Inflow from the top + PSVT (:,:,IKE+1,NSV_ELECBEG) = XCION_POS_FW(:,:,IKE+1) + PSVT (:,:,IKE+1,NSV_ELECEND) = XCION_NEG_FW(:,:,IKE+1) + END WHERE + ENDIF +! +END IF + +! +! +!------------------------------------------------------------------------------- +! +!* 3. COMPUTE LB FIELDS AT TIME T +! --------------------------- +! +! +IF ( KTCOUNT == 1) THEN + ZTSTEP = 0. +ELSE + ZTSTEP = PTSTEP +END IF +! +! +IF ( SIZE(PLBXTHS,1) /= 0 .AND. & + ( HLBCX(1)=='OPEN' .OR. HLBCX(2)=='OPEN') ) THEN + ZLBXVT(:,:,:) = PLBXVM(:,:,:) + ZTSTEP * PLBXVS(:,:,:) + ZLBXWT(:,:,:) = PLBXWM(:,:,:) + ZTSTEP * PLBXWS(:,:,:) + ZLBXTHT(:,:,:) = PLBXTHM(:,:,:) + ZTSTEP * PLBXTHS(:,:,:) + IF ( SIZE(PTKET,1) /= 0 ) THEN + ZLBXTKET(:,:,:) = PLBXTKEM(:,:,:) + ZTSTEP * PLBXTKES(:,:,:) + END IF + IF ( KRR > 0) THEN + ZLBXRT(:,:,:,:) = PLBXRM(:,:,:,:) + ZTSTEP * PLBXRS(:,:,:,:) + END IF + IF ( KSV > 0) THEN + ZLBXSVT(:,:,:,:) = PLBXSVM(:,:,:,:) + ZTSTEP * PLBXSVS(:,:,:,:) + END IF +! +ELSE +! + ZLBXVT(:,:,:) = PLBXVM(:,:,:) + ZLBXWT(:,:,:) = PLBXWM(:,:,:) + ZLBXTHT(:,:,:) = PLBXTHM(:,:,:) + IF ( SIZE(PTKET,1) /= 0 ) THEN + ZLBXTKET(:,:,:) = PLBXTKEM(:,:,:) + END IF + IF ( KRR > 0) THEN + ZLBXRT(:,:,:,:) = PLBXRM(:,:,:,:) + END IF + IF ( KSV > 0) THEN + ZLBXSVT(:,:,:,:) = PLBXSVM(:,:,:,:) + END IF +! +END IF +! +! ============================================================ +! +! Reproductibility for RSTART -> truncate ZLB to real(knd=4) to have reproductible result +! +ZLBXVT(:,:,:) = real(ZLBXVT(:,:,:),kind=MNHREAL32) +ZLBXWT(:,:,:) = real(ZLBXWT(:,:,:),kind=MNHREAL32) +ZLBXTHT(:,:,:) = real(ZLBXTHT(:,:,:),kind=MNHREAL32) +IF ( SIZE(PTKET,1) /= 0 ) THEN + ZLBXTKET(:,:,:) = real(ZLBXTKET(:,:,:),kind=MNHREAL32) +END IF +IF ( KRR > 0) THEN + ZLBXRT(:,:,:,:) = real(ZLBXRT(:,:,:,:),kind=MNHREAL32) +END IF +IF ( KSV > 0) THEN + ZLBXSVT(:,:,:,:) = real(ZLBXSVT(:,:,:,:),kind=MNHREAL32) +END IF +! ============================================================ +! +IF ( SIZE(PLBYTHS,1) /= 0 .AND. & + ( HLBCY(1)=='OPEN' .OR. HLBCY(2)=='OPEN' )) THEN + ZLBYUT(:,:,:) = PLBYUM(:,:,:) + ZTSTEP * PLBYUS(:,:,:) + ZLBYWT(:,:,:) = PLBYWM(:,:,:) + ZTSTEP * PLBYWS(:,:,:) + ZLBYTHT(:,:,:) = PLBYTHM(:,:,:) + ZTSTEP * PLBYTHS(:,:,:) + IF ( SIZE(PTKET,1) /= 0 ) THEN + ZLBYTKET(:,:,:) = PLBYTKEM(:,:,:) + ZTSTEP * PLBYTKES(:,:,:) + END IF + IF ( KRR > 0) THEN + ZLBYRT(:,:,:,:) = PLBYRM(:,:,:,:) + ZTSTEP * PLBYRS(:,:,:,:) + END IF + IF ( KSV > 0) THEN + ZLBYSVT(:,:,:,:) = PLBYSVM(:,:,:,:) + ZTSTEP * PLBYSVS(:,:,:,:) + END IF +! +ELSE +! + ZLBYUT(:,:,:) = PLBYUM(:,:,:) + ZLBYWT(:,:,:) = PLBYWM(:,:,:) + ZLBYTHT(:,:,:) = PLBYTHM(:,:,:) + IF ( SIZE(PTKET,1) /= 0 ) THEN + ZLBYTKET(:,:,:) = PLBYTKEM(:,:,:) + END IF + IF ( KRR > 0) THEN + ZLBYRT(:,:,:,:) = PLBYRM(:,:,:,:) + END IF + IF ( KSV > 0) THEN + ZLBYSVT(:,:,:,:) = PLBYSVM(:,:,:,:) + END IF +! +END IF +! +! +! ============================================================ +! +! Reproductibility for RSTART -> truncate ZLB to real(knd=4) to have reproductible result +! +ZLBYUT(:,:,:) = real(ZLBYUT(:,:,:),kind=MNHREAL32) +ZLBYWT(:,:,:) = real(ZLBYWT(:,:,:),kind=MNHREAL32) +ZLBYTHT(:,:,:) = real(ZLBYTHT(:,:,:),kind=MNHREAL32) +IF ( SIZE(PTKET,1) /= 0 ) THEN + ZLBYTKET(:,:,:) = real(ZLBYTKET(:,:,:),kind=MNHREAL32) +END IF +IF ( KRR > 0) THEN + ZLBYRT(:,:,:,:) = real(ZLBYRT(:,:,:,:),kind=MNHREAL32) +END IF +IF ( KSV > 0) THEN + ZLBYSVT(:,:,:,:) = real(ZLBYSVT(:,:,:,:),kind=MNHREAL32) +END IF +! ============================================================ +! +!------------------------------------------------------------------------------- +! PONDERATION COEFF for Non-Normal velocities and pot temperature +! +ZPOND = XPOND +! +!* 4. LBC FILLING IN THE X DIRECTION (LEFT WEST SIDE): +! ------------------------------------------------ +IF (LWEST_ll( )) THEN +! +! +SELECT CASE ( HLBCX(1) ) +! +!* 4.1 WALL CASE: +! ========= +! + CASE ('WALL') +! + DO JEXT=1,JPHEXT + IF(SIZE(PUT) /= 0) PUT (IIB-JEXT,:,:) = PUT (IIB ,:,:) ! never used during run + IF(SIZE(PVT) /= 0) PVT (IIB-JEXT,:,:) = PVT (IIB-1+JEXT,:,:) + IF(SIZE(PWT) /= 0) PWT (IIB-JEXT,:,:) = PWT (IIB-1+JEXT,:,:) + IF(SIZE(PTHT) /= 0) PTHT(IIB-JEXT,:,:) = PTHT (IIB-1+JEXT,:,:) + IF(SIZE(PTKET)/= 0) PTKET(IIB-JEXT,:,:) = PTKET(IIB-1+JEXT,:,:) + IF(SIZE(PRT) /= 0) PRT (IIB-JEXT,:,:,:) = PRT (IIB-1+JEXT,:,:,:) + IF(SIZE(PSVT) /= 0) PSVT(IIB-JEXT,:,:,:) = PSVT (IIB-1+JEXT,:,:,:) + IF(SIZE(PSRCT) /= 0) PSRCT (IIB-JEXT,:,:) = PSRCT (IIB-1+JEXT,:,:) + IF(LBLOWSNOW) XSNWCANO(IIB-JEXT,:,:) = XSNWCANO(IIB-1+JEXT,:,:) +! + END DO +! + IF(SIZE(PUT) /= 0) PUT(IIB ,:,:) = 0. ! set the normal velocity +! +! +!* 4.2 OPEN CASE: +! ========= +! + CASE ('OPEN') +! + IF(SIZE(PUT) /= 0) THEN + DO JI=JPHEXT,1,-1 + PUT(JI,:,:)=0. + WHERE ( PUT(IIB,:,:) <= 0. ) ! OUTFLOW condition + PVT (JI,:,:) = 2.*PVT (JI+1,:,:) -PVT (JI+2,:,:) + PWT (JI,:,:) = 2.*PWT (JI+1,:,:) -PWT (JI+2,:,:) + PTHT (JI,:,:) = 2.*PTHT (JI+1,:,:) -PTHT (JI+2,:,:) + ! + ELSEWHERE ! INFLOW condition + PVT (JI,:,:) = ZPOND*ZLBXVT (JI,:,:) + (1.-ZPOND)* PVT(JI+1,:,:) ! 1 + PWT (JI,:,:) = ZPOND*ZLBXWT (JI,:,:) + (1.-ZPOND)* PWT(JI+1,:,:) ! 1 + PTHT (JI,:,:) = ZPOND*ZLBXTHT (JI,:,:) + (1.-ZPOND)* PTHT(JI+1,:,:)! 1 + ENDWHERE + ENDDO + ENDIF +! +! + IF(SIZE(PTKET) /= 0) THEN + DO JI=JPHEXT,1,-1 + WHERE ( PUT(IIB,:,:) <= 0. ) ! OUTFLOW condition + PTKET(JI,:,:) = MAX(XTKEMIN, 2.*PTKET(JI+1,:,:)-PTKET(JI+2,:,:)) + ELSEWHERE ! INFLOW condition + PTKET(JI,:,:) = MAX(XTKEMIN, ZPOND*ZLBXTKET(JI,:,:) + (1.-ZPOND)*PTKET(JI+1,:,:)) + ENDWHERE + ENDDO + END IF + ! +! Case with KRR moist variables +! +! +! + DO JRR =1 ,KRR + IF(SIZE(PUT) /= 0) THEN + DO JI=JPHEXT,1,-1 + WHERE ( PUT(IIB,:,:) <= 0. ) ! OUTFLOW condition + PRT(JI,:,:,JRR) = MAX(0.,2.*PRT(JI+1,:,:,JRR) -PRT(JI+2,:,:,JRR)) + ELSEWHERE ! INFLOW condition + PRT(JI,:,:,JRR) = MAX(0.,ZLBXRT(JI,:,:,JRR)) ! 1 + END WHERE + END DO + END IF + ! + END DO +! + IF(SIZE(PSRCT) /= 0) THEN + DO JI=JPHEXT,1,-1 + PSRCT (JI,:,:) = PSRCT (JI+1,:,:) + END DO + END IF +! +! Case with KSV scalar variables + DO JSV=1 ,KSV + IF(SIZE(PUT) /= 0) THEN + DO JI=JPHEXT,1,-1 + WHERE ( PUT(IIB,:,:) <= 0. ) ! OUTFLOW condition + PSVT(JI,:,:,JSV) = MAX(XSVMIN(JSV),2.*PSVT(JI+1,:,:,JSV) - & + PSVT(JI+2,:,:,JSV)) + ELSEWHERE ! INFLOW condition + PSVT(JI,:,:,JSV) = MAX(XSVMIN(JSV),ZLBXSVT(JI,:,:,JSV)) ! 1 + END WHERE + END DO + END IF + ! + END DO + ! + IF(LBLOWSNOW) THEN + DO JSV=1 ,NBLOWSNOW_2D + WHERE ( PUT(IIB,:,IKB) <= 0. ) ! OUTFLOW condition + XSNWCANO(IIB-1,:,JSV) = MAX(0.,2.*XSNWCANO(IIB,:,JSV) - & + XSNWCANO(IIB+1,:,JSV)) + ELSEWHERE ! INFLOW condition + XSNWCANO(IIB-1,:,JSV) = 0. ! Assume no snow enter throug + ! boundaries + END WHERE + END DO + DO JSV=NSV_SNWBEG ,NSV_SNWEND + IF(SIZE(PUT) /= 0) THEN + WHERE ( PUT(IIB,:,:) <= 0. ) ! OUTFLOW condition + PSVT(IIB-1,:,:,JSV) = MAX(0.,2.*PSVT(IIB,:,:,JSV) - & + PSVT(IIB+1,:,:,JSV)) + ELSEWHERE ! INFLOW condition + PSVT(IIB-1,:,:,JSV) = 0. ! Assume no snow enter throug + ! boundaries + END WHERE + END IF + ! + END DO + ENDIF +! +! +END SELECT +! +END IF +!------------------------------------------------------------------------------- +! +!* 5 LBC FILLING IN THE X DIRECTION (RIGHT EAST SIDE): +! ===============-------------------------------- +! +IF (LEAST_ll( )) THEN +! +SELECT CASE ( HLBCX(2) ) +! +!* 5.1 WALL CASE: +! ========= +! + CASE ('WALL') +! + DO JEXT=1,JPHEXT + IF(SIZE(PUT) /= 0) PUT (IIE+JEXT,:,:) = PUT (IIE ,:,:) ! never used during run + IF(SIZE(PVT) /= 0) PVT (IIE+JEXT,:,:) = PVT (IIE+1-JEXT,:,:) + IF(SIZE(PWT) /= 0) PWT (IIE+JEXT,:,:) = PWT (IIE+1-JEXT,:,:) + IF(SIZE(PTHT) /= 0) PTHT (IIE+JEXT,:,:) = PTHT (IIE+1-JEXT,:,:) + IF(SIZE(PTKET) /= 0) PTKET(IIE+JEXT,:,:) = PTKET(IIE+1-JEXT,:,:) + IF(SIZE(PRT) /= 0) PRT (IIE+JEXT,:,:,:) = PRT (IIE+1-JEXT,:,:,:) + IF(SIZE(PSVT) /= 0) PSVT(IIE+JEXT,:,:,:) = PSVT (IIE+1-JEXT,:,:,:) + IF(SIZE(PSRCT) /= 0) PSRCT (IIE+JEXT,:,:)= PSRCT (IIE+1-JEXT,:,:) + IF(LBLOWSNOW) XSNWCANO(IIE+JEXT,:,:) = XSNWCANO(IIE+1-JEXT,:,:) +! + END DO +! + IF(SIZE(PUT) /= 0) PUT(IIE+1 ,:,:) = 0. ! set the normal velocity +! +!* 5.2 OPEN CASE: +! ========= +! + CASE ('OPEN') +! + ILBX = SIZE(PLBXVM,1) + IF(SIZE(PUT) /= 0) THEN + DO JI=1,JPHEXT + WHERE ( PUT(IIE+1,:,:) >= 0. ) ! OUTFLOW condition + PVT (IIE+JI,:,:) = 2.*PVT (IIE+JI-1,:,:) -PVT (IIE+JI-2,:,:) + PWT (IIE+JI,:,:) = 2.*PWT (IIE+JI-1,:,:) -PWT (IIE+JI-2,:,:) + PTHT (IIE+JI,:,:) = 2.*PTHT (IIE+JI-1,:,:) -PTHT (IIE+JI-2,:,:) + ! + ELSEWHERE ! INFLOW condition + PVT (IIE+JI,:,:) = ZPOND*ZLBXVT (ILBX-JPHEXT+JI,:,:) + (1.-ZPOND)* PVT(IIE+JI-1,:,:) + PWT (IIE+JI,:,:) = ZPOND*ZLBXWT (ILBX-JPHEXT+JI,:,:) + (1.-ZPOND)* PWT(IIE+JI-1,:,:) + PTHT (IIE+JI,:,:) = ZPOND*ZLBXTHT (ILBX-JPHEXT+JI,:,:) + (1.-ZPOND)* PTHT(IIE+JI-1,:,:) + ENDWHERE + END DO + ENDIF + ! + IF(SIZE(PTKET) /= 0) THEN + ILBX = SIZE(PLBXTKEM,1) + DO JI=1,JPHEXT + WHERE ( PUT(IIE+1,:,:) >= 0. ) ! OUTFLOW condition + PTKET(IIE+JI,:,:) = MAX(XTKEMIN, 2.*PTKET(IIE+JI-1,:,:)-PTKET(IIE+JI-2,:,:)) + ELSEWHERE ! INFLOW condition + PTKET(IIE+JI,:,:) = MAX(XTKEMIN, ZPOND*ZLBXTKET(ILBX-JPHEXT+JI,:,:) + & + (1.-ZPOND)*PTKET(IIE+JI-1,:,:)) + ENDWHERE + END DO + END IF + ! +! +! Case with KRR moist variables +! +! + DO JRR =1 ,KRR + ILBX=SIZE(PLBXRM,1) + ! + IF(SIZE(PUT) /= 0) THEN + DO JI=1,JPHEXT + WHERE ( PUT(IIE+1,:,:) >= 0. ) ! OUTFLOW condition + PRT(IIE+JI,:,:,JRR) = MAX(0.,2.*PRT(IIE+JI-1,:,:,JRR) -PRT(IIE+JI-2,:,:,JRR)) + ELSEWHERE ! INFLOW condition + PRT(IIE+JI,:,:,JRR) = MAX(0.,ZLBXRT(ILBX-JPHEXT+JI,:,:,JRR)) + END WHERE + END DO + END IF + ! + END DO +! + IF(SIZE(PSRCT) /= 0) THEN + DO JI=1,JPHEXT + PSRCT (IIE+JI,:,:) = PSRCT (IIE+JI-1,:,:) + END DO + END IF +! Case with KSV scalar variables + DO JSV=1 ,KSV + ILBX=SIZE(PLBXSVM,1) + IF(SIZE(PUT) /= 0) THEN + DO JI=1,JPHEXT + WHERE ( PUT(IIE+1,:,:) >= 0. ) ! OUTFLOW condition + PSVT(IIE+JI,:,:,JSV) = MAX(XSVMIN(JSV),2.*PSVT(IIE+JI-1,:,:,JSV) - & + PSVT(IIE+JI-2,:,:,JSV)) + ELSEWHERE ! INFLOW condition + PSVT(IIE+JI,:,:,JSV) = MAX(XSVMIN(JSV),ZLBXSVT(ILBX-JPHEXT+JI,:,:,JSV)) + END WHERE + END DO + END IF + ! + END DO +! + IF(LBLOWSNOW) THEN + DO JSV=1 ,3 + WHERE ( PUT(IIE+1,:,IKB) >= 0. ) ! OUTFLOW condition + XSNWCANO(IIE+1,:,JSV) = MAX(0.,2.*XSNWCANO(IIE,:,JSV) - & + XSNWCANO(IIE-1,:,JSV)) + ELSEWHERE ! INFLOW condition + XSNWCANO(IIE+1,:,JSV) = 0. ! Assume no snow enter throug + ! boundaries + END WHERE + END DO + DO JSV=NSV_SNWBEG ,NSV_SNWEND + IF(SIZE(PUT) /= 0) THEN + WHERE ( PUT(IIE+1,:,:) >= 0. ) ! OUTFLOW condition + PSVT(IIE+1,:,:,JSV) = MAX(0.,2.*PSVT(IIE,:,:,JSV) - & + PSVT(IIE-1,:,:,JSV)) + ELSEWHERE ! INFLOW condition + PSVT(IIE+1,:,:,JSV) = 0. ! Assume no snow enter throug + ! boundaries + END WHERE + END IF + ! + END DO + END IF +! +END SELECT +! +END IF +!------------------------------------------------------------------------------- +! +!* 6. LBC FILLING IN THE Y DIRECTION (BOTTOM SOUTH SIDE): +! ------------------------------ +IF (LSOUTH_ll( )) THEN +! +SELECT CASE ( HLBCY(1) ) +! +!* 6.1 WALL CASE: +! ========= +! + CASE ('WALL') +! + DO JEXT=1,JPHEXT + IF(SIZE(PUT) /= 0) PUT (:,IJB-JEXT,:) = PUT (:,IJB-1+JEXT,:) + IF(SIZE(PVT) /= 0) PVT (:,IJB-JEXT,:) = PVT (:,IJB ,:) ! never used during run + IF(SIZE(PWT) /= 0) PWT (:,IJB-JEXT,:) = PWT (:,IJB-1+JEXT,:) + IF(SIZE(PTHT) /= 0) PTHT (:,IJB-JEXT,:) = PTHT (:,IJB-1+JEXT,:) + IF(SIZE(PTKET) /= 0) PTKET(:,IJB-JEXT,:) = PTKET(:,IJB-1+JEXT,:) + IF(SIZE(PRT) /= 0) PRT (:,IJB-JEXT,:,:) = PRT (:,IJB-1+JEXT,:,:) + IF(SIZE(PSVT) /= 0) PSVT (:,IJB-JEXT,:,:)= PSVT (:,IJB-1+JEXT,:,:) + IF(SIZE(PSRCT) /= 0) PSRCT(:,IJB-JEXT,:) = PSRCT(:,IJB-1+JEXT,:) + IF(LBLOWSNOW) XSNWCANO(:,IJB-JEXT,:) = XSNWCANO(:,IJB-1+JEXT,:) +! + END DO +! + IF(SIZE(PVT) /= 0) PVT(:,IJB ,:) = 0. ! set the normal velocity +! +!* 6.2 OPEN CASE: +! ========= +! + CASE ('OPEN') +! + IF(SIZE(PVT) /= 0) THEN + DO JJ=JPHEXT,1,-1 + PVT(:,JJ,:)=0. + WHERE ( PVT(:,IJB,:) <= 0. ) ! OUTFLOW condition + PUT (:,JJ,:) = 2.*PUT (:,JJ+1,:) -PUT (:,JJ+2,:) + PWT (:,JJ,:) = 2.*PWT (:,JJ+1,:) -PWT (:,JJ+2,:) + PTHT (:,JJ,:) = 2.*PTHT (:,JJ+1,:) -PTHT (:,JJ+2,:) + ELSEWHERE ! INFLOW condition + PUT (:,JJ,:) = ZPOND*ZLBYUT (:,JJ,:) + (1.-ZPOND)* PUT(:,JJ+1,:) + PWT (:,JJ,:) = ZPOND*ZLBYWT (:,JJ,:) + (1.-ZPOND)* PWT(:,JJ+1,:) + PTHT (:,JJ,:) = ZPOND*ZLBYTHT (:,JJ,:) + (1.-ZPOND)* PTHT(:,JJ+1,:) + ENDWHERE + END DO + ENDIF +! + IF(SIZE(PTKET) /= 0) THEN + DO JJ=JPHEXT,1,-1 + WHERE ( PVT(:,IJB,:) <= 0. ) ! OUTFLOW condition + PTKET(:,JJ,:) = MAX(XTKEMIN, 2.*PTKET(:,JJ+1,:)-PTKET(:,JJ+2,:)) + ELSEWHERE ! INFLOW condition + PTKET(:,JJ,:) = MAX(XTKEMIN,ZPOND*ZLBYTKET(:,JJ,:) + & + (1.-ZPOND)*PTKET(:,JJ+1,:)) + ENDWHERE + END DO + END IF + ! +! +! Case with KRR moist variables +! +! + DO JRR =1 ,KRR + IF(SIZE(PVT) /= 0) THEN + DO JJ=JPHEXT,1,-1 + WHERE ( PVT(:,IJB,:) <= 0. ) ! OUTFLOW condition + PRT(:,JJ,:,JRR) = MAX(0.,2.*PRT(:,JJ+1,:,JRR) -PRT(:,JJ+2,:,JRR)) + ELSEWHERE ! INFLOW condition + PRT(:,JJ,:,JRR) = MAX(0.,ZLBYRT(:,JJ,:,JRR)) + END WHERE + END DO + END IF + ! + END DO +! + IF(SIZE(PSRCT) /= 0) THEN + DO JJ=JPHEXT,1,-1 + PSRCT(:,JJ,:) = PSRCT(:,JJ+1,:) + END DO + END IF +! +! Case with KSV scalar variables +! + DO JSV=1 ,KSV + IF(SIZE(PVT) /= 0) THEN + DO JJ=JPHEXT,1,-1 + WHERE ( PVT(:,IJB,:) <= 0. ) ! OUTFLOW condition + PSVT(:,JJ,:,JSV) = MAX(XSVMIN(JSV),2.*PSVT(:,JJ+1,:,JSV) - & + PSVT(:,JJ+2,:,JSV)) + ELSEWHERE ! INFLOW condition + PSVT(:,JJ,:,JSV) = MAX(XSVMIN(JSV),ZLBYSVT(:,JJ,:,JSV)) + END WHERE + END DO + END IF + ! + END DO +! + IF(LBLOWSNOW) THEN + DO JSV=1 ,3 + WHERE ( PVT(:,IJB,IKB) <= 0. ) ! OUTFLOW condition + XSNWCANO(:,IJB-1,JSV) = MAX(0.,2.*XSNWCANO(:,IJB,JSV) - & + XSNWCANO(:,IJB+1,JSV)) + ELSEWHERE ! INFLOW condition + XSNWCANO(:,IJB-1,JSV) = 0. ! Assume no snow enter throug + ! boundaries + END WHERE + END DO + DO JSV=NSV_SNWBEG ,NSV_SNWEND + IF(SIZE(PVT) /= 0) THEN + WHERE ( PVT(:,IJB,:) <= 0. ) ! OUTFLOW condition + PSVT(:,IJB-1,:,JSV) = MAX(0.,2.*PSVT(:,IJB,:,JSV) - & + PSVT(:,IJB+1,:,JSV)) + ELSEWHERE ! INFLOW condition + PSVT(:,IJB-1,:,JSV) = 0. ! Assume no snow enter throug + ! boundaries + END WHERE + END IF + ! + END DO + END IF +! +! +END SELECT +! +END IF +!------------------------------------------------------------------------------- +! +!* 7. LBC FILLING IN THE Y DIRECTION (TOP NORTH SIDE): +! =============== +! +IF (LNORTH_ll( )) THEN +! +SELECT CASE ( HLBCY(2) ) +! +!* 4.3.1 WALL CASE: +! ========= +! + CASE ('WALL') +! + DO JEXT=1,JPHEXT + IF(SIZE(PUT) /= 0) PUT (:,IJE+JEXT,:) = PUT (:,IJE+1-JEXT,:) + IF(SIZE(PVT) /= 0) PVT (:,IJE+JEXT,:) = PVT (:,IJE ,:) ! never used during run + IF(SIZE(PWT) /= 0) PWT (:,IJE+JEXT,:) = PWT (:,IJE+1-JEXT,:) + IF(SIZE(PTHT) /= 0) PTHT (:,IJE+JEXT,:) = PTHT (:,IJE+1-JEXT,:) + IF(SIZE(PTKET) /= 0) PTKET(:,IJE+JEXT,:) = PTKET(:,IJE+1-JEXT,:) + IF(SIZE(PRT) /= 0) PRT (:,IJE+JEXT,:,:) = PRT (:,IJE+1-JEXT,:,:) + IF(SIZE(PSVT) /= 0) PSVT (:,IJE+JEXT,:,:)= PSVT (:,IJE+1-JEXT,:,:) + IF(SIZE(PSRCT) /= 0) PSRCT(:,IJE+JEXT,:) = PSRCT(:,IJE+1-JEXT,:) + IF(LBLOWSNOW) XSNWCANO(:,IJE+JEXT,:) = XSNWCANO(:,IJE+1-JEXT,:) +! + END DO +! + IF(SIZE(PVT) /= 0) PVT(:,IJE+1 ,:) = 0. ! set the normal velocity +! +!* 4.3.2 OPEN CASE: +! ========= +! + CASE ('OPEN') +! +! + ILBY=SIZE(PLBYUM,2) + IF(SIZE(PVT) /= 0) THEN + DO JJ=1,JPHEXT + WHERE ( PVT(:,IJE+1,:) >= 0. ) ! OUTFLOW condition + PUT (:,IJE+JJ,:) = 2.*PUT (:,IJE+JJ-1,:) -PUT (:,IJE+JJ-2,:) + PWT (:,IJE+JJ,:) = 2.*PWT (:,IJE+JJ-1,:) -PWT (:,IJE+JJ-2,:) + PTHT (:,IJE+JJ,:) = 2.*PTHT (:,IJE+JJ-1,:) -PTHT (:,IJE+JJ-2,:) + ELSEWHERE ! INFLOW condition + PUT (:,IJE+JJ,:) = ZPOND*ZLBYUT (:,ILBY-JPHEXT+JJ,:) + (1.-ZPOND)* PUT(:,IJE+JJ-1,:) + PWT (:,IJE+JJ,:) = ZPOND*ZLBYWT (:,ILBY-JPHEXT+JJ,:) + (1.-ZPOND)* PWT(:,IJE+JJ-1,:) + PTHT (:,IJE+JJ,:) = ZPOND*ZLBYTHT (:,ILBY-JPHEXT+JJ,:) + (1.-ZPOND)* PTHT(:,IJE+JJ-1,:) + ENDWHERE + END DO + ENDIF +! + IF(SIZE(PTKET) /= 0) THEN + ILBY=SIZE(PLBYTKEM,2) + DO JJ=1,JPHEXT + WHERE ( PVT(:,IJE+1,:) >= 0. ) ! OUTFLOW condition + PTKET(:,IJE+JJ,:) = MAX(XTKEMIN, 2.*PTKET(:,IJE+JJ-1,:)-PTKET(:,IJE+JJ-2,:)) + ELSEWHERE ! INFLOW condition + PTKET(:,IJE+JJ,:) = MAX(XTKEMIN,ZPOND*ZLBYTKET(:,ILBY-JPHEXT+JJ,:) + & + (1.-ZPOND)*PTKET(:,IJE+JJ-1,:)) + ENDWHERE + END DO + ENDIF + ! +! Case with KRR moist variables +! +! + DO JRR =1 ,KRR + ILBY=SIZE(PLBYRM,2) + ! + IF(SIZE(PVT) /= 0) THEN + DO JJ=1,JPHEXT + WHERE ( PVT(:,IJE+1,:) >= 0. ) ! OUTFLOW condition + PRT(:,IJE+JJ,:,JRR) = MAX(0.,2.*PRT(:,IJE+JJ-1,:,JRR) -PRT(:,IJE+JJ-2,:,JRR)) + ELSEWHERE ! INFLOW condition + PRT(:,IJE+JJ,:,JRR) = MAX(0.,ZLBYRT(:,ILBY-JPHEXT+JJ,:,JRR)) + END WHERE + END DO + END IF + ! + END DO +! + IF(SIZE(PSRCT) /= 0) THEN + DO JJ=1,JPHEXT + PSRCT(:,IJE+JJ,:) = PSRCT(:,IJE+JJ-1,:) + END DO + END IF +! +! Case with KSV scalar variables + DO JSV=1 ,KSV + ILBY=SIZE(PLBYSVM,2) + ! + IF(SIZE(PVT) /= 0) THEN + DO JJ=1,JPHEXT + WHERE ( PVT(:,IJE+1,:) >= 0. ) ! OUTFLOW condition + PSVT(:,IJE+JJ,:,JSV) = MAX(XSVMIN(JSV),2.*PSVT(:,IJE+JJ-1,:,JSV) - & + PSVT(:,IJE+JJ-2,:,JSV)) + ELSEWHERE ! INFLOW condition + PSVT(:,IJE+JJ,:,JSV) = MAX(XSVMIN(JSV),ZLBYSVT(:,ILBY-JPHEXT+JJ,:,JSV)) + END WHERE + END DO + END IF + ! + END DO +! + IF(LBLOWSNOW) THEN + DO JSV=1 ,3 + WHERE ( PVT(:,IJE+1,IKB) >= 0. ) ! OUTFLOW condition + XSNWCANO(:,IJE+1,JSV) = MAX(0.,2.*XSNWCANO(:,IJE,JSV) - & + XSNWCANO(:,IJE-1,JSV)) + ELSEWHERE ! INFLOW condition + XSNWCANO(:,IJE+1,JSV) = 0. ! Assume no snow enter throug + ! boundaries + END WHERE + END DO + DO JSV=NSV_SNWBEG ,NSV_SNWEND + ! + IF(SIZE(PVT) /= 0) THEN + WHERE ( PVT(:,IJE+1,:) >= 0. ) ! OUTFLOW condition + PSVT(:,IJE+1,:,JSV) = MAX(0.,2.*PSVT(:,IJE,:,JSV) - & + PSVT(:,IJE-1,:,JSV)) + ELSEWHERE ! INFLOW condition + PSVT(:,IJE+1,:,JSV) = 0. ! Assume no snow enter throug + ! boundaries + END WHERE + END IF + ! + END DO + ENDIF +! +END SELECT +END IF +! +! +IF (CCLOUD == 'LIMA' .AND. IMI == 1 .AND. CPROGRAM=='MESONH') THEN + + ZSVT=PSVT + ZRT=PRT + + IF (GFIRSTCALLLIMA) THEN + ALLOCATE(GLIMABOUNDARY(NSV_LIMA)) + GFIRSTCALLLIMA = .FALSE. + DO JSV=NSV_LIMA_BEG,NSV_LIMA_END + GCHTMP = .FALSE. + IF (LWEST_ll().AND.HLBCX(1)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBXSVM(JPHEXT,:,:,JSV)==0) + IF (LEAST_ll().AND.HLBCX(2)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBXSVM(ILBX-JPHEXT+1,:,:,JSV)==0) + IF (LSOUTH_ll().AND.HLBCY(1)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBYSVM(:,JPHEXT,:,JSV)==0) + IF (LNORTH_ll().AND.HLBCY(2)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBYSVM(:,ILBY-JPHEXT+1,:,JSV)==0) + GLIMABOUNDARY(JSV-NSV_LIMA_BEG+1) = GCHTMP + ENDDO + ENDIF + CALL INIT_AEROSOL_CONCENTRATION(PRHODREF,ZSVT,XZZ) + DO JSV=NSV_LIMA_CCN_FREE,NSV_LIMA_CCN_FREE+NMOD_CCN-1 ! LBC for CCN + IF (GLIMABOUNDARY(JSV-NSV_LIMA_BEG+1)) THEN + PSVT(IIB-1,:,:,JSV)=ZSVT(IIB-1,:,:,JSV) + PSVT(IIE+1,:,:,JSV)=ZSVT(IIE+1,:,:,JSV) + PSVT(:,IJB-1,:,JSV)=ZSVT(:,IJB-1,:,JSV) + PSVT(:,IJE+1,:,JSV)=ZSVT(:,IJE+1,:,JSV) + ENDIF + END DO + DO JSV=NSV_LIMA_IFN_FREE,NSV_LIMA_IFN_FREE+NMOD_IFN-1 ! LBC for IFN + IF (GLIMABOUNDARY(JSV-NSV_LIMA_BEG+1)) THEN + PSVT(IIB-1,:,:,JSV)=ZSVT(IIB-1,:,:,JSV) + PSVT(IIE+1,:,:,JSV)=ZSVT(IIE+1,:,:,JSV) + PSVT(:,IJB-1,:,JSV)=ZSVT(:,IJB-1,:,JSV) + PSVT(:,IJE+1,:,JSV)=ZSVT(:,IJE+1,:,JSV) + ENDIF + END DO + + CALL SET_CONC_LIMA( IMI, 'NONE', PRHODREF, ZRT(:, :, :, :), ZSVT(:, :, :, NSV_LIMA_BEG:NSV_LIMA_END) ) + IF (NSV_LIMA_NC.GE.1) THEN + IF (GLIMABOUNDARY(NSV_LIMA_NC-NSV_LIMA_BEG+1)) THEN + PSVT(IIB-1,:,:,NSV_LIMA_NC)=ZSVT(IIB-1,:,:,NSV_LIMA_NC) ! cloud + PSVT(IIE+1,:,:,NSV_LIMA_NC)=ZSVT(IIE+1,:,:,NSV_LIMA_NC) + PSVT(:,IJB-1,:,NSV_LIMA_NC)=ZSVT(:,IJB-1,:,NSV_LIMA_NC) + PSVT(:,IJE+1,:,NSV_LIMA_NC)=ZSVT(:,IJE+1,:,NSV_LIMA_NC) + ENDIF + ENDIF + IF (NSV_LIMA_NR.GE.1) THEN + IF (GLIMABOUNDARY(NSV_LIMA_NR-NSV_LIMA_BEG+1)) THEN + PSVT(IIB-1,:,:,NSV_LIMA_NR)=ZSVT(IIB-1,:,:,NSV_LIMA_NR) ! rain + PSVT(IIE+1,:,:,NSV_LIMA_NR)=ZSVT(IIE+1,:,:,NSV_LIMA_NR) + PSVT(:,IJB-1,:,NSV_LIMA_NR)=ZSVT(:,IJB-1,:,NSV_LIMA_NR) + PSVT(:,IJE+1,:,NSV_LIMA_NR)=ZSVT(:,IJE+1,:,NSV_LIMA_NR) + ENDIF + ENDIF + IF (NSV_LIMA_NI.GE.1) THEN + IF (GLIMABOUNDARY(NSV_LIMA_NI-NSV_LIMA_BEG+1)) THEN + PSVT(IIB-1,:,:,NSV_LIMA_NI)=ZSVT(IIB-1,:,:,NSV_LIMA_NI) ! ice + PSVT(IIE+1,:,:,NSV_LIMA_NI)=ZSVT(IIE+1,:,:,NSV_LIMA_NI) + PSVT(:,IJB-1,:,NSV_LIMA_NI)=ZSVT(:,IJB-1,:,NSV_LIMA_NI) + PSVT(:,IJE+1,:,NSV_LIMA_NI)=ZSVT(:,IJE+1,:,NSV_LIMA_NI) + ENDIF + END IF +END IF +! +! +IF (LUSECHEM .AND. IMI == 1) THEN + IF (GFIRSTCALL1) THEN + ALLOCATE(GCHBOUNDARY(NSV_CHEM)) + GFIRSTCALL1 = .FALSE. + DO JSV=NSV_CHEMBEG,NSV_CHEMEND + GCHTMP = .FALSE. + IF (LWEST_ll().AND.HLBCX(1)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBXSVM(JPHEXT,:,:,JSV)==0) + IF (LEAST_ll().AND.HLBCX(2)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBXSVM(ILBX-JPHEXT+1,:,:,JSV)==0) + IF (LSOUTH_ll().AND.HLBCY(1)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBYSVM(:,JPHEXT,:,JSV)==0) + IF (LNORTH_ll().AND.HLBCY(2)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBYSVM(:,ILBY-JPHEXT+1,:,JSV)==0) + GCHBOUNDARY(JSV-NSV_CHEMBEG+1) = GCHTMP + ENDDO + ENDIF + + DO JSV=NSV_CHEMBEG,NSV_CHEMEND + IF (GCHBOUNDARY(JSV-NSV_CHEMBEG+1)) THEN + IF (SIZE(PSVT)>0) THEN + CALL CH_BOUNDARIES (HLBCX,HLBCY,PUT,PVT,PSVT(:,:,:,JSV),XSVMIN(JSV)) + ENDIF + ENDIF + ENDDO +ENDIF +! +IF (LUSECHIC .AND. IMI == 1) THEN + IF (GFIRSTCALLIC) THEN + ALLOCATE(GICBOUNDARY(NSV_CHIC)) + GFIRSTCALLIC = .FALSE. + DO JSV=NSV_CHICBEG,NSV_CHICEND + GCHTMP = .FALSE. + IF (LWEST_ll().AND.HLBCX(1)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBXSVM(JPHEXT,:,:,JSV)==0) + IF (LEAST_ll().AND.HLBCX(2)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBXSVM(ILBX-JPHEXT+1,:,:,JSV)==0) + IF (LSOUTH_ll().AND.HLBCY(1)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBYSVM(:,JPHEXT,:,JSV)==0) + IF (LNORTH_ll().AND.HLBCY(2)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBYSVM(:,ILBY-JPHEXT+1,:,JSV)==0) + GICBOUNDARY(JSV-NSV_CHICBEG+1) = GCHTMP + ENDDO + ENDIF + + DO JSV=NSV_CHICBEG,NSV_CHICEND + IF (GICBOUNDARY(JSV-NSV_CHICBEG+1)) THEN + IF (SIZE(PSVT)>0) THEN + CALL CH_BOUNDARIES (HLBCX,HLBCY,PUT,PVT,PSVT(:,:,:,JSV),XSVMIN(JSV)) + ENDIF + ENDIF + ENDDO +ENDIF +IF (LORILAM .AND. IMI == 1) THEN + IF (GFIRSTCALL2) THEN + ALLOCATE(GAERBOUNDARY(NSV_AER)) + GFIRSTCALL2 = .FALSE. + DO JSV=NSV_AERBEG,NSV_AEREND + GCHTMP = .FALSE. + IF (LWEST_ll().AND.HLBCX(1)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBXSVM(JPHEXT,:,:,JSV)==0) + IF (LEAST_ll().AND.HLBCX(2)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBXSVM(ILBX-JPHEXT+1,:,:,JSV)==0) + IF (LSOUTH_ll().AND.HLBCY(1)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBYSVM(:,JPHEXT,:,JSV)==0) + IF (LNORTH_ll().AND.HLBCY(2)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBYSVM(:,ILBY-JPHEXT+1,:,JSV)==0) + GAERBOUNDARY(JSV-NSV_AERBEG+1) = GCHTMP + ENDDO + ENDIF + + DO JSV=NSV_AERBEG,NSV_AEREND + IF (GAERBOUNDARY(JSV-NSV_AERBEG+1)) THEN + IF (SIZE(PSVT)>0) THEN + CALL CH_BOUNDARIES (HLBCX,HLBCY,PUT,PVT,PSVT(:,:,:,JSV),XSVMIN(JSV)) + ENDIF + ENDIF + ENDDO +ENDIF +! +IF (LDUST .AND. IMI == 1) THEN + IF (GFIRSTCALL3) THEN + ALLOCATE(GDSTBOUNDARY(NSV_DST)) + GFIRSTCALL3 = .FALSE. + DO JSV=NSV_DSTBEG,NSV_DSTEND + GCHTMP = .FALSE. + IF (LWEST_ll().AND.HLBCX(1)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBXSVM(JPHEXT,:,:,JSV)==0) + IF (LEAST_ll().AND.HLBCX(2)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBXSVM(ILBX-JPHEXT+1,:,:,JSV)==0) + IF (LSOUTH_ll().AND.HLBCY(1)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBYSVM(:,JPHEXT,:,JSV)==0) + IF (LNORTH_ll().AND.HLBCY(2)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBYSVM(:,ILBY-JPHEXT+1,:,JSV)==0) + GDSTBOUNDARY(JSV-NSV_DSTBEG+1) = GCHTMP + ENDDO + ENDIF + + DO JSV=NSV_DSTBEG,NSV_DSTEND + IF (GDSTBOUNDARY(JSV-NSV_DSTBEG+1)) THEN + IF (SIZE(PSVT)>0) THEN + CALL CH_BOUNDARIES (HLBCX,HLBCY,PUT,PVT,PSVT(:,:,:,JSV),XSVMIN(JSV)) + ENDIF + ENDIF + ENDDO +ENDIF +! +IF (LSALT .AND. IMI == 1) THEN + IF (GFIRSTCALL5) THEN + ALLOCATE(GSLTBOUNDARY(NSV_SLT)) + GFIRSTCALL5 = .FALSE. + DO JSV=NSV_SLTBEG,NSV_SLTEND + GCHTMP = .FALSE. + IF (LWEST_ll().AND.HLBCX(1)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBXSVM(JPHEXT,:,:,JSV)==0) + IF (LEAST_ll().AND.HLBCX(2)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBXSVM(ILBX-JPHEXT+1,:,:,JSV)==0) + IF (LSOUTH_ll().AND.HLBCY(1)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBYSVM(:,JPHEXT,:,JSV)==0) + IF (LNORTH_ll().AND.HLBCY(2)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBYSVM(:,ILBY-JPHEXT+1,:,JSV)==0) + GSLTBOUNDARY(JSV-NSV_SLTBEG+1) = GCHTMP + ENDDO + ENDIF + + DO JSV=NSV_SLTBEG,NSV_SLTEND + IF (GSLTBOUNDARY(JSV-NSV_SLTBEG+1)) THEN + IF (SIZE(PSVT)>0) THEN + CALL CH_BOUNDARIES (HLBCX,HLBCY,PUT,PVT,PSVT(:,:,:,JSV),XSVMIN(JSV)) + ENDIF + ENDIF + ENDDO +ENDIF +! +IF ( LPASPOL .AND. IMI == 1) THEN + IF (GFIRSTCALLPP) THEN + ALLOCATE(GPPBOUNDARY(NSV_PP)) + GFIRSTCALLPP = .FALSE. + DO JSV=NSV_PPBEG,NSV_PPEND + GPPTMP = .FALSE. + IF (LWEST_ll().AND.HLBCX(1)=='OPEN') GPPTMP = GPPTMP .OR. ALL(PLBXSVM(JPHEXT,:,:,JSV)==0) + IF (LEAST_ll().AND.HLBCX(2)=='OPEN') GPPTMP = GPPTMP .OR. ALL(PLBXSVM(ILBX-JPHEXT+1,:,:,JSV)==0) + IF (LSOUTH_ll().AND.HLBCY(1)=='OPEN') GPPTMP = GPPTMP .OR. ALL(PLBYSVM(:,JPHEXT,:,JSV)==0) + IF (LNORTH_ll().AND.HLBCY(2)=='OPEN') GPPTMP = GPPTMP .OR. ALL(PLBYSVM(:,ILBY-JPHEXT+1,:,JSV)==0) + GPPBOUNDARY(JSV-NSV_PPBEG+1) = GPPTMP + ENDDO + ENDIF + + DO JSV=NSV_PPBEG,NSV_PPEND + IF (GPPBOUNDARY(JSV-NSV_PPBEG+1)) THEN + IF (SIZE(PSVT)>0) THEN + CALL CH_BOUNDARIES (HLBCX,HLBCY,PUT,PVT,PSVT(:,:,:,JSV),XSVMIN(JSV)) + ENDIF + ENDIF + ENDDO +ENDIF +! +IF ( LCONDSAMP .AND. IMI == 1) THEN + IF (GFIRSTCALLCS) THEN + ALLOCATE(GCSBOUNDARY(NSV_CS)) + GFIRSTCALLCS = .FALSE. + DO JSV=NSV_CSBEG,NSV_CSEND + GCSTMP = .FALSE. + IF (LWEST_ll().AND.HLBCX(1)=='OPEN') GCSTMP = GCSTMP .OR. ALL(PLBXSVM(JPHEXT,:,:,JSV)==0) + IF (LEAST_ll().AND.HLBCX(2)=='OPEN') GCSTMP = GCSTMP .OR. ALL(PLBXSVM(ILBX-JPHEXT+1,:,:,JSV)==0) + IF (LSOUTH_ll().AND.HLBCY(1)=='OPEN') GCSTMP = GCSTMP .OR. ALL(PLBYSVM(:,JPHEXT,:,JSV)==0) + IF (LNORTH_ll().AND.HLBCY(2)=='OPEN') GCSTMP = GCSTMP .OR. ALL(PLBYSVM(:,ILBY-JPHEXT+1,:,JSV)==0) + GCSBOUNDARY(JSV-NSV_CSBEG+1) = GCSTMP + ENDDO + ENDIF + + DO JSV=NSV_CSBEG,NSV_CSEND + IF (GCSBOUNDARY(JSV-NSV_CSBEG+1)) THEN + IF (SIZE(PSVT)>0) THEN + CALL CH_BOUNDARIES (HLBCX,HLBCY,PUT,PVT,PSVT(:,:,:,JSV),XSVMIN(JSV)) + ENDIF + ENDIF + ENDDO +ENDIF + +IF (LBLOWSNOW .AND. IMI == 1) THEN + IF (GFIRSTCALL3) THEN + ALLOCATE(GSNWBOUNDARY(NSV_SNW)) + GFIRSTCALL3 = .FALSE. + DO JSV=NSV_SNWBEG,NSV_SNWEND + GCHTMP = .FALSE. + IF (LWEST_ll().AND.HLBCX(1)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBXSVM(1,:,:,JSV)==0) + IF (LEAST_ll().AND.HLBCX(2)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBXSVM(ILBX,:,:,JSV)==0) + IF (LSOUTH_ll().AND.HLBCY(1)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBYSVM(:,1,:,JSV)==0) + IF (LNORTH_ll().AND.HLBCY(2)=='OPEN') GCHTMP = GCHTMP .OR. ALL(PLBYSVM(:,ILBY,:,JSV)==0) + GSNWBOUNDARY(JSV-NSV_SNWBEG+1) = GCHTMP + ENDDO + ENDIF +ENDIF + +#ifdef MNH_FOREFIRE +!ForeFire +IF ( LFOREFIRE .AND. IMI == 1) THEN + IF (GFIRSTCALLFF) THEN + ALLOCATE(GFFBOUNDARY(NSV_FF)) + GFIRSTCALLFF = .FALSE. + DO JSV=NSV_FFBEG,NSV_FFEND + GFFTMP = .FALSE. + IF (LWEST_ll().AND.HLBCX(1)=='OPEN') GFFTMP = GFFTMP .OR. ALL(PLBXSVM(JPHEXT,:,:,JSV)==0) + IF (LEAST_ll().AND.HLBCX(2)=='OPEN') GFFTMP = GFFTMP .OR. ALL(PLBXSVM(ILBX-JPHEXT+1,:,:,JSV)==0) + IF (LSOUTH_ll().AND.HLBCY(1)=='OPEN') GFFTMP = GFFTMP .OR. ALL(PLBYSVM(:,JPHEXT,:,JSV)==0) + IF (LNORTH_ll().AND.HLBCY(2)=='OPEN') GFFTMP = GFFTMP .OR. ALL(PLBYSVM(:,ILBY-JPHEXT+1,:,JSV)==0) + GFFBOUNDARY(JSV-NSV_FFBEG+1) = GFFTMP + ENDDO + ENDIF + + DO JSV=NSV_FFBEG,NSV_FFEND + IF (GFFBOUNDARY(JSV-NSV_FFBEG+1)) THEN + IF (SIZE(PSVT)>0) THEN + CALL CH_BOUNDARIES (HLBCX,HLBCY,PUT,PVT,PSVT(:,:,:,JSV),XSVMIN(JSV)) + ENDIF + ENDIF + ENDDO +ENDIF +#endif +! +IF ( CELEC /= 'NONE' .AND. (NSV_ELEC_A(NDAD(IMI)) == 0 .OR. IMI == 1)) THEN + CALL ION_BOUNDARIES (HLBCX,HLBCY,PUT,PVT,PSVT) +ENDIF +! +!------------------------------------------------------------------------------- +! +END SUBROUTINE BOUNDARIES diff --git a/src/mesonh/ext/ch_aqueous_sedim1mom.f90 b/src/mesonh/ext/ch_aqueous_sedim1mom.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ba0b6ffd5418befa08bfb5c44cdb761c3856a448 --- /dev/null +++ b/src/mesonh/ext/ch_aqueous_sedim1mom.f90 @@ -0,0 +1,382 @@ +!MNH_LIC Copyright 2007-2019 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_CH_AQUEOUS_SEDIM1MOM +! ################################ +! +INTERFACE + SUBROUTINE CH_AQUEOUS_SEDIM1MOM (KSPLITR, HCLOUD, OUSECHIC, PTSTEP, & + PZZ, PRHODREF, PRHODJ, PRRS, & + PRSS, PRGS, PRRSVS, PSGRSVS, PINPRR ) +! +CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! Cloud parameterization +INTEGER, INTENT(IN) :: KSPLITR ! Current time +REAL, INTENT(IN) :: PTSTEP ! Time step +LOGICAL, INTENT(IN) :: OUSECHIC ! flag for ice chem. +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! Height (z) +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF! Reference density +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Dry density * Jacobian +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRRS ! Rainwater m.r. source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRSS ! Snow m.r. source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRGS ! Graupel m.r. source +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRSVS ! Rainwater aq. species source +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PSGRSVS ! Precip. ice species source +REAL, DIMENSION(:,:), INTENT(OUT) :: PINPRR ! instantaneaous precip. +! +END SUBROUTINE CH_AQUEOUS_SEDIM1MOM +END INTERFACE +END MODULE MODI_CH_AQUEOUS_SEDIM1MOM +! +! ###################################################################### + SUBROUTINE CH_AQUEOUS_SEDIM1MOM (KSPLITR, HCLOUD, OUSECHIC, PTSTEP, & + PZZ, PRHODREF, PRHODJ, PRRS, & + PRSS, PRGS, PRRSVS, PSGRSVS, PINPRR ) +! ###################################################################### +! +!!**** * - compute the explicit microphysical sources +!! +!! PURPOSE +!! ------- +!! The purpose of this routine is to compute the sedimentation +!! of chemical species in the raindrops for the Kessler, ICE2, ICE3 and +!! ICE4 cloud microphysical scheme +!! The sedimentation rates are computed with a time spliting technique: +!! an upstream scheme, written as a difference of non-advective fluxes. +!! This source term is added to the next coming time step (split-implicit +!! process). see rain_ice.f90 +!! +!! +!!** METHOD +!! ------ +!! +!! EXTERNAL +!! -------- +!! None +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODD_PARAMETERS +!! JPHEXT : Horizontal external points number +!! JPVEXT : Vertical external points number +!! Module MODD_CONF : +!! CCONF configuration of the model for the first time step +!! +!! REFERENCE +!! --------- +!! Book1 of the documentation ( routine CH_AQUEOUS_SEDIM1MOM ) +!! +!! AUTHOR +!! ------ +!! J.-P. Pinty * Laboratoire d'Aerologie* +!! +!! MODIFICATIONS +!! ------------- +!! Original 22/07/07 +!! 04/11/08 (M Leriche) add ICE3 +!! 17/09/10 (M Leriche) add LUSECHIC flag +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! 16/12/15 (M Leriche) compute instantaneous rain at the surface +! P. Wautelet 12/02/2019: bugfix: ZRR_SEDIM was not initialized everywhere +! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function +! P. Wautelet 28/05/2019: move COUNTJV function to tools.f90 +! +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_PARAMETERS, ONLY : JPHEXT, JPVEXT +USE MODD_CONF +USE MODD_CST, ONLY : XRHOLW +USE MODD_CLOUDPAR, ONLY : VCEXVT=>XCEXVT, XCRS, XCEXRS +USE MODD_RAIN_ICE_DESCR_n, ONLY : WCEXVT=>XCEXVT, WRTMIN=>XRTMIN +USE MODD_RAIN_ICE_PARAM_n, ONLY : XFSEDR, XEXSEDR, & + XFSEDS, XEXSEDS, & + XFSEDG, XEXSEDG + +use mode_tools, only: Countjv +use mode_tools_ll, only: GET_INDICE_ll + +IMPLICIT NONE +! +!* 0.1 Declarations of dummy arguments : +! +! +CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! Cloud parameterization +INTEGER, INTENT(IN) :: KSPLITR ! Current time +REAL, INTENT(IN) :: PTSTEP ! Time step +LOGICAL, INTENT(IN) :: OUSECHIC ! flag for ice chem. +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! Height (z) +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF! Reference density +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Dry density * Jacobian +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRRS ! Rainwater m.r. source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRSS ! Snow m.r. source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRGS ! Graupel m.r. source +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRSVS ! Rainwater aq. species source +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PSGRSVS ! Precip. ice species source +REAL, DIMENSION(:,:), INTENT(OUT) :: PINPRR ! instantaneaous precip. +! +!* 0.2 Declarations of local variables : +! +INTEGER :: JK,JI,JJ ! Vertical loop index for the rain sedimentation +INTEGER :: JN ! Temporal loop index for the rain sedimentation +INTEGER :: IIB ! Define the domain where is +INTEGER :: IIE ! the microphysical sources have to be computed +INTEGER :: IJB ! +INTEGER :: IJE ! +INTEGER :: IKB ! +INTEGER :: IKE ! +! +REAL :: ZTSPLITR ! Small time step for rain sedimentation +! +INTEGER :: ISEDIMR, ISEDIMS, ISEDIMG ! Case number of sedimentation +LOGICAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)) & + :: GSEDIMR ! where to compute the SED processes +LOGICAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)) & + :: GSEDIMS ! where to compute the SED processes +LOGICAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)) & + :: GSEDIMG ! where to compute the SED processes +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)) & + :: ZRRS ! rainwater m.r.source phys.tendency +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)) & + :: ZRSS ! snow m.r.source phys.tendency +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)) & + :: ZRGS ! graupel m.r.source phys.tendency +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)) & + :: ZW ! work array +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)) & + :: ZWSED ! sedimentation fluxes +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)) & + :: ZZRRS ! Rainwater m.r. source phys.tendency *dt +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)) & + :: ZZRSS ! Snow m.r. source phys.tendency *dt +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)) & + :: ZZRGS ! Graupel m.r. source phys.tendency *dt +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)) & + :: ZRR_SEDIM ! Drain/Dt sur ZTSPLIT +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)) & + :: ZSV_SEDIM_FACTR ! Cumul des Dsv/DT +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)) & + :: ZSV_SEDIM_FACTS ! Cumul des Dsv/DT +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)) & + :: ZSV_SEDIM_FACTG ! Cumul des Dsv/DT +REAL, DIMENSION(:), ALLOCATABLE :: ZZZRRS ! Rainwater m.r. source +REAL, DIMENSION(:), ALLOCATABLE :: ZZZRSS ! Snow m.r. source +REAL, DIMENSION(:), ALLOCATABLE :: ZZZRGS ! Graupel m.r. source +! +REAL, DIMENSION(:), ALLOCATABLE :: ZRHODREF, & ! RHO Dry REFerence + ZZW ! Work array +REAL, DIMENSION(7), SAVE :: Z_XRTMIN +! +REAL :: ZVTRMAX, ZT +LOGICAL, SAVE :: GSFIRSTCALL = .TRUE. +REAL, SAVE :: ZFSEDR, ZEXSEDR, ZCEXVT +! +INTEGER , DIMENSION(SIZE(GSEDIMR)) :: IR1,IR2,IR3 ! Used to replace the COUNT +INTEGER , DIMENSION(SIZE(GSEDIMS)) :: IS1,IS2,IS3 ! Used to replace the COUNT +INTEGER , DIMENSION(SIZE(GSEDIMG)) :: IG1,IG2,IG3 ! Used to replace the COUNT +INTEGER :: JL ! and PACK intrinsics +! +!------------------------------------------------------------------------------- +! +!* 1. COMPUTE THE LOOP BOUNDS +! ----------------------- +! +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +IKB=1+JPVEXT +IKE=SIZE(PZZ,3) - JPVEXT +PINPRR(:,:) = 0. ! initialize instantaneous precip. +! +!------------------------------------------------------------------------------- +! +!!* 2. TRANSFORMATION INTO PHYSICAL TENDENCIES +! --------------------------------------- +! +ZRRS(:,:,:) = PRRS(:,:,:) / PRHODJ(:,:,:) +IF (HCLOUD(1:3) == 'ICE') THEN + ZRSS(:,:,:) = PRSS(:,:,:) / PRHODJ(:,:,:) + ZRGS(:,:,:) = PRGS(:,:,:) / PRHODJ(:,:,:) +ENDIF +! +!------------------------------------------------------------------------------- +! +!* 3. COMPUTE THE SEDIMENTATION (RS) SOURCE +! ------------------------------------- +! +!* 3.1 Initialize some constants +! +firstcall : IF (GSFIRSTCALL) THEN + GSFIRSTCALL = .FALSE. + SELECT CASE ( HCLOUD) + CASE('KESS') + ZVTRMAX = 20. + CASE('ICE3') + ZVTRMAX = 10. + CASE('ICE4') + ZVTRMAX = 40. + END SELECT +! + SELECT CASE ( HCLOUD ) ! constants for rain sedimentation + CASE('KESS') + Z_XRTMIN(2:3) = 1.0E-20 ! Default values + ZFSEDR = XCRS + ZEXSEDR = XCEXRS + ZCEXVT = VCEXVT + CASE('ICE3','ICE4') + Z_XRTMIN(1:SIZE(WRTMIN)) = WRTMIN ! Values given in ICEx schemes + ZFSEDR = XFSEDR + ZEXSEDR = XEXSEDR + ZCEXVT = WCEXVT + END SELECT +END IF firstcall +! +!* 3.2 time splitting loop initialization +! +ZTSPLITR = PTSTEP / REAL(KSPLITR) ! Small time step +! +!* 3.3 compute the fluxes +! +ZSV_SEDIM_FACTR(:,:,:) = 1.0 +ZZRRS(:,:,:) = ZRRS(:,:,:) * PTSTEP +IF (HCLOUD(1:3) == 'ICE') THEN + ZZRSS(:,:,:) = ZRSS(:,:,:) * PTSTEP + ZZRGS(:,:,:) = ZRGS(:,:,:) * PTSTEP + ZSV_SEDIM_FACTS(:,:,:) = 1.0 + ZSV_SEDIM_FACTG(:,:,:) = 1.0 +ENDIF +DO JN = 1 , KSPLITR + IF( JN==1 ) THEN + ZW(:,:,:) = 0.0 + DO JK = IKB , IKE-1 + ZW(:,:,JK) =ZTSPLITR*2./(PRHODREF(:,:,JK)*(PZZ(:,:,JK+2)-PZZ(:,:,JK))) + END DO + ZW(:,:,IKE) =ZTSPLITR/(PRHODREF(:,:,IKE)*(PZZ(:,:,IKE+1)-PZZ(:,:,IKE))) + END IF +! +!* 3.3.1 for rain +! + GSEDIMR(:,:,:) = .FALSE. + GSEDIMR(IIB:IIE,IJB:IJE,IKB:IKE) = ZZRRS(IIB:IIE,IJB:IJE,IKB:IKE) > Z_XRTMIN(3) + ISEDIMR = COUNTJV( GSEDIMR(:,:,:),IR1(:),IR2(:),IR3(:)) +! + IF ( ISEDIMR >= 1 ) THEN + ALLOCATE(ZZZRRS(ISEDIMR)) + ALLOCATE(ZRHODREF(ISEDIMR)) + DO JL=1,ISEDIMR + ZZZRRS(JL) = ZZRRS(IR1(JL),IR2(JL),IR3(JL)) + ZRHODREF(JL) = PRHODREF(IR1(JL),IR2(JL),IR3(JL)) + ENDDO + ALLOCATE(ZZW(ISEDIMR)) ; ZZW(:) = 0.0 +! + ZZW(:) = ZFSEDR * ZZZRRS(:)**(ZEXSEDR) * ZRHODREF(:)**(ZEXSEDR-ZCEXVT) + ZWSED(:,:,:) = UNPACK( ZZW(:),MASK=GSEDIMR(:,:,:),FIELD=0.0 ) + ZRR_SEDIM(:,:,:) = 0.0 + DO JK = IKB , IKE + ZRR_SEDIM(:,:,JK) = ZW(:,:,JK)*(ZWSED(:,:,JK+1)-ZWSED(:,:,JK)) + END DO + ZZRRS(:,:,:) = ZZRRS(:,:,:) + ZRR_SEDIM(:,:,:) + PINPRR(:,:) = PINPRR(:,:) + ZWSED(:,:,IKB)/XRHOLW/KSPLITR +! + ZZW(:) = ZFSEDR * ZZZRRS(:)**(ZEXSEDR-1.0) * ZRHODREF(:)**(ZEXSEDR-ZCEXVT) + ZWSED(:,:,:) = UNPACK( ZZW(:),MASK=GSEDIMR(:,:,:),FIELD=0.0 ) + ZRR_SEDIM(:,:,:) = 0.0 + DO JK = IKB , IKE + ZRR_SEDIM(:,:,JK) = ZW(:,:,JK)*(ZWSED(:,:,JK+1)-ZWSED(:,:,JK)) + END DO + DEALLOCATE(ZRHODREF) + DEALLOCATE(ZZZRRS) + DEALLOCATE(ZZW) + ZSV_SEDIM_FACTR(:,:,:) = ZSV_SEDIM_FACTR(:,:,:) * (1.0 + ZRR_SEDIM(:,:,:)) +!! (1.0 + ZRR_SEDIM(:,:,:)/MAX(ZZRRS(:,:,:),XRTMIN_AQ)) + END IF + IF (HCLOUD == 'KESS') EXIT +! +!* 3.3.1 for iced precip.hydrometeors +! + GSEDIMS(:,:,:) = .FALSE. + GSEDIMG(:,:,:) = .FALSE. + GSEDIMS(IIB:IIE,IJB:IJE,IKB:IKE) = ZZRSS(IIB:IIE,IJB:IJE,IKB:IKE) > Z_XRTMIN(5) + GSEDIMG(IIB:IIE,IJB:IJE,IKB:IKE) = ZZRGS(IIB:IIE,IJB:IJE,IKB:IKE) > Z_XRTMIN(6) + ISEDIMS = COUNTJV( GSEDIMS(:,:,:),IS1(:),IS2(:),IS3(:)) + ISEDIMG = COUNTJV( GSEDIMG(:,:,:),IG1(:),IG2(:),IG3(:)) +! for snow + IF ( ISEDIMS >= 1) THEN + ALLOCATE(ZZZRSS(ISEDIMS)) + ALLOCATE(ZRHODREF(ISEDIMS)) + DO JL=1,ISEDIMS + ZZZRSS(JL) = ZZRSS(IS1(JL),IS2(JL),IS3(JL)) + ZRHODREF(JL) = PRHODREF(IS1(JL),IS2(JL),IS3(JL)) + ENDDO + ALLOCATE(ZZW(ISEDIMS)) ; ZZW(:) = 0.0 +! + ZZW(:) = XFSEDS * ZZZRSS(:)**(XEXSEDS) * ZRHODREF(:)**(XEXSEDS-ZCEXVT) + ZWSED(:,:,:) = UNPACK( ZZW(:),MASK=GSEDIMS(:,:,:),FIELD=0.0 ) + ZRR_SEDIM(:,:,:) = 0.0 + DO JK = IKB , IKE + ZRR_SEDIM(:,:,JK) = ZW(:,:,JK)*(ZWSED(:,:,JK+1)-ZWSED(:,:,JK)) + END DO + ZZRSS(:,:,:) = ZZRSS(:,:,:) + ZRR_SEDIM(:,:,:) +! + ZZW(:) = XFSEDS * ZZZRSS(:)**(XEXSEDS-1.0) * ZRHODREF(:)**(XEXSEDS-ZCEXVT) + ZWSED(:,:,:) = UNPACK( ZZW(:),MASK=GSEDIMS(:,:,:),FIELD=0.0 ) + ZRR_SEDIM(:,:,:) = 0.0 + DO JK = IKB , IKE + ZRR_SEDIM(:,:,JK) = ZW(:,:,JK)*(ZWSED(:,:,JK+1)-ZWSED(:,:,JK)) + END DO + DEALLOCATE(ZRHODREF) + DEALLOCATE(ZZZRSS) + DEALLOCATE(ZZW) + ZSV_SEDIM_FACTS(:,:,:) = ZSV_SEDIM_FACTS(:,:,:) * (1.0 + ZRR_SEDIM(:,:,:)) + ENDIF +! for graupel + IF ( ISEDIMG >= 1) THEN + ALLOCATE(ZZZRGS(ISEDIMG)) + ALLOCATE(ZRHODREF(ISEDIMG)) + DO JL=1,ISEDIMG + ZZZRGS(JL) = ZZRGS(IG1(JL),IG2(JL),IG3(JL)) + ZRHODREF(JL) = PRHODREF(IG1(JL),IG2(JL),IG3(JL)) + ENDDO + ALLOCATE(ZZW(ISEDIMG)) ; ZZW(:) = 0.0 +! + ZZW(:) = XFSEDG * ZZZRGS(:)**(XEXSEDG) * ZRHODREF(:)**(XEXSEDG-ZCEXVT) + ZWSED(:,:,:) = UNPACK( ZZW(:),MASK=GSEDIMG(:,:,:),FIELD=0.0 ) + ZRR_SEDIM(:,:,:) = 0.0 + DO JK = IKB , IKE + ZRR_SEDIM(:,:,JK) = ZW(:,:,JK)*(ZWSED(:,:,JK+1)-ZWSED(:,:,JK)) + END DO + ZZRGS(:,:,:) = ZZRGS(:,:,:) + ZRR_SEDIM(:,:,:) +! + ZZW(:) = XFSEDG * ZZZRGS(:)**(XEXSEDG-1.0) * ZRHODREF(:)**(XEXSEDG-ZCEXVT) + ZWSED(:,:,:) = UNPACK( ZZW(:),MASK=GSEDIMG(:,:,:),FIELD=0.0 ) + ZRR_SEDIM(:,:,:) = 0.0 + DO JK = IKB , IKE + ZRR_SEDIM(:,:,JK) = ZW(:,:,JK)*(ZWSED(:,:,JK+1)-ZWSED(:,:,JK)) + END DO + DEALLOCATE(ZRHODREF) + DEALLOCATE(ZZZRGS) + DEALLOCATE(ZZW) + ZSV_SEDIM_FACTG(:,:,:) = ZSV_SEDIM_FACTG(:,:,:) * (1.0 + ZRR_SEDIM(:,:,:)) + ENDIF +END DO +! +! Apply the rain sedimentation rate to the WR_xxx aqueous species +DO JL= 1, SIZE(PRRSVS,4) + PRRSVS(:,:,:,JL) = MAX( 0.0,ZSV_SEDIM_FACTR(:,:,:)*PRRSVS(:,:,:,JL) ) +ENDDO +!ice phase +IF (OUSECHIC) THEN + DO JL= 1, SIZE(PSGRSVS,4) + PSGRSVS(:,:,:,JL) = MAX( 0.0, & + ((ZSV_SEDIM_FACTS(:,:,:)+ZSV_SEDIM_FACTG(:,:,:))/2.) & + *PSGRSVS(:,:,:,JL) ) + ENDDO +ENDIF +! +!------------------------------------------------------------------------------- +! +END SUBROUTINE CH_AQUEOUS_SEDIM1MOM diff --git a/src/mesonh/ext/ch_aqueous_tmicice.f90 b/src/mesonh/ext/ch_aqueous_tmicice.f90 new file mode 100644 index 0000000000000000000000000000000000000000..51255f6fd86cc99c6db1de25b0a21483f0edde7f --- /dev/null +++ b/src/mesonh/ext/ch_aqueous_tmicice.f90 @@ -0,0 +1,1304 @@ +!MNH_LIC Copyright 2008-2019 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_CH_AQUEOUS_TMICICE +! #################################### +! +INTERFACE + SUBROUTINE CH_AQUEOUS_TMICICE( PTSTEP, PRHODREF, PRHODJ, PTHT, PPABST, & + PRTMIN_AQ, OUSECHIC, OCH_RET_ICE, HNAMES, & + HICNAMES, KEQ, KEQAQ, PRVT, PRCT, PRRT, PRIT,& + PRST, PRGT, PCIT, PRCS, PRRS, PRIS, PRSS, & + PRGS, PGSVT, PGRSVS, PCSVT, PCRSVS, PRSVT, & + PRRSVS, PSGSVT, PSGRSVS ) +! +REAL, INTENT(IN) :: PTSTEP ! Time step +REAL, INTENT(IN) :: PRTMIN_AQ ! LWC threshold liq. chem. +INTEGER, INTENT(IN) :: KEQ ! Number of chem. spec. +INTEGER, INTENT(IN) :: KEQAQ ! Number of liq. chem. spec. +LOGICAL, INTENT(IN) :: OUSECHIC ! flag for ice chem. +LOGICAL, INTENT(IN) :: OCH_RET_ICE ! flag for retention in ice +! +CHARACTER(LEN=32), DIMENSION(:), INTENT(IN) :: HNAMES ! name of chem. species +CHARACTER(LEN=32), DIMENSION(:), INTENT(IN) :: HICNAMES ! name of ice chem. species +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF! Reference density +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Dry density * Jacobian +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABST ! absolute pressure at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHT ! Theta at time t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRVT ! Vapor m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRCT ! cloud water m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRRT ! Rainwater m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRIT ! Pristine m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRST ! Snow m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRGT ! Graupel m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PCIT ! Pristine conc. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRCS ! cloud water m.r. source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRRS ! Rainwater m.r. source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRIS ! Pristine m.r. source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRSS ! Snow m.r. source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRGS ! graupel m.r. source +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PGSVT ! gas species at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PGRSVS ! gas species source +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PCSVT ! cloud water aq. species at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PCRSVS ! cloud water aq. species source +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRSVT ! Rainwater aq. species at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRSVS ! Rainwater aq. species source +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSGSVT ! ice species at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PSGRSVS ! ice species source +! +END SUBROUTINE CH_AQUEOUS_TMICICE +END INTERFACE +END MODULE MODI_CH_AQUEOUS_TMICICE +! +! ################################################################################ + SUBROUTINE CH_AQUEOUS_TMICICE( PTSTEP, PRHODREF, PRHODJ, PTHT, PPABST, & + PRTMIN_AQ, OUSECHIC, OCH_RET_ICE, HNAMES, & + HICNAMES, KEQ, KEQAQ, PRVT, PRCT, PRRT, PRIT,& + PRST, PRGT, PCIT, PRCS, PRRS, PRIS, PRSS, & + PRGS, PGSVT, PGRSVS, PCSVT, PCRSVS, PRSVT, & + PRRSVS, PSGSVT, PSGRSVS ) +! ################################################################################ +! +!!**** * - compute the explicit microphysical sources +!! +!! PURPOSE +!! ------- +!! The purpose of this routine is to compute the microphysical sources +!! corresponding to collision/coalescence processes (autoconversion + accretion) +!! and to the freezing, rimin and melting processes for snow and graupel +!! for the ICE3(4) cloud microphysics parameterization (see rain_ice) +!! +!! +!!** METHOD +!! ------ +!! +!! EXTERNAL +!! -------- +!! None +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODD_PARAMETERS +!! JPHEXT : Horizontal external points number +!! JPVEXT : Vertical external points number +!! +!! REFERENCE +!! --------- +!! Book1 of the documentation ( routine CH_AQUEOUS_TMICICE ) +!! +!! AUTHOR +!! ------ +!! C. Mari J.P. Pinty M. Leriche * Laboratoire d'Aerologie* +!! +!! MODIFICATIONS +!! ------------- +!! Original 26/03/08 +!! M. Leriche 19/07/2010 add riming, freezing and melting for ice phase(ICE3) +!! M. Leriche 17/09/2010 add OUSECHIC flag +!! Juan 24/09/2012: for BUG Pgi rewrite PACK function on mode_pack_pgi +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! M.Leriche 2015 correction bug +! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function +! P. Wautelet 28/05/2019: move COUNTJV function to tools.f90 +! +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_PARAMETERS, ONLY : JPHEXT, &! number of horizontal External points + JPVEXT ! number of vertical External points +USE MODD_CST, ONLY : XP00, XRD, XRV, XCPD, XTT, XLMTT, XLVTT, XCPV, & + XCL, XCI, XESTT, XMV, XMD +USE MODD_RAIN_ICE_DESCR_n, ONLY : XLBR, XLBEXR, XCEXVT, XLBDAS_MAX, XLBS, XLBEXS, & + XLBG, XLBEXG, XCXS, XCXG, XDG, XBS +USE MODD_RAIN_ICE_PARAM_n, ONLY : XTIMAUTC, XCRIAUTC, XFCACCR, XEXCACCR, & + XRIMINTP1, XRIMINTP2, XCRIMSS, XCRIMSG,& + XEXCRIMSS, XEXCRIMSG, NGAMINC, XGAMINC_RIM1, & + XFRACCSS, XLBRACCS1, XLBRACCS2, XLBRACCS3, & + XACCINTP1S, XACCINTP2S, XACCINTP1R, XACCINTP2R, & + NACCLBDAS, NACCLBDAR, XKER_RACCSS, XKER_RACCS, & + XEXRCFRI, XRCFRI, X0DEPG, XEX0DEPG, X1DEPG, & + XEX1DEPG, XSCFAC, XFCDRYG, XFIDRYG, XCOLEXIG, & + XCOLEXSG, XFSDRYG, NDRYLBDAG, XDRYINTP1G, & + XDRYINTP2G, NDRYLBDAS, XDRYINTP1S, XDRYINTP2S, & + XKER_SDRYG, XLBSDRYG1, XLBSDRYG2, XLBSDRYG3, & + XFRDRYG, NDRYLBDAR, XDRYINTP1R, XDRYINTP2R, & + XKER_RDRYG, XLBRDRYG1, XLBRDRYG2, XLBRDRYG3, & + XCOLIG, XCOLEXIG, XCOLSG, XCOLEXSG +USE MODD_CH_ICE ! value of retention coefficient +USE MODD_CH_ICE_n ! index for ice phase chemistry with IC3/4 +! +#ifdef MNH_PGI +USE MODE_PACK_PGI +#endif +use mode_tools, only: Countjv +use mode_tools_ll, only: GET_INDICE_ll +! +IMPLICIT NONE +! +!* 0.1 Declarations of dummy arguments : +! +! +REAL, INTENT(IN) :: PTSTEP ! Time step +REAL, INTENT(IN) :: PRTMIN_AQ ! LWC threshold liq. chem. +INTEGER, INTENT(IN) :: KEQ ! Number of chem. spec. +INTEGER, INTENT(IN) :: KEQAQ ! Number of liq. chem. spec. +LOGICAL, INTENT(IN) :: OUSECHIC ! flag for ice chem. +LOGICAL, INTENT(IN) :: OCH_RET_ICE ! flag for retention in ice +! +CHARACTER(LEN=32), DIMENSION(:), INTENT(IN) :: HNAMES ! name of chem. species +CHARACTER(LEN=32), DIMENSION(:), INTENT(IN) :: HICNAMES ! name of ice chem. species +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF! Reference density +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Dry density * Jacobian +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABST ! absolute pressure at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHT ! Theta at time t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRVT ! Vapor m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRCT ! cloud water m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRRT ! Rainwater m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRIT ! Pristine m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRST ! Snow m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRGT ! Graupel m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PCIT ! Pristine conc. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRCS ! cloud water m.r. source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRRS ! Rainwater m.r. source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRIS ! Pristine m.r. source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRSS ! Snow m.r. source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRGS ! graupel m.r. source +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PGSVT ! gas species at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PGRSVS ! gas species source +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PCSVT ! cloud water aq. species at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PCRSVS ! cloud water aq. species source +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRSVT ! Rainwater aq. species at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRSVS ! Rainwater aq. species source +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSGSVT ! ice species at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PSGRSVS ! ice species source +! +!* 0.2 Declarations of local variables : +! +INTEGER :: JLC, JLR, JLI, JLG, JLW ! Loop index for cloud water, rainwater and ice species +INTEGER :: JJ ! Loop index +INTEGER :: IIB ! Define the domain where is +INTEGER :: IIE ! the microphysical sources have to be computed +INTEGER :: IJB +INTEGER :: IJE +INTEGER :: IKB +INTEGER :: IKE +! +INTEGER :: IMICRO ! case number of r_x>0 locations +LOGICAL, DIMENSION(SIZE(PRCT,1),SIZE(PRCT,2),SIZE(PRCT,3)) & + :: GMICRO ! where to compute mic. processes +REAL, DIMENSION(SIZE(PRCT,1),SIZE(PRCT,2),SIZE(PRCT,3)) & + :: ZT ! Temperature +REAL, DIMENSION(SIZE(PRCT,1),SIZE(PRCT,2),SIZE(PRCT,3)) & + :: ZRCS ! Cloud water m.r. source phys.tendency +REAL, DIMENSION(SIZE(PRCT,1),SIZE(PRCT,2),SIZE(PRCT,3)) & + :: ZRRS ! Rain water m.r. source phys. tendency +REAL, DIMENSION(SIZE(PRCT,1),SIZE(PRCT,2),SIZE(PRCT,3)) & + :: ZRIS ! Pristine m.r. source phys. tendency +REAL, DIMENSION(SIZE(PRCT,1),SIZE(PRCT,2),SIZE(PRCT,3)) & + :: ZRSS ! Snow m.r. source phys. tendency +REAL, DIMENSION(SIZE(PRCT,1),SIZE(PRCT,2),SIZE(PRCT,3)) & + :: ZRGS ! Graupel m.r. source phys. tendency +REAL, DIMENSION(SIZE(PGRSVS,1),SIZE(PGRSVS,2),SIZE(PGRSVS,3),SIZE(PGRSVS,4)) & + :: ZZGRSVS ! Gas species source +REAL, DIMENSION(SIZE(PCRSVS,1),SIZE(PCRSVS,2),SIZE(PCRSVS,3),SIZE(PCRSVS,4)) & + :: ZZCRSVS ! Cloud water aq. species source +REAL, DIMENSION(SIZE(PRRSVS,1),SIZE(PRRSVS,2),SIZE(PRRSVS,3),SIZE(PRRSVS,4)) & + :: ZZRRSVS ! Rain water aq. species source +REAL, DIMENSION(SIZE(PSGRSVS,1),SIZE(PSGRSVS,2),SIZE(PSGRSVS,3),SIZE(PSGRSVS,4)) & + :: ZZSGRSVS ! Ice (snow+graupel) species source +REAL, DIMENSION(SIZE(PRCT,1),SIZE(PRCT,2),SIZE(PRCT,3)) & + :: ZCW ! work array +REAL, DIMENSION(SIZE(PRCT,1),SIZE(PRCT,2),SIZE(PRCT,3)) & + :: ZRW ! work array +REAL, DIMENSION(SIZE(PRCT,1),SIZE(PRCT,2),SIZE(PRCT,3)) & + :: ZSGW ! work array +REAL, DIMENSION(SIZE(PRCT,1),SIZE(PRCT,2),SIZE(PRCT,3)) & + :: ZGW ! work array +REAL, DIMENSION(:), ALLOCATABLE :: ZZT ! Temperature +REAL, DIMENSION(:), ALLOCATABLE :: ZPRES ! Pressure +REAL, DIMENSION(:), ALLOCATABLE :: ZRVT ! Vapor m.r. at t +REAL, DIMENSION(:), ALLOCATABLE :: ZRCT ! Cloud water m.r. at t +REAL, DIMENSION(:), ALLOCATABLE :: ZRRT ! Rain water m.r. at t +REAL, DIMENSION(:), ALLOCATABLE :: ZRIT ! Pristine m.r. at t +REAL, DIMENSION(:), ALLOCATABLE :: ZRST ! Snow m.r. at t +REAL, DIMENSION(:), ALLOCATABLE :: ZRGT ! Graupel m.r. at t +REAL, DIMENSION(:), ALLOCATABLE :: ZCIT ! Pristine conc. at t +REAL, DIMENSION(:), ALLOCATABLE :: ZZRCS ! Cloud water m.r. source +REAL, DIMENSION(:), ALLOCATABLE :: ZZRRS ! Rain water m.r. source +REAL, DIMENSION(:), ALLOCATABLE :: ZZRIS ! Pristine m.r. source +REAL, DIMENSION(:), ALLOCATABLE :: ZZRSS ! snow m.r. source +REAL, DIMENSION(:), ALLOCATABLE :: ZZRGS ! graupel m.r. source +REAL, DIMENSION(:,:), ALLOCATABLE :: ZCSVT ! Cloud water aq. species at t +REAL, DIMENSION(:,:), ALLOCATABLE :: ZRSVT ! Rain water aq. species at t +REAL, DIMENSION(:,:), ALLOCATABLE :: ZSGSVT ! Ice (snow + graupel) species at t +REAL, DIMENSION(:,:), ALLOCATABLE :: ZGRSVS ! Gas species source +REAL, DIMENSION(:,:), ALLOCATABLE :: ZCRSVS ! Cloud water aq. species source +REAL, DIMENSION(:,:), ALLOCATABLE :: ZRRSVS ! Rain water aq. species source +REAL, DIMENSION(:,:), ALLOCATABLE :: ZSGRSVS! Ice (snow+graupel) species source +REAL, DIMENSION(:), ALLOCATABLE :: ZCJ ! Function to compute the ventilation coefficient +REAL, DIMENSION(:), ALLOCATABLE :: ZKA ! Thermal conductivity of the air +REAL, DIMENSION(:), ALLOCATABLE :: ZDV ! Diffusivity of water vapor in the air +! +REAL, DIMENSION(:), ALLOCATABLE :: ZRHODREF, & ! RHO Dry REFerence + ZZW, & ! Work array + ZLBDAR, & ! Slope parameter of the raindrop distribution + ZLBDAS, & ! Slope parameter of the snow distribution + ZLBDAG, & ! Slope parameter of the graupel distribution + ZRDRYG, & ! Dry growth rate of the graupel + ZRWETG ! Wet growth rate of the graupel +! +INTEGER :: IGRIM, IGACC ! Case number of riming, accretion +INTEGER :: IGDRY +!, IGWET ! dry growth and wet growth locations for graupels +LOGICAL, DIMENSION(:), ALLOCATABLE :: GRIM ! Test where to compute riming +LOGICAL, DIMENSION(:), ALLOCATABLE :: GACC ! Test where to compute accretion +LOGICAL, DIMENSION(:), ALLOCATABLE :: GDRY ! Test where to compute dry growth +!LOGICAL, DIMENSION(:), ALLOCATABLE :: GWET ! Test where to compute wet growt +INTEGER, DIMENSION(:), ALLOCATABLE :: IVEC1,IVEC2 ! Vectors of indices for + ! interpolations +REAL, DIMENSION(:), ALLOCATABLE :: ZVEC1,ZVEC2,ZVEC3 ! Work vectors for + ! interpolations +REAL, DIMENSION(:,:), ALLOCATABLE :: ZZW1, ZZW2, ZZW3, ZZW4 ! Work arrays +! +INTEGER , DIMENSION(SIZE(GMICRO)) :: I1,I2,I3 ! Used to replace the COUNT +INTEGER :: JL ! and PACK intrinsics +! +! +! compute the temperature +! +ZT(:,:,:) = PTHT(:,:,:) * ( PPABST(:,:,:) / XP00 ) ** (XRD/XCPD) +! +!------------------------------------------------------------------------------- +! +!* 1. COMPUTE THE LOOP BOUNDS +! ----------------------- +! +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +IKB=1+JPVEXT +IKE=SIZE(PRCT,3) - JPVEXT +! +!------------------------------------------------------------------------------- +! +!!* 2. TRANSFORMATION INTO PHYSICAL TENDENCIES +! --------------------------------------- +! +ZRCS(:,:,:) = PRCS(:,:,:) / PRHODJ(:,:,:) +ZRRS(:,:,:) = PRRS(:,:,:) / PRHODJ(:,:,:) +ZRSS(:,:,:) = PRSS(:,:,:) / PRHODJ(:,:,:) +ZRIS(:,:,:) = PRIS(:,:,:) / PRHODJ(:,:,:) +ZRGS(:,:,:) = PRGS(:,:,:) / PRHODJ(:,:,:) +! +DO JLC= 1, SIZE(PCRSVS,4) + ZZCRSVS(:,:,:,JLC) = PCRSVS(:,:,:,JLC) / PRHODJ(:,:,:) +ENDDO +DO JLR= 1, SIZE(PRRSVS,4) + ZZRRSVS(:,:,:,JLR) = PRRSVS(:,:,:,JLR) / PRHODJ(:,:,:) +ENDDO +IF (OUSECHIC) THEN + DO JLG= 1, SIZE(PGRSVS,4) + ZZGRSVS(:,:,:,JLG) = PGRSVS(:,:,:,JLG) / PRHODJ(:,:,:) + ENDDO + DO JLI= 1, SIZE(PSGRSVS,4) + ZZSGRSVS(:,:,:,JLI) = PSGRSVS(:,:,:,JLI) / PRHODJ(:,:,:) + ENDDO +ELSE + IF (.NOT.(OCH_RET_ICE)) THEN + DO JLG= 1, SIZE(PGRSVS,4) + ZZGRSVS(:,:,:,JLG) = PGRSVS(:,:,:,JLG) / PRHODJ(:,:,:) + ENDDO + ENDIF +ENDIF +! +!------------------------------------------------------------------------------- +! +!* 3. OPTIMIZATION: looking for locations where m.r. hydro. > min value +! ----------------------------------------------------------------- +! +GMICRO(:,:,:) = .FALSE. +GMICRO(IIB:IIE,IJB:IJE,IKB:IKE) = & + (PRCT(IIB:IIE,IJB:IJE,IKB:IKE)>PRTMIN_AQ*1.e3/PRHODREF(IIB:IIE,IJB:IJE,IKB:IKE)) .OR. & + (PRRT(IIB:IIE,IJB:IJE,IKB:IKE)>PRTMIN_AQ*1.e3/PRHODREF(IIB:IIE,IJB:IJE,IKB:IKE)) .OR. & + (PRST(IIB:IIE,IJB:IJE,IKB:IKE)>PRTMIN_AQ*1.e3/PRHODREF(IIB:IIE,IJB:IJE,IKB:IKE)) .OR. & + (PRGT(IIB:IIE,IJB:IJE,IKB:IKE)>PRTMIN_AQ*1.e3/PRHODREF(IIB:IIE,IJB:IJE,IKB:IKE)) +! +IMICRO = COUNTJV( GMICRO(:,:,:),I1(:),I2(:),I3(:)) +IF( IMICRO >= 1 ) THEN + ALLOCATE(ZZT(IMICRO)) + ALLOCATE(ZPRES(IMICRO)) + ALLOCATE(ZRVT(IMICRO)) + ALLOCATE(ZRCT(IMICRO)) + ALLOCATE(ZRRT(IMICRO)) + ALLOCATE(ZRIT(IMICRO)) + ALLOCATE(ZRST(IMICRO)) + ALLOCATE(ZRGT(IMICRO)) + ALLOCATE(ZCIT(IMICRO)) + ALLOCATE(ZCSVT(IMICRO,SIZE(PCSVT,4))) + ALLOCATE(ZRSVT(IMICRO,SIZE(PRSVT,4))) + ALLOCATE(ZZRCS(IMICRO)) + ALLOCATE(ZZRRS(IMICRO)) + ALLOCATE(ZZRIS(IMICRO)) + ALLOCATE(ZZRSS(IMICRO)) + ALLOCATE(ZZRGS(IMICRO)) + ALLOCATE(ZCRSVS(IMICRO,SIZE(PCRSVS,4))) + ALLOCATE(ZRRSVS(IMICRO,SIZE(PRRSVS,4))) + ALLOCATE(ZRHODREF(IMICRO)) + ALLOCATE(ZZW(IMICRO)) + ALLOCATE(ZZW2(IMICRO,SIZE(PCSVT,4))) + ALLOCATE(ZZW4(IMICRO,SIZE(PCSVT,4))) + ALLOCATE(ZZW1(IMICRO,6)) + ALLOCATE(ZLBDAR(IMICRO)) + ALLOCATE(ZLBDAS(IMICRO)) + ALLOCATE(ZLBDAG(IMICRO)) + ALLOCATE(ZRDRYG(IMICRO)) + ALLOCATE(ZRWETG(IMICRO)) + ALLOCATE(ZKA(IMICRO)) + ALLOCATE(ZDV(IMICRO)) + ALLOCATE(ZCJ(IMICRO)) + DO JL=1,IMICRO + ZCSVT(JL,:) = PCSVT(I1(JL),I2(JL),I3(JL),:) + ZCRSVS(JL,:) = ZZCRSVS(I1(JL),I2(JL),I3(JL),:) + ZRSVT(JL,:) = PRSVT(I1(JL),I2(JL),I3(JL),:) + ZRRSVS(JL,:) = ZZRRSVS(I1(JL),I2(JL),I3(JL),:) +! + ZRVT(JL) = PRVT(I1(JL),I2(JL),I3(JL)) + ZRCT(JL) = PRCT(I1(JL),I2(JL),I3(JL)) + ZRRT(JL) = PRRT(I1(JL),I2(JL),I3(JL)) + ZRIT(JL) = PRIT(I1(JL),I2(JL),I3(JL)) + ZRST(JL) = PRST(I1(JL),I2(JL),I3(JL)) + ZRGT(JL) = PRGT(I1(JL),I2(JL),I3(JL)) + ZCIT(JL) = PCIT(I1(JL),I2(JL),I3(JL)) +! + ZZRCS(JL) = ZRCS(I1(JL),I2(JL),I3(JL)) + ZZRRS(JL) = ZRRS(I1(JL),I2(JL),I3(JL)) + ZZRIS(JL) = ZRIS(I1(JL),I2(JL),I3(JL)) + ZZRSS(JL) = ZRSS(I1(JL),I2(JL),I3(JL)) + ZZRGS(JL) = ZRGS(I1(JL),I2(JL),I3(JL)) +! + ZZT(JL) = ZT(I1(JL),I2(JL),I3(JL)) + ZRHODREF(JL) = PRHODREF(I1(JL),I2(JL),I3(JL)) + ZPRES(JL) = PPABST(I1(JL),I2(JL),I3(JL)) + ENDDO + IF (OUSECHIC) THEN + ALLOCATE(ZSGSVT(IMICRO,SIZE(PSGSVT,4))) + ALLOCATE(ZGRSVS(IMICRO,SIZE(PGRSVS,4))) + ALLOCATE(ZSGRSVS(IMICRO,SIZE(PSGRSVS,4))) + ALLOCATE(ZZW3(IMICRO,SIZE(PSGSVT,4))) + DO JL=1,IMICRO + ZGRSVS(JL,:) = ZZGRSVS(I1(JL),I2(JL),I3(JL),:) + ZSGSVT(JL,:) = PSGSVT(I1(JL),I2(JL),I3(JL),:) + ZSGRSVS(JL,:) = ZZSGRSVS(I1(JL),I2(JL),I3(JL),:) + ENDDO + ELSE + IF (.NOT.(OCH_RET_ICE)) THEN + ALLOCATE(ZGRSVS(IMICRO,SIZE(PGRSVS,4))) + DO JL=1,IMICRO + ZGRSVS(JL,:) = ZZGRSVS(I1(JL),I2(JL),I3(JL),:) + ENDDO + ENDIF + ENDIF +! +! +!------------------------------------------------------------------------------- +! +!* 4. COMPUTES THE SLOW WARM PROCESS SOURCES +! -------------------------------------- +! +!* 4.1 compute the slope parameter Lbda_r +! + WHERE( ZRRT(:)>0.0 ) + ZLBDAR(:) = XLBR*( ZRHODREF(:)*MAX( ZRRT(:),PRTMIN_AQ*1.e3/ZRHODREF(:)) )**XLBEXR + END WHERE +! +!* 4.2 compute the autoconversion of r_c for r_r production: RCAUTR +! + ZZW(:) = 0.0 + ZZW2(:,:) = 0.0 +! + DO JL=1,IMICRO + IF ( (ZRCT(JL)>0.0) .AND. (ZZRCS(JL)>0.0) ) THEN + ZZW(JL) = MIN( ZZRCS(JL),XTIMAUTC*MAX( ZRCT(JL)-XCRIAUTC/ZRHODREF(JL),0.0)) +! + ZZW2(JL,:) = ZZW(JL) * ZCSVT(JL,:)/ZRCT(JL) + ZZW2(JL,:) = MAX(MIN(ZZW2(JL,:),(ZCSVT(JL,:)/PTSTEP)),0.0) + ZCRSVS(JL,:) = ZCRSVS(JL,:) - ZZW2(JL,:) + ZRRSVS(JL,:) = ZRRSVS(JL,:) + ZZW2(JL,:) + END IF + END DO +! +!* 4.3 compute the accretion of r_c for r_r production: RCACCR +! + ZZW(:) = 0.0 + ZZW2(:,:) = 0.0 +! + DO JL = 1,IMICRO + IF( (ZRCT(JL)>0.0) .AND. (ZRRT(JL)>0.0) .AND. (ZZRCS(JL)>0.0) ) THEN + ZZW(JL) = MIN( ZZRCS(JL),XFCACCR * ZRCT(JL) & + * ZLBDAR(JL)**XEXCACCR & + * ZRHODREF(JL)**(-XCEXVT) ) +! + ZZW2(JL,:) = ZZW(JL) * ZCSVT(JL,:)/ZRCT(JL) + ZZW2(JL,:) = MAX(MIN(ZZW2(JL,:),(ZCSVT(JL,:)/PTSTEP)),0.0) + ZCRSVS(JL,:) = ZCRSVS(JL,:) - ZZW2(JL,:) + ZRRSVS(JL,:) = ZRRSVS(JL,:) + ZZW2(JL,:) + END IF + END DO +! +! +!* 4.4 compute the evaporation of r_r: RREVAV +! +! calculated by the kinetic mass transfer equation (BASIC.f90) +! +! +!------------------------------------------------------------------------------- +! +!* 5. COMPUTES THE SLOW COLD PROCESS SOURCES +! -------------------------------------- +! +!* 5.1 compute the spontaneous freezing source: RRHONG +! + ZZW(:) = 0.0 + ZZW2(:,:) = 0.0 +! + DO JL = 1,IMICRO + IF( (ZZT(JL)<XTT-35.0) .AND. (ZRRT(JL)>0.) .AND. (ZZRRS(JL)>0.) ) THEN + ZZW(JL) = MIN( ZZRRS(JL),ZRRT(JL)/PTSTEP ) + ZZW2(JL,:) = ZZW(JL) * ZRSVT(JL,:)/ZRRT(JL) + ZZW2(JL,:) = MAX(MIN(ZZW2(JL,:),(ZRSVT(JL,:)/PTSTEP)),0.0) + ZRRSVS(JL,:) = ZRRSVS(JL,:) - ZZW2(JL,:) + IF (OUSECHIC) THEN + DO JLI = 1, SIZE(PSGRSVS,4) + IF (TRIM(HICNAMES(JLI)) == 'IC_HNO3' .OR. TRIM(HICNAMES(JLI)) == 'IC_SULF' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_H2SO4' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_NH3' .OR. TRIM(HICNAMES(JLI)) == 'IC_HCL' & + .OR. HICNAMES(JLI)(1:4) == 'IC_A' .OR. HICNAMES(JLI)(1:4) == 'IC_B' & + .OR. NINDEXGI(JLI).EQ.0) THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETNA * ZZW2(JL,NINDEXWI(JLI)) + ELSE IF (TRIM(HICNAMES(JLI)) == 'IC_H2O2' .OR. TRIM(HICNAMES(JLI)) == 'IC_HO2' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_HONO' .OR. TRIM(HICNAMES(JLI)) == 'IC_HNO4'& + .OR. TRIM(HICNAMES(JLI)) == 'IC_HCHO' .OR. TRIM(HICNAMES(JLI)) == 'IC_ORA1'& + .OR. TRIM(HICNAMES(JLI)) == 'IC_ORA2') THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETHP * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETHP) * ZZW2(JL,NINDEXWI(JLI)) + ELSE IF (TRIM(HICNAMES(JLI)) == 'IC_SO2' .OR. TRIM(HICNAMES(JLI)) == 'IC_OH' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_MO2' .OR. & + TRIM(HICNAMES(JLI)) == 'IC_OP1') THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETSU * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETSU) * ZZW2(JL,NINDEXWI(JLI)) + ELSE + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETDF * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETDF) * ZZW2(JL,NINDEXWI(JLI)) + ENDIF + ENDDO + ELSE + IF (.NOT.(OCH_RET_ICE)) THEN + DO JLW = 1, SIZE(PRRSVS,4) + IF (.NOT.(NINDEXWG(JLW).EQ.0)) THEN + ZGRSVS(JL,NINDEXWG(JLW)) = ZGRSVS(JL,NINDEXWG(JLW)) + ZZW2(JL,JLW) + ENDIF + ENDDO + ENDIF + ENDIF + ENDIF + ENDDO +! +! +!------------------------------------------------------------------------------- +! +!* 6. COMPUTES THE FAST COLD PROCESS SOURCES +! -------------------------------------- +! +!* 6.1 compute the slope parameter Lbda_s and Lbda_g +! + WHERE ( ZRST(:)>0.0 ) + ZLBDAS(:) = MIN( XLBDAS_MAX, & + XLBS*( ZRHODREF(:)*MAX( ZRST(:),PRTMIN_AQ*1.e3/ZRHODREF(:)) )**XLBEXS ) + END WHERE +! + WHERE ( ZRGT(:)>0.0 ) + ZLBDAG(:) = XLBG*( ZRHODREF(:)*MAX( ZRGT(:),PRTMIN_AQ*1.e3/ZRHODREF(:)))**XLBEXG + END WHERE +! +!* 6.2 cloud droplet riming of the aggregates +! + ZZW1(:,:) = 0.0 + ZZW(:) = 0.0 + + ALLOCATE(GRIM(IMICRO)) + GRIM(:) = (ZRCT(:)>PRTMIN_AQ*1.e3/ZRHODREF(:)) .AND. & + (ZRST(:)>PRTMIN_AQ*1.e3/ZRHODREF(:)) .AND. & + (ZZRCS(:)>0.0) .AND. (ZZT(:)<XTT) + IGRIM = COUNT( GRIM(:) ) +! + IF( IGRIM>0 ) THEN +! +! 6.2.0 allocations +! + ALLOCATE(ZVEC1(IGRIM)) + ALLOCATE(ZVEC2(IGRIM)) + ALLOCATE(IVEC1(IGRIM)) + ALLOCATE(IVEC2(IGRIM)) +! +! 6.2.1 select the ZLBDAS +! + ZVEC1(:) = PACK( ZLBDAS(:),MASK=GRIM(:) ) +! +! 6.2.2 find the next lower indice for the ZLBDAS in the geometrical +! set of Lbda_s used to tabulate some moments of the incomplete +! gamma function +! + ZVEC2(1:IGRIM) = MAX( 1.00001, MIN( REAL(NGAMINC)-0.00001, & + XRIMINTP1 * LOG( ZVEC1(1:IGRIM) ) + XRIMINTP2 ) ) + IVEC2(1:IGRIM) = INT( ZVEC2(1:IGRIM) ) + ZVEC2(1:IGRIM) = ZVEC2(1:IGRIM) - REAL( IVEC2(1:IGRIM) ) +! +! 6.2.3 perform the linear interpolation of the normalized +! "2+XDS"-moment of the incomplete gamma function +! + ZVEC1(1:IGRIM) = XGAMINC_RIM1( IVEC2(1:IGRIM)+1 )* ZVEC2(1:IGRIM) & + - XGAMINC_RIM1( IVEC2(1:IGRIM) )*(ZVEC2(1:IGRIM) - 1.0) + ZZW(:) = UNPACK( VECTOR=ZVEC1(:),MASK=GRIM,FIELD=0.0 ) +! +! 6.2.4 riming of the small sized aggregates +! + ZZW2(:,:) = 0.0 + DO JL = 1,IMICRO + IF ( GRIM(JL) ) THEN + ZZW1(JL,1) = MIN( ZZRCS(JL), XCRIMSS * ZZW(JL) * ZRCT(JL) * ZRST(JL) & ! RCRIMSS + * ZLBDAS(JL)**(XBS+XEXCRIMSS) * ZRHODREF(JL)**(-XCEXVT+1) ) + ZZW2(JL,:) = ZZW1(JL,1) * ZCSVT(JL,:)/ZRCT(JL) + ZZW2(JL,:) = MAX(MIN(ZZW2(JL,:),(ZCSVT(JL,:)/PTSTEP)),0.0) + ZCRSVS(JL,:) = ZCRSVS(JL,:) - ZZW2(JL,:) + IF (OUSECHIC) THEN + DO JLI = 1, SIZE(PSGRSVS,4) + IF (TRIM(HICNAMES(JLI)) == 'IC_HNO3' .OR. TRIM(HICNAMES(JLI)) == 'IC_SULF' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_H2SO4' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_NH3' .OR. TRIM(HICNAMES(JLI)) == 'IC_HCL' & + .OR. HICNAMES(JLI)(1:4) == 'IC_A' .OR. HICNAMES(JLI)(1:4) == 'IC_B' & + .OR. NINDEXGI(JLI).EQ.0) THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETNA * ZZW2(JL,NINDEXWI(JLI)) + ELSE IF (TRIM(HICNAMES(JLI)) == 'IC_H2O2' .OR. TRIM(HICNAMES(JLI)) == 'IC_HO2' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_HONO' .OR. TRIM(HICNAMES(JLI)) == 'IC_HNO4'& + .OR. TRIM(HICNAMES(JLI)) == 'IC_HCHO' .OR. TRIM(HICNAMES(JLI)) == 'IC_ORA1'& + .OR. TRIM(HICNAMES(JLI)) == 'IC_ORA2') THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETHP * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETHP) * ZZW2(JL,NINDEXWI(JLI)) + ELSE IF (TRIM(HICNAMES(JLI)) == 'IC_SO2' .OR. TRIM(HICNAMES(JLI)) == 'IC_OH' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_MO2' .OR. & + TRIM(HICNAMES(JLI)) == 'IC_OP1') THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETSU * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETSU) * ZZW2(JL,NINDEXWI(JLI)) + ELSE + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETDF * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETDF) * ZZW2(JL,NINDEXWI(JLI)) + ENDIF + ENDDO + ELSE + IF (.NOT.(OCH_RET_ICE)) THEN + DO JLW = 1, SIZE(PCRSVS,4) + IF (.NOT.(NINDEXWG(JLW).EQ.0)) THEN + ZGRSVS(JL,NINDEXWG(JLW)) = ZGRSVS(JL,NINDEXWG(JLW)) + ZZW2(JL,JLW) + ENDIF + ENDDO + ENDIF + ENDIF + ENDIF + ENDDO +! +! 6.2.5 riming-conversion of the large sized aggregates into graupel +! + ZZW2(:,:) = 0.0 + DO JL = 1,IMICRO + IF ( GRIM(JL) .AND. (ZZRSS(JL)>0.0) ) THEN + ZZW1(JL,2) = MIN( ZZRCS(JL), XCRIMSG * ZRCT(JL) * ZRST(JL) * ZLBDAS(JL)**(XBS+XEXCRIMSG) & ! RCRIMSG + * ZRHODREF(JL)**(-XCEXVT+1) - ZZW1(JL,1) ) + ZZW2(JL,:) = ZZW1(JL,2) * ZCSVT(JL,:)/ZRCT(JL) + ZZW2(JL,:) = MAX(MIN(ZZW2(JL,:),(ZCSVT(JL,:)/PTSTEP)),0.0) + ZCRSVS(JL,:) = ZCRSVS(JL,:) - ZZW2(JL,:) + IF (OUSECHIC) THEN + DO JLI = 1, SIZE(PSGRSVS,4) + IF (TRIM(HICNAMES(JLI)) == 'IC_HNO3' .OR. TRIM(HICNAMES(JLI)) == 'IC_SULF' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_H2SO4' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_NH3' .OR. TRIM(HICNAMES(JLI)) == 'IC_HCL' & + .OR. HICNAMES(JLI)(1:4) == 'IC_A' .OR. HICNAMES(JLI)(1:4) == 'IC_B' & + .OR. NINDEXGI(JLI).EQ.0) THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETNA * ZZW2(JL,NINDEXWI(JLI)) + ELSE IF (TRIM(HICNAMES(JLI)) == 'IC_H2O2' .OR. TRIM(HICNAMES(JLI)) == 'IC_HO2' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_HONO' .OR. TRIM(HICNAMES(JLI)) == 'IC_HNO4'& + .OR. TRIM(HICNAMES(JLI)) == 'IC_HCHO' .OR. TRIM(HICNAMES(JLI)) == 'IC_ORA1'& + .OR. TRIM(HICNAMES(JLI)) == 'IC_ORA2') THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETHP * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETHP) * ZZW2(JL,NINDEXWI(JLI)) + ELSE IF (TRIM(HICNAMES(JLI)) == 'IC_SO2' .OR. TRIM(HICNAMES(JLI)) == 'IC_OH' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_MO2' .OR. & + TRIM(HICNAMES(JLI)) == 'IC_OP1') THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETSU * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETSU) * ZZW2(JL,NINDEXWI(JLI)) + ELSE + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETDF * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETDF) * ZZW2(JL,NINDEXWI(JLI)) + ENDIF + ENDDO + ELSE + IF (.NOT.(OCH_RET_ICE)) THEN + DO JLW = 1, SIZE(PCRSVS,4) + IF (.NOT.(NINDEXWG(JLW).EQ.0)) THEN + ZGRSVS(JL,NINDEXWG(JLW)) = ZGRSVS(JL,NINDEXWG(JLW)) + ZZW2(JL,JLW) + ENDIF + ENDDO + ENDIF + ENDIF + ENDIF + ENDDO + + DEALLOCATE(IVEC2) + DEALLOCATE(IVEC1) + DEALLOCATE(ZVEC2) + DEALLOCATE(ZVEC1) + END IF + DEALLOCATE(GRIM) +! +!* 6.3 rain accretion onto the aggregates +! + ZZW(:) = 0.0 + ZZW1(:,2:3) = 0.0 + ALLOCATE(GACC(IMICRO)) + GACC(:) = (ZRRT(:)>PRTMIN_AQ*1.e3/ZRHODREF(:)) .AND. & + (ZRST(:)>PRTMIN_AQ*1.e3/ZRHODREF(:)) .AND. & + (ZZRRS(:)>0.0) .AND. (ZZT(:)<XTT) + IGACC = COUNT( GACC(:) ) +! + IF( IGACC>0 ) THEN +! +! 6.3.0 allocations +! + ALLOCATE(ZVEC1(IGACC)) + ALLOCATE(ZVEC2(IGACC)) + ALLOCATE(ZVEC3(IGACC)) + ALLOCATE(IVEC1(IGACC)) + ALLOCATE(IVEC2(IGACC)) +! +! 6.3.1 select the (ZLBDAS,ZLBDAR) couplet +! + ZVEC1(:) = PACK( ZLBDAS(:),MASK=GACC(:) ) + ZVEC2(:) = PACK( ZLBDAR(:),MASK=GACC(:) ) +! +! 6.3.2 find the next lower indice for the ZLBDAS and for the ZLBDAR +! in the geometrical set of (Lbda_s,Lbda_r) couplet use to +! tabulate the RACCSS-kernel +! + ZVEC1(1:IGACC) = MAX( 1.00001, MIN( REAL(NACCLBDAS)-0.00001, & + XACCINTP1S * LOG( ZVEC1(1:IGACC) ) + XACCINTP2S ) ) + IVEC1(1:IGACC) = INT( ZVEC1(1:IGACC) ) + ZVEC1(1:IGACC) = ZVEC1(1:IGACC) - REAL( IVEC1(1:IGACC) ) +! + ZVEC2(1:IGACC) = MAX( 1.00001, MIN( REAL(NACCLBDAR)-0.00001, & + XACCINTP1R * LOG( ZVEC2(1:IGACC) ) + XACCINTP2R ) ) + IVEC2(1:IGACC) = INT( ZVEC2(1:IGACC) ) + ZVEC2(1:IGACC) = ZVEC2(1:IGACC) - REAL( IVEC2(1:IGACC) ) +! +! 6.3.3 perform the bilinear interpolation of the normalized +! RACCSS-kernel +! + DO JJ = 1,IGACC + ZVEC3(JJ) = ( XKER_RACCSS(IVEC1(JJ)+1,IVEC2(JJ)+1)* ZVEC2(JJ) & + - XKER_RACCSS(IVEC1(JJ)+1,IVEC2(JJ) )*(ZVEC2(JJ) - 1.0) ) & + * ZVEC1(JJ) & + - ( XKER_RACCSS(IVEC1(JJ) ,IVEC2(JJ)+1)* ZVEC2(JJ) & + - XKER_RACCSS(IVEC1(JJ) ,IVEC2(JJ) )*(ZVEC2(JJ) - 1.0) ) & + * (ZVEC1(JJ) - 1.0) + END DO + ZZW(:) = UNPACK( VECTOR=ZVEC3(:),MASK=GACC,FIELD=0.0 ) +! +! 6.3.4 raindrop accretion on the small sized aggregates +! + ZZW2(:,:) = 0.0 + DO JL = 1,IMICRO + IF ( GACC(JL) ) THEN + ZZW1(JL,2) = & !! coef of RRACCS + XFRACCSS*( ZRST(JL)*ZLBDAS(JL)**XBS )*( ZRHODREF(JL)**(-XCEXVT) ) & + *( XLBRACCS1/((ZLBDAS(JL)**2) ) + & + XLBRACCS2/( ZLBDAS(JL) * ZLBDAR(JL) ) + & + XLBRACCS3/( (ZLBDAR(JL)**2)) )/ZLBDAR(JL)**4 + ZZW1(JL,4) = MIN( ZZRRS(JL),ZZW1(JL,2)*ZZW(JL) ) ! RRACCSS + ZZW2(JL,:) = ZZW1(JL,4) * ZRSVT(JL,:)/ZRRT(JL) + ZZW2(JL,:) = MAX(MIN(ZZW2(JL,:),(ZRSVT(JL,:)/PTSTEP)),0.0) + ZRRSVS(JL,:) = ZRRSVS(JL,:) - ZZW2(JL,:) + IF (OUSECHIC) THEN + DO JLI = 1, SIZE(PSGRSVS,4) + IF (TRIM(HICNAMES(JLI)) == 'IC_HNO3' .OR. TRIM(HICNAMES(JLI)) == 'IC_SULF' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_H2SO4' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_NH3' .OR. TRIM(HICNAMES(JLI)) == 'IC_HCL' & + .OR. HICNAMES(JLI)(1:4) == 'IC_A' .OR. HICNAMES(JLI)(1:4) == 'IC_B' & + .OR. NINDEXGI(JLI).EQ.0) THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETNA * ZZW2(JL,NINDEXWI(JLI)) + ELSE IF (TRIM(HICNAMES(JLI)) == 'IC_H2O2' .OR. TRIM(HICNAMES(JLI)) == 'IC_HO2' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_HONO' .OR. TRIM(HICNAMES(JLI)) == 'IC_HNO4'& + .OR. TRIM(HICNAMES(JLI)) == 'IC_HCHO' .OR. TRIM(HICNAMES(JLI)) == 'IC_ORA1'& + .OR. TRIM(HICNAMES(JLI)) == 'IC_ORA2') THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETHP * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETHP) * ZZW2(JL,NINDEXWI(JLI)) + ELSE IF (TRIM(HICNAMES(JLI)) == 'IC_SO2' .OR. TRIM(HICNAMES(JLI)) == 'IC_OH' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_MO2' .OR. & + TRIM(HICNAMES(JLI)) == 'IC_OP1') THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETSU * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETSU) * ZZW2(JL,NINDEXWI(JLI)) + ELSE + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETDF * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETDF) * ZZW2(JL,NINDEXWI(JLI)) + ENDIF + ENDDO + ELSE + IF (.NOT.(OCH_RET_ICE)) THEN + DO JLW = 1, SIZE(PRRSVS,4) + IF (.NOT.(NINDEXWG(JLW).EQ.0)) THEN + ZGRSVS(JL,NINDEXWG(JLW)) = ZGRSVS(JL,NINDEXWG(JLW)) + ZZW2(JL,JLW) + ENDIF + ENDDO + ENDIF + ENDIF + ENDIF + ENDDO +! +! 6.3.4b perform the bilinear interpolation of the normalized +! RACCS-kernel +! + DO JJ = 1,IGACC + ZVEC3(JJ) = ( XKER_RACCS(IVEC2(JJ)+1,IVEC1(JJ)+1)* ZVEC1(JJ) & + - XKER_RACCS(IVEC2(JJ)+1,IVEC1(JJ) )*(ZVEC1(JJ) - 1.0) ) & + * ZVEC2(JJ) & + - ( XKER_RACCS(IVEC2(JJ) ,IVEC1(JJ)+1)* ZVEC1(JJ) & + - XKER_RACCS(IVEC2(JJ) ,IVEC1(JJ) )*(ZVEC1(JJ) - 1.0) ) & + * (ZVEC2(JJ) - 1.0) + END DO + ZZW1(:,2) = ZZW1(:,2)*UNPACK( VECTOR=ZVEC3(:),MASK=GACC(:),FIELD=0.0 ) +! +! 6.3.5 raindrop accretion-conversion of the large sized aggregates +! into graupeln +! + ZZW2(:,:) = 0.0 + WHERE ( GACC(:) .AND. (ZZRSS(:)>0.0) ) + ZZW1(:,2) = MAX( MIN( ZZRRS(:),ZZW1(:,2)-ZZW1(:,4) ),0.0 ) ! RRACCSG + END WHERE + DO JL = 1,IMICRO + IF ( GACC(JL) .AND. (ZZRSS(JL)>0.0) .AND. ZZW1(JL,2)>0.0 ) THEN + ZZW2(JL,:) = ZZW1(JL,2) * ZRSVT(JL,:)/ZRRT(JL) + ZZW2(JL,:) = MAX(MIN(ZZW2(JL,:),(ZRSVT(JL,:)/PTSTEP)),0.0) + ZRRSVS(JL,:) = ZRRSVS(JL,:) - ZZW2(JL,:) + IF (OUSECHIC) THEN + DO JLI = 1, SIZE(PSGRSVS,4) + IF (TRIM(HICNAMES(JLI)) == 'IC_HNO3' .OR. TRIM(HICNAMES(JLI)) == 'IC_SULF' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_H2SO4' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_NH3' .OR. TRIM(HICNAMES(JLI)) == 'IC_HCL' & + .OR. HICNAMES(JLI)(1:4) == 'IC_A' .OR. HICNAMES(JLI)(1:4) == 'IC_B' & + .OR. NINDEXGI(JLI).EQ.0) THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETNA * ZZW2(JL,NINDEXWI(JLI)) + ELSE IF (TRIM(HICNAMES(JLI)) == 'IC_H2O2' .OR. TRIM(HICNAMES(JLI)) == 'IC_HO2' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_HONO' .OR. TRIM(HICNAMES(JLI)) == 'IC_HNO4'& + .OR. TRIM(HICNAMES(JLI)) == 'IC_HCHO' .OR. TRIM(HICNAMES(JLI)) == 'IC_ORA1'& + .OR. TRIM(HICNAMES(JLI)) == 'IC_ORA2') THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETHP * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETHP) * ZZW2(JL,NINDEXWI(JLI)) + ELSE IF (TRIM(HICNAMES(JLI)) == 'IC_SO2' .OR. TRIM(HICNAMES(JLI)) == 'IC_OH' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_MO2' .OR. & + TRIM(HICNAMES(JLI)) == 'IC_OP1') THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETSU * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETSU) * ZZW2(JL,NINDEXWI(JLI)) + ELSE + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETDF * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETDF) * ZZW2(JL,NINDEXWI(JLI)) + ENDIF + ENDDO + ELSE + IF (.NOT.(OCH_RET_ICE)) THEN + DO JLW = 1, SIZE(PRRSVS,4) + IF (.NOT.(NINDEXWG(JLW).EQ.0)) THEN + ZGRSVS(JL,NINDEXWG(JLW)) = ZGRSVS(JL,NINDEXWG(JLW)) + ZZW2(JL,JLW) + ENDIF + ENDDO + ENDIF + ENDIF + ENDIF + ENDDO +! + DEALLOCATE(IVEC2) + DEALLOCATE(IVEC1) + DEALLOCATE(ZVEC3) + DEALLOCATE(ZVEC2) + DEALLOCATE(ZVEC1) + END IF + DEALLOCATE(GACC) +! +!* 6.4 rain contact freezing +! + ZZW1(:,4) = 0.0 + ZZW2(:,:) = 0.0 + DO JL = 1,IMICRO + IF ( (ZRIT(JL)>PRTMIN_AQ*1.e3/ZRHODREF(JL)) .AND. & + (ZRRT(JL)>PRTMIN_AQ*1.e3/ZRHODREF(JL)) .AND. & + (ZZRIS(JL)>0.0) .AND. (ZZRRS(JL)>0.0) ) THEN + ZZW1(JL,4) = MIN( ZZRRS(JL), XRCFRI * ZCIT(JL) & ! RRCFRIG + * ZLBDAR(JL)**XEXRCFRI & + * ZRHODREF(JL)**(-XCEXVT-1.) ) + ZZW2(JL,:) = ZZW1(JL,4) * ZRSVT(JL,:)/ZRRT(JL) + ZZW2(JL,:) = MAX(MIN(ZZW2(JL,:),(ZRSVT(JL,:)/PTSTEP)),0.0) + ZRRSVS(JL,:) = ZRRSVS(JL,:) - ZZW2(JL,:) + IF (OUSECHIC) THEN + DO JLI = 1, SIZE(PSGRSVS,4) + IF (TRIM(HICNAMES(JLI)) == 'IC_HNO3' .OR. TRIM(HICNAMES(JLI)) == 'IC_SULF' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_H2SO4' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_NH3' .OR. TRIM(HICNAMES(JLI)) == 'IC_HCL' & + .OR. HICNAMES(JLI)(1:4) == 'IC_A' .OR. HICNAMES(JLI)(1:4) == 'IC_B' & + .OR. NINDEXGI(JLI).EQ.0) THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETNA * ZZW2(JL,NINDEXWI(JLI)) + ELSE IF (TRIM(HICNAMES(JLI)) == 'IC_H2O2' .OR. TRIM(HICNAMES(JLI)) == 'IC_HO2' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_HONO' .OR. TRIM(HICNAMES(JLI)) == 'IC_HNO4'& + .OR. TRIM(HICNAMES(JLI)) == 'IC_HCHO' .OR. TRIM(HICNAMES(JLI)) == 'IC_ORA1'& + .OR. TRIM(HICNAMES(JLI)) == 'IC_ORA2') THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETHP * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETHP) * ZZW2(JL,NINDEXWI(JLI)) + ELSE IF (TRIM(HICNAMES(JLI)) == 'IC_SO2' .OR. TRIM(HICNAMES(JLI)) == 'IC_OH' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_MO2' .OR. & + TRIM(HICNAMES(JLI)) == 'IC_OP1') THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETSU * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETSU) * ZZW2(JL,NINDEXWI(JLI)) + ELSE + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETDF * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETDF) * ZZW2(JL,NINDEXWI(JLI)) + ENDIF + ENDDO + ELSE + IF (.NOT.(OCH_RET_ICE)) THEN + DO JLW = 1, SIZE(PRRSVS,4) + IF (.NOT.(NINDEXWG(JLW).EQ.0)) THEN + ZGRSVS(JL,NINDEXWG(JLW)) = ZGRSVS(JL,NINDEXWG(JLW)) + ZZW2(JL,JLW) + ENDIF + ENDDO + ENDIF + ENDIF + ENDIF + ENDDO +! +!* 6.5 compute the Dry growth case of graupel +! + ZZW(:) = 0.0 + ZZW1(:,:) = 0.0 + WHERE( (ZRGT(:)>PRTMIN_AQ*1.e3/ZRHODREF(:)) .AND. & + ((ZRCT(:)>PRTMIN_AQ*1.e3/ZRHODREF(:) .AND. ZZRCS(:)>0.0)) ) + ZZW(:) = ZLBDAG(:)**(XCXG-XDG-2.0) * ZRHODREF(:)**(-XCEXVT) + ZZW1(:,1) = MIN( ZZRCS(:),XFCDRYG * ZRCT(:) * ZZW(:) ) ! RCDRYG + END WHERE + WHERE( (ZRGT(:)>PRTMIN_AQ*1.e3/ZRHODREF(:)) .AND. & + ((ZRIT(:)>PRTMIN_AQ*1.e3/ZRHODREF(:) .AND. ZZRIS(:)>0.0)) ) + ZZW(:) = ZLBDAG(:)**(XCXG-XDG-2.0) * ZRHODREF(:)**(-XCEXVT) + ZZW1(:,2) = MIN( ZZRIS(:),XFIDRYG * EXP( XCOLEXIG*(ZZT(:)-XTT) ) & + * ZRIT(:) * ZZW(:) ) ! RIDRYG + END WHERE +! +! 6.5.1 accretion of aggregates on the graupeln +! + ALLOCATE(GDRY(IMICRO)) + GDRY(:) = (ZRST(:)>PRTMIN_AQ*1.e3/ZRHODREF(:)) .AND. & + (ZRGT(:)>PRTMIN_AQ*1.e3/ZRHODREF(:)) .AND. (ZZRSS(:)>0.0) + IGDRY = COUNT( GDRY(:) ) +! + IF( IGDRY>0 ) THEN +! +! 6.5.2 allocations +! + ALLOCATE(ZVEC1(IGDRY)) + ALLOCATE(ZVEC2(IGDRY)) + ALLOCATE(ZVEC3(IGDRY)) + ALLOCATE(IVEC1(IGDRY)) + ALLOCATE(IVEC2(IGDRY)) +! +! 6.5.3 select the (ZLBDAG,ZLBDAS) couplet +! + ZVEC1(:) = PACK( ZLBDAG(:),MASK=GDRY(:) ) + ZVEC2(:) = PACK( ZLBDAS(:),MASK=GDRY(:) ) +! +! 6.5.4 find the next lower indice for the ZLBDAG and for the ZLBDAS +! in the geometrical set of (Lbda_g,Lbda_s) couplet use to +! tabulate the SDRYG-kernel +! + ZVEC1(1:IGDRY) = MAX( 1.00001, MIN( REAL(NDRYLBDAG)-0.00001, & + XDRYINTP1G * LOG( ZVEC1(1:IGDRY) ) + XDRYINTP2G ) ) + IVEC1(1:IGDRY) = INT( ZVEC1(1:IGDRY) ) + ZVEC1(1:IGDRY) = ZVEC1(1:IGDRY) - REAL( IVEC1(1:IGDRY) ) +! + ZVEC2(1:IGDRY) = MAX( 1.00001, MIN( REAL(NDRYLBDAS)-0.00001, & + XDRYINTP1S * LOG( ZVEC2(1:IGDRY) ) + XDRYINTP2S ) ) + IVEC2(1:IGDRY) = INT( ZVEC2(1:IGDRY) ) + ZVEC2(1:IGDRY) = ZVEC2(1:IGDRY) - REAL( IVEC2(1:IGDRY) ) +! +! 6.5.5 perform the bilinear interpolation of the normalized +! SDRYG-kernel +! + DO JJ = 1,IGDRY + ZVEC3(JJ) = ( XKER_SDRYG(IVEC1(JJ)+1,IVEC2(JJ)+1)* ZVEC2(JJ) & + - XKER_SDRYG(IVEC1(JJ)+1,IVEC2(JJ) )*(ZVEC2(JJ) - 1.0) ) & + * ZVEC1(JJ) & + - ( XKER_SDRYG(IVEC1(JJ) ,IVEC2(JJ)+1)* ZVEC2(JJ) & + - XKER_SDRYG(IVEC1(JJ) ,IVEC2(JJ) )*(ZVEC2(JJ) - 1.0) ) & + * (ZVEC1(JJ) - 1.0) + END DO + ZZW(:) = UNPACK( VECTOR=ZVEC3(:),MASK=GDRY,FIELD=0.0 ) +! + WHERE( GDRY(:) ) + ZZW1(:,3) = MIN( ZZRSS(:),XFSDRYG*ZZW(:) & ! RSDRYG + * EXP( XCOLEXSG*(ZZT(:)-XTT) ) & + *ZRST(:)*( ZLBDAG(:)**XCXG ) & + *( ZRHODREF(:)**(-XCEXVT) ) & + *( XLBSDRYG1/( ZLBDAG(:)**2 ) + & + XLBSDRYG2/( ZLBDAG(:) * ZLBDAS(:) ) + & + XLBSDRYG3/( ZLBDAS(:)**2) ) ) + END WHERE + DEALLOCATE(IVEC2) + DEALLOCATE(IVEC1) + DEALLOCATE(ZVEC3) + DEALLOCATE(ZVEC2) + DEALLOCATE(ZVEC1) + END IF +! +! 6.5.6 accretion of raindrops on the graupeln +! + GDRY(:) = (ZRRT(:)>PRTMIN_AQ*1.e3/ZRHODREF(:)) .AND. & + (ZRGT(:)>PRTMIN_AQ*1.e3/ZRHODREF(:)) .AND. (ZZRRS(:)>0.0) + IGDRY = COUNT( GDRY(:) ) +! + IF( IGDRY>0 ) THEN +! +! 6.5.7 allocations +! + ALLOCATE(ZVEC1(IGDRY)) + ALLOCATE(ZVEC2(IGDRY)) + ALLOCATE(ZVEC3(IGDRY)) + ALLOCATE(IVEC1(IGDRY)) + ALLOCATE(IVEC2(IGDRY)) +! +! 6.5.8 select the (ZLBDAG,ZLBDAR) couplet +! + ZVEC1(:) = PACK( ZLBDAG(:),MASK=GDRY(:) ) + ZVEC2(:) = PACK( ZLBDAR(:),MASK=GDRY(:) ) +! +! 6.5.9 find the next lower indice for the ZLBDAG and for the ZLBDAR +! in the geometrical set of (Lbda_g,Lbda_r) couplet use to +! tabulate the RDRYG-kernel +! + ZVEC1(1:IGDRY) = MAX( 1.00001, MIN( REAL(NDRYLBDAG)-0.00001, & + XDRYINTP1G * LOG( ZVEC1(1:IGDRY) ) + XDRYINTP2G ) ) + IVEC1(1:IGDRY) = INT( ZVEC1(1:IGDRY) ) + ZVEC1(1:IGDRY) = ZVEC1(1:IGDRY) - REAL( IVEC1(1:IGDRY) ) +! + ZVEC2(1:IGDRY) = MAX( 1.00001, MIN( REAL(NDRYLBDAR)-0.00001, & + XDRYINTP1R * LOG( ZVEC2(1:IGDRY) ) + XDRYINTP2R ) ) + IVEC2(1:IGDRY) = INT( ZVEC2(1:IGDRY) ) + ZVEC2(1:IGDRY) = ZVEC2(1:IGDRY) - REAL( IVEC2(1:IGDRY) ) +! +! 6.5.10 perform the bilinear interpolation of the normalized +! RDRYG-kernel +! + DO JJ = 1,IGDRY + ZVEC3(JJ) = ( XKER_RDRYG(IVEC1(JJ)+1,IVEC2(JJ)+1)* ZVEC2(JJ) & + - XKER_RDRYG(IVEC1(JJ)+1,IVEC2(JJ) )*(ZVEC2(JJ) - 1.0) ) & + * ZVEC1(JJ) & + - ( XKER_RDRYG(IVEC1(JJ) ,IVEC2(JJ)+1)* ZVEC2(JJ) & + - XKER_RDRYG(IVEC1(JJ) ,IVEC2(JJ) )*(ZVEC2(JJ) - 1.0) ) & + * (ZVEC1(JJ) - 1.0) + END DO + ZZW(:) = UNPACK( VECTOR=ZVEC3(:),MASK=GDRY,FIELD=0.0 ) +! + WHERE( GDRY(:) ) + ZZW1(:,4) = MIN( ZZRRS(:), XFRDRYG*ZZW(:) & ! RRDRYG + *( ZLBDAR(:)**(-4) )*( ZLBDAG(:)**XCXG ) & + *( ZRHODREF(:)**(-XCEXVT-1.) ) & + *( XLBRDRYG1/( ZLBDAG(:)**2 ) + & + XLBRDRYG2/( ZLBDAG(:) * ZLBDAR(:) ) + & + XLBRDRYG3/( ZLBDAR(:)**2) ) ) + END WHERE + DEALLOCATE(IVEC2) + DEALLOCATE(IVEC1) + DEALLOCATE(ZVEC3) + DEALLOCATE(ZVEC2) + DEALLOCATE(ZVEC1) + END IF +! + ZRDRYG(:) = ZZW1(:,1) + ZZW1(:,2) + ZZW1(:,3) + ZZW1(:,4) + DEALLOCATE(GDRY) +! +!* 6.6 compute the Wet growth case of the graupel +! + ZZW(:) = 0.0 + ZRWETG(:) = 0.0 +! + ZKA(:) = 2.38E-2 + 0.0071E-2 * ( ZZT(:) - XTT ) ! k_a + ZDV(:) = 0.211E-4 * (ZZT(:)/XTT)**1.94 * (XP00/ZPRES(:)) ! D_v + ZCJ(:) = XSCFAC * ZRHODREF(:)**0.3 / SQRT( 1.718E-5+0.0049E-5*(ZZT(:)-XTT) ) + !c^prime_j (in the ventilation factor) + WHERE( ZRGT(:)>PRTMIN_AQ*1.e3/ZRHODREF(:) ) + ZZW1(:,5) = MIN( ZZRIS(:), & + ZZW1(:,2) / (XCOLIG*EXP(XCOLEXIG*(ZZT(:)-XTT)) ) ) ! RIWETG + ZZW1(:,6) = MIN( ZZRSS(:), & + ZZW1(:,3) / (XCOLSG*EXP(XCOLEXSG*(ZZT(:)-XTT)) ) ) ! RSWETG +! + ZZW(:) = ZRVT(:)*ZPRES(:)/((XMV/XMD)+ZRVT(:)) ! Vapor pressure + ZZW(:) = ZKA(:)*(XTT-ZZT(:)) + & + ( ZDV(:)*(XLVTT + ( XCPV - XCL ) * ( ZZT(:) - XTT )) & + *(XESTT-ZZW(:))/(XRV*ZZT(:)) ) +! compute RWETG +! + ZRWETG(:)=MAX( 0.0, & + ( ZZW(:) * ( X0DEPG* ZLBDAG(:)**XEX0DEPG + & + X1DEPG*ZCJ(:)*ZLBDAG(:)**XEX1DEPG ) + & + ( ZZW1(:,5)+ZZW1(:,6) ) * & + ( ZRHODREF(:)*(XLMTT+(XCI-XCL)*(XTT-ZZT(:))) ) ) / & + ( ZRHODREF(:)*(XLMTT-XCL*(XTT-ZZT(:))) ) ) + END WHERE +! +!* 6.7 Select Wet or Dry case for the growth of the graupel +! + ZZW(:) = 0.0 + ZZW2(:,:) = 0.0 + ZZW4(:,:) = 0.0 + DO JL = 1,IMICRO + IF ( (ZRGT(JL)>PRTMIN_AQ*1.e3/ZRHODREF(JL)) .AND. & ! wet case + ZZT(JL)<XTT .AND. ZRDRYG(JL)>=ZRWETG(JL) .AND. & + ZRWETG(JL)>0.0 .AND. ZRCT(JL)>0.0 .AND. ZRRT(JL)>0.0) THEN + ZZW(JL) = ZRWETG(JL) + ZZW2(JL,:) = ZZW(JL) * ZRSVT(JL,:)/ZRRT(JL) + ZZW2(JL,:) = MAX(MIN(ZZW2(JL,:),(ZRSVT(JL,:)/PTSTEP)),0.0) + ZRRSVS(JL,:) = ZRRSVS(JL,:) - ZZW2(JL,:) ! rain -> graupel + IF (OUSECHIC) THEN + ZZW3(:,:) = 0.0 + DO JLI = 1, SIZE(PSGRSVS,4) + IF (TRIM(HICNAMES(JLI)) == 'IC_HNO3' .OR. TRIM(HICNAMES(JLI)) == 'IC_SULF' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_H2SO4' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_NH3' .OR. TRIM(HICNAMES(JLI)) == 'IC_HCL' & + .OR. HICNAMES(JLI)(1:4) == 'IC_A' .OR. HICNAMES(JLI)(1:4) == 'IC_B' & + .OR. NINDEXGI(JLI).EQ.0) THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETNA * ZZW2(JL,NINDEXWI(JLI)) + ELSE IF (TRIM(HICNAMES(JLI)) == 'IC_H2O2' .OR. TRIM(HICNAMES(JLI)) == 'IC_HO2' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_HONO' .OR. TRIM(HICNAMES(JLI)) == 'IC_HNO4'& + .OR. TRIM(HICNAMES(JLI)) == 'IC_HCHO' .OR. TRIM(HICNAMES(JLI)) == 'IC_ORA1'& + .OR. TRIM(HICNAMES(JLI)) == 'IC_ORA2') THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETHP * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETHP) * ZZW2(JL,NINDEXWI(JLI)) + ELSE IF (TRIM(HICNAMES(JLI)) == 'IC_SO2' .OR. TRIM(HICNAMES(JLI)) == 'IC_OH' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_MO2' .OR. & + TRIM(HICNAMES(JLI)) == 'IC_OP1') THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETSU * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETSU) * ZZW2(JL,NINDEXWI(JLI)) + ELSE + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETDF * ZZW2(JL,NINDEXWI(JLI)) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + & + (1. - XRETDF) * ZZW2(JL,NINDEXWI(JLI)) + ENDIF + ENDDO + IF (ZRST(JL)>0.0) THEN + ZZW3(JL,:) = ZZW1(JL,6) * ZSGSVT(JL,:)/ZRST(JL) + ZZW3(JL,:) = MAX(MIN(ZZW3(JL,:),(ZSGSVT(JL,:)/PTSTEP)),0.0) + ZSGRSVS(JL,:) = ZSGRSVS(JL,:) - ZZW3(JL,:) !snow->rain + DO JLI = 1, SIZE(PSGRSVS,4) + ZRRSVS(JL,NINDEXWI(JLI)) = ZRRSVS(JL,NINDEXWI(JLI)) + ZZW3(JL,JLI) + ENDDO + ENDIF + ELSE + IF (.NOT.(OCH_RET_ICE)) THEN + DO JLW = 1, SIZE(PRRSVS,4) + IF (.NOT.(NINDEXWG(JLW).EQ.0)) THEN + ZGRSVS(JL,NINDEXWG(JLW)) = ZGRSVS(JL,NINDEXWG(JLW)) + ZZW2(JL,JLW) + ENDIF + ENDDO + ENDIF + ENDIF + ZZW4(JL,:) = ZZW1(JL,1) * ZCSVT(JL,:)/ZRCT(JL) + ZZW4(JL,:) = MAX(MIN(ZZW4(JL,:),(ZCSVT(JL,:)/PTSTEP)),0.0) + ZCRSVS(JL,:) = ZCRSVS(JL,:) - ZZW4(JL,:) !cloud->rain + ZRRSVS(JL,:) = ZRRSVS(JL,:) + ZZW4(JL,:) + ELSE IF ( (ZRGT(JL)>PRTMIN_AQ*1.e3/ZRHODREF(JL)) .AND. & ! dry case + ZZT(JL)<XTT .AND. ZRDRYG(JL)<ZRWETG(JL) .AND. & + ZRDRYG(JL)>0.0 .AND. ZRCT(JL)>0.0 .AND. ZRRT(JL)>0.0) THEN + ZZW2(JL,:) = ZZW1(JL,1) * ZCSVT(JL,:)/ZRCT(JL) + ZZW2(JL,:) = MAX(MIN(ZZW2(JL,:),(ZCSVT(JL,:)/PTSTEP)),0.0) + ZZW4(JL,:) = ZZW1(JL,4) * ZRSVT(JL,:)/ZRRT(JL) + ZZW4(JL,:) = MAX(MIN(ZZW4(JL,:),(ZRSVT(JL,:)/PTSTEP)),0.0) + ZCRSVS(JL,:) = ZCRSVS(JL,:) - ZZW2(JL,:) + ZRRSVS(JL,:) = ZRRSVS(JL,:) - ZZW4(JL,:) + IF (OUSECHIC) THEN + DO JLI = 1, SIZE(PSGRSVS,4) + IF (TRIM(HICNAMES(JLI)) == 'IC_HNO3' .OR. TRIM(HICNAMES(JLI)) == 'IC_SULF' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_H2SO4' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_NH3' .OR. TRIM(HICNAMES(JLI)) == 'IC_HCL' & + .OR. HICNAMES(JLI)(1:4) == 'IC_A' .OR. HICNAMES(JLI)(1:4) == 'IC_B' & + .OR. NINDEXGI(JLI).EQ.0) THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETNA * ( & + ZZW2(JL,NINDEXWI(JLI)) + ZZW4(JL,NINDEXWI(JLI)) ) + ELSE IF (TRIM(HICNAMES(JLI)) == 'IC_H2O2' .OR. TRIM(HICNAMES(JLI)) == 'IC_HO2' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_HONO' .OR. TRIM(HICNAMES(JLI)) == 'IC_HNO4'& + .OR. TRIM(HICNAMES(JLI)) == 'IC_HCHO' .OR. TRIM(HICNAMES(JLI)) == 'IC_ORA1'& + .OR. TRIM(HICNAMES(JLI)) == 'IC_ORA2') THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETHP * ( & + ZZW2(JL,NINDEXWI(JLI)) + ZZW4(JL,NINDEXWI(JLI)) ) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + (1. - XRETHP) * ( & + ZZW2(JL,NINDEXWI(JLI)) + ZZW4(JL,NINDEXWI(JLI)) ) + ELSE IF (TRIM(HICNAMES(JLI)) == 'IC_SO2' .OR. TRIM(HICNAMES(JLI)) == 'IC_OH' & + .OR. TRIM(HICNAMES(JLI)) == 'IC_MO2' .OR. & + TRIM(HICNAMES(JLI)) == 'IC_OP1') THEN + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETSU * ( & + ZZW2(JL,NINDEXWI(JLI)) + ZZW4(JL,NINDEXWI(JLI)) ) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + (1. - XRETSU) * ( & + ZZW2(JL,NINDEXWI(JLI)) + ZZW4(JL,NINDEXWI(JLI)) ) + ELSE + ZSGRSVS(JL,JLI) = ZSGRSVS(JL,JLI) + XRETDF * ( & + ZZW2(JL,NINDEXWI(JLI)) + ZZW4(JL,NINDEXWI(JLI)) ) + ZGRSVS(JL,NINDEXGI(JLI)) = ZGRSVS(JL,NINDEXGI(JLI)) + (1. - XRETDF) * ( & + ZZW2(JL,NINDEXWI(JLI)) + ZZW4(JL,NINDEXWI(JLI)) ) + ENDIF + ENDDO + ELSE + IF (.NOT.(OCH_RET_ICE)) THEN + DO JLW = 1, SIZE(PRRSVS,4) + IF (.NOT.(NINDEXWG(JLW).EQ.0)) THEN + ZGRSVS(JL,NINDEXWG(JLW)) = ZGRSVS(JL,NINDEXWG(JLW)) + ZZW2(JL,JLW) & + + ZZW4(JL,JLW) + ENDIF + ENDDO + ENDIF + ENDIF + ENDIF + ENDDO +! +!* 6.8 Melting of the graupel +! + IF (OUSECHIC) THEN + ZZW(:) = 0.0 + ZZW3(:,:) = 0.0 + DO JL = 1,IMICRO + IF ( (ZRGT(JL)>PRTMIN_AQ*1.e3/ZRHODREF(JL)) .AND. & + (ZZRGS(JL)>0.0) .AND. (ZZT(JL)>XTT) ) THEN + ZZW(JL) = ZRVT(JL)*ZPRES(JL)/((XMV/XMD)+ZRVT(JL)) ! Vapor pressure + ZZW(JL) = ZKA(JL)*(XTT-ZZT(JL)) + & + ( ZDV(JL)*(XLVTT + ( XCPV - XCL ) * ( ZZT(JL) - XTT )) & + *(XESTT-ZZW(JL))/(XRV*ZZT(JL)) ) +! compute RGMLTR + ZZW(JL) = MIN( ZZRGS(JL), MAX( 0.0,( -ZZW(JL) * & + ( X0DEPG* ZLBDAG(JL)**XEX0DEPG + & + X1DEPG*ZCJ(JL)*ZLBDAG(JL)**XEX1DEPG ) - & + ( ZZW1(JL,1)+ZZW1(JL,4) ) * & + ( ZRHODREF(JL)*XCL*(XTT-ZZT(JL))) ) / & + ( ZRHODREF(JL)*XLMTT ) ) ) + ZZW3(JL,:) = ZZW(JL) * ZSGSVT(JL,:)/ZRGT(JL) + ZZW3(JL,:) = MAX(MIN(ZZW3(JL,:),(ZSGSVT(JL,:)/PTSTEP)),0.0) + ZSGRSVS(JL,:) = ZSGRSVS(JL,:) - ZZW3(JL,:) !graupel->rain + DO JLI = 1, SIZE(PSGRSVS,4) + ZRRSVS(JL,NINDEXWI(JLI)) = ZRRSVS(JL,NINDEXWI(JLI)) + ZZW3(JL,JLI) + ENDDO + ENDIF + ENDDO + ENDIF +! +! +!------------------------------------------------------------------------------- +! +!* 7. UNPACK RESULTS AND DEALLOCATE ARRAYS +! ------------------------------------ + + + DO JLC= 1, SIZE(PCRSVS,4) + ZCW(:,:,:) = ZZCRSVS(:,:,:,JLC) + ZZCRSVS(:,:,:,JLC) = UNPACK(ZCRSVS(:,JLC), MASK=GMICRO(:,:,:), FIELD=ZCW(:,:,:)) + PCRSVS(:,:,:,JLC) = ZZCRSVS(:,:,:,JLC) * PRHODJ(:,:,:) + END DO + DO JLR= 1, SIZE(PRRSVS,4) + ZRW(:,:,:) = ZZRRSVS(:,:,:,JLR) + ZZRRSVS(:,:,:,JLR) = UNPACK(ZRRSVS(:,JLR), MASK=GMICRO(:,:,:), FIELD=ZRW(:,:,:)) + PRRSVS(:,:,:,JLR) = ZZRRSVS(:,:,:,JLR) * PRHODJ(:,:,:) + END DO + IF (OUSECHIC) THEN + DO JLI= 1, SIZE(PSGRSVS,4) + ZSGW(:,:,:) = ZZSGRSVS(:,:,:,JLI) + ZZSGRSVS(:,:,:,JLI) = UNPACK(ZSGRSVS(:,JLI), MASK=GMICRO(:,:,:), FIELD=ZSGW(:,:,:)) + PSGRSVS(:,:,:,JLI) = ZZSGRSVS(:,:,:,JLI) * PRHODJ(:,:,:) + END DO + DO JLG= 1, SIZE(PGRSVS,4) + ZGW(:,:,:) = ZZGRSVS(:,:,:,JLG) + ZZGRSVS(:,:,:,JLG) = UNPACK(ZGRSVS(:,JLG), MASK=GMICRO(:,:,:), FIELD=ZGW(:,:,:)) + PGRSVS(:,:,:,JLG) = ZZGRSVS(:,:,:,JLG) * PRHODJ(:,:,:) + END DO + DEALLOCATE(ZGRSVS) + DEALLOCATE(ZSGRSVS) + DEALLOCATE(ZSGSVT) + DEALLOCATE(ZZW3) + ELSE + IF (.NOT.(OCH_RET_ICE)) THEN + DO JLG= 1, SIZE(PGRSVS,4) + ZGW(:,:,:) = ZZGRSVS(:,:,:,JLG) + ZZGRSVS(:,:,:,JLG) = UNPACK(ZGRSVS(:,JLG), MASK=GMICRO(:,:,:), FIELD=ZGW(:,:,:)) + PGRSVS(:,:,:,JLG) = ZZGRSVS(:,:,:,JLG) * PRHODJ(:,:,:) + END DO + DEALLOCATE(ZGRSVS) + ENDIF + ENDIF + + DEALLOCATE(ZRHODREF) + DEALLOCATE(ZZT) + DEALLOCATE(ZPRES) + DEALLOCATE(ZKA) + DEALLOCATE(ZDV) + DEALLOCATE(ZCJ) + DEALLOCATE(ZZW) + DEALLOCATE(ZZW1) + DEALLOCATE(ZZW2) + DEALLOCATE(ZZW4) + DEALLOCATE(ZZRCS) + DEALLOCATE(ZZRRS) + DEALLOCATE(ZZRIS) + DEALLOCATE(ZZRSS) + DEALLOCATE(ZZRGS) + DEALLOCATE(ZCRSVS) + DEALLOCATE(ZRRSVS) + DEALLOCATE(ZRVT) + DEALLOCATE(ZRCT) + DEALLOCATE(ZRRT) + DEALLOCATE(ZRIT) + DEALLOCATE(ZRST) + DEALLOCATE(ZRGT) + DEALLOCATE(ZCIT) + DEALLOCATE(ZCSVT) + DEALLOCATE(ZRSVT) + DEALLOCATE(ZLBDAR) + DEALLOCATE(ZLBDAS) + DEALLOCATE(ZLBDAG) + DEALLOCATE(ZRDRYG) +! +END IF +! +!------------------------------------------------------------------------------- +! +END SUBROUTINE CH_AQUEOUS_TMICICE diff --git a/src/mesonh/ext/ch_meteo_trans_kess.f90 b/src/mesonh/ext/ch_meteo_trans_kess.f90 new file mode 100644 index 0000000000000000000000000000000000000000..debd6ae61a8107d41da8ba5870e267cb73c5a0d1 --- /dev/null +++ b/src/mesonh/ext/ch_meteo_trans_kess.f90 @@ -0,0 +1,351 @@ +!MNH_LIC Copyright 1995-2019 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_CH_METEO_TRANS_KESS +!! ############################### +!! +! +INTERFACE +!! +SUBROUTINE CH_METEO_TRANS_KESS(KL, PRHODJ, PRHODREF, PRTSM, PTHT, PABST, & + KVECNPT, KVECMASK, TPM, KDAY, KMONTH, & + KYEAR, PLAT, PLON, PLAT0, PLON0, OUSERV, & + OUSERC, OUSERR, KLUOUT, HCLOUD, PTSTEP ) +! +USE MODD_CH_M9_n, ONLY: METEOTRANSTYPE +! +IMPLICIT NONE +REAL, INTENT(IN), OPTIONAL :: PTSTEP !timestep +CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! Cloud parameterization +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Dry density * Jacobian +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF ! air density +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRTSM ! moist variables at t or t-dt or water m.r. source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHT, PABST ! theta and pressure at t +INTEGER, DIMENSION(:,:), INTENT(IN) :: KVECMASK +! +TYPE(METEOTRANSTYPE), DIMENSION(:), INTENT(INOUT) :: TPM + ! meteo variable for CCS +INTEGER, INTENT(IN) :: KYEAR ! Current Year +INTEGER, INTENT(IN) :: KMONTH ! Current Month +INTEGER, INTENT(IN) :: KDAY ! Current Day +INTEGER, INTENT(IN) :: KLUOUT ! channel for output listing +INTEGER, INTENT(IN) :: KL, KVECNPT +REAL, DIMENSION(:,:), INTENT(IN) :: PLAT, PLON +REAL, INTENT(IN) :: PLAT0, PLON0 +LOGICAL, INTENT(IN) :: OUSERV, OUSERC, OUSERR +END SUBROUTINE CH_METEO_TRANS_KESS +!! +END INTERFACE +!! +END MODULE MODI_CH_METEO_TRANS_KESS +!! +!! #################################################################### +SUBROUTINE CH_METEO_TRANS_KESS(KL, PRHODJ, PRHODREF, PRTSM, PTHT, PABST, & + KVECNPT, KVECMASK, TPM, KDAY, KMONTH, & + KYEAR, PLAT, PLON, PLAT0, PLON0, OUSERV, & + OUSERC, OUSERR, KLUOUT, HCLOUD, PTSTEP ) +!! #################################################################### +!! +!!*** *CH_METEO_TRANS_KESS* +!! +!! PURPOSE +!! ------- +! Transfer of meteorological data, such as temperature, pressure +! and water vapor mixing ratio for one point into the variable TPM(JM+1) +! here LWC, LWR and mean radius computed from Kessler or ICEx schemes +!! +!! METHOD +!! ------ +!! For the given grid-point KI,KJ,KK, the meteorological parameters +!! will be transfered for use by CH_SET_RATES and CH_SET_PHOTO_RATES. +!! Presently, the variables altitude, air density, temperature, +!! water vapor mixing ratio, cloud water, longitude, latitude and date +!! will be transfered. In the chemical definition file (.chf) +!! these variables have to be transfered into variables like O2, H2O etc. +!! Also, consistency is checked between the number of +!! variables expected by the CCS (as defined in the .chf file) and +!! the number of variables to be transfered here. If you change +!! the meaning of XMETEOVARS in your .chf file, make sure to modify +!! this subroutine accordingly. +!! If the model is run in 1D mode, the model level instead of altitude +!! is passed. In 2D and 3D, altitude is passed with a negative sign +!! so that the radiation scheme TUV can make the difference between +!! model levels and altitude. +!! +!! AUTHOR +!! ------ +!! K. Suhre *Laboratoire d'Aerologie* +!! +!! MODIFICATIONS +!! ------------- +!! Original 24/05/95 +!! 04/08/96 (K. Suhre) restructured +!! 21/02/97 (K. Suhre) add XLAT0 and XLON0 for LCARTESIAN=T case +!! 27/08/98 (P. Tulet) add temperature at t for kinetic coefficient +!! 09/03/99 (V. Crassier & K. Suhre) vectorization +!! 09/03/99 (K. Suhre) modification for TUV +!! 09/03/99 (C. Mari & J. Escobar) Code optimization +!! 01/12/03 (D. Gazen) change Chemical scheme interface +!! 01/12/03 (D. Gazen) change Chemical scheme interface +!! 01/12/04 (P. Tulet) update ch_meteo_transn.f90 for Arome +!! 01/12/07 (M. Leriche) include rain +!! 14/05/08 (M. Leriche) include raindrops and cloud droplets mean radius +!! 05/06/08 (M. Leriche) calculate LWC and LWR in coherence with time spliting scheme +!! 05/11/08 (M. Leriche) split in two routines for 1-moment and 2-moment cloud schemes +! P. Wautelet 10/04/2019: replace ABORT and STOP calls by Print_msg +! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function +!! +!! EXTERNAL +!! -------- +!! GAMMA : gamma function +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! +USE MODD_CH_M9_n, ONLY: NMETEOVARS, & ! number of meteorological variables + METEOTRANSTYPE !type for meteo . transfer +!! +USE MODD_CST, ONLY: XP00, & ! Surface pressure + XRD, & ! R gas constant + XCPD, & !specific heat for dry air + XPI, & !pie + XRHOLW !density of water +!! +USE MODD_CONF, ONLY: LCARTESIAN ! Logical for cartesian geometry +!! +USE MODD_RAIN_ICE_DESCR_n, ONLY: XNUC, XALPHAC, & !Cloud droplets distrib. param. + XRTMIN, & ! min values of the water m. r. + XLBC, XLBEXC, & !shape param. of the cloud droplets + XLBR, XLBEXR, & !shape param. of the raindrops + XCONC_LAND +!! +use mode_msg + +USE MODI_GAMMA +! +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +IMPLICIT NONE +! +!* 0.1 declarations of arguments +! +REAL, INTENT(IN), OPTIONAL :: PTSTEP ! Double timestep +CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! Cloud parameterization +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Dry density * Jacobian +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF ! air density +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRTSM ! moist variables at t or t-dt or water m.r. source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHT, PABST ! theta and pressure at t +INTEGER, DIMENSION(:,:), INTENT(IN) :: KVECMASK +! +TYPE(METEOTRANSTYPE), DIMENSION(:), INTENT(INOUT) :: TPM + ! meteo variable for CCS +INTEGER, INTENT(IN) :: KYEAR ! Current Year +INTEGER, INTENT(IN) :: KMONTH ! Current Month +INTEGER, INTENT(IN) :: KDAY ! Current Day +INTEGER, INTENT(IN) :: KLUOUT ! channel for output listing +INTEGER, INTENT(IN) :: KL, KVECNPT +REAL, DIMENSION(:,:), INTENT(IN) :: PLAT, PLON +REAL, INTENT(IN) :: PLAT0, PLON0 +LOGICAL, INTENT(IN) :: OUSERV, OUSERC, OUSERR +! +!* 0.2 declarations of local variables +! +REAL,DIMENSION(SIZE(PRTSM,1),SIZE(PRTSM,2),SIZE(PRTSM,3),3) :: ZRTSM +REAL,DIMENSION(SIZE(PRTSM,1),SIZE(PRTSM,2)) :: ZLAT, ZLON +REAL,DIMENSION(SIZE(PRTSM,1),SIZE(PRTSM,2),SIZE(PRTSM,3)) :: ZRAYC, ZWLBDC, & + ZWLBDC3, ZCONC +REAL,DIMENSION(SIZE(PRTSM,1),SIZE(PRTSM,2),SIZE(PRTSM,3)) :: ZRAYR, ZWLBDR, ZWLBDR3 +LOGICAL, SAVE :: GSFIRSTCALL = .TRUE. +INTEGER :: JI,JJ,JK,JM +INTEGER :: IDTI,IDTJ,IDTK +! +! +!------------------------------------------------------------------------------- +! +!* 1. INITIALIZE METEO VARIABLE TRANSFER +! ---------------------------------- +! +firstcall : IF (GSFIRSTCALL) THEN +! + GSFIRSTCALL = .FALSE. +! +!* 1.1 check if number of variables NMETEOVARS +! corresponds to what the CCS expects +! + IF (NMETEOVARS /= 13) THEN + WRITE(KLUOUT,*) "CH_METEO_TRANS ERROR: number of meteovars to transfer" + WRITE(KLUOUT,*) "does not correspond to the number expected by the CCS:" + WRITE(KLUOUT,*) " meteovars to transfer: ", 13 + WRITE(KLUOUT,*) " NMETEOVARS expected: ", NMETEOVARS + WRITE(KLUOUT,*) "Check the definition of NMETEOVARS in your .chf file." + WRITE(KLUOUT,*) "The program will be stopped now!" + call Print_msg( NVERB_FATAL, 'GEN', 'CH_METEO_TRANS_KESS', & + 'number of meteovars to transfer does not correspond to the expected number.' ) + END IF +! +!* 1.2 initialize names of meteo vars +! + TPM(:)%CMETEOVAR(1) = "Model level" + TPM(:)%CMETEOVAR(2) = "Air density (kg/m3)" + TPM(:)%CMETEOVAR(3) = "Temperature (K)" + TPM(:)%CMETEOVAR(4) = "Water vapor (kg/kg)" + TPM(:)%CMETEOVAR(5) = "Cloud water (kg/kg)" + TPM(:)%CMETEOVAR(6) = "Latitude (rad)" + TPM(:)%CMETEOVAR(7) = "Longitude (rad)" + TPM(:)%CMETEOVAR(8) = "Current date (year)" + TPM(:)%CMETEOVAR(9) = "Current date (month)" + TPM(:)%CMETEOVAR(10)= "Current date (day)" + TPM(:)%CMETEOVAR(11)= "Rain water (kg/kg)" + TPM(:)%CMETEOVAR(12)= "Mean cloud droplets radius (m)" + TPM(:)%CMETEOVAR(13)= "Mean raindrops radius (m)" +! +ENDIF firstcall +! +! "Water vapor (kg/kg)" +! +IF (OUSERV) THEN +! if split option, use tendency + IF (PRESENT(PTSTEP)) THEN + ZRTSM(:,:,:,1) = (PRTSM(:,:,:, 1)/ PRHODJ(:,:,:))*PTSTEP + ELSE + ZRTSM(:,:,:,1) = PRTSM(:,:,:, 1) + ENDIF +ELSE + ZRTSM(:,:,:,1) = 0.0 +ENDIF +! +! "Cloud water (kg/kg)" and "Mean cloud droplets radius (m)" +! +IF (OUSERC) THEN + IF (PRESENT(PTSTEP)) THEN + ZRTSM(:,:,:,2) = (PRTSM(:,:,:, 2)/ PRHODJ(:,:,:))*PTSTEP + ELSE + ZRTSM(:,:,:,2) = PRTSM(:,:,:, 2) + ENDIF + ZRAYC(:,:,:) = 10.e-6 ! avoid division by zero + SELECT CASE (HCLOUD) + CASE ('KESS') + WHERE (ZRTSM(:,:,:, 2)>1.e-20) !default value for Kessler + ZRAYC(:,:,:) = 10.e-6 ! assume a cloud droplet radius of 10 µm + ENDWHERE + CASE ('ICE3','ICE4') + WHERE (ZRTSM(:,:,:, 2)>XRTMIN(2)) + ZCONC(:,:,:) = XCONC_LAND + ZWLBDC3(:,:,:) = XLBC(1) * ZCONC(:,:,:) / (PRHODREF(:,:,:) * ZRTSM(:,:,:, 2)) + ZWLBDC(:,:,:) = ZWLBDC3(:,:,:)**XLBEXC + ZRAYC(:,:,:) = 0.5*GAMMA(XNUC+1./XALPHAC)/(GAMMA(XNUC)*ZWLBDC(:,:,:)) +! ZRAYC(:,:,:) = 10.e-6 ! assume a cloud droplet radius of 10 µm + ENDWHERE + END SELECT +ELSE + ZRTSM(:,:,:,2) = 0.0 + ZRAYC(:,:,:) = 10.e-6 ! avoid division by zero +ENDIF +! +! "Rain water (kg/kg)" and "Mean raindrops radius (m)" +! +IF (OUSERR) THEN + IF (PRESENT(PTSTEP)) THEN + ZRTSM(:,:,:,3) = (PRTSM(:,:,:, 3)/ PRHODJ(:,:,:))*PTSTEP + ELSE + ZRTSM(:,:,:,3) = PRTSM(:,:,:, 3) + ENDIF + ZRAYR(:,:,:) = 500.e-6 ! avoid division by zero + SELECT CASE (HCLOUD) + CASE ('KESS') + WHERE (ZRTSM(:,:,:, 3)>1.e-20) !default value for Kessler + ZRAYR(:,:,:) = 0.5*((XPI*XRHOLW*1.E7)/ & + (PRHODREF(:,:,:)*ZRTSM(:,:,:,3)))**(-1./4.) + ENDWHERE + CASE ('ICE3','ICE4') + WHERE (ZRTSM(:,:,:, 3)>XRTMIN(3)) + ZRAYR(:,:,:) = 0.5*(1./(XLBR*(PRHODREF(:,:,:)*ZRTSM(:,:,:,3))**XLBEXR)) + ENDWHERE + END SELECT +ELSE + ZRTSM(:,:,:,3) = 0.0 + ZRAYR(:,:,:) = 500.e-6 ! avoid division by zero +ENDIF + +IF(LCARTESIAN) THEN +! "Latitude (rad)" + ZLAT(:,:) = PLAT0 +! "Longitude (rad)" + ZLON(:,:) = PLON0 +ELSE +! "Latitude (rad)" + ZLAT(:,:) = PLAT(:,:) +! "Longitude (rad)" + ZLON(:,:) = PLON(:,:) +END IF +!! +!* 2. TRANSFER METEO VARIABLES +! ------------------------ +! +IDTI=KVECMASK(2,KL)-KVECMASK(1,KL)+1 +IDTJ=KVECMASK(4,KL)-KVECMASK(3,KL)+1 +IDTK=KVECMASK(6,KL)-KVECMASK(5,KL)+1 +!Vectorization: +!ocl novrec +!cdir nodep +DO JM=0,KVECNPT-1 + JI=JM-IDTI*(JM/IDTI)+KVECMASK(1,KL) + JJ=JM/IDTI-IDTJ*(JM/(IDTI*IDTJ))+KVECMASK(3,KL) + JK=JM/(IDTI*IDTJ)-IDTK*(JM/(IDTI*IDTJ*IDTK))+KVECMASK(5,KL) +! +!"Model Altitude" +! + TPM(JM+1)%XMETEOVAR(1) = JK-1 ! assuming first model level is level 2 +! TPM(JM+1)%XMETEOVAR(1) = JK ! assuming first model level is level 1 +! +! "Air density (kg/m3)" +! + TPM(JM+1)%XMETEOVAR(2) = PRHODREF(JI, JJ, JK) +! +! "Temperature (K)" +! + TPM(JM+1)%XMETEOVAR(3) = PTHT(JI,JJ,JK)*((PABST(JI,JJ,JK)/XP00)**(XRD/XCPD)) +! +! "Water vapor (kg/kg)" +! + TPM(JM+1)%XMETEOVAR(4) = ZRTSM(JI, JJ, JK, 1) +! +! "Cloud water (kg/kg)" +! + TPM(JM+1)%XMETEOVAR(5) = ZRTSM(JI, JJ, JK, 2) +! +! "Latitude (rad)" +! + TPM(JM+1)%XMETEOVAR(6) = ZLAT(JI, JJ) +! +! "Longitude (rad)" +! + TPM(JM+1)%XMETEOVAR(7) = ZLON(JI, JJ) +! +! "Current date" +! + TPM(JM+1)%XMETEOVAR(8) = REAL(KYEAR) + TPM(JM+1)%XMETEOVAR(9) = REAL(KMONTH) + TPM(JM+1)%XMETEOVAR(10)= REAL(KDAY) +! +! "Rain water (kg/kg)" +! + TPM(JM+1)%XMETEOVAR(11) = ZRTSM(JI, JJ, JK, 3) +! +! "Mean cloud droplets radius (m)" +! + TPM(JM+1)%XMETEOVAR(12) = ZRAYC(JI, JJ, JK) +! +! "Mean raindrops radius (m)" +! + TPM(JM+1)%XMETEOVAR(13) = ZRAYR(JI, JJ, JK) +! +ENDDO +! +END SUBROUTINE CH_METEO_TRANS_KESS diff --git a/src/mesonh/ext/cphase_profile.f90 b/src/mesonh/ext/cphase_profile.f90 new file mode 100644 index 0000000000000000000000000000000000000000..f403e5447f35bf807c2a92cf68c92885ae3d71d8 --- /dev/null +++ b/src/mesonh/ext/cphase_profile.f90 @@ -0,0 +1,140 @@ +!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_CPHASE_PROFILE +!######################### +! +INTERFACE +! + SUBROUTINE CPHASE_PROFILE (PZHAT,PCPHASE,PCPHASE_PBL,PCPHASE_PROFILE,PTKEM) +! +REAL, DIMENSION(:) , INTENT(IN) :: PZHAT ! height level without orography +REAL , INTENT(IN) :: PCPHASE ! prescribed phase velocity +REAL , INTENT(IN) :: PCPHASE_PBL ! prescribed phase velocity +REAL, DIMENSION(:,:) , INTENT(OUT) :: PCPHASE_PROFILE ! profile of Cphase speed +REAL, DIMENSION(:,:),OPTIONAL , INTENT(IN) :: PTKEM ! TKE at t-dt +! +END SUBROUTINE CPHASE_PROFILE +! +END INTERFACE +! +END MODULE MODI_CPHASE_PROFILE +! +! ########################################################################## + SUBROUTINE CPHASE_PROFILE (PZHAT,PCPHASE,PCPHASE_PBL,PCPHASE_PROFILE,PTKEM) +! ########################################################################## +! +!!**** *CPHASE_PROFILE* - defines a non-constant vertical profile for Cphase +!! velocity +!! +!! PURPOSE +!! ------- +! +!!** METHOD +!! ------ +!! +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! V. Masson & C. Lac * Meteo France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 08/2010 +!! Escobar 9/11/2010 : array bound problem if NO Turb => PTKEM optional +!! C.Lac 06/2013 : correction and introduction of PCPHASE_PBL +!! +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_TURB_n, ONLY: XTKEMIN +USE MODD_PARAMETERS +! +IMPLICIT NONE +! +! +!* 0.1 declarations of arguments +! +! +! +REAL, DIMENSION(:) , INTENT(IN) :: PZHAT ! height level without orography +REAL , INTENT(IN) :: PCPHASE ! prescribed phase velocity +REAL , INTENT(IN) :: PCPHASE_PBL ! prescribed phase velocity +REAL, DIMENSION(:,:) , INTENT(OUT) :: PCPHASE_PROFILE ! profile of Cphase speed +REAL, DIMENSION(:,:),OPTIONAL , INTENT(IN) :: PTKEM ! TKE at t-dt +! +!* 0.2 declarations of local variables +! +INTEGER :: IKB ! indice K Beginning in z direction +INTEGER :: IKE ! indice K End in z direction +! +REAL, DIMENSION(SIZE(PCPHASE_PROFILE,1)) :: ZTKE, ZTKEMIN +INTEGER :: JL,JK,JKTKE +! +!------------------------------------------------------------------------------- +! +!* 1. PROLOGUE +! -------- +! +!* 1.1 Compute dimensions of arrays and other indices +! +IKB = 1 + JPVEXT +IKE = SIZE(PCPHASE_PROFILE,2) - JPVEXT +! +! +!* 1.2 Initializations +! +! +PCPHASE_PROFILE = 0.0 +ZTKEMIN = PZHAT(IKE) +ZTKE = PZHAT(IKE-1) +!------------------------------------------------------------------------------- +!------------------------------------------------------------------------------- +! + IF (PRESENT(PTKEM)) THEN +! + DO JL = 1,SIZE(PCPHASE_PROFILE,1) + JKTKE=IKE-1 + DO JK = IKB, IKE-1 + IF (PTKEM(JL,JK) < 5.*XTKEMIN ) THEN + ZTKE (JL) = PZHAT (JK) + JKTKE = JK + EXIT + END IF + END DO + DO JK = JKTKE+1,IKE + IF (PTKEM(JL,JK) == XTKEMIN ) THEN + ZTKEMIN (JL) = PZHAT (JK) + EXIT + END IF + END DO + END DO +! + ELSE + ZTKE (:) = 1000. + ZTKEMIN (:) = 2000. + END IF +! + DO JL = 1,SIZE(PCPHASE_PROFILE,1) + DO JK = IKB, IKE + IF (PZHAT(JK) > ZTKEMIN (JL) ) THEN + PCPHASE_PROFILE(JL,JK) = PCPHASE + ELSE IF (PZHAT(JK) < ZTKE (JL) ) THEN + PCPHASE_PROFILE(JL,JK) = PCPHASE_PBL + ELSE + PCPHASE_PROFILE(JL,JK) = 1./(ZTKEMIN (JL) - ZTKE (JL)) * & + ((PZHAT(JK) - ZTKE(JL)) * PCPHASE + (ZTKEMIN (JL) - PZHAT(JK)) * PCPHASE_PBL ) + END IF + END DO + END DO +! +!------------------------------------------------------------------------------- +! +END SUBROUTINE CPHASE_PROFILE diff --git a/src/mesonh/ext/deallocate_model1.f90 b/src/mesonh/ext/deallocate_model1.f90 new file mode 100644 index 0000000000000000000000000000000000000000..0a38726e144cb2a24d8983286774e78d73722b80 --- /dev/null +++ b/src/mesonh/ext/deallocate_model1.f90 @@ -0,0 +1,703 @@ +!MNH_LIC Copyright 1997-2021 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_DEALLOCATE_MODEL1 +!############################ +! +INTERFACE +! +SUBROUTINE DEALLOCATE_MODEL1 (KCALL) +! +INTEGER, INTENT(IN) :: KCALL +! +END SUBROUTINE DEALLOCATE_MODEL1 +! +END INTERFACE +! +END MODULE MODI_DEALLOCATE_MODEL1 +! +! +! #################################### + SUBROUTINE DEALLOCATE_MODEL1 (KCALL) +! #################################### +! +!!**** *DEALLOCATE_MODEL1* - deallocate all model1 fields +!! +!! PURPOSE +!! ------- +! deallocate all model #1 fields in order to spare memory in spawning +! +!!** METHOD +!! ------ +!! +!! KCALL = 1 --> deallocates all SOURCES, LES, FORCING and SOLVER variables +!! +!! KCALL = 2 --> deallocates all METRIC, RADIATION and CORIOLIS variables +!! +!! KCALL = 3 --> deallocates all other variables of model1 +!! +!! KCALL = 4 --> deallocates all variables common to ALL models +!! +!! 1 + 2 --> all variables used in spawning +!! 1 + 2 + 3 + 4 --> in diag after a file has been treated +!! +!! EXTERNAL +!! -------- +!! +!! REFERENCE +!! --------- +!! +!! +!! AUTHOR +!! ------ +!! V. Masson * Meteo France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 08/12/97 +!! +!! 20/05/98 use the LB fields +!! 15/03/99 new PGD fields +!! 08/03/01 D.Gazen add chemical emission field +!! 01/2004 V. Masson surface externalization +!! 06/2012 M.Tomasini add 2D nesting ADVFRC +!! 10/2016 M.Mazoyer New KHKO output fields +! P. Wautelet 05/2016-04/2018: new data structures and calls for I/O +! C. Lac 02/2019: add rain fraction as an output field +! P. Wautelet 07/06/2019: bugfix: deallocate XLSRVM only if allocated +! S. Riette 04/2020: XHL* fields +! A. Costes 12:2021: Blaze Fire model variables +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +USE MODD_REF +! +USE MODD_METRICS_n +USE MODD_FIELD_n +USE MODD_DUMMY_GR_FIELD_n +USE MODD_LSFIELD_n +USE MODD_GRID_n +USE MODD_REF_n +USE MODD_CURVCOR_n +USE MODD_DYN_n +USE MODD_DEEP_CONVECTION_n +USE MODD_RADIATIONS_n +USE MODD_FRC +USE MODD_PRECIP_n +USE MODD_ELEC_n +USE MODD_PASPOL_n +USE MODD_RAIN_ICE_PARAM_n +USE MODD_RAIN_ICE_DESCR_n +USE MODD_PARAM_n , ONLY : CCLOUD +USE MODE_MODELN_HANDLER +! +! Modif 2D +USE MODD_LATZ_EDFLX ! For ADVFRC and EDDY FLUXES +USE MODD_DEF_EDDY_FLUX_n ! For EDDY FLUXES +USE MODD_DEF_EDDYUV_FLUX_n ! For EDDY FLUXES +! +USE MODD_2D_FRC +USE MODD_ADVFRC_n ! For ADVFRC and EDDY FLUXES +USE MODD_RELFRC_n +USE MODD_ADV_n +USE MODD_PAST_FIELD_n +USE MODD_TURB_n +USE MODD_PARAM_C2R2, ONLY :LSUPSAT +! +IMPLICIT NONE +! +!* 0.1 declarations of arguments +! +INTEGER, INTENT(IN) :: KCALL ! number of times this routine has been called +INTEGER :: IMI ! Current Model index +! +!* 0.2 declarations of local variables +! +!------------------------------------------------------------------------------- +! +! Save current Model index and switch to model 1 variables +IMI = GET_CURRENT_MODEL_INDEX() +CALL GOTO_MODEL(1) +!* 1. Module MODD_FIELD$n +! +IF ( KCALL==3 ) THEN + IF (CUVW_ADV_SCHEME(1:3)=='CEN'.AND. CTEMP_SCHEME=='LEFR') THEN + DEALLOCATE(XUM) + DEALLOCATE(XVM) + DEALLOCATE(XWM) + DEALLOCATE(XDUM) + DEALLOCATE(XDVM) + DEALLOCATE(XDWM) + END IF + DEALLOCATE(XUT) + DEALLOCATE(XVT) + DEALLOCATE(XWT) + DEALLOCATE(XTHT) + IF (L2D_ADV_FRC) THEN + IF (ASSOCIATED(XDTHFRC)) DEALLOCATE(XDTHFRC) + IF (ASSOCIATED(XDRVFRC)) DEALLOCATE(XDRVFRC) + IF (ASSOCIATED(TDTADVFRC)) DEALLOCATE(TDTADVFRC) + END IF + IF (L2D_REL_FRC) THEN + IF (ASSOCIATED(XTHREL)) DEALLOCATE(XTHREL) + IF (ASSOCIATED(XRVREL)) DEALLOCATE(XRVREL) + IF (ASSOCIATED(TDTRELFRC)) DEALLOCATE(TDTRELFRC) + END IF + ! DEALLOCATE EDDY FLUXES + IF (LTH_FLX) THEN + DEALLOCATE(XVTH_FLUX_M) + DEALLOCATE(XWTH_FLUX_M) + END IF + IF (LUV_FLX) THEN + DEALLOCATE(XVU_FLUX_M) + END IF +END IF +IF ( KCALL==1 ) THEN + DEALLOCATE(XRUS) + DEALLOCATE(XRVS) + DEALLOCATE(XRWS) + DEALLOCATE(XRTHS) + DEALLOCATE(XRUS_PRES, XRVS_PRES, XRWS_PRES ) + DEALLOCATE(XRTHS_CLD ) +END IF +! +IF ( KCALL==3 ) THEN + IF (ASSOCIATED(XTKET)) DEALLOCATE(XTKET) +END IF +IF ( ASSOCIATED(XRTKES) .AND. KCALL==1 ) THEN + DEALLOCATE(XRTKES) +END IF +! +IF ( KCALL==3 ) THEN + DEALLOCATE(XPABST) +! + DEALLOCATE(XRT) +END IF +! +IF ( KCALL==1 ) THEN + DEALLOCATE(XRRS) + DEALLOCATE(XRRS_CLD) +END IF +! +IF ( ASSOCIATED(XSRCT) .AND. KCALL==3 ) THEN + DEALLOCATE(XSRCT) + DEALLOCATE(XSIGS) +END IF +! +IF ( ASSOCIATED(XHLC_HRC) .AND. KCALL==3 ) THEN + DEALLOCATE(XHLC_HRC) + DEALLOCATE(XHLC_HCF) + DEALLOCATE(XHLI_HRI) + DEALLOCATE(XHLI_HCF) +END IF +! +IF ( ASSOCIATED(XCLDFR) .AND. KCALL==2 ) THEN + DEALLOCATE(XCLDFR) +END IF +! +IF ( ASSOCIATED(XICEFR) .AND. KCALL==2 ) THEN + DEALLOCATE(XICEFR) +END IF +! +IF ( ASSOCIATED(XRAINFR) .AND. KCALL==2 ) THEN + DEALLOCATE(XRAINFR) +END IF +! +IF ( KCALL == 3 ) THEN + DEALLOCATE(XSVT) +END IF +IF ( KCALL == 1 ) THEN + DEALLOCATE(XRSVS) + DEALLOCATE(XRSVS_CLD) +END IF +! +IF ((CCLOUD == 'KHKO') .AND. LSUPSAT) THEN + DEALLOCATE(XSUPSAT) + DEALLOCATE(XNACT) + DEALLOCATE(XNPRO) + DEALLOCATE(XSSPRO) +END IF +! +IF (ASSOCIATED(XDUMMY_GR_FIELDS) .AND. KCALL==3 ) THEN + DEALLOCATE(XDUMMY_GR_FIELDS) +END IF + +IF (ASSOCIATED(XLSPHI)) THEN + DEALLOCATE(XLSPHI) +END IF + +IF (ASSOCIATED(XBMAP)) THEN + DEALLOCATE(XBMAP) +END IF + +IF (ASSOCIATED(XFMRFA)) THEN + DEALLOCATE(XFMRFA) +END IF + +IF (ASSOCIATED(XFMWF0)) THEN + DEALLOCATE(XFMWF0) +END IF + +IF (ASSOCIATED(XFMR0)) THEN + DEALLOCATE(XFMR0) +END IF + +IF (ASSOCIATED(XFMR00)) THEN + DEALLOCATE(XFMR00) +END IF + +IF (ASSOCIATED(XFMIGNITION)) THEN + DEALLOCATE(XFMIGNITION) +END IF + +IF (ASSOCIATED(XFMFUELTYPE)) THEN + DEALLOCATE(XFMFUELTYPE) +END IF + +IF (ASSOCIATED(XFIRETAU)) THEN + DEALLOCATE(XFIRETAU) +END IF + +IF (ASSOCIATED(XFLUXPARAMH)) THEN + DEALLOCATE(XFLUXPARAMH) +END IF + +IF (ASSOCIATED(XFLUXPARAMW)) THEN + DEALLOCATE(XFLUXPARAMW) +END IF + +IF (ASSOCIATED(XFIRERW)) THEN + DEALLOCATE(XFIRERW) +END IF + +IF (ASSOCIATED(XFMASE)) THEN + DEALLOCATE(XFMASE) +END IF + +IF (ASSOCIATED(XFMAWC)) THEN + DEALLOCATE(XFMAWC) +END IF + +IF (ASSOCIATED(XFMWALKIG)) THEN + DEALLOCATE(XFMWALKIG) +END IF + +IF (ASSOCIATED(XFMFLUXHDH)) THEN + DEALLOCATE(XFMFLUXHDH) +END IF + +IF (ASSOCIATED(XFMFLUXHDW)) THEN + DEALLOCATE(XFMFLUXHDW) +END IF + +IF (ASSOCIATED(XFMHWS)) THEN + DEALLOCATE(XFMHWS) +END IF + +IF (ASSOCIATED(XFMWINDU)) THEN + DEALLOCATE(XFMWINDU) +END IF + +IF (ASSOCIATED(XFMWINDV)) THEN + DEALLOCATE(XFMWINDV) +END IF + +IF (ASSOCIATED(XFMWINDW)) THEN + DEALLOCATE(XFMWINDW) +END IF + +IF (ASSOCIATED(XFMGRADOROX)) THEN + DEALLOCATE(XFMGRADOROX) +END IF + +IF (ASSOCIATED(XFMGRADOROY)) THEN + DEALLOCATE(XFMGRADOROY) +END IF + +IF (ASSOCIATED(XGRADLSPHIX)) THEN + DEALLOCATE(XGRADLSPHIX) +END IF + +IF (ASSOCIATED(XGRADLSPHIY)) THEN + DEALLOCATE(XGRADLSPHIY) +END IF + +IF (ASSOCIATED(XFIREWIND)) THEN + DEALLOCATE(XFIREWIND) +END IF + +IF (ASSOCIATED(XLSPHI2D)) THEN + DEALLOCATE(XLSPHI2D) +END IF + +IF (ASSOCIATED(XGRADLSPHIX2D)) THEN + DEALLOCATE(XGRADLSPHIX2D) +END IF + +IF (ASSOCIATED(XGRADLSPHIY2D)) THEN + DEALLOCATE(XGRADLSPHIY2D) +END IF + +IF (ASSOCIATED(XGRADMASKX)) THEN + DEALLOCATE(XGRADMASKX) +END IF + +IF (ASSOCIATED(XGRADMASKY)) THEN + DEALLOCATE(XGRADMASKY) +END IF + +IF (ASSOCIATED(XSURFRATIO2D)) THEN + DEALLOCATE(XSURFRATIO2D) +END IF + +IF (ASSOCIATED(XLSDIFFUX2D)) THEN + DEALLOCATE(XLSDIFFUX2D) +END IF + +IF (ASSOCIATED(XLSDIFFUY2D)) THEN + DEALLOCATE(XLSDIFFUY2D) +END IF + +IF (ASSOCIATED(XFIRERW2D)) THEN + DEALLOCATE(XFIRERW2D) +END IF +! +!* 3. Module MODD_GRID$n +! +IF ( ASSOCIATED(XLON) .AND. KCALL == 3 ) THEN + DEALLOCATE(XLON) + DEALLOCATE(XLAT) + DEALLOCATE(XMAP) +END IF +! +IF ( KCALL == 3 ) THEN + !Philippe W.: do not deallocate XXHAT, XYHAT and XZHAT because they are needed later on + !As they are 1D, their memory footprint is negligible + ! DEALLOCATE(XXHAT) + DEALLOCATE(XDXHAT) + ! DEALLOCATE(XYHAT) + DEALLOCATE(XDYHAT) + DEALLOCATE(XZS) + DEALLOCATE(XZSMT) + DEALLOCATE(XZZ) + ! DEALLOCATE(XZHAT) +END IF +! +IF ( KCALL == 2 ) THEN + DEALLOCATE(XDIRCOSZW) + DEALLOCATE(XDIRCOSXW) + DEALLOCATE(XDIRCOSYW) + DEALLOCATE(XCOSSLOPE) + DEALLOCATE(XSINSLOPE) +END IF + +IF ( KCALL == 2 ) THEN + DEALLOCATE(XDXX) + DEALLOCATE(XDYY) + DEALLOCATE(XDZX) + DEALLOCATE(XDZY) + DEALLOCATE(XDZZ) +END IF +! +!* 4. Modules MODD_REF and MODD_REF$n +! +IF ( KCALL == 4 ) THEN + DEALLOCATE(XRHODREFZ) + DEALLOCATE(XTHVREFZ) +END IF +! +IF ( KCALL == 3 ) THEN + DEALLOCATE(XRHODREF) + DEALLOCATE(XTHVREF) + DEALLOCATE(XEXNREF) + DEALLOCATE(XRHODJ) + IF ( ASSOCIATED(XRVREF) ) THEN + DEALLOCATE(XRVREF) + END IF +END IF +! +!* 5. Module MODD_CURVCOR$n +! +IF ( ASSOCIATED(XCORIOX) .AND. KCALL == 2 ) THEN + DEALLOCATE(XCORIOX) + DEALLOCATE(XCORIOY) +END IF +IF ( KCALL == 2 ) THEN + DEALLOCATE(XCORIOZ) +END IF +IF ( ASSOCIATED(XCURVX) .AND. KCALL == 2) THEN + DEALLOCATE(XCURVX) + DEALLOCATE(XCURVY) +END IF +! +!* 6. Module MODD_DYN$n +! +IF ( KCALL == 1 ) THEN + DEALLOCATE(XBFY) + DEALLOCATE(XAF,XCF) + DEALLOCATE(XTRIGSX) + DEALLOCATE(XTRIGSY) + DEALLOCATE(XRHOM) + DEALLOCATE(XALK) + DEALLOCATE(XALKW) + DEALLOCATE(XALKBAS) + DEALLOCATE(XALKWBAS) + IF ( ASSOCIATED(XKURELAX) ) THEN + DEALLOCATE(XKURELAX) + DEALLOCATE(XKVRELAX) + DEALLOCATE(XKWRELAX) + DEALLOCATE(LMASK_RELAX) + END IF +END IF +! +!* 7. Larger Scale variables (Module MODD_LSFIELD$n) +! +IF ( KCALL == 3 ) THEN + DEALLOCATE(XLSUM) + DEALLOCATE(XLSVM) + DEALLOCATE(XLSWM) + DEALLOCATE(XLSTHM) + IF(ASSOCIATED(XLSRVM)) DEALLOCATE(XLSRVM) + IF (ASSOCIATED(XLBXUM)) THEN + DEALLOCATE(XLBXUM) + DEALLOCATE(XLBYUM) + DEALLOCATE(XLBXVM) + DEALLOCATE(XLBYVM) + DEALLOCATE(XLBXWM) + DEALLOCATE(XLBYWM) + DEALLOCATE(XLBXTHM) + DEALLOCATE(XLBYTHM) + END IF + IF (ASSOCIATED(XLBXTKEM)) THEN + DEALLOCATE(XLBXTKEM) + DEALLOCATE(XLBYTKEM) + END IF + IF (ASSOCIATED(XLBXRM)) THEN + DEALLOCATE(XLBXRM) + DEALLOCATE(XLBYRM) + END IF + IF (ASSOCIATED(XLBXSVM)) THEN + DEALLOCATE(XLBXSVM) + DEALLOCATE(XLBYSVM) + END IF +END IF +! + ! steady LS fields only for model 1 or independent models +! +IF( ASSOCIATED(XLSUS) .AND. KCALL == 3 ) THEN + DEALLOCATE(XLSUS) + DEALLOCATE(XLSVS) + DEALLOCATE(XLSWS) + DEALLOCATE(XLSTHS) + IF(ASSOCIATED(XLSRVS)) DEALLOCATE(XLSRVS) +! + IF ( ASSOCIATED(XLBXUS) ) THEN + DEALLOCATE(XLBXUS) + DEALLOCATE(XLBYUS) + DEALLOCATE(XLBXVS) + DEALLOCATE(XLBYVS) + DEALLOCATE(XLBXWS) + DEALLOCATE(XLBYWS) + DEALLOCATE(XLBXTHS) + DEALLOCATE(XLBYTHS) + END IF + IF ( ASSOCIATED(XLBXTKES) ) THEN + DEALLOCATE(XLBXTKES) + DEALLOCATE(XLBYTKES) + END IF +! + IF ( ASSOCIATED(XLBXRS) ) THEN + DEALLOCATE(XLBXRS) + DEALLOCATE(XLBYRS) + END IF +! + IF ( ASSOCIATED(XLBXSVS) ) THEN + DEALLOCATE(XLBXSVS) + DEALLOCATE(XLBYSVS) + END IF +! + IF ( ASSOCIATED(XCOEFLIN_LBXM) ) THEN + DEALLOCATE(XCOEFLIN_LBXM) + DEALLOCATE(NKLIN_LBXM) + END IF + + IF ( ASSOCIATED(XCOEFLIN_LBYM) ) THEN + DEALLOCATE(XCOEFLIN_LBYM) + DEALLOCATE(NKLIN_LBYM) + END IF + + IF ( ASSOCIATED(XCOEFLIN_LBXU) ) THEN + DEALLOCATE(XCOEFLIN_LBXU) + DEALLOCATE(NKLIN_LBXU) + DEALLOCATE(XCOEFLIN_LBYU) + DEALLOCATE(NKLIN_LBYU) + DEALLOCATE(XCOEFLIN_LBXV) + DEALLOCATE(NKLIN_LBXV) + DEALLOCATE(XCOEFLIN_LBYV) + DEALLOCATE(NKLIN_LBYV) + DEALLOCATE(XCOEFLIN_LBXW) + DEALLOCATE(NKLIN_LBXW) + DEALLOCATE(XCOEFLIN_LBYW) + DEALLOCATE(NKLIN_LBYW) + END IF +END IF +! +!* 8. L.E.S. variables +! + +! +!* 9. Module MODD_RADIATIONS$n +! +! +IF ( ASSOCIATED(XSLOPANG) .AND. KCALL == 2 ) THEN + DEALLOCATE(XSLOPANG) + DEALLOCATE(XSLOPAZI) + DEALLOCATE(XDTHRAD) + DEALLOCATE(XFLALWD) + DEALLOCATE(XDIRFLASWD) + DEALLOCATE(XSCAFLASWD) + DEALLOCATE(XDIRSRFSWD) + DEALLOCATE(XSWU) + DEALLOCATE(XSWD) + DEALLOCATE(XLWU) + DEALLOCATE(XLWD) + DEALLOCATE(XDTHRADSW) + DEALLOCATE(XDTHRADLW) + DEALLOCATE(XRADEFF) + DEALLOCATE(NCLEARCOL_TM1) +END IF +IF (ASSOCIATED(XSTATM)) DEALLOCATE(XSTATM) +! +!* 10. Module MODD_DEEP_CONVECTION$n +! +IF ( ASSOCIATED(XDTHCONV) .AND. KCALL == 2 ) THEN + DEALLOCATE(NCOUNTCONV) + DEALLOCATE(XDTHCONV) + DEALLOCATE(XDRVCONV) + DEALLOCATE(XDRCCONV) + DEALLOCATE(XDRICONV) +END IF +! +IF ( ASSOCIATED(XPRCONV) .AND. KCALL == 2 ) THEN + DEALLOCATE(XPRCONV) + DEALLOCATE(XPACCONV) +END IF +IF ( ASSOCIATED(XPRSCONV) .AND. KCALL == 2 ) THEN + DEALLOCATE(XPRSCONV) +END IF +! +IF ( ASSOCIATED(XDSVCONV) .AND. KCALL == 2 ) THEN + DEALLOCATE(XDSVCONV) +END IF +! +!* 11. Forcing variables (Module MODD_FRC) +! +IF ( ALLOCATED(XUFRC) .AND. KCALL == 4 ) THEN + DEALLOCATE(TDTFRC) + DEALLOCATE(XUFRC) + DEALLOCATE(XVFRC) + DEALLOCATE(XWFRC) + DEALLOCATE(XTHFRC) + DEALLOCATE(XRVFRC) + DEALLOCATE(XTENDTHFRC) + DEALLOCATE(XTENDRVFRC) + DEALLOCATE(XGXTHFRC) + DEALLOCATE(XGYTHFRC) + DEALLOCATE(XPGROUNDFRC) +END IF +! +!* 12. Module MODD_ICE_CONC$n +! +IF ( ASSOCIATED(XCIT) .AND. KCALL == 2 ) THEN + DEALLOCATE(XCIT) +END IF +! +!* 13. Module MODD_PRECIP$n +! +IF ( ASSOCIATED(XINPRC) .AND. KCALL == 3 ) THEN + DEALLOCATE(XINPRC) + DEALLOCATE(XACPRC) +END IF +! +IF ( ASSOCIATED(XINPRR) .AND. KCALL == 3 ) THEN + DEALLOCATE(XINPRR) + DEALLOCATE(XACPRR) +END IF +! +IF ( ASSOCIATED(XINPRR3D) .AND. KCALL == 3 ) THEN + DEALLOCATE(XINPRR3D) + DEALLOCATE(XEVAP3D) +END IF +! +IF ( ASSOCIATED(XINPRS) .AND. KCALL == 3 ) THEN + DEALLOCATE(XINPRS) + DEALLOCATE(XACPRS) + DEALLOCATE(XINPRG) + DEALLOCATE(XACPRG) +END IF +! +IF ( ASSOCIATED(XINPRH) .AND. KCALL == 3 ) THEN + DEALLOCATE(XINPRH) + DEALLOCATE(XACPRH) +END IF +! +!* 13b. Module MODD_ELEC$n +! +IF ( ASSOCIATED(XNI_SDRYG) .AND. KCALL == 3 ) THEN + DEALLOCATE(XNI_SDRYG) + DEALLOCATE(XNI_IDRYG) + DEALLOCATE(XNI_IAGGS) + DEALLOCATE(XEW) + DEALLOCATE(XIND_RATE) +END IF +! +IF ( ASSOCIATED(XEFIELDU) .AND. KCALL == 3 ) THEN + DEALLOCATE(XEFIELDU) + DEALLOCATE(XEFIELDV) + DEALLOCATE(XEFIELDW) + DEALLOCATE(XESOURCEFW) + DEALLOCATE(XIONSOURCEFW) + DEALLOCATE(XCION_POS_FW) + DEALLOCATE(XCION_NEG_FW) + DEALLOCATE(XMOBIL_POS) + DEALLOCATE(XMOBIL_NEG) +END IF +! +IF ( ASSOCIATED(XRHOM_E) .AND. KCALL == 3 ) THEN + DEALLOCATE (XRHOM_E) + DEALLOCATE (XAF_E) + DEALLOCATE (XCF_E) + DEALLOCATE (XBFY_E) +END IF +! +!* 14. Modules RAIN_ICE_DESCR and MODD_RAIN_ICE_PARAM +! +IF ( ASSOCIATED(XRTMIN) .AND. KCALL == 4 ) THEN + CALL RAIN_ICE_DESCR_DEALLOCATE() + CALL RAIN_ICE_PARAM_DEALLOCATE() +END IF +! +!* 15. Module PASPOLn +! +IF ( ASSOCIATED(XATC) .AND. KCALL == 3 ) THEN + DEALLOCATE(XATC) +END IF +! +!* 16. Module TURBn +! +IF ( KCALL==3 ) THEN + IF (ASSOCIATED(XDYP)) DEALLOCATE(XDYP) + IF (ASSOCIATED(XTHP)) DEALLOCATE(XTHP) + IF (ASSOCIATED(XTR)) DEALLOCATE(XTR) + IF (ASSOCIATED(XDISS)) DEALLOCATE(XDISS) + IF (ASSOCIATED(XLEM)) DEALLOCATE(XLEM) +END IF +!------------------------------------------------------------------------------- +! +CALL GOTO_MODEL(IMI) +! +END SUBROUTINE DEALLOCATE_MODEL1 diff --git a/src/mesonh/ext/default_desfmn.f90 b/src/mesonh/ext/default_desfmn.f90 new file mode 100644 index 0000000000000000000000000000000000000000..59cc7e101c4189e55bcd035e1c39c0cfe69dd5cf --- /dev/null +++ b/src/mesonh/ext/default_desfmn.f90 @@ -0,0 +1,1407 @@ +!MNH_LIC Copyright 1994-2021 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_DEFAULT_DESFM_n +! ########################### +! +INTERFACE +! +SUBROUTINE DEFAULT_DESFM_n(KMI) +INTEGER, INTENT(IN) :: KMI ! Model index +END SUBROUTINE DEFAULT_DESFM_n +! +END INTERFACE +! +END MODULE MODI_DEFAULT_DESFM_n +! +! +! +! ############################### + SUBROUTINE DEFAULT_DESFM_n(KMI) +! ############################### +! +!!**** *DEFAULT_DESFM_n * - set default values for descriptive variables of +!! model KMI +!! +!! PURPOSE +!! ------- +! The purpose of this routine is to set default values for the variables +! in descriptor files by filling the corresponding variables which +! are stored in modules. +! +! +!!** METHOD +!! ------ +!! Each variable in modules, which can be initialized by reading its +!! value in the descriptor file is set to a default value. +!! When this routine is used during INIT, the modules of the first model +!! are used to temporarily store the variables associated with a nested +!! model. +!! When this routine is used during SPAWNING, the modules of a second +!! model must be initialized. +!! Default values for variables common to all models are set only +!! at the first call of DEFAULT_DESFM_n (i.e. when KMI=1) +!! +!! +!! EXTERNAL +!! -------- +!! NONE +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODD_PARAMETERS : JPHEXT,JPVEXT +!! +!! Module MODD_CONF : CCONF,L2D,L1D,LFLAT,NMODEL,NVERB +!! +!! Module MODD_DYN : XSEGLEN,XASSELIN,LCORIO,LNUMDIFF +!! XALKTOP,XALZBOT +!! +!! Module MODD_BAKOUT +!! +!! Module MODD_NESTING : NDAD(m),NDTRATIO(m),XWAY(m) +!! +!! Module MODD_CONF_n : LUSERV,LUSERC,LUSERR,LUSERI,LUSERS +!! LUSERG,LUSERH,CSEG,CEXP +!! +!! Module MODD_LUNIT_n : CINIFILE,CCPLFILE +!! +!! +!! Module MODD_DYN_n : XTSTEP,CPRESOPT,NITR,XRELAX,LHO_RELAX +!! LVE_RELAX,XRIMKMAX,NRIMX,NRIMY +!! +!! Module MODD_ADV_n : CUVW_ADV_SCHEME,CMET_ADV_SCHEME,CSV_ADV_SCHEME,NLITER +!! +!! Module MODD_PARAM_n : CTURB,CRAD,CDCONV,CSCONV +!! +!! Module MODD_LBC_n : CLBCX, CLBCY,NLBLX,NLBLY,XCPHASE,XCPHASE_PBL,XPOND +!! +!! Module MODD_TURB_n : XIMPL,CTURBLEN,CTURBDIM,LTURB_FLX,LTURB_DIAG,LSUBG_COND +!! LTGT_FLX +!! +!! +!! Module MODD_PARAM_RAD_n: +!! XDTRAD,XDTRAD_CLONLY,LCLEAR_SKY,NRAD_COLNBR, NRAD_DIAG +!! +!! Module MODD_BUDGET : CBUTYPE,NBUMOD,XBULEN,NBUKL, NBUKH,LBU_KCP,XBUWRI +!! NBUIL, NBUIH,NBUJL, NBUJH,LBU_ICP,LBU_JCP,NBUMASK +!! +!! Module MODD_BLANK_n: +!! +!! XDUMMYi, NDUMMYi, LDUMMYi, CDUMMYi +!! +!! Module MODD_FRC : +!! +!! LGEOST_UV_FRC,LGEOST_TH_FRC,LTEND_THRV_FRC +!! LVERT_MOTION_FRC,LRELAX_THRV_FRC,LRELAX_UV_FRC,LRELAX_UVMEAN_FRC, +!! XRELAX_TIME_FRC +!! XRELAX_HEIGHT_FRC,CRELAX_HEIGHT_TYPE,LTRANS,XUTRANS,XVTRANS, +!! LPGROUND_FRC +!! +!! Module MODD_PARAM_ICE : +!! +!! LWARM,CPRISTINE_ICE +!! +!! Module MODD_PARAM_KAFR_n : +!! +!! XDTCONV,LREFRESH_ALL,LDOWN,NICE,LCHTRANS +!! +!! Module MODD_PARAM_MFSHALL_n : +!! +!! CMF_UPDRAFT,LMIXUV,CMF_CLOUD,XIMPL_MF,LMF_FLX +!! +!! +!! +!! +!! REFERENCE +!! --------- +!! Book2 of the documentation (routine DEFAULT_DESFM_n) +!! +!! +!! AUTHOR +!! ------ +!! V. Ducrocq * Meteo France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 02/06/94 +!! Modifications 17/10/94 (Stein) For LCORIO +!! Modifications 06/12/94 (Stein) remove LBOUSS+add LABSLAYER, LNUMDIFF +!! ,LSTEADYLS +!! Modifications 06/12/94 (Stein) remove LABSLAYER, add LHO_RELAX, +!! LVE_RELAX, NRIMX, NRIMY, XRIMKMAX +!! Modifications 09/01/95 (Lafore) add LSTEADY_DMASS +!! Modifications 09/01/95 (Stein) add the turbulence scheme namelist +!! Modifications 09/01/95 (Stein) add the 1D switch +!! Modifications 10/03/95 (Mallet) add the coupling files +!! 29/06/95 ( Stein, Nicolau, Hereil) add the budgets +!! Modifications 25/09/95 ( Stein )add the LES tools +!! Modifications 25/10/95 ( Stein )add the radiations +!! Modifications 23/10/95 (Vila, lafore) new scalar advection scheme +!! Modifications 24/02/96 (Stein) change the default value for CCPLFILE +!! Modifications 12/02/96 (Lafore) transformation to DEFAULT_DESFM_n for +!! spawning +!! Modifications 25/04/96 (Suhre) add the blank module +!! Modifications 29/07/96 (Pinty&Suhre) add module MODD_FRC +!! Modifications 11/04/96 (Pinty) add the rain-ice scheme and modify +!! the split arrays in MODD_PARAM_RAD_n +!! Modifications 11/01/97 (Pinty) add the deep convection scheme +!! Modifications 24/11/96 (Masson) add LREFRESH_ALL in deep convection +!! Modifications 12/02/96 (Lafore) transformation to DEFAULT_DESFM_n for spawning +!! Modifications 22/07/96 (Lafore) gridnesting implementation +!! Modifications 29/07/96 (Lafore) add the module MODD_FMOUT (renamed MODD_BAKOUT) +!! Modifications 23/06/97 (Stein) add the equation system name +!! Modifications 10/07/97 (Masson) add MODD_PARAM_GROUNDn : CROUGH +!! Modifications 28/07/97 (Masson) remove LREFRESH_ALL and LSTEADY_DMASS +!! Modifications 08/10/97 (Stein) switch (_n=1) to initialize the +!! parameters common to all models +!! Modifications 24/01/98 (Bechtold) add LREFRESH_ALL, LCHTRANS, +!! LTEND_THRV_FR and LSST_FRC +!! Modifications 18/07/99 (Stein) add LRAD_DIAG +!! Modification 15/03/99 (Masson) use of XUNDEF +!! Modification 11/12/00 (Tomasini) Add CSEA_FLUX to MODD_PARAMn +!! Modification 22/01/01 (Gazen) delete NSV and add LHORELAX_SVC2R2 +!! LHORELAX_SVCHEM,LHORELAX_SVLG +!! Modification 15/03/02 (Solmon) radiation scheme: remove NSPOT and add +!! default for aerosol and cloud rad. prop. control +!! Modification 22/05/02 (Jabouille) put chimical default here +!! Modification 01/2004 (Masson) removes surface (externalization) +!! 09/04 (M. Tomasini) New namelist to modify the +!! Cloud mixing length +!! 07/05 (P.Tulet) New namelists for dust and aerosol +!! Modification 01/2007 (Malardel, Pergaud) Add MODD_PARAM_MFSHALL_n +!! Modification 10/2009 (Aumond) Add user multimasks for LES +!! Modification 10/2009 (Aumond) Add MEAN_FIELD +!! Modification 12/04/07 (Leriche) add LUSECHAQ for aqueous chemistry +!! Modification 30/05/07 (Leriche) add LCH_PH and XCH_PHINIT for pH +!! Modification 25/04/08 (Leriche) add XRTMIN_AQ LWC threshold for aq. chemistry +!! 16/07/10 add LHORELAX_SVIC +!! 16/09/10 add LUSECHIC +!! 13/01/11 add LCH_RET_ICE +!! 01/07/11 (F.Couvreux) Add CONDSAMP +!! 01/07/11 (B.Aouizerats) Add CAOP +!! 07/2013 (C.Lac) add WENO, LCHECK +!! 07/2013 (Bosseur & Filippi) adds Forefire +!! 08/2015 (Redelsperger & Pianezze) add XPOND coefficient for LBC +!! Modification 24/03/16 (Leriche) remove LCH_SURFACE_FLUX +!! put NCH_VEC_LENGTH = 50 instead of 1000 +!! +!! 04/2016 (C.LAC) negative contribution to the budget split between advection, turbulence and microphysics for KHKO/C2R2 +!! Modification 01/2016 (JP Pinty) Add LIMA +!! Modification 24/03/16 (Leriche) remove LCH_SURFACE_FLUX +!! put NCH_VEC_LENGTH = 50 instead of 1000 +!! 10/2016 (C.Lac) VSIGQSAT change from 0 to 0.02 for coherence with AROME +!! 10/2016 (C.Lac) Add droplet deposition +!! 10/2016 (R.Honnert and S.Riette) : Improvement of EDKF and adaptation to the grey zone +!! 10/2016 (F Brosse) add prod/loss terms computation for chemistry +!! 07/2017 (V. Masson) adds time step for output files writing. +!! 09/2017 Q.Rodier add LTEND_UV_FRC +!! 02/2018 Q.Libois ECRAD +! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +!! 01/2018 (S. Riette) new budgets and variables for ICE3/ICE4 +!! 01/2018 (J.Colin) add VISC and DRAG +!! 07/2017 (V. Vionnet) add blowing snow variables +!! 01/2019 (R. Honnert) add reduction of the mass-flux surface closure with the resolution +!! Bielli S. 02/2019 Sea salt : significant sea wave height influences salt emission; 5 salt modes +!! 05/2019 F.Brient add tracer emission from the top of the boundary-layer +!! 11/2019 C.Lac correction in the drag formula and application to building in addition to tree +! P. Wautelet 17/04/2020: move budgets switch values into modd_budget +! P. Wautelet 30/06/2020: add NNETURSV, NNEADVSV and NNECONSV variables +! F. Auguste, T. Nagel 02/2021: add IBM defaults parameters +! T. Nagel 02/2021: add turbulence recycling defaults parameters +! P-A Joulin 21/05/2021: add Wind turbines +! S. Riette 21/05/2021: add options to PDF subgrid scheme +! D. Ricard 05/2021: add the contribution of Leonard terms in the turbulence scheme +! JL Redelsperger 06/2021: add parameters allowing to active idealized oceanic convection +! B. Vie 06/2021: add prognostic supersaturation for LIMA +! Q. Rodier 06/2021: modify default value to LGZ=F (grey-zone corr.), LSEDI and OSEDC=T (LIMA sedimentation) +! F. Couvreux 06/2021: add LRELAX_UVMEAN_FRC +! Q. Rodier 07/2021: modify XPOND=1 +! A. Costes 12/2021: Blaze fire model +! C. Barthe 03/2022: add CIBU and RDSF options in LIMA +! Delbeke/Vie 03/2022 : KHKO option in LIMA +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +USE MODD_PARAMETERS +USE MODD_LUNIT_n, ONLY: TLUOUT +USE MODD_CONF ! For INIT only DEFAULT_DESFM1 +USE MODD_CONFZ +USE MODD_DYN +USE MODD_NESTING +USE MODD_BAKOUT +USE MODD_SERIES +USE MODD_CONF_n ! modules used to set the default values is only +USE MODD_LUNIT_n ! the one corresponding to model 1. These memory +USE MODD_DIM_n ! addresses will then be filled by the values read in +USE MODD_DYN_n ! the DESFM corresponding to model n which may have +USE MODD_ADV_n ! missing values. This is why we affect default values. +USE MODD_PARAM_n ! For SPAWNING DEFAULT_DESFM2 is also used +USE MODD_LBC_n +USE MODD_OUT_n +USE MODD_TURB_n, ONLY: TURBN_INIT +USE MODD_NEB_n, ONLY: NEBN_INIT +USE MODD_BUDGET +USE MODD_LES +USE MODD_PARAM_RAD_n +#ifdef MNH_ECRAD +USE MODD_PARAM_ECRAD_n +#if ( VER_ECRAD == 140 ) +USE MODD_RADIATIONS_n , ONLY : NSWB_MNH, NLWB_MNH +#endif +#endif +USE MODD_BLANK_n +USE MODD_FRC +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICEN_INIT +USE MODD_PARAM_C2R2 +USE MODD_TURB_CLOUD +USE MODD_PARAM_KAFR_n +USE MODD_PARAM_MFSHALL_n, ONLY: PARAM_MFSHALLN_INIT +USE MODD_CH_MNHC_n +USE MODD_SERIES_n +USE MODD_NUDGING_n +USE MODD_CH_AEROSOL +USE MODD_DUST +USE MODD_SALT +USE MODD_PASPOL +USE MODD_CONDSAMP +USE MODD_MEAN_FIELD +USE MODD_DRAGTREE_n +USE MODD_DRAGBLDG_n +USE MODD_EOL_MAIN +USE MODD_EOL_ADNR +USE MODD_EOL_ALM +USE MODD_EOL_SHARED_IO +USE MODD_ALLSTATION_n +! +! +USE MODD_PARAM_LIMA, ONLY : LCOLD, LNUCL, LSEDI, LHHONI, LSNOW, LHAIL, LMEYERS, & + NMOM_I, NMOM_S, NMOM_G, NMOM_H, & + NMOD_IFN, XIFN_CONC, LIFN_HOM, CIFN_SPECIES, & + CINT_MIXING, NMOD_IMM, NIND_SPECIE, LMURAKAMI, & + YSNOW_T=>LSNOW_T, CPRISTINE_ICE_LIMA, CHEVRIMED_ICE_LIMA, & + XFACTNUC_DEP, XFACTNUC_CON, & + OWARM=>LWARM, LACTI, ORAIN=>LRAIN, OSEDC=>LSEDC, & + OACTIT=>LACTIT, LBOUND, LSPRO, LADJ, LKHKO, NMOM_C, NMOM_R, & + NMOD_CCN, XCCN_CONC, LKESSLERAC, & + LCCN_HOM, CCCN_MODES, & + YALPHAR=>XALPHAR, YNUR=>XNUR, & + YALPHAC=>XALPHAC, YNUC=>XNUC, CINI_CCN=>HINI_CCN, & + CTYPE_CCN=>HTYPE_CCN, YFSOLUB_CCN=>XFSOLUB_CCN, & + YACTEMP_CCN=>XACTEMP_CCN, YAERDIFF=>XAERDIFF, & + YAERHEIGHT=>XAERHEIGHT, & + LSCAV, LAERO_MASS, NPHILLIPS, & + LCIBU, XNDEBRIS_CIBU, LRDSF, & + ODEPOC=>LDEPOC, OVDEPOC=>XVDEPOC, OACTTKE=>LACTTKE, & + LPTSPLIT, L_LFEEDBACKT=>LFEEDBACKT, L_NMAXITER=>NMAXITER, & + L_XMRSTEP=>XMRSTEP, L_XTSTEP_TS=>XTSTEP_TS +! +USE MODD_LATZ_EDFLX +USE MODD_2D_FRC +USE MODD_BLOWSNOW +USE MODD_BLOWSNOW_n +USE MODD_DRAG_n +USE MODD_VISCOSITY +USE MODD_RECYCL_PARAM_n +USE MODD_IBM_PARAM_n +USE MODD_IBM_LSF +#ifdef MNH_FOREFIRE +USE MODD_FOREFIRE +#endif +USE MODD_FIRE +! +IMPLICIT NONE +! +!* 0.1 declarations of arguments +! +INTEGER, INTENT(IN) :: KMI ! Model index +! +!* 0.2 declaration of local variables +! +INTEGER :: JM ! loop index +! +!------------------------------------------------------------------------------- +! +!* 1. SET DEFAULT VALUES FOR MODD_LUNIT_n : +! ---------------------------------- +! +! CINIFILE='INIFILE' +CINIFILEPGD='' !Necessary to keep this line to prevent problems with spawning +CCPLFILE(:)=' ' +! +!------------------------------------------------------------------------------- +! +!* 2. SET DEFAULT VALUES FOR MODD_CONF AND MODD_CONF_n : +! ------------------------------------------------ +! +IF (KMI == 1) THEN + CCONF ='START' + LTHINSHELL = .FALSE. + L2D = .FALSE. + L1D = .FALSE. + LFLAT = .FALSE. + NMODEL = 1 + CEQNSYS = 'DUR' + NVERB = 5 + CEXP = 'EXP01' + CSEG = 'SEG01' + LFORCING = .FALSE. + L2D_ADV_FRC= .FALSE. + L2D_REL_FRC= .FALSE. + XRELAX_HEIGHT_BOT = 0. + XRELAX_HEIGHT_TOP = 30000. + XRELAX_TIME = 864000. + LPACK = .TRUE. + NHALO = 1 +#ifdef MNH_SX5 + CSPLIT ='YSPLITTING' ! NEC vectoriel architecture , low number of PROC +#else + CSPLIT ='BSPLITTING' ! Scalaire architecture , high number of PROC +#endif + NZ_PROC = 0 !JUAN Z_SPLITTING :: number of proc in Z splitting + NZ_SPLITTING = 10 !JUAN Z_SPLITTING :: for debug NZ=1=flat_inv; NZ=10=flat_invz; NZ=1+2 the two + LLG = .FALSE. + LINIT_LG = .FALSE. + CINIT_LG = 'FMOUT' + LNOMIXLG = .FALSE. + LCHECK = .FALSE. +END IF +! +CCLOUD = 'NONE' +LUSERV = .TRUE. +LUSERC = .FALSE. +LUSERR = .FALSE. +LUSERI = .FALSE. +LUSERS = .FALSE. +LUSERG = .FALSE. +LUSERH = .FALSE. +LOCEAN = .FALSE. +!NSV = 0 +!NSV_USER = 0 +LUSECI = .FALSE. +! +!------------------------------------------------------------------------------- +! +!* 3. SET DEFAULT VALUES FOR MODD_DYN AND MODD_DYN_n : +! ----------------------------------------------- +! +IF (KMI == 1) THEN + XSEGLEN = 43200. + XASSELIN = 0.2 + XASSELIN_SV = 0.02 + LCORIO = .TRUE. + LNUMDIFU = .TRUE. + LNUMDIFTH = .FALSE. + LNUMDIFSV = .FALSE. + XALZBOT = 4000. + XALKTOP = 0.01 + XALKGRD = 0.01 + XALZBAS = 0.01 +END IF +! +XTSTEP = 60. +CPRESOPT = 'CRESI' +NITR = 4 +LITRADJ = .TRUE. +LRES = .FALSE. +XRES = 1.E-07 +XRELAX = 1. +LVE_RELAX = .FALSE. +LVE_RELAX_GRD = .FALSE. +XRIMKMAX = 0.01 / XTSTEP +XT4DIFU = 1800. +XT4DIFTH = 1800. +XT4DIFSV = 1800. +! +IF (KMI == 1) THEN ! for model 1 we have a Large scale information + NRIMX = JPRIMMAX ! for U,V,W,TH,Rv used for the hor. relaxation + NRIMY = JPRIMMAX +ELSE + NRIMX = 0 ! for inner models we use only surfacic fields to + NRIMY = 0 ! give the lbc and no hor. relaxation is used +END IF +! +LHORELAX_UVWTH = .FALSE. +LHORELAX_RV = .FALSE. +LHORELAX_RC = .FALSE. ! for all these fields, no large scale is usally available +LHORELAX_RR = .FALSE. ! for model 1 and for inner models, we only use surfacic +LHORELAX_RS = .FALSE. ! fiels ( no hor. relax. ) +LHORELAX_RI = .FALSE. +LHORELAX_RG = .FALSE. +LHORELAX_RH = .FALSE. +LHORELAX_TKE = .FALSE. +LHORELAX_SV(:) = .FALSE. +LHORELAX_SVC2R2 = .FALSE. +LHORELAX_SVC1R3 = .FALSE. +LHORELAX_SVELEC = .FALSE. +LHORELAX_SVLG = .FALSE. +LHORELAX_SVCHEM = .FALSE. +LHORELAX_SVCHIC = .FALSE. +LHORELAX_SVDST = .FALSE. +LHORELAX_SVSLT = .FALSE. +LHORELAX_SVPP = .FALSE. +LHORELAX_SVCS = .FALSE. +LHORELAX_SVAER = .FALSE. +! +LHORELAX_SVLIMA = .FALSE. +! +#ifdef MNH_FOREFIRE +LHORELAX_SVFF = .FALSE. +#endif +LHORELAX_SVSNW = .FALSE. +LHORELAX_SVFIRE = .FALSE. +! +! +!------------------------------------------------------------------------------- +! +!* 4. SET DEFAULT VALUES FOR MODD_NESTING : +! ----------------------------------- +! +IF (KMI == 1) THEN + NDAD(1)=1 + DO JM=2,JPMODELMAX + NDAD(JM) = JM - 1 + END DO + NDTRATIO(:) = 1 + XWAY(:) = 2. ! two-way interactive gridnesting + XWAY(1) = 0. ! except for model 1 +END IF +! +!------------------------------------------------------------------------------- +! +!* 5. SET DEFAULT VALUES FOR MODD_ADV_n : +! ---------------------------------- +! +CUVW_ADV_SCHEME = 'CEN4TH' +CMET_ADV_SCHEME = 'PPM_01' +CSV_ADV_SCHEME = 'PPM_01' +CTEMP_SCHEME = 'RKC4' +NWENO_ORDER = 3 +NSPLIT = 1 +LSPLIT_CFL = .TRUE. +LSPLIT_WENO = .TRUE. +XSPLIT_CFL = 0.8 +LCFL_WRIT = .FALSE. +! +!------------------------------------------------------------------------------- +! +!* 6. SET DEFAULT VALUES FOR MODD_PARAM_n : +! ----------------------------------- +! +CTURB = 'NONE' +CRAD = 'NONE' +CDCONV = 'NONE' +CSCONV = 'NONE' +CELEC = 'NONE' +CACTCCN = 'NONE' +! +!------------------------------------------------------------------------------- +! +!* 7. SET DEFAULT VALUES FOR MODD_LBC_n : +! --------------------------------- +! +CLBCX(1) ='CYCL' +CLBCX(2) ='CYCL' +CLBCY(1) ='CYCL' +CLBCY(2) ='CYCL' +NLBLX(:) = 1 +NLBLY(:) = 1 +XCPHASE = 20. +XCPHASE_PBL = 0. +XCARPKMAX = XUNDEF +XPOND = 1.0 +! +!------------------------------------------------------------------------------- +! +!* 8. SET DEFAULT VALUES FOR MODD_NUDGING_n : +! --------------------------------- +! +LNUDGING = .FALSE. +XTNUDGING = 21600. +! +!------------------------------------------------------------------------------- +! +!* 9. SET DEFAULT VALUES FOR MODD_BAKOUT and MODD_OUT_n : +! ------------------------------------------------ +! +! +! +!------------------------------------------------------------------------------- +! +!* 10. SET DEFAULT VALUES FOR MODD_TURB_n : +! ---------------------------------- +! +CALL TURBN_INIT(CPROGRAM, 0, .FALSE., TLUOUT%NLU, & + &LDDEFAULTVAL=.TRUE., LDREADNAM=.FALSE., LDCHECK=.FALSE., KPRINT=0) +!------------------------------------------------------------------------------- +! +!* 10a. SET DEFAULT VALUES FOR MODD_NEB_n : +! ---------------------------------- +! +CALL NEBN_INIT(CPROGRAM, 0, .FALSE., TLUOUT%NLU, & + &LDDEFAULTVAL=.TRUE., LDREADNAM=.FALSE., LDCHECK=.FALSE., KPRINT=0) +!------------------------------------------------------------------------------- +! +!* 10b. SET DEFAULT VALUES FOR MODD_DRAGTREE : +! ---------------------------------- +! +LDRAGTREE = .FALSE. +LDEPOTREE = .FALSE. +XVDEPOTREE = 0.02 ! 2 cm/s +!------------------------------------------------------------------------------ +! +!* 10c. SET DEFAULT VALUES FOR MODD_DRAGB +! ---------------------------------- +! +LDRAGBLDG = .FALSE. +! +!* 10d. SET DEFAULT VALUES FOR MODD_EOL* : +! ---------------------------------- +! +! 10d.i) MODD_EOL_MAIN +! +LMAIN_EOL = .FALSE. +CMETH_EOL = 'ADNR' +CSMEAR = '3LIN' +NMODEL_EOL = 1 +! +! 10d.ii) MODD_EOL_SHARED_IO +! +CFARM_CSVDATA = 'data_farm.csv' +CTURBINE_CSVDATA = 'data_turbine.csv' +CBLADE_CSVDATA = 'data_blade.csv' +CAIRFOIL_CSVDATA = 'data_airfoil.csv' +! +CINTERP = 'CLS' +! +! 10d.iii) MODD_EOL_ALM +! +NNB_BLAELT = 42 +LTIMESPLIT = .FALSE. +LTIPLOSSG = .TRUE. +LTECOUTPTS = .FALSE. +! +!------------------------------------------------------------------------------ +!* 10.e SET DEFAULT VALUES FOR MODD_ALLSTATION_n : +! ---------------------------------- +! +NNUMB_STAT = 0 +XSTEP_STAT = 60.0 +XX_STAT(:) = XUNDEF +XY_STAT(:) = XUNDEF +XZ_STAT(:) = XUNDEF +XLAT_STAT(:) = XUNDEF +XLON_STAT(:) = XUNDEF +CNAME_STAT(:) = '' +CTYPE_STAT(:) = '' +CFILE_STAT = 'NO_INPUT_CSV' +LDIAG_SURFRAD = .TRUE. +! +!------------------------------------------------------------------------------- +! +!* 11. SET DEFAULT VALUES FOR MODD_BUDGET : +! ------------------------------------ +! +! 11.1 General budget variables +! +IF (KMI == 1) THEN + CBUTYPE = 'NONE' + NBUMOD = 1 + XBULEN = XSEGLEN + XBUWRI = XSEGLEN + NBUKL = 1 + NBUKH = 0 + LBU_KCP = .TRUE. +! +! 11.2 Variables for the cartesian box +! + NBUIL = 1 + NBUIH = 0 + NBUJL = 1 + NBUJH = 0 + LBU_ICP = .TRUE. + LBU_JCP = .TRUE. +! +! 11.3 Variables for the mask +! + NBUMASK = 1 +END IF +! +!------------------------------------------------------------------------------- +! +!* 12. SET DEFAULT VALUES FOR MODD_LES : +! --------------------------------- +! +IF (KMI == 1) THEN + LLES_MEAN = .FALSE. + LLES_RESOLVED = .FALSE. + LLES_SUBGRID = .FALSE. + LLES_UPDRAFT = .FALSE. + LLES_DOWNDRAFT = .FALSE. + LLES_SPECTRA = .FALSE. +! + NLES_LEVELS = NUNDEF + XLES_ALTITUDES = XUNDEF + NSPECTRA_LEVELS = NUNDEF + XSPECTRA_ALTITUDES = XUNDEF + NLES_TEMP_SERIE_I = NUNDEF + NLES_TEMP_SERIE_J = NUNDEF + NLES_TEMP_SERIE_Z = NUNDEF + CLES_NORM_TYPE = 'NONE' + CBL_HEIGHT_DEF = 'KE' + XLES_TEMP_SAMPLING = XUNDEF + XLES_TEMP_MEAN_START = XUNDEF + XLES_TEMP_MEAN_END = XUNDEF + XLES_TEMP_MEAN_STEP = 3600. + LLES_CART_MASK = .FALSE. + NLES_IINF = NUNDEF + NLES_ISUP = NUNDEF + NLES_JINF = NUNDEF + NLES_JSUP = NUNDEF + LLES_NEB_MASK = .FALSE. + LLES_CORE_MASK = .FALSE. + LLES_MY_MASK = .FALSE. + NLES_MASKS_USER = NUNDEF + LLES_CS_MASK = .FALSE. + + LLES_PDF = .FALSE. + NPDF = 1 + XTH_PDF_MIN = 270. + XTH_PDF_MAX = 350. + XW_PDF_MIN = -10. + XW_PDF_MAX = 10. + XTHV_PDF_MIN = 270. + XTHV_PDF_MAX = 350. + XRV_PDF_MIN = 0. + XRV_PDF_MAX = 20. + XRC_PDF_MIN = 0. + XRC_PDF_MAX = 1. + XRR_PDF_MIN = 0. + XRR_PDF_MAX = 1. + XRI_PDF_MIN = 0. + XRI_PDF_MAX = 1. + XRS_PDF_MIN = 0. + XRS_PDF_MAX = 1. + XRG_PDF_MIN = 0. + XRG_PDF_MAX = 1. + XRT_PDF_MIN = 0. + XRT_PDF_MAX = 20. + XTHL_PDF_MIN = 270. + XTHL_PDF_MAX = 350. +END IF +! +!------------------------------------------------------------------------------- +! +!* 13. SET DEFAULT VALUES FOR MODD_PARAM_RAD_n : +! --------------------------------------- +! +XDTRAD = XTSTEP +XDTRAD_CLONLY = XTSTEP +LCLEAR_SKY =.FALSE. +NRAD_COLNBR = 1000 +NRAD_DIAG = 0 +CLW ='RRTM' +CAER='SURF' +CAOP='CLIM' +CEFRADL='MART' +CEFRADI='LIOU' +COPWSW = 'FOUQ' +COPISW = 'EBCU' +COPWLW = 'SMSH' +COPILW = 'EBCU' +XFUDG = 1. +LAERO_FT=.FALSE. +LFIX_DAT=.FALSE. +! +#ifdef MNH_ECRAD +!* 13bis. SET DEFAULT VALUES FOR MODD_PARAM_ECRAD_n : +! --------------------------------------- +! +#if ( VER_ECRAD == 101 ) +NSWSOLVER = 0 ! 0: 'McICA 1: 'SPARTACUS' 2: 'SPARTACUS' + 3D effect +NLWSOLVER = 0 ! 0: 'McICA 1: 'SPARTACUS' 2: 'SPARTACUS' + 3D effect +#endif +#if ( VER_ECRAD == 140 ) +LSPEC_ALB = .FALSE. +LSPEC_EMISS = .FALSE. + + +!ALLOCATE(USER_ALB_DIFF(NSWB_MNH)) +!ALLOCATE(USER_ALB_DIR(NSWB_MNH)) +!ALLOCATE(USER_EMISS(NLWB_MNH)) +!PRINT*,USER_ALB_DIFF +!USER_ALB_DIFF = (/0,0,0,0,0,0,0,0,0,0,0,0,0,0/) +!USER_ALB_DIR = (/0,0,0,0,0,0,0,0,0,0,0,0,0,0/) +!USER_EMISS = (/0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0/) +SURF_TYPE="SNOW" + +NLWSOLVER = 1 ! 0: 'McICA 1: 'SPARTACUS' 2: 'SPARTACUS' + 3D effect +NSWSOLVER = 1 ! 0: 'McICA 1: 'SPARTACUS' 2: 'SPARTACUS' + 3D effect +#endif +! LEFF3D = .TRUE. +! LSIDEM = .TRUE. +NREG = 3 ! Number of cloudy regions (3=TripleClouds) +! LLWCSCA = .TRUE. ! LW cloud scattering +! LLWASCA = .TRUE. ! LW aerosols scattering +NLWSCATTERING = 2 +NAERMACC = 0 +! CGAS = 'RRTMG-IFS' ! Gas optics model +NOVLP = 1 ! overlap assumption ; 0= 'Max-Ran' ; 1= 'Exp-Ran'; 2 = 'Exp-Exp' +NLIQOPT = 3 ! 1: 'Monochromatic', 2: 'HuStamnes', 3: 'SOCRATES', 4: 'Slingo' +NICEOPT = 3 ! 1: 'Monochromatic', 2: 'Fu-PSRAD', 3: 'Fu-IFS', 4: 'Baran', 5: 'Baran2016', 6: 'Baran2017' +! LSW_ML_E = .FALSE. +! LLW_ML_E = .FALSE. +! LPSRAD = .FALSE. +! +NRADLP = 1 ! 0: ERA-15, 1: Zhang and Rossow, 2: Martin (1994) et Woods (2000) +NRADIP = 1 ! 0: 40 mum, 1: Liou and Ou (1994), 2: Liou and Ou (1994) improved, 3: Sun and Rikus (1999) +XCLOUD_FRAC_STD = 1.0_JPRB ! change to 0.75 for more realistic distribution +#endif +!------------------------------------------------------------------------------- +! +!* 14. SET DEFAULT VALUES FOR MODD_BLANK_n : +! ----------------------------------- +! +XDUMMY1 = 0. +XDUMMY2 = 0. +XDUMMY3 = 0. +XDUMMY4 = 0. +XDUMMY5 = 0. +XDUMMY6 = 0. +XDUMMY7 = 0. +XDUMMY8 = 0. +! +NDUMMY1 = 0 +NDUMMY2 = 0 +NDUMMY3 = 0 +NDUMMY4 = 0 +NDUMMY5 = 0 +NDUMMY6 = 0 +NDUMMY7 = 0 +NDUMMY8 = 0 +! +LDUMMY1 = .TRUE. +LDUMMY2 = .TRUE. +LDUMMY3 = .TRUE. +LDUMMY4 = .TRUE. +LDUMMY5 = .TRUE. +LDUMMY6 = .TRUE. +LDUMMY7 = .TRUE. +LDUMMY8 = .TRUE. +! +CDUMMY1 = ' ' +CDUMMY2 = ' ' +CDUMMY3 = ' ' +CDUMMY4 = ' ' +CDUMMY5 = ' ' +CDUMMY6 = ' ' +CDUMMY7 = ' ' +CDUMMY8 = ' ' +! +!------------------------------------------------------------------------------ +! +!* 15. SET DEFAULT VALUES FOR MODD_FRC : +! --------------------------------- +! +IF (KMI == 1) THEN + LGEOST_UV_FRC = .FALSE. + LGEOST_TH_FRC = .FALSE. + LTEND_THRV_FRC = .FALSE. + LTEND_UV_FRC = .FALSE. + LVERT_MOTION_FRC = .FALSE. + LRELAX_THRV_FRC = .FALSE. + LRELAX_UV_FRC = .FALSE. + LRELAX_UVMEAN_FRC = .FALSE. + XRELAX_TIME_FRC = 10800. + XRELAX_HEIGHT_FRC = 0. + CRELAX_HEIGHT_TYPE = "FIXE" + LTRANS = .FALSE. + XUTRANS = 0.0 + XVTRANS = 0.0 + LPGROUND_FRC = .FALSE. + LDEEPOC = .FALSE. + XCENTX_OC = 16000. + XCENTY_OC = 16000. + XRADX_OC = 8000. + XRADY_OC = 8000. +END IF +! +!------------------------------------------------------------------------------- +! +! +!* 16. SET DEFAULT VALUES FOR MODD_PARAM_ICE : +! --------------------------------------- +! +CALL PARAM_ICEN_INIT(CPROGRAM, 0, .FALSE., TLUOUT%NLU, & + &LDDEFAULTVAL=.TRUE., LDREADNAM=.FALSE., LDCHECK=.FALSE., KPRINT=0) +! +!------------------------------------------------------------------------------- +! +! +!* 17. SET DEFAULT VALUES FOR MODD_PARAM_KAFR_n : +! -------------------------------------------- +! +XDTCONV = MAX( 300.0,XTSTEP ) +NICE = 1 +LREFRESH_ALL = .TRUE. +LCHTRANS = .FALSE. +LDOWN = .TRUE. +LSETTADJ = .FALSE. +XTADJD = 3600. +XTADJS = 10800. +LDIAGCONV = .FALSE. +NENSM = 0 +! +!------------------------------------------------------------------------------- +! +! +!* 18. SET DEFAULT VALUES FOR MODD_PARAM_MFSHALL_n : +! -------------------------------------------- +! +CALL PARAM_MFSHALLN_INIT(CPROGRAM, 0, .FALSE., TLUOUT%NLU, & + &LDDEFAULTVAL=.TRUE., LDREADNAM=.FALSE., LDCHECK=.FALSE., KPRINT=0) +! +!------------------------------------------------------------------------------- +! +!* 19. SET DEFAULT VALUES FOR MODD_PARAM_C2R2 : +! ---------------------------------------- +! +IF (KMI == 1) THEN + XNUC = 1.0 + XALPHAC = 3.0 + XNUR = 2.0 + XALPHAR = 1.0 +! + LRAIN = .TRUE. + LSEDC = .TRUE. + LACTIT = .FALSE. + LSUPSAT = .FALSE. + LDEPOC = .FALSE. + XVDEPOC = 0.02 ! 2 cm/s + LACTTKE = .TRUE. +! + HPARAM_CCN = 'XXX' + HINI_CCN = 'XXX' + HTYPE_CCN = 'X' +! + XCHEN = 0.0 + XKHEN = 0.0 + XMUHEN = 0.0 + XBETAHEN = 0.0 +! + XCONC_CCN = 0.0 + XAERDIFF = 0.0 + XAERHEIGHT = 2000 + XR_MEAN_CCN = 0.0 + XLOGSIG_CCN = 0.0 + XFSOLUB_CCN = 1.0 + XACTEMP_CCN = 280. +ENDIF +! +!------------------------------------------------------------------------------- +! +!* 19.BIS SET DEFAULT VALUES FOR MODD_PARAM_LIMA : +! ---------------------------------------- +! +IF (KMI == 1) THEN + LPTSPLIT = .FALSE. + L_LFEEDBACKT = .TRUE. + L_NMAXITER = 1 + L_XMRSTEP = 0. + L_XTSTEP_TS = 0. +! + YNUC = 1.0 + YALPHAC = 3.0 + YNUR = 2.0 + YALPHAR = 1.0 +! + OWARM = .TRUE. + LACTI = .TRUE. + ORAIN = .TRUE. + OSEDC = .TRUE. + OACTIT = .FALSE. + LADJ = .TRUE. + LSPRO = .FALSE. + LKHKO = .FALSE. + ODEPOC = .TRUE. + LBOUND = .FALSE. + OACTTKE = .TRUE. + LKESSLERAC = .FALSE. +! + NMOM_C = 2 + NMOM_R = 2 +! + OVDEPOC = 0.02 ! 2 cm/s +! + CINI_CCN = 'AER' + CTYPE_CCN(:) = 'M' +! + YAERDIFF = 0.0 + YAERHEIGHT = 2000. +! YR_MEAN_CCN = 0.0 ! In case of 'CCN' initialization +! YLOGSIG_CCN = 0.0 + YFSOLUB_CCN = 1.0 + YACTEMP_CCN = 280. +! + NMOD_CCN = 1 +! +!* AP Scavenging +! + LSCAV = .FALSE. + LAERO_MASS = .FALSE. +! + LCCN_HOM = .TRUE. + CCCN_MODES = 'COPT' + XCCN_CONC(:)=300. +! + LHHONI = .FALSE. + LCOLD = .TRUE. + LNUCL = .TRUE. + LSEDI = .TRUE. + LSNOW = .TRUE. + LHAIL = .FALSE. + YSNOW_T = .FALSE. + LMURAKAMI = .TRUE. + CPRISTINE_ICE_LIMA = 'PLAT' + CHEVRIMED_ICE_LIMA = 'GRAU' + XFACTNUC_DEP = 1.0 + XFACTNUC_CON = 1.0 + NMOM_I = 2 + NMOM_S = 1 + NMOM_G = 1 + NMOM_H = 1 + NMOD_IFN = 1 + NIND_SPECIE = 1 + LMEYERS = .FALSE. + LIFN_HOM = .TRUE. + CIFN_SPECIES = 'PHILLIPS' + CINT_MIXING = 'DM2' + XIFN_CONC(:) = 100. + NMOD_IMM = 0 + NPHILLIPS=8 + LCIBU = .FALSE. + XNDEBRIS_CIBU = 50.0 + LRDSF = .FALSE. +ENDIF +! +!------------------------------------------------------------------------------- +! +!* 20. SET DEFAULT VALUES FOR MODD_CH_MNHC_n +! ------------------------------------- +! +LUSECHEM = .FALSE. +LUSECHAQ = .FALSE. +LUSECHIC = .FALSE. +LCH_INIT_FIELD = .FALSE. +LCH_CONV_SCAV = .FALSE. +LCH_CONV_LINOX = .FALSE. +LCH_PH = .FALSE. +LCH_RET_ICE = .FALSE. +XCH_PHINIT = 5.2 +XRTMIN_AQ = 5.e-8 +CCHEM_INPUT_FILE = 'EXSEG1.nam' +CCH_TDISCRETIZATION = 'SPLIT' +NCH_SUBSTEPS = 1 +LCH_TUV_ONLINE = .FALSE. +CCH_TUV_LOOKUP = 'PHOTO.TUV39' +CCH_TUV_CLOUDS = 'NONE' +XCH_TUV_ALBNEW = -1. +XCH_TUV_DOBNEW = -1. +XCH_TUV_TUPDATE = 600. +CCH_VEC_METHOD = 'MAX' +NCH_VEC_LENGTH = 50 +XCH_TS1D_TSTEP = 600. +CCH_TS1D_COMMENT = 'no comment' +CCH_TS1D_FILENAME = 'IO1D' +CSPEC_PRODLOSS = '' +CSPEC_BUDGET = '' +! +!------------------------------------------------------------------------------- +! +!* 21. SET DEFAULT VALUES FOR MODD_SERIES AND MODD_SERIE_n +! --------------------------------------------------- +! +IF (KMI == 1) THEN + LSERIES = .FALSE. + LMASKLANDSEA = .FALSE. + LWMINMAX = .FALSE. + LSURF = .FALSE. +ENDIF +! +NIBOXL = 1 !+ JPHEXT +NIBOXH = 1 !+ 2*JPHEXT +NJBOXL = 1 !+ JPHEXT +NJBOXH = 1 !+ 2*JPHEXT +NKCLS = 1 !+ JPVEXT +NKLOW = 1 !+ JPVEXT +NKMID = 1 !+ JPVEXT +NKUP = 1 !+ JPVEXT +NKCLA = 1 !+ JPVEXT +NBJSLICE = 1 +NJSLICEL(:) = 1 !+ JPHEXT +NJSLICEH(:) = 1 !+ 2*JPHEXT +NFREQSERIES = INT(XSEGLEN /(100.*XTSTEP) ) +NFREQSERIES = MAX(NFREQSERIES,1) +! +!------------------------------------------------------------------------------- +! +!* 22. SET DEFAULT VALUES FOR MODD_TURB_CLOUD +! -------------------------------------- +! +IF (KMI == 1) THEN + NMODEL_CLOUD = NUNDEF + CTURBLEN_CLOUD = 'DELT' + XCOEF_AMPL_SAT = 5. + XCEI_MIN = 0.001E-06 + XCEI_MAX = 0.01E-06 +ENDIF +!------------------------------------------------------------------------------- +! +!* 22. SET DEFAULT VALUES FOR MODD_MEAN_FIELD +! -------------------------------------- +! +IF (KMI == 1) THEN + LMEAN_FIELD = .FALSE. + LCOV_FIELD = .FALSE. +ENDIF +! +!------------------------------------------------------------------------------- +! +!* 22. SET DEFAULT VALUES FOR MODD_AEROSOL +! ----------------------------------- +IF (KMI == 1) THEN ! other values are defined in modd_ch_aerosol +! +! aerosol lognormal parameterization + +LVARSIGI = .FALSE. ! switch to active pronostic dispersion for I mode +LVARSIGJ = .FALSE. ! switch to active pronostic dispersion for J mode +LHETEROSO4 = .FALSE. ! switch to active sulfates heteronegeous + ! production +LSEDIMAERO = .FALSE. ! switch to active aerosol sedimentation +LAERINIT = .FALSE. ! switch to initialize aerosol in arome +CMINERAL = "NONE" ! mineral equilibrium scheme +CORGANIC = "NONE" ! mineral equilibrium scheme +CNUCLEATION = "NONE" ! sulfates nucleation scheme +LDEPOS_AER(:) = .FALSE. + +ENDIF + +!* 23. SET DEFAULT VALUES FOR MODD_DUST and MODD_SALT +! ---------------------------------------------- +! +IF (KMI == 1) THEN ! other values initialized in modd_dust + LDUST = .FALSE. + NMODE_DST = 3 + LVARSIG = .FALSE. + LSEDIMDUST = .FALSE. + LDEPOS_DST(:) = .FALSE. + + LSALT = .FALSE. + LVARSIG_SLT= .FALSE. + LSEDIMSALT = .FALSE. + LDEPOS_SLT(:) = .FALSE. +ENDIF +! +!------------------------------------------------------------------------------- +! +! +!* 24. SET DEFAULT VALUES FOR MODD_PASPOL +! ---------------------------------- +! +! other values initialized in modd_paspol +! +IF (KMI == 1) THEN + LPASPOL = .FALSE. + NRELEASE = 0 + CPPINIT(:) ='1PT' + XPPLAT(:) = 0. + XPPLON (:) = 0. + XPPMASS(:) = 0. + XPPBOT(:) = 0. + XPPTOP(:) = 0. + CPPT1(:) = "20010921090000" + CPPT2(:) = "20010921090000" + CPPT3(:) = "20010921091500" + CPPT4(:) = "20010921091500" +ENDIF +! +!------------------------------------------------------------------------------- +! +! +!* 25. SET DEFAULT VALUES FOR MODD_CONDSAMP +! ---------------------------------- +! +! other values initialized in modd_condsamp +! +IF (KMI == 1) THEN + LCONDSAMP = .FALSE. + NCONDSAMP = 3 + XRADIO(:) = 900. + XSCAL(:) = 1. + XHEIGHT_BASE = 100. + XDEPTH_BASE = 100. + XHEIGHT_TOP = 100. + XDEPTH_TOP = 100. + NFINDTOP = 0 + XTHVP = 0.25 + LTPLUS = .TRUE. +ENDIF +!------------------------------------------------------------------------------- +! +! +!* 26. SET DEFAULT VALUES FOR MODD_LATZ_EDFLX +! ---------------------------------- +! +IF (KMI == 1) THEN + LUV_FLX=.FALSE. + XUV_FLX1=3.E+14 + XUV_FLX2=0. + LTH_FLX=.FALSE. + XTH_FLX=0.75 +ENDIF +#ifdef MNH_FOREFIRE +!------------------------------------------------------------------------------- +! +!* 27. SET DEFAULT VALUES FOR MODD_FOREFIRE +! ---------------------------------- +! +! other values initialized in modd_forefire +! +IF (KMI == 1) THEN + LFOREFIRE = .FALSE. + LFFCHEM = .FALSE. + COUPLINGRES = 100. + NFFSCALARS = 0 +ENDIF +#endif +!------------------------------------------------------------------------------- +! +!* 28. SET DEFAULT VALUES FOR MODD_BLOWSNOW AND MODD_BLOWSNOW_n +! ---------------------------------------- +! +IF (KMI == 1) THEN + LBLOWSNOW = .FALSE. + XALPHA_SNOW = 3. + XRSNOW = 4. + CSNOWSEDIM = 'TABC' +END IF +LSNOWSUBL = .FALSE. +! +! +!------------------------------------------------------------------------------- +! +!* 29. SET DEFAULT VALUES FOR MODD_VISC +! ---------------------------------- +! +! other values initialized in modd_VISC +! +IF (KMI == 1) THEN + LVISC = .FALSE. + LVISC_UVW = .FALSE. + LVISC_TH = .FALSE. + LVISC_SV = .FALSE. + LVISC_R = .FALSE. + XMU_V = 0. + XPRANDTL = 0. +ENDIF +! +!------------------------------------------------------------------------------- +! +! +!* 30. SET DEFAULT VALUES FOR MODD_DRAG +! ---------------------------------- +! +! other values initialized in modd_DRAG +! +IF (KMI == 1) THEN + LDRAG = .FALSE. + LMOUNT = .FALSE. + NSTART = 1 + XHSTART = 0. +ENDIF +! +!------------------------------------------------------------------------------- +! +!* 31. SET DEFAULT VALUES FOR MODD_IBM_PARAMn +! -------------------------------------- +! + LIBM = .FALSE. + LIBM_TROUBLE = .FALSE. + CIBM_ADV = 'NOTHIN' + XIBM_EPSI = 1.E-9 + XIBM_IEPS = 1.E+9 + NIBM_ITR = 8 + XIBM_RUG = 0.01 ! (m^1.s^-0) + XIBM_VISC = 1.56e-5 ! (m^2.s^-1) + XIBM_CNU = 0.06 ! (m^0.s^-0) + + NIBM_LAYER_P = 2 + NIBM_LAYER_Q = 2 + NIBM_LAYER_R = 2 + NIBM_LAYER_S = 2 + NIBM_LAYER_T = 2 + NIBM_LAYER_E = 2 + NIBM_LAYER_V = 2 + + XIBM_RADIUS_P = 2. + XIBM_RADIUS_Q = 2. + XIBM_RADIUS_R = 2. + XIBM_RADIUS_S = 2. + XIBM_RADIUS_T = 2. + XIBM_RADIUS_E = 2. + XIBM_RADIUS_V = 2. + + XIBM_POWERS_P = 1. + XIBM_POWERS_Q = 1. + XIBM_POWERS_R = 1. + XIBM_POWERS_S = 1. + XIBM_POWERS_T = 1. + XIBM_POWERS_E = 1. + XIBM_POWERS_V = 1. + + CIBM_MODE_INTE3_P = 'LAI' + CIBM_MODE_INTE3_Q = 'LAI' + CIBM_MODE_INTE3_R = 'LAI' + CIBM_MODE_INTE3_S = 'LAI' + CIBM_MODE_INTE3_T = 'LAI' + CIBM_MODE_INTE3_E = 'LAI' + CIBM_MODE_INTE3_V = 'LAI' + + CIBM_MODE_INTE1_P = 'CL2' + CIBM_MODE_INTE1_Q = 'CL2' + CIBM_MODE_INTE1_R = 'CL2' + CIBM_MODE_INTE1_S = 'CL2' + CIBM_MODE_INTE1_T = 'CL2' + CIBM_MODE_INTE1_E = 'CL2' + CIBM_MODE_INTE1NV = 'CL2' + CIBM_MODE_INTE1TV = 'CL2' + CIBM_MODE_INTE1CV = 'CL2' + + CIBM_MODE_BOUND_P = 'SYM' + CIBM_MODE_BOUND_Q = 'SYM' + CIBM_MODE_BOUND_R = 'SYM' + CIBM_MODE_BOUND_S = 'SYM' + CIBM_MODE_BOUND_T = 'SYM' + CIBM_MODE_BOUND_E = 'SYM' + CIBM_MODE_BOUNT_V = 'ASY' + CIBM_MODE_BOUNN_V = 'ASY' + CIBM_MODE_BOUNC_V = 'ASY' + + XIBM_FORC_BOUND_P = 0. + XIBM_FORC_BOUND_Q = 0. + XIBM_FORC_BOUND_R = 0. + XIBM_FORC_BOUND_S = 0. + XIBM_FORC_BOUND_T = 0. + XIBM_FORC_BOUND_E = 0. + XIBM_FORC_BOUNN_V = 0. + XIBM_FORC_BOUNT_V = 0. + XIBM_FORC_BOUNC_V = 0. + + CIBM_TYPE_BOUND_P = 'NEU' + CIBM_TYPE_BOUND_Q = 'NEU' + CIBM_TYPE_BOUND_R = 'NEU' + CIBM_TYPE_BOUND_S = 'NEU' + CIBM_TYPE_BOUND_T = 'NEU' + CIBM_TYPE_BOUND_E = 'NEU' + CIBM_TYPE_BOUNT_V = 'DIR' + CIBM_TYPE_BOUNN_V = 'DIR' + CIBM_TYPE_BOUNC_V = 'DIR' + + CIBM_FORC_BOUND_P = 'CST' + CIBM_FORC_BOUND_Q = 'CST' + CIBM_FORC_BOUND_R = 'CST' + CIBM_FORC_BOUND_S = 'CST' + CIBM_FORC_BOUND_T = 'CST' + CIBM_FORC_BOUND_E = 'CST' + CIBM_FORC_BOUNN_V = 'CST' + CIBM_FORC_BOUNT_V = 'CST' + CIBM_FORC_BOUNC_V = 'CST' + CIBM_FORC_BOUNR_V = 'CST' + +! +!------------------------------------------------------------------------------- +! +!* 32. SET DEFAULT VALUES FOR MODD_RECYCL_PARAMn +! -------------------------------------- +! + LRECYCL = .FALSE. + LRECYCLN = .FALSE. + LRECYCLW = .FALSE. + LRECYCLE = .FALSE. + LRECYCLS = .FALSE. + XDRECYCLN = 0. + XARECYCLN = 0. + XDRECYCLW = 0. + XARECYCLW = 0. + XDRECYCLS = 0. + XARECYCLS = 0. + XDRECYCLE = 0. + XARECYCLE = 0. + XTMOY = 0. + XTMOYCOUNT = 0. + XNUMBELT = 28. + XRCOEFF = 0.2 + XTBVTOP = 500. + XTBVBOT = 300. +! +!------------------------------------------------------------------------------- +! +!* 33. SET DEFAULT VALUES FOR MODD_FIRE +! -------------------------------- +! +! Blaze fire model namelist +! +IF (KMI == 1) THEN + LBLAZE = .FALSE. ! Flag for Fire model use, default FALSE + ! + CPROPAG_MODEL = 'SANTONI2011' ! Fire propagation model (default SANTONI2011) + ! + CHEAT_FLUX_MODEL = 'EXS' ! Sensible heat flux injection model (default EXS) + CLATENT_FLUX_MODEL = 'EXP' ! latent heat flux injection model (default EXP) + XFERR = 0.8 ! Energy released in flamming stage (only for EXP) + ! + CFIRE_CPL_MODE = '2WAYCPL' ! Coupling mode (default 2way coupled) + CBMAPFILE = CINIFILE ! File name of BMAP for FIR2ATM mode + LINTERPWIND = .TRUE. ! Horizontal interpolation of wind + LSGBAWEIGHT = .FALSE. ! Flag for use of weighted average method for SubGrid Burning Area computation + ! + NFIRE_WENO_ORDER = 3 ! Weno order (1,3,5) + NFIRE_RK_ORDER = 3 ! Runge Kutta order (1,2,3,4) + ! + NREFINX = 1 ! Refinement ratio X + NREFINY = 1 ! Refinement ratio Y + ! + XCFLMAXFIRE = 0.8 ! Max CFL on fire mesh + XLSDIFFUSION = 0.1 ! Numerical diffusion of LevelSet + XROSDIFFUSION = 0.05 ! Numerical diffusion of ROS + ! + XFLUXZEXT = 3. ! Flux distribution on vertical caracteristic length + XFLUXZMAX = 4. * XFLUXZEXT ! Flux distribution on vertical max injetion height + ! + XFLXCOEFTMP = 1. ! Flux multiplicator. For testing + ! + LWINDFILTER = .FALSE. ! Fire wind filtering flag + CWINDFILTER = 'EWAM' ! Wind filter method (EWAM or WLIM) + XEWAMTAU = 20. ! Time averaging constant for EWAM method (s) + XWLIMUTH = 8. ! Thresehold wind value for WLIM method (m/s) + XWLIMUTMAX = 9. ! Maximum wind value for WLIM method (m/s) (needs to be >= XWLIMUTH ) + ! + NNBSMOKETRACER = 1 ! Nb of smoke tracers + ! + NWINDSLOPECPLMODE = 0 ! Flag for use of wind/slope in ROS (0 = wind + slope, 1 = wind only, 2 = slope only (U0=0)) + ! + ! + ! + !! DO NOT CHANGE BELOW PARAMETERS + XFIREMESHSIZE(:) = 0. ! Fire mesh size (dxf,dyf) + LRESTA_ASE = .FALSE. ! Flag for using ASE in RESTA file + LRESTA_AWC = .FALSE. ! Flag for using AWC in RESTA file + LRESTA_EWAM = .FALSE. ! Flag for using EWAM in RESTA file + LRESTA_WLIM = .FALSE. ! Flag for using WLIM in RESTA file +ENDIF + +!------------------------------------------------------------------------------- +END SUBROUTINE DEFAULT_DESFM_n diff --git a/src/mesonh/ext/endstep.f90 b/src/mesonh/ext/endstep.f90 new file mode 100644 index 0000000000000000000000000000000000000000..97734d72bd8ecad1aa8e4163c203fbfe7ab5fe57 --- /dev/null +++ b/src/mesonh/ext/endstep.f90 @@ -0,0 +1,668 @@ +!MNH_LIC Copyright 1994-2021 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_ENDSTEP +! ################### +! +INTERFACE +! + SUBROUTINE ENDSTEP (PTSTEP,KRR,KSV,KTCOUNT,KMI, & + HUVW_ADV_SCHEME,HTEMP_SCHEME, PRHODJ, & + PUS,PVS,PWS,PDRYMASSS, & + PTHS,PRS,PTKES,PSVS, & + PLSUS,PLSVS,PLSWS, & + PLSTHS,PLSRVS,PLSZWSS, & + PLBXUS,PLBXVS,PLBXWS, & + PLBXTHS,PLBXRS,PLBXTKES,PLBXSVS, & + PLBYUS,PLBYVS,PLBYWS, & + PLBYTHS,PLBYRS,PLBYTKES,PLBYSVS, & + PUM,PVM,PWM,PZWS, & + PUT,PVT,PWT,PPABST,PDRYMASST, & + PTHT,PRT,PTHM,PRCM,PPABSM,PTKET,PSVT, & + PLSUM,PLSVM,PLSWM, & + PLSTHM,PLSRVM,PLSZWSM, & + PLBXUM,PLBXVM,PLBXWM, & + PLBXTHM,PLBXRM,PLBXTKEM,PLBXSVM, & + PLBYUM,PLBYVM,PLBYWM, & + PLBYTHM,PLBYRM,PLBYTKEM,PLBYSVM ) +! +REAL, INTENT(IN) :: PTSTEP ! Time step +INTEGER, INTENT(IN) :: KRR ! Number of water var. +INTEGER, INTENT(IN) :: KSV ! Number of scal. var. +INTEGER, INTENT(IN) :: KTCOUNT ! Temporal loop COUNTer +INTEGER, INTENT(IN) :: KMI ! Model index +CHARACTER(LEN=6), INTENT(IN) :: HUVW_ADV_SCHEME ! advection scheme for wind +CHARACTER(LEN=4), INTENT(IN) :: HTEMP_SCHEME ! Temporal scheme +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! (Rho) dry * Jacobian +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PUS,PVS,PWS, & ! + PTHS,PTKES ! variables at +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRS,PSVS ! t+dt +! +REAL, INTENT(IN) :: PDRYMASSS ! Md source +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLSUS,PLSVS,PLSWS,& ! Large Scale + PLSTHS,PLSRVS ! fields tendencies +! +REAL, DIMENSION(:,:), INTENT(IN) :: PLSZWSS ! Large Scale fields tendencies +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBXUS,PLBXVS,PLBXWS, & ! + PLBXTHS,PLBXTKES ! LBX tendancy +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PLBXRS,PLBXSVS ! +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBYUS,PLBYVS,PLBYWS,& ! + PLBYTHS,PLBYTKES ! LBY tendancy +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PLBYRS,PLBYSVS ! +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PUM,PVM,PWM! Variables at t-dt +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PUT,PVT,PWT,PPABST,PTHT,&! + PTKET ! Variables at +REAL, DIMENSION(:,:,:,:),INTENT(INOUT):: PRT,PSVT ! t +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PTHM, PRCM,PPABSM ! Variables at t-Dt +REAL, INTENT(INOUT):: PDRYMASST ! +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PLSUM,PLSVM,PLSWM,& ! Large Scale fields + PLSTHM,PLSRVM ! at t-dt +REAL, DIMENSION(:,:), INTENT(INOUT) :: PLSZWSM ! Large Scale fields at t-dt +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PLBXUM,PLBXVM,PLBXWM, & ! + PLBXTHM,PLBXTKEM ! LBX fields +REAL, DIMENSION(:,:,:,:), INTENT(INOUT):: PLBXRM,PLBXSVM ! +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PLBYUM,PLBYVM,PLBYWM, & ! + PLBYTHM,PLBYTKEM ! LBY fields +REAL, DIMENSION(:,:,:,:), INTENT(INOUT):: PLBYRM,PLBYSVM ! +REAL, DIMENSION(:,:), INTENT(INOUT) :: PZWS ! significant wave height +! +END SUBROUTINE ENDSTEP +! +END INTERFACE +! +END MODULE MODI_ENDSTEP +! +! +! +! ###################################################################### + SUBROUTINE ENDSTEP (PTSTEP,KRR,KSV,KTCOUNT,KMI, & + HUVW_ADV_SCHEME,HTEMP_SCHEME, PRHODJ, & + PUS,PVS,PWS,PDRYMASSS, & + PTHS,PRS,PTKES,PSVS, & + PLSUS,PLSVS,PLSWS, & + PLSTHS,PLSRVS,PLSZWSS, & + PLBXUS,PLBXVS,PLBXWS, & + PLBXTHS,PLBXRS,PLBXTKES,PLBXSVS, & + PLBYUS,PLBYVS,PLBYWS, & + PLBYTHS,PLBYRS,PLBYTKES,PLBYSVS, & + PUM,PVM,PWM,PZWS, & + PUT,PVT,PWT,PPABST,PDRYMASST, & + PTHT,PRT,PTHM,PRCM,PPABSM,PTKET,PSVT, & + PLSUM,PLSVM,PLSWM, & + PLSTHM,PLSRVM,PLSZWSM, & + PLBXUM,PLBXVM,PLBXWM, & + PLBXTHM,PLBXRM,PLBXTKEM,PLBXSVM, & + PLBYUM,PLBYVM,PLBYWM, & + PLBYTHM,PLBYRM,PLBYTKEM,PLBYSVM ) +! ###################################################################### +! +!!**** *ENDSTEP* - temporal advance and asselin filter for all variables +!! (replaces the previous endstep_dyn and endstep_scalar subroutines) +!! +!! PURPOSE +!! ------- +!! +!! The purpose of ENDSTEP is to apply the asselin filter, perform +!! the time advance and thereby finalize the time step. +! +! +!!** METHOD +!! ------ +!! +!! The filtered values of the prognostic variables at t is obtained +!! by linear combination of variables at t-dt, t, and t+dt. +!! This value is put into the array containing the t-dt value. +!! To perform the time swapping, the t+dt values are put into the arrays +!! containing the t values. +!! +!! In case of cold start (first time step), indicated by the value 'START' +!! of CCONF in module MODD_CONF, a simple time advance is performed. +!! +!! The swapping for the absolute pressure function is only a copy of time t in +!! time (t-dt). +!! +!! Temporal advances of large scale, lateral boundarie and SST fields +!! are also made in this subroutine. +!! +!! The different sources terms are stored for the budget computations. +!! +!! EXTERNAL +!! -------- +!! BUDGET : Stores the different budget components +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! MODULE MODD_DYN containing XASSELIN +!! MODULE MODD_CONF containing CCONF +!! MODULE MODD_CTURB containing XTKEMIN, XEPSMIN +!! MODULE MODD_BUDGET: +!! NBUMOD : model in which budget is calculated +!! NBUTSHIFT : temporal shift for budgets writing +!! +!! REFERENCE +!! --------- +!! Book2 of documentation +!! +!! AUTHOR +!! ------ +!! P. Bougeault Meteo France +!! +!! MODIFICATIONS +!! ------------- +!! +!! original 22/06/94 +!! corrections 01/09/94 (J. P. Lafore) +!! " 07/11/94 (J.Stein) pressure function swapping +!! update 03/01/94 (J. P. Lafore) Total mass of dry air Md evolution +!! 20/03/95 (J.Stein ) remove R from the historical variables +!! + switch for TKE unused +!! 01/04/95 (Ph. Hereil J. Nicolau) add the budget computation +!! 30/08/95 (J.Stein) remove the positivity control and +!! correct the bug for PRM and PSVM for the cold start +!! 16/10/95 (J. Stein) change the budget calls +!! 12/10/96 (J. Stein) add the SRC temporal evolution +!! 20/12/96 (J.-P. Pinty) update the CALL BUDGET +!! 03/09/96 (J. P. Lafore) temporal advance of LS scalar fields +!! 22/06/97 (J. Stein) add the absolute pressure +!! 13/03/97 (J. P. Lafore) add "surfacic" LS fields +!! 24/09/97 (V. Masson) positive values for ls fields +!! 10/01/98 (J. Stein) use the LB fields +!! 20/04/98 (P. Josse) temporal evolution of SST +!! 18/09/98 (P. Jabouille) merge endstep_dyn and endstep_scalar +!! 08/12/00 (P. Jabouille) minimum values for hydrometeors +!! 22/06/01 (P. Jabouille) use XSVMIN +!! 06/11/02 (V. Masson) update the budget calls +!! 01/2004 (V. Masson) surface externalization +!! 05/2006 Remove KEPS +!! 10/2006 (Maric, Lac) modification for PPM schemes +!! 10/2009 (C.Lac) Correction on FIT temporal scheme for variables +!! advected with PPM +!! 04/2013 (C.Lac) FIT for all the variables +!! 04/2014 (C.Lac) Check on the positivity of PSVT +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! 02/2019 (S. Bielli) Sea salt : significant sea wave height influences salt emission; 5 salt modes +! P. Wautelet 02/2020: use the new data structures and subroutines for budgets +! P. Wautelet 02/2022: add sea salt +!------------------------------------------------------------------------------ +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_BLOWSNOW +USE MODD_BLOWSNOW_n +use modd_budget, only: lbudget_u, lbudget_v, lbudget_w, lbudget_th, lbudget_tke, lbudget_rv, lbudget_rc, & + lbudget_rr, lbudget_ri, lbudget_rs, lbudget_rg, lbudget_rh, lbudget_sv, lbu_enable, & + NBUDGET_U, NBUDGET_V, NBUDGET_W, NBUDGET_TH, NBUDGET_TKE, NBUDGET_RV, NBUDGET_RC, & + NBUDGET_RR, NBUDGET_RI, NBUDGET_RS, NBUDGET_RG, NBUDGET_RH, NBUDGET_SV1, & + nbustep, tbudgets +USE MODD_CH_AEROSOL, ONLY: LORILAM +USE MODD_CONF +USE MODD_TURB_n, ONLY: XTKEMIN +USE MODD_DUST, ONLY: LDUST +USE MODD_SALT, ONLY: LSALT +USE MODD_DYN +USE MODD_GRID_n +USE MODD_LBC_n, ONLY: CLBCX, CLBCY +USE MODD_NSV, ONLY: XSVMIN, NSV_CHEMBEG, NSV_CHEMEND, & + NSV_AERBEG, NSV_AEREND,& + NSV_DSTBEG, NSV_DSTEND,& + NSV_SLTBEG, NSV_SLTEND,& + NSV_SNWBEG, NSV_SNWEND +USE MODD_PARAM_C2R2, ONLY: LACTIT +USE MODD_PARAM_LIMA, ONLY: LACTIT_LIMA=>LACTIT + +use mode_budget, only: Budget_store_end, Budget_store_init + +USE MODI_SHUMAN +! +USE MODE_ll +! +IMPLICIT NONE +! +!* 0.1 DECLARATIONS OF ARGUMENTS +! +! +REAL, INTENT(IN) :: PTSTEP ! Time step +INTEGER, INTENT(IN) :: KRR ! Number of water var. +INTEGER, INTENT(IN) :: KSV ! Number of scal. var. +INTEGER, INTENT(IN) :: KTCOUNT ! Temporal loop COUNTer +INTEGER, INTENT(IN) :: KMI ! Model index +CHARACTER(LEN=6), INTENT(IN) :: HUVW_ADV_SCHEME ! advection scheme for wind +CHARACTER(LEN=4), INTENT(IN) :: HTEMP_SCHEME ! Temporal scheme +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! (Rho) dry * Jacobian +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PUS,PVS,PWS, & ! + PTHS,PTKES ! variables at +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRS,PSVS ! t+dt +! +REAL, INTENT(IN) :: PDRYMASSS ! Md source +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLSUS,PLSVS,PLSWS,& ! Large Scale + PLSTHS,PLSRVS ! fields tendencies +REAL, DIMENSION(:,:), INTENT(IN) :: PLSZWSS ! Large Scale fields tendencies +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBXUS,PLBXVS,PLBXWS, & ! + PLBXTHS,PLBXTKES ! LBX tendancy +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PLBXRS,PLBXSVS ! +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PLBYUS,PLBYVS,PLBYWS,& ! + PLBYTHS,PLBYTKES ! LBY tendancy +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PLBYRS,PLBYSVS ! +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PUM,PVM,PWM! Variables at t-dt +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PUT,PVT,PWT,PPABST,PTHT,&! + PTKET ! Variables at +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PTHM, PRCM, PPABSM ! Variables at t-Dt +REAL, DIMENSION(:,:,:,:),INTENT(INOUT):: PRT,PSVT ! t +REAL, INTENT(INOUT):: PDRYMASST ! +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PLSUM,PLSVM,PLSWM,& ! Large Scale fields + PLSTHM,PLSRVM ! at t-dt +! +REAL, DIMENSION(:,:), INTENT(INOUT) :: PLSZWSM ! Large Scale fields at t-dt +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PLBXUM,PLBXVM,PLBXWM, & ! + PLBXTHM,PLBXTKEM ! LBX fields +REAL, DIMENSION(:,:,:,:), INTENT(INOUT):: PLBXRM,PLBXSVM ! +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PLBYUM,PLBYVM,PLBYWM, & ! + PLBYTHM,PLBYTKEM ! LBY fields +REAL, DIMENSION(:,:,:,:), INTENT(INOUT):: PLBYRM,PLBYSVM ! +! +REAL, DIMENSION(:,:), INTENT(INOUT) :: PZWS ! significant wave height +! +!* 0.2 DECLARATIONS OF LOCAL VARIABLES +! +INTEGER:: JSV ! loop counters +INTEGER :: IIB, IIE ! index of first and last inner mass points along x +INTEGER :: IJB, IJE ! index of first and last inner mass points along y +real, dimension(:,:,:), allocatable :: zrhodjontime +real, dimension(:,:,:), allocatable :: zwork +! +!------------------------------------------------------------------------------ +! +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +! +!* 1. ASSELIN FILTER +! +IF ((HUVW_ADV_SCHEME(1:3)=='CEN').AND. (HTEMP_SCHEME == 'LEFR')) THEN + IF( KTCOUNT /= 1 .OR. CCONF /= 'START' ) THEN + PUM(:,:,:)=(1.-XASSELIN)*PUT(:,:,:)+0.5*XASSELIN*(PUM(:,:,:)+PUS(:,:,:)) + PVM(:,:,:)=(1.-XASSELIN)*PVT(:,:,:)+0.5*XASSELIN*(PVM(:,:,:)+PVS(:,:,:)) + PWM(:,:,:)=(1.-XASSELIN)*PWT(:,:,:)+0.5*XASSELIN*(PWM(:,:,:)+PWS(:,:,:)) + END IF +END IF + +!* 1. TEMPORAL ADVANCE OF PROGNOSTIC VARIABLES +! +PPABSM(:,:,:) = PPABST(:,:,:) +! +IF (LACTIT .OR. LACTIT_LIMA) THEN + PTHM(:,:,:) = PTHT(:,:,:) + PRCM(:,:,:) = PRT(:,:,:,2) +END IF + +PUT(:,:,:)=PUS(:,:,:) +PVT(:,:,:)=PVS(:,:,:) +PWT(:,:,:)=PWS(:,:,:) +! +PDRYMASST = PDRYMASST + PTSTEP * PDRYMASSS +! +PTHT(:,:,:)=PTHS(:,:,:) +! +! Moisture +! +PRT(:,:,:,1:KRR)=PRS(:,:,:,1:KRR) +! +! Turbulence +! +IF (SIZE(PTKET,1) /= 0) PTKET(:,:,:)=PTKES(:,:,:) +! +! Other scalars +! +PSVT(:,:,:,1:KSV)=PSVS(:,:,:,1:KSV) +! +IF(LBLOWSNOW) THEN + DO JSV=1,(NBLOWSNOW_2D) + XSNWCANO(:,:,JSV) = XRSNWCANOS(:,:,JSV) + END DO +!* MINIMUM VALUE FOR BLOWING SNOW +! + WHERE(XSNWCANO(:,:,:)<1.E-20) + XSNWCANO(:,:,:)=0. + END WHERE + + IF (SIZE(PSVT,4) > 1) THEN + WHERE(PSVT(:,:,:,NSV_SNWBEG:NSV_SNWEND)<1.E-20) + PSVT(:,:,:,NSV_SNWBEG:NSV_SNWEND)=0. + END WHERE + END IF +! +END IF +! +IF (LWEST_ll( ) .AND. CLBCX(1)=='OPEN') THEN + DO JSV=1,KSV + PSVT(IIB,:,:,JSV)=MAX(PSVT(IIB,:,:,JSV),XSVMIN(JSV)) + PSVT(IIB-1,:,:,JSV)=MAX(PSVT(IIB-1,:,:,JSV),XSVMIN(JSV)) + END DO +END IF +! +IF (LEAST_ll( ) .AND. CLBCX(2)=='OPEN') THEN + DO JSV=1,KSV + PSVT(IIE,:,:,JSV)=MAX(PSVT(IIE,:,:,JSV),XSVMIN(JSV)) + PSVT(IIE+1,:,:,JSV)=MAX(PSVT(IIE+1,:,:,JSV),XSVMIN(JSV)) + END DO +END IF +! +IF (LSOUTH_ll( ) .AND. CLBCY(1)=='OPEN') THEN + DO JSV=1,KSV + PSVT(:,IJB,:,JSV)=MAX(PSVT(:,IJB,:,JSV),XSVMIN(JSV)) + PSVT(:,IJB-1,:,JSV)=MAX(PSVT(:,IJB-1,:,JSV),XSVMIN(JSV)) + END DO +END IF +! +IF (LNORTH_ll( ) .AND. CLBCY(2)=='OPEN') THEN + DO JSV=1,KSV + PSVT(:,IJE,:,JSV)=MAX(PSVT(:,IJE,:,JSV),XSVMIN(JSV)) + PSVT(:,IJE+1,:,JSV)=MAX(PSVT(:,IJE+1,:,JSV),XSVMIN(JSV)) + END DO +END IF +!------------------------------------------------------------------------------ +! +!* 4. TEMPORAL ADVANCE OF THE LARGE SCALE FIELDS +! +! +IF (SIZE(PLSUS,1) /= 0) THEN + PLSUM(:,:,:) = PLSUM(:,:,:) + PTSTEP * PLSUS(:,:,:) + PLSVM(:,:,:) = PLSVM(:,:,:) + PTSTEP * PLSVS(:,:,:) + PLSWM(:,:,:) = PLSWM(:,:,:) + PTSTEP * PLSWS(:,:,:) +END IF +! +IF (SIZE(PLSTHS,1) /= 0) THEN + PLSTHM(:,:,:) = PLSTHM(:,:,:) + PTSTEP * PLSTHS(:,:,:) +ENDIF +! +IF (SIZE(PLSRVS,1) /= 0) THEN + PLSRVM(:,:,:) = MAX( PLSRVM(:,:,:) + PTSTEP * PLSRVS(:,:,:) , 0.) +ENDIF + +IF (SIZE(PLSZWSS,1) /= 0) THEN + PLSZWSM(:,:) = MAX( PLSZWSM(:,:) + PTSTEP * PLSZWSS(:,:) , 0.) + PZWS(:,:) = PLSZWSM(:,:) +ENDIF +! +!------------------------------------------------------------------------------ +! +!* 5. TEMPORAL ADVANCE OF THE LATERAL BOUNDARIES FIELDS +! +IF (SIZE(PLBXUS,1) /= 0) THEN + PLBXUM(:,:,:) = PLBXUM(:,:,:) + PTSTEP * PLBXUS(:,:,:) + PLBXVM(:,:,:) = PLBXVM(:,:,:) + PTSTEP * PLBXVS(:,:,:) + PLBXWM(:,:,:) = PLBXWM(:,:,:) + PTSTEP * PLBXWS(:,:,:) +ENDIF +IF (SIZE(PLBYUS,1) /= 0) THEN + PLBYUM(:,:,:) = PLBYUM(:,:,:) + PTSTEP * PLBYUS(:,:,:) + PLBYVM(:,:,:) = PLBYVM(:,:,:) + PTSTEP * PLBYVS(:,:,:) + PLBYWM(:,:,:) = PLBYWM(:,:,:) + PTSTEP * PLBYWS(:,:,:) +ENDIF +! +IF (SIZE(PLBXTHS,1) /= 0) THEN + PLBXTHM(:,:,:) = PLBXTHM(:,:,:) + PTSTEP * PLBXTHS(:,:,:) +END IF +IF (SIZE(PLBYTHS,1) /= 0) THEN + PLBYTHM(:,:,:) = PLBYTHM(:,:,:) + PTSTEP * PLBYTHS(:,:,:) +END IF +! +IF (SIZE(PLBXTKES,1) /= 0) THEN + PLBXTKEM(:,:,:) = MAX( PLBXTKEM(:,:,:) + PTSTEP * PLBXTKES(:,:,:), XTKEMIN) +END IF +IF (SIZE(PLBYTKES,1) /= 0) THEN + PLBYTKEM(:,:,:) = MAX( PLBYTKEM(:,:,:) + PTSTEP * PLBYTKES(:,:,:), XTKEMIN) +END IF +! +IF (SIZE(PLBXRS,1) /= 0) THEN + PLBXRM(:,:,:,:) = MAX( PLBXRM(:,:,:,:) + PTSTEP * PLBXRS(:,:,:,:), 0.) +END IF +IF (SIZE(PLBYRS,1) /= 0) THEN + PLBYRM(:,:,:,:) = MAX( PLBYRM(:,:,:,:) + PTSTEP * PLBYRS(:,:,:,:), 0.) +END IF +! +IF (SIZE(PLBXSVS,1) /= 0) THEN + DO JSV = 1,KSV + PLBXSVM(:,:,:,JSV) = MAX( PLBXSVM(:,:,:,JSV) + PTSTEP * PLBXSVS(:,:,:,JSV),XSVMIN(JSV)) + ENDDO +ENDIF +IF (SIZE(PLBYSVS,1) /= 0) THEN + DO JSV = 1,KSV + PLBYSVM(:,:,:,JSV) = MAX( PLBYSVM(:,:,:,JSV) + PTSTEP * PLBYSVS(:,:,:,JSV),XSVMIN(JSV)) + ENDDO +END IF +! +!------------------------------------------------------------------------------ +! +!* 6. MINIMUM VALUE FOR HYDROMETEORS +! +IF (SIZE(PRT,4) > 1) THEN + WHERE(PRT(:,:,:,2:)<1.E-20) + PRT(:,:,:,2:)=0. + END WHERE +END IF +IF (SIZE(PLBXRM,4) > 1) THEN + WHERE(PLBXRM(:,:,:,2:)<1.E-20) + PLBXRM(:,:,:,2:)=0. + END WHERE +END IF +IF (SIZE(PLBYRM,4) > 1) THEN + WHERE(PLBYRM(:,:,:,2:)<1.E-20) + PLBYRM(:,:,:,2:)=0. + END WHERE +END IF +! +!------------------------------------------------------------------------------ +! +!* 7. MINIMUM VALUE FOR CHEMISTRY +! +IF ((SIZE(PLBXSVM,4) > NSV_CHEMEND-1).AND.(SIZE(PLBXSVM,1) /= 0)) THEN + DO JSV=NSV_CHEMBEG, NSV_CHEMEND + PLBXSVM(:,:,:,JSV) = MAX(PLBXSVM(:,:,:,JSV), XSVMIN(JSV)) + END DO +END IF +IF ((SIZE(PLBYSVM,4) > NSV_CHEMEND-1).AND.(SIZE(PLBYSVM,1) /= 0)) THEN + DO JSV=NSV_CHEMBEG, NSV_CHEMEND + PLBYSVM(:,:,:,JSV) = MAX(PLBYSVM(:,:,:,JSV), XSVMIN(JSV)) + END DO +END IF +! +!------------------------------------------------------------------------------ +! +!* 8. MINIMUM VALUE FOR AEROSOLS +! +IF (LORILAM) THEN + IF ((SIZE(PLBXSVM,4) > NSV_AEREND-1).AND.(SIZE(PLBXSVM,1) /= 0)) THEN + DO JSV=NSV_AERBEG, NSV_AEREND + PLBXSVM(:,:,:,JSV) = MAX(PLBXSVM(:,:,:,JSV), XSVMIN(JSV)) + END DO + END IF + IF ((SIZE(PLBYSVM,4) > NSV_AEREND-1).AND.(SIZE(PLBYSVM,1) /= 0)) THEN + DO JSV=NSV_AERBEG, NSV_AEREND + PLBYSVM(:,:,:,JSV) = MAX(PLBYSVM(:,:,:,JSV), XSVMIN(JSV)) + END DO + END IF +END IF +! +!------------------------------------------------------------------------------ +! +!* 9. MINIMUM VALUE FOR DUSTS +! +IF (LDUST) THEN + IF ((SIZE(PLBXSVM,4) > NSV_DSTEND-1).AND.(SIZE(PLBXSVM,1) /= 0)) THEN + DO JSV=NSV_DSTBEG, NSV_DSTEND + PLBXSVM(:,:,:,JSV) = MAX(PLBXSVM(:,:,:,JSV), XSVMIN(JSV)) + END DO + END IF + IF ((SIZE(PLBYSVM,4) > NSV_DSTEND-1).AND.(SIZE(PLBYSVM,1) /= 0)) THEN + DO JSV=NSV_DSTBEG, NSV_DSTEND + PLBYSVM(:,:,:,JSV) = MAX(PLBYSVM(:,:,:,JSV), XSVMIN(JSV)) + END DO + END IF +END IF +! +!------------------------------------------------------------------------------ +! +!* 9. MINIMUM VALUE FOR SEA SALTS +! +IF (LSALT) THEN + IF ((SIZE(PLBXSVM,4) > NSV_SLTEND-1).AND.(SIZE(PLBXSVM,1) /= 0)) THEN + DO JSV=NSV_SLTBEG, NSV_SLTEND + PLBXSVM(:,:,:,JSV) = MAX(PLBXSVM(:,:,:,JSV), XSVMIN(JSV)) + END DO + END IF + IF ((SIZE(PLBYSVM,4) > NSV_SLTEND-1).AND.(SIZE(PLBYSVM,1) /= 0)) THEN + DO JSV=NSV_SLTBEG, NSV_SLTEND + PLBYSVM(:,:,:,JSV) = MAX(PLBYSVM(:,:,:,JSV), XSVMIN(JSV)) + END DO + END IF +END IF +! +!------------------------------------------------------------------------------ +! +!* 11. STORAGE IN BUDGET ARRAYS +! +IF (LBU_ENABLE) THEN + !Division by nbustep to compute average on the selected time period + if ( lbudget_u .or. lbudget_v .or. lbudget_w .or. lbudget_th & + .or. lbudget_tke .or. lbudget_rv .or. lbudget_rc .or. lbudget_rr .or. lbudget_ri & + .or. lbudget_rs .or. lbudget_rg .or. lbudget_rh .or. lbudget_sv ) then + Allocate( zrhodjontime, mold = prhodj ) + Allocate( zwork, mold = prhodj ) + zrhodjontime(:, :, :) = prhodj(:, :, :) / ( ptstep * nbustep ) + end if + + if ( lbudget_u ) call Budget_store_end( tbudgets(NBUDGET_U ), 'AVEF', put (:, :, :) * zrhodjontime(:, :, :) ) + if ( lbudget_v ) call Budget_store_end( tbudgets(NBUDGET_V ), 'AVEF', pvt (:, :, :) * zrhodjontime(:, :, :) ) + if ( lbudget_w ) call Budget_store_end( tbudgets(NBUDGET_W ), 'AVEF', pwt (:, :, :) * zrhodjontime(:, :, :) ) + if ( lbudget_th ) call Budget_store_end( tbudgets(NBUDGET_TH ), 'AVEF', ptht (:, :, :) * zrhodjontime(:, :, :) ) + if ( lbudget_tke ) call Budget_store_end( tbudgets(NBUDGET_TKE), 'AVEF', ptket(:, :, :) * zrhodjontime(:, :, :) ) + if ( lbudget_rv ) call Budget_store_end( tbudgets(NBUDGET_RV ), 'AVEF', prt (:, :, :, 1) * zrhodjontime(:, :, :) ) + if ( lbudget_rc ) call Budget_store_end( tbudgets(NBUDGET_RC ), 'AVEF', prt (:, :, :, 2) * zrhodjontime(:, :, :) ) + if ( lbudget_rr ) call Budget_store_end( tbudgets(NBUDGET_RR ), 'AVEF', prt (:, :, :, 3) * zrhodjontime(:, :, :) ) + if ( lbudget_ri ) call Budget_store_end( tbudgets(NBUDGET_RI ), 'AVEF', prt (:, :, :, 4) * zrhodjontime(:, :, :) ) + if ( lbudget_rs ) call Budget_store_end( tbudgets(NBUDGET_RS ), 'AVEF', prt (:, :, :, 5) * zrhodjontime(:, :, :) ) + if ( lbudget_rg ) call Budget_store_end( tbudgets(NBUDGET_RG ), 'AVEF', prt (:, :, :, 6) * zrhodjontime(:, :, :) ) + if ( lbudget_rh ) call Budget_store_end( tbudgets(NBUDGET_RH ), 'AVEF', prt (:, :, :, 7) * zrhodjontime(:, :, :) ) + if ( lbudget_sv ) then + do jsv = 1, ksv + call Budget_store_end( tbudgets(jsv + NBUDGET_SV1 - 1), 'AVEF', psvt(:, :, :, jsv) * zrhodjontime(:, :, :) ) + end do + end if + + if ( lbudget_u ) then + zwork(:, :, :) = pus (:, :, :) * Mxm( prhodj(:, :, :) ) / ptstep + call Budget_store_end( tbudgets(NBUDGET_U ), 'ENDF', zwork ) + call Budget_store_init( tbudgets(NBUDGET_U ), 'ASSE', zwork ) + end if + + if ( lbudget_v ) then + zwork(:, :, :) = pvs (:, :, :) * Mym( prhodj(:, :, :) ) / ptstep + call Budget_store_end( tbudgets(NBUDGET_V ), 'ENDF', zwork ) + call Budget_store_init( tbudgets(NBUDGET_V ), 'ASSE', zwork ) + end if + + if ( lbudget_w ) then + zwork(:, :, :) = pws (:, :, :) * Mzm( prhodj(:, :, :) ) / ptstep + call Budget_store_end( tbudgets(NBUDGET_W ), 'ENDF', zwork ) + call Budget_store_init( tbudgets(NBUDGET_W ), 'ASSE', zwork ) + end if + + if ( lbudget_th .or. lbudget_tke .or. lbudget_rv .or. lbudget_rc .or. lbudget_rr & + .or. lbudget_ri .or. lbudget_rs .or. lbudget_rg .or. lbudget_rh .or. lbudget_sv ) then + zrhodjontime(:, :, :) = prhodj(:, :, :) / ptstep + end if + + if ( lbudget_th ) then + zwork(:, :, :) = pths (:, :, :) * zrhodjontime(:, :, :) + call Budget_store_end( tbudgets(NBUDGET_TH ), 'ENDF', zwork ) + call Budget_store_init( tbudgets(NBUDGET_TH ), 'ASSE', zwork ) + end if + + if ( lbudget_tke ) then + zwork(:, :, :) = ptkes(:, :, :) * zrhodjontime(:, :, :) + call Budget_store_end( tbudgets(NBUDGET_TKE), 'ENDF', zwork ) + call Budget_store_init( tbudgets(NBUDGET_TKE), 'ASSE', zwork ) + end if + + if ( lbudget_rv ) then + zwork(:, :, :) = prs (:, :, :, 1) * zrhodjontime(:, :, :) + call Budget_store_end( tbudgets(NBUDGET_RV ), 'ENDF', zwork ) + call Budget_store_init( tbudgets(NBUDGET_RV ), 'ASSE', zwork ) + end if + + if ( lbudget_rc ) then + zwork(:, :, :) = prs (:, :, :, 2) * zrhodjontime(:, :, :) + call Budget_store_end( tbudgets(NBUDGET_RC ), 'ENDF', zwork ) + call Budget_store_init( tbudgets(NBUDGET_RC ), 'ASSE', zwork ) + end if + + if ( lbudget_rr ) then + zwork(:, :, :) = prs (:, :, :, 3) * zrhodjontime(:, :, :) + call Budget_store_end( tbudgets(NBUDGET_RR ), 'ENDF', zwork ) + call Budget_store_init( tbudgets(NBUDGET_RR ), 'ASSE', zwork ) + end if + + if ( lbudget_ri ) then + zwork(:, :, :) = prs (:, :, :, 4) * zrhodjontime(:, :, :) + call Budget_store_end( tbudgets(NBUDGET_RI ), 'ENDF', zwork ) + call Budget_store_init( tbudgets(NBUDGET_RI ), 'ASSE', zwork ) + end if + + if ( lbudget_rs ) then + zwork(:, :, :) = prs (:, :, :, 5) * zrhodjontime(:, :, :) + call Budget_store_end( tbudgets(NBUDGET_RS ), 'ENDF', zwork ) + call Budget_store_init( tbudgets(NBUDGET_RS ), 'ASSE', zwork ) + end if + + if ( lbudget_rg ) then + zwork(:, :, :) = prs (:, :, :, 6) * zrhodjontime(:, :, :) + call Budget_store_end( tbudgets(NBUDGET_RG ), 'ENDF', zwork ) + call Budget_store_init( tbudgets(NBUDGET_RG ), 'ASSE', zwork ) + end if + + if ( lbudget_rh ) then + zwork(:, :, :) = prs (:, :, :, 7) * zrhodjontime(:, :, :) + call Budget_store_end( tbudgets(NBUDGET_RH ), 'ENDF', zwork ) + call Budget_store_init( tbudgets(NBUDGET_RH ), 'ASSE', zwork ) + end if + + if ( lbudget_sv ) then + do jsv = 1, ksv + zwork(:, :, :) = psvs(:, :, :, jsv) * zrhodjontime(:, :, :) + call Budget_store_end( tbudgets(jsv + NBUDGET_SV1 - 1), 'ENDF', zwork ) + call Budget_store_init( tbudgets(jsv + NBUDGET_SV1 - 1), 'ASSE', zwork ) + end do + end if + + if ( Allocated( zwork ) ) Deallocate( zwork ) + if ( Allocated( zrhodjontime ) ) Deallocate( zrhodjontime ) +END IF +! +!------------------------------------------------------------------------------ +! +!* 12. COMPUTATION OF PHASE VELOCITY +! ----------------------------- +! +! It is temporarily set to a constant value +! +!------------------------------------------------------------------------------ +! +! +END SUBROUTINE ENDSTEP diff --git a/src/mesonh/ext/flash_geom_elec.f90 b/src/mesonh/ext/flash_geom_elec.f90 new file mode 100644 index 0000000000000000000000000000000000000000..99b77e1c68f3ac3f41936d42cb5735cd6feb3fd9 --- /dev/null +++ b/src/mesonh/ext/flash_geom_elec.f90 @@ -0,0 +1,2877 @@ +!MNH_LIC Copyright 2010-2020 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_FLASH_GEOM_ELEC_n +! ############################# +! +INTERFACE + SUBROUTINE FLASH_GEOM_ELEC_n (KTCOUNT, KMI, KRR, PTSTEP, OEXIT, & + PRHODJ, PRHODREF, PRT, PCIT, PRSVS, PRS, PTHT, PPABST, & + PEFIELDU, PEFIELDV, PEFIELDW, PZZ, PSVS_LINOX, & + TPFILE_FGEOM_DIAG, TPFILE_FGEOM_COORD, TPFILE_LMA, & + PTOWN, PSEA ) +! +USE MODD_IO, ONLY: TFILEDATA +! +INTEGER, INTENT(IN) :: KTCOUNT ! Temporal loop counter +INTEGER, INTENT(IN) :: KMI ! current model index +INTEGER, INTENT(IN) :: KRR ! number of moist variables +REAL, INTENT(IN) :: PTSTEP ! Double time step except for + ! cold start +LOGICAL, INTENT(IN) :: OEXIT ! switch for the end of the temporal loop +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF ! Reference dry air density +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Dry density * Jacobian +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRT ! Moist variables at time t +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PCIT ! Pristine ice n.c. at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRSVS ! Scalar variables source term +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PEFIELDU ! x-component of the electric field +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PEFIELDV ! y-component of the electric field +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PEFIELDW ! z-component of the electric field +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRS ! Moist variables vol. source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHT ! Theta (K) at time t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABST ! Absolute pressure at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! height +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSVS_LINOX ! NOx source term +TYPE(TFILEDATA), INTENT(IN) :: TPFILE_FGEOM_DIAG +TYPE(TFILEDATA), INTENT(IN) :: TPFILE_FGEOM_COORD +TYPE(TFILEDATA), INTENT(IN) :: TPFILE_LMA +REAL, DIMENSION(:,:), OPTIONAL, INTENT(IN) :: PTOWN ! town fraction +REAL, DIMENSION(:,:), OPTIONAL, INTENT(IN) :: PSEA ! Land-sea mask +! +END SUBROUTINE FLASH_GEOM_ELEC_n +END INTERFACE +END MODULE MODI_FLASH_GEOM_ELEC_n +! +! +! ###################################################################################### + SUBROUTINE FLASH_GEOM_ELEC_n (KTCOUNT, KMI, KRR, PTSTEP, OEXIT, & + PRHODJ, PRHODREF, PRT, PCIT, PRSVS, PRS, PTHT, PPABST, & + PEFIELDU, PEFIELDV, PEFIELDW, PZZ, PSVS_LINOX, & + TPFILE_FGEOM_DIAG, TPFILE_FGEOM_COORD, TPFILE_LMA, & + PTOWN, PSEA ) +! ###################################################################################### +! +!!**** * - +!! +!! PURPOSE +!! ------- +!! The purpose of this routine is to compute the lightning flash path, +!! and to neutralize the electric charge along the lightning channel. +!! +!! +!! METHOD +!! ------ +!! +!! EXTERNAL +!! -------- +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! C. Barthe * LACy * +!! +!! MODIFICATIONS +!! ------------- +!! Original : Jan. 2010 +!! Modifications: +!! M. Chong * LA * Juin 2010 : add small ions +!! J-P Pinty * LA * Feb. 2013 : add LMA storage +!! J-P Pinty * LA * Nov. 2013 : add flash map storage +!! M. Chong * LA * Juin 2010 : add LiNOx +!! C. Barthe * LACy * Jan. 2015 : convert trig. pt into lat,lon in ascii file +!! J.Escobar : 18/12/2015 : Correction of bug in bound in // for NHALO <>1 +!! J.Escobar : 28/03/2018 : Correction of multiple // bug & compiler indepedent mnh_random_number +!! J.Escobar : 20/06/2018 : Correction of computation of global index I8VECT +!! J.Escobar : 10/12/2018 : // Correction , mpi_bcast CG & CG_POS parameter +!! & initialize INBLIGHT on all proc for filling/saving AREA* arrays +! P. Wautelet 10/01/2019: use NEWUNIT argument of OPEN +! P. Wautelet 22/01/2019: use standard FLUSH statement instead of non standard intrinsics!! +! P. Wautelet 22/02/2019: use MOD intrinsics with same kind for all arguments (to respect Fortran standard) +! P. Wautelet 10/04/2019: replace ABORT and STOP calls by Print_msg +! P. Wautelet 19/04/2019: use modd_precision kinds +! P. Wautelet 26/04/2019: use modd_precision parameters for datatypes of MPI communications +! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function +! P. Wautelet 20/05/2019: add name argument to ADDnFIELD_ll + new ADD4DFIELD_ll subroutine +! P. Wautelet 18/09/2019: correct support of 64bit integers (MNH_INT=8) +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_ARGSLIST_ll, ONLY: LIST_ll +USE MODD_CONF, ONLY: CEXP, LCARTESIAN +USE MODD_CST, ONLY: XAVOGADRO, XMD +USE MODD_DYN_n, ONLY: XDXHATM, XDYHATM, NSTOP +USE MODD_ELEC_DESCR +USE MODD_ELEC_FLASH +USE MODD_ELEC_PARAM, ONLY: XFQLIGHTR, XEXQLIGHTR, & + XFQLIGHTI, XEXQLIGHTI, & + XFQLIGHTS, XEXQLIGHTS, & + XFQLIGHTG, XEXQLIGHTG, & + XFQLIGHTH, XEXQLIGHTH, & + XFQLIGHTC +USE MODD_GRID, ONLY: XLATORI,XLONORI +USE MODD_GRID_n, ONLY: XXHAT, XYHAT, XZHAT +USE MODD_IO, ONLY: TFILEDATA +USE MODD_LMA_SIMULATOR +USE MODD_METRICS_n, ONLY: XDXX, XDYY, XDZZ ! in linox_production +USE MODD_NSV, ONLY: NSV_ELECBEG, NSV_ELECEND, NSV_ELEC +USE MODD_PARAMETERS, ONLY: JPHEXT, JPVEXT +use MODD_PRECISION, only: MNHINT_MPI, MNHLOG_MPI, MNHREAL_MPI +USE MODD_RAIN_ICE_DESCR_n, ONLY: XLBR, XLBEXR, XLBS, XLBEXS, & + XLBG, XLBEXG, XLBH, XLBEXH, & + XRTMIN +USE MODD_SUB_ELEC_n +USE MODD_TIME_n +USE MODD_VAR_ll, ONLY: NPROC,NMNH_COMM_WORLD +! +USE MODE_ELEC_ll +USE MODE_GRIDPROJ +USE MODE_ll +USE MODE_MPPDB +#ifdef MNH_PGI +USE MODE_PACK_PGI +#endif +! +USE MODI_ION_ATTACH_ELEC +USE MODI_SHUMAN +USE MODI_TO_ELEC_FIELD_n +! +IMPLICIT NONE +! +! +! 0.1 Declaration of arguments +! +INTEGER, INTENT(IN) :: KTCOUNT ! Temporal loop counter +INTEGER, INTENT(IN) :: KMI ! current model index +INTEGER, INTENT(IN) :: KRR ! number of moist variables +REAL, INTENT(IN) :: PTSTEP ! Double time step except for + ! cold start +LOGICAL, INTENT(IN) :: OEXIT ! switch for the end of the temporal loop +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF ! Reference dry air density +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Dry density * Jacobian +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRT ! Moist variables at time t +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PCIT ! Pristine ice n.c. at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRSVS ! Scalar variables source term +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PEFIELDU ! x-component of the electric field +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PEFIELDV ! y-component of the electric field +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PEFIELDW ! z-component of the electric field +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRS ! Moist variables vol. source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHT ! Theta (K) at time t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABST ! Absolute pressure at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! height +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSVS_LINOX ! NOx source term +TYPE(TFILEDATA), INTENT(IN) :: TPFILE_FGEOM_DIAG +TYPE(TFILEDATA), INTENT(IN) :: TPFILE_FGEOM_COORD +TYPE(TFILEDATA), INTENT(IN) :: TPFILE_LMA +REAL, DIMENSION(:,:), OPTIONAL, INTENT(IN) :: PTOWN ! town fraction +REAL, DIMENSION(:,:), OPTIONAL, INTENT(IN) :: PSEA ! Land-sea mask +! +! +! 0.2 Declaration of local variables +! +INTEGER :: IIB, IIE ! index values of the first and last inner mass points along x +INTEGER :: IJB, IJE ! index values of the first and last inner mass points along y +INTEGER :: IKB, IKE ! index values of the first and last inner mass points along z +INTEGER :: II, IJ, IK, IL, IM, IPOINT ! loop indexes +INTEGER :: IX, IY, IZ +INTEGER :: IXOR, IYOR ! origin of the extended subdomain +INTEGER :: INB_CELL ! Number of detected electrified cells +INTEGER :: IPROC_CELL ! Proc with the center of the cell +INTEGER :: IICOORD, IJCOORD, IKCOORD ! local indexes of the cell center / max electric field +INTEGER :: IPROC ! my proc number +INTEGER :: IINFO_ll ! return code of parallel routine +INTEGER :: COUNT_BEF ! nb of pts in zcell before testing neighbour pts +INTEGER :: COUNT_AFT ! nb of pts in zcell after testing neighbour pts +INTEGER :: INBFTS_MAX ! Max number of flashes per time step / cell +INTEGER :: IIBL_LOC ! local i index of the ongoing bi-leader segment +INTEGER :: IJBL_LOC ! local j index of the ongoing bi-leader segment +INTEGER :: IKBL ! k index of the ongoing bi-leader segment +INTEGER :: II_TRIG_LOC ! local i index of the triggering point +INTEGER :: IJ_TRIG_LOC ! local j index of the triggering point +INTEGER :: II_TRIG_GLOB ! global i index of the potential triggering pt +INTEGER :: IJ_TRIG_GLOB ! global j index of the potential triggering pt +INTEGER :: IK_TRIG ! k index of the triggering point +INTEGER :: ISIGN_LEADER ! sign of the leader +INTEGER :: IPROC_AUX ! proc number for max_ll and min_ll +INTEGER :: IIND_MAX ! max nb of indexes between the trig. pt and the possible branches +INTEGER :: IIND_MIN ! min nb of indexes between the trig. pt and the possible branches +INTEGER :: IDELTA_IND ! number of indexes between iind_max and iind_min +INTEGER :: IPT_DIST ! nb of possible pts for branching on each proc +INTEGER :: IPT_DIST_GLOB ! global nb of possible pts for branching +INTEGER :: IFOUND ! if =1, then the random selection is successful +INTEGER :: ICHOICE_LOCX ! local i indice for random choice +INTEGER :: ICHOICE_LOCY ! local j indice for random choice +INTEGER :: ICHOICE_Z ! k indice for random choice +INTEGER :: INB_PROP ! nb of pts where the flash can propagate +INTEGER :: INB_NEUT ! nb of pts to neutralize +INTEGER :: INB_NEUT_OK ! nb of effective flash neutralization +INTEGER :: ISTOP +INTEGER :: IERR ! error status +INTEGER :: IWORK +INTEGER :: ICHOICE +INTEGER :: IIMIN, IIMAX, IJMIN, IJMAX, IKMIN, IKMAX +INTEGER :: IPOS_LEADER, INEG_LEADER +INTEGER :: INBLIGHT +INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: ITYPE ! flash type (IC, CGN or CGP) +INTEGER, DIMENSION(:), ALLOCATABLE :: INBSEG_LEADER ! number of segments in the leader +INTEGER, DIMENSION(:), ALLOCATABLE :: ISIGNE_EZ ! sign of the vertical electric field + ! component at the trig. pt +INTEGER, DIMENSION(:), ALLOCATABLE :: IPROC_TRIG ! proc that contains the triggering point +INTEGER, DIMENSION(:), ALLOCATABLE :: INBSEG ! Number of segments per flash +INTEGER, DIMENSION(:), ALLOCATABLE :: INBSEG_ALL ! Number of segments, all processes +INTEGER, DIMENSION(NPROC) :: INBSEG_PROC ! ------------------ per process +INTEGER, DIMENSION(:), ALLOCATABLE :: INB_FLASH ! Number of flashes per time step / cell +INTEGER, DIMENSION(:), ALLOCATABLE :: INB_FL_REAL ! Effective Number of flashes per timestep/cell +INTEGER, DIMENSION(:), ALLOCATABLE :: IHIST_LOC ! local nb of possible branches at [r,r+dr] +INTEGER, DIMENSION(:), ALLOCATABLE :: IHIST_GLOB ! global nb of possible branches at [r,r+dr] + ! at [r,r+dr] on each proc +INTEGER, DIMENSION(:), ALLOCATABLE :: IMAX_BRANCH ! max nb of branches at [r,r+dr] + ! proportional to the percentage of + ! available pts / proc at this distance +INTEGER, DIMENSION(:,:), ALLOCATABLE :: ISEG_LOC ! Local indexes of the flash segments +INTEGER, DIMENSION(:,:), ALLOCATABLE :: ICELL_LOC ! local indexes + proc of the cell 'center' +INTEGER, DIMENSION(:,:,:), ALLOCATABLE :: IMASKQ_DIST ! contains the distance/indice + ! from the triggering pt +! +LOGICAL :: GPOSITIVE ! if T, positive charge regions where the negative part + ! of the leader propagates +LOGICAL :: GEND_DOMAIN ! no more points with E > E_threshold +LOGICAL :: GEND_CELL ! if T, end of the cell +LOGICAL :: GCG ! if true, the flash is a CG +LOGICAL :: GCG_POS ! if true, the flash is a +CG +LOGICAL :: GNEUTRALIZATION +LOGICAL :: GNEW_FLASH_GLOB +LOGICAL, DIMENSION(:), ALLOCATABLE :: GNEW_FLASH +LOGICAL, DIMENSION(:,:,:), ALLOCATABLE :: GATTACH ! if T, ion recombination and + ! attachment +LOGICAL, DIMENSION(:,:,:), ALLOCATABLE :: GPOSS ! if T, new cell possible at this pt +LOGICAL, DIMENSION(:,:,:,:), ALLOCATABLE :: GPROP ! if T, propagation possible at this pt +! +REAL :: ZE_TRIG_THRES ! Triggering Electric field threshold corrected for + ! pressure +REAL :: ZMAXE ! Max electric field module (V/m) +REAL :: ZEMOD_BL ! E module at the tip of the last segment of the leader (V/m) +REAL :: ZMEAN_GRID ! mean grid size +REAL :: ZMAX_DIST ! max distance between the triggering pt and the possible branches +REAL :: ZMIN_DIST ! min distance between the triggering pt and the possible branches +REAL :: ZRANDOM ! random number +REAL :: ZQNET ! net charge carried by the flash (C/kg) +REAL :: ZCLOUDLIM ! cloud limit +REAL :: ZSIGMIN ! min efficient cross section +REAL :: ZLAT, ZLON ! lat,lon coordinates of the triggering points if not lcartesian +! +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZQMT ! mass charge density (C/kg) +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZCELL ! define the electrified cells +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZSIGMA ! efficient cross section of hydrometeors +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZDQDT ! charge to neutralize at each pt (C/kg) +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZFLASH ! = 1 if the flash leader reaches this pt + ! = 2 if the flash branch is concerned +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZLBDAR ! Lambda for rain +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZLBDAS ! Lambda for snow +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZLBDAG ! Lambda for graupel +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZLBDAH ! Lambda for hail +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZQMTOT ! total mass charge density (C/kg) +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZCLOUD ! total mixing ratio (kg/kg) +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZEMODULE ! Electric field module (V/m) +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDIST ! distance between the trig. pt and the cell pts (m) +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZSIGLOB ! sum of the cross sections +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZQFLASH ! total charge in excess of xqexcess (C/kg) +REAL, DIMENSION(:,:), ALLOCATABLE :: ZCOORD_TRIG ! Global coordinates of triggering point +REAL, DIMENSION(:,:), ALLOCATABLE :: ZCOORD_SEG ! Global coordinates of segments +REAL, DIMENSION(:), ALLOCATABLE :: ZEM_TRIG ! Electric field module at the triggering pt +REAL, DIMENSION(:), ALLOCATABLE :: ZNEUT_POS ! Positive charge neutralized at each segment +REAL, DIMENSION(:), ALLOCATABLE :: ZNEUT_NEG ! Negative charge neutralized at each segment +INTEGER, DIMENSION(:,:), ALLOCATABLE :: ISEG_GLOB ! Global indexes of LMA segments +INTEGER, DIMENSION(:,:), ALLOCATABLE :: ILMA_SEG_ALL ! Global indexes of LMA segments +REAL, DIMENSION(:,:), ALLOCATABLE :: ZLMA_QMT ! Particle charge at neutralization point +REAL, DIMENSION(:,:), ALLOCATABLE :: ZLMA_PRT ! Particle mixing ratio at neutralization point +REAL, DIMENSION(:,:), ALLOCATABLE :: ZLMA_NEUT_POS +REAL, DIMENSION(:,:), ALLOCATABLE :: ZLMA_NEUT_NEG +REAL, DIMENSION(:,:), ALLOCATABLE :: ZCOORD_SEG_ALL +REAL, DIMENSION(:), ALLOCATABLE :: ZEMAX ! Max electric field in each cell +REAL, DIMENSION(:), ALLOCATABLE :: ZHIST_PERCENT ! percentage of possible branches at [r,r+dr] on each proc +REAL, DIMENSION(:), ALLOCATABLE :: ZMAX_BRANCH ! max nb of branches at [r,r+dr] +REAL, DIMENSION(:), ALLOCATABLE :: ZVECT +! +! Storage for nflash_write flashes before writing output files (denoted xSxxx) +INTEGER, SAVE :: ISAVE_STATUS ! 0: print and save + ! 1: save only + ! 2: print only +! +TYPE(LIST_ll), POINTER :: TZFIELDS_ll=> NULL() ! list of fields to exchange +! +! Storage for the localization of the flashes +LOGICAL :: GFIRSTFLASH +INTEGER,DIMENSION(SIZE(PRT,1),SIZE(PRT,2)) :: IMAP2D +! +! Storage for the NOx production terms +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZLNOX +REAL :: ZLGHTLENGTH, ZCOEF +INTEGER :: IFLASH_COUNT, IFLASH_COUNT_GLOB ! Total number of flashes within the timestep +! +REAL,DIMENSION(SIZE(PRT,1),SIZE(PRT,2)) :: ZCELL_NEW +! +INTEGER :: ILJ +INTEGER :: NIMAX_ll, NJMAX_ll,IIU_ll,IJU_ll ! dimensions of global domain +! +!------------------------------------------------------------------------------- +! +!* 1. INITIALIZATION +! -------------- +CALL MYPROC_ELEC_ll(IPROC) +! +!* 1.1 subdomains indexes +! +! beginning and end indexes of the physical subdomain +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +IKB = 1 + JPVEXT +IKE = SIZE(PRT,3) - JPVEXT +! +! global indexes of the local subdomains origin +CALL GET_GLOBALDIMS_ll (NIMAX_ll,NJMAX_ll) +CALL GET_OR_ll('B',IXOR,IYOR) +IIU_ll = NIMAX_ll + 2*JPHEXT +IJU_ll = NJMAX_ll + 2*JPHEXT +! +! +!* 1.2 allocations and initializations +! +! +! from the litterature, the max number of flash per minute is ~ 1000 +! this value is used here as the max number of flash per minute per cell +INBFTS_MAX = ANINT(1000 * PTSTEP / 60) +! +IF (GEFIRSTCALL) THEN + GEFIRSTCALL = .FALSE. + ALLOCATE (ZXMASS(SIZE(XXHAT))) + ALLOCATE (ZYMASS(SIZE(XYHAT))) + ALLOCATE (ZZMASS(SIZE(PZZ,1), SIZE(PZZ,2), SIZE(PZZ,3))) + ALLOCATE (ZPRES_COEF(SIZE(PZZ,1), SIZE(PZZ,2), SIZE(PZZ,3))) + IF(LLMA) THEN + ALLOCATE (ZLMA_LAT(NFLASH_WRITE, NBRANCH_MAX)) + ALLOCATE (ZLMA_LON(NFLASH_WRITE, NBRANCH_MAX)) + ALLOCATE (ZSLMA_NEUT_POS(NFLASH_WRITE, NBRANCH_MAX)) + ALLOCATE (ZSLMA_NEUT_NEG(NFLASH_WRITE, NBRANCH_MAX)) + ALLOCATE (ISLMA_SEG_GLOB(NFLASH_WRITE, NBRANCH_MAX, 3)) + ALLOCATE (ZSLMA_QMT(NFLASH_WRITE, NBRANCH_MAX, SIZE(PRSVS,4))) + ALLOCATE (ZSLMA_PRT(NFLASH_WRITE, NBRANCH_MAX, SIZE(PRSVS,4))) + ISLMA_SEG_GLOB(:,:,:) = 0 + END IF + ALLOCATE (ZSCOORD_SEG(NFLASH_WRITE, NBRANCH_MAX, 3)) ! NFLASH_WRITE nb of flash to be stored + ! before writing in files + ! NBRANCH_MAX=5000 default + ALLOCATE (ISFLASH_NUMBER(0:NFLASH_WRITE)) + ALLOCATE (ISNB_FLASH(NFLASH_WRITE)) + ALLOCATE (ISCELL_NUMBER(NFLASH_WRITE)) + ALLOCATE (ISNBSEG(NFLASH_WRITE)) + ALLOCATE (ISTCOUNT_NUMBER(NFLASH_WRITE)) + ALLOCATE (ISTYPE(NFLASH_WRITE)) + ALLOCATE (ZSEM_TRIG(NFLASH_WRITE)) + ALLOCATE (ZSNEUT_POS(NFLASH_WRITE)) + ALLOCATE (ZSNEUT_NEG(NFLASH_WRITE)) +! + ZXMASS(IIB:IIE) = 0.5 * (XXHAT(IIB:IIE) + XXHAT(IIB+1:IIE+1)) + ZYMASS(IJB:IJE) = 0.5 * (XYHAT(IJB:IJE) + XYHAT(IJB+1:IJE+1)) + ZZMASS = MZF(PZZ) + ZPRES_COEF = EXP(ZZMASS/8400.) + ZSCOORD_SEG(:,:,:) = 0.0 + ISAVE_STATUS = 1 + ISFLASH_NUMBER(:) = 0 +END IF +! +ALLOCATE (ZQMT(SIZE(PRSVS,1),SIZE(PRSVS,2),SIZE(PRSVS,3),SIZE(PRSVS,4))) +ALLOCATE (ZQMTOT(SIZE(PRSVS,1),SIZE(PRSVS,2),SIZE(PRSVS,3))) +ALLOCATE (ZCLOUD(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3))) +ALLOCATE (GPOSS(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3))) +ALLOCATE (ZEMODULE(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3))) +ALLOCATE (ZCELL(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3),NMAX_CELL)) + +! +ZQMT(:,:,:,:) = 0. +ZQMTOT(:,:,:) = 0. +ZCLOUD(:,:,:) = 0. +GPOSS(:,:,:) = .FALSE. +GPOSS(IIB:IIE,IJB:IJE,IKB:IKE) = .TRUE. +ZEMODULE(:,:,:) = 0. +ZCELL(:,:,:,:) = 0. +! +! +!* 1.3 point discharge (Corona) +! +PRSVS(:,:,:,1) = XECHARGE * PRSVS(:,:,:,1) ! C /(m3 s) +PRSVS(:,:,:,NSV_ELEC) = -1. * XECHARGE * PRSVS(:,:,:,NSV_ELEC) ! C /(m3 s) +! +CALL PT_DISCHARGE +! +! +!* 1.4 total charge density and mixing ratio +! +DO II = 1, NSV_ELEC +! transform the source term (C/s) into the updated charge density (C/kg) + ZQMT(:,:,:,II) = PRSVS(:,:,:,II) * PTSTEP / PRHODJ(:,:,:) +! +! total mass charge density (C/kg) + ZQMTOT(:,:,:) = ZQMTOT(:,:,:) + PRSVS(:,:,:,II) * PTSTEP / PRHODJ(:,:,:) +END DO +! +! total mixing ratio (g/kg) +DO II = 2, KRR + ZCLOUD(:,:,:) = ZCLOUD(:,:,:) + PRT(:,:,:,II) +END DO +! +! +!* 1.5 constants +! +ZCLOUDLIM = 1.E-5 +ZSIGMIN = 1.E-12 +! +! +!------------------------------------------------------------------------------- +! +!* 2. FIND AND COUNT THE ELECTRIFIED CELLS +! ------------------------------------ +! +ALLOCATE (ZEMAX(NMAX_CELL)) +ALLOCATE (ICELL_LOC(4,NMAX_CELL)) +! +ZEMAX(:) = 0. +ICELL_LOC(:,:) = 0 +! +WHERE (ZCLOUD(IIB:IIE,IJB:IJE,IKB:IKE) .LE. ZCLOUDLIM) + GPOSS(IIB:IIE,IJB:IJE,IKB:IKE) = .FALSE. +END WHERE +! +! +!* 2.1 find the maximum electric field +! +GEND_DOMAIN = .FALSE. +GEND_CELL = .FALSE. +INB_CELL = 0 +ZE_TRIG_THRES = XETRIG * (1. - XEBALANCE) +! +CALL MPPDB_CHECK3DM("flash:: PRHODJ,PRT",PRECISION,& + PRHODJ,PRT(:,:,:,1),PRT(:,:,:,2),PRT(:,:,:,3),PRT(:,:,:,4),& + PRT(:,:,:,5),PRT(:,:,:,6)) +CALL MPPDB_CHECK3DM("flash:: ZQMT",PRECISION,& + ZQMT(:,:,:,1),ZQMT(:,:,:,2),ZQMT(:,:,:,3),ZQMT(:,:,:,4),& + ZQMT(:,:,:,5),ZQMT(:,:,:,6),ZQMT(:,:,:,7)) + +CALL TO_ELEC_FIELD_n (PRT, ZQMT, PRHODJ, KTCOUNT, KRR, & + PEFIELDU, PEFIELDV, PEFIELDW) +CALL MPPDB_CHECK3DM("flash:: PEFIELDU, PEFIELDV, PEFIELDW",PRECISION,& + PEFIELDU, PEFIELDV, PEFIELDW) +! +! electric field module including pressure effect +ZEMODULE(IIB:IIE,IJB:IJE,IKB:IKE) = ZPRES_COEF(IIB:IIE,IJB:IJE,IKB:IKE)* & + (PEFIELDU(IIB:IIE,IJB:IJE,IKB:IKE)**2 + & + PEFIELDV(IIB:IIE,IJB:IJE,IKB:IKE)**2 + & + PEFIELDW(IIB:IIE,IJB:IJE,IKB:IKE)**2)**0.5 +! +DO WHILE (.NOT. GEND_DOMAIN .AND. INB_CELL .LT. NMAX_CELL) +! +! find the maximum electric field on each proc + IF (COUNT(GPOSS(IIB:IIE,IJB:IJE,IKB:IKE)) .GT. 0) THEN + ZMAXE = MAXVAL(ZEMODULE(IIB:IIE,IJB:IJE,IKB:IKE), MASK=GPOSS(IIB:IIE,IJB:IJE,IKB:IKE)) + ELSE + ZMAXE = 0. + END IF +! +! find the max electric field on the whole domain + the proc that contains this value + CALL MAX_ELEC_ll (ZMAXE, IPROC_CELL) +! + IF (ZMAXE .GT. ZE_TRIG_THRES) THEN + INB_CELL = INB_CELL + 1 ! one cell is detected + ZEMAX(INB_CELL) = ZMAXE +! local coordinates of the maximum electric field + ICELL_LOC(1:3,INB_CELL) = MAXLOC(ZEMODULE, MASK=GPOSS ) + IICOORD = ICELL_LOC(1,INB_CELL) + IJCOORD = ICELL_LOC(2,INB_CELL) + ICELL_LOC(1,INB_CELL) = IICOORD + IXOR -1 + ICELL_LOC(2,INB_CELL) = IJCOORD + IYOR -1 + IKCOORD = ICELL_LOC(3,INB_CELL) + ICELL_LOC(4,INB_CELL) = IPROC_CELL +! +! Broadcast the center of the cell to all procs + CALL MPI_BCAST (ICELL_LOC(:,INB_CELL), 4, MNHINT_MPI, IPROC_CELL, & + NMNH_COMM_WORLD, IERR) +! +! +!* 2.2 horizontal extension of the cell +! + DO IK = IKB, IKE + IF (IPROC_CELL .EQ. IPROC) THEN + IF (GPOSS(IICOORD,IJCOORD,IK)) THEN + ZCELL(IICOORD,IJCOORD,IK,INB_CELL) = 1. + GPOSS(IICOORD,IJCOORD,IK) = .FALSE. + END IF + END IF +! +!* 2.2.1 do the neighbour points have q_tot > q_thresh? +! + GEND_CELL = .FALSE. + DO WHILE (.NOT. GEND_CELL) +! + CALL ADD2DFIELD_ll ( TZFIELDS_ll, ZCELL(:,:,IK,INB_CELL), 'FLASH_GEOM_ELEC_n::ZCELL(:,:,IK,INB_CELL)' ) + CALL UPDATE_HALO_ll ( TZFIELDS_ll, IINFO_ll ) + CALL CLEANLIST_ll ( TZFIELDS_ll ) +! + COUNT_BEF = COUNT(ZCELL(IIB:IIE,IJB:IJE,IK,INB_CELL) .EQ. 1.) + CALL SUM_ELEC_ll (COUNT_BEF) +! + ZCELL_NEW = ZCELL(:,:,IK,INB_CELL) + DO II = IIB, IIE + DO IJ = IJB, IJE + IF ((ZCELL(II,IJ,IK,INB_CELL) .EQ. 0.) .AND. & + (GPOSS(II,IJ,IK)) .AND. & + (ZCLOUD(II,IJ,IK) .GT. 1.E-5) .AND. & + ((ABS(ZQMT(II,IJ,IK,2)) * PRHODREF(II,IJ,IK) .GT. XQEXCES).OR. & + (ABS(ZQMT(II,IJ,IK,3)) * PRHODREF(II,IJ,IK) .GT. XQEXCES).OR. & + (ABS(ZQMT(II,IJ,IK,4)) * PRHODREF(II,IJ,IK) .GT. XQEXCES).OR. & + (ABS(ZQMT(II,IJ,IK,5)) * PRHODREF(II,IJ,IK) .GT. XQEXCES).OR. & + (ABS(ZQMT(II,IJ,IK,6)) * PRHODREF(II,IJ,IK) .GT. XQEXCES)) )THEN +! + IF ((ZCELL(II-1,IJ, IK,INB_CELL) .EQ. 1.) .OR. & + (ZCELL(II+1,IJ, IK,INB_CELL) .EQ. 1.) .OR. & + (ZCELL(II, IJ-1,IK,INB_CELL) .EQ. 1.) .OR. & + (ZCELL(II, IJ+1,IK,INB_CELL) .EQ. 1.) .OR. & + (ZCELL(II-1,IJ-1,IK,INB_CELL) .EQ. 1.) .OR. & + (ZCELL(II-1,IJ+1,IK,INB_CELL) .EQ. 1.) .OR. & + (ZCELL(II+1,IJ+1,IK,INB_CELL) .EQ. 1.) .OR. & + (ZCELL(II+1,IJ-1,IK,INB_CELL) .EQ. 1.)) THEN + GPOSS(II,IJ,IK) = .FALSE. + ZCELL_NEW(II,IJ) = 1. + END IF + END IF + END DO + END DO + ZCELL(:,:,IK,INB_CELL) = ZCELL_NEW +! + COUNT_AFT = COUNT(ZCELL(IIB:IIE,IJB:IJE,IK,INB_CELL) .EQ. 1.) + CALL SUM_ELEC_ll(COUNT_AFT) +! + IF (COUNT_BEF .EQ. COUNT_AFT) THEN + GEND_CELL = .TRUE. ! no more point in the cell at this level + ELSE + GEND_CELL = .FALSE. + END IF + END DO ! end loop gend_cell + END DO ! end loop ik +! +! avoid cell detection in the colums where a previous cell is already present + DO II = IIB, IIE + DO IJ = IJB, IJE + DO IK = IKB, IKE + IF (ZCELL(II,IJ,IK,INB_CELL) .EQ. 1.) GPOSS(II,IJ,:) = .FALSE. + END DO + END DO + END DO + ELSE + GEND_DOMAIN = .TRUE. ! no more points with E > E_threshold + END IF ! max E +END DO ! end loop gend_domain +! +DEALLOCATE (GPOSS) +DEALLOCATE (ZEMAX) +! +! +!* 2.3 if at least 1 cell, allocate arrays +! +IF (INB_CELL .GE. 1) THEN +! +! mean mesh size + ZMEAN_GRID = (XDXHATM**2 + XDYHATM**2 + & + (SUM(XZHAT(2:SIZE(PRT,3)) - XZHAT(1:SIZE(PRT,3)-1)) / & + (SIZE(PRT,3)-1.))**2)**0.5 +! chaque proc calcule son propre zmean_grid +! mais cette valeur peut etre differente sur chaque proc (ex: relief) +! laisse tel quel pour le moment +! + ALLOCATE (ISEG_LOC(3*SIZE(PRT,3), INB_CELL)) ! 3 coord indices of the leader + ALLOCATE (ZCOORD_TRIG(3, INB_CELL)) + ALLOCATE (ZCOORD_SEG(NBRANCH_MAX*3, INB_CELL)) + ! NBRANCH_MAX=5000 default + ! 3= 3 coord index + ALLOCATE (ZCOORD_SEG_ALL(NBRANCH_MAX*3, INB_CELL)) + ALLOCATE (ISEG_GLOB(NBRANCH_MAX*3, INB_CELL)) + ISEG_GLOB(:,:) = 0 +! + IF(LLMA) THEN + ALLOCATE (ILMA_SEG_ALL (NBRANCH_MAX*3, INB_CELL)) + ALLOCATE (ZLMA_QMT(NBRANCH_MAX*NSV_ELEC, INB_CELL)) ! charge des part. + ! a neutraliser + ALLOCATE (ZLMA_PRT(NBRANCH_MAX*NSV_ELEC, INB_CELL)) ! mixing ratio + ALLOCATE (ZLMA_NEUT_POS(NBRANCH_MAX, INB_CELL)) + ALLOCATE (ZLMA_NEUT_NEG(NBRANCH_MAX, INB_CELL)) + ZLMA_QMT(:,:) = 0. + ZLMA_PRT(:,:) = 0. + ZLMA_NEUT_POS(:,:) = 0. + ZLMA_NEUT_NEG(:,:) = 0. + END IF +! + IF (LLNOX_EXPLICIT) THEN + ALLOCATE (ZLNOX(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3))) + ZLNOX(:,:,:) = 0. + END IF +! + ALLOCATE (ZEM_TRIG(INB_CELL)) + ALLOCATE (INB_FLASH(INB_CELL)) + ALLOCATE (INB_FL_REAL(INB_CELL)) + ALLOCATE (INBSEG(INB_CELL)) + ALLOCATE (INBSEG_ALL(INB_CELL)) + ALLOCATE (ITYPE(INB_CELL)) + ALLOCATE (INBSEG_LEADER(INB_CELL)) + ALLOCATE (ZDQDT(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3),SIZE(PRT,4)+1)) + ALLOCATE (ZSIGMA(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3),SIZE(PRT,4)-1)) + ALLOCATE (ZLBDAR(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3))) + ALLOCATE (ZLBDAS(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3))) + ALLOCATE (ZLBDAG(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3))) + IF (KRR == 7) ALLOCATE (ZLBDAH(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3))) + ALLOCATE (ZSIGLOB(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3))) + ALLOCATE (ZFLASH(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3),INB_CELL)) + ALLOCATE (ZDIST(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3))) + ALLOCATE (ZQFLASH(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3))) + ALLOCATE (GATTACH(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3))) +! + ISEG_LOC(:,:) = 0 + ZCOORD_TRIG(:,:) = 0. + ZCOORD_SEG(:,:) = 0. + ZDQDT(:,:,:,:) = 0. + ZSIGMA(:,:,:,:) = 0. + ZLBDAR(:,:,:) = 0. + ZLBDAS(:,:,:) = 0. + ZLBDAG(:,:,:) = 0. + ZSIGLOB(:,:,:) = 0. + ZFLASH(:,:,:,:) = 0. + ZDIST(:,:,:) = 0. + ZQFLASH(:,:,:) = 0. + ZEM_TRIG(:) = 0. + INB_FLASH(:) = 0 + INB_FL_REAL(:) = 0 + INBSEG(:) = 0 + INBSEG_ALL(:) = 0 + INBSEG_PROC(:) = 0 + INBSEG_LEADER(:) = 0 + ITYPE(:) = 1 ! default = IC +! +! +!------------------------------------------------------------------------------- +! +!* 3. COMPUTE THE EFFICIENT CROSS SECTIONS OF HYDROMETEORS +! ---------------------------------------------------- +! +!* 3.1 for cloud droplets +! + WHERE (PRT(:,:,:,2) > ZCLOUDLIM) + ZSIGMA(:,:,:,1) = XFQLIGHTC * PRHODREF(:,:,:) * PRT(:,:,:,2) + ENDWHERE +! +! +!* 3.2 for raindrops +! + WHERE (PRT(:,:,:,3) > 0.0) + ZLBDAR(:,:,:) = XLBR * (PRHODREF(:,:,:) * & + MAX(PRT(:,:,:,3),XRTMIN(3)))**XLBEXR + END WHERE +! + WHERE (PRT(:,:,:,3) > ZCLOUDLIM .AND. ZLBDAR(:,:,:) < XLBDAR_MAXE .AND. & + ZLBDAR(:,:,:) > 0.) + ZSIGMA(:,:,:,2) = XFQLIGHTR * ZLBDAR(:,:,:)**XEXQLIGHTR + END WHERE +! +! +!* 3.3 for ice crystals +! + WHERE (PRT(:,:,:,4) > ZCLOUDLIM .AND. PCIT(:,:,:) > 1.E4) + ZSIGMA(:,:,:,3) = XFQLIGHTI * PCIT(:,:,:)**(1.-XEXQLIGHTI) * & + ((PRHODREF(:,:,:) * PRT(:,:,:,4))**XEXQLIGHTI) + ENDWHERE +! +! +!* 3.4 for snow +! + WHERE (PRT(:,:,:,5) > 0.0) + ZLBDAS(:,:,:) = MIN(XLBDAS_MAXE, & + XLBS * (PRHODREF(:,:,:) * & + MAX(PRT(:,:,:,5),XRTMIN(5)))**XLBEXS) + END WHERE +! + WHERE (PRT(:,:,:,5) > ZCLOUDLIM .AND. ZLBDAS(:,:,:) < XLBDAS_MAXE .AND. & + ZLBDAS(:,:,:) > 0.) + ZSIGMA(:,:,:,4) = XFQLIGHTS * ZLBDAS(:,:,:)**XEXQLIGHTS + ENDWHERE +! +! +!* 3.5 for graupel +! + WHERE (PRT(:,:,:,6) > 0.0) + ZLBDAG(:,:,:) = XLBG * (PRHODREF(:,:,:) * MAX(PRT(:,:,:,6),XRTMIN(6)))**XLBEXG + END WHERE +! + WHERE (PRT(:,:,:,6) > ZCLOUDLIM .AND. ZLBDAG(:,:,:) < XLBDAG_MAXE .AND. & + ZLBDAG(:,:,:) > 0.) + ZSIGMA(:,:,:,5) = XFQLIGHTG * ZLBDAG(:,:,:)**XEXQLIGHTG + ENDWHERE +! +! +!* 3.6 for hail +! + IF (KRR == 7) THEN + WHERE (PRT(:,:,:,7) > 0.0) + ZLBDAH(:,:,:) = XLBH * (PRHODREF(:,:,:) * & + MAX(PRT(:,:,:,7), XRTMIN(7)))**XLBEXH + END WHERE +! + WHERE (PRT(:,:,:,7) > ZCLOUDLIM .AND. ZLBDAH(:,:,:) < XLBDAH_MAXE .AND. & + ZLBDAH(:,:,:) > 0.) + ZSIGMA(:,:,:,6) = XFQLIGHTH * ZLBDAH(:,:,:)**XEXQLIGHTH + ENDWHERE + END IF +! +! +!* 3.7 sum of the efficient cross sections +! + ZSIGLOB(:,:,:) = ZSIGMA(:,:,:,1) + ZSIGMA(:,:,:,2) + ZSIGMA(:,:,:,3) + & + ZSIGMA(:,:,:,4) + ZSIGMA(:,:,:,5) +! + IF (KRR == 7) ZSIGLOB(:,:,:) = ZSIGLOB(:,:,:) + ZSIGMA(:,:,:,6) +! +IF (KRR == 7) THEN + CALL MPPDB_CHECK3DM("flash:: ZLBDAR,ZLBDAS,ZLBDAG,ZLBDAH",PRECISION,& + ZLBDAR,ZLBDAS,ZLBDAG,ZLBDAH,& + ZSIGMA(:,:,:,1),ZSIGMA(:,:,:,2),ZSIGMA(:,:,:,3),ZSIGMA(:,:,:,4),& + ZSIGMA(:,:,:,5),ZSIGMA(:,:,:,6)) +ELSE + CALL MPPDB_CHECK3DM("flash:: ZLBDAR,ZLBDAS,ZLBDAG",PRECISION,& + ZLBDAR,ZLBDAS,ZLBDAG,& + ZSIGMA(:,:,:,1),ZSIGMA(:,:,:,2),ZSIGMA(:,:,:,3),ZSIGMA(:,:,:,4),& + ZSIGMA(:,:,:,5)) +ENDIF +! +!------------------------------------------------------------------------------- +! +!* 4. FIND THE TRIGGERING POINT IN EACH CELL +! -------------------------------------- +! + ALLOCATE (IPROC_TRIG(INB_CELL)) + ALLOCATE (ISIGNE_EZ(INB_CELL)) + ALLOCATE (GNEW_FLASH(INB_CELL)) + ALLOCATE (ZNEUT_POS(INB_CELL)) + ALLOCATE (ZNEUT_NEG(INB_CELL)) +! + IPROC_TRIG(:) = 0 + ISIGNE_EZ(:) = 0 + GNEW_FLASH(:) = .FALSE. + ZNEUT_POS(:) = 0. + ZNEUT_NEG(:) = 0. +! + CALL TRIG_POINT +! +! +!------------------------------------------------------------------------------- +! +!* 4. FLASH TRIGGERING +! ---------------- +! + IFLASH_COUNT = 0 + IFLASH_COUNT_GLOB = 0 +! + DO WHILE (GNEW_FLASH_GLOB) +! + GATTACH(:,:,:) = .FALSE. +! + DO IL = 1, INB_CELL + IF (GNEW_FLASH(IL)) THEN + ZFLASH(:,:,:,IL) = 0. +! update lightning informations + INB_FLASH(IL) = INB_FLASH(IL) + 1 ! nb of flashes / cell / time step + INB_FL_REAL(IL) = INB_FL_REAL(IL) + 1 ! nb of flashes / cell / time step + INBSEG(IL) = 0 ! nb of segments / flash + ITYPE(IL) = 1 +! + IF (IPROC .EQ. IPROC_TRIG(IL)) THEN + ZEMOD_BL = ZEM_TRIG(IL) + IIBL_LOC = ISEG_LOC(1,IL) + IJBL_LOC = ISEG_LOC(2,IL) + IKBL = ISEG_LOC(3,IL) +! + INBSEG(IL) = 1 ! nb of segments / flash + ZFLASH(IIBL_LOC,IJBL_LOC,IKBL,IL) = 1. + ENDIF +! + GCG = .FALSE. + GCG_POS = .FALSE. + + CALL MPPDB_CHECK3DM("flash:: 4. ZFLASH(IL)",PRECISION,& + ZFLASH(:,:,:,IL)) +! +! +!------------------------------------------------------------------------------- +! +!* 5. PROPAGATE THE BIDIRECTIONAL LEADER +! ---------------------------------- +! +! it is assumed that the leader propagates only along the vertical +! +!* 5.1 positive segments +! +! the positive leader propagates parallel to the electric field + ISIGN_LEADER = 1 + CALL ONE_LEADER + IPOS_LEADER = INBSEG(IL) -1 +! +! +!* 5.2 negative segments +! +! the negative leader propagates anti-parallel to the electric field + ZEMOD_BL = ZEM_TRIG(IL) + IKBL = ISEG_LOC(3,IL) + ISIGN_LEADER = -1 + CALL ONE_LEADER +! + INBSEG_LEADER(IL) = INBSEG(IL) + INEG_LEADER = INBSEG_LEADER(IL) - IPOS_LEADER - 1 +! +! Eliminate this flash if only positive or negative leader exists + IF (IPROC .EQ. IPROC_TRIG(IL)) THEN + IF (IPOS_LEADER .EQ. 0 .OR. INEG_LEADER .EQ. 0) THEN + ZFLASH(IIBL_LOC,IJBL_LOC,IKB:IKE,IL) = 0. + INB_FL_REAL(IL) = INB_FL_REAL(IL) - 1 + GNEW_FLASH(IL) = .FALSE. + ELSE ! return to actual Triggering electrical field + IIBL_LOC = ISEG_LOC(1,IL) + IJBL_LOC = ISEG_LOC(2,IL) + IKBL = ISEG_LOC(3,IL) + ZEM_TRIG(IL) = ZEM_TRIG(IL)/ZPRES_COEF(IIBL_LOC,IJBL_LOC,IKBL) + ENDIF + ENDIF + + CALL MPPDB_CHECK3DM("flash:: 5. ZFLASH(IL)",PRECISION,& + ZFLASH(:,:,:,IL)) +! + CALL MPI_BCAST (GNEW_FLASH(IL),1, MNHLOG_MPI, IPROC_TRIG(IL), & + NMNH_COMM_WORLD, IERR) + CALL MPI_BCAST (ZEM_TRIG(IL), 1, MNHREAL_MPI, IPROC_TRIG(IL), & + NMNH_COMM_WORLD, IERR) + CALL MPI_BCAST (INB_FL_REAL(IL), 1, MNHINT_MPI, IPROC_TRIG(IL), & + NMNH_COMM_WORLD, IERR) + END IF + END DO ! end loop il +! +! +!------------------------------------------------------------------------------- +! +!* 6. POSITIVE AND NEGATIVE REGIONS WHERE THE FLASH CAN PROPAGATE +! ----------------------------------------------------------- +! +! Note: this is done to avoid branching in a third charge region: +! the branches 'stay' in the 2 charge regions where the bileader started to propagate +! +!* 6.1 positive charge region associated to the negative leader +! + ALLOCATE (GPROP(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3),INB_CELL)) + GPROP(:,:,:,:) = .FALSE. +! + GPOSITIVE = .TRUE. + CALL CHARGE_POCKET +! +! +!* 6.2 negative charge region associated to the positive leader +! + GPOSITIVE = .FALSE. + CALL CHARGE_POCKET +! +! => a point can be added to the flash only if gprop = true +! +! +!------------------------------------------------------------------------------- +! +!* 7. NUMBER OF POINTS TO REDISTRIBUTE AT DISTANCE D +! ---------------------------------------------- +! +!* 7.1 distance between the triggering point and each point of the mask +!* global coordinates: only points possibly contributing to branches +! + INB_NEUT_OK = 0 +! + DO IL = 1, INB_CELL + IF (GNEW_FLASH(IL)) THEN + INB_PROP = COUNT(GPROP(IIB:IIE,IJB:IJE,IKB:IKE,IL)) + CALL SUM_ELEC_ll(INB_PROP) +! + IF (INB_PROP .GT. 0) THEN + ZDIST(:,:,:) = 0. + DO II = IIB, IIE + DO IJ = IJB, IJE + DO IK = IKB, IKE + IF (GPROP(II,IJ,IK,IL)) THEN + ZDIST(II,IJ,IK) = ((ZXMASS(II) - ZCOORD_TRIG(1,IL))**2 + & + (ZYMASS(IJ) - ZCOORD_TRIG(2,IL))**2 + & + (ZZMASS(II,IJ,IK) - ZCOORD_TRIG(3,IL))**2)**0.5 + END IF + END DO + END DO + END DO +! +! +!* 7.3 compute the min and max distance from the triggering point - global +! + ZMIN_DIST = 0.0 + ZMAX_DIST = MAX_ll(ZDIST,IPROC_AUX) +! +! transform the min and max distances into min and max increments + IIND_MIN = 1 + IIND_MAX = MAX(1, INT((ZMAX_DIST-ZMIN_DIST)/ZMEAN_GRID +1.)) + IDELTA_IND = IIND_MAX + 1 +! + ALLOCATE (IHIST_LOC(IDELTA_IND)) + ALLOCATE (ZHIST_PERCENT(IDELTA_IND)) + ALLOCATE (IHIST_GLOB(IDELTA_IND)) + ALLOCATE (ZMAX_BRANCH(IDELTA_IND)) + ALLOCATE (IMAX_BRANCH(IDELTA_IND)) + ALLOCATE (IMASKQ_DIST(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3))) +! + IHIST_LOC(:) = 0 + ZHIST_PERCENT(:) = 0. + IHIST_GLOB(:) = 0 + ZMAX_BRANCH(:) = 0. + IMAX_BRANCH(:) = 0 + IMASKQ_DIST(:,:,:) = 0 +! +! +!* 7.4 histogram: number of points between r and r+dr +!* for each proc +! +! build an array with the possible points: IMASKQ_DIST contains the distance +! rank of points contributing to branches, excluding the leader points +! + DO II = IIB, IIE + DO IJ = IJB, IJE + DO IK = IKB, IKE + IF (ZDIST(II,IJ,IK) .NE. 0.) THEN + IM = INT( (ZDIST(II,IJ,IK)-ZMIN_DIST)/ZMEAN_GRID + 1.) + IHIST_LOC(IM) = IHIST_LOC(IM) + 1 + IMASKQ_DIST(II,IJ,IK) = IM + ENDIF + END DO + END DO + END DO +! +! +!* 7.5 global histogram +! + IHIST_GLOB(:) = IHIST_LOC(:) + CALL SUM_ELEC_ll(IHIST_GLOB) +! +! +!* 7.6 normalization +! + ZHIST_PERCENT(:) = 0. + ZMAX_BRANCH(:) = 0. + IMAX_BRANCH(:) = 0 +! + DO IM = 1, IDELTA_IND + IF (IHIST_GLOB(IM) .GT. 0) THEN + ZHIST_PERCENT(IM) = REAL(IHIST_LOC(IM)) / REAL(IHIST_GLOB(IM)) + END IF +! +! +!------------------------------------------------------------------------------- +! +!* 8. BRANCHES +! -------- +! +!* 8.1 max number of branches at distance d from the triggering point +! + ZMAX_BRANCH(IM) = (XDFRAC_L / ZMEAN_GRID) * & + REAL(IIND_MIN+IM-1)**(XDFRAC_ECLAIR - 1.) + ZMAX_BRANCH(IM) = ANINT(ZMAX_BRANCH(IM)) +! all procs know the max total number of branches at distance d +! => the max number of branches / proc is proportional to the percentage of +! available points / proc at this distance +! + IMAX_BRANCH(IM) = INT(ANINT(ZMAX_BRANCH(IM))) + END DO +! + DEALLOCATE (IHIST_LOC) + DEALLOCATE (ZHIST_PERCENT) + DEALLOCATE (IHIST_GLOB) + DEALLOCATE (ZMAX_BRANCH) +! +! +!* 8.3 distribute the branches +! +! + CALL BRANCH_GEOM(IKB, IKE) +! + DEALLOCATE (IMAX_BRANCH) + DEALLOCATE (IMASKQ_DIST) + END IF ! end if count(gprop) +! +! +!------------------------------------------------------------------------------- +! +!* 9. NEUTRALIZATION +! -------------- + CALL MPPDB_CHECK3DM("flash:: 9. ZQMTOT",PRECISION,ZQMTOT) + CALL MPPDB_CHECK3DM("flash:: 9. ZFLASH",PRECISION,ZFLASH(:,:,:,IL)) +! +!* 9.1 charge carried by the lightning flash +! + ZQFLASH(:,:,:) = 0. + WHERE (ZFLASH(IIB:IIE,IJB:IJE,IKB:IKE,IL) .GT. 0. .AND. & + ABS(ZQMTOT(IIB:IIE,IJB:IJE,IKB:IKE) * & + PRHODREF(IIB:IIE,IJB:IJE,IKB:IKE)) .GT. XQNEUT .AND. & + ZSIGLOB(IIB:IIE,IJB:IJE,IKB:IKE) .GE. ZSIGMIN) + ZQFLASH(IIB:IIE,IJB:IJE,IKB:IKE) = -1. * & + (ABS(ZQMTOT(IIB:IIE,IJB:IJE,IKB:IKE)) / & + ZQMTOT(IIB:IIE,IJB:IJE,IKB:IKE)) * & + (ABS(ZQMTOT(IIB:IIE,IJB:IJE,IKB:IKE)) - & + (XQNEUT / PRHODREF(IIB:IIE,IJB:IJE,IKB:IKE))) + GATTACH(IIB:IIE,IJB:IJE,IKB:IKE) = .TRUE. + + END WHERE +! +! net charge carried by the flash (for charge conservation / IC) + ZQNET = SUM3D_ll(ZQFLASH*PRHODJ, IINFO_ll) +! +! +!* 9.2 number of points to neutralize +! + INB_NEUT = COUNT(ZSIGLOB(IIB:IIE,IJB:IJE,IKB:IKE) .GE. ZSIGMIN .AND. & + ZQFLASH(IIB:IIE,IJB:IJE,IKB:IKE) .NE. 0.) + CALL SUM_ELEC_ll(INB_NEUT) + +! +! +!* 9.3 ensure total charge conservation for IC +! + IF (INB_NEUT .GE. 3) THEN + GNEUTRALIZATION = .TRUE. + ELSE + GNEUTRALIZATION = .FALSE. + GNEW_FLASH(IL) = .FALSE. + INB_FL_REAL(IL) = INB_FL_REAL(IL) - 1 + END IF +! + IF (GNEUTRALIZATION .AND. (.NOT. GCG) .AND. ZQNET .NE. 0.) THEN + ZQNET = ZQNET / REAL(INB_NEUT) + WHERE (ZSIGLOB(IIB:IIE,IJB:IJE,IKB:IKE) .GE. ZSIGMIN .AND. & + ZQFLASH(IIB:IIE,IJB:IJE,IKB:IKE) .NE. 0.) + ZQFLASH(IIB:IIE,IJB:IJE,IKB:IKE) = ZQFLASH(IIB:IIE,IJB:IJE,IKB:IKE) - & + ZQNET / PRHODJ(IIB:IIE,IJB:IJE,IKB:IKE) + ENDWHERE + END IF +! +! +!* 9.4 charge neutralization +! + CALL MPPDB_CHECK3DM("flash:: 9.4 ZQFLASH,ZSIGLOB",PRECISION,& + ZQFLASH,ZSIGLOB) + + ZDQDT(:,:,:,:) = 0. +! + IF (GNEUTRALIZATION) THEN + IF (ITYPE(IL) .EQ. 1.) THEN + WHERE (ZQFLASH(IIB:IIE,IJB:IJE,IKB:IKE) < 0.) + ! increase negative ion charge + ZDQDT(IIB:IIE,IJB:IJE,IKB:IKE,NSV_ELEC) = & + ZDQDT(IIB:IIE,IJB:IJE,IKB:IKE,NSV_ELEC) + & + ZQFLASH(IIB:IIE,IJB:IJE,IKB:IKE) + ENDWHERE +! + WHERE (ZQFLASH(IIB:IIE,IJB:IJE,IKB:IKE) > 0.) + ! Increase positive ion charge + ZDQDT(IIB:IIE,IJB:IJE,IKB:IKE,1) = & + ZDQDT(IIB:IIE,IJB:IJE,IKB:IKE,1) + & + ZQFLASH(IIB:IIE,IJB:IJE,IKB:IKE) + ENDWHERE +! +! +!* 9.4.2 cloud-to-ground flashes +! + ELSE +! +! Neutralization of the charge on positive CG flashes + IF (ITYPE(IL) .EQ. 3) THEN + DO II = 1, NSV_ELEC + WHERE (ZQFLASH(IIB:IIE,IJB:IJE,IKB:IKE) > 0.) + ZDQDT(IIB:IIE,IJB:IJE,IKB:IKE,II) = & + ZDQDT(IIB:IIE,IJB:IJE,IKB:IKE,II) - & + ZQMT(IIB:IIE,IJB:IJE,IKB:IKE,II) + END WHERE + ENDDO +! + WHERE (ZQFLASH(IIB:IIE,IJB:IJE,IKB:IKE) > 0.) + ZQFLASH(IIB:IIE,IJB:IJE,IKB:IKE)=0. + END WHERE +! + WHERE (ZQFLASH(IIB:IIE,IJB:IJE,IKB:IKE) < 0.) +! Increase negative ion charge + ZDQDT(IIB:IIE,IJB:IJE,IKB:IKE,NSV_ELEC) = & + ZDQDT(IIB:IIE,IJB:IJE,IKB:IKE,NSV_ELEC) + & + ZQFLASH(IIB:IIE,IJB:IJE,IKB:IKE) + ENDWHERE + ELSE +! +! Neutralization of the charge on negative CG flashes +! + DO II = 1, NSV_ELEC + WHERE (ZQFLASH(IIB:IIE,IJB:IJE,IKB:IKE) < 0.) + ZDQDT(IIB:IIE,IJB:IJE,IKB:IKE,II) = & + ZDQDT(IIB:IIE,IJB:IJE,IKB:IKE,II) - & + ZQMT(IIB:IIE,IJB:IJE,IKB:IKE,II) + END WHERE + ENDDO +! + WHERE (ZQFLASH(IIB:IIE,IJB:IJE,IKB:IKE) < 0.) + ZQFLASH(IIB:IIE,IJB:IJE,IKB:IKE)=0. + END WHERE +! + WHERE (ZQFLASH(IIB:IIE,IJB:IJE,IKB:IKE) > 0.) + ! Increase positive ion charge + ZDQDT(IIB:IIE,IJB:IJE,IKB:IKE,1) = & + ZDQDT(IIB:IIE,IJB:IJE,IKB:IKE,1) + & + ZQFLASH(IIB:IIE,IJB:IJE,IKB:IKE) + ENDWHERE + END IF ! GCG_POS + END IF ! NOT(GCG) +! +! Counting the total number of points neutralized in the cell + IF (IPROC .EQ. IPROC_TRIG(IL)) THEN + INB_NEUT_OK = INB_NEUT_OK + INB_NEUT + END IF +! + CALL MPI_BCAST (INB_NEUT_OK,1, MNHINT_MPI, IPROC_TRIG(IL), & + NMNH_COMM_WORLD, IERR) +! +!* 9.5 Gather lightning information from all processes +!* Save the particule charge and total pos/neg charge neutralization points. +!* the coordinates of all flash branch points +! + CALL MPI_ALLGATHER(INBSEG(IL), 1, MNHINT_MPI, & + INBSEG_PROC, 1, MNHINT_MPI, NMNH_COMM_WORLD, IERR) + + INBSEG_ALL(IL) = INBSEG(IL) + CALL SUM_ELEC_ll(INBSEG_ALL(IL)) + + CALL GATHER_ALL_BRANCH +! +!* 9.6 update the source term +! + CALL MPPDB_CHECK3DM("flash:: 9.6 PRSVS",PRECISION,& + PRSVS(:,:,:,1),PRSVS(:,:,:,2),PRSVS(:,:,:,3),PRSVS(:,:,:,4),& + PRSVS(:,:,:,5),PRSVS(:,:,:,6),PRSVS(:,:,:,7)) + CALL MPPDB_CHECK3DM("flash:: 9.6 ZDQDT",PRECISION,& + ZDQDT(:,:,:,1),ZDQDT(:,:,:,2),ZDQDT(:,:,:,3),ZDQDT(:,:,:,4),& + ZDQDT(:,:,:,5),ZDQDT(:,:,:,6),ZDQDT(:,:,:,7)) + + DO II = IIB, IIE + DO IJ = IJB, IJE + DO IK = IKB, IKE + DO IM = 1, NSV_ELEC + IF (ZDQDT(II,IJ,IK,IM) .NE. 0.) THEN + PRSVS(II,IJ,IK,IM) = PRSVS(II,IJ,IK,IM) + & + ZDQDT(II,IJ,IK,IM) * & + PRHODJ(II,IJ,IK) / PTSTEP + END IF +! +! +!* 9.7 update the positive and negative charge neutralized +! + IF (ZDQDT(II,IJ,IK,IM) .LT. 0.) THEN + ZNEUT_NEG(IL) = ZNEUT_NEG(IL) + ZDQDT(II,IJ,IK,IM) * & + PRHODJ(II,IJ,IK) + ELSE IF (ZDQDT(II,IJ,IK,IM) .GT. 0.) THEN + ZNEUT_POS(IL) = ZNEUT_POS(IL) + ZDQDT(II,IJ,IK,IM) * & + PRHODJ(II,IJ,IK) + END IF + END DO + END DO + END DO + END DO +! + CALL SUM_ELEC_ll(ZNEUT_POS(IL)) + CALL SUM_ELEC_ll(ZNEUT_NEG(IL)) +! +! +!* 9.8 compute the NOx production +! +!! The lightning length is first computed. The number of NOx molecules per +!! meter of lightning flash is taken from Wang et al. (1998). It is a linear +!! function of the pressure. No distinction is made between ICs and CGs. + + IF (LLNOX_EXPLICIT) THEN + IFLASH_COUNT_GLOB = IFLASH_COUNT_GLOB + 1 + IF (INBSEG(IL) .NE. 0) THEN + DO II = 0, INBSEG(IL)-1 + IM = 3 * II + IX = ISEG_GLOB(IM+1,IL) - IXOR + 1 + IY = ISEG_GLOB(IM+2,IL) - IYOR + 1 + IZ = ISEG_GLOB(IM+3,IL) + ZLGHTLENGTH = (XDXX(IX,IY,IZ) * XDYY(IX,IY,IZ) * & + XDZZ(IX,IY,IZ))**(1./3.) + ZLNOX(IX, IY, IZ) = ZLNOX(IX, IY, IZ) + & + (XWANG_A + XWANG_B * PPABST(IX,IY,IZ)) * & + ZLGHTLENGTH + ENDDO + IFLASH_COUNT = IFLASH_COUNT + 1 + END IF + END IF + END IF ! GNEUTRALIZATION + END IF ! end if gnew_flash + END DO ! end loop il +! + DEALLOCATE (GPROP) +! +! +!---------------------------------------------------------------------------- +! +!* 10. PRINT OR SAVE (before print) LIGHTNING INFORMATIONS +! --------------------------------------------------- +! +! Synchronizing all processes +! CALL MPI_BARRIER(NMNH_COMM_WORLD, IERR) ! A ACTIVER SI PB. +! + INBLIGHT = COUNT(GNEW_FLASH(1:INB_CELL)) + IF (IPROC .EQ. 0) THEN + IF (INBLIGHT .NE. 0) THEN + IF ((NNBLIGHT+INBLIGHT) .LE. NFLASH_WRITE) THEN ! SAVE + ISAVE_STATUS = 1 + DO IL = 1, INB_CELL + IF (GNEW_FLASH(IL)) THEN + NNBLIGHT = NNBLIGHT + 1 + ISFLASH_NUMBER(NNBLIGHT) = ISFLASH_NUMBER(NNBLIGHT-1) + 1 + ISNB_FLASH(NNBLIGHT) = INB_FL_REAL(IL) + ISNBSEG(NNBLIGHT) = INBSEG_ALL(IL) + ISCELL_NUMBER(NNBLIGHT) = IL + ISTCOUNT_NUMBER(NNBLIGHT) = KTCOUNT + ISTYPE(NNBLIGHT) = ITYPE(IL) + ZSEM_TRIG(NNBLIGHT) = ZEM_TRIG(IL) / 1000. + ZSNEUT_POS(NNBLIGHT) = ZNEUT_POS(IL) + ZSNEUT_NEG(NNBLIGHT) = ZNEUT_NEG(IL) +! + DO II = 1, INBSEG_ALL(IL) + IM = 3 * (II - 1) + ZSCOORD_SEG(NNBLIGHT,II,1:3) = ZCOORD_SEG_ALL(IM+1:IM+3,IL) + ENDDO +! + IF(LLMA) THEN + DO II = 1, INBSEG_ALL(IL) + IM = 3 * (II - 1) + ISLMA_SEG_GLOB(NNBLIGHT,II,1:3) = ILMA_SEG_ALL(IM+1:IM+3,IL) + IM = NSV_ELEC * (II - 1) + ZSLMA_QMT(NNBLIGHT,II,2:6) = ZLMA_QMT(IM+2:IM+6,IL) + ZSLMA_PRT(NNBLIGHT,II,2:6) = ZLMA_PRT(IM+2:IM+6,IL) + ZSLMA_NEUT_POS(NNBLIGHT,II) = ZLMA_NEUT_POS(II,IL) + ZSLMA_NEUT_NEG(NNBLIGHT,II) = ZLMA_NEUT_NEG(II,IL) + END DO + END IF ! llma + END IF ! gnew_flash + END DO ! end loop il +! + IF (NNBLIGHT .EQ. NFLASH_WRITE) ISAVE_STATUS = 0 +! + ELSE ! Print in output files + ISAVE_STATUS = 2 + END IF +! + IF (ISAVE_STATUS .EQ. 0 .OR. ISAVE_STATUS .EQ. 2) THEN + CALL WRITE_OUT_ASCII + IF(LLMA) THEN + CALL WRITE_OUT_LMA + END IF + ISFLASH_NUMBER(0) = ISFLASH_NUMBER(NNBLIGHT) + END IF +! + IF (ISAVE_STATUS .EQ. 2) THEN ! Save flashes of the temporal loop + NNBLIGHT = 0 + DO IL = 1, INB_CELL + IF (GNEW_FLASH(IL)) THEN + NNBLIGHT = NNBLIGHT + 1 + ISFLASH_NUMBER(NNBLIGHT) = ISFLASH_NUMBER(NNBLIGHT-1) + 1 + ISNB_FLASH(NNBLIGHT) = INB_FL_REAL(IL) + ISNBSEG(NNBLIGHT) = INBSEG_ALL(IL) + ISCELL_NUMBER(NNBLIGHT) = IL + ISTCOUNT_NUMBER(NNBLIGHT) = KTCOUNT + ISTYPE(NNBLIGHT) = ITYPE(IL) + ZSEM_TRIG(NNBLIGHT) = ZEM_TRIG(IL) / 1000. + ZSNEUT_POS(NNBLIGHT) = ZNEUT_POS(IL) + ZSNEUT_NEG(NNBLIGHT) = ZNEUT_NEG(IL) +! + DO II = 1, INBSEG_ALL(IL) + IM = 3 * (II - 1) + ZSCOORD_SEG(NNBLIGHT, II, 1:3) = ZCOORD_SEG_ALL(IM+1:IM+3, IL) + ENDDO +! + IF(LLMA) THEN + DO II = 1, INBSEG_ALL(IL) + IM = 3 * (II - 1) + ISLMA_SEG_GLOB(NNBLIGHT,II,1:3) = ILMA_SEG_ALL(IM+1:IM+3,IL) + IM = NSV_ELEC*(II-1) + ZSLMA_QMT(NNBLIGHT,II,2:6) = ZLMA_QMT(IM+2:IM+6,IL) + ZSLMA_PRT(NNBLIGHT,II,2:6) = ZLMA_PRT(IM+2:IM+6,IL) + ZSLMA_NEUT_POS(NNBLIGHT,II) = ZLMA_NEUT_POS(II,IL) + ZSLMA_NEUT_NEG(NNBLIGHT,II) = ZLMA_NEUT_NEG(II,IL) + END DO + END IF + END IF + ENDDO + END IF +! + IF (ISAVE_STATUS .EQ. 0) THEN + NNBLIGHT = 0 + END IF + END IF ! INBLIGHT + END IF ! IPROC +! +! Save flash location statistics in all processes + IF (INBLIGHT .NE. 0) THEN + DO IL = 1, INB_CELL + IF (GNEW_FLASH(IL)) THEN + IMAP2D(:,:) = 0 + DO IK = IKB, IKE + IMAP2D(:,:) = IMAP2D(:,:) + ZFLASH(:,:,IK,IL) + END DO +! +! Detect Trig/Impact X,Y location + IX = 0 + IY = 0 + GFIRSTFLASH = .FALSE. + DO II = IIB, IIE + DO IJ = IJB, IJE + DO IK = IKB, IKE + IF (GFIRSTFLASH) EXIT + IF (ZFLASH(II,IJ,IK,IL)==1.) THEN + IX = II + IY = IJ + GFIRSTFLASH = .TRUE. + END IF + END DO + END DO + END DO +! +! Store + IF (ITYPE(IL)==1) THEN ! IC + IF (IX*IY/=0) NMAP_TRIG_IC(IX,IY) = NMAP_TRIG_IC(IX,IY) + 1 + NMAP_2DAREA_IC(:,:) = NMAP_2DAREA_IC(:,:) + MIN(1,IMAP2D(:,:)) + NMAP_3DIC(:,:,:) = NMAP_3DIC(:,:,:) + ZFLASH(:,:,:,IL) + ELSE ! CGN & CGP + IF (IX*IY/=0) NMAP_IMPACT_CG(IX,IY) = NMAP_IMPACT_CG(IX,IY) + 1 + NMAP_2DAREA_CG(:,:) = NMAP_2DAREA_CG(:,:) + MIN(1,IMAP2D(:,:)) + NMAP_3DCG(:,:,:) = NMAP_3DCG(:,:,:) + ZFLASH(:,:,:,IL) + END IF + END IF + ENDDO + END IF ! INBLIGHT +! +!------------------------------------------------------------------------------ +! +!* 11. ATTACHMENT AFTER CHARGE NEUTRALIZATION +! -------------------------------------- +! +!* 11.1 ion attachment +! + IF (INB_NEUT_OK .NE. 0) THEN + + CALL MPPDB_CHECK3DM("flash:: PRSVS",PRECISION,& + PRSVS(:,:,:,1),PRSVS(:,:,:,2),PRSVS(:,:,:,3),PRSVS(:,:,:,4),& + PRSVS(:,:,:,5),PRSVS(:,:,:,6),PRSVS(:,:,:,7)) + + PRSVS(:,:,:,1) = PRSVS(:,:,:,1) / XECHARGE + PRSVS(:,:,:,NSV_ELEC) = - PRSVS(:,:,:,NSV_ELEC) / XECHARGE +! + CALL ION_ATTACH_ELEC(KTCOUNT, KRR, PTSTEP, PRHODREF, & + PRHODJ, PRSVS, PRS, PTHT, PCIT, PPABST, PEFIELDU, & + PEFIELDV, PEFIELDW, GATTACH, PTOWN, PSEA ) +! + PRSVS(:,:,:,1) = PRSVS(:,:,:,1) * XECHARGE + PRSVS(:,:,:,NSV_ELEC) = - PRSVS(:,:,:,NSV_ELEC) * XECHARGE + + CALL MPPDB_CHECK3DM("flash:: after ION PRSVS",PRECISION,& + PRSVS(:,:,:,1),PRSVS(:,:,:,2),PRSVS(:,:,:,3),PRSVS(:,:,:,4),& + PRSVS(:,:,:,5),PRSVS(:,:,:,6),PRSVS(:,:,:,7)) + ENDIF +! +! +!* 11.2 update the charge density to check if another flash can be triggered +! + ZQMTOT(:,:,:) = 0. + DO II = 1, NSV_ELEC +! transform the source term (C/s) into the updated charge density (C/kg) + ZQMT(:,:,:,II) = PRSVS(:,:,:,II) * PTSTEP / PRHODJ(:,:,:) +! +! total charge density (C/kg) + ZQMTOT(:,:,:) = ZQMTOT(:,:,:) + PRSVS(:,:,:,II) * PTSTEP / PRHODJ(:,:,:) + END DO +! +! +!------------------------------------------------------------------------------- +! +!* 12. CHECK IF ANOTHER FLASH CAN BE TRIGGERED +! --------------------------------------- +! + + IF ((MAXVAL(INB_FLASH(:))+1) < INBFTS_MAX) THEN + IF (INB_NEUT_OK .NE. 0) THEN + CALL MPPDB_CHECK3DM("flash:: PRHODJ,PRT",PRECISION,& + PRHODJ,PRT(:,:,:,1),PRT(:,:,:,2),PRT(:,:,:,3),PRT(:,:,:,4),& + PRT(:,:,:,5),PRT(:,:,:,6)) + CALL MPPDB_CHECK3DM("flash:: ZQMT",PRECISION,& + ZQMT(:,:,:,1),ZQMT(:,:,:,2),ZQMT(:,:,:,3),ZQMT(:,:,:,4),& + ZQMT(:,:,:,5),ZQMT(:,:,:,6),ZQMT(:,:,:,7)) + CALL TO_ELEC_FIELD_n (PRT, ZQMT, PRHODJ, KTCOUNT, KRR, & + PEFIELDU, PEFIELDV, PEFIELDW) + CALL MPPDB_CHECK3DM("flash:: PEFIELDU, PEFIELDV, PEFIELDW",PRECISION,& + PEFIELDU, PEFIELDV, PEFIELDW) +! electric field module including pressure effect + ZEMODULE(IIB:IIE,IJB:IJE,IKB:IKE) = ZPRES_COEF(IIB:IIE,IJB:IJE,IKB:IKE)* & + (PEFIELDU(IIB:IIE,IJB:IJE,IKB:IKE)**2 + & + PEFIELDV(IIB:IIE,IJB:IJE,IKB:IKE)**2 + & + PEFIELDW(IIB:IIE,IJB:IJE,IKB:IKE)**2)**0.5 + ENDIF +! + ISEG_LOC(:,:) = 0 + ZCOORD_TRIG(:,:) = 0. + ZCOORD_SEG(:,:) = 0. + IPROC_TRIG(:) = 0 + ISIGNE_EZ(:) = 0 +! + CALL TRIG_POINT + ELSE + GNEW_FLASH_GLOB = .FALSE. + END IF +! + ZNEUT_POS(:) = 0. + ZNEUT_NEG(:) = 0. +! + IF (LLMA) THEN + ZLMA_NEUT_POS(:,:) = 0. + ZLMA_NEUT_NEG(:,:) = 0. + END IF + END DO ! end loop do while +! +! +!------------------------------------------------------------------------------- +! +!* 13. COMPUTE THE NOX SOURCE TERM +! --------------------------- +! + IF (LLNOX_EXPLICIT) THEN + IF (IFLASH_COUNT_GLOB .NE. 0) THEN + ZCOEF = XMD / XAVOGADRO + XLNOX_ECLAIR = 0. + IF (IFLASH_COUNT .NE. 0) THEN + XLNOX_ECLAIR = SUM(ZLNOX(:,:,:)) + PSVS_LINOX(:,:,:) = PSVS_LINOX(:,:,:) + ZLNOX(:,:,:) * ZCOEF ! PRHODJ is + ! implicit + END IF + CALL SUM_ELEC_ll (XLNOX_ECLAIR) + XLNOX_ECLAIR = XLNOX_ECLAIR / (XAVOGADRO * REAL(IFLASH_COUNT_GLOB)) + END IF + DEALLOCATE (ZLNOX) + END IF +! + DEALLOCATE (ZNEUT_POS) + DEALLOCATE (ZNEUT_NEG) + DEALLOCATE (ZSIGMA) + DEALLOCATE (ZLBDAR) + DEALLOCATE (ZLBDAS) + DEALLOCATE (ZLBDAG) + IF (KRR == 7) DEALLOCATE (ZLBDAH) + DEALLOCATE (ZSIGLOB) + DEALLOCATE (ZDQDT) + DEALLOCATE (ZDIST) + DEALLOCATE (ZFLASH) + DEALLOCATE (ZQFLASH) + DEALLOCATE (IPROC_TRIG) + DEALLOCATE (ISIGNE_EZ) + DEALLOCATE (GNEW_FLASH) + DEALLOCATE (INBSEG) + DEALLOCATE (INBSEG_ALL) + DEALLOCATE (INBSEG_LEADER) + DEALLOCATE (INB_FLASH) + DEALLOCATE (INB_FL_REAL) + DEALLOCATE (ZEM_TRIG) + DEALLOCATE (ITYPE) + DEALLOCATE (ISEG_LOC) + DEALLOCATE (ZCOORD_TRIG) + DEALLOCATE (ZCOORD_SEG) + DEALLOCATE (ZCOORD_SEG_ALL) + DEALLOCATE (ISEG_GLOB) + DEALLOCATE (GATTACH) + IF(LLMA) THEN + DEALLOCATE (ILMA_SEG_ALL) + DEALLOCATE (ZLMA_QMT) + DEALLOCATE (ZLMA_PRT) + DEALLOCATE (ZLMA_NEUT_POS) + DEALLOCATE (ZLMA_NEUT_NEG) + END IF +END IF ! (inb_cell .ge. 1) +! +! +!------------------------------------------------------------------------------- +! +!* 13. PRINT LIGHTNING INFORMATIONS FOR THE LAST TIMESTEP +! OR LMA_TIME_SAVE IS REACHED IF LLMA OPTION IS USED +! -------------------------------------------------- +! +IF (LLMA) THEN + IF( IPROC .EQ. 0 .AND. TDTCUR%xtime >= TDTLMA%xtime - PTSTEP ) THEN + CALL WRITE_OUT_ASCII + CALL WRITE_OUT_LMA + ISFLASH_NUMBER(0) = ISFLASH_NUMBER(NNBLIGHT) + NNBLIGHT = 0 + END IF +END IF +! +IF (NNBLIGHT .NE. 0 .AND. ((IPROC .EQ. 0 .AND. OEXIT) .OR. & + (KTCOUNT == NSTOP .AND. KMI==1))) THEN + CALL WRITE_OUT_ASCII + IF(LLMA) CALL WRITE_OUT_LMA +END IF +! +! +!------------------------------------------------------------------------------- +! +!* 14. DEALLOCATE +! ---------- +! +DEALLOCATE (ICELL_LOC) +DEALLOCATE (ZQMT) +DEALLOCATE (ZQMTOT) +DEALLOCATE (ZCLOUD) +DEALLOCATE (ZCELL) +DEALLOCATE (ZEMODULE) +! +! +!------------------------------------------------------------------------------- +! +!* 14. BACK TO INPUT UNITS (per kg and per (m3 s)) FOR IONS +! ---------------------------------------------------- +! +PRSVS(:,:,:,1) = PRSVS(:,:,:,1) / XECHARGE ! 1 /(m3 s) +PRSVS(:,:,:,NSV_ELEC) = -PRSVS(:,:,:,NSV_ELEC) / XECHARGE ! 1 /(m3 s) +! +! +!------------------------------------------------------------------------------- +! +CONTAINS +! +!------------------------------------------------------------------------------- +! + SUBROUTINE TRIG_POINT () +! +! Goal : find randomly a triggering point where E > E_trig +! +!* 0. DECLARATIONS +! ------------ +! +IMPLICIT NONE +! +!* 0.1 declaration of dummy arguments +! +!* 0.2 declaration of local variables +! +LOGICAL, DIMENSION(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3),INB_CELL) :: & + GTRIG ! mask for the triggering pts +INTEGER :: INB_TRIG ! Nb of pts where triggering is possible +INTEGER :: IWEST_GLOB_TRIG ! western global limit of possible triggering +INTEGER :: IEAST_GLOB_TRIG ! eastern global limit of possible triggering +INTEGER :: ISOUTH_GLOB_TRIG ! southern global limit of possible triggering +INTEGER :: INORTH_GLOB_TRIG ! northern global limit of possible triggering +INTEGER :: IUP_TRIG ! upper limit of possible triggering +INTEGER :: IDOWN_TRIG ! down limit of possible triggering +! +! +!* 1. INITIALIZATIONS +! ----------- +! +GTRIG(:,:,:,:) = .FALSE. +GNEW_FLASH(:) = .FALSE. +GNEW_FLASH_GLOB = .FALSE. +! +! +!* 2. FIND THE POSSIBLE TRIGGERING POINTS +! ----------------------------------- +! +DO IL = 1, INB_CELL + WHERE (ZEMODULE(IIB:IIE,IJB:IJE,IKB:IKE) > ZE_TRIG_THRES .AND. & + ZCELL(IIB:IIE,IJB:IJE,IKB:IKE,IL) .GT. 0.) + GTRIG(IIB:IIE,IJB:IJE,IKB:IKE,IL) = .TRUE. + ENDWHERE +END DO +! +! +!* 3. CHOICE OF THE TRIGGERING POINT +! ------------------------------ +! +!* 3.1 number and coordinates of the possible triggering points +! +INB_TRIG = 0 +DO IL = 1, INB_CELL + INB_TRIG = COUNT(GTRIG(IIB:IIE,IJB:IJE,IKB:IKE,IL)) + CALL SUM_ELEC_ll(INB_TRIG) +! +! +!* 3.2 random choice of the triggering point +! + IF (INB_TRIG .GT. 0) THEN + IFOUND = 0 +! +! find the global limits where GTRIG = T + CALL EXTREMA_ELEC_ll(GTRIG(:,:,:,IL), IWEST_GLOB_TRIG, IEAST_GLOB_TRIG, & + ISOUTH_GLOB_TRIG, INORTH_GLOB_TRIG, & + IDOWN_TRIG, IUP_TRIG) +! + DO WHILE (IFOUND .NE. 1) +! +! random choice of the 3 global ind. + CALL MNH_RANDOM_NUMBER(ZRANDOM) + II_TRIG_GLOB = IWEST_GLOB_TRIG + & + INT(ANINT(ZRANDOM * (IEAST_GLOB_TRIG - IWEST_GLOB_TRIG))) + CALL MNH_RANDOM_NUMBER(ZRANDOM) + IJ_TRIG_GLOB = ISOUTH_GLOB_TRIG + & + INT(ANINT(ZRANDOM * (INORTH_GLOB_TRIG - ISOUTH_GLOB_TRIG))) + CALL MNH_RANDOM_NUMBER(ZRANDOM) + IK_TRIG = IDOWN_TRIG + INT(ANINT(ZRANDOM * (IUP_TRIG - IDOWN_TRIG))) +! +! global ind. --> local ind. of the potential triggering pt + II_TRIG_LOC = II_TRIG_GLOB - IXOR + 1 + IJ_TRIG_LOC = IJ_TRIG_GLOB - IYOR + 1 +! +! test if the randomly chosen pt meets all conditions for triggering + IF ((II_TRIG_LOC .LE. IIE) .AND. (II_TRIG_LOC .GE. IIB) .AND. & + (IJ_TRIG_LOC .LE. IJE) .AND. (IJ_TRIG_LOC .GE. IJB) .AND. & + (IK_TRIG .LE. IKE) .AND. (IK_TRIG .GE. IKB)) THEN + IF (GTRIG(II_TRIG_LOC,IJ_TRIG_LOC,IK_TRIG,IL)) THEN + IFOUND = 1 +! +! update the local coordinates of the flash segments + ISEG_LOC(1,IL) = II_TRIG_LOC + ISEG_LOC(2,IL) = IJ_TRIG_LOC + ISEG_LOC(3,IL) = IK_TRIG +! + ISEG_GLOB(1,IL) = II_TRIG_GLOB + ISEG_GLOB(2,IL) = IJ_TRIG_GLOB + ISEG_GLOB(3,IL) = IK_TRIG +! + ZCOORD_TRIG(1,IL) = ZXMASS(II_TRIG_LOC) + ZCOORD_TRIG(2,IL) = ZYMASS(IJ_TRIG_LOC) + ZCOORD_TRIG(3,IL) = ZZMASS(II_TRIG_LOC, IJ_TRIG_LOC, IK_TRIG) +! + ZCOORD_SEG(1:3,IL) = ZCOORD_TRIG(1:3,IL) +! +! electric field module at the triggering point + ZEM_TRIG(IL) = ZEMODULE(II_TRIG_LOC,IJ_TRIG_LOC,IK_TRIG) +! +! sign of Ez at the triggering point + ISIGNE_EZ(IL) = 0 + IF (PEFIELDW(II_TRIG_LOC,IJ_TRIG_LOC,IK_TRIG) .GT. 0.) THEN + ISIGNE_EZ(IL) = 1 + ELSE IF (PEFIELDW(II_TRIG_LOC,IJ_TRIG_LOC,IK_TRIG) .LT. 0.) THEN + ISIGNE_EZ(IL) = -1 + END IF + END IF + END IF +! +! broadcast IFOUND and find the proc where IFOUND = 1 + CALL MAX_ELEC_ll (IFOUND, IPROC_TRIG(IL)) +! + END DO +! +! +! +!* 4. BROADCAST USEFULL PARAMETERS +! ---------------------------- +! + CALL MPI_BCAST (ZEM_TRIG(IL), 1, & + MNHREAL_MPI, IPROC_TRIG(IL), NMNH_COMM_WORLD, IERR) + CALL MPI_BCAST (ISEG_LOC(:,IL), 3*SIZE(PRT,3), & + MNHINT_MPI, IPROC_TRIG(IL), NMNH_COMM_WORLD, IERR) + CALL MPI_BCAST (ZCOORD_TRIG(:,IL), 3, & + MNHREAL_MPI, IPROC_TRIG(IL), NMNH_COMM_WORLD, IERR) + CALL MPI_BCAST (ISIGNE_EZ(IL), 1, & + MNHINT_MPI, IPROC_TRIG(IL), NMNH_COMM_WORLD, IERR) +! +! +!* 5. CHECK IF THE FLASH CAN DEVELOP +! ------------------------------ +! + IF (INB_FLASH(IL) < INBFTS_MAX) THEN + IF (IPROC.EQ.IPROC_TRIG(IL)) THEN + ZCELL(II_TRIG_LOC,IJ_TRIG_LOC,IK_TRIG,IL) = 0. + END IF +! + GNEW_FLASH(IL) = .TRUE. + GNEW_FLASH_GLOB = .TRUE. + CALL MPI_BCAST (GNEW_FLASH(IL),1, MNHLOG_MPI, IPROC_TRIG(IL), & + NMNH_COMM_WORLD, IERR) + CALL MPI_BCAST (GNEW_FLASH_GLOB,1, MNHLOG_MPI, IPROC_TRIG(IL), & + NMNH_COMM_WORLD, IERR) + END IF + END IF +END DO +! +! +END SUBROUTINE TRIG_POINT +! +!------------------------------------------------------------------------------- +! + SUBROUTINE ONE_LEADER () +! +!! Purpose: propagates the bidirectional leader along the vertical +! +!* 0. DECLARATIONS +! ------------ +! +IMPLICIT NONE +! +INTEGER :: IKSTEP, IIDECAL +! +!* 1. BUILD THE POSITIVE/NEGATIVE LEADER +! ---------------------------------- +CALL MPPDB_CHECK3DM("flash:: one_leader ZFLASH",PRECISION,ZFLASH(:,:,:,IL)) +! +IKSTEP = ISIGN_LEADER * ISIGNE_EZ(IL) + ! the positive leader propagates parallel to the electric field + ! while the negative leader propagates anti// to the electric field +ISTOP = 0 +! +! +IF (IPROC .EQ. IPROC_TRIG(IL)) THEN + + DO WHILE (ZEMOD_BL > XEPROP .AND. IKBL > IKB .AND. & + IKBL < IKE .AND. ISTOP .EQ. 0 .AND. & + INBSEG(IL) .LE. (NLEADER_MAX-1)) +! +! local coordinates of the new segment + IIBL_LOC = ISEG_LOC(1,IL) + IJBL_LOC = ISEG_LOC(2,IL) + IKBL = IKBL + IKSTEP + IIDECAL = INBSEG(IL) * 3 +! + ISEG_LOC(IIDECAL+1,IL) = IIBL_LOC + ISEG_LOC(IIDECAL+2,IL) = IJBL_LOC + ISEG_LOC(IIDECAL+3,IL) = IKBL +! + ISEG_GLOB(IIDECAL+1,IL) = IIBL_LOC + IXOR - 1 + ISEG_GLOB(IIDECAL+2,IL) = IJBL_LOC + IYOR - 1 + ISEG_GLOB(IIDECAL+3,IL) = IKBL +! + ZCOORD_SEG(IIDECAL+1,IL) = ZXMASS(IIBL_LOC) + ZCOORD_SEG(IIDECAL+2,IL) = ZYMASS(IJBL_LOC) + ZCOORD_SEG(IIDECAL+3,IL) = ZZMASS(IIBL_LOC, IJBL_LOC, IKBL) +! + INBSEG(IL) = INBSEG(IL) + 1 +! +! +!* 1.3 test if Ez keeps the same sign +! + IF (PEFIELDW(IIBL_LOC,IJBL_LOC,IKBL) .EQ. 0. .OR. & + INT(ABS(PEFIELDW(IIBL_LOC,IJBL_LOC,IKBL)) / & + PEFIELDW(IIBL_LOC,IJBL_LOC,IKBL)) /= ISIGNE_EZ(IL) .OR. & + ZCELL(IIBL_LOC,IJBL_LOC,IKBL,IL) .EQ. 0.) THEN + ISTOP = 1 +! then this segment is not part of the leader + INBSEG(IL) = INBSEG(IL) - 1 + END IF +! +! +!* 1.4 sign of the induced charge +! + IF (ISTOP .EQ. 0) THEN + ZFLASH(IIBL_LOC,IJBL_LOC,IKBL,IL) = 1. + ZCELL(IIBL_LOC,IJBL_LOC,IKBL,IL) = 0. +! +! +!* 1.6 electric field module at the tip of the leader +! + ZEMOD_BL = ZEMODULE(IIBL_LOC,IJBL_LOC,IKBL) +! +! +!* 1.7 test if the domain boundaries are reached +! + IF ((IIBL_LOC < IIB .AND. LWEST_ll()) .OR. & + (IIBL_LOC > IIE .AND. LEAST_ll()) .OR. & + (IJBL_LOC < IJB .AND. LSOUTH_ll()) .OR. & + (IJBL_LOC > IJE .AND. LNORTH_ll())) THEN + PRINT*,'DOMAIN BOUNDARIES REACHED BY THE LIGHTNING ' + ISTOP = 1 + ENDIF +! + IF (IKBL .LE. IKB) THEN + PRINT*,'THE LIGHTNING FLASH HAS REACHED THE GROUND ' + ISTOP = 1 + GCG = .TRUE. + NNB_CG = NNB_CG + 1 + IF (ISIGN_LEADER > 0) THEN + GCG_POS = .TRUE. + ITYPE(IL) = 3 ! CGP + NNB_CG_POS = NNB_CG_POS + 1 + ELSE + ITYPE(IL) = 2 ! CGN + END IF + ENDIF +! + IF (IKBL .GE. IKE) THEN + PRINT*,'THE LIGHTNING FLASH HAS REACHED THE TOP OF THE DOMAIN ' + ISTOP = 1 + ENDIF +! +! +!* 2. TEST IF THE FLASH IS A CG +! ------------------------- +! + IF (.NOT. GCG) THEN + IF ( (ZZMASS(IIBL_LOC,IJBL_LOC,IKBL)-PZZ(IIBL_LOC,IJBL_LOC,IKB)) <= & + XALT_CG .AND. INBSEG(IL) .GT. 1 .AND. IKSTEP .LT. 0) THEN +! +! +!* 2.1 the channel is prolongated to the ground if +!* one segment reaches the altitude XALT_CG +! + DO WHILE (IKBL > IKB) + IKBL = IKBL - 1 +! +! local coordinates of the new segment + IIDECAL = INBSEG(IL) * 3 +! + ISEG_LOC(IIDECAL+1,IL) = IIBL_LOC + ISEG_LOC(IIDECAL+2,IL) = IJBL_LOC + ISEG_LOC(IIDECAL+3,IL) = IKBL +! + ISEG_GLOB(IIDECAL+1:IIDECAL+2,IL) = ISEG_GLOB(IIDECAL-2:IIDECAL-1,IL) + ISEG_GLOB(IIDECAL+3,IL) = IKBL +! + ZCOORD_SEG(IIDECAL+1:IIDECAL+2,IL) = ZCOORD_SEG(IIDECAL-2:IIDECAL-1,IL) + ZCOORD_SEG(IIDECAL+3,IL) = ZZMASS(IIBL_LOC, IJBL_LOC, IKBL) +! +! Increment number of segments + INBSEG(IL) = INBSEG(IL) + 1 ! Nb of segments + ZFLASH(IIBL_LOC,IJBL_LOC,IKBL,IL) = 1. + ZCELL(IIBL_LOC,IJBL_LOC,IKBL,IL) = 0. + END DO +! +! +!* 2.2 update the number of CG flashes +! + GCG = .TRUE. + NNB_CG = NNB_CG + 1 + ISTOP = 1 +! + IF (ISIGN_LEADER > 0) THEN + GCG_POS = .TRUE. + NNB_CG_POS = NNB_CG_POS + 1 + ITYPE(IL) = 3 + ELSE + ITYPE(IL) = 2 + END IF + END IF + END IF + END IF ! end if ISTOP=0 + END DO ! end loop leader +END IF ! only iproc_trig was working +! +! +!* 3. BROADCAST THE INFORMATIONS TO ALL PROCS +! --------------------------------------- +! +CALL MPI_BCAST (ISEG_LOC(:,IL), 3*SIZE(PRT,3), & + MNHINT_MPI, IPROC_TRIG(IL), NMNH_COMM_WORLD, IERR) +CALL MPI_BCAST (ITYPE(IL), 1, & + MNHINT_MPI, IPROC_TRIG(IL), NMNH_COMM_WORLD, IERR) + +CALL MPI_BCAST (GCG, 1, & + MNHLOG_MPI, IPROC_TRIG(IL), NMNH_COMM_WORLD, IERR) +CALL MPI_BCAST (GCG_POS, 1, & + MNHLOG_MPI, IPROC_TRIG(IL), NMNH_COMM_WORLD, IERR) +CALL MPI_BCAST (NNB_CG, 1, & + MNHINT_MPI, IPROC_TRIG(IL), NMNH_COMM_WORLD, IERR) +CALL MPI_BCAST (NNB_CG_POS, 1, & + MNHINT_MPI, IPROC_TRIG(IL), NMNH_COMM_WORLD, IERR) + +! +CALL MPPDB_CHECK3DM("flash:: one_leader end ZFLASH",PRECISION,ZFLASH(:,:,:,IL)) +! +END SUBROUTINE ONE_LEADER +! +!------------------------------------------------------------------------------- +! + SUBROUTINE CHARGE_POCKET +! +!! +!! Purpose: limit flash propagation into the positive and negative charge layers +!! located immediatly above and below the triggering point +!! +!* 0. DECLARATIONS +! ------------ +! +IMPLICIT NONE +! +REAL, DIMENSION(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3)) :: ZSIGN_AREA,ZSIGN_AREA_NEW + +REAL, DIMENSION(INB_CELL) :: ZSIGN ! sign of the charge immediatly below/above the triggering pt +! +INTEGER, DIMENSION(INB_CELL) :: IEND ! if 1, no more neighbour pts meeting the conditions +INTEGER, DIMENSION(INB_CELL) :: COUNT_BEF2 +INTEGER, DIMENSION(INB_CELL) :: COUNT_AFT2 +INTEGER :: IPROC_END +INTEGER :: IEND_GLOB +INTEGER :: IIDECAL, IKMIN, IKMAX +REAL :: ZFACT +! +! +!* 1. SEARCH THE POINTS BELONGING TO THE LAYERS +! ----------------------------------------- +! +ZFACT = -1. +IF(GPOSITIVE) ZFACT = 1. + +ZSIGN_AREA(:,:,:) = 0. +ZSIGN(:) = 0. +IEND(:) = 0 +IEND_GLOB = 0 +! +! +DO IL = 1, INB_CELL + IF (.NOT. GNEW_FLASH(IL)) THEN + IEND(IL) = 1 + IEND_GLOB = IEND_GLOB + IEND(IL) + END IF + IF (GNEW_FLASH(IL) .AND. IPROC .EQ. IPROC_TRIG(IL)) THEN + DO II = 1, INBSEG(IL) + IIDECAL = 3 * (II - 1) + IIBL_LOC = ISEG_LOC(IIDECAL+1,IL) + IJBL_LOC = ISEG_LOC(IIDECAL+2,IL) + IKBL = ISEG_LOC(IIDECAL+3,IL) +! + IF (ZQMTOT(IIBL_LOC,IJBL_LOC,IKBL) .GT. 0. .AND. GPOSITIVE) THEN + ZSIGN_AREA(IIBL_LOC,IJBL_LOC,IKBL) = 1. * REAL(IL) + ZSIGN(IL) = ZSIGN_AREA(IIBL_LOC,IJBL_LOC,IKBL) + ELSE IF (ZQMTOT(IIBL_LOC,IJBL_LOC,IKBL) .LT. 0. .AND. .NOT.GPOSITIVE) THEN + ZSIGN_AREA(IIBL_LOC,IJBL_LOC,IKBL) = -1. * REAL(IL) + ZSIGN(IL) = ZSIGN_AREA(IIBL_LOC,IJBL_LOC,IKBL) + END IF + END DO + END IF +! + CALL MPI_BCAST (ZSIGN(IL), 1, MNHREAL_MPI, IPROC_TRIG(IL), & + NMNH_COMM_WORLD, IERR) +END DO +! +DO WHILE (IEND_GLOB .NE. INB_CELL) + DO IL = 1, INB_CELL + CALL ADD3DFIELD_ll ( TZFIELDS_ll, ZSIGN_AREA, 'FLASH_GEOM_ELEC_n::ZSIGN_AREA' ) + CALL UPDATE_HALO_ll ( TZFIELDS_ll, IINFO_ll) + CALL CLEANLIST_ll ( TZFIELDS_ll) +! + IF (GNEW_FLASH(IL) .AND. (IEND(IL) .NE. 1)) THEN + COUNT_BEF2(IL) = COUNT(ZSIGN_AREA(IIB:IIE,IJB:IJE,IKB:IKE) .EQ. ZSIGN(IL)) + CALL SUM_ELEC_ll (COUNT_BEF2(IL)) +! + IF (ISIGNE_EZ(IL).EQ.1) THEN + IF (GPOSITIVE) THEN + IKMIN = IKB + IKMAX = ISEG_LOC(3, IL) + ELSE + IKMIN = ISEG_LOC(3, IL) + IKMAX = IKE + ENDIF + ENDIF +! + IF (ISIGNE_EZ(IL).EQ.-1) THEN + IF (GPOSITIVE) THEN + IKMIN = ISEG_LOC(3, IL) + IKMAX = IKE + ELSE + IKMIN = IKB + IKMAX = ISEG_LOC(3, IL) + ENDIF + ENDIF +! + ZSIGN_AREA_NEW(:,:,IKMIN:IKMAX) = ZSIGN_AREA (:,:,IKMIN:IKMAX) + DO II = IIB, IIE + DO IJ = IJB, IJE + DO IK = IKMIN, IKMAX + IF ((ZSIGN_AREA(II, IJ, IK) .EQ. 0.) .AND. & + (ZCELL(II,IJ,IK,IL) .EQ. 1.) .AND. & + (.NOT. GPROP(II,IJ,IK,IL)) .AND. & + (ZQMTOT(II,IJ,IK)*ZFACT .GT. 0.) .AND. & + (ABS(ZQMTOT(II,IJ,IK) * & + PRHODREF(II,IJ,IK)) .GT. XQNEUT)) THEN +! + IF ((ZSIGN_AREA(II-1,IJ, IK) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II+1,IJ, IK) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II, IJ-1,IK) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II, IJ+1,IK) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II-1,IJ-1,IK) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II-1,IJ+1,IK) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II+1,IJ+1,IK) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II+1,IJ-1,IK) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II, IJ, IK+1) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II-1,IJ, IK+1) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II+1,IJ, IK+1) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II, IJ-1,IK+1) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II, IJ+1,IK+1) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II-1,IJ-1,IK+1) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II-1,IJ+1,IK+1) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II+1,IJ+1,IK+1) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II+1,IJ-1,IK+1) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II, IJ, IK-1) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II-1,IJ, IK-1) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II+1,IJ, IK-1) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II, IJ-1,IK-1) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II, IJ+1,IK-1) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II-1,IJ-1,IK-1) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II-1,IJ+1,IK-1) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II+1,IJ+1,IK-1) .EQ. ZSIGN(IL)) .OR. & + (ZSIGN_AREA(II+1,IJ-1,IK-1) .EQ. ZSIGN(IL))) THEN + ZSIGN_AREA_NEW(II,IJ,IK) = ZSIGN(IL) + GPROP(II,IJ,IK,IL) = .TRUE. + END IF + END IF + END DO + END DO + END DO + ZSIGN_AREA (:,:,IKMIN:IKMAX) = ZSIGN_AREA_NEW(:,:,IKMIN:IKMAX) +! + COUNT_AFT2(IL) = COUNT(ZSIGN_AREA(IIB:IIE,IJB:IJE,IKB:IKE) .EQ. ZSIGN(IL)) + CALL SUM_ELEC_ll(COUNT_AFT2(IL)) +! + IF (COUNT_BEF2(IL) .EQ. COUNT_AFT2(IL)) THEN + IEND(IL) = 1 + ELSE + IEND(IL) = 0 + END IF +! broadcast IEND and find the proc where IEND = 1 + CALL MAX_ELEC_ll (IEND(IL), IPROC_END) + IEND_GLOB = IEND_GLOB + IEND(IL) + END IF + END DO +END DO ! end do while +! +END SUBROUTINE CHARGE_POCKET +! +!------------------------------------------------------------------------------- +! + SUBROUTINE BRANCH_GEOM (IKMIN, IKMAX) +! +! Goal : find randomly flash branch points +! +!* 0. DECLARATIONS +! ------------ +! +use modd_precision, only: MNHINT64, MNHINT64_MPI + +IMPLICIT NONE +! +!* 0.1 declaration of dummy arguments +! +INTEGER, INTENT(IN) :: IKMIN, IKMAX +! +!* 0.2 declaration of local variables +! +INTEGER :: IIDECALB +INTEGER :: IPLOOP ! loop index for the proc number +INTEGER :: IMIN, IMAX +INTEGER :: IAUX +INTEGER :: INB_SEG_BEF ! nb of segments before branching +INTEGER :: INB_SEG_AFT ! nb of segments after branching +INTEGER :: INB_SEG_TO_BRANCH ! = NBRANCH_MAX-INB_SEG_BEF +LOGICAL :: GRANDOM ! T = the gridpoints are chosen randomly +INTEGER, DIMENSION(NPROC) :: INBPT_PROC +REAL, DIMENSION(:), ALLOCATABLE :: ZAUX +! +INTEGER :: JI,JJ,JK,JIL , ICHOICE,IPOINT +INTEGER, DIMENSION(NPROC+1) :: IDISPL +INTEGER(kind=MNHINT64), DIMENSION(:), ALLOCATABLE :: I8VECT , I8VECT_LL +INTEGER, DIMENSION(:), ALLOCATABLE :: IRANK , IRANK_LL , IORDER_LL +! +! +! +!* 1. ON EACH PROC, COUNT THE NUMBER OF POINTS AT DISTANCE D +!* THAT CAN RECEIVE A BRANCH +! ------------------------------------------------------ +CALL MPPDB_CHECK3DM("flash:: branch ZFLASH,IMASKQ_DIST",PRECISION,& + ZFLASH(:,:,:,IL),IMASKQ_DIST*1.0) +! +IM = 1 +ISTOP = 0 +INB_SEG_BEF = COUNT(ZFLASH(IIB:IIE,IJB:IJE,IKB:IKE,IL) .NE. 0.) +CALL SUM_ELEC_ll(INB_SEG_BEF) +! +INB_SEG_TO_BRANCH = NBRANCH_MAX - INB_SEG_BEF +! +DO WHILE (IM .LE. IDELTA_IND .AND. ISTOP .NE. 1) +! number of points that can receive a branch in each proc + IPT_DIST = COUNT(IMASKQ_DIST(IIB:IIE,IJB:IJE,IKB:IKE) .EQ. IM) +! global number of points that can receive a branch + IPT_DIST_GLOB = IPT_DIST + CALL SUM_ELEC_ll (IPT_DIST_GLOB) +! + IF (IPT_DIST_GLOB .LE. INB_SEG_TO_BRANCH) THEN + IF (IPT_DIST_GLOB .LE. IMAX_BRANCH(IM)) THEN + GRANDOM = .FALSE. + ELSE + GRANDOM = .TRUE. + END IF + ELSE + GRANDOM = .TRUE. + END IF +! +! +!* 2. DISTRIBUTE THE BRANCHES +! ----------------------- +! + IF (IPT_DIST_GLOB .GT. 0 .AND. INB_SEG_TO_BRANCH .NE. 0) THEN + IF (.NOT. GRANDOM) THEN + INB_SEG_TO_BRANCH = INB_SEG_TO_BRANCH - IPT_DIST_GLOB +! +!* 2.1 all points are selected +! + IF(IPT_DIST .GT. 0) THEN + WHERE (IMASKQ_DIST(IIB:IIE,IJB:IJE,IKB:IKE) .EQ. IM) + ZFLASH(IIB:IIE,IJB:IJE,IKB:IKE,IL) = 2. + ZCELL(IIB:IIE,IJB:IJE,IKB:IKE,IL) = 0. + END WHERE + END IF + ELSE +! +!* 2.2 the gridpoints are chosen randomly +! + IF (IMAX_BRANCH(IM) .GT. 0) THEN + INBPT_PROC(:) = 0 + CALL MPI_ALLGATHER(IPT_DIST, 1, MNHINT_MPI, & + INBPT_PROC, 1, MNHINT_MPI, NMNH_COMM_WORLD, IERR) +! + IDISPL(1) = 0 + DO JI=2, NPROC+1 + IDISPL(JI) = IDISPL(JI-1)+INBPT_PROC(JI-1) + ENDDO +! + ALLOCATE (I8VECT(IPT_DIST)) + ALLOCATE (IRANK(IPT_DIST)) + IF (IPT_DIST .GT. 0) THEN + JIL=0 + DO JK=IKB,IKE + DO JJ=IJB,IJE + DO JI=IIB,IIE + IF (IMASKQ_DIST(JI,JJ,JK) .EQ. IM) THEN + JIL = JIL + 1 + I8VECT(JIL) = IJU_ll*IIU_ll*(JK-1) + IIU_ll*(JJ-1 +IYOR-1) + (JI +IXOR-1) + !print*,"IN => I8VECT(JIL )=",I8VECT(JIL),JI,JJ,JK,JIL + END IF + END DO + END DO + END DO + ! + IRANK(:) = IPROC + END IF +! + ALLOCATE(I8VECT_LL(IPT_DIST_GLOB)) + ALLOCATE(IRANK_LL(IPT_DIST_GLOB)) + ALLOCATE(IORDER_LL(IPT_DIST_GLOB)) + CALL MPI_ALLGATHERV(I8VECT,IPT_DIST, MNHINT64_MPI,I8VECT_LL , & + INBPT_PROC, IDISPL, MNHINT64_MPI, NMNH_COMM_WORLD, IERR) + CALL MPI_ALLGATHERV(IRANK,IPT_DIST, MNHINT_MPI,IRANK_LL , & + INBPT_PROC, IDISPL, MNHINT_MPI, NMNH_COMM_WORLD, IERR) + CALL N8QUICK_SORT(I8VECT_LL, IORDER_LL) +! + DO IPOINT = 1, MIN(IMAX_BRANCH(IM), INB_SEG_TO_BRANCH) + IFOUND = 0 + DO WHILE (IFOUND .NE. 1) + ! randomly chose points in zvect + CALL MNH_RANDOM_NUMBER(ZRANDOM) + ICHOICE = INT(ANINT(ZRANDOM * IPT_DIST_GLOB)) + IF (ICHOICE .EQ. 0) ICHOICE = 1 + IF (I8VECT_LL(ICHOICE) .NE. 0 ) THEN + IFOUND = 1 + ! The points is in this processors , get is coord and set it + IF (IRANK_LL(IORDER_LL(ICHOICE)) .EQ. IPROC) THEN + JK = 1 + (I8VECT_LL(ICHOICE)-1) / ( IJU_ll*IIU_ll ) + JJ = 1 + ( (I8VECT_LL(ICHOICE)-1) - IJU_ll*IIU_ll*(JK-1) ) / IIU_ll - IYOR +1 + JI = 1 + MOD((I8VECT_LL(ICHOICE)-1) , int(IIU_ll,kind(I8VECT_LL(1)))) - IXOR +1 + !print*,"OUT => I8VECT_LL(ICHOICE)=",I8VECT_ll(ICHOICE),JI,JJ,JK,ICHOICE + ZFLASH(JI,JJ,JK,IL) = 2. + END IF + I8VECT_LL(ICHOICE) = 0 + ENDIF + END DO + END DO +! + INB_SEG_TO_BRANCH = INB_SEG_TO_BRANCH - MIN(IMAX_BRANCH(IM), INB_SEG_TO_BRANCH) +! + DEALLOCATE(I8VECT,I8VECT_LL,IRANK,IRANK_LL,IORDER_LL) + CALL MPPDB_CHECK3DM("flash:: branch IPT_DIST ZFLASH",PRECISION,& + ZFLASH(:,:,:,IL)) + END IF + END IF !IPT_DIST .LE. IMAX_BRANCH(IM) + ELSE +! if no pt available at r, then no branching possible at r+dr ! + ISTOP = 1 + END IF ! end if ipt_dist > 0 +! +! next distance + CALL MPPDB_CHECK3DM("flash:: branch IM+1 ZFLASH",PRECISION,ZFLASH(:,:,:,IL)) + IM = IM + 1 +END DO ! end loop / do while / radius IM +! +INB_SEG_AFT = COUNT (ZFLASH(IIB:IIE,IJB:IJE,IKB:IKE,IL) .NE. 0.) +CALL SUM_ELEC_ll(INB_SEG_AFT) +! +IF (INB_SEG_AFT .GT. INB_SEG_BEF) THEN + DO II = IIB, IIE + DO IJ = IJB, IJE + DO IK = IKB, IKE + IF (ZFLASH(II,IJ,IK,IL) .EQ. 2.) THEN + IIDECALB = INBSEG(IL) * 3 +! + ISEG_GLOB(IIDECALB+1,IL) = II + IXOR - 1 + ISEG_GLOB(IIDECALB+2,IL) = IJ + IYOR - 1 + ISEG_GLOB(IIDECALB+3,IL) = IK +! + ZCOORD_SEG(IIDECALB+1,IL) = ZXMASS(II) + ZCOORD_SEG(IIDECALB+2,IL) = ZYMASS(IJ) + ZCOORD_SEG(IIDECALB+3,IL) = ZZMASS(II,IJ,IK) + INBSEG(IL) = INBSEG(IL) + 1 + END IF + END DO + END DO + END DO +END IF +! +CALL MPPDB_CHECK3DM("flash:: end branch ZFLASH",PRECISION,ZFLASH(:,:,:,IL)) +! +END SUBROUTINE BRANCH_GEOM +! +!-------------------------------------------------------------------------------- +! + SUBROUTINE GATHER_ALL_BRANCH +! +!! +!! Purpose: +!! +! +!* 0. DECLARATIONS +! ------------ +! +IMPLICIT NONE +! +INTEGER :: INSEGPROC, INSEGCELL ! number of segments in the process, + ! and number of segments in the cell +INTEGER :: ISAVEDECAL +INTEGER :: INSEGTRIG, IPROCTRIG +REAL, DIMENSION(:), ALLOCATABLE :: ZLMAQMT, ZLMAPRT, ZLMAPOS, ZLMANEG +REAL, DIMENSION(:), ALLOCATABLE :: ZSEND, ZRECV +INTEGER, DIMENSION(:), ALLOCATABLE :: ISEND, IRECV +INTEGER, DIMENSION(NPROC) :: IDECAL, IDECAL3, IDECALN +INTEGER, DIMENSION(NPROC) :: INBSEG_PROC_X3, INBSEG_PROC_XNSV +! +! +IPROCTRIG = IPROC_TRIG(IL) +INSEGCELL = INBSEG_ALL(IL) +INSEGPROC = INBSEG_PROC(IPROC+1) +INSEGTRIG = INBSEG_PROC(IPROCTRIG+1) +! +IDECAL(1) = INSEGTRIG +DO IK = 2, NPROC + IDECAL(IK) = IDECAL(IK-1) + INBSEG_PROC(IK-1) +END DO +! +IF(IPROCTRIG .EQ. 0) ISAVEDECAL = IDECAL(IPROCTRIG+1) +! +IDECAL(IPROCTRIG+1) = 0 +DO IK = IPROCTRIG+2, NPROC + IF(IPROCTRIG .EQ. 0) THEN + IDECAL(IK) = IDECAL(IK) - ISAVEDECAL + ELSE + IDECAL(IK) = IDECAL(IK) - IDECAL(1) + END IF +END DO +! +IDECAL3(:) = 3 * IDECAL(:) +! +! +!* 1. BRANCH COORDINATES +! +ALLOCATE (ZRECV(INSEGCELL*3)) +ALLOCATE (ZSEND(INSEGPROC*3)) +! +IF (INSEGPROC .NE. 0) THEN + ZSEND(1:3*INSEGPROC) = ZCOORD_SEG(1:3*INSEGPROC,IL) +END IF +! +IF (IPROC .EQ. 0) THEN + INBSEG_PROC_X3(:) = 3 * INBSEG_PROC(:) +END IF +! +CALL MPI_GATHERV (ZSEND, 3*INSEGPROC, MNHREAL_MPI, ZRECV, INBSEG_PROC_X3, & + IDECAL3, MNHREAL_MPI, 0, NMNH_COMM_WORLD, IERR) +! +IF (IPROC .EQ. 0) THEN + ZCOORD_SEG_ALL(1:3*INSEGCELL,IL) = ZRECV(1:3*INSEGCELL) +END IF +! +DEALLOCATE (ZRECV) +DEALLOCATE (ZSEND) +! +! +!* 2. FOR LMA-LIKE RESULTS: Charge, mixing ratio, +!* neutralized positive/negative charge +!* and grid index +! +IF (LLMA) THEN + ALLOCATE (ISEND(3*INSEGPROC)) + ALLOCATE (ZLMAQMT(INSEGPROC*NSV_ELEC)) + ALLOCATE (ZLMAPRT(INSEGPROC*NSV_ELEC)) + ALLOCATE (ZLMAPOS(INSEGPROC)) + ALLOCATE (ZLMANEG(INSEGPROC)) +! + ISEND (:) = 0 + ZLMAPOS(:) = 0. + ZLMANEG(:) = 0. + ZLMAQMT(:) = 0. + ZLMAPRT(:) = 0. +! + IF (INSEGPROC .NE. 0) THEN + DO II = 1, INSEGPROC + IM = 3 * (II - 1) + IX = ISEG_GLOB(IM+1,IL) - IXOR + 1 + IY = ISEG_GLOB(IM+2,IL) - IYOR + 1 + IZ = ISEG_GLOB(IM+3,IL) +! + IM = NSV_ELEC * (II - 1) + IF (IX .LE. IIE .AND. IX .GE. IIB .AND. & + IY .LE. IJE .AND. IY .GE. IJB) THEN + ZLMAQMT(IM+2:IM+6) = ZQMT(IX,IY,IZ,2:6) + ZLMAPRT(IM+2:IM+6) = PRT(IX,IY,IZ,2:6) + DO IJ = 1, NSV_ELEC + IF (ZDQDT(IX,IY,IZ,IJ) .GT. 0.) THEN + ZLMAPOS(II) = ZLMAPOS(II) + & + ZDQDT(IX,IY,IZ,IJ) * PRHODJ(IX,IY,IZ) + ELSE IF (ZDQDT(IX,IY,IZ,IJ) .LT. 0.) THEN + ZLMANEG(II) = ZLMANEG(II) + & + ZDQDT(IX,IY,IZ,IJ) * PRHODJ(IX,IY,IZ) + END IF + END DO + END IF + END DO +! + ISEND(1:3*INSEGPROC) = ISEG_GLOB(1:3*INSEGPROC, IL) + END IF +! +! Grid Indexes +! + ALLOCATE (IRECV(3*INSEGCELL)) +! + CALL MPI_GATHERV (ISEND, 3*INSEGPROC, MNHINT_MPI, IRECV, INBSEG_PROC_X3, & + IDECAL3, MNHINT_MPI, 0, NMNH_COMM_WORLD, IERR) +! + IF (IPROC .EQ. 0) THEN + ILMA_SEG_ALL(1:3*INSEGCELL,IL) = IRECV(1:3*INSEGCELL) + END IF +! + DEALLOCATE (IRECV) + DEALLOCATE (ISEND) +! +! Neutralized charge at grid points +! + ALLOCATE (ZRECV(INSEGCELL)) +! + CALL MPI_GATHERV (ZLMAPOS, INSEGPROC, MNHREAL_MPI, ZRECV, INBSEG_PROC, & + IDECAL, MNHREAL_MPI, 0, NMNH_COMM_WORLD, IERR) +! + IF (IPROC .EQ. 0) THEN + ZLMA_NEUT_POS(1:INSEGCELL,IL) = ZRECV(1:INSEGCELL) + END IF +! + CALL MPI_GATHERV (ZLMANEG, INSEGPROC, MNHREAL_MPI, ZRECV, INBSEG_PROC, & + IDECAL, MNHREAL_MPI, 0, NMNH_COMM_WORLD, IERR) +! + IF (IPROC .EQ. 0) THEN + ZLMA_NEUT_NEG(1:INSEGCELL,IL) = ZRECV(1:INSEGCELL) + END IF +! + DEALLOCATE (ZLMAPOS) + DEALLOCATE (ZLMANEG) + DEALLOCATE (ZRECV) +! +! Charge and mixing ratios at neutralized points +! + ALLOCATE (ZRECV(NSV_ELEC*INSEGCELL)) +! + IDECALN(:) = IDECAL(:) * NSV_ELEC +! + IF (IPROC .EQ. 0) THEN + INBSEG_PROC_XNSV(:) = NSV_ELEC * INBSEG_PROC(:) + END IF +! + CALL MPI_GATHERV (ZLMAQMT, NSV_ELEC*INSEGPROC, MNHREAL_MPI, ZRECV, & + INBSEG_PROC_XNSV, & + IDECALN, MNHREAL_MPI, 0, NMNH_COMM_WORLD, IERR ) +! + IF (IPROC .EQ. 0) THEN + ZLMA_QMT(1:NSV_ELEC*INSEGCELL,IL) = ZRECV(1:NSV_ELEC*INSEGCELL) + END IF +! + CALL MPI_GATHERV (ZLMAPRT, NSV_ELEC*INSEGPROC, MNHREAL_MPI, ZRECV, & + INBSEG_PROC_XNSV, & + IDECALN, MNHREAL_MPI, 0, NMNH_COMM_WORLD, IERR ) +! + IF (IPROC .EQ. 0) THEN + ZLMA_PRT(1:NSV_ELEC*INSEGCELL,IL) = ZRECV(1:NSV_ELEC*INSEGCELL) + END IF +! + DEALLOCATE (ZLMAQMT) + DEALLOCATE (ZLMAPRT) + DEALLOCATE (ZRECV) +! +END IF +! +END SUBROUTINE GATHER_ALL_BRANCH +! +!-------------------------------------------------------------------------------- +! + SUBROUTINE PT_DISCHARGE +! +!! +!! Purpose: +!! +! +!* 0. DECLARATIONS +! ------------ +! +IMPLICIT NONE +! +! +WHERE (ABS(PEFIELDW(:,:,IKB)) > XECORONA .AND. PEFIELDW(:,:,IKB) > 0.) + PRSVS(:,:,IKB,1) = PRSVS(:,:,IKB,1) + & + XFCORONA * PEFIELDW(:,:,IKB) * (ABS(PEFIELDW(:,:,IKB)) - & + XECORONA)**2 / (PZZ(:,:,IKB+1) - PZZ(:,:,IKB)) +ENDWHERE +! +WHERE (ABS(PEFIELDW(:,:,IKB)) > XECORONA .AND. PEFIELDW(:,:,IKB) < 0.) + PRSVS(:,:,IKB,NSV_ELEC) = PRSVS(:,:,IKB,NSV_ELEC) + & + XFCORONA * PEFIELDW(:,:,IKB) * (ABS(PEFIELDW(:,:,IKB)) - & + XECORONA)**2 / (PZZ(:,:,IKB+1) - PZZ(:,:,IKB)) +ENDWHERE +! +END SUBROUTINE PT_DISCHARGE +! +!---------------------------------------------------------------------------------- +! + SUBROUTINE WRITE_OUT_ASCII +! +!! +!! Purpose: +!! +! +!* 0. DECLARATIONS +! ------------ +! +IMPLICIT NONE +! +INTEGER :: I1, I2 +INTEGER :: ILU ! unit number for IO +! +! +!* 1. FLASH PARAMETERS +! ---------------- +! +ILU = TPFILE_FGEOM_DIAG%NLU +! +! Ecriture ascii dans CEXP//'_fgeom_diag.asc" defini dans RESOLVED_ELEC +! +IF (LCARTESIAN) THEN + DO I1 = 1, NNBLIGHT + WRITE (UNIT=ILU,FMT='(I8,F9.1,I4,I6,I4,I6,F9.3,F12.3,F12.3,F9.3,F8.2,F9.2,f9.4)') & + ISFLASH_NUMBER(I1), & + ISTCOUNT_NUMBER(I1) * PTSTEP, & + ISCELL_NUMBER(I1), & + ISNB_FLASH(I1), & + ISTYPE(I1), & + ISNBSEG(I1), & + ZSEM_TRIG(I1), & + ZSCOORD_SEG(I1,1,1)*1.E-3, & + ZSCOORD_SEG(I1,1,2)*1.E-3, & + ZSCOORD_SEG(I1,1,3)*1.E-3, & + ZSNEUT_POS(I1), & + ZSNEUT_NEG(I1), ZSNEUT_POS(I1)+ZSNEUT_NEG(I1) + END DO +ELSE + DO I1 = 1, NNBLIGHT +! compute latitude and longitude of the triggering point + CALL SM_LATLON(XLATORI,XLONORI,ZSCOORD_SEG(I1,1,1),& + ZSCOORD_SEG(I1,1,2),& + ZLAT,ZLON) +! + WRITE (UNIT=ILU,FMT='(I8,F9.1,I4,I6,I4,I6,F9.3,F12.3,F12.3,F9.3,F8.2,F9.2,f9.4)') & + ISFLASH_NUMBER(I1), & + ISTCOUNT_NUMBER(I1) * PTSTEP, & + ISCELL_NUMBER(I1), & + ISNB_FLASH(I1), & + ISTYPE(I1), & + ISNBSEG(I1), & + ZSEM_TRIG(I1), & + ZLAT, & + ZLON, & + ZSCOORD_SEG(I1,1,3)*1.E-3, & + ZSNEUT_POS(I1), & + ZSNEUT_NEG(I1), ZSNEUT_POS(I1)+ZSNEUT_NEG(I1) + END DO +END IF +! +FLUSH(UNIT=ILU) +! +! +!* 2. FLASH SEGMENT COORDINATES +! ------------------------- +! +IF (LSAVE_COORD) THEN +! +! Ecriture ascii dans CEXP//'_fgeom_coord.asc" defini dans RESOLVED_ELEC +! + ILU = TPFILE_FGEOM_COORD%NLU +! + DO I1 = 1, NNBLIGHT + DO I2 = 1, ISNBSEG(I1) + WRITE (ILU, FMT='(I4,F9.1,I4,F12.3,F12.3,F12.3)') & + ISFLASH_NUMBER(I1), & + ISTCOUNT_NUMBER(I1) * PTSTEP, & + ISTYPE(I1), & + ZSCOORD_SEG(I1,I2,1)*1.E-3, & + ZSCOORD_SEG(I1,I2,2)*1.E-3, & + ZSCOORD_SEG(I1,I2,3)*1.E-3 + END DO + END DO +! + FLUSH(UNIT=ILU) +END IF +! +END SUBROUTINE WRITE_OUT_ASCII +! +!------------------------------------------------------------------------------- +! +SUBROUTINE WRITE_OUT_LMA +! +!! +!! Purpose: +!! +! +!* 0. DECLARATIONS +! ------------ +! +IMPLICIT NONE +! +INTEGER :: I1, I2 +INTEGER :: ILU ! unit number for IO +! +! +!* 1. LMA SIMULATOR +! ------------- +! +CALL SM_LATLON(XLATORI,XLONORI,ZSCOORD_SEG(:,:,1),ZSCOORD_SEG(:,:,2), & + ZLMA_LAT(:,:),ZLMA_LON(:,:)) +! +ILU = TPFILE_LMA%NLU +! +DO I1 = 1, NNBLIGHT + DO I2 = 1, ISNBSEG(I1) + WRITE (UNIT=ILU,FMT='(I6,F12.1,I6,2(F15.6),3(F15.3),3(I6),12(E15.4))') & + ISFLASH_NUMBER(I1), & + ISTCOUNT_NUMBER(I1) * PTSTEP, & + ISTYPE(I1), & + ZLMA_LAT(I1,I2), & + ZLMA_LON(I1,I2), & + ZSCOORD_SEG(I1,I2,1)*1.E-3, & + ZSCOORD_SEG(I1,I2,2)*1.E-3, & + ZSCOORD_SEG(I1,I2,3)*1.E-3, & + ISLMA_SEG_GLOB(I1,I2,1), & + ISLMA_SEG_GLOB(I1,I2,2), & + ISLMA_SEG_GLOB(I1,I2,3), & + ZSLMA_PRT(I1,I2,2), & + ZSLMA_PRT(I1,I2,3), & + ZSLMA_PRT(I1,I2,4), & + ZSLMA_PRT(I1,I2,5), & + ZSLMA_PRT(I1,I2,6), & + ZSLMA_QMT(I1,I2,2), & + ZSLMA_QMT(I1,I2,3), & + ZSLMA_QMT(I1,I2,4), & + ZSLMA_QMT(I1,I2,5), & + ZSLMA_QMT(I1,I2,6), & + ZSLMA_NEUT_POS(I1,I2), & + ZSLMA_NEUT_NEG(I1,I2) + END DO +END DO +! +FLUSH(UNIT=ILU) +! +END SUBROUTINE WRITE_OUT_LMA +! +!------------------------------------------------------------------------------- +! +RECURSIVE SUBROUTINE N8QUICK_SORT(PLIST, KORDER) + +! Quick sort routine from: +! Brainerd, W.S., Goldberg, C.H. & Adams, J.C. (1990) "Programmer's Guide to +! Fortran 90", McGraw-Hill ISBN 0-07-000248-7, pages 149-150. +! Modified by Alan Miller to include an associated integer array which gives +! the positions of the elements in the original order. +! +use modd_precision, only: MNHINT64 + +IMPLICIT NONE +! +INTEGER(kind=MNHINT64), DIMENSION (:), INTENT(INOUT) :: PLIST +INTEGER, DIMENSION (:), INTENT(OUT) :: KORDER +! +! Local variable +INTEGER :: JI + +DO JI = 1, SIZE(PLIST) + KORDER(JI) = JI +END DO + +CALL N8QUICK_SORT_1(1, SIZE(PLIST), PLIST, KORDER) + +END SUBROUTINE N8QUICK_SORT +! +!------------------------------------------------------------------------------- +! +RECURSIVE SUBROUTINE N8QUICK_SORT_1(KLEFT_END, KRIGHT_END, PLIST1, KORDER1) + +use modd_precision, only: MNHINT64 + +implicit none + +INTEGER, INTENT(IN) :: KLEFT_END, KRIGHT_END +INTEGER(kind=MNHINT64), DIMENSION (:), INTENT(INOUT) :: PLIST1 +INTEGER, DIMENSION (:), INTENT(INOUT) :: KORDER1 +! Local variables +INTEGER, PARAMETER :: IMAX_SIMPLE_SORT_SIZE = 6 + +INTEGER :: JI, JJ, ITEMP +INTEGER(kind=MNHINT64) :: ZREF, ZTEMP + +IF (KRIGHT_END < KLEFT_END + IMAX_SIMPLE_SORT_SIZE) THEN + ! Use interchange sort for small PLISTs + CALL N8INTERCHANGE_SORT(KLEFT_END, KRIGHT_END, PLIST1, KORDER1) + ! +ELSE + ! + ! Use partition ("quick") sort + ! valeur au centre du tableau + ZREF = PLIST1((KLEFT_END + KRIGHT_END)/2) + JI = KLEFT_END - 1 + JJ = KRIGHT_END + 1 + + DO + ! Scan PLIST from left end until element >= ZREF is found + DO + JI = JI + 1 + IF (PLIST1(JI) >= ZREF) EXIT + END DO + ! Scan PLIST from right end until element <= ZREF is found + DO + JJ = JJ - 1 + IF (PLIST1(JJ) <= ZREF) EXIT + END DO + + + IF (JI < JJ) THEN + ! Swap two out-of-order elements + ZTEMP = PLIST1(JI) + PLIST1(JI) = PLIST1(JJ) + PLIST1(JJ) = ZTEMP + ITEMP = KORDER1(JI) + KORDER1(JI) = KORDER1(JJ) + KORDER1(JJ) = ITEMP + ELSE IF (JI == JJ) THEN + JI = JI + 1 + EXIT + ELSE + EXIT + END IF + END DO + + IF ( KLEFT_END < JJ ) CALL N8QUICK_SORT_1( KLEFT_END, JJ, PLIST1, KORDER1 ) + IF ( JI < KRIGHT_END ) CALL N8QUICK_SORT_1( JI, KRIGHT_END, PLIST1, KORDER1 ) +END IF + +END SUBROUTINE N8QUICK_SORT_1 +! +!------------------------------------------------------------------------------- +! +SUBROUTINE N8INTERCHANGE_SORT(KLEFT_END, KRIGHT_END, PLIST2, KORDER2) + +use modd_precision, only: MNHINT64 + +implicit none + +INTEGER, INTENT(IN) :: KLEFT_END, KRIGHT_END +INTEGER(kind=MNHINT64), DIMENSION(:), INTENT(INOUT) :: PLIST2 +INTEGER, DIMENSION(:), INTENT(INOUT) :: KORDER2 +! Local variables +INTEGER :: JI, JJ, ITEMP +INTEGER(kind=MNHINT64) :: ZTEMP + +! boucle sur tous les points +DO JI = KLEFT_END, KRIGHT_END - 1 + ! + ! boucle sur les points suivants le point JI + DO JJ = JI+1, KRIGHT_END + ! + ! si la distance de JI au point est plus grande que celle de JJ + IF (PLIST2(JI) > PLIST2(JJ)) THEN + ! distance de JI au point (la plus grande) + ZTEMP = PLIST2(JI) + ! le point JJ est déplacé à l'indice JI dans le tableau + PLIST2(JI) = PLIST2(JJ) + ! le point JI est déplacé à l'indice JJ dans le tableau + PLIST2(JJ) = ZTEMP + ! indice du point JI dans le tableau + ITEMP = KORDER2(JI) + ! l'indice du point JJ est mis à la place JI + KORDER2(JI) = KORDER2(JJ) + ! l'indice du point JI est mis à la place JJ + KORDER2(JJ) = ITEMP + END IF + ! + END DO + ! +END DO + +END SUBROUTINE N8INTERCHANGE_SORT +!------------------------------------------------------------------------------- + SUBROUTINE MNH_RANDOM_NUMBER(ZRANDOM) + + use modd_precision, only: MNHINT32 + + REAL :: ZRANDOM + INTEGER(kind=MNHINT32), SAVE :: NSEED_MNH = 26032012_MNHINT32 + + ZRANDOM = real( r8_uniform_01( NSEED_MNH ), kind(ZRANDOM) ) + + END SUBROUTINE MNH_RANDOM_NUMBER + +!------------------------------------------------------------------------------------------ + + FUNCTION r8_uniform_01 ( seed ) + + !*****************************************************************************80 + ! + !! R8_UNIFORM_01 returns a unit pseudorandom R8. + ! + ! Discussion: + ! + ! An R8 is a real ( kind = 8 ) value. + ! + ! For now, the input quantity SEED is an integer variable. + ! + ! This routine implements the recursion + ! + ! seed = ( 16807 * seed ) mod ( 2^31 - 1 ) + ! r8_uniform_01 = seed / ( 2^31 - 1 ) + ! + ! The integer arithmetic never requires more than 32 bits, + ! including a sign bit. + ! + ! If the initial seed is 12345, then the first three computations are + ! + ! Input Output R8_UNIFORM_01 + ! SEED SEED + ! + ! 12345 207482415 0.096616 + ! 207482415 1790989824 0.833995 + ! 1790989824 2035175616 0.947702 + ! + ! Licensing: + ! + ! This code is distributed under the GNU LGPL license. + ! Souce here : https://people.sc.fsu.edu/~jburkardt/f_src/uniform/uniform.f90 + ! + ! Modified: + ! + ! 31 May 2007 + ! + ! Author: + ! + ! John Burkardt + ! + ! Reference: + ! + ! Paul Bratley, Bennett Fox, Linus Schrage, + ! A Guide to Simulation, + ! Second Edition, + ! Springer, 1987, + ! ISBN: 0387964673, + ! LC: QA76.9.C65.B73. + ! + ! Bennett Fox, + ! Algorithm 647: + ! Implementation and Relative Efficiency of Quasirandom + ! Sequence Generators, + ! ACM Transactions on Mathematical Software, + ! Volume 12, Number 4, December 1986, pages 362-376. + ! + ! Pierre L'Ecuyer, + ! Random Number Generation, + ! in Handbook of Simulation, + ! edited by Jerry Banks, + ! Wiley, 1998, + ! ISBN: 0471134031, + ! LC: T57.62.H37. + ! + ! Peter Lewis, Allen Goodman, James Miller, + ! A Pseudo-Random Number Generator for the System/360, + ! IBM Systems Journal, + ! Volume 8, Number 2, 1969, pages 136-143. + ! + ! Parameters: + ! + ! Input/output, integer ( kind = MNHINT32 ) SEED, the "seed" value, which should + ! NOT be 0. On output, SEED has been updated. + ! + ! Output, real ( kind = MNHREAL64 ) R8_UNIFORM_01, a new pseudorandom variate, + ! strictly between 0 and 1. + ! + use modd_precision, only: MNHINT32, MNHREAL64 + + implicit none + + integer(kind = MNHINT32), intent(inout) :: seed + real(kind=MNHREAL64) :: r8_uniform_01 + + integer(kind = MNHINT32), parameter :: i4_huge = 2147483647_MNHINT32 + + integer(kind = MNHINT32) :: k + + if ( seed == 0_MNHINT32 ) THEN + call Print_msg( NVERB_FATAL, 'GEN', 'r8_uniform_01', 'seed dummy argument must be different of 0' ) + end if + + k = seed / 127773_MNHINT32 + + seed = 16807_MNHINT32 * ( seed - k * 127773_MNHINT32 ) - k * 2836_MNHINT32 + + if ( seed < 0_MNHINT32 ) then + seed = seed + i4_huge + end if + + r8_uniform_01 = real(seed) * 4.656612875d-10 + + return + end function r8_uniform_01 +! +END SUBROUTINE FLASH_GEOM_ELEC_n +! +!------------------------------------------------------------------------------- diff --git a/src/mesonh/ext/goto_model_wrapper.f90 b/src/mesonh/ext/goto_model_wrapper.f90 new file mode 100644 index 0000000000000000000000000000000000000000..3328700f385c69fde2101daf4ef32d152dc7728f --- /dev/null +++ b/src/mesonh/ext/goto_model_wrapper.f90 @@ -0,0 +1,245 @@ +!MNH_LIC Copyright 1994-2021 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. +!----------------------------------------------------------------- +!! MODIFICATIONS +!! ------------- +!! 06/12 (Tomasini) Grid-nesting of ADVFRC and EDDY_FLUX +!! 07/13 (Bosseur & Filippi) adds Forefire +!! 2014 (Faivre) +!! 2016 (Leriche) Add MODD_CH_ICE Suppress MODD_CH_DEP_n +!! Modification 01/2016 (JP Pinty) Add LIMA +!! 10/2016 (F Brosse) Add prod/loss terms computation for chemistry +!! 07/2017 (M.Leriche) Add DIAG chimical surface fluxes +! 02/2018 Q.Libois ECRAD +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +! 2017 V.Vionnet blow snow +! 11/2019 C.Lac correction in the drag formula and application to building in addition to tree +! F. Auguste 02/21: add IBM +! T. Nagel 02/21: add turbulence recycling +!----------------------------------------------------------------- +MODULE MODI_GOTO_MODEL_WRAPPER + +INTERFACE +SUBROUTINE GOTO_MODEL_WRAPPER(KFROM, KTO, ONOFIELDLIST) +INTEGER, INTENT(IN) :: KFROM, KTO +LOGICAL, OPTIONAL, INTENT(IN) :: ONOFIELDLIST +END SUBROUTINE GOTO_MODEL_WRAPPER +END INTERFACE + +END MODULE MODI_GOTO_MODEL_WRAPPER + +SUBROUTINE GOTO_MODEL_WRAPPER(KFROM, KTO, ONOFIELDLIST) +! all USE modd*_n modules +USE MODD_ADVFRC_n +USE MODD_ADV_n +USE MODD_ALLSTATION_n +USE MODD_BIKHARDT_n +USE MODD_BLANK_n +USE MODD_BLOWSNOW_n +USE MODD_CH_AERO_n +USE MODD_CH_BUDGET_n +USE MODD_CH_FLX_n +USE MODD_CH_ICE_n +USE MODD_CH_JVALUES_n +USE MODD_CH_M9_n +USE MODD_CH_MNHC_n +USE MODD_CH_PH_n +USE MODD_CH_PRODLOSSTOT_n +USE MODD_CH_ROSENBROCK_n +USE MODD_CH_SOLVER_n +USE MODD_CLOUDPAR_n +USE MODD_PARAM_ICE_n +USE MODD_RAIN_ICE_PARAM_n +USE MODD_RAIN_ICE_DESCR_n +USE MODD_CLOUD_MF_n +USE MODD_CONF_n +USE MODD_CURVCOR_n +USE MODD_DIM_n +USE MODD_DRAG_n +USE MODD_DRAGTREE_n +USE MODD_DRAGBLDG_n +USE MODD_DUMMY_GR_FIELD_n +USE MODD_DYN_n +USE MODD_DYNZD_n +USE MODD_FIELD_n +#ifdef MNH_FOREFIRE +USE MODD_FOREFIRE_n +#endif +USE MODD_FRC_n +USE MODD_GET_n +USE MODD_GR_FIELD_n +USE MODD_IBM_LSF +USE MODD_IBM_PARAM_n +USE MODD_IO_SURF_MNH +USE MODD_LBC_n +USE MODD_LES_n +USE MODD_LSFIELD_n +USE MODD_LUNIT_n +USE MODD_MEAN_FIELD_n +USE MODD_METRICS_n +USE MODD_NEST_PGD_n +USE MODD_NUDGING_n +USE MODD_OUT_n +USE MODD_PACK_GR_FIELD_n +USE MODD_PARAM_KAFR_n +USE MODD_PARAM_MFSHALL_n +USE MODD_PARAM_n +USE MODD_PARAM_RAD_n +USE MODD_PARAM_ECRAD_n +USE MODD_PASPOL_n +USE MODD_PAST_FIELD_n +USE MODD_PRECIP_n +USE MODD_ELEC_n +USE MODD_PROFILER_n +USE MODD_RADIATIONS_n +USE MODD_RBK90_Global_n +USE MODD_RBK90_JacobianSP_n +USE MODD_RBK90_Parameters_n +USE MODD_RECYCL_PARAM_n +USE MODD_REF_n +USE MODD_RELFRC_n +USE MODD_SECPGD_FIELD_n +USE MODD_SERIES_n +USE MODD_SHADOWS_n +USE MODD_STATION_n +USE MODD_SUB_CH_FIELD_VALUE_n +USE MODD_SUB_CH_MONITOR_n +USE MODD_SUB_ELEC_n +USE MODD_SUB_MODEL_n +USE MODD_SUB_PASPOL_n +USE MODD_SUB_PHYS_PARAM_n +USE MODD_SUB_PROFILER_n +USE MODD_SUB_STATION_n +USE MODD_TIMEZ +USE MODD_TURB_n +USE MODD_NEB_n, ONLY: NEB_GOTO_MODEL +! +! +use mode_field, only: Fieldlist_goto_model +use mode_msg +! +! +IMPLICIT NONE +! +INTEGER, INTENT(IN) :: KFROM, KTO +LOGICAL, OPTIONAL, INTENT(IN) :: ONOFIELDLIST +! +CHARACTER(LEN=64) :: YMSG +LOGICAL :: GNOFIELDLIST +! +WRITE(YMSG,'( I4,"->",I4 )') KFROM,KTO +CALL PRINT_MSG(NVERB_DEBUG,'GEN','GOTO_MODEL_WRAPPER',TRIM(YMSG)) +! +IF (PRESENT(ONOFIELDLIST)) THEN + GNOFIELDLIST = ONOFIELDLIST +ELSE + GNOFIELDLIST = .FALSE. +END IF +! +! All calls to specific modd_*n goto_model routines +! +CALL ADV_GOTO_MODEL(KFROM, KTO) +CALL BIKHARDT_GOTO_MODEL(KFROM, KTO) +CALL BLANK_GOTO_MODEL(KFROM,KTO) +CALL CH_AERO_GOTO_MODEL(KFROM,KTO) +CALL CH_FLX_GOTO_MODEL(KFROM, KTO) +CALL CH_JVALUES_GOTO_MODEL(KFROM, KTO) +CALL CH_MNHC_GOTO_MODEL(KFROM, KTO) +CALL CH_SOLVER_GOTO_MODEL(KFROM, KTO) +CALL CLOUDPAR_GOTO_MODEL(KFROM, KTO) +CALL PARAM_ICE_GOTO_MODEL(KFROM, KTO) +CALL RAIN_ICE_PARAM_GOTO_MODEL(KFROM, KTO) +CALL RAIN_ICE_DESCR_GOTO_MODEL(KFROM, KTO) +CALL CLOUD_MF_GOTO_MODEL(KFROM, KTO) +CALL CONF_GOTO_MODEL(KFROM, KTO) +CALL CURVCOR_GOTO_MODEL(KFROM, KTO) +!CALL DEEP_CONVECTION_GOTO_MODEL(KFROM, KTO) +CALL DIM_GOTO_MODEL(KFROM, KTO) +CALL DRAGTREE_GOTO_MODEL(KFROM, KTO) +CALL DRAGBLDG_GOTO_MODEL(KFROM, KTO) +CALL DUMMY_GR_FIELD_GOTO_MODEL(KFROM, KTO) +CALL DYN_GOTO_MODEL(KFROM, KTO) +CALL DYNZD_GOTO_MODEL(KFROM,KTO) +CALL FIELD_GOTO_MODEL(KFROM, KTO) +!CALL PAST_FIELD_GOTO_MODEL(KFROM, KTO) +CALL GET_GOTO_MODEL(KFROM, KTO) +!CALL GR_FIELD_GOTO_MODEL(KFROM, KTO) +!$20140403 add grid_conf_proj_goto_model +!CALL GRID_CONF_PROJ_GOTO_MODEL(KFROM,KTO) +!$ +!CALL GRID_GOTO_MODEL(KFROM, KTO) +!CALL HURR_FIELD_GOTO_MODEL(KFROM, KTO) +!$20140403 add io_surf_mnh_goto_model!! +CALL IO_SURF_MNH_GOTO_MODEL(KFROM, KTO) +!$ +CALL LBC_GOTO_MODEL(KFROM, KTO) +CALL LES_GOTO_MODEL(KFROM, KTO) +CALL LSFIELD_GOTO_MODEL(KFROM, KTO) +CALL LUNIT_GOTO_MODEL(KFROM, KTO) +CALL MEAN_FIELD_GOTO_MODEL(KFROM, KTO) +CALL METRICS_GOTO_MODEL(KFROM, KTO) +CALL NEST_PGD_GOTO_MODEL(KFROM, KTO) +CALL NUDGING_GOTO_MODEL(KFROM, KTO) +CALL OUT_GOTO_MODEL(KFROM, KTO) +CALL PACK_GR_FIELD_GOTO_MODEL(KFROM, KTO) +CALL PARAM_KAFR_GOTO_MODEL(KFROM, KTO) +CALL PARAM_MFSHALL_GOTO_MODEL(KFROM, KTO) +CALL PARAM_GOTO_MODEL(KFROM, KTO) +CALL PARAM_RAD_GOTO_MODEL(KFROM, KTO) +#ifdef MNH_ECRAD +CALL PARAM_ECRAD_GOTO_MODEL(KFROM, KTO) +#endif +CALL PASPOL_GOTO_MODEL(KFROM, KTO) +#ifdef MNH_FOREFIRE +CALL FOREFIRE_GOTO_MODEL(KFROM, KTO) +#endif +!CALL PRECIP_GOTO_MODEL(KFROM, KTO) +CALL ELEC_GOTO_MODEL(KFROM, KTO) +CALL PROFILER_GOTO_MODEL(KFROM, KTO) +CALL RADIATIONS_GOTO_MODEL(KFROM, KTO) +CALL SHADOWS_GOTO_MODEL(KFROM, KTO) +CALL REF_GOTO_MODEL(KFROM, KTO) +CALL FRC_GOTO_MODEL(KFROM, KTO) +CALL SECPGD_FIELD_GOTO_MODEL(KFROM, KTO) +CALL SERIES_GOTO_MODEL(KFROM, KTO) +CALL STATION_GOTO_MODEL(KFROM, KTO) +CALL ALLSTATION_GOTO_MODEL(KFROM, KTO) +CALL SUB_CH_FIELD_VALUE_GOTO_MODEL(KFROM, KTO) +CALL SUB_CH_MONITOR_GOTO_MODEL(KFROM, KTO) +CALL SUB_MODEL_GOTO_MODEL(KFROM, KTO) +CALL SUB_PHYS_PARAM_GOTO_MODEL(KFROM, KTO) +CALL SUB_PROFILER_GOTO_MODEL(KFROM, KTO) +CALL SUB_STATION_GOTO_MODEL(KFROM, KTO) +CALL SUB_PASPOL_GOTO_MODEL(KFROM, KTO) +CALL SUB_ELEC_GOTO_MODEL(KFROM, KTO) +!CALL TIME_GOTO_MODEL(KFROM, KTO) +CALL TURB_GOTO_MODEL(KFROM, KTO) +CALL NEB_GOTO_MODEL(KFROM, KTO) +CALL DRAG_GOTO_MODEL(KFROM, KTO) +CALL TIMEZ_GOTO_MODEL(KFROM, KTO) +CALL CH_PH_GOTO_MODEL(KFROM, KTO) +CALL CH_ICE_GOTO_MODEL(KFROM, KTO) +CALL CH_M9_GOTO_MODEL(KFROM, KTO) +CALL CH_ROSENBROCK_GOTO_MODEL(KFROM, KTO) +CALL RBK90_Global_GOTO_MODEL(KFROM, KTO) +CALL RBK90_JacobianSP_GOTO_MODEL(KFROM, KTO) +CALL RBK90_Parameters_GOTO_MODEL(KFROM, KTO) +! +!CALL LIMA_PRECIP_SCAVENGING_GOTO_MODEL(KFROM, KTO) +! +!CALL EDDY_FLUX_GOTO_MODEL(KFROM, KTO) +!CALL EDDYUV_FLUX_GOTO_MODEL(KFROM, KTO) +CALL ADVFRC_GOTO_MODEL(KFROM, KTO) +CALL RELFRC_GOTO_MODEL(KFROM, KTO) +CALL CH_PRODLOSSTOT_GOTO_MODEL(KFROM,KTO) +CALL CH_BUDGET_GOTO_MODEL(KFROM,KTO) +CALL BLOWSNOW_GOTO_MODEL(KFROM, KTO) +CALL IBM_GOTO_MODEL(KFROM, KTO) +CALL RECYCL_GOTO_MODEL(KFROM, KTO) +CALL LSF_GOTO_MODEL(KFROM, KTO) +! +IF (.NOT.GNOFIELDLIST) CALL FIELDLIST_GOTO_MODEL(KFROM, KTO) +! +END SUBROUTINE GOTO_MODEL_WRAPPER diff --git a/src/mesonh/ext/ground_paramn.f90 b/src/mesonh/ext/ground_paramn.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e07e6f62a450748a4c3fce2496176ee6ba8f737f --- /dev/null +++ b/src/mesonh/ext/ground_paramn.f90 @@ -0,0 +1,1230 @@ +!MNH_LIC Copyright 1994-2020 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_GROUND_PARAM_n +! ########## +! +INTERFACE +! + SUBROUTINE GROUND_PARAM_n(D, PSFTH, PSFRV, PSFSV, PSFCO2, PSFU, PSFV, & + PDIR_ALB, PSCA_ALB, PEMIS, PTSRAD, KTCOUNT, TPFILE ) +! +USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t +!* surface fluxes +! -------------- +! +USE MODD_IO, ONLY: TFILEDATA +! +TYPE(DIMPHYEX_t), INTENT(IN) :: D +REAL, DIMENSION(:,:), INTENT(OUT) :: PSFTH ! surface flux of potential temperature (Km/s) +REAL, DIMENSION(:,:), INTENT(OUT) :: PSFRV ! surface flux of water vapor (m/s*kg/kg) +REAL, DIMENSION(:,:,:),INTENT(OUT):: PSFSV ! surface flux of scalar (m/s*kg/kg) + ! flux of chemical var. (ppp.m/s) +REAL, DIMENSION(:,:), INTENT(OUT) :: PSFCO2! surface flux of CO2 (m/s*kg/kg) +REAL, DIMENSION(:,:), INTENT(OUT) :: PSFU ! surface fluxes of horizontal +REAL, DIMENSION(:,:), INTENT(OUT) :: PSFV ! momentum in x and y directions (m2/s2) +! +!* Radiative parameters +! -------------------- +! +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PDIR_ALB ! direct albedo for each spectral band (-) +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSCA_ALB ! diffuse albedo for each spectral band (-) +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PEMIS ! surface emissivity (-) +REAL, DIMENSION(:,:), INTENT(OUT) :: PTSRAD ! surface radiative temperature (K) +! +INTEGER, INTENT(IN) :: KTCOUNT ! temporal iteration count +TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Synchronous output file +END SUBROUTINE GROUND_PARAM_n +! +END INTERFACE +! +END MODULE MODI_GROUND_PARAM_n +! +! ###################################################################### + SUBROUTINE GROUND_PARAM_n(D, PSFTH, PSFRV, PSFSV, PSFCO2, PSFU, PSFV, & + PDIR_ALB, PSCA_ALB, PEMIS, PTSRAD, KTCOUNT, TPFILE ) +! ####################################################################### +! +! +!!**** *GROUND_PARAM* +!! +!! PURPOSE +!! ------- +! Monitor to call the externalized surface +! +!!** METHOD +!! ------ +! +!! EXTERNAL +!! -------- +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! +!! REFERENCE +!! --------- +!! +!! Noilhan and Planton (1989) +!! +!! AUTHOR +!! ------ +!! S. Belair * Meteo-France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 10/03/95 +!! (J.Stein) 25/10/95 add the rain flux computation at the ground +!! and the lbc +!! (J.Stein) 15/11/95 include the strong slopes cases +!! (J.Stein) 06/02/96 bug correction for the precipitation flux writing +!! (J.Stein) 20/05/96 set the right IGRID value for the rain rate +!! (J.Viviand) 04/02/97 add cold and convective precipitation rate +!! (J.Stein) 22/06/97 use the absolute pressure +!! (V.Masson) 09/07/97 add directional z0 computations and RESA correction +!! (V.Masson) 13/02/98 merge the ISBA and TSZ0 routines, +!! rename the routine as a monitor, called by PHYS_PARAMn +!! add the town parameterization +!! recomputes z0 where snow is. +!! pack and unpack of 2D fields into 1D fields +!! (V.Masson) 04/01/00 removes the TSZ0 case +! (F.Solmon/V.Masson) adapatation for patch approach +! modification of internal subroutine pack/ allocation in function +! of patch indices +! calling of isba for each defined patch +! averaging of patch fluxes to get nat fluxes +! (P. Tulet/G.Guenais) 04/02/01 separation of vegetatives class +! for friction velocity and +! aerodynamical resistance +! (S Donnier) 09/12/02 add specific humidity at 2m for diagnostic +! (V.Masson) 01/03/03 externalisation of the surface schemes! +! (P.Tulet ) 01/11/03 externalisation of the surface chemistry! +!! (D.Gazen) 01/12/03 change emissions handling for surf. externalization +!! (J.escobar) 18/10/2012 missing USE MODI_COUPLING_SURF_ATM_n & MODI_DIAG_SURF_ATM_n +! (J.escobar) 02/2014 add Forefire coupling +!! (G.Delautier) 06/2016 phasage surfex 8 +!! (B.Vie) 2016 LIMA +!! (J.Pianezze) 08/2016 add send/recv oasis functions +!! (M.Leriche) 24/03/16 remove flag for chemical surface fluxes +!! (M.Leriche) 01/07/2017 Add DIAG chimical surface fluxes +!! 01/2018 (G.Delautier) SURFEX 8.1 +!! 02/2018 Q.Libois ECRAD +!! (P.Wautelet) 28/03/2018 replace TEMPORAL_DIST by DATETIME_DISTANCE + +!! (V. Vionnet) 18/07/2017 add coupling for blowing snow module +!! (Bielli S.) 02/2019 Sea salt : significant sea wave height influences salt emission; 5 salt modes +! P. Wautelet 20/05/2019: add name argument to ADDnFIELD_ll + new ADD4DFIELD_ll subroutine +! P. Wautelet 09/02/2022: bugfix: add missing XCURRENT_LEI computation +! A. Costes 12/2021: Blaze Fire model +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +! +#ifdef CPLOASIS +USE MODI_GET_HALO +USE MODI_MNH_OASIS_RECV +USE MODI_MNH_OASIS_SEND +USE MODD_SFX_OASIS, ONLY : LOASIS +USE MODD_DYN, ONLY : XSEGLEN +USE MODD_DYN_n, ONLY : DYN_MODEL +#endif +! +USE MODD_LUNIT_n, ONLY: TLUOUT +USE MODD_CST, ONLY : XP00, XCPD, XRD, XRV,XRHOLW, XDAY, XPI, XLVTT, XMD, XAVOGADRO +USE MODD_DIMPHYEX, ONLY : DIMPHYEX_t +USE MODD_PARAMETERS, ONLY : JPVEXT, XUNDEF +USE MODD_DYN_n, ONLY : XTSTEP +USE MODD_CH_MNHC_n, ONLY : LUSECHEM +USE MODD_CH_M9_n, ONLY : CNAMES +USE MODD_FIELD_n, ONLY : XUT, XVT, XWT, XTHT, XRT, XPABST, XSVT, XTKET, XZWS,& +XLSPHI, XBMAP, XFMR0, XFMRFA, XFMWF0, XFMR00, XFMIGNITION, XFMFUELTYPE,& +XFIRETAU, XFLUXPARAMH, XFLUXPARAMW, XFIRERW, XFMASE, XFMAWC, XFMWALKIG,& +XFMFLUXHDH, XFMFLUXHDW, XRTHS, XRRS, XFMHWS, XFMWINDU, XFMWINDV, XFMWINDW, XGRADLSPHIX, & +XGRADLSPHIY, XFIREWIND, XFMGRADOROX, XFMGRADOROY +USE MODD_METRICS_n, ONLY : XDXX, XDYY, XDZZ +USE MODD_DIM_n, ONLY : NKMAX +USE MODD_GRID_n, ONLY : XLON, XZZ, XDIRCOSXW, XDIRCOSYW, XDIRCOSZW, & + XCOSSLOPE, XSINSLOPE, XZS +USE MODD_REF_n, ONLY : XRHODREF,XRHODJ,XEXNREF +USE MODD_CONF_n, ONLY : NRR +USE MODD_PARAM_n, ONLY : CDCONV,CCLOUD, CRAD +USE MODD_PRECIP_n, ONLY : XINPRC, XINPRR, XINPRS, XINPRG, XINPRH +USE MODD_DEEP_CONVECTION_n, ONLY : XPRCONV, XPRSCONV +USE MODD_CONF, ONLY : LCARTESIAN, CPROGRAM +USE MODD_TIME_n, ONLY : TDTCUR +USE MODD_RADIATIONS_n, ONLY : XFLALWD, XCCO2, XTSIDER, & + XSW_BANDS, XDIRSRFSWD, XSCAFLASWD, & + XZENITH, XAZIM, XAER, XSWU, XLWU +USE MODD_NSV +USE MODD_GRID, ONLY : XLON0, XRPK, XBETA +USE MODD_PARAM_ICE_n, ONLY : LSEDIC +USE MODD_PARAM_C2R2, ONLY : LSEDC +USE MODD_DIAG_IN_RUN +USE MODD_DUST, ONLY : LDUST +USE MODD_SALT, ONLY : LSALT +USE MODD_BLOWSNOW +USE MODD_BLOWSNOW_n +USE MODD_CH_AEROSOL, ONLY : LORILAM +USE MODD_CSTS_DUST, ONLY : XMOLARWEIGHT_DUST +USE MODD_CSTS_SALT, ONLY : XMOLARWEIGHT_SALT +USE MODD_CH_FLX_n, ONLY : XCHFLX +USE MODD_DIAG_FLAG, ONLY : LCHEMDIAG +! +USE MODI_NORMAL_INTERPOL +USE MODE_ROTATE_WIND, ONLY : ROTATE_WIND +USE MODI_SHUMAN +USE MODI_MNHGET_SURF_PARAM_n +USE MODI_COUPLING_SURF_ATM_n +USE MODI_DIAG_SURF_ATM_n +USE MODD_MNH_SURFEX_n +! +USE MODE_DATETIME +USE MODE_ll +USE MODD_ARGSLIST_ll, ONLY : LIST_ll +#ifdef MNH_FOREFIRE +!** MODULES FOR FOREFIRE **! +USE MODD_FOREFIRE +USE MODD_FOREFIRE_n +USE MODI_COUPLING_FOREFIRE_n +#endif +! +USE MODD_TIME_n +USE MODD_TIME +! +USE MODD_PARAM_LIMA, ONLY : MSEDC=>LSEDC +! +USE MODD_FIRE +USE MODD_FIELD +USE MODI_FIRE_MODEL +USE MODD_CONF, ONLY : NVERB, NHALO +USE MODE_MNH_TIMING, ONLY : SECOND_MNH2 +USE MODE_MSG +USE MODD_IO, ONLY: TFILEDATA +! +IMPLICIT NONE +! +! +! +!* 0.1 declarations of arguments +! +!* surface fluxes +! -------------- +! +TYPE(DIMPHYEX_t), INTENT(IN) :: D +REAL, DIMENSION(:,:), INTENT(OUT) :: PSFTH ! surface flux of potential temperature (Km/s) +REAL, DIMENSION(:,:), INTENT(OUT) :: PSFRV ! surface flux of water vapor (m/s*kg/kg) +REAL, DIMENSION(:,:,:),INTENT(OUT):: PSFSV ! surface flux of scalar (m/s*kg/kg) + ! flux of chemical var. (ppp.m/s) +REAL, DIMENSION(:,:), INTENT(OUT) :: PSFCO2! surface flux of CO2 (m/s*kg/kg) +REAL, DIMENSION(:,:), INTENT(OUT) :: PSFU ! surface fluxes of horizontal +REAL, DIMENSION(:,:), INTENT(OUT) :: PSFV ! momentum in x and y directions (m2/s2) +! +!* Radiative parameters +! -------------------- +! +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PDIR_ALB ! direct albedo for each spectral band (-) +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSCA_ALB ! diffuse albedo for each spectral band (-) +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PEMIS ! surface emissivity (-) +REAL, DIMENSION(:,:), INTENT(OUT) :: PTSRAD ! surface radiative temperature (K) +! +INTEGER, INTENT(IN) :: KTCOUNT ! temporal iteration count +TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Synchronous output file +! +!------------------------------------------------------------------------------- +! +! +! +!* 0.2 declarations of local variables +! ------------------------------- +! +! +!* Atmospheric variables +! --------------------- +! +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRV ! vapor mixing ratio +! +! suffix 'A' stands for atmospheric variable at first model level +! +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZZREF ! Forcing height +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZTA ! Temperature +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZRVA ! vapor mixing ratio +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZQA ! humidity (kg/m3) +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZPA ! Pressure +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZPS ! Pressure +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZEXNA ! Exner function +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZEXNS ! Exner function +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZTHA ! potential temperature +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZRAIN ! liquid precipitation (kg/m2/s) +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZSNOW ! solid precipitation (kg/m2/s) +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZTSUN ! solar time (s since midnight) +! +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZUA ! u component of the wind +! ! parallel to the orography +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZVA ! v component of the wind +! ! parallel to the orography +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZU ! zonal wind +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZV ! meridian wind +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZWIND ! wind parallel to the orography +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZRHOA ! air density +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZDIR ! wind direction (rad from N clockwise) +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZSFU ! zonal momentum flux +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZSFV ! meridian momentum flux +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZCO2 ! CO2 concentration (kg/kg) +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZALFA ! angle between the wind +! ! and the x axis +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2),1):: ZU2D ! u and v component of the +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2),1):: ZV2D ! wind at mass point +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZSFTH ! Turbulent flux of heat +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZSFTQ ! Turbulent flux of water +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2)) :: ZSFCO2 ! Turbulent flux of CO2 +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2),NSV):: ZSFTS! Turbulent flux of scalar +! +REAL, DIMENSION(SIZE(PSFTH,1),SIZE(PSFTH,2),NBLOWSNOW_2D) :: ZBLOWSNOW_2D ! 2D blowing snow variables + ! after advection + ! They refer to the 2D fields advected by MNH including: + ! - total number concentration in Canopy + ! - total mass concentration in Canopy + ! - equivalent concentration in the saltation layer +! +!* Dimensions +! ---------- +! +INTEGER :: IIB ! physical boundary +INTEGER :: IIE ! physical boundary +INTEGER :: IJB ! physical boundary +INTEGER :: IJE ! physical boundary +INTEGER :: IKB ! physical boundary +INTEGER :: IKE ! physical boundary +INTEGER :: IKU ! vertical array sizes +! +INTEGER :: JLAYER ! loop counter +INTEGER :: JSV ! loop counter +INTEGER :: JI,JJ,JK ! loop index +! +INTEGER :: IDIM1 ! X physical dimension +INTEGER :: IDIM2 ! Y physical dimension +INTEGER :: IDIM1D! total physical dimension +INTEGER :: IKRAD +! +INTEGER :: KSV_SURF ! Number of scalar variables sent to SURFEX +! +!* Arrays put in 1D vectors +! ------------------------ +! +REAL, DIMENSION(:), ALLOCATABLE :: ZP_TSUN ! solar time +REAL, DIMENSION(:), ALLOCATABLE :: ZP_ZENITH ! zenithal angle +REAL, DIMENSION(:), ALLOCATABLE :: ZP_AZIM ! azimuthal angle +REAL, DIMENSION(:), ALLOCATABLE :: ZP_ZREF ! forcing height +REAL, DIMENSION(:), ALLOCATABLE :: ZP_ZS ! orography +REAL, DIMENSION(:), ALLOCATABLE :: ZP_U ! zonal wind +REAL, DIMENSION(:), ALLOCATABLE :: ZP_V ! meridian wind +REAL, DIMENSION(:), ALLOCATABLE :: ZP_QA ! air humidity (kg/m3) +REAL, DIMENSION(:), ALLOCATABLE :: ZP_TA ! air temperature +REAL, DIMENSION(:), ALLOCATABLE :: ZP_RHOA ! air density +REAL, DIMENSION(:,:), ALLOCATABLE :: ZP_SV ! scalar at first atmospheric level +REAL, DIMENSION(:), ALLOCATABLE :: ZP_CO2 ! air CO2 concentration +REAL, DIMENSION(:), ALLOCATABLE :: ZP_RAIN ! liquid precipitation +REAL, DIMENSION(:), ALLOCATABLE :: ZP_SNOW ! solid precipitation +REAL, DIMENSION(:), ALLOCATABLE :: ZP_LW ! incoming longwave +REAL, DIMENSION(:,:), ALLOCATABLE :: ZP_DIR_SW ! direct incoming shortwave +REAL, DIMENSION(:,:), ALLOCATABLE :: ZP_SCA_SW ! diffuse incoming shortwave +REAL, DIMENSION(:), ALLOCATABLE :: ZP_PS ! surface pressure +REAL, DIMENSION(:), ALLOCATABLE :: ZP_PA ! pressure at first atmospheric level +REAL, DIMENSION(:), ALLOCATABLE :: ZP_ZWS ! significant wave height (m) + +REAL, DIMENSION(:), ALLOCATABLE :: ZP_SFTQ ! water vapor flux +REAL, DIMENSION(:), ALLOCATABLE :: ZP_SFTH ! potential temperature flux +REAL, DIMENSION(:,:), ALLOCATABLE :: ZP_SFTS ! scalar flux +REAL, DIMENSION(:), ALLOCATABLE :: ZP_SFCO2 ! CO2 flux +REAL, DIMENSION(:), ALLOCATABLE :: ZP_SFU ! zonal momentum flux +REAL, DIMENSION(:), ALLOCATABLE :: ZP_SFV ! meridian momentum flux +REAL, DIMENSION(:), ALLOCATABLE :: ZP_TSRAD ! radiative surface temperature +REAL, DIMENSION(:,:), ALLOCATABLE :: ZP_DIR_ALB ! direct albedo +REAL, DIMENSION(:,:), ALLOCATABLE :: ZP_SCA_ALB ! diffuse albedo +REAL, DIMENSION(:), ALLOCATABLE :: ZP_EMIS ! emissivity + +REAL, DIMENSION(:), ALLOCATABLE :: ZP_TSURF +REAL, DIMENSION(:), ALLOCATABLE :: ZP_Z0 +REAL, DIMENSION(:), ALLOCATABLE :: ZP_Z0H +REAL, DIMENSION(:), ALLOCATABLE :: ZP_QSURF + +REAL, DIMENSION(:), ALLOCATABLE :: ZP_PEW_A_COEF ! coefficients for +REAL, DIMENSION(:), ALLOCATABLE :: ZP_PEW_B_COEF ! implicit coupling +REAL, DIMENSION(:), ALLOCATABLE :: ZP_PET_A_COEF +REAL, DIMENSION(:), ALLOCATABLE :: ZP_PEQ_A_COEF +REAL, DIMENSION(:), ALLOCATABLE :: ZP_PET_B_COEF +REAL, DIMENSION(:), ALLOCATABLE :: ZP_PEQ_B_COEF +REAL, DIMENSION(:), ALLOCATABLE :: ZP_RN ! net radiation (W/m2) +REAL, DIMENSION(:), ALLOCATABLE :: ZP_H ! sensible heat flux (W/m2) +REAL, DIMENSION(:), ALLOCATABLE :: ZP_LE ! Total latent heat flux (W/m2) +REAL, DIMENSION(:), ALLOCATABLE :: ZP_LEI ! Solid Latent heat flux (W/m2) +REAL, DIMENSION(:), ALLOCATABLE :: ZP_GFLUX ! ground flux (W/m2) +REAL, DIMENSION(:), ALLOCATABLE :: ZP_T2M ! Air temperature at 2 meters (K) +REAL, DIMENSION(:), ALLOCATABLE :: ZP_Q2M ! Air humidity at 2 meters (kg/kg) +REAL, DIMENSION(:), ALLOCATABLE :: ZP_HU2M ! Air relative humidity at 2 meters (-) +REAL, DIMENSION(:), ALLOCATABLE :: ZP_ZON10M ! zonal Wind at 10 meters (m/s) +REAL, DIMENSION(:), ALLOCATABLE :: ZP_MER10M ! meridian Wind at 10 meters (m/s) +TYPE(LIST_ll), POINTER :: TZFIELDSURF_ll ! list of fields to exchange +INTEGER :: IINFO_ll ! return code of parallel routine +! +! +CHARACTER(LEN=6), DIMENSION(:), ALLOCATABLE :: YSV_SURF ! name of the scalar variables + ! sent to SURFEX +! +REAL :: ZTIMEC +INTEGER :: ILUOUT ! logical unit +! +! Fire model +REAL, DIMENSION(2) :: ZFIRETIME1, ZFIRETIME2 ! CPU time for Blaze perf profiling +REAL, DIMENSION(2) :: ZGRADTIME1, ZGRADTIME2 ! CPU time for Blaze perf profiling +REAL, DIMENSION(2) :: ZPROPAGTIME1, ZPROPAGTIME2 ! CPU time for Blaze perf profiling +REAL, DIMENSION(2) :: ZFLUXTIME1, ZFLUXTIME2 ! CPU time for Blaze perf profiling +REAL, DIMENSION(2) :: ZROSWINDTIME1, ZROSWINDTIME2 ! CPU time for Blaze perf profiling +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZFIREFUELMAP ! Fuel map +CHARACTER(LEN=7) :: YFUELMAPFILE ! Fuel Map file name +TYPE(LIST_ll), POINTER :: TZFIELDFIRE_ll ! list of fields to exchange + +!------------------------------------------------------------------------------- +! +! +ILUOUT=TLUOUT%NLU +IKB= 1+JPVEXT +IKU=NKMAX + 2* JPVEXT +IKE=IKU-JPVEXT +! +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +! +PSFTH = XUNDEF +PSFRV = XUNDEF +PSFSV = XUNDEF +PSFCO2 = XUNDEF +PSFU = XUNDEF +PSFV = XUNDEF +PDIR_ALB = XUNDEF +PSCA_ALB = XUNDEF +PEMIS = XUNDEF +PTSRAD = XUNDEF +! +! +!------------------------------------------------------------------------------- +! +!* 1. CONVERSION OF THE ATMOSPHERIC VARIABLES +! --------------------------------------- +! +! 1.1 water vapor +! ----------- + +! +ALLOCATE(ZRV(SIZE(PSFTH,1),SIZE(PSFTH,2),IKU)) +! +IF(NRR>0) THEN + ZRV(:,:,:)=XRT(:,:,:,1) +ELSE + ZRV(:,:,:)=0. +END IF +! +! 1.2 Horizontal wind direction (rad from N clockwise) +! ------------------------- +! +ZU2D(:,:,:)=MXF(XUT(:,:,IKB:IKB)) +ZV2D(:,:,:)=MYF(XVT(:,:,IKB:IKB)) +! +!* angle between Y axis and wind (rad., clockwise) +! +ZALFA = 0. +WHERE(ZU2D(:,:,1)/=0. .OR. ZV2D(:,:,1)/=0.) + ZALFA(:,:)=ATAN2(ZU2D(:,:,1),ZV2D(:,:,1)) +END WHERE +WHERE(ZALFA(:,:)<0.) ZALFA(:,:) = ZALFA(:,:) + 2. * XPI +! +!* angle between North and wind (rad., clockwise) +! +IF (.NOT. LCARTESIAN) THEN + ZDIR = ( (XRPK*(XLON(:,:)-XLON0)) - XBETA ) * XPI/180. + ZALFA +ELSE + ZDIR = - XBETA * XPI/180. + ZALFA +END IF +! +! +! 1.3 Rotate the wind +! --------------- +! +CALL ROTATE_WIND(D,XUT,XVT,XWT, & + XDIRCOSXW, XDIRCOSYW, XDIRCOSZW, & + XCOSSLOPE,XSINSLOPE, & + XDXX,XDYY,XDZZ, & + ZUA,ZVA ) + +! +! 1.4 zonal and meridian components of the wind parallel to the slope +! --------------------------------------------------------------- +! +ZWIND(:,:) = SQRT( ZUA**2 + ZVA**2 ) +! +ZU(:,:) = ZWIND(:,:) * SIN(ZDIR) +ZV(:,:) = ZWIND(:,:) * COS(ZDIR) +! +! 1.5 Horizontal interpolation the thermodynamic fields +! ------------------------------------------------- +! +CALL NORMAL_INTERPOL(XTHT,ZRV,XPABST, & + XDIRCOSXW, XDIRCOSYW, XDIRCOSZW, & + XCOSSLOPE,XSINSLOPE, & + XDXX,XDYY,XDZZ, & + ZTHA,ZRVA,ZEXNA ) +! +DEALLOCATE(ZRV) +! +! +! 1.6 Pressure and Exner function +! --------------------------- +! +! +ZPA(:,:) = XP00 * ZEXNA(:,:) **(XCPD/XRD) +! +ZEXNS(:,:) = 0.5 * ( (XPABST(:,:,IKB-1)/XP00)**(XRD/XCPD) & + +(XPABST(:,:,IKB )/XP00)**(XRD/XCPD) & + ) +ZPS(:,:) = XP00 * ZEXNS(:,:) **(XCPD/XRD) +! +! 1.7 humidity in kg/m3 from the mixing ratio +! --------------------------------------- +! +! +ZQA(:,:) = ZRVA(:,:) * XRHODREF(:,:,IKB) +! +! +! 1.8 Temperature from the potential temperature +! ------------------------------------------ +! +! +ZTA(:,:) = ZTHA(:,:) * ZEXNA(:,:) +! +! +! 1.9 Air density +! ----------- +! +ZRHOA(:,:) = ZPA(:,:)/(XRD * ZTA(:,:) * ((1. + (XRD/XRV)*ZRVA(:,:))/ & + (1. + ZRVA(:,:)))) +! +! +! 1.10 Precipitations +! -------------- +! +ZRAIN=0. +ZSNOW=0. +IF (NRR>2 .AND. SIZE(XINPRR)>0 ) THEN + IF (( CCLOUD(1:3) == 'ICE' .AND. LSEDIC) .OR. & + ((CCLOUD == 'C2R2' .OR. CCLOUD == 'C3R5' .OR. CCLOUD == 'KHKO') .AND. LSEDC) .OR. & + ( CCLOUD=='LIMA' .AND. MSEDC)) THEN + ZRAIN = ZRAIN + XINPRR * XRHOLW + XINPRC * XRHOLW + ELSE + ZRAIN = ZRAIN + XINPRR * XRHOLW + END IF +END IF +IF (CDCONV == 'KAFR') THEN + ZRAIN = ZRAIN + (XPRCONV - XPRSCONV) * XRHOLW + ZSNOW = ZSNOW + XPRSCONV * XRHOLW +END IF +IF( NRR >= 5 .AND. SIZE(XINPRS)>0 ) ZSNOW = ZSNOW + XINPRS * XRHOLW +IF( NRR >= 6 .AND. SIZE(XINPRG)>0 ) ZSNOW = ZSNOW + XINPRG * XRHOLW +IF( NRR >= 7 .AND. SIZE(XINPRH)>0 ) ZSNOW = ZSNOW + XINPRH * XRHOLW +! +! +! 1.11 Solar time +! ---------- +! +IF (.NOT. LCARTESIAN) THEN + ZTSUN(:,:) = MOD(TDTCUR%xtime -XTSIDER*3600. +XLON(:,:)*240., XDAY) +ELSE + ZTSUN(:,:) = MOD(TDTCUR%xtime -XTSIDER*3600. +XLON0 *240., XDAY) +END IF +! +! 1.12 Forcing level +! ------------- +! +ZZREF(:,:) = 0.5*( XZZ(:,:,IKB+1)-XZZ(:,:,IKB) )*XDIRCOSZW(:,:) +! +! +! 1.13 CO2 concentration (kg/m3) +! ----------------- +! +ZCO2(:,:) = XCCO2 * XRHODREF(:,:,IKB) +! +! +! +! 1.14 Blowing snow scheme (optional) +! ----------------- +! +ZBLOWSNOW_2D=0. + +IF(LBLOWSNOW) THEN + KSV_SURF = NSV+NBLOWSNOW_2D ! When blowing snow scheme is used + ! NBLOWSN0W_2D variables are sent to SURFEX through ZP_SV. + ! They refer to the 2D fields advected by MNH including: + ! - total number concentration in Canopy + ! - total mass concentration in Canopy + ! - equivalent concentration in the saltation layer + ! Initialize array of scalar to be sent to SURFEX including 2D blowing snow fields + ALLOCATE(YSV_SURF(KSV_SURF)) + YSV_SURF(1:NSV) = CSV(:) + YSV_SURF(NSV+1:KSV_SURF) = YPBLOWSNOW_2D(:) + + + DO JSV=1,NBLOWSNOW_2D + ZBLOWSNOW_2D(:,:,JSV) = XRSNWCANOS(:,:,JSV)*XTSTEP/XRHODJ(:,:,IKB) + END DO + +ELSE + KSV_SURF = NSV + ALLOCATE(YSV_SURF(KSV_SURF)) + YSV_SURF(:) = CSV(:) +ENDIF +! +!------------------------------------------------------------------------------- +! +!* 2. Call to surface monitor with 2D variables +! ----------------------------------------- +! +! +! initial values: +! +IDIM1 = IIE-IIB+1 +IDIM2 = IJE-IJB+1 +IDIM1D = IDIM1*IDIM2 +! +! +! Transform 2D input fields into 1D: +! +CALL RESHAPE_SURF(IDIM1D) +! +! call to have the cumulated time since beginning of simulation +! +CALL DATETIME_DISTANCE(TDTSEG,TDTCUR,ZTIMEC) + +#ifdef CPLOASIS +IF (LOASIS) THEN + IF ( MOD(ZTIMEC,1.0) .LE. 1E-2 .OR. (1.0 - MOD(ZTIMEC,1.0)) .LE. 1E-2 ) THEN + IF ( NINT(ZTIMEC-(XSEGLEN-DYN_MODEL(1)%XTSTEP)) .LT. 0 ) THEN + WRITE(ILUOUT,*) '----------------------------' + WRITE(ILUOUT,*) ' Reception des champs avec OASIS' + WRITE(ILUOUT,*) 'NINT(ZTIMEC)=', NINT(ZTIMEC) + CALL MNH_OASIS_RECV(CPROGRAM,IDIM1D,SIZE(XSW_BANDS),ZTIMEC+XTSTEP,XTSTEP, & + ZP_ZENITH,XSW_BANDS , & + ZP_TSRAD,ZP_DIR_ALB,ZP_SCA_ALB,ZP_EMIS,ZP_TSURF) + WRITE(ILUOUT,*) '----------------------------' + END IF + END IF +END IF +#endif +! +! Call to surface schemes +! +CALL COUPLING_SURF_ATM_n(YSURF_CUR,'MESONH', 'E',ZTIMEC, & + XTSTEP, TDTCUR%nyear, TDTCUR%nmonth, TDTCUR%nday, TDTCUR%xtime, & + IDIM1D,KSV_SURF,SIZE(XSW_BANDS), & + ZP_TSUN, ZP_ZENITH,ZP_ZENITH, ZP_AZIM, & + ZP_ZREF, ZP_ZREF, ZP_ZS, ZP_U, ZP_V, ZP_QA, ZP_TA, ZP_RHOA, ZP_SV, ZP_CO2, YSV_SURF, & + ZP_RAIN, ZP_SNOW, ZP_LW, ZP_DIR_SW, ZP_SCA_SW, XSW_BANDS, ZP_PS, ZP_PA, & + ZP_SFTQ, ZP_SFTH, ZP_SFTS, ZP_SFCO2, ZP_SFU, ZP_SFV, & + ZP_TSRAD, ZP_DIR_ALB, ZP_SCA_ALB, ZP_EMIS, ZP_TSURF, ZP_Z0, ZP_Z0H, ZP_QSURF, & + ZP_PEW_A_COEF, ZP_PEW_B_COEF, & + ZP_PET_A_COEF, ZP_PEQ_A_COEF, ZP_PET_B_COEF, ZP_PEQ_B_COEF,ZP_ZWS, & + 'OK' ) +! +#ifdef CPLOASIS +IF (LOASIS) THEN + IF ( MOD(ZTIMEC,1.0) .LE. 1E-2 .OR. (1.0 - MOD(ZTIMEC,1.0)) .LE. 1E-2 ) THEN + IF (NINT(ZTIMEC-(XSEGLEN-DYN_MODEL(1)%XTSTEP)) .LT. 0) THEN + WRITE(ILUOUT,*) '----------------------------' + WRITE(ILUOUT,*) ' Envoi des champs avec OASIS' + WRITE(ILUOUT,*) 'NINT(ZTIMEC)=', NINT(ZTIMEC) + CALL MNH_OASIS_SEND(CPROGRAM,IDIM1D,ZTIMEC+XTSTEP,XTSTEP) + WRITE(ILUOUT,*) '----------------------------' + END IF + END IF +END IF +#endif +! +IF (CPROGRAM=='DIAG ' .OR. LDIAG_IN_RUN) THEN + CALL DIAG_SURF_ATM_n(YSURF_CUR,'MESONH') + CALL MNHGET_SURF_PARAM_n( PRN = ZP_RN, PH = ZP_H, PLE = ZP_LE, PLEI = ZP_LEI, & + PGFLUX = ZP_GFLUX, PT2M = ZP_T2M, PQ2M = ZP_Q2M, PHU2M = ZP_HU2M, & + PZON10M = ZP_ZON10M, PMER10M = ZP_MER10M ) +END IF +! +! Transform 1D output fields into 2D: +! +CALL UNSHAPE_SURF(IDIM1,IDIM2) +#ifdef MNH_FOREFIRE +!------------------------! +! COUPLING WITH FOREFIRE ! +!------------------------! + +IF ( LFOREFIRE ) THEN + CALL FOREFIRE_DUMP_FIELDS_n(XUT, XVT, XWT, XSVT& + , XTHT, XRT(:,:,:,1), XPABST, XTKET& + , IDIM1+2, IDIM2+2, NKMAX+2) +END IF + +IF ( FFCOUPLING ) THEN + + CALL SEND_GROUND_WIND_n(XUT, XVT, IKB, IINFO_ll) + + CALL FOREFIRE_RECEIVE_PARAL_n() + + CALL COUPLING_FOREFIRE_n(XTSTEP, ZSFTH, ZSFTQ, ZSFTS) + + CALL FOREFIRE_SEND_PARAL_n(IINFO_ll) + +END IF + +FF_TIME = FF_TIME + XTSTEP +#endif +! +! Friction of components along slope axes (U: largest local slope axis, V: zero slope axis) +! +! +PSFU(:,:) = 0. +PSFV(:,:) = 0. +! +WHERE (ZSFU(:,:)/=XUNDEF .AND. ZWIND(:,:)>0.) + PSFU(:,:) = - SQRT(ZSFU**2+ZSFV**2) * ZUA(:,:) / ZWIND(:,:) / XRHODREF(:,:,IKB) + PSFV(:,:) = - SQRT(ZSFU**2+ZSFV**2) * ZVA(:,:) / ZWIND(:,:) / XRHODREF(:,:,IKB) +END WHERE +! + +!* 2.1 Blaze Fire Model +! ---------------- +! +IF (LBLAZE) THEN + ! get start time + CALL SECOND_MNH2( ZFIRETIME1 ) + + !* 2.1.1 Local variables allocation + ! -------------------------- + ! + + ! Parallel fuel + NULLIFY(TZFIELDFIRE_ll) + IF (KTCOUNT <= 1) THEN + ! fuelmap + SELECT CASE (CPROPAG_MODEL) + CASE('SANTONI2011') + ! + ALLOCATE( ZFIREFUELMAP(SIZE(XLSPHI,1), SIZE(XLSPHI,2), SIZE(XLSPHI,3), 22) ); + ! Parallel fuel + CALL ADD4DFIELD_ll( TZFIELDFIRE_ll, ZFIREFUELMAP(:,:,:,1::22), 'MODEL_n::ZFIREFUELMAP' ) + ! Default value + ZFIREFUELMAP(:,:,:,:) = 0. + END SELECT + + !* 2.1.2 Read fuel map file + ! ------------------ + ! + ! Fuel map file name + YFUELMAPFILE = 'FuelMap' + ! + CALL FIRE_READFUEL( TPFILE, ZFIREFUELMAP, XFMIGNITION, XFMWALKIG ) + + !* 2.1.3 Ignition LS function with ignition map + ! -------------------------------------- + ! + SELECT CASE (CFIRE_CPL_MODE) + CASE('2WAYCPL', 'ATM2FIR') + ! force ignition + WHERE (XFMIGNITION <= TDTCUR%XTIME ) XLSPHI = 1. + ! walking ignition + CALL FIRE_LS_RECONSTRUCTION_FROM_BMAP( XLSPHI, XFMWALKIG, 0.) + ! + !* 2.1.4 Update BMAP + ! ----------- + ! + WHERE (XLSPHI >= .5 .AND. XBMAP < 0) XBMAP = TDTCUR%XTIME + ! + CASE('FIR2ATM') + CALL FIRE_READBMAP(TPFILE,XBMAP) + + END SELECT + ! + !* 2.1.5 Compute R0, A, Wf0, R00 + ! ----------------------- + ! + SELECT CASE (CPROPAG_MODEL) + CASE('SANTONI2011') + CALL FIRE_NOWINDROS( ZFIREFUELMAP, XFMR0, XFMRFA, XFMWF0, XFMR00, XFMFUELTYPE, XFIRETAU, XFLUXPARAMH, & + XFLUXPARAMW, XFMASE, XFMAWC ) + END SELECT + ! + !* 2.1.6 Compute orographic gradient + ! --------------------------- + CALL FIRE_GRAD_OROGRAPHY( XZS, XFMGRADOROX, XFMGRADOROY ) + ! + !* 2.1.7 Test halo size + ! -------------- + IF (NHALO < 2 .AND. NFIRE_WENO_ORDER == 3) THEN + WRITE(ILUOUT,'(A/A)') 'ERROR BLAZE-FIRE : WENO3 fire gradient calculation needs NHALO >= 2' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','GROUND_PARAM_n','') + ELSEIF (NHALO < 3 .AND. NFIRE_WENO_ORDER == 5) THEN + WRITE(ILUOUT,'(A/A)') 'ERROR : WENO5 fire gradient calculation needs NHALO >= 3' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','GROUND_PARAM_n','') + END IF + ! + END IF + ! + !* 2.1.6 Compute grad of level set function phi + ! -------------------------------------- + ! + SELECT CASE (CFIRE_CPL_MODE) + CASE('2WAYCPL', 'ATM2FIR') + ! get time 1 + CALL SECOND_MNH2( ZGRADTIME1 ) + CALL FIRE_GRADPHI( XLSPHI, XGRADLSPHIX, XGRADLSPHIY ) + + ! get time 2 + CALL SECOND_MNH2( ZGRADTIME2 ) + XGRADPERF = XGRADPERF + ZGRADTIME2 - ZGRADTIME1 + ! + !* 2.1.7 Get horizontal wind speed projected on LS gradient direction + ! ------------------------------------------------------------ + ! + CALL FIRE_GETWIND( XUT, XVT, XWT, XGRADLSPHIX, XGRADLSPHIY, XFIREWIND, KTCOUNT, XTSTEP, XFMGRADOROX, XFMGRADOROY ) + ! + !* 2.1.8 Compute ROS XFIRERW with wind + ! ----------------------------- + ! + ! + SELECT CASE (CPROPAG_MODEL) + CASE('SANTONI2011') + CALL FIRE_RATEOFSPREAD( XFMFUELTYPE, XFMR0, XFMRFA, XFMWF0, XFMR00, XFIREWIND, XGRADLSPHIX, XGRADLSPHIY, & + XFMGRADOROX, XFMGRADOROY, XFIRERW ) + END SELECT + CALL SECOND_MNH2( ZROSWINDTIME2 ) + XROSWINDPERF = XROSWINDPERF + ZROSWINDTIME2 - ZGRADTIME2 + ! + !* 2.1.8 Integrate model on atm time step to propagate + ! --------------------------------------------- + ! + SELECT CASE (CPROPAG_MODEL) + CASE('SANTONI2011') + CALL FIRE_PROPAGATE( XLSPHI, XBMAP, XFMIGNITION, XFMWALKIG, XGRADLSPHIX, XGRADLSPHIY, XTSTEP, XFIRERW ) + END SELECT + CALL SECOND_MNH2( ZPROPAGTIME2 ) + XPROPAGPERF = XPROPAGPERF + ZPROPAGTIME2 - ZROSWINDTIME2 + ! + CASE('FIR2ATM') + ! + CALL SECOND_MNH2( ZPROPAGTIME1 ) + CALL FIRE_LS_RECONSTRUCTION_FROM_BMAP( XLSPHI, XBMAP, XTSTEP ) + CALL SECOND_MNH2( ZPROPAGTIME2 ) + XPROPAGPERF = XPROPAGPERF + ZPROPAGTIME2 - ZPROPAGTIME1 + XGRADPERF(:) = 0. + ! + END SELECT + ! + !* 2.1.8 Compute fluxes + ! -------------- + ! + SELECT CASE (CFIRE_CPL_MODE) + CASE('2WAYCPL','FIR2ATM') + CALL SECOND_MNH2( ZFLUXTIME1 ) + ! 2 way coupling + CALL FIRE_HEATFLUXES( XLSPHI, XBMAP, XFIRETAU, XTSTEP, XFLUXPARAMH, XFLUXPARAMW, XFMFLUXHDH, XFMFLUXHDW, XFMASE, XFMAWC ) + ! vertical distribution of fire heat fluxes + CALL FIRE_VERTICALFLUXDISTRIB( XFMFLUXHDH, XFMFLUXHDW, XRTHS, XRRS, ZSFTS, XEXNREF, XRHODJ, XRT, XRHODREF ) + ! + CALL SECOND_MNH2( ZFLUXTIME2 ) + XFLUXPERF = XFLUXPERF + ZFLUXTIME2 - ZFLUXTIME1 + CASE DEFAULT + XFLUXPERF(:) = 0. + END SELECT + ! get end time + CALL SECOND_MNH2( ZFIRETIME2 ) + ! add to Blaze time + XFIREPERF = XFIREPERF + ZFIRETIME2 - ZFIRETIME1 +END IF +!* conversion from H (W/m2) to w'Theta' +! +PSFTH(:,:) = ZSFTH(:,:) / XCPD / XRHODREF(:,:,IKB) +! +! +!* conversion from water flux (kg/m2/s) to w'rv' +! +PSFRV(:,:) = ZSFTQ(:,:) / XRHODREF(:,:,IKB) +! +! +!* conversion from scalar flux (kg/m2/s) to w'rsv' +! +IF(NSV .GT. 0) THEN + DO JSV=1,NSV + PSFSV(:,:,JSV) = ZSFTS(:,:,JSV) / XRHODREF(:,:,IKB) + END DO +END IF +! +!* conversion from chemistry flux (molec/m2/s) to (ppp.m.s-1) +! +IF (LUSECHEM) THEN + DO JSV=NSV_CHEMBEG,NSV_CHEMEND + PSFSV(:,:,JSV) = ZSFTS(:,:,JSV) * XMD / ( XAVOGADRO * XRHODREF(:,:,IKB)) + IF ((LCHEMDIAG).AND.(CPROGRAM == 'DIAG ')) XCHFLX(:,:,JSV-NSV_CHEMBEG+1) = PSFSV(:,:,JSV) + END DO +ELSE + PSFSV(:,:,NSV_CHEMBEG:NSV_CHEMEND) = 0. +END IF +! +!* conversion from dust flux (kg/m2/s) to (ppp.m.s-1) +! +IF (LDUST) THEN + DO JSV=NSV_DSTBEG,NSV_DSTEND + PSFSV(:,:,JSV) = ZSFTS(:,:,JSV) * XMD / (XMOLARWEIGHT_DUST * XRHODREF(:,:,IKB)) + END DO +ELSE + PSFSV(:,:,NSV_DSTBEG:NSV_DSTEND) = 0. +END IF +! +!* conversion from sea salt flux (kg/m2/s) to (ppp.m.s-1) +! +IF (LSALT) THEN + DO JSV=NSV_SLTBEG,NSV_SLTEND + PSFSV(:,:,JSV) = ZSFTS(:,:,JSV) * XMD / (XMOLARWEIGHT_SALT * XRHODREF(:,:,IKB)) + END DO +ELSE + PSFSV(:,:,NSV_SLTBEG:NSV_SLTEND) = 0. +END IF +! +!* conversion from aerosol flux (molec/m2/s) to (ppp.m.s-1) +! +IF (LORILAM) THEN + DO JSV=NSV_AERBEG,NSV_AEREND + PSFSV(:,:,JSV) = ZSFTS(:,:,JSV) * XMD / ( XAVOGADRO * XRHODREF(:,:,IKB)) + END DO +ELSE + PSFSV(:,:,NSV_AERBEG:NSV_AEREND) = 0. +END IF +! +!* conversion from blowing snow flux (kg/m2/s) to [kg(snow)/kg(dry air).m.s-1] +! +IF (LBLOWSNOW) THEN + DO JSV=NSV_SNWBEG,NSV_SNWEND + PSFSV(:,:,JSV) = ZSFTS(:,:,JSV)/ (ZRHOA(:,:)) + END DO + !* Update tendency for blowing snow 2D fields + DO JSV=1,(NBLOWSNOW_2D) + XRSNWCANOS(:,:,JSV) = ZBLOWSNOW_2D(:,:,JSV)*XRHODJ(:,:,IKB)/(XTSTEP*ZRHOA(:,:)) + END DO + +ELSE + PSFSV(:,:,NSV_SNWBEG:NSV_SNWEND) = 0. +END IF +! +!* conversion from CO2 flux (kg/m2/s) to w'CO2' +! +PSFCO2(:,:) = ZSFCO2(:,:) / XRHODREF(:,:,IKB) +! +! +!* Diagnostics +! ----------- +! +! +IF (LDIAG_IN_RUN) THEN + ! + XCURRENT_SFCO2(:,:) = ZSFCO2(:,:) + XCURRENT_DSTAOD(:,:)=0.0 + XCURRENT_SLTAOD(:,:)=0.0 + IF (CRAD/='NONE') THEN + XCURRENT_LWD (:,:) = XFLALWD(:,:) + XCURRENT_SWD (:,:) = SUM(XDIRSRFSWD(:,:,:)+XSCAFLASWD(:,:,:),DIM=3) + XCURRENT_LWU (:,:) = XLWU(:,:,IKB) + XCURRENT_SWU (:,:) = XSWU(:,:,IKB) + XCURRENT_SWDIR(:,:) = SUM(XDIRSRFSWD,DIM=3) + XCURRENT_SWDIFF(:,:) = SUM(XSCAFLASWD(:,:,:),DIM=3) + DO JK=IKB,IKE + IKRAD = JK - 1 + DO JJ=IJB,IJE + DO JI=IIB,IIE + XCURRENT_DSTAOD(JI,JJ)=XCURRENT_DSTAOD(JI,JJ)+XAER(JI,JJ,IKRAD,3) + XCURRENT_SLTAOD(JI,JJ)=XCURRENT_SLTAOD(JI,JJ)+XAER(JI,JJ,IKRAD,2) + ENDDO + ENDDO + ENDDO + END IF +! + NULLIFY(TZFIELDSURF_ll) + CALL ADD2DFIELD_ll( TZFIELDSURF_ll,XCURRENT_RN, 'GROUND_PARAM_n::XCURRENT_RN' ) + CALL ADD2DFIELD_ll( TZFIELDSURF_ll,XCURRENT_H, 'GROUND_PARAM_n::XCURRENT_H' ) + CALL ADD2DFIELD_ll( TZFIELDSURF_ll,XCURRENT_LE, 'GROUND_PARAM_n::XCURRENT_LE' ) + CALL ADD2DFIELD_ll( TZFIELDSURF_ll,XCURRENT_GFLUX, 'GROUND_PARAM_n::XCURRENT_GFLUX' ) + CALL ADD2DFIELD_ll( TZFIELDSURF_ll,XCURRENT_SWD, 'GROUND_PARAM_n::XCURRENT_SWD' ) + CALL ADD2DFIELD_ll( TZFIELDSURF_ll,XCURRENT_SWU, 'GROUND_PARAM_n::XCURRENT_SWU' ) + CALL ADD2DFIELD_ll( TZFIELDSURF_ll,XCURRENT_LWD, 'GROUND_PARAM_n::XCURRENT_LWD' ) + CALL ADD2DFIELD_ll( TZFIELDSURF_ll,XCURRENT_LWU, 'GROUND_PARAM_n::XCURRENT_LWU' ) + CALL ADD2DFIELD_ll( TZFIELDSURF_ll,XCURRENT_T2M, 'GROUND_PARAM_n::XCURRENT_T2M' ) + CALL ADD2DFIELD_ll( TZFIELDSURF_ll,XCURRENT_Q2M, 'GROUND_PARAM_n::XCURRENT_Q2M' ) + CALL ADD2DFIELD_ll( TZFIELDSURF_ll,XCURRENT_HU2M, 'GROUND_PARAM_n::XCURRENT_HU2M' ) + CALL ADD2DFIELD_ll( TZFIELDSURF_ll,XCURRENT_ZON10M, 'GROUND_PARAM_n::XCURRENT_ZON10M' ) + CALL ADD2DFIELD_ll( TZFIELDSURF_ll,XCURRENT_MER10M, 'GROUND_PARAM_n::XCURRENT_MER10M' ) + CALL ADD2DFIELD_ll( TZFIELDSURF_ll,XCURRENT_DSTAOD, 'GROUND_PARAM_n::XCURRENT_DSTAOD' ) + CALL ADD2DFIELD_ll( TZFIELDSURF_ll,XCURRENT_SLTAOD, 'GROUND_PARAM_n::XCURRENT_SLTAOD' ) + CALL ADD2DFIELD_ll( TZFIELDSURF_ll,XCURRENT_ZWS, 'GROUND_PARAM_n::XCURRENT_ZWS' ) + CALL ADD2DFIELD_ll( TZFIELDSURF_ll,XCURRENT_SFCO2, 'GROUND_PARAM_n::XCURRENT_SFCO2' ) + + CALL UPDATE_HALO_ll(TZFIELDSURF_ll,IINFO_ll) + CALL CLEANLIST_ll(TZFIELDSURF_ll) +END IF +! +IF (LBLAZE) THEN + IF (KTCOUNT <= 1) THEN + DEALLOCATE(ZFIREFUELMAP) + END IF + CALL CLEANLIST_ll(TZFIELDFIRE_ll) +END IF +!================================================================================== +! +CONTAINS +! +!================================================================================== +! +SUBROUTINE RESHAPE_SURF(KDIM1D) +! +INTEGER, INTENT(IN) :: KDIM1D +INTEGER, DIMENSION(1) :: ISHAPE_1 +! +ISHAPE_1 = (/KDIM1D/) +! +ALLOCATE(ZP_TSUN (KDIM1D)) +ALLOCATE(ZP_ZENITH (KDIM1D)) +ALLOCATE(ZP_AZIM (KDIM1D)) +ALLOCATE(ZP_ZREF (KDIM1D)) +ALLOCATE(ZP_ZS (KDIM1D)) +ALLOCATE(ZP_U (KDIM1D)) +ALLOCATE(ZP_V (KDIM1D)) +ALLOCATE(ZP_QA (KDIM1D)) +ALLOCATE(ZP_TA (KDIM1D)) +ALLOCATE(ZP_RHOA (KDIM1D)) +ALLOCATE(ZP_SV (KDIM1D,KSV_SURF)) +ALLOCATE(ZP_CO2 (KDIM1D)) +ALLOCATE(ZP_RAIN (KDIM1D)) +ALLOCATE(ZP_SNOW (KDIM1D)) +ALLOCATE(ZP_LW (KDIM1D)) +ALLOCATE(ZP_DIR_SW (KDIM1D,SIZE(XDIRSRFSWD,3))) +ALLOCATE(ZP_SCA_SW (KDIM1D,SIZE(XSCAFLASWD,3))) +ALLOCATE(ZP_PS (KDIM1D)) +ALLOCATE(ZP_PA (KDIM1D)) +ALLOCATE(ZP_ZWS (KDIM1D)) + +ALLOCATE(ZP_SFTQ (KDIM1D)) +ALLOCATE(ZP_SFTH (KDIM1D)) +ALLOCATE(ZP_SFU (KDIM1D)) +ALLOCATE(ZP_SFV (KDIM1D)) +ALLOCATE(ZP_SFTS (KDIM1D,KSV_SURF)) +ALLOCATE(ZP_SFCO2 (KDIM1D)) +ALLOCATE(ZP_TSRAD (KDIM1D)) +ALLOCATE(ZP_DIR_ALB (KDIM1D,SIZE(PDIR_ALB,3))) +ALLOCATE(ZP_SCA_ALB (KDIM1D,SIZE(PSCA_ALB,3))) +ALLOCATE(ZP_EMIS (KDIM1D)) +ALLOCATE(ZP_TSURF (KDIM1D)) +ALLOCATE(ZP_Z0 (KDIM1D)) +ALLOCATE(ZP_Z0H (KDIM1D)) +ALLOCATE(ZP_QSURF (KDIM1D)) +ALLOCATE(ZP_RN (KDIM1D)) +ALLOCATE(ZP_H (KDIM1D)) +ALLOCATE(ZP_LE (KDIM1D)) +ALLOCATE(ZP_LEI (KDIM1D)) +ALLOCATE(ZP_GFLUX (KDIM1D)) +ALLOCATE(ZP_T2M (KDIM1D)) +ALLOCATE(ZP_Q2M (KDIM1D)) +ALLOCATE(ZP_HU2M (KDIM1D)) +ALLOCATE(ZP_ZON10M (KDIM1D)) +ALLOCATE(ZP_MER10M (KDIM1D)) + +!* explicit coupling only +ALLOCATE(ZP_PEW_A_COEF (KDIM1D)) +ALLOCATE(ZP_PEW_B_COEF (KDIM1D)) +ALLOCATE(ZP_PET_A_COEF (KDIM1D)) +ALLOCATE(ZP_PEQ_A_COEF (KDIM1D)) +ALLOCATE(ZP_PET_B_COEF (KDIM1D)) +ALLOCATE(ZP_PEQ_B_COEF (KDIM1D)) + +ZP_TSUN(:) = RESHAPE(ZTSUN(IIB:IIE,IJB:IJE), ISHAPE_1) +ZP_TA(:) = RESHAPE(ZTA(IIB:IIE,IJB:IJE), ISHAPE_1) +ZP_QA(:) = RESHAPE(ZQA(IIB:IIE,IJB:IJE), ISHAPE_1) +ZP_RHOA(:) = RESHAPE(ZRHOA(IIB:IIE,IJB:IJE), ISHAPE_1) +ZP_U(:) = RESHAPE(ZU(IIB:IIE,IJB:IJE), ISHAPE_1) +ZP_V(:) = RESHAPE(ZV(IIB:IIE,IJB:IJE), ISHAPE_1) +ZP_PS(:) = RESHAPE(ZPS(IIB:IIE,IJB:IJE), ISHAPE_1) +ZP_PA(:) = RESHAPE(ZPA(IIB:IIE,IJB:IJE), ISHAPE_1) +ZP_ZS(:) = RESHAPE(XZS(IIB:IIE,IJB:IJE), ISHAPE_1) +ZP_CO2(:) = RESHAPE(ZCO2(IIB:IIE,IJB:IJE), ISHAPE_1) +ZP_SNOW(:) = RESHAPE(ZSNOW(IIB:IIE,IJB:IJE), ISHAPE_1) +ZP_RAIN(:) = RESHAPE(ZRAIN(IIB:IIE,IJB:IJE), ISHAPE_1) +ZP_ZREF(:) = RESHAPE(ZZREF(IIB:IIE,IJB:IJE), ISHAPE_1) +ZP_ZWS(:) = RESHAPE(XZWS(IIB:IIE,IJB:IJE), ISHAPE_1) + +DO JLAYER=1,NSV + ZP_SV(:,JLAYER) = RESHAPE(XSVT(IIB:IIE,IJB:IJE,IKB,JLAYER), ISHAPE_1) +END DO +! +IF(LBLOWSNOW) THEN + DO JLAYER=1,NBLOWSNOW_2D + ZP_SV(:,NSV+JLAYER) = RESHAPE(ZBLOWSNOW_2D(IIB:IIE,IJB:IJE,JLAYER), ISHAPE_1) + END DO +END IF +! +!chemical conversion : from part/part to molec./m3 +DO JLAYER=NSV_CHEMBEG,NSV_CHEMEND + ZP_SV(:,JLAYER) = ZP_SV(:,JLAYER) * XAVOGADRO * ZP_RHOA(:) / XMD +END DO +DO JLAYER=NSV_AERBEG,NSV_AEREND + ZP_SV(:,JLAYER) = ZP_SV(:,JLAYER) * XAVOGADRO * ZP_RHOA(:) / XMD +END DO +!dust conversion : from part/part to kg/m3 +DO JLAYER=NSV_DSTBEG,NSV_DSTEND + ZP_SV(:,JLAYER) = ZP_SV(:,JLAYER) * XMOLARWEIGHT_DUST* ZP_RHOA(:) / XMD +END DO +!sea salt conversion : from part/part to kg/m3 +DO JLAYER=NSV_SLTBEG,NSV_SLTEND + ZP_SV(:,JLAYER) = ZP_SV(:,JLAYER) * XMOLARWEIGHT_SALT* ZP_RHOA(:) / XMD +END DO +! +!blowing snow conversion : from kg(snow)/kg(dry air) to kg(snow)/m3 +DO JLAYER=NSV_SNWBEG,NSV_SNWEND + ZP_SV(:,JLAYER) = ZP_SV(:,JLAYER) * ZP_RHOA(:) +END DO + +IF(LBLOWSNOW) THEN ! Convert 2D blowing snow fields + ! from kg(snow)/kg(dry air) to kg(snow)/m3 + DO JLAYER=(NSV+1),KSV_SURF + ZP_SV(:,JLAYER) = ZP_SV(:,JLAYER) * ZP_RHOA(:) + END DO +END IF +! +ZP_ZENITH(:) = RESHAPE(XZENITH(IIB:IIE,IJB:IJE), ISHAPE_1) +ZP_AZIM (:) = RESHAPE(XAZIM (IIB:IIE,IJB:IJE), ISHAPE_1) +ZP_LW(:) = RESHAPE(XFLALWD(IIB:IIE,IJB:IJE), ISHAPE_1) +DO JLAYER=1,SIZE(XDIRSRFSWD,3) + ZP_DIR_SW(:,JLAYER) = RESHAPE(XDIRSRFSWD(IIB:IIE,IJB:IJE,JLAYER), ISHAPE_1) + ZP_SCA_SW(:,JLAYER) = RESHAPE(XSCAFLASWD(IIB:IIE,IJB:IJE,JLAYER), ISHAPE_1) +END DO +! +ZP_PEW_A_COEF = 0. +ZP_PEW_B_COEF = 0. +ZP_PET_A_COEF = 0. +ZP_PEQ_A_COEF = 0. +ZP_PET_B_COEF = 0. +ZP_PEQ_B_COEF = 0. +! +END SUBROUTINE RESHAPE_SURF +!================================================i================================= +SUBROUTINE UNSHAPE_SURF(KDIM1,KDIM2) +! +INTEGER, INTENT(IN) :: KDIM1, KDIM2 +INTEGER, DIMENSION(2) :: ISHAPE_2 +! +ISHAPE_2 = (/KDIM1,KDIM2/) +! +! Arguments in call to surface: +! +ZSFTH = XUNDEF +ZSFTQ = XUNDEF +IF (NSV>0) ZSFTS = XUNDEF +ZSFCO2 = XUNDEF +ZSFU = XUNDEF +ZSFV = XUNDEF +! +ZSFTH (IIB:IIE,IJB:IJE) = RESHAPE(ZP_SFTH(:), ISHAPE_2) +ZSFTQ (IIB:IIE,IJB:IJE) = RESHAPE(ZP_SFTQ(:), ISHAPE_2) +DO JLAYER=1,SIZE(PSFSV,3) + ZSFTS (IIB:IIE,IJB:IJE,JLAYER) = RESHAPE(ZP_SFTS(:,JLAYER), ISHAPE_2) +END DO +ZSFCO2 (IIB:IIE,IJB:IJE) = RESHAPE(ZP_SFCO2(:), ISHAPE_2) +ZSFU (IIB:IIE,IJB:IJE) = RESHAPE(ZP_SFU(:), ISHAPE_2) +ZSFV (IIB:IIE,IJB:IJE) = RESHAPE(ZP_SFV(:), ISHAPE_2) +DO JLAYER=1,SIZE(PEMIS,3) + PEMIS (IIB:IIE,IJB:IJE,JLAYER) = RESHAPE(ZP_EMIS(:), ISHAPE_2) +END DO +PTSRAD (IIB:IIE,IJB:IJE) = RESHAPE(ZP_TSRAD(:), ISHAPE_2) +IF(LBLOWSNOW) THEN + DO JLAYER=1,NBLOWSNOW_2D + ZBLOWSNOW_2D(IIB:IIE,IJB:IJE,JLAYER) = RESHAPE(ZP_SFTS(:,NSV+JLAYER), ISHAPE_2) + END DO +END IF +! +IF (LDIAG_IN_RUN) THEN + XCURRENT_RN (IIB:IIE,IJB:IJE) = RESHAPE(ZP_RN(:), ISHAPE_2) + XCURRENT_H (IIB:IIE,IJB:IJE) = RESHAPE(ZP_H (:), ISHAPE_2) + XCURRENT_LE (IIB:IIE,IJB:IJE) = RESHAPE(ZP_LE(:), ISHAPE_2) + XCURRENT_LEI (IIB:IIE,IJB:IJE) = RESHAPE(ZP_LEI(:), ISHAPE_2) + XCURRENT_GFLUX (IIB:IIE,IJB:IJE) = RESHAPE(ZP_GFLUX(:), ISHAPE_2) + XCURRENT_T2M (IIB:IIE,IJB:IJE) = RESHAPE(ZP_T2M(:), ISHAPE_2) + XCURRENT_Q2M (IIB:IIE,IJB:IJE) = RESHAPE(ZP_Q2M(:), ISHAPE_2) + XCURRENT_HU2M (IIB:IIE,IJB:IJE) = RESHAPE(ZP_HU2M(:), ISHAPE_2) + XCURRENT_ZON10M (IIB:IIE,IJB:IJE) = RESHAPE(ZP_ZON10M(:), ISHAPE_2) + XCURRENT_MER10M (IIB:IIE,IJB:IJE) = RESHAPE(ZP_MER10M(:), ISHAPE_2) + XCURRENT_ZWS (IIB:IIE,IJB:IJE) = RESHAPE(ZP_ZWS(:), ISHAPE_2) +ENDIF +! +DO JLAYER=1,SIZE(PDIR_ALB,3) + PDIR_ALB(IIB:IIE,IJB:IJE,JLAYER) = RESHAPE(ZP_DIR_ALB(:,JLAYER), ISHAPE_2) + PSCA_ALB(IIB:IIE,IJB:IJE,JLAYER) = RESHAPE(ZP_SCA_ALB(:,JLAYER), ISHAPE_2) +END DO +! +DEALLOCATE(ZP_TSUN ) +DEALLOCATE(ZP_ZENITH ) +DEALLOCATE(ZP_AZIM ) +DEALLOCATE(ZP_ZREF ) +DEALLOCATE(ZP_ZS ) +DEALLOCATE(ZP_U ) +DEALLOCATE(ZP_V ) +DEALLOCATE(ZP_QA ) +DEALLOCATE(ZP_TA ) +DEALLOCATE(ZP_RHOA ) +DEALLOCATE(ZP_SV ) +DEALLOCATE(ZP_CO2 ) +DEALLOCATE(ZP_RAIN ) +DEALLOCATE(ZP_SNOW ) +DEALLOCATE(ZP_LW ) +DEALLOCATE(ZP_DIR_SW ) +DEALLOCATE(ZP_SCA_SW ) +DEALLOCATE(ZP_PS ) +DEALLOCATE(ZP_PA ) +DEALLOCATE(ZP_ZWS ) + +DEALLOCATE(ZP_SFTQ ) +DEALLOCATE(ZP_SFTH ) +DEALLOCATE(ZP_SFTS ) +DEALLOCATE(ZP_SFCO2 ) +DEALLOCATE(ZP_SFU ) +DEALLOCATE(ZP_SFV ) +DEALLOCATE(ZP_TSRAD ) +DEALLOCATE(ZP_DIR_ALB ) +DEALLOCATE(ZP_SCA_ALB ) +DEALLOCATE(ZP_EMIS ) +DEALLOCATE(ZP_RN ) +DEALLOCATE(ZP_H ) +DEALLOCATE(ZP_LE ) +DEALLOCATE(ZP_LEI ) +DEALLOCATE(ZP_GFLUX ) +DEALLOCATE(ZP_T2M ) +DEALLOCATE(ZP_Q2M ) +DEALLOCATE(ZP_HU2M ) +DEALLOCATE(ZP_ZON10M ) +DEALLOCATE(ZP_MER10M ) + +DEALLOCATE(ZP_PEW_A_COEF ) +DEALLOCATE(ZP_PEW_B_COEF ) +DEALLOCATE(ZP_PET_A_COEF ) +DEALLOCATE(ZP_PEQ_A_COEF ) +DEALLOCATE(ZP_PET_B_COEF ) +DEALLOCATE(ZP_PEQ_B_COEF ) +! +END SUBROUTINE UNSHAPE_SURF +!================================================================================== +! +END SUBROUTINE GROUND_PARAM_n diff --git a/src/mesonh/ext/ibm_forcing.f90 b/src/mesonh/ext/ibm_forcing.f90 new file mode 100644 index 0000000000000000000000000000000000000000..aebf45609f2e854eaedb797480f641390f21738b --- /dev/null +++ b/src/mesonh/ext/ibm_forcing.f90 @@ -0,0 +1,314 @@ +!MNH_LIC Copyright 2019-2021 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_IBM_FORCING + ! ####################### + ! + INTERFACE + ! + SUBROUTINE IBM_FORCING(PRUS,PRVS,PRWS,PTHS,PRRS,PSVS,PTKS) + ! + REAL, DIMENSION(:,:,:) ,INTENT(INOUT) :: PRUS,PRVS,PRWS + REAL, DIMENSION(:,:,:) ,INTENT(INOUT) :: PTHS + REAL, DIMENSION(:,:,:,:),INTENT(INOUT), OPTIONAL :: PRRS + REAL, DIMENSION(:,:,:,:),INTENT(INOUT), OPTIONAL :: PSVS + REAL, DIMENSION(:,:,:) ,INTENT(INOUT), OPTIONAL :: PTKS + ! + END SUBROUTINE IBM_FORCING + ! + END INTERFACE + ! +END MODULE MODI_IBM_FORCING +! +! ########################################################## +SUBROUTINE IBM_FORCING(PRUS,PRVS,PRWS,PTHS,PRRS,PSVS,PTKS) + ! ########################################################## + ! + !!**** *IBM_FORCING* - routine to force all desired fields + !! + !! PURPOSE + !! ------- + ! The purpose of this routine is to compute variables in the virtual + ! embedded solid region in regard of variables computed in the real + ! fluid region + ! + !! METHOD + !! ------ + !! + !! EXTERNAL + !! -------- + !! NONE + !! + !! IMPLICIT ARGUMENTS + !! ------------------ + !! + !! REFERENCE + !! --------- + !! + !! AUTHOR + !! ------ + !! Franck Auguste * CERFACS(AE) * + !! + !! MODIFICATIONS + !! ------------- + !! Original 01/01/2019 + !! + !----------------------------------------------------------------------------- + ! + !**** 0. DECLARATIONS + ! --------------- + ! + ! module + USE MODE_POS + USE MODE_ll + USE MODE_IO + USE MODD_ARGSLIST_ll, ONLY : LIST_ll + ! + ! declaration + USE MODD_CST + USE MODD_FIELD_n + USE MODD_REF + USE MODD_REF_n, ONLY: XRHODJ,XRHODREF,XTHVREF,XEXNREF,XRVREF + USE MODD_PARAMETERS, ONLY: JPVEXT,JPHEXT + USE MODD_IBM_PARAM_n + USE MODD_LBC_n + USE MODD_CONF + USE MODD_CONF_n + USE MODD_NSV + USE MODD_TURB_n, ONLY: XTKEMIN + USE MODD_PARAM_n + USE MODD_DYN_n, ONLY: XTSTEP + ! + ! interface + USE MODI_IBM_AFFECTV + USE MODI_IBM_AFFECTP + USE MODI_SHUMAN + ! + IMPLICIT NONE + ! + !----------------------------------------------------------------------------- + ! + ! 0.1 declarations of arguments + ! + REAL, DIMENSION(:,:,:) ,INTENT(INOUT) :: PRUS,PRVS,PRWS + REAL, DIMENSION(:,:,:) ,INTENT(INOUT) :: PTHS + REAL, DIMENSION(:,:,:,:),INTENT(INOUT), OPTIONAL :: PRRS + REAL, DIMENSION(:,:,:,:),INTENT(INOUT), OPTIONAL :: PSVS + REAL, DIMENSION(:,:,:) ,INTENT(INOUT), OPTIONAL :: PTKS + ! + !----------------------------------------------------------------------------- + ! + ! 0.2 declaration of local variables + REAL, DIMENSION(:,:,:) , ALLOCATABLE :: ZTMP,ZXMU,ZDIV,ZTKE + REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZTMU,ZTRY + INTEGER :: IIU,IJU,IKU,IKB,IKE + INTEGER :: JRR,JSV + TYPE(LIST_ll), POINTER :: TZFIELDS_ll + INTEGER :: IINFO_ll + ! + !----------------------------------------------------------------------------- + ! + !**** 0. ALLOCATIONS + ! -------------- + ! + IIU = SIZE(PRUS,1) + IJU = SIZE(PRVS,2) + IKU = SIZE(PRWS,3) + ! + ALLOCATE(ZTMU(IIU,IJU,IKU,3),ZTMP(IIU,IJU,IKU),ZTRY(IIU,IJU,IKU,3), & + ZXMU(IIU,IJU,IKU),ZDIV(IIU,IJU,IKU),ZTKE(IIU,IJU,IKU)) + ! + ZTMU=0. + ZXMU=0. + ZDIV=0. + ZTMP=0. + ZTRY=0. + ! + IKB = 1 + JPVEXT + IKE = IKU - JPVEXT + ! + !----------------------------------------------------------------------------- + ! + !**** 1. PRELIMINARIES + ! ---------------- + IF (NSV>=1) THEN + ! + DO JSV=1,NSV + WHERE (XIBM_LS(:,:,:,1).GT.XIBM_EPSI) PSVS(:,:,:,JSV) = XIBM_EPSI**1.5 + ENDDO + ! + ENDIF + ! + WHERE (XIBM_LS(:,:,:,1).GT.XIBM_EPSI) PTHS(:,:,:) = XTHVREF(:,:,:) + ! + IF (NRR>=1) THEN + WHERE (XIBM_LS(:,:,:,1).GT.XIBM_EPSI) + PRRS(:,:,:,1) = XRVREF(:,:,:) + PTHS(:,:,:) = XTHVREF(:,:,:)/(1.+XRD/XRV*XRVREF(:,:,:)) + ENDWHERE + ENDIF + IF (NRR>=2) THEN + DO JRR=2,NRR + WHERE (XIBM_LS(:,:,:,1).GT.XIBM_EPSI) PRRS(:,:,:,JRR) = XIBM_EPSI + ENDDO + ENDIF + ! + WHERE (XIBM_LS(:,:,:,2).GT.XIBM_EPSI) PRUS(:,:,:) = XIBM_EPSI + WHERE (XIBM_LS(:,:,:,3).GT.XIBM_EPSI) PRVS(:,:,:) = XIBM_EPSI + WHERE (XIBM_LS(:,:,:,4).GT.XIBM_EPSI) PRWS(:,:,:) = XIBM_EPSI + IF (CTURB/='NONE') WHERE (XIBM_LS(:,:,:,1).GT.XIBM_EPSI) PTKS(:,:,:) = XTKEMIN + ! + !**** 2. EXECUTIONS + ! ------------- + ! + ! ====================== + ! === SCALAR FORCING === + ! ====================== + ! + IF (CTURB/='NONE') THEN + ZTMP(:,:,:) = PTKS(:,:,:) + ZTMP(:,:,IKB-1)=ZTMP(:,:,IKB) + ZTMP(:,:,IKE+1)=ZTMP(:,:,IKE) + ZXMU(:,:,:) = XIBM_XMUT(:,:,:) + ZDIV(:,:,:) = XIBM_CURV(:,:,:) + CALL IBM_AFFECTP(ZTMP,NIBM_LAYER_E,XIBM_RADIUS_E,XIBM_POWERS_E,& + CIBM_MODE_INTE1_E,CIBM_MODE_INTE3_E,& + CIBM_TYPE_BOUND_E,CIBM_MODE_BOUND_E,& + CIBM_FORC_BOUND_E,XIBM_FORC_BOUND_E,ZXMU,ZDIV) + ZTMP(:,:,IKB-1)=ZTMP(:,:,IKB) + ZTMP(:,:,IKE+1)=XTKEMIN + PTKS(:,:,:)=MAX(XTKEMIN,ZTMP(:,:,:)) + ENDIF + ! + ZTMP(:,:,:) = PTHS(:,:,:) + ZTMP(:,:,IKB-1)=ZTMP(:,:,IKB) + ZTMP(:,:,IKE+1)=ZTMP(:,:,IKE) + CALL IBM_AFFECTP(ZTMP,NIBM_LAYER_T,XIBM_RADIUS_T,XIBM_POWERS_T,& + CIBM_MODE_INTE1_T,CIBM_MODE_INTE3_T,& + CIBM_TYPE_BOUND_T,CIBM_MODE_BOUND_T,& + CIBM_FORC_BOUND_T,XIBM_FORC_BOUND_T,ZXMU,ZDIV) + ZTMP(:,:,:) = ZTMP(:,:,:) + ZTMP(:,:,IKB-1)=ZTMP(:,:,IKB) + ZTMP(:,:,IKE+1)=ZTMP(:,:,IKE) + PTHS(:,:,:) = MAX(ZTMP(:,:,:),250.) + ! + IF (NRR>=1) THEN + DO JRR=1,NRR + ZTMP(:,:,:) = PRRS(:,:,:,JRR) + ZTMP(:,:,IKB-1)=ZTMP(:,:,IKB) + ZTMP(:,:,IKE+1)=ZTMP(:,:,IKE) + CALL IBM_AFFECTP(ZTMP,NIBM_LAYER_R,XIBM_RADIUS_R,XIBM_POWERS_R,& + CIBM_MODE_INTE1_R,CIBM_MODE_INTE3_R,& + CIBM_TYPE_BOUND_R,CIBM_MODE_BOUND_R,& + CIBM_FORC_BOUND_R,XIBM_FORC_BOUND_R,ZXMU,ZDIV) + ZTMP(:,:,IKB-1)=ZTMP(:,:,IKB) + ZTMP(:,:,IKE+1)=ZTMP(:,:,IKE) + PRRS(:,:,:,JRR) = ZTMP(:,:,:) + ENDDO + ENDIF + ! + IF (NSV>=1) THEN + DO JSV=1,NSV + ZTMP(:,:,:) = PSVS(:,:,:,JSV) + ZTMP(:,:,IKB-1)=ZTMP(:,:,IKB) + ZTMP(:,:,IKE+1)=ZTMP(:,:,IKE) + CALL IBM_AFFECTP(ZTMP,NIBM_LAYER_S,XIBM_RADIUS_S,XIBM_POWERS_S,& + CIBM_MODE_INTE1_S,CIBM_MODE_INTE3_S,& + CIBM_TYPE_BOUND_S,CIBM_MODE_BOUND_S,& + CIBM_FORC_BOUND_S,XIBM_FORC_BOUND_S,ZXMU,ZDIV) + ZTMP(:,:,:) = MAX(XIBM_EPSI**1.5,ZTMP(:,:,:)) + ZTMP(:,:,IKB-1)=ZTMP(:,:,IKB) + ZTMP(:,:,IKE+1)=ZTMP(:,:,IKE) + PSVS(:,:,:,JSV) = ZTMP(:,:,:) + ENDDO + ENDIF + ! + !======================= + ! === VECTOR FORCING === + ! ====================== + ! + PRUS(:,:,IKB-1)=PRUS(:,:,IKB) + PRUS(:,:,IKE+1)=PRUS(:,:,IKE) + PRVS(:,:,IKB-1)=PRVS(:,:,IKB) + PRVS(:,:,IKE+1)=PRVS(:,:,IKE) + PRWS(:,:,IKB-1)=0. + PRWS(:,:,IKE+1)=0. + ! + ZTMU(:,:,:,1) = PRUS(:,:,:) + ZTMU(:,:,:,2) = PRVS(:,:,:) + ZTMU(:,:,:,3) = PRWS(:,:,:) + ! + ZTMP(:,:,:) = PRUS(:,:,:) + ZXMU(:,:,:) = MXM(XIBM_XMUT(:,:,:)) + ZDIV(:,:,:) = MXM(XIBM_CURV(:,:,:)) + CALL IBM_AFFECTV(ZTMP,ZTMU,ZTRY,'U',NIBM_LAYER_V,CIBM_MODE_INTE3_V,& + CIBM_FORC_BOUNR_V,XIBM_RADIUS_V,XIBM_POWERS_V,& + CIBM_MODE_INTE1NV,CIBM_TYPE_BOUNN_V,CIBM_MODE_BOUNN_V,CIBM_FORC_BOUNN_V ,XIBM_FORC_BOUNN_V,& + CIBM_MODE_INTE1TV,CIBM_TYPE_BOUNT_V,CIBM_MODE_BOUNT_V,CIBM_FORC_BOUNT_V ,XIBM_FORC_BOUNT_V,& + CIBM_MODE_INTE1CV,CIBM_TYPE_BOUNC_V,CIBM_MODE_BOUNC_V,CIBM_FORC_BOUNC_V ,XIBM_FORC_BOUNC_V,ZXMU,ZDIV) + PRUS(:,:,:) = ZTMP(:,:,:) + ZTMP(:,:,:) = PRVS(:,:,:) + ZXMU(:,:,:) = MYM(XIBM_XMUT(:,:,:)) + ZDIV(:,:,:) = MYM(XIBM_CURV(:,:,:)) + CALL IBM_AFFECTV(ZTMP,ZTMU,ZTRY,'V',NIBM_LAYER_V,CIBM_MODE_INTE3_V,& + CIBM_FORC_BOUNR_V,XIBM_RADIUS_V,XIBM_POWERS_V,& + CIBM_MODE_INTE1NV,CIBM_TYPE_BOUNN_V,CIBM_MODE_BOUNN_V,CIBM_FORC_BOUNN_V ,XIBM_FORC_BOUNN_V,& + CIBM_MODE_INTE1TV,CIBM_TYPE_BOUNT_V,CIBM_MODE_BOUNT_V,CIBM_FORC_BOUNT_V ,XIBM_FORC_BOUNT_V,& + CIBM_MODE_INTE1CV,CIBM_TYPE_BOUNC_V,CIBM_MODE_BOUNC_V,CIBM_FORC_BOUNC_V ,XIBM_FORC_BOUNC_V,ZXMU,ZDIV) + PRVS(:,:,:) = ZTMP(:,:,:) + ZTMP(:,:,:) = PRWS(:,:,:) + ZXMU(:,:,:) = MZM(XIBM_XMUT(:,:,:)) + ZDIV(:,:,:) = MZM(XIBM_CURV(:,:,:)) + CALL IBM_AFFECTV(ZTMP,ZTMU,ZTRY,'W',NIBM_LAYER_V,CIBM_MODE_INTE3_V,& + CIBM_FORC_BOUNR_V,XIBM_RADIUS_V,XIBM_POWERS_V,& + CIBM_MODE_INTE1NV,CIBM_TYPE_BOUNN_V,CIBM_MODE_BOUNN_V,CIBM_FORC_BOUNN_V ,XIBM_FORC_BOUNN_V,& + CIBM_MODE_INTE1TV,CIBM_TYPE_BOUNT_V,CIBM_MODE_BOUNT_V,CIBM_FORC_BOUNT_V ,XIBM_FORC_BOUNT_V,& + CIBM_MODE_INTE1CV,CIBM_TYPE_BOUNC_V,CIBM_MODE_BOUNC_V,CIBM_FORC_BOUNC_V ,XIBM_FORC_BOUNC_V,ZXMU,ZDIV) + PRWS(:,:,:) = ZTMP(:,:,:) + PRUS(:,:,IKB-1)=PRUS(:,:,IKB) + PRUS(:,:,IKE+1)=PRUS(:,:,IKE) + PRVS(:,:,IKB-1)=PRVS(:,:,IKB) + PRVS(:,:,IKE+1)=PRVS(:,:,IKE) + PRWS(:,:,IKB-1)=0. + PRWS(:,:,IKB) =0. + PRWS(:,:,IKE+1)=0. + ! + !**** 3. COMMUNICATIONS + ! ----------------- + ! + IF (.NOT. LIBM_TROUBLE) THEN + ! + NULLIFY(TZFIELDS_ll) + CALL ADD3DFIELD_ll(TZFIELDS_ll,PTHS(:,:,:),'IBM_FORCING::PTHS') + IF (CTURB/='NONE') CALL ADD3DFIELD_ll(TZFIELDS_ll,PTKS(:,:,:),'IBM_FORCING::PTKS') + CALL ADD3DFIELD_ll(TZFIELDS_ll,PRUS(:,:,:),'IBM_FORCING::PRUS') + CALL ADD3DFIELD_ll(TZFIELDS_ll,PRVS(:,:,:),'IBM_FORCING::PRVS') + CALL ADD3DFIELD_ll(TZFIELDS_ll,PRWS(:,:,:),'IBM_FORCING::PRWS') + IF (NRR>=1) THEN + DO JRR=1,NRR + CALL ADD3DFIELD_ll(TZFIELDS_ll,PRRS(:,:,:,JRR),'IBM_FORCING::PRRS') + ENDDO + ENDIF + IF (NSV>=1) THEN + DO JSV=1,NSV + CALL ADD3DFIELD_ll(TZFIELDS_ll,PSVS(:,:,:,JSV),'IBM_FORCING::PSVS') + ENDDO + ENDIF + ! + CALL UPDATE_HALO_ll(TZFIELDS_ll,IINFO_ll) + CALL CLEANLIST_ll(TZFIELDS_ll) + ! + ENDIF + ! + !**** 4. DEALLOCATIONS + ! ---------------- + ! + DEALLOCATE(ZTMP,ZTMU,ZTRY,ZXMU,ZDIV,ZTKE) + ! + RETURN + ! +END SUBROUTINE IBM_FORCING diff --git a/src/mesonh/ext/ibm_forcing_tr.f90 b/src/mesonh/ext/ibm_forcing_tr.f90 new file mode 100644 index 0000000000000000000000000000000000000000..c14ac2aa61fadced5c1759f7043002c727492670 --- /dev/null +++ b/src/mesonh/ext/ibm_forcing_tr.f90 @@ -0,0 +1,410 @@ +!MNH_LIC Copyright 2019-2021 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_IBM_FORCING_TR + ! ########################## + ! + INTERFACE + ! + SUBROUTINE IBM_FORCING_TR(PRUS,PRVS,PRWS,PTHS,PRRS,PSVS,PTKS) + ! + REAL, DIMENSION(:,:,:) ,INTENT(INOUT) :: PRUS,PRVS,PRWS + REAL, DIMENSION(:,:,:) ,INTENT(INOUT) :: PTHS + REAL, DIMENSION(:,:,:,:) ,INTENT(INOUT),OPTIONAL :: PRRS + REAL, DIMENSION(:,:,:,:) ,INTENT(INOUT),OPTIONAL :: PSVS + REAL, DIMENSION(:,:,:) ,INTENT(INOUT),OPTIONAL :: PTKS + ! + END SUBROUTINE IBM_FORCING_TR + ! + END INTERFACE + ! +END MODULE MODI_IBM_FORCING_TR +! +! +! ############################################################# +SUBROUTINE IBM_FORCING_TR(PRUS,PRVS,PRWS,PTHS,PRRS,PSVS,PTKS) + ! ############################################################# + ! + !!**** *IBM_FORCING_TR* - routine to force all desired fields + !! + !! PURPOSE + !! ------- + ! The purpose of this routine is to compute variables in the virtual + ! embedded solid region in regard of variables computed in the real + ! fluid region + ! + !! METHOD + !! ------ + !! + !! EXTERNAL + !! -------- + !! NONE + !! + !! IMPLICIT ARGUMENTS + !! ------------------ + !! + !! REFERENCE + !! --------- + !! + !! AUTHOR + !! ------ + !! Franck Auguste * CERFACS(AE) * + !! + !! MODIFICATIONS + !! ------------- + !! Original 01/01/2019 + !! + !------------------------------------------------------------------------------ + ! + !**** 0. DECLARATIONS + ! --------------- + ! + ! module + USE MODE_POS + USE MODE_ll + USE MODE_IO + USE MODD_ARGSLIST_ll, ONLY: LIST_ll + ! + ! declaration + USE MODD_CST, ONLY: XRD,XRV + USE MODD_REF_n, ONLY: XRHODJ,XRHODREF,XTHVREF,XRVREF + USE MODD_PARAMETERS, ONLY: JPVEXT,JPHEXT + USE MODD_IBM_PARAM_n + USE MODD_LBC_n + USE MODD_CONF + USE MODD_CONF_n + USE MODD_NSV + USE MODD_TURB_n, ONLY: XTKEMIN + USE MODD_PARAM_n + ! + ! interface + ! + IMPLICIT NONE + ! + !----------------------------------------------------------------------------- + ! + ! 0.1 declarations of arguments + ! + REAL, DIMENSION(:,:,:) ,INTENT(INOUT) :: PRUS,PRVS,PRWS + REAL, DIMENSION(:,:,:) ,INTENT(INOUT) :: PTHS + REAL, DIMENSION(:,:,:,:),INTENT(INOUT),OPTIONAL :: PRRS + REAL, DIMENSION(:,:,:,:),INTENT(INOUT),OPTIONAL :: PSVS + REAL, DIMENSION(:,:,:) ,INTENT(INOUT),OPTIONAL :: PTKS + ! + !----------------------------------------------------------------------------- + ! + ! 0.2 declaration of local variables + INTEGER :: JI,JJ,JK,JI2,JJ2,JK2,IIU,IJU,IKU,JL + INTEGER :: JIM1,JJM1,JKM1,JIP1,JJP1,JKP1 + INTEGER :: IIE,IIB,IJE,IJB,IKB,IKE + REAL :: ZSUM1,ZSUM2,ZSUM4 + REAL, DIMENSION(:), ALLOCATABLE :: ZSUM3,ZSUM5 + TYPE(LIST_ll), POINTER :: TZFIELDS_ll + INTEGER :: IINFO_ll + ! + !----------------------------------------------------------------------------- + ! + !**** 0. ALLOCATIONS + ! -------------- + CALL GET_INDICE_ll(IIB,IJB,IIE,IJE) + IIU = SIZE(PRUS,1) + IJU = SIZE(PRUS,2) + IKU = SIZE(PRUS,3) + IKB = 1 + JPVEXT + IKE = SIZE(PRUS,3) - JPVEXT + ! + !----------------------------------------------------------------------------- + ! + ! Problems in GCT ? => imposition of the adjacent value + DO JI=IIB,IIE + DO JJ=IJB,IJE + DO JK=IKB,IKE + ! + IF (XIBM_SUTR(JI,JJ,JK,1).LT.0.5) THEN + ! + JIM1 = JI-1 + JJM1 = JJ-1 + JKM1 = JK-1 + JIP1 = JI+1 + JJP1 = JJ+1 + JKP1 = JK+1 + ZSUM1 = 0. + ZSUM2 = 0. + IF (NSV>=1) ALLOCATE(ZSUM3(NSV)) + ZSUM3 = 0. + ZSUM4 = 0. + IF (NRR>=1) ALLOCATE(ZSUM5(NRR)) + ZSUM5 = 0. + ! + DO JI2=JIM1,JIP1 + DO JJ2=JJM1,JJP1 + DO JK2=JKM1,JKP1 + ! + ZSUM1 = ZSUM1 + (XIBM_SUTR(JI2,JJ2,JK2,1)) + ZSUM2 = ZSUM2 + (XIBM_SUTR(JI2,JJ2,JK2,1))*PTHS(JI2,JJ2,JK2) + IF (NRR>=1) THEN + DO JL = 1,NRR + ZSUM5(JL) = ZSUM5(JL) + (XIBM_SUTR(JI2,JJ2,JK2,1))*PRRS(JI2,JJ2,JK2,JL) + ENDDO + ENDIF + IF (NSV>=1) THEN + DO JL = 1,NSV + ZSUM3(JL) = ZSUM3(JL) + (XIBM_SUTR(JI2,JJ2,JK2,1))*PSVS(JI2,JJ2,JK2,JL) + ENDDO + ENDIF + IF (CTURB/='NONE') ZSUM4 = ZSUM4 + (XIBM_SUTR(JI2,JJ2,JK2,1))*PTKS(JI2,JJ2,JK2) + ! + ENDDO + ENDDO + ENDDO + ! + PTHS(JI,JJ,JK) = XTHVREF(JI,JJ,JK) + IF (NRR>=1) PTHS(JI,JJ,JK) = XTHVREF(JI,JJ,JK)/(1.+XRD/XRV*XRVREF(JI,JJ,JK)) + IF (ZSUM1.GT.XIBM_EPSI) PTHS(JI,JJ,JK) = ZSUM2/ZSUM1 + IF (NRR>=1) THEN + PRRS(JI,JJ,JK,1) = XRVREF(JI,JJ,JK) + IF (ZSUM1.GT.XIBM_EPSI) PRRS(JI,JJ,JK,1) = ZSUM5(1)/ZSUM1 + IF (NRR>=2) THEN + DO JL = 2,NRR + PRRS(JI,JJ,JK,JL) = 0. + IF (ZSUM1.GT.XIBM_EPSI) PRRS(JI,JJ,JK,JL) = ZSUM5(JL)/ZSUM1 + ENDDO + ENDIF + ENDIF + ! + IF (NSV>=1) THEN + DO JL = 1,NSV + PSVS(JI,JJ,JK,JL) = 0. + IF (ZSUM1.GT.XIBM_EPSI) PSVS(JI,JJ,JK,JL) = ZSUM3(JL)/ZSUM1 + ENDDO + ENDIF + ! + IF (CTURB/='NONE') PTKS(JI,JJ,JK) = XTKEMIN + IF (ZSUM1.GT.XIBM_EPSI.AND.(CTURB/='NONE')) PTKS(JI,JJ,JK) = ZSUM4/ZSUM1 + IF (NSV>=1) DEALLOCATE(ZSUM3) + IF (NRR>=1) DEALLOCATE(ZSUM5) + ! + ENDIF + ! + IF (XIBM_SUTR(JI,JJ,JK,2).LT.0.5) THEN + ! + JIM1 = JI-1 + JJM1 = JJ-1 + JKM1 = JK-1 + JIP1 = JI+1 + JJP1 = JJ+1 + JKP1 = JK+1 + ZSUM1 = 0. + ZSUM2 = 0. + ! + DO JI2=JIM1,JIP1 + DO JJ2=JJM1,JJP1 + DO JK2=JKM1,JKP1 + ZSUM1 = ZSUM1 + (XIBM_SUTR(JI2,JJ2,JK2,2)) + ZSUM2 = ZSUM2 + (XIBM_SUTR(JI2,JJ2,JK2,2))*PRUS(JI2,JJ2,JK2) + ENDDO + ENDDO + ENDDO + ! + PRUS(JI,JJ,JK) = 0. + IF (ZSUM1.GT.XIBM_EPSI) PRUS(JI,JJ,JK) = ZSUM2/ZSUM1 + ! + ENDIF + ! + IF (XIBM_SUTR(JI,JJ,JK,3).LT.0.5) THEN + ! + JIM1 = JI-1 + JJM1 = JJ-1 + JKM1 = JK-1 + JIP1 = JI+1 + JJP1 = JJ+1 + JKP1 = JK+1 + ZSUM1 = 0. + ZSUM2 = 0. + ! + DO JI2=JIM1,JIP1 + DO JJ2=JJM1,JJP1 + DO JK2=JKM1,JKP1 + ZSUM1 = ZSUM1 + (XIBM_SUTR(JI2,JJ2,JK2,3)) + ZSUM2 = ZSUM2 + (XIBM_SUTR(JI2,JJ2,JK2,3))*PRVS(JI2,JJ2,JK2) + ENDDO + ENDDO + ENDDO + ! + PRVS(JI,JJ,JK) = 0. + IF (ZSUM1.GT.XIBM_EPSI) PRVS(JI,JJ,JK) = ZSUM2/ZSUM1 + ! + ENDIF + ! + IF (XIBM_SUTR(JI,JJ,JK,4).LT.0.5) THEN + ! + JIM1 = JI-1 + JJM1 = JJ-1 + JKM1 = JK-1 + JIP1 = JI+1 + JJP1 = JJ+1 + JKP1 = JK+1 + ZSUM1 = 0. + ZSUM2 = 0. + ! + DO JI2=JIM1,JIP1 + DO JJ2=JJM1,JJP1 + DO JK2=JKM1,JKP1 + ZSUM1 = ZSUM1 + (XIBM_SUTR(JI2,JJ2,JK2,4)) + ZSUM2 = ZSUM2 + (XIBM_SUTR(JI2,JJ2,JK2,4))*PRWS(JI2,JJ2,JK2) + ENDDO + ENDDO + ENDDO + ! + PRWS(JI,JJ,JK) = 0. + IF (ZSUM1.GT.XIBM_EPSI) PRWS(JI,JJ,JK) = ZSUM2/ZSUM1 + ! + ENDIF + ENDDO + ENDDO + ENDDO + ! + PTHS(:,:,IKB-1)=PTHS(:,:,IKB) + PTHS(:,:,IKE+1)=PTHS(:,:,IKE) + IF (CTURB/='NONE') PTKS(:,:,IKB-1)=PTKS(:,:,IKB) + IF (CTURB/='NONE') PTKS(:,:,IKE+1)=PTKS(:,:,IKE) + IF (NSV>=1) PSVS(:,:,IKB-1,:)=PSVS(:,:,IKB,:) + IF (NSV>=1) PSVS(:,:,IKE+1,:)=PSVS(:,:,IKE,:) + IF (NRR>=1) PRRS(:,:,IKB-1,:)=PRRS(:,:,IKB,:) + IF (NRR>=1) PRRS(:,:,IKE+1,:)=PRRS(:,:,IKE,:) + PRUS(:,:,IKB-1)=PRUS(:,:,IKB) + PRUS(:,:,IKE+1)=PRUS(:,:,IKE) + PRVS(:,:,IKB-1)=PRVS(:,:,IKB) + PRVS(:,:,IKE+1)=PRVS(:,:,IKE) + PRWS(:,:,IKB-1)=0. + PRWS(:,:,IKB) =0. + PRWS(:,:,IKE+1)=0. + ! + NULLIFY(TZFIELDS_ll) + CALL ADD3DFIELD_ll(TZFIELDS_ll,PTHS(:,:,:),'IBM_FORCING_TR::PTHS') + IF (CTURB/='NONE') CALL ADD3DFIELD_ll(TZFIELDS_ll,PTKS(:,:,:),'IBM_FORCING_TR::PTKS') + CALL ADD3DFIELD_ll(TZFIELDS_ll,PRUS(:,:,:),'IBM_FORCING_TR::PRUS') + CALL ADD3DFIELD_ll(TZFIELDS_ll,PRVS(:,:,:),'IBM_FORCING_TR::PRVS') + CALL ADD3DFIELD_ll(TZFIELDS_ll,PRWS(:,:,:),'IBM_FORCING_TR::PRWS') + IF (NSV>=1) THEN + DO JL=1,NSV + CALL ADD3DFIELD_ll(TZFIELDS_ll,PSVS(:,:,:,JL),'IBM_FORCING_TR::PSVS') + ENDDO + ENDIF + IF (NRR>=1) THEN + DO JL=1,NRR + CALL ADD3DFIELD_ll(TZFIELDS_ll,PRRS(:,:,:,JL),'IBM_FORCING_TR::PRRS') + ENDDO + ENDIF + CALL UPDATE_HALO_ll(TZFIELDS_ll,IINFO_ll) + CALL CLEANLIST_ll(TZFIELDS_ll) + ! + ! Problems on corners ? => imposition of the adjacent value + ! + DO JI=IIB,IIE + DO JJ=IJB,IJE + DO JK=IKB,IKE + ! + IF (XIBM_LS(JI,JJ,JK,2).GT.XIBM_EPSI) THEN + ! + ZSUM1 = (XIBM_CURV(JI,JJ,JK)+XIBM_CURV(JI-1,JJ,JK))/2. + ZSUM1 = ABS(ZSUM1) + ZSUM1 = MIN(1.,ZSUM1) + ! + JIM1 = JI-1 + JJM1 = JJ-1 + JKM1 = JK-1 + JIP1 = JI+1 + JJP1 = JJ+1 + JKP1 = JK+1 + ZSUM2 = 0. + ! + DO JI2=JIM1,JIP1 + DO JJ2=JJM1,JJP1 + DO JK2=JKM1,JKP1 + ZSUM2 = ZSUM2 + PRUS(JI2,JJ2,JK2) + ENDDO + ENDDO + ENDDO + ! + PRUS(JI,JJ,JK) = (1.-ZSUM1)*PRUS(JI,JJ,JK)+ZSUM1*ZSUM2/27. + ! + ENDIF + ! + IF (XIBM_LS(JI,JJ,JK,3).GT.XIBM_EPSI) THEN + ! + ZSUM1 = (XIBM_CURV(JI,JJ,JK)+XIBM_CURV(JI,JJ-1,JK))/2. + ZSUM1 = ABS(ZSUM1) + ZSUM1 = MIN(1.,ZSUM1) + ! + JIM1 = JI-1 + JJM1 = JJ-1 + JKM1 = JK-1 + JIP1 = JI+1 + JJP1 = JJ+1 + JKP1 = JK+1 + ZSUM2 = 0. + ! + DO JI2=JIM1,JIP1 + DO JJ2=JJM1,JJP1 + DO JK2=JKM1,JKP1 + ZSUM2 = ZSUM2 + PRVS(JI2,JJ2,JK2) + ENDDO + ENDDO + ENDDO + ! + PRVS(JI,JJ,JK) = (1.-ZSUM1)*PRVS(JI,JJ,JK)+ZSUM1*ZSUM2/27. + ! + ENDIF + ! + IF (XIBM_LS(JI,JJ,JK,4).GT.XIBM_EPSI) THEN + ! + ZSUM1 = (XIBM_CURV(JI,JJ,JK)+XIBM_CURV(JI,JJ,JK-1))/2. + ZSUM1 = ABS(ZSUM1) + ZSUM1 = MIN(1.,ZSUM1) + ! + JIM1 = JI-1 + JJM1 = JJ-1 + JKM1 = JK-1 + JIP1 = JI+1 + JJP1 = JJ+1 + JKP1 = JK+1 + ZSUM2 = 0. + ! + DO JI2=JIM1,JIP1 + DO JJ2=JJM1,JJP1 + DO JK2=JKM1,JKP1 + ZSUM2 = ZSUM2 + PRWS(JI2,JJ2,JK2) + ENDDO + ENDDO + ENDDO + ! + PRWS(JI,JJ,JK) = (1.-ZSUM1)*PRWS(JI,JJ,JK)+ZSUM1*ZSUM2/27. + ! + ENDIF + ENDDO + ENDDO + ENDDO + ! + PRUS(:,:,IKB-1)=PRUS(:,:,IKB) + PRUS(:,:,IKE+1)=PRUS(:,:,IKE) + PRVS(:,:,IKB-1)=PRVS(:,:,IKB) + PRVS(:,:,IKE+1)=PRVS(:,:,IKE) + PRWS(:,:,IKB-1)=0. + PRWS(:,:,IKB) =0. + PRWS(:,:,IKE+1)=0. + ! + NULLIFY(TZFIELDS_ll) + CALL ADD3DFIELD_ll(TZFIELDS_ll,PRUS(:,:,:),'IBM_FORCING_TR::PRUS') + CALL ADD3DFIELD_ll(TZFIELDS_ll,PRVS(:,:,:),'IBM_FORCING_TR::PRVS') + CALL ADD3DFIELD_ll(TZFIELDS_ll,PRWS(:,:,:),'IBM_FORCING_TR::PRWS') + CALL UPDATE_HALO_ll(TZFIELDS_ll,IINFO_ll) + CALL CLEANLIST_ll(TZFIELDS_ll) + ! + RETURN + ! +END SUBROUTINE IBM_FORCING_TR diff --git a/src/mesonh/ext/ice4_sedimentation_split_momentum.f90 b/src/mesonh/ext/ice4_sedimentation_split_momentum.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/mesonh/ext/ice_adjust_bis.f90 b/src/mesonh/ext/ice_adjust_bis.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e530d5c21f91b7e143b2d7240f669e4df7c181bd --- /dev/null +++ b/src/mesonh/ext/ice_adjust_bis.f90 @@ -0,0 +1,160 @@ +!MNH_LIC Copyright 2012-2019 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. +!----------------------------------------------------------------- +! ######spl + MODULE MODI_ICE_ADJUST_BIS +! ############################### +! +INTERFACE +! +! ################################################################# + SUBROUTINE ICE_ADJUST_BIS(PP,PTH,PR) +! ################################################################# +! +!! +!* 1.1 Declaration of Arguments +!! + +REAL, DIMENSION(:,:,:), INTENT(IN) :: PP ! Pressure +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PTH ! thetal to transform into th +REAL, DIMENSION(:,:,:,:),INTENT(INOUT) :: PR ! Total mixing ratios to transform into rv,rc and ri +! +END SUBROUTINE ICE_ADJUST_BIS + +END INTERFACE +! +END MODULE MODI_ICE_ADJUST_BIS +! ######spl + SUBROUTINE ICE_ADJUST_BIS(PP,PTH,PR) +! ################################################################# +! +! +!!**** *ICE_ADJUST_BIS* - computes an adjusted state of thermodynamical variables +!! +!! PURPOSE +!! ------- +!! +!!** METHOD +!! ------ +!! +!! +!! EXTERNAL +!! -------- +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! Valery Masson & C. Lac * Meteo-France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 09/2012 +!! M.Moge 08/2015 UPDATE_HALO_ll on PTH, ZRV, ZRC, ZRI +! P. Wautelet 20/05/2019: add name argument to ADDnFIELD_ll + new ADD4DFIELD_ll subroutine +!! +!! -------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_CST, ONLY : XCPD, XRD, XP00, CST +USE MODD_NEB_n, ONLY : NEBN +! +USE MODI_COMPUTE_FUNCTION_THERMO +USE MODI_THLRT_FROM_THRVRCRI +! +USE MODE_ll +! +IMPLICIT NONE +! +! +!* 0.1 declarations of arguments +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PP ! Pressure +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PTH ! thetal to transform into th +REAL, DIMENSION(:,:,:,:),INTENT(INOUT) :: PR ! Total mixing ratios to transform into rv,rc and ri +! +!------------------------------------------------------------------------------- +! +! 0.2 declaration of local variables +REAL, DIMENSION(SIZE(PTH,1),SIZE(PTH,2),SIZE(PTH,3)) :: ZTHL, ZRW, ZRV, ZRC, & + ZRI, ZWORK +REAL, DIMENSION(SIZE(PTH,1),SIZE(PTH,2),SIZE(PTH,3)) :: ZFRAC_ICE, ZRSATW, ZRSATI +REAL, DIMENSION(SIZE(PTH,1),SIZE(PTH,2),SIZE(PTH,3)) :: ZT, ZEXN, ZLVOCPEXN,ZLSOCPEXN +REAL, DIMENSION(SIZE(PTH,1),SIZE(PTH,2),SIZE(PTH,3), 16) :: ZBUF +INTEGER :: IRR +CHARACTER(LEN=1) :: YFRAC_ICE +! +INTEGER :: IINFO_ll +TYPE(LIST_ll), POINTER :: TZFIELDS_ll=>NULL() ! list of fields to exchange +!---------------------------------------------------------------------------- +! +!* 1 Initialisation +! -------------- +! +IRR = SIZE(PR,4) +! +ZRV(:,:,:)=0. +IF (IRR>=1) & +ZRV(:,:,:)=PR(:,:,:,1) +ZRC(:,:,:)=0. +IF (IRR>=2) & +ZRC(:,:,:)=PR(:,:,:,2) +ZRI(:,:,:)=0. +IF (IRR>=4) & +ZRI(:,:,:)=PR(:,:,:,4) +! +YFRAC_ICE='T' +ZFRAC_ICE(:,:,:) = 0. +! +!* 2 Computation +! ----------- +! +ZEXN(:,:,:)=(PP(:,:,:)/XP00)**(XRD/XCPD) +! +CALL COMPUTE_FUNCTION_THERMO( IRR, & + PTH, PR, ZEXN, PP, & + ZT,ZLVOCPEXN,ZLSOCPEXN ) + +! +CALL THLRT_FROM_THRVRCRI( IRR, PTH, PR, ZLVOCPEXN, ZLSOCPEXN,& + ZTHL, ZRW ) +! +CALL TH_R_FROM_THL_RT(CST, NEBN, SIZE(ZFRAC_ICE), YFRAC_ICE,ZFRAC_ICE(:,:,:),PP(:,:,:), & + ZTHL(:,:,:), ZRW(:,:,:), PTH(:,:,:), & + ZRV(:,:,:), ZRC(:,:,:), ZRI(:,:,:), & + ZRSATW(:,:,:), ZRSATI(:,:,:),OOCEAN=.FALSE.,& + PBUF=ZBUF) +CALL ADD3DFIELD_ll( TZFIELDS_ll, PTH, 'ICE_ADJUST_BIS::PTH') +IF (IRR>=1) THEN + CALL ADD3DFIELD_ll( TZFIELDS_ll, ZRV, 'ICE_ADJUST_BIS::ZRV' ) +ENDIF +IF (IRR>=2) THEN + CALL ADD3DFIELD_ll( TZFIELDS_ll, ZRC, 'ICE_ADJUST_BIS::ZRC' ) +ENDIF +IF (IRR>=4) THEN + CALL ADD3DFIELD_ll( TZFIELDS_ll, ZRI, 'ICE_ADJUST_BIS::ZRI' ) +ENDIF +CALL UPDATE_HALO_ll(TZFIELDS_ll,IINFO_ll) +CALL CLEANLIST_ll(TZFIELDS_ll) +! + +IF (IRR>=1) & +PR(:,:,:,1) = ZRV(:,:,:) +IF (IRR>=2) & +PR(:,:,:,2) = ZRC(:,:,:) +IF (IRR>=4) & +PR(:,:,:,4) = ZRI(:,:,:) +! +CONTAINS +INCLUDE "th_r_from_thl_rt.func.h" +INCLUDE "compute_frac_ice.func.h" +END SUBROUTINE ICE_ADJUST_BIS diff --git a/src/mesonh/ext/ini_budget.f90 b/src/mesonh/ext/ini_budget.f90 new file mode 100644 index 0000000000000000000000000000000000000000..2509f667d5d3eb10d2fa7c5e8cb198c20f9e440f --- /dev/null +++ b/src/mesonh/ext/ini_budget.f90 @@ -0,0 +1,4874 @@ +!MNH_LIC Copyright 1995-2021 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. +!----------------------------------------------------------------- +! Modifications: +! P. Wautelet 17/08/2020: add Budget_preallocate subroutine +!----------------------------------------------------------------- +module mode_ini_budget + + use mode_msg + + implicit none + + private + + public :: Budget_preallocate, Ini_budget + + integer, parameter :: NSOURCESMAX = 60 !Maximum number of sources in a budget + +contains + +subroutine Budget_preallocate() + +use modd_budget, only: nbudgets, tbudgets, & + NBUDGET_U, NBUDGET_V, NBUDGET_W, NBUDGET_TH, NBUDGET_TKE, & + NBUDGET_RV, NBUDGET_RC, NBUDGET_RR, NBUDGET_RI, NBUDGET_RS, & + NBUDGET_RG, NBUDGET_RH, NBUDGET_SV1 +use modd_nsv, only: csvnames, nsv + +integer :: ibudget +integer :: jsv + +call Print_msg( NVERB_DEBUG, 'BUD', 'Budget_preallocate', 'called' ) + +if ( allocated( tbudgets ) ) then + call Print_msg( NVERB_WARNING, 'BUD', 'Budget_preallocate', 'tbudgets already allocated' ) + return +end if + +nbudgets = NBUDGET_SV1 - 1 + nsv +allocate( tbudgets( nbudgets ) ) + +tbudgets(NBUDGET_U)%cname = "UU" +tbudgets(NBUDGET_U)%ccomment = "Budget for U" +tbudgets(NBUDGET_U)%nid = NBUDGET_U + +tbudgets(NBUDGET_V)%cname = "VV" +tbudgets(NBUDGET_V)%ccomment = "Budget for V" +tbudgets(NBUDGET_V)%nid = NBUDGET_V + +tbudgets(NBUDGET_W)%cname = "WW" +tbudgets(NBUDGET_W)%ccomment = "Budget for W" +tbudgets(NBUDGET_W)%nid = NBUDGET_W + +tbudgets(NBUDGET_TH)%cname = "TH" +tbudgets(NBUDGET_TH)%ccomment = "Budget for potential temperature" +tbudgets(NBUDGET_TH)%nid = NBUDGET_TH + +tbudgets(NBUDGET_TKE)%cname = "TK" +tbudgets(NBUDGET_TKE)%ccomment = "Budget for turbulent kinetic energy" +tbudgets(NBUDGET_TKE)%nid = NBUDGET_TKE + +tbudgets(NBUDGET_RV)%cname = "RV" +tbudgets(NBUDGET_RV)%ccomment = "Budget for water vapor mixing ratio" +tbudgets(NBUDGET_RV)%nid = NBUDGET_RV + +tbudgets(NBUDGET_RC)%cname = "RC" +tbudgets(NBUDGET_RC)%ccomment = "Budget for cloud water mixing ratio" +tbudgets(NBUDGET_RC)%nid = NBUDGET_RC + +tbudgets(NBUDGET_RR)%cname = "RR" +tbudgets(NBUDGET_RR)%ccomment = "Budget for rain water mixing ratio" +tbudgets(NBUDGET_RR)%nid = NBUDGET_RR + +tbudgets(NBUDGET_RI)%cname = "RI" +tbudgets(NBUDGET_RI)%ccomment = "Budget for cloud ice mixing ratio" +tbudgets(NBUDGET_RI)%nid = NBUDGET_RI + +tbudgets(NBUDGET_RS)%cname = "RS" +tbudgets(NBUDGET_RS)%ccomment = "Budget for snow/aggregate mixing ratio" +tbudgets(NBUDGET_RS)%nid = NBUDGET_RS + +tbudgets(NBUDGET_RG)%cname = "RG" +tbudgets(NBUDGET_RG)%ccomment = "Budget for graupel mixing ratio" +tbudgets(NBUDGET_RG)%nid = NBUDGET_RG + +tbudgets(NBUDGET_RH)%cname = "RH" +tbudgets(NBUDGET_RH)%ccomment = "Budget for hail mixing ratio" +tbudgets(NBUDGET_RH)%nid = NBUDGET_RH + +do jsv = 1, nsv + ibudget = NBUDGET_SV1 - 1 + jsv + tbudgets(ibudget)%cname = Trim( csvnames(jsv) ) + tbudgets(ibudget)%ccomment = 'Budget for scalar variable ' // Trim( csvnames(jsv) ) + tbudgets(ibudget)%nid = ibudget +end do + + +end subroutine Budget_preallocate + + +! ################################################################# + SUBROUTINE Ini_budget(KLUOUT,PTSTEP,KSV,KRR, & + ONUMDIFU,ONUMDIFTH,ONUMDIFSV, & + OHORELAX_UVWTH,OHORELAX_RV,OHORELAX_RC,OHORELAX_RR, & + OHORELAX_RI,OHORELAX_RS, OHORELAX_RG, OHORELAX_RH,OHORELAX_TKE, & + OHORELAX_SV, OVE_RELAX, ove_relax_grd, OCHTRANS, & + ONUDGING,ODRAGTREE,ODEPOTREE, OAERO_EOL, & + HRAD,HDCONV,HSCONV,HTURB,HTURBDIM,HCLOUD ) +! ################################################################# +! +!!**** *INI_BUDGET* - routine to initialize the parameters for the budgets +!! +!! PURPOSE +!! ------- +! The purpose of this routine is to set or compute the parameters used +! by the MESONH budgets. Names of files for budget recording are processed +! and storage arrays are initialized. +! +!!** METHOD +!! ------ +!! The essential of information is passed by modules. The choice of budgets +!! and processes set by the user as integers is converted in "actions" +!! readable by the subroutine BUDGET under the form of string characters. +!! For each complete process composed of several elementary processes, names +!! of elementary processes are concatenated in order to have an explicit name +!! in the comment of the recording file for budget. +!! +!! +!! EXTERNAL +!! -------- +!! None +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Modules MODD_* +!! +!! REFERENCE +!! --------- +!! Book2 of documentation (routine INI_BUDGET) +!! +!! +!! AUTHOR +!! ------ +!! P. Hereil * Meteo France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 01/03/95 +!! J. Stein 25/06/95 put the sources in phase with the code +!! J. Stein 20/07/95 reset to FALSE of all the switches when +!! CBUTYPE /= MASK or CART +!! J. Stein 26/06/96 add the new sources + add the increment between +!! 2 active processes +!! J.-P. Pinty 13/12/96 Allowance of multiple SVs +!! J.-P. Pinty 11/01/97 Includes deep convection ice and forcing processes +!! J.-P. Lafore 10/02/98 Allocation of the RHODJs for budget +!! V. Ducrocq 04/06/99 // +!! N. Asencio 18/06/99 // MASK case : delete KIMAX and KJMAX arguments, +!! GET_DIM_EXT_ll initializes the dimensions of the +!! extended local domain. +!! LBU_MASK and NBUSURF are allocated on the extended +!! local domain. +!! add 3 local variables IBUDIM1,IBUDIM2,IBUDIM3 +!! to define the dimensions of the budget arrays +!! in the different cases CART and MASK +!! J.-P. Pinty 23/09/00 add budget for C2R2 +!! V. Masson 18/11/02 add budget for 2way nesting +!! O.Geoffroy 03/2006 Add KHKO scheme +!! J.-P. Pinty 22/04/97 add the explicit hail processes +!! C.Lac 10/08/07 Add ADV for PPM without contribution +!! of each direction +!! C. Barthe 19/11/09 Add atmospheric electricity +!! C.Lac 01/07/11 Add vegetation drag +!! P. Peyrille, M. Tomasini : include in the forcing term the 2D forcing +!! terms in term 2DFRC search for modif PP . but Not very clean! +!! C .Lac 27/05/14 add negativity corrections for chemical species +!! C.Lac 29/01/15 Correction for NSV_USER +!! J.Escobar 02/10/2015 modif for JPHEXT(JPVEXT) variable +!! C.Lac 04/12/15 Correction for LSUPSAT +! C. Lac 04/2016: negative contribution to the budget split between advection, turbulence and microphysics for KHKO/C2R2 +! C. Barthe 01/2016: add budget for LIMA +! C. Lac 10/2016: add budget for droplet deposition +! S. Riette 11/2016: new budgets for ICE3/ICE4 +! P. Wautelet 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 10/04/2019: replace ABORT and STOP calls by Print_msg +! P. Wautelet 15/11/2019: remove unused CBURECORD variable +! P. Wautelet 24/02/2020: bugfix: corrected condition for budget NCDEPITH +! P. Wautelet 26/02/2020: bugfix: rename CEVA->REVA for budget for raindrop evaporation in C2R2 (necessary after commit 4ed805fc) +! P. Wautelet 26/02/2020: bugfix: add missing condition on OCOLD for NSEDIRH budget in LIMA case +! P. Wautelet 02-03/2020: use the new data structures and subroutines for budgets +! B. Vie 02/03/2020: LIMA negativity checks after turbulence, advection and microphysics budgets +! P .Wautelet 09/03/2020: add missing budgets for electricity +! P. Wautelet 25/03/2020: add missing ove_relax_grd +! P. Wautelet 23/04/2020: add nid in tbudgetdata datatype +! P. Wautelet + Benoit Vié 11/06/2020: improve removal of negative scalar variables + adapt the corresponding budgets +! P. Wautelet 30/06/2020: use NADVSV when possible +! P. Wautelet 30/06/2020: add NNETURSV, NNEADVSV and NNECONSV variables +! P. Wautelet 06/07/2020: bugfix: add condition on HTURB for NETUR sources for SV budgets +! P. Wautelet 08/12/2020: add nbusubwrite and nbutotwrite +! P. Wautelet 11/01/2021: ignore xbuwri for cartesian boxes (write at every xbulen interval) +! P. Wautelet 01/02/2021: bugfix: add missing CEDS source terms for SV budgets +! P. Wautelet 02/02/2021: budgets: add missing source terms for SV budgets in LIMA +! P. Wautelet 03/02/2021: budgets: add new source if LIMA splitting: CORR2 +! P. Wautelet 10/02/2021: budgets: add missing sources for NSV_C2R2BEG+3 budget +! P. Wautelet 11/02/2021: budgets: add missing term SCAV for NSV_LIMA_SCAVMASS budget +! P. Wautelet 02/03/2021: budgets: add terms for blowing snow +! P. Wautelet 04/03/2021: budgets: add terms for drag due to buildings +! P. Wautelet 17/03/2021: choose source terms for budgets with character strings instead of multiple integer variables +! C. Barthe 14/03/2022: budgets: add terms for CIBU and RDSF in LIMA +! M. Taufour 01/07/2022: budgets: add concentration for snow, graupel, hail +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +use modd_2d_frc, only: l2d_adv_frc, l2d_rel_frc +use modd_blowsnow, only: lblowsnow +use modd_blowsnow_n, only: lsnowsubl +use modd_budget +use modd_ch_aerosol, only: lorilam +use modd_conf, only: l1d, lcartesian, lforcing, lthinshell, nmodel +use modd_dim_n, only: nimax_ll, njmax_ll, nkmax +use modd_dragbldg_n, only: ldragbldg +use modd_dust, only: ldust +use modd_dyn, only: lcorio, xseglen +use modd_dyn_n, only: xtstep, locean +use modd_elec_descr, only: linductive, lrelax2fw_ion +use modd_field, only: TYPEREAL +use modd_nsv, only: csvnames, & + nsv_aerbeg, nsv_aerend, nsv_aerdepbeg, nsv_aerdepend, nsv_c2r2beg, nsv_c2r2end, & + nsv_chembeg, nsv_chemend, nsv_chicbeg, nsv_chicend, nsv_csbeg, nsv_csend, & + nsv_dstbeg, nsv_dstend, nsv_dstdepbeg, nsv_dstdepend, nsv_elecbeg, nsv_elecend, & +#ifdef MNH_FOREFIRE + nsv_ffbeg, nsv_ffend, & +#endif + nsv_lgbeg, nsv_lgend, & + nsv_lima_beg, nsv_lima_end, nsv_lima_ccn_acti, nsv_lima_ccn_free, nsv_lima_hom_haze, & + nsv_lima_ifn_free, nsv_lima_ifn_nucl, nsv_lima_imm_nucl, & + nsv_lima_nc, nsv_lima_nr, nsv_lima_ni, nsv_lima_scavmass, nsv_lima_spro, & + nsv_lima_ns, nsv_lima_ng, nsv_lima_nh, & + nsv_lnoxbeg, nsv_lnoxend, nsv_ppbeg, nsv_ppend, & + nsv_sltbeg, nsv_sltend, nsv_sltdepbeg, nsv_sltdepend, nsv_snwbeg, nsv_snwend, & + nsv_user +use modd_parameters, only: jphext +use modd_param_c2r2, only: ldepoc_c2r2 => ldepoc, lrain_c2r2 => lrain, lsedc_c2r2 => lsedc, lsupsat_c2r2 => lsupsat +use modd_param_ice_n, only: ladj_after, ladj_before, ldeposc_ice => ldeposc, lred, lsedic_ice => lsedic, lwarm_ice => lwarm +use modd_param_n, only: cactccn, celec +use modd_param_lima, only: laero_mass_lima => laero_mass, lacti_lima => lacti, lcold_lima => lcold, ldepoc_lima => ldepoc, & + lhail_lima => lhail, lhhoni_lima => lhhoni, lmeyers_lima => lmeyers, lnucl_lima => lnucl, & + lptsplit, & + lrain_lima => lrain, lscav_lima => lscav, lsedc_lima => lsedc, lsedi_lima => lsedi, & + lsnow_lima => lsnow, lspro_lima => lspro, lwarm_lima => lwarm, lcibu, lrdsf, & + nmom_c, nmom_r, nmom_i, nmom_s, nmom_g, nmom_h, nmod_ccn, nmod_ifn, nmod_imm +use modd_ref, only: lcouples +use modd_salt, only: lsalt +use modd_neb_n, only: lsubg_cond +use modd_viscosity, only: lvisc, lvisc_r, lvisc_sv, lvisc_th, lvisc_uvw + +USE MODE_ll + +IMPLICIT NONE +! +!* 0.1 declarations of argument +! +! +INTEGER, INTENT(IN) :: KLUOUT ! Logical unit number for prints +REAL, INTENT(IN) :: PTSTEP ! time step +INTEGER, INTENT(IN) :: KSV ! number of scalar variables +INTEGER, INTENT(IN) :: KRR ! number of moist variables +LOGICAL, INTENT(IN) :: ONUMDIFU ! switch to activate the numerical + ! diffusion for momentum +LOGICAL, INTENT(IN) :: ONUMDIFTH ! for meteorological scalar variables +LOGICAL, INTENT(IN) :: ONUMDIFSV ! for tracer scalar variables +LOGICAL, INTENT(IN) :: OHORELAX_UVWTH ! switch for the + ! horizontal relaxation for U,V,W,TH +LOGICAL, INTENT(IN) :: OHORELAX_RV ! switch for the + ! horizontal relaxation for Rv +LOGICAL, INTENT(IN) :: OHORELAX_RC ! switch for the + ! horizontal relaxation for Rc +LOGICAL, INTENT(IN) :: OHORELAX_RR ! switch for the + ! horizontal relaxation for Rr +LOGICAL, INTENT(IN) :: OHORELAX_RI ! switch for the + ! horizontal relaxation for Ri +LOGICAL, INTENT(IN) :: OHORELAX_RS ! switch for the + ! horizontal relaxation for Rs +LOGICAL, INTENT(IN) :: OHORELAX_RG ! switch for the + ! horizontal relaxation for Rg +LOGICAL, INTENT(IN) :: OHORELAX_RH ! switch for the + ! horizontal relaxation for Rh +LOGICAL, INTENT(IN) :: OHORELAX_TKE ! switch for the + ! horizontal relaxation for tke +LOGICAL,DIMENSION(:),INTENT(IN):: OHORELAX_SV ! switch for the + ! horizontal relaxation for scalar variables +LOGICAL, INTENT(IN) :: OVE_RELAX ! switch to activate the vertical + ! relaxation +logical, intent(in) :: ove_relax_grd ! switch to activate the vertical + ! relaxation to the lowest verticals +LOGICAL, INTENT(IN) :: OCHTRANS ! switch to activate convective + !transport for SV +LOGICAL, INTENT(IN) :: ONUDGING ! switch to activate nudging +LOGICAL, INTENT(IN) :: ODRAGTREE ! switch to activate vegetation drag +LOGICAL, INTENT(IN) :: ODEPOTREE ! switch to activate droplet deposition on tree +LOGICAL, INTENT(IN) :: OAERO_EOL ! switch to activate wind turbine wake +CHARACTER (LEN=*), INTENT(IN) :: HRAD ! type of the radiation scheme +CHARACTER (LEN=*), INTENT(IN) :: HDCONV ! type of the deep convection scheme +CHARACTER (LEN=*), INTENT(IN) :: HSCONV ! type of the shallow convection scheme +CHARACTER (LEN=*), INTENT(IN) :: HTURB ! type of the turbulence scheme +CHARACTER (LEN=*), INTENT(IN) :: HTURBDIM! dimensionnality of the turbulence + ! scheme +CHARACTER (LEN=*), INTENT(IN) :: HCLOUD ! type of microphysical scheme +! +!* 0.2 declarations of local variables +! +real, parameter :: ITOL = 1e-6 + +INTEGER :: JI, JJ ! loop indices +INTEGER :: IIMAX_ll, IJMAX_ll ! size of the physical global domain +INTEGER :: IIU, IJU ! size along x and y directions + ! of the extended subdomain +INTEGER :: IBUDIM1 ! first dimension of the budget arrays + ! = NBUIMAX in CART case + ! = NBUKMAX in MASK case +INTEGER :: IBUDIM2 ! second dimension of the budget arrays + ! = NBUJMAX in CART case + ! = nbusubwrite in MASK case +INTEGER :: IBUDIM3 ! third dimension of the budget arrays + ! = NBUKMAX in CART case + ! = NBUMASK in MASK case +INTEGER :: JSV ! loop indice for the SVs +INTEGER :: IINFO_ll ! return status of the interface routine +integer :: ibudget +logical :: gtmp +type(tbusourcedata) :: tzsource ! Used to prepare metadate of source terms + +call Print_msg( NVERB_DEBUG, 'BUD', 'Ini_budget', 'called' ) +! +!* 1. COMPUTE BUDGET VARIABLES +! ------------------------ +! +NBUSTEP = NINT (XBULEN / PTSTEP) +NBUTSHIFT=0 +! +! common dimension for all CBUTYPE values +! +IF (LBU_KCP) THEN + NBUKMAX = 1 +ELSE + NBUKMAX = NBUKH - NBUKL +1 +END IF +! +if ( cbutype == 'CART' .or. cbutype == 'MASK' ) then + !Check if xbulen is a multiple of xtstep (within tolerance) + if ( Abs( Nint( xbulen / xtstep ) * xtstep - xbulen ) > ( ITOL * xtstep ) ) & + call Print_msg( NVERB_WARNING, 'BUD', 'Ini_budget', 'xbulen is not a multiple of xtstep' ) + + if ( cbutype == 'CART' ) then + !Check if xseglen is a multiple of xbulen (within tolerance) + if ( Abs( Nint( xseglen / xbulen ) * xbulen - xseglen ) > ( ITOL * xseglen ) ) & + call Print_msg( NVERB_WARNING, 'BUD', 'Ini_budget', 'xseglen is not a multiple of xbulen' ) + + !Write cartesian budgets every xbulen time period (do not take xbuwri into account) + xbuwri = xbulen + + nbusubwrite = 1 !Number of budget time average periods for each write + nbutotwrite = nbusubwrite * Nint( xseglen / xbulen ) !Total number of budget time average periods + else if ( cbutype == 'MASK' ) then + !Check if xbuwri is a multiple of xtstep (within tolerance) + if ( Abs( Nint( xbuwri / xtstep ) * xtstep - xbuwri ) > ( ITOL * xtstep ) ) & + call Print_msg( NVERB_WARNING, 'BUD', 'Ini_budget', 'xbuwri is not a multiple of xtstep' ) + + !Check if xbuwri is a multiple of xbulen (within tolerance) + if ( Abs( Nint( xbuwri / xbulen ) * xbulen - xbuwri ) > ( ITOL * xbulen ) ) & + call Print_msg( NVERB_WARNING, 'BUD', 'Ini_budget', 'xbuwri is not a multiple of xbulen' ) + + !Check if xseglen is a multiple of xbuwri (within tolerance) + if ( Abs( Nint( xseglen / xbuwri ) * xbuwri - xseglen ) > ( ITOL * xseglen ) ) & + call Print_msg( NVERB_WARNING, 'BUD', 'Ini_budget', 'xseglen is not a multiple of xbuwri' ) + + nbusubwrite = Nint ( xbuwri / xbulen ) !Number of budget time average periods for each write + nbutotwrite = nbusubwrite * Nint( xseglen / xbuwri ) !Total number of budget time average periods + end if +end if + +IF (CBUTYPE=='CART') THEN ! cartesian case only +! + IF ( NBUIL < 1 ) CALL Print_msg( NVERB_ERROR, 'BUD', 'Ini_budget', 'NBUIL too small (<1)' ) + IF ( NBUIL > NIMAX_ll ) CALL Print_msg( NVERB_ERROR, 'BUD', 'Ini_budget', 'NBUIL too large (>NIMAX)' ) + IF ( NBUIH < 1 ) CALL Print_msg( NVERB_ERROR, 'BUD', 'Ini_budget', 'NBUIH too small (<1)' ) + IF ( NBUIH > NIMAX_ll ) CALL Print_msg( NVERB_ERROR, 'BUD', 'Ini_budget', 'NBUIH too large (>NIMAX)' ) + IF ( NBUIH < NBUIL ) CALL Print_msg( NVERB_ERROR, 'BUD', 'Ini_budget', 'NBUIH < NBUIL' ) + IF (LBU_ICP) THEN + NBUIMAX_ll = 1 + ELSE + NBUIMAX_ll = NBUIH - NBUIL +1 + END IF + + IF ( NBUJL < 1 ) CALL Print_msg( NVERB_ERROR, 'BUD', 'Ini_budget', 'NBUJL too small (<1)' ) + IF ( NBUJL > NJMAX_ll ) CALL Print_msg( NVERB_ERROR, 'BUD', 'Ini_budget', 'NBUJL too large (>NJMAX)' ) + IF ( NBUJH < 1 ) CALL Print_msg( NVERB_ERROR, 'BUD', 'Ini_budget', 'NBUJH too small (<1)' ) + IF ( NBUJH > NJMAX_ll ) CALL Print_msg( NVERB_ERROR, 'BUD', 'Ini_budget', 'NBUJH too large (>NJMAX)' ) + IF ( NBUJH < NBUJL ) CALL Print_msg( NVERB_ERROR, 'BUD', 'Ini_budget', 'NBUJH < NBUJL' ) + IF (LBU_JCP) THEN + NBUJMAX_ll = 1 + ELSE + NBUJMAX_ll = NBUJH - NBUJL +1 + END IF + + IF ( NBUKL < 1 ) CALL Print_msg( NVERB_ERROR, 'BUD', 'Ini_budget', 'NBUKL too small (<1)' ) + IF ( NBUKL > NKMAX ) CALL Print_msg( NVERB_ERROR, 'BUD', 'Ini_budget', 'NBUKL too large (>NKMAX)' ) + IF ( NBUKH < 1 ) CALL Print_msg( NVERB_ERROR, 'BUD', 'Ini_budget', 'NBUKH too small (<1)' ) + IF ( NBUKH > NKMAX ) CALL Print_msg( NVERB_ERROR, 'BUD', 'Ini_budget', 'NBUKH too large (>NKMAX)' ) + IF ( NBUKH < NBUKL ) CALL Print_msg( NVERB_ERROR, 'BUD', 'Ini_budget', 'NBUKH < NBUKL' ) + + CALL GET_INTERSECTION_ll(NBUIL+JPHEXT,NBUJL+JPHEXT,NBUIH+JPHEXT,NBUJH+JPHEXT, & + NBUSIL,NBUSJL,NBUSIH,NBUSJH,"PHYS",IINFO_ll) + IF ( IINFO_ll /= 1 ) THEN ! + IF (LBU_ICP) THEN + NBUIMAX = 1 + ELSE + NBUIMAX = NBUSIH - NBUSIL +1 + END IF + IF (LBU_JCP) THEN + NBUJMAX = 1 + ELSE + NBUJMAX = NBUSJH - NBUSJL +1 + END IF + ELSE ! the intersection is void + CBUTYPE='SKIP' ! no budget on this processor + NBUIMAX = 0 ! in order to allocate void arrays + NBUJMAX = 0 + ENDIF +! three first dimensions of budget arrays in cart and skip cases + IBUDIM1=NBUIMAX + IBUDIM2=NBUJMAX + IBUDIM3=NBUKMAX +! these variables are not be used + NBUMASK=-1 +! +ELSEIF (CBUTYPE=='MASK') THEN ! mask case only +! + LBU_ENABLE=.TRUE. + ! result on the FM_FILE + NBUTIME = 1 + + CALL GET_DIM_EXT_ll ('B', IIU,IJU) + ALLOCATE( LBU_MASK( IIU ,IJU, NBUMASK) ) + LBU_MASK(:,:,:)=.FALSE. + ALLOCATE( NBUSURF( IIU, IJU, NBUMASK, nbusubwrite) ) + NBUSURF(:,:,:,:) = 0 +! +! three first dimensions of budget arrays in mask case +! the order of the dimensions are the order expected in WRITE_DIACHRO routine: +! x,y,z,time,mask,processus and in this case x and y are missing +! first dimension of the arrays : dimension along K +! second dimension of the arrays : number of the budget time period +! third dimension of the arrays : number of the budget masks zones + IBUDIM1=NBUKMAX + IBUDIM2=nbusubwrite + IBUDIM3=NBUMASK +! these variables are not used in this case + NBUIMAX=-1 + NBUJMAX=-1 +! the beginning and the end along x and y direction : global extended domain + ! get dimensions of the physical global domain + CALL GET_GLOBALDIMS_ll (IIMAX_ll,IJMAX_ll) + NBUIL=1 + NBUIH=IIMAX_ll + 2 * JPHEXT + NBUJL=1 + NBUJH=IJMAX_ll + 2 * JPHEXT +! +ELSE ! default case +! + LBU_ENABLE=.FALSE. + NBUIMAX = -1 + NBUJMAX = -1 + LBU_RU = .FALSE. + LBU_RV = .FALSE. + LBU_RW = .FALSE. + LBU_RTH= .FALSE. + LBU_RTKE= .FALSE. + LBU_RRV= .FALSE. + LBU_RRC= .FALSE. + LBU_RRR= .FALSE. + LBU_RRI= .FALSE. + LBU_RRS= .FALSE. + LBU_RRG= .FALSE. + LBU_RRH= .FALSE. + LBU_RSV= .FALSE. +! +! three first dimensions of budget arrays in default case + IBUDIM1=0 + IBUDIM2=0 + IBUDIM3=0 +! +END IF +! +! +!------------------------------------------------------------------------------- +! +!* 2. ALLOCATE MEMORY FOR BUDGET ARRAYS AND INITIALIZE +! ------------------------------------------------ +! +LBU_BEG =.TRUE. +! +!------------------------------------------------------------------------------- +! +!* 3. INITALIZE VARIABLES +! ------------------- +! +!Create intermediate variable to store rhodj for scalar variables +if ( lbu_rth .or. lbu_rtke .or. lbu_rrv .or. lbu_rrc .or. lbu_rrr .or. & + lbu_rri .or. lbu_rrs .or. lbu_rrg .or. lbu_rrh .or. lbu_rsv ) then + allocate( tburhodj ) + + tburhodj%cmnhname = 'RhodJS' + tburhodj%cstdname = '' + tburhodj%clongname = 'RhodJS' + tburhodj%cunits = 'kg' + tburhodj%ccomment = 'RhodJ for Scalars variables' + tburhodj%ngrid = 1 + tburhodj%ntype = TYPEREAL + tburhodj%ndims = 3 + + allocate( tburhodj%xdata(ibudim1, ibudim2, ibudim3) ) + tburhodj%xdata(:, :, :) = 0. +end if + +tzsource%ntype = TYPEREAL +tzsource%ndims = 3 + +! Budget of RU +tbudgets(NBUDGET_U)%lenabled = lbu_ru + +if ( lbu_ru ) then + allocate( tbudgets(NBUDGET_U)%trhodj ) + + tbudgets(NBUDGET_U)%trhodj%cmnhname = 'RhodJX' + tbudgets(NBUDGET_U)%trhodj%cstdname = '' + tbudgets(NBUDGET_U)%trhodj%clongname = 'RhodJX' + tbudgets(NBUDGET_U)%trhodj%cunits = 'kg' + tbudgets(NBUDGET_U)%trhodj%ccomment = 'RhodJ for momentum along X axis' + tbudgets(NBUDGET_U)%trhodj%ngrid = 2 + tbudgets(NBUDGET_U)%trhodj%ntype = TYPEREAL + tbudgets(NBUDGET_U)%trhodj%ndims = 3 + + allocate( tbudgets(NBUDGET_U)%trhodj%xdata(ibudim1, ibudim2, ibudim3) ) + tbudgets(NBUDGET_U)%trhodj%xdata(:, :, :) = 0. + + !Allocate all basic source terms (used or not) + !The size should be large enough (bigger than necessary is OK) + tbudgets(NBUDGET_U)%nsourcesmax = NSOURCESMAX + allocate( tbudgets(NBUDGET_U)%tsources(NSOURCESMAX) ) + + allocate( tbudgets(NBUDGET_U)%xtmpstore(ibudim1, ibudim2, ibudim3) ) + + tbudgets(NBUDGET_U)%tsources(:)%ngroup = 0 + + tzsource%ccomment = 'Budget of momentum along X axis' + tzsource%ngrid = 2 + + tzsource%cunits = 'm s-1' + + tzsource%cmnhname = 'INIF' + tzsource%clongname = 'initial state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_U), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'ENDF' + tzsource%clongname = 'final state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_U), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'AVEF' + tzsource%clongname = 'averaged state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_U), tzsource, odonotinit = .true., ooverwrite = .false. ) + + tzsource%cunits = 'm s-2' + + tzsource%cmnhname = 'ASSE' + tzsource%clongname = 'time filter (Asselin)' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_U), tzsource ) + + tzsource%cmnhname = 'NEST' + tzsource%clongname = 'nesting' + tzsource%lavailable = nmodel > 1 + call Budget_source_add( tbudgets(NBUDGET_U), tzsource ) + + tzsource%cmnhname = 'FRC' + tzsource%clongname = 'forcing' + tzsource%lavailable = lforcing + call Budget_source_add( tbudgets(NBUDGET_U), tzsource ) + + tzsource%cmnhname = 'NUD' + tzsource%clongname = 'nudging' + tzsource%lavailable = onudging + call Budget_source_add( tbudgets(NBUDGET_U), tzsource ) + + tzsource%cmnhname = 'CURV' + tzsource%clongname = 'curvature' + tzsource%lavailable = .not.l1d .and. .not.lcartesian + call Budget_source_add( tbudgets(NBUDGET_U), tzsource ) + + tzsource%cmnhname = 'COR' + tzsource%clongname = 'Coriolis' + tzsource%lavailable = lcorio + call Budget_source_add( tbudgets(NBUDGET_U), tzsource ) + + tzsource%cmnhname = 'DIF' + tzsource%clongname = 'numerical diffusion' + tzsource%lavailable = onumdifu + call Budget_source_add( tbudgets(NBUDGET_U), tzsource ) + + tzsource%cmnhname = 'REL' + tzsource%clongname = 'relaxation' + tzsource%lavailable = ohorelax_uvwth .or. ove_relax .or. ove_relax_grd + call Budget_source_add( tbudgets(NBUDGET_U), tzsource ) + + tzsource%cmnhname = 'DRAG' + tzsource%clongname = 'drag force due to trees' + tzsource%lavailable = odragtree + call Budget_source_add( tbudgets(NBUDGET_U), tzsource ) + + tzsource%cmnhname = 'DRAGEOL' + tzsource%clongname = 'drag force due to wind turbine' + tzsource%lavailable = OAERO_EOL + call Budget_source_add( tbudgets(NBUDGET_U), tzsource ) + + tzsource%cmnhname = 'DRAGB' + tzsource%clongname = 'drag force due to buildings' + tzsource%lavailable = ldragbldg + call Budget_source_add( tbudgets(NBUDGET_U), tzsource ) + + tzsource%cmnhname = 'VTURB' + tzsource%clongname = 'vertical turbulent diffusion' + tzsource%lavailable = hturb == 'TKEL' + call Budget_source_add( tbudgets(NBUDGET_U), tzsource ) + + tzsource%cmnhname = 'HTURB' + tzsource%clongname = 'horizontal turbulent diffusion' + tzsource%lavailable = hturb == 'TKEL' .and. HTURBDIM == '3DIM' + call Budget_source_add( tbudgets(NBUDGET_U), tzsource ) + + tzsource%cmnhname = 'MAFL' + tzsource%clongname = 'mass flux' + tzsource%lavailable = hsconv == 'EDKF' + call Budget_source_add( tbudgets(NBUDGET_U), tzsource ) + + tzsource%cmnhname = 'VISC' + tzsource%clongname = 'viscosity' + tzsource%lavailable = lvisc .and. lvisc_uvw + call Budget_source_add( tbudgets(NBUDGET_U), tzsource ) + + tzsource%cmnhname = 'ADV' + tzsource%clongname = 'advection' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_U), tzsource ) + + tzsource%cmnhname = 'PRES' + tzsource%clongname = 'pressure' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_U), tzsource ) + + + call Sourcelist_sort_compact( tbudgets(NBUDGET_U) ) + + call Sourcelist_scan( tbudgets(NBUDGET_U), cbulist_ru ) +end if + +! Budget of RV +tbudgets(NBUDGET_V)%lenabled = lbu_rv + +if ( lbu_rv ) then + allocate( tbudgets(NBUDGET_V)%trhodj ) + + tbudgets(NBUDGET_V)%trhodj%cmnhname = 'RhodJY' + tbudgets(NBUDGET_V)%trhodj%cstdname = '' + tbudgets(NBUDGET_V)%trhodj%clongname = 'RhodJY' + tbudgets(NBUDGET_V)%trhodj%cunits = 'kg' + tbudgets(NBUDGET_V)%trhodj%ccomment = 'RhodJ for momentum along Y axis' + tbudgets(NBUDGET_V)%trhodj%ngrid = 3 + tbudgets(NBUDGET_V)%trhodj%ntype = TYPEREAL + tbudgets(NBUDGET_V)%trhodj%ndims = 3 + + allocate( tbudgets(NBUDGET_V)%trhodj%xdata(ibudim1, ibudim2, ibudim3) ) + tbudgets(NBUDGET_V)%trhodj%xdata(:, :, :) = 0. + + !Allocate all basic source terms (used or not) + !The size should be large enough (bigger than necessary is OK) + tbudgets(NBUDGET_V)%nsourcesmax = NSOURCESMAX + allocate( tbudgets(NBUDGET_V)%tsources(NSOURCESMAX) ) + + allocate( tbudgets(NBUDGET_V)%xtmpstore(ibudim1, ibudim2, ibudim3) ) + + tbudgets(NBUDGET_V)%tsources(:)%ngroup = 0 + + tzsource%ccomment = 'Budget of momentum along Y axis' + tzsource%ngrid = 3 + + tzsource%cunits = 'm s-1' + + tzsource%cmnhname = 'INIF' + tzsource%clongname = 'initial state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_V), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'ENDF' + tzsource%clongname = 'final state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_V), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'AVEF' + tzsource%clongname = 'averaged state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_V), tzsource, odonotinit = .true., ooverwrite = .false. ) + + tzsource%cunits = 'm s-2' + + tzsource%cmnhname = 'ASSE' + tzsource%clongname = 'time filter (Asselin)' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_V), tzsource ) + + tzsource%cmnhname = 'NEST' + tzsource%clongname = 'nesting' + tzsource%lavailable = nmodel > 1 + call Budget_source_add( tbudgets(NBUDGET_V), tzsource ) + + tzsource%cmnhname = 'FRC' + tzsource%clongname = 'forcing' + tzsource%lavailable = lforcing + call Budget_source_add( tbudgets(NBUDGET_V), tzsource ) + + tzsource%cmnhname = 'NUD' + tzsource%clongname = 'nudging' + tzsource%lavailable = onudging + call Budget_source_add( tbudgets(NBUDGET_V), tzsource ) + + tzsource%cmnhname = 'CURV' + tzsource%clongname = 'curvature' + tzsource%lavailable = .not.l1d .and. .not.lcartesian + call Budget_source_add( tbudgets(NBUDGET_V), tzsource ) + + tzsource%cmnhname = 'COR' + tzsource%clongname = 'Coriolis' + tzsource%lavailable = lcorio + call Budget_source_add( tbudgets(NBUDGET_V), tzsource ) + + tzsource%cmnhname = 'DIF' + tzsource%clongname = 'numerical diffusion' + tzsource%lavailable = onumdifu + call Budget_source_add( tbudgets(NBUDGET_V), tzsource ) + + tzsource%cmnhname = 'REL' + tzsource%clongname = 'relaxation' + tzsource%lavailable = ohorelax_uvwth .or. ove_relax .or. ove_relax_grd + call Budget_source_add( tbudgets(NBUDGET_V), tzsource ) + + tzsource%cmnhname = 'DRAG' + tzsource%clongname = 'drag force due to trees' + tzsource%lavailable = odragtree + call Budget_source_add( tbudgets(NBUDGET_V), tzsource ) + + tzsource%cmnhname = 'DRAGEOL' + tzsource%clongname = 'drag force due to wind turbine' + tzsource%lavailable = OAERO_EOL + call Budget_source_add( tbudgets(NBUDGET_V), tzsource ) + + tzsource%cmnhname = 'DRAGB' + tzsource%clongname = 'drag force due to buildings' + tzsource%lavailable = ldragbldg + call Budget_source_add( tbudgets(NBUDGET_V), tzsource ) + + tzsource%cmnhname = 'VTURB' + tzsource%clongname = 'vertical turbulent diffusion' + tzsource%lavailable = hturb == 'TKEL' + call Budget_source_add( tbudgets(NBUDGET_V), tzsource ) + + tzsource%cmnhname = 'HTURB' + tzsource%clongname = 'horizontal turbulent diffusion' + tzsource%lavailable = hturb == 'TKEL' .and. HTURBDIM == '3DIM' + call Budget_source_add( tbudgets(NBUDGET_V), tzsource ) + + tzsource%cmnhname = 'MAFL' + tzsource%clongname = 'mass flux' + tzsource%lavailable = hsconv == 'EDKF' + call Budget_source_add( tbudgets(NBUDGET_V), tzsource ) + + tzsource%cmnhname = 'VISC' + tzsource%clongname = 'viscosity' + tzsource%lavailable = lvisc .and. lvisc_uvw + call Budget_source_add( tbudgets(NBUDGET_V), tzsource ) + + tzsource%cmnhname = 'ADV' + tzsource%clongname = 'advection' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_V), tzsource ) + + tzsource%cmnhname = 'PRES' + tzsource%clongname = 'pressure' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_V), tzsource ) + + + call Sourcelist_sort_compact( tbudgets(NBUDGET_V) ) + + call Sourcelist_scan( tbudgets(NBUDGET_V), cbulist_rv ) +end if + +! Budget of RW +tbudgets(NBUDGET_W)%lenabled = lbu_rw + +if ( lbu_rw ) then + allocate( tbudgets(NBUDGET_W)%trhodj ) + + tbudgets(NBUDGET_W)%trhodj%cmnhname = 'RhodJZ' + tbudgets(NBUDGET_W)%trhodj%cstdname = '' + tbudgets(NBUDGET_W)%trhodj%clongname = 'RhodJZ' + tbudgets(NBUDGET_W)%trhodj%cunits = 'kg' + tbudgets(NBUDGET_W)%trhodj%ccomment = 'RhodJ for momentum along Z axis' + tbudgets(NBUDGET_W)%trhodj%ngrid = 4 + tbudgets(NBUDGET_W)%trhodj%ntype = TYPEREAL + tbudgets(NBUDGET_W)%trhodj%ndims = 3 + + allocate( tbudgets(NBUDGET_W)%trhodj%xdata(ibudim1, ibudim2, ibudim3) ) + tbudgets(NBUDGET_W)%trhodj%xdata(:, :, :) = 0. + + !Allocate all basic source terms (used or not) + !The size should be large enough (bigger than necessary is OK) + tbudgets(NBUDGET_W)%nsourcesmax = NSOURCESMAX + allocate( tbudgets(NBUDGET_W)%tsources(NSOURCESMAX) ) + + allocate( tbudgets(NBUDGET_W)%xtmpstore(ibudim1, ibudim2, ibudim3) ) + + tbudgets(NBUDGET_W)%tsources(:)%ngroup = 0 + + tzsource%ccomment = 'Budget of momentum along Z axis' + tzsource%ngrid = 4 + + tzsource%cunits = 'm s-1' + + tzsource%cmnhname = 'INIF' + tzsource%clongname = 'initial state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_W), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'ENDF' + tzsource%clongname = 'final state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_W), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'AVEF' + tzsource%clongname = 'averaged state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_W), tzsource, odonotinit = .true., ooverwrite = .false. ) + + tzsource%cunits = 'm s-2' + + tzsource%cmnhname = 'ASSE' + tzsource%clongname = 'time filter (Asselin)' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_W), tzsource ) + + tzsource%cmnhname = 'NEST' + tzsource%clongname = 'nesting' + tzsource%lavailable = nmodel > 1 + call Budget_source_add( tbudgets(NBUDGET_W), tzsource ) + + tzsource%cmnhname = 'FRC' + tzsource%clongname = 'forcing' + tzsource%lavailable = lforcing + call Budget_source_add( tbudgets(NBUDGET_W), tzsource ) + + tzsource%cmnhname = 'NUD' + tzsource%clongname = 'nudging' + tzsource%lavailable = onudging + call Budget_source_add( tbudgets(NBUDGET_W), tzsource ) + + tzsource%cmnhname = 'CURV' + tzsource%clongname = 'curvature' + tzsource%lavailable = .not.l1d .and. .not.lcartesian .and. .not.lthinshell + call Budget_source_add( tbudgets(NBUDGET_W), tzsource ) + + tzsource%cmnhname = 'COR' + tzsource%clongname = 'Coriolis' + tzsource%lavailable = lcorio .and. .not.l1d .and. .not.lthinshell + call Budget_source_add( tbudgets(NBUDGET_W), tzsource ) + + tzsource%cmnhname = 'DIF' + tzsource%clongname = 'numerical diffusion' + tzsource%lavailable = onumdifu + call Budget_source_add( tbudgets(NBUDGET_W), tzsource ) + + tzsource%cmnhname = 'REL' + tzsource%clongname = 'relaxation' + tzsource%lavailable = ohorelax_uvwth .or. ove_relax .or. ove_relax_grd + call Budget_source_add( tbudgets(NBUDGET_W), tzsource ) + + tzsource%cmnhname = 'VTURB' + tzsource%clongname = 'vertical turbulent diffusion' + tzsource%lavailable = hturb == 'TKEL' + call Budget_source_add( tbudgets(NBUDGET_W), tzsource ) + + tzsource%cmnhname = 'HTURB' + tzsource%clongname = 'horizontal turbulent diffusion' + tzsource%lavailable = hturb == 'TKEL' .and. HTURBDIM == '3DIM' + call Budget_source_add( tbudgets(NBUDGET_W), tzsource ) + + tzsource%cmnhname = 'VISC' + tzsource%clongname = 'viscosity' + tzsource%lavailable = lvisc .and. lvisc_uvw + call Budget_source_add( tbudgets(NBUDGET_W), tzsource ) + + tzsource%cmnhname = 'GRAV' + tzsource%clongname = 'gravity' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_W), tzsource ) + + tzsource%cmnhname = 'ADV' + tzsource%clongname = 'advection' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_W), tzsource ) + + tzsource%cmnhname = 'PRES' + tzsource%clongname = 'pressure' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_W), tzsource ) + + tzsource%cmnhname = 'DRAGEOL' + tzsource%clongname = 'drag force due to wind turbine' + tzsource%lavailable = OAERO_EOL + call Budget_source_add( tbudgets(NBUDGET_W), tzsource ) + + call Sourcelist_sort_compact( tbudgets(NBUDGET_W) ) + + call Sourcelist_scan( tbudgets(NBUDGET_W), cbulist_rw ) +end if + +! Budget of RTH +tbudgets(NBUDGET_TH)%lenabled = lbu_rth + +if ( lbu_rth ) then + tbudgets(NBUDGET_TH)%trhodj => tburhodj + + !Allocate all basic source terms (used or not) + !The size should be large enough (bigger than necessary is OK) + tbudgets(NBUDGET_TH)%nsourcesmax = NSOURCESMAX + allocate( tbudgets(NBUDGET_TH)%tsources(NSOURCESMAX) ) + + allocate( tbudgets(NBUDGET_TH)%xtmpstore(ibudim1, ibudim2, ibudim3) ) + + tbudgets(NBUDGET_TH)%tsources(:)%ngroup = 0 + + tzsource%ccomment = 'Budget of potential temperature' + tzsource%ngrid = 1 + + tzsource%cunits = 'K' + + tzsource%cmnhname = 'INIF' + tzsource%clongname = 'initial state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'ENDF' + tzsource%clongname = 'final state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'AVEF' + tzsource%clongname = 'averaged state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource, odonotinit = .true., ooverwrite = .false. ) + + tzsource%cunits = 'K s-1' + + tzsource%cmnhname = 'ASSE' + tzsource%clongname = 'time filter (Asselin)' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'NEST' + tzsource%clongname = 'nesting' + tzsource%lavailable = nmodel > 1 + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'FRC' + tzsource%clongname = 'forcing' + tzsource%lavailable = lforcing + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = '2DADV' + tzsource%clongname = 'advective forcing' + tzsource%lavailable = l2d_adv_frc + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = '2DREL' + tzsource%clongname = 'relaxation forcing' + tzsource%lavailable = l2d_rel_frc + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'NUD' + tzsource%clongname = 'nudging' + tzsource%lavailable = onudging + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'PREF' + tzsource%clongname = 'reference pressure' + tzsource%lavailable = krr > 0 .and. .not.l1d + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'DIF' + tzsource%clongname = 'numerical diffusion' + tzsource%lavailable = onumdifth + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'REL' + tzsource%clongname = 'relaxation' + tzsource%lavailable = ohorelax_uvwth .or. ove_relax .or. ove_relax_grd + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'RAD' + tzsource%clongname = 'radiation' + tzsource%lavailable = hrad /= 'NONE' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'DCONV' + tzsource%clongname = 'KAFR convection' + tzsource%lavailable = hdconv == 'KAFR' .OR. hsconv == 'KAFR' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'VTURB' + tzsource%clongname = 'vertical turbulent diffusion' + tzsource%lavailable = hturb == 'TKEL' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'HTURB' + tzsource%clongname = 'horizontal turbulent diffusion' + tzsource%lavailable = hturb == 'TKEL' .and. HTURBDIM == '3DIM' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'DISSH' + tzsource%clongname = 'dissipation' + tzsource%lavailable = hturb == 'TKEL' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'NETUR' + tzsource%clongname = 'negativity correction induced by turbulence' + tzsource%lavailable = hturb == 'TKEL' .and. ( hcloud == 'KESS' .or. hcloud == 'ICE3' .or. hcloud == 'ICE4' & + .or. hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' ) + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'MAFL' + tzsource%clongname = 'mass flux' + tzsource%lavailable = hsconv == 'EDKF' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'SNSUB' + tzsource%clongname = 'blowing snow sublimation' + tzsource%lavailable = lblowsnow .and. lsnowsubl + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'VISC' + tzsource%clongname = 'viscosity' + tzsource%lavailable = lvisc .and. lvisc_th + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'OCEAN' + tzsource%clongname = 'radiative tendency due to SW penetrating ocean' + tzsource%lavailable = locean .and. (.not. lcouples) + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'ADV' + tzsource%clongname = 'total advection' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'NEADV' + tzsource%clongname = 'negativity correction induced by advection' + tzsource%lavailable = hcloud == 'KESS' .or. hcloud == 'ICE3' .or. hcloud == 'ICE4' & + .or. hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'NEGA' + tzsource%clongname = 'negativity correction' + tzsource%lavailable = hcloud == 'KESS' .or. hcloud == 'ICE3' .or. hcloud == 'ICE4' & + .or. hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'heat transport by hydrometeors sedimentation' + tzsource%lavailable = hcloud == 'LIMA' .and. lptsplit + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'HENU' + tzsource%clongname = 'heterogeneous nucleation' + gtmp = cactccn == 'ABRK' .and. (lorilam .or. ldust .or. lsalt ) + tzsource%lavailable = ( hcloud == 'LIMA' .and. lwarm_lima .and. lacti_lima .and. nmod_ccn >= 1 & + .and. ( .not.lptsplit .or. .not.lsubg_cond ) ) & + .or. ( hcloud == 'C2R2' .and. ( gtmp .or. .not.lsupsat_c2r2 ) ) & + .or. ( hcloud == 'KHKO' .and. ( gtmp .or. .not.lsupsat_c2r2 ) ) + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'REVA' + tzsource%clongname = 'rain evaporation' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( ( .not. lptsplit .and. lwarm_lima .and. lrain_lima ) .or. lptsplit ) ) & + .or. ( hcloud(1:3) == 'ICE' .and. lwarm_ice ) & + .or. ( hcloud == 'C2R2' .and. lrain_c2r2 ) & + .or. ( hcloud == 'KHKO' .and. lrain_c2r2 ) & + .or. hcloud == 'KESS' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'HIN' + tzsource%clongname = 'heterogeneous ice nucleation' + tzsource%lavailable = hcloud(1:3) == 'ICE' .or. (hcloud == 'LIMA' .and. nmom_i == 1) + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'HIND' + tzsource%clongname = 'heterogeneous nucleation by deposition' + tzsource%lavailable = hcloud == 'LIMA' .and. lcold_lima .and. lnucl_lima + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'HINC' + tzsource%clongname = 'heterogeneous nucleation by contact' + tzsource%lavailable = hcloud == 'LIMA' .and. lcold_lima .and. lnucl_lima + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'HON' + tzsource%clongname = 'homogeneous nucleation' + tzsource%lavailable = hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'HONH' + tzsource%clongname = 'haze homogeneous nucleation' + tzsource%lavailable = hcloud == 'LIMA' .and. lcold_lima .and. lnucl_lima .and. lhhoni_lima .and. nmod_ccn >= 1 + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'HONC' + tzsource%clongname = 'droplet homogeneous freezing' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lnucl_lima ) ) + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'HONR' + tzsource%clongname = 'raindrop homogeneous freezing' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lnucl_lima .and. lrain_lima ) ) + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'SFR' + tzsource%clongname = 'spontaneous freezing' + tzsource%lavailable = hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'DEPS' + tzsource%clongname = 'deposition on snow' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lsnow_lima ) ) ) .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'DEPG' + tzsource%clongname = 'deposition on graupel' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'DEPH' + tzsource%clongname = 'deposition on hail' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. lhail_lima ) ) & + .or. hcloud == 'ICE4' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'IMLT' + tzsource%clongname = 'melting of ice' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima ) ) ) .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'BERFI' + tzsource%clongname = 'Bergeron-Findeisen' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima ) ) ) .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'RIM' + tzsource%clongname = 'riming of cloud water' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'ACC' + tzsource%clongname = 'accretion of rain on aggregates' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit & + .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima .and. lrain_lima ) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'CFRZ' + tzsource%clongname = 'conversion freezing of rain' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'WETG' + tzsource%clongname = 'wet growth of graupel' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'DRYG' + tzsource%clongname = 'dry growth of graupel' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'GMLT' + tzsource%clongname = 'graupel melting' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'WETH' + tzsource%clongname = 'wet growth of hail' + tzsource%lavailable = ( hcloud == 'LIMA' .and. .not.lptsplit .and. lhail_lima .and. lcold_lima & + .and. lwarm_lima .and. lsnow_lima ) & + .or. ( hcloud == 'LIMA' .and. lptsplit ) & + .or. hcloud == 'ICE4' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'DRYH' + tzsource%clongname = 'dry growth of hail' + tzsource%lavailable = hcloud == 'ICE4' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'HMLT' + tzsource%clongname = 'melting of hail' + tzsource%lavailable = ( hcloud == 'LIMA' .and. .not.lptsplit .and. lhail_lima .and. lcold_lima & + .and. lwarm_lima .and. lsnow_lima ) & + .or. ( hcloud == 'LIMA' .and. lptsplit ) & + .or. hcloud == 'ICE4' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'CORR' + tzsource%clongname = 'correction' + tzsource%lavailable = hcloud(1:3) == 'ICE' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'CEDS' + tzsource%clongname = 'adjustment to saturation' + tzsource%lavailable = hcloud == 'LIMA' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'ADJU' + tzsource%clongname = 'adjustment to saturation' + tzsource%lavailable = hcloud(1:3) == 'ICE' .and. lred .and. ladj_before .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'DEPI' + tzsource%clongname = 'deposition on ice' + tzsource%lavailable = ( hcloud(1:3) == 'ICE' .and. ( .not. lred .or. ( lred .and. ladj_after ) .or. celec /= 'NONE') ) & + .or. ( hcloud == 'LIMA' .and. lptsplit ) + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'COND' + tzsource%clongname = 'vapor condensation or cloud water evaporation' + tzsource%lavailable = hcloud == 'C2R2' .or. hcloud == 'KHKO' .or. hcloud == 'KESS' .or. hcloud == 'REVE' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + tzsource%cmnhname = 'NECON' + tzsource%clongname = 'negativity correction induced by condensation' + tzsource%lavailable = ( hcloud == 'KESS' .or. hcloud == 'ICE3' .or. hcloud == 'ICE4' & + .or. hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' ) & + .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_TH), tzsource ) + + + call Sourcelist_sort_compact( tbudgets(NBUDGET_TH) ) + + call Sourcelist_scan( tbudgets(NBUDGET_TH), cbulist_rth ) +end if + +! Budget of RTKE +tbudgets(NBUDGET_TKE)%lenabled = lbu_rtke + +if ( lbu_rtke ) then + tbudgets(NBUDGET_TKE)%trhodj => tburhodj + + !Allocate all basic source terms (used or not) + !The size should be large enough (bigger than necessary is OK) + tbudgets(NBUDGET_TKE)%nsourcesmax = NSOURCESMAX + allocate( tbudgets(NBUDGET_TKE)%tsources(NSOURCESMAX) ) + + allocate( tbudgets(NBUDGET_TKE)%xtmpstore(ibudim1, ibudim2, ibudim3) ) + + tbudgets(NBUDGET_TKE)%tsources(:)%ngroup = 0 + + tzsource%ccomment = 'Budget of turbulent kinetic energy' + tzsource%ngrid = 1 + + tzsource%cunits = 'm2 s-1' + + tzsource%cmnhname = 'INIF' + tzsource%clongname = 'initial state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_TKE), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'ENDF' + tzsource%clongname = 'final state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_TKE), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'AVEF' + tzsource%clongname = 'averaged state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_TKE), tzsource, odonotinit = .true., ooverwrite = .false. ) + + tzsource%cunits = 'm2 s-3' + + tzsource%cmnhname = 'ASSE' + tzsource%clongname = 'time filter (Asselin)' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_TKE), tzsource ) + + tzsource%cmnhname = 'FRC' + tzsource%clongname = 'forcing' + tzsource%lavailable = lforcing + call Budget_source_add( tbudgets(NBUDGET_TKE), tzsource ) + + tzsource%cmnhname = 'DIF' + tzsource%clongname = 'numerical diffusion' + tzsource%lavailable = onumdifth + call Budget_source_add( tbudgets(NBUDGET_TKE), tzsource ) + + tzsource%cmnhname = 'REL' + tzsource%clongname = 'relaxation' + tzsource%lavailable = ohorelax_tke + call Budget_source_add( tbudgets(NBUDGET_TKE), tzsource ) + + tzsource%cmnhname = 'DRAG' + tzsource%clongname = 'drag force' + tzsource%lavailable = odragtree + call Budget_source_add( tbudgets(NBUDGET_TKE), tzsource ) + + tzsource%cmnhname = 'DRAGB' + tzsource%clongname = 'drag force due to buildings' + tzsource%lavailable = ldragbldg + call Budget_source_add( tbudgets(NBUDGET_TKE), tzsource ) + + tzsource%cmnhname = 'DP' + tzsource%clongname = 'dynamic production' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_TKE), tzsource ) + + tzsource%cmnhname = 'TP' + tzsource%clongname = 'thermal production' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_TKE), tzsource ) + + tzsource%cmnhname = 'DISS' + tzsource%clongname = 'dissipation of TKE' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_TKE), tzsource ) + + tzsource%cmnhname = 'TR' + tzsource%clongname = 'turbulent transport' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_TKE), tzsource ) + + tzsource%cmnhname = 'ADV' + tzsource%clongname = 'total advection' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_TKE), tzsource ) + + + call Sourcelist_sort_compact( tbudgets(NBUDGET_TKE) ) + + call Sourcelist_scan( tbudgets(NBUDGET_TKE), cbulist_rtke ) +end if + +! Budget of RRV +tbudgets(NBUDGET_RV)%lenabled = lbu_rrv .and. krr >= 1 + +if ( tbudgets(NBUDGET_RV)%lenabled ) then + tbudgets(NBUDGET_RV)%trhodj => tburhodj + + !Allocate all basic source terms (used or not) + !The size should be large enough (bigger than necessary is OK) + tbudgets(NBUDGET_RV)%nsourcesmax = NSOURCESMAX + allocate( tbudgets(NBUDGET_RV)%tsources(NSOURCESMAX) ) + + allocate( tbudgets(NBUDGET_RV)%xtmpstore(ibudim1, ibudim2, ibudim3) ) + + tbudgets(NBUDGET_RV)%tsources(:)%ngroup = 0 + + tzsource%ccomment = 'Budget of water vapor mixing ratio' + tzsource%ngrid = 1 + + tzsource%cunits = 'kg kg-1' + + tzsource%cmnhname = 'INIF' + tzsource%clongname = 'initial state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'ENDF' + tzsource%clongname = 'final state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'AVEF' + tzsource%clongname = 'averaged state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource, odonotinit = .true., ooverwrite = .false. ) + + tzsource%cunits = 's-1' + + tzsource%cmnhname = 'ASSE' + tzsource%clongname = 'time filter (Asselin)' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'NEST' + tzsource%clongname = 'nesting' + tzsource%lavailable = nmodel > 1 + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'FRC' + tzsource%clongname = 'forcing' + tzsource%lavailable = lforcing + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = '2DADV' + tzsource%clongname = 'advective forcing' + tzsource%lavailable = l2d_adv_frc + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = '2DREL' + tzsource%clongname = 'relaxation forcing' + tzsource%lavailable = l2d_rel_frc + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'NUD' + tzsource%clongname = 'nudging' + tzsource%lavailable = onudging + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'DIF' + tzsource%clongname = 'numerical diffusion' + tzsource%lavailable = onumdifth + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'REL' + tzsource%clongname = 'relaxation' + tzsource%lavailable = ohorelax_rv + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'DCONV' + tzsource%clongname = 'KAFR convection' + tzsource%lavailable = hdconv == 'KAFR' .OR. hsconv == 'KAFR' + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'VTURB' + tzsource%clongname = 'vertical turbulent diffusion' + tzsource%lavailable = hturb == 'TKEL' + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'HTURB' + tzsource%clongname = 'horizontal turbulent diffusion' + tzsource%lavailable = hturb == 'TKEL' .and. HTURBDIM == '3DIM' + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'NETUR' + tzsource%clongname = 'negativity correction induced by turbulence' + tzsource%lavailable = hturb == 'TKEL' .and. ( hcloud == 'KESS' .or. hcloud == 'ICE3' .or. hcloud == 'ICE4' & + .or. hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' ) + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'MAFL' + tzsource%clongname = 'mass flux' + tzsource%lavailable = hsconv == 'EDKF' + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'SNSUB' + tzsource%clongname = 'blowing snow sublimation' + tzsource%lavailable = lblowsnow .and. lsnowsubl + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'VISC' + tzsource%clongname = 'viscosity' + tzsource%lavailable = lvisc .and. lvisc_r + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'ADV' + tzsource%clongname = 'total advection' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'NEADV' + tzsource%clongname = 'negativity correction induced by advection' + tzsource%lavailable = hcloud == 'KESS' .or. hcloud == 'ICE3' .or. hcloud == 'ICE4' & + .or. hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'NEGA' + tzsource%clongname = 'negativity correction' + tzsource%lavailable = hcloud == 'KESS' .or. hcloud == 'ICE3' .or. hcloud == 'ICE4' & + .or. hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'HENU' + tzsource%clongname = 'heterogeneous nucleation' + gtmp = cactccn == 'ABRK' .and. (lorilam .or. ldust .or. lsalt ) + tzsource%lavailable = ( hcloud == 'LIMA' .and. lwarm_lima .and. lacti_lima .and. nmod_ccn >= 1 & + .and. ( .not.lptsplit .or. .not.lsubg_cond ) ) & + .or. ( hcloud == 'C2R2' .and. ( gtmp .or. .not.lsupsat_c2r2 ) ) & + .or. ( hcloud == 'KHKO' .and. ( gtmp .or. .not.lsupsat_c2r2 ) ) + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'REVA' + tzsource%clongname = 'rain evaporation' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( ( .not. lptsplit .and. lwarm_lima .and. lrain_lima ) & + .or. lptsplit ) ) & + .or. ( hcloud(1:3) == 'ICE' .and. lwarm_ice ) & + .or. ( hcloud == 'C2R2' .and. lrain_c2r2 ) & + .or. ( hcloud == 'KHKO' .and. lrain_c2r2 ) & + .or. hcloud == 'KESS' + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'HIN' + tzsource%clongname = 'heterogeneous ice nucleation' + tzsource%lavailable = hcloud(1:3) == 'ICE' .or. ( hcloud == 'LIMA' .and. nmom_i == 1 ) + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'HIND' + tzsource%clongname = 'heterogeneous nucleation by deposition' + tzsource%lavailable = hcloud == 'LIMA' .and. lcold_lima .and. lnucl_lima + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'HONH' + tzsource%clongname = 'haze homogeneous nucleation' + tzsource%lavailable = hcloud == 'LIMA' .and. lcold_lima .and. lnucl_lima .and. lhhoni_lima .and. nmod_ccn >= 1 + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'DEPS' + tzsource%clongname = 'deposition on snow' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lsnow_lima ) ) ) .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'DEPG' + tzsource%clongname = 'deposition on graupel' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'DEPH' + tzsource%clongname = 'deposition on HAIL' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. lhail_lima ) & + .or. hcloud == 'ICE4' ) + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'CEDS' + tzsource%clongname = 'adjustment to saturation' + tzsource%lavailable = hcloud == 'LIMA' + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'ADJU' + tzsource%clongname = 'adjustment to saturation' + tzsource%lavailable = hcloud(1:3) == 'ICE' .and. lred .and. ladj_before .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'COND' + tzsource%clongname = 'vapor condensation or cloud water evaporation' + tzsource%lavailable = hcloud == 'C2R2' .or. hcloud == 'KHKO' .or. hcloud == 'KESS' .or. hcloud == 'REVE' + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'CORR' + tzsource%clongname = 'correction' + tzsource%lavailable = hcloud(1:3) == 'ICE' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'DEPI' + tzsource%clongname = 'deposition on ice' + tzsource%lavailable = ( hcloud(1:3) == 'ICE' .and. ( .not. lred .or. ( lred .and. ladj_after ) .or. celec /= 'NONE') ) & + .or. ( hcloud == 'LIMA' .and. lptsplit ) + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'CORR2' + tzsource%clongname = 'supplementary correction inside LIMA splitting' + tzsource%lavailable = hcloud == 'LIMA' .and. lptsplit + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + tzsource%cmnhname = 'NECON' + tzsource%clongname = 'negativity correction induced by condensation' + tzsource%lavailable = ( hcloud == 'KESS' .or. hcloud == 'ICE3' .or. hcloud == 'ICE4' & + .or. hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' ) & + .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RV), tzsource ) + + + call Sourcelist_sort_compact( tbudgets(NBUDGET_RV) ) + + call Sourcelist_scan( tbudgets(NBUDGET_RV), cbulist_rrv ) +end if + +! Budget of RRC +tbudgets(NBUDGET_RC)%lenabled = lbu_rrc .and. krr >= 2 + +if ( tbudgets(NBUDGET_RC)%lenabled ) then + if ( hcloud(1:3) == 'ICE' .and. lred .and. lsedic_ice .and. ldeposc_ice ) & + call Print_msg( NVERB_WARNING, 'BUD', 'Ini_budget', 'lred=T + lsedic=T + ldeposc=T:'// & + 'DEPO and SEDI source terms are mixed and stored in SEDI' ) + + tbudgets(NBUDGET_RC)%trhodj => tburhodj + + !Allocate all basic source terms (used or not) + !The size should be large enough (bigger than necessary is OK) + tbudgets(NBUDGET_RC)%nsourcesmax = NSOURCESMAX + allocate( tbudgets(NBUDGET_RC)%tsources(NSOURCESMAX) ) + + allocate( tbudgets(NBUDGET_RC)%xtmpstore(ibudim1, ibudim2, ibudim3) ) + + tbudgets(NBUDGET_RC)%tsources(:)%ngroup = 0 + + tzsource%ccomment = 'Budget of cloud water mixing ratio' + tzsource%ngrid = 1 + + tzsource%cunits = 'kg kg-1' + + tzsource%cmnhname = 'INIF' + tzsource%clongname = 'initial state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'ENDF' + tzsource%clongname = 'final state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'AVEF' + tzsource%clongname = 'averaged state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource, odonotinit = .true., ooverwrite = .false. ) + + tzsource%cunits = 's-1' + + tzsource%cmnhname = 'ASSE' + tzsource%clongname = 'time filter (Asselin)' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'NEST' + tzsource%clongname = 'nesting' + tzsource%lavailable = nmodel > 1 + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'FRC' + tzsource%clongname = 'forcing' + tzsource%lavailable = lforcing + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'DIF' + tzsource%clongname = 'numerical diffusion' + tzsource%lavailable = onumdifth + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'REL' + tzsource%clongname = 'relaxation' + tzsource%lavailable = ohorelax_rc + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'DCONV' + tzsource%clongname = 'KAFR convection' + tzsource%lavailable = hdconv == 'KAFR' .OR. hsconv == 'KAFR' + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'DEPOTR' + tzsource%clongname = 'tree droplet deposition' + tzsource%lavailable = odragtree .and. odepotree + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'VTURB' + tzsource%clongname = 'vertical turbulent diffusion' + tzsource%lavailable = hturb == 'TKEL' + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'HTURB' + tzsource%clongname = 'horizontal turbulent diffusion' + tzsource%lavailable = hturb == 'TKEL' .and. HTURBDIM == '3DIM' + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'NETUR' + tzsource%clongname = 'negativity correction induced by turbulence' + tzsource%lavailable = hturb == 'TKEL' .and. ( hcloud == 'KESS' .or. hcloud == 'ICE3' .or. hcloud == 'ICE4' & + .or. hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' ) + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'VISC' + tzsource%clongname = 'viscosity' + tzsource%lavailable = lvisc .and. lvisc_r + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'ADV' + tzsource%clongname = 'total advection' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'NEADV' + tzsource%clongname = 'negativity correction induced by advection' + tzsource%lavailable = hcloud == 'KESS' .or. hcloud == 'ICE3' .or. hcloud == 'ICE4' & + .or. hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'NEGA' + tzsource%clongname = 'negativity correction' + tzsource%lavailable = hcloud == 'KESS' .or. hcloud == 'ICE3' .or. hcloud == 'ICE4' & + .or. hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'CORR' + tzsource%clongname = 'correction' +! tzsource%lavailable = ( hcloud == 'LIMA' .and. lptsplit .and. lwarm_lima .and. lrain_lima ) & +! .or. ( hcloud(1:3) == 'ICE' .and. lred .and. celec == 'NONE' ) + tzsource%lavailable = hcloud(1:3) == 'ICE' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation of cloud' + tzsource%lavailable = ( hcloud == 'LIMA' .and. lwarm_lima .and. lsedc_lima ) & + .or. ( hcloud(1:3) == 'ICE' .and. lsedic_ice ) & + .or. ( hcloud == 'C2R2' .and. lsedc_c2r2 ) & + .or. ( hcloud == 'KHKO' .and. lsedc_c2r2 ) + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'DEPO' + tzsource%clongname = 'surface droplet deposition' + tzsource%lavailable = ( hcloud == 'LIMA' .and. lwarm_lima .and. ldepoc_lima ) & + .or. ( hcloud == 'C2R2' .and. ldepoc_c2r2 ) & + .or. ( hcloud == 'KHKO' .and. ldepoc_c2r2 ) & + .or. ( hcloud(1:3) == 'ICE' .and. ldeposc_ice .and. celec == 'NONE' ) + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'R2C1' + tzsource%clongname = 'rain to cloud change after sedimentation' + tzsource%lavailable = hcloud == 'LIMA' .and. lptsplit .and. lwarm_lima .and. lrain_lima + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'HENU' + tzsource%clongname = 'CCN activation' + gtmp = cactccn == 'ABRK' .and. (lorilam .or. ldust .or. lsalt ) + tzsource%lavailable = ( hcloud == 'LIMA' .and. lwarm_lima .and. lacti_lima .and. nmod_ccn >= 1 & + .and. ( .not.lptsplit .or. .not.lsubg_cond ) ) & + .or. ( hcloud == 'C2R2' .and. ( gtmp .or. .not.lsupsat_c2r2 ) ) & + .or. ( hcloud == 'KHKO' .and. ( gtmp .or. .not.lsupsat_c2r2 ) ) + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'HINC' + tzsource%clongname = 'heterogeneous nucleation by contact' + tzsource%lavailable = hcloud == 'LIMA' .and. lcold_lima .and. lnucl_lima + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'ADJU' + tzsource%clongname = 'adjustment to saturation' + tzsource%lavailable = hcloud(1:3) == 'ICE' .and. lred .and. ladj_before .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'HON' + tzsource%clongname = 'homogeneous nucleation' + tzsource%lavailable = hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'AUTO' + tzsource%clongname = 'autoconversion into rain' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lwarm_lima .and. lrain_lima ) ) ) & + .or. hcloud == 'KESS' & + .or. ( hcloud(1:3) == 'ICE' .and. lwarm_ice ) & + .or. ( hcloud == 'C2R2' .and. lrain_c2r2 ) & + .or. ( hcloud == 'KHKO' .and. lrain_c2r2 ) + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'ACCR' + tzsource%clongname = 'accretion of cloud droplets' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lwarm_lima .and. lrain_lima ) ) ) & + .or. hcloud == 'KESS' & + .or. ( hcloud(1:3) == 'ICE' .and. lwarm_ice ) & + .or. ( hcloud == 'C2R2' .and. lrain_c2r2 ) & + .or. ( hcloud == 'KHKO' .and. lrain_c2r2 ) + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'REVA' + tzsource%clongname = 'rain evaporation' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. ( lwarm_lima .and. lrain_lima ) ) + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'HONC' + tzsource%clongname = 'droplet homogeneous freezing' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lnucl_lima ) ) + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'IMLT' + tzsource%clongname = 'melting of ice' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima ) ) ) .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'BERFI' + tzsource%clongname = 'Bergeron-Findeisen' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. (lcold_lima .and. lwarm_lima) ) ) .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'RIM' + tzsource%clongname = 'riming of cloud water' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'CMEL' + tzsource%clongname = 'collection by snow and conversion into rain with T>XTT on ice' + tzsource%lavailable = hcloud(1:3) == 'ICE' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'WETG' + tzsource%clongname = 'wet growth of graupel' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. (lcold_lima .and. lwarm_lima .and. lsnow_lima) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'DRYG' + tzsource%clongname = 'dry growth of graupel' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. (lcold_lima .and. lwarm_lima .and. lsnow_lima) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'CVRC' + tzsource%clongname = 'rain to cloud change after other microphysical processes' + tzsource%lavailable = hcloud == 'LIMA' .and. lptsplit + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'WETH' + tzsource%clongname = 'wet growth of hail' + tzsource%lavailable = ( hcloud == 'LIMA' .and. .not.lptsplit .and. lhail_lima .and. lcold_lima & + .and. lwarm_lima .and. lsnow_lima ) & + .or. ( hcloud == 'LIMA' .and. lptsplit ) & + .or. hcloud == 'ICE4' + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'DRYH' + tzsource%clongname = 'dry growth of hail' + tzsource%lavailable = hcloud == 'ICE4' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'CEDS' + tzsource%clongname = 'adjustment to saturation' + tzsource%lavailable = hcloud == 'LIMA' + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'DEPI' + tzsource%clongname = 'condensation/deposition on ice' + tzsource%lavailable = hcloud(1:3) == 'ICE' .and. ( .not. lred .or. ( lred .and. ladj_after ) .or. celec /= 'NONE' ) + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'COND' + tzsource%clongname = 'vapor condensation or cloud water evaporation' + tzsource%lavailable = hcloud == 'C2R2' .or. hcloud == 'KHKO' .or. hcloud == 'KESS' .or. hcloud == 'REVE' + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'CORR2' + tzsource%clongname = 'supplementary correction inside LIMA splitting' + tzsource%lavailable = hcloud == 'LIMA' .and. lptsplit + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + tzsource%cmnhname = 'NECON' + tzsource%clongname = 'negativity correction induced by condensation' + tzsource%lavailable = ( hcloud == 'KESS' .or. hcloud == 'ICE3' .or. hcloud == 'ICE4' & + .or. hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' ) & + .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RC), tzsource ) + + + call Sourcelist_sort_compact( tbudgets(NBUDGET_RC) ) + + call Sourcelist_scan( tbudgets(NBUDGET_RC), cbulist_rrc ) +end if + +! Budget of RRR +tbudgets(NBUDGET_RR)%lenabled = lbu_rrr .and. krr >= 3 + +if ( tbudgets(NBUDGET_RR)%lenabled ) then + tbudgets(NBUDGET_RR)%trhodj => tburhodj + + !Allocate all basic source terms (used or not) + !The size should be large enough (bigger than necessary is OK) + tbudgets(NBUDGET_RR)%nsourcesmax = NSOURCESMAX + allocate( tbudgets(NBUDGET_RR)%tsources(NSOURCESMAX) ) + + allocate( tbudgets(NBUDGET_RR)%xtmpstore(ibudim1, ibudim2, ibudim3) ) + + tbudgets(NBUDGET_RR)%tsources(:)%ngroup = 0 + + tzsource%ccomment = 'Budget of rain water mixing ratio' + tzsource%ngrid = 1 + + tzsource%cunits = 'kg kg-1' + + tzsource%cmnhname = 'INIF' + tzsource%clongname = 'initial state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'ENDF' + tzsource%clongname = 'final state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'AVEF' + tzsource%clongname = 'averaged state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource, odonotinit = .true., ooverwrite = .false. ) + + tzsource%cunits = 's-1' + + tzsource%cmnhname = 'ASSE' + tzsource%clongname = 'time filter (Asselin)' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'NEST' + tzsource%clongname = 'nesting' + tzsource%lavailable = nmodel > 1 + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'FRC' + tzsource%clongname = 'forcing' + tzsource%lavailable = lforcing + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'DIF' + tzsource%clongname = 'numerical diffusion' + tzsource%lavailable = onumdifth + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'REL' + tzsource%clongname = 'relaxation' + tzsource%lavailable = ohorelax_rr + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'NETUR' + tzsource%clongname = 'negativity correction induced by turbulence' + tzsource%lavailable = hturb == 'TKEL' .and. ( hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' ) + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'VISC' + tzsource%clongname = 'viscosity' + tzsource%lavailable = lvisc .and. lvisc_r + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'ADV' + tzsource%clongname = 'total advection' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'NEADV' + tzsource%clongname = 'negativity correction induced by advection' + tzsource%lavailable = hcloud == 'KESS' .or. hcloud == 'ICE3' .or. hcloud == 'ICE4' & + .or. hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'NEGA' + tzsource%clongname = 'negativity correction' + tzsource%lavailable = hcloud == 'KESS' .or. hcloud == 'ICE3' .or. hcloud == 'ICE4' & + .or. hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'CORR' + tzsource%clongname = 'correction' +! tzsource%lavailable = ( hcloud == 'LIMA' .and. lptsplit .and. lwarm_lima .and. lrain_lima ) & +! .or. ( hcloud(1:3) == 'ICE' .and. lred .and. celec == 'NONE' ) + tzsource%lavailable = hcloud(1:3) == 'ICE' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation of rain drops' + tzsource%lavailable = ( hcloud == 'LIMA' .and. lwarm_lima .and. lrain_lima ) & + .or. hcloud == 'KESS' & + .or. hcloud(1:3) == 'ICE' & + .or. hcloud == 'C2R2' & + .or. hcloud == 'KHKO' + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'R2C1' + tzsource%clongname = 'rain to cloud change after sedimentation' + tzsource%lavailable = hcloud == 'LIMA' .and. lptsplit .and. lwarm_lima .and. lrain_lima + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'AUTO' + tzsource%clongname = 'autoconversion into rain' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lwarm_lima .and. lrain_lima ) ) ) & + .or. hcloud == 'KESS' & + .or. ( hcloud(1:3) == 'ICE' .and. lwarm_ice ) & + .or. ( hcloud == 'C2R2' .and. lrain_c2r2 ) & + .or. ( hcloud == 'KHKO' .and. lrain_c2r2 ) + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'ACCR' + tzsource%clongname = 'accretion of cloud droplets' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lwarm_lima .and. lrain_lima ) ) ) & + .or. hcloud == 'KESS' & + .or. ( hcloud(1:3) == 'ICE' .and. lwarm_ice ) & + .or. ( hcloud == 'C2R2' .and. lrain_c2r2 ) & + .or. ( hcloud == 'KHKO' .and. lrain_c2r2 ) + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'REVA' + tzsource%clongname = 'rain evaporation' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lwarm_lima .and. lrain_lima ) ) ) & + .or. hcloud == 'KESS' & + .or. ( hcloud(1:3) == 'ICE' .and. lwarm_ice ) & + .or. ( hcloud == 'C2R2' .and. lrain_c2r2 ) & + .or. ( hcloud == 'KHKO' .and. lrain_c2r2 ) + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'HONR' + tzsource%clongname = 'rain homogeneous freezing' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lnucl_lima .and. lrain_lima ) ) + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + + tzsource%cmnhname = 'ACC' + tzsource%clongname = 'accretion of rain on aggregates' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima & + .and. lsnow_lima .and. lrain_lima) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'CMEL' + tzsource%clongname = 'collection of droplets by snow and conversion into rain' + tzsource%lavailable = hcloud(1:3) == 'ICE' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'CFRZ' + tzsource%clongname = 'conversion freezing of rain' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. (lcold_lima .and. lwarm_lima .and. lsnow_lima) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'WETG' + tzsource%clongname = 'wet growth of graupel' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. (lcold_lima .and. lwarm_lima .and. lsnow_lima) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'DRYG' + tzsource%clongname = 'dry growth of graupel' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. (lcold_lima .and. lwarm_lima .and. lsnow_lima) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'GMLT' + tzsource%clongname = 'graupel melting' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. (lcold_lima .and. lwarm_lima .and. lsnow_lima) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'CVRC' + tzsource%clongname = 'rain to cloud change after other microphysical processes' + tzsource%lavailable = hcloud == 'LIMA' .and. lptsplit + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'WETH' + tzsource%clongname = 'wet growth of hail' + tzsource%lavailable = ( hcloud == 'LIMA' .and. .not.lptsplit .and. lhail_lima .and. lcold_lima & + .and. lwarm_lima .and. lsnow_lima ) & + .or. ( hcloud == 'LIMA' .and. lptsplit ) & + .or. hcloud == 'ICE4' + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'DRYH' + tzsource%clongname = 'dry growth of hail' + tzsource%lavailable = hcloud == 'ICE4' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'HMLT' + tzsource%clongname = 'melting of hail' + tzsource%lavailable = ( hcloud == 'LIMA' .and. .not.lptsplit .and. lhail_lima .and. lcold_lima & + .and. lwarm_lima .and. lsnow_lima ) & + .or. ( hcloud == 'LIMA' .and. lptsplit ) & + .or. hcloud == 'ICE4' + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'SFR' + tzsource%clongname = 'spontaneous freezing' + tzsource%lavailable = hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + +!PW: a documenter + tzsource%cmnhname = 'CORR2' + tzsource%clongname = 'supplementary correction inside LIMA splitting' + tzsource%lavailable = hcloud == 'LIMA' .and. lptsplit + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + tzsource%cmnhname = 'NECON' + tzsource%clongname = 'negativity correction induced by condensation' + tzsource%lavailable = ( hcloud == 'KESS' .or. hcloud == 'ICE3' .or. hcloud == 'ICE4' & + .or. hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' ) & + .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RR), tzsource ) + + + call Sourcelist_sort_compact( tbudgets(NBUDGET_RR) ) + + call Sourcelist_scan( tbudgets(NBUDGET_RR), cbulist_rrr ) +end if + +! Budget of RRI +tbudgets(NBUDGET_RI)%lenabled = lbu_rri .and. krr >= 4 + +if ( tbudgets(NBUDGET_RI)%lenabled ) then + tbudgets(NBUDGET_RI)%trhodj => tburhodj + + !Allocate all basic source terms (used or not) + !The size should be large enough (bigger than necessary is OK) + tbudgets(NBUDGET_RI)%nsourcesmax = NSOURCESMAX + allocate( tbudgets(NBUDGET_RI)%tsources(NSOURCESMAX) ) + + allocate( tbudgets(NBUDGET_RI)%xtmpstore(ibudim1, ibudim2, ibudim3) ) + + tbudgets(NBUDGET_RI)%tsources(:)%ngroup = 0 + + tzsource%ccomment = 'Budget of cloud ice mixing ratio' + tzsource%ngrid = 1 + + tzsource%cunits = 'kg kg-1' + + tzsource%cmnhname = 'INIF' + tzsource%clongname = 'initial state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'ENDF' + tzsource%clongname = 'final state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'AVEF' + tzsource%clongname = 'averaged state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource, odonotinit = .true., ooverwrite = .false. ) + + tzsource%cunits = 's-1' + + tzsource%cmnhname = 'ASSE' + tzsource%clongname = 'time filter (Asselin)' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'NEST' + tzsource%clongname = 'nesting' + tzsource%lavailable = nmodel > 1 + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'FRC' + tzsource%clongname = 'forcing' + tzsource%lavailable = lforcing + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'DIF' + tzsource%clongname = 'numerical diffusion' + tzsource%lavailable = onumdifth + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'REL' + tzsource%clongname = 'relaxation' + tzsource%lavailable = ohorelax_ri + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'DCONV' + tzsource%clongname = 'KAFR convection' + tzsource%lavailable = hdconv == 'KAFR' .OR. hsconv == 'KAFR' + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'VTURB' + tzsource%clongname = 'vertical turbulent diffusion' + tzsource%lavailable = hturb == 'TKEL' + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'HTURB' + tzsource%clongname = 'horizontal turbulent diffusion' + tzsource%lavailable = hturb == 'TKEL' .and. HTURBDIM == '3DIM' + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'NETUR' + tzsource%clongname = 'negativity correction induced by turbulence' + tzsource%lavailable = hturb == 'TKEL' .and. ( hcloud == 'ICE3' .or. hcloud == 'ICE4' .or. hcloud == 'LIMA' ) + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'VISC' + tzsource%clongname = 'viscosity' + tzsource%lavailable = lvisc .and. lvisc_r + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'ADV' + tzsource%clongname = 'total advection' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'NEADV' + tzsource%clongname = 'negativity correction induced by advection' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'NEGA' + tzsource%clongname = 'negativity correction' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'CORR' + tzsource%clongname = 'correction' +! tzsource%lavailable = ( hcloud == 'LIMA' .and. lptsplit .and. lcold_lima .and. lsnow_lima ) & +! .or. ( hcloud(1:3) == 'ICE' .and. lred .and. celec == 'NONE' ) + tzsource%lavailable = hcloud(1:3) == 'ICE' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'ADJU' + tzsource%clongname = 'adjustment to saturation' + tzsource%lavailable = hcloud(1:3) == 'ICE' .and. lred .and. ladj_before .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation of rain drops' + tzsource%lavailable = ( hcloud == 'LIMA' .and. lcold_lima .and. lsedi_lima ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'HIN' + tzsource%clongname = 'heterogeneous ice nucleation' + tzsource%lavailable = hcloud(1:3) == 'ICE' .or. ( hcloud == 'LIMA' .and. nmom_i == 1) + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'HIND' + tzsource%clongname = 'heterogeneous nucleation by deposition' + tzsource%lavailable = hcloud == 'LIMA' .and. lcold_lima .and. lnucl_lima + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'HINC' + tzsource%clongname = 'heterogeneous nucleation by contact' + tzsource%lavailable = hcloud == 'LIMA' .and. lcold_lima .and. lnucl_lima + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'HON' + tzsource%clongname = 'homogeneous nucleation' + tzsource%lavailable = hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'HONH' + tzsource%clongname = 'haze homogeneous nucleation' + tzsource%lavailable = hcloud == 'LIMA' .and. lcold_lima .and. lnucl_lima .and. lhhoni_lima .and. nmod_ccn >= 1 + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'HONC' + tzsource%clongname = 'droplet homogeneous freezing' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lnucl_lima ) ) + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'CNVI' + tzsource%clongname = 'conversion of snow to cloud ice' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lsnow_lima ) ) + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'CNVS' + tzsource%clongname = 'conversion of pristine ice to snow' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lsnow_lima ) ) + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'AGGS' + tzsource%clongname = 'aggregation of snow' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lsnow_lima ) ) ) .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'AUTS' + tzsource%clongname = 'autoconversion of ice' + tzsource%lavailable = hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'IMLT' + tzsource%clongname = 'melting of ice' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima ) ) ) .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'BERFI' + tzsource%clongname = 'Bergeron-Findeisen' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima ) ) ) .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'HMS' + tzsource%clongname = 'Hallett-Mossop ice multiplication process due to snow riming' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'CIBU' + tzsource%clongname = 'ice multiplication process due to ice collisional breakup' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima .and. lcibu ) ) + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'CFRZ' + tzsource%clongname = 'conversion freezing of rain' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'RDSF' + tzsource%clongname = 'ice multiplication process following rain contact freezing' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima .and. lrdsf ) ) + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'WETG' + tzsource%clongname = 'wet growth of graupel' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'DRYG' + tzsource%clongname = 'dry growth of graupel' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'HMG' + tzsource%clongname = 'Hallett-Mossop ice multiplication process due to graupel riming' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'WETH' + tzsource%clongname = 'wet growth of hail' + tzsource%lavailable = ( hcloud == 'LIMA' .and. .not.lptsplit .and. lhail_lima .and. lcold_lima & + .and. lwarm_lima .and. lsnow_lima ) & + .or. ( hcloud == 'LIMA' .and. lptsplit ) & + .or. hcloud == 'ICE4' + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'DRYH' + tzsource%clongname = 'dry growth of hail' + tzsource%lavailable = hcloud == 'ICE4' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'CEDS' + tzsource%clongname = 'adjustment to saturation' + tzsource%lavailable = hcloud == 'LIMA' + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'DEPI' + tzsource%clongname = 'condensation/deposition on ice' + tzsource%lavailable = ( hcloud(1:3) == 'ICE' .and. ( .not. lred .or. ( lred .and. ladj_after ) .or. celec /= 'NONE') ) & + .or. ( hcloud == 'LIMA' .and. lptsplit ) + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'CORR2' + tzsource%clongname = 'supplementary correction inside LIMA splitting' + tzsource%lavailable = hcloud == 'LIMA' .and. lptsplit + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + tzsource%cmnhname = 'NECON' + tzsource%clongname = 'negativity correction induced by condensation' + tzsource%lavailable = celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RI), tzsource ) + + + call Sourcelist_sort_compact( tbudgets(NBUDGET_RI) ) + + call Sourcelist_scan( tbudgets(NBUDGET_RI), cbulist_rri ) +end if + +! Budget of RRS +tbudgets(NBUDGET_RS)%lenabled = lbu_rrs .and. krr >= 5 + +if ( tbudgets(NBUDGET_RS)%lenabled ) then + tbudgets(NBUDGET_RS)%trhodj => tburhodj + + !Allocate all basic source terms (used or not) + !The size should be large enough (bigger than necessary is OK) + tbudgets(NBUDGET_RS)%nsourcesmax = NSOURCESMAX + allocate( tbudgets(NBUDGET_RS)%tsources(NSOURCESMAX) ) + + allocate( tbudgets(NBUDGET_RS)%xtmpstore(ibudim1, ibudim2, ibudim3) ) + + tbudgets(NBUDGET_RS)%tsources(:)%ngroup = 0 + + tzsource%ccomment = 'Budget of snow/aggregate mixing ratio' + tzsource%ngrid = 1 + + tzsource%cunits = 'kg kg-1' + + tzsource%cmnhname = 'INIF' + tzsource%clongname = 'initial state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'ENDF' + tzsource%clongname = 'final state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'AVEF' + tzsource%clongname = 'averaged state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource, odonotinit = .true., ooverwrite = .false. ) + + tzsource%cunits = 's-1' + + tzsource%cmnhname = 'ASSE' + tzsource%clongname = 'time filter (Asselin)' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'NEST' + tzsource%clongname = 'nesting' + tzsource%lavailable = nmodel > 1 + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'FRC' + tzsource%clongname = 'forcing' + tzsource%lavailable = lforcing + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'DIF' + tzsource%clongname = 'numerical diffusion' + tzsource%lavailable = onumdifth + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'REL' + tzsource%clongname = 'relaxation' + tzsource%lavailable = ohorelax_rs + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + +! tzsource%cmnhname = 'NETUR' +! tzsource%clongname = 'negativity correction induced by turbulence' +! tzsource%lavailable = hturb == 'TKEL' .and. ( hcloud == 'ICE3' .or. hcloud == 'ICE4' & +! .or. hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' ) +! call Budget_source_add( tbudgets(NBUDGET_RS), tzsource nneturrs ) + + tzsource%cmnhname = 'VISC' + tzsource%clongname = 'viscosity' + tzsource%lavailable = lvisc .and. lvisc_r + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'ADV' + tzsource%clongname = 'total advection' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'NEADV' + tzsource%clongname = 'negativity correction induced by advection' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'NEGA' + tzsource%clongname = 'negativity correction' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'CORR' + tzsource%clongname = 'correction' +! tzsource%lavailable = ( hcloud == 'LIMA' .and. lptsplit .and. lcold_lima .and. lsnow_lima ) & +! .or. ( hcloud(1:3) == 'ICE' .and. lred .and. celec == 'NONE' ) + tzsource%lavailable = hcloud(1:3) == 'ICE' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation' + tzsource%lavailable = ( hcloud == 'LIMA' .and. lcold_lima .and. lsnow_lima ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'CNVI' + tzsource%clongname = 'conversion of snow to cloud ice' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lsnow_lima ) ) + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'DEPS' + tzsource%clongname = 'deposition on snow' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lsnow_lima ) ) ) .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'CNVS' + tzsource%clongname = 'conversion of pristine ice to snow' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lsnow_lima ) ) + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'AGGS' + tzsource%clongname = 'aggregation of snow' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lsnow_lima ) ) ) .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'AUTS' + tzsource%clongname = 'autoconversion of ice' + tzsource%lavailable = hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'RIM' + tzsource%clongname = 'riming of cloud water' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'HMS' + tzsource%clongname = 'Hallett-Mossop ice multiplication process due to snow riming' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. (lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'CIBU' + tzsource%clongname = 'ice multiplication process due to ice collisional breakup' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima .and. lcibu ) ) + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'ACC' + tzsource%clongname = 'accretion of rain on snow' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima & + .and. lsnow_lima .and. lrain_lima) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'CMEL' + tzsource%clongname = 'conversion melting' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'WETG' + tzsource%clongname = 'wet growth of graupel' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'DRYG' + tzsource%clongname = 'dry growth of graupel' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'WETH' + tzsource%clongname = 'wet growth of hail' + tzsource%lavailable = ( hcloud == 'LIMA' .and. .not.lptsplit .and. lhail_lima .and. lcold_lima & + .and. lwarm_lima .and. lsnow_lima ) & + .or. ( hcloud == 'LIMA' .and. lptsplit ) & + .or. hcloud == 'ICE4' + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'DRYH' + tzsource%clongname = 'dry growth of hail' + tzsource%lavailable = hcloud == 'ICE4' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + tzsource%cmnhname = 'NECON' + tzsource%clongname = 'negativity correction induced by condensation' + tzsource%lavailable = celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RS), tzsource ) + + + call Sourcelist_sort_compact( tbudgets(NBUDGET_RS) ) + + call Sourcelist_scan( tbudgets(NBUDGET_RS), cbulist_rrs ) +end if + +! Budget of RRG +tbudgets(NBUDGET_RG)%lenabled = lbu_rrg .and. krr >= 6 + +if ( tbudgets(NBUDGET_RG)%lenabled ) then + tbudgets(NBUDGET_RG)%trhodj => tburhodj + + !Allocate all basic source terms (used or not) + !The size should be large enough (bigger than necessary is OK) + tbudgets(NBUDGET_RG)%nsourcesmax = NSOURCESMAX + allocate( tbudgets(NBUDGET_RG)%tsources(NSOURCESMAX) ) + + allocate( tbudgets(NBUDGET_RG)%xtmpstore(ibudim1, ibudim2, ibudim3) ) + + tbudgets(NBUDGET_RG)%tsources(:)%ngroup = 0 + + tzsource%ccomment = 'Budget of graupel mixing ratio' + tzsource%ngrid = 1 + + tzsource%cunits = 'kg kg-1' + + tzsource%cmnhname = 'INIF' + tzsource%clongname = 'initial state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'ENDF' + tzsource%clongname = 'final state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'AVEF' + tzsource%clongname = 'averaged state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource, odonotinit = .true., ooverwrite = .false. ) + + tzsource%cunits = 's-1' + + tzsource%cmnhname = 'ASSE' + tzsource%clongname = 'time filter (Asselin)' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'NEST' + tzsource%clongname = 'nesting' + tzsource%lavailable = nmodel > 1 + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'FRC' + tzsource%clongname = 'forcing' + tzsource%lavailable = lforcing + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'DIF' + tzsource%clongname = 'numerical diffusion' + tzsource%lavailable = onumdifth + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'REL' + tzsource%clongname = 'relaxation' + tzsource%lavailable = ohorelax_rg + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + +! tzsource%cmnhname = 'NETUR' +! tzsource%clongname = 'negativity correction induced by turbulence' +! tzsource%lavailable = hturb == 'TKEL' .and. ( hcloud == 'ICE3' .or. hcloud == 'ICE4' & +! .or. hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' ) +! call Budget_source_add( tbudgets(NBUDGET_RG), tzsource nneturrg ) + + tzsource%cmnhname = 'VISC' + tzsource%clongname = 'viscosity' + tzsource%lavailable = lvisc .and. lvisc_r + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'ADV' + tzsource%clongname = 'total advection' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'NEADV' + tzsource%clongname = 'negativity correction induced by advection' + tzsource%lavailable = hcloud == 'ICE3' .or. hcloud == 'ICE4' .or. hcloud == 'LIMA' + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'NEGA' + tzsource%clongname = 'negativity correction' + tzsource%lavailable = hcloud == 'ICE3' .or. hcloud == 'ICE4' .or. hcloud == 'LIMA' + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'CORR' + tzsource%clongname = 'correction' + tzsource%lavailable = hcloud(1:3) == 'ICE' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation' + tzsource%lavailable = ( hcloud == 'LIMA' .and. lcold_lima .and. lsnow_lima ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'HONR' + tzsource%clongname = 'rain homogeneous freezing' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lnucl_lima .and. lrain_lima ) ) + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'SFR' + tzsource%clongname = 'spontaneous freezing' + tzsource%lavailable = hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'DEPG' + tzsource%clongname = 'deposition on graupel' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'RIM' + tzsource%clongname = 'riming of cloud water' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'ACC' + tzsource%clongname = 'accretion of rain on graupel' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima & + .and. lsnow_lima .and. lrain_lima) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'CMEL' + tzsource%clongname = 'conversion melting of snow' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. (lcold_lima .and. lwarm_lima .and. lsnow_lima) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'CFRZ' + tzsource%clongname = 'conversion freezing of rain' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. (lcold_lima .and. lwarm_lima .and. lsnow_lima) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'RDSF' + tzsource%clongname = 'ice multiplication process following rain contact freezing' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima .and. lrdsf ) ) + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'WETG' + tzsource%clongname = 'wet growth of graupel' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. (lcold_lima .and. lwarm_lima .and. lsnow_lima) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'GHCV' + tzsource%clongname = 'graupel to hail conversion' + tzsource%lavailable = hcloud == 'ICE4' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'DRYG' + tzsource%clongname = 'dry growth of graupel' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. (lcold_lima .and. lwarm_lima .and. lsnow_lima) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'HMG' + tzsource%clongname = 'Hallett-Mossop ice multiplication process due to graupel riming' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. (lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'GMLT' + tzsource%clongname = 'graupel melting' + tzsource%lavailable = ( hcloud == 'LIMA' .and. ( lptsplit .or. (lcold_lima .and. lwarm_lima .and. lsnow_lima) ) ) & + .or. hcloud(1:3) == 'ICE' + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'WETH' + tzsource%clongname = 'wet growth of hail' + tzsource%lavailable = ( hcloud == 'LIMA' .and. .not.lptsplit .and. lhail_lima .and. lcold_lima & + .and. lwarm_lima .and. lsnow_lima ) & + .or. ( hcloud == 'LIMA' .and. lptsplit ) & + .or. hcloud == 'ICE4' + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'COHG' + tzsource%clongname = 'conversion of hail to graupel' + tzsource%lavailable = hcloud == 'LIMA' .and. (lptsplit .or. (lhail_lima .and. lcold_lima .and. lwarm_lima .and. lsnow_lima) ) + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'HGCV' + tzsource%clongname = 'hail to graupel conversion' + tzsource%lavailable = hcloud == 'ICE4' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'DRYH' + tzsource%clongname = 'dry growth of hail' + tzsource%lavailable = hcloud == 'ICE4' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + tzsource%cmnhname = 'NECON' + tzsource%clongname = 'negativity correction induced by condensation' + tzsource%lavailable = ( hcloud == 'KESS' .or. hcloud == 'ICE3' .or. hcloud == 'ICE4' & + .or. hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' ) & + .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RG), tzsource ) + + + call Sourcelist_sort_compact( tbudgets(NBUDGET_RG) ) + + call Sourcelist_scan( tbudgets(NBUDGET_RG), cbulist_rrg ) +end if + +! Budget of RRH +tbudgets(NBUDGET_RH)%lenabled = lbu_rrh .and. krr >= 7 + +if ( tbudgets(NBUDGET_RH)%lenabled ) then + tbudgets(NBUDGET_RH)%trhodj => tburhodj + + !Allocate all basic source terms (used or not) + !The size should be large enough (bigger than necessary is OK) + tbudgets(NBUDGET_RH)%nsourcesmax = NSOURCESMAX + allocate( tbudgets(NBUDGET_RH)%tsources(NSOURCESMAX) ) + + allocate( tbudgets(NBUDGET_RH)%xtmpstore(ibudim1, ibudim2, ibudim3) ) + + tbudgets(NBUDGET_RH)%tsources(:)%ngroup = 0 + + tzsource%ccomment = 'Budget of hail mixing ratio' + tzsource%ngrid = 1 + + tzsource%cunits = 'kg kg-1' + + tzsource%cmnhname = 'INIF' + tzsource%clongname = 'initial state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'ENDF' + tzsource%clongname = 'final state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'AVEF' + tzsource%clongname = 'averaged state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource, odonotinit = .true., ooverwrite = .false. ) + + tzsource%cunits = 's-1' + + tzsource%cmnhname = 'ASSE' + tzsource%clongname = 'time filter (Asselin)' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + + tzsource%cmnhname = 'NEST' + tzsource%clongname = 'nesting' + tzsource%lavailable = nmodel > 1 + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + + tzsource%cmnhname = 'FRC' + tzsource%clongname = 'forcing' + tzsource%lavailable = lforcing + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + + tzsource%cmnhname = 'DIF' + tzsource%clongname = 'numerical diffusion' + tzsource%lavailable = onumdifth + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + + tzsource%cmnhname = 'REL' + tzsource%clongname = 'relaxation' + tzsource%lavailable = ohorelax_rh + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + +! tzsource%cmnhname = 'NETUR' +! tzsource%clongname = 'negativity correction induced by turbulence' +! tzsource%lavailable = hturb == 'TKEL' .and. ( hcloud == 'ICE3' .or. hcloud == 'ICE4' & +! .or. hcloud == 'KHKO' .or. hcloud == 'C2R2' .or. hcloud == 'LIMA' ) +! call Budget_source_add( tbudgets(NBUDGET_RH), tzsource nneturrh ) + + tzsource%cmnhname = 'VISC' + tzsource%clongname = 'viscosity' + tzsource%lavailable = lvisc .and. lvisc_r + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + + tzsource%cmnhname = 'ADV' + tzsource%clongname = 'total advection' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + + tzsource%cmnhname = 'NEADV' + tzsource%clongname = 'negativity correction induced by advection' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + + tzsource%cmnhname = 'NEGA' + tzsource%clongname = 'negativity correction' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation' + tzsource%lavailable = ( hcloud == 'LIMA' .and. lcold_lima .and. lhail_lima ) & + .or. hcloud == 'ICE4' + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + + tzsource%cmnhname = 'DEPH' + tzsource%clongname = 'deposition on hail' + tzsource%lavailable = ( hcloud == 'LIMA' .and. lhail_lima ) + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + + + tzsource%cmnhname = 'GHCV' + tzsource%clongname = 'graupel to hail conversion' + tzsource%lavailable = hcloud == 'ICE4' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + + tzsource%cmnhname = 'WETG' + tzsource%clongname = 'wet growth of graupel' + tzsource%lavailable = ( hcloud == 'LIMA' .and. lhail_lima & + .and. ( lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) ) ) & + .or. ( hcloud == 'ICE4' .and. ( .not. lred .or. celec /= 'NONE' ) ) + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + + tzsource%cmnhname = 'WETH' + tzsource%clongname = 'wet growth of hail' + tzsource%lavailable = ( hcloud == 'LIMA' .and. .not.lptsplit .and. lhail_lima .and. lcold_lima & + .and. lwarm_lima .and. lsnow_lima ) & + .or. ( hcloud == 'LIMA' .and. lptsplit ) & + .or. hcloud == 'ICE4' + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + + tzsource%cmnhname = 'COHG' + tzsource%clongname = 'conversion from hail to graupel' + tzsource%lavailable = hcloud == 'LIMA' .and. ( lptsplit .or. (lhail_lima .and. lcold_lima & + .and. lwarm_lima .and. lsnow_lima) ) + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + + tzsource%cmnhname = 'HGCV' + tzsource%clongname = 'hail to graupel conversion' + tzsource%lavailable = hcloud == 'ICE4' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + + tzsource%cmnhname = 'DRYH' + tzsource%clongname = 'dry growth of hail' + tzsource%lavailable = hcloud == 'ICE4' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + + tzsource%cmnhname = 'HMLT' + tzsource%clongname = 'melting of hail' + tzsource%lavailable = ( hcloud == 'LIMA' .and. .not. lptsplit .and. lhail_lima .and. lcold_lima & + .and. lwarm_lima .and. lsnow_lima ) & + .or. ( hcloud == 'LIMA' .and. lptsplit ) & + .or. hcloud == 'ICE4' + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + + tzsource%cmnhname = 'CORR' + tzsource%clongname = 'correction' + tzsource%lavailable = hcloud == 'ICE4' .and. lred .and. celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + + tzsource%cmnhname = 'NECON' + tzsource%clongname = 'negativity correction induced by condensation' + tzsource%lavailable = celec == 'NONE' + call Budget_source_add( tbudgets(NBUDGET_RH), tzsource ) + + + call Sourcelist_sort_compact( tbudgets(NBUDGET_RH) ) + + call Sourcelist_scan( tbudgets(NBUDGET_RH), cbulist_rrh ) +end if + +! Budgets of RSV (scalar variables) + +if ( ksv > 999 ) call Print_msg( NVERB_FATAL, 'BUD', 'Ini_budget', 'number of scalar variables > 999' ) + +SV_BUDGETS: do jsv = 1, ksv + ibudget = NBUDGET_SV1 - 1 + jsv + + tbudgets(ibudget)%lenabled = lbu_rsv + + if ( lbu_rsv ) then + tbudgets(ibudget)%trhodj => tburhodj + + !Allocate all basic source terms (used or not) + !The size should be large enough (bigger than necessary is OK) + tbudgets(ibudget)%nsourcesmax = NSOURCESMAX + allocate( tbudgets(ibudget)%tsources(NSOURCESMAX) ) + + allocate( tbudgets(ibudget)%xtmpstore(ibudim1, ibudim2, ibudim3) ) + + tbudgets(ibudget)%tsources(:)%ngroup = 0 + + tzsource%ccomment = 'Budget of scalar variable ' // csvnames(jsv) + tzsource%ngrid = 1 + + tzsource%cunits = '1' + + tzsource%cmnhname = 'INIF' + tzsource%clongname = 'initial state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'ENDF' + tzsource%clongname = 'final state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource, odonotinit = .true., ooverwrite = .true. ) + + tzsource%cmnhname = 'AVEF' + tzsource%clongname = 'averaged state' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource, odonotinit = .true., ooverwrite = .false. ) + + tzsource%cunits = 's-1' + + tzsource%cmnhname = 'ASSE' + tzsource%clongname = 'time filter (Asselin)' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'NEST' + tzsource%clongname = 'nesting' + tzsource%lavailable = nmodel > 1 + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'FRC' + tzsource%clongname = 'forcing' + tzsource%lavailable = lforcing + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DIF' + tzsource%clongname = 'numerical diffusion' + tzsource%lavailable = onumdifsv + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'REL' + tzsource%clongname = 'relaxation' + tzsource%lavailable = ohorelax_sv( jsv ) .or. ( celec /= 'NONE' .and. lrelax2fw_ion & + .and. (jsv == nsv_elecbeg .or. jsv == nsv_elecend ) ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DCONV' + tzsource%clongname = 'KAFR convection' + tzsource%lavailable = ( hdconv == 'KAFR' .or. hsconv == 'KAFR' ) .and. ochtrans + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'VTURB' + tzsource%clongname = 'vertical turbulent diffusion' + tzsource%lavailable = hturb == 'TKEL' + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'HTURB' + tzsource%clongname = 'horizontal turbulent diffusion' + tzsource%lavailable = hturb == 'TKEL' .and. HTURBDIM == '3DIM' + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'MAFL' + tzsource%clongname = 'mass flux' + tzsource%lavailable = hsconv == 'EDKF' + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'VISC' + tzsource%clongname = 'viscosity' + tzsource%lavailable = lvisc .and. lvisc_sv + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'ADV' + tzsource%clongname = 'total advection' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'NEGA2' + tzsource%clongname = 'negativity correction' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + ! Add specific source terms to different scalar variables + SV_VAR: if ( jsv <= nsv_user ) then + ! nsv_user case + ! Nothing to do + + else if ( jsv >= nsv_c2r2beg .and. jsv <= nsv_c2r2end ) then SV_VAR + ! C2R2 or KHKO Case + + ! Source terms in common for all C2R2/KHKO budgets + tzsource%cmnhname = 'NETUR' + tzsource%clongname = 'negativity correction induced by turbulence' + tzsource%lavailable = hturb == 'TKEL' + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'NEADV' + tzsource%clongname = 'negativity correction induced by advection' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'NEGA' + tzsource%clongname = 'negativity correction' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'NECON' + tzsource%clongname = 'negativity correction induced by condensation' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + ! Source terms specific to each budget + SV_C2R2: select case( jsv - nsv_c2r2beg + 1 ) + case ( 1 ) SV_C2R2 + ! Concentration of activated nuclei + tzsource%cmnhname = 'HENU' + tzsource%clongname = 'CCN activation' + gtmp = cactccn == 'ABRK' .and. (lorilam .or. ldust .or. lsalt ) + tzsource%lavailable = gtmp .or. ( .not.gtmp .and. .not.lsupsat_c2r2 ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CEVA' + tzsource%clongname = 'evaporation' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + + case ( 2 ) SV_C2R2 + ! Concentration of cloud droplets + tzsource%cmnhname = 'DEPOTR' + tzsource%clongname = 'tree droplet deposition' + tzsource%lavailable = odragtree .and. odepotree + call Budget_source_add( tbudgets(ibudget), tzsource) + + tzsource%cmnhname = 'HENU' + tzsource%clongname = 'CCN activation' + gtmp = cactccn == 'ABRK' .and. (lorilam .or. ldust .or. lsalt ) + tzsource%lavailable = gtmp .or. ( .not.gtmp .and. .not.lsupsat_c2r2 ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'SELF' + tzsource%clongname = 'self-collection of cloud droplets' + tzsource%lavailable = lrain_c2r2 + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'ACCR' + tzsource%clongname = 'accretion of cloud droplets' + tzsource%lavailable = lrain_c2r2 + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation' + tzsource%lavailable = lsedc_c2r2 + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DEPO' + tzsource%clongname = 'surface droplet deposition' + tzsource%lavailable = ldepoc_c2r2 + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CEVA' + tzsource%clongname = 'evaporation' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + + case ( 3 ) SV_C2R2 + ! Concentration of raindrops + tzsource%cmnhname = 'AUTO' + tzsource%clongname = 'autoconversion into rain' + tzsource%lavailable = lrain_c2r2 + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'SCBU' + tzsource%clongname = 'self collection - coalescence/break-up' + tzsource%lavailable = hcloud /= 'KHKO' + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'REVA' + tzsource%clongname = 'rain evaporation' + tzsource%lavailable = lrain_c2r2 + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'BRKU' + tzsource%clongname = 'spontaneous break-up' + tzsource%lavailable = lrain_c2r2 + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + + case ( 4 ) SV_C2R2 + ! Supersaturation + tzsource%cmnhname = 'CEVA' + tzsource%clongname = 'evaporation' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + end select SV_C2R2 + + + else if ( jsv >= nsv_lima_beg .and. jsv <= nsv_lima_end ) then SV_VAR + ! LIMA case + + ! Source terms in common for all LIMA budgets (except supersaturation) + if ( jsv /= nsv_lima_spro ) then + tzsource%cmnhname = 'NETUR' + tzsource%clongname = 'negativity correction induced by turbulence' + tzsource%lavailable = hturb == 'TKEL' + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'NEADV' + tzsource%clongname = 'negativity correction induced by advection' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'NEGA' + tzsource%clongname = 'negativity correction' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'NECON' + tzsource%clongname = 'negativity correction induced by condensation' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + end if + + + ! Source terms specific to each budget + SV_LIMA: if ( jsv == nsv_lima_nc ) then + ! Cloud droplets concentration + tzsource%cmnhname = 'DEPOTR' + tzsource%clongname = 'tree droplet deposition' + tzsource%lavailable = odragtree .and. odepotree + call Budget_source_add( tbudgets(ibudget), tzsource ) + +! tzsource%cmnhname = 'CORR' +! tzsource%clongname = 'correction' +! tzsource%lavailable = lptsplit .and. lwarm_lima .and. lrain_lima +! call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation' + tzsource%lavailable = lwarm_lima .and. lsedc_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DEPO' + tzsource%clongname = 'surface droplet deposition' + tzsource%lavailable = lwarm_lima .and. ldepoc_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'R2C1' + tzsource%clongname = 'rain to cloud change after sedimentation' + tzsource%lavailable = lptsplit .and. lwarm_lima .and. lrain_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'HENU' + tzsource%clongname = 'CCN activation' + tzsource%lavailable = lwarm_lima .and. lacti_lima .and. nmod_ccn >= 1 .and. ( .not.lptsplit .or. .not.lsubg_cond ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'HINC' + tzsource%clongname = 'heterogeneous nucleation by contact' + tzsource%lavailable = lcold_lima .and. lnucl_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'SELF' + tzsource%clongname = 'self-collection of cloud droplets' + tzsource%lavailable = lptsplit .or. (lwarm_lima .and. lrain_lima) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'AUTO' + tzsource%clongname = 'autoconversion into rain' + tzsource%lavailable = lptsplit .or. ( lwarm_lima .and. lrain_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'ACCR' + tzsource%clongname = 'accretion of cloud droplets' + tzsource%lavailable = lptsplit .or. ( lwarm_lima .and. lrain_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'REVA' + tzsource%clongname = 'rain evaporation' + tzsource%lavailable = lptsplit .or. ( lwarm_lima .and. lrain_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'HONC' + tzsource%clongname = 'droplet homogeneous freezing' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lnucl_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'IMLT' + tzsource%clongname = 'melting of ice' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'RIM' + tzsource%clongname = 'riming of cloud water' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETG' + tzsource%clongname = 'wet growth of graupel' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DRYG' + tzsource%clongname = 'dry growth of graupel' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CVRC' + tzsource%clongname = 'rain to cloud change after other microphysical processes' + tzsource%lavailable = lptsplit + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETH' + tzsource%clongname = 'wet growth of hail' + tzsource%lavailable = lptsplit .or. lhail_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CORR2' + tzsource%clongname = 'supplementary correction inside LIMA splitting' + tzsource%lavailable = lptsplit + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CEDS' + tzsource%clongname = 'adjustment to saturation' + tzsource%lavailable = lwarm_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + + else if ( jsv == nsv_lima_nr ) then SV_LIMA + ! Rain drops concentration +! tzsource%cmnhname = 'CORR' +! tzsource%clongname = 'correction' +! tzsource%lavailable = lptsplit .and. lwarm_lima .and. lrain_lima +! call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation' + tzsource%lavailable = lwarm_lima .and. lrain_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'R2C1' + tzsource%clongname = 'rain to cloud change after sedimentation' + tzsource%lavailable = lptsplit .and. lwarm_lima .and. lrain_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'AUTO' + tzsource%clongname = 'autoconversion into rain' + tzsource%lavailable = lptsplit .or. (lwarm_lima .and. lrain_lima) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'SCBU' + tzsource%clongname = 'self collection - coalescence/break-up' + tzsource%lavailable = lptsplit .or. (lwarm_lima .and. lrain_lima) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'REVA' + tzsource%clongname = 'rain evaporation' + tzsource%lavailable = lptsplit .or. (lwarm_lima .and. lrain_lima) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'BRKU' + tzsource%clongname = 'spontaneous break-up' + tzsource%lavailable = lptsplit .or. (lwarm_lima .and. lrain_lima) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'HONR' + tzsource%clongname = 'rain homogeneous freezing' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lrain_lima .and. lnucl_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'ACC' + tzsource%clongname = 'accretion of rain on aggregates' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima .and. lrain_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CFRZ' + tzsource%clongname = 'conversion freezing of rain' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETG' + tzsource%clongname = 'wet growth of graupel' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DRYG' + tzsource%clongname = 'dry growth of graupel' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'GMLT' + tzsource%clongname = 'graupel melting' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CVRC' + tzsource%clongname = 'rain to cloud change after other microphysical processes' + tzsource%lavailable = lptsplit + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETH' + tzsource%clongname = 'wet growth of hail' + tzsource%lavailable = lptsplit .or. lhail_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'HMLT' + tzsource%clongname = 'melting of hail' + tzsource%lavailable = lptsplit .or. lhail_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CORR2' + tzsource%clongname = 'supplementary correction inside LIMA splitting' + tzsource%lavailable = lptsplit + call Budget_source_add( tbudgets(ibudget), tzsource ) + + + else if ( jsv >= nsv_lima_ccn_free .and. jsv <= nsv_lima_ccn_free + nmod_ccn - 1 ) then SV_LIMA + ! Free CCN concentration + tzsource%cmnhname = 'HENU' + tzsource%clongname = 'CCN activation' + tzsource%lavailable = lwarm_lima .and. lacti_lima .and. nmod_ccn >= 1 .and. ( .not.lptsplit .or. .not.lsubg_cond ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'HONH' + tzsource%clongname = 'haze homogeneous nucleation' + tzsource%lavailable = lcold_lima .and. lnucl_lima .and. lhhoni_lima .and. nmod_ccn >= 1 + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CEDS' + tzsource%clongname = 'adjustment to saturation' + tzsource%lavailable = lwarm_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'SCAV' + tzsource%clongname = 'scavenging' + tzsource%lavailable = lscav_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + + else if ( jsv >= nsv_lima_ccn_acti .and. jsv <= nsv_lima_ccn_acti + nmod_ccn - 1 ) then SV_LIMA + ! Activated CCN concentration + tzsource%cmnhname = 'HENU' + tzsource%clongname = 'CCN activation' + tzsource%lavailable = lwarm_lima .and. lacti_lima .and. nmod_ccn >= 1 .and. ( .not.lptsplit .or. .not.lsubg_cond ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'HINC' + tzsource%clongname = 'heterogeneous nucleation by contact' + tzsource%lavailable = lcold_lima .and. lnucl_lima .and. .not. lmeyers_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CEDS' + tzsource%clongname = 'adjustment to saturation' + tzsource%lavailable = lwarm_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + + else if ( jsv == nsv_lima_scavmass ) then SV_LIMA + ! Scavenged mass variable + tzsource%cmnhname = 'SCAV' + tzsource%clongname = 'scavenging' + tzsource%lavailable = lscav_lima .and. laero_mass_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CEDS' + tzsource%clongname = 'adjustment to saturation' + tzsource%lavailable = lscav_lima .and. laero_mass_lima .and. .not.lspro_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + + else if ( jsv == nsv_lima_ni ) then SV_LIMA + ! Pristine ice crystals concentration +! tzsource%cmnhname = 'CORR' +! tzsource%clongname = 'correction' +! tzsource%lavailable = lptsplit .and. lcold_lima .and. lsnow_lima +! call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation' + tzsource%lavailable = lcold_lima .and. lsedi_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'HIND' + tzsource%clongname = 'heterogeneous nucleation by deposition' + tzsource%lavailable = lcold_lima .and. lnucl_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'HINC' + tzsource%clongname = 'heterogeneous nucleation by contact' + tzsource%lavailable = lcold_lima .and. lnucl_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'HONH' + tzsource%clongname = 'haze homogeneous nucleation' + tzsource%lavailable = lcold_lima .and. lnucl_lima .and. lhhoni_lima .and. nmod_ccn >= 1 + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'HONC' + tzsource%clongname = 'droplet homogeneous freezing' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lnucl_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CNVI' + tzsource%clongname = 'conversion of snow to cloud ice' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CNVS' + tzsource%clongname = 'conversion of pristine ice to snow' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'AGGS' + tzsource%clongname = 'aggregation of snow' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'IMLT' + tzsource%clongname = 'melting of ice' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'HMS' + tzsource%clongname = 'Hallett-Mossop ice multiplication process due to snow riming' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CIBU' + tzsource%clongname = 'ice multiplication process due to ice collisional breakup' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima .and. lcibu ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CFRZ' + tzsource%clongname = 'conversion freezing of rain' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'RDSF' + tzsource%clongname = 'ice multiplication process following rain contact freezing' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima .and. lrdsf ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETG' + tzsource%clongname = 'wet growth of graupel' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DRYG' + tzsource%clongname = 'dry growth of graupel' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'HMG' + tzsource%clongname = 'Hallett-Mossop ice multiplication process due to graupel riming' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETH' + tzsource%clongname = 'wet growth of hail' + tzsource%lavailable = lptsplit .or. lhail_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CEDS' + tzsource%clongname = 'adjustment to saturation' + tzsource%lavailable = lcold_lima .and. .not.lptsplit .and. .not.lspro_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CORR2' + tzsource%clongname = 'supplementary correction inside LIMA splitting' + tzsource%lavailable = lptsplit + call Budget_source_add( tbudgets(ibudget), tzsource ) + + else if ( jsv == nsv_lima_ns ) then SV_LIMA + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation' + tzsource%lavailable = lcold_lima .or. ( lcold_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CNVI' + tzsource%clongname = 'conversion of snow to cloud ice' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CNVS' + tzsource%clongname = 'conversion of pristine ice to snow' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'BRKU' + tzsource%clongname = 'break up of snow' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'RIM' + tzsource%clongname = 'heavy riming of cloud droplet on snow' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'ACC' + tzsource%clongname = 'accretion of rain on snow' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CMEL' + tzsource%clongname = 'conversion melting of snow' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETG' + tzsource%clongname = 'wet growth of graupel' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DRYG' + tzsource%clongname = 'dry growth of graupel' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETH' + tzsource%clongname = 'wet growth of hail' + tzsource%lavailable = lptsplit .or. lhail_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'SSC' + tzsource%clongname = 'snow self collection' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CEDS' + tzsource%clongname = 'adjustment to saturation' + tzsource%lavailable = lcold_lima .and. .not.lptsplit .and. .not.lspro_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + else if ( jsv == nsv_lima_ng ) then SV_LIMA + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation' + tzsource%lavailable = lcold_lima .or. ( lcold_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'RIM' + tzsource%clongname = 'heavy riming of cloud droplet on snow' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'ACC' + tzsource%clongname = 'accretion of rain on snow' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CMEL' + tzsource%clongname = 'conversion melting of snow' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CFRZ' + tzsource%clongname = 'conversion freezing of raindrop' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETG' + tzsource%clongname = 'wet growth of graupel' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'GMLT' + tzsource%clongname = 'graupel melting' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima .and. lsnow_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETH' + tzsource%clongname = 'wet growth of hail' + tzsource%lavailable = lptsplit .or. lhail_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'COHG' + tzsource%clongname = 'conversion hail graupel' + tzsource%lavailable = lptsplit .or. lhail_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CEDS' + tzsource%clongname = 'adjustment to saturation' + tzsource%lavailable = lcold_lima .and. .not.lptsplit .and. .not.lspro_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + else if ( jsv == nsv_lima_nh .and. lhail_lima) then SV_LIMA + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation' + tzsource%lavailable = lcold_lima .or. ( lcold_lima .and. lsnow_lima .and. lhail_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETG' + tzsource%clongname = 'wet growth of graupel' + tzsource%lavailable = lptsplit .or. lhail_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'COHG' + tzsource%clongname = 'conversion hail graupel' + tzsource%lavailable = lptsplit .or. lhail_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'HMLT' + tzsource%clongname = 'hail melting' + tzsource%lavailable = lptsplit .or. lhail_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + else if ( jsv >= nsv_lima_ifn_free .and. jsv <= nsv_lima_ifn_free + nmod_ifn - 1 ) then SV_LIMA + ! Free IFN concentration + tzsource%cmnhname = 'HIND' + tzsource%clongname = 'heterogeneous nucleation by deposition' + tzsource%lavailable = lcold_lima .and. lnucl_lima .and. .not. lmeyers_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CEDS' + tzsource%clongname = 'adjustment to saturation' + tzsource%lavailable = lcold_lima .and. .not.lptsplit .and. .not.lspro_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'SCAV' + tzsource%clongname = 'scavenging' + tzsource%lavailable = lscav_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + + else if ( jsv >= nsv_lima_ifn_nucl .and. jsv <= nsv_lima_ifn_nucl + nmod_ifn - 1 ) then SV_LIMA + ! Nucleated IFN concentration + tzsource%cmnhname = 'HIND' + tzsource%clongname = 'heterogeneous nucleation by deposition' + tzsource%lavailable = lcold_lima .and. lnucl_lima & + .and. ( ( lmeyers_lima .and. jsv == nsv_lima_ifn_nucl ) .or. .not. lmeyers_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'HINC' + tzsource%clongname = 'heterogeneous nucleation by contact' + tzsource%lavailable = lcold_lima .and. lnucl_lima .and. lmeyers_lima .and. jsv == nsv_lima_ifn_nucl + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'IMLT' + tzsource%clongname = 'melting of ice' + tzsource%lavailable = lptsplit .or. ( lcold_lima .and. lwarm_lima ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CEDS' + tzsource%clongname = 'adjustment to saturation' + tzsource%lavailable = lcold_lima .and. .not.lptsplit .and. .not.lspro_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + + else if ( jsv >= nsv_lima_imm_nucl .and. jsv <= nsv_lima_imm_nucl + nmod_imm - 1 ) then SV_LIMA + ! Nucleated IMM concentration + tzsource%cmnhname = 'HINC' + tzsource%clongname = 'heterogeneous nucleation by contact' + tzsource%lavailable = lcold_lima .and. lnucl_lima .and. .not. lmeyers_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CEDS' + tzsource%clongname = 'adjustment to saturation' + tzsource%lavailable = lcold_lima .and. .not.lptsplit .and. .not.lspro_lima + call Budget_source_add( tbudgets(ibudget), tzsource ) + + + else if ( jsv == nsv_lima_hom_haze ) then SV_LIMA + ! Homogeneous freezing of CCN + tzsource%cmnhname = 'HONH' + tzsource%clongname = 'haze homogeneous nucleation' + tzsource%lavailable = lcold_lima .and. lnucl_lima .and. & + ( ( lhhoni_lima .and. nmod_ccn >= 1 ) .or. ( .not.lptsplit .and. lwarm_lima ) ) + call Budget_source_add( tbudgets(ibudget), tzsource ) + + + else if ( jsv == nsv_lima_spro ) then SV_LIMA + ! Supersaturation + tzsource%cmnhname = 'CEDS' + tzsource%clongname = 'adjustment to saturation' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + end if SV_LIMA + + + else if ( jsv >= nsv_elecbeg .and. jsv <= nsv_elecend ) then SV_VAR + ! Electricity case + tzsource%cmnhname = 'NEGA' + tzsource%clongname = 'negativity correction' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + SV_ELEC: select case( jsv - nsv_elecbeg + 1 ) + case ( 1 ) SV_ELEC + ! volumetric charge of water vapor + tzsource%cmnhname = 'DRIFT' + tzsource%clongname = 'ion drift motion' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CORAY' + tzsource%clongname = 'cosmic ray source' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DEPS' + tzsource%clongname = 'deposition on snow' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DEPG' + tzsource%clongname = 'deposition on graupel' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'REVA' + tzsource%clongname = 'rain evaporation' + tzsource%lavailable = lwarm_ice + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DEPI' + tzsource%clongname = 'condensation/deposition on ice' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'NEUT' + tzsource%clongname = 'neutralization' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + + case ( 2 ) SV_ELEC + ! volumetric charge of cloud droplets + tzsource%cmnhname = 'HON' + tzsource%clongname = 'homogeneous nucleation' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'AUTO' + tzsource%clongname = 'autoconversion into rain' + tzsource%lavailable = lwarm_ice + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'ACCR' + tzsource%clongname = 'accretion of cloud droplets' + tzsource%lavailable = lwarm_ice + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'RIM' + tzsource%clongname = 'riming of cloud water' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETG' + tzsource%clongname = 'wet growth of graupel' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DRYG' + tzsource%clongname = 'dry growth of graupel' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'INCG' + tzsource%clongname = 'inductive charge transfer between cloud droplets and graupel' + tzsource%lavailable = linductive + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETH' + tzsource%clongname = 'wet growth of hail' + tzsource%lavailable = hcloud == 'ICE4' + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'IMLT' + tzsource%clongname = 'melting of ice' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'BERFI' + tzsource%clongname = 'Bergeron-Findeisen' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation' + tzsource%lavailable = lsedic_ice + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DEPI' + tzsource%clongname = 'condensation/deposition on ice' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'NEUT' + tzsource%clongname = 'neutralization' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + + case ( 3 ) SV_ELEC + ! volumetric charge of rain drops + tzsource%cmnhname = 'SFR' + tzsource%clongname = 'spontaneous freezing' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'AUTO' + tzsource%clongname = 'autoconversion into rain' + tzsource%lavailable = lwarm_ice + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'ACCR' + tzsource%clongname = 'accretion of cloud droplets' + tzsource%lavailable = lwarm_ice + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'REVA' + tzsource%clongname = 'rain evaporation' + tzsource%lavailable = lwarm_ice + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'ACC' + tzsource%clongname = 'accretion of rain on aggregates' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CFRZ' + tzsource%clongname = 'conversion freezing of rain' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETG' + tzsource%clongname = 'wet growth of graupel' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DRYG' + tzsource%clongname = 'dry growth of graupel' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'GMLT' + tzsource%clongname = 'graupel melting' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETH' + tzsource%clongname = 'wet growth of hail' + tzsource%lavailable = hcloud == 'ICE4' + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'HMLT' + tzsource%clongname = 'melting of hail' + tzsource%lavailable = hcloud == 'ICE4' + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'NEUT' + tzsource%clongname = 'neutralization' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + case ( 4 ) SV_ELEC + ! volumetric charge of ice crystals + tzsource%cmnhname = 'HON' + tzsource%clongname = 'homogeneous nucleation' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'AGGS' + tzsource%clongname = 'aggregation of snow' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'AUTS' + tzsource%clongname = 'autoconversion of ice' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CFRZ' + tzsource%clongname = 'conversion freezing of rain' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETG' + tzsource%clongname = 'wet growth of graupel' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DRYG' + tzsource%clongname = 'dry growth of graupel' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETH' + tzsource%clongname = 'wet growth of hail' + tzsource%lavailable = hcloud == 'ICE4' + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'IMLT' + tzsource%clongname = 'melting of ice' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'BERFI' + tzsource%clongname = 'Bergeron-Findeisen' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'NIIS' + tzsource%clongname = 'non-inductive charge separation due to ice-snow collisions' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DEPI' + tzsource%clongname = 'condensation/deposition on ice' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'NEUT' + tzsource%clongname = 'neutralization' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + + case ( 5 ) SV_ELEC + ! volumetric charge of snow + tzsource%cmnhname = 'DEPS' + tzsource%clongname = 'deposition on snow' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'AGGS' + tzsource%clongname = 'aggregation of snow' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'AUTS' + tzsource%clongname = 'autoconversion of ice' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'RIM' + tzsource%clongname = 'riming of cloud water' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'ACC' + tzsource%clongname = 'accretion of rain on snow' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CMEL' + tzsource%clongname = 'conversion melting' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETG' + tzsource%clongname = 'wet growth of graupel' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DRYG' + tzsource%clongname = 'dry growth of graupel' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'NIIS' + tzsource%clongname = 'non-inductive charge separation due to ice-snow collisions' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETH' + tzsource%clongname = 'wet growth of hail' + tzsource%lavailable = hcloud == 'ICE4' + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'NEUT' + tzsource%clongname = 'neutralization' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + + case ( 6 ) SV_ELEC + ! volumetric charge of graupel + tzsource%cmnhname = 'SFR' + tzsource%clongname = 'spontaneous freezing' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DEPG' + tzsource%clongname = 'deposition on graupel' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'RIM' + tzsource%clongname = 'riming of cloud water' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'ACC' + tzsource%clongname = 'accretion of rain on graupel' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CMEL' + tzsource%clongname = 'conversion melting' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CFRZ' + tzsource%clongname = 'conversion freezing of rain' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETG' + tzsource%clongname = 'wet growth of graupel' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DRYG' + tzsource%clongname = 'dry growth of graupel' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'INCG' + tzsource%clongname = 'inductive charge transfer between cloud droplets and graupel' + tzsource%lavailable = linductive + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'GMLT' + tzsource%clongname = 'graupel melting' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETH' + tzsource%clongname = 'wet growth of hail' + tzsource%lavailable = hcloud == 'ICE4' + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'NEUT' + tzsource%clongname = 'neutralization' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + + case ( 7: ) SV_ELEC + if ( ( hcloud == 'ICE4' .and. ( jsv - nsv_elecbeg + 1 ) == 7 ) ) then + ! volumetric charge of hail + tzsource%cmnhname = 'WETG' + tzsource%clongname = 'wet growth of graupel' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'WETH' + tzsource%clongname = 'wet growth of hail' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'HMLT' + tzsource%clongname = 'melting of hail' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'SEDI' + tzsource%clongname = 'sedimentation' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'NEUT' + tzsource%clongname = 'neutralization' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + else if ( ( hcloud == 'ICE3' .and. ( jsv - nsv_elecbeg + 1 ) == 7 ) & + .or. ( hcloud == 'ICE4' .and. ( jsv - nsv_elecbeg + 1 ) == 8 ) ) then + ! Negative ions (NSV_ELECEND case) + tzsource%cmnhname = 'DRIFT' + tzsource%clongname = 'ion drift motion' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'CORAY' + tzsource%clongname = 'cosmic ray source' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DEPS' + tzsource%clongname = 'deposition on snow' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DEPG' + tzsource%clongname = 'deposition on graupel' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'REVA' + tzsource%clongname = 'rain evaporation' + tzsource%lavailable = lwarm_ice + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'DEPI' + tzsource%clongname = 'condensation/deposition on ice' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'NEUT' + tzsource%clongname = 'neutralization' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + else + call Print_msg( NVERB_FATAL, 'BUD', 'Ini_budget', 'unknown electricity budget' ) + end if + + end select SV_ELEC + + + else if ( jsv >= nsv_lgbeg .and. jsv <= nsv_lgend ) then SV_VAR + !Lagrangian variables + + + else if ( jsv >= nsv_ppbeg .and. jsv <= nsv_ppend ) then SV_VAR + !Passive pollutants + + +#ifdef MNH_FOREFIRE + else if ( jsv >= nsv_ffbeg .and. jsv <= nsv_ffend ) then SV_VAR + !Forefire + +#endif + else if ( jsv >= nsv_csbeg .and. jsv <= nsv_csend ) then SV_VAR + !Conditional sampling + + + else if ( jsv >= nsv_chembeg .and. jsv <= nsv_chemend ) then SV_VAR + !Chemical case + tzsource%cmnhname = 'CHEM' + tzsource%clongname = 'chemistry activity' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'NEGA' + tzsource%clongname = 'negativity correction' + tzsource%lavailable = .true. + call Budget_source_add( tbudgets(ibudget), tzsource ) + + + else if ( jsv >= nsv_chicbeg .and. jsv <= nsv_chicend ) then SV_VAR + !Ice phase chemistry + + + else if ( jsv >= nsv_aerbeg .and. jsv <= nsv_aerend ) then SV_VAR + !Chemical aerosol case + tzsource%cmnhname = 'NEGA' + tzsource%clongname = 'negativity correction' + tzsource%lavailable = lorilam + call Budget_source_add( tbudgets(ibudget), tzsource ) + + else if ( jsv >= nsv_aerdepbeg .and. jsv <= nsv_aerdepend ) then SV_VAR + !Aerosol wet deposition + + else if ( jsv >= nsv_dstbeg .and. jsv <= nsv_dstend ) then SV_VAR + !Dust + + else if ( jsv >= nsv_dstdepbeg .and. jsv <= nsv_dstdepend ) then SV_VAR + !Dust wet deposition + + else if ( jsv >= nsv_sltbeg .and. jsv <= nsv_sltend ) then SV_VAR + !Salt + + else if ( jsv >= nsv_sltdepbeg .and. jsv <= nsv_sltdepend ) then SV_VAR + !Salt wet deposition + + else if ( jsv >= nsv_snwbeg .and. jsv <= nsv_snwend ) then SV_VAR + !Snow + tzsource%cmnhname = 'SNSUB' + tzsource%clongname = 'blowing snow sublimation' + tzsource%lavailable = lblowsnow .and. lsnowsubl + call Budget_source_add( tbudgets(ibudget), tzsource ) + + tzsource%cmnhname = 'SNSED' + tzsource%clongname = 'blowing snow sedimentation' + tzsource%lavailable = lblowsnow + call Budget_source_add( tbudgets(ibudget), tzsource ) + + + else if ( jsv >= nsv_lnoxbeg .and. jsv <= nsv_lnoxend ) then SV_VAR + !LiNOX passive tracer + + else SV_VAR + call Print_msg( NVERB_FATAL, 'BUD', 'Ini_budget', 'unknown scalar variable' ) + end if SV_VAR + + + call Sourcelist_sort_compact( tbudgets(ibudget) ) + + call Sourcelist_scan( tbudgets(ibudget), cbulist_rsv ) + end if +end do SV_BUDGETS + +call Ini_budget_groups( tbudgets, ibudim1, ibudim2, ibudim3 ) + +if ( tbudgets(NBUDGET_U) %lenabled ) call Sourcelist_nml_compact( tbudgets(NBUDGET_U), cbulist_ru ) +if ( tbudgets(NBUDGET_V) %lenabled ) call Sourcelist_nml_compact( tbudgets(NBUDGET_V), cbulist_rv ) +if ( tbudgets(NBUDGET_W) %lenabled ) call Sourcelist_nml_compact( tbudgets(NBUDGET_W), cbulist_rw ) +if ( tbudgets(NBUDGET_TH) %lenabled ) call Sourcelist_nml_compact( tbudgets(NBUDGET_TH), cbulist_rth ) +if ( tbudgets(NBUDGET_TKE)%lenabled ) call Sourcelist_nml_compact( tbudgets(NBUDGET_TKE), cbulist_rtke ) +if ( tbudgets(NBUDGET_RV) %lenabled ) call Sourcelist_nml_compact( tbudgets(NBUDGET_RV), cbulist_rrv ) +if ( tbudgets(NBUDGET_RC) %lenabled ) call Sourcelist_nml_compact( tbudgets(NBUDGET_RC), cbulist_rrc ) +if ( tbudgets(NBUDGET_RR) %lenabled ) call Sourcelist_nml_compact( tbudgets(NBUDGET_RR), cbulist_rrr ) +if ( tbudgets(NBUDGET_RI) %lenabled ) call Sourcelist_nml_compact( tbudgets(NBUDGET_RI), cbulist_rri ) +if ( tbudgets(NBUDGET_RS) %lenabled ) call Sourcelist_nml_compact( tbudgets(NBUDGET_RS), cbulist_rrs ) +if ( tbudgets(NBUDGET_RG) %lenabled ) call Sourcelist_nml_compact( tbudgets(NBUDGET_RG), cbulist_rrg ) +if ( tbudgets(NBUDGET_RH) %lenabled ) call Sourcelist_nml_compact( tbudgets(NBUDGET_RH), cbulist_rrh ) +if ( lbu_rsv ) call Sourcelist_sv_nml_compact( cbulist_rsv ) +end subroutine Ini_budget + + +subroutine Budget_source_add( tpbudget, tpsource, odonotinit, ooverwrite ) + use modd_budget, only: tbudgetdata, tbusourcedata + + type(tbudgetdata), intent(inout) :: tpbudget + type(tbusourcedata), intent(in) :: tpsource ! Metadata basis + logical, optional, intent(in) :: odonotinit + logical, optional, intent(in) :: ooverwrite + + character(len=4) :: ynum + integer :: isourcenumber + + call Print_msg( NVERB_DEBUG, 'BUD', 'Budget_source_add', 'called for ' // Trim( tpbudget%cname ) & + // ': ' // Trim( tpsource%cmnhname ) ) + + isourcenumber = tpbudget%nsources + 1 + if ( isourcenumber > tpbudget%nsourcesmax ) then + Write( ynum, '( i4 )' ) tpbudget%nsourcesmax + cmnhmsg(1) = 'Insufficient max number of source terms (' // Trim(ynum) // ') for budget ' // Trim( tpbudget%cname ) + cmnhmsg(2) = 'Please increaze value of parameter NSOURCESMAX' + call Print_msg( NVERB_FATAL, 'BUD', 'Budget_source_add' ) + else + tpbudget%nsources = tpbudget%nsources + 1 + end if + + ! Copy metadata from provided tpsource + ! Modifications to source term metadata done with the other dummy arguments + tpbudget%tsources(isourcenumber) = tpsource + + if ( present( odonotinit ) ) tpbudget%tsources(isourcenumber)%ldonotinit = odonotinit + + if ( present( ooverwrite ) ) tpbudget%tsources(isourcenumber)%loverwrite = ooverwrite +end subroutine Budget_source_add + + +subroutine Ini_budget_groups( tpbudgets, kbudim1, kbudim2, kbudim3 ) + use modd_budget, only: tbudgetdata + use modd_field, only: TYPEINT, TYPEREAL + use modd_parameters, only: NMNHNAMELGTMAX, NSTDNAMELGTMAX + + use mode_tools, only: Quicksort + + type(tbudgetdata), dimension(:), intent(inout) :: tpbudgets + integer, intent(in) :: kbudim1 + integer, intent(in) :: kbudim2 + integer, intent(in) :: kbudim3 + + character(len=NMNHNAMELGTMAX) :: ymnhname + character(len=NSTDNAMELGTMAX) :: ystdname + character(len=32) :: ylongname + character(len=40) :: yunits + character(len=100) :: ycomment + integer :: ji, jj, jk + integer :: isources ! Number of source terms in a budget + integer :: inbgroups ! Number of budget groups + integer :: ival + integer :: icount + integer :: ivalmax, ivalmin + integer :: igrid + integer :: itype + integer :: idims + integer, dimension(:), allocatable :: igroups ! Temporary array to store sorted group numbers + integer, dimension(:), allocatable :: ipos ! Temporary array to store initial position of group numbers + real :: zval + real :: zvalmax, zvalmin + + call Print_msg( NVERB_DEBUG, 'BUD', 'Ini_budget_groups', 'called' ) + + BUDGETS: do ji = 1, size( tpbudgets ) + ENABLED: if ( tpbudgets(ji)%lenabled ) then + isources = size( tpbudgets(ji)%tsources ) + do jj = 1, isources + ! Check if ngroup is an allowed value + if ( tpbudgets(ji)%tsources(jj)%ngroup < 0 ) then + call Print_msg( NVERB_ERROR, 'BUD', 'Ini_budget', 'negative group value is not allowed' ) + tpbudgets(ji)%tsources(jj)%ngroup = 0 + end if + + if ( tpbudgets(ji)%tsources(jj)%ngroup > 0 ) tpbudgets(ji)%tsources(jj)%lenabled = .true. + end do + + !Count the number of groups of source terms + !ngroup=1 is for individual entries, >1 values are groups + allocate( igroups(isources ) ) + allocate( ipos (isources ) ) + igroups(:) = tpbudgets(ji)%tsources(:)%ngroup + ipos(:) = [ ( jj, jj = 1, isources ) ] + + !Sort the group list number + call Quicksort( igroups, 1, isources, ipos ) + + !Count the number of different groups + !and renumber the entries (from 1 to inbgroups) + inbgroups = 0 + ival = igroups(1) + if ( igroups(1) /= 0 ) then + inbgroups = 1 + igroups(1) = inbgroups + end if + do jj = 2, isources + if ( igroups(jj) == 1 ) then + inbgroups = inbgroups + 1 + igroups(jj) = inbgroups + else if ( igroups(jj) > 0 ) then + if ( igroups(jj) /= ival ) then + ival = igroups(jj) + inbgroups = inbgroups + 1 + end if + igroups(jj) = inbgroups + end if + end do + + !Write the igroups values to the budget structure + do jj = 1, isources + tpbudgets(ji)%tsources(ipos(jj))%ngroup = igroups(jj) + end do + + !Allocate the group structure + populate it + tpbudgets(ji)%ngroups = inbgroups + allocate( tpbudgets(ji)%tgroups(inbgroups) ) + + do jj = 1, inbgroups + !Search the list of sources for each group + !not the most efficient algorithm but do the job + icount = 0 + do jk = 1, isources + if ( tpbudgets(ji)%tsources(jk)%ngroup == jj ) then + icount = icount + 1 + ipos(icount) = jk !ipos is reused as a temporary work array + end if + end do + tpbudgets(ji)%tgroups(jj)%nsources = icount + + allocate( tpbudgets(ji)%tgroups(jj)%nsourcelist(icount) ) + tpbudgets(ji)%tgroups(jj)%nsourcelist(:) = ipos(1 : icount) + + ! Set the name of the field + ymnhname = tpbudgets(ji)%tsources(ipos(1))%cmnhname + do jk = 2, tpbudgets(ji)%tgroups(jj)%nsources + ymnhname = trim( ymnhname ) // '_' // trim( tpbudgets(ji)%tsources(ipos(jk))%cmnhname ) + end do + tpbudgets(ji)%tgroups(jj)%cmnhname = ymnhname + + ! Set the standard name (CF convention) + if ( tpbudgets(ji)%tgroups(jj)%nsources == 1 ) then + ystdname = tpbudgets(ji)%tsources(ipos(1))%cstdname + else + ! The CF standard name is probably wrong if combining several source terms => set to '' + ystdname = '' + end if + tpbudgets(ji)%tgroups(jj)%cstdname = ystdname + + ! Set the long name (CF convention) + ylongname = tpbudgets(ji)%tsources(ipos(1))%clongname + do jk = 2, tpbudgets(ji)%tgroups(jj)%nsources + ylongname = trim( ylongname ) // ' + ' // tpbudgets(ji)%tsources(ipos(jk))%clongname + end do + tpbudgets(ji)%tgroups(jj)%clongname = ylongname + + ! Set the units + yunits = tpbudgets(ji)%tsources(ipos(1))%cunits + do jk = 2, tpbudgets(ji)%tgroups(jj)%nsources + if ( trim( yunits ) /= trim( tpbudgets(ji)%tsources(ipos(jk))%cunits ) ) then + call Print_msg( NVERB_WARNING, 'BUD', 'Ini_budget', & + 'incompatible units for the different source terms of the group ' & + //trim( tpbudgets(ji)%tgroups(jj)%cmnhname ) ) + yunits = 'unknown' + end if + end do + tpbudgets(ji)%tgroups(jj)%cunits = yunits + + ! Set the comment + ! It is composed of the source comment followed by the clongnames of the different sources + ycomment = trim( tpbudgets(ji)%tsources(ipos(1))%ccomment ) // ': '// trim( tpbudgets(ji)%tsources(ipos(1))%clongname ) + do jk = 2, tpbudgets(ji)%tgroups(jj)%nsources + ycomment = trim( ycomment ) // ', ' // trim( tpbudgets(ji)%tsources(ipos(jk))%clongname ) + end do + ycomment = trim( ycomment ) // ' source term' + if ( tpbudgets(ji)%tgroups(jj)%nsources > 1 ) ycomment = trim( ycomment ) // 's' + tpbudgets(ji)%tgroups(jj)%ccomment = ycomment + + ! Set the Arakawa grid + igrid = tpbudgets(ji)%tsources(ipos(1))%ngrid + do jk = 2, tpbudgets(ji)%tgroups(jj)%nsources + if ( igrid /= tpbudgets(ji)%tsources(ipos(jk))%ngrid ) then + call Print_msg( NVERB_WARNING, 'BUD', 'Ini_budget', & + 'different Arakawa grid positions for the different source terms of the group ' & + //trim( tpbudgets(ji)%tgroups(jj)%cmnhname ) ) + end if + end do + tpbudgets(ji)%tgroups(jj)%ngrid = igrid + + ! Set the data type + itype = tpbudgets(ji)%tsources(ipos(1))%ntype + do jk = 2, tpbudgets(ji)%tgroups(jj)%nsources + if ( itype /= tpbudgets(ji)%tsources(ipos(jk))%ntype ) then + call Print_msg( NVERB_FATAL, 'BUD', 'Ini_budget', & + 'incompatible data types for the different source terms of the group ' & + //trim( tpbudgets(ji)%tgroups(jj)%cmnhname ) ) + end if + end do + tpbudgets(ji)%tgroups(jj)%ntype = itype + + ! Set the number of dimensions + idims = tpbudgets(ji)%tsources(ipos(1))%ndims + do jk = 2, tpbudgets(ji)%tgroups(jj)%nsources + if ( idims /= tpbudgets(ji)%tsources(ipos(jk))%ndims ) then + call Print_msg( NVERB_FATAL, 'BUD', 'Ini_budget', & + 'incompatible number of dimensions for the different source terms of the group ' & + //trim( tpbudgets(ji)%tgroups(jj)%cmnhname ) ) + end if + end do + tpbudgets(ji)%tgroups(jj)%ndims = idims + + ! Set the fill values + if ( tpbudgets(ji)%tgroups(jj)%ntype == TYPEINT ) then + ival = tpbudgets(ji)%tsources(ipos(1))%nfillvalue + do jk = 2, tpbudgets(ji)%tgroups(jj)%nsources + if ( ival /= tpbudgets(ji)%tsources(ipos(jk))%nfillvalue ) then + call Print_msg( NVERB_WARNING, 'BUD', 'Ini_budget', & + 'different (integer) fill values for the different source terms of the group ' & + //trim( tpbudgets(ji)%tgroups(jj)%cmnhname ) ) + end if + end do + tpbudgets(ji)%tgroups(jj)%nfillvalue = ival + end if + + if ( tpbudgets(ji)%tgroups(jj)%ntype == TYPEREAL ) then + zval = tpbudgets(ji)%tsources(ipos(1))%xfillvalue + do jk = 2, tpbudgets(ji)%tgroups(jj)%nsources + if ( zval /= tpbudgets(ji)%tsources(ipos(jk))%xfillvalue ) then + call Print_msg( NVERB_WARNING, 'BUD', 'Ini_budget', & + 'different (real) fill values for the different source terms of the group ' & + //trim( tpbudgets(ji)%tgroups(jj)%cmnhname ) ) + end if + end do + tpbudgets(ji)%tgroups(jj)%xfillvalue = zval + end if + + ! Set the valid min/max values + ! Take the min or max of all the sources + ! Maybe, it would be better to take the sum? (if same sign, if not already the maximum allowed value for this type) + if ( tpbudgets(ji)%tgroups(jj)%ntype == TYPEINT ) then + ivalmin = tpbudgets(ji)%tsources(ipos(1))%nvalidmin + ivalmax = tpbudgets(ji)%tsources(ipos(1))%nvalidmax + do jk = 2, tpbudgets(ji)%tgroups(jj)%nsources + ivalmin = min( ivalmin, tpbudgets(ji)%tsources(ipos(jk))%nvalidmin ) + ivalmax = max( ivalmax, tpbudgets(ji)%tsources(ipos(jk))%nvalidmax ) + end do + tpbudgets(ji)%tgroups(jj)%nvalidmin = ivalmin + tpbudgets(ji)%tgroups(jj)%nvalidmax = ivalmax + end if + + if ( tpbudgets(ji)%tgroups(jj)%ntype == TYPEREAL ) then + zvalmin = tpbudgets(ji)%tsources(ipos(1))%xvalidmin + zvalmax = tpbudgets(ji)%tsources(ipos(1))%xvalidmax + do jk = 2, tpbudgets(ji)%tgroups(jj)%nsources + zvalmin = min( zvalmin, tpbudgets(ji)%tsources(ipos(jk))%xvalidmin ) + zvalmax = max( zvalmax, tpbudgets(ji)%tsources(ipos(jk))%xvalidmax ) + end do + tpbudgets(ji)%tgroups(jj)%xvalidmin = zvalmin + tpbudgets(ji)%tgroups(jj)%xvalidmax = zvalmax + end if + + allocate( tpbudgets(ji)%tgroups(jj)%xdata(kbudim1, kbudim2, kbudim3 ) ) + tpbudgets(ji)%tgroups(jj)%xdata(:, :, :) = 0. + end do + + deallocate( igroups ) + deallocate( ipos ) + + !Check that a group does not contain more than 1 source term with ldonotinit=.true. + do jj = 1, inbgroups + if ( tpbudgets(ji)%tgroups(jj)%nsources > 1 ) then + do jk = 1, tpbudgets(ji)%tgroups(jj)%nsources + if ( tpbudgets(ji)%tsources(tpbudgets(ji)%tgroups(jj)%nsourcelist(jk) )%ldonotinit ) & + call Print_msg( NVERB_FATAL, 'BUD', 'Ini_budget', & + 'a group with more than 1 source term may not contain sources with ldonotinit=true' ) + if ( tpbudgets(ji)%tsources(tpbudgets(ji)%tgroups(jj)%nsourcelist(jk) )%loverwrite ) & + call Print_msg( NVERB_FATAL, 'BUD', 'Ini_budget', & + 'a group with more than 1 source term may not contain sources with loverwrite=true' ) + end do + end if + end do + + end if ENABLED + end do BUDGETS + +end subroutine Ini_budget_groups + + +subroutine Sourcelist_sort_compact( tpbudget ) + !Sort the list of sources to put the non-available source terms at the end of the list + !and compact the list + use modd_budget, only: tbudgetdata, tbusourcedata + + type(tbudgetdata), intent(inout) :: tpbudget + + integer :: ji + integer :: isrc_avail, isrc_notavail + type(tbusourcedata), dimension(:), allocatable :: tzsources_avail + type(tbusourcedata), dimension(:), allocatable :: tzsources_notavail + + isrc_avail = 0 + isrc_notavail = 0 + + Allocate( tzsources_avail (tpbudget%nsources) ) + Allocate( tzsources_notavail(tpbudget%nsources) ) + + !Separate source terms available or not during the execution + !(based on the criteria provided to Budget_source_add and stored in lavailable field) + do ji = 1, tpbudget%nsources + if ( tpbudget%tsources(ji)%lavailable ) then + isrc_avail = isrc_avail + 1 + tzsources_avail(isrc_avail) = tpbudget%tsources(ji) + else + isrc_notavail = isrc_notavail + 1 + tzsources_notavail(isrc_notavail) = tpbudget%tsources(ji) + end if + end do + + !Reallocate/compact the source list + if ( Allocated( tpbudget%tsources ) ) Deallocate( tpbudget%tsources ) + Allocate( tpbudget%tsources( tpbudget%nsources ) ) + + tpbudget%nsourcesmax = tpbudget%nsources + !Limit the number of sources to the available list + tpbudget%nsources = isrc_avail + + !Fill the source list beginning with the available sources and finishing with the non-available ones + do ji = 1, isrc_avail + tpbudget%tsources(ji) = tzsources_avail(ji) + end do + + do ji = 1, isrc_notavail + tpbudget%tsources(isrc_avail + ji) = tzsources_notavail(ji) + end do + +end subroutine Sourcelist_sort_compact + + +subroutine Sourcelist_scan( tpbudget, hbulist ) + use modd_budget, only: tbudgetdata + + type(tbudgetdata), intent(inout) :: tpbudget + character(len=*), dimension(:), intent(in) :: hbulist + + character(len=:), allocatable :: yline + character(len=:), allocatable :: ysrc + character(len=:), dimension(:), allocatable :: ymsg + integer :: idx + integer :: igroup + integer :: igroup_idx + integer :: ipos + integer :: istart + integer :: ji + + istart = 1 + + ! Case 'LIST_AVAIL': list all the available source terms + if ( Size( hbulist ) > 0 ) then + if ( Trim( hbulist(1) ) == 'LIST_AVAIL' ) then + Allocate( character(len=65) :: ymsg(tpbudget%nsources + 1) ) + ymsg(1) = '---------------------------------------------------------------------' + ymsg(2) = 'Available source terms for budget ' // Trim( tpbudget%cname ) + Write( ymsg(3), '( A32, " ", A32 )' ) 'Name', 'Long name' + idx = 3 + do ji = 1, tpbudget%nsources + if ( All( tpbudget%tsources(ji)%cmnhname /= [ 'INIF' , 'ENDF', 'AVEF' ] ) ) then + idx = idx + 1 + Write( ymsg(idx), '( A32, " ", A32 )' ) tpbudget%tsources(ji)%cmnhname, tpbudget%tsources(ji)%clongname + end if + end do + ymsg(tpbudget%nsources + 1 ) = '---------------------------------------------------------------------' + call Print_msg_multi( NVERB_WARNING, 'BUD', 'Sourcelist_scan', ymsg ) + !To not read the 1st line again + istart = 2 + end if + end if + + ! Case 'LIST_ALL': list all the source terms + if ( Size( hbulist ) > 0 ) then + if ( Trim( hbulist(1) ) == 'LIST_ALL' ) then + Allocate( character(len=65) :: ymsg(tpbudget%nsourcesmax + 1) ) + ymsg(1) = '---------------------------------------------------------------------' + ymsg(2) = 'Source terms for budget ' // Trim( tpbudget%cname ) + Write( ymsg(3), '( A32, " ", A32 )' ) 'Name', 'Long name' + idx = 3 + do ji = 1, tpbudget%nsourcesmax + if ( All( tpbudget%tsources(ji)%cmnhname /= [ 'INIF' , 'ENDF', 'AVEF' ] ) ) then + idx = idx + 1 + Write( ymsg(idx), '( A32, " ", A32 )' ) tpbudget%tsources(ji)%cmnhname, tpbudget%tsources(ji)%clongname + end if + end do + ymsg(tpbudget%nsourcesmax + 1 ) = '---------------------------------------------------------------------' + call Print_msg_multi( NVERB_WARNING, 'BUD', 'Sourcelist_scan', ymsg ) + !To not read the 1st line again + istart = 2 + end if + end if + + ! Case 'ALL': enable all available source terms + if ( Size( hbulist ) > 0 ) then + if ( Trim( hbulist(1) ) == 'ALL' ) then + do ji = 1, tpbudget%nsources + tpbudget%tsources(ji)%ngroup = 1 + end do + return + end if + end if + + !Always enable INIF, ENDF and AVEF terms + ipos = Source_find( tpbudget, 'INIF' ) + if ( ipos < 1 ) call Print_msg( NVERB_FATAL, 'BUD', 'Sourcelist_scan', 'source term ' // Trim( tpbudget%cname ) & + // ': INIF not found' ) + tpbudget%tsources(ipos)%ngroup = 1 + + ipos = Source_find( tpbudget, 'ENDF' ) + if ( ipos < 1 ) call Print_msg( NVERB_FATAL, 'BUD', 'Sourcelist_scan', 'source term ' // Trim( tpbudget%cname ) & + // ': ENDF not found' ) + tpbudget%tsources(ipos)%ngroup = 1 + + ipos = Source_find( tpbudget, 'AVEF' ) + if ( ipos < 1 ) call Print_msg( NVERB_FATAL, 'BUD', 'Sourcelist_scan', 'source term ' // Trim( tpbudget%cname ) & + // ': AVEF not found' ) + tpbudget%tsources(ipos)%ngroup = 1 + + !igroup_idx start at 2 because 1 is reserved for individually stored source terms + igroup_idx = 2 + + do ji = istart, Size( hbulist ) + if ( Len_trim( hbulist(ji) ) > 0 ) then + ! Scan the line and separate the different sources (separated by + signs) + yline = Trim(hbulist(ji)) + + idx = Index( yline, '+' ) + if ( idx < 1 ) then + igroup = 1 + else + igroup = igroup_idx + igroup_idx = igroup_idx + 1 + end if + + do + idx = Index( yline, '+' ) + if ( idx < 1 ) then + ysrc = yline + else + ysrc = yline(1 : idx - 1) + yline = yline(idx + 1 :) + end if + + !Check if the source is known + if ( Len_trim( ysrc ) > 0 ) then + ipos = Source_find( tpbudget, ysrc ) + + if ( ipos > 0 ) then + call Print_msg( NVERB_DEBUG, 'BUD', 'Sourcelist_scan', 'source term ' // Trim( tpbudget%cname ) & + // ': ' // ysrc // ' found' ) + + if ( .not. tpbudget%tsources(ipos)%lavailable ) then + call Print_msg( NVERB_WARNING, 'BUD', 'Sourcelist_scan', 'source term ' // Trim( tpbudget%cname ) & + // ': ' // ysrc // ' not available' ) + tpbudget%tsources(ipos)%ngroup = 0 + else + tpbudget%tsources(ipos)%ngroup = igroup + end if + else + call Print_msg( NVERB_ERROR, 'BUD', 'Sourcelist_scan', 'source term ' // Trim( tpbudget%cname ) & + // ': ' // ysrc // ' not found' ) + end if + end if + + if ( idx < 1 ) exit + end do + end if + end do +end subroutine Sourcelist_scan + + +subroutine Sourcelist_nml_compact( tpbudget, hbulist ) + !This subroutine reduce the size of the hbulist to the minimum + !The list is generated from the group list + use modd_budget, only: NBULISTMAXLEN, tbudgetdata + + type(tbudgetdata), intent(in) :: tpbudget + character(len=NBULISTMAXLEN), dimension(:), allocatable, intent(inout) :: hbulist + + integer :: idx + integer :: isource + integer :: jg + integer :: js + + if ( Allocated( hbulist ) ) Deallocate( hbulist ) + + if ( tpbudget%ngroups < 3 ) then + call Print_msg( NVERB_ERROR, 'BUD', 'Sourcelist_nml_compact', 'ngroups is too small' ) + return + end if + + Allocate( character(len=NBULISTMAXLEN) :: hbulist(tpbudget%ngroups - 3) ) + hbulist(:) = '' + + idx = 0 + do jg = 1, tpbudget%ngroups + if ( tpbudget%tgroups(jg)%nsources < 1 ) then + call Print_msg( NVERB_ERROR, 'BUD', 'Sourcelist_nml_compact', 'no source for group' ) + cycle + end if + + !Do not put 'INIF', 'ENDF', 'AVEF' in hbulist because their presence is automatic if the corresponding budget is enabled + isource = tpbudget%tgroups(jg)%nsourcelist(1) + if ( Any( tpbudget%tsources(isource)%cmnhname == [ 'INIF', 'ENDF', 'AVEF' ] ) ) cycle + + idx = idx + 1 +#if 0 + !Do not do this way because the group cmnhname may be truncated (NMNHNAMELGTMAX is smaller than NBULISTMAXLEN) + !and the name separator is different ('_') + hbulist(idx) = Trim( tpbudget%tgroups(jg)%cmnhname ) +#else + do js = 1, tpbudget%tgroups(jg)%nsources + isource = tpbudget%tgroups(jg)%nsourcelist(js) + hbulist(idx) = Trim( hbulist(idx) ) // Trim( tpbudget%tsources(isource)%cmnhname ) + if ( js < tpbudget%tgroups(jg)%nsources ) hbulist(idx) = Trim( hbulist(idx) ) // '+' + end do +#endif + end do +end subroutine Sourcelist_nml_compact + + +subroutine Sourcelist_sv_nml_compact( hbulist ) + !This subroutine reduce the size of the hbulist + !For SV variables the reduction is simpler than for other variables + !because it is too complex to do this cleanly (the enabled source terms are different for each scalar variable) + use modd_budget, only: NBULISTMAXLEN, tbudgetdata + + character(len=*), dimension(:), allocatable, intent(inout) :: hbulist + + character(len=NBULISTMAXLEN), dimension(:), allocatable :: ybulist_new + integer :: ilines + integer :: ji + + ilines = 0 + do ji = 1, Size( hbulist ) + if ( Len_trim(hbulist(ji)) > 0 ) ilines = ilines + 1 + end do + + Allocate( ybulist_new(ilines) ) + + ilines = 0 + do ji = 1, Size( hbulist ) + if ( Len_trim(hbulist(ji)) > 0 ) then + ilines = ilines + 1 + ybulist_new(ilines) = Trim( hbulist(ji) ) + end if + end do + + call Move_alloc( from = ybulist_new, to = hbulist ) +end subroutine Sourcelist_sv_nml_compact + + +pure function Source_find( tpbudget, hsource ) result( ipos ) + use modd_budget, only: tbudgetdata + + type(tbudgetdata), intent(in) :: tpbudget + character(len=*), intent(in) :: hsource + integer :: ipos + + integer :: ji + logical :: gfound + + ipos = -1 + gfound = .false. + do ji = 1, tpbudget%nsourcesmax + if ( Trim( hsource ) == Trim ( tpbudget%tsources(ji)%cmnhname ) ) then + gfound = .true. + ipos = ji + exit + end if + end do + +end function Source_find + +end module mode_ini_budget diff --git a/src/mesonh/ext/ini_cturb.f90 b/src/mesonh/ext/ini_cturb.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/mesonh/ext/ini_elecn.f90 b/src/mesonh/ext/ini_elecn.f90 new file mode 100644 index 0000000000000000000000000000000000000000..1795f96f608c147520b0746bb75323aa67ccce91 --- /dev/null +++ b/src/mesonh/ext/ini_elecn.f90 @@ -0,0 +1,327 @@ +!MNH_LIC Copyright 2009-2019 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_INI_ELEC_n +! ###################### +! +INTERFACE + SUBROUTINE INI_ELEC_n (KLUOUT, HELEC, HCLOUD, TPINIFILE, & + PTSTEP, PZZ, & + PDXX, PDYY, PDZZ, PDZX, PDZY ) +! +USE MODD_IO, ONLY : TFILEDATA +! +INTEGER, INTENT(IN) :: KLUOUT ! Logical unit number for prints +CHARACTER (LEN=4), INTENT(IN) :: HELEC ! atmospheric electricity scheme +CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! microphysics scheme +TYPE(TFILEDATA), INTENT(IN) :: TPINIFILE! Initial file +REAL, INTENT(IN) :: PTSTEP ! Time STEP +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! height z +REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX ! metric coefficient dxx +REAL, DIMENSION(:,:,:), INTENT(IN) :: PDYY ! metric coefficient dyy +REAL, DIMENSION(:,:,:), INTENT(IN) :: PDZZ ! metric coefficient dzz +REAL, DIMENSION(:,:,:), INTENT(IN) :: PDZX ! metric coefficient dzx +REAL, DIMENSION(:,:,:), INTENT(IN) :: PDZY ! metric coefficient dzy +! +END SUBROUTINE INI_ELEC_n +END INTERFACE +END MODULE MODI_INI_ELEC_n +! +! ######################################################### + SUBROUTINE INI_ELEC_n(KLUOUT, HELEC, HCLOUD, TPINIFILE, & + PTSTEP, PZZ, & + PDXX, PDYY, PDZZ, PDZX, PDZY ) +! ######################################################### +! +!! PURPOSE +!! ------- +! The purpose of this routine is to initialize the variables +! of the atmospheric electricity scheme +! +!! METHOD +!! ------ +!! The initialization of the scheme is performed as follows : +!! +!! EXTERNAL +!! -------- +!! CLEANLIST_ll : deaalocate a list +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! C. Barthe * Laboratoire de l'Atmosphère et des Cyclones * +!! +!! MODIFICATIONS +!! ------------- +!! Original 09/11/09 +!! M. Chong 13/05/11 Add computation of specific parameters for solving +!! the electric field equation (elements of tri-diag +!! matrix) +!! J.-P. Pinty 13/04/12 Add elec_trid to initialise the tridiagonal syst. +!! J.-P. Pinty 01/07/12 Add a non-homogeneous Neuman fair-weather +!! boundary condition at the top +!! J.-P. Pinty 15/11/13 Initialize the flash maps +!! 10/2016 (C.Lac) Add droplet deposition +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 14/02/2019: remove CLUOUT/CLUOUT0 and associated variables +! P. Wautelet 10/04/2019: replace ABORT and STOP calls by Print_msg +!! +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_CLOUDPAR_n, ONLY : NSPLITR +USE MODD_CONF, ONLY : CEQNSYS,CCONF,CPROGRAM +USE MODD_CONF_n, ONLY : NRR +USE MODD_CST +USE MODD_DIM_n, ONLY : NIMAX_ll, NJMAX_ll +USE MODD_DYN +USE MODD_DYN_n, ONLY : XRHOM, XTRIGSX, XTRIGSY, XAF, XCF, XBFY, XBFB, XDXHATM, & + XDYHATM, NIFAXX, NIFAXY, XBF_SXP2_YP1_Z +USE MODD_ELEC_DESCR +USE MODD_ELEC_FLASH +USE MODD_ELEC_n, ONLY : XRHOM_E, XAF_E, XCF_E, XBFY_E, XBFB_E, XBF_SXP2_YP1_Z_E +USE MODD_GET_n, ONLY : CGETINPRC, CGETINPRR, CGETINPRS, CGETINPRG, CGETINPRH, & + CGETCLOUD, CGETSVT +USE MODD_GRID_n, ONLY : XMAP, XDXHAT, XDYHAT +USE MODD_IO, ONLY : TFILEDATA +USE MODD_LBC_n, ONLY : CLBCX, CLBCY +USE MODD_LUNIT_n, ONLY: TLUOUT +USE MODD_PARAM_C2R2, ONLY : LDEPOC +USE MODD_PARAMETERS, ONLY : JPVEXT, JPHEXT +USE MODD_PARAM_ICE_n, ONLY : LDEPOSC +USE MODD_PRECIP_n, ONLY : XINPRR, XACPRR, XINPRS, XACPRS, XINPRG, XACPRG, & + XINPRH, XACPRH, XINPRC, XACPRC, XINPRR3D, XEVAP3D,& + XINDEP,XACDEP +USE MODD_REF +USE MODD_REF_n, ONLY : XRHODJ, XTHVREF +USE MODD_TIME +! +USE MODD_ARGSLIST_ll, ONLY : LIST_ll +USE MODE_ll +use mode_msg +! +USE MODI_ELEC_TRIDZ +USE MODI_INI_CLOUD +USE MODI_INI_FIELD_ELEC +USE MODI_INI_FLASH_GEOM_ELEC +USE MODI_INI_PARAM_ELEC +USE MODI_INI_RAIN_ICE_ELEC +USE MODI_READ_PRECIP_FIELD +! +! +IMPLICIT NONE +! +!* 0.1 declarations of dummy arguments +! +INTEGER, INTENT(IN) :: KLUOUT ! Logical unit number for prints +CHARACTER (LEN=4), INTENT(IN) :: HELEC ! atmospheric electricity scheme +CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! microphysics scheme +TYPE(TFILEDATA), INTENT(IN) :: TPINIFILE! Initial file +REAL, INTENT(IN) :: PTSTEP ! Time STEP +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! height z +REAL, DIMENSION(:,:,:), INTENT(IN) :: PDXX ! metric coefficient dxx +REAL, DIMENSION(:,:,:), INTENT(IN) :: PDYY ! metric coefficient dyy +REAL, DIMENSION(:,:,:), INTENT(IN) :: PDZZ ! metric coefficient dzz +REAL, DIMENSION(:,:,:), INTENT(IN) :: PDZX ! metric coefficient dzx +REAL, DIMENSION(:,:,:), INTENT(IN) :: PDZY ! metric coefficient dzy +! +!* 0.2 declarations of local variables +! +INTEGER :: ILUOUT ! Logical unit number of output-listing +! +INTEGER :: IIU ! Upper dimension in x direction (local) +INTEGER :: IJU ! Upper dimension in y direction (local) +INTEGER :: IKU ! Upper dimension in z direction +INTEGER :: IKB, IKE +INTEGER :: JK ! Loop vertical index +INTEGER :: IINFO_ll ! Return code of // routines +INTEGER :: IINTVL ! Number of intervals to integrate the kernels +REAL :: ZFDINFTY ! Factor used to define the "infinite" diameter +! +REAL :: ZRHO00 ! Surface reference air density +REAL :: ZDZMIN +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDZ ! mesh size +CHARACTER (LEN=3) :: YEQNSYS +! +! +!------------------------------------------------------------------------------- +! +!* 0. PROLOGUE +! -------- +! +ILUOUT = TLUOUT%NLU +! +CALL GET_DIM_EXT_ll('B',IIU,IJU) +IKU = SIZE(PZZ,3) +! +!------------------------------------------------------------------------------- +! +!* 1. ALLOCATE Module MODD_PRECIP_n +! ----------------------------- +! +IF (HCLOUD(1:3) == 'ICE') THEN + ALLOCATE( XINPRR(IIU,IJU) ) + ALLOCATE( XINPRR3D(IIU,IJU,IKU) ) + ALLOCATE( XEVAP3D(IIU,IJU,IKU) ) + ALLOCATE( XACPRR(IIU,IJU) ) + XINPRR(:,:) = 0.0 + XACPRR(:,:) = 0.0 + XINPRR3D(:,:,:) = 0.0 + XEVAP3D(:,:,:) = 0.0 + ALLOCATE( XINPRC(IIU,IJU) ) + ALLOCATE( XACPRC(IIU,IJU) ) + XINPRC(:,:) = 0.0 + XACPRC(:,:) = 0.0 + ALLOCATE( XINPRS(IIU,IJU) ) + ALLOCATE( XACPRS(IIU,IJU) ) + XINPRS(:,:) = 0.0 + XACPRS(:,:) = 0.0 + ALLOCATE( XINPRG(IIU,IJU) ) + ALLOCATE( XACPRG(IIU,IJU) ) + XINPRG(:,:) = 0.0 + XACPRG(:,:) = 0.0 +END IF +! +IF (HCLOUD == 'ICE4') THEN + ALLOCATE( XINPRH(IIU,IJU) ) + ALLOCATE( XACPRH(IIU,IJU) ) + XINPRH(:,:) = 0.0 + XACPRH(:,:) = 0.0 +ELSE + ALLOCATE( XINPRH(0,0) ) + ALLOCATE( XACPRH(0,0) ) +END IF +! +IF ( LDEPOSC) THEN + ALLOCATE(XINDEP(IIU,IJU)) + ALLOCATE(XACDEP(IIU,IJU)) + XINDEP(:,:)=0.0 + XACDEP(:,:)=0.0 +ELSE + ALLOCATE(XINDEP(0,0)) + ALLOCATE(XACDEP(0,0)) +END IF +! +IF(SIZE(XINPRR) == 0) RETURN +! +! +!------------------------------------------------------------------------------- +! +!* 2. Initialize MODD_PRECIP_n variables +! ----------------------------------- +! +CALL READ_PRECIP_FIELD (TPINIFILE, CPROGRAM, CCONF, & + CGETINPRC,CGETINPRR,CGETINPRS,CGETINPRG,CGETINPRH, & + XINPRC,XACPRC,XINDEP,XACDEP,XINPRR,XINPRR3D,XEVAP3D, & + XACPRR, XINPRS, XACPRS, XINPRG, XACPRG, XINPRH, XACPRH) +! +! +!------------------------------------------------------------------------------- +! +!* 3. INITIALIZE THE PARAMETERS +!* FOR THE MICROPHYSICS AND THE ELECTRICITY +! ---------------------------------------- +! +!* 3.1 Compute the minimun vertical mesh size +! +ALLOCATE( ZDZ(IIU,IJU,IKU) ) +ZDZ(:,:,:) = 0. +! +IKB = 1 + JPVEXT +IKE = SIZE(PZZ,3) - JPVEXT +! +DO JK = IKB, IKE + ZDZ(:,:,JK) = PZZ(:,:,JK+1) - PZZ(:,:,JK) +END DO +ZDZMIN = MIN_ll (ZDZ,IINFO_ll,1,1,IKB,NIMAX_ll+2*JPHEXT,NJMAX_ll+2*JPHEXT,IKE ) +! +DEALLOCATE(ZDZ) +! +! +IF (HELEC(1:3) == 'ELE') THEN +! +! +!* 3.2 initialize the parameters for the mixed-phase microphysics +!* and the electrification +! + CALL INI_RAIN_ICE_ELEC (KLUOUT, PTSTEP, ZDZMIN, NSPLITR, HCLOUD, & + IINTVL, ZFDINFTY) +! +! +!* 3.3 initialize the electrical parameters +! + ZRHO00 = XP00 / (XRD * XTHVREFZ(IKB)) +! + CALL INI_PARAM_ELEC (TPINIFILE, CGETSVT, ZRHO00, NRR, IINTVL, & + ZFDINFTY, IIU, IJU, IKU) +! +! +!* 3.4 initialize the parameters for the electric field +! + IF (LINDUCTIVE .OR. ((.NOT. LOCG) .AND. LELEC_FIELD)) THEN + CALL INI_FIELD_ELEC (PDXX, PDYY, PDZZ, PDZX, PDZY, PZZ) + END IF +! +! +!* 3.5 initialize the parameters for the lightning flashes +! + IF (.NOT. LOCG) THEN + IF (LFLASH_GEOM) THEN + CALL INI_FLASH_GEOM_ELEC + ELSE + call Print_msg( NVERB_FATAL, 'GEN', 'INI_ELEC_n', 'INI_LIGHTNING_ELEC not yet developed' ) + END IF + END IF +! +ELSE IF (HELEC /= 'NONE') THEN + call Print_msg( NVERB_FATAL, 'GEN', 'INI_ELEC_n', 'not yet developed for CELEC='//trim(HELEC) ) +END IF +! +!* 3.6 initialize the parameters for the resolution of the electric field +! +YEQNSYS = CEQNSYS +CEQNSYS = 'LHE' +! Force any CEQNSYS (DUR, MAE, LHE) to LHE to obtain a unique set of coefficients +! for the flat laplacian operator and Return to the original CEQNSYS + +ALLOCATE (XRHOM_E(SIZE(XRHOM))) +ALLOCATE (XAF_E(SIZE(XAF))) +ALLOCATE (XCF_E(SIZE(XCF))) +ALLOCATE (XBFY_E(SIZE(XBFY,1),SIZE(XBFY,2),SIZE(XBFY,3))) +ALLOCATE (XBFB_E(SIZE(XBFB,1),SIZE(XBFB,2),SIZE(XBFB,3))) +ALLOCATE (XBF_SXP2_YP1_Z_E(SIZE(XBF_SXP2_YP1_Z,1),SIZE(XBF_SXP2_YP1_Z,2),& + SIZE(XBF_SXP2_YP1_Z,3))) +! +CALL ELEC_TRIDZ (CLBCX,CLBCY, & + XMAP,XDXHAT,XDYHAT,XDXHATM,XDYHATM,XRHOM_E,XAF_E, & + XCF_E,XTRIGSX,XTRIGSY,NIFAXX,NIFAXY, & + XRHODJ,XTHVREF,PZZ,XBFY_E,XEPOTFW_TOP, & + XBFB_E,XBF_SXP2_YP1_Z_E) +! +CEQNSYS=YEQNSYS +! +!* 3.7 initialize the flash maps +! +ALLOCATE( NMAP_TRIG_IC(IIU,IJU) ); NMAP_TRIG_IC(:,:) = 0 +ALLOCATE( NMAP_IMPACT_CG(IIU,IJU) ); NMAP_IMPACT_CG(:,:) = 0 +ALLOCATE( NMAP_2DAREA_IC(IIU,IJU) ); NMAP_2DAREA_IC(:,:) = 0 +ALLOCATE( NMAP_2DAREA_CG(IIU,IJU) ); NMAP_2DAREA_CG(:,:) = 0 +ALLOCATE( NMAP_3DIC(IIU,IJU,IKU) ); NMAP_3DIC(:,:,:) = 0 +ALLOCATE( NMAP_3DCG(IIU,IJU,IKU) ); NMAP_3DCG(:,:,:) = 0 +! +!------------------------------------------------------------------------------- +! +! +END SUBROUTINE INI_ELEC_n diff --git a/src/mesonh/ext/ini_flash_geom_elec.f90 b/src/mesonh/ext/ini_flash_geom_elec.f90 new file mode 100644 index 0000000000000000000000000000000000000000..3c5faece3492d78a958b5bfe54b815164611abde --- /dev/null +++ b/src/mesonh/ext/ini_flash_geom_elec.f90 @@ -0,0 +1,148 @@ +!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_INI_FLASH_GEOM_ELEC +! ############################### +! +INTERFACE +! + SUBROUTINE INI_FLASH_GEOM_ELEC +! +END SUBROUTINE INI_FLASH_GEOM_ELEC +END INTERFACE +END MODULE MODI_INI_FLASH_GEOM_ELEC +! +! ############################## + SUBROUTINE INI_FLASH_GEOM_ELEC +! ############################## +! +!!**** *INI_FLASH_GEOM_ELEC* - routine to initialize the lightning flashes +!! +!! PURPOSE +!! ------- +! The purpose of this routine is to initialize the variables +! of the lightning flashes routine +! +!!** METHOD +!! ------ +!! The initialization of the scheme is performed as follows : +!! +!! EXTERNAL +!! -------- +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! +!! MODIFICATIONS +!! ------------- +!! Original 29/11/02 +!! +!! Modifications +!! J.-P. Pinty jan 2015 : add LMA simulator +!! J.Escobar 20/06/2018 : truly set NBRANCH_MAX = 5000 ! +!! +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_CST, ONLY : XPI +USE MODD_RAIN_ICE_DESCR_n +USE MODD_ELEC_DESCR +USE MODD_ELEC_PARAM +USE MODD_DIM_n, ONLY : NKMAX +USE MODD_TIME_n, ONLY : TDTCUR +USE MODD_LMA_SIMULATOR, ONLY : LLMA, TDTLMA, LWRITE_LMA, XDTLMA, CLMA_FILE +! +USE MODI_MOMG +! +IMPLICIT NONE +! +!* 0.1 Declaration of dummy arguments +! +! +!* 0.2 Declaration of local variables +! +! +!---------------------------------------------------------------------------- +! +!* 1. SOME CONSTANTS FOR NEUTRALIZATION +! --------------------------------- +! +XFQLIGHTC = 660. * MOMG(3.,3.,2.) / MOMG(3.,3.,3.) ! PI/A*lbda^(b-2) = 660. +! +XFQLIGHTR = XPI * XCCR * MOMG(XALPHAR,XNUR,2.) +XEXQLIGHTR = XCXR - 2. +! +XEXQLIGHTI = 2. / XBI +XFQLIGHTI = XPI / 4. * MOMG(XALPHAI,XNUI,2.) * & + (XAI * MOMG(XALPHAI,XNUI,XBI))**(-XEXQLIGHTI) +! +XFQLIGHTS = XPI * XCCS * MOMG(XALPHAS,XNUS,2.) +XEXQLIGHTS = XCXS - 2. +! +XFQLIGHTG = XPI * XCCG * MOMG(XALPHAG,XNUG,2.) +XEXQLIGHTG = XCXG - 2. +! +! +!---------------------------------------------------------------------------- +! +!* 2. INITIALIZE SOME THRESHOLDS +! -------------------------- +! +! electric field threshold for cell detection +! from Marshall et al. (1995) JGR, the breakeven electric field is +! 200 kV/m at the ground, ~ 33 kV/m at 15 km, and ~ 18 kV/m at 20 km height. +! To be sure all the electrified cells are detected, this threshold is set to +! 20 kV/m +XE_THRESH = 35.E3 ! (V/m) +! +! the maximum of segments in the bi-leader corresponds to the number of +! altitude levels in the domain since the bi-leader is hypothesized to +! propagate only along the vertical +NLEADER_MAX = NKMAX +! +! the maximum number of branches is arbitriraly set to 5000 +NBRANCH_MAX = 5000 +! +! the maximum number of electrified cells in the domain is arbitrarily +! set to 10 +NMAX_CELL = 10 +! +! the altitude for CG to be prolongated to the ground is set to 2 km +! this threshold could be modified once ions will be taken into account +XALT_CG = 2000. ! m +! +! +!---------------------------------------------------------------------------- +! +!* 3. INITIALIZATIONS +! --------------- +! +NNBLIGHT = 0 +NNB_CG = 0 +NNB_CG_POS = 0 +! +! +!---------------------------------------------------------------------------- +! +!* 4. INITIALIZE LMA RECORDS +! ---------------------- +! +! needs LLMA = .TRUE. to operate +XDTLMA = 600. +TDTLMA = TDTCUR +LWRITE_LMA = .FALSE. +CLMA_FILE(1:5) = "BEGIN" +! +!---------------------------------------------------------------------------- +! +END SUBROUTINE INI_FLASH_GEOM_ELEC diff --git a/src/mesonh/ext/ini_lb.f90 b/src/mesonh/ext/ini_lb.f90 new file mode 100644 index 0000000000000000000000000000000000000000..f26f2e48aa8e21bcf1fbd3f74fc8bcb9feeb2138 --- /dev/null +++ b/src/mesonh/ext/ini_lb.f90 @@ -0,0 +1,1664 @@ +!MNH_LIC Copyright 1998-2021 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_INI_LB +! ###################### +! +INTERFACE +! +SUBROUTINE INI_LB(TPINIFILE,OLSOURCE,KSV, & + KSIZELBX_ll,KSIZELBXU_ll,KSIZELBY_ll,KSIZELBYV_ll, & + KSIZELBXTKE_ll,KSIZELBYTKE_ll, & + KSIZELBXR_ll,KSIZELBYR_ll,KSIZELBXSV_ll,KSIZELBYSV_ll, & + HGETTKEM,HGETRVM,HGETRCM,HGETRRM,HGETRIM,HGETRSM, & + HGETRGM,HGETRHM,HGETSVM, & + PLBXUM,PLBXVM,PLBXWM,PLBXTHM,PLBXTKEM,PLBXRM,PLBXSVM, & + PLBYUM,PLBYVM,PLBYWM,PLBYTHM,PLBYTKEM,PLBYRM,PLBYSVM, & + PLBXUMM,PLBXVMM,PLBXWMM,PLBXTHMM,PLBXTKEMM,PLBXRMM,PLBXSVMM, & + PLBYUMM,PLBYVMM,PLBYWMM,PLBYTHMM,PLBYTKEMM,PLBYRMM,PLBYSVMM, & + PLENG ) +! +USE MODD_IO, ONLY: TFILEDATA +! +TYPE(TFILEDATA), INTENT(IN) :: TPINIFILE ! Initial file +LOGICAL, INTENT(IN) :: OLSOURCE ! switch for the source term +! Larger Scale fields (source if OLSOURCE=T, fields at time t-dt if OLSOURCE=F) : +INTEGER, INTENT(IN) :: KSV ! number of passive variables +! sizes of the West-east total LB area +INTEGER, INTENT(IN) :: KSIZELBX_ll,KSIZELBXU_ll ! for T,V,W and u +INTEGER, INTENT(IN) :: KSIZELBXTKE_ll ! for TKE +INTEGER, INTENT(IN) :: KSIZELBXR_ll,KSIZELBXSV_ll ! for Rx and SV +! sizes of the North-south total LB area +INTEGER, INTENT(IN) :: KSIZELBY_ll,KSIZELBYV_ll ! for T,U,W and v +INTEGER, INTENT(IN) :: KSIZELBYTKE_ll ! for TKE +INTEGER, INTENT(IN) :: KSIZELBYR_ll,KSIZELBYSV_ll ! for Rx and SV +! Get indicators +CHARACTER (LEN=*), INTENT(IN) :: HGETTKEM, & + HGETRVM,HGETRCM,HGETRRM, & + HGETRIM,HGETRSM,HGETRGM,HGETRHM +CHARACTER (LEN=*), DIMENSION(:),INTENT(IN) :: HGETSVM +! LB fields (source if OLSOURCE=T, fields at time t-dt if OLSOURCE=F) : +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBXUM,PLBXVM,PLBXWM ! Wind +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBXTHM ! Mass +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBYUM,PLBYVM,PLBYWM ! Wind +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBYTHM ! Mass +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBXTKEM ! TKE +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBYTKEM +REAL, DIMENSION(:,:,:,:), INTENT(OUT) :: PLBXRM ,PLBXSVM ! Moisture and SV +REAL, DIMENSION(:,:,:,:), INTENT(OUT) :: PLBYRM ,PLBYSVM ! in x and y-dir. +! LB arrays at time t-dt (if OLSOURCE=T) : +REAL, DIMENSION(:,:,:), INTENT(IN), OPTIONAL :: PLBXUMM,PLBXVMM,PLBXWMM ! Wind +REAL, DIMENSION(:,:,:),INTENT(IN), OPTIONAL :: PLBXTHMM ! Mass +REAL, DIMENSION(:,:,:),INTENT(IN), OPTIONAL :: PLBYUMM,PLBYVMM,PLBYWMM ! Wind +REAL, DIMENSION(:,:,:),INTENT(IN), OPTIONAL :: PLBYTHMM ! Mass +REAL, DIMENSION(:,:,:),INTENT(IN), OPTIONAL :: PLBXTKEMM ! TKE +REAL, DIMENSION(:,:,:),INTENT(IN), OPTIONAL :: PLBYTKEMM +REAL, DIMENSION(:,:,:,:),INTENT(IN), OPTIONAL :: PLBXRMM ,PLBXSVMM ! Moisture and SV +REAL, DIMENSION(:,:,:,:),INTENT(IN), OPTIONAL :: PLBYRMM ,PLBYSVMM ! in x and y-dir. +REAL, INTENT(IN), OPTIONAL :: PLENG ! Interpolation length +! +END SUBROUTINE INI_LB +! +END INTERFACE +! +END MODULE MODI_INI_LB +! ############################################################ +SUBROUTINE INI_LB(TPINIFILE,OLSOURCE,KSV, & + KSIZELBX_ll,KSIZELBXU_ll,KSIZELBY_ll,KSIZELBYV_ll, & + KSIZELBXTKE_ll,KSIZELBYTKE_ll, & + KSIZELBXR_ll,KSIZELBYR_ll,KSIZELBXSV_ll,KSIZELBYSV_ll, & + HGETTKEM,HGETRVM,HGETRCM,HGETRRM,HGETRIM,HGETRSM, & + HGETRGM,HGETRHM,HGETSVM, & + PLBXUM,PLBXVM,PLBXWM,PLBXTHM,PLBXTKEM,PLBXRM,PLBXSVM, & + PLBYUM,PLBYVM,PLBYWM,PLBYTHM,PLBYTKEM,PLBYRM,PLBYSVM, & + PLBXUMM,PLBXVMM,PLBXWMM,PLBXTHMM,PLBXTKEMM,PLBXRMM,PLBXSVMM, & + PLBYUMM,PLBYVMM,PLBYWMM,PLBYTHMM,PLBYTKEMM,PLBYRMM,PLBYSVMM, & + PLENG ) +! ############################################################ +! +!!**** *INI_LB* - routine to initialize LB fields +!! +!! PURPOSE +!! ------- +! The purpose of this routine is to read the LB fields and to distribute +! on subdomain which have a non-nul intersection with the LB areas. +! In case of OLSOURCE=T, it initializes the LB sources instead of the +! LB fields at time t-dt +! +!!** METHOD +!! ------ +!! The LB fields are read in file and distributed by FMREAD_LB +!! +!! In case of OLSOURCE=T (INI_LB called by INI_CPL or LS_COUPLING), the LB sources +!! are computed +!! +!! +!! EXTERNAL +!! -------- +!! FMREAD : to read data in LFIFM file +!! FMREAD_LB : to read LB data in LFIFM file +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODD_CONF : NVERB +!! +!! REFERENCE +!! --------- +!! Book2 of the documentation (routine INI_LB) +!! +!! +!! AUTHOR +!! ------ +!! V. Ducrocq * Meteo France * +!! D. Gazen L.A. +!! +!! MODIFICATIONS +!! ------------- +!! Original 22/09/98 FMREAD_LB handle LBs fields +!! J. Stein 18/09/99 problem with the dry case +!! D. Gazen 22/01/01 treat NSV_* with floating indices +!! F Gheusi 29/10/03 bug in LB sources for NSV +!! J.-P. Pinty 06/05/04 treat NSV_* for C1R3 and ELEC +!! 20/05/06 Remove KEPS +!! C.Lac 20/03/08 Add passive pollutants +!! M.Leriche 16/07/10 Add ice phase chemical species +!! Pialat/tulet 15/02/12 Add ForeFire scalars +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! M.Leriche 09/02/16 Treat gas and aq. chemicals separately +!! J.Escobar : 27/04/2016 : bug , test only on ANY(HGETSVM({{1:KSV}})=='READ' +!! J.-P. Pinty 09/02/16 Add LIMA that is LBC for CCN and IFN +!! M.Leriche 09/02/16 Treat gas and aq. chemicals separately +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 13/02/2019: initialize PLBXSVM and PLBYSVM in all cases +! P. Wautelet 14/02/2019: move UPCASE function to tools.f90 +!! Bielli S. 02/2019 Sea salt : significant sea wave height influences salt emission; 5 salt modes +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! +USE MODD_CH_AEROSOL +USE MODD_CH_M9_n, ONLY: CNAMES, CICNAMES +USE MODD_TURB_n, ONLY: XTKEMIN +USE MODD_CONF +USE MODD_DUST +USE MODD_ELEC_DESCR, ONLY: CELECNAMES +use modd_field, only: tfielddata, TYPELOG, TYPEREAL +USE MODD_ICE_C1R3_DESCR, ONLY: C1R3NAMES +USE MODD_IO, ONLY: TFILEDATA +USE MODD_LG, ONLY: CLGNAMES +USE MODD_LUNIT_n, ONLY: TLUOUT +USE MODD_NSV +USE MODD_PARAMETERS, ONLY: JPHEXT,NMNHNAMELGTMAX +USE MODD_PARAM_LIMA +USE MODD_PARAM_LIMA_COLD, ONLY: CLIMA_COLD_NAMES +USE MODD_PARAM_LIMA_WARM, ONLY: CLIMA_WARM_NAMES +USE MODD_PARAM_n +USE MODD_RAIN_C2R2_DESCR, ONLY: C2R2NAMES +USE MODD_SALT +! +USE MODE_IO_FIELD_READ, only: IO_Field_read, IO_Field_read_lb +USE MODE_MSG +USE MODE_TOOLS, ONLY: UPCASE +! +IMPLICIT NONE +! +!* 0.1 declarations of arguments +! +! +! +TYPE(TFILEDATA), INTENT(IN) :: TPINIFILE ! Initial file +LOGICAL, INTENT(IN) :: OLSOURCE ! switch for the source term +! Larger Scale fields (source if OLSOURCE=T, fields at time t-dt if OLSOURCE=F) : +INTEGER, INTENT(IN) :: KSV ! number of passive variables +! sizes of the West-east total LB area +INTEGER, INTENT(IN) :: KSIZELBX_ll,KSIZELBXU_ll ! for T,V,W and u +INTEGER, INTENT(IN) :: KSIZELBXTKE_ll ! for TKE +INTEGER, INTENT(IN) :: KSIZELBXR_ll,KSIZELBXSV_ll ! for Rx and SV +! sizes of the North-south total LB area +INTEGER, INTENT(IN) :: KSIZELBY_ll,KSIZELBYV_ll ! for T,U,W and v +INTEGER, INTENT(IN) :: KSIZELBYTKE_ll ! for TKE +INTEGER, INTENT(IN) :: KSIZELBYR_ll,KSIZELBYSV_ll ! for Rx and SV +! Get indicators +CHARACTER (LEN=*), INTENT(IN) :: HGETTKEM, & + HGETRVM,HGETRCM,HGETRRM, & + HGETRIM,HGETRSM,HGETRGM,HGETRHM +CHARACTER (LEN=*), DIMENSION(:),INTENT(IN) :: HGETSVM +! LB fields (source if OLSOURCE=T, fields at time t-dt if OLSOURCE=F) : +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBXUM,PLBXVM,PLBXWM ! Wind +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBXTHM ! Mass +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBYUM,PLBYVM,PLBYWM ! Wind +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBYTHM ! Mass +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBXTKEM ! TKE +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBYTKEM ! +REAL, DIMENSION(:,:,:,:), INTENT(OUT) :: PLBXRM ,PLBXSVM ! Moisture and SV +REAL, DIMENSION(:,:,:,:), INTENT(OUT) :: PLBYRM ,PLBYSVM ! in x and y-dir. +! LB arrays at time t-dt (if OLSOURCE=T) : +REAL, DIMENSION(:,:,:), INTENT(IN), OPTIONAL :: PLBXUMM,PLBXVMM,PLBXWMM ! Wind +REAL, DIMENSION(:,:,:),INTENT(IN), OPTIONAL :: PLBXTHMM ! Mass +REAL, DIMENSION(:,:,:),INTENT(IN), OPTIONAL :: PLBYUMM,PLBYVMM,PLBYWMM ! Wind +REAL, DIMENSION(:,:,:),INTENT(IN), OPTIONAL :: PLBYTHMM ! Mass +REAL, DIMENSION(:,:,:),INTENT(IN), OPTIONAL :: PLBXTKEMM ! TKE +REAL, DIMENSION(:,:,:),INTENT(IN), OPTIONAL :: PLBYTKEMM +REAL, DIMENSION(:,:,:,:),INTENT(IN), OPTIONAL :: PLBXRMM ,PLBXSVMM ! Moisture and SV +REAL, DIMENSION(:,:,:,:),INTENT(IN), OPTIONAL :: PLBYRMM ,PLBYSVMM ! in x and y-dir. +REAL, INTENT(IN), OPTIONAL :: PLENG ! Interpolation length +! +! +!* 0.2 declarations of local variables +! +INTEGER :: ILBSIZEX,ILBSIZEY ! depth of the LB area in the RIM direction + ! written in FM file +INTEGER :: IL3DX,IL3DY ! Size of the LB arrays in FM file + ! in the RIM direction +INTEGER :: IL3DXU,IL3DYV ! Size of the LB arrays in FM file + ! in the RIM direction for the normal wind +INTEGER :: IRIMX,IRIMY ! Total size of the LB area (for the RIM direction) +INTEGER :: IRIMXU,IRIMYV ! Total size of the LB area (for the RIM direction) + ! for the normal wind (spatial gradient needed) + +INTEGER :: JSV,JRR ! Loop index for MOIST AND + ! additional scalar variables +INTEGER :: IRR ! counter for moist variables +INTEGER :: IRESP +INTEGER :: ILUOUT ! Logical unit number associated with TLUOUT +LOGICAL :: GHORELAX_UVWTH ! switch for the horizontal relaxation for U,V,W,TH in the FM file +LOGICAL :: GHORELAX_TKE ! switch for the horizontal relaxation for tke in the FM file +LOGICAL :: GHORELAX_R, GHORELAX_SV ! switch for the horizontal relaxation + ! for moist and scalar variables +CHARACTER (LEN= LEN(HGETRVM)), DIMENSION (7) :: YGETRXM ! Arrays with the get indicators + ! for the moist variables +CHARACTER (LEN=1), DIMENSION (7) :: YC ! array with the prefix of the moist variables +CHARACTER(LEN=2) :: INDICE ! to index CCN and IFN fields of LIMA scheme +TYPE(TFIELDDATA) :: TZFIELD +!------------------------------------------------------------------------------- +! +! +!* 0. READ CPL_AROME to know which LB_fileds there are to read +! -------------------- +IF ((TPINIFILE%NMNHVERSION(1)==4 .AND. TPINIFILE%NMNHVERSION(2)>8) .OR. TPINIFILE%NMNHVERSION(1)>4) THEN + CALL IO_Field_read(TPINIFILE,'CPL_AROME',LCPL_AROME) +ELSE + LCPL_AROME=.FALSE. +ENDIF +! +! +!* 1. SOME INITIALIZATIONS +! -------------------- +! +ILUOUT = TLUOUT%NLU +! +! +!------------------------------------------------------------------------------- +! +!* 2. READ 2D "surfacic" LB fields +! ---------------------------- +! +!* 2.1 read the number of available points for the horizontal relaxation +! for basic variables +CALL IO_Field_read(TPINIFILE,'RIMX',ILBSIZEX) +CALL IO_Field_read(TPINIFILE,'RIMY',ILBSIZEY) +! +!* 2.2 Basic variables +! +CALL IO_Field_read(TPINIFILE,'HORELAX_UVWTH',GHORELAX_UVWTH) + ! +IF (GHORELAX_UVWTH) THEN + IRIMX =(KSIZELBX_ll-2*JPHEXT)/2 + IRIMXU=(KSIZELBXU_ll-2*JPHEXT)/2 + IRIMY =(KSIZELBY_ll-2*JPHEXT)/2 + IRIMYV=(KSIZELBYV_ll-2*JPHEXT)/2 + IL3DX=2*ILBSIZEX+2*JPHEXT + IL3DXU=IL3DX + IL3DY=2*ILBSIZEY+2*JPHEXT + IL3DYV=IL3DY +ELSE + IRIMX=0 + IRIMXU=1 + IRIMY=0 + IRIMYV=1 + IL3DX=2*JPHEXT ! 2 + IL3DY=2*JPHEXT ! 2 + IL3DXU=2 + 2*JPHEXT ! 4 + IL3DYV=2 + 2*JPHEXT ! 4 +ENDIF +! +IF (KSIZELBXU_ll/= 0) THEN + CALL IO_Field_read_lb(TPINIFILE,'LBXUM',IL3DXU,IRIMXU,PLBXUM) +END IF + +IF ( KSIZELBX_ll /= 0) THEN + CALL IO_Field_read_lb(TPINIFILE,'LBXVM',IL3DX,IRIMX,PLBXVM) +ENDIF + +IF ( KSIZELBX_ll /= 0) THEN + CALL IO_Field_read_lb(TPINIFILE,'LBXWM',IL3DX,IRIMX,PLBXWM) +END IF + +IF ( KSIZELBY_ll /= 0) THEN + CALL IO_Field_read_lb(TPINIFILE,'LBYUM',IL3DY,IRIMY,PLBYUM) +END IF + +IF ( KSIZELBYV_ll /= 0) THEN + CALL IO_Field_read_lb(TPINIFILE,'LBYVM',IL3DYV,IRIMYV,PLBYVM) +END IF + +IF (KSIZELBY_ll /= 0) THEN + CALL IO_Field_read_lb(TPINIFILE,'LBYWM',IL3DY,IRIMY,PLBYWM) +END IF + +IF (KSIZELBX_ll /= 0) THEN + CALL IO_Field_read_lb(TPINIFILE,'LBXTHM',IL3DX,IRIMX,PLBXTHM) +END IF + +IF ( KSIZELBY_ll /= 0) THEN + CALL IO_Field_read_lb(TPINIFILE,'LBYTHM',IL3DY,IRIMY,PLBYTHM) +END IF +! +!* 2.3 LB-TKE +! +SELECT CASE(HGETTKEM) +CASE('READ') + IF (.NOT. LCPL_AROME .AND. OLSOURCE) THEN + IF (PRESENT(PLBXTKEMM).AND.PRESENT(PLBYTKEMM)) THEN + WRITE ( ILUOUT,*) 'LBXTKES AND LBYTKES WILL BE INITIALIZED TO 0' + PLBXTKEM(:,:,:) = PLBXTKEMM(:,:,:) + PLBYTKEM(:,:,:) = PLBYTKEMM(:,:,:) + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize LBXTKES and LBYTKES') + ENDIF + ELSE + CALL IO_Field_read(TPINIFILE,'HORELAX_TKE',GHORELAX_TKE) + IF (GHORELAX_TKE) THEN + IRIMX=(KSIZELBXTKE_ll-2*JPHEXT)/2 + IRIMY=(KSIZELBYTKE_ll-2*JPHEXT)/2 + IL3DX=2*ILBSIZEX+2*JPHEXT + IL3DY=2*ILBSIZEY+2*JPHEXT + ELSE + IRIMX=0 + IRIMY=0 + IL3DX=2*JPHEXT ! 2 + IL3DY=2*JPHEXT ! 2 + ENDIF +! + IF (KSIZELBXTKE_ll /= 0) THEN + CALL IO_Field_read_lb(TPINIFILE,'LBXTKEM',IL3DX,IRIMX,PLBXTKEM) + END IF +! + IF (KSIZELBYTKE_ll /= 0) THEN + CALL IO_Field_read_lb(TPINIFILE,'LBYTKEM',IL3DY,IRIMY,PLBYTKEM) + END IF + ENDIF +CASE('INIT') + IF (SIZE(PLBXTKEM,1) /= 0) PLBXTKEM(:,:,:) = XTKEMIN + IF (SIZE(PLBYTKEM,1) /= 0) PLBYTKEM(:,:,:) = XTKEMIN +END SELECT +! +! +!* 2.5 LB-Rx +! +IF(KSIZELBXR_ll > 0 ) THEN + TZFIELD%CMNHNAME = 'HORELAX_R' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'HORELAX_R' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Switch to activate the HOrizontal RELAXation' + TZFIELD%CLBTYPE = 'NONE' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPELOG + TZFIELD%NDIMS = 0 + TZFIELD%LTIMEDEP = .FALSE. + ! + CALL IO_Field_read(TPINIFILE,TZFIELD,GHORELAX_R) + ! + YGETRXM(:)=(/HGETRVM,HGETRCM,HGETRRM,HGETRIM,HGETRSM,HGETRGM,HGETRHM/) + YC(:)=(/"V","C","R","I","S","G","H"/) + IF (GHORELAX_R) THEN + IRIMX=(KSIZELBXR_ll-2*JPHEXT)/2 + IRIMY= (KSIZELBYR_ll-2*JPHEXT)/2 + IL3DX=2*ILBSIZEX+2*JPHEXT + IL3DY=2*ILBSIZEY+2*JPHEXT + ELSE + IRIMX=0 + IRIMY=0 + IL3DX=2*JPHEXT ! 2 + IL3DY=2*JPHEXT ! 2 + END IF + ! + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'kg kg-1' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + IRR=0 + JRR=1 + SELECT CASE(YGETRXM(1)) + CASE('READ') + IRR=IRR+1 + IF ( KSIZELBXR_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBXR'//YC(JRR)//'M' + TZFIELD%CLONGNAME = 'LBXR'//YC(JRR)//'M' + TZFIELD%CLBTYPE = 'LBX' + TZFIELD%CCOMMENT = '2_Y_Z_LBXR'//YC(JRR)//'M' + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXRM(:,:,:,IRR)) + END IF + ! + IF ( KSIZELBYR_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBYR'//YC(JRR)//'M' + TZFIELD%CLONGNAME = 'LBYR'//YC(JRR)//'M' + TZFIELD%CLBTYPE = 'LBY' + TZFIELD%CCOMMENT = '2_Y_Z_LBYR'//YC(JRR)//'M' + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYRM(:,:,:,IRR)) + END IF + CASE('INIT') + IRR=IRR+1 + IF ( SIZE(PLBXRM,1) /= 0 ) PLBXRM(:,:,:,IRR) = 0. + IF ( SIZE(PLBYRM,1) /= 0 ) PLBYRM(:,:,:,IRR) = 0. + END SELECT + ! + ! + DO JRR=2,7 + SELECT CASE(YGETRXM(JRR)) + CASE('READ') + IRR=IRR+1 + IF ( KSIZELBXR_ll /= 0 ) THEN + IF (.NOT. LCPL_AROME .AND. OLSOURCE) THEN + IF (PRESENT(PLBXRMM)) THEN + PLBXRM(:,:,:,IRR)=PLBXRMM(:,:,:,IRR) + WRITE(ILUOUT,*) 'PLBXRS will be initialized to 0 for LBXR'//YC(JRR)//'M' + ELSE + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize PLBXRM for LBXR'//YC(JRR)//'M') + ENDIF + ELSE + TZFIELD%CMNHNAME = 'LBXR'//YC(JRR)//'M' + TZFIELD%CLONGNAME = 'LBXR'//YC(JRR)//'M' + TZFIELD%CLBTYPE = 'LBX' + TZFIELD%CCOMMENT = '2_Y_Z_LBXR'//YC(JRR)//'M' + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXRM(:,:,:,IRR)) + ENDIF + END IF + ! + IF ( KSIZELBYR_ll /= 0 ) THEN + IF (.NOT. LCPL_AROME .AND. OLSOURCE) THEN + IF (PRESENT(PLBYRMM)) THEN + PLBYRM(:,:,:,IRR)=PLBYRMM(:,:,:,IRR) + WRITE(ILUOUT,*) 'PLBYRS will be initialized to 0 for LBYR'//YC(JRR)//'M' + ELSE + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize PLBYRM for LBYR'//YC(JRR)//'M') + ENDIF + ELSE + TZFIELD%CMNHNAME = 'LBYR'//YC(JRR)//'M' + TZFIELD%CLONGNAME = 'LBYR'//YC(JRR)//'M' + TZFIELD%CLBTYPE = 'LBY' + TZFIELD%CCOMMENT = '2_Y_Z_LBYR'//YC(JRR)//'M' + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYRM(:,:,:,IRR)) + ENDIF + END IF + CASE('INIT') + IRR=IRR+1 + IF ( SIZE(PLBXRM,1) /= 0 ) PLBXRM(:,:,:,IRR) = 0. + IF ( SIZE(PLBYRM,1) /= 0 ) PLBYRM(:,:,:,IRR) = 0. + END SELECT + END DO +END IF +! +!* 2.6 LB-Scalar Variables +! +PLBXSVM(:,:,:,:) = 0. +PLBYSVM(:,:,:,:) = 0. +! +IF (KSV > 0) THEN + IF (ANY(HGETSVM(1:KSV)=='READ')) THEN + TZFIELD%CMNHNAME = 'HORELAX_SV' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'HORELAX_SV' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = '' + TZFIELD%CLBTYPE = 'NONE' + TZFIELD%NGRID = 0 + TZFIELD%NTYPE = TYPELOG + TZFIELD%NDIMS = 0 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,GHORELAX_SV) + IF ( GHORELAX_SV ) THEN + IRIMX=(KSIZELBXSV_ll-2*JPHEXT)/2 + IRIMY=(KSIZELBYSV_ll-2*JPHEXT)/2 + IL3DX=2*ILBSIZEX+2*JPHEXT + IL3DY=2*ILBSIZEY+2*JPHEXT + ELSE + IRIMX=0 + IRIMY=0 + IL3DX=2*JPHEXT !2 + IL3DY=2*JPHEXT !2 + END IF + END IF +END IF +! User scalar variables +IF (NSV_USER>0) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'kg kg-1' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = 1, NSV_USER + SELECT CASE(HGETSVM(JSV)) + CASE ('READ') + IF ( KSIZELBXSV_ll /= 0 ) THEN + WRITE(TZFIELD%CMNHNAME,'(A6,I3.3)')'LBXSVM',JSV + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBX' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3,A8)')'2_Y_Z_','LBXSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBXSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBXSVMM)) THEN + PLBXSVM(:,:,:,JSV)=PLBXSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'PLXYSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize PLBXSVM') + ENDIF + END IF + END IF + END IF + ! + IF (KSIZELBYSV_ll /= 0 ) THEN + WRITE(TZFIELD%CMNHNAME,'(A6,I3.3)')'LBYSVM',JSV + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBY' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3,A8)')'X_2_Z_','LBYSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBYSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBYSVMM)) THEN + PLBYSVM(:,:,:,JSV)=PLBYSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'PLBYSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize PLBYSVM') + ENDIF + END IF + END IF + END IF + CASE('INIT') + IF ( SIZE(PLBXSVM,1) /= 0 ) PLBXSVM(:,:,:,JSV) = 0. + IF ( SIZE(PLBYSVM,1) /= 0 ) PLBYSVM(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! C2R2 scalar variables +IF (NSV_C2R2END>=NSV_C2R2BEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm-3' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_C2R2BEG, NSV_C2R2END + SELECT CASE(HGETSVM(JSV)) + CASE ('READ') + IF ( KSIZELBXSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBX_'//TRIM(C2R2NAMES(JSV-NSV_C2R2BEG+1)) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBX' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'2_Y_Z_','LBXSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBXSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBXSVMM)) THEN + PLBXSVM(:,:,:,JSV)=PLBXSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'C2R2 PLBXSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize C2R2 PLBXSVM') + ENDIF + END IF + END IF + END IF + ! + IF (KSIZELBYSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBY_'//TRIM(C2R2NAMES(JSV-NSV_C2R2BEG+1)) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBY' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'X_2_Z_','LBYSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBYSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBYSVMM)) THEN + PLBYSVM(:,:,:,JSV)=PLBYSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'C2R2 PLBYSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize C2R2 PLBYSVM') + ENDIF + END IF + END IF + END IF + CASE('INIT') + IF ( SIZE(PLBXSVM,1) /= 0 ) PLBXSVM(:,:,:,JSV) = 0. + IF ( SIZE(PLBYSVM,1) /= 0 ) PLBYSVM(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! C1R3 scalar variables +IF (NSV_C1R3END>=NSV_C1R3BEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm-3' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_C1R3BEG, NSV_C1R3END + SELECT CASE(HGETSVM(JSV)) + CASE ('READ') + IF ( KSIZELBXSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBX_'//TRIM(C1R3NAMES(JSV-NSV_C1R3BEG+1)) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBX' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'2_Y_Z_','LBXSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBXSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBXSVMM)) THEN + PLBXSVM(:,:,:,JSV)=PLBXSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'C1R3 PLBXSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize C1R3 PLBXSVM') + ENDIF + END IF + END IF + END IF + ! + IF (KSIZELBYSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBY_'//TRIM(C1R3NAMES(JSV-NSV_C1R3BEG+1)) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBY' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'X_2_Z_','LBYSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBYSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBYSVMM)) THEN + PLBYSVM(:,:,:,JSV)=PLBYSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'C1R3 PLBYSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize C1R3 PLBYSVM') + ENDIF + END IF + END IF + END IF + CASE('INIT') + IF ( SIZE(PLBXSVM,1) /= 0 ) PLBXSVM(:,:,:,JSV) = 0. + IF ( SIZE(PLBYSVM,1) /= 0 ) PLBYSVM(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! +! LIMA: CCN and IFN scalar variables +! +IF (CCLOUD=='LIMA' ) THEN + IF (NSV_LIMA_CCN_FREE+NMOD_CCN-1 >= NSV_LIMA_CCN_FREE) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'kg-1' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_LIMA_CCN_FREE,NSV_LIMA_CCN_FREE+NMOD_CCN-1 + SELECT CASE(HGETSVM(JSV)) + CASE ('READ') + WRITE(INDICE,'(I2.2)')(JSV - NSV_LIMA_CCN_FREE + 1) + IF ( KSIZELBXSV_ll /= 0 ) THEN + IF ( TPINIFILE%NMNHVERSION(1) < 5 & + .OR. ( TPINIFILE%NMNHVERSION(1) == 5 .AND. TPINIFILE%NMNHVERSION(2) < 5 ) & + .OR. ( TPINIFILE%NMNHVERSION(1) == 5 .AND. TPINIFILE%NMNHVERSION(2) == 5 & + .AND. TPINIFILE%NMNHVERSION(3) < 1 ) ) THEN + TZFIELD%CMNHNAME = 'LBX_'//TRIM(UPCASE(CLIMA_WARM_NAMES(3)))//INDICE + ELSE + TZFIELD%CMNHNAME = 'LBX_'//TRIM(UPCASE(CLIMA_WARM_NAMES(3)))//INDICE + END IF + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBX' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'2_Y_Z_','LBXSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBXSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBXSVMM)) THEN + PLBXSVM(:,:,:,JSV)=PLBXSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'CCN PLBXSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize CCN PLBXSVM') + ENDIF + END IF + END IF + END IF + ! + IF (KSIZELBYSV_ll /= 0 ) THEN + IF ( TPINIFILE%NMNHVERSION(1) < 5 & + .OR. ( TPINIFILE%NMNHVERSION(1) == 5 .AND. TPINIFILE%NMNHVERSION(2) < 5 ) & + .OR. ( TPINIFILE%NMNHVERSION(1) == 5 .AND. TPINIFILE%NMNHVERSION(2) == 5 & + .AND. TPINIFILE%NMNHVERSION(3) < 1 ) ) THEN + TZFIELD%CMNHNAME = 'LBY_'//TRIM(UPCASE(CLIMA_WARM_NAMES(3)))//INDICE + ELSE + TZFIELD%CMNHNAME = 'LBY_'//TRIM(UPCASE(CLIMA_WARM_NAMES(3)))//INDICE + END IF + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBY' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'X_2_Z_','LBYSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBYSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBYSVMM)) THEN + PLBYSVM(:,:,:,JSV)=PLBYSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'CCN PLBYSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize CCN PLBYSVM') + ENDIF + END IF + END IF + END IF + CASE('INIT') + IF ( SIZE(PLBXSVM,1) /= 0 ) PLBXSVM(:,:,:,JSV) = 0. + IF ( SIZE(PLBYSVM,1) /= 0 ) PLBYSVM(:,:,:,JSV) = 0. + END SELECT + END DO + END IF + ! + IF (NSV_LIMA_IFN_FREE+NMOD_IFN-1 >= NSV_LIMA_IFN_FREE) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'kg-1' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_LIMA_IFN_FREE,NSV_LIMA_IFN_FREE+NMOD_IFN-1 + SELECT CASE(HGETSVM(JSV)) + CASE ('READ') + WRITE(INDICE,'(I2.2)')(JSV - NSV_LIMA_IFN_FREE + 1) + IF ( KSIZELBXSV_ll /= 0 ) THEN + IF ( TPINIFILE%NMNHVERSION(1) < 5 & + .OR. ( TPINIFILE%NMNHVERSION(1) == 5 .AND. TPINIFILE%NMNHVERSION(2) < 5 ) & + .OR. ( TPINIFILE%NMNHVERSION(1) == 5 .AND. TPINIFILE%NMNHVERSION(2) == 5 & + .AND. TPINIFILE%NMNHVERSION(3) < 1 ) ) THEN + TZFIELD%CMNHNAME = 'LBX_'//TRIM(UPCASE(CLIMA_COLD_NAMES(5)))//INDICE + ELSE + TZFIELD%CMNHNAME = 'LBX_'//TRIM(UPCASE(CLIMA_COLD_NAMES(5)))//INDICE + END IF + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBX' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'2_Y_Z_','LBXSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBXSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBXSVMM)) THEN + PLBXSVM(:,:,:,JSV)=PLBXSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'IFN PLBXSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize IFN') + ENDIF + END IF + END IF + END IF + ! + IF (KSIZELBYSV_ll /= 0 ) THEN + IF ( TPINIFILE%NMNHVERSION(1) < 5 & + .OR. ( TPINIFILE%NMNHVERSION(1) == 5 .AND. TPINIFILE%NMNHVERSION(2) < 5 ) & + .OR. ( TPINIFILE%NMNHVERSION(1) == 5 .AND. TPINIFILE%NMNHVERSION(2) == 5 & + .AND. TPINIFILE%NMNHVERSION(3) < 1 ) ) THEN + TZFIELD%CMNHNAME = 'LBY_'//TRIM(UPCASE(CLIMA_COLD_NAMES(5)))//INDICE + ELSE + TZFIELD%CMNHNAME = 'LBY_'//TRIM(UPCASE(CLIMA_COLD_NAMES(5)))//INDICE + END IF + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBY' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'X_2_Z_','LBYSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBYSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBYSVMM)) THEN + PLBYSVM(:,:,:,JSV)=PLBYSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'IFN PLBYSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize IFN') + ENDIF + END IF + END IF + END IF + CASE('INIT') + IF ( SIZE(PLBXSVM,1) /= 0 ) PLBXSVM(:,:,:,JSV) = 0. + IF ( SIZE(PLBYSVM,1) /= 0 ) PLBYSVM(:,:,:,JSV) = 0. + END SELECT + END DO + END IF +ENDIF +! ELEC scalar variables +IF (NSV_ELECEND>=NSV_ELECBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'kg kg-1' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_ELECBEG, NSV_ELECEND + SELECT CASE(HGETSVM(JSV)) + CASE ('READ') + IF ( KSIZELBXSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBX_'//TRIM(CELECNAMES(JSV-NSV_ELECBEG+1)) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBX' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'2_Y_Z_','LBXSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBXSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBXSVMM)) THEN + PLBXSVM(:,:,:,JSV)=PLBXSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'ELEC PLBXSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize ELEC PLBXSVM') + ENDIF + END IF + END IF + END IF + ! + IF (KSIZELBYSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBY_'//TRIM(CELECNAMES(JSV-NSV_ELECBEG+1)) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBY' + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBYSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBYSVMM)) THEN + PLBYSVM(:,:,:,JSV)=PLBYSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'ELEC PLBYSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize ELEC PLBYSVM') + ENDIF + END IF + END IF + END IF + CASE('INIT') + IF ( SIZE(PLBXSVM,1) /= 0 ) PLBXSVM(:,:,:,JSV) = 0. + IF ( SIZE(PLBYSVM,1) /= 0 ) PLBYSVM(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! Chemical gas phase scalar variables +IF (NSV_CHGSEND>=NSV_CHGSBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'kg-1' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_CHGSBEG, NSV_CHGSEND + SELECT CASE(HGETSVM(JSV)) + CASE ('READ') + IF ( KSIZELBXSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBX_'//TRIM(UPCASE(CNAMES(JSV-NSV_CHGSBEG+1))) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBX' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'2_Y_Z_','LBXSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBXSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBXSVMM)) THEN + PLBXSVM(:,:,:,JSV)=PLBXSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Chemical PLBXSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize gas phase chemical PLBXSVM') + ENDIF + END IF + END IF + END IF + ! + IF (KSIZELBYSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBY_'//TRIM(UPCASE(CNAMES(JSV-NSV_CHGSBEG+1))) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBY' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'X_2_Z_','LBYSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBYSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBYSVMM)) THEN + PLBYSVM(:,:,:,JSV)=PLBYSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Chemical PLBYSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize gas phase chemical PLBYSVM') + ENDIF + END IF + END IF + END IF + CASE('INIT') + IF ( SIZE(PLBXSVM,1) /= 0 ) PLBXSVM(:,:,:,JSV) = 0. + IF ( SIZE(PLBYSVM,1) /= 0 ) PLBYSVM(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! Chemical aqueous phase scalar variables +IF (NSV_CHACEND>=NSV_CHACBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppp' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_CHACBEG, NSV_CHACEND + SELECT CASE(HGETSVM(JSV)) + CASE ('READ') + IF ( KSIZELBXSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBX_'//TRIM(UPCASE(CNAMES(JSV-NSV_CHACBEG+NSV_CHGS+1))) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBX' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'2_Y_Z_','LBXSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBXSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBXSVMM)) THEN + PLBXSVM(:,:,:,JSV)=PLBXSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Chemical PLBXSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize aqueous phase chemical PLBXSVM') + ENDIF + END IF + END IF + END IF + ! + IF (KSIZELBYSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBY_'//TRIM(UPCASE(CNAMES(JSV-NSV_CHACBEG+NSV_CHGS+1))) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBY' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'X_2_Z_','LBYSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBYSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBYSVMM)) THEN + PLBYSVM(:,:,:,JSV)=PLBYSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Chemical PLBYSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize aqueous phase chemical PLBYSVM') + ENDIF + END IF + END IF + END IF + CASE('INIT') + IF ( SIZE(PLBXSVM,1) /= 0 ) PLBXSVM(:,:,:,JSV) = 0. + IF ( SIZE(PLBYSVM,1) /= 0 ) PLBYSVM(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! Chemical ice phase scalar variables +IF (NSV_CHICEND>=NSV_CHICBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppp' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_CHICBEG, NSV_CHICEND + SELECT CASE(HGETSVM(JSV)) + CASE ('READ') + IF ( KSIZELBXSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBX_'//TRIM(UPCASE(CICNAMES(JSV-NSV_CHICBEG+1))) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBX' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'2_Y_Z_','LBXSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBXSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBXSVMM)) THEN + PLBXSVM(:,:,:,JSV)=PLBXSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Ice phase chemical PLBXSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize ice phase chemical PLBXSVM') + ENDIF + END IF + END IF + END IF + ! + IF (KSIZELBYSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBY_'//TRIM(UPCASE(CICNAMES(JSV-NSV_CHICBEG+1))) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBY' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'X_2_Z_','LBYSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBYSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBYSVMM)) THEN + PLBYSVM(:,:,:,JSV)=PLBYSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Ice phase chemical PLBYSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize ice phase chemical PLBYSVM') + ENDIF + END IF + END IF + END IF + CASE('INIT') + IF ( SIZE(PLBXSVM,1) /= 0 ) PLBXSVM(:,:,:,JSV) = 0. + IF ( SIZE(PLBYSVM,1) /= 0 ) PLBYSVM(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! Orilam aerosol scalar variables +IF (NSV_AEREND>=NSV_AERBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppp' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_AERBEG, NSV_AEREND + SELECT CASE(HGETSVM(JSV)) + CASE ('READ') + IF ( KSIZELBXSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBX_'//TRIM(UPCASE(CAERONAMES(JSV-NSV_AERBEG+1))) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBX' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'2_Y_Z_','LBXSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBXSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBXSVMM)) THEN + PLBXSVM(:,:,:,JSV)=PLBXSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Aerosol PLBXSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize aerosol PLBXSVM') + ENDIF + END IF + END IF + END IF + ! + IF (KSIZELBYSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBY_'//TRIM(UPCASE(CAERONAMES(JSV-NSV_AERBEG+1))) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBY' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'X_2_Z_','LBYSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBYSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBYSVMM)) THEN + PLBYSVM(:,:,:,JSV)=PLBYSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Aerosol PLBYSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize aerosol PLBYSVM') + ENDIF + END IF + END IF + END IF + CASE('INIT') + IF ( SIZE(PLBXSVM,1) /= 0 ) PLBXSVM(:,:,:,JSV) = 0. + IF ( SIZE(PLBYSVM,1) /= 0 ) PLBYSVM(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! Orilam aerosols moist scalar variables +IF (NSV_AERDEPEND>=NSV_AERDEPBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppp' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_AERDEPBEG, NSV_AERDEPEND + SELECT CASE(HGETSVM(JSV)) + CASE ('READ') + IF ( KSIZELBXSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBX_'//TRIM(UPCASE(CDEAERNAMES(JSV-NSV_AERDEPBEG+1))) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBX' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'2_Y_Z_','LBXSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBXSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBXSVMM)) THEN + PLBXSVM(:,:,:,JSV)=PLBXSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Aerosol PLBXSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize aerosol PLBXSVM') + ENDIF + END IF + END IF + END IF + ! + IF (KSIZELBYSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBY_'//TRIM(CDEAERNAMES(JSV-NSV_AERDEPBEG+1)) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBY' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'X_2_Z_','LBYSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBYSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBYSVMM)) THEN + PLBYSVM(:,:,:,JSV)=PLBYSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Aerosol PLBYSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize aerosol PLBYSVM') + ENDIF + END IF + END IF + END IF + CASE('INIT') + IF ( SIZE(PLBXSVM,1) /= 0 ) PLBXSVM(:,:,:,JSV) = 0. + IF ( SIZE(PLBYSVM,1) /= 0 ) PLBYSVM(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! Dust scalar variables +IF (NSV_DSTEND>=NSV_DSTBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppp' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_DSTBEG, NSV_DSTEND + SELECT CASE(HGETSVM(JSV)) + CASE ('READ') + IF ( KSIZELBXSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBX_'//TRIM(UPCASE(CDUSTNAMES(JSV-NSV_DSTBEG+1))) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBX' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'2_Y_Z_','LBXSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBXSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBXSVMM)) THEN + PLBXSVM(:,:,:,JSV)=PLBXSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Dust PLBXSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize dust PLBXSVM') + ENDIF + END IF + END IF + END IF + ! + IF (KSIZELBYSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBY_'//TRIM(UPCASE(CDUSTNAMES(JSV-NSV_DSTBEG+1))) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBY' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'X_2_Z_','LBYSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBYSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBYSVMM)) THEN + PLBYSVM(:,:,:,JSV)=PLBYSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Dust PLBYSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize dust PLBYSVM') + ENDIF + END IF + END IF + END IF + CASE('INIT') + IF ( SIZE(PLBXSVM,1) /= 0 ) PLBXSVM(:,:,:,JSV) = 0. + IF ( SIZE(PLBYSVM,1) /= 0 ) PLBYSVM(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! +IF (NSV_DSTDEPEND>=NSV_DSTDEPBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppp' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_DSTDEPBEG, NSV_DSTDEPEND + SELECT CASE(HGETSVM(JSV)) + CASE ('READ') + IF ( KSIZELBXSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBX_'//TRIM(UPCASE(CDEDSTNAMES(JSV-NSV_DSTDEPBEG+1))) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBX' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'2_Y_Z_','LBXSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBXSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBXSVMM)) THEN + PLBXSVM(:,:,:,JSV)=PLBXSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Dust Desposition PLBXSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize dust PLBXSVM') + ENDIF + END IF + END IF + END IF + ! + IF (KSIZELBYSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBY_'//TRIM(UPCASE(CDEDSTNAMES(JSV-NSV_DSTDEPBEG+1))) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBY' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'X_2_Z_','LBYSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBYSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBYSVMM)) THEN + PLBYSVM(:,:,:,JSV)=PLBYSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Dust Depoistion PLBYSVM will be initialized to 0' + ELSE + WRITE(ILUOUT,*) 'Pb to initialize dust PLBYSVM ' +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize dust PLBYSVM') + ENDIF + END IF + END IF + END IF + CASE('INIT') + IF ( SIZE(PLBXSVM,1) /= 0 ) PLBXSVM(:,:,:,JSV) = 0. + IF ( SIZE(PLBYSVM,1) /= 0 ) PLBYSVM(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! Sea salt scalar variables +IF (NSV_SLTEND>=NSV_SLTBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppp' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_SLTBEG, NSV_SLTEND + SELECT CASE(HGETSVM(JSV)) + CASE ('READ') + IF ( KSIZELBXSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBX_'//TRIM(UPCASE(CSALTNAMES(JSV-NSV_SLTBEG+1))) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBX' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'2_Y_Z_','LBXSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBXSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBXSVMM)) THEN + PLBXSVM(:,:,:,JSV)=PLBXSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Sea Salt PLBXSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize sea salt PLBXSVM') + ENDIF + END IF + END IF + END IF + ! + IF (KSIZELBYSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBY_'//TRIM(CSALTNAMES(JSV-NSV_SLTBEG+1)) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBY' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'X_2_Z_','LBYSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBYSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBYSVMM)) THEN + PLBYSVM(:,:,:,JSV)=PLBYSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Sea Salt PLBYSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize sea salt PLBYSVM') + ENDIF + END IF + END IF + END IF + CASE('INIT') + IF ( SIZE(PLBXSVM,1) /= 0 ) PLBXSVM(:,:,:,JSV) = 0. + IF ( SIZE(PLBYSVM,1) /= 0 ) PLBYSVM(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! Passive pollutant variables +IF (NSV_PPEND>=NSV_PPBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'kg kg-1' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_PPBEG, NSV_PPEND + SELECT CASE(HGETSVM(JSV)) + CASE ('READ') + IF ( KSIZELBXSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBX_PP' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBX' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'2_Y_Z_','LBXSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBXSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBXSVMM)) THEN + PLBXSVM(:,:,:,JSV)=PLBXSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Passive pollutant PLBXSVM will be initialized to 0' + ELSE + PLBXSVM(:,:,:,JSV)=0. + WRITE(ILUOUT,*) 'Passive pollutant PLBXSVM will be initialized to 0' + ENDIF + END IF + END IF + END IF + ! + IF (KSIZELBYSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBY_PP' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBY' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'X_2_Z_','LBYSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBYSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBYSVMM)) THEN + PLBYSVM(:,:,:,JSV)=PLBYSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Passive pollutant PLBYSVM will be initialized to 0' + ELSE + PLBYSVM(:,:,:,JSV)=0. + WRITE(ILUOUT,*) 'Passive pollutant PLBYSVM will be initialized to 0' + ENDIF + END IF + END IF + END IF + CASE('INIT') + IF ( SIZE(PLBXSVM,1) /= 0 ) PLBXSVM(:,:,:,JSV) = 0. + IF ( SIZE(PLBYSVM,1) /= 0 ) PLBYSVM(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +#ifdef MNH_FOREFIRE +! ForeFire scalar variables +IF (NSV_FFEND>=NSV_FFBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'kg kg-1' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_FFBEG, NSV_FFEND + SELECT CASE(HGETSVM(JSV)) + CASE ('READ') + IF ( KSIZELBXSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBX_FF' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBX' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'2_Y_Z_','LBXSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXSVM(:,:,:,JSV),IRESP) + WRITE(ILUOUT,*) 'ForeFire LBX_FF ', IRESP + IF ( SIZE(PLBXSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBXSVMM)) THEN + PLBXSVM(:,:,:,JSV)=PLBXSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'ForeFire pollutant PLBXSVM will be initialized to 0' + ELSE + PLBXSVM(:,:,:,JSV)=0. + WRITE(ILUOUT,*) 'ForeFire pollutant PLBXSVM will be initialized to 0' + ENDIF + END IF + END IF + END IF + ! + IF (KSIZELBYSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBY_FF' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBY' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'X_2_Z_','LBYSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBYSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBYSVMM)) THEN + PLBYSVM(:,:,:,JSV)=PLBYSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'ForeFire scalar variable PLBYSVM will be initialized to 0' + ELSE + PLBYSVM(:,:,:,JSV)=0. + WRITE(ILUOUT,*) 'ForeFire scalar variable PLBYSVM will be initialized to 0' + ENDIF + END IF + END IF + END IF + CASE('INIT') + IF ( SIZE(PLBXSVM,1) /= 0 ) PLBXSVM(:,:,:,JSV) = 0. + IF ( SIZE(PLBYSVM,1) /= 0 ) PLBYSVM(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +#endif +! Conditional sampling variables +IF (NSV_CSEND>=NSV_CSBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'kg kg-1' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_CSBEG, NSV_CSEND + SELECT CASE(HGETSVM(JSV)) + CASE ('READ') + IF ( KSIZELBXSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBX_CS' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBX' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'2_Y_Z_','LBXSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBXSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBXSVMM)) THEN + PLBXSVM(:,:,:,JSV)=PLBXSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Conditional sampling LBXSVM will be initialized to 0' + ELSE + PLBXSVM(:,:,:,JSV)=0. + WRITE(ILUOUT,*) 'Conditional sampling PLBXSVM will be initialized to 0' + ENDIF + END IF + END IF + END IF + ! + IF (KSIZELBYSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBY_CS' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBY' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'X_2_Z_','LBYSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBYSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBYSVMM)) THEN + PLBYSVM(:,:,:,JSV)=PLBYSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Conditional sampling PLBYSVM will be initialized to 0' + ELSE + PLBYSVM(:,:,:,JSV)=0. + WRITE(ILUOUT,*) 'Conditional sampling PLBYSVM will be initialized to 0' + ENDIF + END IF + END IF + END IF + CASE('INIT') + IF ( SIZE(PLBXSVM,1) /= 0 ) PLBXSVM(:,:,:,JSV) = 0. + IF ( SIZE(PLBYSVM,1) /= 0 ) PLBYSVM(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! Linox scalar variables +IF (NSV_LNOXEND>=NSV_LNOXBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'kg kg-1' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_LNOXBEG, NSV_LNOXEND + SELECT CASE(HGETSVM(JSV)) + CASE ('READ') + IF ( KSIZELBXSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBX_LINOX' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBX' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'2_Y_Z_','LBXSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBXSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBXSVMM)) THEN + PLBXSVM(:,:,:,JSV)=PLBXSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Linox PLBXSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize linox PLBXSVM') + ENDIF + END IF + END IF + END IF + ! + IF (KSIZELBYSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBY_LINOX' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBY' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'X_2_Z_','LBYSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBYSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBYSVMM)) THEN + PLBYSVM(:,:,:,JSV)=PLBYSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'Linox PLBYSVM will be initialized to 0' + ELSE +!calla bortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize linox PLBYSVM') + ENDIF + END IF + END IF + END IF + CASE('INIT') + IF ( SIZE(PLBXSVM,1) /= 0 ) PLBXSVM(:,:,:,JSV) = 0. + IF ( SIZE(PLBYSVM,1) /= 0 ) PLBYSVM(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! Lagrangian variables +IF (NSV_LGEND>=NSV_LGBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_LGBEG, NSV_LGEND + SELECT CASE(HGETSVM(JSV)) + CASE ('READ') + IF ( KSIZELBXSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBX_'//TRIM(CLGNAMES(JSV-NSV_LGBEG+1)) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBX' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'2_Y_Z_','LBXSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DX,IRIMX,PLBXSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBXSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBXSVMM)) THEN + PLBXSVM(:,:,:,JSV)=PLBXSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'lagrangian PLBXSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize lagrangian PLBXSVM') + ENDIF + END IF + END IF + END IF + ! + IF (KSIZELBYSV_ll /= 0 ) THEN + TZFIELD%CMNHNAME = 'LBY_'//TRIM(CLGNAMES(JSV-NSV_LGBEG+1)) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CLBTYPE = 'LBY' + WRITE(TZFIELD%CCOMMENT,'(A6,A6,I3.3)')'X_2_Z_','LBYSVM',JSV + CALL IO_Field_read_lb(TPINIFILE,TZFIELD,IL3DY,IRIMY,PLBYSVM(:,:,:,JSV),IRESP) + IF ( SIZE(PLBYSVM,1) /= 0 ) THEN + IF (IRESP/=0) THEN + IF (PRESENT(PLBYSVMM)) THEN + PLBYSVM(:,:,:,JSV)=PLBYSVMM(:,:,:,JSV) + WRITE(ILUOUT,*) 'lagrangian PLBYSVM will be initialized to 0' + ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_LB','problem to initialize lagrangian PLBYSVM') + ENDIF + END IF + END IF + END IF + ! + CASE('INIT') + IF ( SIZE(PLBXSVM,1) /= 0 ) PLBXSVM(:,:,:,JSV) = 0. + IF ( SIZE(PLBYSVM,1) /= 0 ) PLBYSVM(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +!------------------------------------------------------------------------------- +! +!* 3. COMPUTE THE LB SOURCES +! ----------------------- +! +! IN case of initialization of LB source terms (OLSOURCE=T) : +! xxxM are LB source terms +! xxxMM are LB fields at time t -dt +IF (OLSOURCE) THEN + IF (PRESENT(PLBXUMM).AND.PRESENT(PLBYUMM)) THEN + PLBXUM(:,:,:) = (PLBXUM(:,:,:) - PLBXUMM(:,:,:)) / PLENG + PLBYUM(:,:,:) = (PLBYUM(:,:,:) - PLBYUMM(:,:,:)) / PLENG + ENDIF + IF (PRESENT(PLBXVMM).AND.PRESENT(PLBYVMM)) THEN + PLBXVM(:,:,:) = (PLBXVM(:,:,:) - PLBXVMM(:,:,:)) / PLENG + PLBYVM(:,:,:) = (PLBYVM(:,:,:) - PLBYVMM(:,:,:)) / PLENG + ENDIF + IF (PRESENT(PLBXWMM).AND.PRESENT(PLBYWMM)) THEN + PLBXWM(:,:,:) = (PLBXWM(:,:,:) - PLBXWMM(:,:,:)) / PLENG + PLBYWM(:,:,:) = (PLBYWM(:,:,:) - PLBYWMM(:,:,:)) / PLENG + ENDIF + IF (PRESENT(PLBXTHMM).AND.PRESENT(PLBYTHMM)) THEN + PLBXTHM(:,:,:) = (PLBXTHM(:,:,:) - PLBXTHMM(:,:,:)) / PLENG + PLBYTHM(:,:,:) = (PLBYTHM(:,:,:) - PLBYTHMM(:,:,:)) / PLENG + ENDIF + IF (HGETTKEM =='READ') THEN + IF (PRESENT(PLBXTKEMM).AND.PRESENT(PLBYTKEMM)) THEN + PLBXTKEM(:,:,:) = (PLBXTKEM(:,:,:) - PLBXTKEMM(:,:,:)) / PLENG + PLBYTKEM(:,:,:) = (PLBYTKEM(:,:,:) - PLBYTKEMM(:,:,:)) / PLENG + ENDIF + ENDIF + IF (HGETTKEM =='INIT') THEN + PLBXTKEM(:,:,:) = 0. + PLBYTKEM(:,:,:) = 0. + ENDIF +! LB moist variables + IRR=0 + IF (PRESENT(PLBXRMM).AND.PRESENT(PLBYRMM)) THEN + DO JRR=1,7 + IF (YGETRXM(JRR) == 'READ') THEN + IRR=IRR+1 + PLBXRM(:,:,:,IRR) = (PLBXRM(:,:,:,IRR) - PLBXRMM(:,:,:,IRR)) / PLENG + PLBYRM(:,:,:,IRR) = (PLBYRM(:,:,:,IRR) - PLBYRMM(:,:,:,IRR)) / PLENG + ENDIF + END DO + ENDIF +! LB-scalar variables + DO JSV=1,KSV + IF (HGETSVM(JSV) == 'READ') THEN + PLBXSVM(:,:,:,JSV) = (PLBXSVM(:,:,:,JSV) - PLBXSVMM(:,:,:,JSV)) / PLENG + PLBYSVM(:,:,:,JSV) = (PLBYSVM(:,:,:,JSV) - PLBYSVMM(:,:,:,JSV)) / PLENG + ENDIF + END DO +! +ENDIF +! +END SUBROUTINE INI_LB diff --git a/src/mesonh/ext/ini_micron.f90 b/src/mesonh/ext/ini_micron.f90 new file mode 100644 index 0000000000000000000000000000000000000000..f8555180345104218eb286b541ba9c56a7510f44 --- /dev/null +++ b/src/mesonh/ext/ini_micron.f90 @@ -0,0 +1,327 @@ +!MNH_LIC Copyright 2002-2021 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_INI_MICRO_n +! ######################## +! +INTERFACE + SUBROUTINE INI_MICRO_n ( TPINIFILE,KLUOUT ) +! +USE MODD_IO, ONLY: TFILEDATA +! +TYPE(TFILEDATA), INTENT(IN) :: TPINIFILE ! Initial file +INTEGER, INTENT(IN) :: KLUOUT ! Logical unit number for prints +! +END SUBROUTINE INI_MICRO_n +! +END INTERFACE +! +END MODULE MODI_INI_MICRO_n +! ############################################ + SUBROUTINE INI_MICRO_n ( TPINIFILE,KLUOUT ) +! ############################################ +! +! +!!**** *INI_MICRO_n* allocates and fills MODD_PRECIP_n variables +!! and initialize parameter for microphysical scheme +!! +!! PURPOSE +!! ------- +!! +!! EXTERNAL +!! -------- +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! P. Jabouille +!! +!! MODIFICATIONS +!! ------------- +!! Original 27/11/02 +!! O.Geoffroy (03/2006) : Add KHKO scheme +!! Modification 01/2016 (JP Pinty) Add LIMA +!! C.LAc 10/2016 Add budget for droplet deposition +! P. Wautelet 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 01/2019: bugfix: add missing allocations +! C. Lac 02/2020: add missing allocation of INPRC and ACPRC with deposition +! P. Wautelet 14/02/2019: remove CLUOUT/CLUOUT0 and associated variables +! P. Wautelet 04/06/2020: bugfix: correct bounds of passed arrays +! -------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +! +USE MODD_CONF, ONLY : CCONF,CPROGRAM +USE MODD_IO, ONLY : TFILEDATA +USE MODD_GET_n, ONLY : CGETRCT,CGETRRT, CGETRST, CGETRGT, CGETRHT, CGETCLOUD +USE MODD_DIM_n, ONLY : NIMAX_ll, NJMAX_ll +USE MODD_PARAMETERS, ONLY : JPVEXT, JPHEXT +USE MODD_PARAM_n, ONLY : CCLOUD +USE MODD_PRECIP_n, ONLY : XINPRR, XACPRR, XINPRS, XACPRS, XINPRG, XACPRG, & + XINPRH, XACPRH, XINPRC, XACPRC, XINPRR3D, XEVAP3D,& + XINDEP,XACDEP +USE MODD_FIELD_n, ONLY : XRT, XSVT, XTHT, XPABST, XTHM, XRCM +USE MODD_GRID_n, ONLY : XZZ +USE MODD_METRICS_n, ONLY : XDXX,XDYY,XDZZ,XDZX,XDZY +USE MODD_REF_n, ONLY : XRHODREF +USE MODD_DYN_n, ONLY : XTSTEP +USE MODD_CLOUDPAR_n, ONLY : NSPLITR, NSPLITG +USE MODD_PARAM_n, ONLY : CELEC +USE MODD_PARAM_ICE_n, ONLY : LSEDIC, LDEPOSC +USE MODD_PARAM_C2R2, ONLY : LSEDC, LACTIT, LDEPOC +USE MODD_BLOWSNOW +USE MODD_BLOWSNOW_n +! +USE MODI_READ_PRECIP_FIELD +USE MODI_INI_CLOUD +USE MODE_INI_RAIN_ICE, ONLY: INI_RAIN_ICE +USE MODI_INI_RAIN_C2R2 +USE MODI_INI_ICE_C1R3 +USE MODI_CLEAN_CONC_RAIN_C2R2 +USE MODI_SET_CONC_RAIN_C2R2 +USE MODI_CLEAN_CONC_ICE_C1R3 +USE MODI_SET_CONC_ICE_C1R3 +! +USE MODE_ll +USE MODE_MODELN_HANDLER +USE MODE_BLOWSNOW_SEDIM_LKT +USE MODE_SET_CONC_LIMA +! +USE MODD_NSV, ONLY : NSV,NSV_CHEM,NSV_C2R2BEG,NSV_C2R2END, & + NSV_C1R3BEG,NSV_C1R3END, & + NSV_LIMA_BEG, NSV_LIMA_END +USE MODD_PARAM_LIMA, ONLY : LSCAV, MSEDC=>LSEDC, MACTIT=>LACTIT, MDEPOC=>LDEPOC +USE MODD_LIMA_PRECIP_SCAVENGING_n +! +USE MODI_INIT_AEROSOL_CONCENTRATION +USE MODI_INI_LIMA +! +IMPLICIT NONE +! +!* 0.1 Declarations of dummy arguments : +! +TYPE(TFILEDATA), INTENT(IN) :: TPINIFILE ! Initial file +INTEGER, INTENT(IN) :: KLUOUT ! Logical unit number for prints +! +! 0.2 declaration of local variables +! +! +! +INTEGER :: IIU ! Upper dimension in x direction (local) +INTEGER :: IJU ! Upper dimension in y direction (local) +INTEGER :: IKU ! Upper dimension in z direction +INTEGER :: JK ! loop vertical index +INTEGER :: IINFO_ll! Return code of //routines +INTEGER :: IKB,IKE +! +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDZ ! mesh size +REAL :: ZDZMIN +INTEGER :: IMI +! +!------------------------------------------------------------------------------- +! +!* 1. PROLOGUE +! +! +CALL GET_DIM_EXT_ll('B',IIU,IJU) +IKU=SIZE(XZZ,3) +IMI = GET_CURRENT_MODEL_INDEX() +! +! +!* 2. ALLOCATE Module MODD_PRECIP_n +! ------------------------------ +! +IF (CCLOUD /= 'NONE' .AND. CCLOUD /= 'REVE') THEN + ALLOCATE(XINPRR(IIU,IJU)) + ALLOCATE(XINPRR3D(IIU,IJU,IKU)) + ALLOCATE(XEVAP3D(IIU,IJU,IKU)) + ALLOCATE(XACPRR(IIU,IJU)) + XINPRR(:,:)=0.0 + XACPRR(:,:)=0.0 + XINPRR3D(:,:,:)=0.0 + XEVAP3D(:,:,:)=0.0 +ELSE + ALLOCATE(XINPRR(0,0)) + ALLOCATE(XINPRR3D(0,0,0)) + ALLOCATE(XEVAP3D(0,0,0)) + ALLOCATE(XACPRR(0,0)) +END IF +! +IF (( CCLOUD(1:3) == 'ICE' .AND.(LSEDIC .OR. LDEPOSC)) .OR. & + ((CCLOUD=='C2R2' .OR. CCLOUD=='C3R5' .OR. CCLOUD=='KHKO').AND.(LSEDC .OR. LDEPOC)) .OR. & + ( CCLOUD=='LIMA' .AND.(MSEDC .OR. MDEPOC))) THEN + ALLOCATE(XINPRC(IIU,IJU)) + ALLOCATE(XACPRC(IIU,IJU)) + XINPRC(:,:)=0.0 + XACPRC(:,:)=0.0 +ELSE + ALLOCATE(XINPRC(0,0)) + ALLOCATE(XACPRC(0,0)) +END IF +! +IF (( CCLOUD(1:3) == 'ICE' .AND.LDEPOSC) .OR. & + ((CCLOUD=='C2R2' .OR. CCLOUD=='KHKO').AND.LDEPOC) .OR. & + ( CCLOUD=='LIMA' .AND.MDEPOC)) THEN + ALLOCATE(XINDEP(IIU,IJU)) + ALLOCATE(XACDEP(IIU,IJU)) + XINDEP(:,:)=0.0 + XACDEP(:,:)=0.0 +ELSE + ALLOCATE(XINDEP(0,0)) + ALLOCATE(XACDEP(0,0)) +END IF +! +IF (CCLOUD(1:3) == 'ICE' .OR. CCLOUD == 'C3R5' .OR. CCLOUD == 'LIMA') THEN + ALLOCATE(XINPRS(IIU,IJU)) + ALLOCATE(XACPRS(IIU,IJU)) + XINPRS(:,:)=0.0 + XACPRS(:,:)=0.0 +ELSE + ALLOCATE(XINPRS(0,0)) + ALLOCATE(XACPRS(0,0)) + END IF +! +IF (CCLOUD == 'C3R5' .OR. CCLOUD(1:3) == 'ICE'.OR. CCLOUD == 'LIMA') THEN + ALLOCATE(XINPRG(IIU,IJU)) + ALLOCATE(XACPRG(IIU,IJU)) + XINPRG(:,:)=0.0 + XACPRG(:,:)=0.0 +ELSE + ALLOCATE(XINPRG(0,0)) + ALLOCATE(XACPRG(0,0)) +END IF +! +IF (CCLOUD =='ICE4' .OR. CCLOUD == 'LIMA') THEN + ALLOCATE(XINPRH(IIU,IJU)) + ALLOCATE(XACPRH(IIU,IJU)) + XINPRH(:,:)=0.0 + XACPRH(:,:)=0.0 +ELSE + ALLOCATE(XINPRH(0,0)) + ALLOCATE(XACPRH(0,0)) +END IF +! +IF(LBLOWSNOW) THEN + ALLOCATE(XSNWSUBL3D(IIU,IJU,IKU)) + XSNWSUBL3D(:,:,:) = 0.0 + IF(CSNOWSEDIM=='TABC') THEN +!Read in look up tables of snow particles properties +!No arguments, all look up tables are defined in module +!mode_snowdrift_sedim_lkt + CALL BLOWSNOW_SEDIM_LKT_SET + END IF +ELSE + ALLOCATE(XSNWSUBL3D(0,0,0)) +END IF +! +!* 2b. ALLOCATION for Radiative cooling +! ------------------------------ +IF (LACTIT .OR. MACTIT) THEN + ALLOCATE( XTHM(IIU,IJU,IKU) ) + ALLOCATE( XRCM(IIU,IJU,IKU) ) + XTHM = XTHT + XRCM(:,:,:) = XRT(:,:,:,2) +ELSE + ALLOCATE( XTHM(0,0,0) ) + ALLOCATE( XRCM(0,0,0) ) +END IF +! +!* 2.bis ALLOCATE Module MODD_PRECIP_SCAVENGING_n +! ------------------------------ +! +IF ( (CCLOUD=='LIMA') .AND. LSCAV ) THEN + ALLOCATE(XINPAP(IIU,IJU)) + ALLOCATE(XACPAP(IIU,IJU)) + XINPAP(:,:)=0.0 + XACPAP(:,:)=0.0 +ELSE + ALLOCATE(XINPAP(0,0)) + ALLOCATE(XACPAP(0,0)) +END IF +! +IF(SIZE(XINPRR) == 0) RETURN +! +!* 3. INITIALIZE MODD_PRECIP_n variables +! ---------------------------------- +! +CALL READ_PRECIP_FIELD(TPINIFILE,CPROGRAM,CCONF, & + CGETRCT,CGETRRT,CGETRST,CGETRGT,CGETRHT, & + XINPRC,XACPRC,XINDEP,XACDEP,XINPRR,XINPRR3D,XEVAP3D,& + XACPRR,XINPRS,XACPRS,XINPRG,XACPRG, XINPRH,XACPRH ) +! +! +!* 4. INITIALIZE THE PARAMETERS FOR THE MICROPHYSICS +! ---------------------------------------------- +! +! +!* 4.1 Compute the minimun vertical mesh size +! +ALLOCATE(ZDZ(IIU,IJU,IKU)) +ZDZ=0. +IKB = 1 + JPVEXT +IKE = SIZE(XZZ,3)- JPVEXT +DO JK = IKB,IKE + ZDZ(:,:,JK) = XZZ(:,:,JK+1) - XZZ(:,:,JK) +END DO +ZDZMIN = MIN_ll (ZDZ,IINFO_ll,1,1,IKB,NIMAX_ll+2*JPHEXT,NJMAX_ll+2*JPHEXT,IKE ) +DEALLOCATE(ZDZ) +! +IF (CCLOUD(1:3) == 'KES') THEN + CALL INI_CLOUD(XTSTEP,ZDZMIN,NSPLITR) ! Warm cloud only +ELSE IF (CCLOUD(1:3) == 'ICE' ) THEN + CALL INI_RAIN_ICE(KLUOUT,XTSTEP,ZDZMIN,NSPLITR,CCLOUD) ! Mixed phase cloud + ! including hail +ELSE IF (CCLOUD == 'C2R2' .OR. CCLOUD == 'C3R5' .OR. CCLOUD == 'KHKO') THEN + CALL INI_RAIN_C2R2(XTSTEP,ZDZMIN,NSPLITR,CCLOUD) ! 1/2 spectral warm cloud + IF (CCLOUD == 'C3R5') THEN + CALL INI_ICE_C1R3(XTSTEP,ZDZMIN,NSPLITG) ! 1/2 spectral cold cloud + END IF +ELSE IF (CCLOUD == 'LIMA') THEN + IF (CGETCLOUD /= 'READ') CALL INIT_AEROSOL_CONCENTRATION( XRHODREF, XSVT(:, :, :, :), XZZ(:, :, :) ) + CALL INI_LIMA(XTSTEP,ZDZMIN,NSPLITR, NSPLITG) ! 1/2 spectral warm cloud +END IF +! +IF (CCLOUD == 'C2R2' .OR. CCLOUD == 'C3R5' .OR. CCLOUD == 'KHKO') THEN + IF (CGETCLOUD=='READ') THEN + CALL CLEAN_CONC_RAIN_C2R2 (XRT,XSVT(:,:,:,NSV_C2R2BEG:NSV_C2R2END)) + ELSE IF (CGETCLOUD=='INI1'.OR.CGETCLOUD=='INI2') THEN + CALL SET_CONC_RAIN_C2R2 (CGETCLOUD,XRHODREF,& + &XRT,XSVT(:,:,:,NSV_C2R2BEG:NSV_C2R2END)) + ENDIF + IF (CCLOUD == 'C3R5' ) THEN + IF (CGETCLOUD=='READ') THEN + CALL CLEAN_CONC_ICE_C1R3 (XRT,XSVT(:,:,:,NSV_C2R2BEG:NSV_C1R3END)) + ELSE + CALL SET_CONC_ICE_C1R3 (XRHODREF,XRT,XSVT(:,:,:,NSV_C2R2BEG:NSV_C1R3END)) + ENDIF + ENDIF +ENDIF +! +IF (CCLOUD == 'LIMA') THEN + IF (CGETCLOUD/='READ') THEN + CALL SET_CONC_LIMA(IMI,CGETCLOUD,XRHODREF,XRT,XSVT(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END)) + END IF +END IF +! +! +!* 5. INITIALIZE ATMOSPHERIC ELECTRICITY +! ---------------------------------- +! +! +!IF (CELEC /= 'NONE') THEN +! CALL INI_ELEC(IMI,TPINIFILE,XTSTEP,ZDZMIN,NSPLITR, & +! XDXX,XDYY,XDZZ,XDZX,XDZY ) +!END IF +! +! +END SUBROUTINE INI_MICRO_n diff --git a/src/mesonh/ext/ini_modeln.f90 b/src/mesonh/ext/ini_modeln.f90 new file mode 100644 index 0000000000000000000000000000000000000000..cba4ca757f83b597a515eb95b89a5e9ba411ab43 --- /dev/null +++ b/src/mesonh/ext/ini_modeln.f90 @@ -0,0 +1,2934 @@ +!MNH_LIC Copyright 1994-2021 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_INI_MODEL_n +! ####################### +! +INTERFACE +! + SUBROUTINE INI_MODEL_n(KMI,TPINIFILE) +! +USE MODD_IO, ONLY: TFILEDATA +! +INTEGER, INTENT(IN) :: KMI ! Model Index +TYPE(TFILEDATA), INTENT(IN) :: TPINIFILE ! Initial file +! +END SUBROUTINE INI_MODEL_n +! +END INTERFACE +! +END MODULE MODI_INI_MODEL_n +! ############################################ + SUBROUTINE INI_MODEL_n(KMI,TPINIFILE) +! ############################################ +! +!!**** *INI_MODEL_n* - routine to initialize the nested model _n +!! +!! PURPOSE +!! ------- +! The purpose of this routine is to initialize the variables +! of the nested model _n. +! +!!** METHOD +!! ------ +!! The initialization of the model _n is performed as follows : +!! - Memory for arrays are then allocated : +!! * If turbulence kinetic energy variable is not needed +!! (CTURB='NONE'), XTKET, XTKEM and XTKES are zero-size arrays. +!! * If dissipation of TKE variable is not needed +!! (CTURBLEN /='KEPS'), XEPST, XEPSM and XREPSS are zero-size arrays. +!! * Memory for mixing ratio arrays is allocated according to the +!! value of logicals LUSERn (the number NRR of moist variables is deduced). +!! * The latitude (XLAT), longitude (XLON) and map factor (XMAP) +!! arrays are zero-size arrays if Cartesian geometry (LCARTESIAN=.TRUE.) +!! * Memory for reference state without orography ( XRHODREFZ and +!! XTHVREFZ) is only allocated in INI_MODEL1 +!! * The horizontal Coriolis parameters (XCORIOX and XCORIOY) arrays +!! are zero-size arrays if thinshell approximation (LTHINSHELL=.TRUE.) +!! * The Curvature coefficients (XCURVX and XCURVY) arrays +!! are zero-size arrays if Cartesian geometry (LCARTESIAN=.TRUE.) +!! * Memory for the Jacobian (ZJ) local array is allocated +!! (This variable is computed in SET_GRID and used in SET_REF). +!! - The spatial and temporal grid variables are initialized by SET_GRID. +!! - The metric coefficients are computed by METRICS (they are using in +!! the SET-REF call). +!! - The prognostic variables and are read in initial +!! LFIFM file (in READ_FIELD) +!! - The reference state variables are initialized by SET_REF. +!! - The temporal indexes of the outputs are computed by SET_OUTPUT_TIMES +!! - The large scale sources are computed in case of coupling case by +!! INI_CPL. +!! - The initialization of the parameters needed for the dynamics +!! of the model n is realized in INI_DYNAMICS. +!! - Then the initial file (DESFM+LFIFM files) is closed by IO_File_close. +!! - The initialization of the parameters needed for the ECMWF radiation +!! code is realized in INI_RADIATIONS. +!! - The contents of the scalar variables are overwritten by +!! the chemistry initialization subroutine CH_INIT_FIELDn when +!! the flags LUSECHEM and LCH_INIT_FIELD are set to TRUE. +!! This allows easy initialization of the chemical fields at a +!! restart of the model. +!! +!! EXTERNAL +!! -------- +!! SET_DIM : to initialize dimensions +!! SET_GRID : to initialize grid +!! METRICS : to compute metric coefficients +!! READ_FIELD : to initialize field +!! FMCLOS : to close a FM-file +!! SET_REF : to initialize reference state for anelastic approximation +!! INI_DYNAMICS: to initialize parameters for the dynamics +!! INI_TKE_EPS : to initialize the TKE +!! SET_DIRCOS : to compute the director cosinus of the orography +!! INI_RADIATIONS : to initialize radiation computations +!! CH_INIT_CCS: to initialize the chemical core system +!! CH_INIT_FIELDn: to (re)initialize the scalar variables +!! INI_DEEP_CONVECTION : to initialize the deep convection scheme +!! CLEANLIST_ll : deaalocate a list +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! Module MODD_PARAMETERS : contains declaration of parameter variables +!! JPHEXT : Horizontal external points number +!! JPVEXT : Vertical external points number +!! +!! Module MODD_MODD_DYN : contains declaration of parameters +!! for the dynamics +!! Module MODD_CONF : contains declaration of configuration variables +!! for all models +!! NMODEL : Number of nested models +!! NVERB : Level of informations on output-listing +!! 0 for minimum prints +!! 5 for intermediate level of prints +!! 10 for maximum prints +!! +!! Module MODD_REF : contains declaration of reference state +!! variables for all models +!! Module MODD_FIELD_n : contains declaration of prognostic fields +!! Module MODD_LSFIELD_n : contains declaration of Larger Scale fields +!! Module MODD_GRID_n : contains declaration of spatial grid variables +!! Module MODD_TIME_n : contains declaration of temporal grid variables +!! Module MODD_REF_n : contains declaration of reference state +!! variables +!! Module MODD_CURVCOR_n : contains declaration of curvature and Coriolis +!! variables +!! Module MODD_BUDGET : contains declarations of the budget parameters +!! Module MODD_RADIATIONS_n:contains declaration of the variables of the +!! radiation interface scheme +!! Module MODD_STAND_ATM : contains declaration of the 5 standard +!! atmospheres used for the ECMWF-radiation code +!! Module MODD_FRC : contains declaration of the control variables +!! and of the forcing fields +!! Module MODD_CH_MNHC_n : contains the control parameters for chemistry +!! Module MODD_DEEP_CONVECTION_n: contains declaration of the variables of +!! the deep convection scheme +!! +!! +!! +!! +!! Module MODN_CONF_n : contains declaration of namelist NAM_CONFn and +!! uses module MODD_CONF_n (configuration variables) +!! Module MODN_LUNIT_n : contains declaration of namelist NAM_LUNITn and +!! uses module MODD_LUNIT_n (Logical units) +!! Module MODN_DYN_n : contains declaration of namelist NAM_DYNn and +!! uses module MODD_DYN_n (control of dynamics) +!! Module MODN_PARAM_n : contains declaration of namelist NAM_PARAMn and +!! uses module MODD_PARAM_n (control of physical +!! parameterization) +!! Module MODN_LBC_n : contains declaration of namelist NAM_LBCn and +!! uses module MODD_LBC_n (lateral boundaries) +!! Module MODN_TURB_n : contains declaration of namelist NAM_TURBn and +!! uses module MODD_TURB_n (turbulence scheme) +!! Module MODN_PARAM_RAD_n: contains declaration of namelist NAM_PARAM_RADn +!! +!! REFERENCE +!! --------- +!! Book2 of documentation (routine INI_MODEL_n) +!! +!! +!! AUTHOR +!! ------ +!! V. Ducrocq * Meteo France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 10/06/94 +!! Modification 17/10/94 (Stein) For LCORIO +!! Modification 20/10/94 (Stein) For SET_GRID and NAMOUTN +!! Modification 26/10/94 (Stein) Modifications of the namelist names +!! Modification 10/11/94 (Lafore) allocatation of tke fields +!! Modification 22/11/94 (Stein) change the READ_FIELDS call ( add +!! pressure function +!! Modification 06/12/94 (Stein) add the LS fields +!! 12/12/94 (Stein) rename END_INI in INI_DYNAMICS +!! Modification 09/01/95 (Stein) add the turbulence scheme +!! Modification Jan 19, 1995 (J. Cuxart) add the TKE initialization +!! Jan 23, 1995 (J. Stein ) remove the condition +!! LTHINSHELL=T LCARTESIAN=T => stop +!! Modification Feb 16, 1995 (I.Mallet) add the METRICS call and +!! change the SET_REF call (add +!! the lineic mass) +!! Modification Mar 10, 1995 (I. Mallet) add the COUPLING initialization +!! June 29,1995 (Ph. Hereil, J. Stein) add the budget init. +!! Modification Sept. 1, 1995 (S. Belair) Reading of the surface variables +!! and parameters for ISBA (i.e., add a +!! CALL READ_GR_FIELD) +!! Modification 18/08/95 (J.P.Lafore) time step change case +!! 25/09/95 (J. Cuxart and J.Stein) add LES variables +!! and the diachronic file initialization +!! Modification Sept 20,1995 (Lafore) coupling for the dry mass Md +!! Modification Sept. 12, 1995 (J.-P. Pinty) add the initialization of +!! the ECMWF radiation code +!! Modification Sept. 13, 1995 (J.-P. Pinty) control the allocation of the +!! arrays of MODD_GR_FIELD_n +!! Modification Nove. 17, 1995 (J.Stein) control of the control !! +!! March 01, 1996 (J. Stein) add the cloud fraction +!! April 03, 1996 (J. Stein) unify the ISBA and TSZ0 cases +!! Modification 13/12/95 (M. Georgelin) add the forcing variables in +!! the call read_field, and their +!! allocation. +!! Mai 23, 1996 (J. Stein) allocate XSEA in the TSZ0 case +!! June 11, 1996 (V. Masson) add XSILT and XLAKE of +!! MODD_GR_FIELD_n +!! August 7, 1996 (K. Suhre) add (re)initialization of +!! chemistry +!! Octo. 11, 1996 (J. Stein ) add XSRCT and XSRCM +!! October 8, 1996 (J. Cuxart, E. Sanchez) Moist LES diagnostics +!! and control on TKE initialization. +!! Modification 19/12/96 (J.-P. Pinty) add the ice parameterization and +!! the precipitation fields +!! Modification 11/01/97 (J.-P. Pinty) add the deep convection +!! Nov. 1, 1996 (V. Masson) Read the vertical grid kind +!! Nov. 20, 1996 (V. Masson) control of convection calling time +!! July 16, 1996 (J.P.Lafore) update of EXSEG file reading +!! Oct. 08, 1996 (J.P.Lafore, V.Masson) +!! MY_NAME and DAD_NAME reading and check +!! Oct. 30, 1996 (J.P.Lafore) resolution ratio reading for nesting +!! and Bikhardt interpolation coef. initialization +!! Nov. 22, 1996 (J.P.Lafore) allocation of LS sources for nesting +!! Feb. 26, 1997 (J.P.Lafore) allocation of "surfacic" LS fields +!! March 10, 1997 (J.P.Lafore) forcing only for model 1 +!! June 22, 1997 (J. Stein) add the absolute pressure +!! July 09, 1997 (V. Masson) add directional z0 and SSO +!! Aug. 18, 1997 (V. Masson) consistency between storage +!! type and CCONF +!! Dec. 22, 1997 (J. Stein) add the LS field spawning +!! Jan. 24, 1998 (P.Bechtold) change MODD_FRC and MODD_DEEP_CONVECTION +!! Dec. 24, 1997 (V.Masson) directional z0 parameters +!! Aug. 13, 1998 (V. Ducrocq P Jabouille) // +!! Mai. 26, 1998 (J. Stein) remove NXEND,NYEND +!! Feb. 1, 1999 (J. Stein) compute the Bikhardt +!! interpolation coeff. before the call to set_grid +!! April 5, 1999 (V. Ducrocq) change the DXRATIO_ALL init. +!! April 12, 1999 (J. Stein) cleaning + INI_SPAWN_LS +!! Apr. 7, 1999 (P Jabouille) store the metric coefficients +!! in modd_metrics_n +!! Jui. 15,1999 (P Jabouille) split the routines in two parts +!! Jan. 04,2000 (V. Masson) removes the TSZ0 case +!! Apr. 15,2000 (P Jabouille) parallelization of grid nesting +!! Aug. 20,2000 (J Stein ) tranpose XBFY +!! Jui 01,2000 (F.solmon ) adapatation for patch approach +!! Jun. 15,2000 (J.-P. Pinty) add C2R2 initialization +!! Nov. 15,2000 (V.Masson) use of ini_modeln in prep_real_case +!! Nov. 15,2000 (V.Masson) call of LES routines +!! Nov. 15,2000 (V.Masson) aircraft and balloon initialization routines +!! Jan. 22,2001 (D.Gazen) update_nsv set NSV_* var. for current model +!! Mar. 04,2002 (V.Ducrocq) initialization to temporal series +!! Mar. 15,2002 (F.Solmon) modification of ini_radiation interface +!! Nov. 29,2002 (JP Pinty) add C3R5, ICE2, ICE4, ELEC +!! Jan. 2004 (V.Masson) externalization of surface +!! May 2006 Remove KEPS +!! Apr. 2010 (M. Leriche) add pH for aqueous phase chemistry +!! Jul. 2010 (M. Leriche) add Ice phase chemistry +!! Oct. 2010 (J.Escobar) check if local domain not to small for NRIMX NRIMY +!! Nov. 2010 (J.Escobar) PGI BUG , add SIZE(CSV) to init_ground routine +!! Nov. 2009 (C. Barthe) add call to INI_ELEC_n +!! Mar. 2010 (M. Chong) add small ions +!! Apr. 2011 (M. Chong) correction of RESTART (ELEC) +!! June 2011 (B.Aouizerats) Prognostic aerosols +!! June 2011 (P.Aumond) Drag of the vegetation +!! + Mean fields +!! July 2013 (Bosseur & Filippi) Adds Forefire +!! P. Tulet Nov 2014 accumulated moles of aqueous species that fall at the surface +!! JAn. 2015 (F. Brosse) bug in allocate XACPRAQ +!! Dec 2014 (C.Lac) : For reproducibility START/RESTA +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! V. Masson Feb 2015 replaces, for aerosols, cover fractions by sea, town, bare soil fractions +!! J.Escobar : 19/04/2016 : Pb IOZ/NETCDF , missing OPARALLELIO=.FALSE. for PGD files +!! J.Escobar : 01/06/2016 : correct check limit of NRIM versus local subdomain size IDIM +!! 06/2016 (G.Delautier) phasage surfex 8 +!! Modification 01/2016 (JP Pinty) Add LIMA +!! Aug. 2016 (J.Pianezze) Add SFX_OASIS_READ_NAM function from SurfEx +!! M.Leriche 2016 Chemistry +!! 10/2016 M.Mazoyer New KHKO output fields +!! 10/2016 (C.Lac) Add max values +!! F. Brosse Oct. 2016 add prod/loss terms computation for chemistry +!! M.Leriche 2016 Chemistry +!! M.Leriche 10/02/17 prevent negative values in LBX(Y)SVS +!! M.Leriche 01/07/2017 Add DIAG chimical surface fluxes +!! 09/2017 Q.Rodier add LTEND_UV_FRC +!! 02/2018 Q.Libois ECRAD +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +!! V. Vionnet : 18/07/2017 : add blowing snow scheme +!! 01/18 J.Colin Add DRAG +! P. Wautelet 29/01/2019: bug: add missing zero-size allocations +! P. Wautelet 07/02/2019: force TYPE to a known value for IO_File_add2list +! P. Wautelet 13/02/2019: initialize XALBUV even if no radiation (needed in CH_INTERP_JVALUES) +! P. Wautelet 13/02/2019: removed PPABSM and PTSTEP dummy arguments of READ_FIELD +! P. Wautelet 14/02/2019: remove CLUOUT/CLUOUT0 and associated variables +! P. Wautelet 14/02/2019: remove HINIFILE dummy argument from INI_RADIATIONS_ECMWF/ECRAD +!! 02/2019 C.Lac add rain fraction as an output field +!! Bielli S. 02/2019 Sea salt : significant sea wave height influences salt emission; 5 salt modes +! P. Wautelet 14/03/2019: correct ZWS when variable not present in file (set to XZWS_DEFAULT) +! P. Wautelet 10/04/2019: replace ABORT and STOP calls by Print_msg +! P. Wautelet 19/04/2019: removed unused dummy arguments and variables +! P. Wautelet 07/06/2019: allocate lookup tables for optical properties only when needed +! P. Wautelet 13/09/2019: budget: simplify and modernize date/time management +! C. Lac 11/2019: correction in the drag formula and application to building in addition to tree +! S. Riette 04/2020: XHL* fields +! F. Auguste 02/2021: add IBM +! T.Nigel 02/2021: add turbulence recycling +! J.L.Redelsperger 06/2011: OCEAN case +! A. Costes 12/2021: Blaze fire model +!--------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +#ifdef MNH_ECRAD +USE YOERDI, only: RCCO2 +#endif + +USE MODD_2D_FRC +USE MODD_ADVFRC_n +USE MODD_ADV_n +use MODD_AEROSET, only: POLYTAU, POLYSSA, POLYG +USE MODD_ARGSLIST_ll, only: LIST_ll +USE MODD_BIKHARDT_n +USE MODD_BLOWSNOW +USE MODD_BLOWSNOW_n +USE MODD_BUDGET +USE MODD_CH_AERO_n, only: XSOLORG,XMI +USE MODD_CH_AEROSOL, only: LORILAM +USE MODD_CH_BUDGET_n +USE MODD_CH_FLX_n, only: XCHFLX +USE MODD_CH_M9_n, only:NNONZEROTERMS +USE MODD_CH_MNHC_n, only: LUSECHEM, LUSECHAQ, LUSECHIC, LCH_INIT_FIELD, & + LCH_CONV_LINOX, XCH_TUV_DOBNEW, LCH_PH +USE MODD_CH_PH_n +USE MODD_CH_PRODLOSSTOT_n +USE MODD_CLOUD_MF_n +USE MODD_CONF +USE MODD_CONF_n +USE MODD_CST +USE MODD_CTURB +USE MODD_CURVCOR_n +USE MODD_DEEP_CONVECTION_n +USE MODD_DEF_EDDY_FLUX_n ! for VT and WT fluxes +USE MODD_DEF_EDDYUV_FLUX_n ! FOR UV +USE MODD_DIAG_FLAG, only: LCHEMDIAG, CSPEC_BU_DIAG +USE MODD_DIM_n +USE MODD_DRAG_n +USE MODD_DRAGTREE_n +USE MODD_DUST +use MODD_DUST_OPT_LKT, only: NMAX_RADIUS_LKT_DUST=>NMAX_RADIUS_LKT, NMAX_SIGMA_LKT_DUST=>NMAX_SIGMA_LKT, & + NMAX_WVL_SW_DUST=>NMAX_WVL_SW, & + XEXT_COEFF_WVL_LKT_DUST=>XEXT_COEFF_WVL_LKT, XEXT_COEFF_550_LKT_DUST=>XEXT_COEFF_550_LKT, & + XPIZA_LKT_DUST=>XPIZA_LKT, XCGA_LKT_DUST=>XCGA_LKT +USE MODD_DYN +USE MODD_DYN_n +USE MODD_DYNZD +USE MODD_DYNZD_n +USE MODD_ELEC_n, only: XCION_POS_FW, XCION_NEG_FW +USE MODD_EOL_MAIN +USE MODD_FIELD_n +#ifdef MNH_FOREFIRE +USE MODD_FOREFIRE +USE MODD_FOREFIRE_n +#endif +USE MODD_FRC +USE MODD_FRC_n +USE MODD_GET_n +USE MODD_GRID_n +USE MODD_GRID, only: XLONORI,XLATORI +USE MODD_IBM_PARAM_n, only: LIBM, XIBM_IEPS, XIBM_LS, XIBM_XMUT +USE MODD_IO, only: CIO_DIR, TFILEDATA, TFILE_DUMMY +USE MODD_IO_SURF_MNH, only: IO_SURF_MNH_MODEL +USE MODD_LATZ_EDFLX +USE MODD_LBC_n, only: CLBCX, CLBCY +use modd_les +USE MODD_LSFIELD_n +USE MODD_LUNIT_n +USE MODD_MEAN_FIELD +USE MODD_MEAN_FIELD_n +USE MODD_METRICS_n +USE MODD_MNH_SURFEX_n +USE MODD_NESTING, only: CDAD_NAME, NDAD, NDT_2_WAY, NDTRATIO, NDXRATIO_ALL, NDYRATIO_ALL +USE MODD_NSV +USE MODD_NSV +USE MODD_NUDGING_n, only: LNUDGING +USE MODD_OCEANH +USE MODD_OUT_n +USE MODD_PARAMETERS +USE MODD_PARAM_KAFR_n +USE MODD_PARAM_MFSHALL_n +USE MODD_PARAM_n +USE MODD_PARAM_RAD_n, only: CAER, CAOP, CLW +USE MODD_PASPOL +USE MODD_PASPOL_n +USE MODD_PAST_FIELD_n +use modd_precision, only: LFIINT +USE MODD_RADIATIONS_n +USE MODD_RECYCL_PARAM_n +USE MODD_REF +USE MODD_REF_n +USE MODD_RELFRC_n +use MODD_SALT, only: LSALT +use MODD_SALT_OPT_LKT, only: NMAX_RADIUS_LKT_SALT=>NMAX_RADIUS_LKT, NMAX_SIGMA_LKT_SALT=>NMAX_SIGMA_LKT, & + NMAX_WVL_SW_SALT=>NMAX_WVL_SW, & + XEXT_COEFF_WVL_LKT_SALT=>XEXT_COEFF_WVL_LKT, XEXT_COEFF_550_LKT_SALT=>XEXT_COEFF_550_LKT, & + XPIZA_LKT_SALT=>XPIZA_LKT, XCGA_LKT_SALT=>XCGA_LKT +USE MODD_SERIES, only: LSERIES +USE MODD_SHADOWS_n +USE MODD_STAND_ATM, only: XSTROATM, XSMLSATM, XSMLWATM, XSPOSATM, XSPOWATM +USE MODD_TIME +USE MODD_TIME_n +USE MODD_TURB_CLOUD, only: NMODEL_CLOUD, CTURBLEN_CLOUD,XCEI +USE MODD_TURB_n +USE MODD_NEB_n, only: LSUBG_COND, LSTATNW +USE MODD_VAR_ll, only: IP + +USE MODE_GATHER_ll +use mode_ini_budget, only: Budget_preallocate, Ini_budget +USE MODE_INI_ONE_WAY_n +USE MODE_IO +USE MODE_IO_FIELD_READ, only: IO_Field_read +USE MODE_IO_FILE, only: IO_File_open +USE MODE_IO_MANAGE_STRUCT, only: IO_File_add2list +USE MODE_ll +USE MODE_MODELN_HANDLER +USE MODE_MPPDB +USE MODE_MSG +USE MODE_SPLITTINGZ_ll, only: GET_DIM_EXTZ_ll +USE MODE_TYPE_ZDIFFU +USE MODE_FIELD, ONLY: INI_FIELD_LIST + +USE MODI_CH_AER_MOD_INIT +USE MODI_CH_INIT_BUDGET_n +USE MODI_CH_INIT_FIELD_n +USE MODI_CH_INIT_JVALUES +USE MODI_CH_INIT_PRODLOSSTOT_n +USE MODI_GET_SIZEX_LB +USE MODI_GET_SIZEY_LB +USE MODI_INI_AEROSET1 +USE MODI_INI_AEROSET2 +USE MODI_INI_AEROSET3 +USE MODI_INI_AEROSET4 +USE MODI_INI_AEROSET5 +USE MODI_INI_AEROSET6 +USE MODI_INI_AIRCRAFT_BALLOON +USE MODI_INI_AIRCRAFT_BALLOON +USE MODI_INI_BIKHARDT_n +USE MODI_INI_CPL +USE MODI_INI_DEEP_CONVECTION +USE MODI_INI_DRAG +USE MODI_INI_DYNAMICS +USE MODI_INI_ELEC_n +USE MODI_INI_EOL_ADNR +USE MODI_INI_EOL_ALM +USE MODI_INI_LES_N +USE MODI_INI_LG +USE MODI_INI_LW_SETUP +USE MODI_INI_MICRO_n +USE MODE_INI_TURB, ONLY: INI_TURB +USE MODE_INI_MFSHALL, ONLY: INI_MFSHALL +USE MODI_INI_POSPROFILER_n +USE MODI_INI_RADIATIONS +USE MODI_INI_RADIATIONS_ECMWF +USE MODI_INI_RADIATIONS_ECRAD +USE MODI_INI_SERIES_N +USE MODI_INI_SPAWN_LS_n +USE MODI_INI_SURF_RAD +USE MODI_INI_SURFSTATION_n +USE MODI_INI_SW_SETUP +USE MODI_INIT_AEROSOL_PROPERTIES +#ifdef MNH_FOREFIRE +USE MODI_INIT_FOREFIRE_n +#endif +USE MODI_INIT_GROUND_PARAM_n +USE MODI_INI_TKE_EPS +USE MODI_METRICS +USE MODI_MNHGET_SURF_PARAM_n +USE MODI_MNHREAD_ZS_DUMMY_n +USE MODI_READ_FIELD +USE MODI_SET_DIRCOS +USE MODI_SET_GRID +USE MODI_SET_REF +#ifdef CPLOASIS +USE MODI_SFX_OASIS_READ_NAM +#endif +USE MODI_SUNPOS_n +USE MODI_SURF_SOLAR_GEOM +USE MODI_UPDATE_METRICS +USE MODI_UPDATE_NSV +#ifdef MNH_ECRAD +#if ( VER_ECRAD == 140 ) +USE YOERDI , ONLY :RCCO2 +#endif +#endif +! +USE MODD_FIRE +IMPLICIT NONE +! +!* 0.1 declarations of arguments +! +! +INTEGER, INTENT(IN) :: KMI ! Model Index +TYPE(TFILEDATA), INTENT(IN) :: TPINIFILE ! Initial file +! +!* 0.2 declarations of local variables +! +REAL, PARAMETER :: NALBUV_DEFAULT = 0.01 ! Arbitrary low value for XALBUV +! +INTEGER :: JSV ! Loop index +INTEGER :: IRESP ! Return code of FM routines +INTEGER :: ILUOUT ! Logical unit number of output-listing +CHARACTER(LEN=28) :: YNAME +INTEGER :: IIU ! Upper dimension in x direction (local) +INTEGER :: IJU ! Upper dimension in y direction (local) +INTEGER :: IIU_ll ! Upper dimension in x direction (global) +INTEGER :: IJU_ll ! Upper dimension in y direction (global) +INTEGER :: IKU ! Upper dimension in z direction +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZJ ! Jacobian +LOGICAL :: GINIDCONV ! logical switch for the deep convection + ! initialization +LOGICAL :: GINIRAD ! logical switch for the radiation + ! initialization +logical :: gles ! Logical to determine if LES diagnostics are enabled +! +! +TYPE(LIST_ll), POINTER :: TZINITHALO2D_ll ! pointer for the list of 2D fields + ! which must be communicated in INIT +TYPE(LIST_ll), POINTER :: TZINITHALO3D_ll ! pointer for the list of 3D fields + ! which must be communicated in INIT +! +INTEGER :: IISIZEXF,IJSIZEXF,IISIZEXFU,IJSIZEXFU ! dimensions of the +INTEGER :: IISIZEX4,IJSIZEX4,IISIZEX2,IJSIZEX2 ! West-east LB arrays +INTEGER :: IISIZEYF,IJSIZEYF,IISIZEYFV,IJSIZEYFV ! dimensions of the +INTEGER :: IISIZEY4,IJSIZEY4,IISIZEY2,IJSIZEY2 ! North-south LB arrays +INTEGER :: IINFO_ll ! Return code of //routines +INTEGER :: IIY,IJY +INTEGER :: IIU_B,IJU_B +INTEGER :: IIU_SXP2_YP1_Z_ll,IJU_SXP2_YP1_Z_ll,IKU_SXP2_YP1_Z_ll +! +REAL, DIMENSION(:,:), ALLOCATABLE :: ZCO2 ! CO2 concentration near the surface +REAL, DIMENSION(:,:), ALLOCATABLE :: ZSEA ! sea fraction +REAL, DIMENSION(:,:), ALLOCATABLE :: ZTOWN ! town fraction +REAL, DIMENSION(:,:), ALLOCATABLE :: ZBARE ! bare soil fraction +! +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDIR_ALB ! direct albedo +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZSCA_ALB ! diffuse albedo +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZEMIS ! emissivity +REAL, DIMENSION(:,:), ALLOCATABLE :: ZTSRAD ! surface temperature +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZIBM_LS ! LevelSet IBM +! +! +INTEGER, DIMENSION(:,:),ALLOCATABLE :: IINDEX ! indices of non-zero terms +INTEGER, DIMENSION(:),ALLOCATABLE :: IIND +INTEGER :: JM, JT +! +!------------------------------------------ +! Dummy pointers needed to correct an ifort Bug +REAL, DIMENSION(:), POINTER :: DPTR_XZHAT +REAL, DIMENSION(:), POINTER :: DPTR_XBMX1,DPTR_XBMX2,DPTR_XBMX3,DPTR_XBMX4 +REAL, DIMENSION(:), POINTER :: DPTR_XBMY1,DPTR_XBMY2,DPTR_XBMY3,DPTR_XBMY4 +REAL, DIMENSION(:), POINTER :: DPTR_XBFX1,DPTR_XBFX2,DPTR_XBFX3,DPTR_XBFX4 +REAL, DIMENSION(:), POINTER :: DPTR_XBFY1,DPTR_XBFY2,DPTR_XBFY3,DPTR_XBFY4 +CHARACTER(LEN=4), DIMENSION(:), POINTER :: DPTR_CLBCX,DPTR_CLBCY +INTEGER, DIMENSION(:,:,:), POINTER :: DPTR_NKLIN_LBXU,DPTR_NKLIN_LBYU,DPTR_NKLIN_LBXV,DPTR_NKLIN_LBYV +INTEGER, DIMENSION(:,:,:), POINTER :: DPTR_NKLIN_LBXW,DPTR_NKLIN_LBYW,DPTR_NKLIN_LBXM,DPTR_NKLIN_LBYM +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XCOEFLIN_LBXU,DPTR_XCOEFLIN_LBYU +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XCOEFLIN_LBXV,DPTR_XCOEFLIN_LBYV +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XCOEFLIN_LBXW,DPTR_XCOEFLIN_LBYW +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XCOEFLIN_LBXM,DPTR_XCOEFLIN_LBYM +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XLBXUM,DPTR_XLBYUM,DPTR_XLBXVM,DPTR_XLBYVM +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XLBXWM,DPTR_XLBYWM,DPTR_XLBXTHM,DPTR_XLBYTHM +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XLBXTKEM,DPTR_XLBYTKEM +REAL, DIMENSION(:,:,:,:), POINTER :: DPTR_XLBXSVM,DPTR_XLBYSVM +REAL, DIMENSION(:,:,:,:), POINTER :: DPTR_XLBXRM,DPTR_XLBYRM +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XZZ +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XLSUM,DPTR_XLSVM,DPTR_XLSWM,DPTR_XLSTHM,DPTR_XLSRVM +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XLSUS,DPTR_XLSVS,DPTR_XLSWS,DPTR_XLSTHS,DPTR_XLSRVS +REAL, DIMENSION(:,:), POINTER :: DPTR_XLSZWSM,DPTR_XLSZWSS +! +INTEGER :: IIB,IJB,IIE,IJE,IDIMX,IDIMY,IMI +! Fire model +INTEGER :: INBPARAMSENSIBLE, INBPARAMLATENT +!------------------------------------------------------------------------------- +! +!* 0. PROLOGUE +! -------- +! Compute relaxation coefficients without changing INI_DYNAMICS nor RELAXDEF +! +IF (CCLOUD == 'LIMA') THEN + LHORELAX_SVC1R3=LHORELAX_SVLIMA +END IF +! +! UPDATE CONSTANTS FOR OCEAN MODEL +IF (LOCEAN) THEN + XP00=XP00OCEAN + XTH00=XTH00OCEAN +END IF +! +! +NULLIFY(TZINITHALO2D_ll) +NULLIFY(TZINITHALO3D_ll) +! +!* 1. RETRIEVE LOGICAL UNIT NUMBER +! ---------------------------- +! +ILUOUT = TLUOUT%NLU +! +!------------------------------------------------------------------------------- +! +!* 2. END OF READING +! -------------- +!* 2.1 Read number of forcing fields +! +IF (LFORCING) THEN ! Retrieve the number of time-dependent forcings. + CALL IO_Field_read(TPINIFILE,'FRC',NFRC,IRESP) + IF ( (IRESP /= 0) .OR. (NFRC <=0) ) THEN + WRITE(ILUOUT,'(A/A)') & + "INI_MODEL_n ERROR: you want to read forcing variables from FMfile", & + " but no fields have been found by IO_Field_read" +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_MODEL_n','') + END IF +END IF +! +! Modif PP for time evolving adv forcing + IF ( L2D_ADV_FRC ) THEN ! Retrieve the number of time-dependent forcings. + WRITE(ILUOUT,FMT=*) "INI_MODEL_n ENTER ADV_FORCING" + CALL IO_Field_read(TPINIFILE,'NADVFRC1',NADVFRC,IRESP) + IF ( (IRESP /= 0) .OR. (NADVFRC <=0) ) THEN + WRITE(ILUOUT,'(A/A)') & + "INI_MODELn ERROR: you want to read forcing ADV variables from FMfile", & + " but no fields have been found by IO_Field_read" + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_MODEL_n','') + END IF + WRITE(ILUOUT,*) 'NADVFRC = ', NADVFRC +END IF +! +IF ( L2D_REL_FRC ) THEN ! Retrieve the number of time-dependent forcings. + WRITE(ILUOUT,FMT=*) "INI_MODEL_n ENTER REL_FORCING" + CALL IO_Field_read(TPINIFILE,'NRELFRC1',NRELFRC,IRESP) + IF ( (IRESP /= 0) .OR. (NRELFRC <=0) ) THEN + WRITE(ILUOUT,'(A/A)') & + "INI_MODELn ERROR: you want to read forcing REL variables from FMfile", & + " but no fields have been found by IO_Field_read" + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_MODEL_n','') + END IF + WRITE(ILUOUT,*) 'NRELFRC = ', NRELFRC +END IF +!* 2.2 Checks the position of vertical absorbing layer +! +IKU=NKMAX+2*JPVEXT +! +ALLOCATE(XZHAT(IKU)) +CALL IO_Field_read(TPINIFILE,'ZHAT',XZHAT) +CALL IO_Field_read(TPINIFILE,'ZTOP',XZTOP) +IF (XALZBOT>=XZHAT(IKU) .AND. LVE_RELAX) THEN + WRITE(ILUOUT,FMT=*) "INI_MODEL_n ERROR: you want to use vertical relaxation" + WRITE(ILUOUT,FMT=*) " but bottom of layer XALZBOT(",XALZBOT,")" + WRITE(ILUOUT,FMT=*) " is upper than model top (",XZHAT(IKU),")" +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_MODEL_n','') +END IF +IF (LVE_RELAX) THEN + IF (XALZBOT>=XZHAT(IKU-4) ) THEN + WRITE(ILUOUT,FMT=*) "INI_MODEL_n WARNING: you want to use vertical relaxation" + WRITE(ILUOUT,FMT=*) " but the layer defined by XALZBOT(",XALZBOT,")" + WRITE(ILUOUT,FMT=*) " contains less than 5 model levels" + END IF +END IF +DEALLOCATE(XZHAT) +! +!* 2.3 Compute sizes of arrays of the extended sub-domain +! +CALL GET_DIM_EXT_ll('B',IIU,IJU) +IIU_ll=NIMAX_ll + 2 * JPHEXT +IJU_ll=NJMAX_ll + 2 * JPHEXT +! initialize NIMAX and NJMAX for not updated versions regarding the parallelism +! spawning,... +CALL GET_DIM_PHYS_ll('B',NIMAX,NJMAX) +! +CALL GET_INDICE_ll( IIB,IJB,IIE,IJE) +IDIMX = IIE - IIB + 1 +IDIMY = IJE - IJB + 1 +! +NRR=0 +NRRL=0 +NRRI=0 +IF (CGETRVT /= 'SKIP' ) THEN + NRR = NRR+1 + IDX_RVT = NRR +END IF +IF (CGETRCT /= 'SKIP' ) THEN + NRR = NRR+1 + NRRL = NRRL+1 + IDX_RCT = NRR +END IF +IF (CGETRRT /= 'SKIP' ) THEN + NRR = NRR+1 + NRRL = NRRL+1 + IDX_RRT = NRR +END IF +IF (CGETRIT /= 'SKIP' ) THEN + NRR = NRR+1 + NRRI = NRRI+1 + IDX_RIT = NRR +END IF +IF (CGETRST /= 'SKIP' ) THEN + NRR = NRR+1 + NRRI = NRRI+1 + IDX_RST = NRR +END IF +IF (CGETRGT /= 'SKIP' ) THEN + NRR = NRR+1 + NRRI = NRRI+1 + IDX_RGT = NRR +END IF +IF (CGETRHT /= 'SKIP' ) THEN + NRR = NRR+1 + NRRI = NRRI+1 + IDX_RHT = NRR +END IF +IF (NVERB >= 5) THEN + WRITE (UNIT=ILUOUT,FMT='("THERE ARE ",I2," WATER VARIABLES")') NRR + WRITE (UNIT=ILUOUT,FMT='("THERE ARE ",I2," LIQUID VARIABLES")') NRRL + WRITE (UNIT=ILUOUT,FMT='("THERE ARE ",I2," SOLID VARIABLES")') NRRI +END IF +! +!* 2.4 Update NSV and floating indices for the current model +! +! +CALL UPDATE_NSV(KMI) +! +!------------------------------------------------------------------------------- +! +!* 3. ALLOCATE MEMORY +! ----------------- +! * Module RECYCL +! +IF (LRECYCL) THEN +! + NR_COUNT = 0 +! + ALLOCATE(XUMEANW(IJU,IKU,INT(XNUMBELT))) ; XUMEANW = 0.0 + ALLOCATE(XVMEANW(IJU,IKU,INT(XNUMBELT))) ; XVMEANW = 0.0 + ALLOCATE(XWMEANW(IJU,IKU,INT(XNUMBELT))) ; XWMEANW = 0.0 + ALLOCATE(XUMEANN(IIU,IKU,INT(XNUMBELT))) ; XUMEANN = 0.0 + ALLOCATE(XVMEANN(IIU,IKU,INT(XNUMBELT))) ; XVMEANN = 0.0 + ALLOCATE(XWMEANN(IIU,IKU,INT(XNUMBELT))) ; XWMEANN = 0.0 + ALLOCATE(XUMEANE(IJU,IKU,INT(XNUMBELT))) ; XUMEANE = 0.0 + ALLOCATE(XVMEANE(IJU,IKU,INT(XNUMBELT))) ; XVMEANE = 0.0 + ALLOCATE(XWMEANE(IJU,IKU,INT(XNUMBELT))) ; XWMEANE = 0.0 + ALLOCATE(XUMEANS(IIU,IKU,INT(XNUMBELT))) ; XUMEANS = 0.0 + ALLOCATE(XVMEANS(IIU,IKU,INT(XNUMBELT))) ; XVMEANS = 0.0 + ALLOCATE(XWMEANS(IIU,IKU,INT(XNUMBELT))) ; XWMEANS = 0.0 + ALLOCATE(XTBV(IIU,IJU,IKU)) ; XTBV = 0.0 +ELSE + ALLOCATE(XUMEANW(0,0,0)) + ALLOCATE(XVMEANW(0,0,0)) + ALLOCATE(XWMEANW(0,0,0)) + ALLOCATE(XUMEANN(0,0,0)) + ALLOCATE(XVMEANN(0,0,0)) + ALLOCATE(XWMEANN(0,0,0)) + ALLOCATE(XUMEANE(0,0,0)) + ALLOCATE(XVMEANE(0,0,0)) + ALLOCATE(XWMEANE(0,0,0)) + ALLOCATE(XUMEANS(0,0,0)) + ALLOCATE(XVMEANS(0,0,0)) + ALLOCATE(XWMEANS(0,0,0)) + ALLOCATE(XTBV (0,0,0)) +END IF +! +! +!* 3.1 Module MODD_FIELD_n +! +IF (LMEAN_FIELD) THEN +! + MEAN_COUNT = 0 +! + ALLOCATE(XUM_MEAN(IIU,IJU,IKU)) ; XUM_MEAN = 0.0 + ALLOCATE(XVM_MEAN(IIU,IJU,IKU)) ; XVM_MEAN = 0.0 + ALLOCATE(XWM_MEAN(IIU,IJU,IKU)) ; XWM_MEAN = 0.0 + ALLOCATE(XTHM_MEAN(IIU,IJU,IKU)) ; XTHM_MEAN = 0.0 + ALLOCATE(XTEMPM_MEAN(IIU,IJU,IKU)) ; XTEMPM_MEAN = 0.0 + ALLOCATE(XSVT_MEAN(IIU,IJU,IKU)) ; XSVT_MEAN = 0.0 + IF (CTURB/='NONE') THEN + ALLOCATE(XTKEM_MEAN(IIU,IJU,IKU)) + XTKEM_MEAN = 0.0 + ELSE + ALLOCATE(XTKEM_MEAN(0,0,0)) + END IF + ALLOCATE(XPABSM_MEAN(IIU,IJU,IKU)) ; XPABSM_MEAN = 0.0 +! + ALLOCATE(XU2_M2(IIU,IJU,IKU)) ; XU2_M2 = 0.0 +! + ALLOCATE(XU2_M2(IIU,IJU,IKU)) ; XU2_M2 = 0.0 + ALLOCATE(XV2_M2(IIU,IJU,IKU)) ; XV2_M2 = 0.0 + ALLOCATE(XW2_M2(IIU,IJU,IKU)) ; XW2_M2 = 0.0 + ALLOCATE(XTH2_M2(IIU,IJU,IKU)) ; XTH2_M2 = 0.0 + ALLOCATE(XTEMP2_M2(IIU,IJU,IKU)) ; XTEMP2_M2 = 0.0 + ALLOCATE(XPABS2_M2(IIU,IJU,IKU)) ; XPABS2_M2 = 0.0 +! + IF (LCOV_FIELD) THEN + ALLOCATE(XUV_MEAN(IIU,IJU,IKU)) ; XUV_MEAN = 0.0 + ALLOCATE(XUW_MEAN(IIU,IJU,IKU)) ; XUW_MEAN = 0.0 + ALLOCATE(XVW_MEAN(IIU,IJU,IKU)) ; XVW_MEAN = 0.0 + ALLOCATE(XWTH_MEAN(IIU,IJU,IKU)) ; XWTH_MEAN = 0.0 + END IF +! + ALLOCATE(XUM_MAX(IIU,IJU,IKU)) ; XUM_MAX = -1.E20 + ALLOCATE(XVM_MAX(IIU,IJU,IKU)) ; XVM_MAX = -1.E20 + ALLOCATE(XWM_MAX(IIU,IJU,IKU)) ; XWM_MAX = -1.E20 + ALLOCATE(XTHM_MAX(IIU,IJU,IKU)) ; XTHM_MAX = 0.0 + ALLOCATE(XTEMPM_MAX(IIU,IJU,IKU)) ; XTEMPM_MAX = 0.0 + IF (CTURB/='NONE') THEN + ALLOCATE(XTKEM_MAX(IIU,IJU,IKU)) + XTKEM_MAX = 0.0 + ELSE + ALLOCATE(XTKEM_MAX(0,0,0)) + END IF + ALLOCATE(XPABSM_MAX(IIU,IJU,IKU)) ; XPABSM_MAX = 0.0 +ELSE +! + ALLOCATE(XUM_MEAN(0,0,0)) + ALLOCATE(XVM_MEAN(0,0,0)) + ALLOCATE(XWM_MEAN(0,0,0)) + ALLOCATE(XTHM_MEAN(0,0,0)) + ALLOCATE(XTEMPM_MEAN(0,0,0)) + ALLOCATE(XSVT_MEAN(0,0,0)) + ALLOCATE(XTKEM_MEAN(0,0,0)) + ALLOCATE(XPABSM_MEAN(0,0,0)) +! + ALLOCATE(XU2_M2(0,0,0)) + ALLOCATE(XV2_M2(0,0,0)) + ALLOCATE(XW2_M2(0,0,0)) + ALLOCATE(XTH2_M2(0,0,0)) + ALLOCATE(XTEMP2_M2(0,0,0)) + ALLOCATE(XPABS2_M2(0,0,0)) +! + IF (LCOV_FIELD) THEN + ALLOCATE(XUV_MEAN(0,0,0)) + ALLOCATE(XUW_MEAN(0,0,0)) + ALLOCATE(XVW_MEAN(0,0,0)) + ALLOCATE(XWTH_MEAN(0,0,0)) + END IF +! + ALLOCATE(XUM_MAX(0,0,0)) + ALLOCATE(XVM_MAX(0,0,0)) + ALLOCATE(XWM_MAX(0,0,0)) + ALLOCATE(XTHM_MAX(0,0,0)) + ALLOCATE(XTEMPM_MAX(0,0,0)) + ALLOCATE(XTKEM_MAX(0,0,0)) + ALLOCATE(XPABSM_MAX(0,0,0)) +END IF +! +IF ((CUVW_ADV_SCHEME(1:3)=='CEN') .AND. (CTEMP_SCHEME == 'LEFR') ) THEN + ALLOCATE(XUM(IIU,IJU,IKU)) + ALLOCATE(XVM(IIU,IJU,IKU)) + ALLOCATE(XWM(IIU,IJU,IKU)) + ALLOCATE(XDUM(IIU,IJU,IKU)) + ALLOCATE(XDVM(IIU,IJU,IKU)) + ALLOCATE(XDWM(IIU,IJU,IKU)) + IF (CCONF == 'START') THEN + XUM = 0.0 + XVM = 0.0 + XWM = 0.0 + XDUM = 0.0 + XDVM = 0.0 + XDWM = 0.0 + END IF +ELSE + ALLOCATE(XUM(0,0,0)) + ALLOCATE(XVM(0,0,0)) + ALLOCATE(XWM(0,0,0)) + ALLOCATE(XDUM(0,0,0)) + ALLOCATE(XDVM(0,0,0)) + ALLOCATE(XDWM(0,0,0)) +END IF +! +ALLOCATE(XUT(IIU,IJU,IKU)) ; XUT = 0.0 +ALLOCATE(XVT(IIU,IJU,IKU)) ; XVT = 0.0 +ALLOCATE(XWT(IIU,IJU,IKU)) ; XWT = 0.0 +ALLOCATE(XTHT(IIU,IJU,IKU)) ; XTHT = 0.0 +ALLOCATE(XRUS(IIU,IJU,IKU)) ; XRUS = 0.0 +ALLOCATE(XRVS(IIU,IJU,IKU)) ; XRVS = 0.0 +ALLOCATE(XRWS(IIU,IJU,IKU)) ; XRWS = 0.0 +ALLOCATE(XRUS_PRES(IIU,IJU,IKU)); XRUS_PRES = 0.0 +ALLOCATE(XRVS_PRES(IIU,IJU,IKU)); XRVS_PRES = 0.0 +ALLOCATE(XRWS_PRES(IIU,IJU,IKU)); XRWS_PRES = 0.0 +ALLOCATE(XRTHS(IIU,IJU,IKU)) ; XRTHS = 0.0 +ALLOCATE(XRTHS_CLD(IIU,IJU,IKU)); XRTHS_CLD = 0.0 + +IF ( LIBM ) THEN + ALLOCATE(ZIBM_LS(IIU,IJU,IKU)) ; ZIBM_LS = 0.0 + ALLOCATE(XIBM_XMUT(IIU,IJU,IKU)); XIBM_XMUT = 0.0 +ELSE + ALLOCATE(ZIBM_LS (0,0,0)) + ALLOCATE(XIBM_XMUT(0,0,0)) +END IF + +IF ( LRECYCL ) THEN + ALLOCATE(XFLUCTUNW(IJU,IKU)) ; XFLUCTUNW = 0.0 + ALLOCATE(XFLUCTVNN(IIU,IKU)) ; XFLUCTVNN = 0.0 + ALLOCATE(XFLUCTUTN(IIU,IKU)) ; XFLUCTUTN = 0.0 + ALLOCATE(XFLUCTVTW(IJU,IKU)) ; XFLUCTVTW = 0.0 + ALLOCATE(XFLUCTUNE(IJU,IKU)) ; XFLUCTUNE = 0.0 + ALLOCATE(XFLUCTVNS(IIU,IKU)) ; XFLUCTVNS = 0.0 + ALLOCATE(XFLUCTUTS(IIU,IKU)) ; XFLUCTUTS = 0.0 + ALLOCATE(XFLUCTVTE(IJU,IKU)) ; XFLUCTVTE = 0.0 + ALLOCATE(XFLUCTWTW(IJU,IKU)) ; XFLUCTWTW = 0.0 + ALLOCATE(XFLUCTWTN(IIU,IKU)) ; XFLUCTWTN = 0.0 + ALLOCATE(XFLUCTWTE(IJU,IKU)) ; XFLUCTWTE = 0.0 + ALLOCATE(XFLUCTWTS(IIU,IKU)) ; XFLUCTWTS = 0.0 +ELSE + ALLOCATE(XFLUCTUNW(0,0)) + ALLOCATE(XFLUCTVNN(0,0)) + ALLOCATE(XFLUCTUTN(0,0)) + ALLOCATE(XFLUCTVTW(0,0)) + ALLOCATE(XFLUCTUNE(0,0)) + ALLOCATE(XFLUCTVNS(0,0)) + ALLOCATE(XFLUCTUTS(0,0)) + ALLOCATE(XFLUCTVTE(0,0)) + ALLOCATE(XFLUCTWTW(0,0)) + ALLOCATE(XFLUCTWTN(0,0)) + ALLOCATE(XFLUCTWTE(0,0)) + ALLOCATE(XFLUCTWTS(0,0)) +END IF +! +IF (CTURB /= 'NONE') THEN + ALLOCATE(XTKET(IIU,IJU,IKU)) + ALLOCATE(XRTKES(IIU,IJU,IKU)) + ALLOCATE(XRTKEMS(IIU,IJU,IKU)); XRTKEMS = 0.0 + ALLOCATE(XWTHVMF(IIU,IJU,IKU)) + ALLOCATE(XDYP(IIU,IJU,IKU)) + ALLOCATE(XTHP(IIU,IJU,IKU)) + ALLOCATE(XTR(IIU,IJU,IKU)) + ALLOCATE(XDISS(IIU,IJU,IKU)) + ALLOCATE(XLEM(IIU,IJU,IKU)) +ELSE + ALLOCATE(XTKET(0,0,0)) + ALLOCATE(XRTKES(0,0,0)) + ALLOCATE(XRTKEMS(0,0,0)) + ALLOCATE(XWTHVMF(0,0,0)) + ALLOCATE(XDYP(0,0,0)) + ALLOCATE(XTHP(0,0,0)) + ALLOCATE(XTR(0,0,0)) + ALLOCATE(XDISS(0,0,0)) + ALLOCATE(XLEM(0,0,0)) +END IF +IF (CTOM == 'TM06') THEN + ALLOCATE(XBL_DEPTH(IIU,IJU)) +ELSE + ALLOCATE(XBL_DEPTH(0,0)) +END IF +IF (LRMC01) THEN + ALLOCATE(XSBL_DEPTH(IIU,IJU)) +ELSE + ALLOCATE(XSBL_DEPTH(0,0)) +END IF +! +ALLOCATE(XPABSM(IIU,IJU,IKU)) ; XPABSM = 0.0 +ALLOCATE(XPABST(IIU,IJU,IKU)) ; XPABST = 0.0 +! +ALLOCATE(XRT(IIU,IJU,IKU,NRR)) ; XRT = 0.0 +ALLOCATE(XRRS(IIU,IJU,IKU,NRR)) ; XRRS = 0.0 +ALLOCATE(XRRS_CLD(IIU,IJU,IKU,NRR)); XRRS_CLD = 0.0 +! +IF (CTURB /= 'NONE' .AND. NRR>1) THEN + ALLOCATE(XSRCT(IIU,IJU,IKU)) + ALLOCATE(XSIGS(IIU,IJU,IKU)) +ELSE + ALLOCATE(XSRCT(0,0,0)) + ALLOCATE(XSIGS(0,0,0)) +END IF +IF (CCLOUD == 'ICE3'.OR.CCLOUD == 'ICE4') THEN + ALLOCATE(XHLC_HRC(IIU,IJU,IKU)) + ALLOCATE(XHLC_HCF(IIU,IJU,IKU)) + ALLOCATE(XHLI_HRI(IIU,IJU,IKU)) + ALLOCATE(XHLI_HCF(IIU,IJU,IKU)) + XHLC_HRC(:,:,:)=0. + XHLC_HCF(:,:,:)=0. + XHLI_HRI(:,:,:)=0. + XHLI_HCF(:,:,:)=0. +ELSE + ALLOCATE(XHLC_HRC(0,0,0)) + ALLOCATE(XHLC_HCF(0,0,0)) + ALLOCATE(XHLI_HRI(0,0,0)) + ALLOCATE(XHLI_HCF(0,0,0)) +END IF +! +IF (NRR>1) THEN + ALLOCATE(XCLDFR(IIU,IJU,IKU)); XCLDFR (:, :, :) = 0. + ALLOCATE(XICEFR(IIU,IJU,IKU)); XICEFR (:, :, :) = 0. + ALLOCATE(XRAINFR(IIU,IJU,IKU)); XRAINFR(:, :, :) = 0. +ELSE + ALLOCATE(XCLDFR(0,0,0)) + ALLOCATE(XICEFR(0,0,0)) + ALLOCATE(XRAINFR(0,0,0)) +END IF +! +ALLOCATE(XSVT(IIU,IJU,IKU,NSV)) ; XSVT = 0. +ALLOCATE(XRSVS(IIU,IJU,IKU,NSV)); XRSVS = 0. +ALLOCATE(XRSVS_CLD(IIU,IJU,IKU,NSV)); XRSVS_CLD = 0.0 +ALLOCATE(XZWS(IIU,IJU)) ; XZWS(:,:) = XZWS_DEFAULT +! +IF (LPASPOL) THEN + ALLOCATE( XATC(IIU,IJU,IKU,NSV_PP) ) + XATC = 0. +ELSE + ALLOCATE( XATC(0,0,0,0)) +END IF +! +IF(LBLOWSNOW) THEN + ALLOCATE(XSNWCANO(IIU,IJU,NBLOWSNOW_2D)) + ALLOCATE(XRSNWCANOS(IIU,IJU,NBLOWSNOW_2D)) + XSNWCANO(:,:,:) = 0.0 + XRSNWCANOS(:,:,:) = 0.0 +ELSE + ALLOCATE(XSNWCANO(0,0,0)) + ALLOCATE(XRSNWCANOS(0,0,0)) +END IF +! +!* 3.2 Module MODD_GRID_n and MODD_METRICS_n +! +IF (LCARTESIAN) THEN + ALLOCATE(XLON(0,0)) + ALLOCATE(XLAT(0,0)) + ALLOCATE(XMAP(0,0)) +ELSE + ALLOCATE(XLON(IIU,IJU)) + ALLOCATE(XLAT(IIU,IJU)) + ALLOCATE(XMAP(IIU,IJU)) +END IF +ALLOCATE(XXHAT(IIU)) +ALLOCATE(XDXHAT(IIU)) +ALLOCATE(XYHAT(IJU)) +ALLOCATE(XDYHAT(IJU)) +ALLOCATE(XZS(IIU,IJU)) +ALLOCATE(XZSMT(IIU,IJU)) +ALLOCATE(XZZ(IIU,IJU,IKU)) +ALLOCATE(XZHAT(IKU)) +ALLOCATE(XDIRCOSZW(IIU,IJU)) +ALLOCATE(XDIRCOSXW(IIU,IJU)) +ALLOCATE(XDIRCOSYW(IIU,IJU)) +ALLOCATE(XCOSSLOPE(IIU,IJU)) +ALLOCATE(XSINSLOPE(IIU,IJU)) +! +ALLOCATE(XDXX(IIU,IJU,IKU)) +ALLOCATE(XDYY(IIU,IJU,IKU)) +ALLOCATE(XDZX(IIU,IJU,IKU)) +ALLOCATE(XDZY(IIU,IJU,IKU)) +ALLOCATE(XDZZ(IIU,IJU,IKU)) +! +!* 3.3 Modules MODD_REF and MODD_REF_n +! +! Different reference states for Ocean and Atmosphere models +! For the moment, same reference states for O and A +!IF ((KMI == 1).OR.LCOUPLES) THEN +IF (KMI==1) THEN + ALLOCATE(XRHODREFZ(IKU),XTHVREFZ(IKU)) +ELSE IF (LCOUPLES) THEN +! in coupled O-A case, need different variables for ocean + ALLOCATE(XRHODREFZO(IKU),XTHVREFZO(IKU)) +ELSE + !Do not allocate XRHODREFZ and XTHVREFZ because they are the same on all grids (not 'n' variables) +END IF +! +ALLOCATE(XPHIT(IIU,IJU,IKU)) +ALLOCATE(XRHODREF(IIU,IJU,IKU)) +ALLOCATE(XTHVREF(IIU,IJU,IKU)) +ALLOCATE(XEXNREF(IIU,IJU,IKU)) +ALLOCATE(XRHODJ(IIU,IJU,IKU)) +IF (CEQNSYS=='DUR' .AND. LUSERV) THEN + ALLOCATE(XRVREF(IIU,IJU,IKU)) +ELSE + ALLOCATE(XRVREF(0,0,0)) +END IF +! +!* 3.4 Module MODD_CURVCOR_n +! +IF (LTHINSHELL) THEN + ALLOCATE(XCORIOX(0,0)) + ALLOCATE(XCORIOY(0,0)) +ELSE + ALLOCATE(XCORIOX(IIU,IJU)) + ALLOCATE(XCORIOY(IIU,IJU)) +END IF + ALLOCATE(XCORIOZ(IIU,IJU)) +IF (LCARTESIAN) THEN + ALLOCATE(XCURVX(0,0)) + ALLOCATE(XCURVY(0,0)) +ELSE + ALLOCATE(XCURVX(IIU,IJU)) + ALLOCATE(XCURVY(IIU,IJU)) +END IF +! +!* 3.5 Module MODD_DYN_n +! +CALL GET_DIM_EXT_ll('Y',IIY,IJY) +IF (L2D) THEN + ALLOCATE(XBFY(IIY,IJY,IKU)) +ELSE + ALLOCATE(XBFY(IJY,IIY,IKU)) ! transposition needed by the optimisation of the + ! FFT solver +END IF +CALL GET_DIM_EXT_ll('B',IIU_B,IJU_B) +ALLOCATE(XBFB(IIU_B,IJU_B,IKU)) +CALL GET_DIM_EXTZ_ll('SXP2_YP1_Z',IIU_SXP2_YP1_Z_ll,IJU_SXP2_YP1_Z_ll,IKU_SXP2_YP1_Z_ll) +ALLOCATE(XBF_SXP2_YP1_Z(IIU_SXP2_YP1_Z_ll,IJU_SXP2_YP1_Z_ll,IKU_SXP2_YP1_Z_ll)) +ALLOCATE(XAF(IKU),XCF(IKU)) +ALLOCATE(XTRIGSX(3*IIU_ll)) +ALLOCATE(XTRIGSY(3*IJU_ll)) +ALLOCATE(XRHOM(IKU)) +ALLOCATE(XALK(IKU)) +ALLOCATE(XALKW(IKU)) +ALLOCATE(XALKBAS(IKU)) +ALLOCATE(XALKWBAS(IKU)) +! +IF ( 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 + ALLOCATE(XKURELAX(IIU,IJU)) + ALLOCATE(XKVRELAX(IIU,IJU)) + ALLOCATE(XKWRELAX(IIU,IJU)) + ALLOCATE(LMASK_RELAX(IIU,IJU)) +ELSE + ALLOCATE(XKURELAX(0,0)) + ALLOCATE(XKVRELAX(0,0)) + ALLOCATE(XKWRELAX(0,0)) + ALLOCATE(LMASK_RELAX(0,0)) +END IF +! +! Additional fields for truly horizontal diffusion (Module MODD_DYNZD$n) +IF (LZDIFFU) THEN + CALL INIT_TYPE_ZDIFFU_HALO2(XZDIFFU_HALO2) +ELSE + CALL INIT_TYPE_ZDIFFU_HALO2(XZDIFFU_HALO2,0) +ENDIF +! +!* 3.6 Larger Scale variables (Module MODD_LSFIELD$n) +! +! +! upper relaxation part +! +ALLOCATE(XLSUM(IIU,IJU,IKU)) ; XLSUM = 0.0 +ALLOCATE(XLSVM(IIU,IJU,IKU)) ; XLSVM = 0.0 +ALLOCATE(XLSWM(IIU,IJU,IKU)) ; XLSWM = 0.0 +ALLOCATE(XLSTHM(IIU,IJU,IKU)) ; XLSTHM = 0.0 +IF ( NRR > 0 ) THEN + ALLOCATE(XLSRVM(IIU,IJU,IKU)) ; XLSRVM = 0.0 +ELSE + ALLOCATE(XLSRVM(0,0,0)) +END IF +ALLOCATE(XLSZWSM(IIU,IJU)) ; XLSZWSM = -1. +! +! lbc part +! +IF ( L1D) THEN ! 1D case +! + NSIZELBX_ll=0 + NSIZELBXU_ll=0 + NSIZELBY_ll=0 + NSIZELBYV_ll=0 + NSIZELBXTKE_ll=0 + NSIZELBXR_ll=0 + NSIZELBXSV_ll=0 + NSIZELBYTKE_ll=0 + NSIZELBYR_ll=0 + NSIZELBYSV_ll=0 + ALLOCATE(XLBXUM(0,0,0)) + ALLOCATE(XLBYUM(0,0,0)) + ALLOCATE(XLBXVM(0,0,0)) + ALLOCATE(XLBYVM(0,0,0)) + ALLOCATE(XLBXWM(0,0,0)) + ALLOCATE(XLBYWM(0,0,0)) + ALLOCATE(XLBXTHM(0,0,0)) + ALLOCATE(XLBYTHM(0,0,0)) + ALLOCATE(XLBXTKEM(0,0,0)) + ALLOCATE(XLBYTKEM(0,0,0)) + ALLOCATE(XLBXRM(0,0,0,0)) + ALLOCATE(XLBYRM(0,0,0,0)) + ALLOCATE(XLBXSVM(0,0,0,0)) + ALLOCATE(XLBYSVM(0,0,0,0)) +! +ELSEIF( L2D ) THEN ! 2D case +! + NSIZELBY_ll=0 + NSIZELBYV_ll=0 + NSIZELBYTKE_ll=0 + NSIZELBYR_ll=0 + NSIZELBYSV_ll=0 + ALLOCATE(XLBYUM(0,0,0)) + ALLOCATE(XLBYVM(0,0,0)) + ALLOCATE(XLBYWM(0,0,0)) + ALLOCATE(XLBYTHM(0,0,0)) + ALLOCATE(XLBYTKEM(0,0,0)) + ALLOCATE(XLBYRM(0,0,0,0)) + ALLOCATE(XLBYSVM(0,0,0,0)) +! + CALL GET_SIZEX_LB(NIMAX_ll,NJMAX_ll,NRIMX, & + IISIZEXF,IJSIZEXF,IISIZEXFU,IJSIZEXFU, & + IISIZEX4,IJSIZEX4,IISIZEX2,IJSIZEX2) +! + IF ( LHORELAX_UVWTH ) THEN + NSIZELBX_ll=2*NRIMX+2*JPHEXT + NSIZELBXU_ll=2*NRIMX+2*JPHEXT + ALLOCATE(XLBXUM(IISIZEXFU,IJSIZEXFU,IKU)) + ALLOCATE(XLBXVM(IISIZEXF,IJSIZEXF,IKU)) + ALLOCATE(XLBXWM(IISIZEXF,IJSIZEXF,IKU)) + ALLOCATE(XLBXTHM(IISIZEXF,IJSIZEXF,IKU)) + ELSE + NSIZELBX_ll=2*JPHEXT ! 2 + NSIZELBXU_ll=2*(JPHEXT+1) ! 4 + ALLOCATE(XLBXUM(IISIZEX4,IJSIZEX4,IKU)) + ALLOCATE(XLBXVM(IISIZEX2,IJSIZEX2,IKU)) + ALLOCATE(XLBXWM(IISIZEX2,IJSIZEX2,IKU)) + ALLOCATE(XLBXTHM(IISIZEX2,IJSIZEX2,IKU)) + END IF +! + IF (CTURB /= 'NONE') THEN + IF ( LHORELAX_TKE) THEN + NSIZELBXTKE_ll=2* NRIMX+2*JPHEXT + ALLOCATE(XLBXTKEM(IISIZEXF,IJSIZEXF,IKU)) + ELSE + NSIZELBXTKE_ll=2*JPHEXT ! 2 + ALLOCATE(XLBXTKEM(IISIZEX2,IJSIZEX2,IKU)) + END IF + ELSE + NSIZELBXTKE_ll=0 + ALLOCATE(XLBXTKEM(0,0,0)) + END IF + ! + IF ( NRR > 0 ) THEN + IF (LHORELAX_RV .OR. LHORELAX_RC .OR. LHORELAX_RR .OR. LHORELAX_RI & + .OR. LHORELAX_RS .OR. LHORELAX_RG .OR. LHORELAX_RH & + ) THEN + NSIZELBXR_ll=2* NRIMX+2*JPHEXT + ALLOCATE(XLBXRM(IISIZEXF,IJSIZEXF,IKU,NRR)) + ELSE + NSIZELBXR_ll=2*JPHEXT ! 2 + ALLOCATE(XLBXRM(IISIZEX2,IJSIZEX2,IKU,NRR)) + ENDIF + ELSE + NSIZELBXR_ll=0 + ALLOCATE(XLBXRM(0,0,0,0)) + END IF + ! + IF ( NSV > 0 ) THEN + IF ( ANY( LHORELAX_SV(:)) ) THEN + NSIZELBXSV_ll=2* NRIMX+2*JPHEXT + ALLOCATE(XLBXSVM(IISIZEXF,IJSIZEXF,IKU,NSV)) + ELSE + NSIZELBXSV_ll=2*JPHEXT ! 2 + ALLOCATE(XLBXSVM(IISIZEX2,IJSIZEX2,IKU,NSV)) + END IF + ELSE + NSIZELBXSV_ll=0 + ALLOCATE(XLBXSVM(0,0,0,0)) + END IF +! +ELSE ! 3D case +! +! + CALL GET_SIZEX_LB(NIMAX_ll,NJMAX_ll,NRIMX, & + IISIZEXF,IJSIZEXF,IISIZEXFU,IJSIZEXFU, & + IISIZEX4,IJSIZEX4,IISIZEX2,IJSIZEX2) + CALL GET_SIZEY_LB(NIMAX_ll,NJMAX_ll,NRIMY, & + IISIZEYF,IJSIZEYF,IISIZEYFV,IJSIZEYFV, & + IISIZEY4,IJSIZEY4,IISIZEY2,IJSIZEY2) +! +! check if local domain not to small for NRIMX NRIMY +! + IF ( CLBCX(1) /= 'CYCL' ) THEN + IF ( NRIMX .GT. IDIMX ) THEN + WRITE(*,'(A,I8,A/A,2I8,/A)') "Processor=", IP-1, & + " :: INI_MODEL_n ERROR: ( NRIMX > IDIMX ) ", & + " Local domain to small for relaxation NRIMX,IDIMX ", & + NRIMX,IDIMX ,& + " change relaxation parameters or number of processors " + call Print_msg(NVERB_FATAL,'GEN','INI_MODEL_n','') + END IF + END IF + IF ( CLBCY(1) /= 'CYCL' ) THEN + IF ( NRIMY .GT. IDIMY ) THEN + WRITE(*,'(A,I8,A/A,2I8,/A)') "Processor=", IP-1, & + " :: INI_MODEL_n ERROR: ( NRIMY > IDIMY ) ", & + " Local domain to small for relaxation NRIMY,IDIMY ", & + NRIMY,IDIMY ,& + " change relaxation parameters or number of processors " + call Print_msg(NVERB_FATAL,'GEN','INI_MODEL_n','') + END IF + END IF +IF ( LHORELAX_UVWTH ) THEN + NSIZELBX_ll=2*NRIMX+2*JPHEXT + NSIZELBXU_ll=2*NRIMX+2*JPHEXT + NSIZELBY_ll=2*NRIMY+2*JPHEXT + NSIZELBYV_ll=2*NRIMY+2*JPHEXT + ALLOCATE(XLBXUM(IISIZEXFU,IJSIZEXFU,IKU)) + ALLOCATE(XLBYUM(IISIZEYF,IJSIZEYF,IKU)) + ALLOCATE(XLBXVM(IISIZEXF,IJSIZEXF,IKU)) + ALLOCATE(XLBYVM(IISIZEYFV,IJSIZEYFV,IKU)) + ALLOCATE(XLBXWM(IISIZEXF,IJSIZEXF,IKU)) + ALLOCATE(XLBYWM(IISIZEYF,IJSIZEYF,IKU)) + ALLOCATE(XLBXTHM(IISIZEXF,IJSIZEXF,IKU)) + ALLOCATE(XLBYTHM(IISIZEYF,IJSIZEYF,IKU)) + ELSE + NSIZELBX_ll=2*JPHEXT ! 2 + NSIZELBXU_ll=2*(JPHEXT+1) ! 4 + NSIZELBY_ll=2*JPHEXT ! 2 + NSIZELBYV_ll=2*(JPHEXT+1) ! 4 + ALLOCATE(XLBXUM(IISIZEX4,IJSIZEX4,IKU)) + ALLOCATE(XLBYUM(IISIZEY2,IJSIZEY2,IKU)) + ALLOCATE(XLBXVM(IISIZEX2,IJSIZEX2,IKU)) + ALLOCATE(XLBYVM(IISIZEY4,IJSIZEY4,IKU)) + ALLOCATE(XLBXWM(IISIZEX2,IJSIZEX2,IKU)) + ALLOCATE(XLBYWM(IISIZEY2,IJSIZEY2,IKU)) + ALLOCATE(XLBXTHM(IISIZEX2,IJSIZEX2,IKU)) + ALLOCATE(XLBYTHM(IISIZEY2,IJSIZEY2,IKU)) + END IF + ! + IF (CTURB /= 'NONE') THEN + IF ( LHORELAX_TKE) THEN + NSIZELBXTKE_ll=2*NRIMX+2*JPHEXT + NSIZELBYTKE_ll=2*NRIMY+2*JPHEXT + ALLOCATE(XLBXTKEM(IISIZEXF,IJSIZEXF,IKU)) + ALLOCATE(XLBYTKEM(IISIZEYF,IJSIZEYF,IKU)) + ELSE + NSIZELBXTKE_ll=2*JPHEXT ! 2 + NSIZELBYTKE_ll=2*JPHEXT ! 2 + ALLOCATE(XLBXTKEM(IISIZEX2,IJSIZEX2,IKU)) + ALLOCATE(XLBYTKEM(IISIZEY2,IJSIZEY2,IKU)) + END IF + ELSE + NSIZELBXTKE_ll=0 + NSIZELBYTKE_ll=0 + ALLOCATE(XLBXTKEM(0,0,0)) + ALLOCATE(XLBYTKEM(0,0,0)) + END IF + ! + IF ( NRR > 0 ) THEN + IF (LHORELAX_RV .OR. LHORELAX_RC .OR. LHORELAX_RR .OR. LHORELAX_RI & + .OR. LHORELAX_RS .OR. LHORELAX_RG .OR. LHORELAX_RH & + ) THEN + NSIZELBXR_ll=2*NRIMX+2*JPHEXT + NSIZELBYR_ll=2*NRIMY+2*JPHEXT + ALLOCATE(XLBXRM(IISIZEXF,IJSIZEXF,IKU,NRR)) + ALLOCATE(XLBYRM(IISIZEYF,IJSIZEYF,IKU,NRR)) + ELSE + NSIZELBXR_ll=2*JPHEXT ! 2 + NSIZELBYR_ll=2*JPHEXT ! 2 + ALLOCATE(XLBXRM(IISIZEX2,IJSIZEX2,IKU,NRR)) + ALLOCATE(XLBYRM(IISIZEY2,IJSIZEY2,IKU,NRR)) + ENDIF + ELSE + NSIZELBXR_ll=0 + NSIZELBYR_ll=0 + ALLOCATE(XLBXRM(0,0,0,0)) + ALLOCATE(XLBYRM(0,0,0,0)) + END IF + ! + IF ( NSV > 0 ) THEN + IF ( ANY( LHORELAX_SV(:)) ) THEN + NSIZELBXSV_ll=2*NRIMX+2*JPHEXT + NSIZELBYSV_ll=2*NRIMY+2*JPHEXT + ALLOCATE(XLBXSVM(IISIZEXF,IJSIZEXF,IKU,NSV)) + ALLOCATE(XLBYSVM(IISIZEYF,IJSIZEYF,IKU,NSV)) + ELSE + NSIZELBXSV_ll=2*JPHEXT ! 2 + NSIZELBYSV_ll=2*JPHEXT ! 2 + ALLOCATE(XLBXSVM(IISIZEX2,IJSIZEX2,IKU,NSV)) + ALLOCATE(XLBYSVM(IISIZEY2,IJSIZEY2,IKU,NSV)) + END IF + ELSE + NSIZELBXSV_ll=0 + NSIZELBYSV_ll=0 + ALLOCATE(XLBXSVM(0,0,0,0)) + ALLOCATE(XLBYSVM(0,0,0,0)) + END IF +END IF ! END OF THE IF STRUCTURE ON THE MODEL DIMENSION +! +! +IF ( KMI > 1 ) THEN + ! it has been assumed that the THeta field used the largest rim area compared + ! to the others prognostic variables, if it is not the case, you must change + ! these lines + ALLOCATE(XCOEFLIN_LBXM(SIZE(XLBXTHM,1),SIZE(XLBXTHM,2),SIZE(XLBXTHM,3))) + ALLOCATE( NKLIN_LBXM(SIZE(XLBXTHM,1),SIZE(XLBXTHM,2),SIZE(XLBXTHM,3))) + ALLOCATE(XCOEFLIN_LBYM(SIZE(XLBYTHM,1),SIZE(XLBYTHM,2),SIZE(XLBYTHM,3))) + ALLOCATE( NKLIN_LBYM(SIZE(XLBYTHM,1),SIZE(XLBYTHM,2),SIZE(XLBYTHM,3))) + ALLOCATE(XCOEFLIN_LBXU(SIZE(XLBXUM,1),SIZE(XLBXUM,2),SIZE(XLBXUM,3))) + ALLOCATE( NKLIN_LBXU(SIZE(XLBXUM,1),SIZE(XLBXUM,2),SIZE(XLBXUM,3))) + ALLOCATE(XCOEFLIN_LBYU(SIZE(XLBYUM,1),SIZE(XLBYUM,2),SIZE(XLBYUM,3))) + ALLOCATE( NKLIN_LBYU(SIZE(XLBYUM,1),SIZE(XLBYUM,2),SIZE(XLBYUM,3))) + ALLOCATE(XCOEFLIN_LBXV(SIZE(XLBXVM,1),SIZE(XLBXVM,2),SIZE(XLBXVM,3))) + ALLOCATE( NKLIN_LBXV(SIZE(XLBXVM,1),SIZE(XLBXVM,2),SIZE(XLBXVM,3))) + ALLOCATE(XCOEFLIN_LBYV(SIZE(XLBYVM,1),SIZE(XLBYVM,2),SIZE(XLBYVM,3))) + ALLOCATE( NKLIN_LBYV(SIZE(XLBYVM,1),SIZE(XLBYVM,2),SIZE(XLBYVM,3))) + ALLOCATE(XCOEFLIN_LBXW(SIZE(XLBXWM,1),SIZE(XLBXWM,2),SIZE(XLBXWM,3))) + ALLOCATE( NKLIN_LBXW(SIZE(XLBXWM,1),SIZE(XLBXWM,2),SIZE(XLBXWM,3))) + ALLOCATE(XCOEFLIN_LBYW(SIZE(XLBYWM,1),SIZE(XLBYWM,2),SIZE(XLBYWM,3))) + ALLOCATE( NKLIN_LBYW(SIZE(XLBYWM,1),SIZE(XLBYWM,2),SIZE(XLBYWM,3))) +ELSE + ALLOCATE(XCOEFLIN_LBXM(0,0,0)) + ALLOCATE( NKLIN_LBXM(0,0,0)) + ALLOCATE(XCOEFLIN_LBYM(0,0,0)) + ALLOCATE( NKLIN_LBYM(0,0,0)) + ALLOCATE(XCOEFLIN_LBXU(0,0,0)) + ALLOCATE( NKLIN_LBXU(0,0,0)) + ALLOCATE(XCOEFLIN_LBYU(0,0,0)) + ALLOCATE( NKLIN_LBYU(0,0,0)) + ALLOCATE(XCOEFLIN_LBXV(0,0,0)) + ALLOCATE( NKLIN_LBXV(0,0,0)) + ALLOCATE(XCOEFLIN_LBYV(0,0,0)) + ALLOCATE( NKLIN_LBYV(0,0,0)) + ALLOCATE(XCOEFLIN_LBXW(0,0,0)) + ALLOCATE( NKLIN_LBXW(0,0,0)) + ALLOCATE(XCOEFLIN_LBYW(0,0,0)) + ALLOCATE( NKLIN_LBYW(0,0,0)) +END IF +! +! allocation of the LS fields for vertical relaxation and numerical diffusion +IF( .NOT. LSTEADYLS ) THEN +! + ALLOCATE(XLSUS(SIZE(XLSUM,1),SIZE(XLSUM,2),SIZE(XLSUM,3))) + ALLOCATE(XLSVS(SIZE(XLSVM,1),SIZE(XLSVM,2),SIZE(XLSVM,3))) + ALLOCATE(XLSWS(SIZE(XLSWM,1),SIZE(XLSWM,2),SIZE(XLSWM,3))) + ALLOCATE(XLSTHS(SIZE(XLSTHM,1),SIZE(XLSTHM,2),SIZE(XLSTHM,3))) + ALLOCATE(XLSRVS(SIZE(XLSRVM,1),SIZE(XLSRVM,2),SIZE(XLSRVM,3))) + ALLOCATE(XLSZWSS(SIZE(XLSZWSM,1),SIZE(XLSZWSM,2))) +! +ELSE +! + ALLOCATE(XLSUS(0,0,0)) + ALLOCATE(XLSVS(0,0,0)) + ALLOCATE(XLSWS(0,0,0)) + ALLOCATE(XLSTHS(0,0,0)) + ALLOCATE(XLSRVS(0,0,0)) + ALLOCATE(XLSZWSS(0,0)) +! +END IF +! allocation of the LB fields for horizontal relaxation and Lateral Boundaries +IF( .NOT. ( LSTEADYLS .AND. KMI==1 ) ) THEN +! + ALLOCATE(XLBXTKES(SIZE(XLBXTKEM,1),SIZE(XLBXTKEM,2),SIZE(XLBXTKEM,3))) + ALLOCATE(XLBYTKES(SIZE(XLBYTKEM,1),SIZE(XLBYTKEM,2),SIZE(XLBYTKEM,3))) + ALLOCATE(XLBXUS(SIZE(XLBXUM,1),SIZE(XLBXUM,2),SIZE(XLBXUM,3))) + ALLOCATE(XLBYUS(SIZE(XLBYUM,1),SIZE(XLBYUM,2),SIZE(XLBYUM,3))) + ALLOCATE(XLBXVS(SIZE(XLBXVM,1),SIZE(XLBXVM,2),SIZE(XLBXVM,3))) + ALLOCATE(XLBYVS(SIZE(XLBYVM,1),SIZE(XLBYVM,2),SIZE(XLBYVM,3))) + ALLOCATE(XLBXWS(SIZE(XLBXWM,1),SIZE(XLBXWM,2),SIZE(XLBXWM,3))) + ALLOCATE(XLBYWS(SIZE(XLBYWM,1),SIZE(XLBYWM,2),SIZE(XLBYWM,3))) + ALLOCATE(XLBXTHS(SIZE(XLBXTHM,1),SIZE(XLBXTHM,2),SIZE(XLBXTHM,3))) + ALLOCATE(XLBYTHS(SIZE(XLBYTHM,1),SIZE(XLBYTHM,2),SIZE(XLBYTHM,3))) + ALLOCATE(XLBXRS(SIZE(XLBXRM,1),SIZE(XLBXRM,2),SIZE(XLBXRM,3),SIZE(XLBXRM,4))) + ALLOCATE(XLBYRS(SIZE(XLBYRM,1),SIZE(XLBYRM,2),SIZE(XLBYRM,3),SIZE(XLBYRM,4))) + ALLOCATE(XLBXSVS(SIZE(XLBXSVM,1),SIZE(XLBXSVM,2),SIZE(XLBXSVM,3),SIZE(XLBXSVM,4))) + ALLOCATE(XLBYSVS(SIZE(XLBYSVM,1),SIZE(XLBYSVM,2),SIZE(XLBYSVM,3),SIZE(XLBYSVM,4))) +! +ELSE +! + ALLOCATE(XLBXTKES(0,0,0)) + ALLOCATE(XLBYTKES(0,0,0)) + ALLOCATE(XLBXUS(0,0,0)) + ALLOCATE(XLBYUS(0,0,0)) + ALLOCATE(XLBXVS(0,0,0)) + ALLOCATE(XLBYVS(0,0,0)) + ALLOCATE(XLBXWS(0,0,0)) + ALLOCATE(XLBYWS(0,0,0)) + ALLOCATE(XLBXTHS(0,0,0)) + ALLOCATE(XLBYTHS(0,0,0)) + ALLOCATE(XLBXRS(0,0,0,0)) + ALLOCATE(XLBYRS(0,0,0,0)) + ALLOCATE(XLBXSVS(0,0,0,0)) + ALLOCATE(XLBYSVS(0,0,0,0)) +! +END IF +! +! +!* 3.7 Module MODD_RADIATIONS_n (except XOZON and XAER) +! +! Initialization of SW bands +NSWB_OLD = 6 ! Number of bands in ECMWF original scheme (from Fouquart et Bonnel (1980)) + ! then modified through INI_RADIATIONS_ECMWF but remains equal to 6 practically + +#ifdef MNH_ECRAD +#if ( VER_ECRAD == 140 ) +NLWB_OLD = 16 ! For XEMIS initialization (should be spectral in the future) +#endif +#endif + +NLWB_MNH = 16 ! For XEMIS initialization (should be spectral in the future) + +IF (CRAD == 'ECRA') THEN + NSWB_MNH = 14 +#ifdef MNH_ECRAD +#if ( VER_ECRAD == 140 ) + NLWB_MNH = 16 +#endif +#endif +ELSE + NSWB_MNH = NSWB_OLD +#ifdef MNH_ECRAD +#if ( VER_ECRAD == 140 ) + NLWB_MNH = NLWB_OLD +#endif +#endif +END IF + +ALLOCATE(XSW_BANDS (NSWB_MNH)) +ALLOCATE(XLW_BANDS (NLWB_MNH)) +ALLOCATE(XZENITH (IIU,IJU)) +ALLOCATE(XAZIM (IIU,IJU)) +ALLOCATE(XALBUV (IIU,IJU)) +XALBUV(:,:) = NALBUV_DEFAULT !Set to an arbitrary low value (XALBUV is needed in CH_INTERP_JVALUES even if no radiation) +ALLOCATE(XDIRSRFSWD(IIU,IJU,NSWB_MNH)) +ALLOCATE(XSCAFLASWD(IIU,IJU,NSWB_MNH)) +ALLOCATE(XFLALWD (IIU,IJU)) +! +IF (CRAD /= 'NONE') THEN + ALLOCATE(XSLOPANG(IIU,IJU)) + ALLOCATE(XSLOPAZI(IIU,IJU)) + ALLOCATE(XDTHRAD(IIU,IJU,IKU)) + ALLOCATE(XDIRFLASWD(IIU,IJU,NSWB_MNH)) + ALLOCATE(XDIR_ALB(IIU,IJU,NSWB_MNH)) + ALLOCATE(XSCA_ALB(IIU,IJU,NSWB_MNH)) + ALLOCATE(XEMIS (IIU,IJU,NLWB_MNH)) + ALLOCATE(XTSRAD (IIU,IJU)) ; XTSRAD = 0.0 + ALLOCATE(XSEA (IIU,IJU)) + ALLOCATE(XZS_XY (IIU,IJU)) + ALLOCATE(NCLEARCOL_TM1(IIU,IJU)) + ALLOCATE(XSWU(IIU,IJU,IKU)) + ALLOCATE(XSWD(IIU,IJU,IKU)) + ALLOCATE(XLWU(IIU,IJU,IKU)) + ALLOCATE(XLWD(IIU,IJU,IKU)) + ALLOCATE(XDTHRADSW(IIU,IJU,IKU)) + ALLOCATE(XDTHRADLW(IIU,IJU,IKU)) + ALLOCATE(XRADEFF(IIU,IJU,IKU)) +ELSE + ALLOCATE(XSLOPANG(0,0)) + ALLOCATE(XSLOPAZI(0,0)) + ALLOCATE(XDTHRAD(0,0,0)) + ALLOCATE(XDIRFLASWD(0,0,0)) + ALLOCATE(XDIR_ALB(0,0,0)) + ALLOCATE(XSCA_ALB(0,0,0)) + ALLOCATE(XEMIS (0,0,0)) + ALLOCATE(XTSRAD (0,0)) + ALLOCATE(XSEA (0,0)) + ALLOCATE(XZS_XY (0,0)) + ALLOCATE(NCLEARCOL_TM1(0,0)) + ALLOCATE(XSWU(0,0,0)) + ALLOCATE(XSWD(0,0,0)) + ALLOCATE(XLWU(0,0,0)) + ALLOCATE(XLWD(0,0,0)) + ALLOCATE(XDTHRADSW(0,0,0)) + ALLOCATE(XDTHRADLW(0,0,0)) + ALLOCATE(XRADEFF(0,0,0)) +END IF + +IF (CRAD == 'ECMW' .OR. CRAD == 'ECRA') THEN + ALLOCATE(XSTROATM(31,6)) + ALLOCATE(XSMLSATM(31,6)) + ALLOCATE(XSMLWATM(31,6)) + ALLOCATE(XSPOSATM(31,6)) + ALLOCATE(XSPOWATM(31,6)) + ALLOCATE(XSTATM(31,6)) +ELSE + ALLOCATE(XSTROATM(0,0)) + ALLOCATE(XSMLSATM(0,0)) + ALLOCATE(XSMLWATM(0,0)) + ALLOCATE(XSPOSATM(0,0)) + ALLOCATE(XSPOWATM(0,0)) + ALLOCATE(XSTATM(0,0)) +END IF +! +!* 3.8 Module MODD_DEEP_CONVECTION_n +! +IF (CDCONV /= 'NONE' .OR. CSCONV == 'KAFR') THEN + ALLOCATE(NCOUNTCONV(IIU,IJU)) + ALLOCATE(XDTHCONV(IIU,IJU,IKU)) + ALLOCATE(XDRVCONV(IIU,IJU,IKU)) + ALLOCATE(XDRCCONV(IIU,IJU,IKU)) + ALLOCATE(XDRICONV(IIU,IJU,IKU)) + ALLOCATE(XPRCONV(IIU,IJU)) + ALLOCATE(XPACCONV(IIU,IJU)) + ALLOCATE(XPRSCONV(IIU,IJU)) + ! diagnostics + IF (LCH_CONV_LINOX) THEN + ALLOCATE(XIC_RATE(IIU,IJU)) + ALLOCATE(XCG_RATE(IIU,IJU)) + ALLOCATE(XIC_TOTAL_NUMBER(IIU,IJU)) + ALLOCATE(XCG_TOTAL_NUMBER(IIU,IJU)) + ELSE + ALLOCATE(XIC_RATE(0,0)) + ALLOCATE(XCG_RATE(0,0)) + ALLOCATE(XIC_TOTAL_NUMBER(0,0)) + ALLOCATE(XCG_TOTAL_NUMBER(0,0)) + END IF + IF ( LDIAGCONV ) THEN + ALLOCATE(XUMFCONV(IIU,IJU,IKU)) + ALLOCATE(XDMFCONV(IIU,IJU,IKU)) + ALLOCATE(XPRLFLXCONV(IIU,IJU,IKU)) + ALLOCATE(XPRSFLXCONV(IIU,IJU,IKU)) + ALLOCATE(XCAPE(IIU,IJU)) + ALLOCATE(NCLTOPCONV(IIU,IJU)) + ALLOCATE(NCLBASCONV(IIU,IJU)) + ELSE + ALLOCATE(XUMFCONV(0,0,0)) + ALLOCATE(XDMFCONV(0,0,0)) + ALLOCATE(XPRLFLXCONV(0,0,0)) + ALLOCATE(XPRSFLXCONV(0,0,0)) + ALLOCATE(XCAPE(0,0)) + ALLOCATE(NCLTOPCONV(0,0)) + ALLOCATE(NCLBASCONV(0,0)) + END IF +ELSE + ALLOCATE(NCOUNTCONV(0,0)) + ALLOCATE(XDTHCONV(0,0,0)) + ALLOCATE(XDRVCONV(0,0,0)) + ALLOCATE(XDRCCONV(0,0,0)) + ALLOCATE(XDRICONV(0,0,0)) + ALLOCATE(XPRCONV(0,0)) + ALLOCATE(XPACCONV(0,0)) + ALLOCATE(XPRSCONV(0,0)) + ALLOCATE(XIC_RATE(0,0)) + ALLOCATE(XCG_RATE(0,0)) + ALLOCATE(XIC_TOTAL_NUMBER(0,0)) + ALLOCATE(XCG_TOTAL_NUMBER(0,0)) + ALLOCATE(XUMFCONV(0,0,0)) + ALLOCATE(XDMFCONV(0,0,0)) + ALLOCATE(XPRLFLXCONV(0,0,0)) + ALLOCATE(XPRSFLXCONV(0,0,0)) + ALLOCATE(XCAPE(0,0)) + ALLOCATE(NCLTOPCONV(0,0)) + ALLOCATE(NCLBASCONV(0,0)) +END IF +! +IF ((CDCONV == 'KAFR' .OR. CSCONV == 'KAFR') & + .AND. LSUBG_COND .AND. LSIG_CONV) THEN + ALLOCATE(XMFCONV(IIU,IJU,IKU)) +ELSE + ALLOCATE(XMFCONV(0,0,0)) +ENDIF +! +IF ((CDCONV == 'KAFR' .OR. CSCONV == 'KAFR') & + .AND. LCHTRANS .AND. NSV > 0 ) THEN + ALLOCATE(XDSVCONV(IIU,IJU,IKU,NSV)) +ELSE + ALLOCATE(XDSVCONV(0,0,0,0)) +END IF +! +ALLOCATE(XCF_MF(IIU,IJU,IKU)) ; XCF_MF=0.0 +ALLOCATE(XRC_MF(IIU,IJU,IKU)) ; XRC_MF=0.0 +ALLOCATE(XRI_MF(IIU,IJU,IKU)) ; XRI_MF=0.0 +! +!* 3.9 Local variables +! +ALLOCATE(ZJ(IIU,IJU,IKU)) +! +!* 3.10 Forcing variables (Module MODD_FRC and MODD_FRCn) +! +IF ( LFORCING ) THEN + ALLOCATE(XWTFRC(IIU,IJU,IKU)) ; XWTFRC = XUNDEF + ALLOCATE(XUFRC_PAST(IIU,IJU,IKU)) ; XUFRC_PAST = XUNDEF + ALLOCATE(XVFRC_PAST(IIU,IJU,IKU)) ; XVFRC_PAST = XUNDEF +ELSE + ALLOCATE(XWTFRC(0,0,0)) + ALLOCATE(XUFRC_PAST(0,0,0)) + ALLOCATE(XVFRC_PAST(0,0,0)) +END IF +! +IF (KMI == 1) THEN + IF ( LFORCING ) THEN + ALLOCATE(TDTFRC(NFRC)) + ALLOCATE(XUFRC(IKU,NFRC)) + ALLOCATE(XVFRC(IKU,NFRC)) + ALLOCATE(XWFRC(IKU,NFRC)) + ALLOCATE(XTHFRC(IKU,NFRC)) + ALLOCATE(XRVFRC(IKU,NFRC)) + ALLOCATE(XTENDTHFRC(IKU,NFRC)) + ALLOCATE(XTENDRVFRC(IKU,NFRC)) + ALLOCATE(XGXTHFRC(IKU,NFRC)) + ALLOCATE(XGYTHFRC(IKU,NFRC)) + ALLOCATE(XPGROUNDFRC(NFRC)) + ALLOCATE(XTENDUFRC(IKU,NFRC)) + ALLOCATE(XTENDVFRC(IKU,NFRC)) + ELSE + ALLOCATE(TDTFRC(0)) + ALLOCATE(XUFRC(0,0)) + ALLOCATE(XVFRC(0,0)) + ALLOCATE(XWFRC(0,0)) + ALLOCATE(XTHFRC(0,0)) + ALLOCATE(XRVFRC(0,0)) + ALLOCATE(XTENDTHFRC(0,0)) + ALLOCATE(XTENDRVFRC(0,0)) + ALLOCATE(XGXTHFRC(0,0)) + ALLOCATE(XGYTHFRC(0,0)) + ALLOCATE(XPGROUNDFRC(0)) + ALLOCATE(XTENDUFRC(0,0)) + ALLOCATE(XTENDVFRC(0,0)) + END IF +ELSE + !Do not allocate because they are the same on all grids (not 'n' variables) +END IF +! ---------------------------------------------------------------------- +! +IF (L2D_ADV_FRC) THEN + WRITE(ILUOUT,*) 'L2D_ADV_FRC IS SET TO', L2D_ADV_FRC + WRITE(ILUOUT,*) 'ADV FRC WILL BE SET' + ALLOCATE(TDTADVFRC(NADVFRC)) + ALLOCATE(XDTHFRC(IIU,IJU,IKU,NADVFRC)) ; XDTHFRC=0. + ALLOCATE(XDRVFRC(IIU,IJU,IKU,NADVFRC)) ; XDRVFRC=0. +ELSE + ALLOCATE(TDTADVFRC(0)) + ALLOCATE(XDTHFRC(0,0,0,0)) + ALLOCATE(XDRVFRC(0,0,0,0)) +ENDIF + +IF (L2D_REL_FRC) THEN + WRITE(ILUOUT,*) 'L2D_REL_FRC IS SET TO', L2D_REL_FRC + WRITE(ILUOUT,*) 'REL FRC WILL BE SET' + ALLOCATE(TDTRELFRC(NRELFRC)) + ALLOCATE(XTHREL(IIU,IJU,IKU,NRELFRC)) ; XTHREL=0. + ALLOCATE(XRVREL(IIU,IJU,IKU,NRELFRC)) ; XRVREL=0. +ELSE + ALLOCATE(TDTRELFRC(0)) + ALLOCATE(XTHREL(0,0,0,0)) + ALLOCATE(XRVREL(0,0,0,0)) +ENDIF +! +!* 4.11 BIS: Eddy fluxes allocation +! +IF ( LTH_FLX ) THEN + ALLOCATE(XVTH_FLUX_M(IIU,IJU,IKU)) ; XVTH_FLUX_M = 0. + ALLOCATE(XWTH_FLUX_M(IIU,IJU,IKU)) ; XWTH_FLUX_M = 0. + IF (KMI /= 1) THEN + ALLOCATE(XRTHS_EDDY_FLUX(IIU,IJU,IKU)) + XRTHS_EDDY_FLUX = 0. + ELSE + ALLOCATE(XRTHS_EDDY_FLUX(0,0,0)) + ENDIF +ELSE + ALLOCATE(XVTH_FLUX_M(0,0,0)) + ALLOCATE(XWTH_FLUX_M(0,0,0)) + ALLOCATE(XRTHS_EDDY_FLUX(0,0,0)) +END IF +! +IF ( LUV_FLX) THEN + ALLOCATE(XVU_FLUX_M(IIU,IJU,IKU)) ; XVU_FLUX_M = 0. + IF (KMI /= 1) THEN + ALLOCATE(XRVS_EDDY_FLUX(IIU,IJU,IKU)) + XRVS_EDDY_FLUX = 0. + ELSE + ALLOCATE(XRVS_EDDY_FLUX(0,0,0)) + ENDIF +ELSE + ALLOCATE(XVU_FLUX_M(0,0,0)) + ALLOCATE(XRVS_EDDY_FLUX(0,0,0)) +END IF +! +!* 3.11 Module MODD_ICE_CONC_n +! +IF ( (CCLOUD == 'ICE3'.OR.CCLOUD == 'ICE4') .AND. & + (CPROGRAM == 'DIAG '.OR.CPROGRAM == 'MESONH')) THEN + ALLOCATE(XCIT(IIU,IJU,IKU)) +ELSE + ALLOCATE(XCIT(0,0,0)) +END IF +! +IF ( CCLOUD == 'KHKO' .OR. CCLOUD == 'C2R2') THEN + ALLOCATE(XSUPSAT(IIU,IJU,IKU)) + ALLOCATE(XNACT(IIU,IJU,IKU)) + ALLOCATE(XNPRO(IIU,IJU,IKU)) + ALLOCATE(XSSPRO(IIU,IJU,IKU)) +ELSE + ALLOCATE(XSUPSAT(0,0,0)) + ALLOCATE(XNACT(0,0,0)) + ALLOCATE(XNPRO(0,0,0)) + ALLOCATE(XSSPRO(0,0,0)) +END IF +! +!* 3.12 Module MODD_TURB_CLOUD +! +IF (.NOT.(ALLOCATED(XCEI))) ALLOCATE(XCEI(0,0,0)) +IF (KMI == NMODEL_CLOUD .AND. CTURBLEN_CLOUD/='NONE' ) THEN + DEALLOCATE(XCEI) + ALLOCATE(XCEI(IIU,IJU,IKU)) +ENDIF +! +!* 3.13 Module MODD_CH_PH_n +! +IF (LUSECHAQ.AND.(CPROGRAM == 'DIAG '.OR.CPROGRAM == 'MESONH')) THEN + IF (LCH_PH) THEN + ALLOCATE(XPHC(IIU,IJU,IKU)) + IF (NRRL==2) THEN + ALLOCATE(XPHR(IIU,IJU,IKU)) + ALLOCATE(XACPHR(IIU,IJU)) + XACPHR(:,:) = 0. + ENDIF + ENDIF + IF (NRRL==2) THEN + ALLOCATE(XACPRAQ(IIU,IJU,NSV_CHAC/2)) + XACPRAQ(:,:,:) = 0. + ENDIF +ENDIF +IF (.NOT.(ASSOCIATED(XPHC))) ALLOCATE(XPHC(0,0,0)) +IF (.NOT.(ASSOCIATED(XPHR))) ALLOCATE(XPHR(0,0,0)) +IF (.NOT.(ASSOCIATED(XACPHR))) ALLOCATE(XACPHR(0,0)) +IF (.NOT.(ASSOCIATED(XACPRAQ))) ALLOCATE(XACPRAQ(0,0,0)) +IF ((LUSECHEM).AND.(CPROGRAM == 'DIAG ')) THEN + ALLOCATE(XCHFLX(IIU,IJU,NSV_CHEM)) + XCHFLX(:,:,:) = 0. +ELSE + ALLOCATE(XCHFLX(0,0,0)) +END IF +! +!* 3.14 Module MODD_DRAG +! +IF (LDRAG) THEN + ALLOCATE(XDRAG(IIU,IJU)) +ELSE + ALLOCATE(XDRAG(0,0)) +ENDIF +! +!------------------------------------------------------------------------------- +! +!* 4. INITIALIZE BUDGET VARIABLES +! --------------------------- +! +gles = lles_mean .or. lles_resolved .or. lles_subgrid .or. lles_updraft & + .or. lles_downdraft .or. lles_spectra +!Called if budgets are enabled via NAM_BUDGET +!or if LES budgets are enabled via NAM_LES (condition on kmi==1 to call it max once) +if ( ( cbutype /= "NONE" .and. nbumod == kmi ) .or. ( ( gles .or. lcheck ) .and. kmi == 1 ) ) THEN + call Budget_preallocate() +end if + +IF ( CBUTYPE /= "NONE" .AND. NBUMOD == KMI ) THEN + CALL Ini_budget(ILUOUT,XTSTEP,NSV,NRR, & + LNUMDIFU,LNUMDIFTH,LNUMDIFSV, & + LHORELAX_UVWTH,LHORELAX_RV, LHORELAX_RC,LHORELAX_RR, & + LHORELAX_RI,LHORELAX_RS,LHORELAX_RG, LHORELAX_RH,LHORELAX_TKE, & + LHORELAX_SV, LVE_RELAX, LVE_RELAX_GRD, & + LCHTRANS,LNUDGING,LDRAGTREE,LDEPOTREE,LMAIN_EOL, & + CRAD,CDCONV,CSCONV,CTURB,CTURBDIM,CCLOUD ) +END IF +! +!------------------------------------------------------------------------------- +! +! +!* 5. INITIALIZE INTERPOLATION COEFFICIENTS +! +CALL INI_BIKHARDT_n (NDXRATIO_ALL(KMI),NDYRATIO_ALL(KMI),KMI) +! +!------------------------------------------------------------------------------- +! +!* 6. BUILT THE GENERIC OUTPUT NAME +! ---------------------------- +! +IF (KMI == 1) THEN + DO IMI = 1 , NMODEL + WRITE(IO_SURF_MNH_MODEL(IMI)%COUTFILE,'(A,".",I1,".",A)') CEXP,IMI,TRIM(ADJUSTL(CSEG)) + WRITE(YNAME, '(A,".",I1,".",A)') CEXP,IMI,TRIM(ADJUSTL(CSEG))//'.000' + CALL IO_File_add2list(LUNIT_MODEL(IMI)%TDIAFILE,YNAME,'MNHDIACHRONIC','WRITE', & + HDIRNAME=CIO_DIR, & + KLFINPRAR=INT(50,KIND=LFIINT),KLFITYPE=1,KLFIVERB=NVERB, & + TPDADFILE=LUNIT_MODEL(NDAD(IMI))%TDIAFILE ) + END DO + ! + TDIAFILE => LUNIT_MODEL(KMI)%TDIAFILE !Necessary because no call to GOTO_MODEL before needing it + ! + IF (CPROGRAM=='MESONH') THEN + IF ( NDAD(KMI) == 1) CDAD_NAME(KMI) = CEXP//'.1.'//CSEG + IF ( NDAD(KMI) == 2) CDAD_NAME(KMI) = CEXP//'.2.'//CSEG + IF ( NDAD(KMI) == 3) CDAD_NAME(KMI) = CEXP//'.3.'//CSEG + IF ( NDAD(KMI) == 4) CDAD_NAME(KMI) = CEXP//'.4.'//CSEG + IF ( NDAD(KMI) == 5) CDAD_NAME(KMI) = CEXP//'.5.'//CSEG + IF ( NDAD(KMI) == 6) CDAD_NAME(KMI) = CEXP//'.6.'//CSEG + IF ( NDAD(KMI) == 7) CDAD_NAME(KMI) = CEXP//'.7.'//CSEG + IF ( NDAD(KMI) == 8) CDAD_NAME(KMI) = CEXP//'.8.'//CSEG + END IF +END IF +! +!------------------------------------------------------------------------------- +! +!* 7. INITIALIZE GRIDS AND METRIC COEFFICIENTS +! ---------------------------------------- +! +CALL SET_GRID(KMI,TPINIFILE,IKU,NIMAX_ll,NJMAX_ll, & + XTSTEP,XSEGLEN, & + XLONORI,XLATORI,XLON,XLAT, & + XXHAT,XYHAT,XDXHAT,XDYHAT, XMAP, & + XZS,XZZ,XZHAT,XZTOP,LSLEVE,XLEN1,XLEN2,XZSMT, & + ZJ, & + TDTMOD,TDTCUR,NSTOP,NBAK_NUMB,NOUT_NUMB,TBACKUPN,TOUTPUTN) +! +CALL METRICS(XMAP,XDXHAT,XDYHAT,XZZ,XDXX,XDYY,XDZX,XDZY,XDZZ) +! +!* update halos of metric coefficients +! +! +CALL UPDATE_METRICS(CLBCX,CLBCY,XDXX,XDYY,XDZX,XDZY,XDZZ) +! +! +CALL SET_DIRCOS(CLBCX,CLBCY,XDXX,XDYY,XDZX,XDZY,TZINITHALO2D_ll, & + XDIRCOSXW,XDIRCOSYW,XDIRCOSZW,XCOSSLOPE,XSINSLOPE ) +! +! grid nesting initializations +IF ( KMI == 1 ) THEN + XTSTEP_MODEL1=XTSTEP +END IF +! +NDT_2_WAY(KMI)=4 +! +!------------------------------------------------------------------------------- +! +!* 8. INITIALIZE DATA FOR JVALUES AND AEROSOLS +! +IF ( LUSECHEM .OR. LCHEMDIAG ) THEN + IF ((KMI==1).AND.(CPROGRAM == "MESONH".OR.CPROGRAM == "DIAG ")) & + CALL CH_INIT_JVALUES(TDTCUR%nday, TDTCUR%nmonth, & + TDTCUR%nyear, ILUOUT, XCH_TUV_DOBNEW) +! + IF (LORILAM) THEN + CALL CH_AER_MOD_INIT + ENDIF +END IF +IF (.NOT.(ASSOCIATED(XMI))) ALLOCATE(XMI(0,0,0,0)) +IF (.NOT.(ASSOCIATED(XSOLORG))) ALLOCATE(XSOLORG(0,0,0,0)) +! +IF (CCLOUD=='LIMA') CALL INIT_AEROSOL_PROPERTIES +! +! +! +! +!------------------------------------------------------------------------------- +! +!* 9. FIRE initializations +! -------------------- +! +IF(LBLAZE) THEN + ! + ! 9.1 Array allocation + ! ---------------- + ! + ! Level Set function + ALLOCATE(XLSPHI(IIU,IJU,NREFINX*NREFINY)); XLSPHI(:,:,:) = 0. + + ! BMap array + ! BMap default value + ! -1 = The fire is not here yet + ALLOCATE(XBMAP(IIU,IJU,NREFINX*NREFINY)); XBMAP(:,:,:) = -1. + + ! A array + ALLOCATE(XFMRFA(IIU,IJU,NREFINX*NREFINY)); XFMRFA(:,:,:) = 0. + + ! Wf0 array + ALLOCATE(XFMWF0(IIU,IJU,NREFINX*NREFINY)); XFMWF0(:,:,:) = 0. + + ! R0 array + ALLOCATE(XFMR0(IIU,IJU,NREFINX*NREFINY)); XFMR0(:,:,:) = 0. + + ! r00 array + ALLOCATE(XFMR00(IIU,IJU,NREFINX*NREFINY)); XFMR00(:,:,:) = 0. + + ! Ignition + ! Default value as 1E6 : Ignition long after simulation end time + ! 1E6 should be enough as it is more than 11 days + ALLOCATE(XFMIGNITION(IIU,IJU,NREFINX*NREFINY)); XFMIGNITION(:,:,:) = 1.E6 + + ! Fuel type + ALLOCATE(XFMFUELTYPE(IIU,IJU,NREFINX*NREFINY)); XFMFUELTYPE(:,:,:) = 0. + + ! Residence time function + ALLOCATE(XFIRETAU(IIU,IJU,NREFINX*NREFINY)); XFIRETAU(:,:,:) = 0. + + ! Rate of spread with wind + ALLOCATE(XFIRERW(IIU,IJU,NREFINX*NREFINY)); XFIRERW(:,:,:) = 0. + + ! Sensible heat flux parameters + ! get number of parameters + SELECT CASE(CHEAT_FLUX_MODEL) + CASE('CST') + ! 1 parameter for model : nominal injection value + INBPARAMSENSIBLE = 1 + + CASE('EXP') + ! 2 parameters for model : Max value and characteristic time + INBPARAMSENSIBLE = 2 + + CASE('EXS') + ! 3 parameters for model : Max value and characteristic time, smoldering injection value + INBPARAMSENSIBLE = 3 + END SELECT + + ALLOCATE(XFLUXPARAMH(IIU,IJU,NREFINX*NREFINY,INBPARAMSENSIBLE)); + XFLUXPARAMH(:,:,:,:) = 0. + + ! Latent heat flux parameters + ! get number of parameters + SELECT CASE(CLATENT_FLUX_MODEL) + CASE('CST') + ! 1 parameter for model : nominal injection value + INBPARAMLATENT = 1 + + CASE('EXP') + ! 2 parameters for model : Max value and characteristic time + INBPARAMLATENT = 2 + END SELECT + + ALLOCATE(XFLUXPARAMW(IIU,IJU,NREFINX*NREFINY,INBPARAMLATENT)); + XFLUXPARAMW(:,:,:,:) = 0. + + ! Available Sensible energy + ALLOCATE(XFMASE(IIU,IJU,NREFINX*NREFINY)); XFMASE(:,:,:) = 0. + + ! Available Latent energy + ALLOCATE(XFMAWC(IIU,IJU,NREFINX*NREFINY)); XFMAWC(:,:,:) = 0. + + ! Walking Ignition map (Arrival time matrix for ignition) + ALLOCATE(XFMWALKIG(IIU,IJU,NREFINX*NREFINY)); XFMWALKIG(:,:,:) = -1. + + ! Sensible heat flux (W/m2) + ALLOCATE(XFMFLUXHDH(IIU,IJU,NREFINX*NREFINY)); XFMFLUXHDH(:,:,:) = 0. + + ! Latent heat flux (kg/s/m2) + ALLOCATE(XFMFLUXHDW(IIU,IJU,NREFINX*NREFINY)); XFMFLUXHDW(:,:,:) = 0. + + ! filtered wind on front normal (m/s) + ALLOCATE(XFMHWS(IIU,IJU,NREFINX*NREFINY)); XFMHWS(:,:,:) = 0. + + ! filtered wind U (m/s) + ALLOCATE(XFMWINDU(IIU,IJU,NREFINX*NREFINY)); XFMWINDU(:,:,:) = 0. + + ! filtered wind V (m/s) + ALLOCATE(XFMWINDV(IIU,IJU,NREFINX*NREFINY)); XFMWINDV(:,:,:) = 0. + + ! filtered wind W (m/s) + ALLOCATE(XFMWINDW(IIU,IJU,NREFINX*NREFINY)); XFMWINDW(:,:,:) = 0. + + ! Gradient of Level Set on x + ALLOCATE(XGRADLSPHIX(IIU,IJU,NREFINX*NREFINY)); XGRADLSPHIX(:,:,:) = 0. + + ! Gradient of Level Set on y + ALLOCATE(XGRADLSPHIY(IIU,IJU,NREFINX*NREFINY)); XGRADLSPHIY(:,:,:) = 0. + + ! Wind for fire + ALLOCATE(XFIREWIND(IIU,IJU,NREFINX*NREFINY)); XFIREWIND(:,:,:) = 0. + + ! Orographic gradient on fire mesh + ALLOCATE(XFMGRADOROX(IIU,IJU,NREFINX*NREFINY)); XFMGRADOROX(:,:,:) = 0. + ALLOCATE(XFMGRADOROY(IIU,IJU,NREFINX*NREFINY)); XFMGRADOROY(:,:,:) = 0. + ! + ! 9.2 Array 2d fire mesh allocation + ! ----------------------------- + ! + ! Level Set 2d + ALLOCATE(XLSPHI2D(IIU*NREFINX,IJU*NREFINY)); XLSPHI2D(:,:) = 0. + ! Gradient of Level Set on x 2d + ALLOCATE(XGRADLSPHIX2D(IIU*NREFINX,IJU*NREFINY)); XGRADLSPHIX2D(:,:) = 0. + + ! Gradient of Level Set on y 2d + ALLOCATE(XGRADLSPHIY2D(IIU*NREFINX,IJU*NREFINY)); XGRADLSPHIY2D(:,:) = 0. + + ! Level Set mask on x 2d + ALLOCATE(XGRADMASKX(IIU*NREFINX,IJU*NREFINY)); XGRADMASKX(:,:) = 0. + + ! Level Set mask on y 2d + ALLOCATE(XGRADMASKY(IIU*NREFINX,IJU*NREFINY)); XGRADMASKY(:,:) = 0. + + ! burnt surface ratio 2d + ALLOCATE(XSURFRATIO2D(IIU*NREFINX,IJU*NREFINY)); XSURFRATIO2D(:,:) = 0. + + ! Level Set diffusuon x 2d + ALLOCATE(XLSDIFFUX2D(IIU*NREFINX,IJU*NREFINY)); XLSDIFFUX2D(:,:) = 0. + + ! Level Set diffusion y 2d + ALLOCATE(XLSDIFFUY2D(IIU*NREFINX,IJU*NREFINY)); XLSDIFFUY2D(:,:) = 0. + + ! ROS diffusion 2d + ALLOCATE(XFIRERW2D(IIU*NREFINX,IJU*NREFINY)); XFIRERW2D(:,:) = 0. + ! + ! 9.3 Compute fire mesh size + ! ---------------------- + ! + XFIREMESHSIZE(1) = (XXHAT(2) - XXHAT(1)) / REAL(NREFINX) + XFIREMESHSIZE(2) = (XYHAT(2) - XYHAT(1)) / REAL(NREFINY) + ! +ELSE + ! + ! 9.4 Default allocation + ! ------------------ + ! + ! 3d array + ALLOCATE(XLSPHI(0,0,0)) + ALLOCATE(XBMAP(0,0,0)) + ALLOCATE(XFMRFA(0,0,0)) + ALLOCATE(XFMR0(0,0,0)) + ALLOCATE(XFMWF0(0,0,0)) + ALLOCATE(XFMR00(0,0,0)) + ALLOCATE(XFMIGNITION(0,0,0)) + ALLOCATE(XFMFUELTYPE(0,0,0)) + ALLOCATE(XFIRETAU(0,0,0)) + ALLOCATE(XFIRERW(0,0,0)) + ALLOCATE(XFLUXPARAMH(0,0,0,0)) + ALLOCATE(XFLUXPARAMW(0,0,0,0)) + ALLOCATE(XFMASE(0,0,0)) + ALLOCATE(XFMAWC(0,0,0)) + ALLOCATE(XFMWALKIG(0,0,0)) + ALLOCATE(XFMFLUXHDH(0,0,0)) + ALLOCATE(XFMFLUXHDW(0,0,0)) + ALLOCATE(XGRADLSPHIX(0,0,0)) + ALLOCATE(XGRADLSPHIY(0,0,0)) + ALLOCATE(XFIREWIND(0,0,0)) + ALLOCATE(XFMGRADOROX(0,0,0)) + ALLOCATE(XFMGRADOROY(0,0,0)) + ! 2d array + ALLOCATE(XLSPHI2D(0,0)) + ALLOCATE(XGRADLSPHIX2D(0,0)) + ALLOCATE(XGRADLSPHIY2D(0,0)) + ALLOCATE(XGRADMASKX(0,0)) + ALLOCATE(XGRADMASKY(0,0)) + ALLOCATE(XSURFRATIO2D(0,0)) + ALLOCATE(XLSDIFFUX2D(0,0)) + ALLOCATE(XLSDIFFUY2D(0,0)) + ALLOCATE(XFIRERW2D(0,0)) +END IF +! +! +!------------------------------------------------------------------------------- +! +!* 9. INITIALIZE THE PROGNOSTIC FIELDS +! -------------------------------- +! +CALL MPPDB_CHECK3D(XUT,"INI_MODEL_N-before read_field::XUT",PRECISION) +CALL READ_FIELD(KMI,TPINIFILE,IIU,IJU,IKU, & + CGETTKET,CGETRVT,CGETRCT,CGETRRT,CGETRIT,CGETCIT,CGETZWS, & + CGETRST,CGETRGT,CGETRHT,CGETSVT,CGETSRCT,CGETSIGS,CGETCLDFR, & + CGETICEFR, CGETBL_DEPTH,CGETSBL_DEPTH,CGETPHC,CGETPHR, & + CUVW_ADV_SCHEME, CTEMP_SCHEME, & + NSIZELBX_ll, NSIZELBXU_ll, NSIZELBY_ll, NSIZELBYV_ll, & + NSIZELBXTKE_ll,NSIZELBYTKE_ll, & + NSIZELBXR_ll,NSIZELBYR_ll,NSIZELBXSV_ll,NSIZELBYSV_ll, & + XUM,XVM,XWM,XDUM,XDVM,XDWM, & + XUT,XVT,XWT,XTHT,XPABST,XTKET,XRTKEMS, & + XRT,XSVT,XZWS,XCIT,XDRYMASST,XDRYMASSS, & + XSIGS,XSRCT,XCLDFR,XICEFR, XBL_DEPTH,XSBL_DEPTH,XWTHVMF, & + XPHC,XPHR, XLSUM,XLSVM,XLSWM,XLSTHM,XLSRVM,XLSZWSM, & + XLBXUM,XLBXVM,XLBXWM,XLBXTHM,XLBXTKEM, & + XLBXRM,XLBXSVM, & + XLBYUM,XLBYVM,XLBYWM,XLBYTHM,XLBYTKEM, & + XLBYRM,XLBYSVM, & + NFRC,TDTFRC,XUFRC,XVFRC,XWFRC,XTHFRC,XRVFRC, & + XTENDTHFRC,XTENDRVFRC,XGXTHFRC,XGYTHFRC, & + XPGROUNDFRC, XATC, & + XTENDUFRC, XTENDVFRC, & + NADVFRC,TDTADVFRC,XDTHFRC,XDRVFRC, & + NRELFRC,TDTRELFRC,XTHREL,XRVREL, & + XVTH_FLUX_M,XWTH_FLUX_M,XVU_FLUX_M, & + XRUS_PRES,XRVS_PRES,XRWS_PRES,XRTHS_CLD,XRRS_CLD,XRSVS_CLD, & + ZIBM_LS,XIBM_XMUT,XUMEANW,XVMEANW,XWMEANW,XUMEANN,XVMEANN, & + XWMEANN,XUMEANE,XVMEANE,XWMEANE,XUMEANS,XVMEANS,XWMEANS, & + XLSPHI, XBMAP, XFMASE, XFMAWC, XFMWINDU, XFMWINDV, XFMWINDW, XFMHWS ) + +! +!------------------------------------------------------------------------------- +! +! +!* 10. INITIALIZE REFERENCE STATE +! --------------------------- +! +! +CALL SET_REF(KMI,TPINIFILE, & + XZZ,XZHAT,ZJ,XDXX,XDYY,CLBCX,CLBCY, & + XREFMASS,XMASS_O_PHI0,XLINMASS, & + XRHODREF,XTHVREF,XRVREF,XEXNREF,XRHODJ ) +! +!------------------------------------------------------------------------------- +! +!* 10.1 INITIALIZE THE TURBULENCE VARIABLES +! ----------------------------------- +! +IF(LSTATNW) THEN + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_MODEL_n','LSTATNW option not tested in Meso-NH') +ENDIF +CALL INI_TURB(CPROGRAM) +IF ((CTURB == 'TKEL').AND.(CCONF=='START')) THEN + CALL MPPDB_CHECK3D(XUT,"INI_MODEL_N-before ini_tke_eps::XUT",PRECISION) + CALL INI_TKE_EPS(CGETTKET,XTHVREF,XZZ, & + XUT,XVT,XTHT, & + XTKET,TZINITHALO3D_ll ) + CALL MPPDB_CHECK3D(XUT,"INI_MODEL_N-after ini_tke_eps::XUT",PRECISION) +END IF +! +! +!* 10.2 INITIALIZE THE LES VARIABLES +! ---------------------------- +! +CALL INI_LES_n +! +!------------------------------------------------------------------------------- +! +!* 11. INITIALIZE THE SOURCE OF TOTAL DRY MASS Md +! ------------------------------------------ +! +IF((KMI==1).AND.LSTEADYLS .AND. (CCONF=='START') ) THEN + XDRYMASSS = 0. +END IF +! +!------------------------------------------------------------------------------- +! +!* 12. INITIALIZE THE MICROPHYSICS +! ---------------------------- +! +IF (CELEC == 'NONE') THEN + CALL INI_MICRO_n(TPINIFILE,ILUOUT) +! +!------------------------------------------------------------------------------- +! +!* 13. INITIALIZE THE ATMOSPHERIC ELECTRICITY +! -------------------------------------- +! +ELSE + CALL INI_ELEC_n(ILUOUT, CELEC, CCLOUD, TPINIFILE, & + XTSTEP, XZZ, & + XDXX, XDYY, XDZZ, XDZX, XDZY ) +! + WRITE (UNIT=ILUOUT,& + FMT='(/,"ELECTRIC VARIABLES ARE BETWEEN INDEX",I2," AND ",I2)')& + NSV_ELECBEG, NSV_ELECEND +! + IF( CGETSVT(NSV_ELECBEG)=='INIT' ) THEN + XSVT(:,:,:,NSV_ELECBEG) = XCION_POS_FW(:,:,:) ! Nb/kg + XSVT(:,:,:,NSV_ELECEND) = XCION_NEG_FW(:,:,:) +! + XSVT(:,:,:,NSV_ELECBEG+1:NSV_ELECEND-1) = 0.0 + ELSE ! Convert elec_variables per m3 into elec_variables per kg of air + DO JSV = NSV_ELECBEG, NSV_ELECEND + XSVT(:,:,:,JSV) = XSVT(:,:,:,JSV) / XRHODREF(:,:,:) + ENDDO + END IF +END IF +! +!------------------------------------------------------------------------------- +! +!* 14. INITIALIZE THE LARGE SCALE SOURCES +! ---------------------------------- +! +IF ((KMI==1).AND.(.NOT. LSTEADYLS)) THEN + CALL MPPDB_CHECK3D(XUT,"INI_MODEL_N-before ini_cpl::XUT",PRECISION) + CALL INI_CPL(NSTOP,XTSTEP,LSTEADYLS,CCONF, & + CGETTKET, & + CGETRVT,CGETRCT,CGETRRT,CGETRIT, & + CGETRST,CGETRGT,CGETRHT,CGETSVT,LCH_INIT_FIELD, & + NSV,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,XLSZWSM,XDRYMASST, & + XLBXUM,XLBXVM,XLBXWM,XLBXTHM,XLBXTKEM,XLBXRM,XLBXSVM, & + XLBYUM,XLBYVM,XLBYWM,XLBYTHM,XLBYTKEM,XLBYRM,XLBYSVM, & + XLSUS,XLSVS,XLSWS,XLSTHS,XLSRVS,XLSZWSS,XDRYMASSS, & + XLBXUS,XLBXVS,XLBXWS,XLBXTHS,XLBXTKES,XLBXRS,XLBXSVS, & + XLBYUS,XLBYVS,XLBYWS,XLBYTHS,XLBYTKES,XLBYRS,XLBYSVS ) + CALL MPPDB_CHECK3D(XUT,"INI_MODEL_N-after ini_cpl::XUT",PRECISION) +! + 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 +! Blaze smoke +DO JSV=NSV_FIREBEG,NSV_FIREEND + XLBXSVS(:,:,:,JSV)=MAX(XLBXSVS(:,:,:,JSV),0.) + XLBYSVS(:,:,:,JSV)=MAX(XLBYSVS(:,:,:,JSV),0.) +ENDDO +! + DO JSV=NSV_CSBEG,NSV_CSEND + XLBXSVS(:,:,:,JSV)=MAX(XLBXSVS(:,:,:,JSV),0.) + XLBYSVS(:,:,:,JSV)=MAX(XLBYSVS(:,:,:,JSV),0.) + ENDDO +! +END IF +! +IF ( KMI > 1) THEN + ! Use dummy pointers to correct an ifort BUG + DPTR_XBMX1=>XBMX1 + DPTR_XBMX2=>XBMX2 + DPTR_XBMX3=>XBMX3 + DPTR_XBMX4=>XBMX4 + DPTR_XBMY1=>XBMY1 + DPTR_XBMY2=>XBMY2 + DPTR_XBMY3=>XBMY3 + DPTR_XBMY4=>XBMY4 + DPTR_XBFX1=>XBFX1 + DPTR_XBFX2=>XBFX2 + DPTR_XBFX3=>XBFX3 + DPTR_XBFX4=>XBFX4 + DPTR_XBFY1=>XBFY1 + DPTR_XBFY2=>XBFY2 + DPTR_XBFY3=>XBFY3 + DPTR_XBFY4=>XBFY4 + DPTR_CLBCX=>CLBCX + DPTR_CLBCY=>CLBCY + ! + DPTR_XZZ=>XZZ + DPTR_XZHAT=>XZHAT + DPTR_XLSUM=>XLSUM + DPTR_XLSVM=>XLSVM + DPTR_XLSWM=>XLSWM + DPTR_XLSTHM=>XLSTHM + DPTR_XLSRVM=>XLSRVM + DPTR_XLSZWSM=>XLSZWSM + DPTR_XLSUS=>XLSUS + DPTR_XLSVS=>XLSVS + DPTR_XLSWS=>XLSWS + DPTR_XLSTHS=>XLSTHS + DPTR_XLSRVS=>XLSRVS + DPTR_XLSZWSS=>XLSZWSS + ! + DPTR_NKLIN_LBXU=>NKLIN_LBXU + DPTR_XCOEFLIN_LBXU=>XCOEFLIN_LBXU + DPTR_NKLIN_LBYU=>NKLIN_LBYU + DPTR_XCOEFLIN_LBYU=>XCOEFLIN_LBYU + DPTR_NKLIN_LBXV=>NKLIN_LBXV + DPTR_XCOEFLIN_LBXV=>XCOEFLIN_LBXV + DPTR_NKLIN_LBYV=>NKLIN_LBYV + DPTR_XCOEFLIN_LBYV=>XCOEFLIN_LBYV + DPTR_NKLIN_LBXW=>NKLIN_LBXW + DPTR_XCOEFLIN_LBXW=>XCOEFLIN_LBXW + DPTR_NKLIN_LBYW=>NKLIN_LBYW + DPTR_XCOEFLIN_LBYW=>XCOEFLIN_LBYW + DPTR_NKLIN_LBXM=>NKLIN_LBXM + DPTR_XCOEFLIN_LBXM=>XCOEFLIN_LBXM + DPTR_NKLIN_LBYM=>NKLIN_LBYM + DPTR_XCOEFLIN_LBYM=>XCOEFLIN_LBYM + ! + CALL INI_SPAWN_LS_n(NDAD(KMI),XTSTEP,KMI, & + DPTR_XBMX1,DPTR_XBMX2,DPTR_XBMX3,DPTR_XBMX4,DPTR_XBMY1,DPTR_XBMY2,DPTR_XBMY3,DPTR_XBMY4, & + DPTR_XBFX1,DPTR_XBFX2,DPTR_XBFX3,DPTR_XBFX4,DPTR_XBFY1,DPTR_XBFY2,DPTR_XBFY3,DPTR_XBFY4, & + NDXRATIO_ALL(KMI),NDYRATIO_ALL(KMI), & + DPTR_CLBCX,DPTR_CLBCY,DPTR_XZZ,DPTR_XZHAT, & + LSLEVE,XLEN1,XLEN2, & + DPTR_XLSUM,DPTR_XLSVM,DPTR_XLSWM,DPTR_XLSTHM,DPTR_XLSRVM,DPTR_XLSZWSM, & + DPTR_XLSUS,DPTR_XLSVS,DPTR_XLSWS,DPTR_XLSTHS,DPTR_XLSRVS,DPTR_XLSZWSS, & + DPTR_NKLIN_LBXU,DPTR_XCOEFLIN_LBXU,DPTR_NKLIN_LBYU,DPTR_XCOEFLIN_LBYU, & + DPTR_NKLIN_LBXV,DPTR_XCOEFLIN_LBXV,DPTR_NKLIN_LBYV,DPTR_XCOEFLIN_LBYV, & + DPTR_NKLIN_LBXW,DPTR_XCOEFLIN_LBXW,DPTR_NKLIN_LBYW,DPTR_XCOEFLIN_LBYW, & + DPTR_NKLIN_LBXM,DPTR_XCOEFLIN_LBXM,DPTR_NKLIN_LBYM,DPTR_XCOEFLIN_LBYM ) + ! + DPTR_XLBXUM=>XLBXUM + DPTR_XLBYUM=>XLBYUM + DPTR_XLBXVM=>XLBXVM + DPTR_XLBYVM=>XLBYVM + DPTR_XLBXWM=>XLBXWM + DPTR_XLBYWM=>XLBYWM + DPTR_XLBXTHM=>XLBXTHM + DPTR_XLBYTHM=>XLBYTHM + DPTR_XLBXTKEM=>XLBXTKEM + DPTR_XLBYTKEM=>XLBYTKEM + DPTR_XLBXRM=>XLBXRM + DPTR_XLBYRM=>XLBYRM + DPTR_XLBXSVM=>XLBXSVM + DPTR_XLBYSVM=>XLBYSVM + IF (CCONF=='START') THEN + CALL INI_ONE_WAY_n(NDAD(KMI),KMI, & + DPTR_XBMX1,DPTR_XBMX2,DPTR_XBMX3,DPTR_XBMX4,DPTR_XBMY1,DPTR_XBMY2,DPTR_XBMY3,DPTR_XBMY4, & + DPTR_XBFX1,DPTR_XBFX2,DPTR_XBFX3,DPTR_XBFX4,DPTR_XBFY1,DPTR_XBFY2,DPTR_XBFY3,DPTR_XBFY4, & + NDXRATIO_ALL(KMI),NDYRATIO_ALL(KMI), & + DPTR_CLBCX,DPTR_CLBCY,NRIMX,NRIMY, & + DPTR_NKLIN_LBXU,DPTR_XCOEFLIN_LBXU,DPTR_NKLIN_LBYU,DPTR_XCOEFLIN_LBYU, & + DPTR_NKLIN_LBXV,DPTR_XCOEFLIN_LBXV,DPTR_NKLIN_LBYV,DPTR_XCOEFLIN_LBYV, & + DPTR_NKLIN_LBXW,DPTR_XCOEFLIN_LBXW,DPTR_NKLIN_LBYW,DPTR_XCOEFLIN_LBYW, & + DPTR_NKLIN_LBXM,DPTR_XCOEFLIN_LBXM,DPTR_NKLIN_LBYM,DPTR_XCOEFLIN_LBYM, & + CCLOUD, LUSECHAQ, LUSECHIC, & + DPTR_XLBXUM,DPTR_XLBYUM,DPTR_XLBXVM,DPTR_XLBYVM,DPTR_XLBXWM,DPTR_XLBYWM, & + DPTR_XLBXTHM,DPTR_XLBYTHM, & + DPTR_XLBXTKEM,DPTR_XLBYTKEM, & + DPTR_XLBXRM,DPTR_XLBYRM,DPTR_XLBXSVM,DPTR_XLBYSVM ) + ENDIF +END IF +! +! +!------------------------------------------------------------------------------- +! +!* 15. INITIALIZE THE SCALAR VARIABLES +! ------------------------------- +! +IF (LLG .AND. LINIT_LG .AND. CPROGRAM=='MESONH') & + CALL INI_LG(XXHAT,XYHAT,XZZ,XSVT,XLBXSVM,XLBYSVM) + +! +!------------------------------------------------------------------------------- +! +!* 16. INITIALIZE THE PARAMETERS FOR THE DYNAMICS +! ------------------------------------------ +! +CALL INI_DYNAMICS(XLON,XLAT,XRHODJ,XTHVREF,XMAP,XZZ,XDXHAT,XDYHAT, & + XZHAT,CLBCX,CLBCY,XTSTEP, & + 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_SVAER,LHORELAX_SVDST,LHORELAX_SVSLT, & + LHORELAX_SVPP,LHORELAX_SVCS,LHORELAX_SVCHIC,LHORELAX_SVSNW, & +#ifdef MNH_FOREFIRE + LHORELAX_SVFF, & +#endif + XRIMKMAX,NRIMX,NRIMY, & + XALKTOP,XALKGRD,XALZBOT,XALZBAS, & + XT4DIFU,XT4DIFTH,XT4DIFSV, & + XCORIOX,XCORIOY,XCORIOZ,XCURVX,XCURVY, & + XDXHATM,XDYHATM,XRHOM,XAF,XBFY,XCF,XTRIGSX,XTRIGSY,NIFAXX,NIFAXY,& + XALK,XALKW,NALBOT,XALKBAS,XALKWBAS,NALBAS, & + LMASK_RELAX,XKURELAX,XKVRELAX,XKWRELAX, & + XDK2U,XDK4U,XDK2TH,XDK4TH,XDK2SV,XDK4SV, & + LZDIFFU,XZDIFFU_HALO2, & + XBFB,XBF_SXP2_YP1_Z ) +! +! +!* 16.1 Initialize the XDRAG array +! ------------- +IF (LDRAG) THEN + CALL INI_DRAG(LMOUNT,XZS,XHSTART,NSTART,XDRAG) +ENDIF +!* 16.2 Initialize the LevelSet function +! ------------- +IF (LIBM) THEN + ALLOCATE(XIBM_LS(IIU,IJU,IKU,4)) ; XIBM_LS = -XIBM_IEPS + XIBM_LS(:,:,:,1)=ZIBM_LS(:,:,:) + DEALLOCATE(ZIBM_LS) +ENDIF +!------------------------------------------------------------------------------- +! +!* 17. SURFACE FIELDS +! -------------- +! +!* 17.1 Radiative setup +! --------------- +! +IF (CRAD /= 'NONE') THEN + IF (CGETRAD =='INIT') THEN + GINIRAD =.TRUE. + ELSE + GINIRAD =.FALSE. + END IF + CALL INI_RADIATIONS(TPINIFILE,GINIRAD,TDTCUR,TDTEXP,XZZ, & + XDXX, XDYY, & + XSINDEL,XCOSDEL,XTSIDER,XCORSOL, & + XSLOPANG,XSLOPAZI, & + XDTHRAD,XDIRFLASWD,XSCAFLASWD, & + XFLALWD,XDIRSRFSWD,NCLEARCOL_TM1, & + XZENITH,XAZIM, & + TDTRAD_FULL,TDTRAD_CLONLY, & + TZINITHALO2D_ll, & + XRADEFF,XSWU,XSWD,XLWU, & + XLWD,XDTHRADSW,XDTHRADLW ) + ! + IF (GINIRAD) CALL SUNPOS_n(XZENITH,PAZIMSOL=XAZIM) + CALL SURF_SOLAR_GEOM (XZS, XZS_XY) + ! + ALLOCATE(XXHAT_ll (IIU_ll)) + ALLOCATE(XYHAT_ll (IJU_ll)) + ALLOCATE(XZS_ll (IIU_ll,IJU_ll)) + ALLOCATE(XZS_XY_ll (IIU_ll,IJU_ll)) + ! + CALL GATHERALL_FIELD_ll('XY',XZS,XZS_ll,IRESP) + CALL GATHERALL_FIELD_ll('XY',XZS_XY,XZS_XY_ll,IRESP) + CALL GATHERALL_FIELD_ll('XX',XXHAT,XXHAT_ll,IRESP) + CALL GATHERALL_FIELD_ll('YY',XYHAT,XYHAT_ll,IRESP) + XZS_MAX_ll=MAXVAL(XZS_ll) +ELSE + XAZIM = XPI + XZENITH = XPI/2. + XDIRSRFSWD = 0. + XSCAFLASWD = 0. + XFLALWD = 300. ! W/m2 + XTSIDER = 0. +END IF +! +! +CALL INI_SW_SETUP (CRAD,NSWB_MNH,XSW_BANDS) +CALL INI_LW_SETUP (CRAD,NLWB_MNH,XLW_BANDS) +! +! +! 17.1.1 Special initialisation for CO2 content +! CO2 (molar mass=44) horizontally and vertically homogeneous at 360 ppm +! +XCCO2 = 360.0E-06 * 44.0E-03 / XMD +#ifdef MNH_ECRAD +RCCO2 = 360.0E-06 * 44.0E-03 / XMD +#endif +! +! +!* 17.2 Externalized surface fields +! --------------------------- +! +ALLOCATE(ZCO2(IIU,IJU)) +ZCO2(:,:) = XCCO2 +! + +ALLOCATE(ZDIR_ALB(IIU,IJU,NSWB_MNH)) +ALLOCATE(ZSCA_ALB(IIU,IJU,NSWB_MNH)) +ALLOCATE(ZEMIS (IIU,IJU,NLWB_MNH)) +ALLOCATE(ZTSRAD (IIU,IJU)) +! +IF (LCOUPLES.AND.(KMI>1))THEN + CSURF ="NONE" +ELSE + IF ((TPINIFILE%NMNHVERSION(1)==4 .AND. TPINIFILE%NMNHVERSION(2)>=6) .OR. TPINIFILE%NMNHVERSION(1)>4) THEN + CALL IO_Field_read(TPINIFILE,'SURF',CSURF) + ELSE + CSURF = "EXTE" + END IF +END IF +! +! +IF (CSURF=='EXTE' .AND. (CPROGRAM=='MESONH' .OR. CPROGRAM=='DIAG ')) THEN + ! ouverture du fichier PGD + IF ( LEN_TRIM(CINIFILEPGD) > 0 ) THEN + CALL IO_File_add2list(TINIFILEPGD,TRIM(CINIFILEPGD),'PGD','READ',KLFITYPE=2,KLFIVERB=NVERB) + CALL IO_File_open(TINIFILEPGD,KRESP=IRESP) + LUNIT_MODEL(KMI)%TINIFILEPGD => TINIFILEPGD + IF (IRESP/=0) THEN + WRITE(ILUOUT,FMT=*) "INI_MODEL_n ERROR TO OPEN THE FILE CINIFILEPGD=",CINIFILEPGD + WRITE(ILUOUT,FMT=*) "CHECK YOUR NAMELIST NAM_LUNITn" + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_MODEL_n','') + ENDIF + ELSE + ! case after a spawning + CINIFILEPGD = TPINIFILE%CNAME + END IF + ! + CALL GOTO_SURFEX(KMI) +#ifdef CPLOASIS + CALL SFX_OASIS_READ_NAM(CPROGRAM,XTSTEP) + WRITE(*,*) 'SFX-OASIS: READ NAM_SFX_SEA_CPL OK' +#endif + !* initialization of surface + CALL INIT_GROUND_PARAM_n ('ALL',SIZE(CSV),CSV,ZCO2, & + XZENITH,XAZIM,XSW_BANDS,XLW_BANDS,ZDIR_ALB,ZSCA_ALB, & + ZEMIS,ZTSRAD ) + ! + IF (SIZE(XEMIS)>0) THEN + XDIR_ALB = ZDIR_ALB + XSCA_ALB = ZSCA_ALB + XEMIS = ZEMIS + XTSRAD = ZTSRAD + CALL MNHGET_SURF_PARAM_n (PSEA=XSEA) + END IF +ELSE + !* fields not physically necessary, but must be initialized + IF (SIZE(XEMIS)>0) THEN + XDIR_ALB = 0. + XSCA_ALB = 0. + XEMIS = 1. + XTSRAD = XTT + XSEA = 1. + END IF +END IF +IF (CSURF=='EXTE' .AND. (CPROGRAM=='SPAWN ')) THEN + ! ouverture du fichier PGD + CALL IO_File_add2list(TINIFILEPGD,TRIM(CINIFILEPGD),'PGD','READ',KLFITYPE=2,KLFIVERB=NVERB) + CALL IO_File_open(TINIFILEPGD,KRESP=IRESP) + LUNIT_MODEL(KMI)%TINIFILEPGD => TINIFILEPGD + IF (IRESP/=0) THEN + WRITE(ILUOUT,FMT=*) "INI_MODEL_n ERROR TO OPEN THE FILE CINIFILEPGD=",CINIFILEPGD + WRITE(ILUOUT,FMT=*) "CHECK YOUR NAMELIST NAM_LUNIT2_SPA" + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_MODEL_n','') + ENDIF +ENDIF +! +IF (.NOT.ASSOCIATED(TINIFILEPGD)) TINIFILEPGD => TFILE_DUMMY +! + !* special case after spawning in prep_real_case +IF (CSURF=='EXRM' .AND. CPROGRAM=='REAL ') CSURF = 'EXTE' +! +DEALLOCATE(ZDIR_ALB) +DEALLOCATE(ZSCA_ALB) +DEALLOCATE(ZEMIS ) +DEALLOCATE(ZTSRAD ) +! +DEALLOCATE(ZCO2) +! +! +!* in a RESTART case, reads surface radiative quantities in the MESONH file +! +IF ((CRAD == 'ECMW' .OR. CRAD == 'ECRA') .AND. CGETRAD=='READ') THEN + CALL INI_SURF_RAD(TPINIFILE, XDIR_ALB, XSCA_ALB, XEMIS, XTSRAD) +END IF +! +! +!* 17.3 Mesonh fields +! ------------- +! +IF (CPROGRAM/='REAL ') CALL MNHREAD_ZS_DUMMY_n(TINIFILEPGD) +! +!------------------------------------------------------------------------------- +! +!* 18. INITIALIZE THE PARAMETERS FOR THE PHYSICS +! ----------------------------------------- +! +IF (CRAD == 'ECMW') THEN +! +!* get cover mask for aerosols +! + IF (CPROGRAM=='MESONH' .OR. CPROGRAM=='DIAG ') THEN + ALLOCATE(ZSEA(IIU,IJU)) + ALLOCATE(ZTOWN(IIU,IJU)) + ALLOCATE(ZBARE(IIU,IJU)) + IF (CSURF=='EXTE') THEN + CALL GOTO_SURFEX(KMI) + CALL MNHGET_SURF_PARAM_n(PSEA=ZSEA,PTOWN=ZTOWN,PBARE=ZBARE) + ELSE + ZSEA (:,:) = 1. + ZTOWN(:,:) = 0. + ZBARE(:,:) = 0. + END IF +! + IF ( CAOP=='EXPL' .AND. LDUST .AND. KMI==1) THEN + ALLOCATE( XEXT_COEFF_WVL_LKT_DUST( NMAX_RADIUS_LKT_DUST, NMAX_SIGMA_LKT_DUST, NMAX_WVL_SW_DUST ) ) + ALLOCATE( XEXT_COEFF_550_LKT_DUST( NMAX_RADIUS_LKT_DUST, NMAX_SIGMA_LKT_DUST ) ) + ALLOCATE( XPIZA_LKT_DUST ( NMAX_RADIUS_LKT_DUST, NMAX_SIGMA_LKT_DUST, NMAX_WVL_SW_DUST ) ) + ALLOCATE( XCGA_LKT_DUST ( NMAX_RADIUS_LKT_DUST, NMAX_SIGMA_LKT_DUST, NMAX_WVL_SW_DUST ) ) + END IF +! + IF ( CAOP=='EXPL' .AND. LSALT .AND. KMI==1) THEN + ALLOCATE( XEXT_COEFF_WVL_LKT_SALT( NMAX_RADIUS_LKT_SALT, NMAX_SIGMA_LKT_SALT, NMAX_WVL_SW_SALT ) ) + ALLOCATE( XEXT_COEFF_550_LKT_SALT( NMAX_RADIUS_LKT_SALT, NMAX_SIGMA_LKT_SALT ) ) + ALLOCATE( XPIZA_LKT_SALT ( NMAX_RADIUS_LKT_SALT, NMAX_SIGMA_LKT_SALT, NMAX_WVL_SW_SALT ) ) + ALLOCATE( XCGA_LKT_SALT ( NMAX_RADIUS_LKT_SALT, NMAX_SIGMA_LKT_SALT, NMAX_WVL_SW_SALT ) ) + END IF +! + CALL INI_RADIATIONS_ECMWF (XZHAT,XPABST,XTHT,XTSRAD,XLAT,XLON,TDTCUR,TDTEXP, & + CLW,NDLON,NFLEV,NFLUX,NRAD,NSWB_OLD,CAER,NAER,NSTATM, & + XSTATM,ZSEA,ZTOWN,ZBARE,XOZON, XAER,XDST_WL, LSUBG_COND ) +! + DEALLOCATE(ZSEA,ZTOWN,ZBARE) + ALLOCATE (XAER_CLIM(SIZE(XAER,1),SIZE(XAER,2),SIZE(XAER,3),SIZE(XAER,4))) + XAER_CLIM(:,:,:,:) =XAER(:,:,:,:) +! + END IF + +ELSE IF (CRAD == 'ECRA') THEN +#ifdef MNH_ECRAD +!* get cover mask for aerosols +! + IF (CPROGRAM=='MESONH' .OR. CPROGRAM=='DIAG ') THEN + ALLOCATE(ZSEA(IIU,IJU)) + ALLOCATE(ZTOWN(IIU,IJU)) + ALLOCATE(ZBARE(IIU,IJU)) + IF (CSURF=='EXTE') THEN + CALL GOTO_SURFEX(KMI) + CALL MNHGET_SURF_PARAM_n(PSEA=ZSEA,PTOWN=ZTOWN,PBARE=ZBARE) + ELSE + ZSEA (:,:) = 1. + ZTOWN(:,:) = 0. + ZBARE(:,:) = 0. + END IF +! + CALL INI_RADIATIONS_ECRAD (XZHAT,XPABST,XTHT,XTSRAD,XLAT,XLON,TDTCUR,TDTEXP, & + CLW,NDLON,NFLEV,NFLUX,NRAD,NSWB_OLD,CAER,NAER,NSTATM, & + XSTATM,ZSEA,ZTOWN,ZBARE,XOZON, XAER,XDST_WL, LSUBG_COND ) + + DEALLOCATE(ZSEA,ZTOWN,ZBARE) + ALLOCATE (XAER_CLIM(SIZE(XAER,1),SIZE(XAER,2),SIZE(XAER,3),SIZE(XAER,4))) + XAER_CLIM(:,:,:,:) = XAER(:,:,:,:) +! + END IF +#endif +ELSE + ALLOCATE (XOZON(0,0,0)) + ALLOCATE (XAER(0,0,0,0)) + ALLOCATE (XDST_WL(0,0,0,0)) + ALLOCATE (XAER_CLIM(0,0,0,0)) +END IF +! +! +! +IF (CDCONV /= 'NONE' .OR. CSCONV == 'KAFR') THEN + IF (CGETCONV=='INIT') THEN + GINIDCONV=.TRUE. + ELSE + GINIDCONV=.FALSE. + END IF +! +! commensurability between convection calling time and time step +! + XDTCONV=XTSTEP*REAL( INT( (MIN(XDTCONV,1800.)+1.E-10)/XTSTEP ) ) + XDTCONV=MAX( XDTCONV, XTSTEP ) + IF (NVERB>=10) THEN + WRITE(ILUOUT,*) 'XDTCONV has been set to : ',XDTCONV + END IF + CALL INI_DEEP_CONVECTION (TPINIFILE,GINIDCONV,TDTCUR, & + NCOUNTCONV,XDTHCONV,XDRVCONV,XDRCCONV, & + XDRICONV,XPRCONV,XPRSCONV,XPACCONV, & + XUMFCONV,XDMFCONV,XMFCONV,XPRLFLXCONV,XPRSFLXCONV,& + XCAPE,NCLTOPCONV,NCLBASCONV, & + TDTDCONV, CGETSVCONV, XDSVCONV, & + LCH_CONV_LINOX, XIC_RATE, XCG_RATE, & + XIC_TOTAL_NUMBER, XCG_TOTAL_NUMBER ) + +END IF +! +! +! +IF (CSCONV == 'EDKF') THEN + CALL INI_MFSHALL() +ENDIF +! +!------------------------------------------------------------------------------- +! +! +!* 19. ALLOCATION OF THE TEMPORAL SERIES +! --------------------------------- +! +IF (LSERIES .AND. CPROGRAM/='DIAG ') CALL INI_SERIES_n +! +!------------------------------------------------------------------------------- +! +! +!* 20. (re)initialize scalar variables +! ------------------------------- +! +! +IF ( LUSECHEM .OR. LCHEMDIAG ) THEN + IF (CPROGRAM=='MESONH'.AND.CCONF=='RESTA') LCH_INIT_FIELD =.FALSE. + IF (CPROGRAM=='MESONH'.OR. CPROGRAM=='DIAG ' .OR. CPROGRAM=='IDEAL ') & + CALL CH_INIT_FIELD_n(KMI, ILUOUT, NVERB) +END IF +! +!------------------------------------------------------------------------------- +! +!* 21. UPDATE HALO +! ----------- +! +! +CALL UPDATE_HALO_ll(TZINITHALO3D_ll,IINFO_ll) +CALL UPDATE_HALO_ll(TZINITHALO2D_ll,IINFO_ll) +CALL CLEANLIST_ll(TZINITHALO3D_ll) +CALL CLEANLIST_ll(TZINITHALO2D_ll) +! +! +!------------------------------------------------------------------------------- +! +!* 22. DEALLOCATION +! ------------- +! +DEALLOCATE(ZJ) +! +DEALLOCATE(XSTROATM) +DEALLOCATE(XSMLSATM) +DEALLOCATE(XSMLWATM) +DEALLOCATE(XSPOSATM) +DEALLOCATE(XSPOWATM) +! +!------------------------------------------------------------------------------- +! +!* 23. BALLOON and AIRCRAFT initializations +! ------------------------------------ +! +CALL INI_AIRCRAFT_BALLOON(TPINIFILE,XTSTEP, TDTSEG, XSEGLEN, NRR, NSV, & + IKU,CTURB=="TKEL" , & + XLATORI, XLONORI ) +! +!------------------------------------------------------------------------------- +! +!* 24. STATION initializations +! ----------------------- +! +CALL INI_SURFSTATION_n(XTSTEP, XSEGLEN, NRR, NSV, & + CTURB=="TKEL" , KMI, & + XLATORI, XLONORI ) +! +!------------------------------------------------------------------------------- +! +!* 25. PROFILER initializations +! ------------------------ +! +CALL INI_POSPROFILER_n(XTSTEP, XSEGLEN, NRR, NSV, & + CTURB=="TKEL", & + XLATORI, XLONORI ) +! +!------------------------------------------------------------------------------- +! +!* 26. Prognostic aerosols +! ------------------------ +! +IF ( ( CRAD=='ECMW' .OR. CRAD=='ECRA' ) .AND. CAOP=='EXPL' .AND. LORILAM ) THEN + ALLOCATE(POLYTAU(6,10,8,6,13)) + ALLOCATE(POLYSSA(6,10,8,6,13)) + ALLOCATE(POLYG (6,10,8,6,13)) + CALL INI_AEROSET1 + CALL INI_AEROSET2 + CALL INI_AEROSET3 + CALL INI_AEROSET4 + CALL INI_AEROSET5 + CALL INI_AEROSET6 +END IF +#ifdef MNH_FOREFIRE +! +!------------------------------------------------------------------------------- +! +!* 27. FOREFIRE initializations +! ------------------------ +! + +! Coupling with ForeFire if resolution is low enough +!--------------------------------------------------- +IF ( LFOREFIRE .AND. 0.5*(XXHAT(2)-XXHAT(1)+XYHAT(2)-XYHAT(1)) < COUPLINGRES ) THEN + FFCOUPLING = .TRUE. +ELSE + FFCOUPLING = .FALSE. +ENDIF + +! Initializing the ForeFire variables +!------------------------------------ +IF ( LFOREFIRE ) THEN + CALL INIT_FOREFIRE_n(KMI, ILUOUT, IP & + , TDTCUR%nyear, TDTCUR%nmonth, TDTCUR%nday, TDTCUR%xtime, XTSTEP) +END IF +#endif + +!------------------------------------------------------------------------------- +! +!* 30. Total production/Loss for chemical species +! +IF (LCHEMDIAG) THEN + CALL CH_INIT_PRODLOSSTOT_n(ILUOUT) + IF (NEQ_PLT>0) THEN + ALLOCATE(XPROD(IIU,IJU,IKU,NEQ_PLT)) + ALLOCATE(XLOSS(IIU,IJU,IKU,NEQ_PLT)) + XPROD=0.0 + XLOSS=0.0 + ELSE + ALLOCATE(XPROD(0,0,0,0)) + ALLOCATE(XLOSS(0,0,0,0)) + END IF +ELSE + ALLOCATE(XPROD(0,0,0,0)) + ALLOCATE(XLOSS(0,0,0,0)) +END IF +! +!------------------------------------------------------------------------------- +! +!* 31. Extended production/loss terms for chemical species +! +IF (LCHEMDIAG) THEN + CALL CH_INIT_BUDGET_n(ILUOUT) + IF (NEQ_BUDGET>0) THEN + ALLOCATE(IINDEX(2,NNONZEROTERMS)) + ALLOCATE(IIND(NEQ_BUDGET)) + CALL CH_NONZEROTERMS(KMI,IINDEX,NNONZEROTERMS) + ALLOCATE(XTCHEM(NEQ_BUDGET)) + DO JM=1,NEQ_BUDGET + IIND(JM)=COUNT((IINDEX(1,:))==NSPEC_BUDGET(JM)) + ALLOCATE(XTCHEM(JM)%NB_REAC(IIND(JM))) + ALLOCATE(XTCHEM(JM)%XB_REAC(IIU,IJU,IKU,IIND(JM))) + END DO + DEALLOCATE(IIND) + DEALLOCATE(IINDEX) + ELSE + ALLOCATE(XTCHEM(0)) + END IF +ELSE + ALLOCATE(XTCHEM(0)) +END IF +!------------------------------------------------------------------------------- +! +!* 32. Wind turbine +! +IF (LMAIN_EOL .AND. KMI == NMODEL_EOL) THEN + ALLOCATE(XFX_RG(IIU,IJU,IKU)) + ALLOCATE(XFY_RG(IIU,IJU,IKU)) + ALLOCATE(XFZ_RG(IIU,IJU,IKU)) + ALLOCATE(XFX_SMR_RG(IIU,IJU,IKU)) + ALLOCATE(XFY_SMR_RG(IIU,IJU,IKU)) + ALLOCATE(XFZ_SMR_RG(IIU,IJU,IKU)) + SELECT CASE(CMETH_EOL) + CASE('ADNR') + CALL INI_EOL_ADNR + CASE('ALM') + CALL INI_EOL_ALM(XDXX,XDYY) + END SELECT +END IF +! +!* 33. Auto-coupling Atmos-Ocean LES NH +! +IF (LCOUPLES) THEN + ALLOCATE(XSSUFL_C(IIU,IJU,1)); XSSUFL_C=0.0 + ALLOCATE(XSSVFL_C(IIU,IJU,1)); XSSVFL_C=0.0 + ALLOCATE(XSSTFL_C(IIU,IJU,1)); XSSTFL_C=0.0 + ALLOCATE(XSSRFL_C(IIU,IJU,1)); XSSRFL_C=0. +ELSE + ALLOCATE(XSSUFL_C(0,0,0)) + ALLOCATE(XSSVFL_C(0,0,0)) + ALLOCATE(XSSTFL_C(0,0,0)) + ALLOCATE(XSSRFL_C(0,0,0)) +END IF +! +END SUBROUTINE INI_MODEL_n diff --git a/src/mesonh/ext/ini_radar.f90 b/src/mesonh/ext/ini_radar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..b97372f068027ee9fc880b68844bb99c6e5b2f89 --- /dev/null +++ b/src/mesonh/ext/ini_radar.f90 @@ -0,0 +1,234 @@ +!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. +!----------------------------------------------------------------- +!--------------- special set of characters for RCS information +!----------------------------------------------------------------- +! $Source$ $Revision$ +! masdev4_7 BUG1 2007/06/15 17:47:18 +!----------------------------------------------------------------- +! ######################## + MODULE MODI_INI_RADAR +! ######################## +! +INTERFACE + SUBROUTINE INI_RADAR (HPRISTINE_ICE ) +! +CHARACTER (LEN=4), INTENT(IN) :: HPRISTINE_ICE ! Indicator of ice crystal characteristics +! +! +END SUBROUTINE INI_RADAR +! +END INTERFACE +! +END MODULE MODI_INI_RADAR +! ########################################################### + SUBROUTINE INI_RADAR ( HPRISTINE_ICE ) +! ########################################################### +! +!!**** *INI_RADAR * +!! +!! PURPOSE +!! ------- +!! The purpose of this routine is to initialize the constants used to +!! compute radar reflectivity (radar_rain_ice.f90 or radar_simulator.f90) +!! for DIAG after PREP_REAL_CASE with AROME file (CCLOUD=NONE) +!! +!!** METHOD +!! ------ +!! The constants useful to radar are initialized to their +!! numerical values as in ini_rain_ice.f90 for ICE3 +!! +!! EXTERNAL +!! -------- +!! GAMMA : gamma function +!! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODD_CST +!! XPI ! +!! XP00 ! Reference pressure +!! XRD ! Gaz constant for dry air +!! XRHOLW ! Liquid water density +!! Module MODD_RAIN_ICE_DESCR +!! +!! +!! AUTHOR +!! ------ +!! G. TANGUY * CNRM * +!! +!! MODIFICATIONS +!! ------------- +!! Original 27/10/2009 +!! P.Scheffknecht 22/04/2015: test missing on already allocated XRTMIN +!! +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_CST +USE MODD_RAIN_ICE_DESCR_n +! +IMPLICIT NONE +! +!* 0.1 Declarations of dummy arguments : +! +! +CHARACTER (LEN=4), INTENT(IN) :: HPRISTINE_ICE ! Indicator of ice crystal caracteristics +! +!------------------------------------------------------------------------------- +! +! +! +!* 1.1 Raindrop characteristics +! +! +! +XAR = (XPI/6.0)*XRHOLW +XBR = 3.0 +XCR = 842. +XDR = 0.8 +XCCR = 8.E6 +! +!* 1.2 Ice crystal characteristics +! +! +SELECT CASE (HPRISTINE_ICE) + CASE('PLAT') + XAI = 0.82 ! Plates + XBI = 2.5 ! Plates + XC_I = 800. ! Plates + XDI = 1.0 ! Plates + CASE('COLU') + XAI = 2.14E-3 ! Columns + XBI = 1.7 ! Columns + XC_I = 2.1E5 ! Columns + XDI = 1.585 ! Columns + CASE('BURO') + XAI = 44.0 ! Bullet rosettes + XBI = 3.0 ! Bullet rosettes + XC_I = 4.3E5 ! Bullet rosettes + XDI = 1.663 ! Bullet rosettes +END SELECT +! +! +!* 1.3 Snowflakes/aggregates characteristics +! +! +XAS = 0.02 +XBS = 1.9 +XCS = 5.1 +XDS = 0.27 +XCCS = 5.0 +XCXS = 1.0 +! +!* 1.4 Graupel/Frozen drop characteristics +! +! +XAG = 19.6 +XBG = 2.8 +XCG = 124. +XDG = 0.66 +XCCG = 5.E5 +XCXG = -0.5 +! +!* 1.5 Hailstone characteristics +! +! +XAH = 470. +XBH = 3.0 +XCH = 207. +XDH = 0.64 +XCCH = 4.E4 +XCXH = -1.0 +! +!------------------------------------------------------------------------------- +! +!* 2. DIMENSIONAL DISTRIBUTIONS OF THE SPECIES +! ---------------------------------------- +! +!* 2.1 Raindrops distribution +! +XALPHAR = 1.0 ! Exponential law +XNUR = 1.0 ! Exponential law +! +!* 2.2 Ice crystal distribution +! +XALPHAI = 3.0 ! Gamma law for the ice crystal volume +XNUI = 3.0 ! Gamma law with little dispersion +! +XALPHAS = 1.0 ! Exponential law +XNUS = 1.0 ! Exponential law +! +XALPHAG = 1.0 ! Exponential law +XNUG = 1.0 ! Exponential law +! +XALPHAH = 1.0 ! Gamma law +XNUH = 8.0 ! Gamma law with little dispersion +! +!* 2.3 Constants for shape parameter +! +XLBEXR = 1.0/(-1.0-XBR) +XLBR = ( XAR*XCCR*MOMG(XALPHAR,XNUR,XBR) )**(-XLBEXR) +! +XLBEXI = 1.0/(-XBI) +XLBI = ( XAI*MOMG(XALPHAI,XNUI,XBI) )**(-XLBEXI) +! +XNS = 1.0/(XAS*MOMG(XALPHAS,XNUS,XBS)) +XLBEXS = 1.0/(XCXS-XBS) +XLBS = ( XAS*XCCS*MOMG(XALPHAS,XNUS,XBS) )**(-XLBEXS) +! +XLBEXG = 1.0/(XCXG-XBG) +XLBG = ( XAG*XCCG*MOMG(XALPHAG,XNUG,XBG) )**(-XLBEXG) +! +XLBEXH = 1.0/(XCXH-XBH) +XLBH = ( XAH*XCCH*MOMG(XALPHAH,XNUH,XBH) )**(-XLBEXH) +! +!* 2.4 Minimal values allowed for the mixing ratios +! ICE3 +IF(.NOT.ASSOCIATED(XRTMIN)) THEN + CALL RAIN_ICE_DESCR_ALLOCATE(6) +END IF +! +XRTMIN(1) = 1.0E-20 +XRTMIN(2) = 1.0E-20 +XRTMIN(3) = 1.0E-20 +XRTMIN(4) = 1.0E-20 +XRTMIN(5) = 1.0E-15 +XRTMIN(6) = 1.0E-15 + +! +CONTAINS +! +!------------------------------------------------------------------------------ +! + FUNCTION MOMG (PALPHA,PNU,PP) RESULT (PMOMG) +! +! auxiliary routine used to compute the Pth moment order of the generalized +! gamma law +! + USE MODI_GAMMA + + IMPLICIT NONE + + REAL :: PALPHA ! first shape parameter of the dimensionnal distribution + REAL :: PNU ! second shape parameter of the dimensionnal distribution + REAL :: PP ! order of the moment + REAL :: PMOMG ! result: moment of order ZP + +!------------------------------------------------------------------------------ + + + PMOMG = GAMMA(PNU+PP/PALPHA)/GAMMA(PNU) + + END FUNCTION MOMG + +!------------------------------------------------------------------------------- +! +! +END SUBROUTINE INI_RADAR + + diff --git a/src/mesonh/ext/ini_segn.f90 b/src/mesonh/ext/ini_segn.f90 new file mode 100644 index 0000000000000000000000000000000000000000..03ae8f2dc3855f27f8ae108e8bbfc1e1f6591b79 --- /dev/null +++ b/src/mesonh/ext/ini_segn.f90 @@ -0,0 +1,493 @@ +!MNH_LIC Copyright 1994-2021 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_INI_SEG_n +! ################### +! +INTERFACE +! +SUBROUTINE INI_SEG_n(KMI,TPINIFILE,HINIFILEPGD,PTSTEP_ALL) +! +USE MODD_IO, ONLY : TFILEDATA +! +INTEGER, INTENT(IN) :: KMI !Model index +TYPE(TFILEDATA), POINTER, INTENT(OUT) :: TPINIFILE !Initial file +CHARACTER (LEN=28), INTENT(OUT) :: HINIFILEPGD +REAL,DIMENSION(:), INTENT(INOUT) :: PTSTEP_ALL ! Time STEP of ALL models +! +END SUBROUTINE INI_SEG_n +! +END INTERFACE +! +END MODULE MODI_INI_SEG_n +! +! +! +! +! ############################################################# + SUBROUTINE INI_SEG_n(KMI,TPINIFILE,HINIFILEPGD,PTSTEP_ALL) +! ############################################################# +! +!!**** *INI_SEG_n * - routine to read and update the descriptor files for +!! model KMI +!! +!! PURPOSE +!! ------- +! The purpose of this routine is to read the descriptor files in the +! following order : +! - DESFM file which gives informations about the initial file +! (i.e. the description of the segment that produced the initial file +! or the description of the preinitialisation that created the initial file) +! - EXSEG file which gives informations about the segment to perform. +! +! Informations in EXSEG file are completed by DESFM file informations +! and if the informations are not in DESFM file, they are set +! to default values. +! +! The descriptor file EXSEG corresponding to the segment of simulation +! to be performed, is then updated with the combined informations. +! We also store in the updated EXSEG file, the informations on the status +! of the different variables ( skip, init, read) in the namelist NAM_GETn, +! which will be read in the INI_MODELn routine to properly initiliaze the +! model n. Except this last namelist, the informations written in this +! EXSEG file, will be identical to the NAMELIST section of the descriptive +! part of the FM files containing the model outputs. +! +! In order not to duplicate the routines called by ini_seg, we use the +! modules modd, corresponding to the first model to store the informations +! read on the different files ( DESFM and EXSEG ). The final filling of +! the modules modd (MODD_CONFn ....) will be realized in the subroutine +! INI_MODELn. The goal of the INI_SEG_n part of the initialization is to +! built the final EXSEG, which will be associated to the LFI files +! generated during the segment ( and therefore not to fill the modd). +! +! +!!** METHOD +!! ------ +!! For a nested model of index KMI : +!! - Logical unit numbers are associated to output-listing file and +!! descriptor EXSEG file by FMATTR. Then these files are opened. +!! The name of the initial file is read in EXSEG file. +!! - Default values are supplied for variables in descriptor files +!! (by DEFAULT_DESFM). +!! - The Initial file (LFIFM + DESFM) is opened by IO_File_open. +!! - The descriptor DESFM file is read (by READ_DESFM_n). +!! - The descriptor file EXSEG is read (by READ_EXSEG_n) and coherence +!! between the initial file and the description of segment is also checked +!! in this routine. +!! - If there is more than one model the EXSEG file is updated +!! (by WRITE_DESFM$n). This routine prints also EXSEG content on +!! output-listing. +!! - If there is only one model (i.e. no grid-nesting), +!! EXSEG file is also closed (logical unit number associated with this +!! file is also released by FMFREE). +!! +!! +!! +!! EXTERNAL +!! -------- +!! FMATTR : to associate a logical unit number to a file +!! IO_File_open : to open descriptor file or LFI file +!! DEFAULT_DESFM1: to set default values +!! READ_DESFM_n : to read a DESFM file +!! READ_EXSEG_n : to read a EXSEG file +!! WRITE_DESFM1 : to write the DESFM part of the future outputs +!! FMFREE : to release a logical unit number linked to a file +!! +!! Module MODI_DEFAULT_DESFM : Interface for routine DEFAULT_DESFM +!! Module MODI_READ_DESFM_n : Interface for routine READ_DESFM_n +!! Module MODI_READ_EXSEG_n : Interface for routine READ_EXSEG_n +!! Module MODI_WRITE_DESFM1 : Interface for routine WRITE_DESFM1 +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODD_LUNIT : contains names and logical unit numbers +!! +!! Module MODD_CONF : contains configuration variables +!! CCONF : Configuration of models +!! NMODEL : Number of nested models +!! NVERB : Level of informations on output-listing +!! 0 for minimum of prints +!! 5 for intermediate level of prints +!! 10 for maximum of prints +!! +!! Module MODN_LUNIT1 : contains declarations of namelist NAMLUNITMN +!! and module MODD_LUNIT1 +!! +!! REFERENCE +!! --------- +!! Book2 of documentation (routine INI_SEG) +!! +!! +!! AUTHOR +!! ------ +!! V. Ducrocq * Meteo France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 07/06/94 +!! Modification 26/10/94 remove the NAM_GETn from the namelist present +!! in the EXSEG file (J.Stein) +!! 11/01/95 change the read_exseg and desfm CALLS to add +!! the G1D switch +!! 15/02/95 add the HTURBLEN information (J. Cuxart) +!! 18/08/95 Time STEP change (J. P. Lafore) +!! 02/10/95 add the radiation control (J. Stein) +!! 18/03/96 remove the no write option for WRITE_DESFM +!! (J. Stein) +!! 11/04/96 add the ice conc. control (J.-P. Pinty) +!! 11/01/97 add the deep convection control (J.-P. Pinty) +!! 17/07/96 correction for WRITE_DESFM1 call (J. P. Lafore) +!! 22/07/96 PTSTEP_ALL introduction for nesting (J. P. Lafore) +!! 7/08/98 // (V. Ducrocq) +!! 02/08/99 remove unused argument for read_desfm (J. Stein) +!! 15/03/99 test on execution program (V. Masson) +!! 15/11/00 Add YCLOUD (J.-P. Pinty) +!! 01/03/01 Add GUSECHEM (D. Gazen) +!! 15/10/01 namelists in different orders (I.Mallet) +!! 25/11/02 Add YELEC (P. Jabouille) +!! 01/2004 externalization of surface (V. Masson) +!! 01/2005 add GDUST, GSALT, and GORILAM (P. Tulet) +!! 04/2010 add GUSECHAQ, GCH_PH (M. Leriche) +!! 09/2010 add GUSECHIC (M. Leriche) +!! 02/2012 add GFOREFIRE (Pialat/Tulet) +!! 05/2014 missing reading of IMASDEV before COUPLING +!! test (Escobar) +!! 10/02/15 remove ABORT in parallel case for SPAWNING +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! 01/2015 add GLNOX_EXPLICIT (C. Barthe) +!! 04/2016 add ABORT if CINIFILEPGD is not specified (G.Delautier) +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +!! 07/2017 add GBLOWSNOW (V. Vionnet) +! P. Wautelet 07/02/2019: force TYPE to a known value for IO_File_add2list +! P. Wautelet 14/02/2019: remove CLUOUT/CLUOUT0 and associated variables +! P. Wautelet 19/06/2019: add Fieldlist_nmodel_resize subroutine + provide KMODEL to INI_FIELD_LIST when known +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +USE MODD_CONF +USE MODD_CONF_n, ONLY: CSTORAGE_TYPE +USE MODN_CONFZ +USE MODD_DYN_n, ONLY : LOCEAN +USE MODD_DYN +USE MODD_IO, ONLY: NVERB_FATAL, NVERB_WARNING, TFILE_OUTPUTLISTING, TFILEDATA +USE MODD_LES, ONLY: LES_ASSOCIATE +USE MODD_LUNIT +USE MODD_LUNIT_n, ONLY: CINIFILE_n=> CINIFILE, TINIFILE_n => TINIFILE, CINIFILEPGD_n=> CINIFILEPGD, TLUOUT, LUNIT_MODEL +USE MODD_PARAM_n, ONLY: CSURF +USE MODD_PARAM_ICE_n +USE MODD_PARAMETERS +USE MODD_REF, ONLY: LBOUSS +! +use mode_field, only: Fieldlist_nmodel_resize, Ini_field_list, Ini_field_scalars +USE MODE_IO_FIELD_READ, only: IO_Field_read +USE MODE_IO_FILE, ONLY: IO_File_close, IO_File_open +USE MODE_IO, only: IO_Config_set +USE MODE_IO_MANAGE_STRUCT, ONLY: IO_File_add2list +USE MODE_MSG +USE MODE_POS +! +USE MODI_DEFAULT_DESFM_n +USE MODI_READ_DESFM_n +USE MODI_READ_EXSEG_n +USE MODI_WRITE_DESFM_n +! +USE MODN_CONFIO, ONLY: NAM_CONFIO +USE MODN_LUNIT_n +USE MODN_FIRE +! +IMPLICIT NONE +! +!* 0.1 declarations of arguments +! +INTEGER, INTENT(IN) :: KMI !Model index +TYPE(TFILEDATA), POINTER, INTENT(OUT) :: TPINIFILE !Initial file +CHARACTER (LEN=28), INTENT(OUT) :: HINIFILEPGD +REAL,DIMENSION(:), INTENT(INOUT) :: PTSTEP_ALL ! Time STEP of ALL models +! +!* 0.1 declarations of local variables +! +LOGICAL :: GFOUND ! Return code when searching namelist +CHARACTER (LEN=28) :: YINIFILE ! name of initial file +CHARACTER (LEN=2) :: YMI ! string for model index +INTEGER :: ILUOUT ! Logical unit number + ! associated with TLUOUT + ! +INTEGER :: IRESP,ILUSEG ! File management variables +CHARACTER (LEN=5) :: YCONF ! Local variables which have +LOGICAL :: GFLAT ! the same definition as the +LOGICAL :: GUSERV,GUSERC,GUSERR,GUSERI ! variables in module MODD_CONF, +LOGICAL :: GUSERS,GUSERG,GUSERH,GUSECI ! MODD_CONFn, MODD_PARAMn, +LOGICAL :: GUSECHEM ! flag for chemistry +LOGICAL :: GUSECHAQ ! flag for aq. phase chemistry +LOGICAL :: GUSECHIC ! flag for ice phase chemistry +LOGICAL :: GCH_PH ! flag for pH +LOGICAL :: GCH_CONV_LINOX +LOGICAL :: GDUST +LOGICAL,DIMENSION(JPMODELMAX) :: GDEPOS_DST, GDEPOS_SLT, GDEPOS_AER +LOGICAL :: GSALT +LOGICAL :: GORILAM +LOGICAL :: GLG +LOGICAL :: GPASPOL +LOGICAL :: GFIRE +#ifdef MNH_FOREFIRE +LOGICAL :: GFOREFIRE +#endif +LOGICAL :: GCONDSAMP +LOGICAL :: GBLOWSNOW +LOGICAL :: GCHTRANS +LOGICAL :: GLNOX_EXPLICIT ! flag for LNOx + ! These variables + ! are used to locally store +INTEGER :: ISV ! the value read in DESFM +INTEGER :: IRIMX,IRIMY ! number of points for the + ! horizontal relaxation +CHARACTER (LEN=4) :: YTURB ! file in order to check the +CHARACTER (LEN=4) :: YRAD ! corresponding informations +CHARACTER (LEN=4) :: YTOM ! read in EXSEG file. +LOGICAL :: GRMC01 +CHARACTER (LEN=4) :: YDCONV +CHARACTER (LEN=4) :: YSCONV +CHARACTER (LEN=4) :: YCLOUD +CHARACTER (LEN=4) :: YELEC +CHARACTER (LEN=3) :: YEQNSYS +TYPE(TFILEDATA),POINTER :: TZFILE_DES +! +TPINIFILE => NULL() +TZFILE_DES => NULL() +!------------------------------------------------------------------------------- +! +!* 1. OPEN OUPTUT-LISTING FILE AND EXSEG FILE +! --------------------------------------- +! +WRITE(YMI,'(I2.0)') KMI +CALL IO_File_add2list(LUNIT_MODEL(KMI)%TLUOUT,'OUTPUT_LISTING'//ADJUSTL(YMI),'OUTPUTLISTING','WRITE') +TLUOUT => LUNIT_MODEL(KMI)%TLUOUT !Necessary because TLUOUT was initially pointing to NULL +CALL IO_File_open(TLUOUT) +! +!Set output file for PRINT_MSG +TFILE_OUTPUTLISTING => TLUOUT +! +ILUOUT=TLUOUT%NLU +! +WRITE(UNIT=ILUOUT,FMT='(50("*"),/,"*",17X,"MODEL ",I1," LISTING",16X,"*",/, & + & 50("*"))') KMI +! +IF (CPROGRAM=='MESONH') THEN + CALL IO_File_add2list(TZFILE_DES,'EXSEG'//TRIM(ADJUSTL(YMI))//'.nam','NML','READ') + CALL IO_File_open(TZFILE_DES) +! +!* 1.3 SPAWNING or SPEC or REAL program case +! --------------------- +! +ELSE IF (CPROGRAM=='SPAWN ' .OR. CPROGRAM=='REAL '.OR. CPROGRAM=='SPEC ') THEN + YINIFILE = CINIFILE_n + HINIFILEPGD = CINIFILEPGD_n + CALL IO_File_add2list(TPINIFILE,TRIM(YINIFILE),'MNH','READ',KLFITYPE=2,KLFIVERB=NVERB) + CALL IO_File_open(TPINIFILE) + TZFILE_DES => TPINIFILE%TDESFILE +! +!* 1.3bis DIAG program case +! +ELSE IF (CPROGRAM=='DIAG ') THEN + YINIFILE = CINIFILE_n + HINIFILEPGD = CINIFILEPGD_n + CALL IO_File_add2list(TINIFILE_n,TRIM(YINIFILE),'MNH','READ',KLFITYPE=2,KLFIVERB=NVERB) + CALL IO_File_open(TINIFILE_n) + TPINIFILE => TINIFILE_n + TZFILE_DES => TPINIFILE%TDESFILE +! +!* 1.4 Other program cases +! ------------------- +! +ELSE +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_SEG_n','should not be called for CPROGRAM='//TRIM(CPROGRAM)) +ENDIF +! +ILUSEG = TZFILE_DES%NLU +! +!------------------------------------------------------------------------------- +! +!* 2. SET DEFAULT VALUES +! ------------------ +! +CALL LES_ASSOCIATE() +CALL DEFAULT_DESFM_n(KMI) +! +!------------------------------------------------------------------------------- +! +!* 3. READ INITIAL FILE NAME AND OPEN INITIAL FILE +! -------------------------------------------- +! +CALL POSNAM(ILUSEG,'NAM_LUNITN',GFOUND) +IF (GFOUND) THEN + CALL INIT_NAM_LUNITn + READ(UNIT=ILUSEG,NML=NAM_LUNITn) + CALL UPDATE_NAM_LUNITn + IF (LEN_TRIM(CINIFILEPGD)==0 .AND. CSURF=='EXTE') THEN + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_SEG_n','error in namelist NAM_LUNITn: you need to specify CINIFILEPGD') + ENDIF +END IF + +IF (CPROGRAM=='MESONH') THEN + IF (KMI.EQ.1) THEN + CALL POSNAM(ILUSEG,'NAM_CONFZ',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_CONFZ) + CALL POSNAM(ILUSEG,'NAM_CONFIO',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_CONFIO) + CALL IO_Config_set() + ! read Blaze namelist to get NREFINX and NREFINY before INI_FIELD_LIST + CALL POSNAM(ILUSEG,'NAM_FIRE',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_FIRE) + END IF + HINIFILEPGD=CINIFILEPGD_n + YINIFILE=CINIFILE_n + + CALL IO_File_add2list(TPINIFILE,TRIM(YINIFILE),'MNH','READ',KLFITYPE=2,KLFIVERB=NVERB) + TINIFILE_n => TPINIFILE !Necessary because TINIFILE was initially pointing to NULL + CALL IO_File_open(TPINIFILE) +END IF +! +!------------------------------------------------------------------------------- +! +!* 4. READ DESFM FILE +! --------------- +! +CALL READ_DESFM_n(KMI,TPINIFILE,YCONF,GFLAT,GUSERV,GUSERC, & + GUSERR,GUSERI,GUSECI,GUSERS,GUSERG,GUSERH,GUSECHEM,GUSECHAQ,& + GUSECHIC,GCH_PH,GCH_CONV_LINOX,GSALT,GDEPOS_SLT,GDUST, & + GDEPOS_DST, GCHTRANS, GORILAM, & + GDEPOS_AER, GLG, GPASPOL,GFIRE, & +#ifdef MNH_FOREFIRE + GFOREFIRE, & +#endif + GLNOX_EXPLICIT, & + GCONDSAMP,GBLOWSNOW, IRIMX,IRIMY,ISV, & + YTURB,YTOM,GRMC01,YRAD,YDCONV,YSCONV,YCLOUD,YELEC,YEQNSYS ) +! +!------------------------------------------------------------------------------- +! +!* 5. Initialize fieldlist +! -------------------- +! +IF (KMI==1) THEN !Do this only 1 time + IF (CPROGRAM=='SPAWN ') THEN + CALL INI_FIELD_LIST(2) + ELSE IF (CPROGRAM=='DIAG ' .OR. CPROGRAM=='SPEC ') THEN + CALL INI_FIELD_LIST(1) + ELSE IF (CPROGRAM/='REAL ' .AND. CPROGRAM/='IDEAL ' ) THEN + CALL INI_FIELD_LIST() + END IF + IF (CPROGRAM=='SPAWN ' .OR. CPROGRAM=='DIAG ' .OR. CPROGRAM=='SPEC ' .OR. CPROGRAM=='MESONH') THEN + CALL INI_FIELD_SCALARS() + END IF +END IF +! +!------------------------------------------------------------------------------- +! +!* 6. READ in the LFI file SOME VARIABLES of MODD_CONF +! ------------------------------------------------ +! +IF (CPROGRAM=='MESONH' .OR. CPROGRAM=='SPAWN ') THEN + IF ((TPINIFILE%NMNHVERSION(1)==4 .AND. TPINIFILE%NMNHVERSION(2)>9) .OR. TPINIFILE%NMNHVERSION(1)>4) THEN + CALL IO_Field_read(TPINIFILE,'COUPLING',LCOUPLING) + IF (LCOUPLING) THEN + WRITE(ILUOUT,*) 'Error with the initial file' + WRITE(ILUOUT,*) 'The file',YINIFILE,' was created with LCOUPLING=.TRUE.' + WRITE(ILUOUT,*) 'You can not use it as initial file, only as coupling file' + WRITE(ILUOUT,*) 'Run PREP_REAL_CASE with LCOUPLING=.FALSE.' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_SEG_n','') + ENDIF + ENDIF +END IF +! +! Read the storage type + CALL IO_Field_read(TPINIFILE,'STORAGE_TYPE',CSTORAGE_TYPE,IRESP) + IF (IRESP /= 0) THEN + WRITE(ILUOUT,FMT=9002) 'STORAGE_TYPE',IRESP +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','INI_SEG_n','') + END IF +IF (KMI == 1) THEN +! Read the geometry kind + CALL IO_Field_read(TPINIFILE,'CARTESIAN',LCARTESIAN) +! Read the thinshell approximation + CALL IO_Field_read(TPINIFILE,'THINSHELL',LTHINSHELL) +! + IF ((TPINIFILE%NMNHVERSION(1)==4 .AND. TPINIFILE%NMNHVERSION(2)>=6) .OR. TPINIFILE%NMNHVERSION(1)>4) THEN + CALL IO_Field_read(TPINIFILE,'L1D',L1D,IRESP) + IF (IRESP/=0) L1D=.FALSE. +! + CALL IO_Field_read(TPINIFILE,'L2D',L2D,IRESP) + IF (IRESP/=0) L2D=.FALSE. +! + CALL IO_Field_read(TPINIFILE,'PACK',LPACK,IRESP) + IF (IRESP/=0) LPACK=.TRUE. + ELSE + L1D=.FALSE. + L2D=.FALSE. + LPACK=.TRUE. + END IF + IF ((TPINIFILE%NMNHVERSION(1)==4 .AND. TPINIFILE%NMNHVERSION(2)>=10) .OR. TPINIFILE%NMNHVERSION(1)>4) THEN + CALL IO_Field_read(TPINIFILE,'LBOUSS',LBOUSS) + END IF +! +END IF +! +!------------------------------------------------------------------------------- +! +!* 7. READ EXSEG FILE +! --------------- +! We pass by arguments the informations read in DESFM descriptor to the +! routine which read related informations in the EXSEG descriptor in order to +! check coherence between both informations. +! +CALL IO_Field_read(TPINIFILE,'LOCEAN',LOCEAN,IRESP) +IF ( IRESP /= 0 ) LOCEAN = .FALSE. +! +CALL READ_EXSEG_n(KMI,TZFILE_DES,YCONF,GFLAT,GUSERV,GUSERC, & + GUSERR,GUSERI,GUSECI,GUSERS,GUSERG,GUSERH,GUSECHEM, & + GUSECHAQ,GUSECHIC,GCH_PH, & + GCH_CONV_LINOX,GSALT,GDEPOS_SLT,GDUST,GDEPOS_DST,GCHTRANS, & + GORILAM,GDEPOS_AER,GLG,GPASPOL,GFIRE, & +#ifdef MNH_FOREFIRE + GFOREFIRE, & +#endif + GLNOX_EXPLICIT, & + GCONDSAMP,GBLOWSNOW, IRIMX,IRIMY,ISV, & + YTURB,YTOM,GRMC01,YRAD,YDCONV,YSCONV,YCLOUD,YELEC,YEQNSYS, & + PTSTEP_ALL,CSTORAGE_TYPE,CINIFILEPGD_n ) +! +if ( cprogram == 'MESONH' .and. kmi == 1 ) then !Do this only once + call Fieldlist_nmodel_resize(NMODEL) +end if +! +IF (CPROGRAM=='SPAWN ' .OR. CPROGRAM=='DIAG ' .OR. CPROGRAM=='SPEC ' & + .OR. CPROGRAM=='REAL ') THEN + CINIFILE_n = YINIFILE + CCPLFILE(:) = ' ' + NMODEL=1 + LSTEADYLS=.TRUE. +END IF +! +IF (CPROGRAM=='MESONH') THEN + HINIFILEPGD=CINIFILEPGD_n +END IF +!------------------------------------------------------------------------------- +! +!* 7. CLOSE FILES +! ------------ +! +IF (CPROGRAM=='MESONH') CALL IO_File_close(TZFILE_DES) +! +!------------------------------------------------------------------------------- +9002 FORMAT(/,'FATAL ERROR IN INI_SEG_n: pb to read ',A16,' IRESP=',I3) +! +END SUBROUTINE INI_SEG_n diff --git a/src/mesonh/ext/ini_tke_eps.f90 b/src/mesonh/ext/ini_tke_eps.f90 new file mode 100644 index 0000000000000000000000000000000000000000..7ba1e9f184a11063e2101d4172a83c5ce9928f96 --- /dev/null +++ b/src/mesonh/ext/ini_tke_eps.f90 @@ -0,0 +1,179 @@ +!MNH_LIC Copyright 1995-2021 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_INI_TKE_EPS +! ####################### +INTERFACE +! + SUBROUTINE INI_TKE_EPS(HGETTKET,PTHVREF,PZZ, & + PUT,PVT,PTHT, & + PTKET,TPINITHALO3D_ll ) +! +USE MODD_ARGSLIST_ll, ONLY : LIST_ll +CHARACTER (LEN=*), INTENT(IN) :: HGETTKET + ! character string indicating whether TKE must be + ! initialized or not +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! virtual potential + ! temperature +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! physical height for + ! w-point +REAL, DIMENSION(:,:,:), INTENT(INOUT):: PUT ! x-component of wind +REAL, DIMENSION(:,:,:), INTENT(INOUT):: PVT ! y-component of wind +REAL, DIMENSION(:,:,:), INTENT(INOUT):: PTHT ! potential temperature +REAL, DIMENSION(:,:,:), INTENT(INOUT):: PTKET ! TKE fields +TYPE(LIST_ll), POINTER :: TPINITHALO3D_ll ! pointer for the list of fields + ! which must be communicated in INIT +! +END SUBROUTINE INI_TKE_EPS +! +END INTERFACE +! +END MODULE MODI_INI_TKE_EPS +! +! ################################################################### + SUBROUTINE INI_TKE_EPS(HGETTKET,PTHVREF,PZZ, & + PUT,PVT,PTHT, & + PTKET,TPINITHALO3D_ll ) +! ################################################################### +! +! +!! **** *INI_TKE* initializes by a 1D stationarized TKE equation the +!! values of TKE. A positivity control is made. The +!! dissipation of TKE is set to its minimum value. +!! +!! PURPOSE +!! ------- +! The purpose of this routine is to initialize the values of the +! turbulence kinetic energy. The dissipation is intialized to its minimum +! value. +! +!!** METHOD +!! ------ +!! A diagnostic 1D equation for the TKE is used. The transport terms +!! are neglected. +!! +!! EXTERNAL +!! -------- +!! DZF ,MXF, MYF, MZM : Shuman operators +!! ADD3DFIELD_ll : add a field to 3D-list +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! MODD_CST : XG, XRV, XRD +!! MODD_CTURB : XLINI, XTKEMIN, XCED, XCMFS +!! MODD_PARAMETERS: JPVEXT +!! +!! REFERENCE +!! --------- +!! Book 2 of Documentation (routine INI_TKE) +!! Book 1 of Documentation (Chapter Turbulence) +!! +!! AUTHOR +!! ------ +!! Joan Cuxart * INM and Meteo-France * +!! +!! MODIFICATIONS +!! ------------- +!! Original Jan 19, 1995 +!! Feb 13, 1995 (J. Cuxart) add EPS initialization +!! March 25, 1995 (J. Stein)add PZZ in the arguments +!! to compute a real gradient and allow RESTA conf. +!! Aug 10, 1998 (N. Asencio) add parallel code +!! May 2006 Remove KEPS +! P. Wautelet 20/05/2019: add name argument to ADDnFIELD_ll + new ADD4DFIELD_ll subroutine +!! March 2021 (JL Redelsperger) Add Ocean LES case) +!! ------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_ARGSLIST_ll, ONLY: LIST_ll +USE MODD_CST, ONLY: XG, XALPHAOC +USE MODD_CTURB, ONLY: XCMFS +USE MODD_TURB_n, ONLY: XLINI, XCED, XTKEMIN, XCSHF +USE MODD_DYN_n, ONLY: LOCEAN +USE MODD_PARAMETERS, ONLY: JPVEXT +! +USE MODE_ll +! +USE MODI_SHUMAN, ONLY: DZF, MXF, MYF, MZM +! +IMPLICIT NONE +! +!* 0.1. declarations of arguments +! +CHARACTER (LEN=*), INTENT(IN) :: HGETTKET + ! character string indicating whether TKE must be + ! initialized or not +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHVREF ! virtual potential + ! temperature +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! physical height for + ! w-point +REAL, DIMENSION(:,:,:), INTENT(INOUT):: PUT ! x-component of wind +REAL, DIMENSION(:,:,:), INTENT(INOUT):: PVT ! y-component of wind +REAL, DIMENSION(:,:,:), INTENT(INOUT):: PTHT ! potential temperature +REAL, DIMENSION(:,:,:), INTENT(INOUT):: PTKET ! TKE field +TYPE(LIST_ll), POINTER :: TPINITHALO3D_ll ! pointer for the list of fields + ! which must be communicated in INIT +! +!* 0.2 Declaration of local variables +! +INTEGER :: IKB,IKE ! index value for the first and last inner + ! mass points +INTEGER :: JKK ! vertical loop index +REAL, DIMENSION(SIZE(PUT,1),SIZE(PUT,2),SIZE(PUT,3)) :: ZDELTZ ! vertical + ! increment +! +! --------------------------------------------------------------------- +! +! +IKB=1+JPVEXT +IKE=SIZE(PTHT,3)-JPVEXT +! +!* 1. TKE DETERMINATION +! ----------------- +! +DO JKK=IKB-1,IKE + ZDELTZ(:,:,JKK) = PZZ(:,:,JKK+1)-PZZ(:,:,JKK) +END DO +ZDELTZ(:,:,IKE+1) = ZDELTZ(:,:,IKE) +! +IF (HGETTKET == 'INIT' ) THEN +! instant t + PTHT(:,:,IKB-1) = PTHT(:,:,IKB) + PUT(:,:,IKB-1) = PUT(:,:,IKB) + PVT(:,:,IKB-1) = PVT(:,:,IKB) + ! + PTHT(:,:,IKE+1) = PTHT(:,:,IKE) + PUT(:,:,IKE+1) = PUT(:,:,IKE) + PVT(:,:,IKE+1) = PVT(:,:,IKE) + ! + ! determines TKE + ! Equilibrium/Stationary/neutral 1D TKE equation + IF (LOCEAN) THEN + PTKET(:,:,:)=(XLINI**2/XCED)*( & + XCMFS*( DZF(MXF(MZM(PUT)))**2 & + +DZF(MYF(MZM(PVT)))**2) / ZDELTZ & + -(XG*XALPHAOC)*XCSHF*DZF(MZM(PTHT)) & + ) / ZDELTZ + ELSE + PTKET(:,:,:)=(XLINI**2/XCED)*( & + XCMFS*( DZF(MXF(MZM(PUT)))**2 & + +DZF(MYF(MZM(PVT)))**2) / ZDELTZ & + -(XG/PTHVREF)*XCSHF*DZF(MZM(PTHT)) & + ) / ZDELTZ + END IF + ! positivity control + WHERE (PTKET < XTKEMIN) PTKET=XTKEMIN + ! + ! + ! Add PTKET to TPINITHALO3D_ll list of fields updated at the + ! end of initialization + CALL ADD3DFIELD_ll ( TPINITHALO3D_ll, PTKET, 'INI_TKE_EPS::PTKET' ) +END IF +! +! +END SUBROUTINE INI_TKE_EPS diff --git a/src/mesonh/ext/init_mnh.f90 b/src/mesonh/ext/init_mnh.f90 new file mode 100644 index 0000000000000000000000000000000000000000..b2ec1752f76469529b4e2b8fd97810a63b39e211 --- /dev/null +++ b/src/mesonh/ext/init_mnh.f90 @@ -0,0 +1,249 @@ +!MNH_LIC Copyright 1994-2021 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. +!----------------------------------------------------------------- +! ############### + SUBROUTINE INIT_MNH +! ############### +! +!!**** *INIT_MNH * - monitor to initialize the variables of the model +!! +!! PURPOSE +!! ------- +! The purpose of this routine is to initialize all the variables +! used in the model temporal loop or in the post-processings +! +!!** METHOD +!! ------ +!! This initialization is separated in three parts : +!! 1. A part common to all models where : +!! - The output-listing file common to all models is opened. +!! - The physical constants are initialized. +!! - The other constants for all models are initialized. +!! 2. The treatment of descriptor files model by model : +!! The DESFM and EXSEG files are read and the EXSEG file is updated +!! 3. The sequential initialization of nested models : +!! The initial data fields are read in different files for each +!! model and variables which are not in these initial files are +!! deduced. +!! +!! +!! EXTERNAL +!! -------- +!! INI_CST : to initialize physical constants +!! INI_CTURB : to initialize for all models the constants used in the +!! turbulence scheme +!! INI_SEG_n : to read and update descriptor files +!! INI_SIZE : to initialize the sizes of the different models +!! INI_MODEL : to initialize each nested model +!! INI_PARA_ll: to build the ll data structures +!! GO_TOMODEL : displace the ll lists to the right nested model +!! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODD_PARAMETERS : JPMODELMAX +!! +!! Module MODD_CONF : NMODEL,NVERB +!! +!! REFERENCE +!! --------- +!! Book2 of documentation (routine INIT_MNH) +!! +!! +!! AUTHOR +!! ------ +!! V. Ducrocq * Meteo France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 02/06/94 +!! J.Stein 05/01/95 add ini_cturb +!! J.P. Lafore 18/08/95 Time STEP change +!! J.P. Lafore 22/07/96 ZTSTEP_ALL introduction for nesting +!! V. Ducrocq 7/08/98 // +!! P. Jabouille 7/07/99 split ini_modeln in 2 parts+ cleaning +!! V. Masson 15/03/99 call to ini_data_cover +!! P.Jabouille 15/07/99 special initialisation for spawning +!! J.P Chaboureau 2015 add ini_spectre_n +!! J.Escobar 2/03/2016 bypass , reset NHALO=1 for SPAWNING +!! 06/2016 (G.Delautier) phasage surfex 8 +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 14/02/2019: remove CLUOUT/CLUOUT0 and associated variables +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +USE MODD_CONF +USE MODD_DYN_n, ONLY: CPRESOPT, NITR ! only for spawning purpose +USE MODD_IO, ONLY: TFILE_OUTPUTLISTING, TPTR2FILE +USE MODD_LBC_n, ONLY: CLBCX,CLBCY ! only for spawning purpose +USE MODD_LUNIT +USE MODD_LUNIT_n +USE MODD_MNH_SURFEX_n +USE MODD_PARAMETERS +! +use mode_field, only: Alloc_field_scalars, Fieldlist_goto_model +USE MODE_IO_FILE, ONLY: IO_File_open +USE MODE_IO_MANAGE_STRUCT, ONLY: IO_File_add2list +USE MODE_ll +USE MODE_MODELN_HANDLER +USE MODE_SPLITTINGZ_ll +! +USE MODE_INI_CST, ONLY: INI_CST +USE MODI_INI_MODEL_n +USE MODI_INI_SEG_n +USE MODI_INI_SIZE_n +USE MODI_INI_SIZE_SPAWN +USE MODI_INI_SPECTRE_n +USE MODI_READ_ALL_NAMELISTS +USE MODI_RESET_EXSEG +! +IMPLICIT NONE +! +!* 0.1 Local variables +! +INTEGER :: JMI ! Loop index +CHARACTER(LEN=28),DIMENSION(JPMODELMAX) :: YINIFILEPGD +INTEGER :: ILUOUT0,IRESP ! Logical unit number for + ! output-listing common + ! to all models and return + ! code of file management +REAL, DIMENSION(JPMODELMAX) :: ZTSTEP_ALL ! Time STEP of ALL models +INTEGER :: IINFO_ll ! return code of // routines +! +! Dummy pointers needed to correct an ifort Bug +CHARACTER(LEN=4), DIMENSION(:), POINTER :: DPTR_CLBCX,DPTR_CLBCY + +!------------------------------------------------------------------------------- +! +!* 1. INITIALIZATION COMMON TO ALL MODELS +! ------------------------------------ +! +!* 1.1 initialize // E/S and open output-listing file +! +! +IF (CPROGRAM/='REAL ') THEN + CALL IO_File_add2list(TLUOUT0,'OUTPUT_LISTING0','OUTPUTLISTING','WRITE') + CALL IO_File_open(TLUOUT0) + !Set output file for PRINT_MSG + TFILE_OUTPUTLISTING => TLUOUT0 + ILUOUT0=TLUOUT0%NLU +ELSE + ILUOUT0=TLUOUT0%NLU +END IF +! +WRITE(UNIT=ILUOUT0,FMT="(50('*'),/,'*',48X,'*',/, & + & 7('*'),10X, ' MESO-NH MODEL ',10X,8('*'),/, & + & '*',48X,'*',/, & + & 7('*'),12X,' CNRM - LA ',12X,8('*'),/, & + & '*',48X,'*',/, 50('*'))") +! +! +!* 1.2 initialize physical constants +! +CALL INI_CST +! +! +!* 1.3 initialize constants for the turbulence scheme +! +!Now done in ini_modeln +! +! +!------------------------------------------------------------------------------- +! +!* 2. READ AND UPDATE DESCRIPTOR FILES +! -------------------------------- +! +IF (CPROGRAM=='SPAWN ' .OR. CPROGRAM=='DIAG ' .OR. CPROGRAM=='SPEC ' .OR. CPROGRAM=='MESONH') THEN + CALL ALLOC_FIELD_SCALARS() +END IF +! +CALL GOTO_MODEL(1) +CALL INI_SEG_n(1,LUNIT_MODEL(1)%TINIFILE,YINIFILEPGD(1),ZTSTEP_ALL) +! +DO JMI=2,NMODEL + CALL GOTO_MODEL(JMI) + CALL INI_SEG_n(JMI,LUNIT_MODEL(JMI)%TINIFILE,YINIFILEPGD(JMI),ZTSTEP_ALL) +END DO +! +IF (CPROGRAM=='SPAWN ') THEN + !bypass + NHALO = 1 +END IF +! +IF (CPROGRAM=='DIAG') CALL RESET_EXSEG() +! +!------------------------------------------------------------------------------- +! +! +!* 3. INITIALIZE EACH MODEL SIZES AND DEPENDENCY +! ------------------------------------------ +! +DO JMI=1,NMODEL + CALL GOTO_MODEL(JMI) + CALL INI_SIZE_n(JMI,LUNIT_MODEL(JMI)%TINIFILE,YINIFILEPGD(JMI)) +END DO +! +IF (CPROGRAM=='SPAWN ') THEN + DPTR_CLBCX=>CLBCX + DPTR_CLBCY=>CLBCY + CALL INI_PARAZ_ll(IINFO_ll) + CALL INI_SIZE_SPAWN(DPTR_CLBCX,DPTR_CLBCY,CPRESOPT,NITR,LUNIT_MODEL(1)%TINIFILE) +END IF +! +! INITIALIZE data structures of ComLib +! +!JUAN CALL INI_PARA_ll(IINFO_ll) +CALL INI_PARAZ_ll(IINFO_ll) +! +!------------------------------------------------------------------------------- +! +! +! Allocations of Surfex Types +CALL SURFEX_ALLOC_LIST(NMODEL) +! +DO JMI=1,NMODEL + YSURF_CUR => YSURF_LIST(JMI) +! + IF (CPROGRAM=='SPAWN ' .OR. CPROGRAM=='REAL ') THEN + CALL READ_ALL_NAMELISTS(YSURF_CUR,'MESONH','PRE',.FALSE.) + ELSE + CALL READ_ALL_NAMELISTS(YSURF_CUR,'MESONH','ALL',.TRUE.) + ENDIF +ENDDO +! +! +!------------------------------------------------------------------------------- +! +!* 4. INITIALIZE EACH MODEL +! --------------------- +! +DO JMI=1,NMODEL + CALL GO_TOMODEL_ll(JMI,IINFO_ll) + CALL GOTO_MODEL(JMI) + IF (CPROGRAM/='SPEC ') THEN + CALL INI_MODEL_n(JMI,LUNIT_MODEL(JMI)%TINIFILE) + !Call necessary to update the TFIELDLIST pointers to the data + CALL FIELDLIST_GOTO_MODEL(JMI,JMI) + ELSE + CALL INI_SPECTRE_n(JMI,LUNIT_MODEL(JMI)%TINIFILE) + END IF +END DO +! +!------------------------------------------------------------------------------- +! +!* 5. WRITE MESSAGE ON OUTPUT-LISTING +! ------------------------------- +! +IF (NVERB >= 5) THEN + WRITE(UNIT=ILUOUT0,FMT="(50('*'),/,'*',48X,'*',/, & + & '*',10X,' INITIALIZATION TERMINATED',10X,'*',/, & + & '*',48X,'*',/,50('*'))") +END IF +! +!------------------------------------------------------------------------------- +! +! +END SUBROUTINE INIT_MNH diff --git a/src/mesonh/ext/ion_attach_elec.f90 b/src/mesonh/ext/ion_attach_elec.f90 new file mode 100644 index 0000000000000000000000000000000000000000..cd0fcf1c3eb268b93d7eeceef9161bc5157122aa --- /dev/null +++ b/src/mesonh/ext/ion_attach_elec.f90 @@ -0,0 +1,631 @@ +!MNH_LIC Copyright 2010-2020 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_ION_ATTACH_ELEC +! ############################ +! +INTERFACE + SUBROUTINE ION_ATTACH_ELEC(KTCOUNT, KRR, PTSTEP, PRHODREF, & + PRHODJ,PSVS, PRS, PTHT, PCIT, PPABST, PEFIELDU, & + PEFIELDV, PEFIELDW, GATTACH, PTOWN, PSEA ) + + +INTEGER, INTENT(IN) :: KTCOUNT ! Temporal loop counter +INTEGER, INTENT(IN) :: KRR ! Number of moist variables +REAL, INTENT(IN) :: PTSTEP ! Time step +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF ! Reference dry air density +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! dry air density* Jacobian +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PSVS ! Scalar variable vol. source +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRS ! Moist variable vol. source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHT ! Theta (K) at time t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PCIT ! Pristine ice n.c. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABST ! Absolute pressure at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PEFIELDU, PEFIELDV, PEFIELDW + ! Electric field components +LOGICAL, DIMENSION(:,:,:), INTENT(IN) :: GATTACH !Recombination and + !Attachment if true +REAL, DIMENSION(:,:), OPTIONAL, INTENT(IN) :: PTOWN ! town fraction +REAL, DIMENSION(:,:), OPTIONAL, INTENT(IN) :: PSEA ! Land-sea mask + + END SUBROUTINE ION_ATTACH_ELEC +END INTERFACE +END MODULE MODI_ION_ATTACH_ELEC + + + +! ###################################################################### + SUBROUTINE ION_ATTACH_ELEC(KTCOUNT, KRR, PTSTEP, PRHODREF, & + PRHODJ,PSVS, PRS, PTHT, PCIT, PPABST, PEFIELDU, & + PEFIELDV, PEFIELDW, GATTACH, PTOWN, PSEA ) +! ###################################################################### + + +! +!!**** * - +!! +!! PURPOSE +!! ------- +!! This routine computes the ion capture by (or attachment to) hydrometeors +!! providing a source of charge for hydrometeors and a sink for positive +!! negative ion mixing ratio. It is assumed as resulting from both ionic +!! diffusion and conduction (electrical attraction). +!! +!! +!! METHOD +!! ------ +!! +!! EXTERNAL +!! -------- +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! M. Chong *Laboratoire d'Aerologie* +!! +!! MODIFICATIONS +!! ------------- +!! Original 2010 +!! Modifications: +!! J.Escobar : 18/12/2015 : Correction of bug in bound in // for NHALO <>1 +! P. Wautelet 03/2020: use the new data structures and subroutines for budgets +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +use modd_budget, only : lbudget_sv, NBUDGET_SV1, tbudgets +USE MODD_CONF, ONLY: CCONF +USE MODD_CST +USE MODD_ELEC_DESCR +USE MODD_ELEC_n +USE MODD_ELEC_PARAM +USE MODD_NSV, ONLY: NSV_ELECBEG, NSV_ELEC +USE MODD_PARAMETERS, ONLY: JPHEXT, JPVEXT +USE MODD_RAIN_ICE_DESCR_n +USE MODD_RAIN_ICE_PARAM_n +USE MODD_REF, ONLY: XTHVREFZ + +use mode_budget, only: Budget_store_init, Budget_store_end +use mode_tools_ll, only: GET_INDICE_ll + +USE MODI_MOMG + +IMPLICIT NONE +! +! 0.1 Declaration of arguments +! +INTEGER, INTENT(IN) :: KTCOUNT ! Temporal loop counter +INTEGER, INTENT(IN) :: KRR ! Number of moist variables +REAL, INTENT(IN) :: PTSTEP ! Time step +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF ! Reference dry air density +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! dry air density* Jacobian +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PSVS ! Scalar variable vol. source +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRS ! Moist variable vol. source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHT ! Theta (K) at time t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PCIT ! Pristine ice n.c. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABST ! Absolute pressure at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PEFIELDU, PEFIELDV, PEFIELDW + ! Electric field components +LOGICAL, DIMENSION(:,:,:), INTENT(IN) :: GATTACH !Recombination and + !Attachment if true +REAL, DIMENSION(:,:), OPTIONAL, INTENT(IN) :: PTOWN ! town fraction +REAL, DIMENSION(:,:), OPTIONAL, INTENT(IN) :: PSEA ! Land-sea mask + +! +! +! 0.2 Declaration of local variables +! +REAL, DIMENSION(:), ALLOCATABLE :: ZT ! Temperature (K) +REAL, DIMENSION(:), ALLOCATABLE :: ZCONC, ZVIT, ZRADIUS ! Number concentration + !fallspeed, radius +REAL :: ZCQD, ZCDIF ! computed coefficients +INTEGER, DIMENSION(SIZE(PTHT)) :: IGI, IGJ, IGK ! Valid grid index +INTEGER :: IVALID ! Nb of valid grid +INTEGER :: IIB ! Beginning (B) and end (E) grid points +INTEGER :: IIE ! along i axis, +INTEGER :: IJB ! j axis, +INTEGER :: IJE ! +INTEGER :: IKB ! and k axis +INTEGER :: IKE ! + +INTEGER :: II, IJ, IK, JRR, JSV ! Loop index for variable +INTEGER :: ITYPE ! Hydrometeor category (2: cloud, 3: rain, + ! 4: ice crystal, 5: snow, 6: graupel, 7: hail) +REAL :: ZCOMB ! Recombination +! +! +!------------------------------------------------------------------------------- +if ( lbudget_sv ) then + do jrr = 1, nsv_elec + call Budget_store_init( tbudgets( NBUDGET_SV1 - 1 + nsv_elecbeg - 1 + jrr), 'NEUT', psvs(:, :, :, jrr) ) + end do +end if +! +!* 1. COMPUTE THE ION RECOMBINATION and TEMPERATURE +! --------------------------------------------- +! +! +ZCQD = 4 * XPI * XEPSILON * XBOLTZ / XECHARGE +ZCDIF = XBOLTZ /XECHARGE +! +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +IKB = 1 + JPVEXT +IKE = SIZE(PTHT,3) - JPVEXT +! +!* 1.1 Add Ion Recombination source (PSVS in 1/(m3.s)) +! and count and localize valid grid points for ion source terms +! +IVALID = 0 +DO IK = IKB, IKE + DO IJ = IJB, IJE + DO II = IIB, IIE + IF (GATTACH(II,IJ,IK)) THEN +! Recombination + ZCOMB = XIONCOMB * (PSVS(II,IJ,IK,1)*PTSTEP) * & + (PSVS(II,IJ,IK,NSV_ELEC)*PTSTEP) * & + PRHODREF(II,IJ,IK) / PRHODJ(II,IJ,IK) + ZCOMB = MIN(ZCOMB, PSVS(II,IJ,IK,1), PSVS(II,IJ,IK,NSV_ELEC)) + PSVS(II,IJ,IK,1) = PSVS(II,IJ,IK,1) - ZCOMB + PSVS(II,IJ,IK,NSV_ELEC) = PSVS(II,IJ,IK,NSV_ELEC) - ZCOMB +! Counting + IVALID = IVALID + 1 + IGI(IVALID) = II + IGJ(IVALID) = IJ + IGK(IVALID) = IK + END IF + ENDDO + ENDDO +ENDDO +! +!* 1.2 Compute the temperature +! +IF( IVALID /= 0 ) THEN + ALLOCATE (ZT(IVALID)) + DO II = 1, IVALID + ZT(II) = PTHT(IGI(II),IGJ(II),IGK(II)) * & + (PPABST(IGI(II),IGJ(II),IGK(II)) / XP00) ** (XRD / XCPD) + ENDDO +END IF +! +! +!* 2. TRANSFORM VOLUM. SOURCE TERMS INTO MIXING RATIO +! FOR WATER SPECIES, AND VOLUMIC CONTENT FOR ELECTRIC VARIABLES +! ------------------------------------------------------------- +! +DO JRR = 1, KRR + PRS(:,:,:,JRR) = PRS(:,:,:,JRR) *PTSTEP / PRHODJ(:,:,:) +ENDDO +! +DO JSV = 1, NSV_ELEC + PSVS(:,:,:,JSV) = PSVS(:,:,:,JSV) *PTSTEP *PRHODREF(:,:,:) / PRHODJ(:,:,:) +ENDDO +! +! +!* 3. COMPUTE ATTACHMENT DUE TO ION DIFFUSION AND CONDUCTION +! ------------------------------------------------------ +! +! Attachment to cloud droplets, rain, cloud ice, snow, graupel, +! and hail (optional) +! +! +IF( IVALID /= 0 ) THEN +! +!* 3.1 Attachment to cloud droplets +! + ALLOCATE (ZCONC(IVALID)) + ALLOCATE (ZVIT (IVALID)) + ALLOCATE (ZRADIUS(IVALID)) + + ITYPE = 2 + IF (PRESENT(PSEA)) THEN + CALL HYDROPARAM (IGI, IGJ, IGK, ZCONC, ZVIT, ZRADIUS, ITYPE, PSEA, PTOWN) + ELSE + CALL HYDROPARAM (IGI, IGJ, IGK, ZCONC, ZVIT, ZRADIUS, ITYPE) + ENDIF +! + CALL DIFF_COND (IGI, IGJ, IGK, PSVS(:,:,:,1), PSVS(:,:,:,NSV_ELEC), & + PSVS(:,:,:,ITYPE)) +! +!* 3.2 Attachment to raindrops, ice crystals, snow, graupel, +! and hail (if activated) +! + DO ITYPE = 3, KRR + CALL HYDROPARAM (IGI, IGJ, IGK, ZCONC, ZVIT, ZRADIUS, ITYPE) +! + CALL DIFF_COND (IGI, IGJ, IGK, PSVS(:,:,:,1), PSVS(:,:,:,NSV_ELEC), & + PSVS(:,:,:,ITYPE)) + END DO +! + DEALLOCATE (ZCONC, ZVIT, ZRADIUS) + DEALLOCATE (ZT) +ENDIF +! +! +!* 4. RETURN TO VOLUMETRIC SOURCE (Prognostic units) +! --------------------------- +! +DO JRR = 1, KRR + PRS(:,:,:,JRR) = PRS(:,:,:,JRR) * PRHODJ(:,:,:) / PTSTEP +ENDDO +! +DO JSV = 1, NSV_ELEC + PSVS(:,:,:,JSV) = PSVS(:,:,:,JSV) * PRHODJ(:,:,:) / (PTSTEP * PRHODREF(:,:,:)) +ENDDO +! +! +!* 5. BUDGET +! ------ +! +if ( lbudget_sv ) then + do jrr = 1, nsv_elec + call Budget_store_end( tbudgets( NBUDGET_SV1 - 1 + nsv_elecbeg - 1 + jrr), 'NEUT', psvs(:, :, :, jrr) ) + end do +end if +! +!------------------------------------------------------------------------------ +! +CONTAINS +! +!------------------------------------------------------------------------------ +! + SUBROUTINE HYDROPARAM (IGRIDX, IGRIDY, IGRIDZ, ZCONC, & + ZVIT, ZRADIUS, ITYPE, PSEA, PTOWN) +! +! Purpose : Compute in regions of valid grid points (IGRIDX, IGRIDY, IGRIDZ) +! the hydrometeor parameters: concentration (ZCONC), +! fallspeed (ZVIT), +! and mean radius (ZRADIUS) +! involved in the evaluation of ion attachment +! +! +!* 0. DECLARATIONS +! ------------ +IMPLICIT NONE +! +!* 0.1 declaration of dummy arguments +! +INTEGER, DIMENSION(:), INTENT(IN) :: IGRIDX, IGRIDY, IGRIDZ ! Index of + ! valid gridpoints +INTEGER, INTENT(IN) :: ITYPE ! Hydrometeor category + ! ITYPE= 2: cloud, 3: rain, 4: ice, 5: snow, 6: graupel, 7: hail +REAL, DIMENSION(:), INTENT(INOUT) :: ZCONC, ZVIT, ZRADIUS +! Number concentration, fallspeed, radius +REAL, DIMENSION(:,:), OPTIONAL, INTENT(IN) :: PTOWN ! town fraction +REAL, DIMENSION(:,:), OPTIONAL, INTENT(IN) :: PSEA ! Land-sea mask +! +!* 0.2 declaration of local variables +! +REAL :: ZCONC1, ZCONC2 ! for cloud +REAL :: ZLBC +REAL :: ZFSEDC +REAL :: ZRAY +REAL :: ZEXP1, ZEXP2, ZMOM1, ZMOM2 +REAL :: ZVCOEF, ZRHO00, ZLBI +REAL :: ZLAMBDA +INTEGER :: JI, JJ, JK, IV +! +! +ZCONC(:) = 0. +ZVIT (:) = 0. +ZRADIUS(:) = 0. +! +SELECT CASE (ITYPE) +! +!* 1. PARAMETERS FOR CLOUD +! -------------------- + CASE (2) +! + IF (PRESENT(PSEA)) THEN + + ZMOM1 = 0.5*MOMG(XALPHAC,XNUC,1.) + ZMOM2 = 0.5*MOMG(XALPHAC2,XNUC2,1.) + DO IV = 1, IVALID + JI = IGRIDX(IV) + JJ = IGRIDY(IV) + JK = IGRIDZ(IV) + IF( PRS(JI, JJ, JK, 2)/PRHODREF(JI, JJ, JK) >XRTMIN_ELEC(2) .AND. & + PSVS(JI, JJ, JK, 2) /=0. ) THEN + ZCONC1 = PSEA(JI,JJ) * XCONC_SEA + (1. - PSEA(JI,JJ)) * XCONC_LAND + ZLBC = PSEA(JI,JJ) * XLBC(2) + (1. - PSEA(JI,JJ)) * XLBC(1) + ZFSEDC = PSEA(JI,JJ) * XFSEDC(2) + (1. - PSEA(JI,JJ)) * XFSEDC(1) + ZFSEDC = MAX(MIN(XFSEDC(1),XFSEDC(2)), ZFSEDC) + ZCONC2 = (1. - PTOWN(JI,JJ)) * ZCONC1 + PTOWN(JI,JJ) * XCONC_URBAN + ZRAY = (1. - PSEA(JI,JJ)) * ZMOM1 + PSEA(JI,JJ) * ZMOM2 + ZCONC (IV) = ZCONC2 ! Number concentration + ZLAMBDA = (ZLBC *ZCONC2 / (PRHODREF(JI,JJ,JK) * PRS(JI,JJ,JK,2)))**XLBEXC + ZRADIUS (IV) = ZRAY / ZLAMBDA + ZVIT (IV) = XCC * ZFSEDC * ZLAMBDA**(-XDC) * & + PRHODREF(JI,JJ,JK)**(-XCEXVT) + END IF + ENDDO + ELSE + ZRAY = 0.5*MOMG(XALPHAC,XNUC,1.) + ZLBC = XLBC(1) * XCONC_LAND + DO IV = 1, IVALID + JI = IGRIDX(IV) + JJ = IGRIDY(IV) + JK = IGRIDZ(IV) + IF( PRS(JI, JJ, JK, 2)/PRHODREF(JI, JJ, JK) >XRTMIN_ELEC(2) .AND. & + PSVS(JI, JJ, JK, 2) /=0. ) THEN + ZCONC (IV) = XCONC_LAND ! Number concentration + ZLAMBDA = (ZLBC / (PRHODREF(JI,JJ,JK) * PRS(JI,JJ,JK,2)))**XLBEXC + ZRADIUS (IV) = ZRAY / ZLAMBDA + ZVIT (IV) = XCC * XFSEDC(1) * ZLAMBDA**(-XDC) * & + PRHODREF(JI,JJ,JK)**(-XCEXVT) + END IF + ENDDO + END IF +! +! +!* 2. PARAMETERS FOR RAIN +! ------------------- + CASE (3) + ZEXP1 = XEXSEDR - 1. + ZEXP2 = ZEXP1 - XCEXVT +! + DO IV = 1, IVALID + JI = IGRIDX(IV) + JJ = IGRIDY(IV) + JK = IGRIDZ(IV) + IF( PRS(JI, JJ, JK, 3)/PRHODREF(JI, JJ, JK) >XRTMIN_ELEC(3) .AND. & + PSVS(JI, JJ, JK, 3) /=0. ) THEN + ZLAMBDA = XLBR * (PRHODREF(JI,JJ,JK) * PRS(JI,JJ,JK,3))**XLBEXR + ZRADIUS (IV) = 0.5 / ZLAMBDA + ZCONC (IV) = XCCR / ZLAMBDA + ZVIT (IV) = XFSEDR * PRHODREF(JI,JJ,JK)**ZEXP2 & + * PRS(JI,JJ,JK,3)**ZEXP1 + END IF + ENDDO +! +! +!* 3. PARAMETERS FOR ICE +! ------------------ +! + CASE (4) +! + ZRAY = 0.5*MOMG(XALPHAI,XNUI,1.) + ZRHO00 = XP00 / (XRD * XTHVREFZ(IKB)) +! ZVCOEF= XC_I * (GAMMA(XNUI+(XBI+XDI)/XALPHAI) / GAMMA(XNUI+XBI/XALPHAI)) & +! * ZRHO00**XCEXVT +! Computations for Columns (see ini_rain_ice_elec.f90) + ZVCOEF = 2.1E5 * MOMG(XALPHAI,XNUI, 3.285) / MOMG(XALPHAI,XNUI, 1.7) & + * ZRHO00**XCEXVT + ZLBI = (2.14E-3 * MOMG(XALPHAI,XNUI,1.7)) **0.588235 + + DO IV = 1, IVALID + JI = IGRIDX(IV) + JJ = IGRIDY(IV) + JK = IGRIDZ(IV) + IF( PRS(JI, JJ, JK, 4)/PRHODREF(JI, JJ, JK) > XRTMIN_ELEC(4) .AND. & + PSVS(JI, JJ, JK, 4) /=0.) THEN + ZCONC (IV) = XFCI * PRHODREF(JI,JJ,JK) * PRS(JI,JJ,JK,4) * & + MAX(0.05E6, -0.15319E6 - 0.021454E6 * & + ALOG(PRHODREF(JI,JJ,JK) * PRS(JI,JJ,JK,4)))**3 + ZLAMBDA = ZLBI * (ZCONC(IV) / (PRHODREF(JI,JJ,JK) * & + PRS(JI,JJ,JK,4)))**0.588235 + ZRADIUS (IV) = ZRAY / ZLAMBDA + ZVIT (IV) = ZVCOEF * ZLAMBDA**(-1.585) * & !(-XDI) * & + PRHODREF(JI,JJ,JK)**(-XCEXVT) + END IF + ENDDO +! +! +!* 4. PARAMETERS FOR SNOW +! ------------------- +! + CASE (5) +! + ZEXP1 = XEXSEDS - 1. + ZEXP2 = ZEXP1 - XCEXVT +! + DO IV = 1, IVALID + JI = IGRIDX(IV) + JJ = IGRIDY(IV) + JK = IGRIDZ(IV) + IF( PRS(JI, JJ, JK, 5)/PRHODREF(JI, JJ, JK) >XRTMIN_ELEC(5) .AND. & + PSVS(JI, JJ, JK, 5) /=0. ) THEN + ZLAMBDA = XLBS * (PRHODREF(JI,JJ,JK) * PRS(JI,JJ,JK,5))**XLBEXS + ZRADIUS (IV) = 0.5 / ZLAMBDA + ZCONC (IV) = XCCS * ZLAMBDA**XCXS + ZVIT (IV) = XFSEDS * PRHODREF(JI,JJ,JK)**ZEXP2 & + * PRS(JI,JJ,JK,5)**ZEXP1 + END IF + ENDDO +! +! +!* 5. PARAMETERS FOR GRAUPEL +! ---------------------- +! + CASE (6) +! + ZEXP1 = XEXSEDG - 1. + ZEXP2 = ZEXP1 - XCEXVT +! + DO IV = 1, IVALID + JI = IGRIDX(IV) + JJ = IGRIDY(IV) + JK = IGRIDZ(IV) + IF( PRS(JI, JJ, JK, 6)/PRHODREF(JI, JJ, JK) >XRTMIN_ELEC(6) .AND. & + PSVS(JI, JJ, JK, 6) /=0. ) THEN + ZLAMBDA = XLBG * (PRHODREF(JI,JJ,JK) * PRS(JI,JJ,JK,6))**XLBEXG + ZRADIUS (IV) = 0.5 / ZLAMBDA + ZCONC (IV) = XCCG * ZLAMBDA**XCXG + ZVIT (IV) = XFSEDG * PRHODREF(JI,JJ,JK)**ZEXP2 & + * PRS(JI,JJ,JK,6)**ZEXP1 + END IF + ENDDO +! +! +!* 6. PARAMETERS FOR HAIL +! ------------------- +! + CASE (7) +! + ZEXP1 = XEXSEDH - 1. + ZEXP2 = ZEXP1-XCEXVT + ZRAY = 0.5*MOMG(XALPHAH, XNUH, 1.) +! + DO IV = 1, IVALID + JI = IGRIDX(IV) + JJ = IGRIDY(IV) + JK = IGRIDZ(IV) + IF( PRS(JI, JJ, JK, 7)/PRHODREF(JI, JJ, JK) >XRTMIN_ELEC(7) .AND. & + PSVS(JI, JJ, JK, 7) /=0. ) THEN + ZLAMBDA = XLBH * (PRHODREF(JI,JJ,JK) * PRS(JI,JJ,JK,7))**XLBEXH + ZRADIUS (IV) = ZRAY / ZLAMBDA + ZCONC (IV) = XCCG * ZLAMBDA**XCXG + ZVIT (IV) = XFSEDH * PRHODREF(JI,JJ,JK)**ZEXP2 & + * PRS(JI,JJ,JK,7)**ZEXP1 + END IF + ENDDO +! +END SELECT +! +END SUBROUTINE HYDROPARAM +! +!------------------------------------------------------------------------------ +! + SUBROUTINE DIFF_COND (IGRIDX, IGRIDY, IGRIDZ, PQPIS, PQNIS, PQVS) +! +! Purpose : Compute in regions of valid grid points (IGRIDX, IGRIDY, IGRIDZ) +! the attachment of positive (sink for PQPIS) and negative +! (sink for PQNIS) ions to the hydrometeor variable (charge +! source for PQVS) +! +! +!* 0. DECLARATIONS +! ------------ +IMPLICIT NONE +! +!* 0.1 declaration of dummy arguments +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PQPIS ! Positive ion concentration +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PQNIS ! Negative ion concentration +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PQVS !Hydrom volumetric charge +INTEGER, DIMENSION(:), INTENT(IN) :: IGRIDX, IGRIDY, IGRIDZ ! Index of + ! valid gridpoints + +! +!* 0.2 declaration of local variables +! +INTEGER :: JI, JJ, JK, IV +REAL :: ZNC, ZRADI, ZVT ! Nb conc., radius, fallspeed of the hydrometeor category +REAL :: ZQ ! net particule charge +REAL :: ZX, ZFXP, ZFXN ! Limiting diffusion function ZFX = +/- ZX /(exp(+/-ZX) -1) +REAL :: ZDIFP, ZDPIDT_D ! Diffusion of positive ions +REAL :: ZDIFM, ZDNIDT_D ! Diffusion of negative ions +REAL :: ZDPIDT_C ! Conduction of positive ions +REAL :: ZDNIDT_C ! Conduction of negative ions +REAL :: ZDELPI, ZDELNI ! Total attachment of pos/neg ions +REAL :: ZEFIELD ! Electric field magnitude +REAL :: ZQBOUND ! Limit charge for conduction +! +! +!* 1. COMPUTE ION ATTACHMENT +! ---------------------- +! +DO IV = 1, IVALID + IF (ZCONC(IV) .NE. 0.) THEN + JI = IGRIDX(IV) + JJ = IGRIDY(IV) + JK = IGRIDZ(IV) +! + ZNC = ZCONC(IV) + ZRADI = ZRADIUS(IV) + ZVT = ZVIT(IV) +! +!* 1.0 Ion diffusion to a particle +! + ZDPIDT_D = 0. + ZDNIDT_D = 0. +! + ZQ = PQVS(JI,JJ,JK) / ZNC + ZX = ZQ / (ZCQD * ZRADI * ZT(IV)) +! + IF(ZX /= 0. .AND. ABS(ZX) <= 20.0) THEN + IF( ABS(ZX) < 1.0E-15) THEN + ZFXP = 1. + ZFXN = 1. + ELSE + ZFXP = ZX / (EXP(ZX) - 1.) + ZFXN = -ZX / (EXP(-ZX) -1.) + ENDIF +! + ZDIFP = 4. * XPI * XMOBIL_POS(JI,JJ,JK) * ZCDIF * ZT(IV) + ZDPIDT_D = ZRADI * ZDIFP * PQPIS(JI,JJ,JK) * ZFXP * & + (1. + (2. * ZRADI * ZVT / ZDIFP)**0.5) +! + ZDIFM = 4. * XPI * XMOBIL_NEG(JI,JJ,JK) * ZCDIF * ZT(IV) + ZDNIDT_D = ZRADI * ZDIFM * PQNIS(JI,JJ,JK) * ZFXN * & + (1. + (2. * ZRADI * ZVT / ZDIFM)**0.5) +! + ZDELPI = MIN(ZDPIDT_D*PTSTEP*ZNC, PQPIS(JI,JJ,JK)) + ZDELNI = MIN(ZDNIDT_D*PTSTEP*ZNC, PQNIS(JI,JJ,JK)) +! + PQPIS(JI,JJ,JK) = PQPIS(JI,JJ,JK) - ZDELPI + PQNIS(JI,JJ,JK) = PQNIS(JI,JJ,JK) - ZDELNI + PQVS(JI,JJ,JK) = PQVS(JI,JJ,JK) + XECHARGE * (ZDELPI - ZDELNI) + ENDIF +! +! +!* 1.1 Ion conduction to a particle +! + ZDPIDT_C = 0. + ZDNIDT_C = 0. + ZEFIELD = SQRT(PEFIELDU(JI,JJ,JK)**2+PEFIELDV(JI,JJ,JK)**2+ & + PEFIELDW(JI,JJ,JK)**2) + ZQBOUND = 12. * XPI * XEPSILON * ZEFIELD * ZRADI**2 + ZQ = PQVS(JI,JJ,JK) / ZNC +! + IF (ABS(ZQ) < ZQBOUND) THEN + IF (PEFIELDW(JI,JJ,JK) > 0.) THEN ! opposite to fall velocity direction + ZDPIDT_C = 3. * XPI * ZRADI**2 * ZEFIELD * PQPIS(JI,JJ,JK) * & + XMOBIL_POS(JI,JJ,JK) * (1. - ZQ / ZQBOUND)**2 + IF (ZVT < XMOBIL_NEG(JI,JJ,JK)*ZEFIELD) THEN + ZDNIDT_C = 3. * XPI * ZRADI**2 * ZEFIELD * PQNIS(JI,JJ,JK) * & + XMOBIL_NEG(JI,JJ,JK) * (1. + ZQ / ZQBOUND)**2 + ELSE IF (ZQ > 0.) THEN + ZDNIDT_C = PQNIS(JI,JJ,JK) * XMOBIL_NEG(JI,JJ,JK) * ZQ / XEPSILON + ENDIF + ELSE IF (PEFIELDW(JI,JJ,JK) < 0.) THEN ! in the direction of fall veloc. + IF( ZVT < XMOBIL_POS(JI,JJ,JK)*ZEFIELD) THEN + ZDPIDT_C = 3. * XPI * ZRADI**2 * ZEFIELD * PQPIS(JI,JJ,JK) * & + XMOBIL_POS(JI,JJ,JK) * (1. - ZQ / ZQBOUND)**2 + ELSE IF (ZQ < 0.) THEN + ZDPIDT_C = -PQPIS(JI,JJ,JK) * XMOBIL_POS(JI,JJ,JK) * ZQ / XEPSILON + ENDIF + ZDNIDT_C = 3. * XPI * ZRADI**2 * ZEFIELD * PQNIS(JI,JJ,JK) * & + XMOBIL_NEG(JI,JJ,JK) * (1. + ZQ / ZQBOUND)**2 + ENDIF + ELSE IF (ZQ >= ZQBOUND) THEN + ZDPIDT_C = 0. + ZDNIDT_C = PQNIS(JI,JJ,JK) * XMOBIL_NEG(JI,JJ,JK) * ZQ / XEPSILON + ELSE IF (ZQ <= -ZQBOUND) THEN + ZDPIDT_C = -PQPIS(JI,JJ,JK) * XMOBIL_POS(JI,JJ,JK) * ZQ / XEPSILON + ZDNIDT_C = 0. + ENDIF +! + ZDELPI = MIN(ZDPIDT_C*PTSTEP*ZNC, PQPIS(JI,JJ,JK)) + ZDELNI = MIN(ZDNIDT_C*PTSTEP*ZNC, PQNIS(JI,JJ,JK)) +! + PQPIS(JI,JJ,JK) = PQPIS(JI,JJ,JK) - ZDELPI + PQNIS(JI,JJ,JK) = PQNIS(JI,JJ,JK) - ZDELNI + PQVS(JI,JJ,JK) = PQVS(JI,JJ,JK) + XECHARGE *(ZDELPI - ZDELNI) + END IF +ENDDO +! +END SUBROUTINE DIFF_COND +! +!----------------------------------------------------------------------------- +! +END SUBROUTINE ION_ATTACH_ELEC diff --git a/src/mesonh/ext/latlon_to_xy.f90 b/src/mesonh/ext/latlon_to_xy.f90 new file mode 100644 index 0000000000000000000000000000000000000000..b186d38848cd8773c72d73d7dd9bc5e4951c60fe --- /dev/null +++ b/src/mesonh/ext/latlon_to_xy.f90 @@ -0,0 +1,227 @@ +!MNH_LIC Copyright 1995-2020 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. +!----------------------------------------------------------------- +! #################### + PROGRAM LATLON_TO_XY +! #################### +! +!!**** *LATLON_TO_XY* program to compute x and y from latitude and longiude +!! for a MESONH file +!! +!! PURPOSE +!! ------- +!! +!! METHOD +!! ------ +!! +!! EXTERNAL +!! -------- +!! +!! module MODE_GRIDPROJ : contains projection routines +!! SM_LATLON and SM_XYHAT +!! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! module MODD_GRID : variables for projection: +!! XLAT0,XLON0,XRPK,XBETA +!! +!! module MODD_PGDDIM : specify the dimentions of the data arrays: +!! NPGDIMAX and NPGDJMAX +!! +!! module MODD_PGDGRID : grid variables: +!! XPGDLONOR,XPGDLATOR: longitude and latitude of the +!! origine point for the conformal projection. +!! XPGDXHAT,XPGDYHAT: position x,y in the conformal plane +!! +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! +!! V. Masson Meteo-France +!! +!! MODIFICATION +!! ------------ +!! +!! Original 29/12/95 +!! +!! remove the USE MODI_DEFAULT_DESFM Apr. 17, 1996 (J.Stein) +!! no transfer of the file when closing Dec. 09, 1996 (V.Masson) +!! + changes call to READ_HGRID +! P. Wautelet 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 07/02/2019: force TYPE to a known value for IO_File_add2list +! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function +! P. Wautelet 10/04/2020: add missing initializations (LATLON_TO_XY was not working) +! J. Escobar 21/07/2020: missing modi_version +!---------------------------------------------------------------------------- +! +!* 0. DECLARATION +! ----------- +! +use MODD_CONF, only: CPROGRAM +USE MODD_DIM_n +USE MODD_GRID +USE MODD_IO, ONLY: TFILEDATA +USE MODD_PGDDIM +USE MODD_PGDGRID +USE MODD_PARAMETERS +USE MODD_LUNIT +! +USE MODE_FIELD, ONLY: INI_FIELD_LIST +USE MODE_GRIDPROJ +USE MODE_IO, only: IO_Config_set, IO_Init +use MODE_IO_FIELD_READ, only: IO_Field_read +USE MODE_IO_FILE, only: IO_File_close, IO_File_open +USE MODE_IO_MANAGE_STRUCT, only: IO_File_add2list +use MODE_INIT_ll, only: SET_DIM_ll, SET_JP_ll +USE MODE_MODELN_HANDLER, ONLY: GOTO_MODEL +USE MODE_POS, ONLY: POSNAM +use MODE_SPLITTINGZ_ll +! +USE MODE_INI_CST, ONLY: INI_CST +USE MODI_READ_HGRID +USE MODI_VERSION +! +USE MODN_CONFIO, ONLY: NAM_CONFIO +! +IMPLICIT NONE +! +!* 0.2 Declaration of variables +! ------------------------ +! +CHARACTER(LEN=28) :: YINIFILE ! name of input FM file +CHARACTER(LEN=28) :: YNAME ! true name of input FM file +CHARACTER(LEN=28) :: YDAD ! name of dad of input FM file +CHARACTER(LEN=2) :: YSTORAGE_TYPE +INTEGER :: INAM ! Logical unit for namelist file +INTEGER :: ILUOUT0 ! Logical unit for output file. +INTEGER :: IRESP ! Return-code if problem eraised. +REAL :: ZLAT ! input latitude +REAL :: ZLON ! input longitude +REAL :: ZXHAT ! output conformal coodinate x +REAL :: ZYHAT ! output conformal coodinate y +INTEGER :: II,IJ ! indexes of the point +REAL :: ZI,ZJ ! fractionnal indexes of the point +TYPE(TFILEDATA),POINTER :: TZINIFILE => NULL() +TYPE(TFILEDATA),POINTER :: TZNMLFILE => NULL() +LOGICAL :: GFOUND +! +!* 0.3 Declaration of namelists +! ------------------------ +! +NAMELIST/NAM_INIFILE/ YINIFILE +!---------------------------------------------------------------------------- +! + WRITE(*,*) '+---------------------------------+' + WRITE(*,*) '| program latlon_to_xy |' + WRITE(*,*) '+---------------------------------+' + WRITE(*,*) '' + WRITE(*,*) 'Warning: I and J are integer for flux points' +! +!* 1. Initializations +! --------------- +! +CALL GOTO_MODEL(1) +! +CALL VERSION() +! +CPROGRAM='LAT2XY' +! +CALL IO_Init() +! +CALL INI_CST() +! +CALL INI_FIELD_LIST(1) +! +!* 2. Reading of namelist file +! ------------------------ +! +! +CALL IO_File_add2list(TZNMLFILE,'LATLON2XY1.nam','NML','READ') +CALL IO_File_open(TZNMLFILE) +INAM=TZNMLFILE%NLU +! +CALL POSNAM(INAM,'NAM_INIFILE',GFOUND) +IF (GFOUND) THEN + READ(UNIT=INAM,NML=NAM_INIFILE) + PRINT*, ' namelist NAM_INIFILE read' +END IF +! +CALL POSNAM(INAM,'NAM_CONFIO',GFOUND) +IF (GFOUND) THEN + READ(UNIT=INAM,NML=NAM_CONFIO) + PRINT*, ' namelist NAM_CONFIO read' +END IF +! +CALL IO_Config_set() +CALL IO_File_close(TZNMLFILE) +! +!* 1. Opening of MESONH file +! ---------------------- +! +CALL IO_File_add2list(TZINIFILE,TRIM(YINIFILE),'MNH','READ',KLFITYPE=2,KLFIVERB=2) +CALL IO_File_open(TZINIFILE) +! +CALL IO_Field_read(TZINIFILE,'IMAX', NIMAX) +CALL IO_Field_read(TZINIFILE,'JMAX', NJMAX) +NKMAX = 1 +CALL IO_Field_read(TZINIFILE,'JPHEXT',JPHEXT) +! +CALL SET_JP_ll(1,JPHEXT,JPVEXT,JPHEXT) +CALL SET_DIM_ll(NIMAX, NJMAX, NKMAX) +CALL INI_PARAZ_ll(IRESP) +! +!* 2. Reading of MESONH file +! ---------------------- +! +CALL READ_HGRID(0,TZINIFILE,YNAME,YDAD,YSTORAGE_TYPE) +! +!* 3. Closing of MESONH file +! ---------------------- +! +CALL IO_File_close(TZINIFILE) +! +!------------------------------------------------------------------------------- +! +!* 4. Reading of latitude and longitude +! --------------------------------- +! +DO + WRITE(*,*) '-------------------------------------------------------------------' + WRITE(*,*) 'please enter the latitude (in decimal degrees; quit or q to stop):' + READ(*,*,ERR=1) ZLAT + WRITE(*,*) 'please enter the longitude (in decimal degrees; quit or q to stop):' + READ(*,*,ERR=1) ZLON +! + CALL SM_XYHAT(XPGDLATOR,XPGDLONOR, & + ZLAT,ZLON,ZXHAT,ZYHAT) +! + WRITE(*,*) 'x=', ZXHAT + WRITE(*,*) 'y=', ZYHAT +! + II=MAX(MIN(COUNT(XPGDXHAT(:)<ZXHAT),NPGDIMAX+2*JPHEXT-1),1) + IJ=MAX(MIN(COUNT(XPGDYHAT(:)<ZYHAT),NPGDJMAX+2*JPHEXT-1),1) + ZI=(ZXHAT-XPGDXHAT(II))/(XPGDXHAT(II+1)-XPGDXHAT(II))+REAL(II) + ZJ=(ZYHAT-XPGDYHAT(IJ))/(XPGDYHAT(IJ+1)-XPGDYHAT(IJ))+REAL(IJ) +! + IF ( (ZI>=1.) .AND. (ZI<=NPGDIMAX+2*JPHEXT+1) & + .AND. (ZJ>=1.) .AND. (ZJ<=NPGDJMAX+2*JPHEXT+1) ) THEN + WRITE(*,*) 'I=',ZI + WRITE(*,*) 'J=',ZJ + ELSE + WRITE(*,*) 'point not in the domain' + WRITE(*,*) 'I=',ZI + WRITE(*,*) 'J=',ZJ + END IF +END DO +1 WRITE(*,*) 'good bye' +! +!------------------------------------------------------------------------------- +! +END PROGRAM LATLON_TO_XY diff --git a/src/mesonh/ext/lesn.f90 b/src/mesonh/ext/lesn.f90 new file mode 100644 index 0000000000000000000000000000000000000000..6376d8360e303dc35c72a93820cace8d7ce6ed44 --- /dev/null +++ b/src/mesonh/ext/lesn.f90 @@ -0,0 +1,3580 @@ +!MNH_LIC Copyright 2000-2021 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. +!----------------------------------------------------------------- +! ################# + SUBROUTINE LES_n +! ################# +! +! +!!**** *LES_n* computes the current time-step LES diagnostics for model _n +!! +!! +!! PURPOSE +!! ------- +!! +!! EXTERNAL +!! -------- +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! V. Masson +!! +!! MODIFICATIONS +!! ------------- +!! Original 07/02/00 +!! 01/02/01 (D. Gazen) add module MODD_NSV for NSV variable +!! 06/11/02 (V. Masson) add LES budgets and use of anomalies +!! in LES quantities computations +!! 01/04/03 (V. Masson and F. Couvreux) bug in BL height loop +!! 10/07 (J.Pergaud) Add mass flux diagnostics +!! 06/08 (O.Thouron) Add radiative diagnostics +!! 12/10 (R.Honnert) Add EDKF mass flux in BL height +!! 10/09 (P. Aumond) Add possibility of user maskS +!! 10/14 (C.Lac) Correction on user masks +!! 10/16 (C.Lac) Add ground droplet deposition amount +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +!! 02/2019 (C. Lac) Add rain fraction as a LES diagnostic +!! +!! -------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_CST +USE MODD_CTURB, ONLY : XFTOP_O_FSURF +! +USE MODD_LES +USE MODD_LES_BUDGET +USE MODD_CONF +USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t +USE MODD_LES_n +USE MODD_RADIATIONS_n +USE MODD_GRID_n +USE MODD_REF_n +USE MODD_FIELD_n +USE MODD_CONF_n +USE MODD_PARAM_n +USE MODD_TURB_n +USE MODD_METRICS_n +USE MODD_LUNIT_n, ONLY: TLUOUT +USE MODD_PARAM_n, ONLY: CCLOUD +USE MODD_PRECIP_n, ONLY: XINPRR,XACPRR,XINPRR3D,XEVAP3D,XINPRC,XINDEP +USE MODD_NSV, ONLY : NSV, NSV_CS +USE MODD_PARAM_ICE_n, ONLY: LDEPOSC,LSEDIC +USE MODD_PARAM_C2R2, ONLY: LDEPOC,LSEDC +USE MODD_PARAM_LIMA, ONLY : MSEDC=>LSEDC +! +USE MODI_SHUMAN +USE MODI_GRADIENT_M +USE MODI_GRADIENT_U +USE MODI_GRADIENT_V +USE MODI_GRADIENT_W +USE MODI_LES_VER_INT +USE MODI_SPEC_VER_INT +USE MODI_LES_MEAN_ll +USE MODI_THL_RT_FROM_TH_R +USE MODI_LES_RES_TR +USE MODI_BUDGET_FLAGS +USE MODI_LES_BUDGET_TEND_n +USE MODE_BL_DEPTH_DIAG +! +USE MODE_ll +USE MODE_MODELN_HANDLER +USE MODE_FILL_DIMPHYEX, ONLY: FILL_DIMPHYEX +! +IMPLICIT NONE +! +! +!* 0.1 declarations of arguments +! +! +! 0.2 declaration of local variables +! +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZEXN ! Exner function +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTHL ! liquid potential temperature +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTHV ! virtual potential temperature +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRHO ! air density +! +REAL, DIMENSION(:,:,:), ALLOCATABLE :: CHAMPXY1 !tableau intermediaire +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTEMP ! Temperature +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZEW +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZINDCLD !indice cloud si rc>0 +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZINDCLD2 !indice cloud rc>1E-5 +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZCLDFR_LES! CLDFR on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZICEFR_LES! ICEFR on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRAINFR_LES! RAINFR on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZMASSF ! massflux=rho*w +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZREHU ! relative humidity + + +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZZ_LES ! alt. on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE ::ZZZ_LES +REAL, DIMENSION(:,:,:), ALLOCATABLE ::ZINPRR3D_LES ! precipitation flux 3D +REAL, DIMENSION(:,:,:), ALLOCATABLE ::ZEVAP3D_LES !evaporation 3D +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZP_LES ! pres. on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDP_LES ! dynamical production TKE +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTP_LES ! thermal production TKE +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTR_LES ! transport production TKE +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDISS_LES ! dissipation TKE +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZLM_LES ! mixing length + +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDPDZ_LES ! dp/dz on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDTHLDZ_LES ! dThl/dz on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDTHDZ_LES ! dTh/dz on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDRTDZ_LES ! dRt/dz on LES vertical grid +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZDSvDZ_LES ! dSv/dz on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDUDZ_LES ! du/dz on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDVDZ_LES ! dv/dz on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDWDZ_LES ! dw/dz on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZEXN_LES ! Exner on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRHO_LES ! rho on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZU_LES ! U on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZV_LES ! V on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZW_LES ! W on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZMF_LES ! mass flux on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTH_LES ! Theta on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTHV_LES ! thv on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTHL_LES ! thl on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTKE_LES ! tke on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZKE_LES ! ke on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRV_LES ! Rv on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZREHU_LES ! Rehu on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRC_LES ! Rc on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRR_LES ! Rr on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRI_LES ! Ri on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRS_LES ! Rs on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRG_LES ! Rg on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRH_LES ! Rh on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRT_LES ! Rt on LES vertical grid +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZSV_LES ! Sv on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTH_ANOM ! Theta anomaly on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTHV_ANOM ! thv anomaly on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRV_ANOM ! Rv anomaly on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRC_ANOM ! Rc anomaly on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRI_ANOM ! Ri anomaly on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRR_ANOM ! Rr anomaly on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZP_ANOM ! p anomaly on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRHO_ANOM ! rho anomaly on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDPDZ_ANOM! dp/dz anomaly on LES vertical grid +REAL, DIMENSION(:), ALLOCATABLE :: ZMEAN_DPDZ! dp/dz mean on LES vertical grid +REAL, DIMENSION(:), ALLOCATABLE :: ZLES_MEAN_DRtDZ! drt/dz mean on LES vertical grid +REAL, DIMENSION(:), ALLOCATABLE :: ZLES_MEAN_DTHDZ! dth/dz mean on LES vertical grid +REAL, DIMENSION(:,:), ALLOCATABLE :: ZLES_MEAN_DSVDZ! drt/dz mean on LES vertical grid +REAL, DIMENSION(:,:), ALLOCATABLE :: ZLWP_LES, ZRWP_LES, ZTKET_LES +REAL, DIMENSION(:,:), ALLOCATABLE :: ZIWP_LES, ZSWP_LES, ZGWP_LES, ZHWP_LES +REAL, DIMENSION(:,:), ALLOCATABLE :: ZINDCLD2D ! +REAL, DIMENSION(:,:), ALLOCATABLE :: ZINDCLD2D2 ! +REAL, DIMENSION(:,:), ALLOCATABLE :: ZLWP_ANOM ! lwp anomaly +REAL, DIMENSION(:,:), ALLOCATABLE :: ZMAXWRR2D ! maxwrr2D +! +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZU_SPEC ! U on SPEC vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZV_SPEC ! V on SPEC vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZW_SPEC ! W on SPEC vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTH_SPEC ! Theta on SPEC vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTHL_SPEC ! thl on SPEC vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRV_SPEC ! Rv on SPEC vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRC_SPEC ! Rc on SPEC vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRI_SPEC ! Ri on SPEC vertical grid +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZSV_SPEC ! Sv on SPEC vertical grid +! +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRT ! rv+rc+rr+ri+rs+rg+rh +REAL, DIMENSION(:), ALLOCATABLE :: ZWORK1D,ZWORK1DT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZWORK2D +REAL :: ZINPRRm,ZCOUNT +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRADEFF_LES ! Re on LES vertical grid +!!fl sw, lw, dthrad on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZSWU_LES ! SWU on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZSWD_LES ! SWD on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZLWU_LES ! LWU on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZLWD_LES ! LWD on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDTHRADSW_LES ! DTHRADSW on LES vertical grid +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDTHRADLW_LES ! DTHRADLW on LES vertical grid +! +REAL, DIMENSION(:), ALLOCATABLE :: ZWORK ! +! +INTEGER :: IRR ! moist variables counter +INTEGER :: JSV ! scalar variables counter +INTEGER :: IIU, IJU ! array sizes +INTEGER :: IKE,IKB +INTEGER :: JI, JJ, JK ! loop counters +INTEGER :: IIU_ll, IJU_ll ! total domain I size (fin) +INTEGER :: IIA_ll, IJA_ll ! total domain I size (debut) +INTEGER :: IINFO_ll ! return code of parallel routine +INTEGER :: IIMAX_ll, IJMAX_ll ! total physical domain I size +INTEGER :: JLOOP +! +INTEGER :: IMASK ! mask counter +INTEGER :: IMASKUSER! mask user number +! +INTEGER :: IRESP, ILUOUT +INTEGER :: IMI ! Current model index +TYPE(DIMPHYEX_t) :: YLDIMPHYEX +!------------------------------------------------------------------------------- +! +IMI = GET_CURRENT_MODEL_INDEX() +! +IF (.NOT. LLES_CALL) RETURN +! +CALL GET_GLOBALDIMS_ll(IIMAX_ll,IJMAX_ll) +IIU_ll = IIMAX_ll+JPHEXT +IJU_ll = IJMAX_ll+JPHEXT +IIA_ll=JPHEXT+1 +IJA_ll=JPHEXT+1 +IKE=SIZE(XVT,3)-JPVEXT +IKB=1+JPVEXT +CALL GET_DIM_EXT_ll('B',IIU,IJU) +CALL FILL_DIMPHYEX(YLDIMPHYEX, SIZE(XTHT,1), SIZE(XTHT,2), SIZE(XTHT,3),.TRUE.) +! +ILUOUT = TLUOUT%NLU +! +!------------------------------------------------------------------------------- +! +!* interpolation coefficients for Z type grid +! +IF (CSPECTRA_LEVEL_TYPE=='Z') THEN + IF (ASSOCIATED(XCOEFLIN_CURRENT_SPEC)) CALL LES_DEALLOCATE('XCOEFLIN_CURRENT_SPEC') + IF (ASSOCIATED(NKLIN_CURRENT_SPEC )) CALL LES_DEALLOCATE('NKLIN_CURRENT_SPEC') + ! + CALL LES_ALLOCATE('XCOEFLIN_CURRENT_SPEC',(/IIU,IJU,NSPECTRA_K/)) + CALL LES_ALLOCATE('NKLIN_CURRENT_SPEC',(/IIU,IJU,NSPECTRA_K/)) + ! + XCOEFLIN_CURRENT_SPEC(:,:,:) = XCOEFLIN_SPEC(:,:,:) + NKLIN_CURRENT_SPEC (:,:,:) = NKLIN_SPEC (:,:,:) +END IF +! +!------------------------------------------------------------------------------- +! +!* 1. Allocations +! ----------- +! +ALLOCATE(ZP_LES (IIU,IJU,NLES_K)) +ALLOCATE(ZDP_LES (IIU,IJU,NLES_K)) +ALLOCATE(ZTP_LES (IIU,IJU,NLES_K)) +ALLOCATE(ZTR_LES (IIU,IJU,NLES_K)) +ALLOCATE(ZDISS_LES (IIU,IJU,NLES_K)) +ALLOCATE(ZLM_LES (IIU,IJU,NLES_K)) +ALLOCATE(ZDTHLDZ_LES(IIU,IJU,NLES_K)) +ALLOCATE(ZDTHDZ_LES(IIU,IJU,NLES_K)) +ALLOCATE(ZDRTDZ_LES(IIU,IJU,NLES_K)) +ALLOCATE(ZDUDZ_LES(IIU,IJU,NLES_K)) +ALLOCATE(ZDVDZ_LES(IIU,IJU,NLES_K)) +ALLOCATE(ZDWDZ_LES(IIU,IJU,NLES_K)) +ALLOCATE(ZDSVDZ_LES(IIU,IJU,NLES_K,NSV)) + +ALLOCATE(ZDPDZ_LES(IIU,IJU,NLES_K)) +ALLOCATE(ZEXN_LES (IIU,IJU,NLES_K)) +ALLOCATE(ZRHO_LES (IIU,IJU,NLES_K)) +ALLOCATE(ZU_LES (IIU,IJU,NLES_K)) +ALLOCATE(ZV_LES (IIU,IJU,NLES_K)) +ALLOCATE(ZW_LES (IIU,IJU,NLES_K)) +ALLOCATE(ZMF_LES (IIU,IJU,NLES_K)) +ALLOCATE(ZTH_LES (IIU,IJU,NLES_K)) +IF (CRAD /= 'NONE') THEN + ALLOCATE(ZRADEFF_LES (IIU,IJU,NLES_K)) + ALLOCATE(ZSWU_LES (IIU,IJU,NLES_K)) + ALLOCATE(ZSWD_LES (IIU,IJU,NLES_K)) + ALLOCATE(ZLWU_LES (IIU,IJU,NLES_K)) + ALLOCATE(ZLWD_LES (IIU,IJU,NLES_K)) + ALLOCATE(ZDTHRADSW_LES (IIU,IJU,NLES_K)) + ALLOCATE(ZDTHRADLW_LES (IIU,IJU,NLES_K)) +ELSE + ALLOCATE(ZRADEFF_LES (0,0,0)) + ALLOCATE(ZSWU_LES (0,0,0)) + ALLOCATE(ZSWD_LES (0,0,0)) + ALLOCATE(ZLWU_LES (0,0,0)) + ALLOCATE(ZLWD_LES (0,0,0)) + ALLOCATE(ZDTHRADSW_LES (0,0,0)) + ALLOCATE(ZDTHRADLW_LES (0,0,0)) +END IF +IF (LUSERV) THEN + ALLOCATE(ZTHV_LES (IIU,IJU,NLES_K)) +ELSE + ALLOCATE(ZTHV_LES (0,0,0)) +END IF +ALLOCATE(ZTHL_LES (IIU,IJU,NLES_K)) +ALLOCATE(ZTKE_LES (IIU,IJU,NLES_K)) +ALLOCATE(ZKE_LES(IIU,IJU,NLES_K)) +ALLOCATE(ZTKET_LES(IIU,IJU)) +ALLOCATE(ZWORK1D (NLES_K)) +ALLOCATE(ZWORK1DT (NLES_K)) +ALLOCATE(ZZZ_LES(IIU,IJU,NLES_K)) +IF (LUSERV) THEN + ALLOCATE(ZRV_LES (IIU,IJU,NLES_K)) + ALLOCATE(ZRT_LES (IIU,IJU,NLES_K)) + ALLOCATE(ZREHU_LES (IIU,IJU,NLES_K)) +ELSE + ALLOCATE(ZRV_LES (0,0,0)) + ALLOCATE(ZRT_LES (0,0,0)) + ALLOCATE(ZREHU_LES (0,0,0)) +END IF +IF (LUSERC) THEN + ALLOCATE(ZRC_LES (IIU,IJU,NLES_K)) + ALLOCATE(ZLWP_LES(IIU,IJU)) + ALLOCATE(ZINDCLD2D(IIU,IJU)) + ALLOCATE(ZINDCLD2D2(IIU,IJU)) + ALLOCATE(ZCLDFR_LES(IIU,IJU,NLES_K)) + ALLOCATE(ZWORK2D(IIU,IJU)) + ALLOCATE(ZLWP_ANOM(IIU,IJU)) +ELSE + ALLOCATE(ZRC_LES (0,0,0)) + ALLOCATE(ZLWP_LES(0,0)) + ALLOCATE(ZINDCLD2D(0,0)) + ALLOCATE(ZINDCLD2D2(0,0)) + ALLOCATE(ZCLDFR_LES(0,0,0)) + ALLOCATE(ZWORK2D(0,0)) + ALLOCATE(ZLWP_ANOM(0,0)) +END IF +IF (LUSERR) THEN + ALLOCATE(ZRR_LES (IIU,IJU,NLES_K)) + ALLOCATE(ZMAXWRR2D(IIU,IJU)) + ALLOCATE(ZRWP_LES(IIU,IJU)) + ALLOCATE(ZINPRR3D_LES (IIU,IJU,NLES_K)) + ALLOCATE(ZEVAP3D_LES (IIU,IJU,NLES_K)) + ALLOCATE(ZRAINFR_LES(IIU,IJU,NLES_K)) +ELSE + ALLOCATE(ZRR_LES (0,0,0)) + ALLOCATE(ZMAXWRR2D(0,0)) + ALLOCATE(ZRWP_LES(0,0)) + ALLOCATE(ZINPRR3D_LES(0,0,0)) + ALLOCATE(ZEVAP3D_LES(0,0,0)) + ALLOCATE(ZRAINFR_LES(0,0,0)) +END IF +IF (LUSERI) THEN + ALLOCATE(ZRI_LES (IIU,IJU,NLES_K)) + ALLOCATE(ZIWP_LES(IIU,IJU)) + ALLOCATE(ZICEFR_LES(IIU,IJU,NLES_K)) +ELSE + ALLOCATE(ZRI_LES (0,0,0)) + ALLOCATE(ZIWP_LES(0,0)) + ALLOCATE(ZICEFR_LES(0,0,0)) +END IF +IF (LUSERS) THEN + ALLOCATE(ZRS_LES (IIU,IJU,NLES_K)) + ALLOCATE(ZSWP_LES(IIU,IJU)) +ELSE + ALLOCATE(ZRS_LES (0,0,0)) + ALLOCATE(ZSWP_LES(0,0)) +END IF +IF (LUSERG) THEN + ALLOCATE(ZRG_LES (IIU,IJU,NLES_K)) + ALLOCATE(ZGWP_LES(IIU,IJU)) +ELSE + ALLOCATE(ZRG_LES (0,0,0)) + ALLOCATE(ZGWP_LES(0,0)) +END IF +IF (LUSERH) THEN + ALLOCATE(ZRH_LES (IIU,IJU,NLES_K)) + ALLOCATE(ZHWP_LES(IIU,IJU)) +ELSE + ALLOCATE(ZRH_LES (0,0,0)) + ALLOCATE(ZHWP_LES(0,0)) +END IF +IF (NSV>0) THEN + ALLOCATE(ZSV_LES (IIU,IJU,NLES_K,NSV)) +ELSE + ALLOCATE(ZSV_LES (0,0,0,0)) +END IF +! +ALLOCATE(ZP_ANOM (IIU,IJU,NLES_K)) +ALLOCATE(ZRHO_ANOM (IIU,IJU,NLES_K)) +ALLOCATE(ZTH_ANOM (IIU,IJU,NLES_K)) +ALLOCATE(ZDPDZ_ANOM(IIU,IJU,NLES_K)) +IF (LUSERV) THEN + ALLOCATE(ZTHV_ANOM(IIU,IJU,NLES_K)) + ALLOCATE(ZRV_ANOM (IIU,IJU,NLES_K)) +ELSE + ALLOCATE(ZTHV_ANOM(0,0,0)) + ALLOCATE(ZRV_ANOM (0,0,0)) +END IF +IF (LUSERC) THEN + ALLOCATE(ZRC_ANOM (IIU,IJU,NLES_K)) +ELSE + ALLOCATE(ZRC_ANOM (0,0,0)) +END IF +IF (LUSERI) THEN + ALLOCATE(ZRI_ANOM (IIU,IJU,NLES_K)) +ELSE + ALLOCATE(ZRI_ANOM (0,0,0)) +END IF +IF (LUSERR) THEN + ALLOCATE(ZRR_ANOM (IIU,IJU,NLES_K)) +ELSE + ALLOCATE(ZRR_ANOM (0,0,0)) +END IF +ALLOCATE(ZMEAN_DPDZ(NLES_K)) +ALLOCATE(ZLES_MEAN_DTHDZ(NLES_K)) +! +! +ALLOCATE(ZU_SPEC (NSPECTRA_NI,NSPECTRA_NJ,NSPECTRA_K)) +ALLOCATE(ZV_SPEC (NSPECTRA_NI,NSPECTRA_NJ,NSPECTRA_K)) +ALLOCATE(ZW_SPEC (NSPECTRA_NI,NSPECTRA_NJ,NSPECTRA_K)) +ALLOCATE(ZTH_SPEC (NSPECTRA_NI,NSPECTRA_NJ,NSPECTRA_K)) +IF (LUSERC) THEN + ALLOCATE(ZTHL_SPEC(NSPECTRA_NI,NSPECTRA_NJ,NSPECTRA_K)) +ELSE + ALLOCATE(ZTHL_SPEC(0,0,0)) +END IF +IF (LUSERV) THEN + ALLOCATE(ZRV_SPEC (NSPECTRA_NI,NSPECTRA_NJ,NSPECTRA_K)) +ELSE + ALLOCATE(ZRV_SPEC (0,0,0)) +END IF +IF (LUSERC) THEN + ALLOCATE(ZRC_SPEC (NSPECTRA_NI,NSPECTRA_NJ,NSPECTRA_K)) +ELSE + ALLOCATE(ZRC_SPEC (0,0,0)) +END IF +IF (LUSERI) THEN + ALLOCATE(ZRI_SPEC (NSPECTRA_NI,NSPECTRA_NJ,NSPECTRA_K)) +ELSE + ALLOCATE(ZRI_SPEC (0,0,0)) +END IF +IF (NSV>0) THEN + ALLOCATE(ZSV_SPEC (NSPECTRA_NI,NSPECTRA_NJ,NSPECTRA_K,NSV)) +ELSE + ALLOCATE(ZSV_SPEC (0,0,0,0)) +END IF +! +! +ALLOCATE(ZEXN (IIU,IJU,SIZE(XTHT,3))) +ALLOCATE(ZRHO (IIU,IJU,SIZE(XTHT,3))) +ALLOCATE(ZRT (IIU,IJU,SIZE(XTHT,3))) +ALLOCATE(ZTHV (IIU,IJU,SIZE(XTHT,3))) +ALLOCATE(ZTHL (IIU,IJU,SIZE(XTHT,3))) +ALLOCATE(ZEW (IIU,IJU,SIZE(XTHT,3))) +ALLOCATE(ZMASSF (IIU,IJU,SIZE(XTHT,3))) +ALLOCATE(ZTEMP (IIU,IJU,SIZE(XTHT,3))) +ALLOCATE(ZREHU (IIU,IJU,SIZE(XTHT,3))) +ALLOCATE(CHAMPXY1 (IIU,IJU,1)) +! +!------------------------------------------------------------------------------- +! +!* 1.2 preliminary calculations +! ------------------------ +! +ZEXN(:,:,:) = (XPABST/XP00)**(XRD/XCPD) +! +! +!* computation of relative humidity +ZTEMP=XTHT*ZEXN +ZEW=EXP (XALPW -XBETAW/ZTEMP-XGAMW*ALOG(ZTEMP)) +IF (LUSERV) THEN + ZREHU(:,:,:)=100.*XRT(:,:,:,1)*XPABST(:,:,:)/((XRD/XRV+XRT(:,:,:,1))*ZEW(:,:,:)) +ELSE + ZREHU(:,:,:)=0. +END IF +! +CALL THL_RT_FROM_TH_R(LUSERV, LUSERC, LUSERR, & + LUSERI, LUSERS, LUSERG, LUSERH, & + XCURRENT_L_O_EXN_CP, & + XTHT, XRT, & + ZTHL, ZRT ) +! +!* computation of density and virtual potential temperature +! +ZTHV=XTHT +IF (LUSERV) ZTHV=ZTHV*(1.+XRV/XRD*XRT(:,:,:,1))/(1.+ZRT(:,:,:)) +! +IF (CEQNSYS=='DUR') THEN + ZRHO=XPABST/(XRD*ZTHV*ZEXN) +ELSE + ZRHO=XRHODREF*( 1. + (XCPD-XRD)/XRD*(ZEXN/XEXNREF - 1.) - (ZTHV/XTHVREF - 1.) ) +END IF +! +! computation of mass flux +ZMASSF=MZM(ZRHO)*XWT +! +!------------------------------------------------------------------------------- +! +!* 2. Vertical interpolations to LES vertical grid +! -------------------------------------------- +! +!* note that velocity fields are first localized on the MASS points +! +! +IF (CRAD /= 'NONE') THEN + CALL LES_VER_INT( XRADEFF, ZRADEFF_LES) + CALL LES_VER_INT( XSWU, ZSWU_LES) + CALL LES_VER_INT( XSWD, ZSWD_LES) + CALL LES_VER_INT( XLWU, ZLWU_LES) + CALL LES_VER_INT( XLWD, ZLWD_LES) + CALL LES_VER_INT( XDTHRADSW, ZDTHRADSW_LES) + CALL LES_VER_INT( XDTHRADLW, ZDTHRADLW_LES) +END IF +! +CALL LES_VER_INT( XZZ , ZZZ_LES) +CALL LES_VER_INT( XPABST, ZP_LES ) +CALL LES_VER_INT( XDYP, ZDP_LES ) +CALL LES_VER_INT( XTHP, ZTP_LES ) +CALL LES_VER_INT( XTR, ZTR_LES ) +CALL LES_VER_INT( XDISS, ZDISS_LES ) +CALL LES_VER_INT( XLEM, ZLM_LES ) +CALL LES_VER_INT( GZ_M_M(XPABST,XDZZ), ZDPDZ_LES ) +! +CALL LES_VER_INT( MXF(XUT) ,ZU_LES ) +CALL LES_VER_INT( MYF(XVT) ,ZV_LES ) +CALL LES_VER_INT( MZF(XWT) ,ZW_LES ) +CALL LES_VER_INT( MZF(ZMASSF) ,ZMF_LES) +CALL LES_VER_INT( XTHT ,ZTH_LES ) +CALL LES_VER_INT( MXF(MZF(GZ_U_UW(XUT,XDZZ))), ZDUDZ_LES ) +CALL LES_VER_INT( MYF(MZF(GZ_V_VW(XVT,XDZZ))), ZDVDZ_LES ) +CALL LES_VER_INT( GZ_W_M(XWT,XDZZ), ZDWDZ_LES ) +CALL LES_VER_INT( ZEXN, ZEXN_LES) +! +CALL LES_VER_INT( GZ_M_M(XTHT,XDZZ), ZDTHDZ_LES ) +! +CALL LES_VER_INT(ZRHO, ZRHO_LES) +! +IF (LUSERV) CALL LES_VER_INT(ZTHV, ZTHV_LES) +CALL LES_VER_INT(ZTHL, ZTHL_LES) +CALL LES_VER_INT( GZ_M_M(ZTHL,XDZZ), ZDTHLDZ_LES ) +! +CALL LES_VER_INT( XTKET ,ZTKE_LES) +IRR = 0 +IF (LUSERV) THEN + IRR = IRR + 1 + CALL LES_VER_INT( XRT(:,:,:,IRR) ,ZRV_LES ) + CALL LES_VER_INT( ZRT(:,:,:) ,ZRT_LES ) + CALL LES_VER_INT( GZ_M_M(ZRT,XDZZ), ZDRTDZ_LES ) + CALL LES_VER_INT( ZREHU(:,:,:) ,ZREHU_LES) +END IF +IF (LUSERC) THEN + IRR = IRR + 1 + CALL LES_VER_INT( XRT(:,:,:,IRR) ,ZRC_LES ) + ALLOCATE(ZINDCLD (IIU,IJU,NLES_K)) + ALLOCATE(ZINDCLD2(IIU,IJU,NLES_K)) + ZINDCLD = CEILING(ZRC_LES-1.E-6) + ZINDCLD2 = CEILING(ZRC_LES-1.E-5) + CALL LES_VER_INT( XCLDFR(:,:,:) ,ZCLDFR_LES ) +ELSE + ALLOCATE(ZINDCLD (0,0,0)) + ALLOCATE(ZINDCLD2(0,0,0)) +END IF +IF (LUSERR) THEN + IRR = IRR + 1 + CALL LES_VER_INT( XRT(:,:,:,IRR) ,ZRR_LES ) + CALL LES_VER_INT( XINPRR3D(:,:,:), ZINPRR3D_LES) + CALL LES_VER_INT( XEVAP3D(:,:,:), ZEVAP3D_LES) + CALL LES_VER_INT( XRAINFR(:,:,:) ,ZRAINFR_LES ) +END IF +IF (LUSERC) THEN + DO JJ=1,IJU + DO JI=1,IIU + ZINDCLD2D(JI,JJ) = maxval(ZINDCLD(JI,JJ,:)) + ZINDCLD2D2(JI,JJ)= maxval(ZINDCLD2(JI,JJ,:)) + END DO + END DO + !* integration of rho rc + !!!ZLWP_LES only for cloud water + ZLWP_LES(:,:) = 0. + DO JK=1,NLES_K-1 + ZLWP_LES(:,:) = ZLWP_LES(:,:) + (ZZZ_LES(:,:,JK+1)-ZZZ_LES(:,:,JK)) & + * (ZRC_LES(:,:,JK)) * ZRHO_LES(:,:,JK) + END DO + CALL LES_MEAN_ll ( ZLWP_LES, LLES_CURRENT_CART_MASK(:,:,1), & + XLES_LWP(NLES_CURRENT_TCOUNT) ) +! +END IF + + !!!ZRWP_LES only for rain water +IF (LUSERR) THEN + ZRWP_LES(:,:)=0. + DO JK=1,NLES_K-1 + ZRWP_LES(:,:) = ZRWP_LES(:,:) + (ZZZ_LES(:,:,JK+1)-ZZZ_LES(:,:,JK)) & + * (ZRR_LES(:,:,JK)) * ZRHO_LES(:,:,JK) + END DO + CALL LES_MEAN_ll ( ZRWP_LES, LLES_CURRENT_CART_MASK(:,:,1), & + XLES_RWP(NLES_CURRENT_TCOUNT) ) +ENDIF +! +IF (LUSERI) THEN + IRR = IRR + 1 + CALL LES_VER_INT( XRT(:,:,:,IRR) ,ZRI_LES ) + ZIWP_LES(:,:)=0. + DO JK=1,NLES_K-1 + ZIWP_LES(:,:) = ZIWP_LES(:,:) + (ZZZ_LES(:,:,JK+1)-ZZZ_LES(:,:,JK)) & + * (ZRI_LES(:,:,JK)) * ZRHO_LES(:,:,JK) + END DO + CALL LES_MEAN_ll ( ZIWP_LES, LLES_CURRENT_CART_MASK(:,:,1), & + XLES_IWP(NLES_CURRENT_TCOUNT) ) + CALL LES_VER_INT( XICEFR(:,:,:) ,ZICEFR_LES ) +END IF +IF (LUSERS) THEN + IRR = IRR + 1 + CALL LES_VER_INT( XRT(:,:,:,IRR) ,ZRS_LES ) + ZSWP_LES(:,:)=0. + DO JK=1,NLES_K-1 + ZSWP_LES(:,:) = ZSWP_LES(:,:) + (ZZZ_LES(:,:,JK+1)-ZZZ_LES(:,:,JK)) & + * (ZRS_LES(:,:,JK)) * ZRHO_LES(:,:,JK) + END DO + CALL LES_MEAN_ll ( ZSWP_LES, LLES_CURRENT_CART_MASK(:,:,1), & + XLES_SWP(NLES_CURRENT_TCOUNT) ) +END IF +IF (LUSERG) THEN + IRR = IRR + 1 + CALL LES_VER_INT( XRT(:,:,:,IRR) ,ZRG_LES ) + ZGWP_LES(:,:)=0. + DO JK=1,NLES_K-1 + ZGWP_LES(:,:) = ZGWP_LES(:,:) + (ZZZ_LES(:,:,JK+1)-ZZZ_LES(:,:,JK)) & + * (ZRG_LES(:,:,JK)) * ZRHO_LES(:,:,JK) + END DO + CALL LES_MEAN_ll ( ZGWP_LES, LLES_CURRENT_CART_MASK(:,:,1), & + XLES_GWP(NLES_CURRENT_TCOUNT) ) +END IF +IF (LUSERH) THEN + IRR = IRR + 1 + CALL LES_VER_INT( XRT(:,:,:,IRR) ,ZRH_LES ) + ZHWP_LES(:,:)=0. + DO JK=1,NLES_K-1 + ZHWP_LES(:,:) = ZHWP_LES(:,:) + (ZZZ_LES(:,:,JK+1)-ZZZ_LES(:,:,JK)) & + * (ZRH_LES(:,:,JK)) * ZRHO_LES(:,:,JK) + END DO + CALL LES_MEAN_ll ( ZHWP_LES, LLES_CURRENT_CART_MASK(:,:,1), & + XLES_HWP(NLES_CURRENT_TCOUNT) ) +END IF +IF (NSV>0) THEN + DO JSV=1,NSV + CALL LES_VER_INT( XSVT(:,:,:,JSV), ZSV_LES(:,:,:,JSV) ) + CALL LES_VER_INT( GZ_M_M(XSVT(:,:,:,JSV),XDZZ), ZDSVDZ_LES(:,:,:,JSV) ) + END DO +END IF +! +!*mean sw and lw fluxes + CALL LES_MEAN_ll ( ZSWU_LES, LLES_CURRENT_CART_MASK, & + XLES_SWU(:,NLES_CURRENT_TCOUNT) ) + CALL LES_MEAN_ll ( ZSWD_LES, LLES_CURRENT_CART_MASK, & + XLES_SWD(:,NLES_CURRENT_TCOUNT) ) + CALL LES_MEAN_ll ( ZLWU_LES, LLES_CURRENT_CART_MASK, & + XLES_LWU(:,NLES_CURRENT_TCOUNT) ) + CALL LES_MEAN_ll ( ZLWD_LES, LLES_CURRENT_CART_MASK, & + XLES_LWD(:,NLES_CURRENT_TCOUNT) ) + CALL LES_MEAN_ll ( ZDTHRADSW_LES, LLES_CURRENT_CART_MASK, & + XLES_DTHRADSW(:,NLES_CURRENT_TCOUNT) ) + CALL LES_MEAN_ll ( ZDTHRADLW_LES, LLES_CURRENT_CART_MASK, & + XLES_DTHRADLW(:,NLES_CURRENT_TCOUNT) ) + CALL LES_MEAN_ll ( ZRADEFF_LES, LLES_CURRENT_CART_MASK, & + XLES_RADEFF(:,NLES_CURRENT_TCOUNT) ) +!* mean vertical profiles on the LES grid +! + CALL LES_MEAN_ll ( ZU_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_U(:,NLES_CURRENT_TCOUNT,1) ) +! + CALL LES_MEAN_ll ( ZV_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_V(:,NLES_CURRENT_TCOUNT,1) ) +! + CALL LES_MEAN_ll ( ZW_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_W(:,NLES_CURRENT_TCOUNT,1) ) +! + CALL LES_MEAN_ll ( ZP_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_P(:,NLES_CURRENT_TCOUNT,1) ) +! + CALL LES_MEAN_ll ( ZDP_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_DP(:,NLES_CURRENT_TCOUNT,1) ) +! + CALL LES_MEAN_ll ( ZTP_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_TP(:,NLES_CURRENT_TCOUNT,1) ) +! + CALL LES_MEAN_ll ( ZTR_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_TR(:,NLES_CURRENT_TCOUNT,1) ) +! + CALL LES_MEAN_ll ( ZDISS_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_DISS(:,NLES_CURRENT_TCOUNT,1) ) +! + CALL LES_MEAN_ll ( ZLM_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_LM(:,NLES_CURRENT_TCOUNT,1) ) +! + CALL LES_MEAN_ll ( ZRHO_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_RHO(:,NLES_CURRENT_TCOUNT,1) ) +! + CALL LES_MEAN_ll ( ZMF_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_Mf(:,NLES_CURRENT_TCOUNT,1) ) +! + CALL LES_MEAN_ll ( ZTH_LES*ZEXN_LES, LLES_CURRENT_CART_MASK, & + ZWORK1DT(:) ) +! +!computation of es + ZWORK1D(:)=EXP(XALPW - & + XBETAW/ZWORK1DT(:) & + -XGAMW*ALOG(ZWORK1DT(:))) +!computation of qs + + IF (LUSERV) & + XLES_MEAN_Qs(:,NLES_CURRENT_TCOUNT,1)=XRD/XRV*ZWORK1D(:)/ & + (XLES_MEAN_P(:,NLES_CURRENT_TCOUNT,1)-ZWORK1D(:)*(1-XRD/XRV)) +! qs is determined from the temperature average over the current_mask +! + CALL LES_MEAN_ll ( ZTH_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_Th(:,NLES_CURRENT_TCOUNT,1) ) +! + IF (LUSERV) & + CALL LES_MEAN_ll ( ZTHV_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_Thv(:,NLES_CURRENT_TCOUNT,1) ) +! + IF (LUSERC) & + CALL LES_MEAN_ll ( ZTHL_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_Thl(:,NLES_CURRENT_TCOUNT,1) ) +! + IF (LUSERC) & + CALL LES_MEAN_ll ( ZRT_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_Rt(:,NLES_CURRENT_TCOUNT,1) ) +! + IF (LUSERV) & + CALL LES_MEAN_ll ( ZRV_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_Rv(:,NLES_CURRENT_TCOUNT,1) ) +! + IF (LUSERV) & + CALL LES_MEAN_ll ( ZREHU_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_Rehu(:,NLES_CURRENT_TCOUNT,1) ) +! + IF (LUSERC) & + CALL LES_MEAN_ll ( ZRC_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_Rc(:,NLES_CURRENT_TCOUNT,1) ) +! + IF (LUSERC) THEN + CALL LES_MEAN_ll ( ZINDCLD, LLES_CURRENT_CART_MASK, & + XLES_MEAN_INDCf(:,NLES_CURRENT_TCOUNT,1) ) + CALL LES_MEAN_ll ( ZINDCLD2, LLES_CURRENT_CART_MASK, & + XLES_MEAN_INDCf2(:,NLES_CURRENT_TCOUNT,1) ) + CALL LES_MEAN_ll ( ZCLDFR_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_Cf(:,NLES_CURRENT_TCOUNT,1) ) +! +!* cf total + CALL LES_MEAN_ll( ZINDCLD2D, LLES_CURRENT_CART_MASK(:,:,1) , & + XLES_CFtot(NLES_CURRENT_TCOUNT) ) + CALL LES_MEAN_ll( ZINDCLD2D2, LLES_CURRENT_CART_MASK(:,:,1), & + XLES_CF2tot(NLES_CURRENT_TCOUNT) ) + ENDIF +! + IF (LUSERR) THEN + + CALL LES_MEAN_ll ( XINPRR, LLES_CURRENT_CART_MASK(:,:,1), & + XLES_INPRR(NLES_CURRENT_TCOUNT) ) + ZINPRRm=0. + ZCOUNT=0. + ZINDCLD2D(:,:)=0. + DO JJ=1,IJU + DO JI=1,IIU + IF (ZRR_LES(JI,JJ,1) .GT. 1.E-6) ZINPRRm = ZINPRRm+XINPRR(JI,JJ) + IF (ZRR_LES(JI,JJ,1) .GT. 1.E-6) ZINDCLD2D(JI,JJ)=1. + IF (ZRR_LES(JI,JJ,1) .GT. 1.E-6) ZCOUNT=ZCOUNT+1. + END DO + END DO + IF (ZCOUNT .GE. 1) ZINPRRm=ZINPRRm/ZCOUNT + XLES_RAIN_INPRR(NLES_CURRENT_TCOUNT)=ZINPRRm + CALL LES_MEAN_ll ( ZINDCLD2D, LLES_CURRENT_CART_MASK(:,:,1), & + XLES_PRECFR(NLES_CURRENT_TCOUNT) ) + CALL LES_MEAN_ll ( ZINPRR3D_LES, LLES_CURRENT_CART_MASK, & + XLES_INPRR3D(:,NLES_CURRENT_TCOUNT,1) ) + CALL LES_MEAN_ll ( ZEVAP3D_LES, LLES_CURRENT_CART_MASK, & + XLES_EVAP3D(:,NLES_CURRENT_TCOUNT,1) ) + DO JK=1,NLES_K + CHAMPXY1(:,:,1)=ZINPRR3D_LES(:,:,JK) + XLES_MAX_INPRR3D(JK,NLES_CURRENT_TCOUNT,1)=MAX_ll (CHAMPXY1,IINFO_ll, & + IIA_ll,IJA_ll,1,IIU_ll,IJU_ll,1) + END DO +! + +! conversion de m/s en mm/day + XLES_RAIN_INPRR(NLES_CURRENT_TCOUNT)=XLES_RAIN_INPRR(NLES_CURRENT_TCOUNT)*3.6E6*24. + XLES_INPRR(NLES_CURRENT_TCOUNT)=XLES_INPRR(NLES_CURRENT_TCOUNT)*3.6E6*24. + + CALL LES_MEAN_ll ( XACPRR, LLES_CURRENT_CART_MASK(:,:,1), & + XLES_ACPRR(NLES_CURRENT_TCOUNT) ) +! conversion de m en mm + XLES_ACPRR(NLES_CURRENT_TCOUNT)=XLES_ACPRR(NLES_CURRENT_TCOUNT)*1000. + CALL LES_MEAN_ll ( ZRAINFR_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_RF(:,NLES_CURRENT_TCOUNT,1) ) + + ENDIF +! + IF (LUSERC ) THEN + IF (( CCLOUD(1:3) == 'ICE' .AND.LSEDIC) .OR. & + ((CCLOUD=='C2R2' .OR. CCLOUD=='C3R5' .OR. CCLOUD=='KHKO').AND.LSEDC) .OR. & + ( CCLOUD=='LIMA' .AND.MSEDC)) THEN + CALL LES_MEAN_ll ( XINPRC, LLES_CURRENT_CART_MASK(:,:,1), & + XLES_INPRC(NLES_CURRENT_TCOUNT) ) +! conversion from m/s to mm/day + XLES_INPRC(NLES_CURRENT_TCOUNT)=XLES_INPRC(NLES_CURRENT_TCOUNT)*3.6E6*24. + ENDIF + IF ( (((CCLOUD == 'KHKO') .OR.(CCLOUD == 'C2R2')) .AND. LDEPOC) & + .OR. ( (CCLOUD(1:3) == 'ICE') .AND. LDEPOSC) ) THEN + CALL LES_MEAN_ll ( XINDEP, LLES_CURRENT_CART_MASK(:,:,1), & + XLES_INDEP(NLES_CURRENT_TCOUNT) ) +! conversion from m/s to mm/day + XLES_INDEP(NLES_CURRENT_TCOUNT)=XLES_INDEP(NLES_CURRENT_TCOUNT)*3.6E6*24. + ENDIF + ENDIF +! + IF (LUSERR) & + CALL LES_MEAN_ll ( ZRR_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_Rr(:,NLES_CURRENT_TCOUNT,1) ) +! + IF (LUSERI) & + CALL LES_MEAN_ll ( ZRI_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_Ri(:,NLES_CURRENT_TCOUNT,1) ) + CALL LES_MEAN_ll ( ZICEFR_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_If(:,NLES_CURRENT_TCOUNT,1) ) +! + IF (LUSERS) & + CALL LES_MEAN_ll ( ZRS_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_Rs(:,NLES_CURRENT_TCOUNT,1) ) +! + IF (LUSERG) & + CALL LES_MEAN_ll ( ZRG_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_Rg(:,NLES_CURRENT_TCOUNT,1) ) +! + IF (LUSERH) & + CALL LES_MEAN_ll ( ZRH_LES, LLES_CURRENT_CART_MASK, & + XLES_MEAN_Rh(:,NLES_CURRENT_TCOUNT,1) ) +! + DO JSV=1,NSV + CALL LES_MEAN_ll ( ZSV_LES(:,:,:,JSV), LLES_CURRENT_CART_MASK, & + XLES_MEAN_Sv(:,NLES_CURRENT_TCOUNT,1,JSV) ) + END DO +! + CALL LES_MEAN_ll ( ZDPDZ_LES, LLES_CURRENT_CART_MASK, & + ZMEAN_DPDZ(:) ) + CALL LES_MEAN_ll ( ZDTHDZ_LES, LLES_CURRENT_CART_MASK, & + ZLES_MEAN_DTHDZ(:) ) + +! +!* build the 3D resolved turbulent fields by removing the mean field +! +DO JJ=1,IJU + DO JI=1,IIU + ZP_ANOM(JI,JJ,:) = ZP_LES(JI,JJ,:) - XLES_MEAN_P(:,NLES_CURRENT_TCOUNT,1) + ZDPDZ_ANOM(JI,JJ,:) = ZDPDZ_LES(JI,JJ,:) - ZMEAN_DPDZ(:) + ZTH_ANOM(JI,JJ,:) = ZTH_LES(JI,JJ,:) - XLES_MEAN_Th(:,NLES_CURRENT_TCOUNT,1) + ZRHO_ANOM(JI,JJ,:) = ZRHO_LES(JI,JJ,:) - XLES_MEAN_Rho(:,NLES_CURRENT_TCOUNT,1) + IF (LUSERV) THEN + ZTHV_ANOM(JI,JJ,:) = ZTHV_LES(JI,JJ,:) - XLES_MEAN_Thv(:,NLES_CURRENT_TCOUNT,1) + ZRV_ANOM(JI,JJ,:) = ZRV_LES(JI,JJ,:) - XLES_MEAN_Rv(:,NLES_CURRENT_TCOUNT,1) + END IF + IF (LUSERC) THEN + ZRC_ANOM(JI,JJ,:) = ZRC_LES(JI,JJ,:) - XLES_MEAN_Rc(:,NLES_CURRENT_TCOUNT,1) + ZLWP_ANOM(JI,JJ) =ZLWP_LES(JI,JJ)-XLES_LWP(NLES_CURRENT_TCOUNT) + END IF + IF (LUSERI) THEN + ZRI_ANOM(JI,JJ,:) = ZRI_LES(JI,JJ,:) - XLES_MEAN_Ri(:,NLES_CURRENT_TCOUNT,1) + END IF + IF (LUSERR) THEN + ZRR_ANOM(JI,JJ,:) = ZRR_LES(JI,JJ,:) - XLES_MEAN_Rr(:,NLES_CURRENT_TCOUNT,1) + END IF + END DO +END DO +! +! +!-------------------------------------------------------------------------------- +! +!* vertical grid computed at first LES call for this model +! +IF (NLES_CURRENT_TCOUNT==1) THEN + ALLOCATE(ZZ_LES (IIU,IJU,NLES_K)) + CALL LES_VER_INT( MZF(XZZ) ,ZZ_LES ) + CALL LES_MEAN_ll ( ZZ_LES, LLES_CURRENT_CART_MASK, XLES_Z ) + DEALLOCATE(ZZ_LES) + CALL LES_MEAN_ll ( XZS, LLES_CURRENT_CART_MASK(:,:,1), XLES_ZS ) +END IF +! +!------------------------------------------------------------------------------- +! +!* 3. Vertical interpolations to SECTRA computations vertical grid +! ------------------------------------------------------------ +! +!* note that velocity fields are previously localized on the MASS points +! +CALL SPEC_VER_INT(IMI, MXF(XUT) ,ZU_SPEC ) +CALL SPEC_VER_INT(IMI, MYF(XVT) ,ZV_SPEC ) +CALL SPEC_VER_INT(IMI, MZF(XWT) ,ZW_SPEC ) +CALL SPEC_VER_INT(IMI, XTHT ,ZTH_SPEC ) +IF (LUSERC) CALL SPEC_VER_INT(IMI, ZTHL ,ZTHL_SPEC) +IRR = 0 +IF (LUSERV) THEN + IRR = IRR + 1 + CALL SPEC_VER_INT(IMI, XRT(:,:,:,IRR) ,ZRV_SPEC ) +END IF +IF (LUSERC) THEN + IRR = IRR + 1 + CALL SPEC_VER_INT(IMI, XRT(:,:,:,IRR) ,ZRC_SPEC ) +END IF +IF (LUSERR) THEN + IRR = IRR + 1 +END IF +IF (LUSERI) THEN + IRR = IRR + 1 + CALL SPEC_VER_INT(IMI, XRT(:,:,:,IRR) ,ZRI_SPEC ) +END IF +IF (NSV>0) THEN + DO JSV=1,NSV + CALL SPEC_VER_INT(IMI, XSVT(:,:,:,JSV), ZSV_SPEC(:,:,:,JSV) ) + END DO +END IF +! +!------------------------------------------------------------------------------- +! +!* 4. Call to LES computations on cartesian (sub-)domain +! -------------------------------------------------- +! +IMASK=1 +! +CALL LES(LLES_CURRENT_CART_MASK) +! +!------------------------------------------------------------------------------- +! +!* 5. Call to LES computations on nebulosity mask +! ------------------------------------------- +! +IF (LLES_NEB_MASK) THEN + IMASK=IMASK+1 + CALL LES(LLES_CURRENT_NEB_MASK .AND. LLES_CURRENT_CART_MASK) +! + IMASK=IMASK+1 + CALL LES((.NOT. LLES_CURRENT_NEB_MASK) .AND. LLES_CURRENT_CART_MASK) +END IF +! +!------------------------------------------------------------------------------- +! +!* 6. Call to LES computations on cloud core mask +! ------------------------------------------- +! +IF (LLES_CORE_MASK) THEN + IMASK=IMASK+1 + CALL LES(LLES_CURRENT_CORE_MASK .AND. LLES_CURRENT_CART_MASK) +! + IMASK=IMASK+1 + CALL LES((.NOT. LLES_CURRENT_CORE_MASK) .AND. LLES_CURRENT_CART_MASK) +END IF +! +!------------------------------------------------------------------------------- +! +!* 7. Call to LES computations on user mask +! ------------------------------------- +! +IF (LLES_MY_MASK) THEN + DO JI=1,NLES_MASKS_USER + IMASK=IMASK+1 + CALL LES(LLES_CURRENT_MY_MASKS(:,:,:,JI)) + END DO +END IF +! +!------------------------------------------------------------------------------- +! +!* 7b. Call to LES computations on conditional sampling mask +! ----------------------------------------------------- +! +IF (LLES_CS_MASK) THEN + IMASK=IMASK+1 + CALL LES(LLES_CURRENT_CS1_MASK) + IMASK=IMASK+1 + CALL LES(LLES_CURRENT_CS2_MASK) + IMASK=IMASK+1 + CALL LES(LLES_CURRENT_CS3_MASK) +END IF +! +!------------------------------------------------------------------------------- +! +!* 8. budgets +! ------- +! +!* 8.1 tendencies +! ---------- +! +! +!* 8.2 dynamical production, transport and mean advection +! -------------------------------------------------- +! +ALLOCATE(ZLES_MEAN_DRtDZ(NLES_K)) +ALLOCATE(ZLES_MEAN_DSVDZ(NLES_K,NSV)) +! +IF (LUSERV) THEN + ZLES_MEAN_DRtDZ(:) = XLES_MEAN_DRtDZ(:,NLES_CURRENT_TCOUNT,1) +ELSE + ZLES_MEAN_DRtDZ(:) = XUNDEF +END IF +! +ZLES_MEAN_DSVDZ = 0. +DO JSV=1,NSV + ZLES_MEAN_DSvDZ(:,JSV) = XLES_MEAN_DSvDZ(:,NLES_CURRENT_TCOUNT,1,JSV) +END DO +! +CALL LES_RES_TR(LUSERV, & + XLES_MEAN_DUDZ(:,NLES_CURRENT_TCOUNT,1), & + XLES_MEAN_DVDZ(:,NLES_CURRENT_TCOUNT,1), & + XLES_MEAN_DWDZ(:,NLES_CURRENT_TCOUNT,1), & + XLES_MEAN_DThlDZ(:,NLES_CURRENT_TCOUNT,1), & + ZLES_MEAN_DRtDZ(:), & + ZLES_MEAN_DSvDZ(:,:) ) +! +DEALLOCATE(ZLES_MEAN_DRtDZ) +DEALLOCATE(ZLES_MEAN_DSVDZ) +! +CALL LES_BUDGET_TEND_n +!* 8.3 end of LES budgets computations +! ------------------------------- +! +DO JLOOP=1,NLES_TOT + XLES_BU_RES_KE (:,NLES_CURRENT_TCOUNT,JLOOP) = X_LES_BU_RES_KE (:,JLOOP) + XLES_BU_RES_WThl (:,NLES_CURRENT_TCOUNT,JLOOP) = X_LES_BU_RES_WThl (:,JLOOP) + XLES_BU_RES_Thl2 (:,NLES_CURRENT_TCOUNT,JLOOP) = X_LES_BU_RES_Thl2 (:,JLOOP) + XLES_BU_SBG_Tke (:,NLES_CURRENT_TCOUNT,JLOOP) = X_LES_BU_SBG_Tke (:,JLOOP) + IF (LUSERV) THEN + XLES_BU_RES_WRt (:,NLES_CURRENT_TCOUNT,JLOOP) = X_LES_BU_RES_WRt (:,JLOOP) + XLES_BU_RES_Rt2 (:,NLES_CURRENT_TCOUNT,JLOOP) = X_LES_BU_RES_Rt2 (:,JLOOP) + XLES_BU_RES_ThlRt(:,NLES_CURRENT_TCOUNT,JLOOP) = X_LES_BU_RES_ThlRt(:,JLOOP) + END IF + DO JSV=1,NSV + XLES_BU_RES_Sv2 (:,NLES_CURRENT_TCOUNT,JLOOP,JSV) = X_LES_BU_RES_Sv2 (:,JLOOP,JSV) + XLES_BU_RES_WSv (:,NLES_CURRENT_TCOUNT,JLOOP,JSV) = X_LES_BU_RES_WSv (:,JLOOP,JSV) + END DO +END DO +! +!------------------------------------------------------------------------------- +! +!* 9. Deallocations +! ------------- +! +!* 9.1 local variables +! --------------- +! +DEALLOCATE(ZEXN ) +DEALLOCATE(ZTHL) +DEALLOCATE(ZRT ) +DEALLOCATE(ZTHV ) +DEALLOCATE(ZRHO ) +DEALLOCATE(ZEW ) + +DEALLOCATE(ZINDCLD ) +DEALLOCATE(ZINDCLD2 ) +DEALLOCATE(ZINDCLD2D ) +DEALLOCATE(ZINDCLD2D2) +DEALLOCATE(ZCLDFR_LES) +DEALLOCATE(ZICEFR_LES) +DEALLOCATE(ZRAINFR_LES) +DEALLOCATE(ZMASSF ) +DEALLOCATE(ZTEMP ) +DEALLOCATE(ZREHU ) +DEALLOCATE(CHAMPXY1 ) +! +DEALLOCATE(ZU_LES) +DEALLOCATE(ZV_LES) +DEALLOCATE(ZW_LES) +DEALLOCATE(ZTHL_LES) +DEALLOCATE(ZRT_LES) +DEALLOCATE(ZSV_LES) +DEALLOCATE(ZP_LES ) +DEALLOCATE(ZDP_LES ) +DEALLOCATE(ZTP_LES ) +DEALLOCATE(ZTR_LES ) +DEALLOCATE(ZDISS_LES ) +DEALLOCATE(ZLM_LES ) +DEALLOCATE(ZDPDZ_LES) +DEALLOCATE(ZLWP_ANOM) +DEALLOCATE(ZWORK2D) +DEALLOCATE(ZWORK1D) +DEALLOCATE(ZWORK1DT) +DEALLOCATE(ZMAXWRR2D) +DEALLOCATE(ZDTHLDZ_LES) +DEALLOCATE(ZDTHDZ_LES) +DEALLOCATE(ZDRTDZ_LES) +DEALLOCATE(ZDSVDZ_LES) +DEALLOCATE(ZDUDZ_LES) +DEALLOCATE(ZDVDZ_LES) +DEALLOCATE(ZDWDZ_LES) +DEALLOCATE(ZRHO_LES ) +DEALLOCATE(ZEXN_LES ) +DEALLOCATE(ZTH_LES ) +DEALLOCATE(ZMF_LES ) +DEALLOCATE(ZTHV_LES ) +DEALLOCATE(ZTKE_LES ) +DEALLOCATE(ZKE_LES ) +DEALLOCATE(ZTKET_LES) +DEALLOCATE(ZRV_LES ) +DEALLOCATE(ZREHU_LES ) +DEALLOCATE(ZRC_LES ) +DEALLOCATE(ZRR_LES ) +DEALLOCATE(ZZZ_LES) +DEALLOCATE(ZLWP_LES ) +DEALLOCATE(ZRWP_LES ) +DEALLOCATE(ZIWP_LES ) +DEALLOCATE(ZSWP_LES ) +DEALLOCATE(ZGWP_LES ) +DEALLOCATE(ZHWP_LES ) +DEALLOCATE(ZINPRR3D_LES) +DEALLOCATE(ZEVAP3D_LES) +DEALLOCATE(ZRI_LES ) +DEALLOCATE(ZRS_LES ) +DEALLOCATE(ZRG_LES ) +DEALLOCATE(ZRH_LES ) +DEALLOCATE(ZP_ANOM ) +DEALLOCATE(ZRHO_ANOM) +DEALLOCATE(ZTH_ANOM ) +DEALLOCATE(ZTHV_ANOM) +DEALLOCATE(ZRV_ANOM ) +DEALLOCATE(ZRC_ANOM ) +DEALLOCATE(ZRI_ANOM ) +DEALLOCATE(ZRR_ANOM ) +DEALLOCATE(ZDPDZ_ANOM) +DEALLOCATE(ZMEAN_DPDZ) +DEALLOCATE(ZLES_MEAN_DTHDZ) +! +DEALLOCATE(ZU_SPEC ) +DEALLOCATE(ZV_SPEC ) +DEALLOCATE(ZW_SPEC ) +DEALLOCATE(ZTH_SPEC ) +DEALLOCATE(ZTHL_SPEC ) +DEALLOCATE(ZRV_SPEC ) +DEALLOCATE(ZRC_SPEC ) +DEALLOCATE(ZRI_SPEC ) +DEALLOCATE(ZSV_SPEC ) +! +DEALLOCATE(ZRADEFF_LES ) +DEALLOCATE(ZSWU_LES ) +DEALLOCATE(ZSWD_LES ) +DEALLOCATE(ZLWD_LES ) +DEALLOCATE(ZLWU_LES ) +DEALLOCATE(ZDTHRADSW_LES ) +DEALLOCATE(ZDTHRADLW_LES ) +! +!* 9.2 current time-step LES masks (in MODD_LES) +! --------------------------- +! +CALL LES_DEALLOCATE('LLES_CURRENT_CART_MASK') +IF (LLES_NEB_MASK) CALL LES_DEALLOCATE('LLES_CURRENT_NEB_MASK') +IF (LLES_CORE_MASK) CALL LES_DEALLOCATE('LLES_CURRENT_CORE_MASK') +IF (LLES_MY_MASK) THEN + CALL LES_DEALLOCATE('LLES_CURRENT_MY_MASKS') +END IF +IF (LLES_CS_MASK) THEN + CALL LES_DEALLOCATE('LLES_CURRENT_CS1_MASK') + IF (NSV_CS >= 2) CALL LES_DEALLOCATE('LLES_CURRENT_CS2_MASK') + IF (NSV_CS == 3) CALL LES_DEALLOCATE('LLES_CURRENT_CS3_MASK') +END IF +! +! +!* 9.3 variables in MODD_LES_BUDGET +! ---------------------------- +! + +DEALLOCATE(XU_ANOM ) +DEALLOCATE(XV_ANOM ) +DEALLOCATE(XW_ANOM ) +DEALLOCATE(XTHL_ANOM) +DEALLOCATE(XRT_ANOM ) +DEALLOCATE(XSV_ANOM ) +! +DEALLOCATE(XCURRENT_L_O_EXN_CP) +DEALLOCATE(XCURRENT_RHODJ ) +! +DEALLOCATE(XCURRENT_RUS ) +DEALLOCATE(XCURRENT_RVS ) +DEALLOCATE(XCURRENT_RWS ) +DEALLOCATE(XCURRENT_RTHS ) +DEALLOCATE(XCURRENT_RTKES) +DEALLOCATE(XCURRENT_RRS ) +DEALLOCATE(XCURRENT_RSVS ) +DEALLOCATE(XCURRENT_RTHLS) +DEALLOCATE(XCURRENT_RRTS ) + +DEALLOCATE(X_LES_BU_RES_KE ) +DEALLOCATE(X_LES_BU_RES_WThl ) +DEALLOCATE(X_LES_BU_RES_Thl2 ) +DEALLOCATE(X_LES_BU_RES_WRt ) +DEALLOCATE(X_LES_BU_RES_Rt2 ) +DEALLOCATE(X_LES_BU_RES_ThlRt) +DEALLOCATE(X_LES_BU_RES_Sv2 ) +DEALLOCATE(X_LES_BU_RES_WSv ) +DEALLOCATE(X_LES_BU_SBG_TKE ) +!------------------------------------------------------------------------------- +! +!* 10. end of LES computations for this time-step +! ------------------------------------------ +! +LLES_CALL=.FALSE. +CALL BUDGET_FLAGS(LUSERV, LUSERC, LUSERR, & + LUSERI, LUSERS, LUSERG, LUSERH ) +! +!------------------------------------------------------------------------------- +! +CONTAINS +! +! ########################################################################## + SUBROUTINE LES(OMASK) +! ########################################################################## +! +! +!!**** *LES* computes the current time-step LES diagnostics for one mask. +!! +!! +!! PURPOSE +!! ------- +!! +!! EXTERNAL +!! -------- +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! V. Masson +!! +!! MODIFICATIONS +!! ------------- +!! Original 07/02/00 +!! +!! -------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_PARAMETERS +! +USE MODI_LES_FLUX_ll +USE MODI_LES_3RD_MOMENT_ll +USE MODI_LES_4TH_MOMENT_ll +USE MODI_LES_MEAN_1PROC +USE MODI_LES_MEAN_MPROC +USE MODI_LES_PDF_ll +! +USE MODI_LES_HOR_CORR +! +IMPLICIT NONE +! +! +!* 0.1 declarations of arguments +! +LOGICAL, DIMENSION(:,:,:), INTENT(IN) :: OMASK ! 2D mask for computations +! +! +! +! 0.2 declaration of local variables +! +INTEGER :: JSV ! scalar variables counter +INTEGER :: JI +INTEGER :: JK ! vertical loop counter +INTEGER :: JPDF ! pdf counter +! +LOGICAL, DIMENSION(SIZE(ZW_LES,1),SIZE(ZW_LES,2),SIZE(ZW_LES,3)) :: GUPDRAFT_MASK +LOGICAL, DIMENSION(SIZE(ZW_LES,1),SIZE(ZW_LES,2),SIZE(ZW_LES,3)) :: GDOWNDRAFT_MASK +REAL, DIMENSION(SIZE(ZW_LES,1),SIZE(ZW_LES,2),SIZE(ZW_LES,3)) :: ZUPDRAFT +REAL, DIMENSION(SIZE(ZW_LES,1),SIZE(ZW_LES,2),SIZE(ZW_LES,3)) :: ZDOWNDRAFT +REAL, DIMENSION(SIZE(ZW_LES,1),SIZE(ZW_LES,2),SIZE(ZW_LES,3)) :: ZW_UP +REAL, DIMENSION(SIZE(ZW_LES,1),SIZE(ZW_LES,2),SIZE(ZW_LES,3)) :: ZWORK_LES +! +INTEGER, DIMENSION(SIZE(ZW_LES,3)) :: IAVG_PTS +INTEGER, DIMENSION(SIZE(ZW_LES,3)) :: IUND_PTS +REAL, DIMENSION(SIZE(ZW_LES,3)) :: ZAVG +! +REAL, DIMENSION(SIZE(ZW_LES,3)) :: ZLES_RESOLVED_U3 +REAL, DIMENSION(SIZE(ZW_LES,3)) :: ZLES_RESOLVED_UV2 +REAL, DIMENSION(SIZE(ZW_LES,3)) :: ZLES_RESOLVED_UW2 +REAL, DIMENSION(SIZE(ZW_LES,3)) :: ZLES_RESOLVED_VU2 +REAL, DIMENSION(SIZE(ZW_LES,3)) :: ZLES_RESOLVED_V3 +REAL, DIMENSION(SIZE(ZW_LES,3)) :: ZLES_RESOLVED_VW2 +REAL, DIMENSION(SIZE(ZW_LES,3)) :: ZLES_RESOLVED_WU2 +REAL, DIMENSION(SIZE(ZW_LES,3)) :: ZLES_RESOLVED_WV2 +REAL, DIMENSION(SIZE(ZW_LES,3)) :: ZLES_UPDRAFT_U2 +REAL, DIMENSION(SIZE(ZW_LES,3)) :: ZLES_UPDRAFT_V2 +REAL, DIMENSION(SIZE(ZW_LES,3)) :: ZLES_UPDRAFT_W2 +REAL, DIMENSION(SIZE(ZW_LES,3)) :: ZLES_DOWNDRAFT_U2 +REAL, DIMENSION(SIZE(ZW_LES,3)) :: ZLES_DOWNDRAFT_V2 +REAL, DIMENSION(SIZE(ZW_LES,3)) :: ZLES_DOWNDRAFT_W2 +REAL, DIMENSION(SIZE(ZW_LES,3),NPDF) :: ZPDF +! +INTEGER, DIMENSION(1) :: IKMIN_FLUX ! vertical index of min. W'thl' +INTEGER, DIMENSION(1) :: IKMAX_TH !vertical index maxdth +INTEGER, DIMENSION(1) :: IKMAX_CF ! vertical index of max. Cf +! +REAL, DIMENSION(SIZE(ZW_LES,3)) :: ZKE_TOT ! total turbulent kinetic energy +REAL :: ZINT_KE_TOT! integral of KE_TOT +REAL :: ZINT_RHOKE! integral of RHO*KE +REAL :: ZFRIC_SURF ! surface friction +REAL, DIMENSION(SIZE(ZW_LES,3)) :: ZFRIC_LES ! friction at all LES levels +! +!------------------------------------------------------------------------------- +! +! 1. local diagnostics (for any mask type) +! ----------------- +! +! +! 1.2 Number of points used for averaging on current processor +! -------------------------------------------------------- +! +!* to be sure to be coherent with other computations, +! a field on LES vertical grid (and horizontal mass point grid) is used. +! This information is necessary for the subgrid fluxes computations, because +! half of the work is already done, but the number of averaging points was +! not kept. +! +CALL LES_MEAN_1PROC ( XW_ANOM, OMASK, & + ZAVG(:), & + IAVG_PTS(:), & + IUND_PTS(:) ) +! +! +! 1.3 Number of points used for averaging on all processor +! ---------------------------------------------------- +! +CALL LES_MEAN_ll ( XW_ANOM, OMASK, & + ZAVG(:), & + NLES_AVG_PTS_ll(:,NLES_CURRENT_TCOUNT,IMASK), & + NLES_UND_PTS_ll(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +! +! 1.4 Mean quantities +! --------------- +! +IF (LLES_MEAN .AND. IMASK > 1) THEN +! +!* horizontal wind velocities +! + CALL LES_MEAN_ll ( ZU_LES, OMASK, & + XLES_MEAN_U(:,NLES_CURRENT_TCOUNT,IMASK) ) +! + CALL LES_MEAN_ll ( ZV_LES, OMASK, & + XLES_MEAN_V(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* vertical wind velocity +! + CALL LES_MEAN_ll ( ZW_LES, OMASK, & + XLES_MEAN_W(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* pressure +! + CALL LES_MEAN_ll ( ZP_LES, OMASK, & + XLES_MEAN_P(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* dynamical production TKE +! + CALL LES_MEAN_ll ( ZDP_LES, OMASK, & + XLES_MEAN_DP(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* thermal production TKE +! + CALL LES_MEAN_ll ( ZTP_LES, OMASK, & + XLES_MEAN_TP(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* transport TKE +! + CALL LES_MEAN_ll ( ZTR_LES, OMASK, & + XLES_MEAN_TR(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* dissipation TKE +! + CALL LES_MEAN_ll ( ZDISS_LES, OMASK, & + XLES_MEAN_DISS(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* mixing length +! + CALL LES_MEAN_ll ( ZLM_LES, OMASK, & + XLES_MEAN_LM(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* density +! + CALL LES_MEAN_ll ( ZRHO_LES, OMASK, & + XLES_MEAN_RHO(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +! +!* potential temperature +! + CALL LES_MEAN_ll ( ZTH_LES, OMASK, & + XLES_MEAN_Th(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* mass flux + CALL LES_MEAN_ll ( ZMF_LES, OMASK, & + XLES_MEAN_Mf(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +! +!* virtual potential temperature +! + IF (LUSERV) & + CALL LES_MEAN_ll ( ZTHV_LES, OMASK, & + XLES_MEAN_Thv(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* liquid potential temperature +! + IF (LUSERC) THEN + CALL LES_MEAN_ll ( ZTHL_LES, OMASK, & + XLES_MEAN_Thl(:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF +! +!* vapor mixing ratio +! + IF (LUSERV) THEN + CALL LES_MEAN_ll ( ZRV_LES, OMASK, & + XLES_MEAN_Rv(:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF +! +!*relative humidity +! + IF (LUSERV) THEN + CALL LES_MEAN_ll ( ZREHU_LES, OMASK, & + XLES_MEAN_Rehu(:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF +! +!* cloud mixing ratio +! + IF (LUSERC) THEN + CALL LES_MEAN_ll ( ZRC_LES, OMASK, & + XLES_MEAN_Rc(:,NLES_CURRENT_TCOUNT,IMASK) ) + CALL LES_MEAN_ll ( ZRT_LES, OMASK, & + XLES_MEAN_Rt(:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF +! +!* rain mixing ratio +! + IF (LUSERR) THEN + CALL LES_MEAN_ll ( ZRR_LES, OMASK, & + XLES_MEAN_Rr(:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF +! +!* ice mixing ratio +! + IF (LUSERI) THEN + CALL LES_MEAN_ll ( ZRI_LES, OMASK, & + XLES_MEAN_Ri(:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF +! +!* snow mixing ratio +! + IF (LUSERS) THEN + CALL LES_MEAN_ll ( ZRS_LES, OMASK, & + XLES_MEAN_Rs(:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF +! +!* graupel mixing ratio +! + IF (LUSERG) THEN + CALL LES_MEAN_ll ( ZRG_LES, OMASK, & + XLES_MEAN_Rg(:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF +! +!* hail mixing ratio +! + IF (LUSERH) THEN + CALL LES_MEAN_ll ( ZRH_LES, OMASK, & + XLES_MEAN_Rh(:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF +! +!* scalar variables mixing ratio +! + DO JSV=1,NSV + CALL LES_MEAN_ll ( ZSV_LES(:,:,:,JSV), OMASK, & + XLES_MEAN_Sv(:,NLES_CURRENT_TCOUNT,IMASK,JSV) ) + END DO +END IF +! +!* wind modulus +! +IF (LLES_MEAN) THEN +! + ZWORK_LES =SQRT( ZU_LES**2 +ZV_LES**2 ) + CALL LES_MEAN_ll ( ZWORK_LES, OMASK, & + XLES_MEAN_WIND(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* vertical speed larger than mean vertical speed (updraft) +! + DO JK=1,NLES_K + ZW_UP(:,:,JK) = MAX(ZW_LES(:,:,JK), XLES_MEAN_W(JK,NLES_CURRENT_TCOUNT,IMASK)) + END DO +! +!* upward mass flux +! + ZWORK_LES = ZW_UP * ZRHO_LES + CALL LES_MEAN_ll ( ZWORK_LES, OMASK, & + XLES_RESOLVED_MASSFX(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* pdf calculation +! + IF (LLES_PDF) THEN + CALL LES_PDF_ll ( ZTH_LES,OMASK,XTH_PDF_MIN,XTH_PDF_MAX, & + ZPDF(:,:) ) + DO JSV=1,NPDF + XLES_PDF_TH(:,NLES_CURRENT_TCOUNT,IMASK,JSV)=ZPDF(:,JSV) + END DO + + CALL LES_PDF_ll ( ZW_LES,OMASK,XW_PDF_MIN,XW_PDF_MAX, & + ZPDF(:,:) ) + DO JSV=1,NPDF + XLES_PDF_W(:,NLES_CURRENT_TCOUNT,IMASK,JSV)=ZPDF(:,JSV) + END DO + CALL LES_PDF_ll ( ZTHV_LES,OMASK,XTHV_PDF_MIN,XTHV_PDF_MAX, & + ZPDF(:,:) ) + DO JSV=1,NPDF + XLES_PDF_THV(:,NLES_CURRENT_TCOUNT,IMASK,JSV)=ZPDF(:,JSV) + END DO + IF (LUSERV) THEN + CALL LES_PDF_ll ( ZRV_LES,OMASK,XRV_PDF_MIN,XRV_PDF_MAX, & + ZPDF(:,:) ) + DO JSV=1,NPDF + XLES_PDF_RV(:,NLES_CURRENT_TCOUNT,IMASK,JSV)=ZPDF(:,JSV) + END DO + END IF + IF (LUSERC) THEN + CALL LES_PDF_ll ( ZRC_LES,OMASK,XRC_PDF_MIN,XRC_PDF_MAX, & + ZPDF(:,:) ) + DO JSV=1,NPDF + XLES_PDF_RC(:,NLES_CURRENT_TCOUNT,IMASK,JSV)=ZPDF(:,JSV) + END DO + CALL LES_PDF_ll ( ZRT_LES,OMASK,XRT_PDF_MIN,XRT_PDF_MAX, & + ZPDF(:,:) ) + DO JSV=1,NPDF + XLES_PDF_RT(:,NLES_CURRENT_TCOUNT,IMASK,JSV)=ZPDF(:,JSV) + END DO + CALL LES_PDF_ll ( ZTHL_LES,OMASK,XTHL_PDF_MIN,XTHL_PDF_MAX, & + ZPDF(:,:) ) + DO JSV=1,NPDF + XLES_PDF_THL(:,NLES_CURRENT_TCOUNT,IMASK,JSV)=ZPDF(:,JSV) + END DO + END IF + IF (LUSERR) THEN + CALL LES_PDF_ll ( ZRR_LES,OMASK,XRR_PDF_MIN,XRR_PDF_MAX, & + ZPDF(:,:) ) + DO JSV=1,NPDF + XLES_PDF_RR(:,NLES_CURRENT_TCOUNT,IMASK,JSV)=ZPDF(:,JSV) + END DO + END IF + IF (LUSERI) THEN + CALL LES_PDF_ll ( ZRI_LES,OMASK,XRI_PDF_MIN,XRI_PDF_MAX, & + ZPDF(:,:) ) + DO JSV=1,NPDF + XLES_PDF_RI(:,NLES_CURRENT_TCOUNT,IMASK,JSV)=ZPDF(:,JSV) + END DO + END IF + IF (LUSERS) THEN + CALL LES_PDF_ll ( ZRS_LES,OMASK,XRS_PDF_MIN,XRS_PDF_MAX, & + ZPDF(:,:) ) + DO JSV=1,NPDF + XLES_PDF_RS(:,NLES_CURRENT_TCOUNT,IMASK,JSV)=ZPDF(:,JSV) + END DO + END IF + IF (LUSERG) THEN + CALL LES_PDF_ll ( ZRG_LES,OMASK,XRG_PDF_MIN,XRG_PDF_MAX, & + ZPDF(:,:) ) + DO JSV=1,NPDF + XLES_PDF_RG(:,NLES_CURRENT_TCOUNT,IMASK,JSV)=ZPDF(:,JSV) + END DO + END IF + END IF +! +!* mean vertical gradients +! + CALL LES_MEAN_ll ( ZDTHLDZ_LES, OMASK, XLES_MEAN_DTHLDZ(:,NLES_CURRENT_TCOUNT,IMASK) ) + CALL LES_MEAN_ll ( ZDUDZ_LES, OMASK, XLES_MEAN_DUDZ(:,NLES_CURRENT_TCOUNT,IMASK) ) + CALL LES_MEAN_ll ( ZDVDZ_LES, OMASK, XLES_MEAN_DVDZ(:,NLES_CURRENT_TCOUNT,IMASK) ) + CALL LES_MEAN_ll ( ZDWDZ_LES, OMASK, XLES_MEAN_DWDZ(:,NLES_CURRENT_TCOUNT,IMASK) ) + IF (LUSERV) CALL LES_MEAN_ll ( ZDRtDZ_LES, OMASK, XLES_MEAN_DRtDZ(:,NLES_CURRENT_TCOUNT,IMASK) ) + DO JSV=1,NSV + CALL LES_MEAN_ll ( ZDSVDZ_LES(:,:,:,JSV), OMASK, XLES_MEAN_DSVDZ(:,NLES_CURRENT_TCOUNT,IMASK,JSV) ) + END DO + +END IF +!------------------------------------------------------------------------------- +! +! 1.5 Resolved quantities +! ------------------- +! +!* horizontal wind variances +! + CALL LES_FLUX_ll ( XU_ANOM, XU_ANOM, & + OMASK, & + XLES_RESOLVED_U2 (:,NLES_CURRENT_TCOUNT,IMASK) ) +! + CALL LES_FLUX_ll ( XV_ANOM, XV_ANOM, & + OMASK, & + XLES_RESOLVED_V2 (:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* vertical wind variance +! + CALL LES_FLUX_ll ( XW_ANOM, XW_ANOM, & + OMASK, & + XLES_RESOLVED_W2 (:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* pressure variance +! + CALL LES_FLUX_ll ( ZP_ANOM, ZP_ANOM, & + OMASK, & + XLES_RESOLVED_P2 (:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* potential temperature variance +! + CALL LES_FLUX_ll ( ZTH_ANOM, ZTH_ANOM, & + OMASK, & + XLES_RESOLVED_TH2(:,NLES_CURRENT_TCOUNT,IMASK) ) + +! +!* resolved turbulent kinetic energy +! + XLES_RESOLVED_Ke(:,NLES_CURRENT_TCOUNT,IMASK) = XUNDEF +! + WHERE(XLES_RESOLVED_U2 (:,NLES_CURRENT_TCOUNT,IMASK) /= XUNDEF) & + XLES_RESOLVED_Ke(:,NLES_CURRENT_TCOUNT,IMASK) = 0.5*( & + XLES_RESOLVED_U2 (:,NLES_CURRENT_TCOUNT,IMASK) & + + XLES_RESOLVED_V2 (:,NLES_CURRENT_TCOUNT,IMASK) & + + XLES_RESOLVED_W2 (:,NLES_CURRENT_TCOUNT,IMASK)) +! +!* potential temperature - virtual potential temperature covariance +! + IF (LUSERV) THEN + CALL LES_FLUX_ll ( ZTH_ANOM, ZTHV_ANOM, & + OMASK, & + XLES_RESOLVED_THTHV(:,NLES_CURRENT_TCOUNT,IMASK) ) + +! +!* vapor mixing ratio variance +! + CALL LES_FLUX_ll ( ZRV_ANOM, ZRV_ANOM, & + OMASK, & + XLES_RESOLVED_Rv2(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +! +!* potential temperature - vapor mixing ratio correlation +! + CALL LES_FLUX_ll ( ZTH_ANOM, ZRV_ANOM, & + OMASK, & + XLES_RESOLVED_ThRv(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* virtual potential temperature - vapor mixing ratio correlation +! + CALL LES_FLUX_ll ( ZTHV_ANOM, ZRV_ANOM, & + OMASK, & + XLES_RESOLVED_ThvRv(:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF +! +! +!* liquid potential temperature - virtual potential temperature covariance +! + IF (LUSERC) THEN + CALL LES_FLUX_ll ( XTHL_ANOM, ZTHV_ANOM, & + OMASK, & + XLES_RESOLVED_THLTHV(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* liquid potential temperature variance +! + CALL LES_FLUX_ll ( XTHL_ANOM, XTHL_ANOM, & + OMASK, & + XLES_RESOLVED_THL2(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* total water mixing ratio variance +! + CALL LES_FLUX_ll ( XRT_ANOM, XRT_ANOM, & + OMASK, & + XLES_RESOLVED_Rt2(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* cloud mixing ratio variance +! + CALL LES_FLUX_ll ( ZRC_ANOM, ZRC_ANOM, & + OMASK, & + XLES_RESOLVED_Rc2(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* potential temperature - cloud mixing ratio correlation +! + CALL LES_FLUX_ll ( ZTH_ANOM, ZRC_ANOM, & + OMASK, & + XLES_RESOLVED_ThRc(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* liquid potential temperature - vapor mixing ratio correlation +! + CALL LES_FLUX_ll ( XTHL_ANOM, ZRV_ANOM, & + OMASK, & + XLES_RESOLVED_ThlRv(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* liquid potential temperature - cloud mixing ratio correlation +! + CALL LES_FLUX_ll ( XTHL_ANOM, ZRC_ANOM, & + OMASK, & + XLES_RESOLVED_ThlRc(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* virtual potential temperature - cloud mixing ratio correlation +! + CALL LES_FLUX_ll ( ZTHV_ANOM, ZRC_ANOM, & + OMASK, & + XLES_RESOLVED_ThvRc(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +! variance of lwp +! + IF (IMASK .EQ. 1) THEN + CALL LES_FLUX_ll (ZLWP_ANOM, ZLWP_ANOM, & + OMASK(:,:,1), & + XLES_LWPVAR(NLES_CURRENT_TCOUNT) ) + END IF + END IF +! +!* ice mixing ratio variance +! + IF (LUSERI) THEN + CALL LES_FLUX_ll ( ZRI_ANOM, ZRI_ANOM, & + OMASK, & + XLES_RESOLVED_Ri2(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* potential temperature - ice mixing ratio correlation +! + CALL LES_FLUX_ll ( ZTH_ANOM, ZRI_ANOM, & + OMASK, & + XLES_RESOLVED_ThRi(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* liquid potential temperature - ice mixing ratio correlation +! + CALL LES_FLUX_ll ( XTHL_ANOM, ZRI_ANOM, & + OMASK, & + XLES_RESOLVED_ThlRi(:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* virtual potential temperature - ice mixing ratio correlation +! + CALL LES_FLUX_ll ( ZTHV_ANOM, ZRI_ANOM, & + OMASK, & + XLES_RESOLVED_ThvRi(:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF +! +!* scalar variable mixing ratio variances +! + DO JSV=1,NSV + CALL LES_FLUX_ll ( XSV_ANOM(:,:,:,JSV), XSV_ANOM(:,:,:,JSV), & + OMASK, & + XLES_RESOLVED_Sv2(:,NLES_CURRENT_TCOUNT,IMASK,JSV) ) +! +!* potential temperature - scalar variables ratio correlation +! + CALL LES_FLUX_ll ( ZTH_ANOM, XSV_ANOM(:,:,:,JSV), & + OMASK, & + XLES_RESOLVED_ThSv(:,NLES_CURRENT_TCOUNT,IMASK,JSV) ) +! +!* liquid potential temperature - scalar variables ratio correlation +! + IF (LUSERC) THEN + CALL LES_FLUX_ll ( XTHL_ANOM, XSV_ANOM(:,:,:,JSV), & + OMASK, & + XLES_RESOLVED_ThlSv(:,NLES_CURRENT_TCOUNT,IMASK,JSV) ) + END IF +! +!* virtual potential temperature - scalar variables ratio correlation +! + IF (LUSERV) THEN + CALL LES_FLUX_ll ( ZTHV_ANOM, XSV_ANOM(:,:,:,JSV), & + OMASK, & + XLES_RESOLVED_ThvSv(:,NLES_CURRENT_TCOUNT,IMASK,JSV) ) + END IF + END DO +! +! +!* wind fluxes +! + CALL LES_FLUX_ll ( XU_ANOM, XV_ANOM, & + OMASK, & + XLES_RESOLVED_UV (:,NLES_CURRENT_TCOUNT,IMASK) ) +! + CALL LES_FLUX_ll ( XW_ANOM, XU_ANOM, & + OMASK, & + XLES_RESOLVED_WU (:,NLES_CURRENT_TCOUNT,IMASK) ) +! + CALL LES_FLUX_ll ( XW_ANOM, XV_ANOM, & + OMASK, & + XLES_RESOLVED_WV (:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* pressure fluxes +! + CALL LES_FLUX_ll ( XU_ANOM, ZDPDZ_ANOM, & + OMASK, & + XLES_RESOLVED_UP (:,NLES_CURRENT_TCOUNT,IMASK) ) +! + CALL LES_FLUX_ll ( XV_ANOM, ZDPDZ_ANOM, & + OMASK, & + XLES_RESOLVED_VP (:,NLES_CURRENT_TCOUNT,IMASK) ) +! + CALL LES_FLUX_ll ( XW_ANOM, ZDPDZ_ANOM, & + OMASK, & + XLES_RESOLVED_WP (:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* theta fluxes +! + CALL LES_FLUX_ll ( XU_ANOM, ZTH_ANOM, & + OMASK, & + XLES_RESOLVED_UTh (:,NLES_CURRENT_TCOUNT,IMASK) ) + + CALL LES_FLUX_ll ( XV_ANOM, ZTH_ANOM, & + OMASK, & + XLES_RESOLVED_VTh (:,NLES_CURRENT_TCOUNT,IMASK) ) +! + CALL LES_FLUX_ll ( XW_ANOM, ZTH_ANOM, & + OMASK, & + XLES_RESOLVED_WTh (:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* virtual theta fluxes +! + IF (LUSERV) THEN + CALL LES_FLUX_ll ( XU_ANOM, ZTHV_ANOM, & + OMASK, & + XLES_RESOLVED_UThv (:,NLES_CURRENT_TCOUNT,IMASK) ) +! + CALL LES_FLUX_ll ( XV_ANOM, ZTHV_ANOM, & + OMASK, & + XLES_RESOLVED_VThv (:,NLES_CURRENT_TCOUNT,IMASK) ) +! + CALL LES_FLUX_ll ( XW_ANOM, ZTHV_ANOM, & + OMASK, & + XLES_RESOLVED_WThv (:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* vapor mixing ratio fluxes +! + CALL LES_FLUX_ll ( XU_ANOM, ZRV_ANOM, & + OMASK, & + XLES_RESOLVED_URv (:,NLES_CURRENT_TCOUNT,IMASK) ) +! + CALL LES_FLUX_ll ( XV_ANOM, ZRV_ANOM, & + OMASK, & + XLES_RESOLVED_VRv (:,NLES_CURRENT_TCOUNT,IMASK) ) +! + CALL LES_FLUX_ll ( XW_ANOM, ZRV_ANOM, & + OMASK, & + XLES_RESOLVED_WRv (:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF +! +!* cloud water mixing ratio fluxes +! + IF (LUSERC) THEN + CALL LES_FLUX_ll ( XU_ANOM, ZRC_ANOM, & + OMASK, & + XLES_RESOLVED_URc (:,NLES_CURRENT_TCOUNT,IMASK) ) +! + CALL LES_FLUX_ll ( XV_ANOM, ZRC_ANOM, & + OMASK, & + XLES_RESOLVED_VRc (:,NLES_CURRENT_TCOUNT,IMASK) ) +! + CALL LES_FLUX_ll ( XW_ANOM, ZRC_ANOM, & + OMASK, & + XLES_RESOLVED_WRc (:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* liquid theta fluxes +! + CALL LES_FLUX_ll ( XU_ANOM, XTHL_ANOM, & + OMASK, & + XLES_RESOLVED_UThl (:,NLES_CURRENT_TCOUNT,IMASK) ) +! + CALL LES_FLUX_ll ( XV_ANOM, XTHL_ANOM, & + OMASK, & + XLES_RESOLVED_VThl (:,NLES_CURRENT_TCOUNT,IMASK) ) +! + CALL LES_FLUX_ll ( XW_ANOM, XTHL_ANOM, & + OMASK, & + XLES_RESOLVED_WThl (:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* total water mixing ratio fluxes +! + CALL LES_FLUX_ll ( XW_ANOM, XRT_ANOM, & + OMASK, & + XLES_RESOLVED_WRt (:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF +! +!* cloud ice mixing ratio fluxes +! + IF (LUSERI) THEN + CALL LES_FLUX_ll ( XU_ANOM, ZRI_ANOM, & + OMASK, & + XLES_RESOLVED_URi (:,NLES_CURRENT_TCOUNT,IMASK) ) +! + CALL LES_FLUX_ll ( XV_ANOM, ZRI_ANOM, & + OMASK, & + XLES_RESOLVED_VRi (:,NLES_CURRENT_TCOUNT,IMASK) ) +! + CALL LES_FLUX_ll ( XW_ANOM, ZRI_ANOM, & + OMASK, & + XLES_RESOLVED_WRi (:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF + IF (LUSERR) THEN + CALL LES_FLUX_ll ( XW_ANOM, ZRR_ANOM, & + OMASK, & + XLES_RESOLVED_WRr (:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF +! + +! +!* scalar variables fluxes +! + DO JSV=1,NSV + CALL LES_FLUX_ll ( XU_ANOM, XSV_ANOM(:,:,:,JSV), & + OMASK, & + XLES_RESOLVED_USv (:,NLES_CURRENT_TCOUNT,IMASK,JSV) ) +! + CALL LES_FLUX_ll ( XV_ANOM, XSV_ANOM(:,:,:,JSV), & + OMASK, & + XLES_RESOLVED_VSv (:,NLES_CURRENT_TCOUNT,IMASK,JSV) ) +! + CALL LES_FLUX_ll ( XW_ANOM, XSV_ANOM(:,:,:,JSV), & + OMASK, & + XLES_RESOLVED_WSv (:,NLES_CURRENT_TCOUNT,IMASK,JSV) ) + END DO +! +!* skewness +! + CALL LES_3RD_MOMENT_ll ( XU_ANOM, XU_ANOM, XU_ANOM, & + OMASK, & + XLES_RESOLVED_U3 (:,NLES_CURRENT_TCOUNT,IMASK) ) + + CALL LES_3RD_MOMENT_ll ( XV_ANOM, XV_ANOM, XV_ANOM, & + OMASK, & + XLES_RESOLVED_V3 (:,NLES_CURRENT_TCOUNT,IMASK) ) + + CALL LES_3RD_MOMENT_ll ( XW_ANOM, XW_ANOM, XW_ANOM, & + OMASK, & + XLES_RESOLVED_W3 (:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* kurtosis +! + CALL LES_4TH_MOMENT_ll ( XU_ANOM, XU_ANOM, XU_ANOM, XU_ANOM, & + OMASK, & + XLES_RESOLVED_U4 (:,NLES_CURRENT_TCOUNT,IMASK) ) + + CALL LES_4TH_MOMENT_ll ( XV_ANOM, XV_ANOM, XV_ANOM, XV_ANOM, & + OMASK, & + XLES_RESOLVED_V4 (:,NLES_CURRENT_TCOUNT,IMASK) ) + + CALL LES_4TH_MOMENT_ll ( XW_ANOM, XW_ANOM, XW_ANOM, XW_ANOM, & + OMASK, & + XLES_RESOLVED_W4 (:,NLES_CURRENT_TCOUNT,IMASK) ) +! +!* third moments of liquid potential temperature +! + IF (LUSERC) THEN + CALL LES_3RD_MOMENT_ll ( XW_ANOM, XTHL_ANOM, XTHL_ANOM, & + OMASK, & + XLES_RESOLVED_WThl2(:,NLES_CURRENT_TCOUNT,IMASK) ) + + CALL LES_3RD_MOMENT_ll ( XW_ANOM, XW_ANOM, XTHL_ANOM, & + OMASK, & + XLES_RESOLVED_W2Thl(:,NLES_CURRENT_TCOUNT,IMASK) ) + + ELSE + CALL LES_3RD_MOMENT_ll ( XW_ANOM, ZTH_ANOM, ZTH_ANOM, & + OMASK, & + XLES_RESOLVED_WThl2(:,NLES_CURRENT_TCOUNT,IMASK) ) + + CALL LES_3RD_MOMENT_ll ( XW_ANOM, XW_ANOM, ZTH_ANOM, & + OMASK, & + XLES_RESOLVED_W2Thl(:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF +! +!* third moments of water vapor +! + IF (LUSERV) THEN + CALL LES_3RD_MOMENT_ll ( XW_ANOM, ZRV_ANOM, ZRV_ANOM, & + OMASK, & + XLES_RESOLVED_WRv2 (:,NLES_CURRENT_TCOUNT,IMASK) ) + + CALL LES_3RD_MOMENT_ll ( XW_ANOM, XW_ANOM, ZRV_ANOM, & + OMASK, & + XLES_RESOLVED_W2Rv (:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF + + IF (LUSERC) THEN + CALL LES_3RD_MOMENT_ll ( XW_ANOM, XTHL_ANOM, ZRV_ANOM, & + OMASK, & + XLES_RESOLVED_WThlRv(:,NLES_CURRENT_TCOUNT,IMASK) ) + ELSE IF (LUSERV) THEN + CALL LES_3RD_MOMENT_ll ( XW_ANOM, ZTH_ANOM, ZRV_ANOM, & + OMASK, & + XLES_RESOLVED_WThlRv(:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF +! +!* third moments of total water +! + IF (LUSERC) THEN + CALL LES_3RD_MOMENT_ll ( XW_ANOM, XRT_ANOM, XRT_ANOM, & + OMASK, & + XLES_RESOLVED_WRt2 (:,NLES_CURRENT_TCOUNT,IMASK) ) + + CALL LES_3RD_MOMENT_ll ( XW_ANOM, XW_ANOM, XRT_ANOM, & + OMASK, & + XLES_RESOLVED_W2Rt (:,NLES_CURRENT_TCOUNT,IMASK) ) + CALL LES_3RD_MOMENT_ll ( XW_ANOM, XTHL_ANOM, XRT_ANOM, & + OMASK, & + XLES_RESOLVED_WThlRt (:,NLES_CURRENT_TCOUNT,IMASK) ) + ELSE IF (LUSERV) THEN + CALL LES_3RD_MOMENT_ll ( XW_ANOM, ZRV_ANOM, ZRV_ANOM, & + OMASK, & + XLES_RESOLVED_WRt2 (:,NLES_CURRENT_TCOUNT,IMASK) ) + + CALL LES_3RD_MOMENT_ll ( XW_ANOM, XW_ANOM, ZRV_ANOM, & + OMASK, & + XLES_RESOLVED_W2Rt (:,NLES_CURRENT_TCOUNT,IMASK) ) + CALL LES_3RD_MOMENT_ll ( XW_ANOM, ZTH_ANOM, ZRV_ANOM, & + OMASK, & + XLES_RESOLVED_WThlRt (:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF +! +!* third moments of cloud water +! + IF (LUSERC) THEN + CALL LES_3RD_MOMENT_ll ( XW_ANOM, ZRC_ANOM, ZRC_ANOM, & + OMASK, & + XLES_RESOLVED_WRc2 (:,NLES_CURRENT_TCOUNT,IMASK) ) + + CALL LES_3RD_MOMENT_ll ( XW_ANOM, XW_ANOM, ZRC_ANOM, & + OMASK, & + XLES_RESOLVED_W2Rc (:,NLES_CURRENT_TCOUNT,IMASK) ) + + CALL LES_3RD_MOMENT_ll ( XW_ANOM, XTHL_ANOM, ZRC_ANOM, & + OMASK, & + XLES_RESOLVED_WThlRc(:,NLES_CURRENT_TCOUNT,IMASK) ) + + CALL LES_3RD_MOMENT_ll ( XW_ANOM, ZRV_ANOM, ZRC_ANOM, & + OMASK, & + XLES_RESOLVED_WRvRc (:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF +! +!* third moments of cloud ice +! + IF (LUSERI) THEN + CALL LES_3RD_MOMENT_ll ( XW_ANOM, ZRI_ANOM, ZRI_ANOM, & + OMASK, & + XLES_RESOLVED_WRi2 (:,NLES_CURRENT_TCOUNT,IMASK) ) + + CALL LES_3RD_MOMENT_ll ( XW_ANOM, XW_ANOM, ZRI_ANOM, & + OMASK, & + XLES_RESOLVED_W2Ri (:,NLES_CURRENT_TCOUNT,IMASK) ) + + CALL LES_3RD_MOMENT_ll ( XW_ANOM, XTHL_ANOM, ZRI_ANOM, & + OMASK, & + XLES_RESOLVED_WThlRi(:,NLES_CURRENT_TCOUNT,IMASK) ) + + CALL LES_3RD_MOMENT_ll ( XW_ANOM, ZRV_ANOM, ZRI_ANOM, & + OMASK, & + XLES_RESOLVED_WRvRi (:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF +! +!* third moments of scalar variables +! + DO JSV=1,NSV + CALL LES_3RD_MOMENT_ll ( XW_ANOM, XSV_ANOM(:,:,:,JSV), XSV_ANOM(:,:,:,JSV), & + OMASK, & + XLES_RESOLVED_WSv2 (:,NLES_CURRENT_TCOUNT,IMASK,JSV) ) + + CALL LES_3RD_MOMENT_ll ( XW_ANOM, XW_ANOM, XSV_ANOM(:,:,:,JSV), & + OMASK, & + XLES_RESOLVED_W2Sv (:,NLES_CURRENT_TCOUNT,IMASK,JSV) ) + IF (LUSERC) THEN + CALL LES_3RD_MOMENT_ll ( XW_ANOM, XTHL_ANOM, XSV_ANOM(:,:,:,JSV), & + OMASK, & + XLES_RESOLVED_WThlSv(:,NLES_CURRENT_TCOUNT,IMASK,JSV) ) + ELSE + CALL LES_3RD_MOMENT_ll ( XW_ANOM, ZTH_ANOM, XSV_ANOM(:,:,:,JSV), & + OMASK, & + XLES_RESOLVED_WThlSv(:,NLES_CURRENT_TCOUNT,IMASK,JSV) ) + END IF + + IF (LUSERV) THEN + CALL LES_3RD_MOMENT_ll ( XW_ANOM, ZRV_ANOM, XSV_ANOM(:,:,:,JSV), & + OMASK, & + XLES_RESOLVED_WRvSv (:,NLES_CURRENT_TCOUNT,IMASK,JSV) ) + END IF + END DO +! +!* presso-correlations +! +! + CALL LES_FLUX_ll ( XTHL_ANOM, ZDPDZ_ANOM, & + OMASK, & + XLES_RESOLVED_ThlPz(:,NLES_CURRENT_TCOUNT,IMASK) ) + + IF (LUSERV) & + CALL LES_FLUX_ll ( ZRV_ANOM, ZDPDZ_ANOM, & + OMASK, & + XLES_RESOLVED_RvPz(:,NLES_CURRENT_TCOUNT,IMASK) ) + + IF (LUSERC) THEN + CALL LES_FLUX_ll ( XRT_ANOM, ZDPDZ_ANOM, & + OMASK, & + XLES_RESOLVED_RtPz(:,NLES_CURRENT_TCOUNT,IMASK) ) + + CALL LES_FLUX_ll ( ZRC_ANOM, ZDPDZ_ANOM, & + OMASK, & + XLES_RESOLVED_RcPz(:,NLES_CURRENT_TCOUNT,IMASK) ) + END IF + + IF (LUSERI) & + CALL LES_FLUX_ll ( ZRI_ANOM, ZDPDZ_ANOM, & + OMASK, & + XLES_RESOLVED_RiPz(:,NLES_CURRENT_TCOUNT,IMASK) ) + +! +! +!* resolved turbulent kinetic energy fluxes +! + + CALL LES_3RD_MOMENT_ll ( XU_ANOM, XU_ANOM, XU_ANOM, & + OMASK, & + ZLES_RESOLVED_U3 (:) ) + + CALL LES_3RD_MOMENT_ll ( XU_ANOM, XV_ANOM, XV_ANOM, & + OMASK, & + ZLES_RESOLVED_UV2 (:) ) + + CALL LES_3RD_MOMENT_ll ( XU_ANOM, XW_ANOM, XW_ANOM, & + OMASK, & + ZLES_RESOLVED_UW2 (:) ) + + XLES_RESOLVED_UKe(:,NLES_CURRENT_TCOUNT,IMASK) = 0.5*( ZLES_RESOLVED_U3 & + + ZLES_RESOLVED_UV2 & + + ZLES_RESOLVED_UW2 ) + + + + CALL LES_3RD_MOMENT_ll ( XV_ANOM, XU_ANOM, XU_ANOM, & + OMASK, & + ZLES_RESOLVED_VU2 (:) ) + + CALL LES_3RD_MOMENT_ll ( XV_ANOM, XV_ANOM, XV_ANOM, & + OMASK, & + ZLES_RESOLVED_V3 (:) ) + + CALL LES_3RD_MOMENT_ll ( XV_ANOM, XW_ANOM, XW_ANOM, & + OMASK, & + ZLES_RESOLVED_VW2 (:) ) + + XLES_RESOLVED_VKe(:,NLES_CURRENT_TCOUNT,IMASK) = 0.5*( ZLES_RESOLVED_VU2 & + + ZLES_RESOLVED_V3 & + + ZLES_RESOLVED_VW2 ) + + + CALL LES_3RD_MOMENT_ll ( XW_ANOM, XU_ANOM, XU_ANOM, & + OMASK, & + ZLES_RESOLVED_WU2 (:) ) + + CALL LES_3RD_MOMENT_ll ( XW_ANOM, XV_ANOM, XV_ANOM, & + OMASK, & + ZLES_RESOLVED_WV2 (:) ) + + XLES_RESOLVED_WKe(:,NLES_CURRENT_TCOUNT,IMASK) = 0.5*( ZLES_RESOLVED_WU2 & + + ZLES_RESOLVED_WV2 & + + XLES_RESOLVED_W3(:,NLES_CURRENT_TCOUNT,IMASK) ) + +! +! +!------------------------------------------------------------------------------- +! +! 1.6 Subgrid quantities +! ------------------ +! +IF (LLES_SUBGRID) THEN +! +!* wind fluxes and variances +! + CALL LES_MEAN_ll ( ZTKE_LES, OMASK, & + XLES_SUBGRID_Tke(:,NLES_CURRENT_TCOUNT,IMASK) ) + + CALL LES_MEAN_MPROC ( XLES_SUBGRID_UV(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_WU(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_WV(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_U2(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_V2(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_W2(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! +! +!* liquid potential temperature fluxes +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_UThl(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_VThl(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_WThl(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + +!* liquid potential temperature variance +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_Thl2(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! +!* Mass flux scheme of shallow convection +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_THLUP_MF(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_SUBGRID_RTUP_MF(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_RVUP_MF(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_RCUP_MF(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_RIUP_MF(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_WUP_MF(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_MASSFLUX(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_DETR(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_ENTR(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_FRACUP(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_THVUP_MF(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_WTHLMF(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_WRTMF(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_WTHVMF(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_WUMF(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_WVMF(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + +!* total water mixing ratio fluxes, correlation and variance +! + IF (LUSERV) THEN + CALL LES_MEAN_MPROC ( XLES_SUBGRID_URt(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + ! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_VRt(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + ! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_WRt(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + ! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_ThlRt(:,NLES_CURRENT_TCOUNT,IMASK),& + IAVG_PTS(:), IUND_PTS(:) ) + ! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_Rt2(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + END IF +! +!* scalar variances +! + DO JSV=1,NSV + CALL LES_MEAN_MPROC ( XLES_SUBGRID_Sv2(:,NLES_CURRENT_TCOUNT,IMASK,JSV), & + IAVG_PTS(:), IUND_PTS(:) ) + END DO +! +!* cloud water mixing ratio fluxes +! + IF (LUSERC) THEN + CALL LES_MEAN_MPROC ( XLES_SUBGRID_URc(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + ! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_VRc(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + ! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_WRc(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + END IF +! +!* scalar variables fluxes +! + DO JSV=1,NSV + CALL LES_MEAN_MPROC ( XLES_SUBGRID_USv(:,NLES_CURRENT_TCOUNT,IMASK,JSV), & + IAVG_PTS(:), IUND_PTS(:) ) + ! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_VSv(:,NLES_CURRENT_TCOUNT,IMASK,JSV), & + IAVG_PTS(:), IUND_PTS(:) ) + ! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_WSv(:,NLES_CURRENT_TCOUNT,IMASK,JSV), & + IAVG_PTS(:), IUND_PTS(:) ) + END DO +! +!* subgrid turbulent kinetic energy fluxes +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_UTke(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + ! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_VTke(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + ! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_WTke(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_SUBGRID_ddz_WTke(:,NLES_CURRENT_TCOUNT,IMASK),& + IAVG_PTS(:), IUND_PTS(:) ) +! +!* fluxes and correlations with virtual potential temperature +! + IF (LUSERV) THEN + CALL LES_MEAN_MPROC ( XLES_SUBGRID_WThv(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_SUBGRID_ThlThv(:,NLES_CURRENT_TCOUNT,IMASK),& + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_SUBGRID_RtThv(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + DO JSV=1,NSV + CALL LES_MEAN_MPROC ( XLES_SUBGRID_SvThv(:,NLES_CURRENT_TCOUNT,IMASK,JSV), & + IAVG_PTS(:), IUND_PTS(:) ) + END DO + END IF +! +!* third order fluxes +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_W2Thl(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_SUBGRID_WThl2(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + IF (LUSERV) THEN + CALL LES_MEAN_MPROC ( XLES_SUBGRID_W2Rt(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_SUBGRID_WThlRt(:,NLES_CURRENT_TCOUNT,IMASK),& + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_SUBGRID_WRt2(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + END IF + DO JSV=1,NSV + CALL LES_MEAN_MPROC ( XLES_SUBGRID_W2Sv(:,NLES_CURRENT_TCOUNT,IMASK,JSV), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_SUBGRID_WSv2(:,NLES_CURRENT_TCOUNT,IMASK,JSV), & + IAVG_PTS(:), IUND_PTS(:) ) + END DO +! +!* dissipative terms +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_DISS_Tke(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_SUBGRID_DISS_Thl2(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + IF (LUSERV) THEN + CALL LES_MEAN_MPROC ( XLES_SUBGRID_DISS_Rt2(:,NLES_CURRENT_TCOUNT,IMASK),& + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_SUBGRID_DISS_ThlRt(:,NLES_CURRENT_TCOUNT,IMASK),& + IAVG_PTS(:), IUND_PTS(:) ) + END IF + + DO JSV=1,NSV + CALL LES_MEAN_MPROC ( XLES_SUBGRID_DISS_Sv2(:,NLES_CURRENT_TCOUNT,IMASK,JSV), & + IAVG_PTS(:), IUND_PTS(:) ) + END DO +! +!* presso-correlation terms +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_WP(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_SUBGRID_ThlPz(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + IF (LUSERV) THEN + CALL LES_MEAN_MPROC ( XLES_SUBGRID_RtPz(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + END IF + + DO JSV=1,NSV + CALL LES_MEAN_MPROC ( XLES_SUBGRID_SvPz(:,NLES_CURRENT_TCOUNT,IMASK,JSV), & + IAVG_PTS(:), IUND_PTS(:) ) + END DO + +!* phi3 and psi3 terms +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_PHI3(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + IF (LUSERV) THEN + CALL LES_MEAN_MPROC ( XLES_SUBGRID_PSI3(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + END IF +! +!* subgrid mixing length +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_LMix(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! +!* subgrid dissipative length +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_LDiss(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) +! +!* eddy diffusivities +! + CALL LES_MEAN_MPROC ( XLES_SUBGRID_Km(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_SUBGRID_Kh(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + +END IF +! +! computation of KHT and KHR depending on LLES + IF (LUSERC) THEN + IF (LLES_RESOLVED) THEN + XLES_MEAN_KHt(:,NLES_CURRENT_TCOUNT,IMASK)=0. + WHERE(XLES_MEAN_DTHLDZ(:,NLES_CURRENT_TCOUNT,IMASK)/=0) & + XLES_MEAN_KHt(:,NLES_CURRENT_TCOUNT,IMASK)=-1. & + *XLES_RESOLVED_WThl (:,NLES_CURRENT_TCOUNT,IMASK)/ & + XLES_MEAN_DTHLDZ(:,NLES_CURRENT_TCOUNT,IMASK) + XLES_MEAN_KHr(:,NLES_CURRENT_TCOUNT,IMASK)=0. + WHERE(XLES_MEAN_DRtDZ(:,NLES_CURRENT_TCOUNT,IMASK)/=0) & + XLES_MEAN_KHr(:,NLES_CURRENT_TCOUNT,IMASK)=-1.* & + XLES_RESOLVED_WRt (:,NLES_CURRENT_TCOUNT,IMASK)/ & + XLES_MEAN_DRtDZ(:,NLES_CURRENT_TCOUNT,IMASK) + END IF + IF (LLES_SUBGRID) THEN + XLES_MEAN_KHt(:,NLES_CURRENT_TCOUNT,IMASK)=0. + WHERE(XLES_MEAN_DTHLDZ(:,NLES_CURRENT_TCOUNT,IMASK)/=0) & + XLES_MEAN_KHt(:,NLES_CURRENT_TCOUNT,IMASK)=-1. & + *XLES_SUBGRID_WThl (:,NLES_CURRENT_TCOUNT,IMASK) / & + XLES_MEAN_DTHLDZ(:,NLES_CURRENT_TCOUNT,IMASK) + XLES_MEAN_KHr(:,NLES_CURRENT_TCOUNT,IMASK)=0. + WHERE(XLES_MEAN_DRtDZ(:,NLES_CURRENT_TCOUNT,IMASK)/=0) & + XLES_MEAN_KHr(:,NLES_CURRENT_TCOUNT,IMASK)=-1.* & + XLES_SUBGRID_WRt (:,NLES_CURRENT_TCOUNT,IMASK) / & + XLES_MEAN_DRtDZ(:,NLES_CURRENT_TCOUNT,IMASK) + END IF + IF (LLES_RESOLVED .AND. LLES_SUBGRID) THEN + XLES_MEAN_KHt(:,NLES_CURRENT_TCOUNT,IMASK)=0. + WHERE(XLES_MEAN_DTHLDZ(:,NLES_CURRENT_TCOUNT,IMASK)/=0) & + XLES_MEAN_KHt(:,NLES_CURRENT_TCOUNT,IMASK)=-1. & + *(XLES_RESOLVED_WThl (:,NLES_CURRENT_TCOUNT,IMASK)+ & + XLES_SUBGRID_WThl (:,NLES_CURRENT_TCOUNT,IMASK))/ & + XLES_MEAN_DTHLDZ(:,NLES_CURRENT_TCOUNT,IMASK) + XLES_MEAN_KHr(:,NLES_CURRENT_TCOUNT,IMASK)=0. + WHERE(XLES_MEAN_DRtDZ(:,NLES_CURRENT_TCOUNT,IMASK)/=0) & + XLES_MEAN_KHr(:,NLES_CURRENT_TCOUNT,IMASK)=-1.* & + (XLES_RESOLVED_WRt (:,NLES_CURRENT_TCOUNT,IMASK)+ & + XLES_SUBGRID_WRt (:,NLES_CURRENT_TCOUNT,IMASK)) / & + XLES_MEAN_DRtDZ(:,NLES_CURRENT_TCOUNT,IMASK) + END IF + END IF +!------------------------------------------------------------------------------- +! +! 1.7 Interaction of subgrid and resolved quantities +! ---------------------------------------------- +! +!* WARNING: these terms also contain the term due to the mean flow. +! this mean flow contribution will be removed from them +! when treated in write_les_budgetn.f90 +! +! +!* subgrid turbulent kinetic energy fluxes +! +IF (LLES_RESOLVED) THEN + CALL LES_FLUX_ll ( XU_ANOM, ZTKE_LES, & + OMASK, & + XLES_RES_U_SBG_Tke(:,NLES_CURRENT_TCOUNT,IMASK) ) +! + CALL LES_FLUX_ll ( XV_ANOM, ZTKE_LES, & + OMASK, & + XLES_RES_V_SBG_Tke(:,NLES_CURRENT_TCOUNT,IMASK) ) +! + CALL LES_FLUX_ll ( XW_ANOM, ZTKE_LES, & + OMASK, & + XLES_RES_W_SBG_Tke(:,NLES_CURRENT_TCOUNT,IMASK) ) +END IF +! +!* WARNING: these terms also contain the term due to the mean flow. +! this mean flow contribution will be removed from them +! when treated in write_les_budgetn.f90 +! +!* production terms for subgrid quantities +! +IF (LLES_RESOLVED .AND. LLES_SUBGRID) THEN + CALL LES_MEAN_MPROC ( XLES_RES_ddxa_U_SBG_UaU(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_RES_ddxa_V_SBG_UaV(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_RES_ddxa_W_SBG_UaW(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_RES_ddxa_W_SBG_UaThl(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_RES_ddxa_Thl_SBG_UaW(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_RES_ddz_Thl_SBG_W2 (:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_RES_ddxa_Thl_SBG_UaThl(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + IF (LUSERV) THEN + CALL LES_MEAN_MPROC ( XLES_RES_ddxa_W_SBG_UaRt(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_RES_ddxa_Rt_SBG_UaW(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_RES_ddz_Rt_SBG_W2 (:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_RES_ddxa_Thl_SBG_UaRt(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_RES_ddxa_Rt_SBG_UaThl(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_RES_ddxa_Rt_SBG_UaRt(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + END IF +! +!* WARNING: these terms also contain the term due to the mean flow. +! this mean flow contribution will be removed from them +! when treated in write_les_budgetn.f90 +! +!* turbulent transport and advection terms for subgrid quantities +! + CALL LES_MEAN_MPROC ( XLES_RES_W_SBG_WThl(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_RES_W_SBG_Thl2(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + IF (LUSERV) THEN + CALL LES_MEAN_MPROC ( XLES_RES_W_SBG_WRt(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_RES_W_SBG_Rt2(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_RES_W_SBG_ThlRt(:,NLES_CURRENT_TCOUNT,IMASK), & + IAVG_PTS(:), IUND_PTS(:) ) + + END IF + + DO JSV=1,NSV + CALL LES_MEAN_MPROC ( XLES_RES_W_SBG_WSv(:,NLES_CURRENT_TCOUNT,IMASK,JSV), & + IAVG_PTS(:), IUND_PTS(:) ) + + CALL LES_MEAN_MPROC ( XLES_RES_W_SBG_Sv2(:,NLES_CURRENT_TCOUNT,IMASK,JSV), & + IAVG_PTS(:), IUND_PTS(:) ) + END DO +END IF +! +!------------------------------------------------------------------------------- +! +! 2. The following is for cartesian mask only +! ---------------------------------------- +! +IF (IMASK>1) RETURN +! +!------------------------------------------------------------------------------- +! +! 3. Updraft diagnostics +! ------------------- +! +IF (LLES_UPDRAFT) THEN +! + DO JK=1,NLES_K + GUPDRAFT_MASK(:,:,JK) = (XW_ANOM(:,:,JK) > 0.) .AND. LLES_CURRENT_CART_MASK(:,:,JK) + END DO +! +! +! 3.1 Updraft fraction +! ---------------- +! + ZUPDRAFT(:,:,:) = 0. + WHERE (GUPDRAFT_MASK(:,:,:)) + ZUPDRAFT(:,:,:) = 1. + END WHERE +! + CALL LES_MEAN_ll ( ZUPDRAFT, OMASK, & + XLES_UPDRAFT(:,NLES_CURRENT_TCOUNT) ) +! +! +! 3.2 Updraft mean quantities +! ----------------------- +! +!* vertical wind velocity +! + CALL LES_MEAN_ll ( ZW_LES, GUPDRAFT_MASK, & + XLES_UPDRAFT_W(:,NLES_CURRENT_TCOUNT) ) +! +!* potential temperature +! + CALL LES_MEAN_ll ( ZTH_LES, GUPDRAFT_MASK, & + XLES_UPDRAFT_Th(:,NLES_CURRENT_TCOUNT) ) +! +!* liquid potential temperature +! + IF (LUSERC) & + CALL LES_MEAN_ll ( ZTHL_LES, GUPDRAFT_MASK, & + XLES_UPDRAFT_Thl(:,NLES_CURRENT_TCOUNT) ) +! +!* virtual potential temperature +! + IF (LUSERV) & + CALL LES_MEAN_ll ( ZTHV_LES, GUPDRAFT_MASK, & + XLES_UPDRAFT_Thv(:,NLES_CURRENT_TCOUNT) ) +! +!* vapor mixing ratio +! + IF (LUSERV) & + CALL LES_MEAN_ll ( ZRV_LES, GUPDRAFT_MASK, & + XLES_UPDRAFT_Rv(:,NLES_CURRENT_TCOUNT) ) +! +!* cloud water mixing ratio +! + IF (LUSERC) & + CALL LES_MEAN_ll ( ZRC_LES, GUPDRAFT_MASK, & + XLES_UPDRAFT_Rc(:,NLES_CURRENT_TCOUNT) ) +! +!* rain mixing ratio +! + IF (LUSERR) & + CALL LES_MEAN_ll ( ZRR_LES, GUPDRAFT_MASK, & + XLES_UPDRAFT_Rr(:,NLES_CURRENT_TCOUNT) ) +! +!* cloud ice mixing ratio +! + IF (LUSERI) & + CALL LES_MEAN_ll ( ZRI_LES, GUPDRAFT_MASK, & + XLES_UPDRAFT_Ri(:,NLES_CURRENT_TCOUNT) ) +! +!* snow mixing ratio +! + IF (LUSERS) & + CALL LES_MEAN_ll ( ZRS_LES, GUPDRAFT_MASK, & + XLES_UPDRAFT_Rs(:,NLES_CURRENT_TCOUNT) ) +! +!* graupel mixing ratio +! + IF (LUSERG) & + CALL LES_MEAN_ll ( ZRG_LES, GUPDRAFT_MASK, & + XLES_UPDRAFT_Rg(:,NLES_CURRENT_TCOUNT) ) +! +!* hail mixing ratio +! + IF (LUSERH) & + CALL LES_MEAN_ll ( ZRG_LES, GUPDRAFT_MASK, & + XLES_UPDRAFT_Rh(:,NLES_CURRENT_TCOUNT) ) +! +!* scalar variables +! + DO JSV=1,NSV + CALL LES_MEAN_ll ( ZSV_LES(:,:,:,JSV), GUPDRAFT_MASK, & + XLES_UPDRAFT_Sv(:,NLES_CURRENT_TCOUNT,JSV) ) + END DO +! +!* subgrid turbulent kinetic energy +! + CALL LES_MEAN_ll ( ZTKE_LES, GUPDRAFT_MASK, & + XLES_UPDRAFT_Tke(:,NLES_CURRENT_TCOUNT) ) +! +! +! 3.3 Updraft resolved quantities +! --------------------------- +! +! +!* resolved turbulent kinetic energy +! + CALL LES_FLUX_ll ( XU_ANOM, XU_ANOM, & + GUPDRAFT_MASK, & + ZLES_UPDRAFT_U2(:) ) + + CALL LES_FLUX_ll ( XV_ANOM, XV_ANOM, & + GUPDRAFT_MASK, & + ZLES_UPDRAFT_V2(:) ) + + CALL LES_FLUX_ll ( XW_ANOM, XW_ANOM, & + GUPDRAFT_MASK, & + ZLES_UPDRAFT_W2(:) ) + + XLES_UPDRAFT_Ke(:,NLES_CURRENT_TCOUNT) = 0.5 * ( ZLES_UPDRAFT_U2(:) & + + ZLES_UPDRAFT_V2(:) & + + ZLES_UPDRAFT_W2(:) ) +! +!* vertical potential temperature flux +! + CALL LES_FLUX_ll ( XW_ANOM, ZTH_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_WTh(:,NLES_CURRENT_TCOUNT) ) +! +!* vertical liquid potential temperature flux +! + IF (LUSERC) & + CALL LES_FLUX_ll ( XW_ANOM, XTHL_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_WThl(:,NLES_CURRENT_TCOUNT) ) +! +!* vertical virtual potential temperature flux +! + IF (LUSERV) & + CALL LES_FLUX_ll ( XW_ANOM, ZTHV_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_WThv(:,NLES_CURRENT_TCOUNT) ) +! +!* potential temperature variance +! + CALL LES_FLUX_ll ( ZTH_ANOM, ZTH_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_Th2(:,NLES_CURRENT_TCOUNT) ) +! +!* liquid potential temperature variance +! + IF (LUSERC) & + CALL LES_FLUX_ll ( XTHL_ANOM, XTHL_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_Thl2(:,NLES_CURRENT_TCOUNT) ) +! +!* potential temperature - virtual potential temperature covariance +! + IF (LUSERV) & + CALL LES_FLUX_ll ( ZTH_ANOM, ZTHV_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_ThThv (:,NLES_CURRENT_TCOUNT) ) +! +!* liquid potential temperature - virtual potential temperature covariance +! + IF (LUSERC) & + CALL LES_FLUX_ll ( XTHL_ANOM, ZTHV_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_ThlThv(:,NLES_CURRENT_TCOUNT) ) +! +!* water vapor mixing ratio flux, variance and correlations +! + IF (LUSERV) THEN + CALL LES_FLUX_ll ( XW_ANOM, ZRV_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_WRv(:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( ZRV_ANOM, ZRV_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_Rv2(:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( ZTH_ANOM, ZRV_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_ThRv (:,NLES_CURRENT_TCOUNT) ) + ! + IF (LUSERC) & + CALL LES_FLUX_ll ( XTHL_ANOM, ZRV_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_ThlRv(:,NLES_CURRENT_TCOUNT) ) + + CALL LES_FLUX_ll ( ZTHV_ANOM, ZRV_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_ThvRv(:,NLES_CURRENT_TCOUNT) ) + END IF +! +!* cloud water mixing ratio flux +! + IF (LUSERC) THEN + CALL LES_FLUX_ll ( XW_ANOM, ZRC_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_WRc(:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( ZRC_ANOM, ZRC_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_Rc2(:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( ZTH_ANOM, ZRC_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_ThRc (:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( XTHL_ANOM, ZRC_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_ThlRc(:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( ZTHV_ANOM, ZRC_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_ThvRc(:,NLES_CURRENT_TCOUNT) ) + END IF +! +!* cloud ice mixing ratio flux +! + IF (LUSERI) THEN + CALL LES_FLUX_ll ( XW_ANOM, ZRI_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_WRi(:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( ZRI_ANOM, ZRI_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_Ri2(:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( ZTH_ANOM, ZRI_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_ThRi (:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( XTHL_ANOM, ZRI_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_ThlRi(:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( ZTHV_ANOM, ZRI_ANOM, & + GUPDRAFT_MASK, & + XLES_UPDRAFT_ThvRi(:,NLES_CURRENT_TCOUNT) ) + END IF +! +!* scalar variables flux +! + DO JSV=1,NSV + CALL LES_FLUX_ll ( XW_ANOM, XSV_ANOM(:,:,:,JSV), & + GUPDRAFT_MASK, & + XLES_UPDRAFT_WSv(:,NLES_CURRENT_TCOUNT,JSV) ) + ! + CALL LES_FLUX_ll ( XSV_ANOM(:,:,:,JSV), XSV_ANOM(:,:,:,JSV), & + GUPDRAFT_MASK, & + XLES_UPDRAFT_Sv2(:,NLES_CURRENT_TCOUNT,JSV) ) + ! + CALL LES_FLUX_ll ( ZTH_ANOM, XSV_ANOM(:,:,:,JSV), & + GUPDRAFT_MASK, & + XLES_UPDRAFT_ThSv(:,NLES_CURRENT_TCOUNT,JSV) ) + ! + IF (LUSERC) & + CALL LES_FLUX_ll ( XTHL_ANOM, XSV_ANOM(:,:,:,JSV), & + GUPDRAFT_MASK, & + XLES_UPDRAFT_ThlSv(:,NLES_CURRENT_TCOUNT,JSV) ) + ! + IF (LUSERV) & + CALL LES_FLUX_ll ( ZTHV_ANOM, XSV_ANOM(:,:,:,JSV), & + GUPDRAFT_MASK, & + XLES_UPDRAFT_ThvSv(:,NLES_CURRENT_TCOUNT,JSV) ) + END DO +! +END IF +! +!------------------------------------------------------------------------------- +! +! 4. Downdraft diagnostics +! --------------------- +! +IF (LLES_DOWNDRAFT) THEN +! + DO JK=1,NLES_K + GDOWNDRAFT_MASK(:,:,JK) = (XW_ANOM(:,:,JK) <= 0.) .AND. LLES_CURRENT_CART_MASK(:,:,JK) + END DO +! +! +! 4.1 Downdraft fraction +! ------------------ +! + ZDOWNDRAFT(:,:,:) = 0. + WHERE (GDOWNDRAFT_MASK(:,:,:)) + ZDOWNDRAFT(:,:,:) = 1. + END WHERE +! + CALL LES_MEAN_ll ( ZDOWNDRAFT, OMASK, & + XLES_DOWNDRAFT(:,NLES_CURRENT_TCOUNT) ) +! +! +! 4.2 Downdraft mean quantities +! ------------------------- +! +!* vertical wind velocity +! + CALL LES_MEAN_ll ( ZW_LES, GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_W(:,NLES_CURRENT_TCOUNT) ) +! +!* potential temperature +! + CALL LES_MEAN_ll ( ZTH_LES, GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_Th(:,NLES_CURRENT_TCOUNT) ) +! +!* liquid potential temperature +! + IF (LUSERC) & + CALL LES_MEAN_ll ( ZTHL_LES, GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_Thl(:,NLES_CURRENT_TCOUNT) ) +! +!* virtual potential temperature +! + IF (LUSERV) & + CALL LES_MEAN_ll ( ZTHV_LES, GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_Thv(:,NLES_CURRENT_TCOUNT) ) +! +!* vapor mixing ratio +! + IF (LUSERV) & + CALL LES_MEAN_ll ( ZRV_LES, GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_Rv(:,NLES_CURRENT_TCOUNT) ) +! +!* cloud water mixing ratio +! + IF (LUSERC) & + CALL LES_MEAN_ll ( ZRC_LES, GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_Rc(:,NLES_CURRENT_TCOUNT) ) +! +!* rain mixing ratio +! + IF (LUSERR) & + CALL LES_MEAN_ll ( ZRR_LES, GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_Rr(:,NLES_CURRENT_TCOUNT) ) +! +!* cloud ice mixing ratio +! + IF (LUSERI) & + CALL LES_MEAN_ll ( ZRI_LES, GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_Ri(:,NLES_CURRENT_TCOUNT) ) +! +!* snow mixing ratio +! + IF (LUSERS) & + CALL LES_MEAN_ll ( ZRS_LES, GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_Rs(:,NLES_CURRENT_TCOUNT) ) +! +!* graupel mixing ratio +! + IF (LUSERG) & + CALL LES_MEAN_ll ( ZRG_LES, GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_Rg(:,NLES_CURRENT_TCOUNT) ) +! +!* hail mixing ratio +! + IF (LUSERH) & + CALL LES_MEAN_ll ( ZRG_LES, GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_Rh(:,NLES_CURRENT_TCOUNT) ) +! +!* scalar variables +! + DO JSV=1,NSV + CALL LES_MEAN_ll ( ZSV_LES(:,:,:,JSV), GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_Sv(:,NLES_CURRENT_TCOUNT,JSV) ) + END DO +! +!* subgrid turbulent kinetic energy +! + CALL LES_MEAN_ll ( ZTKE_LES, GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_Tke(:,NLES_CURRENT_TCOUNT) ) +! +! +! 4.3 Downdraft resolved quantities +! ----------------------------- +! +!* resolved turbulent kinetic energy +! + CALL LES_FLUX_ll ( XU_ANOM, XU_ANOM, & + GDOWNDRAFT_MASK, & + ZLES_DOWNDRAFT_U2(:) ) + + CALL LES_FLUX_ll ( XV_ANOM, XV_ANOM, & + GDOWNDRAFT_MASK, & + ZLES_DOWNDRAFT_V2(:) ) + + CALL LES_FLUX_ll ( XW_ANOM, XW_ANOM, & + GDOWNDRAFT_MASK, & + ZLES_DOWNDRAFT_W2(:) ) + + XLES_DOWNDRAFT_Ke(:,NLES_CURRENT_TCOUNT) = 0.5 * ( ZLES_DOWNDRAFT_U2(:) & + + ZLES_DOWNDRAFT_V2(:) & + + ZLES_DOWNDRAFT_W2(:) ) +! +!* vertical potential temperature flux +! + CALL LES_FLUX_ll ( XW_ANOM, ZTH_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_WTh(:,NLES_CURRENT_TCOUNT) ) +! +!* vertical liquid potential temperature flux +! + IF (LUSERC) & + CALL LES_FLUX_ll ( XW_ANOM, XTHL_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_WThl(:,NLES_CURRENT_TCOUNT) ) +! +!* vertical virtual potential temperature flux +! + IF (LUSERV) & + CALL LES_FLUX_ll ( XW_ANOM, ZTHV_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_WThv(:,NLES_CURRENT_TCOUNT) ) +! +!* potential temperature variance +! + CALL LES_FLUX_ll ( ZTH_ANOM, ZTH_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_Th2(:,NLES_CURRENT_TCOUNT) ) +! +!* liquid potential temperature variance +! + IF (LUSERC) & + CALL LES_FLUX_ll ( XTHL_ANOM, XTHL_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_Thl2(:,NLES_CURRENT_TCOUNT) ) +! +!* potential temperature - virtual potential temperature covariance +! + IF (LUSERV) & + CALL LES_FLUX_ll ( ZTH_ANOM, ZTHV_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_ThThv (:,NLES_CURRENT_TCOUNT) ) +! +!* liquid potential temperature - virtual potential temperature covariance +! + IF (LUSERC) & + CALL LES_FLUX_ll ( XTHL_ANOM, ZTHV_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_ThlThv(:,NLES_CURRENT_TCOUNT) ) +! +! +!* water vapor mixing ratio flux, variance and correlations +! + IF (LUSERV) THEN + CALL LES_FLUX_ll ( XW_ANOM, ZRV_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_WRv(:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( ZRV_ANOM, ZRV_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_Rv2(:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( ZTH_ANOM, ZRV_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_ThRv (:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( ZTHV_ANOM, ZRV_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_ThvRv(:,NLES_CURRENT_TCOUNT) ) + ! + IF (LUSERC) & + CALL LES_FLUX_ll ( XTHL_ANOM, ZRV_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_ThlRv(:,NLES_CURRENT_TCOUNT) ) + END IF +! +!* cloud water mixing ratio flux +! + IF (LUSERC) THEN + CALL LES_FLUX_ll ( XW_ANOM, ZRC_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_WRc(:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( ZRC_ANOM, ZRC_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_Rc2(:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( ZTH_ANOM, ZRC_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_ThRc (:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( ZTHV_ANOM, ZRC_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_ThvRc(:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( XTHL_ANOM, ZRC_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_ThlRc(:,NLES_CURRENT_TCOUNT) ) + END IF +! +!* cloud ice mixing ratio flux +! + IF (LUSERI) THEN + CALL LES_FLUX_ll ( XW_ANOM, ZRI_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_WRi(:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( ZRI_ANOM, ZRI_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_Ri2(:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( ZTH_ANOM, ZRI_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_ThRi (:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( ZTHV_ANOM, ZRI_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_ThvRi(:,NLES_CURRENT_TCOUNT) ) + ! + CALL LES_FLUX_ll ( XTHL_ANOM, ZRI_ANOM, & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_ThlRi(:,NLES_CURRENT_TCOUNT) ) + END IF +! +!* scalar variables flux +! + DO JSV=1,NSV + CALL LES_FLUX_ll ( XW_ANOM, XSV_ANOM(:,:,:,JSV), & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_WSv(:,NLES_CURRENT_TCOUNT,JSV) ) + ! + CALL LES_FLUX_ll ( XSV_ANOM(:,:,:,JSV), XSV_ANOM(:,:,:,JSV), & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_Sv2(:,NLES_CURRENT_TCOUNT,JSV) ) + ! + CALL LES_FLUX_ll ( ZTH_ANOM, XSV_ANOM(:,:,:,JSV), & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_ThSv(:,NLES_CURRENT_TCOUNT,JSV) ) + ! + IF (LUSERC) & + CALL LES_FLUX_ll ( XTHL_ANOM, XSV_ANOM(:,:,:,JSV), & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_ThlSv(:,NLES_CURRENT_TCOUNT,JSV) ) + ! + IF (LUSERV) & + CALL LES_FLUX_ll ( ZTHV_ANOM, XSV_ANOM(:,:,:,JSV), & + GDOWNDRAFT_MASK, & + XLES_DOWNDRAFT_ThvSv(:,NLES_CURRENT_TCOUNT,JSV) ) + END DO +! +END IF +! +!------------------------------------------------------------------------------- +! +! 5. surface or 2D variables (only for the cartesian mask) +! ----------------------- +! +!* surface flux of temperature Qo +! +CALL LES_MEAN_MPROC ( XLES_Q0 (NLES_CURRENT_TCOUNT), IAVG_PTS(1), IUND_PTS(1) ) +! +!* surface flux of water vapor Eo +! +CALL LES_MEAN_MPROC ( XLES_E0 (NLES_CURRENT_TCOUNT), IAVG_PTS(1), IUND_PTS(1) ) +! +!* surface flux for scalar variables +! +DO JSV=1,NSV + CALL LES_MEAN_MPROC ( XLES_SV0 (NLES_CURRENT_TCOUNT,JSV), IAVG_PTS(1), IUND_PTS(1) ) +END DO +! +!* surface flux of U wind component +! +CALL LES_MEAN_MPROC ( XLES_UW0 (NLES_CURRENT_TCOUNT), IAVG_PTS(1), IUND_PTS(1) ) +! +!* surface flux of V wind component +! +CALL LES_MEAN_MPROC ( XLES_VW0 (NLES_CURRENT_TCOUNT), IAVG_PTS(1), IUND_PTS(1) ) +! +!* friction velocity u* +! +!* average of local u* +!!CALL LES_MEAN_MPROC ( XLES_USTAR(NLES_CURRENT_TCOUNT), IAVG_PTS(1), IUND_PTS(1) ) +!* or true global u* +XLES_USTAR(NLES_CURRENT_TCOUNT) = SQRT(SQRT(XLES_UW0(NLES_CURRENT_TCOUNT)**2 & + +XLES_VW0(NLES_CURRENT_TCOUNT)**2 )) +! +!* Boundary layer height +! +IF (CBL_HEIGHT_DEF=='WTV') THEN +! +!* level where temperature flux is minimum +! +ALLOCATE(ZWORK(SIZE(XLES_SUBGRID_WTHVMF(:,NLES_CURRENT_TCOUNT,IMASK),1))) +ZWORK=XLES_SUBGRID_WTHVMF(:,NLES_CURRENT_TCOUNT,IMASK) +WHERE(ZWORK==XUNDEF) ZWORK=0. + + IF (LUSERC) THEN + IKMIN_FLUX = MINLOC( XLES_RESOLVED_WThv(:,NLES_CURRENT_TCOUNT,1) & + + XLES_SUBGRID_WThl (:,NLES_CURRENT_TCOUNT,1) & + + ZWORK & ! flux if EDKF + + (XRV/XRD - 1.) *( XLES_SUBGRID_WRt (:,NLES_CURRENT_TCOUNT,1) & + -XLES_SUBGRID_WRc (:,NLES_CURRENT_TCOUNT,1)) ) + ELSE IF (LUSERV) THEN + IKMIN_FLUX = MINLOC( XLES_RESOLVED_WThv(:,NLES_CURRENT_TCOUNT,1) & + + ZWORK & ! flux if EDKF + + XLES_SUBGRID_WThl (:,NLES_CURRENT_TCOUNT,1) & + + (XRV/XRD - 1.) * XLES_SUBGRID_WRt (:,NLES_CURRENT_TCOUNT,1) ) + ELSE + IKMIN_FLUX = MINLOC( XLES_RESOLVED_WTh(:,NLES_CURRENT_TCOUNT,1) & + + ZWORK & ! flux if EDKF + + XLES_SUBGRID_WThl(:,NLES_CURRENT_TCOUNT,1) ) + END IF +DEALLOCATE(ZWORK) +! +!* boundary layer height +! + XLES_BL_HEIGHT(NLES_CURRENT_TCOUNT) = XLES_Z(IKMIN_FLUX(1)) - XLES_ZS +! +ELSE IF (CBL_HEIGHT_DEF=='DTH') THEN + IKMAX_TH=MAXLOC( ZLES_MEAN_DTHDZ(:)) + XLES_BL_HEIGHT(NLES_CURRENT_TCOUNT) = XLES_Z(IKMAX_TH(1)) - XLES_ZS +! +ELSE IF (CBL_HEIGHT_DEF=='KE ') THEN + + XLES_BL_HEIGHT(NLES_CURRENT_TCOUNT) = XLES_Z(NLES_K) - XLES_ZS +! +!* total Turbulent Kinetic Energy +! + ZKE_TOT(:) = 0. +! + ZKE_TOT(:) = ZKE_TOT(:) + XLES_SUBGRID_TKE (:,NLES_CURRENT_TCOUNT,1) +! + IF (CTURBLEN/='BL89' .AND. CTURBLEN/='RM17' .AND. LLES_RESOLVED) & + ZKE_TOT(:) = ZKE_TOT(:) + XLES_RESOLVED_KE(:,NLES_CURRENT_TCOUNT,1) +! + ZINT_KE_TOT = 0. +! +!* integration of total kinetic energy on boundary layer depth +! + ZINT_KE_TOT = ZINT_KE_TOT +XLES_Z(1)*ZKE_TOT(1) + DO JK=1,NLES_K-1 + ZINT_KE_TOT = ZINT_KE_TOT + (XLES_Z(JK+1)-XLES_Z(JK)) & + * 0.5 *( ZKE_TOT(JK+1) + ZKE_TOT(JK) ) +! +!* test of total kinetic energy smaller than 5% of the averaged value below +! + IF ( ZKE_TOT(JK+1) < 0.05 * ZINT_KE_TOT / (XLES_Z(JK+1)-XLES_Z(1)) ) THEN + XLES_BL_HEIGHT(NLES_CURRENT_TCOUNT) = XLES_Z(JK) - XLES_ZS + EXIT + END IF +! + END DO +! +ELSE IF (CBL_HEIGHT_DEF=='TKE') THEN + + XLES_BL_HEIGHT(NLES_CURRENT_TCOUNT) = XLES_Z(NLES_K) - XLES_ZS +! +!* subgrid Turbulent Kinetic Energy +! + ZKE_TOT(:) = XLES_SUBGRID_TKE (:,NLES_CURRENT_TCOUNT,1) +! + ZINT_KE_TOT = 0. +! +!* integration of subgrid kinetic energy on boundary layer depth +! + DO JK=1,NLES_K-1 + ZINT_KE_TOT = ZINT_KE_TOT + (XLES_Z(JK+1)-XLES_Z(JK)) & + * 0.5 *( ZKE_TOT(JK+1) + ZKE_TOT(JK) ) +! +!* test of subgrid kinetic energy smaller than 0.1% of the averaged value below +! + IF ( ZKE_TOT(JK+1) < 0.001 * ZINT_KE_TOT / (XLES_Z(JK+1)-XLES_Z(1)) ) THEN + XLES_BL_HEIGHT(NLES_CURRENT_TCOUNT) = XLES_Z(JK) - XLES_ZS + EXIT + END IF + END DO +ELSE IF (CBL_HEIGHT_DEF=='FRI') THEN + ZFRIC_LES = SQRT( ( XLES_SUBGRID_WU (:,NLES_CURRENT_TCOUNT,1) & + +XLES_RESOLVED_WU(:,NLES_CURRENT_TCOUNT,1))**2 & + +( XLES_SUBGRID_WV (:,NLES_CURRENT_TCOUNT,1) & + +XLES_RESOLVED_WV(:,NLES_CURRENT_TCOUNT,1))**2 ) + ZFRIC_SURF = XLES_USTAR(NLES_CURRENT_TCOUNT)**2 + CALL BL_DEPTH_DIAG(YLDIMPHYEX,ZFRIC_SURF, XLES_ZS, & + ZFRIC_LES, XLES_Z, & + XFTOP_O_FSURF,XLES_BL_HEIGHT(NLES_CURRENT_TCOUNT)) +END IF +! +! +!* integration of total kinetic energy on boundary layer depth +! +XLES_INT_TKE(NLES_CURRENT_TCOUNT)=ZINT_KE_TOT + !* integration of tke + ZTKET_LES(:,:) = 0. + DO JK=1,NLES_K-1 + ZKE_LES(:,:,JK)=0.5*(XU_ANOM(:,:,JK)*XU_ANOM(:,:,JK)+& + XV_ANOM(:,:,JK)*XV_ANOM(:,:,JK)+XW_ANOM(:,:,JK)*XW_ANOM(:,:,JK)) + + ZTKET_LES(:,:) = ZTKET_LES(:,:) + (ZZZ_LES(:,:,JK+1)-ZZZ_LES(:,:,JK)) & + * (ZTKE_LES(:,:,JK)+ZKE_LES(:,:,JK)) + END DO + CALL LES_MEAN_ll ( ZTKET_LES, LLES_CURRENT_CART_MASK(:,:,1), & + XLES_INT_TKE(NLES_CURRENT_TCOUNT) ) +! +!* convective velocity +! +XLES_WSTAR(NLES_CURRENT_TCOUNT) = 0. +! +IF ( XLES_Q0(NLES_CURRENT_TCOUNT) & + + (XRV/XRD-1.)*XLES_E0(NLES_CURRENT_TCOUNT) >0.) THEN + IF (LUSERV) THEN + XLES_WSTAR(NLES_CURRENT_TCOUNT) = & + ( XG / XLES_MEAN_Thv (1,NLES_CURRENT_TCOUNT,1) & + * ( XLES_Q0( NLES_CURRENT_TCOUNT ) & + + (XRV/XRD - 1.) * XLES_E0( NLES_CURRENT_TCOUNT )) & + * XLES_BL_HEIGHT( NLES_CURRENT_TCOUNT ) & + ) ** (1./3.) + ELSE + XLES_WSTAR(NLES_CURRENT_TCOUNT) = & + ( XG / XLES_MEAN_Th (1,NLES_CURRENT_TCOUNT,1) & + * ( XLES_Q0( NLES_CURRENT_TCOUNT ) & + + (XRV/XRD - 1.) * XLES_E0( NLES_CURRENT_TCOUNT )) & + * XLES_BL_HEIGHT( NLES_CURRENT_TCOUNT ) & + ) ** (1./3.) + END IF +END IF +! +!* cloud base height + IF (LUSERC) THEN + ZINT_RHOKE =0. + JJ=1 + DO JI=1,NLES_K + IF ((ZINT_RHOKE .EQ. 0) .AND. & + (XLES_MEAN_RC(JI,NLES_CURRENT_TCOUNT,1) .GT. 1.E-6)) THEN + ZINT_RHOKE=1. + JJ=JI + END IF + END DO + XLES_ZCB(NLES_CURRENT_TCOUNT)= XLES_Z(JJ)-XLES_ZS + ENDIF +! +!* height of max of cf + IF (LUSERC) THEN + IKMAX_CF= MAXLOC( XLES_MEAN_INDCf(:,NLES_CURRENT_TCOUNT,1)) + XLES_ZMAXCF(NLES_CURRENT_TCOUNT) = XLES_Z(IKMAX_CF(1)) - XLES_ZS + IKMAX_CF= MAXLOC( XLES_MEAN_INDCf2(:,NLES_CURRENT_TCOUNT,1)) + XLES_ZMAXCF2(NLES_CURRENT_TCOUNT) = XLES_Z(IKMAX_CF(1)) - XLES_ZS + ENDIF +! +!* Monin-Obukhov length +! +XLES_MO_LENGTH(NLES_CURRENT_TCOUNT) = 0. +! +IF (LUSERV) THEN + IF ( XLES_Q0(NLES_CURRENT_TCOUNT)+(XRV/XRD-1.)*XLES_E0(NLES_CURRENT_TCOUNT) /=0. )& + XLES_MO_LENGTH(NLES_CURRENT_TCOUNT) = (- (XLES_USTAR(NLES_CURRENT_TCOUNT))**3) & + / (XKARMAN*( XLES_Q0(NLES_CURRENT_TCOUNT) & + +(XRV/XRD-1.)*XLES_E0(NLES_CURRENT_TCOUNT)) & + *XG/XLES_MEAN_Thv(1,NLES_CURRENT_TCOUNT,1) ) +ELSE + IF ( XLES_Q0(NLES_CURRENT_TCOUNT) /=0. ) & + XLES_MO_LENGTH(NLES_CURRENT_TCOUNT) = (- (XLES_USTAR(NLES_CURRENT_TCOUNT))**3) & + / (XKARMAN*XLES_Q0(NLES_CURRENT_TCOUNT) & + *XG/XLES_MEAN_Th(1,NLES_CURRENT_TCOUNT,1) ) +END IF +! +!------------------------------------------------------------------------------- +! +! 6. correlations along x and y axes +! ------------------------------- +! +!* u * u +! +DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZU_SPEC(:,:,JK), ZU_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_UU(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_UU(:,JK,NLES_CURRENT_TCOUNT) ) +END DO +! +!* v * v +! +DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZV_SPEC(:,:,JK), ZV_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_VV(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_VV(:,JK,NLES_CURRENT_TCOUNT) ) +END DO +! +!* u * v +! +DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZU_SPEC(:,:,JK), ZV_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_UV(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_UV(:,JK,NLES_CURRENT_TCOUNT) ) +END DO +! +!* w * u +! +DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZW_SPEC(:,:,JK), ZU_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_WU(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_WU(:,JK,NLES_CURRENT_TCOUNT) ) +END DO +! +!* w * v +! +DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZW_SPEC(:,:,JK), ZV_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_WV(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_WV(:,JK,NLES_CURRENT_TCOUNT) ) +END DO +! +!* w * w +! +DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZW_SPEC(:,:,JK), ZW_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_WW(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_WW(:,JK,NLES_CURRENT_TCOUNT) ) +END DO +! +!* w * th +! +DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZW_SPEC(:,:,JK), ZTH_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_WTh(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_WTh(:,JK,NLES_CURRENT_TCOUNT) ) +END DO +! +!* w * thl +! +DO JK=1,NSPECTRA_K + IF (LUSERC) & + CALL LES_HOR_CORR( ZW_SPEC(:,:,JK), ZTHL_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_WThl(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_WThl(:,JK,NLES_CURRENT_TCOUNT) ) +END DO +! +!* th * th +! +DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZTH_SPEC(:,:,JK), ZTH_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_ThTh(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_ThTh(:,JK,NLES_CURRENT_TCOUNT) ) +END DO +! +!* thl * thl +! +DO JK=1,NSPECTRA_K + IF (LUSERC) & + CALL LES_HOR_CORR( ZTHL_SPEC(:,:,JK), ZTHL_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_ThlThl(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_ThlThl(:,JK,NLES_CURRENT_TCOUNT) ) +END DO +! +!* correlations with water vapor +! +IF (LUSERV) THEN + DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZW_SPEC(:,:,JK), ZRV_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_WRv(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_WRv(:,JK,NLES_CURRENT_TCOUNT) ) + END DO + ! + DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZTH_SPEC(:,:,JK), ZRV_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_ThRv(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_ThRv(:,JK,NLES_CURRENT_TCOUNT) ) + END DO + ! + DO JK=1,NSPECTRA_K + IF (LUSERC) & + CALL LES_HOR_CORR( ZTHL_SPEC(:,:,JK), ZRV_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_ThlRv(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_ThlRv(:,JK,NLES_CURRENT_TCOUNT) ) + END DO + ! + DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZRV_SPEC(:,:,JK), ZRV_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_RvRv(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_RvRv(:,JK,NLES_CURRENT_TCOUNT) ) + END DO +END IF +! +! +!* correlations with cloud water +! +IF (LUSERC) THEN + DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZW_SPEC(:,:,JK), ZRC_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_WRc(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_WRc(:,JK,NLES_CURRENT_TCOUNT) ) + END DO + ! + DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZTH_SPEC(:,:,JK), ZRC_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_ThRc(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_ThRc(:,JK,NLES_CURRENT_TCOUNT) ) + END DO + ! + DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZTHL_SPEC(:,:,JK), ZRC_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_ThlRc(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_ThlRc(:,JK,NLES_CURRENT_TCOUNT) ) + END DO + ! + DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZRC_SPEC(:,:,JK), ZRC_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_RcRc(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_RcRc(:,JK,NLES_CURRENT_TCOUNT) ) + END DO +END IF +! +!* correlations with cloud ice +! +IF (LUSERI) THEN + DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZW_SPEC(:,:,JK), ZRI_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_WRi(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_WRi(:,JK,NLES_CURRENT_TCOUNT) ) + END DO + ! + DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZTH_SPEC(:,:,JK), ZRI_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_ThRi(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_ThRi(:,JK,NLES_CURRENT_TCOUNT) ) + END DO + ! + DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZTHL_SPEC(:,:,JK), ZRI_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_ThlRi(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_ThlRi(:,JK,NLES_CURRENT_TCOUNT) ) + END DO + ! + DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZRI_SPEC(:,:,JK), ZRI_SPEC(:,:,JK), & + CLES_LBCX , CLES_LBCY, & + XCORRi_RiRi(:,JK,NLES_CURRENT_TCOUNT), & + XCORRj_RiRi(:,JK,NLES_CURRENT_TCOUNT) ) + END DO +END IF +! +!* correlations with scalar variables +! +DO JSV=1,NSV + DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZW_SPEC(:,:,JK), ZSV_SPEC(:,:,JK,JSV), & + CLES_LBCX , CLES_LBCY, & + XCORRi_WSv(:,JK,NLES_CURRENT_TCOUNT,JSV), & + XCORRj_WSv(:,JK,NLES_CURRENT_TCOUNT,JSV) ) + END DO + ! + DO JK=1,NSPECTRA_K + CALL LES_HOR_CORR( ZSV_SPEC(:,:,JK,JSV), ZSV_SPEC(:,:,JK,JSV), & + CLES_LBCX , CLES_LBCY, & + XCORRi_SvSv(:,JK,NLES_CURRENT_TCOUNT,JSV), & + XCORRj_SvSv(:,JK,NLES_CURRENT_TCOUNT,JSV) ) + END DO +END DO +! +!------------------------------------------------------------------------------- +! +END SUBROUTINE LES +! +!------------------------------------------------------------------------------- +! +END SUBROUTINE LES_n diff --git a/src/mesonh/ext/lidar.f90 b/src/mesonh/ext/lidar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ffce79b6c5351383d6a503c7071419a1568d17da --- /dev/null +++ b/src/mesonh/ext/lidar.f90 @@ -0,0 +1,688 @@ +!MNH_LIC Copyright 2007-2020 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_LIDAR +! ################# +! +INTERFACE + SUBROUTINE LIDAR(HCLOUD,HVIEW,PALT,PWVL,PZZ,PRHO,PT,PCLDFR,PRT, & + PLIDAROUT,PLIPAROUT,PCT,PDSTC,PDSTD,PDSTS) +! +CHARACTER(LEN=*), INTENT(IN) :: HCLOUD ! Name of the cloud scheme +CHARACTER(LEN=*), INTENT(IN) :: HVIEW ! Upward or Downward integration +REAL, INTENT(IN) :: PALT ! Altitude of the lidar source +REAL, INTENT(IN) :: PWVL ! Wavelength of the lidar source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! Altitude +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHO ! Air density +REAL, DIMENSION(:,:,:), INTENT(IN) :: PT ! Air temperature (C) +REAL, DIMENSION(:,:,:), INTENT(IN) :: PCLDFR ! Cloud fraction +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRT ! Moist variables at t +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLIDAROUT ! Lidar output +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLIPAROUT ! Lidar output (particle only) + +REAL, DIMENSION(:,:,:,:), OPTIONAL, INTENT(IN) :: PCT ! Concentration + ! (C2R2 and C1R3) +REAL, DIMENSION(:,:,:,:), OPTIONAL, INTENT(IN) :: PDSTC ! Dust Concentration +REAL, DIMENSION(:,:,:,:), OPTIONAL, INTENT(IN) :: PDSTD ! Dust Diameter +REAL, DIMENSION(:,:,:,:), OPTIONAL, INTENT(IN) :: PDSTS ! Dust Sigma +! + +! +END SUBROUTINE LIDAR +! +END INTERFACE +! +END MODULE MODI_LIDAR +! ######################################################### + SUBROUTINE LIDAR(HCLOUD,HVIEW,PALT,PWVL,PZZ,PRHO,PT,PCLDFR,PRT, & + PLIDAROUT,PLIPAROUT,PCT,PDSTC,PDSTD,PDSTS) +! ######################################################### +! +!!**** *LIDAR * - computes pertinent lidar parameters +!! +!! PURPOSE +!! ------- +!! The purpose of this routine is to compute the normalized backscattered +!! signal of an upward or downward looking lidar in an atmosperic column +!! containing air molecules, aerosols, cloud particles and hydrometeors. +!! +!!** METHOD +!! ------ +!! The reflectivities are computed using the n(D) * D**6 formula. The +!! equivalent reflectiviy is the sum of the reflectivity produced by the +!! the raindrops and the equivalent reflectivities of the ice crystals. +!! The latter are computed using the melted diameter. The Doppler +!! reflectivity is the 'fall speed'-moment of individual particle +!! reflectivity. Ice crystal are assumed to have no preferred orientation. +!! the Z_VV formula is taken from Brandes et al. (MWR, 1995). +!! +!! EXTERNAL +!! -------- +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODD_CST +!! XPI ! +!! XRHOLW ! Liquid water density +!! Module MODD_RAIN_ICE_DESCR +!! Module MODD_RAIN_ICE_PARAM +!! +!! REFERENCE +!! --------- +!! Chaboureau et al. 2011: Long-range transport of Saharan dust and its +!! radiative impact on precipitation forecast over western Europe: a case +!! study during COPS. Quart. J. Roy. Meteor. Soc., 137, 236-251 +!! +!! AUTHOR +!! ------ +!! J.-P. Pinty * Laboratoire d'Aerologie* +!! +!! MODIFICATIONS +!! ------------- +!! Original 04/10/07 +!! JP Chaboureau 12/02/10 change dust refraction index +!! add inputs (lidar charact. and cloud fraction) +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! B.VIE 2016 : LIMA +! P. Wautelet 18/03/2020: remove ICE2 option +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_PARAMETERS +USE MODD_CST +USE MODD_RAIN_C2R2_DESCR, ONLY : XLBEXC, XLBEXR, & + XRTMIN, XCTMIN +USE MODD_PARAM_C2R2, ONLY : YALPHAC=>XALPHAC,YNUC=>XNUC, & + YALPHAR=>XALPHAR,YNUR=>XNUR +USE MODD_PARAM_ICE_n, ONLY: WSNOW_T=>LSNOW_T +USE MODD_RAIN_ICE_DESCR_n, ONLY : XCCR, WLBEXR=>XLBEXR, XLBR, & + XCCS, XCXS, XLBEXS, XLBS, XNS, & + XCCG, XCXG, XLBEXG, XLBG, & + XCCH, XCXH, XLBEXH, XLBH, & + WRTMIN=>XRTMIN +USE MODD_ICE_C1R3_DESCR, ONLY : XLBEXI, & + YRTMIN=>XRTMIN, YCTMIN=>XCTMIN +! +USE MODD_PARAM_LIMA, ONLY : URTMIN=>XRTMIN, UCTMIN=>XCTMIN, & + UALPHAC=>XALPHAC,UNUC=>XNUC, & + UALPHAR=>XALPHAR,UNUR=>XNUR, & + UALPHAI=>XALPHAI,UNUI=>XNUI, & + USNOW_T=>LSNOW_T +USE MODD_PARAM_LIMA_COLD, ONLY : UCCS=>XCCS, UCXS=>XCXS, ULBEXS=>XLBEXS, & + ULBS=>XLBS, UNS=>XNS, & + XLBDAS_MAX,XLBDAS_MIN, UBS=>XBS +USE MODD_PARAM_LIMA_MIXED,ONLY : UCCG=>XCCG, UCXG=>XCXG, ULBEXG=>XLBEXG, & + ULBG=>XLBG + +use mode_tools_ll, only: GET_INDICE_ll + +USE MODI_BHMIE_WATER ! Gamma or mono dispersed size distributions +USE MODI_BHMIE_AEROSOLS ! Lognormal or mono dispersed size distributions +! +IMPLICIT NONE +! +!* 0.1 Declarations of dummy arguments : +! +CHARACTER(LEN=*), INTENT(IN) :: HCLOUD ! Name of the cloud scheme +CHARACTER(LEN=*), INTENT(IN) :: HVIEW ! Upward or Downward integration +REAL, INTENT(IN) :: PALT ! Altitude of the lidar source +REAL, INTENT(IN) :: PWVL ! Wavelength of the lidar source +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! Altitude +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHO ! Air density +REAL, DIMENSION(:,:,:), INTENT(IN) :: PT ! Air temperature (C) +REAL, DIMENSION(:,:,:), INTENT(IN) :: PCLDFR ! Cloud fraction +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRT ! Moist variables at t +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLIDAROUT ! Lidar output +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLIPAROUT ! Lidar output (particle only) + +REAL, DIMENSION(:,:,:,:), OPTIONAL, INTENT(IN) :: PCT ! Concentration + ! (C2R2 and C1R3) +REAL, DIMENSION(:,:,:,:), OPTIONAL, INTENT(IN) :: PDSTC ! Dust Concentration +REAL, DIMENSION(:,:,:,:), OPTIONAL, INTENT(IN) :: PDSTD ! Dust Diameter +REAL, DIMENSION(:,:,:,:), OPTIONAL, INTENT(IN) :: PDSTS ! Dust Sigma +! +!* 0.2 Declarations of local variables : +! +INTEGER :: JI, JJ, JK +INTEGER :: IIB, IIE, IJB, IJE, IKB, IKE +INTEGER :: IALT +INTEGER, DIMENSION(3) :: IKMIN +! +REAL, PARAMETER :: ZCLDFRMIN = 1.0E-03 ! Cloud fraction minimum +! +! +COMPLEX, PARAMETER :: ZZREFIND_WAT = (1.337E+00,1.818E-09) ! Refraction Index + ! of pure water +COMPLEX, PARAMETER :: ZZREFIND_ICE = (1.312E+00,2.614E-09) ! Refraction Index + ! of pure ice +!COMPLEX, PARAMETER :: ZZREFIND_DUST= (1.530E+00,8.000E-03) ! Refraction Index +! ! of mineral dust +! West, R. A., L. R. Doose, A. M. Eibl, M. G. Tomasko, and M. I. Mishchenko +! (1997), Laboratory measurements of mineral dust scattering phase function +! and linear polarization, J. Geophys. Res., 102(D14), 16,871-16,882. +COMPLEX :: ZZREFIND_DUST + +! Tulet, P., M. Mallet, V. Pont, J. Pelon, and A. Boone (2008), The 7-13 +! March 2006 dust storm over West Africa: Generation, transport, and vertical +! stratification, J. Geophys. Res., 113, D00C08, doi:10.1029/2008JD009871. +!! Ri = 1.448-0.00292i for wavelengths between 0.185 and 0.69um. +!! Ri = 1.44023-0.00116i for wavelengths between 0.69 and 1.19um. +!! Ri = 1.41163-0.00106i for wavelengths between 1.19 and 4.0um. +COMPLEX, PARAMETER :: ZZREFIND_DSTL= (1.448,2.92E-03) +COMPLEX, PARAMETER :: ZZREFIND_DSTM= (1.44023,1.16E-03) +COMPLEX, PARAMETER :: ZZREFIND_DSTH= (1.41163,1.06E-03) + +! +! COMPLEX, PARAMETER :: ZZREFIND_WAT = (1.321E+00,1.280E-06) ! Refraction Index +! ! of pure water +! COMPLEX, PARAMETER :: ZZREFIND_ICE = (1.300E+00,1.898E-06) ! Refraction Index +! ! of pure ice +! +COMPLEX, PARAMETER :: ZZREFIND_COAT= (1.337E+00,1.818E-09) ! Refraction Index + ! of coating material +COMPLEX, PARAMETER :: ZZREFIND_BC = (1.870E+00,0.569E+00) ! Refraction Index + ! of black carbone +REAL :: ZCXR=-1.0 ! for rain N ~ 1/N_0 + ! (in Kessler parameterization) +! +REAL :: ZCMOL +REAL :: ZWAVE_LENGTH +! BETA: backscattering coefficient +! ALPHA: extinction coefficient +REAL, DIMENSION(SIZE(PRHO,1),SIZE(PRHO,2),SIZE(PRHO,3)) :: ZBETA_MOL +REAL, DIMENSION(SIZE(PRHO,1),SIZE(PRHO,2),SIZE(PRHO,3)) :: ZALPH_MOL +REAL, DIMENSION(SIZE(PRHO,1),SIZE(PRHO,2),SIZE(PRHO,3)) :: ZBETA_PAR +REAL, DIMENSION(SIZE(PRHO,1),SIZE(PRHO,2),SIZE(PRHO,3)) :: ZALPH_PAR +REAL, ALLOCATABLE, DIMENSION(:,:) :: ZOPTD_TOT ! Optical depths +REAL, ALLOCATABLE, DIMENSION(:,:) :: ZOPTD_MOL +REAL, ALLOCATABLE, DIMENSION(:,:) :: ZOPTD_PAR +! +CHARACTER (LEN=5) :: YDSD +INTEGER :: IRADIUS, IANGLE +REAL :: ZRADIUS, ZCONC, ZLWC, ZIWC +REAL :: ZREFF_FACT +REAL :: ZEXT_COEF, ZBAK_COEF +REAL :: ZLBDAR, ZLBDAS, ZLBDAG, ZLBDAH, ZTCEL +REAL :: ZFRACVOL_CORE, ZDMODAL, ZSIG +REAL :: ZFRACVOL_BC +! +REAL :: ZETACLD, ZETAAER ! Multiple diffusion paramter for cloud and dust +! +REAL, DIMENSION(5) :: ZPOLC, ZPOLR, ZPOLI ! BackScat. Coefficients +! +REAL, DIMENSION(10) :: ZRTMIN, ZCTMIN +REAL :: ZLBEXR +! +INTEGER :: JL +REAL :: ZALPHAC, ZNUC, ZALPHAR, ZNUR, ZALPHAI, ZNUI +REAL :: ZCCS, ZCXS, ZLBEXS, ZLBS, ZNS +REAL :: ZCCG, ZCXG, ZLBEXG, ZLBG +! +! ----------------------------------------------------------------------------- +! +!* 1. COMPUTE THE LOOP BOUNDS +! ----------------------- +! +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +IKB=1+JPVEXT +IKE=SIZE(PRHO,3) - JPVEXT +! +ZWAVE_LENGTH = PWVL +ZCMOL=5.45E-32*((ZWAVE_LENGTH)/0.55E-6)**(-4.09) +IF (ZWAVE_LENGTH<0.69E-6) THEN + PRINT *,'Tulet et al. refractive index - low wavelength' + ZZREFIND_DUST = ZZREFIND_DSTL +ELSEIF (ZWAVE_LENGTH<1.00E-6) THEN + PRINT *,'Tulet et al. refractive index - medium wavelength' + ZZREFIND_DUST = ZZREFIND_DSTM +ELSE + PRINT *,'Tulet et al. refractive index - high wavelength' + ZZREFIND_DUST = ZZREFIND_DSTH +END IF +ZPOLC = (/ 2.6980E-8,-3.7701E-6, 1.6594E-4,-0.0024, 0.0626 /) +ZPOLR(:) = ZPOLC(:) +ZPOLI = (/-1.0176E-8, 1.7615E-6,-1.0480E-4, 0.0019, 0.0460 /) +! +! Multiple diffusion parameter +ZETAAER=1.0 +ZETACLD=1.0 +! a multiple scattering correction for lidar in space; Platt 73 +IF (HVIEW=='NADIR'.AND.PALT==0.) ZETACLD=0.5 +PRINT *,'Multiple diffusion parameter for aerosol ',ZETAAER +PRINT *,'Multiple diffusion parameter for cloud ',ZETACLD +! +! +!* 1. MORE INITIALIZATION +! ------------------- +! +SELECT CASE ( HCLOUD ) + CASE('KESS') + ZRTMIN(1) = 1.0E-20 + ZRTMIN(2) = 1.0E-20 + ZRTMIN(3) = 1.0E-20 + ZLBEXR = 1.0/(-1.0-3.0) + CASE('ICE3','ICE4') + ZRTMIN(1:SIZE(WRTMIN)) = WRTMIN(1:SIZE(WRTMIN)) + ZLBEXR = WLBEXR + ZCCS = XCCS + ZCXS = XCXS + ZLBEXS = XLBEXS + ZLBS = XLBS + ZNS = XNS + ZCCG = XCCG + ZCXG = XCXG + ZLBEXG = XLBEXG + ZLBG = XLBG + CASE('C2R2') + ZRTMIN(1:SIZE(XRTMIN)) = XRTMIN(1:SIZE(XRTMIN)) + ZCTMIN(1:SIZE(XCTMIN)) = XCTMIN(1:SIZE(XCTMIN)) + ZLBEXR = XLBEXR + ZALPHAC = YALPHAC + ZNUR = YNUR + ZALPHAR = YALPHAR + ZNUC = YNUC + CASE('C3R5') + ZRTMIN(1:SIZE(YRTMIN)) = YRTMIN(1:SIZE(YRTMIN)) + ZCTMIN(1:SIZE(YCTMIN)) = YCTMIN(1:SIZE(YCTMIN)) + ZALPHAC = YALPHAC + ZNUR = YNUR + ZALPHAR = YALPHAR + ZNUC = YNUC + ZALPHAI = ZALPHAC + ZNUI = ZNUC + ZCCS = XCCS + ZCXS = XCXS + ZLBEXS = XLBEXS + ZLBS = XLBS + ZCCG = XCCG + ZCXG = XCXG + ZLBEXG = XLBEXG + ZLBG = XLBG + CASE('LIMA') + ZRTMIN(1:SIZE(URTMIN)) = URTMIN(1:SIZE(URTMIN)) + ZCTMIN(1:SIZE(UCTMIN)) = UCTMIN(1:SIZE(UCTMIN)) + ZALPHAC = UALPHAC + ZNUR = UNUR + ZALPHAR = UALPHAR + ZNUC = UNUC + ZALPHAI = UALPHAI + ZNUI = UNUI + ZCCS = UCCS + ZCXS = UCXS + ZLBEXS = ULBEXS + ZLBS = ULBS + ZNS = UNS + ZCCG = UCCG + ZCXG = UCXG + ZLBEXG = ULBEXG + ZLBG = ULBG +END SELECT +! +! ----------------------------------------------------------------------------- +! +!* 2. INITIALIZES THE MEAN-LAYER VARIABLES +! ------------------------------------ +! +! +! MOLECULAR CONTRIBUTION +! +ZBETA_MOL(:,:,:) = ( PRHO(:,:,:)*XAVOGADRO/XMD )*ZCMOL +ZALPH_MOL(:,:,:) = ZBETA_MOL(:,:,:)*(8.0*XPI/3.0) +! +! PARTICULAR CONTRIBUTION +! +ZBETA_PAR(:,:,:) = 0. +ZALPH_PAR(:,:,:) = 0. +! +! AEROSOL CONTRIBUTION ! call bhmie_aerosols +! +IF (PRESENT(PDSTC)) THEN + DO JL = 1, SIZE(PDSTD,4) + DO JK = IKB, IKE + DO JJ = IJB, IJE + DO JI = IIB, IIE + IF ( PDSTD(JI,JJ,JK,JL)>0.1 ) THEN + ! + ! Desert dust particles + ! + YDSD = 'MONOD' + ZCONC = PDSTC(JI,JJ,JK,JL) + ZFRACVOL_CORE = 1.0 + ZRADIUS = PDSTD(JI,JJ,JK,JL)*1.0E-6 + IF( ZRADIUS .GE. 1.0E-3 ) ZRADIUS = ZRADIUS * 1.0E-6 + CALL BHMIE_AEROSOLS( ZWAVE_LENGTH, ZZREFIND_DUST, ZZREFIND_DUST, & + YDSD, ZCONC, ZFRACVOL_CORE, ZEXT_COEF, & + ZBAK_COEF, PRADIUS=ZRADIUS ) + ZALPH_PAR(JI,JJ,JK) = ZALPH_PAR(JI,JJ,JK) + ZETAAER * ZEXT_COEF + ZBETA_PAR(JI,JJ,JK) = ZBETA_PAR(JI,JJ,JK) + ZBAK_COEF + END IF + END DO + END DO + END DO + END DO +END IF +! +! +! HYDROMETEOR CONTRIBUTION ! call bhmie_water +! +! LIQUID WATER +! +! Some Prefactors: Assume Martin et al. (1994, JAS) for Reff +! +ZREFF_FACT = 1.0E-3*(3.E3/(4.0*XPI*0.67E-3))**0.33 ! Continental N=500 +ZREFF_FACT = 1.0E-3*(3.E3/(4.0*XPI*0.80E-3))**0.33 ! Maritime N=150 +! +SELECT CASE ( HCLOUD ) + CASE('KESS','ICE3','ICE4') + DO JK = IKB, IKE + DO JJ = IJB, IJE + DO JI = IIB, IIE + IF ( PRT(JI,JJ,JK,2)>ZRTMIN(2) .AND. PCLDFR(JI,JJ,JK)>ZCLDFRMIN) THEN +! +! Cloud droplets +! + YDSD = 'MONOD' + ZCONC = 200.E6 ! Continental case + ZLWC = PRHO(JI,JJ,JK)*PRT(JI,JJ,JK,2) / PCLDFR(JI,JJ,JK) + ZRADIUS = MIN( 16.0E-6,MAX( 4.0E-6,ZREFF_FACT*(ZLWC/ZCONC)**0.33 ) ) + IANGLE = 11 + CALL BHMIE_WATER( ZWAVE_LENGTH, ZZREFIND_WAT, YDSD, ZCONC, & + IANGLE, ZEXT_COEF, ZBAK_COEF, PRADIUS=ZRADIUS ) + ZALPH_PAR(JI,JJ,JK) = ZALPH_PAR(JI,JJ,JK) + ZETACLD * ZEXT_COEF & + * PCLDFR(JI,JJ,JK) + ZBETA_PAR(JI,JJ,JK) = ZBETA_PAR(JI,JJ,JK) + ZBAK_COEF & + * PCLDFR(JI,JJ,JK) + END IF + END DO + END DO + END DO + DO JK = IKB, IKE + DO JJ = IJB, IJE + DO JI = IIB, IIE + IF ( PRT(JI,JJ,JK,3)>ZRTMIN(3) ) THEN +! +! Rain drops +! + YDSD = 'MONOD' + ZLWC = PRHO(JI,JJ,JK)*PRT(JI,JJ,JK,3) + ZLBDAR = XLBR*(ZLWC)**ZLBEXR + ZCONC = XCCR*(ZLBDAR)**ZCXR + ZRADIUS = 0.5*(3.0/ZLBDAR) ! Assume Marshall-Palmer law for Reff + IANGLE = 11 + CALL BHMIE_WATER( ZWAVE_LENGTH, ZZREFIND_WAT, YDSD, ZCONC, & + IANGLE, ZEXT_COEF, ZBAK_COEF, PRADIUS=ZRADIUS ) + ZALPH_PAR(JI,JJ,JK) = ZALPH_PAR(JI,JJ,JK) + ZETACLD * ZEXT_COEF + ZBETA_PAR(JI,JJ,JK) = ZBETA_PAR(JI,JJ,JK) + ZBAK_COEF + END IF + END DO + END DO + END DO + CASE ('C2R2','C3R5','LIMA') + DO JK = IKB, IKE + DO JJ = IJB, IJE + DO JI = IIB, IIE + IF (PRT(JI,JJ,JK,2)>ZRTMIN(2) .AND. PCT(JI,JJ,JK,2)>ZCTMIN(2)) THEN +! +! Cloud droplets +! + YDSD = 'GAMMA' + ZCONC = PCT(JI,JJ,JK,2) + IRADIUS = 20 + ZLWC = PRHO(JI,JJ,JK)*PRT(JI,JJ,JK,2) + IANGLE = 11 + CALL BHMIE_WATER( ZWAVE_LENGTH, ZZREFIND_WAT, YDSD, ZCONC, & + IANGLE, ZEXT_COEF, ZBAK_COEF, KRADIUS=IRADIUS, & + PALPHA=ZALPHAC, PNU=ZNUC, PLWC=ZLWC ) + ZALPH_PAR(JI,JJ,JK) = ZALPH_PAR(JI,JJ,JK) + ZETACLD * ZEXT_COEF + ZBETA_PAR(JI,JJ,JK) = ZBETA_PAR(JI,JJ,JK) + ZBAK_COEF + END IF + END DO + END DO + END DO + DO JK = IKB, IKE + DO JJ = IJB, IJE + DO JI = IIB, IIE + IF (PRT(JI,JJ,JK,3)>ZRTMIN(3) .AND. PCT(JI,JJ,JK,3)>ZCTMIN(3)) THEN +! +! Rain drops +! + YDSD = 'GAMMA' + ZCONC = PCT(JI,JJ,JK,3) + IRADIUS = 20 + ZLWC = PRHO(JI,JJ,JK)*PRT(JI,JJ,JK,3) + IANGLE = 11 + CALL BHMIE_WATER( ZWAVE_LENGTH, ZZREFIND_WAT, YDSD, ZCONC, & + IANGLE, ZEXT_COEF, ZBAK_COEF, KRADIUS=IRADIUS, & + PALPHA=ZALPHAR, PNU=ZNUR, PLWC=ZLWC ) + ZALPH_PAR(JI,JJ,JK) = ZALPH_PAR(JI,JJ,JK) + ZETACLD * ZEXT_COEF + ZBETA_PAR(JI,JJ,JK) = ZBETA_PAR(JI,JJ,JK) + ZBAK_COEF + END IF + END DO + END DO + END DO +END SELECT +! +! SOLID ICE +! +SELECT CASE ( HCLOUD ) + CASE('ICE3','ICE4') + DO JK = IKB, IKE + DO JJ = IJB, IJE + DO JI = IIB, IIE + IF ( PRT(JI,JJ,JK,4)>ZRTMIN(4) .AND. PCLDFR(JI,JJ,JK)>ZCLDFRMIN) THEN +! +! Pristine crystals +! + YDSD = 'MONOD' + ZCONC = 10.E3 ! Continental case + ZIWC = PRHO(JI,JJ,JK)*PRT(JI,JJ,JK,4) / PCLDFR(JI,JJ,JK) + ZTCEL = 10.0-0.0065*PZZ(JI,JJ,JK) ! A rough estimate + ZRADIUS = MIN( 350.0E-6,MAX( 45.0E-6,0.5E-6*(1.2351+0.0105*ZTCEL)* & + (5.8966*(ZIWC*1.0E3)**0.2214 + & + (0.7957*(ZIWC*1.0E3)**0.2535)*(ZTCEL+190.0)) ) ) + IANGLE = 11 + CALL BHMIE_WATER( ZWAVE_LENGTH, ZZREFIND_ICE, YDSD, ZCONC, & + IANGLE, ZEXT_COEF, ZBAK_COEF, PRADIUS=ZRADIUS ) + ZALPH_PAR(JI,JJ,JK) = ZALPH_PAR(JI,JJ,JK) + ZETACLD * ZEXT_COEF & + *PCLDFR(JI,JJ,JK) + ZBETA_PAR(JI,JJ,JK) = ZBETA_PAR(JI,JJ,JK) + ZBAK_COEF & + *PCLDFR(JI,JJ,JK) + END IF + END DO + END DO + END DO + CASE ('C3R5','LIMA') + DO JK = IKB, IKE + DO JJ = IJB, IJE + DO JI = IIB, IIE + IF (PRT(JI,JJ,JK,4)>ZRTMIN(4) .AND. PCT(JI,JJ,JK,4)>ZCTMIN(4)) THEN +! +! Pristine crystals +! + YDSD = 'GAMMA' + ZCONC = PCT(JI,JJ,JK,4) + IRADIUS = 20 + ZIWC = PRHO(JI,JJ,JK)*PRT(JI,JJ,JK,4) + IANGLE = 11 + CALL BHMIE_WATER( ZWAVE_LENGTH, ZZREFIND_ICE, YDSD, ZCONC, & + IANGLE, ZEXT_COEF, ZBAK_COEF, KRADIUS=IRADIUS, & + PALPHA=ZALPHAI, PNU=ZNUI, PLWC=ZIWC ) + ZALPH_PAR(JI,JJ,JK) = ZALPH_PAR(JI,JJ,JK) + ZETACLD * ZEXT_COEF + ZBETA_PAR(JI,JJ,JK) = ZBETA_PAR(JI,JJ,JK) + ZBAK_COEF + END IF + END DO + END DO + END DO +END SELECT +SELECT CASE ( HCLOUD ) + CASE('ICE3','ICE4','C3R5','LIMA') + DO JK = IKB, IKE + DO JJ = IJB, IJE + DO JI = IIB, IIE + IF ( PRT(JI,JJ,JK,5)>ZRTMIN(5) ) THEN +! +! Snow flakes +! + YDSD = 'MONOD' + ZIWC = PRHO(JI,JJ,JK)*PRT(JI,JJ,JK,5) + IF ( (HCLOUD=='LIMA' .AND. USNOW_T) .OR. & + (HCLOUD=='ICE3' .AND. WSNOW_T) ) THEN + IF (PT(JI,JJ,JK)>-10.) THEN + ZLBDAS = MAX(MIN(XLBDAS_MAX, 10**(14.554-0.0423*(PT(JI,JJ,JK)+273.15))),XLBDAS_MIN) + ELSE + ZLBDAS = MAX(MIN(XLBDAS_MAX, 10**(6.226-0.0106*(PT(JI,JJ,JK)+273.15))),XLBDAS_MIN) + END IF + ZCONC=ZNS*ZIWC*ZLBDAS**UBS + ELSE + ZLBDAS = ZLBS*(ZIWC)**ZLBEXS + ZCONC = ZCCS*(ZLBDAS)**ZCXS + END IF + IF (ZLBDAS .GT. 0) THEN + ZRADIUS = 0.5*(3.0/ZLBDAS) ! Assume Marshall-Palmer law for Reff + IANGLE = 11 + CALL BHMIE_WATER( ZWAVE_LENGTH, ZZREFIND_ICE, YDSD, ZCONC, & + IANGLE, ZEXT_COEF, ZBAK_COEF, PRADIUS=ZRADIUS ) + ZALPH_PAR(JI,JJ,JK) = ZALPH_PAR(JI,JJ,JK) + ZETACLD * ZEXT_COEF + ZBETA_PAR(JI,JJ,JK) = ZBETA_PAR(JI,JJ,JK) + ZBAK_COEF + END IF + END IF + END DO + END DO + END DO +END SELECT +SELECT CASE ( HCLOUD ) + CASE('ICE3','ICE4','C3R5','LIMA') + DO JK = IKB, IKE + DO JJ = IJB, IJE + DO JI = IIB, IIE + IF ( PRT(JI,JJ,JK,6)>ZRTMIN(6) ) THEN +! +! Graupel particles +! + YDSD = 'MONOD' + ZIWC = PRHO(JI,JJ,JK)*PRT(JI,JJ,JK,6) + ZLBDAG = ZLBG*(ZIWC)**ZLBEXG + ZCONC = ZCCG*(ZLBDAG)**ZCXG + ZRADIUS = 0.5*(3.0/ZLBDAG) ! Assume Marshall-Palmer law for Reff + IANGLE = 11 + CALL BHMIE_WATER( ZWAVE_LENGTH, ZZREFIND_ICE, YDSD, ZCONC, & + IANGLE, ZEXT_COEF, ZBAK_COEF, PRADIUS=ZRADIUS ) + ZALPH_PAR(JI,JJ,JK) = ZALPH_PAR(JI,JJ,JK) + ZETACLD * ZEXT_COEF + ZBETA_PAR(JI,JJ,JK) = ZBETA_PAR(JI,JJ,JK) + ZBAK_COEF + END IF + END DO + END DO + END DO +END SELECT +SELECT CASE ( HCLOUD ) + CASE('ICE4') + DO JK = IKB, IKE + DO JJ = IJB, IJE + DO JI = IIB, IIE + IF ( PRT(JI,JJ,JK,7)>ZRTMIN(7) ) THEN +! +! Hailstones +! + YDSD = 'MONOD' + ZIWC = PRHO(JI,JJ,JK)*PRT(JI,JJ,JK,7) + ZLBDAH = XLBH*(ZIWC)**XLBEXH + ZCONC = XCCH*(ZLBDAH)**XCXH + ZRADIUS = 0.5*(3.0/ZLBDAH) ! Assume Marshall-Palmer law for Reff + IANGLE = 11 + CALL BHMIE_WATER( ZWAVE_LENGTH, ZZREFIND_ICE, YDSD, ZCONC, & + IANGLE, ZEXT_COEF, ZBAK_COEF, PRADIUS=ZRADIUS ) + ZALPH_PAR(JI,JJ,JK) = ZALPH_PAR(JI,JJ,JK) + ZETACLD * ZEXT_COEF + ZBETA_PAR(JI,JJ,JK) = ZBETA_PAR(JI,JJ,JK) + ZBAK_COEF + END IF + END DO + END DO + END DO +END SELECT +! +! ----------------------------------------------------------------------------- +! +!* 3. PERFORMS THE BOTTOM-UP OR TOP-DOWN VERTICAL INTEGRATION +! ------------------------------------------------------- +! +! +ALLOCATE(ZOPTD_TOT(SIZE(PRHO,1),SIZE(PRHO,2))) +ALLOCATE(ZOPTD_MOL(SIZE(PRHO,1),SIZE(PRHO,2))) +ALLOCATE(ZOPTD_PAR(SIZE(PRHO,1),SIZE(PRHO,2))) +ZOPTD_TOT(:,:) = 0. +ZOPTD_MOL(:,:) = 0. +ZOPTD_PAR(:,:) = 0. +! +IF( HVIEW=='ZENIT' ) THEN + IALT=IKB + IF (PALT/=0.) THEN + IKMIN=MINLOC(ABS(PZZ(:,:,:)-PALT)) + IALT=MIN(MAX(IKB,IKMIN(3)),IKE) + ENDIF + DO JK=IALT,IKE +! +! molecular optical depth +! + ZOPTD_MOL(:,:) = ZOPTD_MOL(:,:) & + + ZALPH_MOL(:,:,JK)*(PZZ(:,:,JK)-PZZ(:,:,JK-1)) +! +! Particular optical depth +! + ZOPTD_PAR(:,:) = ZOPTD_PAR(:,:) & + + ZALPH_PAR(:,:,JK)*(PZZ(:,:,JK)-PZZ(:,:,JK-1)) +! +! Total optical depth +! + ZOPTD_TOT(:,:) = ZOPTD_MOL(:,:) + ZOPTD_PAR(:,:) +! +! Normalized Lidar profile +! + PLIDAROUT(:,:,JK) = ( ZBETA_MOL(:,:,JK)+ZBETA_PAR(:,:,JK) ) & + * EXP( -2.0*ZOPTD_TOT(:,:) ) +! +! Normalized Lidar particle profile +! + PLIPAROUT(:,:,JK) = ZBETA_PAR(:,:,JK) * EXP( -2.0*ZOPTD_PAR(:,:) ) + END DO +ELSE IF( HVIEW=='NADIR' ) THEN + IALT=IKE + IF (PALT/=0.) THEN + IKMIN=MINLOC(ABS(PZZ(:,:,:)-PALT)) + IALT=MIN(MAX(IKB,IKMIN(3)),IKE) + ENDIF + DO JK=IALT,IKB,-1 +! +! molecular optical depth +! + ZOPTD_MOL(:,:) = ZOPTD_MOL(:,:) & + + ZALPH_MOL(:,:,JK)*(PZZ(:,:,JK)-PZZ(:,:,JK-1)) +! +! Particular optical depth +! + ZOPTD_PAR(:,:) = ZOPTD_PAR(:,:) & + + ZALPH_PAR(:,:,JK)*(PZZ(:,:,JK)-PZZ(:,:,JK-1)) +! +! Total optical depth +! + ZOPTD_TOT(:,:) = ZOPTD_MOL(:,:) + ZOPTD_PAR(:,:) +! +! Normalized Lidar profile +! + PLIDAROUT(:,:,JK) = ( ZBETA_MOL(:,:,JK)+ZBETA_PAR(:,:,JK) ) & + * EXP( -2.0*ZOPTD_TOT(:,:) ) +! +! Normalized Lidar particle profile +! + PLIPAROUT(:,:,JK) = ZBETA_PAR(:,:,JK) * EXP( -2.0*ZOPTD_PAR(:,:) ) + END DO +ENDIF +! +DEALLOCATE(ZOPTD_TOT,ZOPTD_MOL,ZOPTD_PAR) +! +!------------------------------------------------------------------------------ +! +END SUBROUTINE LIDAR diff --git a/src/mesonh/ext/mnh2lpdm.f90 b/src/mesonh/ext/mnh2lpdm.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a3d78eac12738cc388cb786388abde6cc1f9670f --- /dev/null +++ b/src/mesonh/ext/mnh2lpdm.f90 @@ -0,0 +1,181 @@ +!MNH_LIC Copyright 2002-2020 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. +!----------------------------------------------------------------------- +! ######spl + PROGRAM MNH2LPDM +! ############## +!----------------------------------------------------------------------------- +!**** MNH2DIF COUPLAGE MESO-NH / SPRAY. +! +! Auteur : Michel Bouzom, DP/SERV/ENV +! Creation : 16.07.2002 +! Modification : 07.01.2006 (T.LAUVAUX, adaptation LPDM) +! Modification : 04.01.2009 (F. BONNARDOT, DP/SER/ENV ) +! P. Wautelet 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 07/02/2019: force TYPE to a known value for IO_File_add2list +! P. Wautelet 10/04/2019: replace ABORT and STOP calls by Print_msg +! P. Wautelet 05/11/2020: correct I/O of MNH2LPDM +! +!----------------------------------------------------------------------------- +! +! +! +!* 0. DECLARATIONS. +! ------------- +! +!* 0.1 Modules. +! +USE MODD_CONF, ONLY : CPROGRAM +USE MODD_IO, ONLY : TFILEDATA, TFILE_OUTPUTLISTING, TPTR2FILE +use modd_lunit, only: TLUOUT0 +use modd_lunit_n, only: TLUOUT +USE MODD_MNH2LPDM +! +USE MODE_FIELD, ONLY: INI_FIELD_LIST, INI_FIELD_SCALARS +USE MODE_IO, ONLY: IO_Init, IO_Config_set +USE MODE_IO_FILE, ONLY: IO_File_open, IO_File_close +USE MODE_IO_MANAGE_STRUCT, ONLY: IO_File_add2list +USE MODE_MODELN_HANDLER +use mode_msg +USE MODE_POS +! +USE MODE_INI_CST, ONLY: INI_CST +USE MODI_MNH2LPDM_ECH +USE MODI_MNH2LPDM_INI +USE MODI_VERSION +! +USE MODN_CONFIO +! +! +!* 0.2 Variables locales. +! +IMPLICIT NONE +! +CHARACTER(LEN=*),PARAMETER :: YFLOG = 'METEO.log' ! Log filename +CHARACTER(LEN=*),PARAMETER :: YFNML = 'MNH2LPDM1.nam' ! Namelist filename +INTEGER, PARAMETER :: IVERB = 5 +! +INTEGER :: IFNML ! Unit of namelist +INTEGER :: JFIC +LOGICAL :: GFOUND ! Return code when searching namelist +TYPE(TPTR2FILE),DIMENSION(JPMNHMAX) :: TZFMNH ! MesoNH files +TYPE(TFILEDATA),POINTER :: TZDATEFILE => NULL() ! Date file +TYPE(TFILEDATA),POINTER :: TZGRIDFILE => NULL() ! Grid file +TYPE(TFILEDATA),POINTER :: TZMETEOFILE => NULL() ! Meteo file +TYPE(TFILEDATA),POINTER :: TZLOGFILE => NULL() ! Log file +TYPE(TFILEDATA),POINTER :: TZNMLFILE => NULL() ! Namelist file +! +! +! +! +!* 1. INITIALISATION. +! --------------- +! +CPROGRAM='M2LPDM' +CALL GOTO_MODEL(1) +CALL VERSION() +CALL IO_Init() +CALL INI_CST() +CALL INI_FIELD_LIST(1) +CALL INI_FIELD_SCALARS() +! +CALL IO_File_add2list(TLUOUT0,'OUTPUT_LISTING1','OUTPUTLISTING','WRITE') +CALL IO_File_open(TLUOUT0) +!Set output files for PRINT_MSG +TLUOUT => TLUOUT0 +TFILE_OUTPUTLISTING => TLUOUT0 +! +!* 1.1 Variables generales. +! + CFMNH(:) = '' +! +! +!* 1.2 Initialisation routines LL. +! +CALL IO_Init() +! +! +!* 1.3 Ouverture du fichier log. +! +CALL IO_File_add2list(TZLOGFILE,YFLOG,'TXT','WRITE') +CALL IO_File_open(TZLOGFILE) +! +! +!* 1.4 Lecture des namelists. +! +CALL IO_File_add2list(TZNMLFILE,YFNML,'NML','READ') +CALL IO_File_open(TZNMLFILE) +IFNML = TZNMLFILE%NLU + +READ(UNIT=IFNML,NML=NAM_TURB) +READ(UNIT=IFNML,NML=NAM_FIC) +print *,'Lecture de NAM_FIC OK.' + +CALL POSNAM(IFNML,'NAM_CONFIO',GFOUND) +IF (GFOUND) THEN + READ(UNIT=IFNML,NML=NAM_CONFIO) +END IF +LCDF4 = .FALSE. +LLFIOUT = .FALSE. +LLFIREAD = .FALSE. +CALL IO_Config_set() +CALL IO_File_close(TZNMLFILE) +! +! +!* 1.5 Comptage des FM a traiter. +! +IF (LEN_TRIM(CFMNH(1))>0) THEN + NBMNH=1 + CALL IO_File_add2list(TZFMNH(1)%TZFILE,TRIM(CFMNH(1)),'MNH','READ',KLFITYPE=2,KLFIVERB=IVERB) + DO WHILE (CFMNH(NBMNH+1).NE.'VIDE') + NBMNH=NBMNH+1 + CALL IO_File_add2list(TZFMNH(NBMNH)%TZFILE,TRIM(CFMNH(NBMNH)),'MNH','READ',KLFITYPE=2,KLFIVERB=IVERB) + END DO + print *,NBMNH,' fichiers a traiter.' +ELSE + call Print_msg( NVERB_FATAL, 'GEN', 'MNH2LPDM', 'no CFMNH file given' ) +END IF +! +! +! +! +!* 2. TRAITEMENTS. +! ------------ +! +!* 2.1 Ouverture des fichiers METEO et GRILLE et DATE. +! +CALL IO_File_add2list(TZGRIDFILE,CFGRI,'TXT','WRITE') +CALL IO_File_open(TZGRIDFILE) +CALL IO_File_add2list(TZDATEFILE,CFDAT,'TXT','WRITE') +CALL IO_File_open(TZDATEFILE) +! +! +!* 2.2 Preparation du couplage. +! +CALL MNH2LPDM_INI(TZFMNH(1)%TZFILE,TZFMNH(NBMNH)%TZFILE,TZLOGFILE,TZGRIDFILE,TZDATEFILE) +! +! +!* 2.3 Traitement des echeances. +! +DO JFIC=1,NBMNH + print*,"CFMTO(JFIC)=",CFMTO(JFIC) + CALL IO_File_add2list(TZMETEOFILE,CFMTO(JFIC),'METEO','WRITE') + CALL IO_File_open(TZMETEOFILE) + CALL MNH2LPDM_ECH(TZFMNH(JFIC)%TZFILE,TZMETEOFILE) + print*,"CLOSE_LL(CFMTO(JFIC)" + CALL IO_File_close(TZMETEOFILE) + TZMETEOFILE => NULL() +END DO +! +! +!* 2.4 Fermeture des fichiers, METEO, GRILLE et LOG. +! +CALL IO_File_close(TZGRIDFILE) +CALL IO_File_close(TZDATEFILE) +CALL IO_File_close(TZLOGFILE) +! +! +! +END PROGRAM MNH2LPDM diff --git a/src/mesonh/ext/mnh2lpdm_ech.f90 b/src/mesonh/ext/mnh2lpdm_ech.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ef0d7447e723c1e32f421de8daa8f52f9aabbda5 --- /dev/null +++ b/src/mesonh/ext/mnh2lpdm_ech.f90 @@ -0,0 +1,492 @@ +!MNH_LIC Copyright 2009-2020 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. +!----------------------------------------------------------------------- +! ######spl + SUBROUTINE MNH2LPDM_ECH(TPFILE,TPMETEOFILE) +! ################################################## +!----------------------------------------------------------------------- +!**** MNH2S2_ECH TRAITEMENT D'UNE ECHEANCE. +! +! Auteur : Francois Bonnardot, DP/SERV/ENV +! Creation : 07.01.2009 +! Modifications: +! P. Wautelet 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 28/05/2018: corrected truncated integer division (1/3 -> 1./3.) +! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function +! P. Wautelet 05/11/2020: correct I/O of MNH2LPDM +!----------------------------------------------------------------------- +! +!* 0. DECLARATIONS. +! ------------- +! +!* 0.1 Modules. +! +! +! +USE MODD_DIM_n +USE MODD_IO, ONLY: TFILEDATA +USE MODD_TIME_n +USE MODD_GRID_n +! +USE MODD_CST +USE MODD_PARAMETERS +USE MODD_TIME +! +USE MODD_MNH2LPDM +! +use modd_field, only: tfielddata, TYPEREAL +USE MODE_IO_FILE, only: IO_File_close, IO_File_open +USE MODE_IO_FIELD_READ, only: IO_Field_read +USE MODE_IO_MANAGE_STRUCT, only: IO_File_add2list +! +IMPLICIT NONE +! +! +!* 0.2 Arguments. +! +TYPE(TFILEDATA),POINTER,INTENT(INOUT) :: TPFILE +TYPE(TFILEDATA),POINTER,INTENT(IN) :: TPMETEOFILE +! +! +!* 0.3 Variables locales. +! +CHARACTER(LEN=100) :: YFTURB ! Stockage champs de turbulence. +INTEGER :: IFTURB +INTEGER :: IFMTO,IREP +INTEGER :: ICURAA,ICURMM,ICURJJ ! Date courante. +INTEGER :: ICURHH,ICURMN,ICURSS ! Heure courante. +INTEGER :: JI,JJ,JK +TYPE(DATE_TIME) :: TZDTCUR +type(tfielddata) :: tzfield +TYPE(TFILEDATA),POINTER :: TZFILE +! +! +! +! +!* 1. INITIALISATION. +! --------------- +! +!* 1.1 Blabla. +! +TZFILE => NULL() +IFMTO = TPMETEOFILE%NLU +! +!* 2. LECTURE DES DONNEES MESO-NH DE BASE. +! ------------------------------------ +! +!* 2.1 Ouverture du fichier Meso-NH. +! +CALL IO_File_open(TPFILE) +! +!* 2.2 Date et heure courante. +! +CALL IO_Field_read(TPFILE,'DTCUR',TZDTCUR) +! +ICURAA=MOD(TZDTCUR%nyear,100) ! Annee sur 2 caracteres. +ICURMM=TZDTCUR%nmonth +ICURJJ=TZDTCUR%nday +ICURSS=NINT(TZDTCUR%xtime) +! +ICURMN = NINT( (REAL(ICURSS)/60.0)/5.0 )*5 ! Heure arrondie a 5 minutes pres. +ICURSS = 0 +ICURHH =ICURMN/60 +ICURMN =ICURMN-ICURHH*60 +! +print*, '%%% MNH2LPDM2_ECH Date et heure des donnees :' +print 20300, ICURJJ,ICURMM,ICURAA,ICURHH,ICURMN,ICURSS +20300 FORMAT(I2.2,'/',I2.2,'/',I4.4,' ',I2.1,'h',I2.1,'mn',I2.1,'sec') +! +! +! +!* 2.3 Lecture des champs Meso-NH de base. +! +CALL IO_Field_read(TPFILE,'UT', XUT) +CALL IO_Field_read(TPFILE,'VT', XVT) +CALL IO_Field_read(TPFILE,'WT', XWT) +CALL IO_Field_read(TPFILE,'THT', XTHT) +CALL IO_Field_read(TPFILE,'TKET', XTKET) + +tzfield%cmnhname = 'LM' +tzfield%clongname = '' +tzfield%cunits = 'm' +tzfield%cdir = 'XY' +tzfield%ccomment = 'Mixing length' +tzfield%ngrid = 1 +tzfield%ntype = TYPEREAL +tzfield%ndims = 3 +CALL IO_Field_read(TPFILE, tzfield, XLM) + +tzfield%cmnhname = 'THW_FLX' +tzfield%clongname = '' +tzfield%cunits = 'K s-1' !correct? +tzfield%cdir = 'XY' +tzfield%ccomment = 'Conservative potential temperature vertical flux' +tzfield%ngrid = 4 +tzfield%ntype = TYPEREAL +tzfield%ndims = 3 +CALL IO_Field_read(TPFILE, tzfield, XWPTHP) + +tzfield%cmnhname = 'DISS' +tzfield%clongname = '' +tzfield%cunits = '' !TODO: set units +tzfield%cdir = 'XY' +tzfield%ccomment = 'X_Y_Z_DISS' +tzfield%ngrid = 1 +tzfield%ntype = TYPEREAL +tzfield%ndims = 3 +CALL IO_Field_read(TPFILE, tzfield, XDISSIP) + +tzfield%cmnhname = 'FMU' +tzfield%clongname = '' +tzfield%cunits = 'kg m-1 s-2' +tzfield%cdir = 'XY' +tzfield%ccomment = 'X_Y_FMU' +tzfield%ngrid = 4 +tzfield%ntype = TYPEREAL +tzfield%ndims = 2 +CALL IO_Field_read(TPFILE, tzfield, XSFU) + +tzfield%cmnhname = 'FMV' +tzfield%clongname = '' +tzfield%cunits = 'kg m-1 s-2' +tzfield%cdir = 'XY' +tzfield%ccomment = 'X_Y_FMV' +tzfield%ngrid = 4 +tzfield%ntype = TYPEREAL +tzfield%ndims = 2 +CALL IO_Field_read(TPFILE, tzfield, XSFV) + +CALL IO_Field_read(TPFILE,'INPRT', XINRT) +CALL IO_Field_read(TPFILE,'RVT', XRMVT) +CALL IO_Field_read(TPFILE,'RCT', XRMCT) +CALL IO_Field_read(TPFILE,'RRT', XRMRT) +! +! Lecture des donnees Meso-NH terminee.' +! +!* 2.4 Fermeture du fichier Meso-NH. +! +CALL IO_File_close(TPFILE) +! +! +!* 3. PREPARATION DES DONNEES. +! ------------------------ +! +! +!* 3.2 Niveaux altitude "hors-sol" (1:NKMAX). +! +XSU(:,:,1:NKMAX) = XUT(NSIB:NSIE,NSJB:NSJE,NKB:NKE) +XSV(:,:,1:NKMAX) = XVT(NSIB:NSIE,NSJB:NSJE,NKB:NKE) +XSW(:,:,1:NKMAX) = XWT(NSIB:NSIE,NSJB:NSJE,NKB:NKE) +XSTH(:,:,1:NKMAX) = XTHT(NSIB:NSIE,NSJB:NSJE,NKB:NKE) +XSTKE(:,:,1:NKMAX) = XTKET(NSIB:NSIE,NSJB:NSJE,NKB:NKE) +XSLM(:,:,1:NKMAX) = XLM(NSIB:NSIE,NSJB:NSJE,NKB:NKE) +XSDISSIP(:,:,1:NKMAX) = XDISSIP(NSIB:NSIE,NSJB:NSJE,NKB:NKE) +XSINRT(:,:) = XINRT(NSIB:NSIE,NSJB:NSJE) +XSWPTHP(:,:,1:NKMAX) = XWPTHP(NSIB:NSIE,NSJB:NSJE,NKB:NKE) +XSRMV(:,:,1:NKMAX) = XRMVT(NSIB:NSIE,NSJB:NSJE,NKB:NKE) +XSRMC(:,:,1:NKMAX) = XRMCT(NSIB:NSIE,NSJB:NSJE,NKB:NKE) +XSRMR(:,:,1:NKMAX) = XRMRT(NSIB:NSIE,NSJB:NSJE,NKB:NKE) +XSSFU(:,:) = XSFU(NSIB:NSIE,NSJB:NSJE) +XSSFV(:,:) = XSFV(NSIB:NSIE,NSJB:NSJE) +! +! +!* 4. CALCULS DES TEMPS LAGRANGIENS ET VARIANCES DU VENT POUR LPDM. +! ------------------------------------------------------------ +! + XRVSRD = XRV/XRD +! + XSUSTAR (:,:) = XUNDEF + XSLMO (:,:) = XUNDEF + XSHMIX (:,:) = XUNDEF + XSWSTAR (:,:) = XUNDEF + XSSIGU (:,:,:) = XUNDEF + XSSIGW (:,:,:) = XUNDEF + XSTIMEU (:,:,:) = XUNDEF + XSTIMEW (:,:,:) = XUNDEF +! + DO JI=1,NSIMAX ; DO JJ=1,NSJMAX + ! + !* Temperature potentielle virtuelle. + ! + XSTHETAV(:)=1.0+XSRMV(JI,JJ,:)+XSRMC(JI,JJ,:)+XSRMR(JI,JJ,:) + XSTHETAV(:) = XSTH(JI,JJ,:)*(1.0+XSRMV(JI,JJ,:)*XRVSRD)/XSTHETAV(:) + ! + !* ZHMIX Hauteur de melange. + ! + XTHSOL = XSTHETAV(1)+0.5 + XSHMIX(JI,JJ) = 0.0 + DO JK=2,NKMAX + IF ( XSTHETAV(JK).GT.XTHSOL ) THEN + XSHMIX(JI,JJ) = XSHAUT (JK-1) & + +( XSHAUT (JK) - XSHAUT (JK-1) ) & + /( XSTHETAV(JK) - XSTHETAV(JK-1) ) & + *( XTHSOL - XSTHETAV(JK-1) ) + EXIT + ENDIF + END DO + XSHMIX(JI,JJ)=MAX(XSHMIX(JI,JJ),50.0) + + ! + !* XSUSTAR Vitesse de frottement. + ! + XSUSTAR(JI,JJ) = XSSFU(JI,JJ)*XSSFU(JI,JJ) & + +XSSFV(JI,JJ)*XSSFV(JI,JJ) + XSUSTAR(JI,JJ) = SQRT(SQRT(XSUSTAR(JI,JJ))) + ! + ! + ! + !* XSLMO Longueur de Monin-Obukhov. + ! + IF (XSWPTHP(JI,JJ,1).NE.0.) THEN + XSLMO(JI,JJ)= -XSTHETAV(1)*(XSUSTAR(JI,JJ)**3) & + / (XKARMAN*XG*XSWPTHP(JI,JJ,1)) + ENDIF + ! + ! + !* XSWSTAR Vitesse Verticale Convective. + ! + XSWSTAR(JI,JJ)=XG/XSTHETAV(1)*XSWPTHP(JI,JJ,1)*XSHMIX(JI,JJ) + XSWSTAR(JI,JJ)=SIGN(1.,XSWSTAR(JI,JJ)) & + * ( ABS(XSWSTAR(JI,JJ))**(1./3.)) + ! + ! + IF (CTURBPARAM=="HANNA".OR.CTURBPARAM=="HANNABIS") THEN + ! + IF ((XSLMO(JI,JJ).GT.0).AND.(XSLMO(JI,JJ).LE.300)) THEN + ! + !* Conditions stables. + ! + !* XSSIGU,XSSIGW <u'2>**0.5, <w'2>**0.5 + DO JK=1,NKMAX + IF (XSHAUT(JK).LT.XSHMIX(JI,JJ)) THEN + XSSIGU(JI,JJ,JK) = SQRT( 0.5 * & + ((2.0*(1-XSHAUT(JK)/XSHMIX(JI,JJ))*XSUSTAR(JI,JJ))**2) & + + ((1.3*(1-XSHAUT(JK)/XSHMIX(JI,JJ))*XSUSTAR(JI,JJ))**2) ) + XSSIGW(JI,JJ,JK) = 1.3*(1-XSHAUT(JK)/XSHMIX(JI,JJ)) & + *XSUSTAR(JI,JJ) + ELSE + XSSIGU(JI,JJ,JK) = 0.001 + XSSIGW(JI,JJ,JK) = 0.001 + ENDIF + ENDDO + ! + XSSIGU(JI,JJ,:)=MAX(0.001,XSSIGU(JI,JJ,:)) + XSSIGW(JI,JJ,:)=MAX(0.001,XSSIGW(JI,JJ,:)) + ! + !* Lagrangian time scale + XSTIMEU(JI,JJ,:) = 0.11*XSHMIX(JI,JJ)/XSSIGU(JI,JJ,:) & + *SQRT( XSHAUT(:)/XSHMIX(JI,JJ) ) + XSTIMEW(JI,JJ,:) = 0.10*XSHMIX(JI,JJ)/XSSIGW(JI,JJ,:) & + *( XSHAUT(:)/XSHMIX(JI,JJ) )**0.8 + ! + ! + ENDIF + ! + ! + IF (ABS(XSLMO(JI,JJ)).GT.300) THEN + ! + !* Conditions neutres. + ! + !* XSSIGU,XSSIGW <u'2>**0.5, <w'2>**0.5 + XSSIGU(JI,JJ,:)=SQRT( 0.5 * & + ((2.0*XSUSTAR(JI,JJ)*EXP(-3*XSCORIOZ(JI,JJ)*XSHAUT(:)/XSUSTAR(JI,JJ)))**2) & + + ((1.3*XSUSTAR(JI,JJ)*EXP(-2*XSCORIOZ(JI,JJ)*XSHAUT(:)/XSUSTAR(JI,JJ)))**2) ) + XSSIGW(JI,JJ,:)=1.3*XSUSTAR(JI,JJ)*EXP(-2*XSCORIOZ(JI,JJ)*XSHAUT(:)/XSUSTAR(JI,JJ)) + XSSIGU(JI,JJ,:)=MAX(0.001,XSSIGU(JI,JJ,:)) + XSSIGW(JI,JJ,:)=MAX(0.001,XSSIGW(JI,JJ,:)) + ! + !* lagrangian time scale + XSTIMEU(JI,JJ,:) = 0.5*XSHAUT(:)/ & + (XSSIGW(JI,JJ,:)*(1.+15.0*XSCORIOZ(JI,JJ)*XSHAUT(:)/XSUSTAR(JI,JJ))) + XSTIMEW(JI,JJ,:) = XSTIMEU(JI,JJ,:) + ! + ENDIF + ! + ! + IF ((XSLMO(JI,JJ).LT.0).AND.(XSLMO(JI,JJ).GE.-300)) THEN + ! + !* Conditions instables. + ! + !* XSSIGU,XSSIGW <u'2>**0.5, <w'2>**0.5 + ! + IF (CTURBPARAM=="HANNA") THEN + ! + DO JK=1,NKMAX + IF (XSHAUT(JK).LE.XSHMIX(JI,JJ)) THEN + XSSIGU(JI,JJ,JK)=XSUSTAR(JI,JJ) & + * (12+0.5*XSHMIX(JI,JJ)/ABS(XSLMO(JI,JJ)))**(1./3.) + ELSE + XSSIGU(JI,JJ,JK)=0.001 + ENDIF + ENDDO + ! + DO JK=1,NKMAX + !IF (XSHAUT(JK).LE.XSHMIX(JI,JJ)) THEN + ! XSSIGW(JI,JJ,JK)=SQRT( 1.2*XSWSTAR(JI,JJ)**2 & + ! *(1-0.9*XSHAUT(JK)/XSHMIX(JI,JJ)) & + ! *(XSHAUT(JK)/XSHMIX(JI,JJ))**(2/3) & + ! + (1.8-1.4*XSHAUT(JK)/XSHMIX(JI,JJ)) & + ! *XSUSTAR(JI,JJ)**2 ) + !ELSE + IF (XSHAUT(JK).LE.0.4*XSHMIX(JI,JJ)) THEN + XSSIGW(JI,JJ,JK)=0.763*(XSHAUT(JK)/XSHMIX(JI,JJ))**0.175 + ELSE IF (XSHAUT(JK).LE.0.96*XSHMIX(JI,JJ)) THEN + XSSIGW(JI,JJ,JK)=0.722*XSWSTAR(JI,JJ)* & + (1-XSHAUT(JK)/XSHMIX(JI,JJ))**0.207 + ELSE IF (XSHAUT(JK).LE.XSHMIX(JI,JJ)) THEN + XSSIGW(JI,JJ,JK)=0.37*XSWSTAR(JI,JJ) + ELSE + XSSIGW(JI,JJ,JK)=0.001 + ENDIF + ENDDO + ! + XSSIGU(JI,JJ,:)=MAX(0.001,XSSIGU(JI,JJ,:)) + XSSIGW(JI,JJ,:)=MAX(0.001,XSSIGW(JI,JJ,:)) + ! + !* Lagrangian time scale + XSTIMEU(JI,JJ,:) = 0.15*XSHMIX(JI,JJ)/XSSIGU(JI,JJ,:) + DO JK=1,NKMAX + IF (XSHAUT(JK).LE.(0.1*XSHMIX(JI,JJ))) THEN + IF ( XSHAUT(JK).LT.(XSZ0(JI,JJ)-XSLMO(JI,JJ)) ) THEN + XSTIMEW(JI,JJ,JK) = 0.1*XSHAUT(JK)/XSSIGW(JI,JJ,JK) & + / ( 0.55 - 0.38*(XSHAUT(JK)-XSZ0(JI,JJ))/ABS(XSLMO(JI,JJ))) + ELSE + XSTIMEW(JI,JJ,JK) = 0.59*XSHAUT(JK)/XSSIGW(JI,JJ,JK) + ENDIF + ELSE + XSTIMEW(JI,JJ,JK) = 0.15*XSHMIX(JI,JJ)/XSSIGW(JI,JJ,JK) & + *( 1.-EXP(-5*XSHAUT(JK)/XSHMIX(JI,JJ)) ) + ENDIF + END DO + ! + ELSE IF (CTURBPARAM=="HANNABIS") THEN + !* sigmas + XSSIGW(JI,JJ,:) = SQRT(2./3.*XSTKE(JI,JJ,:)) + XSSIGU(JI,JJ,:) = XSSIGW(JI,JJ,:) + !* Temps Lagrangien + DO JK=1,NKMAX + IF (XSHAUT(JK).LE.XSHMIX(JI,JJ)) THEN + XSTIMEU(JI,JJ,JK)=0.17*XSHMIX(JI,JJ)/XSSIGU(JI,JJ,JK) + XSTIMEW(JI,JJ,JK)=0.2*XSHMIX(JI,JJ)/XSSIGW(JI,JJ,JK)* & + (1-EXP(-4*XSHAUT(JK)/XSHMIX(JI,JJ)) & + -0.0003*EXP(8*XSHAUT(JK)/XSHMIX(JI,JJ))) + ELSE IF (XSHAUT(JK).LE.XSHMIX(JI,JJ)*1.2) THEN + XSTIMEU(JI,JJ,JK)= & + (1-(XSHAUT(JK)-XSHAUT(JK-1))/(XSHAUT(JK+1)-XSHAUT(JK-1)))* & + XSTIMEU(JI,JJ,JK-1) & + +(XSHAUT(JK)-XSHAUT(JK-1))/(XSHAUT(JK+1)-XSHAUT(JK-1))*10000.0 + XSTIMEW(JI,JJ,JK)= & + (1-(XSHAUT(JK)-XSHAUT(JK-1))/(XSHAUT(JK+1)-XSHAUT(JK-1)))* & + XSTIMEW(JI,JJ,JK-1) & + +(XSHAUT(JK)-XSHAUT(JK-1))/(XSHAUT(JK+1)-XSHAUT(JK-1))*10000.0 + ELSE + XSTIMEU(JI,JJ,JK)=10000.0 + XSTIMEW(JI,JJ,JK)=10000.0 + ENDIF + ENDDO + ! + ENDIF ! CTURBPARAM=HANNA ou HANNABIS + ! + ENDIF ! instable + ! + ELSE ! CTURBPARAM=="ISOTROPE" + ! + !* XSSIGU,XSSIGW <u'2>**0.5, <w'2>**0.5 + ! + XSSIGW(JI,JJ,:) = SQRT(2./3.*XSTKE(JI,JJ,:)) + XSSIGU(JI,JJ,:) = XSSIGW(JI,JJ,:) + ! + !* Lagrangian time scale + DO JK=1,NKMAX + IF (XSHAUT(JK).LE.XSHMIX(JI,JJ)) THEN + XSTIMEU(JI,JJ,JK)=ABS(2*(XSSIGU(JI,JJ,JK)**2)/(3*XSDISSIP(JI,JJ,JK))) + XSTIMEW(JI,JJ,JK)=ABS(2*(XSSIGW(JI,JJ,JK)**2)/(3*XSDISSIP(JI,JJ,JK))) + ELSE IF (XSHAUT(JK).LE.XSHMIX(JI,JJ)*1.2) THEN + XSTIMEU(JI,JJ,JK)= & + (1-(XSHAUT(JK)-XSHAUT(JK-1))/(XSHAUT(JK+1)-XSHAUT(JK-1)))*XSTIMEU(JI,JJ,JK-1) & + +(XSHAUT(JK)-XSHAUT(JK-1))/(XSHAUT(JK+1)-XSHAUT(JK-1))*1000.0 + XSTIMEW(JI,JJ,JK)=XSTIMEU(JI,JJ,JK) + ELSE + XSTIMEU(JI,JJ,JK)=1000.0 + XSTIMEW(JI,JJ,JK)=1000.0 + ENDIF + ENDDO + ! + ENDIF + ! + ! + END DO + END DO + ! + IF (IGRILLE.EQ.2) THEN + WRITE(YFTURB,'("TURB_LPDM",5I2.2)') ICURAA,ICURMM,ICURJJ,ICURHH,ICURMN + CALL IO_File_add2list(TZFILE,YFTURB,'TXT','WRITE') + CALL IO_File_open(TZFILE) + IFTURB = TZFILE%NLU + WRITE(UNIT=IFTURB,FMT='(5A12)') "WSTAR ","USTAR ", & + "HMIX ","LMO ", & + "WPTHP" + WRITE(UNIT=IFTURB,FMT='(5F12.5)') XSWSTAR(15,15),XSUSTAR(15,15), & + XSHMIX(15,15),XSLMO(15,15), & + XSWPTHP(15,15,1) + + + WRITE(UNIT=IFTURB,FMT='(8A12)') "HAUT ","TKE ", & + "DISS ","THETA ", & + "SIGU ","SIGW ", & + "TIMEU ","TIMEW " + DO JK=1,NKMAX + WRITE(UNIT=IFTURB,FMT='(6F12.5,2F12.1)') XSHAUT(JK),XSTKE(15,15,JK), & + XSDISSIP(15,15,JK),XSTH(15,15,JK), & + XSSIGU(15,15,JK),XSSIGW(15,15,JK), & + XSTIMEU(15,15,JK),XSTIMEW(15,15,JK) + + ENDDO + CALL IO_File_close(TZFILE) + ENDIF +! + + +! +!* 5. ECRITURES FIC MTO. +! ------------------ +! +! +DO JK = 1,NKMAX +WRITE(IFMTO) XSU(:,:,JK) ! Composante zonale du vent. +ENDDO +DO JK = 1,NKMAX +WRITE(IFMTO) XSV(:,:,JK) ! Composante meridienne du vent. +ENDDO +DO JK = 1,NKMAX +WRITE(IFMTO) XSW(:,:,JK) ! Vitesse verticale. +ENDDO +DO JK = 1,NKMAX +WRITE(IFMTO) XSTH(:,:,JK) ! Temperature potentielle. +ENDDO +DO JK = 1,NKMAX +WRITE(IFMTO) XSTKE(:,:,JK) ! Energie cinetique Turbulence +ENDDO +DO JK = 1,NKMAX +WRITE(IFMTO) (XSSIGU(:,:,JK))**2 ! SigmaU +ENDDO +DO JK = 1,NKMAX +WRITE(IFMTO) (XSSIGU(:,:,JK))**2 ! SigmaV +ENDDO +DO JK = 1,NKMAX +WRITE(IFMTO) (XSSIGW(:,:,JK))**2 ! SigmaW +ENDDO +DO JK = 1,NKMAX +WRITE(IFMTO) XSTIMEU(:,:,JK) ! Temps lagrangien U +ENDDO +DO JK = 1,NKMAX +WRITE(IFMTO) XSTIMEU(:,:,JK) ! Temps lagrangien V +ENDDO +DO JK = 1,NKMAX +WRITE(IFMTO) XSTIMEW(:,:,JK) ! Dissipation de TKE +ENDDO +WRITE(IFMTO) XSINRT +! +END SUBROUTINE MNH2LPDM_ECH diff --git a/src/mesonh/ext/mnh2lpdm_ini.f90 b/src/mesonh/ext/mnh2lpdm_ini.f90 new file mode 100644 index 0000000000000000000000000000000000000000..8e1a82dab8e99fefb86599bf02f96bb03c019111 --- /dev/null +++ b/src/mesonh/ext/mnh2lpdm_ini.f90 @@ -0,0 +1,458 @@ +!MNH_LIC Copyright 2009-2020 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. +!----------------------------------------------------------------------- +! ######spl + SUBROUTINE MNH2LPDM_INI(TPFILE1,TPFILE2,TPLOGFILE,TPGRIDFILE,TPDATEFILE) +!-------------------------------------------------------------------------- +!* MNH2S2_INI : INITIALISATION DU COUPLAGE MESO-NH / LPDM. +! +! Auteur : Francois BONNARDOT, DP/SERV/ENV +! Creation : 04.01.2009 (mnh2s2_ini.f90) +! +! +! Arguments explicites. +! --------------------- +! TPFILE1,TPFILE2 First and last files to treat +! TPLOGFILE Log file +! TPGRIDFILE Grid file +! TPDATEFILE Date file +! +! Modifications: +! P. Wautelet 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function +! P. Wautelet 05/11/2020: correct I/O of MNH2LPDM +!-------------------------------------------------------------------------- +! +! +! +!* 0. INITIALISATION. +! --------------- +! +!* 0.1 Modules. +! +USE MODD_CST +USE MODD_DIM_n +use modd_field, only: tfielddata, TYPEREAL +USE MODD_GRID +USE MODD_GRID_n +USE MODD_IO, ONLY: TFILEDATA +USE MODD_LUNIT +USE MODD_MNH2LPDM +USE MODD_PARAMETERS +USE MODD_TIME +USE MODD_TIME_n +! +USE MODE_DATETIME +USE MODE_GRIDPROJ +USE MODE_IO_FILE, only: IO_File_close, IO_File_open +USE MODE_IO_FIELD_READ, only: IO_Field_read +USE MODE_MODELN_HANDLER +! +USE MODE_INI_CST, ONLY: INI_CST +USE MODI_READ_HGRID +USE MODI_XYTOLATLON +! +!* 0.2 Arguments. +! +IMPLICIT NONE +! +TYPE(TFILEDATA),POINTER,INTENT(INOUT) :: TPFILE1,TPFILE2 +TYPE(TFILEDATA),POINTER,INTENT(IN) :: TPLOGFILE +TYPE(TFILEDATA),POINTER,INTENT(IN) :: TPGRIDFILE +TYPE(TFILEDATA),POINTER,INTENT(IN) :: TPDATEFILE +! +! +!* 0.3 Variables locales. +! +CHARACTER(LEN=28) :: YNAME,YDAD ! Noms du FM et de son papa. +CHARACTER(LEN=2) :: YSTORAGE ! Type de variable. +! +REAL :: ZECHEANCE1,ZECHEANCE2 ! dist temp date modele - date courante +INTEGER :: IHHMDL,IMNMDL,ISSMDL ! h - mn - s du model +INTEGER :: IHHCUR1,IMNCUR1,ISSCUR1 +INTEGER :: IHHCUR2,IMNCUR2,ISSCUR2 +CHARACTER(LEN=14) :: YDATMDL,YDATCUR1,YDATCUR2 +! +REAL :: XLATOR,XLONOR,XPTLAT,XPTLON +REAL :: XXPTSOMNH,XYPTSOMNH +INTEGER :: JI,JJ,JK,a +INTEGER :: b,c,I +INTEGER, DIMENSION(:), ALLOCATABLE :: TAB1D +INTEGER, DIMENSION(:,:), ALLOCATABLE :: TAB2D +TYPE(DATE_TIME) :: TZDTCUR1,TZDTCUR2,TZDTEXP1 +INTEGER :: IFDAT,IFGRI,IFLOG +type(tfielddata) :: tzfield +! +! +! +!* 1. INITIALISATION. +! --------------- +! +IFDAT = TPDATEFILE%NLU +IFGRI = TPGRIDFILE%NLU +IFLOG = TPLOGFILE%NLU +! +CALL INI_CST +! +CALL GOTO_MODEL(1) +! +! +!* 2. DONNEES MESO-NH. +! ---------------- +! +!* 2.1 Ouverture du fichier Meso-NH. +! +CALL IO_File_open(TPFILE1) +CALL IO_File_open(TPFILE2) +! +! +!* 2.2 Date et heure du modele. +! +CALL IO_Field_read(TPFILE1,'DTEXP',TZDTEXP1) +CALL IO_Field_read(TPFILE1,'DTCUR',TZDTCUR1) +CALL IO_Field_read(TPFILE2,'DTCUR',TZDTCUR2) +! +CALL DATETIME_DISTANCE(TZDTEXP1,TZDTCUR1,ZECHEANCE1) +CALL DATETIME_DISTANCE(TZDTEXP1,TZDTCUR2,ZECHEANCE2) +! +IHHMDL=INT(TZDTEXP1%xtime/3600) +IMNMDL=INT((TZDTEXP1%xtime-IHHMDL*3600)/60) +ISSMDL=INT(TZDTEXP1%xtime-IHHMDL*3600-IMNMDL*60) +IHHCUR1=INT(TZDTCUR1%xtime/3600) +IMNCUR1=INT((TZDTCUR1%xtime-IHHCUR1*3600)/60) +ISSCUR1=INT(TZDTCUR1%xtime-IHHCUR1*3600-IMNCUR1*60) +IHHCUR2=INT(TZDTCUR2%xtime/3600) +IMNCUR2=INT((TZDTCUR2%xtime-IHHCUR2*3600)/60) +ISSCUR2=INT(TZDTCUR2%xtime-IHHCUR2*3600-IMNCUR2*60) +! +WRITE(YDATMDL, '(I4.4,5I2.2)') TZDTEXP1%nyear, TZDTEXP1%nmonth, TZDTEXP1%nday, & + IHHMDL, IMNMDL, ISSMDL +WRITE(YDATCUR1,'(I4.4,5I2.2)') TZDTCUR1%nyear, TZDTCUR1%nmonth, TZDTCUR1%nday, & + IHHCUR1, IMNCUR1, ISSCUR1 +WRITE(YDATCUR2,'(I4.4,5I2.2)') TZDTCUR2%nyear, TZDTCUR2%nmonth, TZDTCUR2%nday, & + IHHCUR2, IMNCUR2, ISSCUR2 +! +NMDLAA=MOD( TZDTEXP1%nyear, 100 ) ! Annee arrondi a 2 chiffres. +NMDLMM=TZDTEXP1%nmonth +NMDLJJ=TZDTEXP1%nday +NMDLSS=NINT(TZDTEXP1%xtime) +! +!* Heure du modele arrondie a 5 minutes pres. +! +NMDLMN = NINT( (REAL(NMDLSS)/60.0)/5.0 )*5 +NMDLSS = 0 +NMDLHH =NMDLMN/60 +NMDLMN =NMDLMN-NMDLHH*60 +! +!* 2.3 Grille horizontale. +! +CALL READ_HGRID(1,TPFILE1,YNAME,YDAD,YSTORAGE) +IF (YNAME == YDAD) THEN +IGRILLE=1 +ELSE +IGRILLE=2 +ENDIF +print*,IGRILLE +! +! Lecture grille horizontale +! +NIU=NIMAX+2*JPHEXT +NJU=NJMAX+2*JPHEXT +NIB=1+JPHEXT +NJB=1+JPHEXT +NIE=NIU-JPHEXT +NJE=NJU-JPHEXT +! +! +!* 2.4 Nombre de niveaux-verticaux. +! +CALL IO_Field_read(TPFILE1,'KMAX',NKMAX) +!WRITE(IFLOG,*) '%%% MNH2S2_INI Lecture du nombre de niveau OK.' +! +NKU = NKMAX+2*JPVEXT +NKB = 1+JPVEXT +NKE = NKU-JPVEXT +! +! +!* 2.5 Allocations Meso-NH. +! +ALLOCATE( XZHAT(NKU) ) +ALLOCATE( XZS(NIU,NJU) ) +ALLOCATE( XZ0(NIU,NJU) ) +ALLOCATE( XUT(NIU,NJU,NKU)) +ALLOCATE( XVT(NIU,NJU,NKU)) +ALLOCATE( XWT(NIU,NJU,NKU)) +ALLOCATE( XTHT(NIU,NJU,NKU)) +ALLOCATE( XTKET(NIU,NJU,NKU)) +ALLOCATE( XLM(NIU,NJU,NKU)) +ALLOCATE( XDISSIP(NIU,NJU,NKU)) +ALLOCATE( XWPTHP(NIU,NJU,NKU)) +ALLOCATE( XRMVT(NIU,NJU,NKU)) +ALLOCATE( XRMCT(NIU,NJU,NKU)) +ALLOCATE( XRMRT(NIU,NJU,NKU)) +ALLOCATE( XINRT(NIU,NJU)) +ALLOCATE( XSFU(NIU,NJU)) +ALLOCATE( XSFV(NIU,NJU)) +! +!* 2.6 Decoupage vertical. +! +CALL IO_Field_read(TPFILE1,'ZHAT',XZHAT) +CALL IO_Field_read(TPFILE1,'ZTOP',XZTOP) +! +!* 2.7 Orographie. +! +CALL IO_Field_read(TPFILE1,'ZS',XZS) +! +!* 2.8 Rugosite Z0. +! +tzfield%cmnhname = 'Z0' +tzfield%clongname = '' +tzfield%cunits = 'm' +tzfield%cdir = 'XY' +tzfield%ccomment = 'X_Y_Z0' +tzfield%ngrid = 4 +tzfield%ntype = TYPEREAL +tzfield%ndims = 2 +CALL IO_Field_read(TPFILE1,tzfield,XZ0) +! +XXPTSOMNH=XXHAT(1)+(XXHAT(2)-XXHAT(1))/2 +XYPTSOMNH=XYHAT(1)+(XYHAT(2)-XYHAT(1))/2 +CALL SM_LATLON(XLATORI,XLONORI,XXPTSOMNH,XYPTSOMNH,XLATOR,XLONOR) +! +!* 2.9 DOMAINE D'EXTRACTION. +! --------------------- +! +NSIB = NIB +NSIE = NIE +NSJB = NJB +NSJE = NJE +! +NSIMAX = NSIE-NSIB+1 +NSJMAX = NSJE-NSJB+1 +! +! +!* 3. Impression de controle Meso-NH. +! ------------------------------- +! +! Domaine horizontal Meso-NH. +!modif 12.2014 : passage a 1 seul domaine MesoNH +! --------------------------- +WRITE(IFLOG,'(I1,a12)') IGRILLE,' ngrid ' +!WRITE(IFLOG,'(a13)') '2 ngrids' +WRITE(IFLOG,'(a13)') '1 ngrids' +WRITE(IFLOG,'(i4,3x,a6)') NSIMAX,'nx ' +WRITE(IFLOG,'(i4,3x,a6)') NSJMAX,'ny ' +WRITE(IFLOG,'(i4,3x,a6)') NKU-2,'nz ' +WRITE(IFLOG,'(i4,3x,a6)') NKU-3,'nzg ' +WRITE(IFLOG,'(a13)') '12 npatch' +WRITE(IFLOG,'(a13)') '0 icloud' +WRITE(IFLOG,'(a11)') '0.0 wlon ' +WRITE(IFLOG,'(a11)') '45.0 rnlat ' +WRITE(IFLOG,'(f10.1,3x,a6)') XZHAT(NKE),'s ' +WRITE(IFLOG,'(f8.0,a8)') ZECHEANCE1,' time1 ' +WRITE(IFLOG,'(f8.0,a8)') ZECHEANCE2,' time2 ' +WRITE(IFLOG,'(a13)') '3600 dtmet ' +WRITE(IFLOG,'(a13)') 'm tunits' +WRITE(IFLOG,'(a13)') '12 nvout ' +WRITE(IFLOG,'(6x,a8,i4)') 'u ',1 +WRITE(IFLOG,'(6x,a8,i4)') 'v ',1 +WRITE(IFLOG,'(6x,a8,i4)') 'w ',1 +WRITE(IFLOG,'(6x,a8,i4)') 'tp ',1 +WRITE(IFLOG,'(6x,a8,i4)') 'tke ',1 +WRITE(IFLOG,'(6x,a8,i4)') 'uu ',1 +WRITE(IFLOG,'(6x,a8,i4)') 'vv ',1 +WRITE(IFLOG,'(6x,a8,i4)') 'ww ',1 +WRITE(IFLOG,'(6x,a8,i4)') 'tlx ',1 +WRITE(IFLOG,'(6x,a8,i4)') 'tly ',1 +WRITE(IFLOG,'(6x,a8,i4)') 'tlz ',1 +WRITE(IFLOG,'(6x,a8,i4)') 'intopr ',1 +WRITE(IFLOG,*) ' grid structure' +! +!* 4. FICHIER METEO. +! -------------- +! +!* 4.1 Allocations. +! +ALLOCATE( XSHAUT(NKMAX)) +ALLOCATE( XSREL(NSIMAX,NSJMAX) ) +ALLOCATE( XSZ0(NSIMAX,NSJMAX) ) +ALLOCATE( XSCORIOZ (NSIMAX,NSJMAX) ) +ALLOCATE( XSPHI(NSIMAX,NSJMAX,NKMAX) ) +ALLOCATE( XSU(NSIMAX,NSJMAX,NKMAX)) +ALLOCATE( XSV(NSIMAX,NSJMAX,NKMAX)) +ALLOCATE( XSW(NSIMAX,NSJMAX,NKMAX)) +ALLOCATE( XSTH(NSIMAX,NSJMAX,NKMAX)) +ALLOCATE( XSTKE(NSIMAX,NSJMAX,NKMAX)) +ALLOCATE( XSLM(NSIMAX,NSJMAX,NKMAX)) +ALLOCATE( XSDISSIP(NSIMAX,NSJMAX,NKMAX)) +ALLOCATE( XSWPTHP(NSIMAX,NSJMAX,NKMAX)) +ALLOCATE( XSRMV(NSIMAX,NSJMAX,NKMAX)) +ALLOCATE( XSRMC(NSIMAX,NSJMAX,NKMAX)) +ALLOCATE( XSRMR(NSIMAX,NSJMAX,NKMAX)) +ALLOCATE( XSINRT(NSIMAX,NSJMAX)) +ALLOCATE( XSSFU(NSIMAX,NSJMAX)) +ALLOCATE( XSSFV(NSIMAX,NSJMAX)) +ALLOCATE( XSTIMEW(NSIMAX,NSJMAX,NKMAX)) +ALLOCATE( XSTIMEU(NSIMAX,NSJMAX,NKMAX)) +ALLOCATE( XSSIGW(NSIMAX,NSJMAX,NKMAX)) +ALLOCATE( XSSIGU(NSIMAX,NSJMAX,NKMAX)) +ALLOCATE( XSUSTAR(NSIMAX,NSJMAX)) +ALLOCATE( XSWSTAR(NSIMAX,NSJMAX)) +ALLOCATE( XSHMIX(NSIMAX,NSJMAX)) +ALLOCATE( XSLMO(NSIMAX,NSJMAX)) +ALLOCATE( XSTHETAV(NKMAX)) + +! +! 4.2. Nombre de niveaux en Z +! +XSHAUT(1:NKMAX) = (XZHAT(NKB:NKE)+XZHAT(NKB+1:NKE+1))/2. +print*,"niveaux hauteur" +DO JK=1,NKMAX +print*,XSHAUT(JK) +ENDDO +! +! 4.3. Calcul du tableau contenant les coef. de coriolis de la grille +! +DO JI=NSIB,NSIE ; DO JJ=NSJB,NSJE + CALL SM_LATLON(XLATORI,XLONORI,XXHAT(JI),XYHAT(JJ),XPTLAT,XPTLON) + XSCORIOZ(JI-1,JJ-1)=2.*XOMEGA*SIN(XPTLAT*XPI/180.) +ENDDO ; ENDDO +! +! +!* 4.4 Geometrie de la grille et positionnement. +! +! +! On a besoin du point sud-ouest, c'est-a-dire de l'angle inferieur gauche +! du domaine physique de la maille "en bas a gauche". Ca tombe bien, on +! va travailler avec les XXHAT et les XYHAT directement. +! +XPASXM = XXHAT(2)-XXHAT(1) ! Pas selon X en metres. +XPASYM = XYHAT(2)-XYHAT(1) ! Pas selon Y en metres. +ZMAILLE = MAX(XPASXM,XPASYM) +! +!* 4.5 Constantes et champs constants. +! +!* Relief. +! +XSREL(:,:) = XZS(NSIB:NSIE,NSJB:NSJE) +! +!* Geopotentiel PHI +! +print*,"Geopotentiel" +DO JK=1,NKMAX +XSPHI(:,:,JK) = (XSREL(:,:)+XSHAUT(JK))*XG +print*,MINVAL(XSPHI(:,:,JK)),MAXVAL(XSPHI(:,:,JK)) +ENDDO +! +!* Rugosite. +! +XSZ0(:,:) = XZ0(NSIB:NSIE,NSJB:NSJE) +print*,"Rugosite" +print*,MINVAL(XSZ0),MAXVAL(XSZ0) +! +!* 5 FICHIER DATES. +! ------------- +! +WRITE(IFDAT,'(A14)') YDATMDL +WRITE(IFDAT,'(A14)') YDATCUR1 +WRITE(IFDAT,'(A14)') YDATCUR2 +! +!* 5. FICHIER GRILLE. +! -------------- +! +! +!* 5.1 Infos franchement utiles. +! +WRITE(IFGRI,'(F15.8,1X,A)') & + XLON0, 'XLON0 Longitude reference (deg.deci.)' +WRITE(IFGRI,'(F15.8,1X,A)') & + XLAT0, 'XLAT0 Latitude reference (deg.deci.)' +WRITE(IFGRI,'(F15.8,1X,A)') & + XBETA, 'XBETA Rotation grille (deg.deci.)' +WRITE(IFGRI,'(F15.8,1X,A)') XRPK, 'XRPK Facteur de conicite' +WRITE(IFGRI,'(F15.8,1X,A)') & + XLONOR, 'XLONOR Longitude origine (deg.deci.)' +WRITE(IFGRI,'(F15.8,1X,A)') & + XLATOR, 'XLATOR Latitude origine (deg.deci.)' +WRITE(IFGRI,'(F15.1,1X,A)') XXHAT(1),'XHAT(1) Coord. Cartesienne (m)' +WRITE(IFGRI,'(F15.1,1X,A)') XXHAT(2),'XHAT(2) Coord. Cartesienne (m)' +WRITE(IFGRI,'(F15.1,1X,A)') XYHAT(1),'YHAT(1) Coord. Cartesienne (m)' +WRITE(IFGRI,'(F15.1,1X,A)') XYHAT(2),'YHAT(2) Coord. Cartesienne (m)' +! +print*,"GRILLE" +print*,"LON0 : ",XLON0 +print*,"LAT0 : ",XLAT0 +print*,"BETA : ",XBETA +print*,"RPK : ",XRPK +print*,"LONOR: ",XLONOR +print*,"LATOR: ",XLATOR +! +!* 5.2 Points de grille x y z zg +! +WRITE(IFLOG,*)NSIMAX,' gridpoints in x direction' +WRITE(IFLOG,'(8f10.0)')XXHAT(NSIB:NSIE) +WRITE(IFLOG,*)NSJMAX,' gridpoints y direction' +WRITE(IFLOG,'(8f10.0)')XYHAT(NSJB:NSJE) +WRITE(IFLOG,*)NKMAX,' main gridpoints in z direction' +WRITE(IFLOG,'(8f10.2)')XSHAUT(1:NKMAX) +WRITE(IFLOG,'(i4,3x,a38)')NKU-2,'intermediate gridpoints in z direction' +WRITE(IFLOG,'(8f10.2)')XZHAT(2:NKU-1) +WRITE(IFLOG,*)' ==================================================' +! +! Topographie +! +WRITE(IFLOG,*) 'TERRAIN TOPOGRAPHY' +c=1 +a=0 +!modif 12/2014 : passage a une grille haute resolution MesoNH, on depasse 99 +!300 format(i2,'|',18i4) +300 format(i3,'|',18i5) +!400 format(i2,'|',18(f4.2)) +!400 format(i3,'|',18(f5.2)) +!301 format(3x,18('__',i2)) +301 format(3x,18('__',i3)) +ALLOCATE(TAB2D(NSIMAX,NSJMAX)) +ALLOCATE(TAB1D(NSIMAX)) +DO I=1,NSIMAX + TAB1D(I)=I +ENDDO +TAB2D(:,:) = NINT(XSREL(:,:)) +DO WHILE (c.lt.(NSIMAX+1)) + DO b=NSJB,NSJE + IF ((c+17).LT.(NSIMAX+1)) then + a=NSJMAX-b+NSJB + WRITE(IFLOG,300) a,TAB2D(c:c+17,a) + ELSE + a=NSJMAX-b+NSJB + WRITE(IFLOG,300) a,TAB2D(c:NSIMAX,a) + ENDIF + ENDDO +IF ((c+17).LT.(NSIMAX+1)) then + WRITE(IFLOG,301) TAB1D(c:c+17) +ELSE + WRITE(IFLOG,301) TAB1D(c:NSIMAX) +ENDIF + +c=c+18 +ENDDO +! +DEALLOCATE(TAB2D) +DEALLOCATE(TAB1D) +DEALLOCATE(XZS) +DEALLOCATE(XZ0) +DEALLOCATE(XZHAT) +! +! Fermeture du fichier Meso-NH. +! +CALL IO_File_close(TPFILE1) +CALL IO_File_close(TPFILE2) +! +! +!-------------------------------------------' +print*,' FIN MNH2LPDM_INI' +!-------------------------------------------' +! +! +END SUBROUTINE MNH2LPDM_INI diff --git a/src/mesonh/ext/modd_param_ice.F90 b/src/mesonh/ext/modd_param_ice.F90 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/mesonh/ext/modd_rain_ice_descr.F90 b/src/mesonh/ext/modd_rain_ice_descr.F90 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/mesonh/ext/modd_rain_ice_param.F90 b/src/mesonh/ext/modd_rain_ice_param.F90 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/mesonh/ext/modeln.f90 b/src/mesonh/ext/modeln.f90 new file mode 100644 index 0000000000000000000000000000000000000000..aeb7bec8a0befad6a1d596eaa8cb8fbae7da1ed5 --- /dev/null +++ b/src/mesonh/ext/modeln.f90 @@ -0,0 +1,2405 @@ +!MNH_LIC Copyright 1994-2021 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_MODEL_n +! ################### +! +INTERFACE +! + SUBROUTINE MODEL_n(KTCOUNT,OEXIT) +! +INTEGER, INTENT(IN) :: KTCOUNT ! temporal loop index of model KMODEL +LOGICAL, INTENT(INOUT):: OEXIT ! switch for the end of the temporal loop +! +END SUBROUTINE MODEL_n +! +END INTERFACE +! +END MODULE MODI_MODEL_n + +! ################################### + SUBROUTINE MODEL_n(KTCOUNT, OEXIT) +! ################################### +! +!!**** *MODEL_n * -monitor of the model version _n +!! +!! PURPOSE +!! ------- +! The purpose of this routine is to build up a typical model version +! by sequentially calling the specialized routines. +! +!!** METHOD +!! ------ +!! Some preliminary initializations are performed in the first section. +!! Then, specialized routines are called to update the guess of the future +!! instant XRxxS of the variable xx by adding the effects of all the +!! different sources of evolution. +!! +!! (guess of xx at t+dt) * Rhod_ref * Jacobian +!! XRxxS = ------------------------------------------- +!! 2 dt +!! +!! At this level, the informations are transferred with a USE association +!! from the INIT step, where the modules have been previously filled. The +!! transfer to the subroutines computing each source term is performed by +!! argument in order to avoid repeated compilations of these subroutines. +!! This monitor model_n, must therefore be duplicated for each model, +!! model1 corresponds in this case to the outermost model, model2 is used +!! for the first level of gridnesting,.... +!! The effect of all parameterizations is computed in PHYS_PARAM_n, which +!! is itself a monitor. This is due to a possible large number of +!! parameterizations, which can be activated and therefore, will require a +!! very large list of arguments. To circumvent this problem, we transfer by +!! a USE association, the necessary informations in this monitor, which will +!! dispatch the pertinent information to every parametrization. +!! Some elaborated diagnostics, LES tools, budget storages are also called +!! at this level because they require informations about the fields at every +!! timestep. +!! +!! +!! EXTERNAL +!! -------- +!! Subroutine IO_File_open: to open a file +!! Subroutine WRITE_DESFM: to write the descriptive part of a FMfile +!! Subroutine WRITE_LFIFM: to write the binary part of a FMfile +!! Subroutine SET_MASK : to compute all the masks selected for budget +!! computations +!! Subroutine BOUNDARIES : set the fields at the marginal points in every +!! directions according the selected boundary conditions +!! Subroutine INITIAL_GUESS: initializes the guess of the future instant +!! Subroutine LES_FLX_SPECTRA: computes the resolved fluxes and the +!! spectra of some quantities when running in LES mode. +!! Subroutine ADVECTION: computes the advection terms. +!! Subroutine DYN_SOURCES: computes the curvature, Coriolis, gravity terms. +!! Subroutine NUM_DIFF: applies the fourth order numerical diffusion. +!! Subroutine RELAXATION: performs the relaxation to Larger Scale fields +!! in the upper levels and outermost vertical planes +!! Subroutine PHYS_PARAM_n : computes the parameterized physical terms +!! Subroutine RAD_BOUND: prepares the velocity normal components for the bc. +!! Subroutine RESOLVED_CLOUD : computes the sources terms for water in any +!! form +!! Subroutine PRESSURE : computes the pressure gradient term and the +!! absolute pressure +!! Subroutine EXCHANGE : updates the halo of each subdomains +!! Subroutine ENDSTEP : advances in time the fields. +!! Subroutines UVW_LS_COUPLING and SCALAR_LS_COUPLING: +!! compute the large scale fields, used to +!! couple Model_n with outer informations. +!! Subroutine ENDSTEP_BUDGET: writes the budget informations. +!! Subroutine IO_File_close: closes a file +!! Subroutine DATETIME_CORRECTDATE: transform the current time in GMT +!! Subroutine FORCING : computes forcing terms +!! Subroutine ADD3DFIELD_ll : add a field to 3D-list +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! MODD_DYN +!! MODD_CONF +!! MODD_NESTING +!! MODD_BUDGET +!! MODD_PARAMETERS +!! MODD_CONF_n +!! MODD_CURVCOR_n +!! MODD_DYN_n +!! MODD_DIM_n +!! MODD_ADV_n +!! MODD_FIELD_n +!! MODD_LSFIELD_n +!! MODD_GRID_n +!! MODD_METRICS_n +!! MODD_LBC_n +!! MODD_PARAM_n +!! MODD_REF_n +!! MODD_LUNIT_n +!! MODD_OUT_n +!! MODD_TIME_n +!! MODD_TURB_n +!! MODD_CLOUDPAR_n +!! MODD_TIME +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! J.-P. Pinty * LA * +!! +!! MODIFICATIONS +!! ------------- +!! Original 15/09/94 +!! Modification 20/10/94 (J.Stein) for the outputs and abs_layers routines +!! Modification 10/11/94 (J.Stein) change ABS_LAYER_FIELDS call +!! Modification 16/11/94 (J.Stein) add call to the renormalization +!! Modification 17/11/94 (J.-P. Lafore and J.-P. Pinty) call NUM_DIFF +!! Modification 08/12/94 (J.Stein) cleaning + remove (RENORM + ABS_LAYER.. +!! ..) + add RELAXATION + LS fiels in the arguments +!! Modification 19/12/94 (J.Stein) switch for the num diff +!! Modification 22/12/94 (J.Stein) update tdtcur + change dyn_source call +!! Modification 05/01/95 (J.Stein) add the parameterization monitor +!! Modification 09/01/95 (J.Stein) add the 1D switch +!! Modification 10/01/95 (J.Stein) displace the TDTCUR computation +!! Modification 03/01/95 (J.-P. Lafore) Absolute pressure diagnosis +!! Modification Jan 19, 1995 (J. Cuxart) Shunt the DYN_SOURCES in 1D cases. +!! Modification Jan 24, 1995 (J. Stein) Interchange Boundaries and +!! Initial_guess to correct a bug in 2D configuration +!! Modification Feb 02, 1995 (I.Mallet) update BOUNDARIES and RAD_BOUND +!! calls +!! Modification Mar 10, 1995 (I.Mallet) add call to SET_COUPLING +!! March,21, 1995 (J. Stein) remove R from the historical var. +!! March,26, 1995 (J. Stein) add the EPS variable +!! April 18, 1995 (J. Cuxart) add the LES call +!! Sept 20,1995 (Lafore) coupling for the dry mass Md +!! Nov 2,1995 (Stein) displace the temporal counter increase +!! Jan 2,1996 (Stein) rm the test on the temporal counter +!! Modification Feb 5,1996 (J. Vila) implementation new advection +!! schemes for scalars +!! Modification Feb 20,1996 (J.Stein) doctor norm +!! Dec95 - Jul96 (Georgelin, Pinty, Mari, Suhre) FORCING +!! June 17,1996 (Vincent, Lafore, Jabouille) +!! statistics of computing time +!! Aug 8, 1996 (K. Suhre) add chemistry +!! October 12, 1996 (J. Stein) save the PSRC value +!! Sept 05,1996 (V.Masson) print of loop index for debugging +!! purposes +!! July 22,1996 (Lafore) improve write of computing time statistics +!! July 29,1996 (Lafore) nesting introduction +!! Aug. 1,1996 (Lafore) synchronization between models +!! Sept. 4,1996 (Lafore) modification of call to routine SET_COUPLING +!! now split in 2 routines +!! (UVW_LS_COUPLING and SCALAR_LS_COUPLING) +!! Sept 5,1996 (V.Masson) print of loop index for debugging +!! purposes +!! Sept 25,1996 (V.Masson) test for coupling performed here +!! Oct. 29,1996 (Lafore) one-way nesting implementation +!! Oct. 12,1996 (J. Stein) save the PSRC value +!! Dec. 12,1996 (Lafore) change call to RAD_BOUND +!! Dec. 21,1996 (Lafore) two-way nesting implementation +!! Mar. 12,1997 (Lafore) introduction of "surfacic" LS fields +!! Nov 18, 1996 (J.-P. Pinty) FORCING revisited (translation) +!! Dec 04, 1996 (J.-P. Pinty) include mixed-phase clouds +!! Dec 20, 1996 (J.-P. Pinty) update the budgets +!! Dec 23, 1996 (J.-P. Pinty) add the diachronic file control +!! Jan 11, 1997 (J.-P. Pinty) add the deep convection control +!! Dec 20,1996 (V.Masson) call boundaries before the writing +!! Fev 25, 1997 (P.Jabouille) modify the LES tools +!! April 3,1997 (Lafore) merging of the nesting +!! developments on MASTER3 +!! Jul. 8,1997 (Lafore) print control for nesting (NVERB>=7) +!! Jul. 28,1997 (Masson) supress LSTEADY_DMASS +!! Aug. 19,1997 (Lafore) full Clark's formulation introduction +!! Sept 26,1997 (Lafore) LS source calculation at restart +!! (temporarily test to have LS at instant t) +!! Jan. 28,1998 (Bechtold) add SST forcing +!! fev. 10,1998 (Lafore) RHODJ computation and storage for budget +!! Jul. 10,1998 (Stein ) sequentiel loop for nesting +!! Apr. 07,1999 (Stein ) cleaning of the nesting subroutines +!! oct. 20,1998 (Jabouille) // +!! oct. 20,2000 (J.-P. Pinty) add the C2R2 scheme +!! fev. 01,2001 (D.Gazen) add module MODD_NSV for NSV variables +!! mar, 4,2002 (V.Ducrocq) call to temporal series +!! mar, 8, 2001 (V. Masson) advection of perturbation of theta in neutral cases. +!! Nov, 6, 2002 (V. Masson) time counters for budgets & LES +!! mars 20,2001 (Pinty) add ICE4 and C3R5 options +!! jan. 2004 (Masson) surface externalization +!! sept 2004 (M. Tomasini) Cloud mixing length modification +!! june 2005 (P. Tulet) add aerosols / dusts +!! Jul. 2005 (N. Asencio) two_way and phys_param calls: +!! Add the surface parameters : precipitating +!! hydrometeors, Short and Long Wave , MASKkids array +!! Fev. 2006 (M. Leriche) add aqueous phase chemistry +!! april 2006 (T.Maric) Add halo related to 4th order advection scheme +!! May 2006 Remove KEPS +!! Oct 2008 (C.Lac) FIT for variables advected with PPM +!! July 2009 : Displacement of surface diagnostics call to be +!! coherent with surface diagnostics obtained with DIAG +!! 10/11/2009 (P. Aumond) Add mean moments +!! Nov, 12, 2009 (C. Barthe) add cloud electrification and lightning flashes +!! July 2010 (M. Leriche) add ice phase chemical species +!! April 2011 (C.Lac) : Remove instant M +!! April 2011 (C.Lac, V.Masson) : Time splitting for advection +!! J.Escobar 21/03/2013: for HALOK comment all NHALO=1 test +!! P. Tulet Nov 2014 accumulated moles of aqueous species that fall at the surface +!! Dec 2014 (C.Lac) : For reproducibility START/RESTA +!! J.Escobar 20/04/2015: missing UPDATE_HALO before UPDATE_HALO2 +!! July, 2015 (O.Nuissier/F.Duffourg) Add microphysics diagnostic for +!! aircraft, ballon and profiler +!! C.Lac 11/09/2015: correction of the budget due to FIT temporal scheme +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! Sep 2015 (S. Bielli) : Remove YDADFILE from argument call +! of write_phys_param +!! J.Escobar : 19/04/2016 : Pb IOZ/NETCDF , missing OPARALLELIO=.FALSE. for PGD files +!! M.Mazoyer : 04/2016 DTHRAD used for radiative cooling when LACTIT +!!! Modification 01/2016 (JP Pinty) Add LIMA +!! 06/2016 (G.Delautier) phasage surfex 8 +!! M.Leriche : 03/2016 Move computation of accumulated chem. in rain to ch_monitor +!! 09/2016 Add filter on negative values on AERDEP SV before relaxation +!! 10/2016 (C.Lac) _ Correction on the flag for Strang splitting +!! to insure reproducibility between START and RESTA +!! _ Add OSPLIT_WENO +!! _ Add droplet deposition +!! 10/2016 (M.Mazoyer) New KHKO output fields +!! P.Wautelet : 11/07/2016 : removed MNH_NCWRIT define +!! 09/2017 Q.Rodier add LTEND_UV_FRC +!! 10/2017 (C.Lac) Necessity to have chemistry processes as +!! the las process modifying XRSVS +!! 01/2018 (G.Delautier) SURFEX 8.1 +!! 03/2018 (P.Wautelet) replace ADD_FORECAST_TO_DATE by DATETIME_CORRECTDATE +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +!! 07/2017 (V. Vionnet) : Add blowing snow scheme +!! S. Riette : 11/2016 Add ZPABST to keep pressure constant during timestep +!! 01/2018 (C.Lac) Add VISCOSITY +!! Philippe Wautelet: 21/01/2019: add LIO_ALLOW_NO_BACKUP and LIO_NO_WRITE to modd_io_ll +! to allow to disable writes (for bench purposes) +! P. Wautelet 07/02/2019: remove OPARALLELIO argument from open and close files subroutines +! (nsubfiles_ioz is now determined in IO_File_add2list) +!! 02/2019 C.Lac add rain fraction as an output field +!! Bielli S. 02/2019 Sea salt : significant sea wave height influences salt emission; 5 salt modes +! P. Wautelet 28/03/2019: use MNHTIME for time measurement variables +! P. Wautelet 28/03/2019: use TFILE instead of unit number for set_iluout_timing +! P. Wautelet 19/04/2019: removed unused dummy arguments and variables +! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function +! P. Wautelet 20/05/2019: add name argument to ADDnFIELD_ll + new ADD4DFIELD_ll subroutine +! J. Escobar 09/07/2019: norme Doctor -> Rename Module Type variable TZ -> T +! J. Escobar 09/07/2019: for bug in management of XLSZWSM variable, add/use specific 2D TLSFIELD2D_ll pointer +! P. Wautelet 13/09/2019: budget: simplify and modernize date/time management +! J. Escobar 27/09/2019: add missing report timing of RESOLVED_ELEC +! P. Wautelet 02-03/2020: use the new data structures and subroutines for budgets +! P. Wautelet 12/10/2020: Write_les_n: remove HLES_AVG dummy argument and group all 4 calls +! F. Auguste 01/02/2021: add IBM +! T. Nagel 01/02/2021: add turbulence recycling +! P. Wautelet 19/02/2021: add NEGA2 term for SV budgets +! J.L. Redelsperger 03/2021: add Call NHOA_COUPLN (coupling O & A LES version) +! A. Costes 12/2021: add Blaze fire model +! C. Barthe 07/04/2022: deallocation of ZSEA +!!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_2D_FRC +USE MODD_ADV_n +USE MODD_AIRCRAFT_BALLOON +USE MODD_ARGSLIST_ll, ONLY : LIST_ll +USE MODD_BAKOUT +USE MODD_BIKHARDT_n +USE MODD_BLANK_n +USE MODD_BLOWSNOW +USE MODD_BLOWSNOW_n +use modd_budget, only: cbutype, lbu_ru, lbu_rv, lbu_rw, lbudget_u, lbudget_v, lbudget_w, lbudget_sv, lbu_enable, & + NBUDGET_U, NBUDGET_V, NBUDGET_W, NBUDGET_SV1, nbumod, nbutime, & + tbudgets, tburhodj, & + xtime_bu, xtime_bu_process +USE MODD_CH_AERO_n, ONLY: XSOLORG, XMI +USE MODD_CH_MNHC_n, ONLY: LUSECHEM,LCH_CONV_LINOX,LUSECHAQ,LUSECHIC, & + LCH_INIT_FIELD +USE MODD_CLOUD_MF_n +USE MODD_CLOUDPAR_n +USE MODD_CONF +USE MODD_CONF_n +USE MODD_CURVCOR_n +USE MODD_DEEP_CONVECTION_n +USE MODD_DIM_n +USE MODD_DRAG_n +USE MODD_DUST, ONLY: LDUST +USE MODD_DYN +USE MODD_DYN_n +USE MODD_DYNZD +USE MODD_DYNZD_n +USE MODD_ELEC_DESCR +USE MODD_EOL_MAIN +USE MODD_FIELD_n +USE MODD_FRC +USE MODD_FRC_n +USE MODD_GET_n +USE MODD_GRID, ONLY: XLONORI,XLATORI +USE MODD_GRID_n +USE MODD_IBM_PARAM_n, ONLY: CIBM_ADV, LIBM, LIBM_TROUBLE, XIBM_LS +USE MODD_ICE_C1R3_DESCR, ONLY: XRTMIN_C1R3=>XRTMIN +USE MODD_IO, ONLY: LIO_NO_WRITE, TFILEDATA, TFILE_SURFEX, TFILE_DUMMY +USE MODD_LBC_n +USE MODD_LES +USE MODD_LES_BUDGET +USE MODD_LIMA_PRECIP_SCAVENGING_n +USE MODD_LSFIELD_n +USE MODD_LUNIT, ONLY: TOUTDATAFILE +USE MODD_LUNIT_n, ONLY: TDIAFILE,TINIFILE,TINIFILEPGD,TLUOUT +USE MODD_MEAN_FIELD +USE MODD_MEAN_FIELD_n +USE MODD_METRICS_n +USE MODD_MNH_SURFEX_n +USE MODD_NESTING +USE MODD_NSV +USE MODD_NUDGING_n +USE MODD_OUT_n +USE MODD_PARAM_C1R3, ONLY: NSEDI => LSEDI, NHHONI => LHHONI +USE MODD_PARAM_C2R2, ONLY: NSEDC => LSEDC, NRAIN => LRAIN, NACTIT => LACTIT,LACTTKE,LDEPOC +USE MODD_PARAMETERS +USE MODD_PARAM_ICE_n, ONLY: LWARM,LSEDIC,LCONVHG,LDEPOSC, CSUBG_AUCV_RC +USE MODD_PARAM_LIMA, ONLY: MSEDC => LSEDC, MWARM => LWARM, MRAIN => LRAIN, & + MACTIT => LACTIT, LSCAV, LCOLD, & + MSEDI => LSEDI, MHHONI => LHHONI, LHAIL, & + XRTMIN_LIMA=>XRTMIN, MACTTKE=>LACTTKE +USE MODD_PARAM_MFSHALL_n +USE MODD_PARAM_n +USE MODD_PAST_FIELD_n +USE MODD_PRECIP_n +use modd_precision, only: MNHTIME +USE MODD_PROFILER_n +USE MODD_RADIATIONS_n, ONLY: XTSRAD,XSCAFLASWD,XDIRFLASWD,XDIRSRFSWD, XAER, XDTHRAD +USE MODD_RAIN_ICE_DESCR_n, ONLY: XRTMIN +USE MODD_RECYCL_PARAM_n, ONLY: LRECYCL +USE MODD_REF, ONLY: LCOUPLES +USE MODD_REF_n +USE MODD_SALT, ONLY: LSALT +USE MODD_SERIES, ONLY: LSERIES +USE MODD_SERIES_n, ONLY: NFREQSERIES +USE MODD_STATION_n +USE MODD_SUB_MODEL_n +USE MODD_TIME +USE MODD_TIME_n +USE MODD_TIMEZ +USE MODD_TURB_CLOUD, ONLY: NMODEL_CLOUD,CTURBLEN_CLOUD,XCEI +USE MODD_TURB_n +USE MODD_NEB_n, ONLY: VSIGQSAT, LSIGMAS, LSUBG_COND +USE MODD_VISCOSITY +! +use mode_budget, only: Budget_store_init, Budget_store_end +USE MODE_DATETIME +USE MODE_ELEC_ll +USE MODE_GRIDCART +USE MODE_GRIDPROJ +USE MODE_IO_FIELD_WRITE, only: IO_Field_user_write, IO_Fieldlist_write, IO_Header_write +USE MODE_IO_FILE, only: IO_File_close, IO_File_open +USE MODE_IO_MANAGE_STRUCT, only: IO_File_add2list +USE MODE_ll +#ifdef MNH_IOLFI +use mode_menu_diachro, only: MENU_DIACHRO +#endif +USE MODE_MNH_TIMING +USE MODE_MODELN_HANDLER +USE MODE_MPPDB +USE MODE_MSG +USE MODE_ONE_WAY_n +use mode_write_les_n, only: Write_les_n +use mode_write_lfifmn_fordiachro_n, only: WRITE_LFIFMN_FORDIACHRO_n +USE MODE_WRITE_PROFILER_n, ONLY: WRITE_PROFILER_n +! +USE MODI_ADDFLUCTUATIONS +USE MODI_ADVECTION_METSV +USE MODI_ADVECTION_UVW +USE MODI_ADVECTION_UVW_CEN +USE MODI_ADV_FORCING_n +USE MODI_AER_MONITOR_n +USE MODI_AIRCRAFT_BALLOON +USE MODI_BLOWSNOW +USE MODI_BOUNDARIES +USE MODI_BUDGET_FLAGS +USE MODI_CART_COMPRESS +USE MODI_CH_MONITOR_n +USE MODI_DIAG_SURF_ATM_N +USE MODI_DYN_SOURCES +USE MODI_END_DIAG_IN_RUN +USE MODI_ENDSTEP +USE MODI_ENDSTEP_BUDGET +USE MODI_EXCHANGE +USE MODI_FORCING +USE MODI_FORC_SQUALL_LINE +USE MODI_FORC_WIND +USE MODI_GET_HALO +USE MODI_GRAVITY_IMPL +USE MODI_IBM_INIT +USE MODI_IBM_FORCING +USE MODI_IBM_FORCING_TR +USE MODI_IBM_FORCING_ADV +USE MODI_INI_DIAG_IN_RUN +USE MODI_INI_LG +USE MODI_INI_MEAN_FIELD +USE MODI_INITIAL_GUESS +USE MODI_LES_INI_TIMESTEP_n +USE MODI_LES_N +USE MODI_LIMA_PRECIP_SCAVENGING +USE MODI_LS_COUPLING +USE MODI_MASK_COMPRESS +USE MODI_MEAN_FIELD +USE MODI_MNHGET_SURF_PARAM_n +USE MODI_MNHWRITE_ZS_DUMMY_n +USE MODI_NUDGING +USE MODI_NUM_DIFF +USE MODI_PHYS_PARAM_n +USE MODI_PRESSUREZ +USE MODI_PROFILER_n +USE MODI_RAD_BOUND +USE MODI_RECYCLING +USE MODI_RELAX2FW_ION +USE MODI_RELAXATION +USE MODI_REL_FORCING_n +USE MODI_RESOLVED_CLOUD +USE MODI_RESOLVED_ELEC_n +USE MODI_SERIES_N +USE MODI_SETLB_LG +USE MODI_SET_MASK +USE MODI_SHUMAN +USE MODI_SPAWN_LS_n +USE MODI_STATION_n +USE MODI_TURB_CLOUD_INDEX +USE MODI_TWO_WAY +USE MODI_UPDATE_NSV +USE MODI_VISCOSITY +USE MODI_WRITE_AIRCRAFT_BALLOON +USE MODI_WRITE_DESFM_n +USE MODI_WRITE_DIAG_SURF_ATM_N +USE MODI_WRITE_LFIFM_n +USE MODI_WRITE_SERIES_n +USE MODI_WRITE_STATION_n +USE MODI_WRITE_SURF_ATM_N +! +USE MODD_FIRE +IMPLICIT NONE +! +!* 0.1 declarations of arguments +! +! +! +INTEGER, INTENT(IN) :: KTCOUNT +LOGICAL, INTENT(INOUT):: OEXIT +! +!* 0.2 declarations of local variables +! +INTEGER :: ILUOUT ! Logical unit number for the output listing +INTEGER :: IIU,IJU,IKU ! array size in first, second and third dimensions +INTEGER :: IIB,IIE,IJB,IJE ! index values for the physical subdomain +INTEGER :: JSV,JRR ! Loop index for scalar and moist variables +INTEGER :: INBVAR ! number of HALO2_lls to allocate +INTEGER :: IINFO_ll ! return code of parallel routine +INTEGER :: IVERB ! LFI verbosity level +LOGICAL :: GSTEADY_DMASS ! conditional call to mass computation +! + ! for computing time analysis +REAL(kind=MNHTIME), DIMENSION(2) :: ZTIME, ZTIME1, ZTIME2, ZEND, ZTOT, ZALL, ZTOT_PT, ZBLAZETOT +REAL(kind=MNHTIME), DIMENSION(2) :: ZTIME_STEP,ZTIME_STEP_PTS +CHARACTER :: YMI +INTEGER :: IPOINTS +CHARACTER(len=16) :: YTCOUNT,YPOINTS +! +INTEGER :: ISYNCHRO ! model synchronic index relative to its father + ! = 1 for the first time step in phase with DAD + ! = 0 for the last time step (out of phase) +INTEGER :: IMI ! Current model index +REAL, DIMENSION(:,:),ALLOCATABLE :: ZSEA +REAL, DIMENSION(:,:),ALLOCATABLE :: ZTOWN +! Dummy pointers needed to correct an ifort Bug +REAL, DIMENSION(:), POINTER :: DPTR_XZHAT +REAL, DIMENSION(:), POINTER :: DPTR_XBMX1,DPTR_XBMX2,DPTR_XBMX3,DPTR_XBMX4 +REAL, DIMENSION(:), POINTER :: DPTR_XBMY1,DPTR_XBMY2,DPTR_XBMY3,DPTR_XBMY4 +REAL, DIMENSION(:), POINTER :: DPTR_XBFX1,DPTR_XBFX2,DPTR_XBFX3,DPTR_XBFX4 +REAL, DIMENSION(:), POINTER :: DPTR_XBFY1,DPTR_XBFY2,DPTR_XBFY3,DPTR_XBFY4 +CHARACTER(LEN=4), DIMENSION(:), POINTER :: DPTR_CLBCX,DPTR_CLBCY +INTEGER, DIMENSION(:,:,:), POINTER :: DPTR_NKLIN_LBXU,DPTR_NKLIN_LBYU,DPTR_NKLIN_LBXV,DPTR_NKLIN_LBYV +INTEGER, DIMENSION(:,:,:), POINTER :: DPTR_NKLIN_LBXW,DPTR_NKLIN_LBYW,DPTR_NKLIN_LBXM,DPTR_NKLIN_LBYM +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XCOEFLIN_LBXU,DPTR_XCOEFLIN_LBYU +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XCOEFLIN_LBXV,DPTR_XCOEFLIN_LBYV +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XCOEFLIN_LBXW,DPTR_XCOEFLIN_LBYW +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XCOEFLIN_LBXM,DPTR_XCOEFLIN_LBYM +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XLBXUM,DPTR_XLBYUM,DPTR_XLBXVM,DPTR_XLBYVM +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XLBXWM,DPTR_XLBYWM,DPTR_XLBXTHM,DPTR_XLBYTHM +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XLBXTKEM,DPTR_XLBYTKEM +REAL, DIMENSION(:,:,:,:), POINTER :: DPTR_XLBXSVM,DPTR_XLBYSVM +REAL, DIMENSION(:,:,:,:), POINTER :: DPTR_XLBXRM,DPTR_XLBYRM +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XZZ +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XLSUM,DPTR_XLSVM,DPTR_XLSWM,DPTR_XLSTHM,DPTR_XLSRVM +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XLSUS,DPTR_XLSVS,DPTR_XLSWS,DPTR_XLSTHS,DPTR_XLSRVS +REAL, DIMENSION(:,:), POINTER :: DPTR_XLSZWSM,DPTR_XLSZWSS +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XLBXUS,DPTR_XLBYUS,DPTR_XLBXVS,DPTR_XLBYVS +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XLBXWS,DPTR_XLBYWS,DPTR_XLBXTHS,DPTR_XLBYTHS +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XLBXTKES,DPTR_XLBYTKES +REAL, DIMENSION(:,:,:,:), POINTER :: DPTR_XLBXRS,DPTR_XLBYRS,DPTR_XLBXSVS,DPTR_XLBYSVS +! +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XRHODJ,DPTR_XUM,DPTR_XVM,DPTR_XWM,DPTR_XTHM +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XTKEM,DPTR_XRUS,DPTR_XRVS,DPTR_XRWS,DPTR_XRTHS +REAL, DIMENSION(:,:,:), POINTER :: DPTR_XRTKES,DPTR_XDIRFLASWD,DPTR_XSCAFLASWD,DPTR_XDIRSRFSWD +REAL, DIMENSION(:,:,:,:), POINTER :: DPTR_XRM,DPTR_XSVM,DPTR_XRRS,DPTR_XRSVS +REAL, DIMENSION(:,:), POINTER :: DPTR_XINPRC,DPTR_XINPRR,DPTR_XINPRS,DPTR_XINPRG +REAL, DIMENSION(:,:), POINTER :: DPTR_XINPRH,DPTR_XPRCONV,DPTR_XPRSCONV +LOGICAL, DIMENSION(:,:),POINTER :: DPTR_GMASKkids +! +REAL, DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZSPEEDC +REAL, DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZSPEEDR +REAL, DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZSPEEDS +REAL, DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZSPEEDG +REAL, DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZSPEEDH +REAL, DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZINPRC3D +REAL, DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZINPRS3D +REAL, DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZINPRG3D +REAL, DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZINPRH3D +! +LOGICAL :: KWARM +LOGICAL :: KRAIN +LOGICAL :: KSEDC +LOGICAL :: KACTIT +LOGICAL :: KSEDI +LOGICAL :: KHHONI +! +REAL, DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZRUS,ZRVS,ZRWS +REAL, DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZPABST !To give pressure at t + ! (and not t+1) to resolved_cloud +REAL, DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZJ +! +TYPE(LIST_ll), POINTER :: TZFIELDC_ll ! list of fields to exchange +TYPE(HALO2LIST_ll), POINTER :: TZHALO2C_ll ! list of fields to exchange +LOGICAL :: GCLD ! conditionnal call for dust wet deposition +LOGICAL :: GCLOUD_ONLY ! conditionnal radiation computations for + ! the only cloudy columns +REAL, DIMENSION(SIZE(XRSVS,1), SIZE(XRSVS,2), SIZE(XRSVS,3), NSV_AER) :: ZWETDEPAER + + +! +TYPE(TFILEDATA),POINTER :: TZBAKFILE, TZOUTFILE +! TYPE(TFILEDATA),SAVE :: TZDIACFILE +!------------------------------------------------------------------------------- +! +TZBAKFILE=> NULL() +TZOUTFILE=> NULL() +! +!* 0. MICROPHYSICAL SCHEME +! ------------------- +SELECT CASE(CCLOUD) +CASE('C2R2','KHKO','C3R5') + KWARM = .TRUE. + KRAIN = NRAIN + KSEDC = NSEDC + KACTIT = NACTIT +! + KSEDI = NSEDI + KHHONI = NHHONI +CASE('LIMA') + KWARM = MWARM + KRAIN = MRAIN + KSEDC = MSEDC + KACTIT = MACTIT +! + KSEDI = MSEDI + KHHONI = MHHONI +CASE('ICE3','ICE4') !default values + KWARM = LWARM + KRAIN = .TRUE. + KSEDC = .TRUE. + KACTIT = .FALSE. +! + KSEDI = .TRUE. + KHHONI = .FALSE. +END SELECT +! +! +!* 1 PRELIMINARY +! ------------ +IMI = GET_CURRENT_MODEL_INDEX() +! +!* 1.0 update NSV_* variables for current model +! ---------------------------------------- +! +CALL UPDATE_NSV(IMI) +! +!* 1.1 RECOVER THE LOGICAL UNIT NUMBER FOR THE OUTPUT PRINTS +! +ILUOUT = TLUOUT%NLU +! +!* 1.2 SET ARRAY SIZE +! +CALL GET_DIM_EXT_ll('B',IIU,IJU) +IKU=NKMAX+2*JPVEXT +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +! +IF (IMI==1) THEN + GSTEADY_DMASS=LSTEADYLS +ELSE + GSTEADY_DMASS=.FALSE. +END IF +! +!* 1.3 OPEN THE DIACHRONIC FILE +! +IF (KTCOUNT == 1) THEN +! + NULLIFY(TFIELDS_ll,TLSFIELD_ll,TFIELDT_ll) + NULLIFY(TLSFIELD2D_ll) + NULLIFY(THALO2T_ll) + NULLIFY(TLSHALO2_ll) + NULLIFY(TFIELDSC_ll) +! + ALLOCATE(XWT_ACT_NUC(SIZE(XWT,1),SIZE(XWT,2),SIZE(XWT,3))) + ALLOCATE(GMASKkids(SIZE(XWT,1),SIZE(XWT,2))) +! + IF ( .NOT. LIO_NO_WRITE ) THEN + CALL IO_File_open(TDIAFILE) +! + CALL IO_Header_write(TDIAFILE) + CALL WRITE_DESFM_n(IMI,TDIAFILE) + CALL WRITE_LFIFMN_FORDIACHRO_n(TDIAFILE) + END IF +! +!* 1.4 Initialization of the list of fields for the halo updates +! +! a) Sources terms +! + CALL ADD3DFIELD_ll( TFIELDS_ll, XRUS, 'MODEL_n::XRUS' ) + CALL ADD3DFIELD_ll( TFIELDS_ll, XRVS, 'MODEL_n::XRVS' ) + CALL ADD3DFIELD_ll( TFIELDS_ll, XRWS, 'MODEL_n::XRWS' ) + CALL ADD3DFIELD_ll( TFIELDS_ll, XRTHS, 'MODEL_n::XRTHS' ) + CALL ADD3DFIELD_ll( TFIELDS_ll, XRUS_PRES, 'MODEL_n::XRUS_PRES' ) + CALL ADD3DFIELD_ll( TFIELDS_ll, XRVS_PRES, 'MODEL_n::XRVS_PRES' ) + CALL ADD3DFIELD_ll( TFIELDS_ll, XRWS_PRES, 'MODEL_n::XRWS_PRES' ) + CALL ADD3DFIELD_ll( TFIELDS_ll, XRTHS_CLD, 'MODEL_n::XRTHS_CLD' ) + IF (SIZE(XRTKES,1) /= 0) CALL ADD3DFIELD_ll( TFIELDS_ll, XRTKES, 'MODEL_n::XRTKES' ) + CALL ADD4DFIELD_ll( TFIELDS_ll, XRRS (:,:,:,1:NRR), 'MODEL_n::XRRS' ) + CALL ADD4DFIELD_ll( TFIELDS_ll, XRRS_CLD (:,:,:,1:NRR), 'MODEL_n::XRRS_CLD' ) + CALL ADD4DFIELD_ll( TFIELDS_ll, XRSVS (:,:,:,1:NSV), 'MODEL_n::XRSVS') + CALL ADD4DFIELD_ll( TFIELDS_ll, XRSVS_CLD(:,:,:,1:NSV), 'MODEL_n::XRSVS_CLD') + IF (SIZE(XSRCT,1) /= 0) CALL ADD3DFIELD_ll( TFIELDS_ll, XSRCT, 'MODEL_n::XSRCT' ) + ! Fire model parallel setup + IF (LBLAZE) THEN + CALL ADD3DFIELD_ll( TFIELDS_ll, XLSPHI, 'MODEL_n::XLSPHI') + CALL ADD3DFIELD_ll( TFIELDS_ll, XBMAP, 'MODEL_n::XBMAP') + CALL ADD3DFIELD_ll( TFIELDS_ll, XFMRFA, 'MODEL_n::XFMRFA') + CALL ADD3DFIELD_ll( TFIELDS_ll, XFMWF0, 'MODEL_n::XFMWF0') + CALL ADD3DFIELD_ll( TFIELDS_ll, XFMR0, 'MODEL_n::XFMR0') + CALL ADD3DFIELD_ll( TFIELDS_ll, XFMR00, 'MODEL_n::XFMR00') + CALL ADD3DFIELD_ll( TFIELDS_ll, XFMIGNITION, 'MODEL_n::XFMIGNITION') + CALL ADD3DFIELD_ll( TFIELDS_ll, XFMFUELTYPE, 'MODEL_n::XFMFUELTYPE') + CALL ADD3DFIELD_ll( TFIELDS_ll, XFIRETAU, 'MODEL_n::XFIRETAU') + CALL ADD4DFIELD_ll( TFIELDS_ll, XFLUXPARAMH(:,:,:,1:SIZE(XFLUXPARAMH,4)), 'MODEL_n::XFLUXPARAMH') + CALL ADD4DFIELD_ll( TFIELDS_ll, XFLUXPARAMW(:,:,:,1:SIZE(XFLUXPARAMW,4)), 'MODEL_n::XFLUXPARAMW') + CALL ADD3DFIELD_ll( TFIELDS_ll, XFIRERW, 'MODEL_n::XFIRERW') + CALL ADD3DFIELD_ll( TFIELDS_ll, XFMASE, 'MODEL_n::XFMASE') + CALL ADD3DFIELD_ll( TFIELDS_ll, XFMAWC, 'MODEL_n::XFMAWC') + CALL ADD3DFIELD_ll( TFIELDS_ll, XFMWALKIG, 'MODEL_n::XFMWALKIG') + CALL ADD3DFIELD_ll( TFIELDS_ll, XFMFLUXHDH, 'MODEL_n::XFMFLUXHDH') + CALL ADD3DFIELD_ll( TFIELDS_ll, XFMFLUXHDW, 'MODEL_n::XFMFLUXHDW') + CALL ADD3DFIELD_ll( TFIELDS_ll, XFMHWS, 'MODEL_n::XFMHWS') + CALL ADD3DFIELD_ll( TFIELDS_ll, XFMWINDU, 'MODEL_n::XFMWINDU') + CALL ADD3DFIELD_ll( TFIELDS_ll, XFMWINDV, 'MODEL_n::XFMWINDV') + CALL ADD3DFIELD_ll( TFIELDS_ll, XFMWINDW, 'MODEL_n::XFMWINDW') + CALL ADD3DFIELD_ll( TFIELDS_ll, XFMGRADOROX, 'MODEL_n::XFMGRADOROX') + CALL ADD3DFIELD_ll( TFIELDS_ll, XFMGRADOROY, 'MODEL_n::XFMGRADOROY') + END IF + ! + IF ((LNUMDIFU .OR. LNUMDIFTH .OR. LNUMDIFSV) ) THEN + ! + ! b) LS fields + ! + CALL ADD3DFIELD_ll( TLSFIELD_ll, XLSUM, 'MODEL_n::XLSUM' ) + CALL ADD3DFIELD_ll( TLSFIELD_ll, XLSVM, 'MODEL_n::XLSVM' ) + CALL ADD3DFIELD_ll( TLSFIELD_ll, XLSWM, 'MODEL_n::XLSWM' ) + CALL ADD3DFIELD_ll( TLSFIELD_ll, XLSTHM, 'MODEL_n::XLSTHM' ) + CALL ADD2DFIELD_ll( TLSFIELD2D_ll, XLSZWSM, 'MODEL_n::XLSZWSM' ) + IF (NRR >= 1) THEN + CALL ADD3DFIELD_ll( TLSFIELD_ll, XLSRVM, 'MODEL_n::XLSRVM' ) + ENDIF + ! + ! c) Fields at t + ! + CALL ADD3DFIELD_ll( TFIELDT_ll, XUT, 'MODEL_n::XUT' ) + CALL ADD3DFIELD_ll( TFIELDT_ll, XVT, 'MODEL_n::XVT' ) + CALL ADD3DFIELD_ll( TFIELDT_ll, XWT, 'MODEL_n::XWT' ) + CALL ADD3DFIELD_ll( TFIELDT_ll, XTHT, 'MODEL_n::XTHT' ) + IF (SIZE(XRTKES,1) /= 0) CALL ADD3DFIELD_ll( TFIELDT_ll, XTKET, 'MODEL_n::XTKET' ) + CALL ADD4DFIELD_ll(TFIELDT_ll, XRT (:,:,:,1:NRR), 'MODEL_n::XSV' ) + CALL ADD4DFIELD_ll(TFIELDT_ll, XSVT(:,:,:,1:NSV), 'MODEL_n::XSVT' ) + ! + !* 1.5 Initialize the list of fields for the halo updates (2nd layer) + ! + INBVAR = 4+NRR+NSV + IF (SIZE(XRTKES,1) /= 0) INBVAR=INBVAR+1 + CALL INIT_HALO2_ll(THALO2T_ll,INBVAR,IIU,IJU,IKU) + CALL INIT_HALO2_ll(TLSHALO2_ll,4+MIN(1,NRR),IIU,IJU,IKU) + ! + !* 1.6 Initialise the 2nd layer of the halo of the LS fields + ! + IF ( LSTEADYLS ) THEN + CALL UPDATE_HALO_ll(TLSFIELD_ll, IINFO_ll) + CALL UPDATE_HALO_ll(TLSFIELD2D_ll,IINFO_ll) + CALL UPDATE_HALO2_ll(TLSFIELD_ll, TLSHALO2_ll, IINFO_ll) + END IF + END IF + ! +! + ! + XT_START = 0.0_MNHTIME + ! + XT_STORE = 0.0_MNHTIME + XT_BOUND = 0.0_MNHTIME + XT_GUESS = 0.0_MNHTIME + XT_FORCING = 0.0_MNHTIME + XT_NUDGING = 0.0_MNHTIME + XT_ADV = 0.0_MNHTIME + XT_ADVUVW = 0.0_MNHTIME + XT_GRAV = 0.0_MNHTIME + XT_SOURCES = 0.0_MNHTIME + ! + XT_DIFF = 0.0_MNHTIME + XT_RELAX = 0.0_MNHTIME + XT_PARAM = 0.0_MNHTIME + XT_SPECTRA = 0.0_MNHTIME + XT_HALO = 0.0_MNHTIME + XT_VISC = 0.0_MNHTIME + XT_RAD_BOUND = 0.0_MNHTIME + XT_PRESS = 0.0_MNHTIME + ! + XT_CLOUD = 0.0_MNHTIME + XT_STEP_SWA = 0.0_MNHTIME + XT_STEP_MISC = 0.0_MNHTIME + XT_COUPL = 0.0_MNHTIME + XT_1WAY = 0.0_MNHTIME + XT_STEP_BUD = 0.0_MNHTIME + ! + XT_RAD = 0.0_MNHTIME + XT_DCONV = 0.0_MNHTIME + XT_GROUND = 0.0_MNHTIME + XT_TURB = 0.0_MNHTIME + XT_MAFL = 0.0_MNHTIME + XT_DRAG = 0.0_MNHTIME + XT_EOL = 0.0_MNHTIME + XT_TRACER = 0.0_MNHTIME + XT_SHADOWS = 0.0_MNHTIME + XT_ELEC = 0.0_MNHTIME + XT_CHEM = 0.0_MNHTIME + XT_2WAY = 0.0_MNHTIME + ! + XT_IBM_FORC = 0.0_MNHTIME + ! Blaze fire model + XFIREPERF = 0.0_MNHTIME + ! +END IF +! +!* 1.7 Allocation of arrays for observation diagnostics +! +CALL INI_DIAG_IN_RUN(IIU,IJU,IKU,LFLYER,LSTATION,LPROFILER) +! +! +CALL SECOND_MNH2(ZEND) +! +!------------------------------------------------------------------------------- +! +!* 2. ONE-WAY NESTING AND LARGE SCALE FIELD REFRESH +! --------------------------------------------- +! +! +CALL SECOND_MNH2(ZTIME1) +! +ISYNCHRO = MODULO (KTCOUNT, NDTRATIO(IMI) ) ! test of synchronisation +! +! +IF (LCOUPLES.AND.LOCEAN) THEN + CALL NHOA_COUPL_n(NDAD(IMI),XTSTEP,IMI,KTCOUNT,IKU) +END IF +! No Gridnest in coupled OA LES for now +IF (.NOT. LCOUPLES .AND. IMI/=1 .AND. NDAD(IMI)/=IMI .AND. (ISYNCHRO==1 .OR. NDTRATIO(IMI) == 1) ) THEN +! +! Use dummy pointers to correct an ifort BUG + DPTR_XBMX1=>XBMX1 + DPTR_XBMX2=>XBMX2 + DPTR_XBMX3=>XBMX3 + DPTR_XBMX4=>XBMX4 + DPTR_XBMY1=>XBMY1 + DPTR_XBMY2=>XBMY2 + DPTR_XBMY3=>XBMY3 + DPTR_XBMY4=>XBMY4 + DPTR_XBFX1=>XBFX1 + DPTR_XBFX2=>XBFX2 + DPTR_XBFX3=>XBFX3 + DPTR_XBFX4=>XBFX4 + DPTR_XBFY1=>XBFY1 + DPTR_XBFY2=>XBFY2 + DPTR_XBFY3=>XBFY3 + DPTR_XBFY4=>XBFY4 + DPTR_CLBCX=>CLBCX + DPTR_CLBCY=>CLBCY + ! + DPTR_XZZ=>XZZ + DPTR_XZHAT=>XZHAT + DPTR_XCOEFLIN_LBXM=>XCOEFLIN_LBXM + DPTR_XLSTHM=>XLSTHM + DPTR_XLSRVM=>XLSRVM + DPTR_XLSUM=>XLSUM + DPTR_XLSVM=>XLSVM + DPTR_XLSWM=>XLSWM + DPTR_XLSZWSM=>XLSZWSM + DPTR_XLSTHS=>XLSTHS + DPTR_XLSRVS=>XLSRVS + DPTR_XLSUS=>XLSUS + DPTR_XLSVS=>XLSVS + DPTR_XLSWS=>XLSWS + DPTR_XLSZWSS=>XLSZWSS + ! + IF ( LSTEADYLS ) THEN + NCPL_CUR=0 + ELSE + IF (NCPL_CUR/=1) THEN + IF ( KTCOUNT+1 == NCPL_TIMES(NCPL_CUR-1,IMI) ) THEN + ! + ! LS sources are interpolated from the LS field + ! values of model DAD(IMI) + CALL SPAWN_LS_n(NDAD(IMI),XTSTEP,IMI, & + DPTR_XBMX1,DPTR_XBMX2,DPTR_XBMX3,DPTR_XBMX4,DPTR_XBMY1,DPTR_XBMY2,DPTR_XBMY3,DPTR_XBMY4, & + DPTR_XBFX1,DPTR_XBFX2,DPTR_XBFX3,DPTR_XBFX4,DPTR_XBFY1,DPTR_XBFY2,DPTR_XBFY3,DPTR_XBFY4, & + NDXRATIO_ALL(IMI),NDYRATIO_ALL(IMI), & + DPTR_CLBCX,DPTR_CLBCY,DPTR_XZZ,DPTR_XZHAT,LSLEVE,XLEN1,XLEN2,DPTR_XCOEFLIN_LBXM, & + DPTR_XLSTHM,DPTR_XLSRVM,DPTR_XLSUM,DPTR_XLSVM,DPTR_XLSWM,DPTR_XLSZWSM, & + DPTR_XLSTHS,DPTR_XLSRVS,DPTR_XLSUS,DPTR_XLSVS,DPTR_XLSWS, DPTR_XLSZWSS ) + END IF + END IF + ! + END IF + ! + DPTR_NKLIN_LBXU=>NKLIN_LBXU + DPTR_XCOEFLIN_LBXU=>XCOEFLIN_LBXU + DPTR_NKLIN_LBYU=>NKLIN_LBYU + DPTR_XCOEFLIN_LBYU=>XCOEFLIN_LBYU + DPTR_NKLIN_LBXV=>NKLIN_LBXV + DPTR_XCOEFLIN_LBXV=>XCOEFLIN_LBXV + DPTR_NKLIN_LBYV=>NKLIN_LBYV + DPTR_XCOEFLIN_LBYV=>XCOEFLIN_LBYV + DPTR_NKLIN_LBXW=>NKLIN_LBXW + DPTR_XCOEFLIN_LBXW=>XCOEFLIN_LBXW + DPTR_NKLIN_LBYW=>NKLIN_LBYW + DPTR_XCOEFLIN_LBYW=>XCOEFLIN_LBYW + ! + DPTR_NKLIN_LBXM=>NKLIN_LBXM + DPTR_XCOEFLIN_LBXM=>XCOEFLIN_LBXM + DPTR_NKLIN_LBYM=>NKLIN_LBYM + DPTR_XCOEFLIN_LBYM=>XCOEFLIN_LBYM + ! + DPTR_XLBXUM=>XLBXUM + DPTR_XLBYUM=>XLBYUM + DPTR_XLBXVM=>XLBXVM + DPTR_XLBYVM=>XLBYVM + DPTR_XLBXWM=>XLBXWM + DPTR_XLBYWM=>XLBYWM + DPTR_XLBXTHM=>XLBXTHM + DPTR_XLBYTHM=>XLBYTHM + DPTR_XLBXTKEM=>XLBXTKEM + DPTR_XLBYTKEM=>XLBYTKEM + DPTR_XLBXRM=>XLBXRM + DPTR_XLBYRM=>XLBYRM + DPTR_XLBXSVM=>XLBXSVM + DPTR_XLBYSVM=>XLBYSVM + ! + DPTR_XLBXUS=>XLBXUS + DPTR_XLBYUS=>XLBYUS + DPTR_XLBXVS=>XLBXVS + DPTR_XLBYVS=>XLBYVS + DPTR_XLBXWS=>XLBXWS + DPTR_XLBYWS=>XLBYWS + DPTR_XLBXTHS=>XLBXTHS + DPTR_XLBYTHS=>XLBYTHS + DPTR_XLBXTKES=>XLBXTKES + DPTR_XLBYTKES=>XLBYTKES + DPTR_XLBXRS=>XLBXRS + DPTR_XLBYRS=>XLBYRS + DPTR_XLBXSVS=>XLBXSVS + DPTR_XLBYSVS=>XLBYSVS + ! + CALL ONE_WAY_n(NDAD(IMI),XTSTEP,IMI,KTCOUNT, & + DPTR_XBMX1,DPTR_XBMX2,DPTR_XBMX3,DPTR_XBMX4,DPTR_XBMY1,DPTR_XBMY2,DPTR_XBMY3,DPTR_XBMY4, & + DPTR_XBFX1,DPTR_XBFX2,DPTR_XBFX3,DPTR_XBFX4,DPTR_XBFY1,DPTR_XBFY2,DPTR_XBFY3,DPTR_XBFY4, & + NDXRATIO_ALL(IMI),NDYRATIO_ALL(IMI),NDTRATIO(IMI), & + DPTR_CLBCX,DPTR_CLBCY,NRIMX,NRIMY, & + DPTR_NKLIN_LBXU,DPTR_XCOEFLIN_LBXU,DPTR_NKLIN_LBYU,DPTR_XCOEFLIN_LBYU, & + DPTR_NKLIN_LBXV,DPTR_XCOEFLIN_LBXV,DPTR_NKLIN_LBYV,DPTR_XCOEFLIN_LBYV, & + DPTR_NKLIN_LBXW,DPTR_XCOEFLIN_LBXW,DPTR_NKLIN_LBYW,DPTR_XCOEFLIN_LBYW, & + DPTR_NKLIN_LBXM,DPTR_XCOEFLIN_LBXM,DPTR_NKLIN_LBYM,DPTR_XCOEFLIN_LBYM, & + GSTEADY_DMASS,CCLOUD,LUSECHAQ,LUSECHIC, & + DPTR_XLBXUM,DPTR_XLBYUM,DPTR_XLBXVM,DPTR_XLBYVM,DPTR_XLBXWM,DPTR_XLBYWM, & + DPTR_XLBXTHM,DPTR_XLBYTHM, & + DPTR_XLBXTKEM,DPTR_XLBYTKEM, & + DPTR_XLBXRM,DPTR_XLBYRM,DPTR_XLBXSVM,DPTR_XLBYSVM, & + XDRYMASST,XDRYMASSS, & + DPTR_XLBXUS,DPTR_XLBYUS,DPTR_XLBXVS,DPTR_XLBYVS,DPTR_XLBXWS,DPTR_XLBYWS, & + DPTR_XLBXTHS,DPTR_XLBYTHS, & + DPTR_XLBXTKES,DPTR_XLBYTKES, & + DPTR_XLBXRS,DPTR_XLBYRS,DPTR_XLBXSVS,DPTR_XLBYSVS ) + ! +END IF +! +CALL SECOND_MNH2(ZTIME2) +XT_1WAY = XT_1WAY + ZTIME2 - ZTIME1 +! +!* 2.1 RECYCLING TURBULENCE +! ---- +IF (CTURB /= 'NONE' .AND. LRECYCL) THEN + CALL RECYCLING(XFLUCTUNW,XFLUCTVNN,XFLUCTUTN,XFLUCTVTW,XFLUCTWTW,XFLUCTWTN, & + XFLUCTUNE,XFLUCTVNS,XFLUCTUTS,XFLUCTVTE,XFLUCTWTE,XFLUCTWTS, & + KTCOUNT) +ENDIF +! +!* 2.2 IBM +! ---- +! +IF (LIBM .AND. KTCOUNT==1) THEN + ! + IF (.NOT.LCARTESIAN) THEN + CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'MODELN', 'IBM can only be used in combination with cartesian coordinates') + ENDIF + ! + CALL IBM_INIT(XIBM_LS) + ! +ENDIF +! +!------------------------------------------------------------------------------- +! +!* 3. LATERAL BOUNDARY CONDITIONS EXCEPT FOR NORMAL VELOCITY +! ------------------------------------------------------ +! +ZTIME1=ZTIME2 +! +!* 3.1 Set the lagragian variables values at the LB +! +IF( LLG .AND. IMI==1 ) CALL SETLB_LG +! +IF (CCONF == "START" .OR. (CCONF == "RESTA" .AND. KTCOUNT /= 1 )) THEN +CALL MPPDB_CHECK3DM("before BOUNDARIES:XUT, XVT, XWT, XTHT, XTKET",PRECISION,& + & XUT, XVT, XWT, XTHT, XTKET) +CALL BOUNDARIES ( & + XTSTEP,CLBCX,CLBCY,NRR,NSV,KTCOUNT, & + XLBXUM,XLBXVM,XLBXWM,XLBXTHM,XLBXTKEM,XLBXRM,XLBXSVM, & + XLBYUM,XLBYVM,XLBYWM,XLBYTHM,XLBYTKEM,XLBYRM,XLBYSVM, & + XLBXUS,XLBXVS,XLBXWS,XLBXTHS,XLBXTKES,XLBXRS,XLBXSVS, & + XLBYUS,XLBYVS,XLBYWS,XLBYTHS,XLBYTKES,XLBYRS,XLBYSVS, & + XRHODJ,XRHODREF, & + XUT, XVT, XWT, XTHT, XTKET, XRT, XSVT, XSRCT ) +CALL MPPDB_CHECK3DM("after BOUNDARIES:XUT, XVT, XWT, XTHT, XTKET",PRECISION,& + & XUT, XVT, XWT, XTHT, XTKET) +END IF +! +CALL SECOND_MNH2(ZTIME2) +! +XT_BOUND = XT_BOUND + ZTIME2 - ZTIME1 +! +! +! For START/RESTART MPPDB_CHECK use +!IF ( (IMI==1) .AND. (CCONF == "START") .AND. (KTCOUNT == 2) ) THEN +! CALL MPPDB_START_DEBUG() +!ENDIF +!IF ( (IMI==1) .AND. (CCONF == "RESTA") .AND. (KTCOUNT == 1) ) THEN +! CALL MPPDB_START_DEBUG() +!ENDIF +!------------------------------------------------------------------------------- +!* initializes surface number +IF (CSURF=='EXTE') CALL GOTO_SURFEX(IMI) +!------------------------------------------------------------------------------- +! +!* 4. STORAGE IN A SYNCHRONOUS FILE +! ----------------------------- +! +ZTIME1 = ZTIME2 +! +IF ( nfile_backup_current < NBAK_NUMB ) THEN + IF ( KTCOUNT == TBACKUPN(nfile_backup_current + 1)%NSTEP ) THEN + nfile_backup_current = nfile_backup_current + 1 + ! + TZBAKFILE => TBACKUPN(nfile_backup_current)%TFILE + IVERB = TZBAKFILE%NLFIVERB + ! + CALL IO_File_open(TZBAKFILE) + ! + CALL WRITE_DESFM_n(IMI,TZBAKFILE) + CALL IO_Header_write( TBACKUPN(nfile_backup_current)%TFILE ) + CALL WRITE_LFIFM_n( TBACKUPN(nfile_backup_current)%TFILE, TBACKUPN(nfile_backup_current)%TFILE%TDADFILE%CNAME ) + TOUTDATAFILE => TZBAKFILE + CALL MNHWRITE_ZS_DUMMY_n(TZBAKFILE) + IF (CSURF=='EXTE') THEN + TFILE_SURFEX => TZBAKFILE + CALL GOTO_SURFEX(IMI) + CALL WRITE_SURF_ATM_n(YSURF_CUR,'MESONH','ALL',.FALSE.) + IF ( KTCOUNT > 1) THEN + CALL DIAG_SURF_ATM_n(YSURF_CUR,'MESONH') + CALL WRITE_DIAG_SURF_ATM_n(YSURF_CUR,'MESONH','ALL') + END IF + NULLIFY(TFILE_SURFEX) + END IF + ! + ! Reinitialize Lagragian variables at every model backup + IF (LLG .AND. LINIT_LG .AND. CINIT_LG=='FMOUT') THEN + CALL INI_LG(XXHAT,XYHAT,XZZ,XSVT,XLBXSVM,XLBYSVM) + IF (IVERB>=5) THEN + WRITE(UNIT=ILUOUT,FMT=*) '************************************' + WRITE(UNIT=ILUOUT,FMT=*) '*** Lagrangian variables refreshed after ',TRIM(TZBAKFILE%CNAME),' backup' + WRITE(UNIT=ILUOUT,FMT=*) '************************************' + END IF + END IF + ! Reinitialise mean variables + IF (LMEAN_FIELD) THEN + CALL INI_MEAN_FIELD + END IF +! + ELSE + !Necessary to have a 'valid' CNAME when calling some subroutines + TZBAKFILE => TFILE_DUMMY + END IF +ELSE + !Necessary to have a 'valid' CNAME when calling some subroutines + TZBAKFILE => TFILE_DUMMY +END IF +! +IF ( nfile_output_current < NOUT_NUMB ) THEN + IF ( KTCOUNT == TOUTPUTN(nfile_output_current + 1)%NSTEP ) THEN + nfile_output_current = nfile_output_current + 1 + ! + TZOUTFILE => TOUTPUTN(nfile_output_current)%TFILE + ! + CALL IO_File_open(TZOUTFILE) + ! + CALL IO_Header_write(TZOUTFILE) + CALL IO_Fieldlist_write( TOUTPUTN(nfile_output_current) ) + CALL IO_Field_user_write( TOUTPUTN(nfile_output_current) ) + ! + CALL IO_File_close(TZOUTFILE) + ! + END IF +END IF +! +CALL SECOND_MNH2(ZTIME2) +! +XT_STORE = XT_STORE + ZTIME2 - ZTIME1 +! +!------------------------------------------------------------------------------- +! +!* 4.BIS IBM and Fluctuations application +! ----------------------------- +! +!* 4.B1 Add fluctuations at the domain boundaries +! +IF (LRECYCL) THEN + CALL ADDFLUCTUATIONS ( & + CLBCX,CLBCY, & + XUT, XVT, XWT, XTHT, XTKET, XRT, XSVT, XSRCT, & + XFLUCTUTN,XFLUCTVTW,XFLUCTUTS,XFLUCTVTE, & + XFLUCTWTW,XFLUCTWTN,XFLUCTWTS,XFLUCTWTE ) +ENDIF +! +!* 4.B2 Immersed boundaries +! +IF (LIBM) THEN + ! + ZTIME1=ZTIME2 + ! + IF (.NOT.LCARTESIAN) THEN + CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'MODELN', 'IBM can only be used in combination with cartesian coordinates') + ENDIF + ! + CALL IBM_FORCING(XUT,XVT,XWT,XTHT,XRT,XSVT,XTKET) + ! + IF (LIBM_TROUBLE) THEN + CALL IBM_FORCING_TR(XUT,XVT,XWT,XTHT,XRT,XSVT,XTKET) + ENDIF + ! + CALL SECOND_MNH2(ZTIME2) + ! + XT_IBM_FORC = XT_IBM_FORC + ZTIME2 - ZTIME1 + ! +ENDIF +!------------------------------------------------------------------------------- +! +!* 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 ) then + tbudgets(NBUDGET_U)%trhodj%xdata(:, nbutime, :) = tbudgets(NBUDGET_U)%trhodj%xdata(:, nbutime, :) & + + Mask_compress( Mxm( xrhodj(:, :, :) ) ) + end if + if ( lbu_rv ) then + tbudgets(NBUDGET_V)%trhodj%xdata(:, nbutime, :) = tbudgets(NBUDGET_V)%trhodj%xdata(:, nbutime, :) & + + Mask_compress( Mym( xrhodj(:, :, :) ) ) + end if + if ( lbu_rw ) then + tbudgets(NBUDGET_W)%trhodj%xdata(:, nbutime, :) = tbudgets(NBUDGET_W)%trhodj%xdata(:, nbutime, :) & + + Mask_compress( Mzm( xrhodj(:, :, :) ) ) + end if + if ( associated( tburhodj ) ) tburhodj%xdata(:, nbutime, :) = tburhodj%xdata(:, nbutime, :) + Mask_compress( xrhodj(:, :, :) ) +END IF +! +IF (NBUMOD==IMI .AND. CBUTYPE=='CART' ) THEN + if ( lbu_ru ) then + tbudgets(NBUDGET_U)%trhodj%xdata(:, :, :) = tbudgets(NBUDGET_U)%trhodj%xdata(:, :, :) + Cart_compress( Mxm( xrhodj(:, :, :) ) ) + end if + if ( lbu_rv ) then + tbudgets(NBUDGET_V)%trhodj%xdata(:, :, :) = tbudgets(NBUDGET_V)%trhodj%xdata(:, :, :) + Cart_compress( Mym( xrhodj(:, :, :) ) ) + end if + if ( lbu_rw ) then + tbudgets(NBUDGET_W)%trhodj%xdata(:, :, :) = tbudgets(NBUDGET_W)%trhodj%xdata(:, :, :) & + + Cart_compress( Mzm( xrhodj(:, :, :) ) ) + end if + if ( associated( tburhodj ) ) tburhodj%xdata(:, :, :) = tburhodj%xdata(:, :, :) + 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, & + XUT, XVT, XWT, XTHT, XRT, XTKET, XSVT ) +! +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 +IF (LLES) CALL LES_INI_TIMESTEP_n(KTCOUNT) +! +!------------------------------------------------------------------------------- +! +!* 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_XSVM, & + DPTR_XRUS,DPTR_XRVS,DPTR_XRWS,DPTR_XRTHS,DPTR_XRRS,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. +IF (LCARTESIAN) THEN + CALL SM_GRIDCART(XXHAT,XYHAT,XZHAT,XZS,LSLEVE,XLEN1,XLEN2,XZSMT,XDXHAT,XDYHAT,XZZ,ZJ) + XMAP=1. +ELSE + CALL SM_GRIDPROJ(XXHAT,XYHAT,XZHAT,XZS,LSLEVE,XLEN1,XLEN2,XZSMT,XLATORI,XLONORI, & + XMAP,XLAT,XLON,XDXHAT,XDYHAT,XZZ,ZJ) +END IF +! +IF ( LFORCING ) THEN + CALL FORCING(XTSTEP,LUSERV,XRHODJ,XCORIOZ,XZHAT,XZZ,TDTCUR,& + XUFRC_PAST, XVFRC_PAST,XWTFRC, & + 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, & + XUT,XVT,XWT,XTHT,XRT, & + 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 +! +CALL DYN_SOURCES( NRR,NRRL, NRRI, & + 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(TFIELDT_ll, IINFO_ll) + CALL UPDATE_HALO2_ll(TFIELDT_ll, THALO2T_ll, IINFO_ll) + IF ( .NOT. LSTEADYLS ) THEN + CALL UPDATE_HALO_ll(TLSFIELD_ll, IINFO_ll) + CALL UPDATE_HALO_ll(TLSFIELD2D_ll,IINFO_ll) + CALL UPDATE_HALO2_ll(TLSFIELD_ll, TLSHALO2_ll, IINFO_ll) + END IF + CALL NUM_DIFF ( CLBCX, CLBCY, NRR, NSV, & + XDK2U, XDK4U, XDK2TH, XDK4TH, XDK2SV, XDK4SV, IMI, & + XUT, XVT, XWT, XTHT, XTKET, XRT, XSVT, & + XLSUM,XLSVM,XLSWM,XLSTHM,XLSRVM,XRHODJ, & + XRUS, XRVS, XRWS, XRTHS, XRTKES, XRRS, XRSVS, & + LZDIFFU,LNUMDIFU, LNUMDIFTH, LNUMDIFSV, & + THALO2T_ll, TLSHALO2_ll,XZDIFFU_HALO2 ) +END IF + +if ( lbudget_sv ) then + do jsv = 1, nsv + call Budget_store_init( tbudgets(jsv + NBUDGET_SV1 - 1), 'NEGA2', xrsvs(:, :, :, jsv) ) + end do +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 +! Blaze smoke +DO JSV = NSV_FIREBEG,NSV_FIREEND + XRSVS(:,:,:,JSV) = MAX(XRSVS(:,:,:,JSV),0.) +END DO +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 + +if ( lbudget_sv ) then + do jsv = 1, nsv + call Budget_store_end( tbudgets(jsv + NBUDGET_SV1 - 1), 'NEGA2', xrsvs(:, :, :, jsv) ) + end do +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,LHORELAX_SVFIRE, & +#ifdef MNH_FOREFIRE + LHORELAX_SVFF, & +#endif + KTCOUNT,NRR,NSV,XTSTEP,XRHODJ, & + XUT, XVT, XWT, XTHT, XRT, XSVT, XTKET, & + 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 +! +CALL PHYS_PARAM_n( KTCOUNT, TZBAKFILE, & + XT_RAD, XT_SHADOWS, XT_DCONV, XT_GROUND, & + XT_MAFL, XT_DRAG, XT_EOL, 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 +! +! +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, & + 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,XLSZWSM,XDRYMASST, & + XLBXUM,XLBXVM,XLBXWM,XLBXTHM,XLBXTKEM,XLBXRM,XLBXSVM, & + XLBYUM,XLBYVM,XLBYWM,XLBYTHM,XLBYTKEM,XLBYRM,XLBYSVM, & + XLSUS,XLSVS,XLSWS,XLSTHS,XLSRVS,XLSZWSS,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_FIREBEG,NSV_FIREEND + XLBXSVS(:,:,:,JSV)=MAX(XLBXSVS(:,:,:,JSV),0.) + XLBYSVS(:,:,:,JSV)=MAX(XLBYSVS(:,:,:,JSV),0.) + ENDDO + ! + 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( XTSTEP, NRR, XPABST, XTHT, XRT, XZZ, XRHODREF, & + XRHODJ, XEXNREF, XRRS, XRTHS, XSVT, XRSVS, XSNWSUBL3D ) +ENDIF +! +!----------------------------------------------------------------------- +! +!* 8 Ter VISCOSITY (no-slip condition inside) +! --------- +! +! +IF ( LVISC ) THEN +! +ZTIME1 = ZTIME2 +! + CALL VISCOSITY(CLBCX, CLBCY, NRR, NSV, XMU_V,XPRANDTL, & + 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, CUVW_ADV_SCHEME, & + 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 +! +!------------------------------------------------------------------------------- +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 +! +IF ( LIBM .AND. CIBM_ADV=='FORCIN' ) THEN + ! + ZTIME1=ZTIME2 + ! + CALL IBM_FORCING_ADV (XRUS,XRVS,XRWS) + ! + CALL SECOND_MNH2(ZTIME2) + ! + XT_IBM_FORC = XT_IBM_FORC + ZTIME2 - ZTIME1 + ! +ENDIF +! +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 + IF (CUVW_ADV_SCHEME=='CEN4TH') THEN + NULLIFY(TZFIELDC_ll) + NULLIFY(TZHALO2C_ll) + CALL ADD3DFIELD_ll( TZFIELDC_ll, XUT, 'MODEL_n::XUT' ) + CALL ADD3DFIELD_ll( TZFIELDC_ll, XVT, 'MODEL_n::XVT' ) + CALL ADD3DFIELD_ll( TZFIELDC_ll, XWT, 'MODEL_n::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 ) + 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 + CALL TURB_CLOUD_INDEX( XTSTEP, TZBAKFILE, & + LTURB_DIAG, 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) +ZRUS=XRUS +ZRVS=XRVS +ZRWS=XRWS +! +if ( .not. l1d ) then + if ( lbudget_u ) call Budget_store_init( tbudgets(NBUDGET_U), 'PRES', xrus(:, :, :) ) + if ( lbudget_v ) call Budget_store_init( tbudgets(NBUDGET_V), 'PRES', xrvs(:, :, :) ) + if ( lbudget_w ) call Budget_store_init( tbudgets(NBUDGET_W), 'PRES', xrws(:, :, :) ) +end if +! +CALL MPPDB_CHECK3DM("before RAD_BOUND : other var",PRECISION,XUT,XVT,XRHODJ,XTKET) +CALL MPPDB_CHECKLB(XLBXUM,"modeln XLBXUM",PRECISION,'LBXU',NRIMX) +CALL MPPDB_CHECKLB(XLBYVM,"modeln XLBYVM",PRECISION,'LBYV',NRIMY) +CALL MPPDB_CHECKLB(XLBXUS,"modeln XLBXUS",PRECISION,'LBXU',NRIMX) +CALL MPPDB_CHECKLB(XLBYVS,"modeln XLBYVS",PRECISION,'LBYV',NRIMY) +! + CALL RAD_BOUND (CLBCX,CLBCY,CTURB,XCARPKMAX, & + XTSTEP, & + XDXHAT, XDYHAT, XZHAT, & + XUT, XVT, & + XLBXUM, XLBYVM, XLBXUS, XLBYVS, & + XFLUCTUNW,XFLUCTVNN,XFLUCTUNE,XFLUCTVNS, & + 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. +! +ZPABST = XPABST +! +IF(.NOT. L1D) THEN +! +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 + CALL MPPDB_CHECK3DM("after pressurez:XRU/V/WS",PRECISION,XRUS,XRVS,XRWS) +! +END IF +! +CALL SECOND_MNH2(ZTIME2) +! +XT_PRESS = XT_PRESS + ZTIME2 - ZTIME1 & + - XTIME_LES_BU_PROCESS - XTIME_BU_PROCESS +! +!------------------------------------------------------------------------------- +! +!* 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( MAX(MAXVAL(XCLDFR(:,:,:)),MAXVAL(XICEFR(:,:,:))).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 + XWT_ACT_NUC(:,:,:) = XWT(:,:,:) + XWTFRC(:,:,:) + ELSE + XWT_ACT_NUC(:,:,:) = XWT(:,:,:) + END IF + IF (CTURB /= 'NONE' ) THEN + IF ( ((CCLOUD=='C2R2'.OR.CCLOUD=='KHKO').AND.LACTTKE) .OR. (CCLOUD=='LIMA'.AND.MACTTKE) ) THEN + XWT_ACT_NUC(:,:,:) = XWT_ACT_NUC(:,:,:) + (2./3. * XTKET(:,:,:))**0.5 + ELSE + XWT_ACT_NUC(:,:,:) = XWT_ACT_NUC(:,:,:) + ENDIF + ENDIF + ELSE + XWT_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, & + LSUBG_COND,LSIGMAS,CSUBG_AUCV_RC,XTSTEP, & + XZZ, XRHODJ, XRHODREF, XEXNREF, & + ZPABST, XTHT,XRT,XSIGS,VSIGQSAT,XMFCONV,XTHM,XRCM, & + XPABST, XWT_ACT_NUC,XDTHRAD, XRTHS, XRRS, & + XSVT, XRSVS, & + XSRCT, XCLDFR,XICEFR, XCIT, & + LSEDIC,KACTIT, KSEDC, KSEDI, KRAIN, KWARM, KHHONI, & + LCONVHG, XCF_MF,XRC_MF, XRI_MF, & + XINPRC,ZINPRC3D,XINPRR, XINPRR3D, XEVAP3D, & + XINPRS,ZINPRS3D, XINPRG,ZINPRG3D, XINPRH,ZINPRH3D, & + XSOLORG, XMI,ZSPEEDC, ZSPEEDR, ZSPEEDS, ZSPEEDG, ZSPEEDH, & + XINDEP, XSUPSAT, XNACT, XNPRO,XSSPRO, XRAINFR, & + XHLC_HRC, XHLC_HCF, XHLI_HRI, XHLI_HCF, & + ZSEA, ZTOWN ) + DEALLOCATE(ZTOWN) + DEALLOCATE(ZSEA) + ELSE + CALL RESOLVED_CLOUD ( CCLOUD, CACTCCN, CSCONV, CMF_CLOUD, NRR, NSPLITR, & + NSPLITG, IMI, KTCOUNT, & + CLBCX,CLBCY,TZBAKFILE, CRAD, CTURBDIM, & + LSUBG_COND,LSIGMAS,CSUBG_AUCV_RC, & + XTSTEP,XZZ, XRHODJ, XRHODREF, XEXNREF, & + ZPABST, XTHT,XRT,XSIGS,VSIGQSAT,XMFCONV,XTHM,XRCM, & + XPABST, XWT_ACT_NUC,XDTHRAD, XRTHS, XRRS, & + XSVT, XRSVS, & + XSRCT, XCLDFR, XICEFR, XCIT, & + LSEDIC,KACTIT, KSEDC, KSEDI, KRAIN, KWARM, KHHONI, & + LCONVHG, XCF_MF,XRC_MF, XRI_MF, & + XINPRC,ZINPRC3D,XINPRR, XINPRR3D, XEVAP3D, & + XINPRS,ZINPRS3D, XINPRG,ZINPRG3D, XINPRH,ZINPRH3D, & + XSOLORG, XMI,ZSPEEDC, ZSPEEDR, ZSPEEDS, ZSPEEDG, ZSPEEDH, & + XINDEP, XSUPSAT, XNACT, XNPRO,XSSPRO, XRAINFR, & + XHLC_HRC, XHLC_HCF, XHLI_HRI, XHLI_HCF ) + END IF + 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. & + ((CCLOUD == 'C2R2' .OR. CCLOUD == 'C3R5' .OR. CCLOUD == 'KHKO' & + .OR. CCLOUD == 'LIMA' ) .AND. KSEDC ) ) THEN + XACPRC = XACPRC + XINPRC * XTSTEP + 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 + 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 + XWT_ACT_NUC(:,:,:) = 0. +! + 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_ELEC_n (CCLOUD, CSCONV, CMF_CLOUD, & + NRR, NSPLITR, IMI, KTCOUNT, OEXIT, & + CLBCX, CLBCY, CRAD, CTURBDIM, & + LSUBG_COND, LSIGMAS,VSIGQSAT,CSUBG_AUCV_RC, & + XTSTEP, XZZ, XRHODJ, XRHODREF, XEXNREF, & + 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) + DEALLOCATE(ZSEA) + ELSE + CALL RESOLVED_ELEC_n (CCLOUD, CSCONV, CMF_CLOUD, & + NRR, NSPLITR, IMI, KTCOUNT, OEXIT, & + CLBCX, CLBCY, CRAD, CTURBDIM, & + LSUBG_COND, LSIGMAS,VSIGQSAT, CSUBG_AUCV_RC, & + XTSTEP, XZZ, XRHODJ, XRHODREF, XEXNREF, & + 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 +! + 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, XSVT(:,:,:,1)) +END IF +! +!------------------------------------------------------------------------------- +! +!* 22. UPDATE HALO OF EACH SUBDOMAINS FOR TIME T+DT +! -------------------------------------------- +! +ZTIME1 = ZTIME2 +! +CALL EXCHANGE (XTSTEP,NRR,NSV,XRHODJ,TFIELDS_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. +! +CALL ENDSTEP ( XTSTEP,NRR,NSV,KTCOUNT,IMI, & + CUVW_ADV_SCHEME,CTEMP_SCHEME,XRHODJ, & + XRUS,XRVS,XRWS,XDRYMASSS, & + XRTHS,XRRS,XRTKES,XRSVS, & + XLSUS,XLSVS,XLSWS, & + XLSTHS,XLSRVS,XLSZWSS, & + XLBXUS,XLBXVS,XLBXWS, & + XLBXTHS,XLBXRS,XLBXTKES,XLBXSVS, & + XLBYUS,XLBYVS,XLBYWS, & + XLBYTHS,XLBYRS,XLBYTKES,XLBYSVS, & + XUM,XVM,XWM,XZWS, & + XUT,XVT,XWT,XPABST,XDRYMASST, & + XTHT, XRT, XTHM, XRCM, XPABSM,XTKET, XSVT,& + XLSUM,XLSVM,XLSWM, & + XLSTHM,XLSRVM,XLSZWSM, & + XLBXUM,XLBXVM,XLBXWM, & + XLBXTHM,XLBXRM,XLBXTKEM,XLBXSVM, & + XLBYUM,XLBYVM,XLBYWM, & + XLBYTHM,XLBYRM,XLBYTKEM,XLBYSVM ) +! +CALL SECOND_MNH2(ZTIME2) +! +XT_STEP_SWA = XT_STEP_SWA + ZTIME2 - ZTIME1 - XTIME_BU_PROCESS +! +!------------------------------------------------------------------------------- +! +!* 24.1 BALLOON and AIRCRAFT +! -------------------- +! +ZTIME1 = ZTIME2 +! +IF (LFLYER) THEN + IF (CSURF=='EXTE') THEN + ALLOCATE(ZSEA(IIU,IJU)) + ZSEA(:,:) = 0. + CALL MNHGET_SURF_PARAM_n (PSEA=ZSEA(:,:)) + CALL AIRCRAFT_BALLOON(XTSTEP, & + XXHAT, XYHAT, XZZ, XMAP, XLONORI, XLATORI, & + XUT, XVT, XWT, XPABST, XTHT, XRT, XSVT, XTKET, XTSRAD, & + XRHODREF,XCIT,PSEA=ZSEA(:,:)) + DEALLOCATE(ZSEA) + ELSE + CALL AIRCRAFT_BALLOON(XTSTEP, & + XXHAT, XYHAT, XZZ, XMAP, XLONORI, XLATORI, & + XUT, XVT, XWT, XPABST, XTHT, XRT, XSVT, XTKET, XTSRAD, & + XRHODREF,XCIT) + END IF +END IF + +!------------------------------------------------------------------------------- +! +!* 24.2 STATION (observation diagnostic) +! -------------------------------- +! +IF (LSTATION) & + CALL STATION_n(XTSTEP, & + XXHAT, XYHAT, XZZ, & + XUT, XVT, XWT, XTHT, XRT, XSVT, XTKET, XTSRAD, XPABST ) +! +!--------------------------------------------------------- +! +!* 24.3 PROFILER (observation diagnostic) +! --------------------------------- +! +IF (LPROFILER) THEN + IF (CSURF=='EXTE') THEN + ALLOCATE(ZSEA(IIU,IJU)) + ZSEA(:,:) = 0. + CALL MNHGET_SURF_PARAM_n (PSEA=ZSEA(:,:)) + CALL PROFILER_n(XTSTEP, & + XXHAT, XYHAT, XZZ,XRHODREF, & + XUT, XVT, XWT, XTHT, XRT, XSVT, XTKET, XTSRAD, XPABST, & + XAER, MAX(XCLDFR,XICEFR), XCIT,PSEA=ZSEA(:,:)) + DEALLOCATE(ZSEA) + ELSE + CALL PROFILER_n(XTSTEP, & + XXHAT, XYHAT, XZZ,XRHODREF, & + XUT, XVT, XWT, XTHT, XRT, XSVT, XTKET, XTSRAD, XPABST, & + XAER, MAX(XCLDFR,XICEFR), XCIT) + END IF +END IF +! +IF (ALLOCATED(ZSEA)) DEALLOCATE (ZSEA) +! +CALL SECOND_MNH2(ZTIME2) +! +XT_STEP_MISC = XT_STEP_MISC + ZTIME2 - ZTIME1 +! +!------------------------------------------------------------------------------- +! +!* 24.4 deallocation of observation diagnostics +! --------------------------------------- +! +CALL END_DIAG_IN_RUN +! +!------------------------------------------------------------------------------- +! +! +!* 25. STORAGE OF BUDGET FIELDS +! ------------------------ +! +ZTIME1 = ZTIME2 +! +IF ( .NOT. LIO_NO_WRITE ) THEN + IF (NBUMOD==IMI .AND. CBUTYPE/='NONE') THEN + CALL ENDSTEP_BUDGET(TDIAFILE,KTCOUNT,TDTCUR,XTSTEP,NSV) + END IF +END IF +! +CALL SECOND_MNH2(ZTIME2) +! +XT_STEP_BUD = XT_STEP_BUD + ZTIME2 - ZTIME1 + XTIME_BU +! +!------------------------------------------------------------------------------- +! +!* 26. FM FILE CLOSURE +! --------------- +! +IF ( tzbakfile%lopened ) THEN + CALL IO_File_close(TZBAKFILE) +END IF +! +!------------------------------------------------------------------------------- +! +!* 27. CURRENT TIME REFRESH +! -------------------- +! +TDTCUR%xtime=TDTCUR%xtime + XTSTEP +CALL DATETIME_CORRECTDATE(TDTCUR) +! +!------------------------------------------------------------------------------- +! +!* 28. CPU ANALYSIS +! ------------ +! +CALL SECOND_MNH2(ZTIME2) +XT_START=XT_START+ZTIME2-ZEND +! +! +IF ( KTCOUNT == NSTOP .AND. IMI==1) THEN + OEXIT=.TRUE. +END IF +! +IF (OEXIT) THEN +! + IF ( .NOT. LIO_NO_WRITE ) THEN + IF (LSERIES) CALL WRITE_SERIES_n(TDIAFILE) + CALL WRITE_AIRCRAFT_BALLOON(TDIAFILE) + CALL WRITE_STATION_n(TDIAFILE) + CALL WRITE_PROFILER_n(TDIAFILE) + call Write_les_n( tdiafile ) +#ifdef MNH_IOLFI + CALL MENU_DIACHRO(TDIAFILE,'END') +#endif + CALL IO_File_close(TDIAFILE) + END IF + ! + CALL IO_File_close(TINIFILE) + IF (CSURF=="EXTE") CALL IO_File_close(TINIFILEPGD) +! +!* 28.1 print statistics! +! + ! Set File Timing OUTPUT + ! + CALL SET_ILUOUT_TIMING(TLUOUT) + ! + ! Compute global time + ! + CALL TIME_STAT_ll(XT_START,ZTOT) + ! + CALL TIME_HEADER_ll(IMI) + ! + CALL TIME_STAT_ll(XT_1WAY,ZTOT, ' ONE WAY','=') + CALL TIME_STAT_ll(XT_BOUND,ZTOT, ' BOUNDARIES','=') + CALL TIME_STAT_ll(XT_STORE,ZTOT, ' STORE-FIELDS','=') + CALL TIME_STAT_ll(TIMEZ%T_WRIT3D_SEND,ZTOT, ' W3D_SEND ','-') + CALL TIME_STAT_ll(TIMEZ%T_WRIT3D_RECV,ZTOT, ' W3D_RECV ','-') + CALL TIME_STAT_ll(TIMEZ%T_WRIT3D_WRIT,ZTOT, ' W3D_WRIT ','-') + CALL TIME_STAT_ll(TIMEZ%T_WRIT3D_WAIT,ZTOT, ' W3D_WAIT ','-') + CALL TIME_STAT_ll(TIMEZ%T_WRIT3D_ALL ,ZTOT, ' W3D_ALL ','-') + CALL TIME_STAT_ll(TIMEZ%T_WRIT2D_GATH,ZTOT, ' W2D_GATH ','-') + CALL TIME_STAT_ll(TIMEZ%T_WRIT2D_WRIT,ZTOT, ' W2D_WRIT ','-') + CALL TIME_STAT_ll(TIMEZ%T_WRIT2D_ALL ,ZTOT, ' W2D_ALL ','-') + CALL TIME_STAT_ll(XT_GUESS,ZTOT, ' INITIAL_GUESS','=') + CALL TIME_STAT_ll(XT_2WAY,ZTOT, ' TWO WAY','=') + CALL TIME_STAT_ll(XT_ADV,ZTOT, ' ADVECTION MET','=') + CALL TIME_STAT_ll(XT_ADVUVW,ZTOT, ' ADVECTION UVW','=') + CALL TIME_STAT_ll(XT_GRAV,ZTOT, ' GRAVITY','=') + CALL TIME_STAT_ll(XT_FORCING,ZTOT, ' FORCING','=') + CALL TIME_STAT_ll(XT_IBM_FORC,ZTOT, ' IBM','=') + CALL TIME_STAT_ll(XT_NUDGING,ZTOT, ' NUDGING','=') + CALL TIME_STAT_ll(XT_SOURCES,ZTOT, ' DYN_SOURCES','=') + CALL TIME_STAT_ll(XT_DIFF,ZTOT, ' NUM_DIFF','=') + CALL TIME_STAT_ll(XT_RELAX,ZTOT, ' RELAXATION','=') + ! + CALL TIMING_LEGEND() + ! + CALL TIME_STAT_ll(XT_PARAM,ZTOT, ' PHYS_PARAM','=') + CALL TIME_STAT_ll(XT_RAD,ZTOT, ' RAD = '//CRAD ,'-') + CALL TIME_STAT_ll(XT_SHADOWS,ZTOT, ' SHADOWS' ,'-') + CALL TIME_STAT_ll(XT_DCONV,ZTOT, ' DEEP CONV = '//CDCONV,'-') + CALL TIME_STAT_ll(XT_GROUND,ZTOT, ' GROUND' ,'-') + ! Blaze perf + IF (LBLAZE) THEN + CALL TIME_STAT_ll(XFIREPERF,ZBLAZETOT) + CALL TIME_STAT_ll(XFIREPERF,ZTOT, ' BLAZE' ,'~') + CALL TIME_STAT_ll(XGRADPERF,ZBLAZETOT, ' GRAD(PHI)' ,' ') + CALL TIME_STAT_ll(XROSWINDPERF,ZBLAZETOT, ' ROS & WIND' ,' ') + CALL TIME_STAT_ll(XPROPAGPERF,ZBLAZETOT, ' PROPAGATION' ,' ') + CALL TIME_STAT_ll(XFLUXPERF,ZBLAZETOT, ' HEAT FLUXES' ,' ') + END IF + CALL TIME_STAT_ll(XT_TURB,ZTOT, ' TURB = '//CTURB ,'-') + CALL TIME_STAT_ll(XT_MAFL,ZTOT, ' MAFL = '//CSCONV,'-') + CALL TIME_STAT_ll(XT_CHEM,ZTOT, ' CHIMIE' ,'-') + CALL TIME_STAT_ll(XT_EOL,ZTOT, ' WIND TURBINE' ,'-') + CALL TIMING_LEGEND() + CALL TIME_STAT_ll(XT_COUPL,ZTOT, ' SET_COUPLING','=') + CALL TIME_STAT_ll(XT_RAD_BOUND,ZTOT, ' RAD_BOUND','=') + ! + CALL TIMING_LEGEND() + ! + CALL TIME_STAT_ll(XT_PRESS,ZTOT, ' PRESSURE ','=','F') + !JUAN Z_SPLITTING + CALL TIME_STAT_ll(TIMEZ%T_MAP_B_SX_YP2_ZP1,ZTOT, ' REMAP B=>FFTXZ' ,'-','F') + CALL TIME_STAT_ll(TIMEZ%T_MAP_SX_YP2_ZP1_SXP2_Y_ZP1,ZTOT, ' REMAP FFTXZ=>FFTYZ' ,'-','F') + CALL TIME_STAT_ll(TIMEZ%T_MAP_SXP2_Y_ZP1_B,ZTOT, ' REMAP FTTYZ=>B' ,'-','F') + CALL TIME_STAT_ll(TIMEZ%T_MAP_SXP2_Y_ZP1_SXP2_YP1_Z,ZTOT, ' REMAP FFTYZ=>SUBZ' ,'-','F') + CALL TIME_STAT_ll(TIMEZ%T_MAP_B_SXP2_Y_ZP1,ZTOT, ' REMAP B=>FFTYZ-1','-','F') + CALL TIME_STAT_ll(TIMEZ%T_MAP_SXP2_YP1_Z_SXP2_Y_ZP1,ZTOT, ' REMAP SUBZ=>FFTYZ-1','-','F') + CALL TIME_STAT_ll(TIMEZ%T_MAP_SXP2_Y_ZP1_SX_YP2_ZP1,ZTOT, ' REMAP FFTYZ-1=>FFTXZ-1','-','F') + CALL TIME_STAT_ll(TIMEZ%T_MAP_SX_YP2_ZP1_B,ZTOT, ' REMAP FFTXZ-1=>B ' ,'-','F') + ! JUAN P1/P2 + CALL TIME_STAT_ll(XT_CLOUD,ZTOT, ' RESOLVED_CLOUD','=') + CALL TIME_STAT_ll(XT_ELEC,ZTOT, ' RESOLVED_ELEC','=') + CALL TIME_STAT_ll(XT_HALO,ZTOT, ' EXCHANGE_HALO','=') + CALL TIME_STAT_ll(XT_STEP_SWA,ZTOT, ' ENDSTEP','=') + CALL TIME_STAT_ll(XT_STEP_BUD,ZTOT, ' BUDGETS','=') + CALL TIME_STAT_ll(XT_SPECTRA,ZTOT, ' LES','=') + CALL TIME_STAT_ll(XT_STEP_MISC,ZTOT, ' MISCELLANEOUS','=') + IF (LIBM) CALL TIME_STAT_ll(XT_IBM_FORC,ZTOT,' IBM FORCING','=') + ! + ! sum of call subroutine + ! + ZALL = XT_1WAY + XT_BOUND + XT_STORE + XT_GUESS + XT_2WAY + & + XT_ADV + XT_FORCING + XT_NUDGING + XT_SOURCES + XT_DIFF + & + XT_ADVUVW + XT_GRAV + XT_IBM_FORC + & + XT_RELAX+ XT_PARAM + XT_COUPL + XT_RAD_BOUND+XT_PRESS + & + XT_CLOUD+ XT_ELEC + XT_HALO + XT_SPECTRA + XT_STEP_SWA + & + XT_STEP_MISC+ XT_STEP_BUD + CALL TIME_STAT_ll(ZALL,ZTOT, ' SUM(CALL)','=') + CALL TIMING_SEPARATOR('=') + ! + ! Gobale Stat + ! + WRITE(ILUOUT,FMT=*) + WRITE(ILUOUT,FMT=*) + CALL TIMING_LEGEND() + ! + ! MODELN all included + ! + CALL TIMING_SEPARATOR('+') + CALL TIMING_SEPARATOR('+') + WRITE(YMI,FMT="(I0)") IMI + CALL TIME_STAT_ll(XT_START,ZTOT, ' MODEL'//YMI,'+') + CALL TIMING_SEPARATOR('+') + CALL TIMING_SEPARATOR('+') + CALL TIMING_SEPARATOR('+') + ! + ! Timing/ Steps + ! + ZTIME_STEP = XT_START / REAL(KTCOUNT) + WRITE(YTCOUNT,FMT="(I0)") KTCOUNT + CALL TIME_STAT_ll(ZTIME_STEP,ZTOT, ' SECOND/STEP='//YTCOUNT,'=') + ! + ! Timing/Step/Points + ! + IPOINTS = NIMAX_ll*NJMAX_ll*NKMAX + WRITE(YPOINTS,FMT="(I0)") IPOINTS + ZTIME_STEP_PTS = ZTIME_STEP / REAL(IPOINTS) * 1e6 + CALL TIME_STAT_ll(ZTIME_STEP_PTS,ZTOT_PT) + CALL TIME_STAT_ll(ZTIME_STEP_PTS,ZTOT_PT, ' MICROSEC/STP/PT='//YPOINTS,'-') + ! + CALL TIMING_SEPARATOR('=') + ! +END IF +! +END SUBROUTINE MODEL_n diff --git a/src/mesonh/ext/modn_param_ice.f90 b/src/mesonh/ext/modn_param_ice.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/mesonh/ext/modn_turb.f90 b/src/mesonh/ext/modn_turb.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/mesonh/ext/modn_turbn.f90 b/src/mesonh/ext/modn_turbn.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/mesonh/ext/nrcolss.f90 b/src/mesonh/ext/nrcolss.f90 new file mode 100644 index 0000000000000000000000000000000000000000..4dbeaa1de9d30855774e4761cb6046206225d372 --- /dev/null +++ b/src/mesonh/ext/nrcolss.f90 @@ -0,0 +1,316 @@ +!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. +!----------------------------------------------------------------- +!--------------- special set of characters for RCS information +!----------------------------------------------------------------- +! $Source$ $Revision$ +! MASDEV4_7 init 2006/11/23 10:39:56 +!----------------------------------------------------------------- +! ################### + MODULE MODI_NRCOLSS +! ################### +! +INTERFACE +! + SUBROUTINE NRCOLSS( KND, PALPHAS, PNUS, PALPHAR, PNUR, & + PESR, PFALLS, PEXFALLS, PFALLEXPS, PFALLR, PEXFALLR,& + PLBDASMAX, PLBDARMAX, PLBDASMIN, PLBDARMIN, & + PDINFTY, PNRCOLSS, PAG, PBS, PAS ) +! +INTEGER, INTENT(IN) :: KND ! Number of discrete size intervals in DS and DR +! +REAL, INTENT(IN) :: PALPHAS ! First shape parameter of the aggregates + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PNUS ! Second shape parameter of the aggregates + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PALPHAR ! First shape parameter of the rain + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PNUR ! Second shape parameter of the rain + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PESR ! Efficiency of aggregates collecting rain +REAL, INTENT(IN) :: PFALLS ! Fall speed constant of aggregates +REAL, INTENT(IN) :: PEXFALLS ! Fall speed exponent of aggregates +REAL, INTENT(IN) :: PFALLEXPS ! Fall speed exponential of aggregates (Thompson 2008) +REAL, INTENT(IN) :: PFALLR ! Fall speed constant of rain +REAL, INTENT(IN) :: PEXFALLR ! Fall speed exponent of rain +REAL, INTENT(IN) :: PLBDASMAX ! Maximun slope of size distribution of aggregates +REAL, INTENT(IN) :: PLBDARMAX ! Maximun slope of size distribution of rain +REAL, INTENT(IN) :: PLBDASMIN ! Minimun slope of size distribution of aggregates +REAL, INTENT(IN) :: PLBDARMIN ! Minimun slope of size distribution of rain +REAL, INTENT(IN) :: PDINFTY ! Factor to define the largest diameter up to + ! which the diameter integration is performed +REAL, INTENT(IN) :: PAG, PBS, PAS +! +REAL, DIMENSION(:,:), INTENT(INOUT) :: PNRCOLSS! Scaled fall speed difference in + ! the mass collection kernel as a + ! function of LAMBDAX and LAMBDAZ +! + END SUBROUTINE NRCOLSS +! +END INTERFACE +! + END MODULE MODI_NRCOLSS +! ######################################################################## + SUBROUTINE NRCOLSS( KND, PALPHAS, PNUS, PALPHAR, PNUR, & + PESR, PFALLS, PEXFALLS, PFALLEXPS, PFALLR, PEXFALLR,& + PLBDASMAX, PLBDARMAX, PLBDASMIN, PLBDARMIN, & + PDINFTY, PNRCOLSS, PAG, PBS, PAS ) +! ######################################################################## +! +! +! +!!**** * - Build up a look-up table containing the scaled fall speed +!! difference between size distributed particles of aggregates and Z +!! +!! +!! PURPOSE +!! ------- +!! The purpose of this routine is to integrate numerically the scaled fall +!! speed difference between aggregates and rain for use in collection +!! kernels FOR CONCENTRATIONS. A first integral of the form +!! +!! infty Dz_max +!! / / +!! |{| } +!! |{| E_xz (Dx+Dz)^2 |cxDx^dx-czDz^dz| n(Dz) dDz} n(Dx) dDx +!! |{| } +!! / / +!! 0 Dz_min +!! +!! is evaluated and normalised by a second integral of the form +!! +!! infty +!! / / +!! |{| } +!! |{| (Dx+Dz)^2 n(Dz) dDz} n(Dx) dDx +!! |{| } +!! / / +!! 0 +!! +!! The result is stored in a two-dimensional array. +!! +!!** METHOD +!! ------ +!! The free parameters of the size distribution function of aggregates and Z +!! (slope parameter LAMBDA) are discretized with a geometrical rate in a +!! specific range +!! LAMBDA = exp( (Log(LAMBDA_max) - Log(LAMBDA_min))/N_interval ) +!! The two above integrals are performed using the trapezoidal scheme. +!! +!! EXTERNAL +!! -------- +!! MODI_GENERAL_GAMMA: Generalized gamma distribution law +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! MODD_CST : XPI,XRHOLW +!! MODD_RAIN_ICE_DESCR: XAS,XAS,XBS +!! +!! REFERENCE +!! --------- +!! B.S. Ferrier , 1994 : A Double-Moment Multiple-Phase Four-Class +!! Bulk Ice Scheme,JAS,51,249-280. +!! +!! AUTHOR +!! ------ +!! J.-P. Pinty * Laboratoire d'Aerologie * +!! +!! MODIFICATIONS +!! ------------- +!! Original 8/11/95 +!! M. Taufour 03/2022 Adapted from rrcolss for concentration +!! J. Wurtz 03/2022 New snow characteristics +!! +!------------------------------------------------------------------------------- +! +! +!* 0. DECLARATIONS +! ------------ +! +! +USE MODI_GENERAL_GAMMA +! +USE MODD_CST +USE MODD_RAIN_ICE_DESCR_n +! +IMPLICIT NONE +! +! +!* 0.1 Declarations of dummy arguments +! ------------------------------- +! +! +INTEGER, INTENT(IN) :: KND ! Number of discrete size intervals in DS and DR +! +REAL, INTENT(IN) :: PALPHAS ! First shape parameter of the aggregates + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PNUS ! Second shape parameter of the aggregates + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PALPHAR ! First shape parameter of the rain + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PNUR ! Second shape parameter of the rain + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PESR ! Efficiency of aggregates collecting rain +REAL, INTENT(IN) :: PFALLS ! Fall speed constant of aggregates +REAL, INTENT(IN) :: PEXFALLS ! Fall speed exponent of aggregates +REAL, INTENT(IN) :: PFALLEXPS ! Fall speed exponential of aggregates (Thompson 2008) +REAL, INTENT(IN) :: PFALLR ! Fall speed constant of rain +REAL, INTENT(IN) :: PEXFALLR ! Fall speed exponent of rain +REAL, INTENT(IN) :: PLBDASMAX ! Maximun slope of size distribution of aggregates +REAL, INTENT(IN) :: PLBDARMAX ! Maximun slope of size distribution of rain +REAL, INTENT(IN) :: PLBDASMIN ! Minimun slope of size distribution of aggregates +REAL, INTENT(IN) :: PLBDARMIN ! Minimun slope of size distribution of rain +REAL, INTENT(IN) :: PDINFTY ! Factor to define the largest diameter up to + ! which the diameter integration is performed +REAL, INTENT(IN) :: PAG, PBS, PAS +! +REAL, DIMENSION(:,:), INTENT(INOUT) :: PNRCOLSS! Scaled fall speed difference in + ! the mass collection kernel as a + ! function of LAMBDAX and LAMBDAZ +! +! +!* 0.2 Declarations of local variables +! ------------------------------- +! +! +INTEGER :: JLBDAS ! Slope index of the size distribution of aggregates +INTEGER :: JLBDAR ! Slope index of the size distribution of rain +INTEGER :: JDS ! Diameter index of a particle of aggregates +INTEGER :: JDR ! Diameter index of a particle of rain +! +INTEGER :: INR ! Number of diameter step for the partial integration +! +! +REAL :: ZLBDAS ! Current slope parameter LAMBDA of aggregates +REAL :: ZLBDAR ! Current slope parameter LAMBDA of rain +REAL :: ZDLBDAS ! Growth rate of the slope parameter LAMBDA of aggregates +REAL :: ZDLBDAR ! Growth rate of the slope parameter LAMBDA of rain +REAL :: ZDDS ! Integration step of the diameter of aggregates +REAL :: ZDDSCALR! Integration step of the diameter of rain (scaling integral) +REAL :: ZDDCOLLR! Integration step of the diameter of rain (fallspe integral) +REAL :: ZDS ! Current diameter of the particle aggregates +REAL :: ZDR ! Current diameter of the rain +REAL :: ZDRMAX ! Maximal diameter of the raindrops where the integration ends +REAL :: ZCOLLR ! Single integral of the mass weighted fall speed difference + ! over the spectrum of rain +REAL :: ZCOLLDRMAX ! Maximum ending point for the partial integral +REAL :: ZCOLLSR ! Double integral of the mass weighted fall speed difference + ! over the spectra of aggregates and rain +REAL :: ZSCALR ! Single integral of the scaling factor over + ! the spectrum of rain +REAL :: ZSCALSR ! Double integral of the scaling factor over + ! the spectra of aggregates and rain +REAL :: ZFUNC ! Ancillary function +REAL :: ZCST1 +! +! +!------------------------------------------------------------------------------- +! +! +!* 1 COMPUTE THE SCALED VELOCITY DIFFERENCE IN THE MASS +!* COLLECTION KERNEL, +! ------------------------------------------------- +! +! +! +!* 1.0 Initialization +! +PNRCOLSS(:,:) = 0.0 +ZCST1 = (3.0/XPI)/XRHOLW +! +!* 1.1 Compute the growth rate of the slope factors LAMBDA +! +ZDLBDAS = EXP( LOG(PLBDASMAX/PLBDASMIN)/REAL(SIZE(PNRCOLSS(:,:),1)-1) ) +ZDLBDAR = EXP( LOG(PLBDARMAX/PLBDARMIN)/REAL(SIZE(PNRCOLSS(:,:),2)-1) ) +! +!* 1.2 Scan the slope factors LAMBDAX and LAMBDAZ +! +DO JLBDAS = 1,SIZE(PNRCOLSS(:,:),1) + ZLBDAS = PLBDASMIN * ZDLBDAS ** (JLBDAS-1) +! +!* 1.3 Compute the diameter steps +! + ZDDS = PDINFTY / (REAL(KND) * ZLBDAS) + DO JLBDAR = 1,SIZE(PNRCOLSS(:,:),2) + ZLBDAR = PLBDARMIN * ZDLBDAR ** (JLBDAR-1) +! +!* 1.4 Initialize the collection integrals +! + ZSCALSR = 0.0 + ZCOLLSR = 0.0 +! +!* 1.5 Compute the diameter steps +! + ZDDSCALR = PDINFTY / (REAL(KND) * ZLBDAR) +! +!* 1.6 Scan over the diameters DS and DR +! + DO JDS = 1,KND-1 + ZDS = ZDDS * REAL(JDS) + ZSCALR = 0.0 + ZCOLLR = 0.0 + DO JDR = 1,KND-1 + ZDR = ZDDSCALR * REAL(JDR) +! +!* 1.7 Compute the normalization factor by integration over the +! dimensional spectrum of rain +! + ZSCALR = ZSCALR + (ZDS+ZDR)**2 * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDR) + END DO +! +!* 1.8 Compute the scaled fall speed difference by partial +! integration over the dimensional spectrum of rain +! + ZFUNC = PAG - PAS*ZDS**(PBS-3.0) ! approximate limit is Ds=240 microns + IF( ZFUNC>0.0 ) THEN + ZDRMAX = ZDS*( ZCST1*ZFUNC )**0.3333333 + ELSE + ZDRMAX = PDINFTY / ZLBDAR + END IF + IF( ZDS>1.0E-4 ) THEN ! allow computation if Ds>100 microns + ! corresponding to a maximal density of the aggregates of XRHOLW + IF( ZDRMAX >= 0.5*ZDDSCALR ) THEN + INR = CEILING( ZDRMAX/ZDDSCALR ) + ZDDCOLLR = ZDRMAX / REAL(INR) + IF (INR>=KND ) THEN + INR = KND + ZDDCOLLR = ZDDSCALR + END IF + DO JDR = 1,INR-1 + ZDR = ZDDCOLLR * REAL(JDR) + ZCOLLR = ZCOLLR + (ZDS+ZDR)**2 & + * PESR * ABS(PFALLS*ZDS**PEXFALLS * EXP(-(PFALLEXPS*ZDS)**PALPHAS)-PFALLR*ZDR**PEXFALLR) & + * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDR) + END DO + ZCOLLDRMAX = (ZDS+ZDRMAX)**2 & + * PESR * ABS(PFALLS*ZDS**PEXFALLS* EXP(-(PFALLEXPS*ZDS)**PALPHAS)-PFALLR*ZDRMAX**PEXFALLR) & + * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDRMAX) + ZCOLLR = (ZCOLLR + 0.5*ZCOLLDRMAX)*(ZDDCOLLR/ZDDSCALR) +! +!* 1.9 Compute the normalization factor by integration over the +! dimensional spectrum of aggregates +! + ZFUNC = GENERAL_GAMMA(PALPHAS,PNUS,ZLBDAS,ZDS) + ZSCALSR = ZSCALSR + ZSCALR * ZFUNC +! +!* 1.10 Compute the scaled fall speed difference by integration over +! the dimensional spectrum of aggregates +! + ZCOLLSR = ZCOLLSR + ZCOLLR * ZFUNC + END IF +! +! Otherwise ZDRMAX = 0.0 so the density of the graupel cannot be reached +! and so PRRCOLSS(JLBDAS,JLBDAR) = 0.0 ! +! + END IF + END DO +! +!* 1.11 Scale the fall speed difference +! + IF( ZSCALSR>0.0 ) PNRCOLSS(JLBDAS,JLBDAR) = ZCOLLSR / ZSCALSR + END DO +END DO +! +END SUBROUTINE NRCOLSS diff --git a/src/mesonh/ext/nscolrg.f90 b/src/mesonh/ext/nscolrg.f90 new file mode 100644 index 0000000000000000000000000000000000000000..08de78478dc94cb386c188ec3b0d887960c12f43 --- /dev/null +++ b/src/mesonh/ext/nscolrg.f90 @@ -0,0 +1,317 @@ +!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. +!----------------------------------------------------------------- +!--------------- special set of characters for RCS information +!----------------------------------------------------------------- +! $Source$ $Revision$ +! MASDEV4_7 init 2006/11/23 10:43:02 +!----------------------------------------------------------------- +! ################### + MODULE MODI_NSCOLRG +! ################### +! +INTERFACE +! + SUBROUTINE NSCOLRG( KND, PALPHAS, PZNUS, PALPHAR, PNUR, & + PESR, PFALLS, PEXFALLS, PFALLEXPS, PFALLR, PEXFALLR,& + PLBDASMAX, PLBDARMAX, PLBDASMIN, PLBDARMIN, & + PDINFTY, PNSCOLRG,PAG, PBS, PAS ) +! +INTEGER, INTENT(IN) :: KND ! Number of discrete size intervals in DS and DR +! +REAL, INTENT(IN) :: PALPHAS ! First shape parameter of the aggregates + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PZNUS ! Second shape parameter of the aggregates + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PALPHAR ! First shape parameter of the rain + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PNUR ! Second shape parameter of the rain + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PESR ! Efficiency of the aggregates collecting rain +REAL, INTENT(IN) :: PFALLS ! Fall speed constant of the aggregates +REAL, INTENT(IN) :: PEXFALLS ! Fall speed exponent of the aggregates +REAL, INTENT(IN) :: PFALLEXPS ! Fall speed exponential constant of the aggregates +REAL, INTENT(IN) :: PFALLR ! Fall speed constant of rain +REAL, INTENT(IN) :: PEXFALLR ! Fall speed exponent of rain +REAL, INTENT(IN) :: PLBDASMAX ! Maximun slope of size distribution of the aggregates +REAL, INTENT(IN) :: PLBDARMAX ! Maximun slope of size distribution of rain +REAL, INTENT(IN) :: PLBDASMIN ! Minimun slope of size distribution of the aggregates +REAL, INTENT(IN) :: PLBDARMIN ! Minimun slope of size distribution of rain +REAL, INTENT(IN) :: PDINFTY ! Factor to define the largest diameter up to + ! which the diameter integration is performed +REAL, INTENT(IN) :: PAG, PBS, PAS +! +REAL, DIMENSION(:,:), INTENT(INOUT) :: PNSCOLRG! Scaled fall speed difference in + ! the mass collection kernel as a + ! function of LAMBDAX and LAMBDAZ +! + END SUBROUTINE NSCOLRG +! +END INTERFACE +! + END MODULE MODI_NSCOLRG +! ######################################################################## + SUBROUTINE NSCOLRG( KND, PALPHAS, PZNUS, PALPHAR, PNUR, & + PESR, PFALLS, PEXFALLS, PFALLEXPS, PFALLR, PEXFALLR,& + PLBDASMAX, PLBDARMAX, PLBDASMIN, PLBDARMIN, & + PDINFTY, PNSCOLRG,PAG, PBS, PAS ) +! ######################################################################## +! +! +! +!!**** * - Build up a look-up table containing the scaled fall speed +!! difference between size distributed particles of the aggregates and Z +!! +!! +!! PURPOSE +!! ------- +!! The purpose of this routine is to integrate numerically the scaled fall +!! speed difference between aggregates and rain for use in collection +!! kernels. A first integral of the form +!! +!! infty Dz_max +!! / / +!! |{| } +!! |{| E_xz (Dx+Dz)^2 |cxDx^dx-czDz^dz| n(Dz) dDz} n(Dx) dDx +!! |{| } +!! / / +!! 0 Dz_min +!! +!! is evaluated and normalised by a second integral of the form +!! +!! infty +!! / / +!! |{| } +!! |{| (Dx+Dz)^2 n(Dz) dDz} n(Dx) dDx +!! |{| } +!! / / +!! 0 +!! +!! The result is stored in a two-dimensional array. +!! +!!** METHOD +!! ------ +!! The free parameters of the size distribution function of the aggregates +!! and Z (slope parameter LAMBDA) are discretized with a geometrical rate +!! in a specific range +!! LAMBDA = exp( (Log(LAMBDA_max) - Log(LAMBDA_min))/N_interval ) +!! The two above integrals are performed using the trapezoidal scheme. +!! +!! EXTERNAL +!! -------- +!! MODI_GENERAL_GAMMA: Generalized gamma distribution law +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! MODD_CST : XPI,XRHOLW +!! MODD_RAIN_ICE_DESCR: XAS,XAS,XBS +!! +!! REFERENCE +!! --------- +!! B.S. Ferrier , 1994 : A Double-Moment Multiple-Phase Four-Class +!! Bulk Ice Scheme,JAS,51,249-280. +!! +!! AUTHOR +!! ------ +!! J.-P. Pinty * Laboratoire d'Aerologie * +!! +!! MODIFICATIONS +!! ------------- +!! Original 8/11/95 +!! M. Taufour 03/2022 Adapted from rscolrg for concentration +!! J. Wurtz 03/2022 New snow characteristics +!! +!------------------------------------------------------------------------------- +! +! +!* 0. DECLARATIONS +! ------------ +! +USE MODI_GENERAL_GAMMA +! +USE MODD_CST +USE MODD_RAIN_ICE_DESCR_n +! +IMPLICIT NONE +! +!* 0.1 Declarations of dummy arguments +! ------------------------------- +! +! +INTEGER, INTENT(IN) :: KND ! Number of discrete size intervals in DS and DR +! +REAL, INTENT(IN) :: PALPHAS ! First shape parameter of the aggregates + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PZNUS ! Second shape parameter of the aggregates + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PALPHAR ! First shape parameter of the rain + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PNUR ! Second shape parameter of the rain + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PESR ! Efficiency of the aggregates collecting rain +REAL, INTENT(IN) :: PFALLS ! Fall speed constant of the aggregates +REAL, INTENT(IN) :: PEXFALLS ! Fall speed exponent of the aggregates +REAL, INTENT(IN) :: PFALLEXPS ! Fall speed exponential constant of the aggregates +REAL, INTENT(IN) :: PFALLR ! Fall speed constant of rain +REAL, INTENT(IN) :: PEXFALLR ! Fall speed exponent of rain +REAL, INTENT(IN) :: PLBDASMAX ! Maximun slope of size distribution of the aggregates +REAL, INTENT(IN) :: PLBDARMAX ! Maximun slope of size distribution of rain +REAL, INTENT(IN) :: PLBDASMIN ! Minimun slope of size distribution of the aggregates +REAL, INTENT(IN) :: PLBDARMIN ! Minimun slope of size distribution of rain +REAL, INTENT(IN) :: PDINFTY ! Factor to define the largest diameter up to + ! which the diameter integration is performed +REAL, INTENT(IN) :: PAG, PBS, PAS +! +REAL, DIMENSION(:,:), INTENT(INOUT) :: PNSCOLRG! Scaled fall speed difference in + ! the mass collection kernel as a + ! function of LAMBDAX and LAMBDAZ +! +! +!* 0.2 Declarations of local variables +! ------------------------------- +! +! +INTEGER :: JLBDAS ! Slope index of the size distribution of the aggregates +INTEGER :: JLBDAR ! Slope index of the size distribution of rain +INTEGER :: JDS ! Diameter index of a particle of the aggregates +INTEGER :: JDR ! Diameter index of a particle of rain +! +INTEGER :: INR ! Number of diameter step for the partial integration +! +REAL :: ZLBDAS ! Current slope parameter LAMBDA of the aggregates +REAL :: ZLBDAR ! Current slope parameter LAMBDA of rain +REAL :: ZDLBDAS ! Growth rate of the slope parameter LAMBDA of the aggregates +REAL :: ZDLBDAR ! Growth rate of the slope parameter LAMBDA of rain +REAL :: ZDDS ! Integration step of the diameter of the aggregates +REAL :: ZDDSCALR! Integration step of the diameter of rain (scaling integral) +REAL :: ZDDCOLLR! Integration step of the diameter of rain (fallspe integral) +REAL :: ZDS ! Current diameter of the particle aggregates +REAL :: ZDR ! Current diameter of the raindrops +REAL :: ZDRMIN ! Minimal diameter of the raindrops where the integration starts +REAL :: ZDRMAX ! Maximal diameter of the raindrops where the integration ends +REAL :: ZCOLLR ! Single integral of the mass weighted fall speed difference + ! over the spectrum of rain +REAL :: ZCOLLDRMIN ! Minimum ending point for the partial integral +REAL :: ZCOLLSR ! Double integral of the mass weighted fall speed difference + ! over the spectra of the aggregates and rain +REAL :: ZSCALR ! Single integral of the scaling factor over + ! the spectrum of rain +REAL :: ZSCALSR ! Double integral of the scaling factor over + ! the spectra of the aggregates and rain +REAL :: ZFUNC ! Ancillary function +REAL :: ZCST1 +! +! +!------------------------------------------------------------------------------- +! +! +!* 1 COMPUTE THE SCALED VELOCITY DIFFERENCE IN THE MASS +!* COLLECTION KERNEL, +! ------------------------------------------------- +! +! +!* 1.0 Initialization +! +PNSCOLRG(:,:) = 0.0 +ZCST1 = (3.0/XPI)/XRHOLW +! +!* 1.1 Compute the growth rate of the slope factors LAMBDA +! +ZDLBDAR = EXP( LOG(PLBDARMAX/PLBDARMIN)/REAL(SIZE(PNSCOLRG(:,:),1)-1) ) +ZDLBDAS = EXP( LOG(PLBDASMAX/PLBDASMIN)/REAL(SIZE(PNSCOLRG(:,:),2)-1) ) +! +!* 1.2 Scan the slope factors LAMBDAX and LAMBDAZ +! +DO JLBDAR = 1,SIZE(PNSCOLRG(:,:),1) + ZLBDAR = PLBDARMIN * ZDLBDAR ** (JLBDAR-1) + ZDRMAX = PDINFTY / ZLBDAR +! +!* 1.3 Compute the diameter steps +! + ZDDSCALR = PDINFTY / (REAL(KND) * ZLBDAR) + DO JLBDAS = 1,SIZE(PNSCOLRG(:,:),2) + ZLBDAS = PLBDASMIN * ZDLBDAS ** (JLBDAS-1) +! +!* 1.4 Initialize the collection integrals +! + ZSCALSR = 0.0 + ZCOLLSR = 0.0 +! +!* 1.5 Compute the diameter steps +! + ZDDS = PDINFTY / (REAL(KND) * ZLBDAS) +! +!* 1.6 Scan over the diameters DS and DR +! + DO JDS = 1,KND-1 + ZDS = ZDDS * REAL(JDS) + ZSCALR = 0.0 + ZCOLLR = 0.0 + DO JDR = 1,KND-1 + ZDR = ZDDSCALR * REAL(JDR) +! +!* 1.7 Compute the normalization factor by integration over the +! dimensional spectrum of rain +! + ZSCALR = ZSCALR + (ZDS+ZDR)**2 * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDR) + END DO +! +!* 1.8 Compute the scaled fall speed difference by partial +! integration over the dimensional spectrum of rain +! + ZFUNC = PAG - PAS*ZDS**(PBS-3.0) ! approximate limit is Ds=240 microns + IF( ZFUNC>0.0 ) THEN + ZDRMIN = ZDS*( ZCST1*ZFUNC )**0.3333333 + ELSE + ZDRMIN = 0.0 + END IF + IF( ZDS>1.0E-4 ) THEN ! allow computation if Ds>100 microns + ! corresponding to a maximal density of the aggregates of XRHOLW + IF( (ZDRMAX-ZDRMIN) >= 0.5*ZDDSCALR ) THEN + INR = CEILING( (ZDRMAX-ZDRMIN)/ZDDSCALR ) + ZDDCOLLR = (ZDRMAX-ZDRMIN) / REAL(INR) + DO JDR = 1,INR-1 + ZDR = ZDDCOLLR * REAL(JDR) + ZDRMIN + ZCOLLR = ZCOLLR + (ZDS+ZDR)**2 & + * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDR) & + * PESR * ABS(PFALLS*ZDS**PEXFALLS*EXP(-(ZDS*PFALLEXPS)**PALPHAS)-PFALLR*ZDR**PEXFALLR) + END DO + IF( ZDRMIN>0.0 ) THEN + ZCOLLDRMIN = (ZDS+ZDRMIN)**2 & + * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDRMIN) & + * PESR * ABS(PFALLS*ZDS**PEXFALLS*EXP(-(ZDS*PFALLEXPS)**PALPHAS)-PFALLR*ZDRMIN**PEXFALLR) + ELSE + ZCOLLDRMIN = 0.0 + END IF + ZCOLLR = (ZCOLLR + 0.5*ZCOLLDRMIN)*(ZDDCOLLR/ZDDSCALR) +! +!* 1.9 Compute the normalization factor by integration over the +! dimensional spectrum of the aggregates +! + ZFUNC = GENERAL_GAMMA(PALPHAS,PZNUS,ZLBDAS,ZDS) ! MTaufour : !*(ZDS**PEXMASSS) + ZSCALSR = ZSCALSR + ZSCALR * ZFUNC +! +!* 1.10 Compute the scaled fall speed difference by integration over +! the dimensional spectrum of the aggregates +! + ZCOLLSR = ZCOLLSR + ZCOLLR * ZFUNC +! +! Otherwise ZDRMIN>ZDRMAX so PRRCOLSS(JLBDAS,JLBDAR) = 0.0 ! +! + END IF +! +! Otherwise ZDRMAX = 0.0 so the density of the graupel cannot be reached +! and so PRRCOLSS(JLBDAS,JLBDAR) = 0.0 ! +! + END IF + END DO +! +!* 1.10 Scale the fall speed difference +! + IF( ZSCALSR>0.0 ) PNSCOLRG(JLBDAR,JLBDAS) = ZCOLLSR / ZSCALSR + END DO +END DO +! +END SUBROUTINE NSCOLRG diff --git a/src/mesonh/ext/phys_paramn.f90 b/src/mesonh/ext/phys_paramn.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a75b88d848d1b765ccfec6b6f13833a45c89393b --- /dev/null +++ b/src/mesonh/ext/phys_paramn.f90 @@ -0,0 +1,1692 @@ +!MNH_LIC Copyright 1995-2021 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_PHYS_PARAM_n +! ######################## +! +! +INTERFACE +! + SUBROUTINE PHYS_PARAM_n( KTCOUNT, TPFILE, & + PRAD, PSHADOWS, PKAFR, PGROUND, PMAFL, PDRAG,PEOL, PTURB, & + PTRACER, PTIME_BU, PWETDEPAER, OMASKkids, OCLOUD_ONLY ) +! +USE MODD_IO, ONLY: TFILEDATA +use modd_precision, only: MNHTIME +! +INTEGER, INTENT(IN) :: KTCOUNT ! temporal iteration count +TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Synchronous output file +! advection schemes +REAL(kind=MNHTIME), DIMENSION(2), INTENT(INOUT) :: PRAD,PSHADOWS,PKAFR,PGROUND,PTURB,PMAFL,PDRAG,PTRACER,PEOL ! to store CPU + ! time for computing time +REAL(kind=MNHTIME), DIMENSION(2), INTENT(INOUT) :: PTIME_BU ! time used in budget&LES budgets statistics +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PWETDEPAER +LOGICAL, DIMENSION(:,:), INTENT(IN) :: OMASKkids ! kids domains mask +LOGICAL, INTENT(OUT) :: OCLOUD_ONLY ! conditionnal radiation computations for + ! the only cloudy columns + ! +END SUBROUTINE PHYS_PARAM_n +! +END INTERFACE +! +END MODULE MODI_PHYS_PARAM_n +! +! ######################################################################################## + SUBROUTINE PHYS_PARAM_n( KTCOUNT, TPFILE, & + PRAD, PSHADOWS, PKAFR, PGROUND, PMAFL, PEOL, PDRAG, PTURB, & + PTRACER, PTIME_BU, PWETDEPAER, OMASKkids, OCLOUD_ONLY ) +! ######################################################################################## +! +!!**** *PHYS_PARAM_n * -monitor of the parameterizations used by model _n +!! +!! PURPOSE +!! ------- +! The purpose of this routine is to update the sources by adding the +! parameterized terms. This is realized by sequentially calling the +! specialized routines. +! +!!** METHOD +!! ------ +!! The first parametrization is the radiation scheme: +!! ---------------- +!! * CRAD = 'FIXE' +!! In this case, a temporal interpolation is performed for the downward +!! surface fluxes XFLALWD and XFLASWD. +!! * CRAD = 'ECMWF' +!! Several tests are performed before calling the radiation computations +!! interface with the ECMWF radiation scheme code. A control is made to +!! ensure that: +!! - the full radiation code is called at the first model timestep +!! - there is a priority for calling the full radiation instead of the +!! cloud-only approximation if both must be called at the current +!! timestep +!! - the cloud-only option (approximation) is coherent with the +!! occurence of one cloudy vertical column at least +!! If all the above conditions are fulfilled (GRAD is .TRUE.) then the +!! position of the sun is computed in routine SUNPOS_n and the interfacing +!! routine RADIATIONS is called to update the radiative tendency XDTHRAD +!! and the downward surface fluxes XFLALWD and XFLASWD. Finally, the +!! radiative tendency is integrated as a source term in the THETA prognostic +!! equation. +!! +!! The second parameterization is the soil scheme: +!! ----------- +!! +!! externalized surface +!! +!! The third parameterization is the turbulence scheme: +!! ----------------- +!! * CTURB='NONE' +!! no turbulent mixing is taken into account +!! * CTURB='TKEL' +!! The turbulent fluxes are computed according to a one and half order +!! closure of the hydrodynamical equations. This scheme is based on a +!! prognostic for the turbulent kinetic energy and a mixing length +!! computation ( the mesh size or a physically based length). Other +!! turbulent moments are diagnosed according to a stationarization of the +!! second order turbulent moments. This turbulent scheme forecasts +!! either a purely vertical turbulent mixing or 3-dimensional mixing +!! according to its internal degrees of freedom. +!! +!! +!! The LAST parameterization is the chemistry scheme: +!! ----------------- +!! The chemistry part of MesoNH has two namelists, NAM_SOLVER for the +!! parameters concerning the stiff solver, and NAM_MNHCn concerning the +!! configuration and options of the chemistry module itself. +!! The switch LUSECHEM in NAM_CONF acitvates or deactivates the chemistry. +!! The only variables of MesoNH that are modified by chemistry are the +!! scalar variables. If calculation of chemical surface fluxes is +!! requested, those fluxes are calculated before +!! entering the turbulence scheme, since those fluxes are taken into +!! account by TURB as surface boundary conditions. +!! CAUTION: chemistry has allways to be called AFTER ALL OTHER TERMS +!! that affect the scalar variables (dynamical terms, forcing, +!! parameterizations (like TURB, CONVECTION), since it uses the variables +!! XRSVS as input in case of the time-split option. +!! +!! EXTERNAL +!! -------- +!! Subroutine SUNPOS_n : computes the position of the sun +!! Subroutine RADIATIONS : computes the radiative tendency and fluxes +!! Subroutine TSZ0 : computes the surface from temporally +!! interpolated Ts and given z0 +!! Subroutine ISBA : computes the surface fluxes from a soil scheme +!! Subroutine TURB : computes the turbulence source terms +!! Subroutine CONVECTION : computes the convection source term +!! Subroutine CH_SURFACE_FLUX_n: computes the surface flux for chemical +!! species +!! Subroutine CH_MONITOR_n : computes the chemistry source terms +!! that are applied to the scalar variables +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! USE MODD_DYN +!! USE MODD_CONF +!! USE MODD_CONF_n +!! USE MODD_CURVCOR_n +!! USE MODD_DYN_n +!! USE MODD_FIELD_n +!! USE MODD_GR_FIELD_n +!! USE MODD_LSFIELD_n +!! USE MODD_GRID_n +!! USE MODD_LBC_n +!! USE MODD_PARAM_RAD_n +!! USE MODD_RADIATIONS_n +!! USE MODD_REF_n +!! USE MODD_LUNIT_n +!! USE MODD_TIME_n +!! USE MODD_CH_MNHC_n +!! +!! REFERENCE +!! --------- +!! None +!! +!! AUTHOR +!! ------ +!! J. Stein * Meteo-France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 05/01/95 +!! Modifications Feb 14, 1995 (J.Cuxart) add the I/O arguments, +!! the director cosinus and change the names of the surface fluxes +!! Modifications March 21, 1995 (J.M.Carriere) take into account liquid +!! water +!! June 30,1995 (J.Stein) initialize at 0 the surf. fluxes +!! Modifications Sept. 1, 1995 (S.Belair) ISBA scheme +!! Modifications Sept.25, 1995 (J.Stein) switch on the radiation scheme +!! Modifications Sept. 11, 1995 (J.-P. Pinty) radiation scheme +!! Nov. 15, 1995 (J.Stein) cleaning + change the temporal +!! algorithm for the soil scheme-turbulence +!! Jan. 23, 1996 (J.Stein) add a new option for the surface +!! fluxes where Ts and z0 are given +!! March 18, 1996 (J.Stein) add the cloud fraction +!! March 28, 1996 (J.Stein) the soil scheme gives energy +!! fluxes + cleaning +!! June 17, 1996 (Lafore) statistics of computing time +!! August 4, 1996 (K. Suhre) add chemistry +!! Oct. 12, 1996 (J.Stein) use XSRCM in the turbulence +!! scheme +!! Nov. 18, 1996 (J.-P. Pinty) add domain translation +!! change arg. in radiations +!! Fev. 4, 1997 (J.Viviand) change isba's calling for ice +!! Jun. 22, 1997 (J.Stein) change the equation system and use +!! the absolute pressure +!! Jul. 09, 1997 (V.Masson) add directional z0 +!! Jan. 24, 1998 (P.Bechtold) add convective transport for tracers +!! Jan. 24, 1998 (J.-P. Pinty) split SW and LW part for radiation +!! Mai. 10, 1999 (P.Bechtold) shallow convection +!! Oct. 20, 1999 (P.Jabouille) domain translation for turbulence +!! Jan. 04, 2000 (V.Masson) removes TSZ0 case +!! Jan. 04, 2000 (V.Masson) modifies albedo computation +! Jul 02, 2000 (F.Solmon/V.Masson) adaptation for patch approach +!! Nov. 15, 2000 (V.Masson) LES routines +!! Nov. 15, 2000 (V.Masson) effect of slopes on surface fluxes +!! Feb. 02, 2001 (P.Tulet) add friction velocities and aerodynamical +!! resistance (patch approach) +!! Jan. 04, 2000 (V.Masson) modify surf_rad_modif computation +!! Mar. 04, 2002 (F.Solmon) new interface for radiation call +!! Nov. 06, 2002 (V.Masson) LES budgets & budget time counters +!! Jan. 2004 (V.Masson) surface externalization +!! Jan. 13, 2004 (J.Escobar) bug correction : compute "GRAD" in parallel +!! Jan. 20, 2005 (P. Tulet) add dust sedimentation +!! Jan. 20, 2005 (P. Tulet) climatologic SSA +!! Jan. 20, 2005 (P. Tulet) add aerosol / dust scavenging +!! Jul. 2005 (N. Asencio) use the two-way result-fields +!! before ground_param call +!! May 2006 Remove EPS +!! Oct. 2007 (J.Pergaud) Add shallow_MF +!! Oct. 2009 (C.Lac) Introduction of different PTSTEP according to the +!! advection schemes +!! Oct. 2009 (V. MAsson) optimization of Pergaud et al massflux scheme +!! Aug. 2010 (V.Masson, C.Lac) Exchange of SBL_DEPTH for +!! reproducibility +!! Oct. 2010 (J.Escobar) init ZTIME_LES_MF ( pb detected with g95 ) +!! Feb. 2011 (V.Masson, C.Lac) SBL_DEPTH values on outer pts +!! for RMC01 +!! Sept.2011 (J.Escobar) init YINST_SFU ='M' +!! +!! Specific for 2D modeling : +!! +!! 06/2010 (P.Peyrille) add Call to aerozon.f90 if LAERO_FT=T +!! to update +!! aerosols and ozone climatology at each call to +!! phys_param otherwise it is constant to monthly average +!! 03/2013 (C.Lac) FIT temporal scheme +!! 01/2014 (C.Lac) correction for the nesting of 2D surface +!! fields if the number of the son model does not +!! follow the number of the dad model +!! J.Escobar 21/03/2013: for HALOK comment all NHALO=1 test +!! 2014 (M.Faivre) +!! 06/2016 (G.Delautier) phasage surfex 8 +!! 2016 B.VIE LIMA +!! M. Leriche 02/2017 Avoid negative fluxes if sv=0 outside the physics domain +!! C.Lac 10/2017 : ch_monitor and aer_monitor extracted from phys_param +!! to be called directly by modeln as the last process +!! 02/2018 Q.Libois ECRAD +! P. Wautelet 28/03/2018: replace TEMPORAL_DIST by DATETIME_DISTANCE +! P. Wautelet 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 28/03/2019: use MNHTIME for time measurement variables +! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function +! P. Wautelet 20/05/2019: add name argument to ADDnFIELD_ll + new ADD4DFIELD_ll subroutine +! P. Wautelet 21/11/2019: ZRG_HOUR and ZRAT_HOUR are now parameter arrays +! C. Lac 11/2019: correction in the drag formula and application to building in addition to tree +! F. Auguste 02/2021: add IBM +! JL Redelsperger 03/2021: add the SW flux penetration for Ocean model case +! A. Costes 12/2021: add Blaze fire model +!!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_ADV_n, ONLY : XRTKEMS +USE MODD_ARGSLIST_ll, ONLY : LIST_ll +USE MODD_BLOWSNOW, ONLY : LBLOWSNOW,XRSNOW +USE MODD_BUDGET, ONLY: NBUDGET_TH, NBUDGET_RV, NBUDGET_RC, NBUDGET_RI, NBUDGET_SV1, & + TBUDGETS, xtime_bu_process, TBUCONF +USE MODD_CH_AEROSOL +USE MODD_CH_MNHC_n, ONLY : LUSECHEM, &! indicates if chemistry is used + LCH_CONV_SCAV, & + LCH_CONV_LINOX +USE MODD_CLOUD_MF_n +USE MODD_CONDSAMP +USE MODD_CONF +USE MODD_CONF_n +USE MODD_CST, ONLY : CST +USE MODD_CTURB, ONLY : CSTURB +USE MODD_CURVCOR_n +USE MODD_DEEP_CONVECTION_n +USE MODD_DEF_EDDY_FLUX_n ! Ajout PP +USE MODD_DEF_EDDYUV_FLUX_n ! Ajout PP +USE MODD_DIAG_IN_RUN, ONLY: LDIAG_IN_RUN, XCURRENT_TKE_DISS +USE MODD_DIM_n, ONLY: NIMAX_ll, NJMAX_ll +USE MODD_DRAGBLDG_n +USE MODD_DRAGTREE_n +USE MODD_DUST +USE MODD_DYN +USE MODD_DYN_n +USE MODD_EOL_MAIN, ONLY: LMAIN_EOL, CMETH_EOL, NMODEL_EOL +USE MODD_FIELD_n +USE MODD_FRC +USE MODD_FRC_n +USE MODD_GRID +USE MODD_GRID_n +USE MODD_IBM_PARAM_n, ONLY: LIBM, XIBM_EPSI, XIBM_LS, XIBM_XMUT +USE MODD_ICE_C1R3_DESCR, ONLY : XRTMIN_C1R3=>XRTMIN +USE MODD_IO, ONLY: TFILEDATA +USE MODD_LATZ_EDFLX +USE MODD_LBC_n +USE MODD_LES +USE MODD_LES_BUDGET +USE MODD_LSFIELD_n +USE MODD_LUNIT_n +USE MODD_METRICS_n +USE MODD_MNH_SURFEX_n +USE MODD_NESTING, ONLY : XWAY,NDAD, NDXRATIO_ALL, NDYRATIO_ALL +USE MODD_NSV, ONLY : NSV, NSV_LGBEG, NSV_LGEND, & + NSV_SLTBEG,NSV_SLTEND,NSV_SLT,& + NSV_AERBEG,NSV_AEREND, & + NSV_DSTBEG,NSV_DSTEND, NSV_DST,& + NSV_LIMA_NR,NSV_LIMA_NS,NSV_LIMA_NG,NSV_LIMA_NH +USE MODD_OCEANH +USE MODD_OUT_n +USE MODD_PARAM_C2R2, ONLY : LSEDC +USE MODD_PARAMETERS +USE MODD_PARAM_ICE_n, ONLY : LSEDIC +USE MODD_PARAM_KAFR_n +USE MODD_PARAM_LIMA, ONLY : MSEDC => LSEDC, XRTMIN_LIMA=>XRTMIN +USE MODD_PARAM_MFSHALL_n, ONLY: CMF_CLOUD +USE MODD_PARAM_n +USE MODD_PARAM_RAD_n +USE MODD_PASPOL +USE MODD_PASPOL_n +USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t +USE MODD_PRECIP_n +use modd_precision, only: MNHTIME +USE MODD_RADIATIONS_n +USE MODD_RAIN_ICE_DESCR_n, ONLY: XRTMIN +USE MODD_REF, ONLY: LCOUPLES +USE MODD_REF_n +USE MODD_SALT +USE MODD_SHADOWS_n +USE MODD_SUB_PHYS_PARAM_n +USE MODD_TIME_n +USE MODD_TIME_n +USE MODD_TIME, ONLY : TDTEXP ! Ajout PP +USE MODD_TURB_CLOUD, ONLY : CTURBLEN_CLOUD,NMODEL_CLOUD, & + XCEI,XCEI_MIN,XCEI_MAX,XCOEF_AMPL_SAT +USE MODD_TURB_FLUX_AIRCRAFT_BALLOON, ONLY : XTHW_FLUX, XRCW_FLUX, XSVW_FLUX +USE MODD_TURB_n +USE MODD_NEB_n, ONLY: NEBN + +USE MODE_AERO_PSD +use mode_budget, only: Budget_store_end, Budget_store_init +USE MODE_DATETIME +USE MODE_DUST_PSD +USE MODE_ll +USE MODE_GATHER_ll +USE MODE_MNH_TIMING +USE MODE_MODELN_HANDLER +USE MODE_MPPDB +USE MODE_FILL_DIMPHYEX, ONLY: FILL_DIMPHYEX +USE MODE_SALT_PSD + +USE MODI_AEROZON ! Ajout PP +USE MODI_CONDSAMP +USE MODI_CONVECTION +USE MODI_DRAG_BLD +USE MODI_DRAG_VEG +USE MODI_DUST_FILTER +USE MODI_EDDY_FLUX_n ! Ajout PP +USE MODI_EDDY_FLUX_ONE_WAY_n ! Ajout PP +USE MODI_EDDYUV_FLUX_n ! Ajout PP +USE MODI_EDDYUV_FLUX_ONE_WAY_n ! Ajout PP +USE MODI_EOL_MAIN +USE MODI_GROUND_PARAM_n +USE MODI_GRADIENT_M +USE MODI_GRADIENT_W +USE MODI_PASPOL +USE MODI_RADIATIONS +USE MODI_SALT_FILTER +USE MODI_SEDIM_DUST +USE MODI_SEDIM_SALT +USE MODI_SHALLOW_MF_PACK +USE MODI_SUNPOS_n +USE MODI_SURF_RAD_MODIF +USE MODI_SWITCH_SBG_LES_N +USE MODI_TURB + +IMPLICIT NONE +! +!* 0.1 declarations of arguments +! +INTEGER, INTENT(IN) :: KTCOUNT ! temporal iteration count +TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Synchronous output file +! advection schemes +REAL(kind=MNHTIME), DIMENSION(2), INTENT(INOUT) :: PRAD,PSHADOWS,PKAFR,PGROUND,PTURB,PMAFL,PDRAG,PTRACER,PEOL ! to store CPU + ! time for computing time +REAL(kind=MNHTIME), DIMENSION(2), INTENT(INOUT) :: PTIME_BU ! time used in budget&LES budgets statistics +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PWETDEPAER +LOGICAL, DIMENSION(:,:), INTENT(IN) :: OMASKkids ! kids domains mask +LOGICAL, INTENT(OUT) :: OCLOUD_ONLY ! conditionnal radiation computations for + ! the only cloudy columns + ! +! +!* 0.2 declarations of local variables +! +REAL, DIMENSION(:,:), ALLOCATABLE :: ZSFU ! surface flux of x and +REAL, DIMENSION(:,:), ALLOCATABLE :: ZSFV ! y component of wind +REAL, DIMENSION(:,:), ALLOCATABLE :: ZSFTH ! surface flux of theta +REAL, DIMENSION(:,:), ALLOCATABLE :: ZSFRV ! surface flux of vapor +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZSFSV ! surface flux of scalars +REAL, DIMENSION(:,:), ALLOCATABLE :: ZSFCO2! surface flux of CO2 +! +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZDIR_ALB ! direct albedo +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZSCA_ALB ! diffuse albedo +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZEMIS ! emissivity +REAL, DIMENSION(:,:), ALLOCATABLE :: ZTSRAD ! surface temperature +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZRGDST,ZSIGDST,ZNDST,ZSVDST +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZRGSLT,ZSIGSLT,ZNSLT,ZSVSLT +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZRGAER,ZSIGAER,ZNAER,ZSVAER +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZSVT +! +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZEXN ! Atmospheric density and Exner +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZSIGMF ! MF contribution to XSIGS +! +REAL, DIMENSION(0:24), parameter :: ZRG_HOUR = (/ 0., 0., 0., 0., 0., 32.04, 114.19, & + 228.01, 351.25, 465.49, 557.24, & + 616.82, 638.33, 619.43, 566.56, & + 474.71, 359.20, 230.87, 115.72, & + 32.48, 0., 0., 0., 0., 0. /) +! +REAL, DIMENSION(0:24), parameter :: ZRAT_HOUR = (/ 326.00, 325.93, 325.12, 324.41, & + 323.16, 321.95, 322.51, 325.16, & + 328.01, 331.46, 335.58, 340.00, & + 345.20, 350.32, 354.20, 356.58, & + 356.56, 355.33, 352.79, 351.34, & + 347.00, 342.00, 337.00, 332.00, & + 326.00 /) +! +! +character(len=6) :: ynum +INTEGER :: IHOUR ! parameters necessary for the temporal +REAL :: ZTIME, ZDT ! interpolation +REAL :: ZTEMP_DIST ! time between 2 instants (in seconds) +! +LOGICAL :: GRAD ! conditionnal call for the full radiation + ! computations +REAL :: ZRAD_GLOB_ll ! 'real' global parallel mask of 'GRAD' +INTEGER :: INFO_ll ! error report of parallel routines + ! the only cloudy columns +! +REAL(kind=MNHTIME), DIMENSION(2) :: ZTIME1, ZTIME2, ZTIME3, ZTIME4 ! for computing time analysis +REAL(kind=MNHTIME), DIMENSION(2) :: ZTIME_LES_MF ! time spent in LES computation in shallow conv. +LOGICAL :: GDCONV ! conditionnal call for the deep convection + ! computations +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRC, ZRI, ZWT ! additional dummies +REAL, DIMENSION(:,:), ALLOCATABLE :: ZDXDY ! grid area + ! for rc, ri, w required if main variables not allocated +! +INTEGER :: IIU, IJU, IKU ! dimensional indexes +! +INTEGER :: JSV ! Loop index for Scalar Variables +INTEGER :: JSWB ! loop on SW spectral bands +INTEGER :: IIB,IIE,IJB,IJE, IKB, IKE, JI,JJ +INTEGER :: IMODEIDX + ! index values for the Beginning or the End of the physical + ! domain in x and y directions +TYPE(LIST_ll), POINTER :: TZFIELDS_ll ! list of fields to exchange +INTEGER :: IINFO_ll ! return code of parallel routine +! +!* variables for writing in a fm file +! +INTEGER :: IRESP ! IRESP : return-code if a problem appears + !in LFI subroutines at the open of the file +INTEGER :: ILUOUT ! logical unit numbers of output-listing +INTEGER :: IMI ! model index +INTEGER :: JKID ! loop index to look for the KID models +REAL :: ZINIRADIUSI, ZINIRADIUSJ ! ORILAM initial radius +REAL, DIMENSION(NMODE_DST) :: ZINIRADIUS ! DUST initial radius +REAL, DIMENSION(NMODE_SLT) :: ZINIRADIUS_SLT ! Sea Salt initial radius +REAL, DIMENSION(SIZE(XRSVS,1), SIZE(XRSVS,2), SIZE(XRSVS,3), SIZE(XRSVS,4)) :: ZRSVS +LOGICAL :: GCLD ! conditionnal call for dust wet deposition +! * arrays to store the surface fields before radiation and convection scheme +! calls +INTEGER :: IMODSON ! Number of son models of IMI with XWAY=2 +INTEGER :: IKIDM ! index loop +INTEGER :: IGRADIENTS ! Number of horizontal gradients in turb +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZSAVE_INPRR,ZSAVE_INPRS,ZSAVE_INPRG,ZSAVE_INPRH +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZSAVE_INPRC,ZSAVE_PRCONV,ZSAVE_PRSCONV +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZSAVE_DIRFLASWD, ZSAVE_SCAFLASWD,ZSAVE_DIRSRFSWD +! for ocean model +INTEGER :: JKM , JSW ! vertical index loop +REAL :: ZSWA,TINTSW ! index for SW interpolation and int time betwenn forcings (ocean model) +REAL, DIMENSION(:), ALLOCATABLE :: ZIZOCE(:) ! Solar flux penetrating in ocean +REAL, DIMENSION(:), ALLOCATABLE :: ZPROSOL1(:),ZPROSOL2(:) ! Funtions for penetrating solar flux +! +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZLENGTHM, ZLENGTHH, ZMFMOIST !OHARAT turb option from AROME (not allocated in MNH) + ! to be moved as optional args for turb +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTDIFF, ZTDISS +REAL, DIMENSION(:),ALLOCATABLE :: ZXHAT_ll,ZYHAT_ll ! Position x/y in the conformal + ! plane (array on the complete domain) +REAL, DIMENSION(:,:), ALLOCATABLE :: ZDIST ! distance from the center of the cooling +! +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZHGRAD ! horizontal gradient used in turb +TYPE(DIMPHYEX_t) :: YLDIMPHYEX +LOGICAL :: GCOMPUTE_SRC ! flag to define dimensions of SIGS and SRCT variables +!----------------------------------------------------------------------------- + +NULLIFY(TZFIELDS_ll) +IMI=GET_CURRENT_MODEL_INDEX() +! +ILUOUT = TLUOUT%NLU +CALL GET_DIM_EXT_ll ('B',IIU,IJU) +IKU=SIZE(XTHT,3) +IKB = 1 + JPVEXT +IKE = IKU - JPVEXT +! +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +CALL FILL_DIMPHYEX(YLDIMPHYEX, SIZE(XTHT,1), SIZE(XTHT,2), SIZE(XTHT,3),.TRUE.) +! +ZTIME1 = 0.0_MNHTIME +ZTIME2 = 0.0_MNHTIME +ZTIME3 = 0.0_MNHTIME +ZTIME4 = 0.0_MNHTIME +PTIME_BU = 0._MNHTIME +ZTIME_LES_MF = 0.0_MNHTIME +PWETDEPAER(:,:,:,:) = 0. +! +!* allocation of variables used in more than one parameterization +! +ALLOCATE(ZSFU (IIU,IJU)) ! surface schemes + turbulence +ALLOCATE(ZSFV (IIU,IJU)) +ALLOCATE(ZSFTH (IIU,IJU)) +ALLOCATE(ZSFRV (IIU,IJU)) +ALLOCATE(ZSFSV (IIU,IJU,NSV)) +ALLOCATE(ZSFCO2(IIU,IJU)) +! +!* if XWAY(son)=2 save surface fields before radiation or convective scheme +! calls +! +IMODSON = 0 +DO JKID = IMI+1,NMODEL ! min value of the possible kids + IF (IMI == NDAD(JKID) .AND. XWAY(JKID) == 2. .AND. CPROGRAM=='MESONH' & + .AND. (CCONF == 'RESTA' .OR. (CCONF == 'START' .AND. KTCOUNT /= 1))) THEN + IMODSON = IMODSON + 1 + END IF +END DO +! + IF (IMODSON /= 0 ) THEN + IF (LUSERC .AND. ( & + (LSEDIC .AND. CCLOUD(1:3) == 'ICE') .OR. & + (LSEDC .AND. (CCLOUD == 'C2R2' .OR. CCLOUD == 'KHKO')) .OR. & + (MSEDC .AND. CCLOUD=='LIMA') & + )) THEN + ALLOCATE( ZSAVE_INPRC(SIZE(XINPRC,1),SIZE(XINPRC,2),IMODSON)) + ELSE + ALLOCATE( ZSAVE_INPRC(0,0,0)) + END IF + IF (LUSERR) THEN + ALLOCATE( ZSAVE_INPRR(SIZE(XINPRR,1),SIZE(XINPRR,2),IMODSON)) + ELSE + ALLOCATE( ZSAVE_INPRR(0,0,0)) + END IF + IF (LUSERS) THEN + ALLOCATE( ZSAVE_INPRS(SIZE(XINPRS,1),SIZE(XINPRS,2),IMODSON)) + ELSE + ALLOCATE( ZSAVE_INPRS(0,0,0)) + END IF + IF (LUSERG) THEN + ALLOCATE( ZSAVE_INPRG(SIZE(XINPRG,1),SIZE(XINPRG,2),IMODSON)) + ELSE + ALLOCATE( ZSAVE_INPRG(0,0,0)) + END IF + IF (LUSERH) THEN + ALLOCATE( ZSAVE_INPRH(SIZE(XINPRH,1),SIZE(XINPRH,2),IMODSON)) + ELSE + ALLOCATE( ZSAVE_INPRH(0,0,0)) + END IF + IF (CDCONV /= 'NONE') THEN + ALLOCATE( ZSAVE_PRCONV(SIZE(XPRCONV,1),SIZE(XPRCONV,2),IMODSON)) + ALLOCATE( ZSAVE_PRSCONV(SIZE(XPRSCONV,1),SIZE(XPRSCONV,2),IMODSON)) + ELSE + ALLOCATE( ZSAVE_PRCONV(0,0,0)) + ALLOCATE( ZSAVE_PRSCONV(0,0,0)) + END IF + IF (CRAD /= 'NONE') THEN + ALLOCATE( ZSAVE_DIRFLASWD(SIZE(XDIRFLASWD,1),SIZE(XDIRFLASWD,2),SIZE(XDIRFLASWD,3),IMODSON)) + ALLOCATE( ZSAVE_SCAFLASWD(SIZE(XSCAFLASWD,1),SIZE(XSCAFLASWD,2),SIZE(XSCAFLASWD,3),IMODSON)) + ALLOCATE( ZSAVE_DIRSRFSWD(SIZE(XDIRSRFSWD,1),SIZE(XDIRSRFSWD,2),SIZE(XDIRSRFSWD,3),IMODSON)) + ELSE + ALLOCATE( ZSAVE_DIRFLASWD(0,0,0,0)) + ALLOCATE( ZSAVE_SCAFLASWD(0,0,0,0)) + ALLOCATE( ZSAVE_DIRSRFSWD(0,0,0,0)) + END IF + ENDIF +! +IKIDM=0 +DO JKID = IMI+1,NMODEL ! min value of the possible kids + IF (IMI == NDAD(JKID) .AND. XWAY(JKID) == 2. .AND. CPROGRAM=='MESONH' & + .AND. (CCONF == 'RESTA' .OR. (CCONF == 'START' .AND. KTCOUNT /= 1))) THEN +! BUG if number of the son does not follow the number of the dad +! IKIDM = JKID-IMI + IKIDM = IKIDM + 1 + IF (LUSERC .AND. ( & + (LSEDIC .AND. CCLOUD(1:3) == 'ICE') .OR. & + (LSEDC .AND. (CCLOUD == 'C2R2' .OR. CCLOUD == 'KHKO')) .OR. & + (MSEDC .AND. CCLOUD=='LIMA') & + )) THEN + ZSAVE_INPRC(:,:,IKIDM) = XINPRC(:,:) + END IF + IF (LUSERR) THEN + ZSAVE_INPRR(:,:,IKIDM) = XINPRR(:,:) + END IF + IF (LUSERS) THEN + ZSAVE_INPRS(:,:,IKIDM) = XINPRS(:,:) + END IF + IF (LUSERG) THEN + ZSAVE_INPRG(:,:,IKIDM) = XINPRG(:,:) + END IF + IF (LUSERH) THEN + ZSAVE_INPRH(:,:,IKIDM) = XINPRH(:,:) + END IF + IF (CDCONV /= 'NONE') THEN + ZSAVE_PRCONV(:,:,IKIDM) = XPRCONV(:,:) + ZSAVE_PRSCONV(:,:,IKIDM) = XPRSCONV(:,:) + END IF + IF (CRAD /= 'NONE') THEN + ZSAVE_DIRFLASWD(:,:,:,IKIDM) = XDIRFLASWD(:,:,:) + ZSAVE_SCAFLASWD(:,:,:,IKIDM) = XSCAFLASWD(:,:,:) + ZSAVE_DIRSRFSWD(:,:,:,IKIDM) = XDIRSRFSWD(:,:,:) + END IF + ENDIF +END DO +! +!----------------------------------------------------------------------------- +! +!* 1. RADIATION SCHEME +! ---------------- +! +! +XTIME_BU_PROCESS = 0. +XTIME_LES_BU_PROCESS = 0. +! +CALL SECOND_MNH2(ZTIME1) +! +! +!* 1.1 Tests to control how the radiation package should be called (at the current timestep) +! ----------------------------------------------------------- +! +! +GRAD = .FALSE. +OCLOUD_ONLY = .FALSE. +! +IF (CRAD /='NONE') THEN +! +! test to see if the partial radiations for cloudy must be called +! + IF (CRAD =='ECMW' .OR. CRAD =='ECRA') THEN + CALL DATETIME_DISTANCE(TDTRAD_CLONLY,TDTCUR,ZTEMP_DIST) + IF( MOD(NINT(ZTEMP_DIST/XTSTEP),NINT(XDTRAD_CLONLY/XTSTEP))==0 ) THEN + TDTRAD_CLONLY = TDTCUR + GRAD = .TRUE. + OCLOUD_ONLY = .TRUE. + END IF + END IF +! +! test to see if the full radiations must be called +! + CALL DATETIME_DISTANCE(TDTCUR,TDTRAD_FULL,ZTEMP_DIST) + IF( MOD(NINT(ZTEMP_DIST/XTSTEP),NINT(XDTRAD/XTSTEP))==0 ) THEN + TDTRAD_FULL = TDTCUR + GRAD = .TRUE. + OCLOUD_ONLY = .FALSE. + END IF +! +! tests to see if any cloud exists +! + IF (CRAD =='ECMW' .OR. CRAD =='ECRA') THEN + IF (GRAD .AND. NRR.LE.3 ) THEN + IF( MAX(MAXVAL(XCLDFR(:,:,:)),MAXVAL(XICEFR(:,:,:))).LE. 1.E-10 .AND. OCLOUD_ONLY ) THEN + GRAD = .FALSE. ! only the cloudy verticals would be + ! refreshed but there is no clouds + END IF + END IF +! + IF (GRAD .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. OCLOUD_ONLY ) THEN + GRAD = .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. OCLOUD_ONLY ) THEN + GRAD = .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. OCLOUD_ONLY ) THEN + GRAD = .FALSE. ! only the cloudy verticals would be + ! refreshed but there is no cloudwater and ice + END IF + END IF + END IF + END IF +! +END IF +! +! global parallel mask for 'GRAD' +ZRAD_GLOB_ll = 0.0 +IF (GRAD) ZRAD_GLOB_ll = 1.0 +CALL REDUCESUM_ll(ZRAD_GLOB_ll,INFO_ll) +if (ZRAD_GLOB_ll .NE. 0.0 ) GRAD = .TRUE. +! +! +IF( GRAD ) THEN + ALLOCATE(ZCOSZEN(IIU,IJU)) + ALLOCATE(ZSINZEN(IIU,IJU)) + ALLOCATE(ZAZIMSOL(IIU,IJU)) +! +! +!* 1.2. Astronomical computations +! ------------------------- +! +! Ajout PP +IF (.NOT. OCLOUD_ONLY .AND. KTCOUNT /= 1) THEN + IF (LAERO_FT) THEN + CALL AEROZON (XPABST,XTHT,XTSRAD,XLAT,XLON,TDTCUR,TDTEXP, & + NDLON,NFLEV,CAER,NAER,NSTATM, & + XSINDEL,XCOSDEL,XTSIDER,XCORSOL, & + XSTATM,XOZON, XAER) + XAER_CLIM = XAER + END IF +END IF +! +CALL SUNPOS_n ( XZENITH, ZCOSZEN, ZSINZEN, ZAZIMSOL ) +! +!* 1.3 Call to radiation scheme +! ------------------------ +! + SELECT CASE ( CRAD ) +! +!* 1.3.1 TOP of Atmposphere radiation +! ---------------------------- + CASE('TOPA') +! + XFLALWD (:,:) = 300. + DO JSWB=1,NSWB_MNH + XDIRFLASWD(:,:,JSWB) = CST%XI0 * MAX(COS(XZENITH(:,:)),0.)/REAL(NSWB_MNH) + XSCAFLASWD(:,:,JSWB) = 0. + END DO + XDTHRAD(:,:,:) = 0. + +! +!* 1.3.1 FIXEd radiative surface fluxes +! ------------------------------ +! + CASE('FIXE') + ZTIME = MOD(TDTCUR%xtime +XLON0*240., CST%XDAY) + IHOUR = INT( ZTIME/3600. ) + IF (IHOUR < 0) IHOUR=IHOUR + 24 + ZDT = ZTIME/3600. - REAL(IHOUR) + XDIRFLASWD(:,:,:) =(( ZRG_HOUR(IHOUR+1)-ZRG_HOUR(IHOUR) )*ZDT + ZRG_HOUR(IHOUR)) / REAL(NSWB_MNH) + XFLALWD (:,:) = (ZRAT_HOUR(IHOUR+1)-ZRAT_HOUR(IHOUR))*ZDT + ZRAT_HOUR(IHOUR) + DO JSWB=1,NSWB_MNH + WHERE(ZCOSZEN(:,:)<0.) XDIRFLASWD(:,:,JSWB) = 0. + END DO + + XSCAFLASWD(:,:,:) = XDIRFLASWD(:,:,:) * 0.2 + XDIRFLASWD(:,:,:) = XDIRFLASWD(:,:,:) * 0.8 + XDTHRAD(:,:,:) = 0. + ! +! +!* 1.3.2 ECMWF or ECRAD radiative surface and atmospheric fluxes +! ---------------------------------------------- +! + CASE('ECMW' , 'ECRA') + IF (LLES_MEAN) OCLOUD_ONLY=.FALSE. + XRADEFF(:,:,:)=0.0 + XSWU(:,:,:)=0.0 + XSWD(:,:,:)=0.0 + XLWU(:,:,:)=0.0 + XLWD(:,:,:)=0.0 + XDTHRADSW(:,:,:)=0.0 + XDTHRADLW(:,:,:)=0.0 + CALL RADIATIONS( TPFILE, & + LCLEAR_SKY, OCLOUD_ONLY, NCLEARCOL_TM1, CEFRADL, CEFRADI, COPWSW, COPISW, & + COPWLW, COPILW, XFUDG, & + NDLON, NFLEV, NRAD_DIAG, NFLUX, NRAD, NAER, NSWB_OLD, NSWB_MNH, NLWB_MNH, & + NSTATM, NRAD_COLNBR, ZCOSZEN, XSEA, XCORSOL, & + XDIR_ALB, XSCA_ALB, XEMIS, MAX(XCLDFR,XICEFR), XCCO2, XTSRAD, XSTATM, XTHT, XRT, & + XPABST, XOZON, XAER,XDST_WL, XAER_CLIM, XSVT, & + XDTHRAD, XFLALWD, XDIRFLASWD, XSCAFLASWD, XRHODREF, XZZ , & + XRADEFF, XSWU, XSWD, XLWU, XLWD, XDTHRADSW, XDTHRADLW ) +! + + WRITE(UNIT=ILUOUT,FMT='(" RADIATIONS called for KTCOUNT=",I6, & + & "with the CLOUD_ONLY option set ",L2)') KTCOUNT,OCLOUD_ONLY +! + ! + WHERE (XDIRFLASWD.LT.0.0) + XDIRFLASWD=0.0 + ENDWHERE + ! + WHERE (XDIRFLASWD.GT.1500.0) + XDIRFLASWD=1500.0 + ENDWHERE + ! + WHERE (XSCAFLASWD.LT.0.0) + XSCAFLASWD=0.0 + ENDWHERE + ! + WHERE (XSCAFLASWD.GT.1500.0) + XSCAFLASWD=1500.0 + ENDWHERE + ! + WHERE( XDIRFLASWD(:,:,1) + XSCAFLASWD(:,:,1) >0. ) + XALBUV(:,:) = ( XDIR_ALB(:,:,1) * XDIRFLASWD(:,:,1) & + + XSCA_ALB(:,:,1) * XSCAFLASWD(:,:,1) ) & + / (XDIRFLASWD(:,:,1) + XSCAFLASWD(:,:,1) ) + ELSEWHERE + XALBUV(:,:) = XDIR_ALB(:,:,1) + END WHERE +! + END SELECT +! + CALL SECOND_MNH2(ZTIME2) +! + PRAD = PRAD + ZTIME2 - ZTIME1 +! + ZTIME1 = ZTIME2 +! + CALL SURF_RAD_MODIF (XMAP, XXHAT, XYHAT, & + ZCOSZEN, ZSINZEN, ZAZIMSOL, XZS, XZS_XY, & + XDIRFLASWD, XDIRSRFSWD ) +! +!* Azimuthal angle to be sent later to surface processes +! Defined in radian, clockwise, from North +! + XAZIM = ZAZIMSOL +! + CALL SECOND_MNH2(ZTIME2) +! + PSHADOWS = PSHADOWS + ZTIME2 - ZTIME1 +! + ZTIME1 = ZTIME2 +! + DEALLOCATE(ZCOSZEN) + DEALLOCATE(ZSINZEN) + DEALLOCATE(ZAZIMSOL) +! +END IF +! +! +!* 1.4 control prints +! -------------- +! +!* 1.5 Radiative tendency integration +! ------------------------------ +! +IF (CRAD /='NONE') THEN + if ( TBUCONF%LBUDGET_th ) call Budget_store_init( TBUDGETS(NBUDGET_TH), 'RAD', xrths(:, :, :) ) + XRTHS(:,:,:) = XRTHS(:,:,:) + XRHODJ(:,:,:)*XDTHRAD(:,:,:) + if ( TBUCONF%LBUDGET_th ) call Budget_store_end ( TBUDGETS(NBUDGET_TH), 'RAD', xrths(:, :, :) ) +END IF +! +! +!* 1.6 Ocean case: +! Sfc turbulent fluxes & Radiative tendency due to SW penetrating ocean +! +IF (LCOUPLES) THEN +ZSFU(:,:)= XSSUFL_C(:,:,1) +ZSFV(:,:)= XSSVFL_C(:,:,1) +ZSFTH(:,:)= XSSTFL_C(:,:,1) +ZSFRV(:,:)=XSSRFL_C(:,:,1) +ELSE +IF (LOCEAN) THEN +! + ALLOCATE( ZIZOCE(IKU)); ZIZOCE(:)=0. + ALLOCATE( ZPROSOL1(IKU)) + ALLOCATE( ZPROSOL2(IKU)) + ALLOCATE(XSSOLA(IIU,IJU)) + ! Time interpolation + JSW = INT(TDTCUR%xtime/REAL(NINFRT)) + ZSWA = TDTCUR%xtime/REAL(NINFRT)-REAL(JSW) + ZSFRV = 0. + ZSFTH = (XSSTFL_T(JSW+1)*(1.-ZSWA)+XSSTFL_T(JSW+2)*ZSWA) + ZSFU = (XSSUFL_T(JSW+1)*(1.-ZSWA)+XSSUFL_T(JSW+2)*ZSWA) + ZSFV = (XSSVFL_T(JSW+1)*(1.-ZSWA)+XSSVFL_T(JSW+2)*ZSWA) +! + ZIZOCE(IKU) = XSSOLA_T(JSW+1)*(1.-ZSWA)+XSSOLA_T(JSW+2)*ZSWA + ZPROSOL1(IKU) = CST%XROC*ZIZOCE(IKU) + ZPROSOL2(IKU) = (1.-CST%XROC)*ZIZOCE(IKU) + IF(NVERB >= 5 ) THEN +! WRITE(ILUOUT,*)'ZSWA JSW TDTCUR XTSTEP FT FU FV SolarR(IKU)', NINFRT, ZSWA,JSW,& +! TDTCUR%xtime, XTSTEP, ZSFTH(2,2), ZSFU(2,2),ZSFV(2,2),ZIZOCE(IKU) + WRITE(ILUOUT,*)'XSSTP1,XSSTP,NINFRT,ZSWA,JSW,TDTCUR%xtime,ZSFT', & + XSSTFL_T(JSW+1),XSSTFL_T(JSW),NINFRT,ZSWA,JSW, TDTCUR%xtime,ZSFTH(2,2) + END IF + if ( TBUCONF%LBUDGET_th ) call Budget_store_init( TBUDGETS(NBUDGET_TH), 'OCEAN', xrths(:, :, :) ) + DO JKM=IKU-1,2,-1 + ZPROSOL1(JKM) = ZPROSOL1(JKM+1)* exp(-XDZZ(2,2,JKM)/CST%XD1) + ZPROSOL2(JKM) = ZPROSOL2(JKM+1)* exp(-XDZZ(2,2,JKM)/CST%XD2) + ZIZOCE(JKM) = (ZPROSOL1(JKM+1)-ZPROSOL1(JKM) + ZPROSOL2(JKM+1)-ZPROSOL2(JKM))/XDZZ(2,2,JKM) + ! Adding to temperature tendency, the solar radiation penetrating in ocean + XRTHS(:,:,JKM) = XRTHS(:,:,JKM) + XRHODJ(:,:,JKM)*ZIZOCE(JKM) + END DO + if ( TBUCONF%LBUDGET_th ) call Budget_store_end ( TBUDGETS(NBUDGET_TH), 'OCEAN', xrths(:, :, :) ) + DEALLOCATE (XSSOLA) + DEALLOCATE( ZIZOCE) + DEALLOCATE (ZPROSOL1) + DEALLOCATE (ZPROSOL2) +END IF! LOCEAN NO LCOUPLES +END IF!NO LCOUPLES +! +! +CALL SECOND_MNH2(ZTIME2) +! +PRAD = PRAD + ZTIME2 - ZTIME1 & + - XTIME_LES_BU_PROCESS - XTIME_BU_PROCESS +! +PTIME_BU = PTIME_BU + XTIME_LES_BU_PROCESS + XTIME_BU_PROCESS +! +! +!----------------------------------------------------------------------------- +! +!* 2. DEEP CONVECTION SCHEME +! ---------------------- +! +ZTIME1 = ZTIME2 +XTIME_BU_PROCESS = 0. +XTIME_LES_BU_PROCESS = 0. +! +CALL SECOND_MNH2(ZTIME1) +! +IF( CDCONV == 'KAFR' .OR. CSCONV == 'KAFR' ) THEN + + if ( TBUCONF%LBUDGET_th ) call Budget_store_init( TBUDGETS(NBUDGET_TH), 'DCONV', xrths(:, :, :) ) + if ( TBUCONF%LBUDGET_rv ) call Budget_store_init( TBUDGETS(NBUDGET_RV), 'DCONV', xrrs (:, :, :, 1) ) + if ( TBUCONF%LBUDGET_rc ) call Budget_store_init( TBUDGETS(NBUDGET_RC), 'DCONV', xrrs (:, :, :, 2) ) + if ( TBUCONF%LBUDGET_ri ) call Budget_store_init( TBUDGETS(NBUDGET_RI), 'DCONV', xrrs (:, :, :, 4) ) + if ( TBUCONF%LBUDGET_sv .and. lchtrans ) then + do jsv = 1, size( xrsvs, 4 ) + call Budget_store_init( TBUDGETS(NBUDGET_SV1 - 1 + jsv), 'DCONV', xrsvs (:, :, :, jsv) ) + end do + end if +! +! test to see if the deep convection scheme should be called +! + GDCONV = .FALSE. +! + CALL DATETIME_DISTANCE(TDTDCONV,TDTCUR,ZTEMP_DIST) + IF( MOD(NINT(ZTEMP_DIST/XTSTEP),NINT(XDTCONV/XTSTEP))==0 ) THEN + TDTDCONV = TDTCUR + GDCONV = .TRUE. + END IF +! + IF( GDCONV ) THEN + IF (CDCONV == 'KAFR' .OR. CSCONV == 'KAFR' ) THEN + ALLOCATE( ZRC(IIU,IJU,IKU) ) + ALLOCATE( ZRI(IIU,IJU,IKU) ) + ALLOCATE( ZWT(IIU,IJU,IKU) ) + ALLOCATE( ZDXDY(IIU,IJU) ) + ! Compute grid area + ZDXDY(:,:) = SPREAD(XDXHAT(1:IIU),2,IJU) * SPREAD(XDYHAT(1:IJU),1,IIU) + ! + IF( LUSERC .AND. LUSERI ) THEN + ZRC(:,:,:) = XRT(:,:,:,2) + ZRI(:,:,:) = XRT(:,:,:,4) + ELSE IF( LUSERC .AND. (.NOT. LUSERI) ) THEN + ZRC(:,:,:) = XRT(:,:,:,2) + ZRI(:,:,:) = 0.0 + ELSE + ZRC(:,:,:) = 0.0 + ZRI(:,:,:) = 0.0 + END IF + WRITE(UNIT=ILUOUT,FMT='(" CONVECTION called for KTCOUNT=",I6)') & + KTCOUNT + IF ( LFORCING .AND. L1D ) THEN + ZWT(:,:,:) = XWTFRC(:,:,:) + ELSE + ZWT(:,:,:) = XWT(:,:,:) + ENDIF + IF (LDUST) CALL DUST_FILTER(XSVT(:,:,:,NSV_DSTBEG:NSV_DSTEND), XRHODREF(:,:,:)) + IF (LSALT) CALL SALT_FILTER(XSVT(:,:,:,NSV_SLTBEG:NSV_SLTEND), XRHODREF(:,:,:)) + IF (LCH_CONV_LINOX) THEN + CALL CONVECTION( XDTCONV, CDCONV, CSCONV, LREFRESH_ALL, LDOWN, NICE, & + LSETTADJ, XTADJD, XTADJS, LDIAGCONV, NENSM, & + XPABST, XZZ, ZDXDY, & + XTHT, XRT(:,:,:,1), ZRC, ZRI, XUT, XVT, & + ZWT,XTKET(:,:,IKB), & + NCOUNTCONV, XDTHCONV, XDRVCONV, XDRCCONV, XDRICONV, & + XPRCONV, XPRSCONV, & + XUMFCONV,XDMFCONV,XMFCONV,XPRLFLXCONV,XPRSFLXCONV, & + XCAPE, NCLTOPCONV, NCLBASCONV, & + LCHTRANS, XSVT, XDSVCONV, & + LUSECHEM, LCH_CONV_SCAV, LCH_CONV_LINOX, & + LDUST, LSALT, & + XRHODREF, XIC_RATE, XCG_RATE ) + ELSE + CALL CONVECTION( XDTCONV, CDCONV, CSCONV, LREFRESH_ALL, LDOWN, NICE, & + LSETTADJ, XTADJD, XTADJS, LDIAGCONV, NENSM, & + XPABST, XZZ, ZDXDY, & + XTHT, XRT(:,:,:,1), ZRC, ZRI, XUT, XVT, & + ZWT,XTKET(:,:,IKB), & + NCOUNTCONV, XDTHCONV, XDRVCONV, XDRCCONV, XDRICONV, & + XPRCONV, XPRSCONV, & + XUMFCONV,XDMFCONV,XMFCONV,XPRLFLXCONV,XPRSFLXCONV, & + XCAPE, NCLTOPCONV, NCLBASCONV, & + LCHTRANS, XSVT, XDSVCONV, & + LUSECHEM, LCH_CONV_SCAV, LCH_CONV_LINOX, & + LDUST, LSALT, & + XRHODREF ) + END IF +! + DEALLOCATE( ZRC ) + DEALLOCATE( ZRI ) + DEALLOCATE( ZWT ) + DEALLOCATE( ZDXDY ) + END IF + END IF +! +! Deep convection tendency integration +! + XRTHS(:,:,:) = XRTHS(:,:,:) + XRHODJ(:,:,:) * XDTHCONV(:,:,:) + XRRS(:,:,:,1) = XRRS(:,:,:,1) + XRHODJ(:,:,:) * XDRVCONV(:,:,:) +! +! +! Aerosols size distribution +! Compute Rg and sigma before tracers convection tendency (for orilam, dust and sea +! salt) +! + + IF ( LCHTRANS ) THEN ! update tracers for chemical transport + IF (LORILAM) ZRSVS(:,:,:,:) = XRSVS(:,:,:,:) ! + IF ((LDUST)) THEN ! dust convective balance + ALLOCATE(ZSIGDST(IIU,IJU,IKU,NMODE_DST)) + ALLOCATE(ZRGDST(IIU,IJU,IKU,NMODE_DST)) + ALLOCATE(ZNDST(IIU,IJU,IKU,NMODE_DST)) + ALLOCATE(ZSVDST(IIU,IJU,IKU,NSV_DST)) + ! + DO JSV=1,NMODE_DST + IMODEIDX = JPDUSTORDER(JSV) + IF (CRGUNITD=="MASS") THEN + ZINIRADIUS(JSV) = XINIRADIUS(IMODEIDX) * EXP(-3.*(LOG(XINISIG(IMODEIDX)))**2) + ELSE + ZINIRADIUS(JSV) = XINIRADIUS(IMODEIDX) + END IF + ZSIGDST(:,:,:,JSV) = XINISIG(IMODEIDX) + ZRGDST(:,:,:,JSV) = ZINIRADIUS(JSV) + ZNDST(:,:,:,JSV) = XN0MIN(IMODEIDX) + ENDDO + ! + DO JSV=NSV_DSTBEG,NSV_DSTEND + ZSVDST(:,:,:,JSV-NSV_DSTBEG+1) = XRSVS(:,:,:,JSV) * XTSTEP / XRHODJ(:,:,:) + ENDDO + CALL PPP2DUST(ZSVDST(IIB:IIE,IJB:IJE,IKB:IKE,:), XRHODREF(IIB:IIE,IJB:IJE,IKB:IKE),& + PSIG3D=ZSIGDST(IIB:IIE,IJB:IJE,IKB:IKE,:), PRG3D=ZRGDST(IIB:IIE,IJB:IJE,IKB:IKE,:), & + PN3D=ZNDST(IIB:IIE,IJB:IJE,IKB:IKE,:)) + END IF + ! + IF ((LSALT)) THEN ! sea salt convective balance + ALLOCATE(ZSIGSLT(IIU,IJU,IKU,NMODE_SLT)) + ALLOCATE(ZRGSLT(IIU,IJU,IKU,NMODE_SLT)) + ALLOCATE(ZNSLT(IIU,IJU,IKU,NMODE_SLT)) + ALLOCATE(ZSVSLT(IIU,IJU,IKU,NSV_SLT)) + ! + DO JSV=1,NMODE_SLT + IMODEIDX = JPSALTORDER(JSV) + IF (CRGUNITS=="MASS") THEN + ZINIRADIUS_SLT(JSV) = XINIRADIUS_SLT(IMODEIDX) * & + EXP(-3.*(LOG(XINISIG_SLT(IMODEIDX)))**2) + ELSE + ZINIRADIUS_SLT(JSV) = XINIRADIUS_SLT(IMODEIDX) + END IF + ZSIGSLT(:,:,:,JSV) = XINISIG_SLT(IMODEIDX) + ZRGSLT(:,:,:,JSV) = ZINIRADIUS_SLT(JSV) + ZNSLT(:,:,:,JSV) = XN0MIN_SLT(IMODEIDX) + ENDDO + ! + DO JSV=NSV_SLTBEG,NSV_SLTEND + ZSVSLT(:,:,:,JSV-NSV_SLTBEG+1) = XRSVS(:,:,:,JSV) * XTSTEP / XRHODJ(:,:,:) + ENDDO + CALL PPP2SALT(ZSVSLT(IIB:IIE,IJB:IJE,IKB:IKE,:), XRHODREF(IIB:IIE,IJB:IJE,IKB:IKE),& + PSIG3D=ZSIGSLT(IIB:IIE,IJB:IJE,IKB:IKE,:), PRG3D=ZRGSLT(IIB:IIE,IJB:IJE,IKB:IKE,:), & + PN3D=ZNSLT(IIB:IIE,IJB:IJE,IKB:IKE,:)) + END IF + ! +! +! Compute convective tendency for all tracers +! + IF (LCHTRANS) THEN + DO JSV = 1, SIZE(XRSVS,4) + XRSVS(:,:,:,JSV) = XRSVS(:,:,:,JSV) + XRHODJ(:,:,:) * XDSVCONV(:,:,:,JSV) + END DO + IF (LORILAM) THEN + DO JSV = NSV_AERBEG,NSV_AEREND + PWETDEPAER(:,:,:,JSV-NSV_AERBEG+1) = XDSVCONV(:,:,:,JSV) * XRHODJ(:,:,:) + XRSVS(:,:,:,JSV) = ZRSVS(:,:,:,JSV) + END DO + END IF + END IF +! + IF ((LDUST).AND.(LCHTRANS)) THEN ! dust convective balance + IF (CPROGRAM == "MESONH") THEN + DO JSV=NSV_DSTBEG,NSV_DSTEND + ZSVDST(:,:,:,JSV-NSV_DSTBEG+1) = XRSVS(:,:,:,JSV) * XTSTEP / XRHODJ(:,:,:) + ENDDO + ELSE + DO JSV=NSV_DSTBEG,NSV_DSTEND + ZSVDST(:,:,:,JSV-NSV_DSTBEG+1) = XSVT(:,:,:,JSV) + ENDDO + ENDIF + CALL DUST2PPP(ZSVDST(IIB:IIE,IJB:IJE,IKB:IKE,:), & + XRHODREF(IIB:IIE,IJB:IJE,IKB:IKE), ZSIGDST(IIB:IIE,IJB:IJE,IKB:IKE,:),& + ZRGDST(IIB:IIE,IJB:IJE,IKB:IKE,:)) + DO JSV=NSV_DSTBEG,NSV_DSTEND + XRSVS(:,:,:,JSV) = ZSVDST(:,:,:,JSV-NSV_DSTBEG+1) * XRHODJ(:,:,:) / XTSTEP + ENDDO + ! + DEALLOCATE(ZSVDST) + DEALLOCATE(ZNDST) + DEALLOCATE(ZRGDST) + DEALLOCATE(ZSIGDST) + END IF + ! + IF ((LSALT).AND.(LCHTRANS)) THEN ! sea salt convective balance + IF (CPROGRAM == "MESONH") THEN + DO JSV=NSV_SLTBEG,NSV_SLTEND + ZSVSLT(:,:,:,JSV-NSV_SLTBEG+1) = XRSVS(:,:,:,JSV) * XTSTEP / XRHODJ(:,:,:) + ENDDO + ELSE + DO JSV=NSV_SLTBEG,NSV_SLTEND + ZSVSLT(:,:,:,JSV-NSV_SLTBEG+1) = XSVT(:,:,:,JSV) + ENDDO + END IF + CALL SALT2PPP(ZSVSLT(IIB:IIE,IJB:IJE,IKB:IKE,:), & + XRHODREF(IIB:IIE,IJB:IJE,IKB:IKE), ZSIGSLT(IIB:IIE,IJB:IJE,IKB:IKE,:),& + ZRGSLT(IIB:IIE,IJB:IJE,IKB:IKE,:)) + DO JSV=NSV_SLTBEG,NSV_SLTEND + XRSVS(:,:,:,JSV) = ZSVSLT(:,:,:,JSV-NSV_SLTBEG+1) * XRHODJ(:,:,:) / XTSTEP + ENDDO + ! + DEALLOCATE(ZSVSLT) + DEALLOCATE(ZNSLT) + DEALLOCATE(ZRGSLT) + DEALLOCATE(ZSIGSLT) + END IF + ! +END IF +! + IF( LUSERC .AND. LUSERI ) THEN + XRRS(:,:,:,2) = XRRS(:,:,:,2) + XRHODJ(:,:,:) * XDRCCONV(:,:,:) + XRRS(:,:,:,4) = XRRS(:,:,:,4) + XRHODJ(:,:,:) * XDRICONV(:,:,:) +! + ELSE IF ( LUSERC .AND. (.NOT. LUSERI) ) THEN +! +! If only cloud water but no cloud ice is used, the convective tendency +! for cloud ice is added to the tendency for cloud water +! + XRRS(:,:,:,2) = XRRS(:,:,:,2) + XRHODJ(:,:,:) * (XDRCCONV(:,:,:) + & + XDRICONV(:,:,:) ) +! and cloud ice is melted +! + XRTHS(:,:,:) = XRTHS(:,:,:) - XRHODJ(:,:,:) * & + ( XP00/XPABST(:,:,:) )**(XRD/XCPD) * CST%XLMTT / XCPD * XDRICONV(:,:,:) +! + ELSE IF ( (.NOT. LUSERC) .AND. (.NOT. LUSERI) ) THEN +! +! If no cloud water and no cloud ice are used the convective tendencies for these +! variables are added to the water vapor tendency +! + XRRS(:,:,:,1) = XRRS(:,:,:,1) + XRHODJ(:,:,:) * (XDRCCONV(:,:,:) + & + XDRICONV(:,:,:) ) +! and all cloud condensate is evaporated +! + XRTHS(:,:,:) = XRTHS(:,:,:) - XRHODJ(:,:,:) / XCPD * ( & + CST%XLVTT * XDRCCONV(:,:,:) + CST%XLSTT * XDRICONV(:,:,:) ) *& + ( XP00 / XPABST(:,:,:) ) ** ( XRD / XCPD ) + END IF + + if ( TBUCONF%LBUDGET_th ) call Budget_store_end( TBUDGETS(NBUDGET_TH), 'DCONV', xrths(:, :, :) ) + if ( TBUCONF%LBUDGET_rv ) call Budget_store_end( TBUDGETS(NBUDGET_RV), 'DCONV', xrrs (:, :, :, 1) ) + if ( TBUCONF%LBUDGET_rc ) call Budget_store_end( TBUDGETS(NBUDGET_RC), 'DCONV', xrrs (:, :, :, 2) ) + if ( TBUCONF%LBUDGET_ri ) call Budget_store_end( TBUDGETS(NBUDGET_RI), 'DCONV', xrrs (:, :, :, 4) ) + if ( TBUCONF%LBUDGET_sv .and. lchtrans ) then + do jsv = 1, size( xrsvs, 4 ) + call Budget_store_end( TBUDGETS(NBUDGET_SV1 - 1 + jsv), 'DCONV', xrsvs (:, :, :, jsv) ) + end do + end if +END IF +! +CALL SECOND_MNH2(ZTIME2) +! +PKAFR = PKAFR + ZTIME2 - ZTIME1 & + - XTIME_LES_BU_PROCESS - XTIME_BU_PROCESS +! +PTIME_BU = PTIME_BU + XTIME_LES_BU_PROCESS + XTIME_BU_PROCESS +! +!----------------------------------------------------------------------------- +! +!* 3. TURBULENT SURFACE FLUXES +! ------------------------ +! +ZTIME1 = ZTIME2 +! +IF (CSURF=='EXTE') THEN + CALL GOTO_SURFEX(IMI) +! + IF( LTRANS ) THEN + XUT(:,:,1+JPVEXT) = XUT(:,:,1+JPVEXT) + XUTRANS + XVT(:,:,1+JPVEXT) = XVT(:,:,1+JPVEXT) + XVTRANS + END IF + ! + ALLOCATE(ZDIR_ALB(IIU,IJU,NSWB_MNH)) + ALLOCATE(ZSCA_ALB(IIU,IJU,NSWB_MNH)) + ALLOCATE(ZEMIS (IIU,IJU,NLWB_MNH)) + ALLOCATE(ZTSRAD (IIU,IJU)) + ! + IKIDM=0 + DO JKID = IMI+1,NMODEL ! min value of the possible kids + IF (IMI == NDAD(JKID) .AND. XWAY(JKID) == 2. .AND. & + CPROGRAM=='MESONH' .AND. & + (CCONF == 'RESTA' .OR. (CCONF == 'START' .AND. KTCOUNT /= 1))) THEN + ! where kids exist, use the two-way output fields (i.e. OMASKkids true) + ! rather than the farther calculations in radiation and convection schemes +! BUG if number of the son does not follow the number of the dad +! IKIDM = JKID-IMI + IKIDM = IKIDM + 1 + IF (LUSERC .AND. ( & + (LSEDIC .AND. CCLOUD(1:3) == 'ICE') .OR. & + (LSEDC .AND. (CCLOUD == 'C2R2' .OR. CCLOUD == 'KHKO')) .OR. & + (MSEDC .AND. CCLOUD=='LIMA') & + )) THEN + WHERE (OMASKkids(:,:) ) + XINPRC(:,:) = ZSAVE_INPRC(:,:,IKIDM) + ENDWHERE + END IF + IF (LUSERR) THEN + WHERE (OMASKkids(:,:) ) + XINPRR(:,:) = ZSAVE_INPRR(:,:,IKIDM) + ENDWHERE + END IF + IF (LUSERS) THEN + WHERE (OMASKkids(:,:) ) + XINPRS(:,:) = ZSAVE_INPRS(:,:,IKIDM) + ENDWHERE + END IF + IF (LUSERG) THEN + WHERE (OMASKkids(:,:) ) + XINPRG(:,:) = ZSAVE_INPRG(:,:,IKIDM) + ENDWHERE + END IF + IF (LUSERH) THEN + WHERE (OMASKkids(:,:) ) + XINPRH(:,:) = ZSAVE_INPRH(:,:,IKIDM) + ENDWHERE + END IF + IF (CDCONV /= 'NONE') THEN + WHERE (OMASKkids(:,:) ) + XPRCONV(:,:) = ZSAVE_PRCONV(:,:,IKIDM) + XPRSCONV(:,:) = ZSAVE_PRSCONV(:,:,IKIDM) + ENDWHERE + END IF + IF (CRAD /= 'NONE') THEN + DO JSWB=1,NSWB_MNH + WHERE (OMASKkids(:,:) ) + XDIRFLASWD(:,:,JSWB) = ZSAVE_DIRFLASWD(:,:,JSWB,IKIDM) + XSCAFLASWD(:,:,JSWB) = ZSAVE_SCAFLASWD(:,:,JSWB,IKIDM) + XDIRSRFSWD(:,:,JSWB) = ZSAVE_DIRSRFSWD(:,:,JSWB,IKIDM) + ENDWHERE + ENDDO + END IF + ENDIF + END DO + ! + IF (IMODSON /= 0 ) THEN + DEALLOCATE( ZSAVE_INPRR,ZSAVE_INPRS,ZSAVE_INPRG,ZSAVE_INPRH) + DEALLOCATE( ZSAVE_INPRC,ZSAVE_PRCONV,ZSAVE_PRSCONV) + DEALLOCATE( ZSAVE_DIRFLASWD,ZSAVE_SCAFLASWD,ZSAVE_DIRSRFSWD) + END IF + CALL GROUND_PARAM_n(YLDIMPHYEX,ZSFTH, ZSFRV, ZSFSV, ZSFCO2, ZSFU, ZSFV, & + ZDIR_ALB, ZSCA_ALB, ZEMIS, ZTSRAD, KTCOUNT, TPFILE ) + ! + IF (LIBM) THEN + WHERE(XIBM_LS(:,:,IKB,1).GT.-XIBM_EPSI) + ZSFTH(:,:)=0. + ZSFRV(:,:)=0. + ZSFU (:,:)=0. + ZSFV (:,:)=0. + ENDWHERE + IF (NSV>0) THEN + DO JSV = 1 , NSV + WHERE(XIBM_LS(:,:,IKB,1).GT.-XIBM_EPSI) ZSFSV(:,:,JSV)=0. + ENDDO + ENDIF + ENDIF + ! + IF (SIZE(XEMIS)>0) THEN + XDIR_ALB = ZDIR_ALB + XSCA_ALB = ZSCA_ALB + XEMIS = ZEMIS + XTSRAD = ZTSRAD + END IF + ! + DEALLOCATE(ZDIR_ALB) + DEALLOCATE(ZSCA_ALB) + DEALLOCATE(ZEMIS ) + DEALLOCATE(ZTSRAD ) + ! + ! + IF( LTRANS ) THEN + XUT(:,:,1+JPVEXT) = XUT(:,:,1+JPVEXT) - XUTRANS + XVT(:,:,1+JPVEXT) = XVT(:,:,1+JPVEXT) - XVTRANS + END IF +! +ELSE ! case no SURFEX (CSURF logical) + ZSFSV = 0. + ZSFCO2 = 0. + IF (.NOT.LOCEAN) THEN + ZSFTH = 0. + ZSFRV = 0. + ZSFSV = 0. + ZSFCO2 = 0. + ZSFU = 0. + ZSFV = 0. + END IF +END IF !CSURF +! +CALL SECOND_MNH2(ZTIME2) +! +PGROUND = PGROUND + ZTIME2 - ZTIME1 +! +!----------------------------------------------------------------------------- +! +!* 3.1 EDDY FLUXES PARAMETRIZATION +! ------------------ +! +IF (IMI==1) THEN ! On calcule les flus turb. comme preconise par PP + + ! Heat eddy fluxes + IF ( LTH_FLX ) CALL EDDY_FLUX_n(IMI,KTCOUNT,XVT,XTHT,XRHODJ,XRTHS,XVTH_FLUX_M,XWTH_FLUX_M) + ! + ! Momentum eddy fluxes + IF ( LUV_FLX ) CALL EDDYUV_FLUX_n(IMI,KTCOUNT,XVT,XTHT,XRHODJ,XRHODREF,XPABSM,XRVS,XVU_FLUX_M) + +ELSE + ! TEST pour maille infèrieure à 20km ? + ! car pb d'instabilités ? + ! Pour le modèle fils, on spawne les flux du modèle père + ! Heat eddy fluxes + IF ( LTH_FLX ) CALL EDDY_FLUX_ONE_WAY_n (IMI,KTCOUNT,NDXRATIO_ALL(IMI),NDYRATIO_ALL(IMI),CLBCX,CLBCY) + ! + ! Momentum eddy fluxes + IF ( LUV_FLX ) CALL EDDYUV_FLUX_ONE_WAY_n (IMI,KTCOUNT,NDXRATIO_ALL(IMI),NDYRATIO_ALL(IMI),CLBCX,CLBCY) + ! +END IF +!----------------------------------------------------------------------------- +! +!* 4. PASSIVE POLLUTANTS +! ------------------ +! +ZTIME1 = ZTIME2 +! +IF (LPASPOL) CALL PASPOL(XTSTEP, ZSFSV, ILUOUT, NVERB, TPFILE) +! +! +!* 4b. PASSIVE POLLUTANTS FOR MASS-FLUX SCHEME DIAGNOSTICS +! --------------------------------------------------- +! +IF (LCONDSAMP) CALL CONDSAMP(XTSTEP, ZSFSV, ILUOUT, NVERB) +! +CALL SECOND_MNH2(ZTIME2) +! +PTRACER = PTRACER + ZTIME2 - ZTIME1 +!----------------------------------------------------------------------------- +! +!* 5a. Drag force +! ---------- +! +ZTIME1 = ZTIME2 +XTIME_BU_PROCESS = 0. +XTIME_LES_BU_PROCESS = 0. +! +IF (LDRAGTREE) CALL DRAG_VEG( XTSTEP, XUT, XVT, XTKET, LDEPOTREE, XVDEPOTREE, & + CCLOUD, XPABST, XTHT, XRT, XSVT, XRHODJ, XZZ, & + XRUS, XRVS, XRTKES, XRRS, XRSVS ) +! +IF (LDRAGBLDG) CALL DRAG_BLD( XTSTEP, XUT, XVT, XTKET, XRHODJ, XZZ, XRUS, XRVS, XRTKES ) +! +CALL SECOND_MNH2(ZTIME2) +! +PDRAG = PDRAG + ZTIME2 - ZTIME1 & + - XTIME_LES_BU_PROCESS - XTIME_BU_PROCESS +! +PTIME_BU = PTIME_BU + XTIME_LES_BU_PROCESS + XTIME_BU_PROCESS +! +!* 5b. Drag force from wind turbines +! ----------------------- +! +ZTIME1 = ZTIME2 +XTIME_BU_PROCESS = 0. +XTIME_LES_BU_PROCESS = 0. +! +IF (LMAIN_EOL .AND. IMI == NMODEL_EOL) THEN + CALL EOL_MAIN(KTCOUNT,XTSTEP, & + XDXX,XDYY,XDZZ, & + XRHODJ, & + XUT,XVT,XWT, & + XRUS, XRVS, XRWS ) +END IF +! +CALL SECOND_MNH2(ZTIME2) +! +PEOL = PEOL + ZTIME2 - ZTIME1 & + - XTIME_LES_BU_PROCESS - XTIME_BU_PROCESS +! +PTIME_BU = PTIME_BU + XTIME_LES_BU_PROCESS + XTIME_BU_PROCESS +! +!* +!----------------------------------------------------------------------------- +! +!* 6. TURBULENCE SCHEME +! ----------------- +! +ZTIME1 = ZTIME2 +XTIME_BU_PROCESS = 0. +XTIME_LES_BU_PROCESS = 0. +! +ZSFTH(:,:) = ZSFTH(:,:) * XDIRCOSZW(:,:) +ZSFRV(:,:) = ZSFRV(:,:) * XDIRCOSZW(:,:) +DO JSV=1,NSV + ZSFSV(:,:,JSV) = ZSFSV(:,:,JSV) * XDIRCOSZW(:,:) +END DO +! +IF (LLES_CALL) CALL SWITCH_SBG_LES_n +! +! +IF ( CTURB == 'TKEL' ) THEN +! + +!* 6.1 complete surface flux fields on the border +! +!!$ IF(NHALO == 1) THEN + CALL ADD2DFIELD_ll( TZFIELDS_ll, ZSFTH, 'PHYS_PARAM_n::ZSFTH' ) + CALL ADD2DFIELD_ll( TZFIELDS_ll, ZSFRV, 'PHYS_PARAM_n::ZSFRV' ) + CALL ADD2DFIELD_ll( TZFIELDS_ll, ZSFU, 'PHYS_PARAM_n::ZSFU' ) + CALL ADD2DFIELD_ll( TZFIELDS_ll, ZSFV, 'PHYS_PARAM_n::ZSFV' ) + IF(NSV >0)THEN + DO JSV=1,NSV + write ( ynum, '( I6 ) ' ) jsv + CALL ADD2DFIELD_ll( TZFIELDS_ll, ZSFSV(:,:,JSV), 'PHYS_PARAM_n::ZSFSV:'//trim( adjustl( ynum ) ) ) + END DO + END IF + CALL ADD2DFIELD_ll( TZFIELDS_ll, ZSFCO2, 'PHYS_PARAM_n::ZSFCO2' ) + CALL UPDATE_HALO_ll(TZFIELDS_ll,IINFO_ll) + CALL CLEANLIST_ll(TZFIELDS_ll) +!!$ END IF +! + CALL MPPDB_CHECK2D(ZSFU,"phys_param::ZSFU",PRECISION) + ! + IF ( CLBCX(1) /= "CYCL" .AND. LWEST_ll()) THEN + ZSFTH(IIB-1,:)=ZSFTH(IIB,:) + ZSFRV(IIB-1,:)=ZSFRV(IIB,:) + ZSFU(IIB-1,:)=ZSFU(IIB,:) + ZSFV(IIB-1,:)=ZSFV(IIB,:) + IF (NSV>0) THEN + ZSFSV(IIB-1,:,:)=ZSFSV(IIB,:,:) + WHERE ((ZSFSV(IIB-1,:,:).LT.0.).AND.(XSVT(IIB-1,:,IKB,:).EQ.0.)) + ZSFSV(IIB-1,:,:) = 0. + END WHERE + ENDIF + ZSFCO2(IIB-1,:)=ZSFCO2(IIB,:) + END IF + ! + IF ( CLBCX(2) /= "CYCL" .AND. LEAST_ll()) THEN + ZSFTH(IIE+1,:)=ZSFTH(IIE,:) + ZSFRV(IIE+1,:)=ZSFRV(IIE,:) + ZSFU(IIE+1,:)=ZSFU(IIE,:) + ZSFV(IIE+1,:)=ZSFV(IIE,:) + IF (NSV>0) THEN + ZSFSV(IIE+1,:,:)=ZSFSV(IIE,:,:) + WHERE ((ZSFSV(IIE+1,:,:).LT.0.).AND.(XSVT(IIE+1,:,IKB,:).EQ.0.)) + ZSFSV(IIE+1,:,:) = 0. + END WHERE + ENDIF + ZSFCO2(IIE+1,:)=ZSFCO2(IIE,:) + END IF + ! + IF ( CLBCY(1) /= "CYCL" .AND. LSOUTH_ll()) THEN + ZSFTH(:,IJB-1)=ZSFTH(:,IJB) + ZSFRV(:,IJB-1)=ZSFRV(:,IJB) + ZSFU(:,IJB-1)=ZSFU(:,IJB) + ZSFV(:,IJB-1)=ZSFV(:,IJB) + IF (NSV>0) THEN + ZSFSV(:,IJB-1,:)=ZSFSV(:,IJB,:) + WHERE ((ZSFSV(:,IJB-1,:).LT.0.).AND.(XSVT(:,IJB-1,IKB,:).EQ.0.)) + ZSFSV(:,IJB-1,:) = 0. + END WHERE + ENDIF + ZSFCO2(:,IJB-1)=ZSFCO2(:,IJB) + END IF + ! + IF ( CLBCY(2) /= "CYCL" .AND. LNORTH_ll()) THEN + ZSFTH(:,IJE+1)=ZSFTH(:,IJE) + ZSFRV(:,IJE+1)=ZSFRV(:,IJE) + ZSFU(:,IJE+1)=ZSFU(:,IJE) + ZSFV(:,IJE+1)=ZSFV(:,IJE) + IF (NSV>0) THEN + ZSFSV(:,IJE+1,:)=ZSFSV(:,IJE,:) + WHERE ((ZSFSV(:,IJE+1,:).LT.0.).AND.(XSVT(:,IJE+1,IKB,:).EQ.0.)) + ZSFSV(:,IJE+1,:) = 0. + END WHERE + ENDIF + ZSFCO2(:,IJE+1)=ZSFCO2(:,IJE) + END IF +! + IF( LTRANS ) THEN + XUT(:,:,:) = XUT(:,:,:) + XUTRANS + XVT(:,:,:) = XVT(:,:,:) + XVTRANS + END IF +! +! +IF(ALLOCATED(XTHW_FLUX)) THEN + DEALLOCATE(XTHW_FLUX) + ALLOCATE(XTHW_FLUX(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3))) +ELSE + ALLOCATE(XTHW_FLUX(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3))) +END IF + +IF(ALLOCATED(XRCW_FLUX)) THEN + DEALLOCATE(XRCW_FLUX) + ALLOCATE(XRCW_FLUX(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3))) +ELSE + ALLOCATE(XRCW_FLUX(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3))) +END IF +! +IF(ALLOCATED(XSVW_FLUX)) THEN + DEALLOCATE(XSVW_FLUX) + ALLOCATE(XSVW_FLUX(SIZE(XSVT,1),SIZE(XSVT,2),SIZE(XSVT,3),SIZE(XSVT,4))) +ELSE + ALLOCATE(XSVW_FLUX(SIZE(XSVT,1),SIZE(XSVT,2),SIZE(XSVT,3),SIZE(XSVT,4))) +END IF +! +GCOMPUTE_SRC=SIZE(XSIGS, 3)/=0 +! +ALLOCATE(ZTDIFF(IIU,IJU,IKU)) +ALLOCATE(ZTDISS(IIU,IJU,IKU)) +! +!! Compute Shape of sfc flux for Oceanic Deep Conv Case +! +IF (LOCEAN .AND. LDEEPOC) THEN + ALLOCATE(ZDIST(IIU,IJU)) + !* COMPUTES THE PHYSICAL SUBDOMAIN BOUNDS + ALLOCATE(ZXHAT_ll(NIMAX_ll+2*JPHEXT),ZYHAT_ll(NJMAX_ll+2*JPHEXT)) + !compute ZXHAT_ll = position in the (0:Lx) domain 1 (Lx=Size of domain1 ) + !compute XXHAT_ll = position in the (L0_subproc,Lx_subproc) domain for the current subproc + ! L0_subproc as referenced in the full domain 1 + CALL GATHERALL_FIELD_ll('XX',XXHAT,ZXHAT_ll,IRESP) + CALL GATHERALL_FIELD_ll('YY',XYHAT,ZYHAT_ll,IRESP) + CALL GET_DIM_EXT_ll('B',IIU,IJU) + DO JJ = IJB,IJE + DO JI = IIB,IIE + ZDIST(JI,JJ) = SQRT( & + (( (XXHAT(JI)+XXHAT(JI+1))*0.5 - XCENTX_OC ) / XRADX_OC)**2 + & + (( (XYHAT(JJ)+XYHAT(JJ+1))*0.5 - XCENTY_OC ) / XRADY_OC)**2 & + ) + END DO + END DO + DO JJ=IJB,IJE + DO JI=IIB,IIE + IF ( ZDIST(JI,JJ) > 1.) ZSFTH(JI,JJ)=0. + END DO + END DO +END IF !END DEEP OCEAN CONV CASE +! +IF(LLEONARD) THEN + IGRADIENTS=6 + ALLOCATE(ZHGRAD(IIU,IJU,IKU,IGRADIENTS)) + ZHGRAD(:,:,:,1) = GX_W_UW(XWT(:,:,:), XDXX,XDZZ,XDZX,1,IKU,1) + ZHGRAD(:,:,:,2) = GY_W_VW(XWT(:,:,:), XDXX,XDZZ,XDZX,1,IKU,1) + ZHGRAD(:,:,:,3) = GX_M_M(XTHT(:,:,:), XDXX,XDZZ,XDZX,1,IKU,1) + ZHGRAD(:,:,:,4) = GY_M_M(XTHT(:,:,:), XDXX,XDZZ,XDZX,1,IKU,1) + ZHGRAD(:,:,:,5) = GX_M_M(XRT(:,:,:,1), XDXX,XDZZ,XDZX,1,IKU,1) + ZHGRAD(:,:,:,6) = GY_M_M(XRT(:,:,:,1), XDXX,XDZZ,XDZX,1,IKU,1) +END IF + CALL TURB( CST,CSTURB, TBUCONF, TURBN, NEBN, YLDIMPHYEX,TLES, & + IMI, NRR, NRRL, NRRI, CLBCX, CLBCY, IGRADIENTS, NHALO, & + 1, NMODEL_CLOUD, & + NSV, NSV_LGBEG, NSV_LGEND,CPROGRAM, & + NSV_LIMA_NR, NSV_LIMA_NS, NSV_LIMA_NG, NSV_LIMA_NH, & + L2D, LNOMIXLG,LFLAT, & + LCOUPLES, LBLOWSNOW, LIBM, & + GCOMPUTE_SRC, XRSNOW, & + LOCEAN, LDEEPOC, LDIAG_IN_RUN, & + CTURBLEN_CLOUD, CCLOUD, & + XTSTEP, TPFILE, & + XDXX, XDYY, XDZZ, XDZX, XDZY, XZZ, & + XDIRCOSXW, XDIRCOSYW, XDIRCOSZW, XCOSSLOPE, XSINSLOPE, & + XRHODJ, XTHVREF, ZHGRAD, XZS, & + ZSFTH, ZSFRV, ZSFSV, ZSFU, ZSFV, & + XPABST, XUT, XVT, XWT, XTKET, XSVT, XSRCT, & + ZLENGTHM, ZLENGTHH, ZMFMOIST, & + XBL_DEPTH, XSBL_DEPTH, & + XCEI, XCEI_MIN, XCEI_MAX, XCOEF_AMPL_SAT, & + XTHT, XRT, & + XRUS, XRVS, XRWS, XRTHS, XRRS, XRSVS, XRTKES, XSIGS, XWTHVMF, & + XTHW_FLUX, XRCW_FLUX, XSVW_FLUX,XDYP, XTHP, ZTDIFF, ZTDISS, & + TBUDGETS, KBUDGETS=SIZE(TBUDGETS),PLEM=XLEM,PRTKEMS=XRTKEMS, & + PTR=XTR, PDISS=XDISS, PCURRENT_TKE_DISS=XCURRENT_TKE_DISS, & + PIBM_LS=XIBM_LS(:,:,:,1), PIBM_XMUT=XIBM_XMUT, & + PSSTFL=XSSTFL, PSSTFL_C=XSSTFL_C, PSSRFL_C=XSSRFL_C, & + PSSUFL_C=XSSUFL_C, PSSVFL_C=XSSVFL_C, PSSUFL=XSSUFL, PSSVFL=XSSVFL ) +! +DEALLOCATE(ZTDIFF) +DEALLOCATE(ZTDISS) +IF(LLEONARD) DEALLOCATE(ZHGRAD) +! +IF (LRMC01) THEN + CALL ADD2DFIELD_ll( TZFIELDS_ll, XSBL_DEPTH, 'PHYS_PARAM_n::XSBL_DEPTH' ) + CALL UPDATE_HALO_ll(TZFIELDS_ll,IINFO_ll) + CALL CLEANLIST_ll(TZFIELDS_ll) + IF ( CLBCX(1) /= "CYCL" .AND. LWEST_ll()) THEN + XSBL_DEPTH(IIB-1,:)=XSBL_DEPTH(IIB,:) + END IF + IF ( CLBCX(2) /= "CYCL" .AND. LEAST_ll()) THEN + XSBL_DEPTH(IIE+1,:)=XSBL_DEPTH(IIE,:) + END IF + IF ( CLBCY(1) /= "CYCL" .AND. LSOUTH_ll()) THEN + XSBL_DEPTH(:,IJB-1)=XSBL_DEPTH(:,IJB) + END IF + IF ( CLBCY(2) /= "CYCL" .AND. LNORTH_ll()) THEN + XSBL_DEPTH(:,IJE+1)=XSBL_DEPTH(:,IJE) + END IF +END IF +! +CALL SECOND_MNH2(ZTIME3) +! +!----------------------------------------------------------------------------- +! +!* 7. EDMF SCHEME +! ----------- +! +IF (CSCONV == 'EDKF') THEN + ALLOCATE(ZEXN (IIU,IJU,IKU)) + ALLOCATE(ZSIGMF (IIU,IJU,IKU)) + ZSIGMF(:,:,:)=0. + ZEXN(:,:,:)=(XPABST(:,:,:)/XP00)**(XRD/XCPD) + !$20131113 check3d on ZEXN + CALL MPPDB_CHECK3D(ZEXN,"physparan.7::ZEXN",PRECISION) + CALL ADD3DFIELD_ll( TZFIELDS_ll, ZEXN, 'PHYS_PARAM_n::ZEXN' ) + !$20131113 add update_halo_ll + CALL UPDATE_HALO_ll(TZFIELDS_ll,IINFO_ll) + CALL CLEANLIST_ll(TZFIELDS_ll) + CALL MPPDB_CHECK3D(ZEXN,"physparam.7::ZEXN",PRECISION) + ! + CALL SHALLOW_MF_PACK(NRR,NRRL,NRRI, & + TPFILE,ZTIME_LES_MF, & + XTSTEP, & + XDZZ, XZZ,XDXHAT(1),XDYHAT(1), & + XRHODJ, XRHODREF, XPABST, ZEXN, ZSFTH, ZSFRV, & + XTHT,XRT,XUT,XVT,XTKET,XSVT, & + XRTHS,XRRS,XRUS,XRVS,XRSVS, & + ZSIGMF,XRC_MF, XRI_MF, XCF_MF, XWTHVMF) +! +ELSE + XWTHVMF(:,:,:)=0. + XRC_MF(:,:,:)=0. + XRI_MF(:,:,:)=0. + XCF_MF(:,:,:)=0. +ENDIF +! +CALL SECOND_MNH2(ZTIME4) + + IF( LTRANS ) THEN + XUT(:,:,:) = XUT(:,:,:) - XUTRANS + XVT(:,:,:) = XVT(:,:,:) - XVTRANS + END IF + IF (CMF_CLOUD == 'STAT') THEN + XSIGS =SQRT( XSIGS**2 + ZSIGMF**2 ) + ENDIF + IF (CSCONV == 'EDKF') THEN + DEALLOCATE(ZSIGMF) + DEALLOCATE(ZEXN) + ENDIF +END IF +! +IF (LLES_CALL) CALL SWITCH_SBG_LES_n +! +CALL SECOND_MNH2(ZTIME2) +! +PTURB = PTURB + ZTIME2 - ZTIME1 - (XTIME_LES-ZTIME_LES_MF) - XTIME_LES_BU_PROCESS & + - XTIME_BU_PROCESS - (ZTIME4 - ZTIME3) +! +PMAFL = PMAFL + ZTIME4 - ZTIME3 - ZTIME_LES_MF +! +PTIME_BU = PTIME_BU + XTIME_LES_BU_PROCESS + XTIME_BU_PROCESS +! +! +!------------------------------------------------------------------------------- +! +!* deallocation of variables used in more than one parameterization +! +DEALLOCATE(ZSFU ) ! surface schemes + turbulence +DEALLOCATE(ZSFV ) +DEALLOCATE(ZSFTH ) +DEALLOCATE(ZSFRV ) +DEALLOCATE(ZSFSV ) +DEALLOCATE(ZSFCO2) +! +!------------------------------------------------------------------------------- +! +END SUBROUTINE PHYS_PARAM_n + diff --git a/src/mesonh/ext/prep_ideal_case.f90 b/src/mesonh/ext/prep_ideal_case.f90 new file mode 100644 index 0000000000000000000000000000000000000000..3dc623542ad9ff27d4acf04ee1dc28e30e343be1 --- /dev/null +++ b/src/mesonh/ext/prep_ideal_case.f90 @@ -0,0 +1,1946 @@ +!MNH_LIC Copyright 1994-2021 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. +!----------------------------------------------------------------- +! ####################### + PROGRAM PREP_IDEAL_CASE +! ####################### +! +!!**** *PREP_IDEAL_CASE* - program to write an initial FM-file +!! +!! PURPOSE +!! ------- +! The purpose of this program is to prepare an initial meso-NH file +! (LFIFM and DESFM files) filled with some idealized fields. +! +! ---- The present version can provide two types of fields: +! +! 1) CIDEAL = 'CSTN' : 3D fields derived from a vertical profile with +! --------------- n levels of constant moist Brunt Vaisala frequency +! The vertical profile is read in EXPRE file. +! These fields can be used for model runs +! +! 2) CIDEAL = 'RSOU' : 3D fields derived from a radiosounding. +! --------------- +! The radiosounding is read in EXPRE file. +! The following kind of data is permitted : +! YKIND = 'STANDARD' : Zsol, Psol, Tsol, TDsol +! (Pressure, dd, ff) , +! (Pressure, T, Td) +! YKIND = 'PUVTHVMR' : zsol, Psol, Thvsol, Rsol +! (Pressure, U, V) , +! (Pressure, THv, R) +! YKIND = 'PUVTHVHU' : zsol, Psol, Thvsol, Husol +! (Pressure, U, V) , +! (Pressure, THv, Hu) +! YKIND = 'ZUVTHVHU' : zsol, Psol, Thvsol, Husol +! (height, U, V) , +! (height, THv, Hu) +! YKIND = 'ZUVTHVMR' : zsol, Psol, Thvsol, Rsol +! (height, U, V) , +! (height, THv, R) +! YKIND = 'PUVTHDMR' : zsol, Psol, Thdsol, Rsol +! (Pressure, U, V) , +! (Pressure, THd, R) +! YKIND = 'PUVTHDHU' : zsol, Psol, Thdsol, Husol +! (Pressure, U, V) , +! (Pressure, THd, Hu) +! YKIND = 'ZUVTHDMR' : zsol, Psol, Thdsol, Rsol +! (height, U, V) , +! (height, THd, R) +! YKIND = 'ZUVTHLMR' : zsol, Psol, Thdsol, Rsol +! (height, U, V) , +! (height, THl, Rt) +! +! These fields can be used for model runs +! +! Cases (1) and (2) can be balanced +! (geostrophic, hydrostatic and anelastic balances) if desired. +! +! ---- The orography can be flat (YZS='FLAT'), but also +! sine-shaped (YZS='SINE') or bell-shaped (YZS='BELL') +! +! ---- The U(z) profile given in the RSOU and CSTN cases can +! be multiplied (CUFUN="Y*Z") by a function of y (function FUNUY) +! The V(z) profile given in the RSOU and CSTN cases can +! be multiplied (CVFUN="X*Z") by a function of x (function FUNVX). +! If it is not the case, i.e. U(y,z)=U(z) then CUFUN="ZZZ" and +! CVFUN="ZZZ" for V(y,z)=V(z). Instead of these separable forms, +! non-separables functions FUNUYZ (CUFUN="Y,Z") and FUNVXZ (CVFUN="X,Z") +! can be used to specify the wind components. +! +!!** METHOD +!! ------ +!! The directives and data to perform the preparation of the initial FM +!! file are stored in EXPRE file. This file is composed of two parts : +!! - a namelists-format part which is present in all cases +!! - a free-format part which contains data in cases +!! of discretised orography (CZS='DATA') +!! of radiosounding (CIDEAL='RSOU') or Nv=cste profile (CIDEAL='CSTN') +!! of forced version (LFORCING=.TRUE.) +!! +!! +!! The following PREP_IDEAL_CASE program : +!! +!! - initializes physical constants by calling INI_CST +!! +!! - sets default values for global variables which will be +!! written in DESFM file and for variables in EXPRE file (namelists part) +!! which will be written in LFIFM file. +!! +!! - reads the namelists part of EXPRE file which gives +!! informations about the preinitialization to perform, +!! +!! - allocates memory for arrays, +!! +!! - initializes fields depending on the +!! directives (CIDEAL in namelist NAM_CONF_PRE) : +!! +!! * grid variables : +!! The gridpoints are regularly spaced by XDELTAX, XDELTAY. +!! The grid is stretched along the z direction, the mesh varies +!! from XDZGRD near the ground to XDZTOP near the top and the +!! weigthing function is a TANH function characterized by its +!! center and width above and under this center +!! The orography is initialized following the kind of orography +!! (YZS in namelist NAM_CONF_PRE) and the degrees of freedom : +!! sine-shape ---> ZHMAX, IEXPX,IEXPY +!! bell-shape ---> ZHMAX, ZAX,ZAY,IIZS,IJZS +!! The horizontal grid variables are initialized following +!! the kind of geometry (LCARTESIAN in namelist NAM_CONF_PRE) +!! and the grid parameters XLAT0,XLON0,XBETA in both geometries +!! and XRPK,XLONORI,XLATORI in conformal projection. +!! In the case of initialization from a radiosounding, the +!! date and time is read in free-part of the EXPRE file. In other +!! cases year, month and day are set to NUNDEF and time to 0. +!! +!! * prognostic fields : +!! +!! U,V,W, Theta and r. are first determined. They are +!! multiplied by rhoj after the anelastic reference state +!! computation. +!! For the CSTN and RSOU cases, the determination of +!! Theta and rv is performed respectively by SET_RSOU +!! and by SET_CSTN which call the common routine SET_MASS. +!! These three routines have the following actions : +!! --- The input vertical profile is converted in +!! variables (U,V,thetav,r) and interpolated +!! on a mixed grid (with VERT_COORD) as in PREP_REAL_CASE +!! --- A variation of the u-wind component( x-model axis component) +!! is possible in y direction, a variation of the v-wind component +!! (y-model axis component) is possible in x direction. +!! --- Thetav could be computed with thermal wind balance +!! (LGEOSBAL=.TRUE. with call of SET_GEOSBAL) +!! --- The mass fields (theta and r ) and the wind components are +!! then interpolated on the model grid with orography as in +!! PREP_REAL_CASE with the option LSHIFT +!! --- An anelastic correction is applied in PRESSURE_IN_PREP in +!! the case of non-vanishing orography. +!! +!! * anelastic reference state variables : +!! +!! 1D reference state : +!! RSOU and CSTN cases : rhorefz and thvrefz are computed +!! by SET_REFZ (called by SET_MASS). +!! They are deduced from thetav and r on the model grid +!! without orography. +!! The 3D reference state is computed by SET_REF +!! +!! * The total mass of dry air is computed by TOTAL_DMASS +!! +!! - writes the DESFM file, +!! +!! - writes the LFIFM file . +!! +!! EXTERNAL +!! -------- +!! DEFAULT_DESFM : to set default values for variables which can be +!! contained in DESFM file +!! DEFAULT_EXPRE : to set default values for other global variables +!! which can be contained in namelist-part of EXPRE file +!! Module MODE_GRIDPROJ : contains conformal projection routines +!! SM_GRIDPROJ : to compute some grid variables, in +!! case of conformal projection. +!! Module MODE_GRIDCART : contains cartesian geometry routines +!! SM_GRIDCART : to compute some grid variables, in +!! case of cartesian geometry. +!! SET_RSOU : to initialize mass fields from a radiosounding +!! SET_CSTN : to initialize mass fields from a vertical profile of +!! n layers of Nv=cste +!! SET_REF : to compute rhoJ +!! RESSURE_IN_PREP : to apply an anelastic correction in the case of +!! non-vanishing orography +!! IO_File_open : to open a FM-file (DESFM + LFIFM) +!! WRITE_DESFM : to write the DESFM file +!! WRI_LFIFM : to write the LFIFM file +!! IO_File_close : to close a FM-file (DESFM + LFIFM) +!! +!! MXM,MYM,MZM : Shuman operators +!! WGUESS : to compute W with the continuity equation from +!! the U,V values +!! +!! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODD_PARAMETERS : contains parameters +!! Module MODD_DIM1 : contains dimensions +!! Module MODD_CONF : contains configuration variables for +!! all models +!! Module MODD_CST : contains physical constants +!! Module MODD_GRID : contains grid variables for all models +!! Module MODD_GRID1 : contains grid variables +!! Module MODD_TIME : contains time variables for all models +!! Module MODD_TIME1 : contains time variables +!! Module MODD_REF : contains reference state variables for +!! all models +!! Module MODD_REF1 : contains reference state variables +!! Module MODD_LUNIT : contains variables which concern names +!! and logical unit numbers of files for all models +!! Module MODD_FIELD1 : contains prognostics variables +!! Module MODD_GR_FIELD1 : contains the surface prognostic variables +!! Module MODD_LSFIELD1 : contains Larger Scale fields +!! Module MODD_DYN1 : contains dynamic control variables for model 1 +!! Module MODD_LBC1 : contains lbc control variables for model 1 +!! +!! +!! Module MODN_CONF1 : contains configuration variables for model 1 +!! and the NAMELIST list +!! Module MODN_LUNIT1 : contains variables which concern names +!! and logical unit numbers of files and +!! the NAMELIST list +!! +!! +!! REFERENCE +!! --------- +!! Book2 of MESO-NH documentation (program PREP_IDEAL_CASE) +!! +!! AUTHOR +!! ------ +!! V. Ducrocq *Meteo France* +!! +!! MODIFICATIONS +!! ------------- +!! Original 05/05/94 +!! updated V. Ducrocq 27/06/94 +!! updated P.M. 27/07/94 +!! updated V. Ducrocq 23/08/94 +!! updated V. Ducrocq 01/09/94 +!! namelist changes J. Stein 26/10/94 +!! namelist changes J. Stein 04/11/94 +!! remove the second step of the geostrophic balance 14/11/94 (J.Stein) +!! add grid stretching in the z direction + Larger scale fields + +!! cleaning 6/12/94 (J.Stein) +!! periodize the orography and the grid sizes in the periodic case +!! 19/12/94 (J.Stein) +!! correct a bug in the Larger Scale Fields initialization +!! 19/12/94 (J.Stein) +!! add the vertical grid stretching 02/01/95 (J. Stein) +!! Total mass of dry air computation 02/01/95 (J.P.Lafore) +!! add the 1D switch 13/01/95 (J. Stein) +!! enforce a regular vertical grid if desired 18/01/95 (J. Stein) +!! add the tdtcur initialization 26/01/95 (J. Stein) +!! bug in the test of the type of RS localization 25/02/95 (J. Stein) +!! remove R from the historical variables 16/03/95 (J. Stein) +!! error on the grid stretching 30/06/95 (J. Stein) +!! add the soil fields 01/09/95 (S.Belair) +!! change the streching function and the wind guess +!! (J. Stein and V.Masson) 21/09/95 +!! reset to FALSE LUSERC,..,LUSERH 12/12/95 (J. Stein) +!! enforce the RS localization in 1D and 2D config. +!! + add the 'TSZ0' option for the soil variables 28/01/96 (J. Stein) +!! initialization of domain from center point 31/01/96 (V. Masson) +!! add the constant file reading 05/02/96 (J. Stein) +!! enter vertical model levels values 20/10/95 (T.Montmerle) +!! add LFORCING option 19/02/96 (K. Suhre) +!! modify structure of NAM_CONF_PRE 20/02/96 (J.-P. Pinty) +!! default of the domain center when use of pgd file 12/03/96 (V. Masson) +!! change the surface initialization 20/03/96 ( Stein, +!! Bougeault, Kastendeutsch ) +!! change the DEFAULT_DESFMN CALL 17/04/96 ( Lafore ) +!! set the STORAGE_TYPE to 'TT' (a single instant) 30/04/96 (Stein, +!! Jabouille) +!! new wguess to spread the divergence 15/05/96 (Stein) +!! set LTHINSHELL to TRUE + return to the old wguess 29/08/96 (Stein) +!! MY_NAME and DAD_NAME writing for nesting 30/07/96 (Lafore) +!! MY_NAME and DAD_NAME reading in pgd file 26/09/96 (Masson) +!! and reading of pgd grid in a new routine +!! XXHAT and XYHAT are set to 0. at origine point 02/10/96 (Masson) +!! add LTHINSHELL in namelist NAM_CONF_PRE 08/10/96 (Masson) +!! restores use of TS and T2 26/11/96 (Masson) +!! value XUNDEF for soil and vegetation fields on sea 27/11/96 (Masson) +!! use of HUG and HU2 in both ISBA and TSZ0 cases 04/12/96 (Masson) +!! add initialization of chemical variables 06/08/96 (K. Suhre) +!! add MANUAL option for the terrain elevation 12/12/96 (J.-P. Pinty) +!! set DATA instead of MANUAL for the terrain +!! elevation option +!! add new anelastic equations' systems 29/06/97 (Stein) +!! split mode_lfifm_pgd 29/07/97 (Masson) +!! add directional z0 and subgrid scale orography 31/07/97 (Masson) +!! separates surface treatment in PREP_IDEAL_SURF 15/03/99 (Masson) +!! new PGD fields allocations 15/03/99 (Masson) +!! iterative call to pressure solver 15/03/99 (Masson) +!! removes TSZ0 case 04/01/00 (Masson) +!! parallelization 18/06/00 (Pinty) +!! adaptation for patch approach 02/07/00 (Solmon/Masson) +!! bug in W LB field on Y direction 05/03/01 (Stein) +!! add module MODD_NSV for NSV variable 01/02/01 (D. Gazen) +!! allow namelists in different orders 15/10/01 (I. Mallet) +!! allow LUSERC and LUSERI in 1D configuration 05/06/02 (P. Jabouille) +!! add ZUVTHLMR case (move in set_rsou latter) 05/12/02 Jabouille/Masson +!! move LHORELAX_SV (after INI_NSV) 30/04/04 (Pinty) +!! Correction Parallel bug IBEG & IDEND evalution 13/11/08 J.Escobar +!! add the option LSHIFT for interpolation of 26/10/10 (G.Tanguy) +!! correction for XHAT & parallelizarion of ZSDATA 23/09/11 J.Escobar +!! the vertical profile (as in PREP_REAL_CASE) +!! add use MODI of SURFEX routines 10/10/111 J.Escobar +!! +!! For 2D modeling: +!! Initialization of ADVFRC profiles (SET_ADVFRC) 06/2010 (P.Peyrille) +!! when LDUMMY(2)=T in PRE_IDEA1.nam +!! USE MODDB_ADVFRC_n for grid-nesting 02*2012 (M. Tomasini) +!! LBOUSS in MODD_REF 07/2013 (C.Lac) +!! Correction for ZS in PGD file 04/2014 (G. TANGUY) +!! Bug : remove NC WRITE_HGRID 05/2014 (S. Bielli via J.Escobar ) +!! BUG if ZFRC and ZFRC_ADV or ZFRC_REL are used together 11/2014 (G. Delautier) +!! Bug : detected with cray compiler , +!! missing '&' in continuation string 3/12/2014 J.Escobar +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! 06/2016 (G.Delautier) phasage surfex 8 +!! P.Wautelet : 08/07/2016 : removed MNH_NCWRIT define +!! 01/2018 (G.Delautier) SURFEX 8.1 +! P. Wautelet: 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 07/02/2019: force TYPE to a known value for IO_File_add2list +! P. Wautelet 14/02/2019: remove CLUOUT/CLUOUT0 and associated variables +! P. Wautelet 28/03/2019: use MNHTIME for time measurement variables +! P. Wautelet 28/03/2019: use TFILE instead of unit number for set_iluout_timing +! P. Wautelet 19/04/2019: removed unused dummy arguments and variables +! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function +! P. Wautelet 20/05/2019: add name argument to ADDnFIELD_ll + new ADD4DFIELD_ll subroutine +! F. Auguste 02/2021: add IBM +! P. Wautelet 09/03/2021: move some chemistry initializations to ini_nsv +! Jean-Luc Redelsperger 03/2021: ocean LES case +! P. Wautelet 06/07/2021: use FINALIZE_MNH +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_PARAMETERS ! Declarative modules +USE MODD_ARGSLIST_ll, ONLY : LIST_ll +USE MODD_DIM_n +USE MODD_CONF +USE MODD_CST +USE MODD_GRID +USE MODD_GRID_n +USE MODD_IBM_LSF, ONLY: CIBM_TYPE, LIBM_LSF, NIBM_SMOOTH, XIBM_SMOOTH +USE MODD_IBM_PARAM_n, ONLY: XIBM_LS +USE MODD_METRICS_n +USE MODD_PGDDIM +USE MODD_PGDGRID +USE MODD_TIME +USE MODD_TIME_n +USE MODD_REF +USE MODD_REF_n +USE MODD_LUNIT +USE MODD_FIELD_n +USE MODD_DYN_n +USE MODD_LBC_n +USE MODD_LSFIELD_n +USE MODD_PARAM_n +USE MODD_CH_MNHC_n, ONLY: LUSECHEM, LUSECHAQ, LUSECHIC, LCH_PH, LCH_INIT_FIELD +USE MODD_CH_AEROSOL,ONLY: LORILAM, CORGANIC, LVARSIGI, LVARSIGJ, LINITPM, XINIRADIUSI, & + XINIRADIUSJ, XINISIGI, XINISIGJ, XN0IMIN, XN0JMIN, CRGUNIT +USE MODD_DUST, ONLY: LDUST, NMODE_DST, CRGUNITD, XINISIG, XINIRADIUS, XN0MIN +USE MODD_SALT, ONLY: LSALT, NMODE_SLT, CRGUNITS, XINISIG_SLT, XINIRADIUS_SLT, XN0MIN_SLT +USE MODD_VAR_ll, ONLY: NPROC +USE MODD_LUNIT, ONLY: TLUOUT0, TOUTDATAFILE +USE MODD_LUNIT_n +USE MODD_IO, ONLY: TFILE_DUMMY, TFILE_OUTPUTLISTING +USE MODD_CONF_n +USE MODD_NSV, ONLY: NSV +use modd_precision, only: LFIINT, MNHREAL_MPI, MNHTIME +! +USE MODN_BLANK_n +! +USE MODE_FINALIZE_MNH, only: FINALIZE_MNH +USE MODE_THERMO +USE MODE_POS +USE MODE_GRIDCART ! Executive modules +USE MODE_GRIDPROJ +USE MODE_GATHER_ll +USE MODE_IO, only: IO_Config_set, IO_Init, IO_Pack_set +USE MODE_IO_FIELD_READ, only: IO_Field_read +USE MODE_IO_FIELD_WRITE, only: IO_Field_write, IO_Header_write +USE MODE_IO_FILE, only: IO_File_close, IO_File_open +USE MODE_IO_MANAGE_STRUCT, only: IO_File_add2list +USE MODE_ll +USE MODE_MODELN_HANDLER +use mode_field, only: Alloc_field_scalars, Ini_field_list, Ini_field_scalars +USE MODE_MSG +! +USE MODI_DEFAULT_DESFM_n ! Interface modules +USE MODI_DEFAULT_EXPRE +USE MODI_IBM_INIT_LS +USE MODI_READ_HGRID +USE MODI_SHUMAN +USE MODI_SET_RSOU +USE MODI_SET_CSTN +USE MODI_SET_FRC +USE MODI_PRESSURE_IN_PREP +USE MODI_WRITE_DESFM_n +USE MODI_WRITE_LFIFM_n +USE MODI_METRICS +USE MODI_UPDATE_METRICS +USE MODI_SET_REF +USE MODI_SET_PERTURB +USE MODI_TOTAL_DMASS +USE MODI_CH_INIT_FIELD_n +USE MODI_INI_NSV +USE MODI_READ_PRE_IDEA_NAM_n +USE MODI_ZSMT_PIC +USE MODI_ZSMT_PGD +USE MODI_READ_VER_GRID +USE MODI_READ_ALL_NAMELISTS +USE MODI_PGD_GRID_SURF_ATM +USE MODI_SPLIT_GRID +USE MODI_PGD_SURF_ATM +USE MODI_ICE_ADJUST_BIS +USE MODI_WRITE_PGD_SURF_ATM_n +USE MODI_PREP_SURF_MNH +USE MODI_INIT_SALT +USE MODI_AER2LIMA +USE MODD_PARAM_LIMA +! +!JUAN +USE MODE_SPLITTINGZ_ll +USE MODD_SUB_MODEL_n +USE MODE_MNH_TIMING +USE MODN_CONFZ +!JUAN +! +USE MODI_VERSION +USE MODI_INIT_PGD_SURF_ATM +USE MODI_WRITE_SURF_ATM_N +USE MODD_MNH_SURFEX_n +! Modif ADVFRC +USE MODD_2D_FRC +USE MODD_ADVFRC_n ! Modif for grid-nesting +USE MODI_SETADVFRC +USE MODD_RELFRC_n ! Modif for grid-nesting +USE MODI_SET_RELFRC +! +USE MODE_INI_CST, ONLY: INI_CST +USE MODD_NEB_n, ONLY: NEBN +USE MODI_WRITE_HGRID +USE MODD_MPIF +USE MODD_VAR_ll +USE MODD_IO, ONLY: TFILEDATA,TFILE_SURFEX +! +USE MODE_MPPDB +! +USE MODD_GET_n +! +USE MODN_CONFIO, ONLY : NAM_CONFIO +! +IMPLICIT NONE +! +!* 0.1 Declarations of global variables not declared in the modules +! +REAL, DIMENSION(:,:,:), ALLOCATABLE :: XJ ! Jacobian +REAL :: XLATCEN=XUNDEF, XLONCEN=XUNDEF ! latitude and longitude of the center of + ! the domain for initialization. This + ! point is vertical vorticity point + ! ------------------------ +REAL :: XDELTAX=0.5E4, XDELTAY=0.5E4 ! horizontal mesh lengths + ! used to determine XXHAT,XYHAT +! +INTEGER :: NLUPRE,NLUOUT ! Logical unit numbers for EXPRE file + ! and for output_listing file +INTEGER :: NRESP ! return code in FM routines +INTEGER :: NTYPE ! type of file (cpio or not) +INTEGER(KIND=LFIINT) :: NNPRAR ! number of articles predicted in the LFIFM file +LOGICAL :: GFOUND ! Return code when searching namelist +! +INTEGER :: JLOOP,JILOOP,JJLOOP ! Loop indexes +! +INTEGER :: NIB,NJB,NKB ! Begining useful area in x,y,z directions +INTEGER :: NIE,NJE ! Ending useful area in x,y directions +INTEGER :: NIU,NJU,NKU ! Upper bounds in x,y,z directions +CHARACTER(LEN=4) :: CIDEAL ='CSTN' ! kind of idealized fields + ! 'CSTN' : Nv=cste case + ! 'RSOU' : radiosounding case +CHARACTER(LEN=4) :: CZS ='FLAT' ! orography selector + ! 'FLAT' : zero orography + ! 'SINE' : sine-shaped orography + ! 'BELL' : bell-shaped orography +REAL :: XHMAX=XUNDEF ! Maximum height for orography +REAL :: NEXPX=3,NEXPY=1 ! Exponents for orography in case of CZS='SINE' +REAL :: XAX= 1.E4, XAY=1.E4 ! Widths for orography in case CZS='BELL' + ! along x and y +INTEGER :: NIZS = 5, NJZS = 5 ! Localization of the center in + ! case CZS ='BELL' +! +!* 0.1.1 Declarations of local variables for N=cste and +! radiosounding cases : +! +INTEGER :: NYEAR,NMONTH,NDAY ! year, month and day in EXPRE file +REAL :: XTIME ! time in EXPRE file +LOGICAL :: LPERTURB =.FALSE. ! Logical to add a perturbation to + ! a basic state +LOGICAL :: LGEOSBAL =.FALSE. ! Logical to satisfy the geostrophic + ! balance + ! .TRUE. for geostrophic balance + ! .FALSE. to ignore this balance +LOGICAL :: LSHIFT =.FALSE. ! flag to perform vertical shift or not. +CHARACTER(LEN=3) :: CFUNU ='ZZZ' ! CHARACTER STRING for variation of + ! U in y direction + ! 'ZZZ' : U = U(Z) + ! 'Y*Z' : U = F(Y) * U(Z) + ! 'Y,Z' : U = G(Y,Z) +CHARACTER(LEN=3) :: CFUNV ='ZZZ' ! CHARACTER STRING for variation of + ! V in x direction + ! 'ZZZ' : V = V(Z) + ! 'Y*Z' : V = F(X) * V(Z) + ! 'Y,Z' : V = G(X,Z) +CHARACTER(LEN=6) :: CTYPELOC='IJGRID' ! Type of informations used to give the + ! localization of vertical profile + ! 'IJGRID' for (i,j) point on index space + ! 'XYHATM' for (x,y) coordinates on + ! conformal or cartesian plane + ! 'LATLON' for (latitude,longitude) on + ! spherical earth +REAL :: XLATLOC= 45., XLONLOC=0. + ! Latitude and longitude of the vertical + ! profile localization (used in case + ! CTYPELOC='LATLON') +REAL :: XXHATLOC=2.E4, XYHATLOC=2.E4 + ! (x,y) of the vertical profile + ! localization (used in cases + ! CTYPELOC='LATLON' and 'XYHATM') +INTEGER, DIMENSION(1) :: NILOC=4, NJLOC=4 + ! (i,j) of the vertical profile + ! localization +! +! +REAL,DIMENSION(:,:,:),ALLOCATABLE :: XCORIOZ ! Coriolis parameter (this + ! is exceptionnaly a 3D array + ! for computing needs) +! +! +!* 0.1.2 Declarations of local variables used when a PhysioGraphic Data +! file is used : +! +INTEGER :: JSV ! loop index on scalar var. +CHARACTER(LEN=28) :: CPGD_FILE=' ' ! Physio-Graphic Data file name +LOGICAL :: LREAD_ZS = .TRUE., & ! switch to use orography + ! coming from the PGD file + LREAD_GROUND_PARAM = .TRUE. ! switch to use soil parameters + ! useful for the soil scheme + ! coming from the PGD file + +INTEGER :: NSLEVE =12 ! number of iteration for smooth orography +REAL :: XSMOOTH_ZS = XUNDEF ! optional uniform smooth orography for SLEVE coordinate +CHARACTER(LEN=28) :: YPGD_NAME, YPGD_DAD_NAME ! general information +CHARACTER(LEN=2) :: YPGD_TYPE +! +INTEGER :: IINFO_ll ! return code of // routines +TYPE(LIST_ll), POINTER :: TZ_FIELDS_ll ! list of metric coefficient fields +! +INTEGER :: IISIZEXF,IJSIZEXF,IISIZEXFU,IJSIZEXFU ! dimensions of the +INTEGER :: IISIZEX4,IJSIZEX4,IISIZEX2,IJSIZEX2 ! West-east LB arrays +INTEGER :: IISIZEYF,IJSIZEYF,IISIZEYFV,IJSIZEYFV ! dimensions of the +INTEGER :: IISIZEY4,IJSIZEY4,IISIZEY2,IJSIZEY2 ! North-south LB arrays +INTEGER :: IBEG,IEND,IXOR,IXDIM,IYOR,IYDIM,ILBX,ILBY +REAL, DIMENSION(:), ALLOCATABLE :: ZXHAT_ll, ZYHAT_ll +! +REAL, DIMENSION(:,:,:), ALLOCATABLE ::ZTHL,ZT,ZRT,ZFRAC_ICE,& + ZEXN,ZLVOCPEXN,ZLSOCPEXN,ZCPH, & + ZRSATW, ZRSATI +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZBUF + ! variables for adjustement +REAL :: ZDIST +! +!JUAN TIMING +REAL(kind=MNHTIME), DIMENSION(2) :: ZTIME1, ZTIME2, ZEND, ZTOT +CHARACTER :: YMI +INTEGER :: IMI +!JUAN TIMING +! +REAL, DIMENSION(:), ALLOCATABLE :: ZZS_ll +INTEGER :: IJ +! +REAL :: ZZS_MAX, ZZS_MAX_ll +INTEGER :: IJPHEXT +! +TYPE(TFILEDATA),POINTER :: TZEXPREFILE => NULL() +! +! +!* 0.2 Namelist declarations +! +NAMELIST/NAM_CONF_PRE/ LTHINSHELL,LCARTESIAN, &! Declarations in MODD_CONF + LPACK, &! + NVERB,CIDEAL,CZS, &!+global variables initialized + LBOUSS,LOCEAN,LPERTURB, &! at their declarations + LFORCING,CEQNSYS, &! at their declarations + LSHIFT,L2D_ADV_FRC,L2D_REL_FRC, & + NHALO , JPHEXT +NAMELIST/NAM_GRID_PRE/ XLON0,XLAT0, & ! Declarations in MODD_GRID + XBETA,XRPK, & + XLONORI,XLATORI +NAMELIST/NAM_GRIDH_PRE/ XLATCEN,XLONCEN, & ! local variables initialized + XDELTAX,XDELTAY, & ! at their declarations + XHMAX,NEXPX,NEXPY, & + XAX,XAY,NIZS,NJZS +NAMELIST/NAM_VPROF_PRE/LGEOSBAL, CFUNU,CFUNV, &! global variables initialized + CTYPELOC,XLATLOC,XLONLOC, &! at their declarations + XXHATLOC,XYHATLOC,NILOC,NJLOC +NAMELIST/NAM_REAL_PGD/CPGD_FILE, & ! Physio-Graphic Data file + ! name + LREAD_ZS, & ! switch to use orography + ! coming from the PGD file + LREAD_GROUND_PARAM +NAMELIST/NAM_SLEVE/NSLEVE, XSMOOTH_ZS +! +!* 0.3 Auxillary Namelist declarations +! +NAMELIST/NAM_AERO_PRE/ LORILAM, LINITPM, XINIRADIUSI, XINIRADIUSJ, & + XINISIGI, XINISIGJ, XN0IMIN, XN0JMIN, CRGUNIT, & + LDUST, LSALT, CRGUNITD, CRGUNITS,& + NMODE_DST, XINISIG, XINIRADIUS, XN0MIN,& + XINISIG_SLT, XINIRADIUS_SLT, XN0MIN_SLT, & + NMODE_SLT +! +NAMELIST/NAM_IBM_LSF/ LIBM_LSF, CIBM_TYPE, NIBM_SMOOTH, XIBM_SMOOTH +! +!------------------------------------------------------------------------------- +! +!* 0. PROLOGUE +! -------- +CALL MPPDB_INIT() +! +CALL GOTO_MODEL(1) +! +CALL IO_Init() +NULLIFY(TZ_FIELDS_ll) +CALL VERSION +CPROGRAM='IDEAL ' +! +!JUAN TIMING + XT_START = 0.0_MNHTIME + XT_STORE = 0.0_MNHTIME +! + CALL SECOND_MNH2(ZEND) +! +!JUAN TIMING +! +!* 1. INITIALIZE PHYSICAL CONSTANTS : +! ------------------------------ +! +NVERB = 5 +CALL INI_CST +! +!------------------------------------------------------------------------------- +! +! +!* 2. SET DEFAULT VALUES : +! -------------------- +! +! +!* 2.1 For variables in DESFM file +! +CALL ALLOC_FIELD_SCALARS() +CALL DEFAULT_DESFM_n(1) +! +CSURF = "NONE" +! +! +!* 2.2 For other global variables in EXPRE file +! +CALL DEFAULT_EXPRE +!------------------------------------------------------------------------------- +! +!* 3. READ THE EXPRE FILE : +! -------------------- +! +!* 3.1 initialize logical unit numbers (EXPRE and output-listing files) +! and open these files : +! +! +CALL IO_File_add2list(TLUOUT0,'OUTPUT_LISTING1','OUTPUTLISTING','WRITE') +CALL IO_File_open(TLUOUT0) +NLUOUT = TLUOUT0%NLU +!Set output files for PRINT_MSG +TLUOUT => TLUOUT0 +TFILE_OUTPUTLISTING => TLUOUT0 +! +CALL IO_File_add2list(TZEXPREFILE,'PRE_IDEA1.nam','NML','READ') +CALL IO_File_open(TZEXPREFILE) +NLUPRE=TZEXPREFILE%NLU +! +!* 3.2 read in NLUPRE the namelist informations +! +WRITE(NLUOUT,FMT=*) 'attempt to read ',TRIM(TZEXPREFILE%CNAME),' file' +CALL POSNAM(NLUPRE,'NAM_REAL_PGD',GFOUND,NLUOUT) +IF (GFOUND) READ(UNIT=NLUPRE,NML=NAM_REAL_PGD) +! +! +CALL POSNAM(NLUPRE,'NAM_CONF_PRE',GFOUND,NLUOUT) +IF (GFOUND) READ(UNIT=NLUPRE,NML=NAM_CONF_PRE) +!JUANZ +CALL POSNAM(NLUPRE,'NAM_CONFZ',GFOUND,NLUOUT) +IF (GFOUND) READ(UNIT=NLUPRE,NML=NAM_CONFZ) +!JUANZ +CALL POSNAM(NLUPRE,'NAM_CONFIO',GFOUND,NLUOUT) +IF (GFOUND) READ(UNIT=NLUPRE,NML=NAM_CONFIO) +CALL IO_Config_set() +CALL POSNAM(NLUPRE,'NAM_GRID_PRE',GFOUND,NLUOUT) +IF (GFOUND) READ(UNIT=NLUPRE,NML=NAM_GRID_PRE) +CALL POSNAM(NLUPRE,'NAM_GRIDH_PRE',GFOUND,NLUOUT) +IF (GFOUND) READ(UNIT=NLUPRE,NML=NAM_GRIDH_PRE) +CALL POSNAM(NLUPRE,'NAM_VPROF_PRE',GFOUND,NLUOUT) +IF (GFOUND) READ(UNIT=NLUPRE,NML=NAM_VPROF_PRE) +CALL POSNAM(NLUPRE,'NAM_BLANKN',GFOUND,NLUOUT) +CALL INIT_NAM_BLANKn +IF (GFOUND) THEN + READ(UNIT=NLUPRE,NML=NAM_BLANKn) + CALL UPDATE_NAM_BLANKn +END IF +CALL READ_PRE_IDEA_NAM_n(NLUPRE,NLUOUT) +CALL POSNAM(NLUPRE,'NAM_AERO_PRE',GFOUND,NLUOUT) +IF (GFOUND) READ(UNIT=NLUPRE,NML=NAM_AERO_PRE) +CALL POSNAM(NLUPRE,'NAM_IBM_LSF' ,GFOUND,NLUOUT) +IF (GFOUND) READ(UNIT=NLUPRE,NML=NAM_IBM_LSF ) +! +CALL INI_FIELD_LIST(1) +! +CALL INI_FIELD_SCALARS() +! Sea salt +CALL INIT_SALT +! +IF( LEN_TRIM(CPGD_FILE) /= 0 ) THEN + ! open the PGD_FILE + CALL IO_File_add2list(TPGDFILE,TRIM(CPGD_FILE),'PGD','READ',KLFINPRAR=NNPRAR,KLFITYPE=2,KLFIVERB=NVERB) + CALL IO_File_open(TPGDFILE) + + ! read the grid in the PGD file + CALL IO_Field_read(TPGDFILE,'IMAX', NIMAX) + CALL IO_Field_read(TPGDFILE,'JMAX', NJMAX) + CALL IO_Field_read(TPGDFILE,'JPHEXT',IJPHEXT) + + IF ( CPGD_FILE /= CINIFILEPGD) THEN + WRITE(NLUOUT,FMT=*) ' WARNING : in PRE_IDEA1.nam, in NAM_LUNITn you& + & have CINIFILEPGD= ',CINIFILEPGD + WRITE(NLUOUT,FMT=*) ' whereas in NAM_REAL_PGD you have CPGD_FILE = '& + ,CPGD_FILE + WRITE(NLUOUT,FMT=*) ' ' + WRITE(NLUOUT,FMT=*) ' CINIFILEPGD HAS BEEN SET TO ',CPGD_FILE + CINIFILEPGD=CPGD_FILE + END IF + IF ( IJPHEXT .NE. JPHEXT ) THEN + WRITE(NLUOUT,FMT=*) ' PREP_IDEAL_CASE : JPHEXT in PRE_IDEA1.nam/NAM_CONF_PRE ( or default value )& + & JPHEXT=',JPHEXT + WRITE(NLUOUT,FMT=*) ' different from PGD files=', CINIFILEPGD,' value JPHEXT=',IJPHEXT + WRITE(NLUOUT,FMT=*) '-> JOB ABORTED' + CALL PRINT_MSG(NVERB_FATAL,'GEN','PREP_IDEAL_CASE','') + !WRITE(NLUOUT,FMT=*) ' JPHEXT HAS BEEN SET TO ', IJPHEXT + !IJPHEXT = JPHEXT + END IF +END IF +! +NIMAX_ll=NIMAX !! _ll variables are global variables +NJMAX_ll=NJMAX !! but the old names are kept in PRE_IDEA1.nam file +! +!* 3.3 check some parameters: +! +L1D=.FALSE. ; L2D=.FALSE. +! +IF ((NIMAX == 1).OR.(NJMAX == 1)) THEN + L2D=.TRUE. + NJMAX_ll=1 + NIMAX_ll=MAX(NIMAX,NJMAX) + WRITE(NLUOUT,FMT=*) ' NJMAX HAS BEEN SET TO 1 SINCE 2D INITIAL FILE IS REQUIRED & + & (L2D=TRUE) )' +END IF +! +IF ((NIMAX == 1).AND.(NJMAX == 1)) THEN + L1D=.TRUE. + NIMAX_ll = 1 + NJMAX_ll = 1 + WRITE(NLUOUT,FMT=*) ' 1D INITIAL FILE IS REQUIRED (L1D=TRUE) ' +END IF +! +IF(.NOT. L1D) THEN + LHORELAX_UVWTH=.TRUE. + LHORELAX_RV=.TRUE. +ENDIF +! +NRIMX= MIN(JPRIMMAX,NIMAX_ll/2) +! +IF (L2D) THEN + NRIMY=0 +ELSE + NRIMY= MIN(JPRIMMAX,NJMAX_ll/2) +END IF +! +IF (L1D) THEN + NRIMX=0 + NRIMY=0 +END IF +! +IF (L1D .AND. ( LPERTURB .OR. LGEOSBAL .OR. & + (.NOT. LCARTESIAN ) .OR. (.NOT. LTHINSHELL) ))THEN + LGEOSBAL = .FALSE. + LPERTURB = .FALSE. + LCARTESIAN = .TRUE. + LTHINSHELL = .TRUE. + WRITE(NLUOUT,FMT=*) ' LGEOSBAL AND LPERTURB HAVE BEEN SET TO FALSE & + & AND LCARTESIAN AND LTHINSHELL TO TRUE & + & SINCE 1D INITIAL FILE IS REQUIRED (L1D=TRUE)' +END IF +! +IF (LGEOSBAL .AND. LSHIFT ) THEN + LSHIFT=.FALSE. + WRITE(NLUOUT,FMT=*) ' LSHIFT HAS BEEN SET TO FALSE SINCE & + & LGEOSBAL=.TRUE. IS REQUIRED ' +END IF +! +!* 3.4 compute the number of moist variables : +! +IF (.NOT.LUSERV) THEN + LUSERV = .TRUE. + WRITE(NLUOUT,FMT=*) ' LUSERV HAS BEEN RESET TO TRUE, SINCE A MOIST VARIABLE & + & IS PRESENT IN EXPRE FILE (CIDEAL = RSOU OR CSTN)' +END IF +! +IF((LUSERI .OR. LUSERC).AND. (CIDEAL /= 'RSOU')) THEN + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','PREP_IDEAL_CASE','use of hydrometeors is only allowed in RSOU case') +ENDIF +IF (LUSERI) THEN + LUSERC =.TRUE. + LUSERR =.TRUE. + LUSERI =.TRUE. + LUSERS =.TRUE. + LUSERG =.TRUE. + LUSERH =.FALSE. + CCLOUD='ICE3' +ELSEIF(LUSERC) THEN + LUSERR =.FALSE. + LUSERI =.FALSE. + LUSERS =.FALSE. + LUSERG =.FALSE. + LUSERH =.FALSE. + CCLOUD='REVE' +ELSE + LUSERC =.FALSE. + LUSERR =.FALSE. + LUSERI =.FALSE. + LUSERS =.FALSE. + LUSERG =.FALSE. + LUSERH =.FALSE. + LHORELAX_RC=.FALSE. + LHORELAX_RR=.FALSE. + LHORELAX_RI=.FALSE. + LHORELAX_RS=.FALSE. + LHORELAX_RG=.FALSE. + LHORELAX_RH=.FALSE. + CCLOUD='NONE' +! +END IF +! +NRR=0 +IF (LUSERV) THEN + NRR=NRR+1 + IDX_RVT = NRR +END IF +IF (LUSERC) THEN + NRR=NRR+1 + IDX_RCT = NRR +END IF +IF (LUSERR) THEN + NRR=NRR+1 + IDX_RRT = NRR +END IF +IF (LUSERI) THEN + NRR=NRR+1 + IDX_RIT = NRR +END IF +IF (LUSERS) THEN + NRR=NRR+1 + IDX_RST = NRR +END IF +IF (LUSERG) THEN + NRR=NRR+1 + IDX_RGT = NRR +END IF +IF (LUSERH) THEN + NRR=NRR+1 + IDX_RHT = NRR +END IF +! +! NRR=4 for RSOU case because RI and Rc always computed +IF (CIDEAL == 'RSOU' .AND. NRR < 4 ) NRR=4 +! +! +!* 3.5 Chemistry +! +IF (LORILAM .OR. LCH_INIT_FIELD) THEN + LUSECHEM = .TRUE. + IF (LORILAM) THEN + CORGANIC = "MPMPO" + LVARSIGI = .TRUE. + LVARSIGJ = .TRUE. + END IF +END IF +! initialise NSV_* variables +CALL INI_NSV(1) +LHORELAX_SV(:)=.FALSE. +IF(.NOT. L1D) LHORELAX_SV(1:NSV)=.TRUE. +! +!------------------------------------------------------------------------------- +! +!* 4. ALLOCATE MEMORY FOR ARRAYS : +! ---------------------------- +! +!* 4.1 Vertical Spatial grid +! +CALL READ_VER_GRID(TZEXPREFILE) +! +!* 4.2 Initialize parallel variables and compute array's dimensions +! +! +IF(LGEOSBAL) THEN + CALL SET_SPLITTING_ll('XSPLITTING') ! required for integration of thermal wind balance +ELSE + CALL SET_SPLITTING_ll('BSPLITTING') +ENDIF +CALL SET_JP_ll(1,JPHEXT,JPVEXT,JPHEXT) +CALL SET_DAD0_ll() +CALL SET_DIM_ll(NIMAX_ll, NJMAX_ll, NKMAX) +CALL IO_Pack_set(L1D,L2D,LPACK) +CALL SET_LBX_ll(CLBCX(1), 1) +CALL SET_LBY_ll(CLBCY(1), 1) +CALL SET_XRATIO_ll(1, 1) +CALL SET_YRATIO_ll(1, 1) +CALL SET_XOR_ll(1, 1) +CALL SET_XEND_ll(NIMAX_ll+2*JPHEXT, 1) +CALL SET_YOR_ll(1, 1) +CALL SET_YEND_ll(NJMAX_ll+2*JPHEXT, 1) +CALL SET_DAD_ll(0, 1) +CALL INI_PARAZ_ll(IINFO_ll) +! +! sizes of arrays of the extended sub-domain +! +CALL GET_DIM_EXT_ll('B',NIU,NJU) +CALL GET_DIM_PHYS_ll('B',NIMAX,NJMAX) +CALL GET_INDICE_ll(NIB,NJB,NIE,NJE) +CALL GET_OR_ll('B',IXOR,IYOR) +NKB=1+JPVEXT +NKU=NKMAX+2*JPVEXT +! +!* 4.3 Global variables absent from the modules : +! +ALLOCATE(XJ(NIU,NJU,NKU)) +SELECT CASE(CIDEAL) + CASE('RSOU','CSTN') + IF (LGEOSBAL) ALLOCATE(XCORIOZ(NIU,NJU,NKU)) ! exceptionally a 3D array + CASE DEFAULT ! undefined preinitialization + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','PREP_IDEAL_CASE','CIDEAL is not correctly defined') +END SELECT +! +!* 4.4 Prognostic variables at M instant (module MODD_FIELD1): +! +ALLOCATE(XUT(NIU,NJU,NKU)) +ALLOCATE(XVT(NIU,NJU,NKU)) +ALLOCATE(XWT(NIU,NJU,NKU)) +ALLOCATE(XTHT(NIU,NJU,NKU)) +ALLOCATE(XPABST(NIU,NJU,NKU)) +ALLOCATE(XRT(NIU,NJU,NKU,NRR)) +ALLOCATE(XSVT(NIU,NJU,NKU,NSV)) +! +!* 4.5 Grid variables (module MODD_GRID1 and MODD_METRICS1): +! +ALLOCATE(XMAP(NIU,NJU)) +ALLOCATE(XLAT(NIU,NJU)) +ALLOCATE(XLON(NIU,NJU)) +ALLOCATE(XDXHAT(NIU),XDYHAT(NJU)) +IF (LEN_TRIM(CPGD_FILE)==0) ALLOCATE(XZS(NIU,NJU)) +IF (LEN_TRIM(CPGD_FILE)==0) ALLOCATE(ZZS_ll(NIMAX_ll)) +IF (LEN_TRIM(CPGD_FILE)==0) ALLOCATE(XZSMT(NIU,NJU)) +ALLOCATE(XZZ(NIU,NJU,NKU)) +! +ALLOCATE(XDXX(NIU,NJU,NKU)) +ALLOCATE(XDYY(NIU,NJU,NKU)) +ALLOCATE(XDZX(NIU,NJU,NKU)) +ALLOCATE(XDZY(NIU,NJU,NKU)) +ALLOCATE(XDZZ(NIU,NJU,NKU)) +! +!* 4.6 Reference state variables (modules MODD_REF and MODD_REF1): +! +ALLOCATE(XRHODREFZ(NKU),XTHVREFZ(NKU)) +XTHVREFZ(:)=0.0 +IF (LCOUPLES) THEN + ! Arrays for reference state different in ocean and atmosphere + ALLOCATE(XRHODREFZO(NKU),XTHVREFZO(NKU)) + XTHVREFZO(:)=0.0 +END IF +IF(CEQNSYS == 'DUR') THEN + ALLOCATE(XRVREF(NIU,NJU,NKU)) +ELSE + ALLOCATE(XRVREF(0,0,0)) +END IF +ALLOCATE(XRHODREF(NIU,NJU,NKU),XTHVREF(NIU,NJU,NKU),XEXNREF(NIU,NJU,NKU)) +ALLOCATE(XRHODJ(NIU,NJU,NKU)) +! +!* 4.7 Larger Scale fields (modules MODD_LSFIELD1): +! +ALLOCATE(XLSUM(NIU,NJU,NKU)) +ALLOCATE(XLSVM(NIU,NJU,NKU)) +ALLOCATE(XLSWM(NIU,NJU,NKU)) +ALLOCATE(XLSTHM(NIU,NJU,NKU)) +IF ( NRR >= 1) THEN + ALLOCATE(XLSRVM(NIU,NJU,NKU)) +ELSE + ALLOCATE(XLSRVM(0,0,0)) +ENDIF +! +! allocate lateral boundary field used for coupling +! +IF ( L1D) THEN ! 1D case +! + NSIZELBX_ll=0 + NSIZELBXU_ll=0 + NSIZELBY_ll=0 + NSIZELBYV_ll=0 + NSIZELBXTKE_ll=0 + NSIZELBXR_ll=0 + NSIZELBXSV_ll=0 + NSIZELBYTKE_ll=0 + NSIZELBYR_ll=0 + NSIZELBYSV_ll=0 + ALLOCATE(XLBXUM(0,0,0)) + ALLOCATE(XLBYUM(0,0,0)) + ALLOCATE(XLBXVM(0,0,0)) + ALLOCATE(XLBYVM(0,0,0)) + ALLOCATE(XLBXWM(0,0,0)) + ALLOCATE(XLBYWM(0,0,0)) + ALLOCATE(XLBXTHM(0,0,0)) + ALLOCATE(XLBYTHM(0,0,0)) + ALLOCATE(XLBXTKEM(0,0,0)) + ALLOCATE(XLBYTKEM(0,0,0)) + ALLOCATE(XLBXRM(0,0,0,0)) + ALLOCATE(XLBYRM(0,0,0,0)) + ALLOCATE(XLBXSVM(0,0,0,0)) + ALLOCATE(XLBYSVM(0,0,0,0)) +! +ELSEIF( L2D ) THEN ! 2D case (not yet parallelized) +! + CALL GET_SIZEX_LB(NIMAX_ll,NJMAX_ll,NRIMX, & + IISIZEXF,IJSIZEXF,IISIZEXFU,IJSIZEXFU, & + IISIZEX4,IJSIZEX4,IISIZEX2,IJSIZEX2) + NSIZELBY_ll=0 + NSIZELBYV_ll=0 + NSIZELBYTKE_ll=0 + NSIZELBYR_ll=0 + NSIZELBYSV_ll=0 + ALLOCATE(XLBYUM(0,0,0)) + ALLOCATE(XLBYVM(0,0,0)) + ALLOCATE(XLBYWM(0,0,0)) + ALLOCATE(XLBYTHM(0,0,0)) + ALLOCATE(XLBYTKEM(0,0,0)) + ALLOCATE(XLBYRM(0,0,0,0)) + ALLOCATE(XLBYSVM(0,0,0,0)) + ! + IF ( LHORELAX_UVWTH ) THEN +!JUAN A REVOIR TODO_JPHEXT +! <<<<<<< prep_ideal_case.f90 + ! NSIZELBX_ll=2*NRIMX+2 + ! NSIZELBXU_ll=2*NRIMX+2 + ALLOCATE(XLBXUM(IISIZEXFU,NJU,NKU)) + ALLOCATE(XLBXVM(IISIZEXF,NJU,NKU)) + ALLOCATE(XLBXWM(IISIZEXF,NJU,NKU)) + ALLOCATE(XLBXTHM(IISIZEXF,NJU,NKU)) +! ======= + NSIZELBX_ll=2*NRIMX+2*JPHEXT + NSIZELBXU_ll=2*NRIMX+2*JPHEXT + ! ALLOCATE(XLBXUM(2*NRIMX+2*JPHEXT,NJU,NKU)) + ! ALLOCATE(XLBXVM(2*NRIMX+2*JPHEXT,NJU,NKU)) + ! ALLOCATE(XLBXWM(2*NRIMX+2*JPHEXT,NJU,NKU)) + ! ALLOCATE(XLBXTHM(2*NRIMX+2*JPHEXT,NJU,NKU)) +! >>>>>>> 1.3.2.4.2.3.2.14.2.8.2.11.2.2 + ELSE + NSIZELBX_ll= 2*JPHEXT ! 2 + NSIZELBXU_ll=2*(JPHEXT+1) ! 4 + ALLOCATE(XLBXUM(NSIZELBXU_ll,NJU,NKU)) + ALLOCATE(XLBXVM(NSIZELBX_ll,NJU,NKU)) + ALLOCATE(XLBXWM(NSIZELBX_ll,NJU,NKU)) + ALLOCATE(XLBXTHM(NSIZELBX_ll,NJU,NKU)) + END IF + ! + IF ( NRR > 0 ) THEN + IF ( LHORELAX_RV .OR. LHORELAX_RC .OR. LHORELAX_RR .OR. LHORELAX_RI & + .OR. LHORELAX_RS .OR. LHORELAX_RG .OR. LHORELAX_RH & + ) THEN +!JUAN A REVOIR TODO_JPHEXT +! <<<<<<< prep_ideal_case.f90 + ! NSIZELBXR_ll=2* NRIMX+2 + ALLOCATE(XLBXRM(IISIZEXF,NJU,NKU,NRR)) +! ======= + NSIZELBXR_ll=2*NRIMX+2*JPHEXT + ! ALLOCATE(XLBXRM(2*NRIMX+2*JPHEXT,NJU,NKU,NRR)) +! >>>>>>> 1.3.2.4.2.3.2.14.2.8.2.11.2.2 + ELSE + NSIZELBXR_ll=2*JPHEXT ! 2 + ALLOCATE(XLBXRM(NSIZELBXR_ll,NJU,NKU,NRR)) + ENDIF + ELSE + NSIZELBXR_ll=0 + ALLOCATE(XLBXRM(0,0,0,0)) + END IF + ! + IF ( NSV > 0 ) THEN + IF ( ANY( LHORELAX_SV(:)) ) THEN +!JUAN A REVOIR TODO_JPHEXT +! <<<<<<< prep_ideal_case.f90 + ! NSIZELBXSV_ll=2* NRIMX+2 + ALLOCATE(XLBXSVM(IISIZEXF,NJU,NKU,NSV)) +! ======= + NSIZELBXSV_ll=2*NRIMX+2*JPHEXT + ! ALLOCATE(XLBXSVM(2*NRIMX+2*JPHEXT,NJU,NKU,NSV)) +! >>>>>>> 1.3.2.4.2.3.2.14.2.8.2.11.2.2 + ELSE + NSIZELBXSV_ll=2*JPHEXT ! 2 + ALLOCATE(XLBXSVM(NSIZELBXSV_ll,NJU,NKU,NSV)) + END IF + ELSE + NSIZELBXSV_ll=0 + ALLOCATE(XLBXSVM(0,0,0,0)) + END IF +! +ELSE ! 3D case +! + CALL GET_SIZEX_LB(NIMAX_ll,NJMAX_ll,NRIMX, & + IISIZEXF,IJSIZEXF,IISIZEXFU,IJSIZEXFU, & + IISIZEX4,IJSIZEX4,IISIZEX2,IJSIZEX2) + CALL GET_SIZEY_LB(NIMAX_ll,NJMAX_ll,NRIMY, & + IISIZEYF,IJSIZEYF,IISIZEYFV,IJSIZEYFV, & + IISIZEY4,IJSIZEY4,IISIZEY2,IJSIZEY2) +! + IF ( LHORELAX_UVWTH ) THEN + NSIZELBX_ll=2*NRIMX+2*JPHEXT + NSIZELBXU_ll=2*NRIMX+2*JPHEXT + NSIZELBY_ll=2*NRIMY+2*JPHEXT + NSIZELBYV_ll=2*NRIMY+2*JPHEXT + ALLOCATE(XLBXUM(IISIZEXFU,IJSIZEXFU,NKU)) + ALLOCATE(XLBYUM(IISIZEYF,IJSIZEYF,NKU)) + ALLOCATE(XLBXVM(IISIZEXF,IJSIZEXF,NKU)) + ALLOCATE(XLBYVM(IISIZEYFV,IJSIZEYFV,NKU)) + ALLOCATE(XLBXWM(IISIZEXF,IJSIZEXF,NKU)) + ALLOCATE(XLBYWM(IISIZEYF,IJSIZEYF,NKU)) + ALLOCATE(XLBXTHM(IISIZEXF,IJSIZEXF,NKU)) + ALLOCATE(XLBYTHM(IISIZEYF,IJSIZEYF,NKU)) + ELSE + NSIZELBX_ll=2*JPHEXT ! 2 + NSIZELBXU_ll=2*(JPHEXT+1) ! 4 + NSIZELBY_ll=2*JPHEXT ! 2 + NSIZELBYV_ll=2*(JPHEXT+1) ! 4 + ALLOCATE(XLBXUM(IISIZEX4,IJSIZEX4,NKU)) + ALLOCATE(XLBYUM(IISIZEY2,IJSIZEY2,NKU)) + ALLOCATE(XLBXVM(IISIZEX2,IJSIZEX2,NKU)) + ALLOCATE(XLBYVM(IISIZEY4,IJSIZEY4,NKU)) + ALLOCATE(XLBXWM(IISIZEX2,IJSIZEX2,NKU)) + ALLOCATE(XLBYWM(IISIZEY2,IJSIZEY2,NKU)) + ALLOCATE(XLBXTHM(IISIZEX2,IJSIZEX2,NKU)) + ALLOCATE(XLBYTHM(IISIZEY2,IJSIZEY2,NKU)) + END IF + ! + IF ( NRR > 0 ) THEN + IF ( LHORELAX_RV .OR. LHORELAX_RC .OR. LHORELAX_RR .OR. LHORELAX_RI & + .OR. LHORELAX_RS .OR. LHORELAX_RG .OR. LHORELAX_RH & + ) THEN + NSIZELBXR_ll=2*NRIMX+2*JPHEXT + NSIZELBYR_ll=2*NRIMY+2*JPHEXT + ALLOCATE(XLBXRM(IISIZEXF,IJSIZEXF,NKU,NRR)) + ALLOCATE(XLBYRM(IISIZEYF,IJSIZEYF,NKU,NRR)) + ELSE + NSIZELBXR_ll=2*JPHEXT ! 2 + NSIZELBYR_ll=2*JPHEXT ! 2 + ALLOCATE(XLBXRM(IISIZEX2,IJSIZEX2,NKU,NRR)) + ALLOCATE(XLBYRM(IISIZEY2,IJSIZEY2,NKU,NRR)) + ENDIF + ELSE + NSIZELBXR_ll=0 + NSIZELBYR_ll=0 + ALLOCATE(XLBXRM(0,0,0,0)) + ALLOCATE(XLBYRM(0,0,0,0)) + END IF + ! + IF ( NSV > 0 ) THEN + IF ( ANY( LHORELAX_SV(:)) ) THEN + NSIZELBXSV_ll=2*NRIMX+2*JPHEXT + NSIZELBYSV_ll=2*NRIMY+2*JPHEXT + ALLOCATE(XLBXSVM(IISIZEXF,IJSIZEXF,NKU,NSV)) + ALLOCATE(XLBYSVM(IISIZEYF,IJSIZEYF,NKU,NSV)) + ELSE + NSIZELBXSV_ll=2*JPHEXT ! 2 + NSIZELBYSV_ll=2*JPHEXT ! 2 + ALLOCATE(XLBXSVM(IISIZEX2,IJSIZEX2,NKU,NSV)) + ALLOCATE(XLBYSVM(IISIZEY2,IJSIZEY2,NKU,NSV)) + END IF + ELSE + NSIZELBXSV_ll=0 + NSIZELBYSV_ll=0 + ALLOCATE(XLBXSVM(0,0,0,0)) + ALLOCATE(XLBYSVM(0,0,0,0)) + END IF +END IF +! +! +!------------------------------------------------------------------------------- +! +!* 5. INITIALIZE ALL THE MODEL VARIABLES +! ---------------------------------- +! +! +!* 5.1 Grid variables and RS localization: +! +!* 5.1.1 Horizontal Spatial grid : +! +IF( LEN_TRIM(CPGD_FILE) /= 0 ) THEN +!-------------------------------------------------------- +! the MESONH horizontal grid will be read in the PGD_FILE +!-------------------------------------------------------- + CALL READ_HGRID(1,TPGDFILE,YPGD_NAME,YPGD_DAD_NAME,YPGD_TYPE) +! control the cartesian option + IF( LCARTESIAN ) THEN + WRITE(NLUOUT,FMT=*) 'PREP_IDEAL_CASE : IN GENERAL, THE USE OF A PGD_FILE & + & IMPLIES THAT YOU MUST TAKE INTO ACCOUNT THE EARTH SPHERICITY' + WRITE(NLUOUT,FMT=*) 'NEVERTHELESS, LCARTESIAN HAS BEEN KEPT TO TRUE' + END IF +! +!* use of the externalized surface +! + CSURF = "EXTE" +! +! determine whether the model is flat or no +! + ZZS_MAX = ABS( MAXVAL(XZS(NIB:NIU-JPHEXT,NJB:NJU-JPHEXT))) + CALL MPI_ALLREDUCE(ZZS_MAX, ZZS_MAX_ll, 1, MNHREAL_MPI, MPI_MAX, & + NMNH_COMM_WORLD,IINFO_ll) + IF( ABS(ZZS_MAX_ll) < 1.E-10 ) THEN + LFLAT=.TRUE. + ELSE + LFLAT=.FALSE. + END IF +! + +ELSE +!------------------------------------------------------------------------ +! the MESONH horizontal grid is built from the PRE_IDEA1.nam informations +!------------------------------------------------------------------------ +! + ALLOCATE(XXHAT(NIU),XYHAT(NJU)) +! +! define the grid localization at the earth surface by the central point +! coordinates +! + IF (XLONCEN/=XUNDEF .OR. XLATCEN/=XUNDEF) THEN + IF (XLONCEN/=XUNDEF .AND. XLATCEN/=XUNDEF) THEN +! +! it should be noted that XLATCEN and XLONCEN refer to a vertical +! vorticity point and (XLATORI, XLONORI) refer to the mass point of +! conformal coordinates (0,0). This is to allow the centering of the model in +! a non-cyclic configuration regarding to XLATCEN or XLONCEN. +! + ALLOCATE(ZXHAT_ll(NIMAX_ll+2*JPHEXT),ZYHAT_ll(NJMAX_ll+2*JPHEXT)) + ZXHAT_ll=0. + ZYHAT_ll=0. + CALL SM_LATLON(XLATCEN,XLONCEN, & + -XDELTAX*(NIMAX_ll/2-0.5+JPHEXT), & + -XDELTAY*(NJMAX_ll/2-0.5+JPHEXT), & + XLATORI,XLONORI) + DEALLOCATE(ZXHAT_ll,ZYHAT_ll) +! + WRITE(NLUOUT,FMT=*) 'PREP_IDEAL_CASE : XLATORI=' , XLATORI, & + ' XLONORI= ', XLONORI + ELSE + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','PREP_IDEAL_CASE',& + 'latitude and longitude of the center point must be initialized alltogether or not') + END IF + END IF +! + IF (NPROC > 1) THEN + CALL GET_DIM_EXT_ll('B',IXDIM,IYDIM) + IBEG = IXOR-JPHEXT-1 + IEND = IBEG+IXDIM-1 + XXHAT(:) = (/ (REAL(JLOOP)*XDELTAX, JLOOP=IBEG,IEND) /) + IBEG = IYOR-JPHEXT-1 + IEND = IBEG+IYDIM-1 + XYHAT(:) = (/ (REAL(JLOOP)*XDELTAY, JLOOP=IBEG,IEND) /) +! + ELSE + XXHAT(:) = (/ (REAL(JLOOP-NIB)*XDELTAX, JLOOP=1,NIU) /) + XYHAT(:) = (/ (REAL(JLOOP-NJB)*XDELTAY, JLOOP=1,NJU) /) + END IF +END IF +! +!* 5.1.2 Orography and Gal-Chen Sommerville transformation : +! +IF ( LEN_TRIM(CPGD_FILE) == 0 .OR. .NOT. LREAD_ZS) THEN + SELECT CASE(CZS) ! 'FLAT' or 'SINE' or 'BELL' + CASE('FLAT') + LFLAT = .TRUE. + IF (XHMAX==XUNDEF) THEN + XZS(:,:) = 0. + ELSE + XZS(:,:) = XHMAX + END IF + CASE('SINE') ! sinus-shaped orography + IF (XHMAX==XUNDEF) XHMAX=300. + LFLAT =.FALSE. + XZS(:,:) = XHMAX & ! three-dimensional case + *SPREAD((/((SIN((XPI/(NIMAX_ll+2*JPHEXT-1))*JLOOP)**2)**NEXPX,JLOOP=IXOR-1,IXOR+NIU-2)/),2,NJU) & + *SPREAD((/((SIN((XPI/(NJMAX_ll+2*JPHEXT-1))*JLOOP)**2)**NEXPY,JLOOP=IYOR-1,IYOR+NJU-2)/),1,NIU) + IF(L1D) THEN ! one-dimensional case + XZS(:,:) = XHMAX + END IF + CASE('BELL') ! bell-shaped orography + IF (XHMAX==XUNDEF) XHMAX=300. + LFLAT = .FALSE. + IF(.NOT.L2D) THEN ! three-dimensional case + XZS(:,:) = XHMAX / ( 1. & + + ( (SPREAD(XXHAT(1:NIU),2,NJU) - REAL(NIZS) * XDELTAX) /XAX ) **2 & + + ( (SPREAD(XYHAT(1:NJU),1,NIU) - REAL(NJZS) * XDELTAY) /XAY ) **2 ) **1.5 + ELSE ! two-dimensional case + XZS(:,:) = XHMAX / ( 1. & + + ( (SPREAD(XXHAT(1:NIU),2,NJU) - REAL(NIZS) * XDELTAX) /XAX ) **2 ) + ENDIF + IF(L1D) THEN ! one-dimensional case + XZS(:,:) = XHMAX + END IF + CASE('COSI') ! (1+cosine)**4 shape + IF (XHMAX==XUNDEF) XHMAX=800. + LFLAT = .FALSE. + IF(L2D) THEN ! two-dimensional case + DO JILOOP = 1, NIU + ZDIST = XXHAT(JILOOP)-REAL(NIZS)*XDELTAX + IF( ABS(ZDIST)<(4.0*XAX) ) THEN + XZS(JILOOP,:) = (XHMAX/16.0)*( 1.0 + COS((XPI*ZDIST)/(4.0*XAX)) )**4 + ELSE + XZS(JILOOP,:) = 0.0 + ENDIF + END DO + ENDIF + CASE('SCHA') ! exp(-(x/a)**2)*cosine(pi*x/lambda)**2 shape + IF (XHMAX==XUNDEF) XHMAX=800. + LFLAT = .FALSE. + IF(L2D) THEN ! two-dimensional case + DO JILOOP = 1, NIU + ZDIST = XXHAT(JILOOP)-REAL(NIZS)*XDELTAX + IF( ABS(ZDIST)<(4.0*XAX) ) THEN + XZS(JILOOP,:) = XHMAX*EXP(-(ZDIST/XAY)**2)*COS((XPI*ZDIST)/XAX)**2 + ELSE + XZS(JILOOP,:) = 0.0 + ENDIF + END DO + ENDIF + CASE('AGNE') ! h*a**2/(x**2+a**2) shape + LFLAT = .FALSE. + IF(L2D) THEN ! two-dimensional case + DO JILOOP = 1, NIU + ZDIST = XXHAT(JILOOP)-REAL(NIZS)*XDELTAX + XZS(JILOOP,:) = XHMAX*(XAX**2)/(XAX**2+ZDIST**2) + END DO + ELSE ! three dimensionnal case - infinite profile in y direction + DO JILOOP = 1, NIU + ZDIST = XXHAT(JILOOP)-REAL(NIZS)*XDELTAX + XZS(JILOOP,:) = XHMAX*(XAX**2)/(XAX**2+ZDIST**2) + END DO + ENDIF + + CASE('DATA') ! discretized orography + LFLAT =.FALSE. + WRITE(NLUOUT,FMT=*) 'CZS="DATA", ATTEMPT TO READ ARRAY & + &XZS(NIB:NIU-JPHEXT:1,NJU-JPHEXT:NJB:-1) & + &starting from the first index' + CALL POSKEY(NLUPRE,NLUOUT,'ZSDATA') + DO JJLOOP = NJMAX_ll+2*JPHEXT-1,JPHEXT+1,-1 ! input like a map prior the sounding + READ(NLUPRE,FMT=*) ZZS_ll + IF ( ( JJLOOP <= ( NJU-JPHEXT + IYOR-1 ) ) .AND. ( JJLOOP >= ( NJB + IYOR-1 ) ) ) THEN + IJ = JJLOOP - ( IYOR-1 ) + XZS(NIB:NIU-JPHEXT,IJ) = ZZS_ll(IXOR:IXOR + NIU-JPHEXT - NIB ) + END IF + END DO +! + CASE DEFAULT ! undefined shape of orography + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','PREP_IDEAL_CASE','erroneous ground type') + END SELECT +! + CALL ADD2DFIELD_ll( TZ_FIELDS_ll, XZS, 'PREP_IDEAL_CASE::XZS' ) + CALL UPDATE_HALO_ll(TZ_FIELDS_ll,IINFO_ll) + CALL CLEANLIST_ll(TZ_FIELDS_ll) +! +END IF +! +!IF( ( LEN_TRIM(CPGD_FILE) /= 0 ) .AND. .NOT.LFLAT .AND. & +! ((CLBCX(1) /= "OPEN" ) .OR. & +! (CLBCX(2) /= "OPEN" ) .OR. (CLBCY(1) /= "OPEN" ) .OR. & +! (CLBCY(2) /= "OPEN" )) ) THEN +! !callabortstop +! CALL PRINT_MSG(NVERB_FATAL,'GEN','PREP_IDEAL_CASE','with a PGD file, you cannot be in a cyclic LBC') +!END IF +! +IF (LWEST_ll()) THEN + DO JILOOP = 1,JPHEXT + XZS(JILOOP,:) = XZS(NIB,:) + END DO +END IF +IF (LEAST_ll()) THEN + DO JILOOP = NIU-JPHEXT+1,NIU + XZS(JILOOP,:)=XZS(NIU-JPHEXT,:) + END DO +END IF +IF (LSOUTH_ll()) THEN + DO JJLOOP = 1,JPHEXT + XZS(:,JJLOOP)=XZS(:,NJB) + END DO +END IF +IF (LNORTH_ll()) THEN + DO JJLOOP =NJU-JPHEXT+1,NJU + XZS(:,JJLOOP)=XZS(:,NJU-JPHEXT) + END DO +END IF +! +IF ( LEN_TRIM(CPGD_FILE) == 0 .OR. .NOT. LREAD_ZS) THEN + IF (LSLEVE) THEN + CALL ZSMT_PIC(NSLEVE,XSMOOTH_ZS) + ELSE + XZSMT(:,:) = 0. + END IF +END IF +! +IF (LCARTESIAN) THEN + CALL SM_GRIDCART(XXHAT,XYHAT,XZHAT,XZS,LSLEVE,XLEN1,XLEN2,XZSMT,XDXHAT,XDYHAT,XZZ,XJ) + XMAP=1. +ELSE + CALL SM_GRIDPROJ(XXHAT,XYHAT,XZHAT,XZS,LSLEVE,XLEN1,XLEN2,XZSMT,XLATORI,XLONORI, & + XMAP,XLAT,XLON,XDXHAT,XDYHAT,XZZ,XJ) +END IF +!* 5.4.1 metrics coefficients and update halos: +! +CALL METRICS(XMAP,XDXHAT,XDYHAT,XZZ,XDXX,XDYY,XDZX,XDZY,XDZZ) +! +CALL UPDATE_METRICS(CLBCX,CLBCY,XDXX,XDYY,XDZX,XDZY,XDZZ) +! +!* 5.1.3 Compute the localization in index space of the vertical profile +! in CSTN and RSOU cases : +! +IF (CTYPELOC =='LATLON' ) THEN + IF (.NOT.LCARTESIAN) THEN ! compute (x,y) if + CALL SM_XYHAT(XLATORI,XLONORI, & ! the localization + XLATLOC,XLONLOC,XXHATLOC,XYHATLOC) ! is given in latitude + ELSE ! and longitude + WRITE(NLUOUT,FMT=*) 'CTYPELOC CANNOT BE LATLON IN CARTESIAN GEOMETRY' + WRITE(NLUOUT,FMT=*) '-> JOB ABORTED' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','PREP_IDEAL_CASE','CTYPELOC cannot be LATLON in cartesian geometry') + END IF +END IF +! +ALLOCATE(ZXHAT_ll(NIMAX_ll+ 2 * JPHEXT),ZYHAT_ll(NJMAX_ll+2 * JPHEXT)) +CALL GATHERALL_FIELD_ll('XX',XXHAT,ZXHAT_ll,NRESP) !// +CALL GATHERALL_FIELD_ll('YY',XYHAT,ZYHAT_ll,NRESP) !// +IF (CTYPELOC /= 'IJGRID') THEN + NILOC = MINLOC(ABS(XXHATLOC-ZXHAT_ll(:))) + NJLOC = MINLOC(ABS(XYHATLOC-ZYHAT_ll(:))) +END IF +! +IF ( L1D .AND. ( NILOC(1) /= 1 .OR. NJLOC(1) /= 1 ) ) THEN + NILOC = 1 + NJLOC = 1 + WRITE(NLUOUT,FMT=*) 'FOR 1D CONFIGURATION, THE RS INFORMATIONS ARE TAKEN AT & + & I=1 AND J=1 (CENTRAL VERTICAL WITHOUT HALO)' +END IF +! +IF ( L2D .AND. ( NJLOC(1) /= 1 ) ) THEN + NJLOC = 1 + WRITE(NLUOUT,FMT=*) 'FOR 2D CONFIGURATION, THE RS INFORMATIONS ARE TAKEN AT & + & J=1 (CENTRAL PLANE WITHOUT HALO)' +END IF +! +!* 5.2 Prognostic variables (not multiplied by rhoJ) : u,v,w,theta,r +! and 1D anelastic reference state +! +! +!* 5.2.1 Use a Radiosounding : CIDEAL='RSOU'' +! +IF (CIDEAL == 'RSOU') THEN + WRITE(NLUOUT,FMT=*) 'CIDEAL="RSOU", attempt to read DATE' + CALL POSKEY(NLUPRE,NLUOUT,'RSOU') + READ(NLUPRE,FMT=*) NYEAR,NMONTH,NDAY,XTIME + TDTCUR = DATE_TIME(DATE(NYEAR,NMONTH,NDAY),XTIME) + TDTEXP = TDTCUR + TDTSEG = TDTCUR + TDTMOD = TDTCUR + WRITE(NLUOUT,FMT=*) 'CIDEAL="RSOU", ATTEMPT TO PROCESS THE SOUNDING DATA' + IF (LGEOSBAL) THEN + CALL SET_RSOU(TFILE_DUMMY,TZEXPREFILE,CFUNU,CFUNV,NILOC(1),NJLOC(1),LBOUSS, & + XJ,LSHIFT,XCORIOZ) + ELSE + CALL SET_RSOU(TFILE_DUMMY,TZEXPREFILE,CFUNU,CFUNV,NILOC(1),NJLOC(1),LBOUSS, & + XJ,LSHIFT) + END IF +! +!* 5.2.2 N=cste and U(z) : CIDEAL='CSTN' +! +ELSE IF (CIDEAL == 'CSTN') THEN + WRITE(NLUOUT,FMT=*) 'CIDEAL="CSTN", attempt to read DATE' + CALL POSKEY(NLUPRE,NLUOUT,'CSTN') + READ(NLUPRE,FMT=*) NYEAR,NMONTH,NDAY,XTIME + TDTCUR = DATE_TIME(DATE(NYEAR,NMONTH,NDAY),XTIME) + TDTEXP = TDTCUR + TDTSEG = TDTCUR + TDTMOD = TDTCUR + WRITE(NLUOUT,FMT=*) 'CIDEAL="CSTN", ATTEMPT TO PROCESS THE SOUNDING DATA' + IF (LGEOSBAL) THEN + CALL SET_CSTN(TFILE_DUMMY,TZEXPREFILE,CFUNU,CFUNV,NILOC(1),NJLOC(1),LBOUSS, & + XJ,LSHIFT,XCORIOZ) + ELSE + CALL SET_CSTN(TFILE_DUMMY,TZEXPREFILE,CFUNU,CFUNV,NILOC(1),NJLOC(1),LBOUSS, & + XJ,LSHIFT) + END IF +! +END IF +! +!* 5.3 Forcing variables +! +IF (LFORCING) THEN + WRITE(NLUOUT,FMT=*) 'FORCING IS ENABLED, ATTEMPT TO SET FORCING FIELDS' + CALL POSKEY(NLUPRE,NLUOUT,'ZFRC ','PFRC') + CALL SET_FRC(TZEXPREFILE) +END IF +! +!! --------------------------------------------------------------------- +! Modif PP ADV FRC +! 5.4.2 initialize profiles for adv forcings +IF (L2D_ADV_FRC) THEN + WRITE(NLUOUT,FMT=*) 'L2D_ADV_FRC IS SET TO TRUE' + WRITE(NLUOUT,FMT=*) 'ADVECTING FORCING USED IS USER MADE, NOT STANDARD ONE ' + WRITE(NLUOUT,FMT=*) 'IT IS FOR 2D IDEALIZED WAM STUDY ONLY ' + CALL POSKEY(NLUPRE,NLUOUT,'ZFRC_ADV') + CALL SET_ADVFRC(TZEXPREFILE) +ENDIF +IF (L2D_REL_FRC) THEN + WRITE(NLUOUT,FMT=*) 'L2D_REL_FRC IS SET TO TRUE' + WRITE(NLUOUT,FMT=*) 'RELAXATION FORCING USED IS USER MADE, NOT STANDARD ONE ' + WRITE(NLUOUT,FMT=*) 'IT IS FOR 2D IDEALIZED WAM STUDY ONLY ' + CALL POSKEY(NLUPRE,NLUOUT,'ZFRC_REL') + CALL SET_RELFRC(TZEXPREFILE) +ENDIF +!* 5.4 3D Reference state variables : +! +! +!* 5.4.1 metrics coefficients and update halos: +! +CALL METRICS(XMAP,XDXHAT,XDYHAT,XZZ,XDXX,XDYY,XDZX,XDZY,XDZZ) +! +CALL UPDATE_METRICS(CLBCX,CLBCY,XDXX,XDYY,XDZX,XDZY,XDZZ) +! +!* 5.4.2 3D reference state : +! +CALL SET_REF(0,TFILE_DUMMY, & + XZZ,XZHAT,XJ,XDXX,XDYY,CLBCX,CLBCY, & + XREFMASS,XMASS_O_PHI0,XLINMASS, & + XRHODREF,XTHVREF,XRVREF,XEXNREF,XRHODJ) +! +! +!* 5.5.1 Absolute pressure : +! +! +!* 5.5.2 Total mass of dry air Md computation : +! +CALL TOTAL_DMASS(XJ,XRHODREF,XDRYMASST) +! +! +!* 5.6 Complete prognostic variables (multipliy by rhoJ) at time t : +! +! U grid : gridpoint 2 +IF (LWEST_ll()) XUT(1,:,:) = 2.*XUT(2,:,:) - XUT(3,:,:) +! V grid : gridpoint 3 +IF (LSOUTH_ll()) XVT(:,1,:) = 2.*XVT(:,2,:) - XVT(:,3,:) +! SV : gridpoint 1 +XSVT(:,:,:,:) = 0. +! +! +!* 5.7 Larger scale fields initialization : +! +XLSUM(:,:,:) = XUT(:,:,:) ! these fields do not satisfy the +XLSVM(:,:,:) = XVT(:,:,:) ! lower boundary condition but are +XLSWM(:,:,:) = XWT(:,:,:) ! in equilibrium +XLSTHM(:,:,:)= XTHT(:,:,:) +XLSRVM(:,:,:)= XRT(:,:,:,1) +! +! enforce the vertical homogeneity under the ground and above the top of +! the model for the LS fields +! +XLSUM(:,:,NKB-1)=XLSUM(:,:,NKB) +XLSUM(:,:,NKU)=XLSUM(:,:,NKU-1) +XLSVM(:,:,NKB-1)=XLSVM(:,:,NKB) +XLSVM(:,:,NKU)=XLSVM(:,:,NKU-1) +XLSWM(:,:,NKB-1)=XLSWM(:,:,NKB) +XLSWM(:,:,NKU)=XLSWM(:,:,NKU-1) +XLSTHM(:,:,NKB-1)=XLSTHM(:,:,NKB) +XLSTHM(:,:,NKU)=XLSTHM(:,:,NKU-1) +IF ( NRR > 0 ) THEN + XLSRVM(:,:,NKB-1)=XLSRVM(:,:,NKB) + XLSRVM(:,:,NKU)=XLSRVM(:,:,NKU-1) +END IF +! +ILBX=SIZE(XLBXUM,1) +ILBY=SIZE(XLBYUM,2) +IF(LWEST_ll() .AND. .NOT. L1D) THEN + XLBXUM(1:NRIMX+JPHEXT, :,:) = XUT(2:NRIMX+JPHEXT+1, :,:) + XLBXVM(1:NRIMX+JPHEXT, :,:) = XVT(1:NRIMX+JPHEXT, :,:) + XLBXWM(1:NRIMX+JPHEXT, :,:) = XWT(1:NRIMX+JPHEXT, :,:) + XLBXTHM(1:NRIMX+JPHEXT, :,:) = XTHT(1:NRIMX+JPHEXT, :,:) + XLBXRM(1:NRIMX+JPHEXT, :,:,:) = XRT(1:NRIMX+JPHEXT, :,:,:) +ENDIF +IF(LEAST_ll() .AND. .NOT. L1D) THEN + XLBXUM(ILBX-NRIMX-JPHEXT+1:ILBX,:,:) = XUT(NIU-NRIMX-JPHEXT+1:NIU, :,:) + XLBXVM(ILBX-NRIMX-JPHEXT+1:ILBX,:,:) = XVT(NIU-NRIMX-JPHEXT+1:NIU, :,:) + XLBXWM(ILBX-NRIMX-JPHEXT+1:ILBX,:,:) = XWT(NIU-NRIMX-JPHEXT+1:NIU, :,:) + XLBXTHM(ILBX-NRIMX-JPHEXT+1:ILBX,:,:) = XTHT(NIU-NRIMX-JPHEXT+1:NIU, :,:) + XLBXRM(ILBX-NRIMX-JPHEXT+1:ILBX,:,:,:) = XRT(NIU-NRIMX-JPHEXT+1:NIU, :,:,:) +ENDIF +IF(LSOUTH_ll() .AND. .NOT. L1D .AND. .NOT. L2D) THEN + XLBYUM(:,1:NRIMY+JPHEXT, :) = XUT(:,1:NRIMY+JPHEXT, :) + XLBYVM(:,1:NRIMY+JPHEXT, :) = XVT(:,2:NRIMY+JPHEXT+1, :) + XLBYWM(:,1:NRIMY+JPHEXT, :) = XWT(:,1:NRIMY+JPHEXT, :) + XLBYTHM(:,1:NRIMY+JPHEXT, :) = XTHT(:,1:NRIMY+JPHEXT, :) + XLBYRM(:,1:NRIMY+JPHEXT, :,:) = XRT(:,1:NRIMY+JPHEXT, :,:) +ENDIF +IF(LNORTH_ll().AND. .NOT. L1D .AND. .NOT. L2D) THEN + XLBYUM(:,ILBY-NRIMY-JPHEXT+1:ILBY,:) = XUT(:,NJU-NRIMY-JPHEXT+1:NJU, :) + XLBYVM(:,ILBY-NRIMY-JPHEXT+1:ILBY,:) = XVT(:,NJU-NRIMY-JPHEXT+1:NJU, :) + XLBYWM(:,ILBY-NRIMY-JPHEXT+1:ILBY,:) = XWT(:,NJU-NRIMY-JPHEXT+1:NJU, :) + XLBYTHM(:,ILBY-NRIMY-JPHEXT+1:ILBY,:) = XTHT(:,NJU-NRIMY-JPHEXT+1:NJU, :) + XLBYRM(:,ILBY-NRIMY-JPHEXT+1:ILBY,:,:) = XRT(:,NJU-NRIMY-JPHEXT+1:NJU, :,:) +ENDIF +DO JSV = 1, NSV + IF(LWEST_ll() .AND. .NOT. L1D) & + XLBXSVM(1:NRIMX+JPHEXT, :,:,JSV) = XSVT(1:NRIMX+JPHEXT, :,:,JSV) + IF(LEAST_ll() .AND. .NOT. L1D) & + XLBXSVM(ILBX-NRIMX-JPHEXT+1:ILBX,:,:,JSV) = XSVT(NIU-NRIMX-JPHEXT+1:NIU, :,:,JSV) + IF(LSOUTH_ll() .AND. .NOT. L1D .AND. .NOT. L2D) & + XLBYSVM(:,1:NRIMY+JPHEXT, :,JSV) = XSVT(:,1:NRIMY+JPHEXT, :,JSV) + IF(LNORTH_ll() .AND. .NOT. L1D .AND. .NOT. L2D) & + XLBYSVM(:,ILBY-NRIMY-JPHEXT+1:ILBY,:,JSV) = XSVT(:,NJU-NRIMY-JPHEXT+1:NJU, :,JSV) +END DO +! +! +!* 5.8 Add a perturbation to a basic state : +! +IF(LPERTURB) CALL SET_PERTURB(TZEXPREFILE) +! +! +!* 5.9 Anelastic correction and pressure: +! +IF (.NOT.LOCEAN) THEN + CALL ICE_ADJUST_BIS(XPABST,XTHT,XRT) + IF ( .NOT. L1D ) CALL PRESSURE_IN_PREP(XDXX,XDYY,XDZX,XDZY,XDZZ) + CALL ICE_ADJUST_BIS(XPABST,XTHT,XRT) +END IF +! +! +!* 5.10 Compute THETA, vapor and cloud mixing ratio +! +IF (CIDEAL == 'RSOU') THEN + ALLOCATE(ZEXN(NIU,NJU,NKU)) + ALLOCATE(ZT(NIU,NJU,NKU)) + ALLOCATE(ZTHL(NIU,NJU,NKU)) + ALLOCATE(ZRT(NIU,NJU,NKU)) + ALLOCATE(ZCPH(NIU,NJU,NKU)) + ALLOCATE(ZLVOCPEXN(NIU,NJU,NKU)) + ALLOCATE(ZLSOCPEXN(NIU,NJU,NKU)) + ALLOCATE(ZFRAC_ICE(NIU,NJU,NKU)) + ALLOCATE(ZRSATW(NIU,NJU,NKU)) + ALLOCATE(ZRSATI(NIU,NJU,NKU)) + ALLOCATE(ZBUF(NIU,NJU,NKU,16)) + ZRT=XRT(:,:,:,1)+XRT(:,:,:,2)+XRT(:,:,:,4) +IF (LOCEAN) THEN + ZEXN(:,:,:)= 1. + ZT=XTHT + ZTHL=XTHT + ZCPH=XCPD+ XCPV * XRT(:,:,:,1) + ZLVOCPEXN = XLVTT + ZLSOCPEXN = XLSTT +ELSE + ZEXN=(XPABST/XP00) ** (XRD/XCPD) + ZT=XTHT*(XPABST/XP00)**(XRD/XCPD) + ZCPH=XCPD+ XCPV * XRT(:,:,:,1)+ XCL *XRT(:,:,:,2) + XCI * XRT(:,:,:,4) + ZLVOCPEXN = (XLVTT + (XCPV-XCL) * (ZT-XTT))/(ZCPH*ZEXN) + ZLSOCPEXN = (XLSTT + (XCPV-XCI) * (ZT-XTT))/(ZCPH*ZEXN) + ZTHL=XTHT-ZLVOCPEXN*XRT(:,:,:,2)-ZLSOCPEXN*XRT(:,:,:,4) + CALL TH_R_FROM_THL_RT(CST, NEBN, SIZE(ZFRAC_ICE), 'T',ZFRAC_ICE,XPABST,ZTHL,ZRT,XTHT,XRT(:,:,:,1), & + XRT(:,:,:,2),XRT(:,:,:,4),ZRSATW, ZRSATI,OOCEAN=.FALSE.,& + PBUF=ZBUF) +END IF + DEALLOCATE(ZEXN) + DEALLOCATE(ZT) + DEALLOCATE(ZCPH) + DEALLOCATE(ZLVOCPEXN) + DEALLOCATE(ZLSOCPEXN) + DEALLOCATE(ZTHL) + DEALLOCATE(ZRT) + DEALLOCATE(ZBUF) +! Coherence test + IF ((.NOT. LUSERI) ) THEN + IF (MAXVAL(XRT(:,:,:,4))/= 0) THEN + WRITE(NLUOUT,FMT=*) "*********************************" + WRITE(NLUOUT,FMT=*) 'WARNING' + WRITE(NLUOUT,FMT=*) 'YOU HAVE LUSERI=FALSE ' + WRITE(NLUOUT,FMT=*) ' BUT WITH YOUR RADIOSOUNDING Ri/=0' + WRITE(NLUOUT,FMT=*) MINVAL(XRT(:,:,:,4)),MAXVAL(XRT(:,:,:,4)) + WRITE(NLUOUT,FMT=*) "*********************************" + ENDIF + ENDIF + IF ((.NOT. LUSERC)) THEN + IF (MAXVAL(XRT(:,:,:,2))/= 0) THEN + WRITE(NLUOUT,FMT=*) "*********************************" + WRITE(NLUOUT,FMT=*) 'WARNING' + WRITE(NLUOUT,FMT=*) 'YOU HAVE LUSERC=FALSE ' + WRITE(NLUOUT,FMT=*) 'BUT WITH YOUR RADIOSOUNDING RC/=0' + WRITE(NLUOUT,FMT=*) MINVAL(XRT(:,:,:,2)),MAXVAL(XRT(:,:,:,2)) + WRITE(NLUOUT,FMT=*) "*********************************" + ENDIF + ENDIF + ! on remet les bonnes valeurs pour NRR + IF(CCLOUD=='NONE') NRR=1 + IF(CCLOUD=='REVE') NRR=2 +END IF +! +!------------------------------------------------------------------------------- +! +!* 6. INITIALIZE SCALAR VARIABLES FOR CHEMISTRY +! ----------------------------------------- +! +! before calling chemistry +CCONF = 'START' +CSTORAGE_TYPE='TT' +CALL IO_File_close(TZEXPREFILE) ! Close the EXPRE file +! +IF ( LCH_INIT_FIELD ) CALL CH_INIT_FIELD_n(1, NLUOUT, NVERB) +! +! Initialization LIMA variables by ORILAM +IF (CCLOUD == 'LIMA' .AND. ((LORILAM).OR.(LDUST).OR.(LSALT))) & + CALL AER2LIMA(XSVT, XRHODREF, XRT(:,:,:,1), XPABST, XTHT, XZZ) +!------------------------------------------------------------------------------- +! +!* 7. INITIALIZE LEVELSET FOR IBM +! --------------------------- +! +IF (LIBM_LSF) THEN + ! + ! In their current state, the IBM can only be used in + ! combination with cartesian coordinates and flat orography. + ! + IF ((CZS.NE."FLAT").OR.(.NOT.LCARTESIAN)) THEN + CALL PRINT_MSG(NVERB_FATAL,'GEN','PREP_IDEAL_CASE','IBM can only be used with flat ground') + ENDIF + ! + ALLOCATE(XIBM_LS(NIU,NJU,NKU,4)) + ! + CALL IBM_INIT_LS(XIBM_LS) + ! +ENDIF +! +!------------------------------------------------------------------------------- +! +!* 8. WRITE THE FMFILE +! ---------------- +! +CALL SECOND_MNH2(ZTIME1) +! +NNPRAR = 22 + 2*(NRR+NSV) & ! 22 = number of grid variables + reference + + 8 + 17 ! state variables + dimension variables + ! 2*(8+NRR+NSV) + 1 = number of prognostic + ! variables at time t and t-dt +NTYPE=1 +! +CALL IO_File_add2list(TINIFILE,TRIM(CINIFILE),'MNH','WRITE',KLFINPRAR=NNPRAR,KLFITYPE=NTYPE,KLFIVERB=NVERB) +! +CALL IO_File_open(TINIFILE) +! +CALL IO_Header_write(TINIFILE) +! +CALL WRITE_DESFM_n(1,TINIFILE) +! +CALL WRITE_LFIFM_n(TINIFILE,'') ! There is no DAD model for PREP_IDEAL_CASE +! +CALL SECOND_MNH2(ZTIME2) +! +XT_STORE = XT_STORE + ZTIME2 - ZTIME1 +! +!------------------------------------------------------------------------------- +! +!* 9. EXTERNALIZED SURFACE +! -------------------- +! +! +IF (CSURF =='EXTE') THEN + IF (LEN_TRIM(CINIFILEPGD)==0) THEN + IF (LEN_TRIM(CPGD_FILE)/=0) THEN + CINIFILEPGD=CPGD_FILE + ELSE + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','PREP_IDEAL_CASE','CINIFILEPGD needed in NAM_LUNITn') + ENDIF + ENDIF + CALL SURFEX_ALLOC_LIST(1) + YSURF_CUR => YSURF_LIST(1) + CALL READ_ALL_NAMELISTS(YSURF_CUR,'MESONH','PRE',.FALSE.) + ! Switch to model 1 surface variables + CALL GOTO_SURFEX(1) + !* definition of physiographic fields + ! computed ... + IF (LEN_TRIM(CPGD_FILE)==0 .OR. .NOT. LREAD_GROUND_PARAM) THEN + TPGDFILE => TINIFILE + CALL PGD_GRID_SURF_ATM(YSURF_CUR%UG, YSURF_CUR%U,YSURF_CUR%GCP,'MESONH',TINIFILE%CNAME,'MESONH',.TRUE.,HDIR='-') + CALL PGD_SURF_ATM (YSURF_CUR,'MESONH',TINIFILE%CNAME,'MESONH',.TRUE.) + CALL IO_File_add2list(TINIFILEPGD,TRIM(CINIFILEPGD),'PGD','WRITE',KLFINPRAR=NNPRAR,KLFITYPE=NTYPE,KLFIVERB=NVERB) + CALL IO_File_open (TINIFILEPGD) + TPGDFILE => TINIFILEPGD + ELSE + ! ... or read from file. + CALL INIT_PGD_SURF_ATM( YSURF_CUR, 'MESONH', 'PGD', & + ' ', ' ', & + TDTCUR%nyear, TDTCUR%nmonth, & + TDTCUR%nday, TDTCUR%xtime ) +! + END IF + ! + !* forces orography from atmospheric file + IF (.NOT. LREAD_ZS) CALL MNHPUT_ZS_n + ! + ! on ecrit un nouveau fichier PGD que s'il n'existe pas + IF (LEN_TRIM(CPGD_FILE)==0 .OR. .NOT. LREAD_GROUND_PARAM) THEN + !* writing of physiographic fields in the file + CSTORAGE_TYPE='PG' + ! + CALL IO_Header_write(TINIFILEPGD) + CALL IO_Field_write(TINIFILEPGD,'JPHEXT', JPHEXT) + CALL IO_Field_write(TINIFILEPGD,'SURF','EXTE') + CALL IO_Field_write(TINIFILEPGD,'L1D', L1D) + CALL IO_Field_write(TINIFILEPGD,'L2D', L2D) + CALL IO_Field_write(TINIFILEPGD,'PACK',LPACK) + CALL WRITE_HGRID(1,TINIFILEPGD) + ! + TOUTDATAFILE => TINIFILEPGD + ! + TFILE_SURFEX => TINIFILEPGD + ALLOCATE(YSURF_CUR%DUO%CSELECT(0)) + CALL WRITE_PGD_SURF_ATM_n(YSURF_CUR,'MESONH') + NULLIFY(TFILE_SURFEX) + CSTORAGE_TYPE='TT' + ENDIF + ! + ! + !* rereading of physiographic fields and definition of prognostic fields + !* writing of all surface fields + TOUTDATAFILE => TINIFILE + TFILE_SURFEX => TINIFILE + CALL PREP_SURF_MNH(' ',' ') + NULLIFY(TFILE_SURFEX) +ELSE + CSURF = "NONE" +END IF +! +!------------------------------------------------------------------------------- +! +!* 10. CLOSES THE FILE +! --------------- +! +IF (CSURF =='EXTE' .AND. (LEN_TRIM(CPGD_FILE)==0 .OR. .NOT. LREAD_GROUND_PARAM)) THEN + CALL IO_File_close(TINIFILEPGD) +ENDIF +CALL IO_File_close(TINIFILE) +IF( LEN_TRIM(CPGD_FILE) /= 0 ) THEN + CALL IO_File_close(TPGDFILE) +ENDIF +! +! +!------------------------------------------------------------------------------- +! +!* 11. PRINTS ON OUTPUT-LISTING +! ------------------------ +! +IF (NVERB >= 5) THEN + WRITE(NLUOUT,FMT=*) 'PREP_IDEAL_CASE: LCARTESIAN,CIDEAL,CZS=', & + LCARTESIAN,CIDEAL,CZS + WRITE(NLUOUT,FMT=*) 'PREP_IDEAL_CASE: LUSERV=',LUSERV + WRITE(NLUOUT,FMT=*) 'PREP_IDEAL_CASE: XLON0,XLAT0,XBETA,XRPK,XLONORI,XLATORI=', & + XLON0,XLAT0,XBETA,XRPK,XLONORI,XLATORI + WRITE(NLUOUT,FMT=*) 'PREP_IDEAL_CASE: XDELTAX,XDELTAY=',XDELTAX,XDELTAY + WRITE(NLUOUT,FMT=*) 'PREP_IDEAL_CASE: NVERB=',NVERB + IF(LCARTESIAN) THEN + WRITE(NLUOUT,FMT=*) 'PREP_IDEAL_CASE: No map projection used.' + ELSE + IF (XRPK == 1.) THEN + WRITE(NLUOUT,FMT=*) 'PREP_IDEAL_CASE: Polar stereo used.' + ELSE IF (XRPK == 0.) THEN + WRITE(NLUOUT,FMT=*) 'PREP_IDEAL_CASE: Mercator used.' + ELSE + WRITE(NLUOUT,FMT=*) 'PREP_IDEAL_CASE: Lambert used, cone factor=',XRPK + END IF + END IF +END IF +! +IF (NVERB >= 5) THEN + WRITE(NLUOUT,FMT=*) 'PREP_IDEAL_CASE: IIB, IJB, IKB=',NIB,NJB,NKB + WRITE(NLUOUT,FMT=*) 'PREP_IDEAL_CASE: IIU, IJU, IKU=',NIU,NJU,NKU +END IF +! +! +!* 28.1 print statistics! +! + ! + CALL SECOND_MNH2(ZTIME2) + XT_START=XT_START+ZTIME2-ZEND + ! + ! Set File Timing OUTPUT + ! + CALL SET_ILUOUT_TIMING(TLUOUT0) + ! + ! Compute global time + ! + CALL TIME_STAT_ll(XT_START,ZTOT) + ! + ! + IMI = 1 + CALL TIME_HEADER_ll(IMI) + ! + CALL TIME_STAT_ll(XT_STORE,ZTOT, ' STORE-FIELDS','=') + CALL TIMING_SEPARATOR('+') + CALL TIMING_SEPARATOR('+') + WRITE(YMI,FMT="(I0)") IMI + CALL TIME_STAT_ll(XT_START,ZTOT, ' MODEL'//YMI,'+') + CALL TIMING_SEPARATOR('+') + CALL TIMING_SEPARATOR('+') + CALL TIMING_SEPARATOR('+') +WRITE(NLUOUT,FMT=*) ' ' +WRITE(NLUOUT,FMT=*) '****************************************************' +WRITE(NLUOUT,FMT=*) '* PREP_IDEAL_CASE: PREP_IDEAL_CASE ENDS CORRECTLY. *' +WRITE(NLUOUT,FMT=*) '****************************************************' +! +CALL FINALIZE_MNH() +! +! +CONTAINS +INCLUDE "th_r_from_thl_rt.func.h" +INCLUDE "compute_frac_ice.func.h" +END PROGRAM PREP_IDEAL_CASE diff --git a/src/mesonh/ext/prep_nest_pgd.f90 b/src/mesonh/ext/prep_nest_pgd.f90 new file mode 100644 index 0000000000000000000000000000000000000000..6d74a372c2059a319e41e92848533fc0d3bc0e10 --- /dev/null +++ b/src/mesonh/ext/prep_nest_pgd.f90 @@ -0,0 +1,408 @@ +!MNH_LIC Copyright 1995-2021 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. +!----------------------------------------------------------------- +! ##################### + PROGRAM PREP_NEST_PGD +! ##################### +! +!!**** *PREP_NEST_PGD* - to make coherent pgd files for nesting +!! +!! PURPOSE +!! ------- +!! +!! The purpose of this program is to prepare pgd files with which +!! nesting can be performed. A pgd file must be coherent with its +!! father: +!! The average of orography of fine model on each of its father grid +!! mesh must be the same as its father orography. +!! +!! All the pgd files are read at the begining of the program, +!! then they are checked, and recursively, the orography of a father +!! is replaced by the averaged orography from ist son. +!! +!! The control data are given in the namelist file PRE_NEST.nam +!! +!! &NAM_NEST_PGD1 CPGD='coarser model' / +!! &NAM_NEST_PGD2 CPGD='medium model' , IDAD=1 / +!! &NAM_NEST_PGD3 CPGD='medium model' , IDAD=1 / +!! &NAM_NEST_PGD4 CPGD='fine model' , IDAD=2 / +!! &NAM_NEST_PGD5 CPGD='fine model' , IDAD=2 / +!! &NAM_NEST_PGD6 CPGD='fine model' , IDAD=3 / +!! &NAM_NEST_PGD7 CPGD='very fine model' , IDAD=6 / +!! &NAM_NEST_PGD8 CPGD='very very fine model' , IDAD=7 / +!! +!! In each namelist is given the name of the pgd file, and the number +!! of its father. This one MUST be smaller. +!! There is one output file for each input file, with the suffix +!! '.nest' added at the end of the file name (even if the file has not +!! been changed). +!! +!! In the case of the namelist above, one obtain something like: +!! +!! +----------------------------------------------------------+ +!! | 1 | +!! | +-----------------------+ | +!! | | 2 | | +!! | | | | +!! | | +-+ | | +!! | | +-------+ |5| | +-----------------------+ | +!! | | | 4 | +-+ | | +----------+ 3 | | +!! | | +-------+ | | |+------+ 6| | | +!! | +-----------------------+ | || +-+ 7| | | | +!! | | || |8| | | | | +!! | | || +-+ | | | | +!! | | |+------+ | | | +!! | | +----------+ | | +!! | +-----------------------+ | +!! +----------------------------------------------------------+ +!! +!! +!!** METHOD +!! ------ +!! +!! EXTERNAL +!! -------- +!! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! +!! REFERENCE +!! --------- +!! +!! Book 2 +!! +!! AUTHOR +!! ------ +!! +!! V.Masson Meteo-France +!! +!! MODIFICATIONS +!! ------------- +!! Original 26/09/95 +!! 30/07/97 (Masson) split of mode_lfifm_pgd +!! 2014 (M.Faivre) +!! 06/2015 (M.Moge) parallelization +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! J.Escobar : 19/04/2016 : Pb IOZ/NETCDF , missing OPARALLELIO=.FALSE. for PGD files +!! 06/2016 (G.Delautier) phasage surfex 8 +!! P.Wautelet : 08/07/2016 : removed MNH_NCWRIT define +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 07/02/2019: force TYPE to a known value for IO_File_add2list +! P. Wautelet 06/07/2021: use FINALIZE_MNH +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_CONF +USE MODD_CONF_n +USE MODD_CST +USE MODD_DIM_n +USE MODD_IO, ONLY: TFILE_SURFEX, TPTR2FILE +USE MODD_GRID_n, ONLY: XZSMT +USE MODD_LUNIT, ONLY: TPGDFILE,TLUOUT0,TOUTDATAFILE +USE MODD_MNH_SURFEX_n +USE MODD_NESTING +USE MODD_PARAMETERS +USE MODD_VAR_ll, ONLY: NPROC, IP, NMNH_COMM_WORLD +! +use mode_field, only: Ini_field_list +USE MODE_FINALIZE_MNH, only: FINALIZE_MNH +USE MODE_IO, only: IO_Init, IO_Pack_set +USE MODE_IO_FIELD_READ, only: IO_Field_read +USE MODE_IO_FIELD_WRITE, only: IO_Field_write, IO_Header_write +USE MODE_IO_FILE, only: IO_File_close, IO_File_open +USE MODE_IO_MANAGE_STRUCT, only: IO_File_add2list +USE MODE_ll +USE MODE_MNH_WORLD, ONLY: INIT_NMNH_COMM_WORLD +USE MODE_MODELN_HANDLER +USE MODE_MPPDB +USE MODE_SPLITTINGZ_ll, ONLY: INI_PARAZ_ll +! +USE MODI_DEFINE_MASK_n +USE MODI_INIT_HORGRID_ll_n +USE MODI_INIT_PGD_SURF_ATM +USE MODI_NEST_FIELD_n +USE MODI_NEST_ZSMT_n +USE MODI_OPEN_NESTPGD_FILES +USE MODI_READ_ALL_NAMELISTS +USE MODI_READ_HGRID +USE MODI_RETRIEVE1_NEST_INFO_n +USE MODI_VERSION +USE MODI_WRITE_PGD_SURF_ATM_N +USE MODE_INI_CST, ONLY: INI_CST +! +IMPLICIT NONE +! +!* 0.1 Declaration of local variables +! ------------------------------ +! +INTEGER, DIMENSION(JPMODELMAX) :: NXSIZE ! number of grid points for each model +INTEGER, DIMENSION(JPMODELMAX) :: NYSIZE ! in x and y-directions + ! relatively to its father grid +! +INTEGER :: ILUOUT0 +INTEGER :: IINFO_ll ! return code of // routines +INTEGER :: JPGD ! loop control +CHARACTER(LEN=28) :: YMY_NAME,YDAD_NAME +CHARACTER(LEN=2) :: YSTORAGE_TYPE +LOGICAL, DIMENSION(JPMODELMAX) :: L1D_ALL ! Flag for 1D conf. for each PGD +LOGICAL, DIMENSION(JPMODELMAX) :: L2D_ALL ! Flag for 2D conf. for each PGD +LOGICAL, DIMENSION(JPMODELMAX) :: LPACK_ALL! Flag for packing conf. for each PGD +! +INTEGER :: JTIME,ITIME +INTEGER :: IIMAX,IJMAX,IKMAX +INTEGER :: IDXRATIO,IDYRATIO +INTEGER :: IDAD +INTEGER :: II +LOGICAL :: GISINIT +! +TYPE(TPTR2FILE),DIMENSION(:),ALLOCATABLE :: TZFILEPGD ! Input PGD files +TYPE(TPTR2FILE),DIMENSION(:),ALLOCATABLE,TARGET :: TZFILENESTPGD ! Output PGD files +! +!------------------------------------------------------------------------------- +! +CALL MPPDB_INIT() +! +CALL VERSION +CPROGRAM='NESPGD' +! +CALL IO_Init() +!!$CALL SET_JP_ll(JPMODELMAX,JPHEXT,JPVEXT,JPHEXT) +! +!* 1. INITIALIZATION OF PHYSICAL CONSTANTS +! ------------------------------------ +! +CALL INI_CST +! +!------------------------------------------------------------------------------- +! +!* 2. OPENING OF THE FILES +! --------------------- +! +NVERB=1 +! +CALL OPEN_NESTPGD_FILES(TZFILEPGD,TZFILENESTPGD) +CALL SET_JP_ll(JPMODELMAX,JPHEXT,JPVEXT,JPHEXT) +! +ILUOUT0 = TLUOUT0%NLU +! +CALL SURFEX_ALLOC_LIST(NMODEL) +YSURF_CUR => YSURF_LIST(1) +CALL READ_ALL_NAMELISTS(YSURF_CUR,'MESONH','PRE',.FALSE.) +! +!------------------------------------------------------------------------------- +! +!* 3. READING OF THE GRIDS +! -------------------- +! +CALL INI_FIELD_LIST(NMODEL) +! +CALL SET_DAD0_ll() +DO JPGD=1,NMODEL + ! read and set dimensions and ratios of model JPGD + CALL IO_Field_read(TZFILEPGD(JPGD)%TZFILE,'IMAX', IIMAX) + CALL IO_Field_read(TZFILEPGD(JPGD)%TZFILE,'JMAX', IJMAX) + CALL IO_Field_read(TZFILEPGD(JPGD)%TZFILE,'DXRATIO',NDXRATIO_ALL(JPGD)) + CALL IO_Field_read(TZFILEPGD(JPGD)%TZFILE,'DYRATIO',NDYRATIO_ALL(JPGD)) + CALL IO_Field_read(TZFILEPGD(JPGD)%TZFILE,'XSIZE', NXSIZE(JPGD)) + CALL IO_Field_read(TZFILEPGD(JPGD)%TZFILE,'YSIZE', NYSIZE(JPGD)) + CALL IO_Field_read(TZFILEPGD(JPGD)%TZFILE,'XOR', NXOR_ALL(JPGD)) + CALL IO_Field_read(TZFILEPGD(JPGD)%TZFILE,'YOR', NYOR_ALL(JPGD)) + CALL SET_DIM_ll(IIMAX, IJMAX, 1) + ! compute origin and end of local subdomain of model JPGD + ! initialize variables from MODD_NESTING, origin and end of global model JPGD in coordinates of its father + IF ( NDAD(JPGD) > 0 ) THEN + NXEND_ALL(JPGD) = NXOR_ALL(JPGD) + NXSIZE(JPGD) - 1 + 2*JPHEXT + NYEND_ALL(JPGD) = NYOR_ALL(JPGD) + NYSIZE(JPGD) - 1 + 2*JPHEXT + ELSE ! this is not a son model + NXOR_ALL(JPGD) = 1 + NXEND_ALL(JPGD) = IIMAX+2*JPHEXT + NYOR_ALL(JPGD) = 1 + NYEND_ALL(JPGD) = IJMAX+2*JPHEXT + NDXRATIO_ALL(JPGD) = 1 + NDYRATIO_ALL(JPGD) = 1 + ENDIF + ! initialize variables from MODD_DIM_ll, origin and end of global model JPGD in coordinates of its father + CALL SET_XOR_ll(NXOR_ALL(JPGD), JPGD) + CALL SET_XEND_ll(NXEND_ALL(JPGD), JPGD) + CALL SET_YOR_ll(NYOR_ALL(JPGD), JPGD) + CALL SET_YEND_ll(NYEND_ALL(JPGD), JPGD) + ! set the father model of model JPGD +! set MODD_NESTING::NDAD using MODD_DIM_ll::NDAD +! MODD_DIM_ll::NDAD was filled in OPEN_NESTPGD_FILES + CALL SET_DAD_ll(NDAD(JPGD), JPGD) + ! set the ratio of model JPGD in MODD_DIM_ll + CALL SET_XRATIO_ll(NDXRATIO_ALL(JPGD), JPGD) + CALL SET_YRATIO_ll(NDYRATIO_ALL(JPGD), JPGD) +END DO +! +! reading of the grids +! + CALL SET_DIM_ll(NXEND_ALL(1)-NXOR_ALL(1)+1-2*JPHEXT, NYEND_ALL(1)-NYOR_ALL(1)+1-2*JPHEXT, 1) + CALL INI_PARAZ_ll(IINFO_ll) +DO JPGD=1,NMODEL + CALL GOTO_MODEL(JPGD) + CALL GO_TOMODEL_ll(JPGD,IINFO_ll) + CALL GOTO_SURFEX(JPGD) + CALL IO_Field_read(TZFILEPGD(JPGD)%TZFILE,'L1D', L1D_ALL(JPGD)) + CALL IO_Field_read(TZFILEPGD(JPGD)%TZFILE,'L2D', L2D_ALL(JPGD)) + CALL IO_Field_read(TZFILEPGD(JPGD)%TZFILE,'PACK',LPACK_ALL(JPGD)) + CALL IO_Pack_set(L1D_ALL(JPGD),L2D_ALL(JPGD),LPACK_ALL(JPGD)) + CALL READ_HGRID(JPGD,TZFILEPGD(JPGD)%TZFILE,YMY_NAME,YDAD_NAME,YSTORAGE_TYPE) + CSTORAGE_TYPE='PG' +END DO + CALL INI_PARAZ_ll(IINFO_ll) +! +!------------------------------------------------------------------------------- +! +!* 5. MASKS DEFINITIONS +! ----------------- +! + +DO JPGD=1,NMODEL + CALL GOTO_SURFEX(JPGD) + CALL GOTO_MODEL(JPGD) + CALL GO_TOMODEL_ll(JPGD,IINFO_ll) +!!$ CALL INIT_HORGRID_ll_n() + CALL DEFINE_MASK_n() +END DO +! +!------------------------------------------------------------------------------- +! +!* 6. MODIFICATION OF OROGRAPHY +! ------------------------- +! +WRITE(ILUOUT0,FMT=*) +WRITE(ILUOUT0,FMT=*) 'field ZS of all models' +DO JPGD=NMODEL,1,-1 + CALL GOTO_MODEL(JPGD) + CALL GO_TOMODEL_ll(JPGD,IINFO_ll) + CALL GOTO_SURFEX(JPGD) + CALL NEST_FIELD_n('ZS ') +END DO +! +! *** Adaptation of smooth topography for SLEVE coordinate +! +WRITE(ILUOUT0,FMT=*) +WRITE(ILUOUT0,FMT=*) 'field ZSMT of all models' +DO JPGD=1,NMODEL + CALL GOTO_MODEL(JPGD) + CALL GO_TOMODEL_ll(JPGD,IINFO_ll) + CALL GOTO_SURFEX(JPGD) + CALL NEST_ZSMT_n('ZSMT ') +END DO + +! +!------------------------------------------------------------------------------- +! +!* 7. SURFACE FIELDS READING +! ---------------------- +! +DO JPGD=1,NMODEL + IF (LEN_TRIM(TZFILEPGD(JPGD)%TZFILE%CNAME)>0) THEN + CALL GO_TOMODEL_ll(JPGD,IINFO_ll) + TPGDFILE => TZFILEPGD(JPGD)%TZFILE + CALL GOTO_MODEL(JPGD) + CALL GOTO_SURFEX(JPGD) + CALL INIT_PGD_SURF_ATM(YSURF_CUR,'MESONH','PGD', & + ' ',' ',& + NUNDEF,NUNDEF,NUNDEF,XUNDEF ) + END IF +END DO +! +!------------------------------------------------------------------------------- +! +!* 8. MODIFICATION OF OROGRAPHY +! ------------------------- +! +DO JPGD=1,NMODEL + CALL GOTO_MODEL(JPGD) + CALL GO_TOMODEL_ll(JPGD,IINFO_ll) + CALL GOTO_SURFEX(JPGD) + CALL MNHPUT_ZS_n +END DO +! +!------------------------------------------------------------------------------- +! +!* 10. SURFACE FIELDS WRITING +! ---------------------- +! +DO JPGD=1,NMODEL + CALL GO_TOMODEL_ll(JPGD,IINFO_ll) + TPGDFILE => TZFILEPGD(JPGD)%TZFILE + TOUTDATAFILE => TZFILENESTPGD(JPGD)%TZFILE + CALL GOTO_MODEL(JPGD) + !Open done here because grid dimensions have to be known + CALL IO_File_open(TZFILENESTPGD(JPGD)%TZFILE) + CALL GOTO_SURFEX(JPGD) + TFILE_SURFEX => TZFILENESTPGD(JPGD)%TZFILE + CALL WRITE_PGD_SURF_ATM_n(YSURF_CUR,'MESONH') + NULLIFY(TFILE_SURFEX) + CALL IO_Field_write(TZFILENESTPGD(JPGD)%TZFILE,'ZSMT',XZSMT) +END DO +! +!------------------------------------------------------------------------------- +! +!* 12. Write configuration variables in the output file +! ------------------------------------------------ +! +! +DO JPGD=1,NMODEL + CALL IO_Header_write(TZFILENESTPGD(JPGD)%TZFILE) + IF ( ASSOCIATED(TZFILENESTPGD(JPGD)%TZFILE%TDADFILE) ) THEN + CALL IO_Field_write(TZFILENESTPGD(JPGD)%TZFILE,'DXRATIO',NDXRATIO_ALL(JPGD)) + CALL IO_Field_write(TZFILENESTPGD(JPGD)%TZFILE,'DYRATIO',NDYRATIO_ALL(JPGD)) + CALL IO_Field_write(TZFILENESTPGD(JPGD)%TZFILE,'XOR', NXOR_ALL(JPGD)) + CALL IO_Field_write(TZFILENESTPGD(JPGD)%TZFILE,'YOR', NYOR_ALL(JPGD)) + END IF + CALL IO_Field_write(TZFILENESTPGD(JPGD)%TZFILE,'SURF', 'EXTE') + CALL IO_Field_write(TZFILENESTPGD(JPGD)%TZFILE,'L1D', L1D_ALL(JPGD)) + CALL IO_Field_write(TZFILENESTPGD(JPGD)%TZFILE,'L2D', L2D_ALL(JPGD)) + CALL IO_Field_write(TZFILENESTPGD(JPGD)%TZFILE,'PACK', LPACK_ALL(JPGD)) + CALL IO_Field_write(TZFILENESTPGD(JPGD)%TZFILE,'JPHEXT',JPHEXT) +END DO +! +!------------------------------------------------------------------------------- +! +!* 13. CLOSING OF THE FILES +! -------------------- +! +DO JPGD=1,NMODEL + CALL IO_File_close(TZFILEPGD(JPGD)%TZFILE) + CALL IO_File_close(TZFILENESTPGD(JPGD)%TZFILE) +END DO +! +!* loop to spare enough time to transfer commands before end of program +ITIME=0 +DO JTIME=1,1000000 + ITIME=ITIME+1 +END DO +!------------------------------------------------------------------------------- +! +!* 12. EPILOGUE +! -------- +! +WRITE(ILUOUT0,FMT=*) +WRITE(ILUOUT0,FMT=*) '************************************************' +WRITE(ILUOUT0,FMT=*) '* PREP_NEST_PGD: PREP_NEST_PGD ends correctly. *' +WRITE(ILUOUT0,FMT=*) '************************************************' +! +!------------------------------------------------------------------------------- +! +!* 10. FINALIZE THE PARALLEL SESSION +! ----------------------------- +! +CALL FINALIZE_MNH() + +! CALL END_PARA_ll(IINFO_ll) +! +! CALL SURFEX_DEALLO_LIST +! +!------------------------------------------------------------------------------- + +END PROGRAM PREP_NEST_PGD diff --git a/src/mesonh/ext/prep_pgd.f90 b/src/mesonh/ext/prep_pgd.f90 new file mode 100644 index 0000000000000000000000000000000000000000..16af36df885ddddfdae1b3416fcd2be5790d588c --- /dev/null +++ b/src/mesonh/ext/prep_pgd.f90 @@ -0,0 +1,340 @@ +!MNH_LIC Copyright 1995-2021 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. +!----------------------------------------------------------------- +! ################ + PROGRAM PREP_PGD +! ################ +!! +!! PURPOSE +!! ------- +!! This program prepares the physiographic data fields. +!! +!! METHOD +!! ------ +!! +!! +!! EXTERNAL +!! -------- +!! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! +!! F. Mereyde Meteo-France +!! +!! MODIFICATION +!! ------------ +!! +!! Original 21/07/95 +!! Modification 26/07/95 Treatment of orography and subgrid-scale +!! orography roughness length (V. Masson) +!! Modification 22/05/96 Variable CSTORAGE_TYPE (V. Masson) +!! Modification 25/05/96 Modification of splines, correction on z0rel +!! and set limits for some surface varaibles +!! Modification 12/06/96 Treatment of a rare case for ZPGDZ0EFF (Masson) +!! Modification 22/11/96 removes the filtering. It will have to be +!! performed in ADVANCED_PREP_PGD (Masson) +!! Modification 15/03/99 **** MAJOR MODIFICATION **** (Masson) +!! PGD fields are now defined from the cover +!! type fractions in the grid meshes +!! User can still include its own data, and +!! even additional (dummy) fields +!! Modificatio 06/00 patch approach, for vegetation related variable (Solmon/Masson) +! averaging is performed on subclass(=patch) of nature +!! 08/03/01 add chemical emission treatment (D.Gazen) +!! Modification 15/10/01 allow namelists in different orders (I.Mallet) +!! +!! ################################ +!! MODIFICATION 13/10/03 EXTERNALIZED VERSION (V. Masson) +!! ################################ +!! J.Escobar 4/04/2008 Improve checking --> add STATUS=OLD in open_ll(PRE_PGD1.nam,... +!! +!! Modification 30/03/2012 Add NAM_NCOUT for netcdf output (S.Bielli) +!! S.Bielli 23/04/2014 supress writing of LAt and LON in NETCDF case +!! S.Bielli 20/11/2014 add writing of LAt and LON in NETCDF case +!! M.Moge 01/03/2015 use MPPDB + SPLIT_GRID is now called in PGD_GRID. Here we extend +!! the new grid on the halo with EXTEND_GRID_ON_HALO (M.Moge) +!! M.Moge 06/2015 write NDXRATIO,NDYRATIO,NXSIZE,NYSIZE,NXOR,NYOR in .lfi output file +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! J.Escobar : 05/10/2015 : missing JPHEXT for LAT/LON/ZS/ZSMT writing +!! M.Moge 11/2015 disable the creation of files on multiple +!! Z-levels when using parallel IO for PREP_PGD +!! 06/2016 (G.Delautier) phasage surfex 8 +!! P.Wautelet : 08/07/2016 : removed MNH_NCWRIT define +!! 10/2016 (S.Faroux S.Bielli) correction for NHALO=0 +!! 01/2018 (G.Delautier) SURFEX 8.1 +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +!! Q. Rodier 01/2019 : add a new filtering for very high slopes in NAM_ZSFILTER +! P. Wautelet 07/02/2019: force TYPE to a known value for IO_File_add2list +! P. Wautelet 07/02/2019: remove OPARALLELIO argument from open and close files subroutines +! (nsubfiles_ioz is now determined in IO_File_add2list) +! P. Wautelet 14/02/2019: remove CLUOUT/CLUOUT0 and associated variables +! P. Wautelet 06/07/2021: use FINALIZE_MNH +!---------------------------------------------------------------------------- +! +!* 0. DECLARATION +! ----------- +! +USE MODD_CONF, ONLY : CPROGRAM, L1D, L2D, LPACK, LCARTESIAN +USE MODD_CONF_n,ONLY : CSTORAGE_TYPE +USE MODD_LUNIT, ONLY : TLUOUT0 +USE MODD_LUNIT_n,ONLY : LUNIT_MODEL +USE MODD_PARAMETERS, ONLY : XUNDEF +USE MODD_IO, only: TFILEDATA, TFILE_OUTPUTLISTING, TFILE_SURFEX +use modd_precision, only: LFIINT +USE MODD_IO_SURF_MNH, ONLY : NHALO +USE MODD_SPAWN, ONLY : NDXRATIO,NDYRATIO,NXSIZE,NYSIZE,NXOR,NYOR +! +use mode_field, only: Ini_field_list +USE MODE_FINALIZE_MNH, only: FINALIZE_MNH +USE MODE_IO, only: IO_Config_set, IO_Init +USE MODE_IO_FIELD_WRITE, only: IO_Field_write, IO_Header_write +USE MODE_IO_FILE, only: IO_File_close, IO_File_open +USE MODE_IO_MANAGE_STRUCT, only: IO_File_add2list +use mode_ll +USE MODE_MODELN_HANDLER +USE MODE_MSG +USE MODE_POS +! +USE MODI_ZSMT_PGD +! +!JUAN +USE MODN_CONFZ +USE MODD_PARAMETERS, ONLY : JPHEXT +USE MODD_CONF, ONLY : NHALO_CONF_MNH => NHALO +!JUAN +! +USE MODI_READ_ALL_NAMELISTS +USE MODI_VERSION +USE MODI_PGD_GRID_SURF_ATM +USE MODI_SPLIT_GRID +USE MODI_PGD_SURF_ATM +USE MODI_WRITE_PGD_SURF_ATM_N +USE MODD_MNH_SURFEX_n +! +USE MODE_MPPDB +USE MODI_EXTEND_GRID_ON_HALO +! +USE MODN_CONFIO, ONLY : NAM_CONFIO +USE MODE_INI_CST, ONLY: INI_CST +! +IMPLICIT NONE +! +! +!* 0.2 Declaration of local variables +! ------------------------------ +! +INTEGER :: IRESP ! return code for I/O +INTEGER :: ILUOUT0 +INTEGER :: ILUNAM +LOGICAL :: GFOUND +CHARACTER(LEN=28) :: YDAD =' ' ! name of dad of input FM file +CHARACTER(LEN=28) :: CPGDFILE ='PGDFILE' ! name of the output file +CHARACTER(LEN=100) :: YMSG +INTEGER :: NZSFILTER=1 ! number of iteration for filter for fine orography +INTEGER :: NLOCZSFILTER=3 ! number of iteration for filter of local fine orography +LOGICAL :: LHSLOP=.FALSE. ! filtering of local slopes higher than XHSLOP +REAL :: XHSLOP=1.0 ! slopes where the local fine filtering is applied +INTEGER :: NSLEVE =12 ! number of iteration for filter for smooth orography +REAL :: XSMOOTH_ZS = XUNDEF ! optional uniform smooth orography for SLEVE coordinate +REAL, DIMENSION(:,:),ALLOCATABLE :: ZWORK ! work array for lat and lon reshape +REAL, DIMENSION(:,:),ALLOCATABLE :: ZWORK_LAT ! work array for lat and lon reshape +REAL, DIMENSION(:,:),ALLOCATABLE :: ZWORK_LON ! work array for lat and lon reshape +INTEGER :: IIMAX, IJMAX +INTEGER :: NHALO_MNH +TYPE(TFILEDATA),POINTER :: TZFILE => NULL() +TYPE(TFILEDATA),POINTER :: TZNMLFILE => NULL() ! Namelist file +! +NAMELIST/NAM_PGDFILE/CPGDFILE, NHALO +NAMELIST/NAM_ZSFILTER/NZSFILTER,NLOCZSFILTER,LHSLOP,XHSLOP +NAMELIST/NAM_SLEVE/NSLEVE, XSMOOTH_ZS +NAMELIST/NAM_CONF_PGD/JPHEXT, NHALO_MNH +!------------------------------------------------------------------------------ +! +CALL MPPDB_INIT() +! +CPROGRAM='PGD ' +! +!* 1. Set default names and parallelized I/O +! -------------------------------------- +! +CALL IO_Init() +! +NHALO=15 +! +CALL IO_File_add2list(TLUOUT0,'OUTPUT_LISTING0','OUTPUTLISTING','WRITE') +CALL IO_File_open(TLUOUT0) +! +!Set output file for PRINT_MSG +TFILE_OUTPUTLISTING => TLUOUT0 +! +LUNIT_MODEL(1)%TLUOUT => TLUOUT0 +ILUOUT0=TLUOUT0%NLU +! +!JUAN +CALL IO_File_add2list(TZNMLFILE,'PRE_PGD1.nam','NML','READ') +CALL IO_File_open(TZNMLFILE,KRESP=IRESP) +ILUNAM = TZNMLFILE%NLU +IF (IRESP.NE.0 ) THEN + WRITE(YMSG,*) 'file PRE_PGD1.nam not found, IRESP=', IRESP + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','PREP_PGD',YMSG) +ENDIF +!JUAN + +CALL POSNAM(ILUNAM,'NAM_PGDFILE',GFOUND) +IF (GFOUND) READ(UNIT=ILUNAM,NML=NAM_PGDFILE) +CALL POSNAM(ILUNAM,'NAM_ZSFILTER',GFOUND) +IF (GFOUND) READ(UNIT=ILUNAM,NML=NAM_ZSFILTER) +CALL POSNAM(ILUNAM,'NAM_SLEVE',GFOUND) +IF (GFOUND) READ(UNIT=ILUNAM,NML=NAM_SLEVE) +!JUANZ +CALL POSNAM(ILUNAM,'NAM_CONFZ',GFOUND) +IF (GFOUND) READ(UNIT=ILUNAM,NML=NAM_CONFZ) +CALL POSNAM(ILUNAM,'NAM_CONF_PGD',GFOUND) +IF (GFOUND) THEN + NHALO_MNH = NHALO_CONF_MNH + READ(UNIT=ILUNAM,NML=NAM_CONF_PGD) + NHALO_CONF_MNH = NHALO_MNH +ENDIF +!JUANZ +CALL POSNAM(ILUNAM,'NAM_CONFIO',GFOUND) +IF (GFOUND) READ(UNIT=ILUNAM,NML=NAM_CONFIO) +CALL IO_Config_set() +! +CALL IO_File_close(TZNMLFILE) +! +! +CALL SURFEX_ALLOC_LIST(1) +YSURF_CUR => YSURF_LIST(1) +CALL READ_ALL_NAMELISTS(YSURF_CUR,'MESONH','PRE',.FALSE.) +! +CALL INI_FIELD_LIST(1) +! +CALL GOTO_MODEL(1) +CALL GOTO_SURFEX(1) +! +CALL VERSION +CSTORAGE_TYPE = 'PG' +! +CALL INI_CST +! +! +!* 2. Preparation of surface physiographic fields +! ------------------------------------------- +! +!* Initializes the grid +! -------------------- +! +CALL PGD_GRID_SURF_ATM(YSURF_CUR%UG, YSURF_CUR%U,YSURF_CUR%GCP,'MESONH',& + ' ',' ',.FALSE.,HDIR='-') +! +CALL EXTEND_GRID_ON_HALO('MESONH',YSURF_CUR%UG, YSURF_CUR%U,& + YSURF_CUR%UG%G%NGRID_PAR, YSURF_CUR%UG%G%XGRID_PAR) +! +! +!* Initializes all physiographic fields +! ------------------------------------ +! +CALL PGD_SURF_ATM(YSURF_CUR,'MESONH',' ',' ',.FALSE.) +! +! +!* 3. Writes the physiographic fields +! ------------------------------- +! +CALL IO_File_add2list(TZFILE,CPGDFILE,'PGD','WRITE',KLFINPRAR=INT(1,KIND=LFIINT),KLFITYPE=1,KLFIVERB=5) +! +CALL IO_File_open(TZFILE) +! +CALL IO_Header_write(TZFILE) +! +CALL IO_Field_write(TZFILE,'SURF','EXTE') +CALL IO_Field_write(TZFILE,'L1D', L1D) +CALL IO_Field_write(TZFILE,'L2D', L2D) +CALL IO_Field_write(TZFILE,'PACK',LPACK) +IF ( NDXRATIO <= 0 .AND. NDYRATIO <= 0 ) THEN + NDXRATIO = 1 + NDYRATIO = 1 +ENDIF +IF ( NXSIZE < 0 .AND. NYSIZE < 0 ) THEN + NXSIZE = 0 + NYSIZE = 0 +ENDIF +IF ( NXOR <= 0 .AND. NYOR <= 0 ) THEN + NXOR = 1 + NYOR = 1 +ENDIF +CALL IO_Field_write(TZFILE,'DXRATIO',NDXRATIO) +CALL IO_Field_write(TZFILE,'DYRATIO',NDYRATIO) +CALL IO_Field_write(TZFILE,'XSIZE', NXSIZE) +CALL IO_Field_write(TZFILE,'YSIZE', NYSIZE) +CALL IO_Field_write(TZFILE,'XOR', NXOR) +CALL IO_Field_write(TZFILE,'YOR', NYOR) +CALL IO_Field_write(TZFILE,'JPHEXT', JPHEXT) +! +TFILE_SURFEX => TZFILE +ALLOCATE(YSURF_CUR%DUO%CSELECT(0)) +CALL WRITE_PGD_SURF_ATM_n(YSURF_CUR,'MESONH') +NULLIFY(TFILE_SURFEX) !Probably not necessary +! +!* 4. Computes and writes smooth orography for SLEVE coordinate +! --------------------------------------------------------- +CALL ZSMT_PGD(TZFILE,NZSFILTER,NSLEVE,NLOCZSFILTER,LHSLOP,XHSLOP,XSMOOTH_ZS) +! +IF (.NOT.LCARTESIAN) THEN +!!!! WRITE LAT and LON + CALL GET_DIM_PHYS_ll('B',IIMAX,IJMAX) + ALLOCATE(ZWORK(IIMAX+NHALO*2,IJMAX+NHALO*2)) + ALLOCATE(ZWORK_LAT(IIMAX+2*JPHEXT,IJMAX+2*JPHEXT)) + ALLOCATE(ZWORK_LON(IIMAX+2*JPHEXT,IJMAX+2*JPHEXT)) + ZWORK=RESHAPE(YSURF_CUR%UG%G%XLAT, (/ (IIMAX+NHALO*2),(IJMAX+NHALO*2) /) ) + IF (NHALO/=0) THEN + ZWORK_LAT=ZWORK(NHALO:(IIMAX+NHALO+1),NHALO:(IJMAX+NHALO+1)) + ELSE + ZWORK_LAT(2:IIMAX+1,2:IJMAX+1)=ZWORK + ZWORK_LAT(1,:) = ZWORK_LAT(2,:) + ZWORK_LAT(IIMAX+2,:) = ZWORK_LAT(IIMAX+1,:) + ZWORK_LAT(:,1) = ZWORK_LAT(:,2) + ZWORK_LAT(:,IJMAX+2) = ZWORK_LAT(:,IJMAX+1) + ENDIF + ZWORK=RESHAPE(YSURF_CUR%UG%G%XLON, (/ IIMAX+NHALO*2,IJMAX+NHALO*2 /) ) + IF (NHALO/=0) THEN + ZWORK_LON=ZWORK(NHALO:(IIMAX+NHALO+1),NHALO:(IJMAX+NHALO+1)) + ELSE + ZWORK_LON(2:IIMAX+1,2:IJMAX+1)=ZWORK + ZWORK_LON(1,:) = ZWORK_LON(2,:) + ZWORK_LON(IIMAX+2,:) = ZWORK_LON(IIMAX+1,:) + ZWORK_LON(:,1) = ZWORK_LON(:,2) + ZWORK_LON(:,IJMAX+2) = ZWORK_LON(:,IJMAX+1) + ENDIF + CALL IO_Field_write(TZFILE,'LAT',ZWORK_LAT) + CALL IO_Field_write(TZFILE,'LON',ZWORK_LON) + ! + DEALLOCATE(ZWORK,ZWORK_LAT,ZWORK_LON) +END IF +! +! +WRITE(ILUOUT0,*) +WRITE(ILUOUT0,*) '***************************' +WRITE(ILUOUT0,*) '* PREP_PGD ends correctly *' +WRITE(ILUOUT0,*) '***************************' +! +!* 6. Close parallelized I/O +! ---------------------- +! +CALL IO_File_close(TZFILE) +! +CALL FINALIZE_MNH() +! +!------------------------------------------------------------------------------- +! +END PROGRAM PREP_PGD diff --git a/src/mesonh/ext/prep_real_case.f90 b/src/mesonh/ext/prep_real_case.f90 new file mode 100644 index 0000000000000000000000000000000000000000..aab0e905721ea6c4c0292b9c5612b432498356d2 --- /dev/null +++ b/src/mesonh/ext/prep_real_case.f90 @@ -0,0 +1,1420 @@ +!MNH_LIC Copyright 1995-2021 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. +!----------------------------------------------------------------- +! ###################### + PROGRAM PREP_REAL_CASE +! ###################### +! +!!**** *PREP_REAL_CASE* - program to write an initial FM file from real case +!! situation. +!! +!! PURPOSE +!! ------- +!! +!! The purpose of this program is to prepare an initial meso-NH file +!! (LFIFM and DESFM files) filled by some fields of a real situation. +!! General data are given by the MESO-NH user in the namelist file +!! 'PRE_REAL1.nam'. The fields are obtained from three sources: +!! - an atmospheric input file, which can be: +!! * an Aladin file, itself obtained from an Arpege file with +!! the Aladin routine "FULLPOS". +!! * a grib file (ECMWF, Grib Arpege or Grib Aladin) +!! * a MESONH file +!! - an physiographic data file. +!! +!! 1) Fields obtained from the Atmospheric file: +!! ----------------------------------------- +!! +!! - the projection parameters (checked with PGD file): +!! reference latitude and longitude +!! parameter of projection +!! angle of rotation of the domain +!! +!! - the horizontal grid definition (checked with PGD file): +!! grid mesh +!! latitude and longitude of the reference point +!! (with data from PRE_REAL1.nam) +!! +!! - thermodynamical 3D and 2D fields: +!! potential temperature +!! vapor mixing ratio +!! +!! - dynamical fields: +!! three components of the wind +!! +!! - reference anelastic state variables: +!! profile of virtual potential temperature +!! profile of dry density +!! Exner function at model top +!! +!! - total dry air mass +!! +!! +!! 2) Fields obtained from the physiographic data file: +!! ------------------------------------------------ +!! +!! - the projection parameters: +!! reference latitude and longitude +!! parameter of projection +!! angle of rotation of the domain +!! +!! - the horizontal grid definition: +!! grid mesh +!! latitude and longitude of the reference point +!! (with data from PRE_REAL1.nam) +!! - physiografic fields: (orographic, vegetation, soil and radiation fields) +!! +!! +!! 3) Data obtained from the namelist file PRE_REAL1.nam: +!! -------------------------------------------------- +!! +!! - type of equations system +!! - vertical grid definition +!! - number of points in x and y directions +!! - level of verbosity +!! - name of the different files +!! +!! +!!** METHOD +!! ------ +!! In this program, once the MESO-NH domain is calculated, all the +!! 2D or 3D fields are computed on the MESO-NH horizontal domain WITH +!! the external points. This is particularly important for the large +!! scale fields during the MESO-NH run. +!! +!! 1) The following PREP_REAL_CASE program: +!! +!! - set default values for global variables which will be written in +!! DESFM file (by calling DEFAULT_DESFM1); lateral boundary conditions +!! are open. +!! +!! - opens the different files (by calling OPEN_PRC_FILES). +!! +!! - initializes physical constants (by calling INI_CST). +!! +!! - initializes the horizontal domain from the data read in the +!! descriptive part of the Aladin file and the directives read in the +!! namelist file (routines READ_GENERAL and SET_SUBDOMAIN in +!! READ_ALL_DATA). This MESO-NH domain is a part of the Aladin domain. +!! +!! - initializes global variables from namelists and the MESO-NH +!! vertical grid definition variables in the namelist file +!! (routine READ_VER_GRID). +!! +!! - initializes the physiographic 2D fields from the physiographic data +!! file, in particular the MESO-NH orography. +!! +!! - reads the 3D and 2D variable fields in the Grib file +!! (routine READ_ALL_DATA_GRIB_CASE), +!! if HATMFILETYPE='GRIBEX': +!! absolute temperature +!! specific humidity +!! horizontal contravariant wind +!! surface pressure +!! large scale orography +!! +!! - reads the 3D and 2D variable fields in the input MESONH file +!! (routine READ_ALL_DATA_MESONH_CASE), if HATMFILETYPE='MESONH': +!! potential temperature +!! vapor mixing ratio +!! horizontal wind +!! other mixing ratios +!! turbulence prognostic and semi-prognostic variables +!! large scale orography +!! +!! - computes some geometric variables (routines SM_GRIDPROJ and METRICS), +!! in particular: +!! * altitude 3D array +!! * metric coefficients +!! * jacobian +!! +!! - initializes MESO-NH thermodynamical fields: +!! * changes of variables (routine VER_PREP_mmmmmm_CASE): +!! absolute temperature --> virtual potential temperature +!! specific humidity --> vapor mixing ratio +!! * interpolates/extrapolates the fields from the large scale +!! orography to the MESO-NH one (routine VER_INT_THERMO in +!! VER_THERMO, by using a shifting function method). +!! in water vapor case, the interpolations are always performed +!! on relative humidity. +!! * the pressure is computed on each grid by integration of the +!! hydrostatic equation from bottom or top. When input atmospheric +!! file is a MESO-NH one, information about the difference between +!! hydrostatic pressure and total pressure is kept and interpolated +!! during the entire PREP_REAL_CASE process. +!! * interpolates the fields to the MESO-NH vertical grid +!! (also by routine VER_INT_THERMO in VER_THERMO). +!! * computes the potential temperature (routine VER_THERMO). +!! * sets to zero the mixing ratios, except the vapor mixing ratio +!! (VER_THERMO). +!! +!! - initializes the reference anelastic state variables (routine SET_REFZ +!! in VER_THERMO). +!! +!! - computes the total dry air mass (routine DRY_MASS in VER_THERMO). +!! +!! - initializes MESO-NH dynamical variables: +!! * changes Aladin contravariant wind into true horizontal wind +!! (in subroutine VER_PREP). +!! * interpolates/extrapolates the momentum from the large scale +!! orography to the MESO-NH one (routine VER_INT_DYN in +!! VER_DYN, by using a shifting function method). +!! * interpolates the fields to the MESO-NH vertical grid +!! (also by routine VER_INT_DYN in VER_DYN). The fields +!! are located on a horizontal Arakawa A-grid, as the Aladin fields. +!! * The momentum is interpolated to the Arakawa C-grid +!! (routine VER_DYN). +!! * A first guess of the vertical momentum, verifying the +!! uncompressible continuity equation and the material lower boundary +!! condition against the ground, is computed (routine WGUESS). +!! * computes the final non-divergent wind field (routine +!! ANEL_BALANCE). +!! +!! - copies the interpolated fields also at t-dt and in the large scale +!! fields (routine INI_PROG_VAR). +!! +!! - writes the DESFM and LFIFM files (routines WRITE_DESFM1 and +!! WRITE_LFIFM1). +!! +!! +!! 2) Some conventions are used in this program and its subroutines because +!! of the number of different grids and fields: +!! +!! - subscripts: +!! * the subscripts I and J are used for all the horizontal grid. +!! * the subcript K is used for the MESO-NH vertical grid (increasing +!! from bottom to top). +!! * the subscript L is used for the Aladin or input Mesonh grids +!! (increasing from bottom to top). +!! +!! - suffixes: +!! * _LS: +!! If used for a geographic or horizontal grid definition variable, +!! this variable is connected to the large horizontal domain. +!! If used for a surface variable, this variable corresponds to +!! the large scale orography, and therefore will be modified. +!! If used for another variable, this variable is discretized +!! on the Aladin or input MESONH file vertical grid +!! (large-scale orography with input vertical discretization, +!! either coming from eta levels or input Gal-Chen grid). +!! * _MX: +!! Such a variable is discretized on the mixed grid. +!! (large-scale orography with output Gal-Chen vertical grid +!! discretization) +!! * _SH: +!! Such a variable is discretized on the shifted grid. +!! (fine orography with a shifted vertical grid, NOT Gal-Chen) +!! * no suffix: +!! The variable is discretized on the MESO-NH grid. +!! (fine orography with output Gal-Chen vertical grid discretization) +!! +!! - additional pre-suffixes: (for pressure, Exner and altitude fields) +!! * MASS: +!! The variable is discretized on a mass point +!! * FLUX: +!! The variable is discretized on a flux point +!! +!! +!! - names of variables: for a physical variable VAR: +!! * pVARs is the variable itself. +!! * pRHODVARs is the variable multiplied by the dry density rhod. +!! * pRHODJVARs is the variable multiplied by the dry density rhod +!! and the Jacobian. +!! * pRVARs is the variable multiplied by rhod_ref, the anelastic +!! reference state dry density and the Jacobian. +!! where p and s are the appropriate prefix and suffix. +!! +!! - allocation of arrays: the arrays are allocated +!! * just before their initialization for the general arrays stored in +!! modules. +!! * in the subroutine in which they are declared for the local arrays +!! in a subroutine. +!! * in the routine in which they are initialized for the arrays +!! defined in the monitor PREP_REAL_CASE. In this case they are in +!! fact passed as pointer to the subroutines to allow their +!! dynamical allocation (exception which confirms the rule: ZJ). +!! +!! +!! EXTERNAL +!! -------- +!! +!! Routine DEFAULT_DESFM1 : to set default values for variables which can be +!! contained in DESFM file. +!! Routine OPEN_PRC_FILES: to open all files. +!! Routine INI_CST : to initialize physical constants. +!! Routine READ_ALL_DATA_GRIB_CASE : to read all input data. +!! Routine READ_ALL_DATA_MESONH_CASE : to read all input data. +!! Routine SM_GRIDPROJ : to compute some grid variables, in case of +!! conformal projection. +!! Routine METRICS : to compute metric coefficients. +!! Routine VER_PREP_GRIBEX_CASE : to prepare the interpolations. +!! Routine VER_PREP_MESONH_CASE : to prepare the interpolations. +!! Routine VER_THERMO : to perform the interpolation of thermodynamical +!! variables. +!! Routine VER_DYN : to perform the interpolation of dynamical +!! variables. +!! Routine INI_PROG_VAR : to initialize the prognostic varaibles not yet +!! initialized +!! Routine WRITE_DESFM1 : to write a DESFM file. +!! Routine WRITE_LFIFM1 : to write a LFIFM file. +!! Routine IO_File_close : to close a FM-file (DESFM + LFIFM). +!! +!! Module MODE_GRIDPROJ : contains conformal projection routines +!! +!! Module MODI_DEFAULT_DESFM1 : interface module for routine DEFAULT_DESFM1 +!! Module MODI_OPEN_PRC_FILES : interface module for routine OPEN_PRC_FILES +!! Module MODI_READ_ALL_DATA_MESONH_CASE : interface module for routine +!! READ_ALL_DATA_MESONH_CASE +!! Module MODI_METRICS : interface module for routine METRICS +!! Module MODI_VER_PREP_GRIBEX_CASE : interface module for routine +!! VER_PREP_GRIBEX_CASE +!! Module MODI_VER_PREP_MESONH_CASE : interface module for routine +!! VER_PREP_MESONH_CASE +!! Module MODI_VER_THERMO : interface module for routine VER_THERMO +!! Module MODI_VER_DYN : interface module for routine VER_DYN +!! Module MODI_INI_PROG_VAR : interface module for routine INI_PROG_VAR +!! Module MODI_WRITE_DESFM1 : interface module for routine WRITE_DESFM1 +!! Module MODI_WRITE_LFIFM1 : interface module for routine WRITE_LFIFM1 +!! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! Module MODD_CONF : contains configuration variables for all models. +!! NVERB : verbosity level for output-listing +!! Module MODD_CONF1 : contains configuration variables for model 1. +!! NRR : number of moist variables +!! Module MODD_LUNIT : contains logical unit and names of files. +!! Module MODD_LUNIT : contains logical unit and names of files (model1). +!! CINIFILE: name of the FM file which will be used for the MESO-NH run. +!! Module MODD_GRID1 : contains grid variables. +!! XLAT : latitude of the grid points +!! XLON : longitudeof the grid points +!! XXHAT : position xhat in the conformal plane +!! XYHAT : position yhat in the conformal plane +!! XDXHAT : horizontal local meshlength on the conformal plane +!! XDYHAT : horizontal local meshlength on the conformal plane +!! XZS : MESO-NH orography +!! XZZ : altitude +!! XZHAT : height zhat +!! XMAP : map factor +!! Module MODD_LBC1 : contains declaration of lateral boundary conditions +!! CLBCX : X-direction LBC type at left(1) and right(2) boundaries +!! CLBCY : Y-direction LBC type at left(1) and right(2) boundaries +!! Module MODD_PARAM1 : contains declaration of the parameterizations' names +!! +!! REFERENCE +!! --------- +!! +!! Book 2 +!! +!! AUTHOR +!! ------ +!! +!! V.Masson Meteo-France +!! +!! MODIFICATIONS +!! ------------- +!! Original 01/01/95 +!! Sept. 21, 1995 (J.Stein and V.Masson) surface pressure +!! Jan. 09, 1996 (V. Masson) pressure function deduced from +!! hydrostatic pressure +!! Jan. 31, 1996 (V. Masson) possibility to initialize +!! atmospheric fields from MESONH file +!! Mar. 18, 1996 (V. Masson) new vertical extrapolation of Ts +!! in case of initialization with MESONH file +!! Apr 17, 1996 (J. Stein ) change the DEFAULT_DESFM CALL +!! May 25, 1996 (V. Masson) Variable CSTORAGE_TYPE +!! Aug 26, 1996 (V. Masson) Only thinshell approximation is +!! currently available. +!! Sept 24, 1996 (V. Masson) add writing of varaibles for +!! nesting ('DAD_NAME', 'DXRATIO', 'DYRATIO') +!! Oct 11, 1996 (V. Masson) L1D and L2D configurations +!! Oct 28, 1996 (V. Masson) add deallocations and NVERB +!! default set to 1 +!! Dec 02, 1996 (V. Masson) vertical interpolation of +!! surface fields in aladin case +!! Dec 12, 1996 (V. Masson) add LS vertical velocity +!! Jan 16, 1997 (J. Stein) Durran's anelastic system +!! May 07, 1997 (V. Masson) add LS tke +!! Jun 27, 1997 (V. Masson) add absolute pressure +!! Jul 09, 1997 (V. Masson) add namelist NAM_REAL_CONF +!! Jul 10, 1997 (V. Masson) add LS epsilon +!! Aug 25, 1997 (V. Masson) add computing time analysis +!! Jan 20, 1998 (J. Stein) add LB and LS fields +!! Apr, 30, 1998 (V. Masson) Large scale VEG and LAI +!! Jun, 04, 1998 (V. Masson) Large scale D2 and Aladin ISBA +!! files +!! Jun, 04, 1998 (V. Masson) Add new soil interface var. +!! Jan 20, 1999 (J. Stein) add a Boundaries call +!! March 15 1999 (J. Pettre, V. Bousquet and V. Masson) +!! initialization from GRIB files +!! Jul 2000 (F.solmon/V.Masson) Adaptation for patch +!! according to GRIB or MESONH case +!! Nov 22, 2000 (P.Tulet, I. Mallet) initialization +!! from GRIB MOCAGE file +!! Fev 01, 2001 (D.Gazen) add module MODD_NSV for NSV variable +!! Jul 02, 2001 (J.Stein) add LCARTESIAN case +!! Oct 15, 2001 (I.Mallet) allow namelists in different orders +!! Dec 2003 (V.Masson) removes surface calls +!! Jun 01, 2002 (O.Nuissier) filtering of tropical cyclone +!! Aou 09, 2005 (D.Barbary) add CDADATMFILE CDADBOGFILE +!! May 2006 Remove KEPS +!! Feb 02, 2012 (C. Mari) interpolation from MOZART +!! add call to READ_CHEM_NETCDF_CASE & +!! VER_PREP_NETCDF_CASE +!! Mar 2012 Add NAM_NCOUT for netcdf output +!! July 2013 (Bosseur & Filippi) Adds Forefire +!! Mars 2014 (J.Escobar) Missing 'full' UPDATE_METRICS for arp2lfi // run +!! April 2014 (G.TANGUY) Add LCOUPLING +!! 2014 (M.Faivre) +!! Fevr 2015 (M.Moge) Cleaning up +!! Aug 2015 (M.Moge) removing EXTRAPOL on XDXX and XDYY in part 8 +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! M.Leriche 2015 : add LUSECHEM dans NAM_CH_CONF +!! Feb 02, 2012 (C. Mari & BV) interpolation from CAMS +!! add call to READ_CAMS_NETCDF_CASE & +!! VER_PREP_NETCDF_CASE +!! Modification 01/2016 (JP Pinty) Add LIMA +!! Modification 02/2016 (JP Pinty) Convert CAMS mix ratio to nbr conc +! +!! 06/2016 (G.Delautier) phasage surfex 8 +!! P.Wautelet : 08/07/2016 : removed MNH_NCWRIT define +!! B.VIE 2016 : LIMA +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 07/02/2019: force TYPE to a known value for IO_File_add2list +! P. Wautelet 14/02/2019: remove CLUOUT/CLUOUT0 and associated variables +! S. Bielli 02/2019: sea salt: significant sea wave height influences salt emission; 5 salt modes +! P. Wautelet 20/03/2019: missing use MODI_INIT_SALT +! P. Wautelet 20/05/2019: add name argument to ADDnFIELD_ll + new ADD4DFIELD_ll subroutine +! T.Nagel 02/2021: add IBM +! P. Wautelet 06/07/2021: use FINALIZE_MNH +!! M. Leriche 26/01/2022: add reading of CAMS reanalysis for chemistry +!! and/or for LIMA +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_CH_M9_n +USE MODD_CH_MNHC_n, ONLY: LUSECHAQ_n=>LUSECHAQ,LUSECHIC_n=>LUSECHIC, LUSECHEM_n=>LUSECHEM +USE MODD_CONF +USE MODD_CONF_n +USE MODD_CST +USE MODD_DIM_n +!UPG*PT +USE MODD_CH_AEROSOL +USE MODD_DUST, ONLY: LDUST, NMODE_DST, CRGUNITD, XINISIG, XINIRADIUS, XN0MIN,& + LDSTCAMS +!UPG*PT + +USE MODD_DYN_n, CPRESOPT_n=>CPRESOPT, LRES_n=>LRES, XRES_n=>XRES , NITR_n=>NITR +USE MODD_FIELD_n +USE MODD_GR_FIELD_n +USE MODD_GRID +USE MODD_GRID_n +USE MODD_HURR_CONF +USE MODD_IBM_LSF, ONLY: CIBM_TYPE, LIBM_LSF, NIBM_SMOOTH, XIBM_SMOOTH +USE MODD_IBM_PARAM_n, ONLY: XIBM_LS +USE MODD_IO, ONLY: TFILEDATA, TFILE_SURFEX +USE MODD_LBC_n +USE MODD_LSFIELD_n +USE MODD_LUNIT, ONLY: TPGDFILE,TLUOUT0,TOUTDATAFILE +USE MODD_LUNIT_n, ONLY: CINIFILE,TINIFILE,TLUOUT +USE MODD_METRICS_n +USE MODD_MNH_SURFEX_n +USE MODD_NESTING +USE MODD_NSV +USE MODD_PARAMETERS +USE MODD_PARAM_n +USE MODD_PREP_REAL +USE MODD_REF_n +!UPG*PT +USE MODD_SALT, ONLY: LSALT, NMODE_SLT, CRGUNITS, XINISIG_SLT, XINIRADIUS_SLT, XN0MIN_SLT,& + LSLTCAMS +USE MODD_CH_AERO_n, ONLY: XM3D, XRHOP3D, XSIG3D, XRG3D, XN3D, XCTOTA3D +!UPG*PT +USE MODD_TURB_n +! +USE MODE_EXTRAPOL +use mode_field, only: Alloc_field_scalars, Ini_field_list, Ini_field_scalars +USE MODE_FINALIZE_MNH, only: FINALIZE_MNH +USE MODE_GRIDCART +USE MODE_GRIDPROJ +USE MODE_IO, only: IO_Init +USE MODE_IO_FIELD_READ, only: IO_Field_read +USE MODE_IO_FIELD_WRITE, only: IO_Header_write +USE MODE_IO_FILE, only: IO_File_close, IO_File_open +USE MODE_IO_MANAGE_STRUCT, only: IO_File_add2list, IO_File_find_byname +USE MODE_ll +USE MODE_MODELN_HANDLER +USE MODE_MPPDB +USE MODE_MSG +USE MODE_POS +USE MODE_SPLITTINGZ_ll +! +USE MODI_BOUNDARIES +USE MODI_COMPARE_DAD +USE MODI_DEALLOCATE_MODEL1 +USE MODI_DEALLOC_PARA_LL +USE MODI_DEFAULT_DESFM_n +USE MODI_ERROR_ON_TEMPERATURE +USE MODI_IBM_INIT_LS +USE MODI_INI_PROG_VAR +USE MODI_INIT_SALT +USE MODI_LIMA_MIXRAT_TO_NCONC +USE MODI_METRICS +USE MODI_MNHREAD_ZS_DUMMY_n +USE MODI_MNHWRITE_ZS_DUMMY_n +USE MODI_OPEN_PRC_FILES +USE MODI_PREP_SURF_MNH +USE MODI_PRESSURE_IN_PREP +USE MODI_READ_ALL_DATA_GRIB_CASE +USE MODI_READ_ALL_DATA_MESONH_CASE +USE MODI_READ_ALL_NAMELISTS +!UPG*PT +!USE MODI_READ_CAMS_DATA_NETCDF_CASE +!USE MODI_READ_CHEM_DATA_NETCDF_CASE +USE MODI_READ_CHEM_DATA_MOZART_CASE +USE MODI_READ_CHEM_DATA_CAMS_CASE +USE MODI_READ_LIMA_DATA_NETCDF_CASE +USE MODI_AER2LIMA +USE MODI_CH_AER_EQM_INIT_n +!UPG*PT +USE MODI_READ_VER_GRID +USE MODI_SECOND_MNH +USE MODI_SET_REF +USE MODI_UPDATE_METRICS +USE MODI_VER_DYN +USE MODI_VER_PREP_GRIBEX_CASE +USE MODI_VER_PREP_MESONH_CASE +USE MODI_VER_PREP_NETCDF_CASE +USE MODI_VERSION +USE MODI_VER_THERMO +USE MODI_WRITE_DESFM_n +USE MODI_WRITE_LFIFM_n +! +USE MODN_CONF, ONLY: JPHEXT , NHALO +USE MODN_CONFZ +USE MODN_PARAM_LIMA +USE MODI_INI_CST, ONLY: INI_CST +! +IMPLICIT NONE +! +!* 0.1 Declaration of local variables +! ------------------------------ +! +CHARACTER(LEN=28) :: YATMFILE ! name of the Atmospheric file +CHARACTER(LEN=6) :: YATMFILETYPE! type of the Atmospheric file +CHARACTER(LEN=28) :: YCHEMFILE ! name of the Chemical file +CHARACTER(LEN=6) :: YCHEMFILETYPE! type of the Chemical file +!UP*PT +!CHARACTER(LEN=28) :: YCAMSFILE ! name of the input CAMS file +!CHARACTER(LEN=6) :: YCAMSFILETYPE! type of the input CAMS file +CHARACTER(LEN=28) :: YLIMAFILE ! name of the input MACC file +CHARACTER(LEN=6) :: YLIMAFILETYPE! type of the input MACC file +!UP*PT +CHARACTER(LEN=28) :: YSURFFILE ! name of the Surface file +CHARACTER(LEN=6) :: YSURFFILETYPE! type of the Surface file +CHARACTER(LEN=28) :: YPGDFILE ! name of the physiographic data +! ! file +! +CHARACTER(LEN=28) :: YDAD_NAME ! true name of the atmospheric file +! +!* other variables +! +REAL,DIMENSION(:,:,:), ALLOCATABLE:: ZJ ! Jacobian +! +!* file management variables and counters +! +INTEGER :: ILUOUT0 ! logical unit for listing file +INTEGER :: IPRE_REAL1 ! logical unit for namelist file +INTEGER :: IRESP ! return code in FM routines +LOGICAL :: GFOUND ! Return code when searching namelist +INTEGER :: NIU,NJU,NKU ! Upper bounds in x,y,z directions +! +REAL :: ZSTART, ZEND, ZTIME1, ZTIME2, ZTOT, ZALL ! for computing time analysis +REAL :: ZMISC, ZREAD, ZHORI, ZPREP, ZSURF, ZTHERMO, ZDYN, ZDIAG, ZWRITE +REAL :: ZDG ! diagnostics time in routines +INTEGER :: IINFO_ll ! return code of // routines +! Namelist model variables +CHARACTER(LEN=5) :: CPRESOPT +INTEGER :: NITR +LOGICAL :: LRES +REAL :: XRES +LOGICAL :: LSHIFT ! flag to perform vertical shift or not. +LOGICAL :: LDUMMY_REAL ! flag to read and interpolate + !dummy fields from GRIBex file +INTEGER :: JRR ! loop counter for moist var. +LOGICAL :: LUSECHAQ +LOGICAL :: LUSECHIC +LOGICAL :: LUSECHEM +INTEGER :: JN +! +TYPE(TFILEDATA),POINTER :: TZATMFILE => NULL() +TYPE(TFILEDATA),POINTER :: TZPRE_REAL1FILE => NULL() +! +! +!* 0.3 Declaration of namelists +! ------------------------ +! +NAMELIST/NAM_REAL_CONF/ NVERB, CEQNSYS, CPRESOPT, LSHIFT, LDUMMY_REAL, & + LRES, XRES, NITR,LCOUPLING, NHALO , JPHEXT +! Filtering and balancing of the large-scale and radar tropical cyclone +NAMELIST/NAM_HURR_CONF/ LFILTERING, CFILTERING, & +XLAMBDA, NK, XLATGUESS, XLONGUESS, XBOXWIND, XRADGUESS, NPHIL, NDIAG_FILT, & +NLEVELR0,LBOGUSSING, & +XLATBOG, XLONBOG, XVTMAXSURF, XRADWINDSURF, & +XMAX, XC, XRHO_Z, XRHO_ZZ, XB_0, XBETA_Z, XBETA_ZZ,& +XANGCONV0, XANGCONV1000, XANGCONV2000, & + CDADATMFILE, CDADBOGFILE + NAMELIST/NAM_AERO_CONF/ LORILAM, LINITPM, LDUST, XINIRADIUSI, XINIRADIUSJ,& + XINISIGI, XINISIGJ, XN0IMIN, XN0JMIN, CRGUNIT, CRGUNITD,& + LSALT, CRGUNITS, NMODE_DST, XINISIG, XINIRADIUS, XN0MIN,& +!UPG*PT + XINISIG_SLT, XINIRADIUS_SLT, XN0MIN_SLT, NMODE_SLT, & + LDSTCAMS, LSLTCAMS,CACTCCN,CCLOUD, NMOD_IFN, NMOD_CCN +!UPG*PT + +NAMELIST/NAM_CH_CONF/ LUSECHAQ,LUSECHIC,LUSECHEM +! +NAMELIST/NAM_IBM_LSF/ LIBM_LSF, CIBM_TYPE, NIBM_SMOOTH, XIBM_SMOOTH +! +! name of dad of input FM file +INTEGER :: II, IJ, IGRID, ILENGTH +CHARACTER (LEN=100) :: HCOMMENT +TYPE(LIST_ll), POINTER :: TZFIELDS_ll=>NULL() ! list of fields to exchange +!UPG*PT +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZLBXRHO, ZLBYRHO +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZLBXZZ, ZLBYZZ +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZLBXPABST, ZLBYPABST +INTEGER :: ILBX,ILBY,IIB,IJB,IIE,IJE +!UPG*PT + +!------------------------------------------------------------------------------- +! +CALL MPPDB_INIT() +! +CALL GOTO_MODEL(1,ONOFIELDLIST=.TRUE.) +! +ZDIAG = 0. +CALL SECOND_MNH (ZSTART) +! +ZHORI = 0. +ZSURF = 0. +ZTIME1 = ZSTART +! +!* 1. SET DEFAULT VALUES +! ------------------ +! +CALL VERSION +CPROGRAM='REAL ' +! +CALL ALLOC_FIELD_SCALARS() +CALL DEFAULT_DESFM_n(1) +NRR=1 +IDX_RVT = 1 +! +!------------------------------------------------------------------------------- +! +!* 2. OPENNING OF THE FILES +! --------------------- +CALL IO_Init() +! +CALL OPEN_PRC_FILES(TZPRE_REAL1FILE,YATMFILE, YATMFILETYPE,TZATMFILE & + ,YCHEMFILE,YCHEMFILETYPE & + ,YSURFFILE,YSURFFILETYPE & + ,YPGDFILE,TPGDFILE & +!UPG*PT +! ,YCAMSFILE,YCAMSFILETYPE) + ,YLIMAFILE,YLIMAFILETYPE) +!UPG*PT +ILUOUT0 = TLUOUT0%NLU +TLUOUT => TLUOUT0 +! +IF (YATMFILETYPE=='MESONH') THEN + LSHIFT = .FALSE. +ELSE IF (YATMFILETYPE=='GRIBEX') THEN + LSHIFT = .TRUE. +ELSE + LSHIFT = .TRUE. + WRITE(ILUOUT0,FMT=*) 'HATMFILETYPE WAS SET TO: '//TRIM(YATMFILETYPE) + WRITE(ILUOUT0,FMT=*) 'ONLY TWO VALUES POSSIBLE FOR HATMFILETYPE:' + WRITE(ILUOUT0,FMT=*) 'EITHER MESONH OR GRIBEX' + WRITE(ILUOUT0,FMT=*) '-> JOB ABORTED' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','PREP_REAL_CASE','') +END IF +! +LCPL_AROME=.FALSE. +LCOUPLING=.FALSE. +! +!------------------------------------------------------------------------------- +! +!* 3. INITIALIZATION OF PHYSICAL CONSTANTS +! ------------------------------------ +! +CALL INI_CST +! +!------------------------------------------------------------------------------- +! +!* 4. READING OF NAMELIST +! ------------------- +! +!* 4.1 reading of configuration variables +! +IPRE_REAL1 = TZPRE_REAL1FILE%NLU +! +CALL INIT_NMLVAR +CALL POSNAM(IPRE_REAL1,'NAM_REAL_CONF',GFOUND,ILUOUT0) +IF (GFOUND) READ(IPRE_REAL1,NAM_REAL_CONF) +CALL POSNAM(IPRE_REAL1,'NAM_PARAM_LIMA',GFOUND,ILUOUT0) +IF (GFOUND) READ(IPRE_REAL1,NAM_PARAM_LIMA) +! +CALL INI_FIELD_LIST(1) +! +CALL INI_FIELD_SCALARS() +! +!* 4.2 reading of values of some configuration variables in namelist +! +! +!JUAN REALZ from prep_surfex +! +IF (YATMFILETYPE == 'GRIBEX') THEN +! +!* 4.1 Vertical Spatial grid +! +CALL INIT_NMLVAR() +CALL READ_VER_GRID(TZPRE_REAL1FILE) +! +CALL IO_Field_read(TPGDFILE,'IMAX',NIMAX) +CALL IO_Field_read(TPGDFILE,'JMAX',NJMAX) +! +NIMAX_ll=NIMAX !! _ll variables are global variables +NJMAX_ll=NJMAX !! but the old names are kept in PRE_IDEA1.nam file +! +CALL SET_JP_ll(JPMODELMAX,JPHEXT,JPVEXT,JPHEXT) +CALL SET_DAD0_ll() +!JUAN 4/04/2014 correction for PREP_REAL_CASE on Gribex files +!CALL SET_DIM_ll(NIMAX_ll, NJMAX_ll, 128) +CALL SET_DIM_ll(NIMAX_ll, NJMAX_ll, NKMAX) +CALL SET_LBX_ll('OPEN',1) +CALL SET_LBY_ll('OPEN', 1) +CALL SET_XRATIO_ll(1, 1) +CALL SET_YRATIO_ll(1, 1) +CALL SET_XOR_ll(1, 1) +CALL SET_XEND_ll(NIMAX_ll+2*JPHEXT, 1) +CALL SET_YOR_ll(1, 1) +CALL SET_YEND_ll(NJMAX_ll+2*JPHEXT, 1) +CALL SET_DAD_ll(0, 1) +!JUANZ +!CALL INI_PARA_ll(IINFO_ll) +CALL INI_PARAZ_ll(IINFO_ll) +!JUANZ + +! +! sizes of arrays of the extended sub-domain +! +CALL GET_DIM_PHYS_ll('B',NIMAX,NJMAX) +!!$CALL GET_DIM_EXT_ll('B',NIU,NJU) +!!$CALL GET_INDICE_ll(NIB,NJB,NIE,NJE) +!!$CALL GET_OR_ll('B',IXOR,IYOR) +ENDIF +!JUAN REALZ +! +LDUMMY_REAL= .FALSE. +LFILTERING= .FALSE. +CFILTERING= 'UVT ' +XLATGUESS= XUNDEF ; XLONGUESS= XUNDEF ; XBOXWIND=XUNDEF; XRADGUESS= XUNDEF +NK=50 ; XLAMBDA=0.2 ; NPHIL=24 +NLEVELR0=15 +NDIAG_FILT=-1 +LBOGUSSING= .FALSE. +XLATBOG= XUNDEF ; XLONBOG= XUNDEF +XVTMAXSURF= XUNDEF ; XRADWINDSURF= XUNDEF +XMAX=16000. ; XC=0.7 ; XRHO_Z=-0.3 ; XRHO_ZZ=0.9 +XB_0=1.65 ; XBETA_Z=-0.5 ; XBETA_ZZ=0.35 +XANGCONV0=0. ; XANGCONV1000=0. ; XANGCONV2000=0. +CDADATMFILE=' ' ; CDADBOGFILE=' ' +! +CALL INIT_NMLVAR +CALL POSNAM(IPRE_REAL1,'NAM_REAL_CONF',GFOUND,ILUOUT0) +IF (GFOUND) READ(IPRE_REAL1,NAM_REAL_CONF) +CALL POSNAM(IPRE_REAL1,'NAM_HURR_CONF',GFOUND,ILUOUT0) +IF (GFOUND) READ(IPRE_REAL1,NAM_HURR_CONF) +CALL POSNAM(IPRE_REAL1,'NAM_CH_CONF',GFOUND,ILUOUT0) +IF (GFOUND) READ(UNIT=IPRE_REAL1,NML=NAM_CH_CONF) +CALL UPDATE_MODD_FROM_NMLVAR +CALL POSNAM(IPRE_REAL1,'NAM_AERO_CONF',GFOUND,ILUOUT0) +IF (GFOUND) READ(IPRE_REAL1,NAM_AERO_CONF) +CALL POSNAM(IPRE_REAL1,'NAM_CONFZ',GFOUND,ILUOUT0) +IF (GFOUND) READ(UNIT=IPRE_REAL1,NML=NAM_CONFZ) +CALL POSNAM(IPRE_REAL1,'NAM_IBM_LSF' ,GFOUND,ILUOUT0) +IF (GFOUND) READ(UNIT=IPRE_REAL1,NML=NAM_IBM_LSF) +! +! Sea salt +CALL INIT_SALT +! +!* 4.3 set soil scheme to ISBA for initialization from GRIB +! +IF (YATMFILETYPE=='GRIBEX') THEN + CLBCX(:) ='OPEN' + CLBCY(:) ='OPEN' +END IF +! +CALL SECOND_MNH(ZTIME2) +ZMISC = ZTIME2 - ZTIME1 +!------------------------------------------------------------------------------- +! +!* 5. READING OF THE INPUT DATA +! ------------------------- +! +ZTIME1 = ZTIME2 +! +IF (YATMFILETYPE=='MESONH') THEN + CALL READ_ALL_DATA_MESONH_CASE(TZPRE_REAL1FILE,YATMFILE,TPGDFILE,YDAD_NAME) +ELSE IF (YATMFILETYPE=='GRIBEX') THEN + IF(LEN_TRIM(YCHEMFILE)>0 .AND. YCHEMFILETYPE=='GRIBEX')THEN + CALL READ_ALL_DATA_GRIB_CASE('ATM1',TZPRE_REAL1FILE,YATMFILE,TPGDFILE,ZHORI,NVERB,LDUMMY_REAL) + ELSE + CALL READ_ALL_DATA_GRIB_CASE('ATM0',TZPRE_REAL1FILE,YATMFILE,TPGDFILE,ZHORI,NVERB,LDUMMY_REAL) + END IF +! + YDAD_NAME=' ' +END IF +! +IF (NIMAX==1 .AND. NJMAX==1) THEN + L1D=.TRUE. + L2D=.FALSE. +ELSE IF (NJMAX==1) THEN + L1D=.FALSE. + L2D=.TRUE. +ELSE + L1D=.FALSE. + L2D=.FALSE. +END IF +! +! UPG*PT +!* 5.1 reading of the input chemical data +! +!IF(LEN_TRIM(YCHEMFILE)>0)THEN +! ! read again Nam_aero_conf +! CALL POSNAM(IPRE_REAL1,'NAM_AERO_CONF',GFOUND,ILUOUT0) +! IF (GFOUND) READ(IPRE_REAL1,NAM_AERO_CONF) +! IF(YCHEMFILETYPE=='GRIBEX') & +! CALL READ_ALL_DATA_GRIB_CASE('CHEM',TZPRE_REAL1FILE,YCHEMFILE,TPGDFILE,ZHORI,NVERB,LDUMMY_REAL) +! IF (YCHEMFILETYPE=='NETCDF') & +! CALL READ_CHEM_DATA_NETCDF_CASE(TZPRE_REAL1FILE,YCHEMFILE,TPGDFILE,ZHORI,NVERB,LDUMMY_REAL) +!END IF +! +!* 5.2 reading the input CAMS data +! +!IF(LEN_TRIM(YCAMSFILE)>0)THEN +! IF(YCAMSFILETYPE=='NETCDF') THEN +! CALL READ_CAMS_DATA_NETCDF_CASE(TZPRE_REAL1FILE,YCAMSFILE,TPGDFILE,ZHORI,NVERB,LDUMMY_REAL) +! ELSE +! CALL PRINT_MSG(NVERB_FATAL,'GEN','PREP_REAL_CASE','CANNOT READ CAMS GRIB FILES YET') +! END IF +!END IF +!* 5.1 reading CAMS or MACC files for init LIMA +! +IF(LEN_TRIM(YLIMAFILE)>0)THEN + IF(YLIMAFILETYPE=='NETCDF') THEN + CALL READ_LIMA_DATA_NETCDF_CASE(TZPRE_REAL1FILE,YLIMAFILE,TPGDFILE,ZHORI,NVERB,LDUMMY_REAL) + ELSE + WRITE(ILUOUT0,FMT=*) + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','PREP_REAL_CASE','Pb in MACC/CAMS file') + STOP + END IF +END IF +! +!* 5.2 reading of the input chemical data + dusts + salts if needed +! +IF(LEN_TRIM(YCHEMFILE)>0)THEN + ! read again Nam_aero_conf + CALL POSNAM(IPRE_REAL1,'NAM_AERO_CONF',GFOUND,ILUOUT0) + IF (GFOUND) READ(IPRE_REAL1,NAM_AERO_CONF) + IF(YCHEMFILETYPE=='GRIBEX') & + CALL READ_ALL_DATA_GRIB_CASE('CHEM',TZPRE_REAL1FILE,YCHEMFILE,TPGDFILE,ZHORI,NVERB,LDUMMY_REAL) + IF (YCHEMFILETYPE=='MOZART') & + CALL READ_CHEM_DATA_MOZART_CASE(TZPRE_REAL1FILE,YCHEMFILE,TPGDFILE,ZHORI,NVERB,LDUMMY_REAL) + IF (YCHEMFILETYPE=='CAMSEU') & + CALL READ_CHEM_DATA_CAMS_CASE(TZPRE_REAL1FILE,YCHEMFILE,TPGDFILE,ZHORI,NVERB, & + LDUMMY_REAL,LUSECHEM) +END IF + +!UPG*PT +! +CALL IO_File_close(TZPRE_REAL1FILE) +! +CALL SECOND_MNH(ZTIME2) +ZREAD = ZTIME2 - ZTIME1 - ZHORI +!------------------------------------------------------------------------------- +! +CALL IO_File_add2list(TINIFILE,CINIFILE,'MNH','WRITE',KLFITYPE=1,KLFIVERB=NVERB) +CALL IO_File_open(TINIFILE) +! +ZTIME1=ZTIME2 +! +!* 6. CONFIGURATION VARIABLES +! ----------------------- +! +!* 6.1 imposed values of some other configuration variables +! +CDCONV='NONE' +CSCONV='NONE' +CRAD='NONE' +CCONF='START' +NRIMX=6 +NRIMY=6 +LHORELAX_UVWTH=.TRUE. +LHORELAX_RV=LUSERV +LHORELAX_RC=LUSERC +LHORELAX_RR=LUSERR +LHORELAX_RI=LUSERI +LHORELAX_RS=LUSERS +LHORELAX_RG=LUSERG +LHORELAX_RH=LUSERH +LHORELAX_SV(:)=.FALSE. +LHORELAX_SVC2R2 = (NSV_C2R2 > 0) +LHORELAX_SVC1R3 = (NSV_C1R3 > 0) +LHORELAX_SVLIMA = (NSV_LIMA > 0) +LHORELAX_SVELEC = (NSV_ELEC > 0) +LHORELAX_SVCHEM = (NSV_CHEM > 0) +LHORELAX_SVCHIC = (NSV_CHIC > 0) +LHORELAX_SVDST = (NSV_DST > 0) +LHORELAX_SVSLT = (NSV_SLT > 0) +LHORELAX_SVAER = (NSV_AER > 0) +LHORELAX_SVPP = (NSV_PP > 0) +#ifdef MNH_FOREFIRE +LHORELAX_SVFF = (NSV_FF > 0) +#endif +LHORELAX_SVCS = (NSV_CS > 0) + +LHORELAX_SVLG = .FALSE. +LHORELAX_SV(1:NSV)=.TRUE. +IF ( CTURB /= 'NONE') THEN + LHORELAX_TKE = .TRUE. +ELSE + LHORELAX_TKE = .FALSE. +END IF +! +! +CSTORAGE_TYPE='TT' +!------------------------------------------------------------------------------- +! +!* 8. COMPUTATION OF GEOMETRIC VARIABLES +! ---------------------------------- +! +ZTIME1 = ZTIME2 +! +ALLOCATE(XMAP(SIZE(XXHAT),SIZE(XYHAT))) +ALLOCATE(XLAT(SIZE(XXHAT),SIZE(XYHAT))) +ALLOCATE(XLON(SIZE(XXHAT),SIZE(XYHAT))) +ALLOCATE(XDXHAT(SIZE(XXHAT))) +ALLOCATE(XDYHAT(SIZE(XYHAT))) +ALLOCATE(XZZ(SIZE(XXHAT),SIZE(XYHAT),SIZE(XZHAT))) +ALLOCATE(ZJ(SIZE(XXHAT),SIZE(XYHAT),SIZE(XZHAT))) +! +IF (LCARTESIAN) THEN + CALL SM_GRIDCART(XXHAT,XYHAT,XZHAT,XZS,LSLEVE,XLEN1,XLEN2,XZSMT,XDXHAT,XDYHAT,XZZ,ZJ) + XMAP=1. +ELSE + CALL SM_GRIDPROJ(XXHAT,XYHAT,XZHAT,XZS, & + LSLEVE,XLEN1,XLEN2,XZSMT,XLATORI,XLONORI, & + XMAP,XLAT,XLON,XDXHAT,XDYHAT,XZZ,ZJ ) +END IF +! +CALL MPPDB_CHECK2D(XZS,"prep_real_case8:XZS",PRECISION) +CALL MPPDB_CHECK2D(XMAP,"prep_real_case8:XMAP",PRECISION) +CALL MPPDB_CHECK2D(XLAT,"prep_real_case8:XLAT",PRECISION) +CALL MPPDB_CHECK2D(XLON,"prep_real_case8:XLON",PRECISION) +CALL MPPDB_CHECK3D(XZZ,"prep_real_case8:XZZ",PRECISION) +CALL MPPDB_CHECK3D(ZJ,"prep_real_case8:ZJ",PRECISION) +! +ALLOCATE(XDXX(SIZE(XXHAT),SIZE(XYHAT),SIZE(XZHAT))) +ALLOCATE(XDYY(SIZE(XXHAT),SIZE(XYHAT),SIZE(XZHAT))) +ALLOCATE(XDZX(SIZE(XXHAT),SIZE(XYHAT),SIZE(XZHAT))) +ALLOCATE(XDZY(SIZE(XXHAT),SIZE(XYHAT),SIZE(XZHAT))) +ALLOCATE(XDZZ(SIZE(XXHAT),SIZE(XYHAT),SIZE(XZHAT))) +! +!20131024 add update halo +!=> corrects on PDXX calculation in metrics and XDXX !! +CALL ADD3DFIELD_ll( TZFIELDS_ll, XZZ, 'PREP_REAL_CASE::XZZ' ) +CALL UPDATE_HALO_ll(TZFIELDS_ll,IINFO_ll) +CALL CLEANLIST_ll(TZFIELDS_ll) +! +CALL METRICS(XMAP,XDXHAT,XDYHAT,XZZ,XDXX,XDYY,XDZX,XDZY,XDZZ) +! +CALL MPPDB_CHECK3D(XDXX,"prc8-beforeupdate_metrics:PDXX",PRECISION) +CALL MPPDB_CHECK3D(XDYY,"prc8-beforeupdate_metrics:PDYY",PRECISION) +CALL MPPDB_CHECK3D(XDZX,"prc8-beforeupdate_metrics:PDZX",PRECISION) +CALL MPPDB_CHECK3D(XDZY,"prc8-beforeupdate_metrics:PDZY",PRECISION) +! +CALL UPDATE_METRICS(CLBCX,CLBCY,XDXX,XDYY,XDZX,XDZY,XDZZ) +! +!20131112 add update_halo for XDYY and XDZY!! +CALL ADD3DFIELD_ll( TZFIELDS_ll, XDXX, 'PREP_REAL_CASE::XDXX' ) +CALL ADD3DFIELD_ll( TZFIELDS_ll, XDZX, 'PREP_REAL_CASE::XDZX' ) +CALL ADD3DFIELD_ll( TZFIELDS_ll, XDYY, 'PREP_REAL_CASE::XDYY' ) +CALL ADD3DFIELD_ll( TZFIELDS_ll, XDZY, 'PREP_REAL_CASE::XDZY' ) +CALL UPDATE_HALO_ll(TZFIELDS_ll,IINFO_ll) +CALL CLEANLIST_ll(TZFIELDS_ll) + +!CALL EXTRAPOL('W',XDXX,XDZX) +!CALL EXTRAPOL('S',XDYY,XDZY) + +CALL SECOND_MNH(ZTIME2) + +ZMISC = ZMISC + ZTIME2 - ZTIME1 +!------------------------------------------------------------------------------- +! +!* 9. PREPARATION OF THE VERTICAL SHIFT AND INTERPOLATION +! --------------------------------------------------- +! +ZTIME1 = ZTIME2 +! +IF (YATMFILETYPE=='GRIBEX') THEN + CALL VER_PREP_GRIBEX_CASE('ATM ',ZDG) +ELSE IF (YATMFILETYPE=='MESONH') THEN + CALL VER_PREP_MESONH_CASE(ZDG) +END IF +! +IF (LEN_TRIM(YCHEMFILE)>0 .AND. YCHEMFILETYPE=='GRIBEX') THEN + CALL VER_PREP_GRIBEX_CASE('CHEM',ZDG) +END IF +!UPG*PT +!IF ((LEN_TRIM(YCHEMFILE)>0 .AND. YCHEMFILETYPE=='NETCDF') .OR. & +! (LEN_TRIM(YCAMSFILE)>0 .AND. YCAMSFILETYPE=='NETCDF')) THEN +! CALL VER_PREP_NETCDF_CASE(ZDG) +!END IF +IF (LEN_TRIM(YCHEMFILE)>0 .AND. ((YCHEMFILETYPE=='MOZART').OR. & + (YCHEMFILETYPE=='CAMSEU'))) THEN + CALL VER_PREP_NETCDF_CASE(ZDG,XSV_LS) + + DEALLOCATE(XSV_LS) +END IF +! +IF (LEN_TRIM(YLIMAFILE)>0 .AND. YLIMAFILETYPE=='NETCDF') THEN + CALL VER_PREP_NETCDF_CASE(ZDG,XSV_LS_LIMA) + DEALLOCATE(XSV_LS_LIMA) +END IF +!UPG*PT +! +CALL SECOND_MNH(ZTIME2) +ZPREP = ZTIME2 - ZTIME1 - ZDG +ZDIAG = ZDIAG + ZDG +!------------------------------------------------------------------------------- +! +!* 10. VERTICAL INTERPOLATION OF ALL THERMODYNAMICAL VARIABLES +! ------------------------------------------------------- +! +ZTIME1 = ZTIME2 +! +ALLOCATE(XPSURF(SIZE(XXHAT),SIZE(XYHAT))) +! +CALL EXTRAPOL('E',XEXNTOP2D) +IF (YATMFILETYPE=='GRIBEX') THEN + CALL VER_THERMO(TINIFILE,LSHIFT,XTHV_MX,XR_MX,XZS_LS,XZSMT_LS,XZMASS_MX,XZFLUX_MX,XPMHP_MX,ZJ, & + XDXX,XDYY,XEXNTOP2D,XPSURF,ZDG ) +ELSE IF (YATMFILETYPE=='MESONH') THEN + CALL VER_THERMO(TINIFILE,LSHIFT,XTHV_MX,XR_MX,XZS_LS,XZSMT_LS,XZMASS_MX,XZFLUX_MX,XPMHP_MX,ZJ, & + XDXX,XDYY,XEXNTOP2D,XPSURF,ZDG, & + XLSTH_MX,XLSRV_MX ) +END IF +! +CALL SECOND_MNH(ZTIME2) +ZTHERMO = ZTIME2 - ZTIME1 - ZDG +ZDIAG = ZDIAG + ZDG +!------------------------------------------------------------------------------- +! +!* 12. VERTICAL INTERPOLATION OF DYNAMICAL VARIABLES +! --------------------------------------------- +! +ZTIME1 = ZTIME2 +IF (YATMFILETYPE=='GRIBEX') THEN + CALL VER_DYN(LSHIFT,XU_MX,XV_MX,XW_MX,XRHOD_MX,XZFLUX_MX,XZMASS_MX,XZS_LS, & + XDXX,XDYY,XDZZ,XDZX,XDZY,ZJ,YATMFILETYPE ) +ELSE IF (YATMFILETYPE=='MESONH') THEN + CALL VER_DYN(LSHIFT,XU_MX,XV_MX,XW_MX,XRHOD_MX,XZFLUX_MX,XZMASS_MX,XZS_LS, & + XDXX,XDYY,XDZZ,XDZX,XDZY,ZJ,YATMFILETYPE, & + XLSU_MX,XLSV_MX,XLSW_MX ) +END IF +! +! +IF (ALLOCATED(XTHV_MX)) DEALLOCATE(XTHV_MX) +IF (ALLOCATED(XR_MX)) DEALLOCATE(XR_MX) +IF (ALLOCATED(XPMHP_MX)) DEALLOCATE(XPMHP_MX) +IF (ALLOCATED(XU_MX)) DEALLOCATE(XU_MX) +IF (ALLOCATED(XV_MX)) DEALLOCATE(XV_MX) +IF (ALLOCATED(XW_MX)) DEALLOCATE(XW_MX) +IF (ALLOCATED(XLSTH_MX)) DEALLOCATE(XLSTH_MX) +IF (ALLOCATED(XLSRV_MX)) DEALLOCATE(XLSRV_MX) +IF (ALLOCATED(XLSU_MX)) DEALLOCATE(XLSU_MX) +IF (ALLOCATED(XLSV_MX)) DEALLOCATE(XLSV_MX) +IF (ALLOCATED(XLSW_MX)) DEALLOCATE(XLSW_MX) +IF (ALLOCATED(XZFLUX_MX)) DEALLOCATE(XZFLUX_MX) +IF (ALLOCATED(XZMASS_MX)) DEALLOCATE(XZMASS_MX) +IF (ALLOCATED(XRHOD_MX)) DEALLOCATE(XRHOD_MX) +IF (ALLOCATED(XEXNTOP2D)) DEALLOCATE(XEXNTOP2D) +IF (ALLOCATED(XZS_LS)) DEALLOCATE(XZS_LS) +IF (ALLOCATED(XZSMT_LS)) DEALLOCATE(XZSMT_LS) +! +!------------------------------------------------------------------------------- +! +!* 13. ANELASTIC CORRECTION +! -------------------- +! +CALL PRESSURE_IN_PREP(XDXX,XDYY,XDZX,XDZY,XDZZ) +! +CALL SECOND_MNH(ZTIME2) +ZDYN = ZTIME2 - ZTIME1 +! +!------------------------------------------------------------------------------- +! +!* 14. INITIALIZATION OF THE REMAINING PROGNOSTIC VARIABLES (COPIES) +! ------------------------------------------------------------- +! +ZTIME1 = ZTIME2 +! +IF(LEN_TRIM(YCHEMFILE)>0 .AND. YCHEMFILETYPE=='MESONH')THEN + CALL INI_PROG_VAR(XTKE_MX,XSV_MX,YCHEMFILE) + LHORELAX_SVCHEM = (NSV_CHEM > 0) + LHORELAX_SVCHIC = (NSV_CHIC > 0) + LHORELAX_SVDST = (NSV_DST > 0) + LHORELAX_SVSLT = (NSV_SLT > 0) + LHORELAX_SVAER = (NSV_AER > 0) +ELSE +! +!UPG*PT +!IF (LEN_TRIM(YCAMSFILE)>0 .AND. YCAMSFILETYPE=='NETCDF') THEN +IF (LEN_TRIM(YLIMAFILE)>0 .AND. YLIMAFILETYPE=='NETCDF') THEN +!UPG*PT + CALL LIMA_MIXRAT_TO_NCONC(XPABST, XTHT, XRT(:,:,:,1), XSV_MX) +END IF +! + CALL INI_PROG_VAR(XTKE_MX,XSV_MX) +END IF +! + +! Initialization of ORILAM variables +IF (LORILAM) THEN + IF (.NOT.(ASSOCIATED(XN3D))) ALLOCATE(XN3D(SIZE(XSVT,1),SIZE(XSVT,2),SIZE(XSVT,3),JPMODE)) + IF (.NOT.(ASSOCIATED(XRG3D))) ALLOCATE(XRG3D(SIZE(XSVT,1),SIZE(XSVT,2),SIZE(XSVT,3),JPMODE)) + IF (.NOT.(ASSOCIATED(XSIG3D))) ALLOCATE(XSIG3D(SIZE(XSVT,1),SIZE(XSVT,2),SIZE(XSVT,3),JPMODE)) + IF (.NOT.(ASSOCIATED(XRHOP3D))) ALLOCATE(XRHOP3D(SIZE(XSVT,1),SIZE(XSVT,2),SIZE(XSVT,3),JPMODE)) + IF (.NOT.(ASSOCIATED(XM3D))) ALLOCATE(XM3D(SIZE(XSVT,1),SIZE(XSVT,2),SIZE(XSVT,3),JPMODE*3)) + IF (.NOT.(ASSOCIATED(XCTOTA3D))) & + ALLOCATE(XCTOTA3D(SIZE(XSVT,1),SIZE(XSVT,2),SIZE(XSVT,3),NSP+NCARB+NSOA,JPMODE)) + + CALL CH_AER_EQM_INIT_n(XSVT(:,:,:,NSV_CHEMBEG:NSV_CHEMEND),& + XSVT(:,:,:,NSV_AERBEG:NSV_AEREND),& + XM3D,XRHOP3D,XSIG3D,& + XRG3D,XN3D, XRHODREF, XCTOTA3D) +END IF +! +! Initialization LIMA variables by ORILAM +IF (CCLOUD == 'LIMA' .AND. ((LORILAM).OR.(LDUST).OR.(LSALT))) THEN + + ! Init LIMA by ORILAM + CALL AER2LIMA(XSVT, XRHODREF, XRT(:,:,:,1), XPABST, XTHT,XZZ) + + ! Init LB LIMA by ORILAM + ALLOCATE(ZLBXRHO(SIZE(XLBXSVM,1), SIZE(XLBXSVM,2), SIZE(XLBXSVM,3))) + ALLOCATE(ZLBYRHO(SIZE(XLBYSVM,1), SIZE(XLBYSVM,2), SIZE(XLBYSVM,3))) + ALLOCATE(ZLBXPABST(SIZE(XLBXSVM,1), SIZE(XLBXSVM,2), SIZE(XLBXSVM,3))) + ALLOCATE(ZLBYPABST(SIZE(XLBYSVM,1), SIZE(XLBYSVM,2), SIZE(XLBYSVM,3))) + ALLOCATE(ZLBXZZ(SIZE(XLBXSVM,1), SIZE(XLBXSVM,2), SIZE(XLBXSVM,3))) + ALLOCATE(ZLBYZZ(SIZE(XLBYSVM,1), SIZE(XLBYSVM,2), SIZE(XLBYSVM,3))) + + ILBX=SIZE(XLBXSVM,1)/2-JPHEXT + ILBY=SIZE(XLBYSVM,2)/2-JPHEXT + + CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) + + ZLBXRHO(1:ILBX+1,:,:) = XRHODREF(IIB-1:IIB-1+ILBX,:,:) + ZLBXRHO(ILBX+2:2*ILBX+2,:,:) = XRHODREF(IIE+1-ILBX:IIE+1,:,:) + ZLBYRHO(:,1:ILBY+1,:) = XRHODREF(:,IJB-1:IJB-1+ILBY,:) + ZLBYRHO(:,ILBY+2:2*ILBY+2,:) = XRHODREF(:,IJE+1-ILBY:IJE+1,:) + ZLBXPABST(1:ILBX+1,:,:) = XPABST(IIB-1:IIB-1+ILBX,:,:) + ZLBXPABST(ILBX+2:2*ILBX+2,:,:) = XPABST(IIE+1-ILBX:IIE+1,:,:) + ZLBYPABST(:,1:ILBY+1,:) = XPABST(:,IJB-1:IJB-1+ILBY,:) + ZLBYPABST(:,ILBY+2:2*ILBY+2,:) = XPABST(:,IJE+1-ILBY:IJE+1,:) + ZLBXZZ(1:ILBX+1,:,:) = XZZ(IIB-1:IIB-1+ILBX,:,:) + ZLBXZZ(ILBX+2:2*ILBX+2,:,:) = XZZ(IIE+1-ILBX:IIE+1,:,:) + ZLBYZZ(:,1:ILBY+1,:) = XZZ(:,IJB-1:IJB-1+ILBY,:) + ZLBYZZ(:,ILBY+2:2*ILBY+2,:) = XZZ(:,IJE+1-ILBY:IJE+1,:) + + CALL AER2LIMA(XLBXSVM, ZLBXRHO, XLBXRM(:,:,:,1), ZLBXPABST, XLBXTHM, ZLBXZZ) + CALL AER2LIMA(XLBYSVM, ZLBYRHO, XLBYRM(:,:,:,1), ZLBYPABST, XLBYTHM, ZLBYZZ) + + DEALLOCATE(ZLBXRHO) + DEALLOCATE(ZLBYRHO) + DEALLOCATE(ZLBXPABST) + DEALLOCATE(ZLBYPABST) + DEALLOCATE(ZLBXZZ) + DEALLOCATE(ZLBYZZ) + +END IF +! +IF (ALLOCATED(XSV_MX)) DEALLOCATE(XSV_MX) +IF (ALLOCATED(XTKE_MX)) DEALLOCATE(XTKE_MX) +! +CALL BOUNDARIES ( & + 0.,CLBCX,CLBCY,NRR,NSV,1, & + XLBXUM,XLBXVM,XLBXWM,XLBXTHM,XLBXTKEM,XLBXRM,XLBXSVM, & + XLBYUM,XLBYVM,XLBYWM,XLBYTHM,XLBYTKEM,XLBYRM,XLBYSVM, & + XLBXUM,XLBXVM,XLBXWM,XLBXTHM,XLBXTKEM,XLBXRM,XLBXSVM, & + XLBYUM,XLBYVM,XLBYWM,XLBYTHM,XLBYTKEM,XLBYRM,XLBYSVM, & + XRHODJ,XRHODREF, & + XUT, XVT, XWT, XTHT, XTKET, XRT, XSVT, XSRCT ) +! +CALL SECOND_MNH(ZTIME2) +ZMISC = ZMISC + ZTIME2 - ZTIME1 +! +!------------------------------------------------------------------------------- +! +!* 15. Error on temperature during interpolations +! ------------------------------------------ +! +ZTIME1 = ZTIME2 +! +IF (YATMFILETYPE=='GRIBEX' .AND. NVERB>1) THEN + CALL ERROR_ON_TEMPERATURE(XT_LS,XPMASS_LS,XPABST,XPS_LS,XPSURF) +END IF +! +IF (YATMFILETYPE=='GRIBEX') THEN + DEALLOCATE(XT_LS) + DEALLOCATE(XPMASS_LS) + DEALLOCATE(XPS_LS) +END IF +! +IF (ALLOCATED(XPSURF)) DEALLOCATE(XPSURF) +! +CALL SECOND_MNH(ZTIME2) +ZDIAG = ZDIAG + ZTIME2 - ZTIME1 +!------------------------------------------------------------------------------- +! +!* 16. INITIALIZE LEVELSET FOR IBM +! --------------------------- +! +IF (LIBM_LSF) THEN + ! + IF (.NOT.LCARTESIAN) THEN + CALL PRINT_MSG(NVERB_FATAL,'GEN','PREP_IDEAL_CASE','IBM can only be used with cartesian coordinates') + ENDIF + ! + CALL GET_DIM_EXT_ll('B',NIU,NJU) + NKU=NKMAX+2*JPVEXT + ! + ALLOCATE(XIBM_LS(NIU,NJU,NKU,4)) + ! + CALL IBM_INIT_LS(XIBM_LS) + ! +ENDIF +! +!------------------------------------------------------------------------------- +! +!* 17. WRITING OF THE MESO-NH FM-FILE +! ------------------------------ +! +ZTIME1 = ZTIME2 +! +CSTORAGE_TYPE='TT' +IF (YATMFILETYPE=='GRIBEX') THEN + CSURF = "EXTE" + DO JRR=1,NRR + IF (JRR==1) THEN + LUSERV=.TRUE. + IDX_RVT = JRR + END IF + IF (JRR==2) THEN + LUSERC=.TRUE. + IDX_RCT = JRR + END IF + IF (JRR==3) THEN + LUSERR=.TRUE. + IDX_RRT = JRR + END IF + IF (JRR==4) THEN + LUSERI=.TRUE. + IDX_RIT = JRR + END IF + IF (JRR==5) THEN + LUSERS=.TRUE. + IDX_RST = JRR + END IF + IF (JRR==6) THEN + LUSERG=.TRUE. + IDX_RGT = JRR + END IF + IF (JRR==7) THEN + LUSERH=.TRUE. + IDX_RHT = JRR + END IF + END DO +END IF +! +CALL WRITE_DESFM_n(1,TINIFILE) +CALL IO_Header_write(TINIFILE,HDAD_NAME=YDAD_NAME) +CALL WRITE_LFIFM_n(TINIFILE,YDAD_NAME) +! +CALL SECOND_MNH(ZTIME2) +ZWRITE = ZTIME2 - ZTIME1 +! +!------------------------------------------------------------------------------- +! +!* 18. OROGRAPHIC and DUMMY PHYSIOGRAPHIC FIELDS +! ----------------------------------------- +! +!* reading in the PGD file +! +CALL MNHREAD_ZS_DUMMY_n(TPGDFILE) +! +!* writing in the output file +! +TOUTDATAFILE => TINIFILE +CALL MNHWRITE_ZS_DUMMY_n(TINIFILE) +! +CALL DEALLOCATE_MODEL1(3) +! +IF (YATMFILETYPE=='MESONH'.AND. YATMFILE/=YPGDFILE) THEN + CALL IO_File_find_byname(TRIM(YATMFILE),TZATMFILE,IRESP) + CALL IO_File_close(TZATMFILE) +END IF +!------------------------------------------------------------------------------- +! +!* 19. INTERPOLATION OF SURFACE VARIABLES +! ---------------------------------- +! +IF (.NOT. LCOUPLING ) THEN + ZTIME1 = ZTIME2 +! + IF (CSURF=="EXTE") THEN + IF (YATMFILETYPE/='MESONH') THEN + CALL SURFEX_ALLOC_LIST(1) + YSURF_CUR => YSURF_LIST(1) + CALL READ_ALL_NAMELISTS(YSURF_CUR,'MESONH','PRE',.FALSE.) + ENDIF + CALL GOTO_SURFEX(1) + TFILE_SURFEX => TINIFILE + CALL PREP_SURF_MNH(YSURFFILE,YSURFFILETYPE) + NULLIFY(TFILE_SURFEX) + ENDIF +! + CALL SECOND_MNH(ZTIME2) + ZSURF = ZSURF + ZTIME2 - ZTIME1 +ENDIF +! +!------------------------------------------------------------------------------- +! +!* 20. EPILOGUE +! -------- +! +WRITE(ILUOUT0,*) +WRITE(ILUOUT0,*) +WRITE(ILUOUT0,*) +WRITE(ILUOUT0,*) '**************************************************' +WRITE(ILUOUT0,*) '* PREP_REAL_CASE: PREP_REAL_CASE ends correctly. *' +WRITE(ILUOUT0,*) '**************************************************' +WRITE(ILUOUT0,*) +! +!------------------------------------------------------------------------------- +! +CALL SECOND_MNH (ZEND) +! +ZTOT = ZEND - ZSTART ! for computing time analysis +! +ZALL = ZMISC + ZREAD + ZHORI + ZPREP + ZTHERMO + ZSURF + ZDYN + ZDIAG + ZWRITE +! +WRITE(ILUOUT0,*) +WRITE(ILUOUT0,*) ' ------------------------------------------------------------ ' +WRITE(ILUOUT0,*) '| |' +WRITE(ILUOUT0,*) '| COMPUTING TIME ANALYSIS in PREP_REAL_CASE |' +WRITE(ILUOUT0,*) '| |' +WRITE(ILUOUT0,*) '|------------------------------------------------------------|' +WRITE(ILUOUT0,*) '| | | |' +WRITE(ILUOUT0,*) '| ROUTINE NAME | CPU-TIME | PERCENTAGE % |' +WRITE(ILUOUT0,*) '| | | |' +WRITE(ILUOUT0,*) '|---------------------|-------------------|------------------|' +WRITE(ILUOUT0,*) '| | | |' +WRITE(UNIT=ILUOUT0,FMT=2) ZREAD, 100.*ZREAD/ZTOT +WRITE(UNIT=ILUOUT0,FMT=9) ZHORI, 100.*ZHORI/ZTOT +WRITE(UNIT=ILUOUT0,FMT=3) ZPREP, 100.*ZPREP/ZTOT +WRITE(UNIT=ILUOUT0,FMT=4) ZTHERMO, 100.*ZTHERMO/ZTOT +WRITE(UNIT=ILUOUT0,FMT=6) ZDYN, 100.*ZDYN/ZTOT +WRITE(UNIT=ILUOUT0,FMT=7) ZDIAG, 100.*ZDIAG/ZTOT +WRITE(UNIT=ILUOUT0,FMT=8) ZWRITE, 100.*ZWRITE/ZTOT +WRITE(UNIT=ILUOUT0,FMT=1) ZMISC, 100.*ZMISC/ZTOT +WRITE(UNIT=ILUOUT0,FMT=5) ZSURF, 100.*ZSURF/ZTOT +! +WRITE(UNIT=ILUOUT0,FMT=10) ZTOT , 100.*ZALL/ZTOT +WRITE(ILUOUT0,*) ' ------------------------------------------------------------ ' +! +! FORMATS +! ------- +! +2 FORMAT(' | READING OF DATA | ',F8.3,' | ',F8.3,' |') +9 FORMAT(' | HOR. INTERPOLATIONS | ',F8.3,' | ',F8.3,' |') +3 FORMAT(' | VER_PREP | ',F8.3,' | ',F8.3,' |') +4 FORMAT(' | VER_THERMO | ',F8.3,' | ',F8.3,' |') +6 FORMAT(' | VER_DYN | ',F8.3,' | ',F8.3,' |') +7 FORMAT(' | DIAGNOSTICS | ',F8.3,' | ',F8.3,' |') +8 FORMAT(' | WRITE | ',F8.3,' | ',F8.3,' |') +1 FORMAT(' | MISCELLANEOUS | ',F8.3,' | ',F8.3,' |') +5 FORMAT(' | SURFACE | ',F8.3,' | ',F8.3,' |') +10 FORMAT(' | PREP_REAL_CASE | ',F8.3,' | ',F8.3,' |') +! +!------------------------------------------------------------------------------- +! +IF (LEN_TRIM(YDAD_NAME)>0) THEN + WRITE(ILUOUT0,*) ' ' + WRITE(ILUOUT0,*) ' ------------------------------------------------------------' + WRITE(ILUOUT0,*) '| Nesting allowed |' + WRITE(ILUOUT0,*) '| DAD_NAME="',YDAD_NAME,'" |' + WRITE(ILUOUT0,*) ' ------------------------------------------------------------' + WRITE(ILUOUT0,*) ' ' +ELSE + WRITE(ILUOUT0,*) ' ' + WRITE(ILUOUT0,*) ' ------------------------------------------------------------' + WRITE(ILUOUT0,*) '| Nesting not allowed with a larger-scale model. |' + WRITE(ILUOUT0,*) '| The new file can only be used as model number 1 |' + WRITE(ILUOUT0,*) ' ------------------------------------------------------------' + WRITE(ILUOUT0,*) ' ' +END IF +! +!------------------------------------------------------------------------------- +! +CALL IO_File_close(TINIFILE) +CALL IO_File_close(TPGDFILE) +! +CALL FINALIZE_MNH() +! +!------------------------------------------------------------------------------- +! +CONTAINS + +SUBROUTINE INIT_NMLVAR +CPRESOPT=CPRESOPT_n +LRES=LRES_n +XRES=XRES_n +NITR=NITR_n +LUSECHAQ=LUSECHAQ_n +LUSECHIC=LUSECHIC_n +LUSECHEM=LUSECHEM_n +END SUBROUTINE INIT_NMLVAR + +SUBROUTINE UPDATE_MODD_FROM_NMLVAR +CPRESOPT_n=CPRESOPT +LRES_n=LRES +XRES_n=XRES +NITR_n=NITR +LUSECHAQ_n=LUSECHAQ +LUSECHIC_n=LUSECHIC +LUSECHEM_n=LUSECHEM +END SUBROUTINE UPDATE_MODD_FROM_NMLVAR + +END PROGRAM PREP_REAL_CASE diff --git a/src/mesonh/ext/prep_surfex.f90 b/src/mesonh/ext/prep_surfex.f90 new file mode 100644 index 0000000000000000000000000000000000000000..4c56ea8b4e18980d97f6fefdb6793e5dc15fe5ff --- /dev/null +++ b/src/mesonh/ext/prep_surfex.f90 @@ -0,0 +1,208 @@ +!MNH_LIC Copyright 2004-2021 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. +!----------------------------------------------------------------- +! ############################# + PROGRAM PREP_SURFEX +! ############################# +! +!!**** *PREP_SURFEX* - program to write an initial FM file from real case +!! situation containing only surface fields. +!! +!! REFERENCE +!! --------- +!! +!! Book 2 +!! +!! AUTHOR +!! ------ +!! +!! V.Masson Meteo-France +!! +!! MODIFICATIONS +!! ------------- +!! Original 12/2004 (P. Le Moigne) +!! 10/10/2011 J.Escobar call INI_PARAZ_ll +!! 06/2016 (G.Delautier) phasage surfex 8 +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 07/02/2019: force TYPE to a known value for IO_File_add2list +!! 2021 B.Vie LIMA - CAMS coupling +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_CONF, ONLY : CPROGRAM,& + L1D, L2D, LPACK +USE MODD_CONF_n, ONLY : CSTORAGE_TYPE +USE MODD_IO, ONLY : TFILEDATA, TFILE_SURFEX +USE MODD_LUNIT, ONLY : TPGDFILE, TLUOUT0 +USE MODD_LUNIT_n, ONLY : CINIFILE, TINIFILE +USE MODD_MNH_SURFEX_n +USE MODD_PARAMETERS, ONLY : JPMODELMAX,JPHEXT,JPVEXT, NUNDEF, XUNDEF +USE MODD_TIME_n, ONLY : TDTCUR +! +use mode_field, only: Ini_field_list, Ini_field_scalars +USE MODE_FINALIZE_MNH, only: FINALIZE_MNH +USE MODE_IO, only: IO_Init +USE MODE_IO_FIELD_READ, only: IO_Field_read +USE MODE_IO_FIELD_WRITE, only: IO_Field_write, IO_Header_write +USE MODE_IO_FILE, only: IO_File_close, IO_File_open +USE MODE_IO_MANAGE_STRUCT, only: IO_File_add2list +USE MODE_ll +USE MODE_MSG +USE MODE_MODELN_HANDLER +USE MODE_SPLITTINGZ_ll +! +USE MODI_OPEN_PRC_FILES +USE MODI_PREP_SURF_MNH +USE MODI_READ_ALL_NAMELISTS +USE MODI_VERSION +USE MODE_INI_CST, ONLY: INI_CST +! +IMPLICIT NONE +! +!* 0.1 Declaration of local variables +! ------------------------------ +! +CHARACTER(LEN=28) :: YATMFILE ! name of the Atmospheric file +CHARACTER(LEN=6) :: YATMFILETYPE ! type of the Atmospheric file +CHARACTER(LEN=28) :: YCHEMFILE ! name of the Chemical file (not used) +CHARACTER(LEN=6) :: YCHEMFILETYPE ! type of the Chemical file (not used) +CHARACTER(LEN=28) :: YCAMSFILE ! name of the input CAMS file +CHARACTER(LEN=6) :: YCAMSFILETYPE ! type of the input CAMS file +CHARACTER(LEN=28) :: YSURFFILE ! name of the Surface file (not used) +CHARACTER(LEN=6) :: YSURFFILETYPE ! type of the Surface file (not used) +CHARACTER(LEN=28) :: YPGDFILE ! name of the physiographic data +! ! file +! +!* file management variables and counters +! +INTEGER :: ILUOUT0 ! logical unit for listing file +INTEGER :: IRESP ! return code in FM routines +! +INTEGER :: IINFO_ll ! return code of // routines +CHARACTER (LEN=100) :: HCOMMENT +INTEGER :: II, IJ, IGRID, ILENGTH +! +TYPE(TFILEDATA),POINTER :: TZATMFILE => NULL() +TYPE(TFILEDATA),POINTER :: TZPRE_REAL1FILE => NULL() +! +!------------------------------------------------------------------------------- +! +! +!* 1. SET DEFAULT VALUES +! ------------------ +! +CALL GOTO_MODEL(1) +! +CALL VERSION +CPROGRAM='REAL ' +CSTORAGE_TYPE='SU' +! +!------------------------------------------------------------------------------- +! +!* 2. OPENNING OF THE FILES +! --------------------- +CALL IO_Init() +! +CALL OPEN_PRC_FILES(TZPRE_REAL1FILE,YATMFILE, YATMFILETYPE,TZATMFILE & + ,YCHEMFILE,YCHEMFILETYPE & + ,YSURFFILE,YSURFFILETYPE & + ,YPGDFILE,TPGDFILE & + ,YCAMSFILE,YCAMSFILETYPE) +ILUOUT0 = TLUOUT0%NLU +! +!------------------------------------------------------------------------------- +! +!* 3. INITIALIZATION OF PHYSICAL CONSTANTS +! ------------------------------------ +! +CALL INI_CST +! +!------------------------------------------------------------------------------- +! +!* 4. READING OF NAMELIST +! ------------------- +! +!* 4.1 reading of configuration variables +! +CALL IO_File_close(TZPRE_REAL1FILE) +! +!* 4.2 reading of values of some configuration variables in namelist +! +CALL INI_FIELD_LIST(1) +! +CALL INI_FIELD_SCALARS() +! +CALL IO_Field_read(TPGDFILE,'IMAX',II) +CALL IO_Field_read(TPGDFILE,'JMAX',IJ) +CALL SET_JP_ll(JPMODELMAX,JPHEXT,JPVEXT,JPHEXT) +CALL SET_DAD0_ll() +CALL SET_DIM_ll(II, IJ, 1) +CALL SET_LBX_ll('OPEN',1) +CALL SET_LBY_ll('OPEN', 1) +CALL SET_XRATIO_ll(1, 1) +CALL SET_YRATIO_ll(1, 1) +CALL SET_XOR_ll(1, 1) +CALL SET_XEND_ll(II+2*JPHEXT, 1) +CALL SET_YOR_ll(1, 1) +CALL SET_YEND_ll(IJ+2*JPHEXT, 1) +CALL SET_DAD_ll(0, 1) +!JUANZ CALL INI_PARA_ll(IINFO_ll) +CALL INI_PARAZ_ll(IINFO_ll) +! +!------------------------------------------------------------------------------- +! +! +!* 5. PREPARATION OF SURFACE FIELDS +! ----------------------------- +! +!* reading of date +! +IF (YATMFILETYPE=='MESONH') THEN + CALL IO_File_add2list(TZATMFILE,TRIM(YATMFILE),'MNH','READ',KLFITYPE=1,KLFIVERB=1) + CALL IO_File_open(TZATMFILE) + CALL IO_Field_read(TZATMFILE,'DTCUR',TDTCUR) + CALL IO_File_close(TZATMFILE) +ELSE + TDTCUR%nyear = NUNDEF + TDTCUR%nmonth = NUNDEF + TDTCUR%nday = NUNDEF + TDTCUR%xtime = XUNDEF +END IF +! +CALL SURFEX_ALLOC_LIST(1) +YSURF_CUR => YSURF_LIST(1) +CALL READ_ALL_NAMELISTS(YSURF_CUR,'MESONH','PRE',.FALSE.) +CALL GOTO_SURFEX(1) +! +CALL IO_File_add2list(TINIFILE,TRIM(CINIFILE),'PGD','WRITE',KLFITYPE=1,KLFIVERB=1) +!The open is done later in PREP_SURF_MNH when domain dimensions are known +! +TFILE_SURFEX => TINIFILE +CALL PREP_SURF_MNH(YATMFILE,YATMFILETYPE,OINIFILEOPEN=.TRUE.) +NULLIFY(TFILE_SURFEX) +! +!------------------------------------------------------------------------------- +! +CALL IO_Header_write(TINIFILE) +CALL IO_Field_write(TINIFILE,'SURF','EXTE') +CALL IO_Field_write(TINIFILE,'L1D', L1D) +CALL IO_Field_write(TINIFILE,'L2D', L2D) +CALL IO_Field_write(TINIFILE,'PACK',LPACK) +! +!------------------------------------------------------------------------------- +WRITE(ILUOUT0,*) ' ' +WRITE(ILUOUT0,*) '----------------------------------' +WRITE(ILUOUT0,*) '| |' +WRITE(ILUOUT0,*) '| PREP_SURFEX ends correctly |' +WRITE(ILUOUT0,*) '| |' +WRITE(ILUOUT0,*) '----------------------------------' +CALL IO_File_close(TINIFILE) +! +CALL FINALIZE_MNH() +!------------------------------------------------------------------------------- +! +END PROGRAM PREP_SURFEX diff --git a/src/mesonh/ext/profilern.f90 b/src/mesonh/ext/profilern.f90 new file mode 100644 index 0000000000000000000000000000000000000000..004131a99ebabf2ce79cc355eece0b3bed148fc4 --- /dev/null +++ b/src/mesonh/ext/profilern.f90 @@ -0,0 +1,1069 @@ +!MNH_LIC Copyright 2002-2022 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_PROFILER_n +! ########################## +! +INTERFACE +! + SUBROUTINE PROFILER_n(PTSTEP, & + PXHAT, PYHAT, PZ,PRHODREF, & + PU, PV, PW, PTH, PR, PSV, PTKE, & + PTS, PP, PAER, PCLDFR, PCIT, PSEA) +! +REAL, INTENT(IN) :: PTSTEP ! time step +REAL, DIMENSION(:), INTENT(IN) :: PXHAT ! x coordinate +REAL, DIMENSION(:), INTENT(IN) :: PYHAT ! y coordinate +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZ ! z array +REAL, DIMENSION(:,:,:), INTENT(IN) :: PU ! horizontal wind X component +REAL, DIMENSION(:,:,:), INTENT(IN) :: PV ! horizontal wind Y component +REAL, DIMENSION(:,:,:), INTENT(IN) :: PW ! vertical wind +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTH ! potential temperature +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PR ! water mixing ratios +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSV ! Scalar variables +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKE ! turbulent kinetic energy +REAL, DIMENSION(:,:), INTENT(IN) :: PTS ! surface temperature +REAL, DIMENSION(:,:,:), INTENT(IN) :: PP ! pressure +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PAER ! aerosol extinction +REAL, DIMENSION(:,:,:), INTENT(IN) :: PCLDFR ! cloud fraction +REAL, DIMENSION(:,:,:), INTENT(IN) :: PCIT ! ice concentration +REAL, DIMENSION(:,:), OPTIONAL, INTENT(IN) :: PSEA ! for radar +! +!------------------------------------------------------------------------------- +! +END SUBROUTINE PROFILER_n +! +END INTERFACE +! +END MODULE MODI_PROFILER_n +! +! ######################################################## + SUBROUTINE PROFILER_n(PTSTEP, & + PXHAT, PYHAT, PZ,PRHODREF, & + PU, PV, PW, PTH, PR, PSV, PTKE, & + PTS, PP, PAER, PCLDFR, PCIT, PSEA) +! ######################################################## +! +! +! +!!**** *PROFILER_n* - (advects and) stores +!! stations/s in the model +!! +!! PURPOSE +!! ------- +! +! +!!** METHOD +!! ------ +!! +!! +!! +!! EXTERNAL +!! -------- +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! Pierre TULET / Valery Masson * Meteo-France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 15/02/2002 +!! March 2013 : C.Lac : Corrections for 1D + new fields (RARE,THV,DD,FF) +!! April 2014 : C.Lac : Call RADAR only if ICE3 +!! C.Lac 10/2016 Add visibility diagnostic +!! March,28, 2018 (P. Wautelet) replace TEMPORAL_DIST by DATETIME_DISTANCE +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 13/09/2019: budget: simplify and modernize date/time management +! M. Taufour 05/07/2021: modify RARE for hydrometeors containing ice and add bright band calculation for RARE +! P. Wautelet 09/02/2022: add message when some variables not computed +! + bugfix: put values in variables in this case +! + move some operations outside a do loop +! -------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_CONF +USE MODD_CST +USE MODD_DIAG_IN_RUN +USE MODD_GRID +USE MODD_SUB_PROFILER_n +USE MODD_NSV +USE MODD_PARAMETERS +USE MODD_PARAM_n, ONLY: CCLOUD, CRAD, CSURF +USE MODD_PROFILER_n +USE MODD_TIME, only: tdtexp +USE MODD_TIME_n, only: tdtcur +! +USE MODE_ll +USE MODE_MSG +! +USE MODI_GPS_ZENITH_GRID +USE MODI_LIDAR +USE MODI_RADAR_RAIN_ICE +USE MODI_WATER_SUM +USE MODE_FGAU, ONLY : GAULAG +USE MODE_FSCATTER, ONLY: QEPSW,QEPSI,BHMIE,MOMG,MG +USE MODD_PARAM_LIMA, ONLY: XALPHAR_L=>XALPHAR,XNUR_L=>XNUR,XALPHAS_L=>XALPHAS,XNUS_L=>XNUS,& + XALPHAG_L=>XALPHAG,XNUG_L=>XNUG, XALPHAI_L=>XALPHAI,XNUI_L=>XNUI,& + XRTMIN_L=>XRTMIN,XALPHAC_L=>XALPHAC,XNUC_L=>XNUC, LSNOW_T_L=>LSNOW_T +USE MODD_PARAM_LIMA_COLD, ONLY: XDI_L=>XDI,XLBEXI_L=>XLBEXI,XLBI_L=>XLBI,XAI_L=>XAI,XBI_L=>XBI,XC_I_L=>XC_I,& + XLBEXS_L=>XLBEXS,XLBS_L=>XLBS,XCCS_L=>XCCS,XNS_L=>XNS,& + XAS_L=>XAS,XBS_L=>XBS,XCXS_L=>XCXS, & + XLBDAS_MIN,XLBDAS_MAX +USE MODD_PARAM_LIMA_MIXED, ONLY: XDG_L=>XDG,XLBEXG_L=>XLBEXG,XLBG_L=>XLBG,XCCG_L=>XCCG,& + XAG_L=>XAG,XBG_L=>XBG,XCXG_L=>XCXG,XCG_L=>XCG +USE MODD_PARAM_LIMA_WARM, ONLY: XLBEXR_L=>XLBEXR,XLBR_L=>XLBR,XBR_L=>XBR,XAR_L=>XAR,& + XBC_L=>XBC,XAC_L=>XAC +USE MODD_PARAM_ICE_n, ONLY: LSNOW_T_I=>LSNOW_T +USE MODD_RAIN_ICE_DESCR_n, ONLY: XALPHAR_I=>XALPHAR,XNUR_I=>XNUR,XLBEXR_I=>XLBEXR,& + XLBR_I=>XLBR,XCCR_I=>XCCR,XBR_I=>XBR,XAR_I=>XAR,& + XALPHAC_I=>XALPHAC,XNUC_I=>XNUC,& + XLBC_I=>XLBC,XBC_I=>XBC,XAC_I=>XAC,& + XALPHAC2_I=>XALPHAC2,XNUC2_I=>XNUC2,& + XALPHAS_I=>XALPHAS,XNUS_I=>XNUS,XLBEXS_I=>XLBEXS,& + XLBS_I=>XLBS,XCCS_I=>XCCS,XNS_I=>XNS,XAS_I=>XAS,XBS_I=>XBS,XCXS_I=>XCXS,& + XALPHAG_I=>XALPHAG,XNUG_I=>XNUG,XDG_I=>XDG,XLBEXG_I=>XLBEXG,& + XLBG_I=>XLBG,XCCG_I=>XCCG,XAG_I=>XAG,XBG_I=>XBG,XCXG_I=>XCXG,XCG_I=>XCG,& + XALPHAI_I=>XALPHAI,XNUI_I=>XNUI,XDI_I=>XDI,XLBEXI_I=>XLBEXI,& + XLBI_I=>XLBI,XAI_I=>XAI,XBI_I=>XBI,XC_I_I=>XC_I,& + XRTMIN_I=>XRTMIN,XCONC_LAND,XCONC_SEA +! +! +IMPLICIT NONE +! +! +!* 0.1 declarations of arguments +! +! +REAL, INTENT(IN) :: PTSTEP ! time step +REAL, DIMENSION(:), INTENT(IN) :: PXHAT ! x coordinate +REAL, DIMENSION(:), INTENT(IN) :: PYHAT ! y coordinate +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZ ! z array +REAL, DIMENSION(:,:,:), INTENT(IN) :: PU ! horizontal wind X component +REAL, DIMENSION(:,:,:), INTENT(IN) :: PV ! horizontal wind Y component +REAL, DIMENSION(:,:,:), INTENT(IN) :: PW ! vertical wind +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTH ! potential temperature +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PR ! water mixing ratios +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSV ! Scalar variables +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKE ! turbulent kinetic energy +REAL, DIMENSION(:,:), INTENT(IN) :: PTS ! surface temperature +REAL, DIMENSION(:,:,:), INTENT(IN) :: PP ! pressure +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PAER ! aerosol extinction +REAL, DIMENSION(:,:,:), INTENT(IN) :: PCLDFR ! cloud fraction +REAL, DIMENSION(:,:,:), INTENT(IN) :: PCIT ! ice concentration +REAL, DIMENSION(:,:), OPTIONAL, INTENT(IN) :: PSEA ! for radar +! +!------------------------------------------------------------------------------- +! +! 0.2 declaration of local variables +! +! +INTEGER :: IIB ! current processor domain sizes +INTEGER :: IJB +INTEGER :: IKB +INTEGER :: IIE +INTEGER :: IJE +INTEGER :: IKE +INTEGER :: IIU +INTEGER :: IJU +INTEGER :: IKU +! +! +REAL, DIMENSION(SIZE(PXHAT)) :: ZXHATM ! mass point coordinates +REAL, DIMENSION(SIZE(PYHAT)) :: ZYHATM ! mass point coordinates +! +REAL, DIMENSION(SIZE(PSV,1),SIZE(PSV,2),SIZE(PSV,3),SIZE(PSV,4)) :: ZWORK +REAL, DIMENSION(SIZE(PSV,1),SIZE(PSV,2),SIZE(PSV,3),SIZE(PAER,4)) :: ZWORK2 +! +LOGICAL :: GSTORE ! storage occurs at this time step +! +INTEGER :: IN ! time index +INTEGER :: JSV ! loop counter +INTEGER :: JK ! loop +INTEGER :: IKRAD +! +REAL,DIMENSION(SIZE(PZ,3)) :: ZU_PROFILER ! horizontal wind speed profile at station location (along x) +REAL,DIMENSION(SIZE(PZ,3)) :: ZV_PROFILER ! horizontal wind speed profile at station location (along y) +REAL,DIMENSION(SIZE(PZ,3)) :: ZFF ! horizontal wind speed profile at station location +REAL,DIMENSION(SIZE(PZ,3)) :: ZDD ! horizontal wind speed profile at station location +REAL,DIMENSION(SIZE(PZ,3)) :: ZRHOD ! dry air density in moist mixing profile at station location +REAL,DIMENSION(SIZE(PZ,3)) :: ZRV ! water vapour mixing ratio profile at station location +REAL,DIMENSION(SIZE(PZ,3)) :: ZT ! temperature profile at station location +REAL,DIMENSION(SIZE(PZ,3)) :: ZTV ! virtual temperature profile at station location +REAL,DIMENSION(SIZE(PZ,3)) :: ZPRES ! pressure profile at station location +REAL,DIMENSION(SIZE(PZ,3)) :: ZE ! water vapour partial pressure profile at station location +REAL,DIMENSION(SIZE(PZ,3)) :: ZZ ! altitude of model levels at station location +REAL,DIMENSION(SIZE(PZ,3)-1) :: ZZHATM ! altitude of mass point levels at station location +REAL :: ZGAM ! rotation between meso-nh base and spherical lat-lon base. +! +REAL :: XZS_GPS ! GPS station altitude +REAL :: ZIWV ! integrated water vapour at station location +REAL :: ZZM_STAT ! altitude at station location +REAL :: ZTM_STAT ! temperature at station location +REAL :: ZTV_STAT ! virtual temperature at station location +REAL :: ZPM_STAT ! pressure at station location +REAL :: ZEM_STAT ! water vapour partial pressure at station location +REAL :: ZZTD_PROFILER ! ZTD at station location +REAL :: ZZHD_PROFILER ! ZHD at station location +REAL :: ZZWD_PROFILER ! ZWD at station location +REAL :: ZZHDR ! ZHD correction at station location +REAL :: ZZWDR ! ZWD correction at station location +! +INTEGER :: IINFO_ll ! return code +INTEGER :: ILUOUT ! logical unit +INTEGER :: IRESP ! return code +INTEGER :: I ! loop for stations +! +REAL,DIMENSION(SIZE(PTH,1),SIZE(PTH,2)) :: ZZTD,ZZHD,ZZWD +REAL,DIMENSION(SIZE(PTH,1),SIZE(PTH,2),SIZE(PTH,3)) :: ZTEMP,ZRARE,ZTHV,ZTEMPV +REAL,DIMENSION(SIZE(PTH,1),SIZE(PTH,2),SIZE(PTH,3)) :: ZWORK32,ZWORK33,ZWORK34 +REAL,DIMENSION(SIZE(PTH,1),SIZE(PTH,2),SIZE(PTH,3)) :: ZVISI,ZVISIKUN +REAL :: ZK1,ZK2,ZK3 ! k1, k2 and K3 atmospheric refractivity constants +REAL :: ZRDSRV ! XRD/XRV +! +! specific to cloud radar +INTEGER :: JLOOP,JLOOP2 ! loop counter +REAL, DIMENSION(SIZE(PR,3)) :: ZTEMPZ! vertical profile of temperature +REAL, DIMENSION(SIZE(PR,3)) :: ZRHODREFZ ! vertical profile of dry air density of the reference state +REAL, DIMENSION(SIZE(PR,3)) :: ZCIT ! pristine ice concentration +REAL, DIMENSION(SIZE(PR,3)) :: ZCCI,ZCCR,ZCCC ! ICE,RAIN CLOUD concentration (LIMA) +REAL, DIMENSION(SIZE(PR,1),SIZE(PR,2),SIZE(PR,3)) :: ZR +REAL, DIMENSION(SIZE(PR,3),SIZE(PR,4)+1) :: ZRZ ! vertical profile of hydrometeor mixing ratios +REAL :: ZA,ZB,ZCC,ZCX,ZALPHA,ZNU,ZLB,ZLBEX,ZRHOHYD,XLAM_CRAD,ZNS ! generic microphysical parameters +INTEGER :: JJ ! loop counter for quadrature +COMPLEX :: QMW,QMI,QM,QB,QEPSIW,QEPSWI ! dielectric parameter +REAL :: ZAETOT,ZAETMP,ZREFLOC,ZQSCA,ZQBACK,ZQEXT ! temporary scattering parameters +REAL,DIMENSION(:),ALLOCATABLE :: ZAELOC,ZZMZ ! temporary arrays +INTEGER :: JPTS_GAULAG=9 ! number of points for Gauss-Laguerre quadrature +REAL :: ZLBDA ! slope distribution parameter +REAL :: ZN ! number cocentration +REAL :: ZFRAC_ICE ! ice water fraction +REAL :: ZDELTA_EQUIV ! mass-equivalent Gauss-Laguerre point +REAL :: ZFW ! liquid fraction +REAL :: ZFPW ! weight for mixed-phase reflectivity +REAL,DIMENSION(:),ALLOCATABLE :: ZX,ZW ! Gauss-Laguerre points and weights +REAL,DIMENSION(:),ALLOCATABLE :: ZRTMIN ! local values for XRTMIN +LOGICAL :: GCALC +!---------------------------------------------------------------------------- +! +!* 2. PRELIMINARIES +! ------------- +! +!* 2.0 Refractivity coeficients +! ------------------------ +! Bevis et al. (1994) +ZK1 = 0.776 ! K/Pa +ZK2 = 0.704 ! K/Pa +ZK3 = 3739. ! K2/Pa +ZRDSRV=XRD/XRV +! +XLAM_CRAD = 3.154E-3 ! (in m) <=> 95.04 GHz = Rasta cloud radar frequency +!* 2.1 Indices +! ------- +! +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +IKU = SIZE(PZ,3) ! nombre de niveaux sur la verticale +IKB = JPVEXT+1 +IKE = IKU-JPVEXT +! +! +!* 2.2 Interpolations of model variables to mass points +! ------------------------------------------------ +! +IIU=SIZE(PXHAT) +IJU=SIZE(PYHAT) +! +ZXHATM(1:IIU-1)=0.5*PXHAT(1:IIU-1)+0.5*PXHAT(2:IIU ) +ZXHATM( IIU )=1.5*PXHAT( IIU )-0.5*PXHAT( IIU-1) +! +ZYHATM(1:IJU-1)=0.5*PYHAT(1:IJU-1)+0.5*PYHAT(2:IJU ) +ZYHATM( IJU )=1.5*PYHAT( IJU )-0.5*PYHAT( IJU-1) +! +!---------------------------------------------------------------------------- +! +! +!* 3.4 instant of storage +! ------------------ +! +IF ( TPROFILER%T_CUR == XUNDEF ) TPROFILER%T_CUR = TPROFILER%STEP - PTSTEP +! +TPROFILER%T_CUR = TPROFILER%T_CUR + PTSTEP +! +IF ( TPROFILER%T_CUR >= TPROFILER%STEP - 1.E-10 ) THEN + GSTORE = .TRUE. + TPROFILER%T_CUR = TPROFILER%T_CUR - TPROFILER%STEP + TPROFILER%N_CUR = TPROFILER%N_CUR + 1 + IN = TPROFILER%N_CUR +ELSE + GSTORE = .FALSE. +END IF +! +IF (GSTORE) THEN +#if 0 + tprofiler%tpdates(in)%date%year = tdtexp%date%year + tprofiler%tpdates(in)%date%month = tdtexp%date%month + tprofiler%tpdates(in)%date%day = tdtexp%date%day + tprofiler%tpdates(in)%xtime = tdtexp%xtime + ( in - 1 ) * tprofiler%step +#else + tprofiler%tpdates(in) = tdtcur +#endif +END IF +! +! +!---------------------------------------------------------------------------- +! +!* 4. PROFILER POSITION +! -------------- +! +!* 4.0 initialization of processor test +! -------------------------------- +IF (GPROFILERFIRSTCALL) THEN +GPROFILERFIRSTCALL=.FALSE. +! + IF (.NOT.(ASSOCIATED(ZTHIS_PROCS))) ALLOCATE(ZTHIS_PROCS(NUMBPROFILER)) +! +IF (.NOT.(ASSOCIATED(II))) ALLOCATE(II(NUMBPROFILER)) +IF (.NOT.(ASSOCIATED(IJ))) ALLOCATE(IJ(NUMBPROFILER)) +IF (.NOT.(ASSOCIATED(IV))) ALLOCATE(IV(NUMBPROFILER)) +IF (.NOT.(ASSOCIATED(IU))) ALLOCATE(IU(NUMBPROFILER)) +IF (.NOT.(ASSOCIATED(ZXCOEF))) ALLOCATE(ZXCOEF(NUMBPROFILER)) +IF (.NOT.(ASSOCIATED(ZUCOEF))) ALLOCATE(ZUCOEF(NUMBPROFILER)) +IF (.NOT.(ASSOCIATED(ZYCOEF))) ALLOCATE(ZYCOEF(NUMBPROFILER)) +IF (.NOT.(ASSOCIATED(ZVCOEF))) ALLOCATE(ZVCOEF(NUMBPROFILER)) +! +ZXCOEF(:)=XUNDEF +ZUCOEF(:)=XUNDEF +ZYCOEF(:)=XUNDEF +ZVCOEF(:)=XUNDEF +! +DO I=1,NUMBPROFILER + +ZTHIS_PROCS(I)=0. +! +!* 4.1 X position +! ---------- +! +IU(I)=COUNT( PXHAT (:)<=TPROFILER%X(I) ) +II(I)=COUNT( ZXHATM(:)<=TPROFILER%X(I) ) +! +IF (II(I)<=IIB-1 .AND. LWEST_ll() .AND. .NOT. L1D) TPROFILER%ERROR(I)=.TRUE. +IF (II(I)>=IIE .AND. LEAST_ll() .AND. .NOT. L1D) TPROFILER%ERROR(I)=.TRUE. +! +! +!* 4.2 Y position +! ---------- +! +IV(I)=COUNT( PYHAT (:)<=TPROFILER%Y(I) ) +IJ(I)=COUNT( ZYHATM(:)<=TPROFILER%Y(I) ) +! +IF (IJ(I)<=IJB-1 .AND. LSOUTH_ll() .AND. .NOT. L1D) TPROFILER%ERROR(I)=.TRUE. +IF (IJ(I)>=IJE .AND. LNORTH_ll() .AND. .NOT. L1D) TPROFILER%ERROR(I)=.TRUE. +! +! +!* 4.3 Position of station according to processors +! ------------------------------------------- +! +IF (IU(I)>=IIB .AND. IU(I)<=IIE .AND. IV(I)>=IJB .AND. IV(I)<=IJE) ZTHIS_PROCS(I)=1. +IF (L1D) ZTHIS_PROCS(I)=1. +! +! +!* 4.4 Computations only on correct processor +! -------------------------------------- +ZXCOEF(I) = 0. +ZYCOEF(I) = 0. +ZUCOEF(I) = 0. +ZVCOEF(I) = 0. +IF (ZTHIS_PROCS(I) >0. .AND. .NOT. L1D) THEN +! +!* 6.1 Interpolation coefficient for X +! ------------------------------- +! + ZXCOEF(I) = (TPROFILER%X(I) - ZXHATM(II(I))) / (ZXHATM(II(I)+1) - ZXHATM(II(I))) +! +! +! +!* 6.2 Interpolation coefficient for y +! ------------------------------- +! + ZYCOEF(I) = (TPROFILER%Y(I) - ZYHATM(IJ(I))) / (ZYHATM(IJ(I)+1) - ZYHATM(IJ(I))) +! +!---------------------------------------------------------------------------- +! +!* 7. INITIALIZATIONS FOR INTERPOLATIONS OF U AND V +! --------------------------------------------- +! +!* 7.1 Interpolation coefficient for X (for U) +! ------------------------------- +! + ZUCOEF(I) = (TPROFILER%X(I) - PXHAT(IU(I))) / (PXHAT(IU(I)+1) - PXHAT(IU(I))) +! +!* 7.2 Interpolation coefficient for y (for V) +! ------------------------------- +! + ZVCOEF(I) = (TPROFILER%Y(I) - PYHAT(IV(I))) / (PYHAT(IV(I)+1) - PYHAT(IV(I))) +! +END IF +ENDDO +END IF +!---------------------------------------------------------------------------- +! +!* 8. DATA RECORDING +! -------------- +! +ZTEMP(:,:,:)=PTH(:,:,:)*(PP(:,:,:)/ XP00) **(XRD/XCPD) +! Theta_v +ZTHV(:,:,:) = PTH(:,:,:) / (1.+WATER_SUM(PR(:,:,:,:)))*(1.+PR(:,:,:,1)/ZRDSRV) +! virtual temperature +ZTEMPV(:,:,:)=ZTHV(:,:,:)*(PP(:,:,:)/ XP00) **(XRD/XCPD) +CALL GPS_ZENITH_GRID(PR(:,:,:,1),ZTEMP,PP,ZZTD,ZZHD,ZZWD) +! Kunkel formulation +IF (SIZE(PR,4) >= 2) THEN + ZVISIKUN(:,:,:) = 10E5 !default value + WHERE ( PR(:,:,:,2) /=0 ) + ZVISIKUN(:,:,:) =0.027/(10**(-8)+(PR(:,:,:,2)/(1+PR(:,:,:,2))*PRHODREF(:,:,:)*1000))**0.88 + END WHERE +END IF +! Gultepe formulation +IF ((SIZE(PR,4) >= 2) .AND. NSV_C2R2END /= 0 ) THEN + WHERE ( (PR(:,:,:,2) /=0. ) .AND. (PSV(:,:,:,NSV_C2R2BEG+1) /=0. ) ) + ZVISI(:,:,:) =1.002/(PR(:,:,:,2)*PRHODREF(:,:,:)*PSV(:,:,:,NSV_C2R2BEG+1))**0.6473 + END WHERE +END IF +! +IF (GSTORE) THEN + DO I=1,NUMBPROFILER + IF ((ZTHIS_PROCS(I)==1.).AND.(.NOT. TPROFILER%ERROR(I))) THEN + ! + ZZ(:) = PROFILER_INTERP(PZ) + ZRHOD(:) = PROFILER_INTERP(PRHODREF) + ZPRES(:) = PROFILER_INTERP(PP) + ZU_PROFILER(:) = PROFILER_INTERP_U(PU) + ZV_PROFILER(:) = PROFILER_INTERP_V(PV) + ZGAM = (XRPK * (TPROFILER%LON(I) - XLON0) - XBETA)*(XPI/180.) + ZFF(:) = SQRT(ZU_PROFILER(:)**2 + ZV_PROFILER(:)**2) + DO JK=1,IKU + IF (ZU_PROFILER(JK) >=0. .AND. ZV_PROFILER(JK) > 0.) & + ZDD(JK) = ATAN(ABS(ZU_PROFILER(JK)/ZV_PROFILER(JK))) * 180./XPI + 180. + IF (ZU_PROFILER(JK) >0. .AND. ZV_PROFILER(JK) <= 0.) & + ZDD(JK) = ATAN(ABS(ZV_PROFILER(JK)/ZU_PROFILER(JK))) * 180./XPI + 270. + IF (ZU_PROFILER(JK) <=0. .AND. ZV_PROFILER(JK) < 0.) & + ZDD(JK) = ATAN(ABS(ZU_PROFILER(JK)/ZV_PROFILER(JK))) * 180./XPI + IF (ZU_PROFILER(JK) <0. .AND. ZV_PROFILER(JK) >= 0.) & + ZDD(JK) = ATAN(ABS(ZV_PROFILER(JK)/ZU_PROFILER(JK))) * 180./XPI + 90. + IF (ZU_PROFILER(JK) == 0. .AND. ZV_PROFILER(JK) == 0.) & + ZDD(JK) = XUNDEF + END DO + ! GPS IWV and ZTD + XZS_GPS=TPROFILER%ALT(I) + IF ( ABS( ZZ(IKB)-XZS_GPS ) < 150 ) THEN ! distance between real and model orography ok + ZRV(:) = PROFILER_INTERP(PR(:,:,:,1)) + ZT(:) = PROFILER_INTERP(ZTEMP) + ZE(:) = ZPRES(:)*ZRV(:)/(ZRDSRV+ZRV(:)) + ZTV(:) = PROFILER_INTERP(ZTEMPV) + ZZTD_PROFILER = PROFILER_INTERP_2D(ZZTD) + ZZHD_PROFILER = PROFILER_INTERP_2D(ZZHD) + ZZWD_PROFILER = PROFILER_INTERP_2D(ZZWD) + ZIWV = 0. + DO JK=IKB,IKE + ZIWV=ZIWV+ZRHOD(JK)*ZRV(JK)*(ZZ(JK+1)-ZZ(JK)) + END DO + IF (ZZ(IKB) < XZS_GPS) THEN ! station above the model orography + DO JK=IKB+1,IKE + IF ( ZZ(JK) < XZS_GPS) THEN ! whole layer to remove + ZZHDR=( 1.E-6 * ZK1 * ZPRES(JK-1) * ( ZZ(JK) - ZZ(JK-1) ) / ZTV(JK-1)) + ZZWDR=( 1.E-6 * ( (ZK2-ZRDSRV*ZK1) + ( ZK3/ZT(JK-1) ) ) * & + ZE(JK-1)* ( ZZ(JK) - ZZ(JK-1) ) / ZT(JK-1) ) + ZZHD_PROFILER=ZZHD_PROFILER-ZZHDR + ZZWD_PROFILER=ZZWD_PROFILER-ZZWDR + ZZTD_PROFILER=ZZTD_PROFILER-ZZHDR-ZZWDR + ELSE ! partial layer to remove + ZZHDR=( 1.E-6 * ZK1 * ZPRES(JK-1) * ( XZS_GPS - ZZ(JK-1) ) / ZTV(JK-1)) + ZZWDR=( 1.E-6 * ( (ZK2-ZRDSRV*ZK1) + ( ZK3/ZT(JK-1) ) ) * & + ZE(JK-1)* ( XZS_GPS - ZZ(JK-1) ) / ZT(JK-1) ) + ZZHD_PROFILER=ZZHD_PROFILER-ZZHDR + ZZWD_PROFILER=ZZWD_PROFILER-ZZWDR + ZZTD_PROFILER=ZZTD_PROFILER-ZZHDR-ZZWDR + EXIT + END IF + END DO + ELSE ! station below the model orography +! Extrapolate variables below the model orography assuming constant T&Tv gradients, +! constant rv and hydrostatic law + ZZHATM(:)=0.5*(ZZ(1:IKU-1)+ZZ(2:IKU)) + ZZM_STAT=0.5*(XZS_GPS+ZZ(IKB)) + ZTM_STAT=ZT(IKB) + ( (ZZM_STAT-ZZHATM(IKB))*& + ( ZT(IKB)- ZT(IKB+1) )/(ZZHATM(IKB)-ZZHATM(IKB+1)) ) + ZTV_STAT=ZTV(IKB) + ( (ZZM_STAT-ZZHATM(IKB))*& + ( ZTV(IKB)- ZTV(IKB+1) )/(ZZHATM(IKB)-ZZHATM(IKB+1)) ) + ZPM_STAT = ZPRES(IKB) * EXP(XG *(ZZM_STAT-ZZHATM(IKB))& + /(XRD* 0.5 *(ZTV_STAT+ZTV(IKB)))) + ZEM_STAT = ZPM_STAT * ZRV(IKB) / ( ZRDSRV + ZRV(IKB) ) +! add contribution below the model orography + ZZHDR=( 1.E-6 * ZK1 * ZPM_STAT * ( ZZ(IKB) - XZS_GPS ) / ZTV_STAT ) + ZZWDR=( 1.E-6 * ( (ZK2-ZRDSRV*ZK1) + (ZK3/ZTM_STAT) )& + * ZEM_STAT* ( ZZ(IKB) - XZS_GPS ) / ZTM_STAT ) + ZZHD_PROFILER=ZZHD_PROFILER+ZZHDR + ZZWD_PROFILER=ZZWD_PROFILER+ZZWDR + ZZTD_PROFILER=ZZTD_PROFILER+ZZHDR+ZZWDR + END IF + TPROFILER%IWV(IN,I)= ZIWV + TPROFILER%ZTD(IN,I)= ZZTD_PROFILER + TPROFILER%ZWD(IN,I)= ZZWD_PROFILER + TPROFILER%ZHD(IN,I)= ZZHD_PROFILER + ELSE + CMNHMSG(1) = 'altitude of profiler ' // TRIM( TPROFILER%NAME(I) ) // ' is too far from orography' + CMNHMSG(2) = 'some variables are therefore not computed (IWV, ZTD, ZWD, ZHD)' + CALL PRINT_MSG( NVERB_WARNING, 'GEN', 'PROFILER_n' ) + TPROFILER%IWV(IN,I)= XUNDEF + TPROFILER%ZTD(IN,I)= XUNDEF + TPROFILER%ZWD(IN,I)= XUNDEF + TPROFILER%ZHD(IN,I)= XUNDEF + END IF + TPROFILER%ZON (IN,:,I) = ZU_PROFILER(:) * COS(ZGAM) + ZV_PROFILER(:) * SIN(ZGAM) + TPROFILER%MER (IN,:,I) = - ZU_PROFILER(:) * SIN(ZGAM) + ZV_PROFILER(:) * COS(ZGAM) + TPROFILER%FF (IN,:,I) = ZFF(:) + TPROFILER%DD (IN,:,I) = ZDD(:) + TPROFILER%W (IN,:,I) = PROFILER_INTERP(PW) + TPROFILER%TH (IN,:,I) = PROFILER_INTERP(PTH) + TPROFILER%THV (IN,:,I) = PROFILER_INTERP(ZTHV) + TPROFILER%VISI(IN,:,I) = PROFILER_INTERP(ZVISI) + TPROFILER%VISIKUN(IN,:,I) = PROFILER_INTERP(ZVISIKUN) + TPROFILER%ZZ (IN,:,I) = ZZ(:) + TPROFILER%RHOD(IN,:,I) = ZRHOD(:) + TPROFILER%CIZ(IN,:,I) = PROFILER_INTERP(PCIT) +! add RARE + ! initialization CRARE and CRARE_ATT + LWC and IWC + TPROFILER%CRARE(IN,:,I) = 0. + TPROFILER%CRARE_ATT(IN,:,I) = 0. + TPROFILER%LWCZ (IN,:,I) = 0. + TPROFILER%IWCZ (IN,:,I) = 0. + IF (CCLOUD=="LIMA" .OR. CCLOUD=="ICE3" ) THEN ! only for ICE3 and LIMA + TPROFILER%LWCZ (IN,:,I) = PROFILER_INTERP((PR(:,:,:,2)+PR(:,:,:,3))*PRHODREF(:,:,:)) + TPROFILER%IWCZ (IN,:,I) = PROFILER_INTERP((PR(:,:,:,4)+PR(:,:,:,5)+PR(:,:,:,6))*PRHODREF(:,:,:)) + ZTEMPZ(:)=PROFILER_INTERP(ZTEMP(:,:,:)) + ZRHODREFZ(:)=PROFILER_INTERP(PRHODREF(:,:,:)) + ZCIT(:)=PROFILER_INTERP(PCIT(:,:,:)) + IF (CCLOUD=="LIMA") THEN + ZCCI(:)=PROFILER_INTERP(PSV(:,:,:,NSV_LIMA_NI)) + ZCCR(:)=PROFILER_INTERP(PSV(:,:,:,NSV_LIMA_NR)) + ZCCC(:)=PROFILER_INTERP(PSV(:,:,:,NSV_LIMA_NC)) + ENDIF + DO JLOOP=3,6 + ZRZ(:,JLOOP)=PROFILER_INTERP(PR(:,:,:,JLOOP)) + END DO + IF (CSURF=="EXTE") THEN + DO JK=1,IKU + ZRZ(JK,2)=PROFILER_INTERP_2D(PR(:,:,JK,2)*PSEA(:,:)) ! becomes cloud mixing ratio over sea + ZRZ(JK,7)=PROFILER_INTERP_2D(PR(:,:,JK,2)*(1.-PSEA(:,:))) ! becomes cloud mixing ratio over land + END DO + ELSE + ZRZ(:,2)=PROFILER_INTERP(PR(:,:,:,2)) + ZRZ(:,7)=0. + END IF + ALLOCATE(ZAELOC(IKU)) + ! + ZAELOC(:)=0. + ! initialization of quadrature points and weights + ALLOCATE(ZX(JPTS_GAULAG),ZW(JPTS_GAULAG)) + CALL GAULAG(JPTS_GAULAG,ZX,ZW) ! for integration over diameters + ! initialize minimum values + ALLOCATE(ZRTMIN(SIZE(PR,4)+1)) + IF (CCLOUD == 'LIMA') THEN + ZRTMIN(2)=XRTMIN_L(2) ! cloud water over sea + ZRTMIN(3)=XRTMIN_L(3) + ZRTMIN(4)=XRTMIN_L(4) + ZRTMIN(5)=1E-10 + ZRTMIN(6)=XRTMIN_L(6) + ZRTMIN(7)=XRTMIN_L(2) ! cloud water over land + ELSE + ZRTMIN(2)=XRTMIN_I(2) ! cloud water over sea + ZRTMIN(3)=XRTMIN_I(3) + ZRTMIN(4)=XRTMIN_I(4) + ZRTMIN(5)=1E-10 + ZRTMIN(6)=XRTMIN_I(6) + ZRTMIN(7)=XRTMIN_I(2) ! cloud water over land + ENDIF + ! compute cloud radar reflectivity from vertical profiles of temperature + ! and mixing ratios + DO JK=1,IKU + QMW=SQRT(QEPSW(ZTEMPZ(JK),XLIGHTSPEED/XLAM_CRAD)) + QMI=SQRT(QEPSI(ZTEMPZ(JK),XLIGHTSPEED/XLAM_CRAD)) + DO JLOOP=2,7 + IF (CCLOUD == 'LIMA') THEN + GCALC=(ZRZ(JK,JLOOP)>ZRTMIN(JLOOP).AND.(JLOOP.NE.4.OR.ZCCI(JK)>0.).AND.& + (JLOOP.NE.3.OR.ZCCR(JK)>0.).AND.((JLOOP.NE.2.AND.JLOOP.NE.7).OR.ZCCC(JK)>0.)) + ELSE + GCALC=(ZRZ(JK,JLOOP)>ZRTMIN(JLOOP).AND.(JLOOP.NE.4.OR.ZCIT(JK)>0.)) + ENDIF + IF(GCALC) THEN + SELECT CASE(JLOOP) + CASE(2) ! cloud water over sea + IF (CCLOUD == 'LIMA') THEN + ZA=XAC_L + ZB=XBC_L + ZCC=ZCCC(JK)*ZRHODREFZ(JK) + ZCX=0. + ZALPHA=XALPHAC_L + ZNU=XNUC_L + ZLBEX=1.0/(ZCX-ZB) + ZLB=( ZA*ZCC*MOMG(ZALPHA,ZNU,ZB) )**(-ZLBEX) + ELSE + ZA=XAC_I + ZB=XBC_I + ZCC=XCONC_SEA + ZCX=0. + ZALPHA=XALPHAC2_I + ZNU=XNUC2_I + ZLBEX=1.0/(ZCX-ZB) + ZLB=( ZA*ZCC*MOMG(ZALPHA,ZNU,ZB) )**(-ZLBEX) + ENDIF + CASE(3) ! rain water + IF (CCLOUD == 'LIMA') THEN + ZA=XAR_L + ZB=XBR_L + ZCC=ZCCR(JK)*ZRHODREFZ(JK) + ZCX=0. + ZALPHA=XALPHAR_L + ZNU=XNUR_L + ZLBEX=1.0/(ZCX-ZB) + ZLB=( ZA*ZCC*MOMG(ZALPHA,ZNU,ZB) )**(-ZLBEX) + ELSE + ZA=XAR_I + ZB=XBR_I + ZCC=XCCR_I + ZCX=-1. + ZALPHA=XALPHAR_I + ZNU=XNUR_I + ZLB=XLBR_I + ZLBEX=XLBEXR_I + ENDIF + CASE(4) ! pristine ice + IF (CCLOUD == 'LIMA') THEN + ZA=XAI_L + ZB=XBI_L + ZCC=ZCCI(JK)*ZRHODREFZ(JK) + ZCX=0. + ZALPHA=XALPHAI_L + ZNU=XNUI_L + ZLBEX=1.0/(ZCX-ZB) + ZLB=( ZA*ZCC*MOMG(ZALPHA,ZNU,ZB) )**(-ZLBEX) ! because ZCC not included in XLBI + ZFW=0 + ELSE + ZA=XAI_I + ZB=XBI_I + ZCC=ZCIT(JK) + ZCX=0. + ZALPHA=XALPHAI_I + ZNU=XNUI_I + ZLBEX=XLBEXI_I + ZLB=XLBI_I*ZCC**(-ZLBEX) ! because ZCC not included in XLBI + ZFW=0 + ENDIF + CASE(5) ! snow + IF (CCLOUD == 'LIMA') THEN + ZA=XAS_L + ZB=XBS_L + ZCC=XCCS_L + ZCX=XCXS_L + ZALPHA=XALPHAS_L + ZNU=XNUS_L + ZNS=XNS_L + ZLB=XLBS_L + ZLBEX=XLBEXS_L + ZFW=0 + ELSE + ZA=XAS_I + ZB=XBS_I + ZCC=XCCS_I + ZCX=XCXS_I + ZALPHA=XALPHAS_I + ZNU=XNUS_I + ZNS=XNS_I + ZLB=XLBS_I + ZLBEX=XLBEXS_I + ZFW=0 + ENDIF + CASE(6) ! graupel + !If temperature between -10 and 10B0C and Mr and Mg over min + !threshold: melting graupel + ! with liquid water fraction Fw=Mr/(Mr+Mg) else dry graupel + ! (Fw=0) + IF( ZTEMPZ(JK) > XTT-10 .AND. ZTEMPZ(JK) < XTT+10 & + .AND. ZRZ(JK,3) > ZRTMIN(3) ) THEN + ZFW=ZRZ(JK,3)/(ZRZ(JK,3)+ZRZ(JK,JLOOP)) + ELSE + ZFW=0 + ENDIF + IF (CCLOUD == 'LIMA') THEN + ZA=XAG_L + ZB=XBG_L + ZCC=XCCG_L + ZCX=XCXG_L + ZALPHA=XALPHAG_L + ZNU=XNUG_L + ZLB=XLBG_L + ZLBEX=XLBEXG_L + ELSE + ZA=XAG_I + ZB=XBG_I + ZCC=XCCG_I + ZCX=XCXG_I + ZALPHA=XALPHAG_I + ZNU=XNUG_I + ZLB=XLBG_I + ZLBEX=XLBEXG_I + ENDIF + CASE(7) ! cloud water over land + IF (CCLOUD == 'LIMA') THEN + ZA=XAC_L + ZB=XBC_L + ZCC=ZCCC(JK)*ZRHODREFZ(JK) + ZCX=0. + ZALPHA=XALPHAC_L + ZNU=XNUC_L + ZLBEX=1.0/(ZCX-ZB) + ZLB=( ZA*ZCC*MOMG(ZALPHA,ZNU,ZB) )**(-ZLBEX) + ELSE + ZA=XAC_I + ZB=XBC_I + ZCC=XCONC_LAND + ZCX=0. + ZALPHA=XALPHAC_I + ZNU=XNUC_I + ZLBEX=1.0/(ZCX-ZB) + ZLB=( ZA*ZCC*MOMG(ZALPHA,ZNU,ZB) )**(-ZLBEX) + ENDIF + END SELECT + IF (JLOOP.EQ.5 .AND. ( (CCLOUD=='LIMA'.AND.LSNOW_T_L).OR. & + (CCLOUD=='ICE3'.AND.LSNOW_T_I) ) ) THEN + IF (ZTEMPZ(JK)>-10.) THEN + ZLBDA = MAX(MIN(XLBDAS_MAX, 10**(14.554-0.0423*(ZTEMPZ(JK)+273.15))),XLBDAS_MIN) + ELSE + ZLBDA = MAX(MIN(XLBDAS_MAX, 10**(6.226-0.0106*(ZTEMPZ(JK)+273.15))),XLBDAS_MIN) + END IF + ZN=ZNS*ZRHODREFZ(JK)*ZRZ(JK,JLOOP)*ZLBDA**ZB + ELSE + ZLBDA=ZLB*(ZRHODREFZ(JK)*ZRZ(JK,JLOOP))**ZLBEX + ZN=ZCC*ZLBDA**ZCX + END IF + ZREFLOC=0. + ZAETMP=0. + DO JJ=1,JPTS_GAULAG ! Gauss-Laguerre quadrature + ZDELTA_EQUIV=ZX(JJ)**(1./ZALPHA)/ZLBDA + SELECT CASE(JLOOP) + CASE(2,3,7) + QM=QMW + CASE(4,5,6) + ! pristine ice, snow, dry graupel + ZRHOHYD=MIN(6.*ZA*ZDELTA_EQUIV**(ZB-3.)/XPI,.92*XRHOLW) + QM=sqrt(MG(QMI**2,CMPLX(1,0),ZRHOHYD/.92/XRHOLW)) + ! water inclusions in ice in air + QEPSWI=MG(QMW**2,QM**2,ZFW) + ! ice in air inclusions in water + QEPSIW=MG(QM**2,QMW**2,1.-ZFW) + !MG weighted rule (Matrosov 2008) + IF(ZFW .LT. 0.37) THEN + ZFPW=0 + ELSE IF(ZFW .GT. 0.63) THEN + ZFPW=1 + ELSE + ZFPW=(ZFW-0.37)/(0.63-0.37) + ENDIF + QM=sqrt(QEPSWI*(1.-ZFPW)+QEPSIW*ZFPW) + END SELECT + CALL BHMIE(XPI/XLAM_CRAD*ZDELTA_EQUIV,QM,ZQEXT,ZQSCA,ZQBACK) + ZREFLOC=ZREFLOC+ZQBACK*ZX(JJ)**(ZNU-1)*ZDELTA_EQUIV**2*ZW(JJ) + ZAETMP =ZAETMP +ZQEXT *ZX(JJ)**(ZNU-1)*ZDELTA_EQUIV**2*ZW(JJ) + END DO + ZREFLOC=ZREFLOC*(XLAM_CRAD/XPI)**4*ZN/(4.*GAMMA(ZNU)*.93) + ZAETMP=ZAETMP * XPI *ZN/(4.*GAMMA(ZNU)) + TPROFILER%CRARE(IN,JK,I)=TPROFILER%CRARE(IN,JK,I)+ZREFLOC + ZAELOC(JK)=ZAELOC(JK)+ZAETMP + END IF + END DO + END DO + ! apply attenuation + ALLOCATE(ZZMZ(IKU)) + ZZMZ = ZZ(:) ! PROFILER_INTERP(ZZM(:,:,:)) +! ZZMZ(1)=ZZM_STAT + ! zenith + ZAETOT=1. + DO JK = 2,IKU + ! attenuation from ZAELOC(JK) and ZAELOC(JK-1) + ZAETOT=ZAETOT*EXP(-(ZAELOC(JK-1)+ZAELOC(JK))*(ZZMZ(JK)-ZZMZ(JK-1))) + TPROFILER%CRARE_ATT(IN,JK,I)=TPROFILER%CRARE(IN,JK,I)*ZAETOT + END DO +! TPROFILER%ZZ (IN,:,I) = ZZMZ(:) + DEALLOCATE(ZZMZ,ZAELOC) + ! m^3 bmm^6/m^3 bdBZ + WHERE(TPROFILER%CRARE(IN,:,I)>0) + TPROFILER%CRARE(IN,:,I)=10.*LOG10(1.E18*TPROFILER%CRARE(IN,:,I)) + ELSEWHERE + TPROFILER%CRARE(IN,:,I)=XUNDEF + END WHERE + WHERE(TPROFILER%CRARE_ATT(IN,:,I)>0) + TPROFILER%CRARE_ATT(IN,:,I)=10.*LOG10(1.E18*TPROFILER%CRARE_ATT(IN,:,I)) + ELSEWHERE + TPROFILER%CRARE_ATT(IN,:,I)=XUNDEF + END WHERE + DEALLOCATE(ZX,ZW,ZRTMIN) + END IF ! end LOOP ICE3 +! end add RARE +!! + IF (.NOT. L1D) THEN + TPROFILER%P (IN,:,I) = PROFILER_INTERP(PP(II(I):II(I)+1,IJ(I):IJ(I)+1,:)) + ELSE + TPROFILER%P (IN,:,I) = PROFILER_INTERP(PP) + END IF + ! + DO JSV=1,SIZE(PR,4) + TPROFILER%R (IN,:,I,JSV) = PROFILER_INTERP(PR(:,:,:,JSV)) + END DO + ZWORK(:,:,:,:)=PSV(:,:,:,:) + ZWORK(:,:,1,:)=PSV(:,:,2,:) + DO JSV=1,SIZE(PSV,4) + TPROFILER%SV (IN,:,I,JSV) = PROFILER_INTERP(ZWORK(:,:,:,JSV)) + END DO + ZWORK2(:,:,:,:) = 0. + DO JK=IKB,IKE + IKRAD = JK - JPVEXT + ZWORK2(:,:,JK,:)=PAER(:,:,IKRAD,:) + ENDDO + DO JSV=1,SIZE(PAER,4) + TPROFILER%AER(IN,:,I,JSV) = PROFILER_INTERP(ZWORK2(:,:,:,JSV)) + ENDDO + IF (SIZE(PTKE)>0) TPROFILER%TKE (IN,:,I) = PROFILER_INTERP(PTKE) + ! + IF (LDIAG_IN_RUN) THEN + TPROFILER%T2M (IN,I) = PROFILER_INTERP_2D(XCURRENT_T2M ) + TPROFILER%Q2M (IN,I) = PROFILER_INTERP_2D(XCURRENT_Q2M ) + TPROFILER%HU2M (IN,I) = PROFILER_INTERP_2D(XCURRENT_HU2M ) + TPROFILER%ZON10M(IN,I) = PROFILER_INTERP_2D(XCURRENT_ZON10M) + TPROFILER%MER10M(IN,I) = PROFILER_INTERP_2D(XCURRENT_MER10M) + TPROFILER%RN (IN,I) = PROFILER_INTERP_2D(XCURRENT_RN ) + TPROFILER%H (IN,I) = PROFILER_INTERP_2D(XCURRENT_H ) + TPROFILER%LE (IN,I) = PROFILER_INTERP_2D(XCURRENT_LE ) + TPROFILER%LEI (IN,I) = PROFILER_INTERP_2D(XCURRENT_LEI ) + TPROFILER%GFLUX (IN,I) = PROFILER_INTERP_2D(XCURRENT_GFLUX ) + IF (CRAD /= 'NONE') THEN + TPROFILER%SWD (IN,I) = PROFILER_INTERP_2D(XCURRENT_SWD ) + TPROFILER%SWU (IN,I) = PROFILER_INTERP_2D(XCURRENT_SWU ) + TPROFILER%LWD (IN,I) = PROFILER_INTERP_2D(XCURRENT_LWD ) + TPROFILER%LWU (IN,I) = PROFILER_INTERP_2D(XCURRENT_LWU ) + END IF + TPROFILER%TKE_DISS(IN,:,I) = PROFILER_INTERP(XCURRENT_TKE_DISS) + ENDIF + ENDIF +! +!---------------------------------------------------------------------------- +! +!* 11. EXCHANGE OF INFORMATION BETWEEN PROCESSORS +! ------------------------------------------ +! +!* 11.2 data stored +! ----------- +! + CALL DISTRIBUTE_PROFILER(TPROFILER%X (I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%Y (I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%LON (I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%LAT (I)) + ! + IF (LDIAG_IN_RUN) THEN + CALL DISTRIBUTE_PROFILER(TPROFILER%T2M (IN,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%Q2M (IN,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%HU2M (IN,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%ZON10M(IN,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%MER10M(IN,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%RN (IN,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%H (IN,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%LE (IN,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%LEI (IN,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%GFLUX (IN,I)) + IF (CRAD /= 'NONE') THEN + CALL DISTRIBUTE_PROFILER(TPROFILER%LWD (IN,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%LWU (IN,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%SWD (IN,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%SWU (IN,I)) + ENDIF + ENDIF + DO JK=1,IKU + CALL DISTRIBUTE_PROFILER(TPROFILER%ZON (IN,JK,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%MER (IN,JK,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%FF (IN,JK,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%DD (IN,JK,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%W (IN,JK,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%P (IN,JK,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%ZZ (IN,JK,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%TH (IN,JK,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%THV (IN,JK,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%VISI(IN,JK,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%VISIKUN(IN,JK,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%RHOD(IN,JK,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%CRARE(IN,JK,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%CRARE_ATT(IN,JK,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%CIZ(IN,JK,I)) + + ! + IF (LDIAG_IN_RUN) CALL DISTRIBUTE_PROFILER(TPROFILER%TKE_DISS(IN,JK,I)) + ! + DO JSV=1,SIZE(PR,4) + CALL DISTRIBUTE_PROFILER(TPROFILER%R (IN,JK,I,JSV)) + END DO + DO JSV=1,SIZE(PSV,4) + CALL DISTRIBUTE_PROFILER(TPROFILER%SV (IN,JK,I,JSV)) + END DO + IF (SIZE(PTKE)>0) CALL DISTRIBUTE_PROFILER(TPROFILER%TKE (IN,JK,I)) + ENDDO + + CALL DISTRIBUTE_PROFILER(TPROFILER%IWV(IN,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%ZTD(IN,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%ZHD(IN,I)) + CALL DISTRIBUTE_PROFILER(TPROFILER%ZWD(IN,I)) +ENDDO +! +END IF +! +!---------------------------------------------------------------------------- +!---------------------------------------------------------------------------- +! +CONTAINS +! +!---------------------------------------------------------------------------- +!---------------------------------------------------------------------------- +FUNCTION PROFILER_INTERP_2D(PA) RESULT(PB) +! +REAL, DIMENSION(:,:), INTENT(IN) :: PA +REAL :: PB +! +INTEGER :: JI, JJ +! +IF (SIZE(PA,1)==2) THEN + JI=1 + JJ=1 +ELSEIF (L1D) THEN + JI=2 + JJ=2 +ELSE + JI=II(I) + JJ=IJ(I) +END IF +! +! +PB = (1.-ZYCOEF(I)) * (1.-ZXCOEF(I)) * PA(JI,JJ) + & + (1.-ZYCOEF(I)) * (ZXCOEF(I)) * PA(JI+1,JJ) + & + ( ZYCOEF(I)) * (1.-ZXCOEF(I)) * PA(JI,JJ+1) + & + ( ZYCOEF(I)) * (ZXCOEF(I)) * PA(JI+1,JJ+1) +! +END FUNCTION PROFILER_INTERP_2D +!---------------------------------------------------------------------------- +!---------------------------------------------------------------------------- +FUNCTION PROFILER_INTERP(PA) RESULT(PB) +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PA +REAL, DIMENSION(SIZE(PA,3)) :: PB +! +INTEGER :: JI, JJ,JK +! +IF (SIZE(PA,1)==2) THEN + JI=1 + JJ=1 +ELSEIF (L1D) THEN + JI=2 + JJ=2 +ELSE + JI=II(I) + JJ=IJ(I) +END IF +! +! +DO JK=1,SIZE(PA,3) + IF ( (PA(JI,JJ,JK) /= XUNDEF) .AND. (PA(JI+1,JJ,JK) /= XUNDEF) .AND. & + (PA(JI,JJ+1,JK) /= XUNDEF) .AND. (PA(JI+1,JJ+1,JK) /= XUNDEF) ) THEN + PB(JK) = (1.-ZYCOEF(I)) * (1.-ZXCOEF(I)) * PA(JI,JJ,JK) + & + (1.-ZYCOEF(I)) * (ZXCOEF(I)) * PA(JI+1,JJ,JK) + & + (ZYCOEF(I)) * (1.-ZXCOEF(I)) * PA(JI,JJ+1,JK) + & + (ZYCOEF(I)) * (ZXCOEF(I)) * PA(JI+1,JJ+1,JK) + ELSE + PB(JK) = XUNDEF + END IF +END DO +! +END FUNCTION PROFILER_INTERP +!---------------------------------------------------------------------------- +!---------------------------------------------------------------------------- +FUNCTION PROFILER_INTERP_U(PA) RESULT(PB) +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PA +REAL, DIMENSION(SIZE(PA,3)) :: PB +! +INTEGER :: JI, JJ +! +IF (SIZE(PA,1)==2) THEN + JI=1 + JJ=1 +ELSEIF (L1D) THEN + JI=2 + JJ=2 +ELSE + JI=IU(I) + JJ=IJ(I) +END IF +! +PB(:) = (1.- ZYCOEF(I)) * (1.-ZUCOEF(I)) * PA(JI ,JJ ,:) & + + (1.- ZYCOEF(I)) * ( ZUCOEF(I)) * PA(JI+1,JJ ,:) & + + ( ZYCOEF(I)) * (1.-ZUCOEF(I)) * PA(JI ,JJ+1,:) & + + ( ZYCOEF(I)) * ( ZUCOEF(I)) * PA(JI+1,JJ+1,:) +! +END FUNCTION PROFILER_INTERP_U +!---------------------------------------------------------------------------- +!---------------------------------------------------------------------------- +FUNCTION PROFILER_INTERP_V(PA) RESULT(PB) +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PA +REAL, DIMENSION(SIZE(PA,3)) :: PB +! +INTEGER :: JI, JJ +! +IF (SIZE(PA,1)==2) THEN + JI=1 + JJ=1 +ELSEIF (L1D) THEN + JI=2 + JJ=2 +ELSE + JI=II(I) + JJ=IV(I) +END IF +! +PB(:) = (1.- ZVCOEF(I)) * (1.-ZXCOEF(I)) * PA(JI ,JJ ,:) & + + (1.- ZVCOEF(I)) * ( ZXCOEF(I)) * PA(JI+1,JJ ,:) & + + ( ZVCOEF(I)) * (1.-ZXCOEF(I)) * PA(JI ,JJ+1,:) & + + ( ZVCOEF(I)) * ( ZXCOEF(I)) * PA(JI+1,JJ+1,:) +! +END FUNCTION PROFILER_INTERP_V +!---------------------------------------------------------------------------- +!---------------------------------------------------------------------------- +SUBROUTINE DISTRIBUTE_PROFILER(PAS) +! +REAL, INTENT(INOUT) :: PAS +! +PAS = PAS * ZTHIS_PROCS(I) + +CALL REDUCESUM_ll(PAS,IINFO_ll) +! +END SUBROUTINE DISTRIBUTE_PROFILER +!---------------------------------------------------------------------------- +! +END SUBROUTINE PROFILER_n diff --git a/src/mesonh/ext/radar_scattering.f90 b/src/mesonh/ext/radar_scattering.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ebefa37d36ea882c407a0bd5ee1edd0e011f38af --- /dev/null +++ b/src/mesonh/ext/radar_scattering.f90 @@ -0,0 +1,2073 @@ +!MNH_LIC Copyright 2004-2019 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. +!----------------------------------------------------------------- +! ######spl + MODULE MODI_RADAR_SCATTERING +! ############################# +! +INTERFACE + SUBROUTINE RADAR_SCATTERING(PT_RAY,PRHODREF_RAY,PR_RAY,PI_RAY,PCIT_RAY,PS_RAY,PG_RAY,PVDOP_RAY, & + PELEV,PX_H,PX_V,PW_H,PW_V,PZE,PBU_MASK_RAY,PCR_RAY,PH_RAY) +REAL, DIMENSION(:,:,:,:,:,:),INTENT(IN) :: PT_RAY ! temperature interpolated along the rays +REAL, DIMENSION(:,:,:,:,:,:),INTENT(IN) :: PRHODREF_RAY ! +REAL, DIMENSION(:,:,:,:,:,:),INTENT(IN) :: PR_RAY ! rainwater mixing ratio interpolated along the rays +REAL, DIMENSION(:,:,:,:,:,:),INTENT(IN) :: PI_RAY ! pristine ice mixing ratio interpolated along the rays +REAL, DIMENSION(:,:,:,:,:,:), INTENT(IN) :: PCIT_RAY ! pristine ice concentration interpolated along the rays +REAL, DIMENSION(:,:,:,:,:,:), INTENT(IN) :: PS_RAY !aggregates mixing ratio interpolated along the rays +REAL, DIMENSION(:,:,:,:,:,:), INTENT(IN) :: PG_RAY ! graupel mixing ratio interpolated along the rays +REAL, DIMENSION(:,:,:,:,:,:), INTENT(IN) :: PVDOP_RAY !Doppler radial velocity interpolated along the rays +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PELEV ! elevation +REAL, DIMENSION(:), INTENT(IN) :: PX_H ! Gaussian horizontal nodes +REAL, DIMENSION(:), INTENT(IN) :: PX_V ! Gaussian vertical nodes +REAL, DIMENSION(:), INTENT(IN) :: PW_H ! Gaussian horizontal weights +REAL, DIMENSION(:), INTENT(IN) :: PW_V ! Gaussian vertical weights +REAL,DIMENSION(:,:,:,:,:), INTENT(INOUT) :: PZE ! 5D matrix (iradar, ielev, iaz, irangestep, ivar) containing the radar variables that will be calculated +!in polar or cartesian projection (same projection as the observation grid) +! convective/stratiform +REAL, DIMENSION(:,:,:,:,:,:),INTENT(INOUT) :: PBU_MASK_RAY +REAL, DIMENSION(:,:,:,:,:,:),OPTIONAL,INTENT(IN) :: PCR_RAY ! rainwater concentration interpolated along the rays +REAL, DIMENSION(:,:,:,:,:,:),OPTIONAL,INTENT(IN) :: PH_RAY ! hail mixing ratio interpolated along the rays + END SUBROUTINE RADAR_SCATTERING +END INTERFACE +END MODULE MODI_RADAR_SCATTERING +! +! ######spl + SUBROUTINE RADAR_SCATTERING(PT_RAY,PRHODREF_RAY,PR_RAY,PI_RAY,PCIT_RAY, & + PS_RAY,PG_RAY,PVDOP_RAY,PELEV,PX_H,PX_V,PW_H,PW_V,PZE,PBU_MASK_RAY,PCR_RAY,PH_RAY) +! ############################## +! +!!**** *RADAR_SCATTERING* - computes radar reflectivities. +!! +!! PURPOSE +!! ------- +!! Compute equivalent reflectivities of a mixed phase cloud. +!! +!!** METHOD +!! ------ +!! The reflectivities are computed using the n(D) * sigma(D) formula. The +!! equivalent reflectiviy is the sum of the reflectivity produced by the +!! the raindrops and the equivalent reflectivities of the ice crystals. +!! The latter are computed using the mass-equivalent diameter. +!! Four types of diffusion are possible : Rayleigh, Mie, T-matrix, and +!! Rayleigh-Gans (Kerker, 1969, Chap. 10; Battan, 1973, Sec. 5.4; van de +!! Hulst, 1981, Sec. 6.32; Doviak and Zrnic, 1993, p. 249; Bringi and +!! Chandrasekar, 2001, Chap. 2). +!! The integration over diameters for Mie and T-matrix methods is done by +!! using Gauss-Laguerre quadrature (Press et al. 1986). Attenuation is taken +!! into account by computing the extinction efficiency and correcting +!! reflectivities along the beam path. +!! Gaussian quadrature methods are used to model the beam broadening (Gauss- +!! Hermite or Gauss-Legendre, see Press et al. 1986). +!! +!! +!! EXTERNAL +!! -------- +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODD_CST +!! XLIGHTSPEED +!! XPI +!! Module MODD_ARF +!! +!! REFERENCE +!! --------- +!! Press, W. H., B. P. Flannery, S. A. Teukolsky et W. T. Vetterling, 1986: +!! Numerical Recipes: The Art of Scientific Computing. Cambridge University +!! Press, 818 pp. +!! Probert-Jones, J. R., 1962 : The radar equation in meteorology. Quart. +!! J. Roy. Meteor. Soc., 88, 485-495. +!! +!! AUTHOR +!! ------ +!! O. Caumont & V. Ducrocq * Meteo-France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 26/03/2004 +!! O. Caumont 09/09/2009 minor changes to compute radial velocities when no +!! hydrometeors so as to emulate wind lidar +!! O. Caumont 21/12/2009 correction of bugs to compute KDP. +!! O. Caumont 11/02/2010 thresholding and conversion from linear to +!! log values after interpolation instead of before. +!! G.Tanguy 25/03/2010 Introduction of MODD_TMAT and ALLOCATE/DEALLOCATE +!! C.Augros 2014 New simulator for T matrice +!! G.Delautier 10/2014 : Mise a jour simulateur T-matrice pour LIMA +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_CST +USE MODD_IO, ONLY: TFILEDATA +USE MODD_LUNIT +USE MODD_PARAMETERS +USE MODD_PARAM_ICE_n, ONLY: LSNOW_T_I=>LSNOW_T +USE MODD_RAIN_ICE_DESCR_n, ONLY: XALPHAR_I=>XALPHAR,XNUR_I=>XNUR,XDR_I=>XDR,XLBEXR_I=>XLBEXR,& + XLBR_I=>XLBR,XCCR_I=>XCCR,XBR_I=>XBR,XCR_I=>XCR,& + XALPHAS_I=>XALPHAS,XNUS_I=>XNUS,XDS_I=>XDS,XLBEXS_I=>XLBEXS,& + XLBS_I=>XLBS,XCCS_I=>XCCS,XNS_I=>XNS,XAS_I=>XAS,XBS_I=>XBS,XCXS_I=>XCXS,XCS_I=>XCS,& + XALPHAG_I=>XALPHAG,XNUG_I=>XNUG,XDG_I=>XDG,XLBEXG_I=>XLBEXG,& + XLBG_I=>XLBG,XCCG_I=>XCCG,XAG_I=>XAG,XBG_I=>XBG,XCXG_I=>XCXG,XCG_I=>XCG,& + XALPHAH_I=>XALPHAH,XNUH_I=>XNUH,XDH_I=>XDH,XLBEXH_I=>XLBEXH,& + XLBH_I=>XLBH,XCCH_I=>XCCH,XAH_I=>XAH,XBH_I=>XBH,XCXH_I=>XCXH,XCH_I=>XCH,& + XALPHAI_I=>XALPHAI,XNUI_I=>XNUI,XDI_I=>XDI,XLBEXI_I=>XLBEXI,& + XLBI_I=>XLBI,XAI_I=>XAI,XBI_I=>XBI,XC_I_I=>XC_I,& + XRTMIN_I=>XRTMIN +!!LIMA +USE MODD_PARAM_LIMA_WARM, ONLY: XDR_L=>XDR,XLBEXR_L=>XLBEXR,XLBR_L=>XLBR,XBR_L=>XBR,XCR_L=>XCR +USE MODD_PARAM_LIMA_COLD, ONLY: XDI_L=>XDI,XLBEXI_L=>XLBEXI,XLBI_L=>XLBI,XAI_L=>XAI,XBI_L=>XBI,XC_I_L=>XC_I,& + XDS_L=>XDS,XLBEXS_L=>XLBEXS,XLBS_L=>XLBS,XCCS_L=>XCCS,XNS_L=>XNS,XAS_L=>XAS,XBS_L=>XBS,& + XCXS_L=>XCXS,XCS_L=>XCS,XLBDAS_MIN,XLBDAS_MAX + +USE MODD_PARAM_LIMA_MIXED, ONLY:XDG_L=>XDG,XLBEXG_L=>XLBEXG,XLBG_L=>XLBG,XCCG_L=>XCCG,XAG_L=>XAG,XBG_L=>XBG,XCXG_L=>XCXG,XCG_L=>XCG +USE MODD_PARAM_LIMA, ONLY: XALPHAR_L=>XALPHAR,XNUR_L=>XNUR,XALPHAS_L=>XALPHAS,XNUS_L=>XNUS,& + XALPHAG_L=>XALPHAG,XNUG_L=>XNUG, XALPHAI_L=>XALPHAI,XNUI_L=>XNUI,& + XRTMIN_L=>XRTMIN, LSNOW_T_L=>LSNOW_T +!!LIMA +USE MODD_RADAR, ONLY:XLAM_RAD,XSTEP_RAD,NBELEV,NDIFF,LATT,NPTS_GAULAG,LQUAD,XVALGROUND,NDGS, & + LFALL,LWBSCS,LWREFL,XREFLVDOPMIN,XREFLMIN,LSNRT,XSNRMIN +USE MODD_TMAT +! +USE MODE_ARF +USE MODE_FSCATTER +USE MODE_READTMAT +USE MODE_FGAU , ONLY:GAULAG +USE MODI_GAMMA, ONLY:GAMMA +! +USE MODD_LUNIT +USE MODE_IO_FILE, ONLY: IO_File_close, IO_File_open +USE MODE_IO_MANAGE_STRUCT, ONLY: IO_File_add2list +USE MODE_MSG + +! +IMPLICIT NONE +! +!* 0.1 Declarations of dummy arguments : +! +! +REAL,DIMENSION(:,:,:,:,:,:), INTENT(IN) :: PT_RAY ! temperature interpolated along the rays +REAL,DIMENSION(:,:,:,:,:,:), INTENT(IN) :: PRHODREF_RAY ! +REAL,DIMENSION(:,:,:,:,:,:), INTENT(IN) :: PR_RAY ! rainwater mixing ratio interpolated along the rays +REAL,DIMENSION(:,:,:,:,:,:), INTENT(IN) :: PI_RAY ! pristine ice mixing ratio interpolated along the rays +REAL,DIMENSION(:,:,:,:,:,:), INTENT(IN) :: PCIT_RAY !pristine ice concentration interpolated along the rays +REAL,DIMENSION(:,:,:,:,:,:), INTENT(IN) :: PS_RAY !aggregates mixing ratio interpolated along the rays +REAL,DIMENSION(:,:,:,:,:,:), INTENT(IN) :: PG_RAY ! graupel mixing ratio interpolated along the rays +REAL,DIMENSION(:,:,:,:,:,:), INTENT(IN) :: PVDOP_RAY !Doppler radial velocity interpolated along the rays +REAL,DIMENSION(:,:,:,:), INTENT(IN) :: PELEV ! elevation +REAL,DIMENSION(:), INTENT(IN) :: PX_H ! Gaussian horizontal nodes +REAL,DIMENSION(:), INTENT(IN) :: PX_V ! Gaussian vertical nodes +REAL,DIMENSION(:), INTENT(IN) :: PW_H ! Gaussian horizontal weights +REAL,DIMENSION(:), INTENT(IN) :: PW_V ! Gaussian vertical weights +REAL,DIMENSION(:,:,:,:,:), INTENT(INOUT) :: PZE ! gate equivalent reflectivity factor (horizontal & vertical) +! convective/stratiform +REAL,DIMENSION(:,:,:,:,:,:),INTENT(INOUT) :: PBU_MASK_RAY +! /convective/stratiform +REAL, DIMENSION(:,:,:,:,:,:),OPTIONAL,INTENT(IN) :: PCR_RAY ! rainwater concentration interpolated along the rays +REAL, DIMENSION(:,:,:,:,:,:),OPTIONAL,INTENT(IN) :: PH_RAY ! hail mixing ratio interpolated along the rays +! +!* 0.2 Declarations of local variables : +! +REAL, DIMENSION(:,:,:,:,:,:,:),ALLOCATABLE :: ZREFL +!1: ZHH (dBZ), 2: ZDR, 3: KDP, 4: CSR (0 pr air clair, 1 pour stratiforme, 2 pour convectif) +!5-8: ZER, ZEI, ZES,ZEG +!9 : VRU (vitesse radiale) +!10-13 : AER, AEI, AES, AEG +!14-17: ATR, ATI, ATS, ATG +!18-20: RhoHV, PhiDP, DeltaHV + +REAL, DIMENSION(:,:,:,:,:,:,:),ALLOCATABLE :: ZAELOC ! local attenuation +REAL, DIMENSION(:,:,:),ALLOCATABLE :: ZAETOT ! 1: total attenuation, 2: // vertical +REAL :: ZAERINT,ZAEIINT,ZAESINT,ZAEGINT,ZAEHINT ! total attenuation horizontal +REAL :: ZAVRINT,ZAVSINT,ZAVGINT,ZAVHINT ! total attenuation vertical +! +REAL,DIMENSION(:),ALLOCATABLE :: ZX,ZW ! Gauss-Laguerre points and weights +! +REAL,DIMENSION(4) :: ZREFLOC +REAL,DIMENSION(2) :: ZAETMP +REAL,DIMENSION(:),ALLOCATABLE :: ZVTEMP ! temp var for Gaussian quadrature 8 : r_r, 9 : r_i, 10 : r_s , 11 : r_g +REAL :: ZCXR=-1.0 ! for rain N ~ 1/N_0 (in Kessler parameterization) +REAL :: ZDMELT_FACT ! factor used to compute the equivalent melted diameter +REAL :: ZEQICE=0.224! factor used to convert the ice crystals reflectivity into an equivalent liquid water reflectivity (from Smith, JCAM 84) +REAL :: ZEXP ! anciliary parameter +REAL :: ZLBDA ! slope distribution parameter +REAL :: ZN ! Number concentration +REAL :: ZFRAC_ICE,ZD,ZDE ! auxiliary variables +REAL :: ZQSCA +REAL,DIMENSION(2) :: ZQEXT +REAL,DIMENSION(3) :: ZQBACK ! Q_b(HH),Q_b(VV) (backscattering efficiencies at horizontal and vertical polarizations, resp.) +!REAL :: P=DACOS(-1D0) +REAL :: ZRHOI ! pristine ice density (from m=a*D**b), +REAL :: ZRHOPI=916. !pure ice density (kg/m3) +COMPLEX :: ZNUM, ZDEN !for calculation of ice dielectri cconstant +COMPLEX :: ZQM,ZQMW,ZQMI,ZQK,ZQB, ZEPSI ! dielectric parameters +REAL :: ZS11_CARRE_R,ZS22_CARRE_R,ZRE_S22S11_R,ZIM_S22S11_R +REAL :: ZS11_CARRE_I,ZS22_CARRE_I,ZRE_S22S11_I,ZIM_S22S11_I +REAL :: ZS11_CARRE_S,ZS22_CARRE_S,ZRE_S22S11_S,ZIM_S22S11_S +REAL :: ZS11_CARRE_G,ZS22_CARRE_G,ZRE_S22S11_G,ZIM_S22S11_G +REAL :: ZS11_CARRE_H,ZS22_CARRE_H,ZRE_S22S11_H,ZIM_S22S11_H +REAL :: ZS11_CARRE_T,ZS22_CARRE_T,ZRE_S22S11_T,ZIM_S22S11_T +REAL :: ZRE_S22FMS11F,ZIM_S22FT,ZIM_S11FT + +REAL :: ZM +! +INTEGER :: INBRAD,IIELV,INBAZIM,INBSTEPMAX,INPTS_H,INPTS_V ! sizes of the arrays +INTEGER :: IEL +INTEGER :: JI,JL,JEL,JAZ,JH,JV,JJ,JT ! Loop variables of control +REAL :: ZLB ! depolarization factor along the spheroid symmetry axis +REAL :: ZCXI=0. ! should be defined with other parameters of microphysical scheme +REAL :: ZCR,ZCI,ZCS,ZCG,ZCH ! coefficients to take into account fall speeds when simulating Doppler winds +REAL, DIMENSION(:,:,:,:),ALLOCATABLE :: ZCONC_BIN +INTEGER :: IMAX +LOGICAL :: LPART_MASK ! indicates a partial mask along the beam + +! +INTEGER :: IZER,IZEI,IZES,IZEG +INTEGER :: IVDOP,IRHV,IPDP,IDHV +INTEGER :: IAER,IAEI,IAES,IAEG +INTEGER :: IAVR,IAVI,IAVS,IAVG +INTEGER :: IATR,IATI,IATS,IATG +INTEGER :: IRHR, IRHS, IRHG, IZDA, IZDS, IZDG, IKDR, IKDS, IKDG +INTEGER :: IZEH, IRHH,IKDH,IZDH ! hail +INTEGER :: IAEH,IAVH,IATH +! +!for ZSNR threshold +REAL ::ZDISTRAD,ZSNR,ZSNR_R,ZSNR_S,ZSNR_I,ZSNR_G,ZSNR_H,ZZHH,ZZE_R,ZZE_I,ZZE_S,ZZE_G,ZZE_H +LOGICAL :: GTHRESHOLD_V, GTHRESHOLD_Z,GTHRESHOLD_ZR,GTHRESHOLD_ZI,GTHRESHOLD_ZS,GTHRESHOLD_ZG,GTHRESHOLD_ZH + +!--------- TO READ T-MATRIX TABLE -------- +CHARACTER(LEN=6) :: YBAND +CHARACTER(LEN=1) ::YTYPE +CHARACTER(LEN=1),DIMENSION(5) :: YTAB_TYPE +CHARACTER(LEN=25),DIMENSION(5) :: YFILE_COEFINT + +REAL,DIMENSION(5) :: ZELEV_MIN,ZELEV_MAX,ZELEV_STEP,& +ZTC_MIN,ZTC_MAX,ZTC_STEP,ZFW_MIN,ZFW_MAX,ZFW_STEP +INTEGER :: IRESP,ILINE,INB_M +INTEGER,DIMENSION(5) :: INB_ELEV,INB_TC,INB_FW,INB_LINE + +REAL, DIMENSION(:),ALLOCATABLE :: ZTC_T_R, ZTC_T_S, ZTC_T_G, ZTC_T_W +REAL, DIMENSION(:),ALLOCATABLE :: ZELEV_T_R, ZELEV_T_S, ZELEV_T_G, ZELEV_T_W +REAL, DIMENSION(:),ALLOCATABLE :: ZFW_T_S, ZFW_T_G, ZFW_T_W +REAL, DIMENSION(:),ALLOCATABLE :: ZM_T_R, ZM_T_S, ZM_T_G, ZM_T_W +REAL, DIMENSION(:),ALLOCATABLE :: ZS11_CARRE_T_R, ZS11_CARRE_T_S, ZS11_CARRE_T_G, ZS11_CARRE_T_W +REAL, DIMENSION(:),ALLOCATABLE :: ZS22_CARRE_T_R, ZS22_CARRE_T_S, ZS22_CARRE_T_G, ZS22_CARRE_T_W +REAL, DIMENSION(:),ALLOCATABLE :: ZRE_S22S11_T_R, ZRE_S22S11_T_S, ZRE_S22S11_T_G, ZRE_S22S11_T_W +REAL, DIMENSION(:),ALLOCATABLE :: ZIM_S22S11_T_R, ZIM_S22S11_T_S, ZIM_S22S11_T_G, ZIM_S22S11_T_W +REAL, DIMENSION(:),ALLOCATABLE :: ZIM_S22FT_T_R, ZIM_S22FT_T_S, ZIM_S22FT_T_G, ZIM_S22FT_T_W +REAL, DIMENSION(:),ALLOCATABLE :: ZIM_S11FT_T_R, ZIM_S11FT_T_S, ZIM_S11FT_T_G, ZIM_S11FT_T_W +REAL, DIMENSION(:),ALLOCATABLE :: ZRE_S22FMS11FT_T_R, ZRE_S22FMS11FT_T_S, ZRE_S22FMS11FT_T_G, ZRE_S22FMS11FT_T_W +REAL, DIMENSION(:),ALLOCATABLE :: ZTC_T_H ,ZELEV_T_H ,ZFW_T_H,ZM_T_H,ZS11_CARRE_T_H,ZS22_CARRE_T_H,ZRE_S22S11_T_H +REAL, DIMENSION(:),ALLOCATABLE :: ZIM_S22S11_T_H,ZIM_S22FT_T_H,ZIM_S11FT_T_H,ZRE_S22FMS11FT_T_H +INTEGER,DIMENSION(16):: ITMAT +REAL:: ZELEV_RED,ZTC_RED,ZM_RED,ZFW_RED +INTEGER :: JIND +REAL,DIMENSION(7,16) :: KMAT_COEF !matrice contenant tous les coef interpolés + !pour chaque val inf et sup de ELEV_t +REAL :: ZEXPM_MIN, ZEXPM_STEP, ZEXPM_MAX,ZM_MIN +REAL :: ZFW !water fraction inside melting graupel (ZFW=0 for rain, snow and dry graupel). used only with NDIFF=7: Tmatrix +INTEGER :: ILUOUT0,IUNIT +! +! MODIF GAELLE POUR LIMA +! +LOGICAL :: GLIMA,GHAIL +REAL,DIMENSION(5) :: ZCC_MIN,ZCC_MAX, ZCC_STEP +INTEGER,DIMENSION(5):: INB_CC +REAL, DIMENSION(:),ALLOCATABLE :: ZCC_T_R +REAL :: ZCC_RED +LOGICAL :: GCALC +REAL :: ZCC +REAL, DIMENSION(:,:,:,:,:,:),ALLOCATABLE :: ZM_6D,ZCC_6D +REAL :: ZC +! +REAL :: ZCCR,ZLBR,ZLBEXR,ZDR,ZALPHAR,ZNUR,ZBR +REAL :: ZCCS,ZLBS,ZLBEXS,ZDS,ZALPHAS,ZNUS,ZAS,ZBS,ZCXS,ZNS +REAL :: ZCCG,ZLBG,ZLBEXG,ZDG,ZALPHAG,ZNUG,ZAG,ZBG,ZCXG +REAL :: ZCCH,ZLBH,ZLBEXH,ZDH,ZALPHAH,ZNUH,ZAH,ZBH,ZCXH +REAL :: ZLBI,ZLBEXI,ZDI,ZALPHAI,ZNUI,ZAI,ZBI +REAL,DIMENSION(:),ALLOCATABLE :: ZRTMIN +CHARACTER(LEN=100) :: YMSG +TYPE(TFILEDATA),POINTER :: TZFILE +! +!* 1. INITIALISATION +!-------------- +ILUOUT0 = TLUOUT0%NLU +TZFILE => NULL() +! +IF (PRESENT(PCR_RAY)) THEN + GLIMA=.TRUE. +ELSE + GLIMA=.FALSE. +ENDIF +IF (PRESENT(PH_RAY)) THEN + GHAIL=.TRUE. +ELSE + GHAIL=.FALSE. +ENDIF +! +! +! + ZS11_CARRE_R=0 + ZS22_CARRE_R=0 + ZRE_S22S11_R=0 + ZIM_S22S11_R=0 + ZS11_CARRE_I=0 + ZS22_CARRE_I=0 + ZRE_S22S11_I=0 + ZIM_S22S11_I=0 + ZS11_CARRE_S=0 + ZS22_CARRE_S=0 + ZRE_S22S11_S=0 + ZIM_S22S11_S=0 + ZS11_CARRE_G=0 + ZS22_CARRE_G=0 + ZRE_S22S11_G=0 + ZIM_S22S11_G=0 + ZS11_CARRE_H=0 + ZS22_CARRE_H=0 + ZRE_S22S11_H=0 + ZIM_S22S11_H=0 +! Initialisation varibales microphysiques +IF (GLIMA) THEN ! LIMA + ZLBR=XLBR_L + ZLBEXR=XLBEXR_L + ZDR=XDR_L + ZALPHAR=XALPHAR_L + ZNUR=XNUR_L + ZBR=XBR_L + ZCCS=XCCS_L + ZCXS=XCXS_L + ZLBS=XLBS_L + ZLBEXS=XLBEXS_L + ZNS=XNS_L + ZDS=XDS_L + ZALPHAS=XALPHAS_L + ZNUS=XNUS_L + ZAS=XAS_L + ZBS=XBS_L + ZCCG=XCCG_L + ZCXG=XCXG_L + ZLBG=XLBG_L + ZLBEXG=XLBEXG_L + ZDG=XDG_L + ZALPHAG=XALPHAG_L + ZNUG=XNUG_L + ZAG=XAG_L + ZBG=XBG_L + ZLBI=XLBI_L + ZLBEXI=XLBEXI_L + ZDI=XDI_L + ZALPHAI=XALPHAI_L + ZNUI=XNUI_L + ZAI=XAI_L + ZBI=XBI_L + ALLOCATE(ZRTMIN(SIZE(XRTMIN_L))) + ZRTMIN=XRTMIN_L +ELSE ! ICE3 + ZCCR=XCCR_I + ZLBR=XLBR_I + ZLBEXR=XLBEXR_I + ZDR=XDR_I + ZALPHAR=XALPHAR_I + ZNUR=XNUR_I + ZBR=XBR_I + ZCCS=XCCS_I + ZCXS=XCXS_I + ZLBS=XLBS_I + ZLBEXS=XLBEXS_I + ZNS=XNS_I + ZDS=XDS_I + ZALPHAS=XALPHAS_I + ZNUS=XNUS_I + ZAS=XAS_I + ZBS=XBS_I + ZCCG=XCCG_I + ZCXG=XCXG_I + ZLBG=XLBG_I + ZLBEXG=XLBEXG_I + ZDG=XDG_I + ZALPHAG=XALPHAG_I + ZNUG=XNUG_I + ZAG=XAG_I + ZBG=XBG_I + ZLBI=XLBI_I + ZLBEXI=XLBEXI_I + ZDI=XDI_I + ZALPHAI=XALPHAI_I + ZNUI=XNUI_I + ZAI=XAI_I + ZBI=XBI_I + ALLOCATE(ZRTMIN(SIZE(XRTMIN_I))) + ZRTMIN=XRTMIN_I + IF (GHAIL) THEN + ZCCH=XCCH_I + ZCXH=XCXH_I + ZLBH=XLBH_I + ZLBEXH=XLBEXH_I + ZDH=XDH_I + ZALPHAH=XALPHAH_I + ZNUH=XNUH_I + ZAH=XAH_I + ZBH=XBH_I + ENDIF +ENDIF +! +! initialisation of refractivity indices +! 1 : ZHH +! 2 : ZDR +! 3 : KDP +! 4 : CSR +IZER=5 ! ZER +IZEI=IZER+1 ! ZEI +IZES=IZEI+1 ! ZES +IZEG=IZES+1 ! ZEG +IF (GHAIL) THEN + IZEH=IZEG+1 !ZEH + IVDOP=IZEH+1 !VRU +ELSE + IVDOP=IZEG+1 !VRU +END IF +IF (LATT) THEN + IF (GHAIL) THEN + IAER=IVDOP+1 + IAEI=IAER+1 + IAES=IAEI+1 + IAEG=IAES+1 + IAEH=IAEG+1 + IAVR=IAEH+1 + IAVI=IAVR+1 + IAVS=IAVI+1 + IAVG=IAVS+1 + IAVH=IAVG+1 + IATR=IAVH+1 + IATI=IATR+1 + IATS=IATI+1 + IATG=IATS+1 + IATH=IATG+1 + IRHV=IATH+1 + ELSE + IAER=IVDOP+1 + IAEI=IAER+1 + IAES=IAEI+1 + IAEG=IAES+1 + IAVR=IAEG+1 + IAVI=IAVR+1 + IAVS=IAVI+1 + IAVG=IAVS+1 + IATR=IAVG+1 + IATI=IATR+1 + IATS=IATI+1 + IATG=IATS+1 + IRHV=IATG+1 + ENDIF +ELSE + IRHV=IVDOP+1 +ENDIF +IPDP=IRHV+1 +IDHV=IPDP+1 +IRHR=IDHV+1 +IRHS=IRHR+1 +IRHG=IRHS+1 +IF (GHAIL) THEN + IRHH=IRHG+1 + IZDA=IRHH+1 +ELSE + IZDA=IRHG+1 +ENDIF +IZDS=IZDA+1 +IZDG=IZDS+1 +IF (GHAIL) THEN + IZDH=IZDG+1 + IKDR=IZDH+1 +ELSE + IKDR=IZDG+1 +ENDIF +IKDS=IKDR+1 +IKDG=IKDS+1 +IF (GHAIL) THEN + IKDH=IKDG+1 +ENDIF +! +! +! +INBRAD=SIZE(PT_RAY,1) +IIELV=SIZE(PT_RAY,2) +INBAZIM=SIZE(PT_RAY,3) +INBSTEPMAX=SIZE(PT_RAY,4) +INPTS_H=SIZE(PT_RAY,5) +INPTS_V=SIZE(PT_RAY,6) +! +! Initialisation for radial winds +IF(LFALL) THEN + IF (GLIMA) THEN + ZCR=XCR_L + ZCI=XC_I_L + ZCS=XCS_L + ZCG=XCG_L + ELSE + ZCR=XCR_I + ZCI=XC_I_I + ZCS=XCS_I + ZCG=XCG_I + IF (GHAIL) ZCH=XCH_I + ENDIF +ELSE + ZCR=0. + ZCI=0. + ZCS=0. + ZCG=0. + IF (GHAIL) ZCH=0. +END IF + +! Calculation of nodes and weights for the Gauss-Laguerre quadrature +! for Mie and T-matrix and RG +IF(NDIFF/=0) THEN + ALLOCATE(ZX(NPTS_GAULAG),ZW(NPTS_GAULAG)) !NPTS_GAULAG : number of points for the quadrature + CALL GAULAG(NPTS_GAULAG,ZX,ZW) +END IF +! +! +IMAX=SIZE(PZE,5) +WRITE(ILUOUT0,*) "-----------------" +WRITE(ILUOUT0,*) "Radar scattering" +WRITE(ILUOUT0,*) "-----------------" +WRITE(ILUOUT0,*) 'Nombre de variables dans PZE: ',IMAX + +IF(.NOT.LWREFL) IMAX=IMAX+1 + +ALLOCATE(ZREFL(INBRAD,IIELV,INBAZIM,INBSTEPMAX,INPTS_H,INPTS_V,IMAX)) +ZREFL(:,:,:,:,:,:,:)=0. +IF(LATT) THEN + ZREFL(:,:,:,:,:,:,IATR:IATG)=1. + IF (GHAIL) ZREFL(:,:,:,:,:,:,IATH)=1. +END IF +PZE(:,:,:,:,:)=0. +IF (LATT)THEN + ALLOCATE(ZAELOC(INBRAD,IIELV,INBAZIM,INBSTEPMAX,INPTS_H,INPTS_V,2)) + ALLOCATE(ZAETOT(INPTS_H,INPTS_V,2)) + ZAELOC(:,:,:,:,:,:,:)=0. ! initialization of attenuation stuff (alpha_e for first gate) + ZAETOT(:,:,:)=1. ! initialization of attenuation stuff (total attenuation) +END IF +WRITE(ILUOUT0,*) 'BEFORE LOOP DIFFUSION' + +IF(LWBSCS) THEN + ALLOCATE(ZCONC_BIN(INBRAD,IIELV,INBAZIM,INBSTEPMAX)) + ZCONC_BIN(:,:,:,:)=0. +END IF + +WRITE(ILUOUT0,*) "XCCR:",ZCCR +WRITE(ILUOUT0,*) "XLBR:",ZLBR +WRITE(ILUOUT0,*) "XLBEXR:",ZLBEXR + +WRITE(ILUOUT0,*) "XCCS:",ZCCS +WRITE(ILUOUT0,*) "XLBS:",ZLBS +WRITE(ILUOUT0,*) "XLBEXS:",ZLBEXS + +WRITE(ILUOUT0,*) "XCCG:",ZCCG +WRITE(ILUOUT0,*) "XLBG:",ZLBG +WRITE(ILUOUT0,*) "XLBEXG:",ZLBEXG + +IF (GHAIL) THEN + WRITE(ILUOUT0,*) "XCCH:",ZCCH + WRITE(ILUOUT0,*) "XLBH:",ZLBH + WRITE(ILUOUT0,*) "XLBEXH:",ZLBEXH +ENDIF +! +IF (GLIMA .AND. NDIFF==7) THEN + IF (ZALPHAR/=1 .AND. ZNUR /=2.) THEN + WRITE(ILUOUT0,*) " ERROR : TMATRICE TABLE ARE MADE WITH XALPHAR=1 XNUR=2" + WRITE(ILUOUT0,*) " FOR CCLOUD=LIMA. PLEASE CHANGE THIS VALUES OR PROVIDE " + WRITE(ILUOUT0,*) " NEW TMATRICE TABLES " + CALL PRINT_MSG(NVERB_FATAL,'GEN','RADAR_SCATTERING','') + ENDIF +ELSE + IF (ZALPHAR/=1 .AND. ZNUR /=1.) THEN + WRITE(ILUOUT0,*) " ERROR : TMATRICE TABLE ARE MADE WITH XALPHAR=1 XNUR=1" + WRITE(ILUOUT0,*) " FOR CCLOUD=ICE3. PLEASE CHANGE THIS VALUEs OR PROVIDE " + WRITE(ILUOUT0,*) " NEW TMATRICE TABLES " + CALL PRINT_MSG(NVERB_FATAL,'GEN','RADAR_SCATTERING','') + ENDIF +ENDIF + +!--------------------------------------------- +! LOOP OVER EVERYTHING +!-------------------------------------------- +IF(NDIFF==7) THEN + YTAB_TYPE(1)='r' + YTAB_TYPE(2)='s' + YTAB_TYPE(3)='g' + YTAB_TYPE(4)='w' + YTAB_TYPE(5)='h' + ! definition des paramètres de lecture de la table T-matrice + ! all mixing ratio + ZEXPM_MIN=-7. + ZEXPM_STEP=0.01 + ZEXPM_MAX=-2. + ZM_MIN=10**ZEXPM_MIN + ! rain + ZELEV_MIN(1)=0.0 + ZELEV_STEP(1)=4.0 + ZELEV_MAX(1)=12.0 + ZTC_MIN(1)=-20.0 + ZTC_STEP(1)=1.0 + ZTC_MAX(1)=40.0 + ZFW_MIN(1)=0.0 + ZFW_STEP(1)=0.1 + ZFW_MAX(1)=0.0 + IF (GLIMA) THEN + ZCC_MIN(1)=1.8 + ZCC_STEP(1)=0.02 + ZCC_MAX(1)=6 + ELSE + ZCC_MIN(1)=1. + ZCC_STEP(1)=1. + ZCC_MAX(1)=1. + ENDIF + ! snow + graupel + ZELEV_MIN(2:3)=0.0 + ZELEV_STEP(2:3)=12.0 + ZELEV_MAX(2:3)=12.0 + ZTC_MIN(2:3)=-70.0 + ZTC_STEP(2:3)=1.0 + ZTC_MAX(2:3)=10.0 + ZFW_MIN(2:3)=0.0 + ZFW_STEP(2:3)=0.1 + ZFW_MAX(2:3)=0.0 + ZCC_MIN(2:3)=1. + ZCC_STEP(2:3)=1. + ZCC_MAX(2:3)=1. + ! wet graupel + ZELEV_MIN(4)=0.0 + ZELEV_STEP(4)=4.0 + ZELEV_MAX(4)=12.0 + ZTC_MIN(4)=-10.0 + ZTC_STEP(4)=1.0 + ZTC_MAX(4)=10.0 + ZFW_MIN(4)=0.0 + ZFW_STEP(4)=0.1 + ZFW_MAX(4)=1.0 + ZCC_MIN(4)=1. + ZCC_STEP(4)=1. + ZCC_MAX(4)=1. + ! hail + ZELEV_MIN(5)=0.0 + ZELEV_STEP(5)=4.0 + ZELEV_MAX(5)=12.0 + ZTC_MIN(5)=-20.0 + ZTC_STEP(5)=1.0 + ZTC_MAX(5)=30.0 + ZFW_MIN(5)=0. + ZFW_STEP(5)=0.1 + ZFW_MAX(5)=0.0 + ZCC_MIN(5)=1. + ZCC_STEP(5)=1. + ZCC_MAX(5)=1. + DO JT=1,5 + INB_ELEV(JT)=NINT((ZELEV_MAX(JT)-ZELEV_MIN(JT))/ZELEV_STEP(JT))+1 + INB_TC(JT)=NINT((ZTC_MAX(JT)-ZTC_MIN(JT))/ZTC_STEP(JT))+1 + INB_FW(JT)=NINT((ZFW_MAX(JT)-ZFW_MIN(JT))/ZFW_STEP(JT))+1 + INB_M=NINT((ZEXPM_MAX-ZEXPM_MIN)/ZEXPM_STEP)+1 + INB_CC(JT)=NINT((ZCC_MAX(JT)-ZCC_MIN(JT))/ZCC_STEP(JT))+1 + INB_LINE(JT)=INB_ELEV(JT)*INB_TC(JT)*INB_FW(JT)*INB_M*INB_CC(JT) + ENDDO +ENDIF + +!--------------------------------------------- +! LOOP OVER EVERYTHING +!-------------------------------------------- + !============== loop over radars ================= +WRITE(ILUOUT0,*) "INBRAD",INBRAD +DO JI=1,INBRAD + WRITE(ILUOUT0,*) "JI",JI + WRITE(ILUOUT0,*) "XLAM_RAD(JI):",XLAM_RAD(JI) + + IF(NDIFF==7) THEN ! If T-MATRIX + !--------------------------------------------------------------------------------------------- + ! 0. LECTURE DES TABLES TMAT POUR PLUIE, NEIGE, GRAUPEL + ! en fonction de la bande frequence + !--------------------------------------------------------------------------------------------- + IF ( XLAM_RAD(JI)==0.1062) THEN + YBAND='S106.2' + ELSEIF (XLAM_RAD(JI) ==0.0532 ) THEN + YBAND='C053.2' + ELSEIF (XLAM_RAD(JI)==0.0319 ) THEN + YBAND='X031.9' + ELSE + WRITE(ILUOUT0,*) "ERROR RADAR_SCATTERING" + WRITE(ILUOUT0,*) "Tmatrice tables are only available for XLAM_RAD=0.1062" + WRITE(ILUOUT0,*) "or XLAM_RAD=0.0532 or XLAM_RAD=0.0319" + WRITE(ILUOUT0,*) "change XLAM_RAD in namelist or compute new tmatrice table" + CALL PRINT_MSG(NVERB_FATAL,'GEN','RADAR_SCATTERING','') + ENDIF + + !************ fichiers Min Max Pas et Coef Tmat *********** + DO JT=1,5 !types (r, s, g, w, h) + + YTYPE=YTAB_TYPE(JT) + IF (JT .EQ. 1) THEN + IF (GLIMA) THEN + YFILE_COEFINT(JT)='TmatCoefInt_LIMA_'//YBAND//YTYPE + ELSE + YFILE_COEFINT(JT)='TmatCoefInt_ICE3_'//YBAND//YTYPE + ENDIF + ELSE + YFILE_COEFINT(JT)='TmatCoefInt_'//YBAND//YTYPE + ENDIF + YFILE_COEFINT(JT)=TRIM(ADJUSTL(YFILE_COEFINT(JT))) + ENDDO + !lookup tables for rain + ALLOCATE (ZTC_T_R(INB_LINE(1)),ZELEV_T_R(INB_LINE(1)),ZCC_T_R(INB_LINE(1)),ZM_T_R(INB_LINE(1)),& + ZS11_CARRE_T_R(INB_LINE(1)),ZS22_CARRE_T_R(INB_LINE(1)), ZRE_S22S11_T_R(INB_LINE(1)),ZIM_S22S11_T_R(INB_LINE(1)),& + ZRE_S22FMS11FT_T_R(INB_LINE(1)),ZIM_S22FT_T_R(INB_LINE(1)),ZIM_S11FT_T_R(INB_LINE(1))) + + !lookup tables for snow + ALLOCATE (ZTC_T_S(INB_LINE(2)),ZELEV_T_S(INB_LINE(2)),ZFW_T_S(INB_LINE(2)),ZM_T_S(INB_LINE(2)),& + ZS11_CARRE_T_S(INB_LINE(2)),ZS22_CARRE_T_S(INB_LINE(2)),ZRE_S22S11_T_S(INB_LINE(2)),ZIM_S22S11_T_S(INB_LINE(2)),& + ZRE_S22FMS11FT_T_S(INB_LINE(2)),ZIM_S22FT_T_S(INB_LINE(2)),ZIM_S11FT_T_S(INB_LINE(2))) + + !lookup tables for graupel + ALLOCATE (ZTC_T_G(INB_LINE(3)),ZELEV_T_G(INB_LINE(3)),ZFW_T_G(INB_LINE(3)),ZM_T_G(INB_LINE(3)),& + ZS11_CARRE_T_G(INB_LINE(3)),ZS22_CARRE_T_G(INB_LINE(3)), ZRE_S22S11_T_G(INB_LINE(3)),ZIM_S22S11_T_G(INB_LINE(3)),& + ZRE_S22FMS11FT_T_G(INB_LINE(3)),ZIM_S22FT_T_G(INB_LINE(3)),ZIM_S11FT_T_G(INB_LINE(3))) + + !lookup tables for wet graupel + ALLOCATE (ZTC_T_W(INB_LINE(4)),ZELEV_T_W(INB_LINE(4)),ZFW_T_W(INB_LINE(4)),ZM_T_W(INB_LINE(4)),& + ZS11_CARRE_T_W(INB_LINE(4)),ZS22_CARRE_T_W(INB_LINE(4)), ZRE_S22S11_T_W(INB_LINE(4)),ZIM_S22S11_T_W(INB_LINE(4)),& + ZRE_S22FMS11FT_T_W(INB_LINE(4)),ZIM_S22FT_T_W(INB_LINE(4)),ZIM_S11FT_T_W(INB_LINE(4))) + + IF (GHAIL) THEN + !lookup tables for hail + ALLOCATE (ZTC_T_H(INB_LINE(5)),ZELEV_T_H(INB_LINE(5)),ZFW_T_H(INB_LINE(5)),ZM_T_H(INB_LINE(5)),& + ZS11_CARRE_T_H(INB_LINE(5)),ZS22_CARRE_T_H(INB_LINE(5)), ZRE_S22S11_T_H(INB_LINE(5)),ZIM_S22S11_T_H(INB_LINE(5)),& + ZRE_S22FMS11FT_T_H(INB_LINE(5)),ZIM_S22FT_T_H(INB_LINE(5)),ZIM_S11FT_T_H(INB_LINE(5))) + ENDIF + !===== Lecture des tables =========== + + 6003 FORMAT (E11.4,2X,E9.3,2X,E10.4,2X,E10.4,2X,E12.5,2X,E12.5,2X,& + E12.5,2X,E12.5,2X,E12.5,2X,E12.5,2X,E12.5) + + !rain + CALL IO_File_add2list(TZFILE,YFILE_COEFINT(1),'TXT','READ') + CALL IO_File_open(TZFILE,KRESP=IRESP) + IUNIT = TZFILE%NLU + IF ( IRESP /= 0 ) THEN + WRITE(YMSG,*) "problem opening file ",TRIM(YFILE_COEFINT(1)) + CALL PRINT_MSG(NVERB_FATAL,'GEN','RADAR_SCATTERING',YMSG) + ENDIF + ILINE=1 + DO WHILE (ILINE .LE. INB_LINE(1)) + READ( UNIT=IUNIT,FMT=6003, IOSTAT=IRESP ) ZTC_T_R(ILINE),ZELEV_T_R(ILINE),& + ZCC_T_R(ILINE),ZM_T_R(ILINE),ZS11_CARRE_T_R(ILINE),ZS22_CARRE_T_R(ILINE),ZRE_S22S11_T_R(ILINE),& + ZIM_S22S11_T_R(ILINE),ZRE_S22FMS11FT_T_R(ILINE),ZIM_S22FT_T_R(ILINE),ZIM_S11FT_T_R(ILINE) + ILINE=ILINE+1 + ENDDO + CALL IO_File_close(TZFILE) + TZFILE => NULL() + WRITE(ILUOUT0,*) "NLIGNE rain",ILINE + ILINE=2 + WRITE(ILUOUT0,*) "ILINE=",ILINE + WRITE(ILUOUT0,*) "ZTC_T_R(ILINE),ZELEV_T_R(ILINE),ZCC_T_R(ILINE)",& + ZTC_T_R(ILINE),ZELEV_T_R(ILINE),ZCC_T_R(ILINE) + WRITE(ILUOUT0,*) "ZM_T_R(ILINE),ZS11_CARRE_T_R(ILINE),ZS22_CARRE_T_R(ILINE),ZRE_S22S11_T_R(ILINE)",& + ZM_T_R(ILINE),ZS11_CARRE_T_R(ILINE),ZS22_CARRE_T_R(ILINE),ZRE_S22S11_T_R(ILINE) + WRITE(ILUOUT0,*) "ZIM_S22S11_T_R(ILINE),ZRE_S22FMS11FT_T_R(ILINE),ZIM_S22FT_T_R(ILINE),ZIM_S11FT_T_R(ILINE)",& + ZIM_S22S11_T_R(ILINE),ZRE_S22FMS11FT_T_R(ILINE),ZIM_S22FT_T_R(ILINE),ZIM_S11FT_T_R(ILINE) + + !snow + CALL IO_File_add2list(TZFILE,YFILE_COEFINT(2),'TXT','READ') + CALL IO_File_open(TZFILE,KRESP=IRESP) + IUNIT = TZFILE%NLU + IF ( IRESP /= 0 ) THEN + WRITE(YMSG,*) "problem opening file ",TRIM(YFILE_COEFINT(2)) + CALL PRINT_MSG(NVERB_FATAL,'GEN','RADAR_SCATTERING',YMSG) + ENDIF + ILINE=1 + DO WHILE (ILINE .LE. INB_LINE(2)) + READ( UNIT=IUNIT,FMT=6003, IOSTAT=IRESP ) ZTC_T_S(ILINE),ZELEV_T_S(ILINE),& + ZFW_T_S(ILINE),ZM_T_S(ILINE),ZS11_CARRE_T_S(ILINE),ZS22_CARRE_T_S(ILINE),ZRE_S22S11_T_S(ILINE),& + ZIM_S22S11_T_S(ILINE),ZRE_S22FMS11FT_T_S(ILINE),ZIM_S22FT_T_S(ILINE),ZIM_S11FT_T_S(ILINE) + ILINE=ILINE+1 + ENDDO + CALL IO_File_close(TZFILE) + TZFILE => NULL() + WRITE(ILUOUT0,*) "NLIGNE snow",ILINE + ILINE=2 + WRITE(ILUOUT0,*) "ILINE=",ILINE + WRITE(ILUOUT0,*) "ZTC_T_S(ILINE),ZELEV_T_S(ILINE),ZFW_T_S(ILINE)",& + ZTC_T_S(ILINE),ZELEV_T_S(ILINE),ZFW_T_S(ILINE) + WRITE(ILUOUT0,*) "ZM_T_S(ILINE),ZS11_CARRE_T_S(ILINE),ZS22_CARRE_T_S(ILINE),ZRE_S22S11_T_S(ILINE)",& + ZM_T_S(ILINE),ZS11_CARRE_T_S(ILINE),ZS22_CARRE_T_S(ILINE),ZRE_S22S11_T_S(ILINE) + WRITE(ILUOUT0,*) "ZIM_S22S11_T_S(ILINE),ZRE_S22FMS11FT_T_S(ILINE),ZIM_S22FT_T_S(ILINE),ZIM_S11FT_T_S(ILINE)",& + ZIM_S22S11_T_S(ILINE),ZRE_S22FMS11FT_T_S(ILINE),ZIM_S22FT_T_S(ILINE),ZIM_S11FT_T_S(ILINE) + + !graupel + CALL IO_File_add2list(TZFILE,YFILE_COEFINT(3),'TXT','READ') + CALL IO_File_open(TZFILE,KRESP=IRESP) + IUNIT = TZFILE%NLU + IF ( IRESP /= 0 ) THEN + WRITE(YMSG,*) "problem opening file ",TRIM(YFILE_COEFINT(3)) + CALL PRINT_MSG(NVERB_FATAL,'GEN','RADAR_SCATTERING',YMSG) + ENDIF + ILINE=1 + DO WHILE (ILINE .LE. INB_LINE(3)) + READ( UNIT=IUNIT, FMT=6003,IOSTAT=IRESP ) ZTC_T_G(ILINE),ZELEV_T_G(ILINE),& + ZFW_T_G(ILINE),ZM_T_G(ILINE),ZS11_CARRE_T_G(ILINE),ZS22_CARRE_T_G(ILINE),ZRE_S22S11_T_G(ILINE),& + ZIM_S22S11_T_G(ILINE),ZRE_S22FMS11FT_T_G(ILINE),ZIM_S22FT_T_G(ILINE),ZIM_S11FT_T_G(ILINE) + ILINE=ILINE+1 + ENDDO + CALL IO_File_close(TZFILE) + TZFILE => NULL() + WRITE(ILUOUT0,*) "NLIGNE graupel",ILINE + ILINE=2 + WRITE(ILUOUT0,*) "ILINE=",ILINE + WRITE(ILUOUT0,*) "ZTC_T_G(ILINE),ZELEV_T_G(ILINE)",& + ZTC_T_G(ILINE),ZELEV_T_G(ILINE) + WRITE(ILUOUT0,*) "ZM_T_G(ILINE),ZS11_CARRE_T_G(ILINE),ZS22_CARRE_T_G(ILINE),ZRE_S22S11_T_G(ILINE)",& + ZM_T_G(ILINE),ZS11_CARRE_T_G(ILINE),ZS22_CARRE_T_G(ILINE),ZRE_S22S11_T_G(ILINE) + WRITE(ILUOUT0,*) "ZIM_S22S11_T_G(ILINE),ZRE_S22FMS11FT_T_G(ILINE),ZIM_S22FT_T_G(ILINE),ZIM_S11FT_T_G(ILINE)",& + ZIM_S22S11_T_G(ILINE),ZRE_S22FMS11FT_T_G(ILINE),ZIM_S22FT_T_G(ILINE),ZIM_S11FT_T_G(ILINE) + + !wet graupel + CALL IO_File_add2list(TZFILE,YFILE_COEFINT(4),'TXT','READ') + CALL IO_File_open(TZFILE,KRESP=IRESP) + IUNIT = TZFILE%NLU + IF ( IRESP /= 0 ) THEN + WRITE(YMSG,*) "problem opening file ",TRIM(YFILE_COEFINT(4)) + CALL PRINT_MSG(NVERB_FATAL,'GEN','RADAR_SCATTERING',YMSG) + ENDIF + ILINE=1 + DO WHILE (ILINE .LE. INB_LINE(4)) + READ( UNIT=IUNIT, FMT=6003,IOSTAT=IRESP ) ZTC_T_W(ILINE),ZELEV_T_W(ILINE),& + ZFW_T_W(ILINE),ZM_T_W(ILINE),ZS11_CARRE_T_W(ILINE),ZS22_CARRE_T_W(ILINE),ZRE_S22S11_T_W(ILINE),& + ZIM_S22S11_T_W(ILINE),ZRE_S22FMS11FT_T_W(ILINE),ZIM_S22FT_T_W(ILINE),ZIM_S11FT_T_W(ILINE) + ILINE=ILINE+1 + ENDDO + CALL IO_File_close(TZFILE) + TZFILE => NULL() + WRITE(ILUOUT0,*) "NLIGNE wet graupel",ILINE + ILINE=2 + WRITE(ILUOUT0,*) "ILINE=",ILINE + WRITE(ILUOUT0,*) "ZTC_T_W(ILINE),ZELEV_T_W(ILINE)", ZTC_T_W(ILINE),ZELEV_T_W(ILINE) + WRITE(ILUOUT0,*) "ZM_T_W(ILINE),ZS11_CARRE_T_W(ILINE),ZS22_CARRE_T_W(ILINE),ZRE_S22S11_T_W(ILINE)",& + ZM_T_W(ILINE),ZS11_CARRE_T_W(ILINE),ZS22_CARRE_T_W(ILINE),ZRE_S22S11_T_W(ILINE) + WRITE(ILUOUT0,*) "ZIM_S22S11_T_W(ILINE),ZRE_S22FMS11FT_T_W(ILINE),ZIM_S22FT_T_W(ILINE),ZIM_S11FT_T_W(ILINE)",& + ZIM_S22S11_T_W(ILINE),ZRE_S22FMS11FT_T_W(ILINE),ZIM_S22FT_T_W(ILINE),ZIM_S11FT_T_W(ILINE) + + !hail + IF (GHAIL) THEN + CALL IO_File_add2list(TZFILE,YFILE_COEFINT(5),'TXT','READ') + CALL IO_File_open(TZFILE,KRESP=IRESP) + IUNIT = TZFILE%NLU + IF ( IRESP /= 0 ) THEN + WRITE(YMSG,*) "problem opening file ",TRIM(YFILE_COEFINT(5)) + CALL PRINT_MSG(NVERB_FATAL,'GEN','RADAR_SCATTERING',YMSG) + ENDIF + ILINE=1 + DO WHILE (ILINE .LE. INB_LINE(5)) + READ( UNIT=IUNIT, FMT=6003,IOSTAT=IRESP ) ZTC_T_H(ILINE),ZELEV_T_H(ILINE),& + ZFW_T_H(ILINE),ZM_T_H(ILINE),ZS11_CARRE_T_H(ILINE),ZS22_CARRE_T_H(ILINE),ZRE_S22S11_T_H(ILINE),& + ZIM_S22S11_T_H(ILINE),ZRE_S22FMS11FT_T_H(ILINE),ZIM_S22FT_T_H(ILINE),ZIM_S11FT_T_H(ILINE) + ILINE=ILINE+1 + ENDDO + CALL IO_File_close(TZFILE) + TZFILE => NULL() + WRITE(ILUOUT0,*) "NLIGNE hail",ILINE + ILINE=2 + WRITE(ILUOUT0,*) "ILINE=",ILINE + WRITE(ILUOUT0,*) "ZTC_T_H(ILINE),ZELEV_T_H(ILINE)", ZTC_T_H(ILINE),ZELEV_T_H(ILINE) + WRITE(ILUOUT0,*) "ZM_T_H(ILINE),ZS11_CARRE_T_H(ILINE),ZS22_CARRE_T_H(ILINE),ZRE_S22S11_T_H(ILINE)",& + ZM_T_W(ILINE),ZS11_CARRE_T_H(ILINE),ZS22_CARRE_T_H(ILINE),ZRE_S22S11_T_H(ILINE) + WRITE(ILUOUT0,*) "ZIM_S22S11_T_H(ILINE),ZRE_S22FMS11FT_T_H(ILINE),ZIM_S22FT_T_H(ILINE),ZIM_S11FT_T_H(ILINE)",& + ZIM_S22S11_T_H(ILINE),ZRE_S22FMS11FT_T_H(ILINE),ZIM_S22FT_T_H(ILINE),ZIM_S11FT_T_H(ILINE) + ENDIF + ENDIF !END IF T-MATRIX => END OF LOOKUP TABLE READING + + !============== loop over elevations ================= + IEL=NBELEV(JI) + WRITE(ILUOUT0,*) "NBELEV(JI)",NBELEV(JI) + WRITE(ILUOUT0,*) "INPTS_V",INPTS_V + DO JEL=1,IEL + WRITE(ILUOUT0,*) "JEL",JEL + JL=1 + JV=1 + WRITE(ILUOUT0,*) "JL,JV",JL,JV + WRITE(ILUOUT0,*) "PELEV(JI,JEL,JL,JV)*180./XPI",PELEV(JI,JEL,JL,JV)*180./XPI + JL=INBSTEPMAX + JV=INPTS_V + WRITE(ILUOUT0,*) "JL,JV",JL,JV + WRITE(ILUOUT0,*) "PELEV(JI,JEL,JL,JV)*180./XPI",PELEV(JI,JEL,JL,JV)*180./XPI + !============== loop over azimuths ================= + DO JAZ=1,INBAZIM + DO JH=1,INPTS_H !horizontal discretization of the beam + DO JV=1,INPTS_V ! vertical discretization (we go down to check partial masks) + IF(LATT) THEN + ZAERINT=1. + ZAVRINT=1. + ZAEIINT=1. + ZAESINT=1. + ZAVSINT=1. + ZAEGINT=1. + ZAVGINT=1. + ZAEHINT=1. + ZAVHINT=1. + END IF + !Loop over the ranges for one azimuth. If the range is masked, the reflectivity for all the consecutive ranges is set to 0 + LPART_MASK=.FALSE. + LOOPJL: DO JL=1,INBSTEPMAX + IF(LPART_MASK) THEN ! THIS RAY IS MASKED + ZREFL(JI,JEL,JAZ,JL:INBSTEPMAX,JH,JV,1)=0. + EXIT LOOPJL + ELSE + ! if not underground or outside of the MESO-NH domain (PT_RAY : temperature interpolated along the rays) + IF(PT_RAY(JI,JEL,JAZ,JL,JH,JV) /= -XUNDEF) THEN + ! + !--------------------------------------------------------------------------------------------------- + !* 2. RAINDROPS + ! --------- + ! + IF(SIZE(PR_RAY,1) > 0) THEN ! if PR_RAY is available for at least one radar + !contenu en hydrometeore + ZM=PRHODREF_RAY(JI,JEL,JAZ,JL,JH,JV)*PR_RAY(JI,JEL,JAZ,JL,JH,JV) + IF (GLIMA) ZCC=PRHODREF_RAY(JI,JEL,JAZ,JL,JH,JV)*PCR_RAY(JI,JEL,JAZ,JL,JH,JV) + !ZM_MIN : min value for rain content (10**-7 <=> Z=-26 dBZ)mixing ratio + IF (GLIMA) THEN + GCALC=((ZM > ZM_MIN).AND.(ZCC > 10**ZCC_MIN(1))) + ELSE + GCALC=(ZM > ZM_MIN) + ENDIF + IF(GCALC ) THEN + !calculation of the dielectrique constant (permittitivité relative) + ! for liquid water from function QEPSW + !(defined in mode_fscatter.f90 => equation 3.6 p 64) + YTYPE='r' + ZQMW=SQRT(QEPSW(PT_RAY(JI,JEL,JAZ,JL,JH,JV),XLIGHTSPEED/XLAM_RAD(JI))) + !ZLBDA : slope distribution parameter (equation 2.6 p 23) + IF (GLIMA) THEN + ZLBDA=( ZLBR*ZCC / ZM )**ZLBEXR + ELSE + ZLBDA=ZLBR*(ZM)**ZLBEXR + ENDIF + ZQK=(ZQMW**2-1.)/(ZQMW**2+2.) !dielectric factor (3.43 p 56) + ZFW=0 !Liquid water fraction (only for melting graupel => 0 for rain) + + !compteur=compteur+1 + !--------------------------------------------------- + ! ------------ DIFFUSION -------------- + !--------------------------------------------------- + !******************************* NDIFF=0 or 4 ********************************* + IF(NDIFF==0.OR.NDIFF==4) THEN ! Rayleigh + !ZREFLOC(1:2) : Zh et Zv = int(sigma(D)*N(D)) (eq 1.6 p 16) + !with N(D) formulation (eq 2.2 p 23) and sigma Rayleigh (3.41 p 55) + !MOMG : gamma function defined in mong.f90 + !XCCR = 1.E7; XLBEXR = -0.25! Marshall-Palmer law (radar_rain_ice.f90) + !ZCXR : -1 (Xi coeff in equation 2.3 p 23) + ZREFLOC(1:2)=1.E18*ZCCR*ZLBDA**(ZCXR-6.)*MOMG(ZALPHAR,ZNUR,6.) + IF(LWREFL) THEN ! weighting by reflectivities + !ZREFL(...,IVDOP)=radial velocity (IVDOP=9), weighted by reflectivity and + !taking into account raindrops fall velocity (ZCR = 842, XDR = 0.8 -> 2.8 p23 et 2.1 p24) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=-ZCR*SIN(PELEV(JI,JEL,JL,JV)) & + *1.E18*ZCCR*ZLBDA**(ZCXR-6.-ZDR)*MOMG(ZALPHAR,ZNUR,6.+ZDR) + ELSE + ZREFL(JI,JEL,JAZ,JL,JH,JV,IMAX)=ZCCR*ZLBDA**ZCXR ! N0j of equation 2.3 p23 (density of particules) + !projection of fall velocity only + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=-ZCR*SIN(PELEV(JI,JEL,JL,JV)) & + *ZCCR*ZLBDA**(ZCXR-ZDR)*MOMG(ZALPHAR,ZNUR,ZDR) + END IF ! end weighting by reflectivities + IF(LATT) THEN ! Calculation of Extinction coefficient + IF(NDIFF==0) THEN ! Rayleigh 3rd order : calculation from equations + ! 3.39 p55 : extinction coeff = int(extinction_section(D) * N(D)) + ! 2.2 and 2.3 p23: simplification of int(D**p * N(D)) and N0j + ! 3.42 p57 : extinction_section(D) + ZAETMP(:)=ZCCR*ZLBDA**ZCXR*(XPI**2/XLAM_RAD(JI)*AIMAG(ZQK)& + *MOMG(ZALPHAR,ZNUR,ZBR)/ZLBDA**ZBR) + ELSE ! Rayleigh 6th order ! eq 3.52 p 58 for extinction coefficient + ZAETMP(:)=ZCCR*ZLBDA**ZCXR*(XPI**2/XLAM_RAD(JI)*AIMAG(ZQK)& + *MOMG(ZALPHAR,ZNUR,ZBR)/ZLBDA**ZBR & + +XPI**4/15./XLAM_RAD(JI)**3*AIMAG(ZQK**2*(ZQMW**4+27.*ZQMW**2+38.) & + /(2.*ZQMW**2+3.))*MOMG(ZALPHAR,ZNUR,5.*ZBR/3.)/ZLBDA**(5.*ZBR/3.)& + +2.*XPI**5/3. /XLAM_RAD(JI)**4*REAL(ZQK**2) & + *MOMG(ZALPHAR,ZNUR,2.*ZBR) /ZLBDA**(2.*ZBR)) + END IF + END IF ! end IF(LATT) + ZRE_S22S11_R=0 + ZIM_S22S11_R=0 + ZS22_CARRE_R=0 + ZS11_CARRE_R=0 + !******************************* NDIFF==7 ************************************ + ELSE IF(NDIFF==7) THEN !T-matrix + ZREFLOC(:)=0 + IF(LATT) ZAETMP(:)=0 + IF (GLIMA) THEN + CALL CALC_KTMAT_LIMA(PELEV(JI,JEL,JL,JV),& + PT_RAY(JI,JEL,JAZ,JL,JH,JV),ZCC,ZM,& + ZELEV_MIN(1),ZELEV_MAX(1),ZELEV_STEP(1),& + ZTC_MIN(1),ZTC_MAX(1),ZTC_STEP(1),& + ZCC_MIN(1),ZCC_MAX(1),ZCC_STEP(1),& + ZEXPM_MIN,ZEXPM_MAX,ZEXPM_STEP,& + ITMAT,ZELEV_RED,ZTC_RED,ZCC_RED,ZM_RED) + ELSE + CALL CALC_KTMAT(PELEV(JI,JEL,JL,JV),& + PT_RAY(JI,JEL,JAZ,JL,JH,JV),ZFW,ZM,& + ZELEV_MIN(1),ZELEV_MAX(1),ZELEV_STEP(1),& + ZTC_MIN(1),ZTC_MAX(1),ZTC_STEP(1),& + ZFW_MIN(1),ZFW_MAX(1),ZFW_STEP(1),& + ZEXPM_MIN,ZEXPM_MAX,ZEXPM_STEP,& + ITMAT,ZELEV_RED,ZTC_RED,ZFW_RED,ZM_RED) + ENDIF + IF (ITMAT(1) .NE. -NUNDEF) THEN + DO JIND=1,SIZE(KMAT_COEF,2),1 + KMAT_COEF(1,JIND)=ZS11_CARRE_T_R(ITMAT(JIND)) + KMAT_COEF(2,JIND)=ZS22_CARRE_T_R(ITMAT(JIND)) + KMAT_COEF(3,JIND)=ZRE_S22S11_T_R(ITMAT(JIND)) + KMAT_COEF(4,JIND)=ZIM_S22S11_T_R(ITMAT(JIND)) + KMAT_COEF(5,JIND)=ZRE_S22FMS11FT_T_R(ITMAT(JIND)) + KMAT_COEF(6,JIND)=ZIM_S22FT_T_R(ITMAT(JIND)) + KMAT_COEF(7,JIND)=ZIM_S11FT_T_R(ITMAT(JIND)) + ENDDO + IF (GLIMA) THEN + CALL INTERPOL(ZELEV_RED,ZTC_RED,ZCC_RED,ZM_RED,KMAT_COEF,ZS11_CARRE_R,ZS22_CARRE_R,& + ZRE_S22S11_R,ZIM_S22S11_R,ZRE_S22FMS11F,ZIM_S22FT,ZIM_S11FT) + ELSE + CALL INTERPOL(ZELEV_RED,ZTC_RED,ZFW_RED,ZM_RED,KMAT_COEF,ZS11_CARRE_R,ZS22_CARRE_R,& + ZRE_S22S11_R,ZIM_S22S11_R,ZRE_S22FMS11F,ZIM_S22FT,ZIM_S11FT) + ENDIF + ELSE + ZS11_CARRE_R=0 + ZS22_CARRE_R=0 + ZRE_S22S11_R=0 + ZIM_S22S11_R=0 + ZRE_S22FMS11F=0 + ZIM_S22FT=0 + ZIM_S11FT=0 + END IF + ZREFLOC(1)=1.E18*(XLAM_RAD(JI))**4/(XPI**5*.93)*4*XPI*ZS22_CARRE_R + ZREFLOC(2)=1.E18*(XLAM_RAD(JI))**4/(XPI**5*.93)*4*XPI*ZS11_CARRE_R + ZREFLOC(3)=180.E3/XPI*XLAM_RAD(JI)*ZRE_S22FMS11F + IF (GLIMA) THEN + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=PVDOP_RAY(JI,JEL,JAZ,JL,JH,JV)*ZREFLOC(1) & + -ZCR*SIN(PELEV(JI,JEL,JL,JV))*ZREFLOC(1) & + *1.E18*(XLAM_RAD(JI)/XPI)**4/.93*ZCC/4./ZLBDA**(2+ZDR) + ELSE + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=PVDOP_RAY(JI,JEL,JAZ,JL,JH,JV)*ZREFLOC(1) & + -ZCR*SIN(PELEV(JI,JEL,JL,JV))*ZREFLOC(1) & + *1.E18*(XLAM_RAD(JI)/XPI)**4/.93*ZCCR/4./ZLBDA**(3+ZDR) + ENDIF + IF(LATT) THEN + ZAETMP(1)=ZIM_S22FT*XLAM_RAD(JI)*2 + ZAETMP(2)=ZIM_S11FT*XLAM_RAD(JI)*2 + END IF + !******************************* NDIFF=1 or 3 ********************************* + ! Gauss Laguerre integration + ELSE ! MIE OR T-MATRIX OR RAYLEIGH FOR ELLIPSOIDES + ZREFLOC(:)=0. + IF(LATT) ZAETMP(:)=0. + DO JJ=1,NPTS_GAULAG ! ****** Gauss-Laguerre quadrature + SELECT CASE(NDIFF) + CASE(1) ! *************** NDIFF=1 MIE ***************** + ! subroutine BHMIE defined in mode_fscatter.f90 + ! calculate extinction coefficient ZQEXT(1),scattering : ZQSCA + ! and backscattering ZQBACK(1) on the horizontal plan (spheroid) + CALL BHMIE(XPI/XLAM_RAD(JI)*ZX(JJ)/ZLBDA,ZQMW,ZQEXT(1),ZQSCA,ZQBACK(1)) + ZQBACK(2)=ZQBACK(1) !=> same because sphere + ZQEXT(2)=ZQEXT(1) ! modif Clotilde 23/04/2012 + ZQBACK(3)=0. !=> 0 because sphere + CASE(3) !****************** NDIFF==3 RG RAYLEIGH FOR ELLIPSOIDES *********************** + IF(ARF(ZX(JJ)/ZLBDA)==1.) THEN + ZLB=1./3. + ELSE + ZLB=1./(ARF(ZX(JJ)/ZLBDA))**2-1. ! f**2 + ZLB=(1.+ZLB)/ZLB*(1.-ATAN(SQRT(ZLB))/SQRT(ZLB)) ! lambda_b + IF(ZX(JJ)/ZLBDA>16.61E-3) PRINT*, 'Negative axis ratio; reduce NPTS_GAULAG.' + END IF + ! equation 3.44 p 56 (ZX**4 instead of ZX**6 but ZQBACK is multiplied after by ZX**2) + ZQBACK(1)=4.*(XPI/XLAM_RAD(JI)*ZX(JJ)/ZLBDA)**4& + *ABS((ZQMW**2-1.)/3./(1.+.5*(1.-ZLB)*(ZQMW**2-1.)))**2 + ! equation 3.45 p 56 + ZQBACK(2)=4.*(XPI/XLAM_RAD(JI)*ZX(JJ)/ZLBDA)**4*ABS((ZQMW**2-1.)/3.*& + (SIN(PELEV(JI,JEL,JL,JV))**2/(1.+.5*(1.-ZLB)*(ZQMW**2-1.))+& ! PELEV=PI+THETA_I + COS(PELEV(JI,JEL,JL,JV))**2/(1.+ZLB*(ZQMW**2-1.))) )**2 ! + ! KDP from equation 3.49 + ZQBACK(3)=ZX(JJ)/ZLBDA**3*REAL((ZQMW**2-1.)**2*(3.*ZLB-1.)/(2.+(ZQMW**2-1.)*(ZLB+1.) & + +ZLB*(1.-ZLB)*(ZQMW**2-1.)**2)) + IF(LATT) THEN + ! equations 3.48 and 3.49 p57 + ZQEXT(1)=4.*(XPI/XLAM_RAD(JI)*ZX(JJ)/ZLBDA)*AIMAG((ZQMW**2-1.)/3./(1.+.5*(1.-ZLB)*(ZQMW**2-1.))) + ZQEXT(2)=4.*(XPI/XLAM_RAD(JI)*ZX(JJ)/ZLBDA)*AIMAG((ZQMW**2-1.)/3.*& + (SIN(PELEV(JI,JEL,JL,JV))**2/(1.+.5*(1.-ZLB)*(ZQMW**2-1.))+& ! PELEV=PI+THETA_I + COS(PELEV(JI,JEL,JL,JV))**2/(1.+ZLB*(ZQMW**2-1.)))) + END IF + END SELECT !end SELECT NDIFF + !incrementation of the reflectivity and Kdp(1,2,3,4 for Zh, Zv, ) + !with the backscattering coefficients for each point of the GAULAG distribution + ! or each diameter D + ZREFLOC(1:3)=ZREFLOC(1:3)+ZQBACK(1:3)*ZX(JJ)**2*ZW(JJ) + ZREFLOC(4)=ZREFLOC(4)+ZQBACK(1)*ZX(JJ)**(2+ZDR)*ZW(JJ) + !same for attenuation with extinction coefficient + IF(LATT) ZAETMP(:)=ZAETMP(:)+ZQEXT(:)*ZX(JJ)**2*ZW(JJ) + END DO ! ****** end loop Gauss-Laguerre quadrature + + ZREFLOC(1:2)=1.E18*ZREFLOC(1:2)*(XLAM_RAD(JI)/XPI)**4/.93*ZCCR/4./ZLBDA**3 + ZREFLOC(3)=ZREFLOC(3)*XPI**2/6./XLAM_RAD(JI)*ZCCR/ZLBDA & + *180.E3/XPI ! (in deg/km) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=PVDOP_RAY(JI,JEL,JAZ,JL,JH,JV)*ZREFLOC(1) & + -ZCR*SIN(PELEV(JI,JEL,JL,JV))*ZREFLOC(4) & + *1.E18*(XLAM_RAD(JI)/XPI)**4/.93*ZCCR/4./ZLBDA**(3+ZDR) + + !********* for all cases with Gauss-Laguerre integration + ZRE_S22S11_R=0 + ZIM_S22S11_R=0 + ZS22_CARRE_R=0 + ZS11_CARRE_R=0 + IF(LATT) ZAETMP(:)=ZAETMP(:)*XPI*ZCCR*ZLBDA**(ZCXR-2.*ZBR/3.)/(4.*GAMMA(ZNUR)) + END IF ! ****************** End if for each type of diffusion ************************ + !incrementation of ZHH, ZDR and KDP + ZREFL(JI,JEL,JAZ,JL,JH,JV,1:3)=ZREFL(JI,JEL,JAZ,JL,JH,JV,1:3)+ZREFLOC(1:3) + ! ZER (Z due to raindrops) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IZER)=ZREFLOC(1) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IZDA)=ZREFLOC(2) !Zvv for ZDR due to rain + ZREFL(JI,JEL,JAZ,JL,JH,JV,IKDR)=ZREFLOC(3) !Zvv for ZDR due to rain + + ! RhoHV due to rain + IF (ZS22_CARRE_R*ZS11_CARRE_R .GT. 0) THEN + ZREFL(JI,JEL,JAZ,JL,JH,JV,IRHR)=SQRT(ZRE_S22S11_R**2+ZIM_S22S11_R**2)/SQRT(ZS22_CARRE_R*ZS11_CARRE_R) + ELSE + ZREFL(JI,JEL,JAZ,JL,JH,JV,IRHR)=1 + END IF + IF(LATT) THEN + ZAELOC(JI,JEL,JAZ,JL,JH,JV,:)=ZAETMP(:) ! specific attenuation due to rain + ZREFL(JI,JEL,JAZ,JL,JH,JV,IAER)=ZAETMP(1) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IAVR)=ZAETMP(2) + ! for ranges over 1, correction of attenuation on reflectivity due to rain + IF(JL>1) THEN + ZAERINT=ZAERINT*EXP(-2.*ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IAER)*XSTEP_RAD) + ZAVRINT=ZAVRINT*EXP(-2.*ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IAVR)*XSTEP_RAD) + END IF + ZREFL(JI,JEL,JAZ,JL,JH,JV,IZER)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IZER)*ZAERINT ! Z_r attenuated + ZREFL(JI,JEL,JAZ,JL,JH,JV,IZDA)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IZDA)*ZAVRINT ! ZVr attenuated + END IF !end IF(LATT) + END IF + ! mimimum rainwater mixing ratio + ! Total attenuation even if no hydrometeors (equation 1.7 p 17) + IF(LATT.AND.JL>1) ZREFL(JI,JEL,JAZ,JL,JH,JV,IATR)=ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IATR) & + *EXP(-2.*ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IAER)*XSTEP_RAD) + END IF ! **************** end RAIN (end IF SIZE(PR_RAY,1) > 0) + ! + !--------------------------------------------------------------------------------------------------- + !* 3. PRISTINE ICE + ! --------- + ! + IF (SIZE(PI_RAY,1)>0) THEN + ZM=PRHODREF_RAY(JI,JEL,JAZ,JL,JH,JV)*PI_RAY(JI,JEL,JAZ,JL,JH,JV) !ice content + IF (PRHODREF_RAY(JI,JEL,JAZ,JL,JH,JV)==-XUNDEF .OR. PI_RAY(JI,JEL,JAZ,JL,JH,JV)==-XUNDEF) ZM=-XUNDEF + IF (GLIMA) THEN + ZC=PRHODREF_RAY(JI,JEL,JAZ,JL,JH,JV)*PCIT_RAY(JI,JEL,JAZ,JL,JH,JV) + IF (PRHODREF_RAY(JI,JEL,JAZ,JL,JH,JV)==-XUNDEF .OR. PCIT_RAY(JI,JEL,JAZ,JL,JH,JV)==-XUNDEF) ZC=-XUNDEF + ELSE + ZC=PCIT_RAY(JI,JEL,JAZ,JL,JH,JV) + ENDIF + IF(ZM>ZM_MIN .AND. ZC> 527.82) THEN + ! cit > 527.82 otherwise pbs due to interpolation + !ice dielectric constant (QPESI defined in mode_fscatter, equation 3.65 p 65) + ZEPSI=QEPSI(PT_RAY(JI,JEL,JAZ,JL,JH,JV),XLIGHTSPEED/XLAM_RAD(JI)) + ZQMI=SQRT(ZEPSI) + ZQK=(ZQMI**2-1.)/(ZQMI**2+2.) + !see 3.77 p68 : to replace Dg by an equivalent diameter De of pure ice, a multiplicative + !melting factor has to be added + ZDMELT_FACT=(6.*ZAI)/(XPI*.92*XRHOLW) + ZEXP=2.*ZBI !XBI = 2.5 (Plates) in ini_radar.f90 (bj tab 2.1 p24) + !ZLBDA : slope distribution parameter (equation 2.6 p 23) + IF (GLIMA) THEN + ZLBDA=(ZLBI*ZC/ZM)**ZLBEXI + ELSE + ZLBDA=ZLBI*(ZM/ZC)**ZLBEXI + ENDIF + ! Rayleigh or Rayleigh-Gans (=> Rayleigh) or Rayleigh with 6th order for attenuation + ! (pristine ice = sphere), + IF(NDIFF==0.OR.NDIFF==3.OR.NDIFF==4) THEN + !ZREFLOC(1:2) : Zh et Zv from equation 2.2 p23 and Cristals parameters + !ZEQICE=0.224 (radar_rain_ice.f90) factor used to convert the ice crystals + !reflectivity into an equivalent liquid water reflectivity (from Smith, JCAM 84) + ZREFLOC(1:2)=ZEQICE*.92**2*ZDMELT_FACT**2*1.E18*ZC & + *ZLBDA**(ZCXI-ZEXP)*MOMG(ZALPHAI,ZNUI,ZEXP) + ZREFLOC(3)=0. + IF(LWREFL) THEN ! weighting by reflectivities + !calculation of radial velocity + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)& + -ZCI*SIN(PELEV(JI,JEL,JL,JV))*ZEQICE*.92**2*ZDMELT_FACT**2& + *1.E18*ZC*ZLBDA**(ZCXI-ZEXP-ZDI)& + *MOMG(ZALPHAI,ZNUI,ZEXP+ZDI) + ELSE + ZREFL(JI,JEL,JAZ,JL,JH,JV,IMAX)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IMAX)& + +ZC*ZLBDA**ZCXI + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)& + -ZCI*SIN(PELEV(JI,JEL,JL,JV))& + *ZC& + *ZLBDA**(ZCXI-ZDI)*MOMG(ZALPHAI,ZNUI,ZDI) + END IF + IF(LATT) THEN ! Calculation of Extinction coefficient + ! Rayleigh 3rd order + IF(NDIFF==0.OR.NDIFF==3) THEN + ZAETMP(:)=ZC*ZLBDA**ZCXI& + *(ZDMELT_FACT*XPI**2/XLAM_RAD(JI)*AIMAG(ZQK)& + *MOMG(ZALPHAI,ZNUI,ZBI)/ZLBDA**ZBI) + ! Rayleigh 6th order + ELSE + ZAETMP(:)=ZC*ZLBDA**ZCXI*(& + ZDMELT_FACT*XPI**2/XLAM_RAD(JI)*AIMAG(ZQK)& + *MOMG(ZALPHAI,ZNUI,ZBI)/ZLBDA**ZBI& + +ZDMELT_FACT**(5./3.)*XPI**4/15./XLAM_RAD(JI)**3& + *AIMAG(ZQK**2*(ZQMI**4+27.*ZQMI**2+38.)& + /(2.*ZQMI**2+3.))*MOMG(ZALPHAI,ZNUI,5.*ZBI/3.)/ZLBDA**(5.*ZBI/3.) & + +ZDMELT_FACT**2*2.*XPI**5/3. /XLAM_RAD(JI)**4*REAL(ZQK**2)& + *MOMG(ZALPHAI,ZNUI,2.*ZBI)/ZLBDA**(2.*ZBI)) + END IF + END IF + ELSE ! (if NDIFF=1 or NDIFF=7) => MIE (if choice=T-Matrix => Mie) + ZREFLOC(:)=0. + IF(LATT) ZAETMP(:)=0. + DO JJ=1,NPTS_GAULAG ! ****** Gauss-Laguerre quadrature + ZD=ZX(JJ)**(1./ZALPHAI)/ZLBDA !equivaut au ZDELTA_EQUIV olivier + ZRHOI=6*ZAI*ZD**(ZBI-3.)/XPI !pristine ice density + ZNUM=1.+2.*ZRHOI*(ZEPSI-1.)/(ZRHOPI*(ZEPSI+2.)) + ZDEN=1.-ZRHOI*(ZEPSI-1.)/(ZRHOPI*(ZEPSI+2.)) + ZQM=sqrt(ZNUM/ZDEN) + CALL BHMIE(XPI/XLAM_RAD(JI)*ZD,ZQM,ZQEXT(1),ZQSCA,ZQBACK(1)) + ZQBACK(2)=ZQBACK(1) + ZQEXT(2)=ZQEXT(1) ! modif Clotilde 23/04/2012 + ZQBACK(3)=0. + ZREFLOC(1:3)=ZREFLOC(1:3)+ZQBACK(1:3)*ZX(JJ)**(ZNUI-1.)*ZD**2*ZW(JJ) + ZREFLOC(4)=ZREFLOC(4)+ZQBACK(1)*ZX(JJ)**(ZNUI-1.+ZDI/ZALPHAI)*ZD**2*ZW(JJ) + IF(LATT) ZAETMP(:)=ZAETMP(:)+ZQEXT(:)*ZX(JJ)**(ZNUI-1.)*ZD**2*ZW(JJ) + END DO ! **************** end loop Gauss-Laguerre quadrature + + ZREFLOC(1:2)=ZREFLOC(1:2)*1.E18*(XLAM_RAD(JI)/XPI)**4/.93*ZC & + *ZLBDA**(ZCXI)/(4.*GAMMA(ZNUI)) + + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)& + +PVDOP_RAY(JI,JEL,JAZ,JL,JH,JV)*ZREFLOC(1) & + -ZCI*SIN(PELEV(JI,JEL,JL,JV))*ZREFLOC(4) & + *1.E18*(XLAM_RAD(JI)/XPI)**4*ZC & + *ZLBDA**(ZCXI-ZDI)/(4.*GAMMA(ZNUI)*.93) + IF(LATT) ZAETMP(:)=ZAETMP(:)*XPI*ZC*ZLBDA**(ZCXI)/(4.*GAMMA(ZNUI)) + END IF !**************** end loop for each type of diffusion + ZREFL(JI,JEL,JAZ,JL,JH,JV,1:3)=ZREFL(JI,JEL,JAZ,JL,JH,JV,1:3)+ZREFLOC(1:3) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IZEI)=ZREFLOC(1) ! z_e due to pristine ice + IF(LATT) THEN + ZAELOC(JI,JEL,JAZ,JL,JH,JV,:)=ZAELOC(JI,JEL,JAZ,JL,JH,JV,:)+ZAETMP(:) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IAEI)=ZAETMP(1) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IAVI)=ZAETMP(2) + IF(JL>1) ZAEIINT=ZAEIINT*EXP(-2.*ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IAEI)*XSTEP_RAD) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IZEI)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IZEI)*ZAEIINT ! Z_i attenuated + END IF + END IF !********************* end IF (SIZE(PI_RAY,1)>0) + + ! Total attenuation even if no hydrometeors + IF(LATT.AND.JL>1) ZREFL(JI,JEL,JAZ,JL,JH,JV,IATI)=ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IATI) & + *EXP(-2.*ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IAEI)*XSTEP_RAD) + ZRE_S22S11_I=0 + ZIM_S22S11_I=0 + ZS22_CARRE_I=0 + ZS11_CARRE_I=0 + END IF !******************** end IF (SIZE(PI_RAY,1)>0) + !--------------------------------------------------------------------------------------------------- + !* 4. SNOW + ! ----- + IF (SIZE(PS_RAY,1)>0) THEN + ZM=PRHODREF_RAY(JI,JEL,JAZ,JL,JH,JV)*PS_RAY(JI,JEL,JAZ,JL,JH,JV) !snow content + IF(ZM > ZM_MIN) THEN + YTYPE='s' + !ZQMI: same formulation than for ice because snow is simulated only + !above melting leyer (3.5.4 p 67) + ZFW=0 + ZQMI=SQRT(QEPSI(PT_RAY(JI,JEL,JAZ,JL,JH,JV),XLIGHTSPEED/XLAM_RAD(JI))) + ZQK=(ZQMI**2-1.)/(ZQMI**2+2.) !ajout de Clotilde 23/04/2012 + ZDMELT_FACT=6.*ZAS/(XPI*.92*XRHOLW) + ZEXP=2.*ZBS !XBS = 1.9 in ini_radar.f90 (bj tab 2.1 p24) + !dans ini_rain_ice.f90 : + IF ( (GLIMA .AND. LSNOW_T_L) .OR. (.NOT.GLIMA .AND. LSNOW_T_I) ) THEN + IF (PT_RAY(JI,JEL,JAZ,JL,JH,JV)>-10.) THEN + ZLBDA = MAX(MIN(XLBDAS_MAX, 10**(14.554-0.0423*(PT_RAY(JI,JEL,JAZ,JL,JH,JV)+273.15))),XLBDAS_MIN) + ELSE + ZLBDA = MAX(MIN(XLBDAS_MAX, 10**(6.226-0.0106*(PT_RAY(JI,JEL,JAZ,JL,JH,JV)+273.15))),XLBDAS_MIN) + END IF + ZN=ZNS*ZM*ZLBDA**ZBS + ELSE + ZLBDA= ZLBS*(ZM)**ZLBEXS + ZN=ZCCS*ZLBDA**ZCXS + END IF + ! Rayleigh or Rayleigh-Gans or Rayleigh with 6th order for attenuation + IF(NDIFF==0.OR.NDIFF==3.OR.NDIFF==4) THEN + ZREFLOC(1:2)=ZEQICE*.92**2*ZDMELT_FACT**2*1.E18*ZN*ZLBDA**(ZEXP)*MOMG(ZALPHAS,ZNUS,ZEXP) + ZREFLOC(3)=0. + IF(LWREFL) THEN ! weighting by reflectivities + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)& + -ZCS*SIN(PELEV(JI,JEL,JL,JV))*ZEQICE*.92**2*ZDMELT_FACT**2& + *1.E18*ZN*ZLBDA**(ZEXP-ZDS)*MOMG(ZALPHAS,ZNUS,ZEXP+ZDS) + ELSE + ZREFL(JI,JEL,JAZ,JL,JH,JV,IMAX)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IMAX)+ZN + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)& + -ZCS*SIN(PELEV(JI,JEL,JL,JV))& + *ZN*ZLBDA**(ZDS)*MOMG(ZALPHAS,ZNUS,ZDS) + END IF + IF(LATT) THEN + IF(NDIFF==0.OR.NDIFF==3) THEN + ZAETMP(:)=ZN*(ZDMELT_FACT*XPI**2/XLAM_RAD(JI)*AIMAG(ZQK)& + *MOMG(ZALPHAS,ZNUS,ZBS)/ZLBDA**ZBS) + ELSE + ZAETMP(:)=ZN*(ZDMELT_FACT*XPI**2/XLAM_RAD(JI)*AIMAG(ZQK) & + *MOMG(ZALPHAS,ZNUS,ZBS)/ZLBDA**ZBS & + +ZDMELT_FACT**(5./3.)*XPI**4/15./XLAM_RAD(JI)**3 & + *AIMAG(ZQK**2*(ZQMI**4+27.*ZQMI**2+38.) & + /(2.*ZQMI**2+3.))*MOMG(ZALPHAS,ZNUS,5.*ZBS/3.)/ZLBDA**(5.*ZBS/3.) & + +ZDMELT_FACT**2 *2.*XPI**5/3. /XLAM_RAD(JI)**4*REAL(ZQK**2) & + *MOMG(ZALPHAS,ZNUS,2.*ZBS)/ZLBDA**(2.*ZBS)) + END IF + END IF + ZRE_S22S11_S=0 + ZIM_S22S11_S=0 + ZS22_CARRE_S=0 + ZS11_CARRE_S=0 + !******************************* NDIFF==7 ************************************ + ELSE IF(NDIFF==7) THEN + + ZREFLOC(:)=0 + IF(LATT) ZAETMP(:)=0 + CALL CALC_KTMAT(PELEV(JI,JEL,JL,JV), PT_RAY(JI,JEL,JAZ,JL,JH,JV),& + ZFW,ZM,& + ZELEV_MIN(2),ZELEV_MAX(2),ZELEV_STEP(2),& + ZTC_MIN(2),ZTC_MAX(2),ZTC_STEP(2),& + ZFW_MIN(2),ZFW_MAX(2),ZFW_STEP(2),& + ZEXPM_MIN,ZEXPM_MAX,ZEXPM_STEP,& + ITMAT,ZELEV_RED,ZTC_RED,ZFW_RED,ZM_RED) + + IF (ITMAT(1) .NE. -NUNDEF) THEN + DO JIND=1,SIZE(KMAT_COEF,2),1 + KMAT_COEF(1,JIND)=ZS11_CARRE_T_S(ITMAT(JIND)) + KMAT_COEF(2,JIND)=ZS22_CARRE_T_S(ITMAT(JIND)) + KMAT_COEF(3,JIND)=ZRE_S22S11_T_S(ITMAT(JIND)) + KMAT_COEF(4,JIND)=ZIM_S22S11_T_S(ITMAT(JIND)) + KMAT_COEF(5,JIND)=ZRE_S22FMS11FT_T_S(ITMAT(JIND)) + KMAT_COEF(6,JIND)=ZIM_S22FT_T_S(ITMAT(JIND)) + KMAT_COEF(7,JIND)=ZIM_S11FT_T_S(ITMAT(JIND)) + ENDDO + CALL INTERPOL(ZELEV_RED,ZTC_RED,ZFW_RED,ZM_RED,KMAT_COEF,ZS11_CARRE_S,ZS22_CARRE_S,& + ZRE_S22S11_S,ZIM_S22S11_S,ZRE_S22FMS11F,ZIM_S22FT,ZIM_S11FT) + ELSE + ZS11_CARRE_S=0 + ZS22_CARRE_S=0 + ZRE_S22S11_S=0 + ZIM_S22S11_S=0 + ZRE_S22FMS11F=0 + ZIM_S22FT=0 + ZIM_S11FT=0 + END IF + ZREFLOC(1)=1.E18*(XLAM_RAD(JI))**4/(XPI**5*.93)*4*XPI*ZS22_CARRE_S + ZREFLOC(2)=1.E18*(XLAM_RAD(JI))**4/(XPI**5*.93)*4*XPI*ZS11_CARRE_S + ZREFLOC(3)=180.E3/XPI*XLAM_RAD(JI)*ZRE_S22FMS11F + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=PVDOP_RAY(JI,JEL,JAZ,JL,JH,JV)*ZREFLOC(1) & + -ZCS*SIN(PELEV(JI,JEL,JL,JV))*ZREFLOC(1) & + *1.E18*(XLAM_RAD(JI)/XPI)**4/.93*(ZN*ZLBDA**(-ZCXS))/4./ZLBDA**(3+ZDS) + IF(LATT) THEN + ZAETMP(1)=ZIM_S22FT*XLAM_RAD(JI)*2 + ZAETMP(2)=ZIM_S11FT*XLAM_RAD(JI)*2 + END IF + ELSE ! MIE + ZREFLOC(:)=0. + IF(LATT) ZAETMP(:)=0. + DO JJ=1,NPTS_GAULAG ! ****** Gauss-Laguerre quadrature + ZD=ZX(JJ)**(1./ZALPHAS)/ZLBDA + ZDE=ZDMELT_FACT**(1./3.)*ZD**(ZBS/3.) + CALL BHMIE(XPI/XLAM_RAD(JI)*ZDE,ZQMI,ZQEXT(1),ZQSCA,ZQBACK(1)) + ZQBACK(2)=ZQBACK(1) + ZQEXT(2)=ZQEXT(1) ! modif Clotilde 23/04/2012 + ZQBACK(3)=0. + ZREFLOC(1:3)=ZREFLOC(1:3)+ZQBACK(1:3)*ZX(JJ)**(ZNUS-1.+2.*ZBS/3./ZALPHAS)*ZW(JJ) + ZREFLOC(4)=ZREFLOC(4)+ZQBACK(1)*ZX(JJ)**(ZNUS-1.+2.*ZBS/3./ZALPHAS+ZDS/ZALPHAS)*ZW(JJ) + IF(LATT) ZAETMP(:)=ZAETMP(:)+ZQEXT(:)*ZX(JJ)**(ZNUS-1.+2.*ZBS/3./ZALPHAS)*ZW(JJ) + END DO ! ****** end loop Gauss-Laguerre quadrature + ZREFLOC(1:2)=1.E18*(XLAM_RAD(JI)/XPI)**4*ZN*ZLBDA**(-2.*ZBS/3.)/& + (4.*GAMMA(ZNUS)*.93)*ZDMELT_FACT**(2./3.)*ZREFLOC(1:2) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)& + +PVDOP_RAY(JI,JEL,JAZ,JL,JH,JV)*ZREFLOC(1) & + -ZCS*SIN(PELEV(JI,JEL,JL,JV))*ZREFLOC(4) & + *1.E18*(XLAM_RAD(JI)/XPI)**4*ZN & + *ZLBDA**(2.*ZBS/3.-ZDS)/ & + (4.*GAMMA(ZNUS)*.93)*ZDMELT_FACT**(2./3.) + IF(LATT) ZAETMP(:)=ZAETMP(:)*XPI*ZN*ZLBDA**(-2.*ZBS/3.)/(4.*GAMMA(ZNUS))& + *ZDMELT_FACT**(2./3.) + ZRE_S22S11_S=0 + ZIM_S22S11_S=0 + ZS22_CARRE_S=0 + ZS11_CARRE_S=0 + END IF !**************** end loop for each type of diffusion + ZREFL(JI,JEL,JAZ,JL,JH,JV,1:3)=ZREFL(JI,JEL,JAZ,JL,JH,JV,1:3)+ZREFLOC(1:3) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IZES)=ZREFLOC(1) ! Z_e due to snow + ZREFL(JI,JEL,JAZ,JL,JH,JV,IZDS)=ZREFLOC(2) !Zvv for ZDR due to snow + ZREFL(JI,JEL,JAZ,JL,JH,JV,IKDS)=ZREFLOC(3) !Zvv for ZDR due to snow + IF (ZS22_CARRE_S*ZS11_CARRE_S .GT. 0) THEN + ZREFL(JI,JEL,JAZ,JL,JH,JV,IRHS)=SQRT(ZRE_S22S11_S**2+ZIM_S22S11_S**2)/SQRT(ZS22_CARRE_S*ZS11_CARRE_S) + ELSE + ZREFL(JI,JEL,JAZ,JL,JH,JV,IRHS)=1 + END IF + IF(LATT) THEN + ZAELOC(JI,JEL,JAZ,JL,JH,JV,:)=ZAELOC(JI,JEL,JAZ,JL,JH,JV,:)+ZAETMP(:) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IAES)=ZAETMP(1) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IAVS)=ZAETMP(2) + IF(JL>1) THEN + ZAESINT=ZAESINT*EXP(-2.*ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IAES)*XSTEP_RAD) + ZAVSINT=ZAVSINT*EXP(-2.*ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IAVS)*XSTEP_RAD) + ENDIF + ZREFL(JI,JEL,JAZ,JL,JH,JV,IZES)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IZES)*ZAESINT ! Z_s attenuated + ZREFL(JI,JEL,JAZ,JL,JH,JV,IZDS)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IZDS)*ZAVSINT ! ZVs attenuated + END IF !end IF(LATT) + END IF !end IF(PS_RAY(JI,JEL,JAZ,JL,JH,JV) > ...) + + + ! Total attenuation even if no hydrometeors + IF(LATT.AND.JL>1) ZREFL(JI,JEL,JAZ,JL,JH,JV,IATS)=ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IATS) & + *EXP(-2.*ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IAES)*XSTEP_RAD) + END IF !END IF (SIZE(PS_RAY,1)>0) + !--------------------------------------------------------------------------------------------------- + !* 5. GRAUPEL + ! ------- + ! + !ZDG=.5 ! from Bringi & Chandrasekar 2001, p. 433 + IF (SIZE(PG_RAY,1)>0) THEN + ZM=PRHODREF_RAY(JI,JEL,JAZ,JL,JH,JV)*PG_RAY(JI,JEL,JAZ,JL,JH,JV) !graupel content + IF(ZM > ZM_MIN) THEN + YTYPE='g' + ZQMI=SQRT(QEPSI(MIN(PT_RAY(JI,JEL,JAZ,JL,JH,JV),XTT),XLIGHTSPEED/XLAM_RAD(JI))) + ZQMW=SQRT(QEPSW(MAX(PT_RAY(JI,JEL,JAZ,JL,JH,JV),XTT),XLIGHTSPEED/XLAM_RAD(JI))) + !ini_radar.f90 : ZCXG = -0.5 XBG = 2.8 ( Xj et bj tab 2.1 p 24) + !ini_rain_ice.f90 : XLBEXG = 1.0/(XCXG-XBG) XAG = 19.6 (aj tab 2.1 p 24) + !XLBG = ( XAG*XCCG*MOMG(XALPHAG,XNUG,XBG) )**(-XLBEXG) (eq 2.6 p 23) + IF (PR_RAY(JI,JEL,JAZ,JL,JH,JV) > ZRTMIN(3) ) THEN + ZFW=PR_RAY(JI,JEL,JAZ,JL,JH,JV)/(PR_RAY(JI,JEL,JAZ,JL,JH,JV)+PG_RAY(JI,JEL,JAZ,JL,JH,JV)) + ELSE + ZFW=0. + END IF + ZLBDA=ZLBG*(PRHODREF_RAY(JI,JEL,JAZ,JL,JH,JV)*PG_RAY(JI,JEL,JAZ,JL,JH,JV))**ZLBEXG + !XTT : température du point triple de l'eau (273.16 K <=> 0.1 °C) + IF(PT_RAY(JI,JEL,JAZ,JL,JH,JV) > XTT) THEN ! mixture of ice and water + ZFRAC_ICE = .85 !(see p 68) + ELSE ! only ice + ZFRAC_ICE=1. + END IF + ! from eq 3.77 p 68 + !XRHOLW=1000 (initialized in ini_cst.f90) + ZDMELT_FACT=6.*ZAG/(XPI*XRHOLW*((1.-ZFRAC_ICE)+ZFRAC_ICE*0.92)) + ZEXP=2.*ZBG + !Calculation of the refractive index from Bohren and Battan (3.72 p66) + ZQB=2.*ZQMW**2*(2.*ZQMI**2*LOG(ZQMI/ZQMW)/(ZQMI**2-ZQMW**2)-1.)/(ZQMI**2-ZQMW**2) !Beta (3.73 p66) + ZQM=SQRT(((1.-ZFRAC_ICE)*ZQMW**2+ZFRAC_ICE*ZQB*ZQMI**2)/(1.-ZFRAC_ICE+ZFRAC_ICE*ZQB)) ! Bohren & Battan (1982) 3.72 p66 + ZQK=(ZQM**2-1.)/(ZQM**2+2.) + !Rayleigh, Rayleigh for ellipsoides or Rayleigh 6th order + IF(NDIFF==0.OR.NDIFF==3.OR.NDIFF==4) THEN + ZREFLOC(1:2)=ABS(ZQK)**2/.93*ZDMELT_FACT**2*1.E18*ZCCG*ZLBDA**(ZCXG-ZEXP)*MOMG(ZALPHAG,ZNUG,ZEXP) + ZREFLOC(3)=0. + IF(LWREFL) THEN ! weighting by reflectivities + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)& + -ZCG*SIN(PELEV(JI,JEL,JL,JV))*ABS(ZQK)**2/.93*ZDMELT_FACT**2& + *1.E18*ZCCG*ZLBDA**(ZCXG-ZEXP-ZDG)*MOMG(ZALPHAG,ZNUG,ZEXP+ZDG) + ELSE + ZREFL(JI,JEL,JAZ,JL,JH,JV,IMAX)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IMAX)+ZCCG*ZLBDA**ZCXG + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)& + -ZCG*SIN(PELEV(JI,JEL,JL,JV))& + *ZCCG*ZLBDA**(ZCXG-ZDG)*MOMG(ZALPHAG,ZNUG,ZDG) + END IF !end IF(LWREFL) + IF(LATT) THEN + IF(NDIFF==0.OR.NDIFF==3) THEN + ZAETMP(:)=ZCCG*ZLBDA**ZCXG*(ZDMELT_FACT*XPI**2/XLAM_RAD(JI)*AIMAG(ZQK) & + *MOMG(ZALPHAG,ZNUG,ZBG)/ZLBDA**ZBG) + ELSE + ZAETMP(:)=ZCCG*ZLBDA**ZCXG*(ZDMELT_FACT*XPI**2/XLAM_RAD(JI)*AIMAG(ZQK) & + *MOMG(ZALPHAG,ZNUG,ZBG)/ZLBDA**ZBG& + +ZDMELT_FACT**(5./3.)*XPI**4/15./XLAM_RAD(JI)**3 & + *AIMAG(ZQK**2*(ZQM**4+27.*ZQM**2+38.) & + /(2.*ZQM**2+3.))*MOMG(ZALPHAG,ZNUG,5.*ZBG/3.)/ZLBDA**(5.*ZBG/3.)& + +ZDMELT_FACT**2 *2.*XPI**5/3. /XLAM_RAD(JI)**4*REAL(ZQK**2) & + *MOMG(ZALPHAG,ZNUG,2.*ZBG) /ZLBDA**(2.*ZBG)) + END IF ! end IF(NDIFF==0.OR.NDIFF==3) + END IF ! end IF(LATT) + ZRE_S22S11_G=0 + ZIM_S22S11_G=0 + ZS22_CARRE_G=0 + ZS11_CARRE_G=0 + !******************************* NDIFF==7 TmatInt ************************************ + ELSE IF(NDIFF==7) THEN + ZREFLOC(:)=0 + IF(LATT) ZAETMP(:)=0 + IF (ZFW < 0.01) THEN !******** DRY GRAUPEL + CALL CALC_KTMAT(PELEV(JI,JEL,JL,JV), PT_RAY(JI,JEL,JAZ,JL,JH,JV),& + ZFW,ZM,& + ZELEV_MIN(3),ZELEV_MAX(3),ZELEV_STEP(3),& + ZTC_MIN(3),ZTC_MAX(3),ZTC_STEP(3),& + ZFW_MIN(3),ZFW_MAX(3),ZFW_STEP(3),& + ZEXPM_MIN,ZEXPM_MAX,ZEXPM_STEP,& + ITMAT,ZELEV_RED,ZTC_RED,ZFW_RED,ZM_RED) + IF (ITMAT(1) .NE. -NUNDEF) THEN + DO JIND=1,SIZE(KMAT_COEF,2),1 + KMAT_COEF(1,JIND)=ZS11_CARRE_T_G(ITMAT(JIND)) + KMAT_COEF(2,JIND)=ZS22_CARRE_T_G(ITMAT(JIND)) + KMAT_COEF(3,JIND)=ZRE_S22S11_T_G(ITMAT(JIND)) + KMAT_COEF(4,JIND)=ZIM_S22S11_T_G(ITMAT(JIND)) + KMAT_COEF(5,JIND)=ZRE_S22FMS11FT_T_G(ITMAT(JIND)) + KMAT_COEF(6,JIND)=ZIM_S22FT_T_G(ITMAT(JIND)) + KMAT_COEF(7,JIND)=ZIM_S11FT_T_G(ITMAT(JIND)) + ENDDO + CALL INTERPOL(ZELEV_RED,ZTC_RED,ZFW_RED,ZM_RED,KMAT_COEF,ZS11_CARRE_G,ZS22_CARRE_G,& + ZRE_S22S11_G,ZIM_S22S11_G,ZRE_S22FMS11F,ZIM_S22FT,ZIM_S11FT) + ELSE + ZS11_CARRE_G=0 + ZS22_CARRE_G=0 + ZRE_S22S11_G=0 + ZIM_S22S11_G=0 + ZRE_S22FMS11F=0 + ZIM_S22FT=0 + ZIM_S11FT=0 + END IF + ELSE !ZFW >= 0.01 ************** WET GRAUPEL + CALL CALC_KTMAT(PELEV(JI,JEL,JL,JV),PT_RAY(JI,JEL,JAZ,JL,JH,JV),& + ZFW,ZM,& + ZELEV_MIN(4),ZELEV_MAX(4),ZELEV_STEP(4),& + ZTC_MIN(4),ZTC_MAX(4),ZTC_STEP(4),& + ZFW_MIN(4),ZFW_MAX(4),ZFW_STEP(4),& + ZEXPM_MIN,ZEXPM_MAX,ZEXPM_STEP,& + ITMAT,ZELEV_RED,ZTC_RED,ZFW_RED,ZM_RED) + IF (ITMAT(1) .NE. -NUNDEF) THEN + DO JIND=1,SIZE(KMAT_COEF,2),1 + KMAT_COEF(1,JIND)=ZS11_CARRE_T_W(ITMAT(JIND)) + KMAT_COEF(2,JIND)=ZS22_CARRE_T_W(ITMAT(JIND)) + KMAT_COEF(3,JIND)=ZRE_S22S11_T_W(ITMAT(JIND)) + KMAT_COEF(4,JIND)=ZIM_S22S11_T_W(ITMAT(JIND)) + KMAT_COEF(5,JIND)=ZRE_S22FMS11FT_T_W(ITMAT(JIND)) + KMAT_COEF(6,JIND)=ZIM_S22FT_T_W(ITMAT(JIND)) + KMAT_COEF(7,JIND)=ZIM_S11FT_T_W(ITMAT(JIND)) + ENDDO + CALL INTERPOL(ZELEV_RED,ZTC_RED,ZFW_RED,ZM_RED,KMAT_COEF,ZS11_CARRE_G,ZS22_CARRE_G,& + ZRE_S22S11_G,ZIM_S22S11_G,ZRE_S22FMS11F,ZIM_S22FT,ZIM_S11FT) + ELSE + ZS11_CARRE_G=0 + ZS22_CARRE_G=0 + ZRE_S22S11_G=0 + ZIM_S22S11_G=0 + ZRE_S22FMS11F=0 + ZIM_S22FT=0 + ZIM_S11FT=0 + END IF + END IF!END IF (ZFW<0.01) + ZREFLOC(1)=1.E18*(XLAM_RAD(JI))**4/(XPI**5*.93)*4*XPI*ZS22_CARRE_G + ZREFLOC(2)=1.E18*(XLAM_RAD(JI))**4/(XPI**5*.93)*4*XPI*ZS11_CARRE_G + ZREFLOC(3)=180.E3/XPI*XLAM_RAD(JI)*ZRE_S22FMS11F + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=PVDOP_RAY(JI,JEL,JAZ,JL,JH,JV)*ZREFLOC(1) & + -ZCG*SIN(PELEV(JI,JEL,JL,JV))*ZREFLOC(1) & + *1.E18*(XLAM_RAD(JI)/XPI)**4/.93*ZCCG/4./ZLBDA**(3+ZDG) + IF(LATT) THEN + ZAETMP(1)=ZIM_S22FT*XLAM_RAD(JI)*2 + ZAETMP(2)=ZIM_S11FT*XLAM_RAD(JI)*2 + END IF + ELSE ! Mie (NDIFF=1) + ZREFLOC(:)=0. + IF(LATT) ZAETMP(:)=0. + DO JJ=1,NPTS_GAULAG ! ****** Gauss-Laguerre quadrature + ZD=ZX(JJ)**(1./ZALPHAG)/ZLBDA + ZDE=ZDMELT_FACT**(1./3.)*ZD**(ZBG/3.) + CALL BHMIE(XPI/XLAM_RAD(JI)*ZDE,ZQM,ZQEXT(1),ZQSCA,ZQBACK(1)) + ZQBACK(2)=ZQBACK(1) + ZQEXT(2)=ZQEXT(1) ! modif Clotilde 23/04/2012 + ZQBACK(3)=0. + ZREFLOC(1:3)=ZREFLOC(1:3)+ZQBACK(1:3)*ZX(JJ)**(ZNUG-1.+2.*ZBG/3./ZALPHAG)*ZW(JJ) + ZREFLOC(4)=ZREFLOC(4)+ZQBACK(1)*ZX(JJ)**(ZNUG-1.+2.*ZBG/3./ZALPHAG+ZDG/ZALPHAG)*ZW(JJ) + IF(LATT) ZAETMP(:)=ZAETMP(:)+ZQEXT(:)*ZX(JJ)**(ZNUG-1.+2.*ZBG/3./ZALPHAG)*ZW(JJ) + END DO ! ****** end loop on diameter (Gauss-Laguerre) + ZREFLOC(1:2)=ZREFLOC(1:2)*1.E18*(XLAM_RAD(JI)/XPI)**4*ZCCG & + *ZLBDA**(ZCXG-2.*ZBG/3.)/(4.*GAMMA(ZNUG)*.93)*ZDMELT_FACT**(2./3.) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP) & + +PVDOP_RAY(JI,JEL,JAZ,JL,JH,JV)*ZREFLOC(1) & + -ZCG*SIN(PELEV(JI,JEL,JL,JV))*ZREFLOC(4) & + *1.E18*(XLAM_RAD(JI)/XPI)**4*ZCCG & + *ZLBDA**(ZCXG-2.*ZBG/3.-ZDG)/(4.*GAMMA(ZNUG)*.93)*ZDMELT_FACT**(2./3.) + IF(LATT) ZAETMP(:)=ZAETMP(:)*XPI*ZCCG*ZLBDA**(ZCXG-2.*ZBG/3.)/(4.*GAMMA(ZNUG)) & + *ZDMELT_FACT**(2./3.) + ZRE_S22S11_G=0 + ZIM_S22S11_G=0 + ZS22_CARRE_G=0 + ZS11_CARRE_G=0 !0 in case of Mie + END IF !**************** end loop for each type of diffusion : IF(NDIFF==0.OR.NDIFF==3.OR.NDIFF==4) + ZREFL(JI,JEL,JAZ,JL,JH,JV,1:3)=ZREFL(JI,JEL,JAZ,JL,JH,JV,1:3)+ZREFLOC(1:3) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IZEG)=ZREFLOC(1) ! z_e due to graupel + ZREFL(JI,JEL,JAZ,JL,JH,JV,IZDG)=ZREFLOC(2) !Zvv for ZDR due to graupel + ZREFL(JI,JEL,JAZ,JL,JH,JV,IKDG)=ZREFLOC(3) !Zvv for ZDR due to graupel + + IF (ZS22_CARRE_G*ZS11_CARRE_G .GT. 0) THEN + ZREFL(JI,JEL,JAZ,JL,JH,JV,IRHG)=SQRT(ZRE_S22S11_G**2+ZIM_S22S11_G**2)/SQRT(ZS22_CARRE_G*ZS11_CARRE_G) + ELSE + ZREFL(JI,JEL,JAZ,JL,JH,JV,IRHG)=1 + END IF + IF(LATT) THEN + ZAELOC(JI,JEL,JAZ,JL,JH,JV,:)=ZAELOC(JI,JEL,JAZ,JL,JH,JV,:)+ZAETMP(:) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IAEG)=ZAETMP(1) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IAVG)=ZAETMP(2) + IF(JL>1) THEN + ZAEGINT=ZAEGINT*EXP(-2.*ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IAEG)*XSTEP_RAD) + ZAVGINT=ZAVGINT*EXP(-2.*ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IAVG)*XSTEP_RAD) + END IF + ZREFL(JI,JEL,JAZ,JL,JH,JV,IZEG)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IZEG)*ZAEGINT ! Z_g attenuated + ZREFL(JI,JEL,JAZ,JL,JH,JV,IZDG)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IZDG)*ZAVGINT ! Z_g attenuated + END IF !end IF(LATT) + END IF !**************** IF(PG_RAY(JI,JEL,JAZ,JL,JH,JV) > XRTMIN(6)) + + ! Total attenuation even if no hydrometeors + IF(LATT.AND.JL>1) ZREFL(JI,JEL,JAZ,JL,JH,JV,IATG)=ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IATG) & + *EXP(-2.*ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IAEG)*XSTEP_RAD) + + END IF ! **************** end GRAUPEL (end IF SIZE(PG_RAY,1) > 0) + !----------------------------------------------------------------------------------------------- + !----------------------------------------------------------------------------------------------- +!********************************** +!********************************** +!********************************** +!********************************** + + +!--------------------------------------------------------------------------------------------------- + !* 6. HAIL + ! ------- + ! + ! + IF (GHAIL) THEN + ZM=PRHODREF_RAY(JI,JEL,JAZ,JL,JH,JV)*PH_RAY(JI,JEL,JAZ,JL,JH,JV) !graupel content + IF(ZM > ZM_MIN) THEN + YTYPE='h' + ZQMI=SQRT(QEPSI(MIN(PT_RAY(JI,JEL,JAZ,JL,JH,JV),XTT),XLIGHTSPEED/XLAM_RAD(JI))) + ZQMW=SQRT(QEPSW(MAX(PT_RAY(JI,JEL,JAZ,JL,JH,JV),XTT),XLIGHTSPEED/XLAM_RAD(JI))) + !ini_radar.f90 : ZCXG = -0.5 XBG = 2.8 ( Xj et bj tab 2.1 p 24) + !ini_rain_ice.f90 : XLBEXG = 1.0/(XCXG-XBG) XAG = 19.6 (aj tab 2.1 p 24) + !XLBG = ( XAG*XCCG*MOMG(XALPHAG,XNUG,XBG) )**(-XLBEXG) (eq 2.6 p 23) +ZFW=0 !???????? + ZLBDA=ZLBH*(PRHODREF_RAY(JI,JEL,JAZ,JL,JH,JV)*PH_RAY(JI,JEL,JAZ,JL,JH,JV))**ZLBEXH + !XTT : température du point triple de l'eau (273.16 K <=> 0.1 °C) + IF(PT_RAY(JI,JEL,JAZ,JL,JH,JV) > XTT) THEN ! mixture of ice and water + ZFRAC_ICE = .85 !(see p 68) + ELSE ! only ice + ZFRAC_ICE=1. + END IF + ! from eq 3.77 p 68 + !XRHOLW=1000 (initialized in ini_cst.f90) + ZDMELT_FACT=6.*ZAG/(XPI*XRHOLW*((1.-ZFRAC_ICE)+ZFRAC_ICE*0.92)) + ZEXP=2.*ZBH + !Calculation of the refractive index from Bohren and Battan (3.72 p66) + ZQB=2.*ZQMW**2*(2.*ZQMI**2*LOG(ZQMI/ZQMW)/(ZQMI**2-ZQMW**2)-1.)/(ZQMI**2-ZQMW**2) !Beta (3.73 p66) + ZQM=SQRT(((1.-ZFRAC_ICE)*ZQMW**2+ZFRAC_ICE*ZQB*ZQMI**2)/(1.-ZFRAC_ICE+ZFRAC_ICE*ZQB)) ! Bohren & Battan (1982) 3.72 p66 + ZQK=(ZQM**2-1.)/(ZQM**2+2.) + !Rayleigh, Rayleigh for ellipsoides or Rayleigh 6th order + IF(NDIFF==0.OR.NDIFF==3.OR.NDIFF==4) THEN + ZREFLOC(1:2)=ABS(ZQK)**2/.93*ZDMELT_FACT**2*1.E18*ZCCH*ZLBDA**(ZCXH-ZEXP)*MOMG(ZALPHAH,ZNUH,ZEXP) + ZREFLOC(3)=0. + IF(LWREFL) THEN ! weighting by reflectivities + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)& + -ZCH*SIN(PELEV(JI,JEL,JL,JV))*ABS(ZQK)**2/.93*ZDMELT_FACT**2& + *1.E18*ZCCH*ZLBDA**(ZCXH-ZEXP-ZDH)*MOMG(ZALPHAH,ZNUH,ZEXP+ZDH) + ELSE + ZREFL(JI,JEL,JAZ,JL,JH,JV,IMAX)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IMAX)+ZCCH*ZLBDA**ZCXH + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)& + -ZCH*SIN(PELEV(JI,JEL,JL,JV))& + *ZCCH*ZLBDA**(ZCXH-ZDH)*MOMG(ZALPHAH,ZNUH,ZDH) + END IF !end IF(LWREFL) + IF(LATT) THEN + IF(NDIFF==0.OR.NDIFF==3) THEN + ZAETMP(:)=ZCCH*ZLBDA**ZCXH*(ZDMELT_FACT*XPI**2/XLAM_RAD(JI)*AIMAG(ZQK) & + *MOMG(ZALPHAH,ZNUH,ZBH)/ZLBDA**ZBH) + ELSE + ZAETMP(:)=ZCCH*ZLBDA**ZCXH*(ZDMELT_FACT*XPI**2/XLAM_RAD(JI)*AIMAG(ZQK) & + *MOMG(ZALPHAH,ZNUH,ZBH)/ZLBDA**ZBH& + +ZDMELT_FACT**(5./3.)*XPI**4/15./XLAM_RAD(JI)**3 & + *AIMAG(ZQK**2*(ZQM**4+27.*ZQM**2+38.) & + /(2.*ZQM**2+3.))*MOMG(ZALPHAH,ZNUH,5.*ZBH/3.)/ZLBDA**(5.*ZBH/3.)& + +ZDMELT_FACT**2 *2.*XPI**5/3. /XLAM_RAD(JI)**4*REAL(ZQK**2) & + *MOMG(ZALPHAH,ZNUH,2.*ZBH) /ZLBDA**(2.*ZBH)) + END IF ! end IF(NDIFF==0.OR.NDIFF==3) + END IF ! end IF(LATT) + ZRE_S22S11_H=0 + ZIM_S22S11_H=0 + ZS22_CARRE_H=0 + ZS11_CARRE_H=0 + !******************************* NDIFF==7 TmatInt ************************************ + ELSE IF(NDIFF==7) THEN + ZREFLOC(:)=0 + IF(LATT) ZAETMP(:)=0 + CALL CALC_KTMAT(PELEV(JI,JEL,JL,JV), PT_RAY(JI,JEL,JAZ,JL,JH,JV),& + ZFW,ZM,& + ZELEV_MIN(3),ZELEV_MAX(3),ZELEV_STEP(3),& + ZTC_MIN(3),ZTC_MAX(3),ZTC_STEP(3),& + ZFW_MIN(3),ZFW_MAX(3),ZFW_STEP(3),& + ZEXPM_MIN,ZEXPM_MAX,ZEXPM_STEP,& + ITMAT,ZELEV_RED,ZTC_RED,ZFW_RED,ZM_RED) + IF (ITMAT(1) .NE. -NUNDEF) THEN + DO JIND=1,SIZE(KMAT_COEF,2),1 + KMAT_COEF(1,JIND)=ZS11_CARRE_T_H(ITMAT(JIND)) + KMAT_COEF(2,JIND)=ZS22_CARRE_T_H(ITMAT(JIND)) + KMAT_COEF(3,JIND)=ZRE_S22S11_T_H(ITMAT(JIND)) + KMAT_COEF(4,JIND)=ZIM_S22S11_T_H(ITMAT(JIND)) + KMAT_COEF(5,JIND)=ZRE_S22FMS11FT_T_H(ITMAT(JIND)) + KMAT_COEF(6,JIND)=ZIM_S22FT_T_H(ITMAT(JIND)) + KMAT_COEF(7,JIND)=ZIM_S11FT_T_H(ITMAT(JIND)) + ENDDO + CALL INTERPOL(ZELEV_RED,ZTC_RED,ZFW_RED,ZM_RED,KMAT_COEF,ZS11_CARRE_H,ZS22_CARRE_H,& + ZRE_S22S11_H,ZIM_S22S11_H,ZRE_S22FMS11F,ZIM_S22FT,ZIM_S11FT) + ELSE + ZS11_CARRE_H=0 + ZS22_CARRE_H=0 + ZRE_S22S11_H=0 + ZIM_S22S11_H=0 + ZRE_S22FMS11F=0 + ZIM_S22FT=0 + ZIM_S11FT=0 + END IF + ZREFLOC(1)=1.E18*(XLAM_RAD(JI))**4/(XPI**5*.93)*4*XPI*ZS22_CARRE_H + ZREFLOC(2)=1.E18*(XLAM_RAD(JI))**4/(XPI**5*.93)*4*XPI*ZS11_CARRE_H + ZREFLOC(3)=180.E3/XPI*XLAM_RAD(JI)*ZRE_S22FMS11F + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=PVDOP_RAY(JI,JEL,JAZ,JL,JH,JV)*ZREFLOC(1) & + -ZCH*SIN(PELEV(JI,JEL,JL,JV))*ZREFLOC(1) & + *1.E18*(XLAM_RAD(JI)/XPI)**4/.93*ZCCH/4./ZLBDA**(3+ZDH) + IF(LATT) THEN + ZAETMP(1)=ZIM_S22FT*XLAM_RAD(JI)*2 + ZAETMP(2)=ZIM_S11FT*XLAM_RAD(JI)*2 + END IF + ELSE ! Mie (NDIFF=1) + ZREFLOC(:)=0. + IF(LATT) ZAETMP(:)=0. + DO JJ=1,NPTS_GAULAG ! ****** Gauss-Laguerre quadrature + ZD=ZX(JJ)**(1./ZALPHAH)/ZLBDA + ZDE=ZDMELT_FACT**(1./3.)*ZD**(ZBH/3.) + CALL BHMIE(XPI/XLAM_RAD(JI)*ZDE,ZQM,ZQEXT(1),ZQSCA,ZQBACK(1)) + ZQBACK(2)=ZQBACK(1) + ZQEXT(2)=ZQEXT(1) ! modif Clotilde 23/04/2012 + ZQBACK(3)=0. + ZREFLOC(1:3)=ZREFLOC(1:3)+ZQBACK(1:3)*ZX(JJ)**(ZNUH-1.+2.*ZBH/3./ZALPHAH)*ZW(JJ) + ZREFLOC(4)=ZREFLOC(4)+ZQBACK(1)*ZX(JJ)**(ZNUH-1.+2.*ZBH/3./ZALPHAH+ZDH/ZALPHAH)*ZW(JJ) + IF(LATT) ZAETMP(:)=ZAETMP(:)+ZQEXT(:)*ZX(JJ)**(ZNUH-1.+2.*ZBH/3./ZALPHAH)*ZW(JJ) + END DO ! ****** end loop on diameter (Gauss-Laguerre) + ZREFLOC(1:2)=ZREFLOC(1:2)*1.E18*(XLAM_RAD(JI)/XPI)**4*ZCCH & + *ZLBDA**(ZCXH-2.*ZBH/3.)/(4.*GAMMA(ZNUH)*.93)*ZDMELT_FACT**(2./3.) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP) & + +PVDOP_RAY(JI,JEL,JAZ,JL,JH,JV)*ZREFLOC(1) & + -ZCH*SIN(PELEV(JI,JEL,JL,JV))*ZREFLOC(4) & + *1.E18*(XLAM_RAD(JI)/XPI)**4*ZCCH & + *ZLBDA**(ZCXH-2.*ZBH/3.-ZDH)/(4.*GAMMA(ZNUH)*.93)*ZDMELT_FACT**(2./3.) + IF(LATT) ZAETMP(:)=ZAETMP(:)*XPI*ZCCH*ZLBDA**(ZCXH-2.*ZBH/3.)/(4.*GAMMA(ZNUH)) & + *ZDMELT_FACT**(2./3.) + ZRE_S22S11_H=0 + ZIM_S22S11_H=0 + ZS22_CARRE_H=0 + ZS11_CARRE_H=0 !0 in case of Mie + END IF !**************** end loop for each type of diffusion : IF(NDIFF==0.OR.NDIFF==3.OR.NDIFF==4) + ZREFL(JI,JEL,JAZ,JL,JH,JV,1:3)=ZREFL(JI,JEL,JAZ,JL,JH,JV,1:3)+ZREFLOC(1:3) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IZEH)=ZREFLOC(1) ! z_e due to graupel + ZREFL(JI,JEL,JAZ,JL,JH,JV,IZDH)=ZREFLOC(2) !Zvv for ZDR due to graupel + ZREFL(JI,JEL,JAZ,JL,JH,JV,IKDH)=ZREFLOC(3) !Zvv for ZDR due to graupel + + IF (ZS22_CARRE_H*ZS11_CARRE_H .GT. 0) THEN + ZREFL(JI,JEL,JAZ,JL,JH,JV,IRHH)=SQRT(ZRE_S22S11_H**2+ZIM_S22S11_H**2)/SQRT(ZS22_CARRE_H*ZS11_CARRE_H) + ELSE + ZREFL(JI,JEL,JAZ,JL,JH,JV,IRHH)=1 + END IF + IF(LATT) THEN + ZAELOC(JI,JEL,JAZ,JL,JH,JV,:)=ZAELOC(JI,JEL,JAZ,JL,JH,JV,:)+ZAETMP(:) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IAEH)=ZAETMP(1) + ZREFL(JI,JEL,JAZ,JL,JH,JV,IAVH)=ZAETMP(2) + IF(JL>1) THEN + ZAEHINT=ZAEHINT*EXP(-2.*ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IAEH)*XSTEP_RAD) + ZAVHINT=ZAVHINT*EXP(-2.*ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IAVH)*XSTEP_RAD) + END IF + ZREFL(JI,JEL,JAZ,JL,JH,JV,IZEH)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IZEH)*ZAEHINT ! Z_g attenuated + ZREFL(JI,JEL,JAZ,JL,JH,JV,IZDH)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IZDH)*ZAVHINT ! Z_g attenuated + END IF !end IF(LATT) + END IF !**************** IF(PH_RAY(JI,JEL,JAZ,JL,JH,JV) > XRTMIN(6)) + + ! Total attenuation even if no hydrometeors + IF(LATT.AND.JL>1) ZREFL(JI,JEL,JAZ,JL,JH,JV,IATH)=ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IATH) & + *EXP(-2.*ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IAEH)*XSTEP_RAD) + + END IF ! **************** end HAIL (end IF SIZE(PH_RAY,1) > 0) + !----------------------------------------------------------------------------------------------- + !----------------------------------------------------------------------------------------------- +!********************************** +!********************************** +!********************************** +!********************************** + + IF(LWREFL) THEN ! weighting by reflectivities + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)& + +PVDOP_RAY(JI,JEL,JAZ,JL,JH,JV)*ZREFL(JI,JEL,JAZ,JL,JH,JV,1) + ELSE IF(LWBSCS) THEN ! weighting by hydrometeor concentrations + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)& + +PVDOP_RAY(JI,JEL,JAZ,JL,JH,JV)*ZREFL(JI,JEL,JAZ,JL,JH,JV,IMAX) + ELSE IF(ZREFL(JI,JEL,JAZ,JL,JH,JV,IMAX)/=0.) THEN ! no weighting + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)/ZREFL(JI,JEL,JAZ,JL,JH,JV,IMAX)& + +PVDOP_RAY(JI,JEL,JAZ,JL,JH,JV) + END IF + !Calculation of Phidp (ZREFL(JI,JEL,JAZ,JL,JH,JV,IPDP) is initialized to 0 before the loop + IF (JL>1) ZREFL(JI,JEL,JAZ,JL,JH,JV,IPDP)=ZREFL(JI,JEL,JAZ,JL-1,JH,JV,IPDP)+ & + 2.*ZREFL(JI,JEL,JAZ,JL-1,JH,JV,3)*XSTEP_RAD*1D-3 + + !Calculation of RhoHV and DeltaHV + ZRE_S22S11_T=ZRE_S22S11_R+ZRE_S22S11_I+ZRE_S22S11_S+ZRE_S22S11_G+ZRE_S22S11_H + ZIM_S22S11_T=ZIM_S22S11_R+ZIM_S22S11_I+ZIM_S22S11_S+ZIM_S22S11_G+ZIM_S22S11_H + ZS22_CARRE_T=ZS22_CARRE_R+ZS22_CARRE_I+ZS22_CARRE_S+ZS22_CARRE_G+ZS22_CARRE_H + ZS11_CARRE_T=ZS11_CARRE_R+ZS11_CARRE_I+ZS11_CARRE_S+ZS11_CARRE_G+ZS11_CARRE_H + !RhoHV + IF ((ZS22_CARRE_T*ZS11_CARRE_T)>0.) THEN + ZREFL(JI,JEL,JAZ,JL,JH,JV,IRHV)=SQRT(ZRE_S22S11_T**2+ZIM_S22S11_T**2)/SQRT(ZS22_CARRE_T*ZS11_CARRE_T) + ELSE + ZREFL(JI,JEL,JAZ,JL,JH,JV,IRHV)=-XUNDEF + END IF + !DeltaHV + IF (ZRE_S22S11_T/=0) THEN + ZREFL(JI,JEL,JAZ,JL,JH,JV,IDHV)=180/XPI*ATAN(ZIM_S22S11_T/ZRE_S22S11_T) + ELSE + ZREFL(JI,JEL,JAZ,JL,JH,JV,IDHV)=0 + END IF + ELSE !if temperature is not defined + ZREFL(JI,JEL,JAZ,JL,JH,JV,1:2)=XVALGROUND + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=XVALGROUND + LPART_MASK=.TRUE. + END IF !end condition : IF(PT_RAY(JI,JEL,JAZ,JL,JH,JV) /= -XUNDEF) => if temperature is defined + END IF !end condition : IF(LPART_MASK) => if pixel is not masked + END DO LOOPJL + END DO !JV + END DO !JH + END DO !JAZ + END DO !JEL + ! + !lookup tables for rain + DEALLOCATE (ZTC_T_R,ZELEV_T_R,ZM_T_R,ZS11_CARRE_T_R,ZS22_CARRE_T_R,& + ZRE_S22S11_T_R,ZIM_S22S11_T_R,ZRE_S22FMS11FT_T_R,ZIM_S22FT_T_R,ZIM_S11FT_T_R) + !lookup tables for snow + DEALLOCATE (ZTC_T_S,ZELEV_T_S,ZM_T_S,ZS11_CARRE_T_S,ZS22_CARRE_T_S,& + ZRE_S22S11_T_S,ZIM_S22S11_T_S,ZRE_S22FMS11FT_T_S,ZIM_S22FT_T_S,ZIM_S11FT_T_S) + !lookup tables for graupel + DEALLOCATE (ZTC_T_G,ZELEV_T_G,ZM_T_G,ZS11_CARRE_T_G,ZS22_CARRE_T_G,& + ZRE_S22S11_T_G,ZIM_S22S11_T_G,ZRE_S22FMS11FT_T_G,ZIM_S22FT_T_G,ZIM_S11FT_T_G) + !lookup tables for wet graupel + DEALLOCATE (ZTC_T_W,ZELEV_T_W,ZM_T_W,ZS11_CARRE_T_W,ZS22_CARRE_T_W,& + ZRE_S22S11_T_W,ZIM_S22S11_T_W,ZRE_S22FMS11FT_T_W,ZIM_S22FT_T_W,ZIM_S11FT_T_W) + IF (GHAIL) THEN + !lookup tables for hail + DEALLOCATE (ZTC_T_H,ZELEV_T_H,ZM_T_H,ZS11_CARRE_T_H,ZS22_CARRE_T_H,& + ZRE_S22S11_T_H,ZIM_S22S11_T_H,ZRE_S22FMS11FT_T_H,ZIM_S22FT_T_H,ZIM_S11FT_T_H) + ENDIF +END DO !JI +! +! attenuation in dB/km +IF(LATT) ZREFL(:,:,:,:,:,:,IAER:IAEH)=4343.*2.*ZREFL(:,:,:,:,:,:,IAER:IAEH) ! horizontal specific attenuation +IF(LATT) ZREFL(:,:,:,:,:,:,IAVR:IAVH)=4343.*2.*ZREFL(:,:,:,:,:,:,IAVR:IAVH) ! vertical specific attenuation +! convective/stratiform +ZREFL(:,:,:,:,:,:,4)=PBU_MASK_RAY(:,:,:,:,:,:) ! CSR +! /convective/stratiform + +WRITE(ILUOUT0,*) 'NB ZREFL MIN MAX :', MINVAL(ZREFL(:,:,:,:,:,:,:)),MAXVAL(ZREFL(:,:,:,:,:,:,:)) +WRITE(ILUOUT0,*) 'NB ZREFL VALGROUND :', COUNT(ZREFL(:,:,:,:,:,:,:) ==XVALGROUND) +WRITE(ILUOUT0,*) 'NB ZREFL -XUNDEF :', COUNT(ZREFL(:,:,:,:,:,:,:) ==-XUNDEF) +WRITE(ILUOUT0,*) 'NB ZREFL > 0 :', COUNT(ZREFL(:,:,:,:,:,:,:)>0.) +WRITE(ILUOUT0,*) 'NB ZREFL = 0 :', COUNT(ZREFL(:,:,:,:,:,:,:)==0.) +WRITE(ILUOUT0,*) 'NB ZREFL < 0 :', COUNT(ZREFL(:,:,:,:,:,:,:) < 0.)-COUNT( ZREFL(:,:,:,:,:,:,:)==XVALGROUND) +!--------------------------------------------------------------------------------------------------- +!* 6. FINAL STEP : TOTAL ATTENUATION AND EQUIVALENT REFLECTIVITY FACTOR +! --------------------------------------------------------------- +! +ALLOCATE(ZVTEMP(IMAX)) +DO JI=1,INBRAD + IEL=NBELEV(JI) + DO JEL=1,IEL + DO JAZ=1,INBAZIM + IF (LATT) ZAETOT(:,:,1:2)=1. + PZE(JI,JEL,JAZ,1,IPDP)=0 + DO JL=1,INBSTEPMAX + ! if no undef point in gate JL and at least one point where T is defined + IF(COUNT(ZREFL(JI,JEL,JAZ,JL,:,:,1)==-XUNDEF)==0.AND. & + COUNT(ZREFL(JI,JEL,JAZ,JL,:,:,1)==XVALGROUND)==0.AND. & + COUNT(PT_RAY(JI,JEL,JAZ,JL,:,:)/=-XUNDEF)/=0) THEN + DO JH=1,INPTS_H + ZVTEMP(:)=0. + DO JV=1,INPTS_V ! Loop on Jv + !if range is over 1, attenuation is added + IF (JL > 1) THEN + IF(LATT) THEN ! we use ZALPHAE0=alpha_0 from last gate + !Total attenuation + ZAETOT(JH,JV,1:2)=ZAETOT(JH,JV,1:2)*EXP(-2.*ZAELOC(JI,JEL,JAZ,JL-1,JH,JV,:)*XSTEP_RAD) + !Zhh, Zvv + ZREFL(JI,JEL,JAZ,JL,JH,JV,1:2)=ZREFL(JI,JEL,JAZ,JL,JH,JV,1:2)*ZAETOT(JH,JV,1:2)!attenuated reflectivity + !Z for Radial velocity + IF(LWREFL) ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)*ZAETOT(JH,JV,1) + END IF !end IF(LATT) + END IF !end IF (JL > 1) + IF(.NOT.(LWREFL.AND.LWBSCS)) THEN + ZREFL(JI,JEL,JAZ,JL,JH,JV,IVDOP)=PVDOP_RAY(JI,JEL,JAZ,JL,JH,JV) + END IF + ! Quadrature on vertical reflectivities +VDOP + IF(LQUAD) THEN + ZVTEMP(:)=ZVTEMP(:)+ZREFL(JI,JEL,JAZ,JL,JH,JV,:)*PW_V(ABS((2*JV-INPTS_V-1)/2)+1) & + *EXP(-2.*LOG(2.)*PX_V(ABS((2*JV-INPTS_V-1)/2)+1)**2) + ELSE + ZVTEMP(:)=ZVTEMP(:)+ZREFL(JI,JEL,JAZ,JL,JH,JV,:)*PW_V(ABS((2*JV-INPTS_V-1)/2)+1) + END IF + END DO ! End loop on JV +! + IF(LQUAD) THEN + PZE(JI,JEL,JAZ,JL,:)=PZE(JI,JEL,JAZ,JL,:)+ZVTEMP(1:SIZE(PZE,5))*PW_H(ABS((2*JH-INPTS_H-1)/2)+1) & + *EXP(-2.*LOG(2.)*PX_H(ABS((2*JH-INPTS_H-1)/2)+1)**2) + IF(LWBSCS) ZCONC_BIN(JI,JEL,JAZ,JL)=ZCONC_BIN(JI,JEL,JAZ,JL)+ZVTEMP(IMAX)* & + PW_H(ABS((2*JH-INPTS_H-1)/2)+1)*EXP(-2.*LOG(2.)*PX_H(ABS((2*JH-INPTS_H-1)/2)+1)**2) + ELSE + PZE(JI,JEL,JAZ,JL,:)=PZE(JI,JEL,JAZ,JL,:)+ZVTEMP(1:SIZE(PZE,5))*PW_H(ABS((2*JH-INPTS_H-1)/2)+1) + IF(LWBSCS) ZCONC_BIN(JI,JEL,JAZ,JL)=ZCONC_BIN(JI,JEL,JAZ,JL)+ZVTEMP(IMAX)* & + PW_H(ABS((2*JH-INPTS_H-1)/2)+1) + END IF !end IF(LQUAD) + END DO ! End loop on JH + + IF(LQUAD) THEN + PZE(JI,JEL,JAZ,JL,:)=PZE(JI,JEL,JAZ,JL,:)*2.*LOG(2.)/XPI + IF(LWBSCS) ZCONC_BIN(JI,JEL,JAZ,JL)=ZCONC_BIN(JI,JEL,JAZ,JL)*2.*LOG(2.)/XPI + ELSE + PZE(JI,JEL,JAZ,JL,:)=PZE(JI,JEL,JAZ,JL,:)/XPI + IF(LWBSCS) ZCONC_BIN(JI,JEL,JAZ,JL)=ZCONC_BIN(JI,JEL,JAZ,JL)/XPI + END IF !end IF(LQUAD) +! + !**** Thresholding: with ZSNR, or with XREFLVDOPMIN and XREFLMIN + ZSNR=-XUNDEF + ZSNR_R=-XUNDEF + ZSNR_I=-XUNDEF + ZSNR_S=-XUNDEF + ZSNR_G=-XUNDEF + ZSNR_H=-XUNDEF + ZZHH=PZE(JI,JEL,JAZ,JL,1) + ZZE_R=PZE(JI,JEL,JAZ,JL,IZER) + ZZE_I=PZE(JI,JEL,JAZ,JL,IZEI) + ZZE_S=PZE(JI,JEL,JAZ,JL,IZES) + ZZE_G=PZE(JI,JEL,JAZ,JL,IZEG) + IF (GHAIL) ZZE_H=PZE(JI,JEL,JAZ,JL,IZEH) + ZDISTRAD=JL*XSTEP_RAD !radar distance in meters + IF (LSNRT) THEN + IF (ZZHH/=XVALGROUND .AND. ZZHH/=-XUNDEF.AND.ZZHH/=0) THEN + ZSNR=10*LOG10(ZZHH)-20*LOG10(ZDISTRAD/(100*10**3)) + END IF + IF (ZZE_R/=XVALGROUND .AND. ZZE_R/=-XUNDEF.AND.ZZE_R/=0) THEN + ZSNR_R=10*LOG10(ZZE_R)-20*LOG10(ZDISTRAD/(100*10**3)) + END IF + IF (ZZE_I/=XVALGROUND .AND. ZZE_I/=-XUNDEF.AND.ZZE_I/=0) THEN + ZSNR_I=10*LOG10(ZZE_I)-20*LOG10(ZDISTRAD/(100*10**3)) + END IF + IF (ZZE_S/=XVALGROUND .AND. ZZE_S/=-XUNDEF.AND.ZZE_S/=0) THEN + ZSNR_S=10*LOG10(ZZE_S)-20*LOG10(ZDISTRAD/(100*10**3)) + END IF + IF (ZZE_G/=XVALGROUND .AND. ZZE_G/=-XUNDEF.AND.ZZE_G/=0) THEN + ZSNR_G=10*LOG10(ZZE_G)-20*LOG10(ZDISTRAD/(100*10**3)) + END IF + IF (GHAIL) THEN + IF (ZZE_H/=XVALGROUND .AND. ZZE_H/=-XUNDEF.AND.ZZE_H/=0) THEN + ZSNR_H=10*LOG10(ZZE_H)-20*LOG10(ZDISTRAD/(100*10**3)) + END IF + END IF + GTHRESHOLD_V=(ZSNR>=XSNRMIN) + GTHRESHOLD_Z=GTHRESHOLD_V + GTHRESHOLD_ZR=(ZSNR_R>=XSNRMIN) + GTHRESHOLD_ZI=(ZSNR_I>=XSNRMIN) + GTHRESHOLD_ZS=(ZSNR_S>=XSNRMIN) + GTHRESHOLD_ZG=(ZSNR_G>=XSNRMIN) + IF (GHAIL) GTHRESHOLD_ZH=(ZSNR_H>=XSNRMIN) + ELSE + GTHRESHOLD_V=(ZZHH>=10**(XREFLVDOPMIN/10.)) + GTHRESHOLD_Z=(ZZHH>=10**(XREFLMIN/10.)) + GTHRESHOLD_ZR=(ZZE_R>=10**(XREFLMIN/10.)) + GTHRESHOLD_ZI=(ZZE_I>=10**(XREFLMIN/10.)) + GTHRESHOLD_ZS=(ZZE_S>=10**(XREFLMIN/10.)) + GTHRESHOLD_ZG=(ZZE_G>=10**(XREFLMIN/10.)) + IF (GHAIL) GTHRESHOLD_ZH=(ZZE_H>=10**(XREFLMIN/10.)) + END IF + !--- Doppler velocities + IF(GTHRESHOLD_V) THEN + IF(LWREFL) THEN + !change Clotilde 27/04/2012 to avoid division by zero and floating point exception + IF (PZE(JI,JEL,JAZ,JL,1)/=0) THEN + PZE(JI,JEL,JAZ,JL,IVDOP)=PZE(JI,JEL,JAZ,JL,IVDOP)/PZE(JI,JEL,JAZ,JL,1) + END IF + ELSE IF(LWBSCS) THEN + IF(ZCONC_BIN(JI,JEL,JAZ,JL)>0.) THEN + PZE(JI,JEL,JAZ,JL,IVDOP)=PZE(JI,JEL,JAZ,JL,IVDOP)/ZCONC_BIN(JI,JEL,JAZ,JL) + ELSE + PZE(JI,JEL,JAZ,JL,IVDOP)=-XUNDEF + END IF !end IF(ZCONC_BIN(JI,JEL,JAZ,JL)>0.) + END IF !end IF(LWREFL) + ELSE + PZE(JI,JEL,JAZ,JL,IVDOP)=-XUNDEF + END IF !end IF(GTHRESHOLD_V) + + !--- Zhh, Zvv et variables globales + IF(GTHRESHOLD_Z .EQV. .FALSE.) THEN + PZE(JI,JEL,JAZ,JL,1:4)=-XUNDEF + PZE(JI,JEL,JAZ,JL,IRHV:IDHV)=-XUNDEF + END IF + !--- ZER, ZDA, KDR, RHR + IF(GTHRESHOLD_ZR .EQV. .FALSE.) THEN + PZE(JI,JEL,JAZ,JL,IZER)=-XUNDEF + PZE(JI,JEL,JAZ,JL,IZDA)=-XUNDEF + PZE(JI,JEL,JAZ,JL,IKDR)=-XUNDEF + PZE(JI,JEL,JAZ,JL,IRHR)=-XUNDEF + END IF + !--- ZES, ZDS, KDS, RHS + IF(GTHRESHOLD_ZS .EQV. .FALSE.) THEN + PZE(JI,JEL,JAZ,JL,IZES)=-XUNDEF + PZE(JI,JEL,JAZ,JL,IZDS)=-XUNDEF + PZE(JI,JEL,JAZ,JL,IKDS)=-XUNDEF + PZE(JI,JEL,JAZ,JL,IRHS)=-XUNDEF + END IF + + !--- ZEG, ZDG, KDG, RHG + IF(GTHRESHOLD_ZG .EQV. .FALSE.) THEN + PZE(JI,JEL,JAZ,JL,IZEG)=-XUNDEF + PZE(JI,JEL,JAZ,JL,IZDG)=-XUNDEF + PZE(JI,JEL,JAZ,JL,IKDG)=-XUNDEF + PZE(JI,JEL,JAZ,JL,IRHG)=-XUNDEF + END IF + !--- ZEH, ZDH, KDH, RHH + IF (GHAIL) THEN + IF(GTHRESHOLD_ZH .EQV. .FALSE.) THEN + PZE(JI,JEL,JAZ,JL,IZEH)=-XUNDEF + PZE(JI,JEL,JAZ,JL,IZDH)=-XUNDEF + PZE(JI,JEL,JAZ,JL,IKDH)=-XUNDEF + PZE(JI,JEL,JAZ,JL,IRHH)=-XUNDEF + END IF + END IF + !--- ZEI + IF(GTHRESHOLD_ZI .EQV. .FALSE.) THEN + PZE(JI,JEL,JAZ,JL,IZEI)=-XUNDEF + END IF + ELSE + ! ground clutter or outside Meso-NH domain + !(IF T not defined or if one undef point at least in gate) + PZE(JI,JEL,JAZ,JL,:)=XVALGROUND + END IF + IF(PZE(JI,JEL,JAZ,JL,1) < 0. .AND. PZE(JI,JEL,JAZ,JL,1)/=-XUNDEF) THEN ! flag bin when underground => xvalground si < 0? + PZE(JI,JEL,JAZ,JL,:)=XVALGROUND + END IF ! end IF(PZE(JI,JEL,JAZ,JL,1) < 0.) + END DO ! end DO JL=1,INBSTEPMAX + END DO !end DO JAZ=1,INBAZIM + END DO !end DO JEL=1,IEL +END DO !end DO JI=1,INBRAD +DEALLOCATE(ZREFL,ZVTEMP,ZRTMIN) +WRITE(ILUOUT0,*) '*****************FIN RADAR_SCATTERING ***********************' +WRITE(ILUOUT0,*) 'NB PZE MIN MAX :', MINVAL(PZE(:,:,:,:,IZEI)),MAXVAL(PZE(:,:,:,:,IZEI)) +WRITE(ILUOUT0,*) 'NB PZE VALGROUND :', COUNT(PZE(:,:,:,:,IZEI) ==XVALGROUND) +WRITE(ILUOUT0,*) 'NB PZE -XUNDEF :', COUNT(PZE(:,:,:,:,IZEI) ==-XUNDEF) +WRITE(ILUOUT0,*) 'NB PZE > 0 :', COUNT(PZE(:,:,:,:,IZEI)>0.) +WRITE(ILUOUT0,*) 'NB PZE = 0 :', COUNT(PZE(:,:,:,:,IZEI)==0.) +WRITE(ILUOUT0,*) 'NB PZE < 0 :', COUNT(PZE(:,:,:,:,IZEI) < 0.)-COUNT(PZE(:,:,:,:,IZEI) ==XVALGROUND) +IF(NDIFF/=0) DEALLOCATE(ZX,ZW) +IF (LATT) DEALLOCATE(ZAELOC,ZAETOT) +WRITE(ILUOUT0,*) 'END OF RADAR SCATTERING' +END SUBROUTINE RADAR_SCATTERING + diff --git a/src/mesonh/ext/radiations.f90 b/src/mesonh/ext/radiations.f90 new file mode 100644 index 0000000000000000000000000000000000000000..51d7c9ac9bf6b9653daa6749dc66e9fc612ecdae --- /dev/null +++ b/src/mesonh/ext/radiations.f90 @@ -0,0 +1,3780 @@ +!MNH_LIC Copyright 1995-2022 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_RADIATIONS +! ######################## +! +CONTAINS +! +! ############################################################################ + SUBROUTINE RADIATIONS (TPFILE,OCLEAR_SKY,OCLOUD_ONLY, & + KCLEARCOL_TM1,HEFRADL,HEFRADI,HOPWSW,HOPISW,HOPWLW,HOPILW, & + PFUDG, KDLON, KFLEV, KRAD_DIAG, KFLUX, KRAD, KAER, KSWB_OLD, & + KSWB_MNH,KLWB_MNH, KSTATM,KRAD_COLNBR,PCOSZEN,PSEA, PCORSOL, & + PDIR_ALB, PSCA_ALB,PEMIS, PCLDFR, PCCO2, PTSRAD, PSTATM, & + PTHT, PRT, PPABST, POZON, PAER, PDST_WL, PAER_CLIM, PSVT, & + PDTHRAD, PSRFLWD, PSRFSWD_DIR,PSRFSWD_DIF, PRHODREF, PZZ, & + PRADEFF, PSWU, PSWD, PLWU,PLWD, PDTHRADSW, PDTHRADLW ) +! ############################################################################ +! +!!**** *RADIATIONS * - routine to call the SW and LW radiation calculations +!! +!! PURPOSE +!! ------- +!! The purpose of this routine is to prepare the temperature, water vapor +!! liquid water, cloud fraction, ozone profiles for the ECMWF radiation +!! calculations. There is a great number of available radiative fluxes in +!! the output, but only the potential temperature radiative tendency and the +!! SW and LW surface fluxes are provided in the output of the routine. +!! Two simplified computations are available (switches OCLEAR_SKY and +!! OCLOUD_ONLY). When OCLOUD_ONLY is .TRUE. the computations are performed +!! for the cloudy columns only. Furthermore with OCLEAR_SKY being .TRUE. +!! the clear sky columns are averaged and the computations are made for +!! the cloudy columns plus a single ensemble-mean clear sky column. +!! +!!** METHOD +!! ------ +!! First the temperature, water vapor, liquid water, cloud fraction +!! and profile arrays are built using the current model fields and +!! the standard atmosphere for the upper layer filling. +!! The standard atmosphere is used between the levels IKUP and +!! KFLEV where KFLEV is the number of vertical levels for the radiation +!! computations. +!! The aerosols optical thickness and the ozone fields come directly +!! from ini_radiation step (climatlogies used) and are already defined for KFLEV. +!! Surface parameter ( albedo, emiss ) are also defined from current surface fields. +!! In the case of clear-sky or cloud-only approximations, the cloudy +!! columns are selected by testing the vertically integrated cloud fraction +!! and the radiation computations are performed for these columns plus the +!! mean clear-sky one. In addition, columns where cloud have disapeared are determined +!! by saving cloud trace between radiation step and they are also recalculated +!! in cloud only step. In all case, the sun position correponds to the centered +!! time between 2 full radiation steps (determined in physparam). +!! Then the ECMWF radiation package is called and the radiative +!! heating/cooling tendancies are reformatted in case of partial +!! computations. In case of "cloud-only approximation" the only cloudy +!! column radiative fields are updated. +!! +!! EXTERNAL +!! -------- +!! Subroutine ECMWF_RADIATION_VERS2 : ECMWF interface calling radiation routines +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODD_CST : constants +!! XP00 : reference pressure +!! XCPD : calorific capacity of dry air at constant pressure +!! XRD : gas constant for dry air +!! Module MODD_PARAMETERS : parameters +!! JPHEXT : Extra columns on the horizontal boundaries +!! JPVEXT : Extra levels on the vertical boundaries +!! +!! REFERENCE +!! --------- +!! Book2 of documentation ( routine RADIATIONS ) +!! +!! AUTHOR +!! ------ +!! J.-P. Pinty * Laboratoire d'Aerologie* +!! +!! MODIFICATIONS +!! ------------- +!! Original 26/02/95 +!! J.Stein 20/12/95 add the array splitting in order to save memory +!! J.-P. Pinty 19/11/96 change the split arrays, specific humidity +!! and add the ice phase +!! J.Stein 22/06/97 use of the absolute pressure +!! P.Jabouille 31/07/97 impose a zero humidity for dry simulation +!! V.Masson 22/09/97 case of clear-sky approx. with no clear-sky column +!! V.Masson 07/11/97 half level pressure defined from averaged Exner +!! function +!! V.Masson 07/11/97 modification of junction between standard atm +!! and model for half level variables (top model +!! pressure and temperatures are used preferentially +!! to atm standard profile for the first point). +!! P.Jabouille 24/08/98 impose positivity for ZQLAVE +!! J.-P. Pinty 29/01/98 add storage for diagnostics +!! J. Stein 18/07/99 add the ORAD_DIAG switch and keep inside the +!! subroutine the partial tendencies +!! +!! F.Solmon 04/03/01 MAJOR MODIFICATIONS, updated version of ECMWF radiation scheme +!! P.Jabouille 05/05/03 bug in humidity conversion +!! Y.Seity 25/08/03 KSWB=6 for SW direct and scattered surface +!! downward fluxes used in surface scheme. +!! P. Tulet 01/20/05 climatologic SSA +!! A. Grini 05/20/05 dust direct effect (optical properties) +!! V.Masson, C.Lac 08/10 Correction of inversion of Diffuse and direct albedo +!! B.Aouizerats 2010 Explicit aerosol optical properties +!! C.Lac 11/2015 Correction on aerosols +!! B.Vie /13 LIMA +!! J.Escobar 30/03/2017 : Management of compilation of ECMWF_RAD in REAL*8 with MNH_REAL=R4 +!! J.Escobar 29/06/2017 : Check if Pressure Decreasing with height <-> elsif PB & STOP +!! Q.LIBOIS 06/2017 : correction on CLOUD_ONLY +!! Q.Libois 02/2018 : ECRAD +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +!! J.Escobar 28/06/2018 : Reproductible parallelisation of CLOUD_ONLY case +!! J.Escobar 20/07/2018 : for real*4 compilation, convert with REAL(X) argument to SUM_DD... +!! P.Wautelet 22/01/2019: use standard FLUSH statement instead of non standard intrinsics +!! Bielli S. 02/2019 Sea salt : significant sea wave height influences salt emission; 5 salt modes +! P. Wautelet 10/04/2019: replace ABORT and STOP calls by Print_msg +! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function +! P. Wautelet 06/09/2022: small fix: GSURF_CLOUD was not set outside of physical domain +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE PARKIND1, ONLY: JPRB +USE OYOESW , ONLY : RTAUA ,RPIZA ,RCGA +! +USE MODD_CH_AEROSOL, ONLY: LORILAM +USE MODD_CONF, ONLY: LCARTESIAN +USE MODD_CST +USE MODD_DUST, ONLY: LDUST +use modd_field, only: tfielddata, TYPEREAL +USE MODD_GRID , ONLY: XLAT0, XLON0 +USE MODD_GRID_n , ONLY: XLAT, XLON +USE MODD_IO, ONLY: TFILEDATA +USE MODD_LUNIT_n, ONLY: TLUOUT +USE MODD_NSV, ONLY: NSV_C2R2,NSV_C2R2BEG,NSV_C2R2END, & + NSV_C1R3,NSV_C1R3BEG,NSV_C1R3END, & + NSV_DSTBEG, NSV_DSTEND, & + NSV_AERBEG, NSV_AEREND, & + NSV_SLTBEG, NSV_SLTEND, & + NSV_LIMA,NSV_LIMA_BEG,NSV_LIMA_END, & + NSV_LIMA_NC, NSV_LIMA_NR, NSV_LIMA_NI +USE MODD_PARAMETERS +USE MODD_PARAM_LIMA +USE MODD_PARAM_n, ONLY: CCLOUD, CRAD +USE MODD_PARAM_RAD_n, ONLY: CAOP +USE MODD_RAIN_ICE_DESCR_n +USE MODD_SALT, ONLY: LSALT +USE MODD_TIME +! +USE MODE_DUSTOPT +USE MODE_IO_FIELD_WRITE, only: IO_Field_write +USE MODE_ll +use mode_msg +USE MODE_REPRO_SUM, ONLY : SUM_DD_R2_R1_ll,SUM_DD_R1_ll +! +#ifdef MNH_PGI +USE MODE_PACK_PGI +#endif +USE MODE_SALTOPT +USE MODE_SUM_ll, ONLY: MIN_ll +USE MODE_SUM2_ll, ONLY: GMINLOC_ll +USE MODE_THERMO +! +USE MODI_AEROOPT_GET +USE MODI_ECMWF_RADIATION_VERS2 +USE MODI_ECRAD_INTERFACE +USE MODD_VAR_ll, ONLY: IP +! +IMPLICIT NONE +! +!* 0.1 DECLARATIONS OF DUMMY ARGUMENTS : +! +TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file +LOGICAL, INTENT(IN) :: OCLOUD_ONLY! flag for the cloud column + ! computations only +LOGICAL, INTENT(IN) :: OCLEAR_SKY ! +INTEGER, INTENT(IN) :: KDLON ! number of columns where the + ! radiation calculations are + ! performed +INTEGER, INTENT(IN) :: KFLEV ! number of vertical levels + ! where the radiation + ! calculations are performed +INTEGER, INTENT(IN) :: KRAD_DIAG ! index for the number of + ! fields in the output +INTEGER, INTENT(IN) :: KFLUX ! number of top and ground + ! fluxes for the ZFLUX array +INTEGER, INTENT(IN) :: KRAD ! number of satellite radiances + ! for the ZRAD and ZRADCS arrays +INTEGER, INTENT(IN) :: KAER ! number of AERosol classes + +INTEGER, INTENT(IN) :: KSWB_OLD ! number of SW band ECMWF +INTEGER, INTENT(IN) :: KSWB_MNH ! number of SW band ECRAD +INTEGER, INTENT(IN) :: KLWB_MNH ! number of LW band ECRAD +INTEGER, INTENT(IN) :: KSTATM ! index of the standard + ! atmosphere level just above + ! the model top +INTEGER, INTENT(IN) :: KRAD_COLNBR ! factor by which the memory + ! is split + ! + !Choice of : +CHARACTER (LEN=*), INTENT (IN) :: HEFRADL ! +CHARACTER (LEN=*), INTENT (IN) :: HEFRADI ! +CHARACTER (LEN=*), INTENT (IN) :: HOPWSW !cloud water SW optical properties +CHARACTER (LEN=*), INTENT (IN) :: HOPISW !ice water SW optical properties +CHARACTER (LEN=*), INTENT (IN) :: HOPWLW !cloud water LW optical properties +CHARACTER (LEN=*), INTENT (IN) :: HOPILW !ice water LW optical properties +REAL, INTENT(IN) :: PFUDG ! subgrid cloud inhomogenity factor +REAL, DIMENSION(:,:), INTENT(IN) :: PCOSZEN ! COS(zenithal solar angle) +REAL, INTENT(IN) :: PCORSOL ! SOLar constant CORrection +REAL, DIMENSION(:,:), INTENT(IN) :: PSEA ! Land-sea mask +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PDIR_ALB! Surface direct ALBedo +REAL, DIMENSION(:,:,:), INTENT(IN) :: PSCA_ALB! Surface diffuse ALBedo +REAL, DIMENSION(:,:,:), INTENT(IN) :: PEMIS ! Surface IR EMISsivity +REAL, DIMENSION(:,:,:), INTENT(IN) :: PCLDFR ! CLouD FRaction +REAL, INTENT(IN) :: PCCO2 ! CO2 content +REAL, DIMENSION(:,:), INTENT(IN) :: PTSRAD ! RADiative Surface Temperature +REAL, DIMENSION(:,:), INTENT(IN) :: PSTATM ! selected standard atmosphere +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHT ! THeta at t +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRT ! moist variables at t (humidity, cloud water, rain water, ice water) +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABST ! pressure at t +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVT ! scalar variable ( C2R2 and C1R3 particle) +! +REAL, DIMENSION(:,:,:), POINTER :: POZON ! OZONE field from clim. +REAL, DIMENSION(:,:,:,:), POINTER :: PAER ! AERosols optical thickness from clim. +REAL, DIMENSION(:,:,:,:), POINTER :: PDST_WL ! AERosols Extinction by wavelength . +REAL, DIMENSION(:,:,:,:), POINTER :: PAER_CLIM ! AERosols optical thickness from clim. + ! note : the vertical dimension of + ! these fields include the "radiation levels" + ! above domain top + ! + +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF ![kg/m3] air density +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ![m] height of layers + +INTEGER, DIMENSION(:,:), INTENT(INOUT) :: KCLEARCOL_TM1 ! trace of cloud/clear col + ! at the previous radiation step +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDTHRAD ! THeta RADiative Tendancy +REAL, DIMENSION(:,:), INTENT(INOUT) :: PSRFLWD ! Downward SuRFace LW Flux +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSRFSWD_DIR ! Downward SuRFace SW Flux DIRect +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSRFSWD_DIF ! Downward SuRFace SW Flux DIFfuse +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSWU ! upward SW Flux +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSWD ! downward SW Flux +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PLWU ! upward LW Flux +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PLWD ! downward LW Flux +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDTHRADSW ! dthrad sw +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDTHRADLW ! dthradsw +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRADEFF ! effective radius +! +! +!* 0.2 DECLARATIONS OF LOCAL VARIABLES +! +LOGICAL :: GNOCL ! .TRUE. when no cloud is present + ! with OCLEAR_SKY .TRUE. +LOGICAL :: GAOP ! .TRUE. when CAOP='EXPL' +LOGICAL, DIMENSION(KDLON,KFLEV) :: GCLOUD ! .TRUE. for the cloudy columns +LOGICAL, DIMENSION(KFLEV,KDLON) :: GCLOUDT ! transpose of the GCLOUD array +LOGICAL, DIMENSION(KDLON) :: GCLEAR_2D ! .TRUE. for the clear-sky columns +LOGICAL, DIMENSION(KDLON,KFLEV) :: GCLEAR ! .TRUE. for all the levels of the + ! clear-sky columns +LOGICAL, DIMENSION(KDLON,KSWB_MNH) :: GCLEAR_SWB! .TRUE. for all the bands of the + ! clear-sky columns +INTEGER, DIMENSION(:), ALLOCATABLE :: ICLEAR_2D_TM1 ! +! +INTEGER :: JI,JJ,JK,JK1,JK2,JKRAD,JALBS! loop indices +! +INTEGER :: IIB ! I index value of the first inner mass point +INTEGER :: IJB ! J index value of the first inner mass point +INTEGER :: IKB ! K index value of the first inner mass point +INTEGER :: IIE ! I index value of the last inner mass point +INTEGER :: IJE ! J index value of the last inner mass point +INTEGER :: IKE ! K index value of the last inner mass point +INTEGER :: IKU ! array size for the third index +INTEGER :: IIJ ! reformatted array index +INTEGER :: IKSTAE ! level number of the STAndard atmosphere array +INTEGER :: IKUP ! vertical level above which STAndard atmosphere data + ! are filled in +! +INTEGER :: ICLEAR_COL ! number of clear-sky columns +INTEGER :: ICLOUD_COL ! number of cloudy columns +INTEGER :: ICLOUD ! number of levels corresponding of the cloudy columns +INTEGER :: IDIM ! effective number of columns for which the radiation + ! code is run +INTEGER :: INIR ! index corresponding to NIR fisrt band (in SW) +! +REAL, DIMENSION(:,:), ALLOCATABLE :: ZTAVE ! mean-layer temperature +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZTAVE_RAD ! mean-layer temperature +REAL, DIMENSION(:,:), ALLOCATABLE :: ZPAVE ! mean-layer pressure +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZPAVE_RAD ! mean-layer pressure +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZQSAVE ! saturation specific humidity +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZQVAVE ! mean-layer specific humidity +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZQLAVE ! Liquid water KG/KG +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZQRAVE ! Rain water KG/KG +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZQIAVE ! Ice water Kg/KG +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZQLWC ! liquid water content kg/m3 +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZQRWC ! Rain water content kg/m3 +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZQIWC ! ice water content kg/m3 +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZCFAVE ! mean-layer cloud fraction +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZO3AVE ! mean-layer ozone content +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZPRES_HL ! half-level pressure +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZT_HL ! half-level temperature +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZDPRES ! layer pressure thickness +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZCCT_C2R2! Cloud water Concentarion (C2R2) +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZCRT_C2R2! Rain water Concentarion (C2R2) +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZCIT_C1R3! Ice water Concentarion (C2R2) +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZCCT_LIMA! Cloud water Concentration(LIMA) +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZCRT_LIMA! Rain water Concentration(LIMA) +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZCIT_LIMA! Ice water Concentration(LIMA) +REAL(KIND=JPRB), DIMENSION(:,:,:), ALLOCATABLE :: ZAER ! aerosol optical thickness +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZALBP ! spectral surface albedo for direct radiations +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZALBD ! spectral surface albedo for diffuse radiations +REAL(KIND=JPRB), DIMENSION (:,:), ALLOCATABLE :: ZEMIS ! surface LW emissivity +REAL(KIND=JPRB), DIMENSION (:,:), ALLOCATABLE :: ZEMIW ! surface LW WINDOW emissivity +REAL(KIND=JPRB), DIMENSION(:), ALLOCATABLE :: ZTS ! reformatted surface PTSRAD array +REAL(KIND=JPRB), DIMENSION(:), ALLOCATABLE :: ZLSM ! reformatted land sea mask +REAL(KIND=JPRB), DIMENSION(:), ALLOCATABLE :: ZRMU0 ! Reformatted ZMU0 array +REAL(KIND=JPRB) :: ZRII0 ! corrected solar constant +! +REAL, DIMENSION(:,:), ALLOCATABLE :: ZDTLW ! LW temperature tendency +REAL, DIMENSION(:,:), ALLOCATABLE :: ZDTSW ! SW temperature tendency +REAL, DIMENSION(:,:), ALLOCATABLE :: ZNFLW_CS ! CLEAR-SKY LW NET FLUXES +REAL, DIMENSION(:,:), ALLOCATABLE :: ZNFLW ! TOTAL LW NET FLUXES +REAL, DIMENSION(:,:), ALLOCATABLE :: ZNFSW_CS ! CLEAR-SKY SW NET FLUXES +REAL, DIMENSION(:,:), ALLOCATABLE :: ZNFSW ! TOTAL SW NET FLUXES +REAL, DIMENSION(:,:), ALLOCATABLE :: ZFLUX_TOP_GND_IRVISNIR ! Top and + ! Ground radiative FLUXes +REAL, DIMENSION(:,:), ALLOCATABLE :: ZFLUX_SW_DOWN ! DowNward SW Flux profiles +REAL, DIMENSION(:,:), ALLOCATABLE :: ZFLUX_SW_UP ! UPward SW Flux profiles +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZFLUX_LW ! LW Flux profiles +REAL, DIMENSION(:,:), ALLOCATABLE :: ZDTLW_CS ! LW Clear-Sky temp. tendency +REAL, DIMENSION(:,:), ALLOCATABLE :: ZDTSW_CS ! SW Clear-Sky temp. tendency +REAL, DIMENSION(:,:), ALLOCATABLE :: ZFLUX_TOP_GND_IRVISNIR_CS ! Top and + ! Ground Clear-Sky radiative FLUXes +REAL, DIMENSION(:,:), ALLOCATABLE :: ZSFSWDIR !surface SW direct flux +REAL, DIMENSION(:,:), ALLOCATABLE :: ZSFSWDIF !surface SW diffuse flux + +REAL, DIMENSION(:), ALLOCATABLE :: ZPLAN_ALB_VIS, ZPLAN_ALB_NIR + ! PLANetary ALBedo in VISible, Near-InfraRed regions +REAL, DIMENSION(:), ALLOCATABLE :: ZPLAN_TRA_VIS, ZPLAN_TRA_NIR + ! PLANetary TRANsmission in VISible, Near-InfraRed regions +REAL, DIMENSION(:), ALLOCATABLE :: ZPLAN_ABS_VIS, ZPLAN_ABS_NIR + ! PLANetary ABSorption in VISible, Near-InfraRed regions +REAL, DIMENSION(:,:), ALLOCATABLE :: ZEFCL_LWD, ZEFCL_LWU + ! EFective DOWNward and UPward LW nebulosity (equivalent emissivities) + ! undefined if RRTM is used for LW +REAL, DIMENSION(:,:), ALLOCATABLE :: ZFLWP, ZFIWP + ! Liquid and Ice Water Path +REAL, DIMENSION(:,:), ALLOCATABLE :: ZRADLP, ZRADIP + ! Cloud liquid water and ice effective radius +REAL, DIMENSION(:,:), ALLOCATABLE :: ZEFCL_RRTM, ZCLSW_TOTAL + ! effective LW nebulosity ( RRTM case) + ! and SW CLoud fraction for mixed phase clouds +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTAU_TOTAL, ZOMEGA_TOTAL, ZCG_TOTAL + ! effective optical thickness, single scattering albedo + ! and asymetry factor for mixed phase clouds +REAL, DIMENSION(:,:), ALLOCATABLE :: ZFLUX_SW_DOWN_CS, ZFLUX_SW_UP_CS + ! Clear-Sky DowNward and UPward SW Flux profiles +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZFLUX_LW_CS + ! Thicknes of the mesh +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZDZ +! +REAL, DIMENSION(KDLON,KFLEV) :: ZZDTSW ! SW diabatic heating +REAL, DIMENSION(KDLON,KFLEV) :: ZZDTLW ! LW diabatic heating +REAL, DIMENSION(KDLON) :: ZZTGVIS! SW surface flux in the VIS band +REAL, DIMENSION(KDLON) :: ZZTGNIR! SW surface flux in the NIR band +REAL, DIMENSION(KDLON) :: ZZTGIR ! LW surface flux in the IR bands +REAL, DIMENSION(KDLON,SIZE(PSRFSWD_DIR,3)) :: ZZSFSWDIR +! ! SW direct surface flux +REAL, DIMENSION(KDLON,SIZE(PSRFSWD_DIR,3)) :: ZZSFSWDIF +! ! SW diffuse surface flux +! +REAL, DIMENSION(KDLON) :: ZCLOUD ! vertically summed cloud fraction +! +REAL, DIMENSION(SIZE(PTHT,1),SIZE(PTHT,2),SIZE(PTHT,3)) :: ZEXNT ! Exner function +REAL, DIMENSION(SIZE(PTHT,1),SIZE(PTHT,2)) :: ZLWD ! surface Downward LW flux +REAL, DIMENSION(SIZE(PTHT,1),SIZE(PTHT,2),SIZE(PSRFSWD_DIR,3)) :: ZSWDDIR ! surface +REAL, DIMENSION(SIZE(PTHT,1),SIZE(PTHT,2),SIZE(PSRFSWD_DIR,3)) :: ZSWDDIF ! surface Downward SW diffuse flux +REAL, DIMENSION(SIZE(PTHT,1),SIZE(PTHT,2),SIZE(PTHT,3),KSWB_OLD) :: ZPIZAZ ! Aerosols SSA +REAL, DIMENSION(SIZE(PTHT,1),SIZE(PTHT,2),SIZE(PTHT,3),KSWB_OLD) :: ZTAUAZ ! Aerosols Optical Detph +REAL, DIMENSION(SIZE(PTHT,1),SIZE(PTHT,2),SIZE(PTHT,3),KSWB_OLD) :: ZCGAZ ! Aerosols Asymetric factor +REAL :: ZZTGVISC ! downward surface SW flux (VIS band) for clear_sky +REAL :: ZZTGNIRC ! downward surface SW flux (NIR band) for clear_sky +REAL :: ZZTGIRC ! downward surface LW flux for clear_sky +REAL, DIMENSION(SIZE(PSRFSWD_DIR,3)) :: ZZSFSWDIRC +! ! downward surface SW direct flux for clear sky +REAL, DIMENSION(SIZE(PSRFSWD_DIR,3)) :: ZZSFSWDIFC +! ! downward surface SW diffuse flux for clear sky +REAL, DIMENSION(KFLEV) :: ZT_CLEAR ! ensemble mean clear-sky temperature +REAL, DIMENSION(KFLEV) :: ZP_CLEAR ! ensemble mean clear-sky temperature +REAL, DIMENSION(KFLEV) :: ZQV_CLEAR ! ensemble mean clear-sky specific humidity +REAL, DIMENSION(KFLEV) :: ZOZ_CLEAR ! ensemble mean clear-sky ozone +REAL, DIMENSION(KFLEV) :: ZHP_CLEAR ! ensemble mean clear-sky half-lev. pression +REAL, DIMENSION(KFLEV) :: ZHT_CLEAR ! ensemble mean clear-sky half-lev. temp. +REAL, DIMENSION(KFLEV) :: ZDP_CLEAR ! ensemble mean clear-sky pressure thickness +REAL, DIMENSION(KFLEV,KAER) :: ZAER_CLEAR ! ensemble mean clear-sky aerosols optical thickness +REAL, DIMENSION(KSWB_MNH) :: ZALBP_CLEAR ! ensemble mean clear-sky surface albedo (parallel) +REAL, DIMENSION(KSWB_MNH) :: ZALBD_CLEAR ! ensemble mean clear-sky surface albedo (diffuse) +REAL :: ZEMIS_CLEAR ! ensemble mean clear-sky surface emissivity +REAL :: ZEMIW_CLEAR ! ensemble mean clear-sky LW window +REAL :: ZRMU0_CLEAR ! ensemble mean clear-sky MU0 +REAL :: ZTS_CLEAR ! ensemble mean clear-sky surface temperature. +REAL :: ZLSM_CLEAR ! ensemble mean clear-sky land sea-mask +REAL :: ZLAT_CLEAR,ZLON_CLEAR +! +!work arrays +REAL, DIMENSION(:), ALLOCATABLE :: ZWORK1, ZWORK2, ZWORK3, ZWORK +REAL, DIMENSION(:,:), ALLOCATABLE :: ZWORK4, ZWORK1AER, ZWORK2AER, ZWORK_GRID +LOGICAL, DIMENSION(SIZE(PTHT,1),SIZE(PTHT,2)) :: ZWORKL +! +! split arrays used to split the memory required by the ECMWF_radiation +! subroutine, the fields have the same meaning as their complete counterpart +! +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZALBP_SPLIT, ZALBD_SPLIT +REAL(KIND=JPRB), DIMENSION(:), ALLOCATABLE :: ZEMIS_SPLIT, ZEMIW_SPLIT +REAL(KIND=JPRB), DIMENSION(:), ALLOCATABLE :: ZRMU0_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZCFAVE_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZO3AVE_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZT_HL_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZPRES_HL_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZTAVE_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZPAVE_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:,:), ALLOCATABLE :: ZAER_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZDPRES_SPLIT +REAL(KIND=JPRB), DIMENSION(:), ALLOCATABLE :: ZLSM_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZQVAVE_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZQSAVE_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZQLAVE_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZQIAVE_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZQRAVE_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZQRWC_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZQLWC_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZQIWC_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZDZ_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZCCT_C2R2_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZCRT_C2R2_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZCIT_C1R3_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZCCT_LIMA_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZCRT_LIMA_SPLIT +REAL(KIND=JPRB), DIMENSION(:,:), ALLOCATABLE :: ZCIT_LIMA_SPLIT +REAL(KIND=JPRB), DIMENSION(:), ALLOCATABLE :: ZTS_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZSFSWDIR_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZSFSWDIF_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZNFLW_CS_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZNFLW_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZNFSW_CS_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZNFSW_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZDTLW_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZDTSW_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZFLUX_TOP_GND_IRVISNIR_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZFLUX_SW_DOWN_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZFLUX_SW_UP_SPLIT +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZFLUX_LW_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZDTLW_CS_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZDTSW_CS_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZFLUX_TOP_GND_IRVISNIR_CS_SPLIT +REAL, DIMENSION(:), ALLOCATABLE :: ZPLAN_ALB_VIS_SPLIT +REAL, DIMENSION(:), ALLOCATABLE :: ZPLAN_ALB_NIR_SPLIT +REAL, DIMENSION(:), ALLOCATABLE :: ZPLAN_TRA_VIS_SPLIT +REAL, DIMENSION(:), ALLOCATABLE :: ZPLAN_TRA_NIR_SPLIT +REAL, DIMENSION(:), ALLOCATABLE :: ZPLAN_ABS_VIS_SPLIT +REAL, DIMENSION(:), ALLOCATABLE :: ZPLAN_ABS_NIR_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZEFCL_LWD_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZEFCL_LWU_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZFLWP_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZFIWP_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZRADLP_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZRADIP_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZEFCL_RRTM_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZCLSW_TOTAL_SPLIT +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTAU_TOTAL_SPLIT +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZOMEGA_TOTAL_SPLIT +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZCG_TOTAL_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZFLUX_SW_DOWN_CS_SPLIT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZFLUX_SW_UP_CS_SPLIT +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZFLUX_LW_CS_SPLIT +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZPIZA_EQ_TMP !Single scattering albedo of aerosols (lon,lat,lev,wvl) +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZIR !Real part of the aerosol refractive index(lon,lat,lev,wvl) +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZII !Imaginary part of the aerosol refractive index (lon,lat,lev,wvl) +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZCGA_EQ_TMP !Assymetry factor aerosols (lon,lat,lev,wvl) +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZTAUREL_EQ_TMP !tau/tau_{550} aerosols (lon,lat,lev,wvl) +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZPIZA_DST_TMP !Single scattering albedo of dust (lon,lat,lev,wvl) +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZCGA_DST_TMP !Assymetry factor dust (lon,lat,lev,wvl) +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZTAUREL_DST_TMP !tau/tau_{550} dust (lon,lat,lev,wvl) +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZPIZA_AER_TMP !Single scattering albedo of aerosol from ORILAM (lon,lat,lev,wvl) +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZCGA_AER_TMP !Assymetry factor aerosol from ORILAM (lon,lat,lev,wvl) +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZTAUREL_AER_TMP !tau/tau_{550} aerosol from ORILAM (lon,lat,lev,wvl) +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZPIZA_SLT_TMP !Single scattering albedo of sea salt (lon,lat,lev,wvl) +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZCGA_SLT_TMP !Assymetry factor of sea salt (lon,lat,lev,wvl) +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZTAUREL_SLT_TMP !tau/tau_{550} of sea salt (lon,lat,lev,wvl) +REAL, DIMENSION(:,:,:), ALLOCATABLE :: PAER_AER !tau/tau_{550} aerosol from ORILAM (lon,lat,lev,wvl) +REAL, DIMENSION(:,:,:), ALLOCATABLE :: PAER_SLT !tau/tau_{550} sea salt (lon,lat,lev,wvl) +REAL, DIMENSION(:,:,:), ALLOCATABLE :: PAER_DST !tau/tau_{550} dust (lon,lat,lev,wvl) +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTAU550_EQ_TMP !tau/tau_{550} aerosols (lon,lat,lev,wvl) +REAL(KIND=JPRB), DIMENSION(:,:,:), ALLOCATABLE :: ZPIZA_EQ !Single scattering albedo of aerosols (points,lev,wvl) +REAL(KIND=JPRB), DIMENSION(:,:,:), ALLOCATABLE :: ZCGA_EQ !Assymetry factor aerosols (points,lev,wvl) +REAL(KIND=JPRB), DIMENSION(:,:,:), ALLOCATABLE :: ZTAUREL_EQ !tau/tau_{550} aerosols (points,lev,wvl) +REAL(KIND=JPRB), DIMENSION(:,:,:), ALLOCATABLE :: ZPIZA_EQ_SPLIT !Single scattering albedo of aerosols (points,lev,wvl) +REAL(KIND=JPRB), DIMENSION(:,:,:), ALLOCATABLE :: ZCGA_EQ_SPLIT !Assymetry factor aerosols (points,lev,wvl) +REAL(KIND=JPRB), DIMENSION(:,:,:), ALLOCATABLE :: ZTAUREL_EQ_SPLIT !tau/tau_{550} aerosols (points,lev,wvl) +REAL, DIMENSION(KFLEV,KSWB_OLD) :: ZPIZA_EQ_CLEAR !Single scattering albedo of aerosols (lev,wvl) +REAL, DIMENSION(KFLEV,KSWB_OLD) :: ZCGA_EQ_CLEAR !Assymetry factor aerosols (lev,wvl) +REAL, DIMENSION(KFLEV,KSWB_OLD) :: ZTAUREL_EQ_CLEAR !tau/tau_{550} aerosols (lev,wvl) +INTEGER :: WVL_IDX !Counter for wavelength + +! +INTEGER :: JI_SPLIT ! loop on the split array +INTEGER :: INUM_CALL ! number of CALL of the radiation scheme +INTEGER :: IDIM_EFF ! effective number of air-columns to compute +INTEGER :: IDIM_RESIDUE ! number of remaining air-columns to compute +INTEGER :: IBEG, IEND ! auxiliary indices +! +! +REAL, DIMENSION(SIZE(PDTHRAD,1),SIZE(PDTHRAD,2),SIZE(PDTHRAD,3)) & + :: ZDTRAD_LW! LW temperature tendency +REAL, DIMENSION(SIZE(PDTHRAD,1),SIZE(PDTHRAD,2),SIZE(PDTHRAD,3)) & + :: ZDTRAD_SW! SW temperature tendency +INTEGER :: ILUOUT ! Logical unit number for output-listing +INTEGER :: IRESP ! Return code of FM routines +REAL, DIMENSION(SIZE(PDTHRAD,1),SIZE(PDTHRAD,2),SIZE(PDTHRAD,3)) & + :: ZSTORE_3D, ZSTORE_3D2! 3D work array for storage +REAL, DIMENSION(SIZE(PDTHRAD,1),SIZE(PDTHRAD,2)) & + :: ZSTORE_2D ! 2D work array for storage! +INTEGER :: JBAND ! Solar band index +CHARACTER (LEN=4), DIMENSION(KSWB_OLD) :: YBAND_NAME ! Solar band name +CHARACTER (LEN=2) :: YDIR ! Type of the data field +! +INTEGER :: ISWB ! number of SW spectral bands (between radiations and surface schemes) +INTEGER :: JSWB ! loop on SW spectral bands +INTEGER :: JAE ! loop on aerosol class +TYPE(TFIELDDATA) :: TZFIELD +! +REAL, DIMENSION(SIZE(PTHT,1),SIZE(PTHT,2),SIZE(PTHT,3)) :: ZDZPABST +REAL :: ZMINVAL +INTEGER, DIMENSION(3) :: IMINLOC +INTEGER :: IINFO_ll +LOGICAL, DIMENSION(SIZE(PTHT,1),SIZE(PTHT,2)) :: GCLOUD_SURF +! +REAL(KIND=JPRB), DIMENSION(:), ALLOCATABLE :: ZLON,ZLAT +REAL(KIND=JPRB), DIMENSION(:), ALLOCATABLE :: ZLON_SPLIT,ZLAT_SPLIT +! +INTEGER :: ICLEAR_COL_ll +INTEGER, DIMENSION(:), ALLOCATABLE :: INDEX_ICLEAR_COL +REAL, DIMENSION(KFLEV) :: ZT_CLEAR_DD ! ensemble mean clear-sky temperature +REAL :: ZCLEAR_COL_ll , ZDLON_ll +!------------------------------------------------------------------------- +!------------------------------------------------------------------------- +!------------------------------------------------------------------------- +! +!* 1. COMPUTE DIMENSIONS OF ARRAYS AND OTHER INDICES +! ---------------------------------------------- +! +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) ! this definition must be coherent with + ! the one used in ini_radiations routine +IKU = SIZE(PTHT,3) +IKB = 1 + JPVEXT +IKE = IKU - JPVEXT +! +IKSTAE = SIZE(PSTATM,1) +IKUP = IKE-JPVEXT+1 +! +ISWB = SIZE(PSRFSWD_DIR,3) +! +!------------------------------------------------------------------------------- +!* 1.1 CHECK PRESSURE DECREASING +! ------------------------- +ZDZPABST(:,:,1:IKU-1) = PPABST(:,:,1:IKU-1) - PPABST(:,:,2:IKU) +ZDZPABST(:,:,IKU) = ZDZPABST(:,:,IKU-1) +! +ZMINVAL=MIN_ll(ZDZPABST,IINFO_ll) +! +IF ( ZMINVAL <= 0.0 ) THEN + ILUOUT = TLUOUT%NLU + IMINLOC=GMINLOC_ll( ZDZPABST ) + WRITE(ILUOUT,*) ' radiation.f90 STOP :: SOMETHING WRONG WITH PRESSURE , ZDZPABST <= 0.0 ' + WRITE(ILUOUT,*) ' radiation :: ZDZPABST ', ZMINVAL,' located at ', IMINLOC + FLUSH(unit=ILUOUT) + call Print_msg( NVERB_FATAL, 'GEN', 'RADIATIONS', 'something wrong with pressure: ZDZPABST <= 0.0' ) + +ENDIF +!------------------------------------------------------------------------------ +ALLOCATE(ZLAT(KDLON)) +ALLOCATE(ZLON(KDLON)) +IF(LCARTESIAN) THEN + ZLAT(:) = XLAT0*(XPI/180.) + ZLON(:) = XLON0*(XPI/180.) +ELSE + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZLAT(IIJ) = XLAT(JI,JJ)*(XPI/180.) + ZLON(IIJ) = XLON(JI,JJ)*(XPI/180.) + END DO + END DO +END IF +!------------------------------------------------------------------------------- +! +!* 2. INITIALIZES THE MEAN-LAYER VARIABLES +! ------------------------------------ +! +ZEXNT(:,:,:)= ( PPABST(:,:,:)/XP00 ) ** (XRD/XCPD) +! +! Columns where radiation is computed are put on a single line +ALLOCATE(ZTAVE(KDLON,KFLEV)) +ALLOCATE(ZQVAVE(KDLON,KFLEV)) +ALLOCATE(ZQLAVE(KDLON,KFLEV)) +ALLOCATE(ZQIAVE(KDLON,KFLEV)) +ALLOCATE(ZCFAVE(KDLON,KFLEV)) +ALLOCATE(ZQRAVE(KDLON,KFLEV)) +ALLOCATE(ZQLWC(KDLON,KFLEV)) +ALLOCATE(ZQIWC(KDLON,KFLEV)) +ALLOCATE(ZQRWC(KDLON,KFLEV)) +ALLOCATE(ZDZ(KDLON,KFLEV)) +! +ZQVAVE(:,:) = 0.0 +ZQLAVE(:,:) = 0.0 +ZQIAVE(:,:) = 0.0 +ZQRAVE(:,:) = 0.0 +ZCFAVE(:,:) = 0.0 +ZQLWC(:,:) = 0.0 +ZQIWC(:,:) = 0.0 +ZQRWC(:,:) = 0.0 +ZDZ(:,:)=0.0 +! +!COMPUTE THE MESH SIZE +DO JK=IKB,IKE + JKRAD = JK-JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZDZ(IIJ,JKRAD) = PZZ(JI,JJ,JK+1) - PZZ(JI,JJ,JK) + ZTAVE(IIJ,JKRAD) = PTHT(JI,JJ,JK)*ZEXNT(JI,JJ,JK) ! Conversion potential temperature -> actual temperature + END DO + END DO +END DO +! +! Check if the humidity mixing ratio is available +! +IF( SIZE(PRT(:,:,:,:),4) >= 1 ) THEN + DO JK=IKB,IKE + JKRAD = JK-JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZQVAVE(IIJ,JKRAD) =MAX(0., PRT(JI,JJ,JK,1)) + END DO + END DO + END DO +END IF +! +! Check if the cloudwater mixing ratio is available +! +IF( SIZE(PRT(:,:,:,:),4) >= 2 ) THEN + DO JK=IKB,IKE + JKRAD = JK-JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZQLAVE(IIJ,JKRAD) = MAX(0.,PRT(JI,JJ,JK,2)) + ZQLWC(IIJ,JKRAD) = MAX(0.,PRT(JI,JJ,JK,2)*PRHODREF(JI,JJ,JK)) + ZCFAVE(IIJ,JKRAD) = PCLDFR(JI,JJ,JK) + END DO + END DO + END DO +END IF +! +! Check if the rainwater mixing ratio is available +! +IF( SIZE(PRT(:,:,:,:),4) >= 3 ) THEN + DO JK=IKB,IKE + JKRAD = JK-JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZQRWC(IIJ,JKRAD) = MAX(0.,PRT(JI,JJ,JK,3)*PRHODREF(JI,JJ,JK)) + ZQRAVE(IIJ,JKRAD) = MAX(0.,PRT(JI,JJ,JK,3)) + END DO + END DO + END DO +END IF +! +! Check if the cloudice mixing ratio is available +! +IF( SIZE(PRT(:,:,:,:),4) >= 4 ) THEN + DO JK=IKB,IKE + JKRAD = JK-JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZQIWC(IIJ,JKRAD) = MAX(0.,PRT(JI,JJ,JK,4)*PRHODREF(JI,JJ,JK)) +! ZQIAVE(IIJ,JKRAD) = MAX( PRT(JI,JJ,JK,4)-XRTMIN(4),0.0 ) + ZQIAVE(IIJ,JKRAD) = MAX( PRT(JI,JJ,JK,4),0.0 ) + END DO + END DO + END DO +END IF +! +! Standard atmosphere extension +! +DO JK=IKUP,KFLEV + JK1 = (KSTATM-1)+(JK-IKUP) + JK2 = JK1+1 + ZTAVE(:,JK) = 0.5*( PSTATM(JK1,3)+PSTATM(JK2,3) ) + ZQVAVE(:,JK) = 0.5*( PSTATM(JK1,5)/PSTATM(JK1,4)+ & + PSTATM(JK2,5)/PSTATM(JK2,4) ) +END DO +! +! 2.1 pronostic water concentation fields (C2R2 coupling) +! +IF( NSV_C2R2 /= 0 ) THEN + ALLOCATE (ZCCT_C2R2(KDLON, KFLEV)) + ALLOCATE (ZCRT_C2R2(KDLON, KFLEV)) + ZCCT_C2R2(:, :) = 0. + ZCRT_C2R2 (:,:) = 0. + DO JK=IKB,IKE + JKRAD = JK-JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZCCT_C2R2 (IIJ,JKRAD) = MAX(0.,PSVT(JI,JJ,JK,NSV_C2R2BEG+1)) + ZCRT_C2R2 (IIJ,JKRAD) = MAX(0.,PSVT(JI,JJ,JK,NSV_C2R2BEG+2)) + END DO + END DO + END DO +ELSE + ALLOCATE (ZCCT_C2R2(0,0)) + ALLOCATE (ZCRT_C2R2(0,0)) +END IF +! +IF( NSV_C1R3 /= 0 ) THEN + ALLOCATE (ZCIT_C1R3(KDLON, KFLEV)) + ZCIT_C1R3 (:,:) = 0. + DO JK=IKB,IKE + JKRAD = JK-JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZCIT_C1R3 (IIJ,JKRAD) = MAX(0.,PSVT(JI,JJ,JK,NSV_C1R3BEG)) + END DO + END DO + END DO +ELSE + ALLOCATE (ZCIT_C1R3(0,0)) +END IF +! +! +! 2.1*bis pronostic water concentation fields (LIMA coupling) +! +IF( CCLOUD == 'LIMA' ) THEN + ALLOCATE (ZCCT_LIMA(KDLON, KFLEV)) + ALLOCATE (ZCRT_LIMA(KDLON, KFLEV)) + ALLOCATE (ZCIT_LIMA(KDLON, KFLEV)) + ZCCT_LIMA(:, :) = 0. + ZCRT_LIMA (:,:) = 0. + ZCIT_LIMA (:,:) = 0. + DO JK=IKB,IKE + JKRAD = JK-JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + IF (LWARM .AND. NSV_LIMA_NC.GT.0) ZCCT_LIMA(IIJ,JKRAD) = MAX(0.,PSVT(JI,JJ,JK,NSV_LIMA_NC)) + IF (LWARM .AND. LRAIN .AND. NSV_LIMA_NR.GT.0) ZCRT_LIMA(IIJ,JKRAD) = MAX(0.,PSVT(JI,JJ,JK,NSV_LIMA_NR)) + IF (LCOLD .AND. NSV_LIMA_NI.GT.0) ZCIT_LIMA(IIJ,JKRAD) = MAX(0.,PSVT(JI,JJ,JK,NSV_LIMA_NI)) + END DO + END DO + END DO +END IF +! +!------------------------------------------------------------------------------- +! +!* 3. INITIALIZES THE HALF-LEVEL VARIABLES +! ------------------------------------ +! +ALLOCATE(ZPRES_HL(KDLON,KFLEV+1)) +ALLOCATE(ZT_HL(KDLON,KFLEV+1)) +! +DO JK=IKB,IKE+1 + JKRAD = JK-JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZPRES_HL(IIJ,JKRAD) = XP00 * (0.5*(ZEXNT(JI,JJ,JK)+ZEXNT(JI,JJ,JK-1)))**(XCPD/XRD) + END DO + END DO +END DO + +! Standard atmosphere extension - pressure +!* begining at ikup+1 level allows to use a model domain higher than 50km +! +DO JK=IKUP+1,KFLEV+1 + JK1 = (KSTATM-1)+(JK-IKUP) + ZPRES_HL(:,JK) = PSTATM(JK1,2)*100.0 ! mb -> Pa +END DO +! +! Surface temperature at the first level +! and surface radiative temperature +ALLOCATE(ZTS(KDLON)) +! +DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZT_HL(IIJ,1) = PTSRAD(JI,JJ) + ZTS(IIJ) = PTSRAD(JI,JJ) + END DO +END DO +! +! Temperature at half levels +! +ZT_HL(:,2:IKE-JPVEXT) = 0.5*(ZTAVE(:,1:IKE-JPVEXT-1)+ZTAVE(:,2:IKE-JPVEXT)) +! +DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZT_HL(IIJ,IKE-JPVEXT+1) = 0.5*PTHT(JI,JJ,IKE )*ZEXNT(JI,JJ,IKE ) & + + 0.5*PTHT(JI,JJ,IKE+1)*ZEXNT(JI,JJ,IKE+1) + END DO +END DO +! +! Standard atmosphere extension - temperature +!* begining at ikup+1 level allows to use a model domain higher than 50km +! +DO JK=IKUP+1,KFLEV+1 + JK1 = (KSTATM-1)+(JK-IKUP) + ZT_HL(:,JK) = PSTATM(JK1,3) +END DO +! +!mean layer pressure and layer differential pressure (from half level variables) +! +ALLOCATE(ZPAVE(KDLON,KFLEV)) +ALLOCATE(ZDPRES(KDLON,KFLEV)) +DO JKRAD=1,KFLEV + ZPAVE(:,JKRAD)=0.5*(ZPRES_HL(:,JKRAD)+ZPRES_HL(:,JKRAD+1)) + ZDPRES(:,JKRAD)=ZPRES_HL(:,JKRAD)-ZPRES_HL(:,JKRAD+1) +END DO +!----------------------------------------------------------------------- +!* 4. INITIALIZES THE AEROSOLS and OZONE PROFILES from climatology +! ------------------------------------------- +! +! 4.1 AEROSOL optical thickness +! EXPL -> defined online, otherwise climatology +IF (CAOP=='EXPL') THEN + GAOP = .TRUE. +ELSE + GAOP = .FALSE. +ENDIF +! +IF (CAOP=='EXPL') THEN + ALLOCATE(ZPIZA_EQ_TMP(SIZE(PAER,1),SIZE(PAER,2),SIZE(PAER,3),KSWB_OLD)) + ALLOCATE(ZCGA_EQ_TMP(SIZE(PAER,1),SIZE(PAER,2),SIZE(PAER,3),KSWB_OLD)) + ALLOCATE(ZTAUREL_EQ_TMP(SIZE(PAER,1),SIZE(PAER,2),SIZE(PAER,3),KSWB_OLD)) + + ALLOCATE(ZPIZA_DST_TMP(SIZE(PAER,1),SIZE(PAER,2),SIZE(PAER,3),KSWB_OLD)) + ALLOCATE(ZCGA_DST_TMP(SIZE(PAER,1),SIZE(PAER,2),SIZE(PAER,3),KSWB_OLD)) + ALLOCATE(ZTAUREL_DST_TMP(SIZE(PAER,1),SIZE(PAER,2),SIZE(PAER,3),KSWB_OLD)) + ALLOCATE(PAER_DST(SIZE(PAER,1),SIZE(PAER,2),SIZE(PAER,3))) + + ALLOCATE(ZPIZA_AER_TMP(SIZE(PAER,1),SIZE(PAER,2),SIZE(PAER,3),KSWB_OLD)) + ALLOCATE(ZCGA_AER_TMP(SIZE(PAER,1),SIZE(PAER,2),SIZE(PAER,3),KSWB_OLD)) + ALLOCATE(ZTAUREL_AER_TMP(SIZE(PAER,1),SIZE(PAER,2),SIZE(PAER,3),KSWB_OLD)) + ALLOCATE(PAER_AER(SIZE(PAER,1),SIZE(PAER,2),SIZE(PAER,3))) + + ALLOCATE(ZPIZA_SLT_TMP(SIZE(PAER,1),SIZE(PAER,2),SIZE(PAER,3),KSWB_OLD)) + ALLOCATE(ZCGA_SLT_TMP(SIZE(PAER,1),SIZE(PAER,2),SIZE(PAER,3),KSWB_OLD)) + ALLOCATE(ZTAUREL_SLT_TMP(SIZE(PAER,1),SIZE(PAER,2),SIZE(PAER,3),KSWB_OLD)) + ALLOCATE(PAER_SLT(SIZE(PAER,1),SIZE(PAER,2),SIZE(PAER,3))) + + + ALLOCATE(ZII(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3),KSWB_OLD)) + ALLOCATE(ZIR(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3),KSWB_OLD)) + + ZPIZA_EQ_TMP = 0. + ZCGA_EQ_TMP = 0. + ZTAUREL_EQ_TMP = 0. + + ZPIZA_DST_TMP = 0. + ZCGA_DST_TMP = 0. + ZTAUREL_DST_TMP = 0 + + ZPIZA_SLT_TMP = 0. + ZCGA_SLT_TMP = 0. + ZTAUREL_SLT_TMP = 0 + + ZPIZA_AER_TMP = 0. + ZCGA_AER_TMP = 0. + ZTAUREL_AER_TMP = 0 + + PAER_DST=0. + PAER_SLT=0. + PAER_AER=0. + + IF (LORILAM) THEN + CALL AEROOPT_GET( & + PSVT(IIB:IIE,IJB:IJE,:,NSV_AERBEG:NSV_AEREND) & !I [ppp] aerosols concentration + ,PZZ(IIB:IIE,IJB:IJE,:) & !I [m] height of layers + ,PRHODREF(IIB:IIE,IJB:IJE,:) & !I [kg/m3] density of air + ,ZPIZA_AER_TMP(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,:) & !O [-] single scattering albedo of aerosols + ,ZCGA_AER_TMP(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,:) & !O [-] assymetry factor for aerosols + ,ZTAUREL_AER_TMP(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,:) & !O [-] opt.depth(wvl=lambda)/opt.depth(wvl=550nm) + ,PAER_AER(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT) & !O [-] optical depth of aerosols at wvl=550nm + ,KSWB_OLD & !I |nbr] number of shortwave bands + ,ZIR(IIB:IIE,IJB:IJE,:,:) & !O [-] opt.depth(wvl=lambda)/opt.depth(wvl=550nm) + ,ZII(IIB:IIE,IJB:IJE,:,:) & !O [-] opt.depth(wvl=lambda)/opt.depth(wvl=550nm) + ) + ENDIF + IF(LDUST) THEN + CALL DUSTOPT_GET( & + PSVT(IIB:IIE,IJB:IJE,:,NSV_DSTBEG:NSV_DSTEND) & !I [ppp] Dust scalar concentration + ,PZZ(IIB:IIE,IJB:IJE,:) & !I [m] height of layers + ,PRHODREF(IIB:IIE,IJB:IJE,:) & !I [kg/m3] density of air + ,ZPIZA_DST_TMP(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,:) & !O [-] single scattering albedo of dust + ,ZCGA_DST_TMP(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,:) & !O [-] assymetry factor for dust + ,ZTAUREL_DST_TMP(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,:) & !O [-] opt.depth(wvl=lambda)/opt.depth(wvl=550nm) + ,PAER_DST(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT) & !O [-] optical depth of dust at wvl=550nm + ,KSWB_OLD & !I |nbr] number of shortwave bands + ) + DO WVL_IDX=1,KSWB_OLD + PDST_WL(:,:,:,WVL_IDX) = ZTAUREL_DST_TMP(:,:,:,WVL_IDX)* PAER(:,:,:,3) + ENDDO + ENDIF + IF(LSALT) THEN + CALL SALTOPT_GET( & + PSVT(IIB:IIE,IJB:IJE,:,NSV_SLTBEG:NSV_SLTEND) & !I [ppp] sea salt scalar concentration + ,PZZ(IIB:IIE,IJB:IJE,:) & !I [m] height of layers + ,PRHODREF(IIB:IIE,IJB:IJE,:) & !I [kg/m3] density of air + ,PTHT(IIB:IIE,IJB:IJE,:) & !I [K] potential temperature + ,PPABST(IIB:IIE,IJB:IJE,:) & !I [hPa] pressure + ,PRT(IIB:IIE,IJB:IJE,:,:) & !I [kg/kg] water mixing ratio + ,ZPIZA_SLT_TMP(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,:) & !O [-] single scattering albedo of sea salt + ,ZCGA_SLT_TMP(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,:) & !O [-] assymetry factor for sea salt + ,ZTAUREL_SLT_TMP(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,:) & !O [-] opt.depth(wvl=lambda)/opt.depth(wvl=550nm) + ,PAER_SLT(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT) & !O [-] optical depth of sea salt at wvl=550nm + ,KSWB_OLD & !I |nbr] number of shortwave bands + ) + ENDIF + + ZTAUREL_EQ_TMP(:,:,:,:)=ZTAUREL_DST_TMP(:,:,:,:)+ZTAUREL_AER_TMP(:,:,:,:)+ZTAUREL_SLT_TMP(:,:,:,:) + + PAER(:,:,:,2)=PAER_SLT(:,:,:) + PAER(:,:,:,3)=PAER_DST(:,:,:) + PAER(:,:,:,4)=PAER_AER(:,:,:) + + + WHERE (ZTAUREL_EQ_TMP(:,:,:,:).GT.0.0) + ZPIZA_EQ_TMP(:,:,:,:)=(ZPIZA_DST_TMP(:,:,:,:)*ZTAUREL_DST_TMP(:,:,:,:)+& + ZPIZA_AER_TMP(:,:,:,:)*ZTAUREL_AER_TMP(:,:,:,:)+& + ZPIZA_SLT_TMP(:,:,:,:)*ZTAUREL_SLT_TMP(:,:,:,:))/& + ZTAUREL_EQ_TMP(:,:,:,:) + END WHERE + WHERE ((ZTAUREL_EQ_TMP(:,:,:,:).GT.0.0).AND.(ZPIZA_EQ_TMP(:,:,:,:).GT.0.0)) + ZCGA_EQ_TMP(:,:,:,:)=(ZPIZA_DST_TMP(:,:,:,:)*ZTAUREL_DST_TMP(:,:,:,:)*ZCGA_DST_TMP(:,:,:,:)+& + ZPIZA_AER_TMP(:,:,:,:)*ZTAUREL_AER_TMP(:,:,:,:)*ZCGA_AER_TMP(:,:,:,:)+& + ZPIZA_SLT_TMP(:,:,:,:)*ZTAUREL_SLT_TMP(:,:,:,:)*ZCGA_SLT_TMP(:,:,:,:))/& + (ZTAUREL_EQ_TMP(:,:,:,:)*ZPIZA_EQ_TMP(:,:,:,:)) + END WHERE + + ZTAUREL_EQ_TMP(:,:,:,:)=max(1.E-8,ZTAUREL_EQ_TMP(:,:,:,:)) + ZCGA_EQ_TMP(:,:,:,:)=max(1.E-8,ZCGA_EQ_TMP(:,:,:,:)) + ZPIZA_EQ_TMP(:,:,:,:)=max(1.E-8,ZPIZA_EQ_TMP(:,:,:,:)) + PAER(:,:,:,3)=max(1.E-8,PAER(:,:,:,3)) + ZPIZA_EQ_TMP(:,:,:,:)=min(0.99,ZPIZA_EQ_TMP(:,:,:,:)) + + +ENDIF +! +! Computes SSA, optical depth and assymetry factor for clear sky (aerosols) +ZTAUAZ(:,:,:,:) = 0. +ZPIZAZ(:,:,:,:) = 0. +ZCGAZ(:,:,:,:) = 0. +DO WVL_IDX=1,KSWB_OLD + DO JAE=1,KAER + !Special optical properties for dust + IF (CAOP=='EXPL'.AND.(JAE==3)) THEN + !Ponderation of aerosol optical in case of explicit optical factor + !ti + ZTAUAZ(IIB:IIE,IJB:IJE,IKB:IKE,WVL_IDX)= ZTAUAZ(IIB:IIE,IJB:IJE,IKB:IKE,WVL_IDX) + & + PAER(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,JAE) * & + ZTAUREL_EQ_TMP(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,WVL_IDX) + !wi*ti + ZPIZAZ(IIB:IIE,IJB:IJE,IKB:IKE,WVL_IDX)= ZPIZAZ(IIB:IIE,IJB:IJE,IKB:IKE,WVL_IDX) + & + PAER(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,JAE) * & + ZTAUREL_EQ_TMP(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,WVL_IDX) * & + ZPIZA_EQ_TMP(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,WVL_IDX) + !wi*ti*gi + ZCGAZ(IIB:IIE,IJB:IJE,IKB:IKE,WVL_IDX) = ZCGAZ(IIB:IIE,IJB:IJE,IKB:IKE,WVL_IDX) + & + PAER(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,JAE) * & + ZTAUREL_EQ_TMP(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,WVL_IDX) * & + ZPIZA_EQ_TMP(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,WVL_IDX) * & + ZCGA_EQ_TMP(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,WVL_IDX) + ELSE + + !Ponderation of aerosol optical properties + !ti + ZTAUAZ(IIB:IIE,IJB:IJE,IKB:IKE,WVL_IDX)=ZTAUAZ(IIB:IIE,IJB:IJE,IKB:IKE,WVL_IDX)+& + PAER(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,JAE) * RTAUA(WVL_IDX,JAE) + !wi*ti + ZPIZAZ(IIB:IIE,IJB:IJE,IKB:IKE,WVL_IDX)=ZPIZAZ(IIB:IIE,IJB:IJE,IKB:IKE,WVL_IDX)+& + PAER(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,JAE) *& + RTAUA(WVL_IDX,JAE)*RPIZA(WVL_IDX,JAE) + !wi*ti*gi + ZCGAZ(IIB:IIE,IJB:IJE,IKB:IKE,WVL_IDX) = ZCGAZ(IIB:IIE,IJB:IJE,IKB:IKE,WVL_IDX) +& + PAER(IIB:IIE,IJB:IJE,IKB-JPVEXT:IKE-JPVEXT,JAE) *& + RTAUA(WVL_IDX,JAE)*RPIZA(WVL_IDX,JAE)*RCGA(WVL_IDX,JAE) + ENDIF + ENDDO +! assymetry factor: + +ZCGAZ(IIB:IIE,IJB:IJE,IKB:IKE,WVL_IDX) = ZCGAZ(IIB:IIE,IJB:IJE,IKB:IKE,WVL_IDX) / & + ZPIZAZ(IIB:IIE,IJB:IJE,IKB:IKE,WVL_IDX) +! SSA: +ZPIZAZ(IIB:IIE,IJB:IJE,IKB:IKE,WVL_IDX) = ZPIZAZ(IIB:IIE,IJB:IJE,IKB:IKE,WVL_IDX) / & + ZTAUAZ(IIB:IIE,IJB:IJE,IKB:IKE,WVL_IDX) +ENDDO +! + +! +ALLOCATE(ZAER(KDLON,KFLEV,KAER)) +! Aerosol classes +! 1=Continental 2=Maritime 3=Desert 4=Urban 5=Volcanic 6=Stratos.Bckgnd +! Loaded from climatology +DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZAER (IIJ,:,:) = PAER_CLIM (JI,JJ,:,:) + END DO +END DO +IF ((CAOP=='EXPL') .AND. LDUST ) THEN + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZAER (IIJ,:,3) = PAER (JI,JJ,:,3) + END DO + END DO +END IF +IF ((CAOP=='EXPL') .AND. LSALT ) THEN + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZAER (IIJ,:,2) = PAER (JI,JJ,:,2) + END DO + END DO +END IF +IF ((CAOP=='EXPL') .AND. LORILAM ) THEN + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZAER (IIJ,:,4) = PAER (JI,JJ,:,4) + END DO + END DO +END IF +! +ALLOCATE(ZPIZA_EQ(KDLON,KFLEV,KSWB_OLD)) +ALLOCATE(ZCGA_EQ(KDLON,KFLEV,KSWB_OLD)) +ALLOCATE(ZTAUREL_EQ(KDLON,KFLEV,KSWB_OLD)) +IF(CAOP=='EXPL')THEN + !Transform from vector of type #lon #lat #lev #wvl + !to vectors of type #points, #levs, #wavelengths + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZPIZA_EQ(IIJ,:,:) = ZPIZA_EQ_TMP(JI,JJ,:,:) + ZCGA_EQ(IIJ,:,:)= ZCGA_EQ_TMP(JI,JJ,:,:) + ZTAUREL_EQ(IIJ,:,:)=ZTAUREL_EQ_TMP(JI,JJ,:,:) + END DO + END DO + DEALLOCATE(ZPIZA_EQ_TMP) + DEALLOCATE(ZCGA_EQ_TMP) + DEALLOCATE(ZTAUREL_EQ_TMP) + DEALLOCATE(ZPIZA_DST_TMP) + DEALLOCATE(ZCGA_DST_TMP) + DEALLOCATE(ZTAUREL_DST_TMP) + DEALLOCATE(ZPIZA_AER_TMP) + DEALLOCATE(ZCGA_AER_TMP) + DEALLOCATE(ZTAUREL_AER_TMP) + DEALLOCATE(ZPIZA_SLT_TMP) + DEALLOCATE(ZCGA_SLT_TMP) + DEALLOCATE(ZTAUREL_SLT_TMP) + DEALLOCATE(PAER_DST) + DEALLOCATE(PAER_AER) + DEALLOCATE(PAER_SLT) + DEALLOCATE(ZIR) + DEALLOCATE(ZII) +END IF + + +! +! 4.2 OZONE content +! +ALLOCATE(ZO3AVE(KDLON,KFLEV)) +! +DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZO3AVE(IIJ,:) = POZON (JI,JJ,:) + END DO +END DO +#ifdef MNH_ECRAD +#if ( VER_ECRAD == 140 ) +POZON = POZON +#endif +#endif +! +!------------------------------------------------------------------------------- +! +!* 5. CALLS THE E.C.M.W.F. RADIATION CODE +! ----------------------------------- +! +! +!* 5.1 INITIALIZES 2D AND SURFACE FIELDS +! +ALLOCATE(ZRMU0(KDLON)) +ALLOCATE(ZLSM(KDLON)) +! +ALLOCATE(ZALBP(KDLON,KSWB_MNH)) +ALLOCATE(ZALBD(KDLON,KSWB_MNH)) +! +ALLOCATE(ZEMIS(KDLON,KLWB_MNH)) +ALLOCATE(ZEMIW(KDLON,KLWB_MNH)) +! +DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZEMIS(IIJ,:) = PEMIS(JI,JJ,:) + ZRMU0(IIJ) = PCOSZEN(JI,JJ) + ZLSM(IIJ) = 1.0 - PSEA(JI,JJ) + END DO +END DO +! +! spectral albedo +! +IF ( SIZE(PDIR_ALB,3)==1 ) THEN + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ! sw direct and diffuse albedos + ZALBP(IIJ,:) = PDIR_ALB(JI,JJ,1) + ZALBD(IIJ,:) = PSCA_ALB(JI,JJ,1) + ! + END DO + END DO +ELSE + DO JK=1, SIZE(PDIR_ALB,3) + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ! sw direct and diffuse albedos + ZALBP(IIJ,JK) = PDIR_ALB(JI,JJ,JK) + ZALBD(IIJ,JK) = PSCA_ALB(JI,JJ,JK) + ENDDO + END DO + ENDDO +END IF +! +! +! LW emissivity +ZEMIW(:,:)= ZEMIS(:,:) +! +!solar constant +ZRII0= PCORSOL*XI0 ! solar constant multiplied by seasonal variations due to Earth-Sun distance +! +! +!* 5.2 ACCOUNTS FOR THE CLEAR-SKY APPROXIMATION +! +! Performs the horizontal average of the fields when no cloud +! +ZCLOUD(:) = SUM( ZCFAVE(:,:),DIM=2 ) ! one where no cloud on the vertical +! +! MODIF option CLLY +ALLOCATE ( ICLEAR_2D_TM1(KDLON) ) +! +DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ICLEAR_2D_TM1(IIJ) = KCLEARCOL_TM1(JI,JJ) + END DO +END DO +! +IF(OCLOUD_ONLY .OR. OCLEAR_SKY) THEN + ! + GCLEAR_2D(:) = .TRUE. + WHERE( (ZCLOUD(:) > 0.0) .OR. (ICLEAR_2D_TM1(:)==0) ) ! FALSE on cloudy columns + GCLEAR_2D(:) = .FALSE. + END WHERE + ! + ICLEAR_COL = COUNT( GCLEAR_2D(:) ) ! number of clear sky columns + ! + ALLOCATE(INDEX_ICLEAR_COL(ICLEAR_COL)) + IIJ = 0 + DO JI=1,KDLON + IF ( GCLEAR_2D(JI) ) THEN + IIJ = IIJ + 1 + INDEX_ICLEAR_COL(IIJ) = JI + END IF + END DO + + IF( ICLEAR_COL == KDLON ) THEN ! No cloud case so only the mean clear-sky +!!$ GCLEAR_2D(1) = .FALSE. ! column is selected +!!$ ICLEAR_COL = KDLON-1 + GNOCL = .TRUE. ! TRUE if no cloud at all + ELSE + GNOCL = .FALSE. + END IF + + GCLEAR(:,:) = SPREAD( GCLEAR_2D(:),DIM=2,NCOPIES=KFLEV ) ! vertical extension of clear columns 2D map + ICLOUD_COL = KDLON - ICLEAR_COL ! number of cloudy columns +! + ZCLEAR_COL_ll = REAL(ICLEAR_COL) + CALL REDUCESUM_ll(ZCLEAR_COL_ll,IINFO_ll) + !ZDLON_ll = KDLON + !CALL REDUCESUM_ll(ZDLON_ll,IINFO_ll) + + !IF (IP == 1 ) + !print*,",RADIATIOn COULD_ONLY=OCLOUD_ONLY,OCLEAR_SKY,ZCLEAR_COL_ll,ICLEAR_COL,ICLOUD_COL,KDON,ZDLON_ll,GNOCL=", & + ! OCLOUD_ONLY,OCLEAR_SKY,ZCLEAR_COL_ll,ICLEAR_COL,ICLOUD_COL,KDLON,ZDLON_ll,GNOCL +! +!!$ IF( ICLEAR_COL /=0 ) THEN ! at least one clear-sky column exists -> average profiles on clear columns + IF( ZCLEAR_COL_ll /= 0.0 ) THEN ! at least one clear-sky column exists -> average profiles on clear columns + ZT_CLEAR(:) = SUM_DD_R2_R1_ll(ZTAVE(INDEX_ICLEAR_COL(:),:)) / ZCLEAR_COL_ll + ZP_CLEAR(:) = SUM_DD_R2_R1_ll(ZPAVE(INDEX_ICLEAR_COL(:),:)) / ZCLEAR_COL_ll + ZQV_CLEAR(:) = SUM_DD_R2_R1_ll(REAL(ZQVAVE(INDEX_ICLEAR_COL(:),:))) / ZCLEAR_COL_ll + ZOZ_CLEAR(:) = SUM_DD_R2_R1_ll(REAL(ZO3AVE(INDEX_ICLEAR_COL(:),:))) / ZCLEAR_COL_ll + ZDP_CLEAR(:) = SUM_DD_R2_R1_ll(REAL(ZDPRES(INDEX_ICLEAR_COL(:),:))) / ZCLEAR_COL_ll + + DO JK1=1,KAER + ZAER_CLEAR(:,JK1) = SUM_DD_R2_R1_ll(REAL(ZAER(INDEX_ICLEAR_COL(:),:,JK1))) / ZCLEAR_COL_ll + END DO + !Get an average value for the clear column + IF(CAOP=='EXPL')THEN + DO WVL_IDX=1,KSWB_OLD + ZPIZA_EQ_CLEAR(:,WVL_IDX) = SUM_DD_R2_R1_ll(REAL(ZPIZA_EQ( INDEX_ICLEAR_COL(:),:,WVL_IDX))) / ZCLEAR_COL_ll + ZCGA_EQ_CLEAR(:,WVL_IDX) = SUM_DD_R2_R1_ll(REAL(ZCGA_EQ( INDEX_ICLEAR_COL(:),:,WVL_IDX))) / ZCLEAR_COL_ll + ZTAUREL_EQ_CLEAR(:,WVL_IDX) = SUM_DD_R2_R1_ll(REAL(ZTAUREL_EQ(INDEX_ICLEAR_COL(:),:,WVL_IDX))) / ZCLEAR_COL_ll + ENDDO + ENDIF + ! + ZHP_CLEAR(1:KFLEV) = SUM_DD_R2_R1_ll(REAL(ZPRES_HL(INDEX_ICLEAR_COL(:),1:KFLEV))) / ZCLEAR_COL_ll + ZHT_CLEAR(1:KFLEV) = SUM_DD_R2_R1_ll(REAL(ZT_HL (INDEX_ICLEAR_COL(:),1:KFLEV))) / ZCLEAR_COL_ll + ! + ZALBP_CLEAR(:) = SUM_DD_R2_R1_ll(REAL(ZALBP(INDEX_ICLEAR_COL(:),:))) / ZCLEAR_COL_ll + ZALBD_CLEAR(:) = SUM_DD_R2_R1_ll(REAL(ZALBD(INDEX_ICLEAR_COL(:),:))) / ZCLEAR_COL_ll + ! + ZEMIS_CLEAR = SUM_DD_R1_ll(REAL(ZEMIS(INDEX_ICLEAR_COL(:),1))) / ZCLEAR_COL_ll + ZEMIW_CLEAR = SUM_DD_R1_ll(REAL(ZEMIW(INDEX_ICLEAR_COL(:),1))) / ZCLEAR_COL_ll + ZRMU0_CLEAR = SUM_DD_R1_ll(REAL(ZRMU0(INDEX_ICLEAR_COL(:)))) / ZCLEAR_COL_ll + ZTS_CLEAR = SUM_DD_R1_ll(REAL(ZTS(INDEX_ICLEAR_COL(:)))) / ZCLEAR_COL_ll + ZLSM_CLEAR = SUM_DD_R1_ll(REAL(ZLSM(INDEX_ICLEAR_COL(:)))) / ZCLEAR_COL_ll + ZLAT_CLEAR = SUM_DD_R1_ll(REAL(ZLAT(INDEX_ICLEAR_COL(:)))) / ZCLEAR_COL_ll + ZLON_CLEAR = SUM_DD_R1_ll(REAL(ZLON(INDEX_ICLEAR_COL(:)))) / ZCLEAR_COL_ll +! + ELSE ! no clear columns -> the first column is chosen, without physical meaning: it will not be + ! unpacked after the call to the radiation ecmwf routine + ZT_CLEAR(:) = ZTAVE(1,:) + ZP_CLEAR(:) = ZPAVE(1,:) + ZQV_CLEAR(:) = ZQVAVE(1,:) + ZOZ_CLEAR(:) = ZO3AVE(1,:) + ZDP_CLEAR(:) = ZDPRES(1,:) + ZAER_CLEAR(:,:) = ZAER(1,:,:) + IF(CAOP=='EXPL')THEN + ZPIZA_EQ_CLEAR(:,:)=ZPIZA_EQ(1,:,:) + ZCGA_EQ_CLEAR(:,:)=ZCGA_EQ(1,:,:) + ZTAUREL_EQ_CLEAR(:,:)=ZTAUREL_EQ(1,:,:) + ENDIF +! + ZHP_CLEAR(1:KFLEV) = ZPRES_HL(1,1:KFLEV) + ZHT_CLEAR(1:KFLEV) = ZT_HL(1,1:KFLEV) + ZALBP_CLEAR(:) = ZALBP(1,:) + ZALBD_CLEAR(:) = ZALBD(1,:) +! + ZEMIS_CLEAR = ZEMIS(1,1) + ZEMIW_CLEAR = ZEMIW(1,1) + ZRMU0_CLEAR = ZRMU0(1) + ZTS_CLEAR = ZTS(1) + ZLSM_CLEAR = ZLSM(1) + ZLAT_CLEAR = ZLAT(1) + ZLON_CLEAR = ZLON(1) + END IF + ! + GCLOUD(:,:) = .NOT.GCLEAR(:,:) ! .true. where the column is cloudy + GCLOUDT(:,:)=TRANSPOSE(GCLOUD(:,:)) + ICLOUD = ICLOUD_COL*KFLEV ! total number of voxels in cloudy columns + ALLOCATE(ZWORK1(ICLOUD)) + ALLOCATE(ZWORK2(ICLOUD+KFLEV)) ! allocation for the KFLEV levels of + ! the ICLOUD cloudy columns + ! and of the KFLEV levels of the clear sky one + ! + ! temperature profiles + ! + ZWORK1(:) = PACK( TRANSPOSE(ZTAVE(:,:)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= ZT_CLEAR(1:) ! and the single clear_sky one + DEALLOCATE(ZTAVE) + ALLOCATE(ZTAVE(ICLOUD_COL+1,KFLEV)) + ZTAVE(:,:) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) + ! + ! vapor mixing ratio profiles + ! + ZWORK1(:) = PACK( TRANSPOSE(ZQVAVE(:,:)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= ZQV_CLEAR(1:) ! and the single clear_sky one + DEALLOCATE(ZQVAVE) + ALLOCATE(ZQVAVE(ICLOUD_COL+1,KFLEV)) + ZQVAVE(:,:) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) + ! + ! mesh size + ! + ZWORK1(:) = PACK( TRANSPOSE(ZDZ(:,:)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= 0.0 ! and the single clear_sky one + DEALLOCATE(ZDZ) + ALLOCATE(ZDZ(ICLOUD_COL+1,KFLEV)) + ZDZ(:,:) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) + ! + ! + ! liquid water mixing ratio profiles + ! + ZWORK1(:) = PACK( TRANSPOSE(ZQLAVE(:,:)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= 0.0 ! and the single clear_sky one + DEALLOCATE(ZQLAVE) + ALLOCATE(ZQLAVE(ICLOUD_COL+1,KFLEV)) + ZQLAVE(:,:) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) + ! + !rain + ! + ZWORK1(:) = PACK( TRANSPOSE(ZQRAVE(:,:)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= 0.0 ! and the single clear_sky one + DEALLOCATE(ZQRAVE) + ALLOCATE(ZQRAVE(ICLOUD_COL+1,KFLEV)) + ZQRAVE(:,:) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) + ! + ! ice water mixing ratio profiles + ! + ZWORK1(:) = PACK( TRANSPOSE(ZQIAVE(:,:)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= 0.0 ! and the single clear_sky one + DEALLOCATE(ZQIAVE) + ALLOCATE(ZQIAVE(ICLOUD_COL+1,KFLEV)) + ZQIAVE(:,:) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) + ! + ! + ! liquid water mixing ratio profiles + ! + ZWORK1(:) = PACK( TRANSPOSE(ZQLWC(:,:)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= 0.0 ! and the single clear_sky one + DEALLOCATE(ZQLWC) + ALLOCATE(ZQLWC(ICLOUD_COL+1,KFLEV)) + ZQLWC(:,:) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) + ! + !rain + ! + ZWORK1(:) = PACK( TRANSPOSE(ZQRWC(:,:)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= 0.0 ! and the single clear_sky one + DEALLOCATE(ZQRWC) + ALLOCATE(ZQRWC(ICLOUD_COL+1,KFLEV)) + ZQRWC(:,:) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) + ! + ! ice water mixing ratio profiles + ! + ZWORK1(:) = PACK( TRANSPOSE(ZQIWC(:,:)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= 0.0 ! and the single clear_sky one + DEALLOCATE(ZQIWC) + ALLOCATE(ZQIWC(ICLOUD_COL+1,KFLEV)) + ZQIWC(:,:) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) + ! + ! + ! cloud fraction profiles + ! + ZWORK1(:) = PACK( TRANSPOSE(ZCFAVE(:,:)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= 0.0 ! and the single clear_sky one + DEALLOCATE(ZCFAVE) + ALLOCATE(ZCFAVE(ICLOUD_COL+1,KFLEV)) + ZCFAVE(:,:) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) + ! + ! C2R2 water particle concentration + ! + IF ( SIZE(ZCCT_C2R2) > 0 ) THEN + ZWORK1(:) = PACK( TRANSPOSE(ZCCT_C2R2(:,:)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= 0.0 ! and the single clear_sky one + DEALLOCATE(ZCCT_C2R2) + ALLOCATE(ZCCT_C2R2(ICLOUD_COL+1,KFLEV)) + ZCCT_C2R2 (:,:) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) + ENDIF + IF ( SIZE (ZCRT_C2R2) > 0 ) THEN + ZWORK1(:) = PACK( TRANSPOSE(ZCRT_C2R2(:,:)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= 0.0 ! and the single clear_sky one + DEALLOCATE(ZCRT_C2R2) + ALLOCATE(ZCRT_C2R2(ICLOUD_COL+1,KFLEV)) + ZCRT_C2R2 (:,:) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) + ENDIF + IF ( SIZE (ZCIT_C1R3) > 0) THEN + ZWORK1(:) = PACK( TRANSPOSE(ZCIT_C1R3(:,:)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= 0.0 ! and the single clear_sky one + DEALLOCATE(ZCIT_C1R3) + ALLOCATE(ZCIT_C1R3(ICLOUD_COL+1,KFLEV)) + ZCIT_C1R3 (:,:) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) + ENDIF + ! + ! LIMA water particle concentration + ! + IF( CCLOUD == 'LIMA' ) THEN + ZWORK1(:) = PACK( TRANSPOSE(ZCCT_LIMA(:,:)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= 0.0 ! and the single clear_sky one + DEALLOCATE(ZCCT_LIMA) + ALLOCATE(ZCCT_LIMA(ICLOUD_COL+1,KFLEV)) + ZCCT_LIMA (:,:) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) +! + ZWORK1(:) = PACK( TRANSPOSE(ZCRT_LIMA(:,:)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= 0.0 ! and the single clear_sky one + DEALLOCATE(ZCRT_LIMA) + ALLOCATE(ZCRT_LIMA(ICLOUD_COL+1,KFLEV)) + ZCRT_LIMA (:,:) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) +! + ZWORK1(:) = PACK( TRANSPOSE(ZCIT_LIMA(:,:)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= 0.0 ! and the single clear_sky one + DEALLOCATE(ZCIT_LIMA) + ALLOCATE(ZCIT_LIMA(ICLOUD_COL+1,KFLEV)) + ZCIT_LIMA (:,:) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) + ENDIF + ! + ! ozone content profiles + ! + ZWORK1(:) = PACK( TRANSPOSE(ZO3AVE(:,:)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= ZOZ_CLEAR(1:) ! and the single clear_sky one + DEALLOCATE(ZO3AVE) + ALLOCATE(ZO3AVE(ICLOUD_COL+1,KFLEV)) + ZO3AVE(:,:) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) + ! + ZWORK1(:) = PACK( TRANSPOSE(ZPAVE(:,:)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= ZP_CLEAR(1:) ! and the single clear_sky one + DEALLOCATE(ZPAVE) + ALLOCATE(ZPAVE(ICLOUD_COL+1,KFLEV)) + ZPAVE(:,:) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) + ! + !pressure thickness + ! + ZWORK1(:) = PACK( TRANSPOSE(ZDPRES(:,:)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= ZDP_CLEAR(1:) ! and the single clear_sky one + DEALLOCATE(ZDPRES) + ALLOCATE(ZDPRES(ICLOUD_COL+1,KFLEV)) + ZDPRES(:,:) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) + ! + !aerosols + ! + ALLOCATE(ZWORK1AER(ICLOUD,KAER)) + ALLOCATE(ZWORK2AER(ICLOUD+KFLEV,KAER)) + DO JK=1,KAER + ZWORK1AER(:,JK) = PACK( TRANSPOSE(ZAER(:,:,JK)),MASK=GCLOUDT(:,:) ) + ZWORK2AER(1:ICLOUD,JK)=ZWORK1AER(:,JK) + ZWORK2AER(ICLOUD+1:,JK)=ZAER_CLEAR(:,JK) + END DO + DEALLOCATE(ZAER) + ALLOCATE(ZAER(ICLOUD_COL+1,KFLEV,KAER)) + DO JK=1,KAER + ZAER(:,:,JK) = TRANSPOSE( RESHAPE( ZWORK2AER(:,JK),(/KFLEV,ICLOUD_COL+1/) ) ) + END DO + DEALLOCATE (ZWORK1AER) + DEALLOCATE (ZWORK2AER) + ! + IF(CAOP=='EXPL')THEN + ALLOCATE(ZWORK1AER(ICLOUD,KSWB_OLD)) !New vector with value for all cld. points + ALLOCATE(ZWORK2AER(ICLOUD+KFLEV,KSWB_OLD)) !New vector with value for all cld.points + 1 clr column + !Single scattering albedo + DO WVL_IDX=1,KSWB_OLD + ZWORK1AER(:,WVL_IDX) = PACK( TRANSPOSE(ZPIZA_EQ(:,:,WVL_IDX)),MASK=GCLOUDT(:,:) ) + ZWORK2AER(1:ICLOUD,WVL_IDX) = ZWORK1AER(:,WVL_IDX) + ZWORK2AER(ICLOUD+1:,WVL_IDX) = ZPIZA_EQ_CLEAR(:,WVL_IDX) + ENDDO + DEALLOCATE(ZPIZA_EQ) + ALLOCATE(ZPIZA_EQ(ICLOUD_COL+1,KFLEV,KSWB_OLD)) + DO WVL_IDX=1,KSWB_OLD + ZPIZA_EQ(:,:,WVL_IDX) = TRANSPOSE( RESHAPE( ZWORK2AER(:,WVL_IDX),(/KFLEV,ICLOUD_COL+1/) ) ) + ENDDO + !Assymetry factor + DO WVL_IDX=1,KSWB_OLD + ZWORK1AER(:,WVL_IDX) = PACK(TRANSPOSE(ZCGA_EQ(:,:,WVL_IDX)), MASK=GCLOUDT(:,:)) + ZWORK2AER(1:ICLOUD,WVL_IDX) = ZWORK1AER(:,WVL_IDX) + ZWORK2AER(ICLOUD+1:,WVL_IDX) = ZCGA_EQ_CLEAR(:,WVL_IDX) + ENDDO + DEALLOCATE(ZCGA_EQ) + ALLOCATE(ZCGA_EQ(ICLOUD_COL+1,KFLEV,KSWB_OLD)) + DO WVL_IDX=1,KSWB_OLD + ZCGA_EQ(:,:,WVL_IDX) = TRANSPOSE(RESHAPE(ZWORK2AER(:,WVL_IDX),(/KFLEV,ICLOUD_COL+1/))) + ENDDO + !Relative wavelength-distributed optical depth + DO WVL_IDX=1,KSWB_OLD + ZWORK1AER(:,WVL_IDX) = PACK(TRANSPOSE(ZTAUREL_EQ(:,:,WVL_IDX)), MASK=GCLOUDT(:,:)) + ZWORK2AER(1:ICLOUD,WVL_IDX) = ZWORK1AER(:,WVL_IDX) + ZWORK2AER(ICLOUD+1:,WVL_IDX) = ZTAUREL_EQ_CLEAR(:,WVL_IDX) + ENDDO + DEALLOCATE(ZTAUREL_EQ) + ALLOCATE(ZTAUREL_EQ(ICLOUD_COL+1,KFLEV,KSWB_OLD)) + DO WVL_IDX=1,KSWB_OLD + ZTAUREL_EQ(:,:,WVL_IDX) = TRANSPOSE(RESHAPE(ZWORK2AER(:,WVL_IDX),(/KFLEV,ICLOUD_COL+1/))) + ENDDO + DEALLOCATE(ZWORK1AER) + DEALLOCATE(ZWORK2AER) + ELSE + DEALLOCATE(ZPIZA_EQ) + ALLOCATE(ZPIZA_EQ(ICLOUD_COL+1,KFLEV,KSWB_OLD)) + DEALLOCATE(ZCGA_EQ) + ALLOCATE(ZCGA_EQ(ICLOUD_COL+1,KFLEV,KSWB_OLD)) + DEALLOCATE(ZTAUREL_EQ) + ALLOCATE(ZTAUREL_EQ(ICLOUD_COL+1,KFLEV,KSWB_OLD)) + ENDIF !Check on LDUST + + ! half-level variables + ! + ZWORK1(:) = PACK( TRANSPOSE(ZPRES_HL(:,1:KFLEV)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= ZHP_CLEAR(1:) ! and the single clear_sky one + DEALLOCATE(ZPRES_HL) + ALLOCATE(ZPRES_HL(ICLOUD_COL+1,KFLEV+1)) + ZPRES_HL(:,1:KFLEV) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) + ZPRES_HL(:,KFLEV+1) = PSTATM(IKSTAE,2)*100.0 + ! + ZWORK1(:) = PACK( TRANSPOSE(ZT_HL(:,1:KFLEV)),MASK=GCLOUDT(:,:) ) + ZWORK2(1:ICLOUD) = ZWORK1(1:ICLOUD) ! fills the ICLOUD_COL cloudy columns + ZWORK2(ICLOUD+1:)= ZHT_CLEAR(1:) ! and the single clear_sky one + DEALLOCATE(ZT_HL) + ALLOCATE(ZT_HL(ICLOUD_COL+1,KFLEV+1)) + ZT_HL(:,1:KFLEV) = TRANSPOSE( RESHAPE( ZWORK2(:),(/KFLEV,ICLOUD_COL+1/) ) ) + ZT_HL(:,KFLEV+1) = PSTATM(IKSTAE,3) + ! + ! surface fields + ! + ALLOCATE(ZWORK3(ICLOUD_COL)) + ALLOCATE(ZWORK4(ICLOUD_COL,KSWB_MNH)) + ALLOCATE(ZWORK(KDLON)) + DO JALBS=1,KSWB_MNH + ZWORK(:) = ZALBP(:,JALBS) + ZWORK3(:) = PACK( ZWORK(:),MASK=.NOT.GCLEAR_2D(:) ) + ZWORK4(:,JALBS) = ZWORK3(:) + END DO + DEALLOCATE(ZALBP) + ALLOCATE(ZALBP(ICLOUD_COL+1,KSWB_MNH)) + ZALBP(1:ICLOUD_COL,:) = ZWORK4(1:ICLOUD_COL,:) + ZALBP(ICLOUD_COL+1,:) = ZALBP_CLEAR(:) + ! + DO JALBS=1,KSWB_MNH + ZWORK(:) = ZALBD(:,JALBS) + ZWORK3(:) = PACK( ZWORK(:),MASK=.NOT.GCLEAR_2D(:) ) + ZWORK4(:,JALBS) = ZWORK3(:) + END DO + DEALLOCATE(ZALBD) + ALLOCATE(ZALBD(ICLOUD_COL+1,KSWB_MNH)) + ZALBD(1:ICLOUD_COL,:) = ZWORK4(1:ICLOUD_COL,:) + ZALBD(ICLOUD_COL+1,:) = ZALBD_CLEAR(:) + ! + DEALLOCATE(ZWORK4) + ! + ZWORK3(:) = PACK( ZEMIS(:,1),MASK=.NOT.GCLEAR_2D(:) ) + DEALLOCATE(ZEMIS) + ALLOCATE(ZEMIS(ICLOUD_COL+1,1)) + ZEMIS(1:ICLOUD_COL,1) = ZWORK3(1:ICLOUD_COL) + ZEMIS(ICLOUD_COL+1,1) = ZEMIS_CLEAR + ! + ! + ZWORK3(:) = PACK( ZEMIW(:,1),MASK=.NOT.GCLEAR_2D(:) ) + DEALLOCATE(ZEMIW) + ALLOCATE(ZEMIW(ICLOUD_COL+1,1)) + ZEMIW(1:ICLOUD_COL,1) = ZWORK3(1:ICLOUD_COL) + ZEMIW(ICLOUD_COL+1,1) = ZEMIW_CLEAR + ! + ! + ZWORK3(:) = PACK( ZRMU0(:),MASK=.NOT.GCLEAR_2D(:) ) + DEALLOCATE(ZRMU0) + ALLOCATE(ZRMU0(ICLOUD_COL+1)) + ZRMU0(1:ICLOUD_COL) = ZWORK3(1:ICLOUD_COL) + ZRMU0(ICLOUD_COL+1) = ZRMU0_CLEAR + ! + ZWORK3(:) = PACK( ZLSM(:),MASK=.NOT.GCLEAR_2D(:) ) + DEALLOCATE(ZLSM) + ALLOCATE(ZLSM(ICLOUD_COL+1)) + ZLSM(1:ICLOUD_COL) = ZWORK3(1:ICLOUD_COL) + ZLSM (ICLOUD_COL+1)= ZLSM_CLEAR + ! + ZWORK3(:) = PACK( ZLAT(:),MASK=.NOT.GCLEAR_2D(:) ) + DEALLOCATE(ZLAT) + ALLOCATE(ZLAT(ICLOUD_COL+1)) + ZLAT(1:ICLOUD_COL) = ZWORK3(1:ICLOUD_COL) + ZLAT (ICLOUD_COL+1)= ZLAT_CLEAR + ! + ZWORK3(:) = PACK( ZLON(:),MASK=.NOT.GCLEAR_2D(:) ) + DEALLOCATE(ZLON) + ALLOCATE(ZLON(ICLOUD_COL+1)) + ZLON(1:ICLOUD_COL) = ZWORK3(1:ICLOUD_COL) + ZLON (ICLOUD_COL+1)= ZLON_CLEAR + ! + ZWORK3(:) = PACK( ZTS(:),MASK=.NOT.GCLEAR_2D(:) ) + DEALLOCATE(ZTS) + ALLOCATE(ZTS(ICLOUD_COL+1)) + ZTS(1:ICLOUD_COL) = ZWORK3(1:ICLOUD_COL) + ZTS(ICLOUD_COL+1) = ZTS_CLEAR + ! + DEALLOCATE(ZWORK1) + DEALLOCATE(ZWORK2) + DEALLOCATE(ZWORK3) + DEALLOCATE(ZWORK) + ! + IDIM = ICLOUD_COL +1 ! Number of columns where RT is computed +! +ELSE + ! + !* 5.3 RADIATION COMPUTATIONS FOR THE FULL COLUMN NUMBER (KDLON) + ! + IDIM = KDLON +END IF +! +! initialisation of cloud trace for the next radiation time step +! (if unchanged columns are not recomputed) +WHERE ( ZCLOUD(:) <= 0.0 ) + ICLEAR_2D_TM1(:) = 1 +ELSEWHERE + ICLEAR_2D_TM1(:) = 0 +END WHERE +! +DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + KCLEARCOL_TM1(JI,JJ) = ICLEAR_2D_TM1(IIJ) ! output to be saved for next time step + END DO +END DO +! +! +!* 5.4 VERTICAL grid modification(up-down) for compatibility with ECMWF +! radiation vertical grid. ALLOCATION of the outputs. +! +! +ALLOCATE (ZWORK_GRID(SIZE(ZPRES_HL,1),KFLEV+1)) +! +!half level pressure +ZWORK_GRID(:,:)=ZPRES_HL(:,:) +DO JKRAD=1, KFLEV+1 + JK1=(KFLEV+1)+1-JKRAD + ZPRES_HL(:,JKRAD) = ZWORK_GRID(:,JK1) +END DO +! +!half level temperature +ZWORK_GRID(:,:)=ZT_HL(:,:) +DO JKRAD=1, KFLEV+1 + JK1=(KFLEV+1)+1-JKRAD + ZT_HL(:,JKRAD)=ZWORK_GRID(:,JK1) +END DO +! +DEALLOCATE(ZWORK_GRID) +! +!mean layer variables +!------------------------------------- +ALLOCATE(ZWORK_GRID(SIZE(ZTAVE,1),KFLEV)) +! +!mean layer temperature +ZWORK_GRID(:,:)=ZTAVE(:,:) +DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZTAVE(:,JKRAD)=ZWORK_GRID(:,JK1) +END DO +! +!mean layer pressure +ZWORK_GRID(:,:)=ZPAVE(:,:) +DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZPAVE(:,JKRAD)=ZWORK_GRID(:,JK1) +END DO +! +!mean layer pressure thickness +ZWORK_GRID(:,:)=ZDPRES(:,:) +DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZDPRES(:,JKRAD)=ZWORK_GRID(:,JK1) +END DO +! +!mesh size +ZWORK_GRID(:,:)=ZDZ(:,:) +DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZDZ(:,JKRAD)=ZWORK_GRID(:,JK1) +END DO + +!mean layer cloud fraction +ZWORK_GRID(:,:)=ZCFAVE(:,:) +DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZCFAVE(:,JKRAD)=ZWORK_GRID(:,JK1) +END DO +! +!mean layer water vapor mixing ratio +ZWORK_GRID(:,:)=ZQVAVE(:,:) +DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZQVAVE(:,JKRAD)=ZWORK_GRID(:,JK1) +END DO +! +!ice +ZWORK_GRID(:,:)=ZQIAVE(:,:) +DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZQIAVE(:,JKRAD)=ZWORK_GRID(:,JK1) +END DO +! +!liquid water +ZWORK_GRID(:,:)=ZQLAVE(:,:) +DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZQLAVE(:,JKRAD)=ZWORK_GRID(:,JK1) +END DO + + +!rain water +ZWORK_GRID(:,:)=ZQRAVE(:,:) +DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZQRAVE(:,JKRAD)=ZWORK_GRID(:,JK1) +END DO +! +!ice water content +ZWORK_GRID(:,:)=ZQIWC(:,:) +DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZQIWC(:,JKRAD)=ZWORK_GRID(:,JK1) +END DO +! +!liquid water content +ZWORK_GRID(:,:)=ZQLWC(:,:) +DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZQLWC(:,JKRAD)=ZWORK_GRID(:,JK1) +END DO + + +!rain water content +ZWORK_GRID(:,:)=ZQRWC(:,:) +DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZQRWC(:,JKRAD)=ZWORK_GRID(:,JK1) +END DO + + +!C2R2 water particle concentration +! +IF (SIZE(ZCCT_C2R2) > 0) THEN + ZWORK_GRID(:,:)=ZCCT_C2R2(:,:) + DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZCCT_C2R2(:,JKRAD)=ZWORK_GRID(:,JK1) + END DO +END IF +IF (SIZE(ZCRT_C2R2) > 0) THEN + ZWORK_GRID(:,:)=ZCRT_C2R2(:,:) + DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZCRT_C2R2(:,JKRAD)=ZWORK_GRID(:,JK1) + END DO +END IF +IF (SIZE(ZCIT_C1R3) > 0) THEN + ZWORK_GRID(:,:)=ZCIT_C1R3(:,:) + DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZCIT_C1R3(:,JKRAD)=ZWORK_GRID(:,JK1) + END DO +END IF +! +!LIMA water particle concentration +! +IF( CCLOUD == 'LIMA' ) THEN + ZWORK_GRID(:,:)=ZCCT_LIMA(:,:) + DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZCCT_LIMA(:,JKRAD)=ZWORK_GRID(:,JK1) + END DO +! + ZWORK_GRID(:,:)=ZCRT_LIMA(:,:) + DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZCRT_LIMA(:,JKRAD)=ZWORK_GRID(:,JK1) + END DO +! + ZWORK_GRID(:,:)=ZCIT_LIMA(:,:) + DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZCIT_LIMA(:,JKRAD)=ZWORK_GRID(:,JK1) + END DO +END IF +! +!ozone content +ZWORK_GRID(:,:)=ZO3AVE(:,:) +DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZO3AVE(:,JKRAD)=ZWORK_GRID(:,JK1) +END DO +! +!aerosol optical depth +DO JI=1,KAER + ZWORK_GRID(:,:)=ZAER(:,:,JI) + DO JKRAD=1, KFLEV + JK1=KFLEV+1-JKRAD + ZAER(:,JKRAD,JI)=ZWORK_GRID(:,JK1) + END DO +END DO +IF (CAOP=='EXPL') THEN +!TURN MORE FIELDS UPSIDE DOWN... +!Dust single scattering albedo +DO JI=1,KSWB_OLD + ZWORK_GRID(:,:)=ZPIZA_EQ(:,:,JI) + DO JKRAD=1,KFLEV + JK1=KFLEV+1-JKRAD + ZPIZA_EQ(:,JKRAD,JI)=ZWORK_GRID(:,JK1) + ENDDO +ENDDO +!Dust asymmetry factor +DO JI=1,KSWB_OLD + ZWORK_GRID(:,:)=ZCGA_EQ(:,:,JI) + DO JKRAD=1,KFLEV + JK1=KFLEV+1-JKRAD + ZCGA_EQ(:,JKRAD,JI)=ZWORK_GRID(:,JK1) + ENDDO +ENDDO +DO JI=1,KSWB_OLD + ZWORK_GRID(:,:)=ZTAUREL_EQ(:,:,JI) + DO JKRAD=1,KFLEV + JK1=KFLEV+1-JKRAD + ZTAUREL_EQ(:,JKRAD,JI)=ZWORK_GRID(:,JK1) + ENDDO +ENDDO + +END IF + +! +DEALLOCATE(ZWORK_GRID) +! +!mean layer saturation specific humidity +! +ALLOCATE(ZQSAVE(SIZE(ZTAVE,1),SIZE(ZTAVE,2))) +! +WHERE (ZTAVE(:,:) > XTT) + ZQSAVE(:,:) = QSAT(ZTAVE, ZPAVE) +ELSEWHERE + ZQSAVE(:,:) = QSATI(ZTAVE, ZPAVE) +END WHERE +! +! allocations for the radiation code outputs +! +ALLOCATE(ZDTLW(IDIM,KFLEV)) +ALLOCATE(ZDTSW(IDIM,KFLEV)) +ALLOCATE(ZFLUX_TOP_GND_IRVISNIR(IDIM,KFLUX)) +ALLOCATE(ZSFSWDIR(IDIM,ISWB)) +ALLOCATE(ZSFSWDIF(IDIM,ISWB)) +ALLOCATE(ZDTLW_CS(IDIM,KFLEV)) +ALLOCATE(ZDTSW_CS(IDIM,KFLEV)) +ALLOCATE(ZFLUX_TOP_GND_IRVISNIR_CS(IDIM,KFLUX)) +! +! +ALLOCATE(ZFLUX_LW(IDIM,2,KFLEV+1)) +ALLOCATE(ZFLUX_SW_DOWN(IDIM,KFLEV+1)) +ALLOCATE(ZFLUX_SW_UP(IDIM,KFLEV+1)) +ALLOCATE(ZRADLP(IDIM,KFLEV)) +IF( KRAD_DIAG >= 1) THEN + ALLOCATE(ZNFLW(IDIM,KFLEV+1)) + ALLOCATE(ZNFSW(IDIM,KFLEV+1)) +ELSE + ALLOCATE(ZNFLW(0,0)) + ALLOCATE(ZNFSW(0,0)) +END IF +! +IF( KRAD_DIAG >= 2) THEN + ALLOCATE(ZFLUX_SW_DOWN_CS(IDIM,KFLEV+1)) + ALLOCATE(ZFLUX_SW_UP_CS(IDIM,KFLEV+1)) + ALLOCATE(ZFLUX_LW_CS(IDIM,2,KFLEV+1)) + ALLOCATE(ZNFLW_CS(IDIM,KFLEV+1)) + ALLOCATE(ZNFSW_CS(IDIM,KFLEV+1)) +ELSE + ALLOCATE(ZFLUX_SW_DOWN_CS(0,0)) + ALLOCATE(ZFLUX_SW_UP_CS(0,0)) + ALLOCATE(ZFLUX_LW_CS(0,0,0)) + ALLOCATE(ZNFSW_CS(0,0)) + ALLOCATE(ZNFLW_CS(0,0)) +END IF +! +IF( KRAD_DIAG >= 3) THEN + ALLOCATE(ZPLAN_ALB_VIS(IDIM)) + ALLOCATE(ZPLAN_ALB_NIR(IDIM)) + ALLOCATE(ZPLAN_TRA_VIS(IDIM)) + ALLOCATE(ZPLAN_TRA_NIR(IDIM)) + ALLOCATE(ZPLAN_ABS_VIS(IDIM)) + ALLOCATE(ZPLAN_ABS_NIR(IDIM)) +ELSE + ALLOCATE(ZPLAN_ALB_VIS(0)) + ALLOCATE(ZPLAN_ALB_NIR(0)) + ALLOCATE(ZPLAN_TRA_VIS(0)) + ALLOCATE(ZPLAN_TRA_NIR(0)) + ALLOCATE(ZPLAN_ABS_VIS(0)) + ALLOCATE(ZPLAN_ABS_NIR(0)) +END IF +! +IF( KRAD_DIAG >= 4) THEN + ALLOCATE(ZEFCL_RRTM(IDIM,KFLEV)) + ALLOCATE(ZCLSW_TOTAL(IDIM,KFLEV)) + ALLOCATE(ZTAU_TOTAL(IDIM,KSWB_OLD,KFLEV)) + ALLOCATE(ZOMEGA_TOTAL(IDIM,KSWB_OLD,KFLEV)) + ALLOCATE(ZCG_TOTAL(IDIM,KSWB_OLD,KFLEV)) + ALLOCATE(ZEFCL_LWD(IDIM,KFLEV)) + ALLOCATE(ZEFCL_LWU(IDIM,KFLEV)) + ALLOCATE(ZFLWP(IDIM,KFLEV)) + ALLOCATE(ZFIWP(IDIM,KFLEV)) + ALLOCATE(ZRADIP(IDIM,KFLEV)) +ELSE + ALLOCATE(ZEFCL_RRTM(0,0)) + ALLOCATE(ZCLSW_TOTAL(0,0)) + ALLOCATE(ZTAU_TOTAL(0,0,0)) + ALLOCATE(ZOMEGA_TOTAL(0,0,0)) + ALLOCATE(ZCG_TOTAL(0,0,0)) + ALLOCATE(ZEFCL_LWD(0,0)) + ALLOCATE(ZEFCL_LWU(0,0)) + ALLOCATE(ZFLWP(0,0)) + ALLOCATE(ZFIWP(0,0)) + ALLOCATE(ZRADIP(0,0)) +END IF +! +!* 5.6 CALLS THE ECMWF_RADIATION ROUTINES +! +! mixing ratio -> specific humidity conversion (for ECMWF routine) +! mixing ratio = mv/md ; specific humidity = mv/(mv+md) + +ZQVAVE(:,:) = ZQVAVE(:,:) / (1.+ZQVAVE(:,:)) ! Because +! ZAER = 1e-5*ZAER +! ZO3AVE = 1e-5*ZO3AVE! +IF( IDIM <= KRAD_COLNBR ) THEN +! +! there is less than KRAD_COLNBR columns to be considered therefore +! no split of the arrays is performed +! Note that radiation scheme only takes scalar emissivities so only fist value of the spectral emissivity is taken + ALLOCATE(ZTAVE_RAD(SIZE(ZTAVE,1),SIZE(ZTAVE,2))) + ALLOCATE(ZPAVE_RAD(SIZE(ZPAVE,1),SIZE(ZPAVE,2))) + ZTAVE_RAD = ZTAVE + ZPAVE_RAD = ZPAVE + IF (CCLOUD == 'LIMA') THEN + IF (CRAD == "ECMW") THEN + CALL ECMWF_RADIATION_VERS2 ( IDIM ,KFLEV, KRAD_DIAG, KAER, & + ZDZ,HEFRADL,HEFRADI,HOPWSW, HOPISW, HOPWLW, HOPILW,PFUDG, & + ZRII0, ZAER , ZALBD, ZALBP, ZPRES_HL, ZPAVE_RAD, & + PCCO2, ZCFAVE, ZDPRES, ZEMIS(:,1), ZEMIW(:,1), ZLSM, ZRMU0, & + ZO3AVE , ZQVAVE, ZQIAVE ,ZQIWC,ZQLAVE,ZQLWC, ZQSAVE, ZQRAVE, ZQRWC, & + ZT_HL,ZTAVE_RAD, ZTS, ZCCT_LIMA, ZCRT_LIMA, ZCIT_LIMA, & + ZNFLW_CS, ZNFLW, ZNFSW_CS,ZNFSW, & + ZDTLW, ZDTSW, ZFLUX_TOP_GND_IRVISNIR, & + ZSFSWDIR, ZSFSWDIF, & + ZFLUX_SW_DOWN, ZFLUX_SW_UP, ZFLUX_LW , & + ZDTLW_CS, ZDTSW_CS, ZFLUX_TOP_GND_IRVISNIR_CS, & + ZFLUX_SW_DOWN_CS, ZFLUX_SW_UP_CS, ZFLUX_LW_CS, & + ZPLAN_ALB_VIS,ZPLAN_ALB_NIR, ZPLAN_TRA_VIS, ZPLAN_TRA_NIR, & + ZPLAN_ABS_VIS, ZPLAN_ABS_NIR,ZEFCL_LWD, ZEFCL_LWU, & + ZFLWP, ZFIWP,ZRADLP, ZRADIP,ZEFCL_RRTM, ZCLSW_TOTAL, ZTAU_TOTAL, & + ZOMEGA_TOTAL,ZCG_TOTAL, & + GAOP, ZPIZA_EQ,ZCGA_EQ,ZTAUREL_EQ ) + + + ELSE IF (CRAD == "ECRA") THEN + CALL ECRAD_INTERFACE ( IDIM ,KFLEV, KRAD_DIAG, KAER, & + ZDZ,HEFRADL,HEFRADI,HOPWSW, HOPISW, HOPWLW, HOPILW,PFUDG, & + ZRII0, ZAER , ZALBD, ZALBP, ZPRES_HL, ZPAVE_RAD, & + PCCO2, ZCFAVE, ZDPRES, ZEMIS(:,1), ZEMIW(:,1), ZLSM, ZRMU0, & + ZO3AVE , ZQVAVE, ZQIAVE ,ZQIWC,ZQLAVE,ZQLWC, ZQSAVE, ZQRAVE, ZQRWC, & + ZT_HL,ZTAVE_RAD, ZTS, ZCCT_LIMA, ZCRT_LIMA, ZCIT_LIMA, & + ZNFLW, ZNFSW, ZNFLW_CS, ZNFSW_CS, & + ZDTLW, ZDTSW, ZFLUX_TOP_GND_IRVISNIR, & + ZSFSWDIR, ZSFSWDIF, & + ZFLUX_SW_DOWN, ZFLUX_SW_UP, ZFLUX_LW , & + ZDTLW_CS, ZDTSW_CS, ZFLUX_TOP_GND_IRVISNIR_CS, & + ZFLUX_SW_DOWN_CS, ZFLUX_SW_UP_CS, ZFLUX_LW_CS, & + ZPLAN_ALB_VIS,ZPLAN_ALB_NIR, ZPLAN_TRA_VIS, ZPLAN_TRA_NIR, & + ZPLAN_ABS_VIS, ZPLAN_ABS_NIR,ZEFCL_LWD, ZEFCL_LWU, & + ZFLWP, ZFIWP,ZRADLP, ZRADIP,ZEFCL_RRTM, ZCLSW_TOTAL, ZTAU_TOTAL, & + ZOMEGA_TOTAL,ZCG_TOTAL, & + GAOP, ZPIZA_EQ,ZCGA_EQ,ZTAUREL_EQ,ZLAT,ZLON ) + ENDIF + + ELSE + IF (CRAD == "ECMW") THEN + CALL ECMWF_RADIATION_VERS2 ( IDIM ,KFLEV, KRAD_DIAG, KAER, & + ZDZ,HEFRADL,HEFRADI,HOPWSW, HOPISW, HOPWLW, HOPILW,PFUDG, & + ZRII0, ZAER , ZALBD, ZALBP, ZPRES_HL, ZPAVE_RAD, & + PCCO2, ZCFAVE, ZDPRES, ZEMIS(:,1), ZEMIW(:,1), ZLSM, ZRMU0, & + ZO3AVE , ZQVAVE, ZQIAVE ,ZQIWC,ZQLAVE,ZQLWC, ZQSAVE, ZQRAVE, ZQRWC, & + ZT_HL,ZTAVE_RAD, ZTS, ZCCT_C2R2, ZCRT_C2R2, ZCIT_C1R3, & + ZNFLW_CS, ZNFLW, ZNFSW_CS,ZNFSW, & + ZDTLW, ZDTSW, ZFLUX_TOP_GND_IRVISNIR, & + ZSFSWDIR, ZSFSWDIF, & + ZFLUX_SW_DOWN, ZFLUX_SW_UP, ZFLUX_LW , & + ZDTLW_CS, ZDTSW_CS, ZFLUX_TOP_GND_IRVISNIR_CS, & + ZFLUX_SW_DOWN_CS, ZFLUX_SW_UP_CS, ZFLUX_LW_CS, & + ZPLAN_ALB_VIS,ZPLAN_ALB_NIR, ZPLAN_TRA_VIS, ZPLAN_TRA_NIR, & + ZPLAN_ABS_VIS, ZPLAN_ABS_NIR,ZEFCL_LWD, ZEFCL_LWU, & + ZFLWP, ZFIWP,ZRADLP, ZRADIP,ZEFCL_RRTM, ZCLSW_TOTAL, ZTAU_TOTAL, & + ZOMEGA_TOTAL,ZCG_TOTAL, & + GAOP, ZPIZA_EQ,ZCGA_EQ,ZTAUREL_EQ ) + + ELSE IF (CRAD == "ECRA") THEN + CALL ECRAD_INTERFACE ( IDIM ,KFLEV, KRAD_DIAG, KAER, & + ZDZ,HEFRADL,HEFRADI,HOPWSW, HOPISW, HOPWLW, HOPILW,PFUDG, & + ZRII0, ZAER , ZALBD, ZALBP, ZPRES_HL, ZPAVE_RAD, & + PCCO2, ZCFAVE, ZDPRES, ZEMIS(:,1), ZEMIW(:,1), ZLSM, ZRMU0, & + ZO3AVE , ZQVAVE, ZQIAVE ,ZQIWC,ZQLAVE,ZQLWC, ZQSAVE, ZQRAVE, ZQRWC, & + ZT_HL,ZTAVE_RAD, ZTS, ZCCT_C2R2, ZCRT_C2R2, ZCIT_C1R3, & + ZNFLW, ZNFSW, ZNFLW_CS, ZNFSW_CS, & + ZDTLW, ZDTSW, ZFLUX_TOP_GND_IRVISNIR, & + ZSFSWDIR, ZSFSWDIF, & + ZFLUX_SW_DOWN, ZFLUX_SW_UP, ZFLUX_LW , & + ZDTLW_CS, ZDTSW_CS, ZFLUX_TOP_GND_IRVISNIR_CS, & + ZFLUX_SW_DOWN_CS, ZFLUX_SW_UP_CS, ZFLUX_LW_CS, & + ZPLAN_ALB_VIS,ZPLAN_ALB_NIR, ZPLAN_TRA_VIS, ZPLAN_TRA_NIR, & + ZPLAN_ABS_VIS, ZPLAN_ABS_NIR,ZEFCL_LWD, ZEFCL_LWU, & + ZFLWP, ZFIWP,ZRADLP, ZRADIP,ZEFCL_RRTM, ZCLSW_TOTAL, ZTAU_TOTAL, & + ZOMEGA_TOTAL,ZCG_TOTAL, & + GAOP, ZPIZA_EQ,ZCGA_EQ,ZTAUREL_EQ ,ZLAT,ZLON ) + END IF + + + END IF + DEALLOCATE(ZTAVE_RAD,ZPAVE_RAD) +! +ELSE +! +! the splitting of the arrays will be performed +! + INUM_CALL = CEILING( REAL( IDIM ) / REAL( KRAD_COLNBR ) ) + IDIM_RESIDUE = IDIM +! + DO JI_SPLIT = 1 , INUM_CALL + IDIM_EFF = MIN( IDIM_RESIDUE,KRAD_COLNBR ) + ! + IF( JI_SPLIT == 1 .OR. JI_SPLIT == INUM_CALL ) THEN + ALLOCATE( ZALBP_SPLIT(IDIM_EFF,KSWB_MNH)) + ALLOCATE( ZALBD_SPLIT(IDIM_EFF,KSWB_MNH)) + ALLOCATE( ZEMIS_SPLIT(IDIM_EFF)) + ALLOCATE( ZEMIW_SPLIT(IDIM_EFF)) + ALLOCATE( ZRMU0_SPLIT(IDIM_EFF)) + ALLOCATE( ZLAT_SPLIT(IDIM_EFF)) + ALLOCATE( ZLON_SPLIT(IDIM_EFF)) + ALLOCATE( ZCFAVE_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZO3AVE_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZT_HL_SPLIT(IDIM_EFF,KFLEV+1)) + ALLOCATE( ZPRES_HL_SPLIT(IDIM_EFF,KFLEV+1)) + ALLOCATE( ZDZ_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZQLAVE_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZQIAVE_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZQRAVE_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZQLWC_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZQIWC_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZQRWC_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZQVAVE_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZTAVE_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZPAVE_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZAER_SPLIT( IDIM_EFF,KFLEV,KAER)) + ALLOCATE( ZPIZA_EQ_SPLIT(IDIM_EFF,KFLEV,KSWB_OLD)) + ALLOCATE( ZCGA_EQ_SPLIT(IDIM_EFF,KFLEV,KSWB_OLD)) + ALLOCATE( ZTAUREL_EQ_SPLIT(IDIM_EFF,KFLEV,KSWB_OLD)) + ALLOCATE( ZDPRES_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZLSM_SPLIT(IDIM_EFF)) + ALLOCATE( ZQSAVE_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZTS_SPLIT(IDIM_EFF)) + ! output pronostic + ALLOCATE( ZDTLW_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZDTSW_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZFLUX_TOP_GND_IRVISNIR_SPLIT(IDIM_EFF,KFLUX)) + ALLOCATE( ZSFSWDIR_SPLIT(IDIM_EFF,ISWB)) + ALLOCATE( ZSFSWDIF_SPLIT(IDIM_EFF,ISWB)) + ALLOCATE( ZDTLW_CS_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZDTSW_CS_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZFLUX_TOP_GND_IRVISNIR_CS_SPLIT(IDIM_EFF,KFLUX)) +! + ALLOCATE( ZFLUX_LW_SPLIT(IDIM_EFF,2,KFLEV+1)) + ALLOCATE( ZFLUX_SW_DOWN_SPLIT(IDIM_EFF,KFLEV+1)) + ALLOCATE( ZFLUX_SW_UP_SPLIT(IDIM_EFF,KFLEV+1)) + ALLOCATE( ZRADLP_SPLIT(IDIM_EFF,KFLEV)) + IF(KRAD_DIAG >=1) THEN + ALLOCATE( ZNFSW_SPLIT(IDIM_EFF,KFLEV+1)) + ALLOCATE( ZNFLW_SPLIT(IDIM_EFF,KFLEV+1)) + ELSE + ALLOCATE( ZNFSW_SPLIT(0,0)) + ALLOCATE( ZNFLW_SPLIT(0,0)) + END IF +! + IF( KRAD_DIAG >= 2) THEN + ALLOCATE( ZFLUX_SW_DOWN_CS_SPLIT(IDIM_EFF,KFLEV+1)) + ALLOCATE( ZFLUX_SW_UP_CS_SPLIT(IDIM_EFF,KFLEV+1)) + ALLOCATE( ZFLUX_LW_CS_SPLIT(IDIM_EFF,2,KFLEV+1)) + ALLOCATE( ZNFSW_CS_SPLIT(IDIM_EFF,KFLEV+1)) + ALLOCATE( ZNFLW_CS_SPLIT(IDIM_EFF,KFLEV+1)) + ELSE + ALLOCATE( ZFLUX_SW_DOWN_CS_SPLIT(0,0)) + ALLOCATE( ZFLUX_SW_UP_CS_SPLIT(0,0)) + ALLOCATE( ZFLUX_LW_CS_SPLIT(0,0,0)) + ALLOCATE( ZNFSW_CS_SPLIT(0,0)) + ALLOCATE( ZNFLW_CS_SPLIT(0,0)) + END IF +! + IF( KRAD_DIAG >= 3) THEN + ALLOCATE( ZPLAN_ALB_VIS_SPLIT(IDIM_EFF)) + ALLOCATE( ZPLAN_ALB_NIR_SPLIT(IDIM_EFF)) + ALLOCATE( ZPLAN_TRA_VIS_SPLIT(IDIM_EFF)) + ALLOCATE( ZPLAN_TRA_NIR_SPLIT(IDIM_EFF)) + ALLOCATE( ZPLAN_ABS_VIS_SPLIT(IDIM_EFF)) + ALLOCATE( ZPLAN_ABS_NIR_SPLIT(IDIM_EFF)) + ELSE + ALLOCATE( ZPLAN_ALB_VIS_SPLIT(0)) + ALLOCATE( ZPLAN_ALB_NIR_SPLIT(0)) + ALLOCATE( ZPLAN_TRA_VIS_SPLIT(0)) + ALLOCATE( ZPLAN_TRA_NIR_SPLIT(0)) + ALLOCATE( ZPLAN_ABS_VIS_SPLIT(0)) + ALLOCATE( ZPLAN_ABS_NIR_SPLIT(0)) + END IF +! + IF( KRAD_DIAG >= 4) THEN + ALLOCATE( ZEFCL_RRTM_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZCLSW_TOTAL_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZTAU_TOTAL_SPLIT(IDIM_EFF,KSWB_OLD,KFLEV)) + ALLOCATE( ZOMEGA_TOTAL_SPLIT(IDIM_EFF,KSWB_OLD,KFLEV)) + ALLOCATE( ZCG_TOTAL_SPLIT(IDIM_EFF,KSWB_OLD,KFLEV)) + ALLOCATE( ZEFCL_LWD_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZEFCL_LWU_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZFLWP_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZFIWP_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE( ZRADIP_SPLIT(IDIM_EFF,KFLEV)) + ELSE + ALLOCATE( ZEFCL_RRTM_SPLIT(0,0)) + ALLOCATE( ZCLSW_TOTAL_SPLIT(0,0)) + ALLOCATE( ZTAU_TOTAL_SPLIT(0,0,0)) + ALLOCATE( ZOMEGA_TOTAL_SPLIT(0,0,0)) + ALLOCATE( ZCG_TOTAL_SPLIT(0,0,0)) + ALLOCATE( ZEFCL_LWD_SPLIT(0,0)) + ALLOCATE( ZEFCL_LWU_SPLIT(0,0)) + ALLOCATE( ZFLWP_SPLIT(0,0)) + ALLOCATE( ZFIWP_SPLIT(0,0)) + ALLOCATE( ZRADIP_SPLIT(0,0)) + END IF +! +! C2R2 coupling +! + IF (SIZE (ZCCT_C2R2) > 0) THEN + ALLOCATE (ZCCT_C2R2_SPLIT(IDIM_EFF,KFLEV)) + ELSE + ALLOCATE (ZCCT_C2R2_SPLIT(0,0)) + END IF +! + IF (SIZE (ZCRT_C2R2) > 0) THEN + ALLOCATE (ZCRT_C2R2_SPLIT(IDIM_EFF,KFLEV)) + ELSE + ALLOCATE (ZCRT_C2R2_SPLIT(0,0)) + END IF +! + IF (SIZE (ZCIT_C1R3) > 0) THEN + ALLOCATE (ZCIT_C1R3_SPLIT(IDIM_EFF,KFLEV)) + ELSE + ALLOCATE (ZCIT_C1R3_SPLIT(0,0)) + END IF +! +! LIMA coupling +! + IF( CCLOUD == 'LIMA' ) THEN + ALLOCATE (ZCCT_LIMA_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE (ZCRT_LIMA_SPLIT(IDIM_EFF,KFLEV)) + ALLOCATE (ZCIT_LIMA_SPLIT(IDIM_EFF,KFLEV)) + END IF + END IF +! +! fill the split arrays with their values taken from the full arrays +! + IBEG = IDIM-IDIM_RESIDUE+1 + IEND = IBEG+IDIM_EFF-1 +! + ZALBP_SPLIT(:,:) = ZALBP( IBEG:IEND ,:) + ZALBD_SPLIT(:,:) = ZALBD( IBEG:IEND ,:) + ZEMIS_SPLIT(:) = ZEMIS ( IBEG:IEND,1 ) + ZEMIW_SPLIT(:) = ZEMIW ( IBEG:IEND,1 ) + ZRMU0_SPLIT(:) = ZRMU0 ( IBEG:IEND ) + ZLAT_SPLIT(:) = ZLAT ( IBEG:IEND ) + ZLON_SPLIT(:) = ZLON ( IBEG:IEND ) + ZCFAVE_SPLIT(:,:) = ZCFAVE( IBEG:IEND ,:) + ZO3AVE_SPLIT(:,:) = ZO3AVE( IBEG:IEND ,:) + ZT_HL_SPLIT(:,:) = ZT_HL( IBEG:IEND ,:) + ZPRES_HL_SPLIT(:,:) = ZPRES_HL( IBEG:IEND ,:) + ZQLAVE_SPLIT(:,:) = ZQLAVE( IBEG:IEND , :) + ZDZ_SPLIT(:,:) = ZDZ( IBEG:IEND , :) + ZQIAVE_SPLIT(:,:) = ZQIAVE( IBEG:IEND ,:) + ZQRAVE_SPLIT (:,:) = ZQRAVE (IBEG:IEND ,:) + ZQLWC_SPLIT(:,:) = ZQLWC( IBEG:IEND , :) + ZQIWC_SPLIT(:,:) = ZQIWC( IBEG:IEND ,:) + ZQRWC_SPLIT(:,:) = ZQRWC (IBEG:IEND ,:) + ZQVAVE_SPLIT(:,:) = ZQVAVE( IBEG:IEND ,:) + ZTAVE_SPLIT(:,:) = ZTAVE ( IBEG:IEND ,:) + ZPAVE_SPLIT(:,:) = ZPAVE ( IBEG:IEND ,:) + ZAER_SPLIT (:,:,:) = ZAER ( IBEG:IEND ,:,:) + IF(CAOP=='EXPL')THEN + ZPIZA_EQ_SPLIT(:,:,:)=ZPIZA_EQ(IBEG:IEND,:,:) + ZCGA_EQ_SPLIT(:,:,:)=ZCGA_EQ(IBEG:IEND,:,:) + ZTAUREL_EQ_SPLIT(:,:,:)=ZTAUREL_EQ(IBEG:IEND,:,:) + ENDIF + ZDPRES_SPLIT(:,:) = ZDPRES (IBEG:IEND ,:) + ZLSM_SPLIT (:) = ZLSM (IBEG:IEND) + ZQSAVE_SPLIT (:,:) = ZQSAVE (IBEG:IEND ,:) + ZTS_SPLIT (:) = ZTS (IBEG:IEND) +! +! CALL the ECMWF radiation with the split array +! + IF (CCLOUD == 'LIMA') THEN +! LIMA concentrations + ZCCT_LIMA_SPLIT(:,:) = ZCCT_LIMA (IBEG:IEND ,:) + ZCRT_LIMA_SPLIT(:,:) = ZCRT_LIMA (IBEG:IEND ,:) + ZCIT_LIMA_SPLIT(:,:) = ZCIT_LIMA (IBEG:IEND ,:) + + IF (CRAD == "ECMW") THEN +! + CALL ECMWF_RADIATION_VERS2 ( IDIM_EFF , KFLEV, KRAD_DIAG, KAER, & + ZDZ_SPLIT,HEFRADL,HEFRADI,HOPWSW, HOPISW, HOPWLW, HOPILW,PFUDG, & + ZRII0, ZAER_SPLIT , ZALBD_SPLIT, ZALBP_SPLIT, ZPRES_HL_SPLIT, & + ZPAVE_SPLIT,PCCO2, ZCFAVE_SPLIT, ZDPRES_SPLIT, ZEMIS_SPLIT, ZEMIW_SPLIT, & + ZLSM_SPLIT, ZRMU0_SPLIT,ZO3AVE_SPLIT , ZQVAVE_SPLIT, ZQIAVE_SPLIT ,ZQIWC_SPLIT, & + ZQLAVE_SPLIT,ZQLWC_SPLIT,ZQSAVE_SPLIT, ZQRAVE_SPLIT,ZQRWC_SPLIT, ZT_HL_SPLIT, & + ZTAVE_SPLIT, ZTS_SPLIT, ZCCT_LIMA_SPLIT,ZCRT_LIMA_SPLIT,ZCIT_LIMA_SPLIT, & + ZNFLW_CS_SPLIT, ZNFLW_SPLIT, ZNFSW_CS_SPLIT,ZNFSW_SPLIT, & + ZDTLW_SPLIT, ZDTSW_SPLIT, ZFLUX_TOP_GND_IRVISNIR_SPLIT, & + ZSFSWDIR_SPLIT, ZSFSWDIF_SPLIT, & + ZFLUX_SW_DOWN_SPLIT, ZFLUX_SW_UP_SPLIT, ZFLUX_LW_SPLIT , & + ZDTLW_CS_SPLIT, ZDTSW_CS_SPLIT, ZFLUX_TOP_GND_IRVISNIR_CS_SPLIT, & + ZFLUX_SW_DOWN_CS_SPLIT, ZFLUX_SW_UP_CS_SPLIT, ZFLUX_LW_CS_SPLIT, & + ZPLAN_ALB_VIS_SPLIT,ZPLAN_ALB_NIR_SPLIT, ZPLAN_TRA_VIS_SPLIT, & + ZPLAN_TRA_NIR_SPLIT, ZPLAN_ABS_VIS_SPLIT, ZPLAN_ABS_NIR_SPLIT, & + ZEFCL_LWD_SPLIT, ZEFCL_LWU_SPLIT, ZFLWP_SPLIT,ZFIWP_SPLIT, & + ZRADLP_SPLIT,ZRADIP_SPLIT,ZEFCL_RRTM_SPLIT, ZCLSW_TOTAL_SPLIT, & + ZTAU_TOTAL_SPLIT,ZOMEGA_TOTAL_SPLIT, ZCG_TOTAL_SPLIT, & + GAOP,ZPIZA_EQ_SPLIT,ZCGA_EQ_SPLIT,ZTAUREL_EQ_SPLIT ) + + ELSE IF (CRAD == "ECRA") THEN + CALL ECRAD_INTERFACE ( IDIM_EFF ,KFLEV, KRAD_DIAG, KAER, & + ZDZ,HEFRADL,HEFRADI,HOPWSW, HOPISW, HOPWLW, HOPILW,PFUDG, & + ZRII0, ZAER_SPLIT , ZALBD_SPLIT, ZALBP_SPLIT, ZPRES_HL_SPLIT, ZPAVE_SPLIT, & + PCCO2, ZCFAVE_SPLIT, ZDPRES_SPLIT, ZEMIS_SPLIT, ZEMIW_SPLIT, ZLSM_SPLIT, ZRMU0_SPLIT, & + ZO3AVE_SPLIT , ZQVAVE_SPLIT, ZQIAVE_SPLIT ,ZQIWC_SPLIT,ZQLAVE_SPLIT,ZQLWC_SPLIT, & + ZQSAVE_SPLIT, ZQRAVE_SPLIT, ZQRWC_SPLIT, & + ZT_HL_SPLIT,ZTAVE_SPLIT, ZTS_SPLIT, ZCCT_LIMA_SPLIT, & + ZCRT_LIMA_SPLIT, ZCIT_LIMA_SPLIT, & + ZNFLW_SPLIT, ZNFSW_SPLIT, ZNFLW_CS_SPLIT, ZNFSW_CS_SPLIT, & + ZDTLW_SPLIT, ZDTSW_SPLIT, ZFLUX_TOP_GND_IRVISNIR_SPLIT, & + ZSFSWDIR_SPLIT, ZSFSWDIF_SPLIT, & + ZFLUX_SW_DOWN_SPLIT, ZFLUX_SW_UP_SPLIT, ZFLUX_LW_SPLIT , & + ZDTLW_CS_SPLIT, ZDTSW_CS_SPLIT, ZFLUX_TOP_GND_IRVISNIR_CS_SPLIT, & + ZFLUX_SW_DOWN_CS_SPLIT, ZFLUX_SW_UP_CS_SPLIT, ZFLUX_LW_CS_SPLIT, & + ZPLAN_ALB_VIS_SPLIT,ZPLAN_ALB_NIR_SPLIT, ZPLAN_TRA_VIS_SPLIT, ZPLAN_TRA_NIR_SPLIT, & + ZPLAN_ABS_VIS_SPLIT, ZPLAN_ABS_NIR_SPLIT,ZEFCL_LWD_SPLIT, ZEFCL_LWU_SPLIT, & + ZFLWP_SPLIT, ZFIWP_SPLIT,ZRADLP_SPLIT, ZRADIP_SPLIT, & + ZEFCL_RRTM_SPLIT, ZCLSW_TOTAL_SPLIT, ZTAU_TOTAL_SPLIT, & + ZOMEGA_TOTAL_SPLIT,ZCG_TOTAL_SPLIT, & + GAOP, ZPIZA_EQ_SPLIT,ZCGA_EQ_SPLIT,ZTAUREL_EQ_SPLIT,ZLAT_SPLIT,ZLON_SPLIT ) + END IF + ELSE +! C2R2 concentrations + IF (SIZE (ZCCT_C2R2) > 0) ZCCT_C2R2_SPLIT(:,:) = ZCCT_C2R2 (IBEG:IEND ,:) + IF (SIZE (ZCRT_C2R2) > 0) ZCRT_C2R2_SPLIT(:,:) = ZCRT_C2R2 (IBEG:IEND ,:) + IF (SIZE (ZCIT_C1R3) > 0) ZCIT_C1R3_SPLIT(:,:) = ZCIT_C1R3 (IBEG:IEND ,:) + IF (CRAD == "ECMW") THEN + CALL ECMWF_RADIATION_VERS2 ( IDIM_EFF , KFLEV, KRAD_DIAG, KAER, & + ZDZ_SPLIT,HEFRADL,HEFRADI,HOPWSW, HOPISW, HOPWLW, HOPILW,PFUDG, & + ZRII0, ZAER_SPLIT , ZALBD_SPLIT, ZALBP_SPLIT, ZPRES_HL_SPLIT, & + ZPAVE_SPLIT,PCCO2, ZCFAVE_SPLIT, ZDPRES_SPLIT, ZEMIS_SPLIT, ZEMIW_SPLIT, & + ZLSM_SPLIT, ZRMU0_SPLIT,ZO3AVE_SPLIT , ZQVAVE_SPLIT, ZQIAVE_SPLIT ,ZQIWC_SPLIT, & + ZQLAVE_SPLIT,ZQLWC_SPLIT,ZQSAVE_SPLIT, ZQRAVE_SPLIT,ZQRWC_SPLIT, ZT_HL_SPLIT, & + ZTAVE_SPLIT, ZTS_SPLIT, ZCCT_C2R2_SPLIT,ZCRT_C2R2_SPLIT,ZCIT_C1R3_SPLIT, & + ZNFLW_CS_SPLIT, ZNFLW_SPLIT, ZNFSW_CS_SPLIT,ZNFSW_SPLIT, & + ZDTLW_SPLIT, ZDTSW_SPLIT, ZFLUX_TOP_GND_IRVISNIR_SPLIT, & + ZSFSWDIR_SPLIT, ZSFSWDIF_SPLIT, & + ZFLUX_SW_DOWN_SPLIT, ZFLUX_SW_UP_SPLIT, ZFLUX_LW_SPLIT , & + ZDTLW_CS_SPLIT, ZDTSW_CS_SPLIT, ZFLUX_TOP_GND_IRVISNIR_CS_SPLIT, & + ZFLUX_SW_DOWN_CS_SPLIT, ZFLUX_SW_UP_CS_SPLIT, ZFLUX_LW_CS_SPLIT, & + ZPLAN_ALB_VIS_SPLIT,ZPLAN_ALB_NIR_SPLIT, ZPLAN_TRA_VIS_SPLIT, & + ZPLAN_TRA_NIR_SPLIT, ZPLAN_ABS_VIS_SPLIT, ZPLAN_ABS_NIR_SPLIT, & + ZEFCL_LWD_SPLIT, ZEFCL_LWU_SPLIT, ZFLWP_SPLIT,ZFIWP_SPLIT, & + ZRADLP_SPLIT,ZRADIP_SPLIT,ZEFCL_RRTM_SPLIT, ZCLSW_TOTAL_SPLIT, & + ZTAU_TOTAL_SPLIT,ZOMEGA_TOTAL_SPLIT, ZCG_TOTAL_SPLIT, & + GAOP,ZPIZA_EQ_SPLIT,ZCGA_EQ_SPLIT,ZTAUREL_EQ_SPLIT ) + + ELSE IF (CRAD == "ECRA") THEN + CALL ECRAD_INTERFACE ( IDIM_EFF ,KFLEV, KRAD_DIAG, KAER, & + ZDZ_SPLIT,HEFRADL,HEFRADI,HOPWSW, HOPISW, HOPWLW, HOPILW,PFUDG, & + ZRII0, ZAER_SPLIT , ZALBD_SPLIT, ZALBP_SPLIT, ZPRES_HL_SPLIT, ZPAVE_SPLIT, & + PCCO2, ZCFAVE_SPLIT, ZDPRES_SPLIT, ZEMIS_SPLIT, ZEMIW_SPLIT, ZLSM_SPLIT, ZRMU0_SPLIT, & + ZO3AVE_SPLIT , ZQVAVE_SPLIT, ZQIAVE_SPLIT ,ZQIWC_SPLIT,ZQLAVE_SPLIT,ZQLWC_SPLIT, & + ZQSAVE_SPLIT, ZQRAVE_SPLIT, ZQRWC_SPLIT, & + ZT_HL_SPLIT,ZTAVE_SPLIT, ZTS_SPLIT, ZCCT_C2R2_SPLIT, & + ZCRT_C2R2_SPLIT, ZCIT_C1R3_SPLIT, & + ZNFLW_SPLIT, ZNFSW_SPLIT, ZNFLW_CS_SPLIT, ZNFSW_CS_SPLIT, & + ZDTLW_SPLIT, ZDTSW_SPLIT, ZFLUX_TOP_GND_IRVISNIR_SPLIT, & + ZSFSWDIR_SPLIT, ZSFSWDIF_SPLIT, & + ZFLUX_SW_DOWN_SPLIT, ZFLUX_SW_UP_SPLIT, ZFLUX_LW_SPLIT , & + ZDTLW_CS_SPLIT, ZDTSW_CS_SPLIT, ZFLUX_TOP_GND_IRVISNIR_CS_SPLIT, & + ZFLUX_SW_DOWN_CS_SPLIT, ZFLUX_SW_UP_CS_SPLIT, ZFLUX_LW_CS_SPLIT, & + ZPLAN_ALB_VIS_SPLIT,ZPLAN_ALB_NIR_SPLIT, ZPLAN_TRA_VIS_SPLIT, ZPLAN_TRA_NIR_SPLIT, & + ZPLAN_ABS_VIS_SPLIT, ZPLAN_ABS_NIR_SPLIT,ZEFCL_LWD_SPLIT, ZEFCL_LWU_SPLIT, & + ZFLWP_SPLIT, ZFIWP_SPLIT,ZRADLP_SPLIT, ZRADIP_SPLIT, & + ZEFCL_RRTM_SPLIT, ZCLSW_TOTAL_SPLIT, ZTAU_TOTAL_SPLIT, & + ZOMEGA_TOTAL_SPLIT,ZCG_TOTAL_SPLIT, & + GAOP, ZPIZA_EQ_SPLIT,ZCGA_EQ_SPLIT,ZTAUREL_EQ_SPLIT,ZLAT_SPLIT,ZLON_SPLIT ) + END IF + END IF +! +! fill the full output arrays with the split arrays +! + ZDTLW( IBEG:IEND ,:) = ZDTLW_SPLIT(:,:) + ZDTSW( IBEG:IEND ,:) = ZDTSW_SPLIT(:,:) + ZFLUX_TOP_GND_IRVISNIR( IBEG:IEND ,:)= ZFLUX_TOP_GND_IRVISNIR_SPLIT(:,:) + ZSFSWDIR (IBEG:IEND,:) = ZSFSWDIR_SPLIT(:,:) + ZSFSWDIF (IBEG:IEND,:) = ZSFSWDIF_SPLIT(:,:) +! + ZDTLW_CS( IBEG:IEND ,:) = ZDTLW_CS_SPLIT(:,:) + ZDTSW_CS( IBEG:IEND ,:) = ZDTSW_CS_SPLIT(:,:) + ZFLUX_TOP_GND_IRVISNIR_CS( IBEG:IEND ,:) = & + ZFLUX_TOP_GND_IRVISNIR_CS_SPLIT(:,:) + ZFLUX_LW( IBEG:IEND ,:,:) = ZFLUX_LW_SPLIT(:,:,:) + ZFLUX_SW_DOWN( IBEG:IEND ,:) = ZFLUX_SW_DOWN_SPLIT(:,:) + ZFLUX_SW_UP( IBEG:IEND ,:) = ZFLUX_SW_UP_SPLIT(:,:) + ZRADLP( IBEG:IEND ,:) = ZRADLP_SPLIT(:,:) + IF ( tpfile%lopened ) THEN + IF( KRAD_DIAG >= 1) THEN + ZNFLW(IBEG:IEND ,:)= ZNFLW_SPLIT(:,:) + ZNFSW(IBEG:IEND ,:)= ZNFSW_SPLIT(:,:) + IF( KRAD_DIAG >= 2) THEN + ZFLUX_SW_DOWN_CS( IBEG:IEND ,:) = ZFLUX_SW_DOWN_CS_SPLIT(:,:) + ZFLUX_SW_UP_CS( IBEG:IEND ,:) = ZFLUX_SW_UP_CS_SPLIT(:,:) + ZFLUX_LW_CS( IBEG:IEND ,:,:) = ZFLUX_LW_CS_SPLIT(:,:,:) + ZNFLW_CS(IBEG:IEND ,:)= ZNFLW_CS_SPLIT(:,:) + ZNFSW_CS(IBEG:IEND ,:)= ZNFSW_CS_SPLIT(:,:) + IF( KRAD_DIAG >= 3) THEN + ZPLAN_ALB_VIS( IBEG:IEND ) = ZPLAN_ALB_VIS_SPLIT(:) + ZPLAN_ALB_NIR( IBEG:IEND ) = ZPLAN_ALB_NIR_SPLIT(:) + ZPLAN_TRA_VIS( IBEG:IEND ) = ZPLAN_TRA_VIS_SPLIT(:) + ZPLAN_TRA_NIR( IBEG:IEND ) = ZPLAN_TRA_NIR_SPLIT(:) + ZPLAN_ABS_VIS( IBEG:IEND ) = ZPLAN_ABS_VIS_SPLIT(:) + ZPLAN_ABS_NIR( IBEG:IEND ) = ZPLAN_ABS_NIR_SPLIT(:) + IF( KRAD_DIAG >= 4) THEN + ZEFCL_LWD( IBEG:IEND ,:) = ZEFCL_LWD_SPLIT(:,:) + ZEFCL_LWU( IBEG:IEND ,:) = ZEFCL_LWU_SPLIT(:,:) + ZFLWP( IBEG:IEND ,:) = ZFLWP_SPLIT(:,:) + ZFIWP( IBEG:IEND ,:) = ZFIWP_SPLIT(:,:) + ZRADIP( IBEG:IEND ,:) = ZRADIP_SPLIT(:,:) + ZEFCL_RRTM( IBEG:IEND ,:) = ZEFCL_RRTM_SPLIT(:,:) + ZCLSW_TOTAL( IBEG:IEND ,:) = ZCLSW_TOTAL_SPLIT(:,:) + ZTAU_TOTAL( IBEG:IEND ,:,:) = ZTAU_TOTAL_SPLIT(:,:,:) + ZOMEGA_TOTAL( IBEG:IEND ,:,:)= ZOMEGA_TOTAL_SPLIT(:,:,:) + ZCG_TOTAL( IBEG:IEND ,:,:) = ZCG_TOTAL_SPLIT(:,:,:) + END IF + END IF + END IF + END IF + END IF +! + IDIM_RESIDUE = IDIM_RESIDUE - IDIM_EFF +! +! desallocation of the split arrays +! + IF( JI_SPLIT >= INUM_CALL-1 ) THEN + DEALLOCATE( ZALBP_SPLIT ) + DEALLOCATE( ZALBD_SPLIT ) + DEALLOCATE( ZEMIS_SPLIT ) + DEALLOCATE( ZEMIW_SPLIT ) + DEALLOCATE( ZLAT_SPLIT ) + DEALLOCATE( ZLON_SPLIT ) + DEALLOCATE( ZRMU0_SPLIT ) + DEALLOCATE( ZCFAVE_SPLIT ) + DEALLOCATE( ZO3AVE_SPLIT ) + DEALLOCATE( ZT_HL_SPLIT ) + DEALLOCATE( ZPRES_HL_SPLIT ) + DEALLOCATE( ZDZ_SPLIT ) + DEALLOCATE( ZQLAVE_SPLIT ) + DEALLOCATE( ZQIAVE_SPLIT ) + DEALLOCATE( ZQVAVE_SPLIT ) + DEALLOCATE( ZTAVE_SPLIT ) + DEALLOCATE( ZPAVE_SPLIT ) + DEALLOCATE( ZAER_SPLIT ) + DEALLOCATE( ZDPRES_SPLIT ) + DEALLOCATE( ZLSM_SPLIT ) + DEALLOCATE( ZQSAVE_SPLIT ) + DEALLOCATE( ZQRAVE_SPLIT ) + DEALLOCATE( ZQLWC_SPLIT ) + DEALLOCATE( ZQRWC_SPLIT ) + DEALLOCATE( ZQIWC_SPLIT ) + IF ( ALLOCATED( ZCCT_C2R2_SPLIT ) ) DEALLOCATE( ZCCT_C2R2_SPLIT ) + IF ( ALLOCATED( ZCRT_C2R2_SPLIT ) ) DEALLOCATE( ZCRT_C2R2_SPLIT ) + IF ( ALLOCATED( ZCIT_C1R3_SPLIT ) ) DEALLOCATE( ZCIT_C1R3_SPLIT ) + IF ( ALLOCATED( ZCCT_LIMA_SPLIT ) ) DEALLOCATE( ZCCT_LIMA_SPLIT ) + IF ( ALLOCATED( ZCRT_LIMA_SPLIT ) ) DEALLOCATE( ZCRT_LIMA_SPLIT ) + IF ( ALLOCATED( ZCIT_LIMA_SPLIT ) ) DEALLOCATE( ZCIT_LIMA_SPLIT ) + DEALLOCATE( ZTS_SPLIT ) + DEALLOCATE( ZNFLW_CS_SPLIT) + DEALLOCATE( ZNFLW_SPLIT) + DEALLOCATE( ZNFSW_CS_SPLIT) + DEALLOCATE( ZNFSW_SPLIT) + DEALLOCATE(ZDTLW_SPLIT) + DEALLOCATE(ZDTSW_SPLIT) + DEALLOCATE(ZFLUX_TOP_GND_IRVISNIR_SPLIT) + DEALLOCATE(ZSFSWDIR_SPLIT) + DEALLOCATE(ZSFSWDIF_SPLIT) + DEALLOCATE(ZFLUX_SW_DOWN_SPLIT) + DEALLOCATE(ZFLUX_SW_UP_SPLIT) + DEALLOCATE(ZFLUX_LW_SPLIT) + DEALLOCATE(ZDTLW_CS_SPLIT) + DEALLOCATE(ZDTSW_CS_SPLIT) + DEALLOCATE(ZFLUX_TOP_GND_IRVISNIR_CS_SPLIT) + DEALLOCATE(ZPLAN_ALB_VIS_SPLIT) + DEALLOCATE(ZPLAN_ALB_NIR_SPLIT) + DEALLOCATE(ZPLAN_TRA_VIS_SPLIT) + DEALLOCATE(ZPLAN_TRA_NIR_SPLIT) + DEALLOCATE(ZPLAN_ABS_VIS_SPLIT) + DEALLOCATE(ZPLAN_ABS_NIR_SPLIT) + DEALLOCATE(ZEFCL_LWD_SPLIT) + DEALLOCATE(ZEFCL_LWU_SPLIT) + DEALLOCATE(ZFLWP_SPLIT) + DEALLOCATE(ZRADLP_SPLIT) + DEALLOCATE(ZRADIP_SPLIT) + DEALLOCATE(ZFIWP_SPLIT) + DEALLOCATE(ZEFCL_RRTM_SPLIT) + DEALLOCATE(ZCLSW_TOTAL_SPLIT) + DEALLOCATE(ZTAU_TOTAL_SPLIT) + DEALLOCATE(ZOMEGA_TOTAL_SPLIT) + DEALLOCATE(ZCG_TOTAL_SPLIT) + DEALLOCATE(ZFLUX_SW_DOWN_CS_SPLIT) + DEALLOCATE(ZFLUX_SW_UP_CS_SPLIT) + DEALLOCATE(ZFLUX_LW_CS_SPLIT) + DEALLOCATE(ZPIZA_EQ_SPLIT) + DEALLOCATE(ZCGA_EQ_SPLIT) + DEALLOCATE(ZTAUREL_EQ_SPLIT) + END IF + END DO +END IF + +! +DEALLOCATE(ZTAVE) +DEALLOCATE(ZPAVE) +DEALLOCATE(ZQVAVE) +DEALLOCATE(ZQLAVE) +DEALLOCATE(ZDZ) +DEALLOCATE(ZQIAVE) +DEALLOCATE(ZCFAVE) +DEALLOCATE(ZPRES_HL) +DEALLOCATE(ZT_HL) +DEALLOCATE(ZRMU0) +DEALLOCATE(ZLSM) +DEALLOCATE(ZQSAVE) +DEALLOCATE(ZAER) +DEALLOCATE(ZPIZA_EQ) +DEALLOCATE(ZCGA_EQ) +DEALLOCATE(ZTAUREL_EQ) +DEALLOCATE(ZDPRES) +DEALLOCATE(ZCCT_C2R2) +DEALLOCATE(ZCRT_C2R2) +DEALLOCATE(ZCIT_C1R3) +DEALLOCATE(ZLAT) +DEALLOCATE(ZLON) +IF (CCLOUD == 'LIMA') THEN + DEALLOCATE(ZCCT_LIMA) + DEALLOCATE(ZCRT_LIMA) + DEALLOCATE(ZCIT_LIMA) +END IF +! +DEALLOCATE(ZTS) +DEALLOCATE(ZALBP) +DEALLOCATE(ZALBD) +DEALLOCATE(ZEMIS) +DEALLOCATE(ZEMIW) +DEALLOCATE(ZQRAVE) +DEALLOCATE(ZQLWC) +DEALLOCATE(ZQIWC) +DEALLOCATE(ZQRWC) +DEALLOCATE(ICLEAR_2D_TM1) +! +!* 5.6 UNCOMPRESSES THE OUTPUT FIELD IN CASE OF +! CLEAR-SKY APPROXIMATION +! +IF(OCLEAR_SKY .OR. OCLOUD_ONLY) THEN + ALLOCATE(ZWORK1(ICLOUD)) + ALLOCATE(ZWORK2(ICLOUD+KFLEV)) ! allocation for the KFLEV levels of + ALLOCATE(ZWORK4(KFLEV,KDLON)) + ZWORK2(:) = PACK( TRANSPOSE(ZDTLW(:,:)),MASK=.TRUE. ) +! + DO JK=1,KFLEV + ZWORK4(JK,:) = ZWORK2(ICLOUD+JK) + END DO + ZWORK1(1:ICLOUD) = ZWORK2(1:ICLOUD) + ZZDTLW(:,:) = TRANSPOSE( UNPACK( ZWORK1(:),MASK=GCLOUDT(:,:) & + ,FIELD=ZWORK4(:,:) ) ) + ! + ZWORK2(:) = PACK( TRANSPOSE(ZDTSW(:,:)),MASK=.TRUE. ) + DO JK=1,KFLEV + ZWORK4(JK,:) = ZWORK2(ICLOUD+JK) + END DO + ZWORK1(1:ICLOUD) = ZWORK2(1:ICLOUD) + ZZDTSW(:,:) = TRANSPOSE( UNPACK( ZWORK1(:),MASK=GCLOUDT(:,:) & + ,FIELD=ZWORK4(:,:) ) ) + ! + DEALLOCATE(ZWORK1) + DEALLOCATE(ZWORK2) + DEALLOCATE(ZWORK4) + ! + ZZTGVISC = ZFLUX_TOP_GND_IRVISNIR(ICLOUD_COL+1,5) + ! + ZZTGVIS(:) = UNPACK( ZFLUX_TOP_GND_IRVISNIR(:,5),MASK=.NOT.GCLEAR_2D(:), & + FIELD=ZZTGVISC ) + ZZTGNIRC = ZFLUX_TOP_GND_IRVISNIR(ICLOUD_COL+1,6) + ! + ZZTGNIR(:) = UNPACK( ZFLUX_TOP_GND_IRVISNIR(:,6),MASK=.NOT.GCLEAR_2D(:), & + FIELD=ZZTGNIRC ) + ZZTGIRC = ZFLUX_TOP_GND_IRVISNIR(ICLOUD_COL+1,4) + ! + ZZTGIR (:) = UNPACK( ZFLUX_TOP_GND_IRVISNIR(:,4),MASK=.NOT.GCLEAR_2D(:), & + FIELD=ZZTGIRC ) + ! + DO JSWB=1,ISWB + ZZSFSWDIRC(JSWB) = ZSFSWDIR (ICLOUD_COL+1,JSWB) + ! + ZZSFSWDIR(:,JSWB) = UNPACK(ZSFSWDIR (:,JSWB),MASK=.NOT.GCLEAR_2D(:), & + FIELD= ZZSFSWDIRC(JSWB) ) + ! + ZZSFSWDIFC(JSWB) = ZSFSWDIF (ICLOUD_COL+1,JSWB) + ! + ZZSFSWDIF(:,JSWB) = UNPACK(ZSFSWDIF (:,JSWB),MASK=.NOT.GCLEAR_2D(:), & + FIELD= ZZSFSWDIFC(JSWB) ) + END DO +! +! No cloud case +! + IF( GNOCL ) THEN + IF (SIZE(ZZDTLW,1)>1) THEN + ZZDTLW(1,:)= ZZDTLW(2,:) + ENDIF + IF (SIZE(ZZDTSW,1)>1) THEN + ZZDTSW(1,:)= ZZDTSW(2,:) + ENDIF + ZZTGVIS(1) = ZZTGVISC + ZZTGNIR(1) = ZZTGNIRC + ZZTGIR(1) = ZZTGIRC + ZZSFSWDIR(1,:) = ZZSFSWDIRC(:) + ZZSFSWDIF(1,:) = ZZSFSWDIFC(:) + END IF +ELSE + ZZDTLW(:,:) = ZDTLW(:,:) + ZZDTSW(:,:) = ZDTSW(:,:) + ZZTGVIS(:) = ZFLUX_TOP_GND_IRVISNIR(:,5) + ZZTGNIR(:) = ZFLUX_TOP_GND_IRVISNIR(:,6) + ZZTGIR(:) = ZFLUX_TOP_GND_IRVISNIR(:,4) + ZZSFSWDIR(:,:) = ZSFSWDIR(:,:) + ZZSFSWDIF(:,:) = ZSFSWDIF(:,:) +END IF +! +DEALLOCATE(ZDTLW) +DEALLOCATE(ZDTSW) +DEALLOCATE(ZSFSWDIR) +DEALLOCATE(ZSFSWDIF) +! +!-------------------------------------------------------------------------------------------- +! +!* 6. COMPUTES THE RADIATIVE SOURCES AND THE DOWNWARD SURFACE FLUXES in 2D horizontal +! ------------------------------------------------------------------------------ +! +! Computes the SW and LW radiative tendencies +! note : tendencies in K/s for MNH (from K/day) +! +ZDTRAD_LW(:,:,:)=0.0 +ZDTRAD_SW(:,:,:)=0.0 +DO JK=IKB,IKE + JKRAD= JK-JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZDTRAD_LW(JI,JJ,JK) = ZZDTLW(IIJ,JKRAD)/XDAY ! XDAY from modd_cst (day duration in s) + ZDTRAD_SW(JI,JJ,JK) = ZZDTSW(IIJ,JKRAD)/XDAY + END DO + END DO +END DO +! +! Computes the downward SW and LW surface fluxes + diffuse and direct contribution +! +ZLWD(:,:)=0. +ZSWDDIR(:,:,:)=0. +ZSWDDIF(:,:,:)=0. +! +DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZLWD(JI,JJ) = ZZTGIR(IIJ) + ZSWDDIR(JI,JJ,:) = ZZSFSWDIR (IIJ,:) + ZSWDDIF(JI,JJ,:) = ZZSFSWDIF (IIJ,:) + END DO +END DO +! +!final THETA_radiative tendency and surface fluxes +! +IF(OCLOUD_ONLY) THEN + + GCLOUD_SURF(:,:) = .FALSE. + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + GCLOUD_SURF(JI,JJ) = GCLOUD(IIJ,1) + END DO + END DO + + ZWORKL(:,:) = GCLOUD_SURF(:,:) + + DO JK = IKB,IKE + WHERE( ZWORKL(:,:) ) + PDTHRAD(:,:,JK) = (ZDTRAD_LW(:,:,JK)+ZDTRAD_SW(:,:,JK))/ZEXNT(:,:,JK) + ENDWHERE + END DO + ! + WHERE( ZWORKL(:,:) ) + PSRFLWD(:,:) = ZLWD(:,:) + ENDWHERE + DO JSWB=1,ISWB + WHERE( ZWORKL(:,:) ) + PSRFSWD_DIR (:,:,JSWB) = ZSWDDIR(:,:,JSWB) + PSRFSWD_DIF (:,:,JSWB) = ZSWDDIF(:,:,JSWB) + END WHERE + END DO +ELSE + PDTHRAD(:,:,:) = (ZDTRAD_LW(:,:,:)+ZDTRAD_SW(:,:,:))/ZEXNT(:,:,:) ! tendency in potential temperature + PDTHRADSW(:,:,:) = ZDTRAD_SW(:,:,:)/ZEXNT(:,:,:) + PDTHRADLW(:,:,:) = ZDTRAD_LW(:,:,:)/ZEXNT(:,:,:) + PSRFLWD(:,:) = ZLWD(:,:) + DO JSWB=1,ISWB + PSRFSWD_DIR (:,:,JSWB) = ZSWDDIR(:,:,JSWB) + PSRFSWD_DIF (:,:,JSWB) = ZSWDDIF(:,:,JSWB) + END DO +! +!sw and lw fluxes +! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + PSWU(JI,JJ,JK) = ZFLUX_SW_UP(IIJ,JKRAD) + PSWD(JI,JJ,JK) = ZFLUX_SW_DOWN(IIJ,JKRAD) + PLWU(JI,JJ,JK) = ZFLUX_LW(IIJ,1,JKRAD) + PLWD(JI,JJ,JK) = -ZFLUX_LW(IIJ,2,JKRAD) ! in ECMWF all fluxes are upward + END DO + END DO + END DO +!!!effective radius + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + PRADEFF(JI,JJ,JK) = ZRADLP(IIJ,JKRAD) + END DO + END DO + END DO +END IF +! +! +!------------------------------------------------------------------------------- +! +!* 7. STORE SOME ADDITIONNAL RADIATIVE FIELDS +! --------------------------------------- +! +IF( tpfile%lopened .AND. (KRAD_DIAG >= 1) ) THEN + ZSTORE_3D(:,:,:) = 0.0 + ZSTORE_3D2(:,:,:) = 0.0 + ZSTORE_2D(:,:) = 0.0 + ! + IF( KRAD_DIAG >= 1) THEN + ! + ILUOUT = TLUOUT%NLU + WRITE(UNIT=ILUOUT,FMT='(/," STORE ADDITIONNAL RADIATIVE FIELDS:", & + & " KRAD_DIAG=",I1,/)') KRAD_DIAG + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZFLUX_SW_DOWN(IIJ,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'SWF_DOWN' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'SWF_DOWN' + TZFIELD%CUNITS = 'W m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_SWF_DOWN' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) +! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZFLUX_SW_UP(IIJ,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'SWF_UP' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'SWF_UP' + TZFIELD%CUNITS = 'W m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_SWF_UP' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) +! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = -ZFLUX_LW(IIJ,2,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'LWF_DOWN' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'LWF_DOWN' + TZFIELD%CUNITS = 'W m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_LWF_DOWN' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) +! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZFLUX_LW(IIJ,1,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'LWF_UP' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'LWF_UP' + TZFIELD%CUNITS = 'W m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_LWF_UP' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) +! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZNFLW(IIJ,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'LWF_NET' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'LWF_NET' + TZFIELD%CUNITS = 'W m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_LWF_NET' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) +! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZNFSW(IIJ,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'SWF_NET' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'SWF_NET' + TZFIELD%CUNITS = 'W m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_SWF_NET' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) +! + DO JK=IKB,IKE + DO JJ=IJB,IJE + DO JI=IIB,IIE + ZSTORE_3D(JI,JJ,JK) = ZDTRAD_LW (JI,JJ,JK)*XDAY + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'DTRAD_LW' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'DTRAD_LW' + TZFIELD%CUNITS = 'K day-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_DTRAD_LW' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) +! + DO JK=IKB,IKE + DO JJ=IJB,IJE + DO JI=IIB,IIE + ZSTORE_3D(JI,JJ,JK) = ZDTRAD_SW (JI,JJ,JK)*XDAY + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'DTRAD_SW' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'DTRAD_SW' + TZFIELD%CUNITS = 'K day-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_DTRAD_SW' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) +! + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_2D(JI,JJ) = ZFLUX_TOP_GND_IRVISNIR(IIJ,5) + END DO + END DO + TZFIELD%CMNHNAME = 'RADSWD_VIS' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'RADSWD_VIS' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_RADSWD_VIS' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_2D) +! + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_2D(JI,JJ) = ZFLUX_TOP_GND_IRVISNIR(IIJ,6) + END DO + END DO + TZFIELD%CMNHNAME = 'RADSWD_NIR' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'RADSWD_NIR' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_RADSWD_NIR' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_2D) + ! + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_2D(JI,JJ) = ZFLUX_TOP_GND_IRVISNIR(IIJ,4) + END DO + END DO + TZFIELD%CMNHNAME = 'RADLWD' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'RADLWD' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_RADLWD' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_2D) + END IF + ! + ! + IF( KRAD_DIAG >= 2) THEN + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZFLUX_SW_DOWN_CS(IIJ,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'SWF_DOWN_CS' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'SWF_DOWN_CS' + TZFIELD%CUNITS = 'W m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_SWF_DOWN_CS' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) + ! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZFLUX_SW_UP_CS(IIJ,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'SWF_UP_CS' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'SWF_UP_CS' + TZFIELD%CUNITS = 'W m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_SWF_UP_CS' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) + ! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = -ZFLUX_LW_CS(IIJ,2,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'LWF_DOWN_CS' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'LWF_DOWN_CS' + TZFIELD%CUNITS = 'W m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_LWF_DOWN_CS' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) + ! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZFLUX_LW_CS(IIJ,1,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'LWF_UP_CS' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'LWF_UP_CS' + TZFIELD%CUNITS = 'W m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_LWF_UP_CS' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) + ! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZNFLW_CS(IIJ,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'LWF_NET_CS' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'LWF_NET_CS' + TZFIELD%CUNITS = 'W m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_LWF_NET_CS' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) + ! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZNFSW_CS(IIJ,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'SWF_NET_CS' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'SWF_NET_CS' + TZFIELD%CUNITS = 'W m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_SWF_NET_CS' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) + ! + DO JK=IKB,IKE + JKRAD = JK-JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZDTSW_CS(IIJ,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'DTRAD_SW_CS' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'DTRAD_SW_CS' + TZFIELD%CUNITS = 'K day-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_DTRAD_SW_CS' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) + ! + DO JK=IKB,IKE + JKRAD = JK-JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZDTLW_CS(IIJ,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'DTRAD_LW_CS' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'DTRAD_LW_CS' + TZFIELD%CUNITS = 'K day-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_DTRAD_LW_CS' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) + ! + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_2D(JI,JJ) = ZFLUX_TOP_GND_IRVISNIR_CS(IIJ,5) + END DO + END DO + TZFIELD%CMNHNAME = 'RADSWD_VIS_CS' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'RADSWD_VIS_CS' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_RADSWD_VIS_CS' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_2D) + ! + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_2D(JI,JJ) = ZFLUX_TOP_GND_IRVISNIR_CS(IIJ,6) + END DO + END DO + TZFIELD%CMNHNAME = 'RADSWD_NIR_CS' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'RADSWD_NIR_CS' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_RADSWD_NIR_CS' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_2D) + ! + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_2D(JI,JJ) = ZFLUX_TOP_GND_IRVISNIR_CS(IIJ,4) + END DO + END DO + TZFIELD%CMNHNAME = 'RADLWD_CS' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'RADLWD_CS' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_RADLWD_CS' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_2D) + END IF + ! + ! + IF( KRAD_DIAG >= 3) THEN + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_2D(JI,JJ) = ZPLAN_ALB_VIS(IIJ) + END DO + END DO + TZFIELD%CMNHNAME = 'PLAN_ALB_VIS' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'PLAN_ALB_VIS' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_PLAN_ALB_VIS' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_2D) + ! + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_2D(JI,JJ) = ZPLAN_ALB_NIR(IIJ) + END DO + END DO + TZFIELD%CMNHNAME = 'PLAN_ALB_NIR' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'PLAN_ALB_NIR' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_PLAN_ALB_NIR' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_2D) + ! + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_2D(JI,JJ) = ZPLAN_TRA_VIS(IIJ) + END DO + END DO + TZFIELD%CMNHNAME = 'PLAN_TRA_VIS' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'PLAN_TRA_VIS' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_PLAN_TRA_VIS' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_2D) + ! + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_2D(JI,JJ) = ZPLAN_TRA_NIR(IIJ) + END DO + END DO + TZFIELD%CMNHNAME = 'PLAN_TRA_NIR' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'PLAN_TRA_NIR' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_PLAN_TRA_NIR' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_2D) + ! + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_2D(JI,JJ) = ZPLAN_ABS_VIS(IIJ) + END DO + END DO + TZFIELD%CMNHNAME = 'PLAN_ABS_VIS' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'PLAN_ABS_VIS' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_PLAN_ABS_VIS' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_2D) + ! + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_2D(JI,JJ) = ZPLAN_ABS_NIR(IIJ) + END DO + END DO + TZFIELD%CMNHNAME = 'PLAN_ABS_NIR' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'PLAN_ABS_NIR' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_PLAN_ABS_NIR' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_2D) + ! + ! + END IF +! +! + IF( KRAD_DIAG >= 4) THEN + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZEFCL_LWD(IIJ,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'EFNEB_DOWN' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'EFNEB_DOWN' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_EFNEB_DOWN' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) + ! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZEFCL_LWU(IIJ,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'EFNEB_UP' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'EFNEB_UP' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_EFNEB_UP' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) + ! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZFLWP(IIJ,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'FLWP' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'FLWP' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_FLWP' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) + ! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZFIWP(IIJ,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'FIWP' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'FIWP' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_FIWP' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) + ! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZRADLP(IIJ,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'EFRADL' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'EFRADL' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_RAD_microm' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) + ! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZRADIP(IIJ,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'EFRADI' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'EFRADI' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_RAD_microm' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) + ! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZCLSW_TOTAL(IIJ,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'SW_NEB' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'SW_NEB' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_SW_NEB' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) + ! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZEFCL_RRTM(IIJ,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'RRTM_LW_NEB' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'RRTM_LW_NEB' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_LW_NEB' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) + ! + ! spectral bands + IF (KSWB_OLD==6) THEN + INIR = 4 + ELSE + INIR = 2 + END IF + + DO JBAND=1,INIR-1 + WRITE(YBAND_NAME(JBAND),'(A3,I1)') 'VIS', JBAND + END DO + DO JBAND= INIR, KSWB_OLD + WRITE(YBAND_NAME(JBAND),'(A3,I1)') 'NIR', JBAND + END DO +! + DO JBAND=1,KSWB_OLD + TZFIELD%CMNHNAME = 'ODAER_'//YBAND_NAME(JBAND) + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_OD_'//YBAND_NAME(JBAND) + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZTAUAZ(:,:,:,JBAND)) + ! + TZFIELD%CMNHNAME = 'SSAAER_'//YBAND_NAME(JBAND) + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_SSA_'//YBAND_NAME(JBAND) + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZPIZAZ(:,:,:,JBAND)) + ! + TZFIELD%CMNHNAME = 'GAER_'//YBAND_NAME(JBAND) + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_G_'//YBAND_NAME(JBAND) + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZCGAZ(:,:,:,JBAND)) + ENDDO + + DO JBAND=1,KSWB_OLD + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZTAU_TOTAL(IIJ,JBAND,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'OTH_'//YBAND_NAME(JBAND) + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_OTH_'//YBAND_NAME(JBAND) + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) + ! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZOMEGA_TOTAL(IIJ,JBAND,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'SSA_'//YBAND_NAME(JBAND) + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_SSA_'//YBAND_NAME(JBAND) + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) + ! + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZCG_TOTAL(IIJ,JBAND,JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'ASF_'//YBAND_NAME(JBAND) + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_ASF_'//YBAND_NAME(JBAND) + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) + END DO + END IF + ! + ! + IF (KRAD_DIAG >= 5) THEN +! +! OZONE and AER optical thickness climato entering the ecmwf_radiation_vers2 +! note the vertical grid is re-inversed for graphic ! + DO JK=IKB,IKE + JKRAD = KFLEV+1 - JK + JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + IIJ = 1 + (JI-IIB) + (IIE-IIB+1)*(JJ-IJB) + ZSTORE_3D(JI,JJ,JK) = ZO3AVE(IIJ, JKRAD) + END DO + END DO + END DO + TZFIELD%CMNHNAME = 'O3CLIM' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'O3CLIM' + TZFIELD%CUNITS = 'Pa Pa-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_O3' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D) +! +!cumulated optical thickness of aerosols +!cumul begin from the top of the domain, not from the TOA ! +! +!land + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + ZSTORE_3D(JI,JJ,JK) = PAER(JI,JJ,JKRAD,1) + END DO + END DO + END DO +! + ZSTORE_2D (:,:) = 0. + DO JK=IKB,IKE + JK1=IKE-JK+IKB + ZSTORE_2D(:,:) = ZSTORE_2D(:,:) + ZSTORE_3D(:,:,JK1) + ZSTORE_3D2(:,:,JK1) = ZSTORE_2D(:,:) + END DO + TZFIELD%CMNHNAME = 'CUM_AER_LAND' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'CUM_AER_LAND' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_CUM_AER_OPT' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D2) +! +! sea + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + ZSTORE_3D(JI,JJ,JK) = PAER(JI,JJ,JKRAD,2) + END DO + END DO + END DO +!sum + ZSTORE_2D (:,:) = 0. + DO JK=IKB,IKE + JK1=IKE-JK+IKB + ZSTORE_2D(:,:) = ZSTORE_2D(:,:) + ZSTORE_3D(:,:,JK1) + ZSTORE_3D2(:,:,JK1) = ZSTORE_2D(:,:) + END DO +! + TZFIELD%CMNHNAME = 'CUM_AER_SEA' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'CUM_AER_SEA' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_CUM_AER_OPT' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D2) +! +! desert + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + ZSTORE_3D(JI,JJ,JK) = PAER(JI,JJ,JKRAD,3) + END DO + END DO + END DO +!sum + ZSTORE_2D (:,:) = 0. + DO JK=IKB,IKE + JK1=IKE-JK+IKB + ZSTORE_2D(:,:) = ZSTORE_2D(:,:) + ZSTORE_3D(:,:,JK1) + ZSTORE_3D2(:,:,JK1) = ZSTORE_2D(:,:) + END DO +! + TZFIELD%CMNHNAME = 'CUM_AER_DES' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'CUM_AER_DES' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_CUM_AER_OPT' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D2) +! +! urban + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + ZSTORE_3D(JI,JJ,JK) = PAER(JI,JJ,JKRAD,4) + END DO + END DO + END DO +!sum + ZSTORE_2D (:,:) = 0. + DO JK=IKB,IKE + JK1=IKE-JK+IKB + ZSTORE_2D(:,:) = ZSTORE_2D(:,:) + ZSTORE_3D(:,:,JK1) + ZSTORE_3D2(:,:,JK1) = ZSTORE_2D(:,:) + END DO +! + TZFIELD%CMNHNAME = 'CUM_AER_URB' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'CUM_AER_URB' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_CUM_AER_OPT' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D2) +! +! Volcanoes + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + ZSTORE_3D(JI,JJ,JK) = PAER(JI,JJ,JKRAD,5) + END DO + END DO + END DO +!sum + ZSTORE_2D (:,:) = 0. + DO JK=IKB,IKE + JK1=IKE-JK+IKB + ZSTORE_2D(:,:) = ZSTORE_2D(:,:) + ZSTORE_3D(:,:,JK1) + ZSTORE_3D2(:,:,JK1) = ZSTORE_2D(:,:) + END DO +! + TZFIELD%CMNHNAME = 'CUM_AER_VOL' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'CUM_AER_VOL' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_CUM_AER_OPT' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D2) +! +! stratospheric background + DO JK=IKB,IKE + JKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + ZSTORE_3D(JI,JJ,JK) = PAER(JI,JJ,JKRAD,6) + END DO + END DO + END DO +!sum + ZSTORE_2D (:,:) = 0. + DO JK=IKB,IKE + JK1=IKE-JK+IKB + ZSTORE_2D(:,:) = ZSTORE_2D(:,:) + ZSTORE_3D(:,:,JK1) + ZSTORE_3D2(:,:,JK1) = ZSTORE_2D(:,:) + END DO +! + TZFIELD%CMNHNAME = 'CUM_AER_STRB' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'CUM_AER_STRB' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_CUM_AER_OPT' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSTORE_3D2) + ENDIF +END IF +! +DEALLOCATE(ZNFLW_CS) +DEALLOCATE(ZNFLW) +DEALLOCATE(ZNFSW_CS) +DEALLOCATE(ZNFSW) +DEALLOCATE(ZFLUX_TOP_GND_IRVISNIR) +DEALLOCATE(ZFLUX_SW_DOWN) +DEALLOCATE(ZFLUX_SW_UP) +DEALLOCATE(ZFLUX_LW) +DEALLOCATE(ZDTLW_CS) +DEALLOCATE(ZDTSW_CS) +DEALLOCATE(ZFLUX_TOP_GND_IRVISNIR_CS) +DEALLOCATE(ZPLAN_ALB_VIS) +DEALLOCATE(ZPLAN_ALB_NIR) +DEALLOCATE(ZPLAN_TRA_VIS) +DEALLOCATE(ZPLAN_TRA_NIR) +DEALLOCATE(ZPLAN_ABS_VIS) +DEALLOCATE(ZPLAN_ABS_NIR) +DEALLOCATE(ZEFCL_LWD) +DEALLOCATE(ZEFCL_LWU) +DEALLOCATE(ZFLWP) +DEALLOCATE(ZFIWP) +DEALLOCATE(ZRADLP) +DEALLOCATE(ZRADIP) +DEALLOCATE(ZEFCL_RRTM) +DEALLOCATE(ZCLSW_TOTAL) +DEALLOCATE(ZTAU_TOTAL) +DEALLOCATE(ZOMEGA_TOTAL) +DEALLOCATE(ZCG_TOTAL) +DEALLOCATE(ZFLUX_SW_DOWN_CS) +DEALLOCATE(ZFLUX_SW_UP_CS) +DEALLOCATE(ZFLUX_LW_CS) +DEALLOCATE(ZO3AVE) +! +!------------------------------------------------------------------------------- +! +END SUBROUTINE RADIATIONS +! +END MODULE MODI_RADIATIONS diff --git a/src/mesonh/ext/read_all_data_grib_case.f90 b/src/mesonh/ext/read_all_data_grib_case.f90 new file mode 100644 index 0000000000000000000000000000000000000000..00ccf2824a8739dea6433cccdac47861b3fd2ec7 --- /dev/null +++ b/src/mesonh/ext/read_all_data_grib_case.f90 @@ -0,0 +1,2615 @@ +!MNH_LIC Copyright 1998-2021 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_READ_ALL_DATA_GRIB_CASE +! ################################# +INTERFACE +SUBROUTINE READ_ALL_DATA_GRIB_CASE(HFILE,TPPRE_REAL1,HGRIB,TPPGDFILE, & + PTIME_HORI,KVERB,ODUMMY_REAL ) +! +USE MODD_IO, ONLY: TFILEDATA +! +CHARACTER(LEN=4), INTENT(IN) :: HFILE ! which file ('ATM0','ATM1' or 'CHEM') +TYPE(TFILEDATA),POINTER,INTENT(INOUT) :: TPPRE_REAL1 ! PRE_REAL1 file +CHARACTER(LEN=28), INTENT(IN) :: HGRIB ! name of the GRIB file +TYPE(TFILEDATA), INTENT(IN) :: TPPGDFILE ! physiographic data file +INTEGER, INTENT(IN) :: KVERB ! verbosity level +LOGICAL, INTENT(IN) :: ODUMMY_REAL ! flag to interpolate dummy fields +REAL, INTENT(INOUT) :: PTIME_HORI ! time spent in hor. interpolations +! +END SUBROUTINE READ_ALL_DATA_GRIB_CASE +! +END INTERFACE +END MODULE MODI_READ_ALL_DATA_GRIB_CASE +! ########################################################################## + SUBROUTINE READ_ALL_DATA_GRIB_CASE(HFILE,TPPRE_REAL1,HGRIB,TPPGDFILE, & + PTIME_HORI,KVERB,ODUMMY_REAL ) +! ########################################################################## +! +!!**** *READ_ALL_DATA_GRIB_CASE* - reads data for the initialization of real cases. +!! +!! PURPOSE +!! ------- +! This routine reads the two input files : +! The PGD which is closed after reading +! The GRIB file +! Projection is read in READ_LFIFM_PGD (MODD_GRID). +! Grid and definition of large domain are read in PGD file and Grib files. +! The PGD files are also read in READ_LFIFM_PGD. +! The PGD file is closed. +! The MESO-NH domain is defined from PRE_REAL1.nam inputs in SET_SUBDOMAIN_CEP. +! Vertical grid is defined in READ_VER_GRID. +! PGD fields are stored on MESO-NH domain (in TRUNC_PGD). +!! +!!** METHOD +!! ------ +!! 0. Declarations +!! 1. Declaration of arguments +!! 2. Declaration of local variables +!! 1. Read PGD file +!! 1. Domain restriction +!! 2. Coordinate conversion to lat,lon system +!! 2. Read Grib fields +!! 3. Vertical grid +!! 4. Free all temporary allocations +!! +!! EXTERNAL +!! -------- +!! subroutine READ_LFIFM_PGD : to read PGD file +!! subroutine SET_SUBDOMAIN : to define the horizontal MESO-NH domain. +!! subroutine READ_VER_GRID : to read the vertical grid in namelist file. +!! subroutine HORIBL : horizontal bilinear interpolation +!! subroutine XYTOLATLON : projection from conformal to lat,lon +!! +!! Module MODI_SET_SUBDOMAIN : interface for subroutine SET_SUBDOMAIN +!! Module MODI_READ_VER_GRID : interface for subroutine READ_VER_GRID +!! Module MODI_HORIBL : interface for subroutine HORIBL +!! Module MODI_XYTOLATLON : interface for subroutine XYTOLATLON +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! Module MODD_CONF : contains configuration variables for all models. +!! NVERB : verbosity level for output-listing +!! Module MODD_LUNIT : contains logical unit names for all models +!! TLUOUT0 : name of output-listing +!! Module MODD_PGDDIM : contains dimension of PGD fields +!! NPGDIMAX: dimension along x (no external point) +!! NPGDJMAX: dimension along y (no external point) +!! Module MODD_PARAMETERS +!! JPHEXT +!! +!! REFERENCE +!! --------- +!! +!! Book 1 : Informations on ISBA model (soil moisture) +!! "Encoding and decoding Grib data", John D.Chambers, ECMWF, October 95 +!! "A guide to Grib", John D.Stackpole, National weather service, March 94 +!! +!! AUTHOR +!! ------ +!! +!! J. Pettre and V. Bousquet +!! +!! MODIFICATIONS +!! ------------- +!! Original 20/11/98 +!! 15/03/99 (V. Masson) phasing with new PGD fields +!! 21/04/99 (V. Masson) bug in mask definitions for max Y index +!! 22/04/99 (V. Masson) optimizer bug in u,v loop +!! --> splitting of the loop +!! and splitting of the routine in more +!! contains +!! 28/05/99 (V. Bousquet) bug in wind interpolated variable for +!! Arpege +!! 31/05/99 (V. Masson) set pressure points (given on a regular grid at ECMWF) +!! on orography points (assuming the last are included in the former) +!! pressure computation from parameters A and B +!! (instead of interpolation from grib grid) +!! 20/07/00 (V. Masson) increase the threshold for land_sea index +!! 22/11/00 (P. Tulet) add INTERPOL_SV to initialize SV fields +!! (I. Mallet) from MOCAGE model (IMODE=3) +!! 01/02/01 (D. Gazen) add INI_NSV +!! 18/05/01 (P. Jabouille) problem with 129 grib code +!! 05/12/01 (I. Mallet) add Aladin reunion model +!! 02/10/02 (I. Mallet) 2 orography fields for CEP (SFC, ML=1) +!! 01/12/03 (D. Gazen) change Chemical scheme interface +!! 01/2004 (V. Masson) removes surface (externalization) +!! 01/06/02 (O.Nuissier) filtering of tropical cyclone +!! 01/05/04 (P. Tulet) add INTERPOL_SV to initialize SV dust +!! and aerosol fields +!! 08/06/2010 (G. Tanguy) replace GRIBEX by GRIB_API : change +!! of all the subroutine +!! 05/12/2016 (G.Delautier) length of HGRID for grib_api > 1.14 +!! 08/03/2018 (P.Wautelet) replace ADD_FORECAST_TO_DATE by DATETIME_CORRECTDATE +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +!! Pergaud : 2018 add GFS +!! 01/2019 (G.Delautier via Q.Rodier) for GRIB2 ARPEGE and AROME from EPYGRAM +!! Bielli S. 02/2019 Sea salt : significant sea wave height influences salt emission; 5 salt modes +! P. Wautelet 14/03/2019: correct ZWS when variable not present in file +! P. Wautelet 10/04/2019: replace ABORT and STOP calls by Print_msg +! Q. Rodier 16/09/2019: switch of GRIB number ID for orography in ARPEGE/AROME in EPyGrAM +! Q. Rodier 27/01/2020: switch of GRIB number ID for orography and hydrometeors in ARPEGE/AROME in EPyGrAM v1.3.7 +! Q. Rodier 21/04/2020: correction GFS u and v wind component written in the right vertical order +! Q. Rodier 02/09/2020: Read and interpol geopotential height for interpolation on isobaric surface Grid of NCEP +! P. Wautelet 09/03/2021: move some chemistry initializations to ini_nsv +!JP Chaboureau 02/08/2021: add ERA5 reanalysis in pressure levels +!JP Chaboureau 18/10/2022: correction on vertical level for GFS and ERA5 reanalyses in pressure levels +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +!------------ +! +USE MODE_DATETIME +USE MODE_IO_FILE, ONLY: IO_File_close +USE MODE_MSG +USE MODE_TIME +USE MODE_THERMO +USE MODE_TOOLS, ONLY: UPCASE +use mode_tools_ll, only: GET_DIM_EXT_ll +! +USE MODI_READ_HGRID_n +USE MODI_READ_VER_GRID +USE MODI_XYTOLATLON +USE MODI_HORIBL +USE MODI_INI_NSV +USE MODI_REMOVAL_VORTEX +USE MODI_CH_OPEN_INPUT +! +USE MODD_IO, ONLY: TFILEDATA +USE MODD_FIELD_n, ONLY: XZWS, XZWS_DEFAULT +USE MODD_CONF +USE MODD_CONF_n +USE MODD_CST +USE MODD_LUNIT +USE MODD_PARAMETERS +USE MODD_GRID +USE MODD_GRID_n +USE MODD_DIM_n +USE MODD_PARAM_n, ONLY : CTURB +USE MODD_TIME +USE MODD_TIME_n +USE MODD_CH_MNHC_n, ONLY : LUSECHEM,LUSECHAQ,LUSECHIC,LCH_PH +USE MODD_CH_M9_n, ONLY : NEQ , CNAMES +USE MODD_CH_AEROSOL, ONLY: CORGANIC, NCARB, NSOA, NSP, LORILAM,& + JPMODE, LVARSIGI, LVARSIGJ +USE MODD_NSV , ONLY : NSV +USE MODD_HURR_CONF, ONLY : LFILTERING,CFILTERING +USE MODD_PREP_REAL +USE MODE_MODELN_HANDLER +!JUAN REALZ +USE MODE_MPPDB +!JUAN REALZ +! +USE GRIB_API +! +IMPLICIT NONE +! +!* 0.1. Declaration of arguments +! ------------------------ +! +CHARACTER(LEN=4), INTENT(IN) :: HFILE ! which file ('ATM0','ATM1' or 'CHEM') +TYPE(TFILEDATA),POINTER,INTENT(INOUT) :: TPPRE_REAL1! PRE_REAL1 file +CHARACTER(LEN=28), INTENT(IN) :: HGRIB ! name of the GRIB file +TYPE(TFILEDATA), INTENT(IN) :: TPPGDFILE ! physiographic data file +INTEGER, INTENT(IN) :: KVERB ! verbosity level +LOGICAL, INTENT(IN) :: ODUMMY_REAL ! flag to interpolate dummy fields +REAL, INTENT(INOUT) :: PTIME_HORI ! time spent in hor. interpolations +! +!* 0.2 Declaration of local variables +! ------------------------------ +! General purpose variables +INTEGER :: ILUOUT0 ! Unit used for output msg. +INTEGER :: IRESP ! Return code of FM-routines +INTEGER :: IRET ! Return code from subroutines +INTEGER(KIND=kindOfInt) :: IRET_GRIB ! Return code from subroutines +INTEGER, PARAMETER :: JP_GFS=31 ! number of pressure levels for GFS model +INTEGER, PARAMETER :: JP_ERA=37 ! number of pressure levels for ERA5 reanalysis +REAL :: ZA,ZB,ZC ! Dummy variables +REAL :: ZD,ZE,ZF ! | +REAL :: ZTEMP ! | +INTEGER :: JI,JJ ! Dummy counters +INTEGER :: JLOOP1,JLOOP2 ! | +INTEGER :: JLOOP3,JLOOP4 ! | +INTEGER :: JLOOP ! | +! Variables used by the PGD reader +CHARACTER(LEN=28) :: YPGD_NAME ! not used - dummy argument +CHARACTER(LEN=28) :: YPGD_DAD_NAME ! not used - dummy argument +CHARACTER(LEN=2) :: YPGD_TYPE ! not used - dummy argument +! PGD Grib definition variables +INTEGER :: INO ! Number of points of the grid +INTEGER :: IIU ! Number of points along X +INTEGER :: IJU ! Number of points along Y +REAL, DIMENSION(:), ALLOCATABLE :: ZXOUT ! mapping PGD -> Grib (lon.) +REAL, DIMENSION(:), ALLOCATABLE :: ZYOUT ! mapping PGD -> Grib (lat.) +REAL, DIMENSION(:), ALLOCATABLE :: ZLONOUT ! mapping PGD -> Grib (lon.) +REAL, DIMENSION(:), ALLOCATABLE :: ZLATOUT ! mapping PGD -> Grib (lat.) +REAL, DIMENSION(:,:), ALLOCATABLE :: ZXM ! X of PGD mass points +REAL, DIMENSION(:,:), ALLOCATABLE :: ZYM ! Y of PGD mass points +REAL, DIMENSION(:,:), ALLOCATABLE :: ZLATM ! Lat of PGD mass points +REAL, DIMENSION(:,:), ALLOCATABLE :: ZLONM ! Lon of PGD mass points +! Variable involved in the task of reading the grib file +INTEGER(KIND=kindOfInt) :: IUNIT ! unit of the grib file +CHARACTER(LEN=50) :: HGRID ! type of grid +INTEGER :: IPAR ! Parameter identifier +INTEGER :: ITYP ! type of level (Grib code table 3) +INTEGER :: ILEV1 ! level definition +INTEGER :: ILEV2 ! level definition +INTEGER :: IMODEL ! Type of Grib file : + ! 0 -> ECMWF + ! 1 -> METEO FRANCE - ALADIN/AROME + ! 2 -> METEO FRANCE - ALADIN-REUNION + ! 3 -> METEO FRANCE - ARPEGE + ! 4 -> METEO FRANCE - ARPEGE + ! 5 -> METEO FRANCE - MOCAGE + ! 10 -> NCEP - GFS +INTEGER :: ICENTER ! number of center +INTEGER :: ISIZE ! size of grib message +INTEGER(KIND=kindOfInt) :: ICOUNT ! number of messages in the file +INTEGER(KIND=kindOfInt),DIMENSION(:),ALLOCATABLE :: IGRIB ! number of the grib in memory +INTEGER :: INUM ,INUM_ZS ! number of a grib message +REAL,DIMENSION(:),ALLOCATABLE :: ZPARAM ! parameter of grib grid +INTEGER,DIMENSION(:),ALLOCATABLE :: IINLO ! longitude of grib grid +INTEGER(KIND=kindOfInt),DIMENSION(:),ALLOCATABLE :: IINLO_GRIB ! longitude of grib grid +REAL,DIMENSION(:),ALLOCATABLE :: ZPARAM_ZS ! parameter of grib grid for ZS +INTEGER,DIMENSION(:),ALLOCATABLE :: IINLO_ZS ! longitude of grib grid for ZS +REAL,DIMENSION(:),ALLOCATABLE :: ZVALUE ! Intermediate array +REAL,DIMENSION(:),ALLOCATABLE :: ZOUT ! Intermediate arrays +! Grib grid definition variables +INTEGER :: INI ! Number of points +INTEGER :: INLEVEL ! Number of levels +INTEGER :: ISTARTLEVEL ! First level (0 or 1) +TYPE(DATE_TIME) :: TPTCUR ! Date & time of the grib file data +INTEGER :: ITWOZS +! surface pressure +REAL, DIMENSION(:), ALLOCATABLE :: ZPS_G ! Grib data : Ps +REAL, DIMENSION(:), ALLOCATABLE :: ZLNPS_G ! Grib data : ln(Ps) +REAL, DIMENSION(:), ALLOCATABLE :: ZWORK_LNPS ! Grib data on zs grid: ln(Ps) +INTEGER :: INJ,INJ_ZS +! orography +CHARACTER(LEN=50) :: HGRID_ZS ! type of grid +! +! Reading and projection of the wind vectors u, v +REAL :: ZALPHA ! Angle of rotation +REAL, DIMENSION(:), ALLOCATABLE :: ZTU_LS ! Intermediate array for U +REAL, DIMENSION(:), ALLOCATABLE :: ZTV_LS ! | V +REAL :: ZLATPOLE ! Arpege stretching pole latitude +REAL :: ZLONPOLE ! Arpege stretching pole longitude +REAL :: ZLAT,ZLON ! Lat,lon of current point +REAL :: ZCOS,ZSIN ! cos,sin of rotation matrix +REAL, DIMENSION(:), ALLOCATABLE :: ZTU0_LS ! Arpege temp array for U +REAL, DIMENSION(:), ALLOCATABLE :: ZTV0_LS ! | V +! +! variables for hurricane filtering +REAL, DIMENSION(:,:), ALLOCATABLE :: ZTVF_LS,ZMSLP_LS +REAL :: ZGAMREF ! Standard atmosphere lapse rate (K/m) +! date +INTEGER :: ITIME +INTEGER :: IDATE +INTEGER :: ITIMESTEP +CHARACTER(LEN=10) :: CSTEPUNIT +CHARACTER(LEN=15) :: YVAL +!chemistery field +CHARACTER(LEN=16) :: YPRE_MOC="PRE_MOC1.nam" +INTEGER, DIMENSION(:), ALLOCATABLE :: INUMGRIB, INUMLEV ! grib +INTEGER, DIMENSION(:), ALLOCATABLE :: INUMLEV1, INUMLEV2 !numbers +INTEGER :: IMOC +INTEGER :: IVAR +INTEGER :: ICHANNEL +INTEGER :: INDX +INTEGER :: INACT +CHARACTER(LEN=40) :: YINPLINE ! input line +CHARACTER(LEN=16) :: YFIELD +CHARACTER, PARAMETER :: YPTAB = CHAR(9) ! TAB character is ASCII : 9 +CHARACTER, PARAMETER :: YPCOM = CHAR(44)! COMma character is ASCII : 44 +CHARACTER(LEN=40), DIMENSION(:), ALLOCATABLE :: YMNHNAME ! species names +INTEGER :: JN, JNREAL ! loop control variables +CHARACTER(LEN=40) :: YFORMAT +CHARACTER(LEN=100) :: YMSG +! temperature and humidity +INTEGER :: IT,IQ +REAL, DIMENSION(:,:), ALLOCATABLE :: ZPF_G ! Pressure (flux point) +REAL, DIMENSION(:,:), ALLOCATABLE :: ZPM_G ! Pressure (mass point) +REAL, DIMENSION(:,:), ALLOCATABLE :: ZEXNF_G ! Exner fct. (flux point) +REAL, DIMENSION(:,:), ALLOCATABLE :: ZEXNM_G ! Exner fct. (mass point) +REAL, DIMENSION(:,:), ALLOCATABLE :: ZGH_G ! Geopotential Height +REAL, DIMENSION(:,:), ALLOCATABLE :: ZT_G ! Temperature +REAL, DIMENSION(:,:), ALLOCATABLE :: ZQ_G ! Specific humidity +REAL, DIMENSION(:), ALLOCATABLE :: ZH_G ! Relative humidity +REAL, DIMENSION(:), ALLOCATABLE :: ZTHV_G ! Theta V +REAL, DIMENSION(:), ALLOCATABLE :: ZRV_G ! Vapor mixing ratio +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZPF_LS ! Pressure (flux point) +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZPM_LS ! Pressure (mass point) +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZEXNF_LS ! Exner fct. (flux point) +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZEXNM_LS ! Exner fct. (mass point) +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZH_LS ! Relative humidity +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRV_LS ! Vapor mixing ratio +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTHV_LS ! Theta V +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTEV_LS ! T V +REAL, DIMENSION(:), ALLOCATABLE :: ZPV ! vertical level in grib file +INTEGER :: IPVPRESENT ,IPV +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZR_DUM +INTEGER :: IMI +TYPE(TFILEDATA),POINTER :: TZFILE +INTEGER, DIMENSION(JP_GFS) :: IP_GFS ! list of pressure levels for GFS model +INTEGER, DIMENSION(JP_ERA) :: IP_ERA ! list of pressure levels for ERA5 reanalysis +INTEGER :: IVERSION,ILEVTYPE +LOGICAL :: GFIND ! to test if sea wave height is found +!--------------------------------------------------------------------------------------- +IP_GFS=(/1000,975,950,925,900,850,800,750,700,650,600,550,500,450,400,350,300,& + 250,200,150,100,70,50,30,20,10,7,5,3,2,1/) +IP_ERA=(/1000,975,950,925,900,875,850,825,800,775,750,700,650,600,550,500,450,& + 400,350,300,250,225,200,175,150,125,100,70,50,30,20,10,7,5,3,2,1/) +! +TZFILE => NULL() +! +IMI = GET_CURRENT_MODEL_INDEX() +! +!* 1. READ PGD FILE +! ------------- +! +ILUOUT0 = TLUOUT0%NLU +CALL READ_HGRID_n(TPPGDFILE,YPGD_NAME,YPGD_DAD_NAME,YPGD_TYPE) +! +! 1.1 Domain restriction +! +!JUAN REALZ +CALL GET_DIM_EXT_ll('B',IIU,IJU) +!!$IIU=NIMAX + 2*JPHEXT +!!$IJU=NJMAX + 2*JPHEXT +!JUAN REALZ +INO = IIU * IJU +! +! +! 1.2 Coordinate conversion to lat,lon system +! +ALLOCATE (ZXM(IIU,IJU)) +ALLOCATE (ZYM(IIU,IJU)) +ALLOCATE (ZLONM(IIU,IJU)) +ALLOCATE (ZLATM(IIU,IJU)) +ZXM(1:IIU-1,1) = (XXHAT(1:IIU-1) + XXHAT(2:IIU) ) / 2. +ZXM(IIU,1) = XXHAT(IIU) - XXHAT(IIU-1) + ZXM(IIU-1,1) +ZXM(:,2:IJU) = SPREAD(ZXM(:,1),2,IJU-1) +ZYM(1,1:IJU-1) = (XYHAT(1:IJU-1) + XYHAT(2:IJU)) / 2. +ZYM(1,IJU) = XYHAT(IJU) - XYHAT(IJU-1) + ZYM(1,IJU-1) +ZYM(2:IIU,:) = SPREAD(ZYM(1,:),1,IIU-1) +CALL SM_XYTOLATLON_A (XLAT0,XLON0,XRPK,XLATORI,XLONORI,ZXM,ZYM,ZLATM,ZLONM, & + IIU,IJU) +ALLOCATE (ZLONOUT(INO)) +ALLOCATE (ZLATOUT(INO)) +JLOOP1 = 0 +DO JJ = 1, IJU + ZLONOUT(JLOOP1+1:JLOOP1+IIU) = ZLONM(1:IIU,JJ) + ZLATOUT(JLOOP1+1:JLOOP1+IIU) = ZLATM(1:IIU,JJ) + JLOOP1 = JLOOP1 + IIU +ENDDO +DEALLOCATE (ZLATM) +DEALLOCATE (ZLONM) +DEALLOCATE (ZYM) +DEALLOCATE (ZXM) +! +ALLOCATE (ZXOUT(INO)) +ALLOCATE (ZYOUT(INO)) +! +!--------------------------------------------------------------------------------------- +! +!* 2. READ GRIB FIELDS +! ---------------- +! +IF (HFILE(1:3)=='ATM' .OR. HFILE=='CHEM') THEN + WRITE (ILUOUT0,'(A,A4)') ' -- Grib reader started for ',HFILE +ELSE + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE','bad input argument') +END IF +! +!* 2.1 Charge in memory the grib messages +! +! open grib file +CALL GRIB_OPEN_FILE(IUNIT,HGRIB,'R',IRET_GRIB) +IF (IRET_GRIB /= 0) THEN + WRITE(YMSG,*) 'Error opening the grib file ',TRIM(HGRIB),', error code ', IRET_GRIB + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) +END IF +! count the messages in the file +CALL GRIB_COUNT_IN_FILE(IUNIT,ICOUNT,IRET_GRIB) +IF (IRET_GRIB /= 0) THEN + WRITE(YMSG,*) 'Error in reading the grib file ',TRIM(HGRIB),', error code ', IRET_GRIB + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) +END IF +ALLOCATE(IGRIB(ICOUNT)) +! initialize the tabular with a negativ number +! ( all the IGRIB will be different ) +IGRIB(:)=-12 +!charge all the message in memory +DO JLOOP=1,ICOUNT +CALL GRIB_NEW_FROM_FILE(IUNIT,IGRIB(JLOOP),IRET_GRIB) +IF (IRET_GRIB /= 0) THEN + WRITE(YMSG,*) 'Error in reading the grib file - ILOOP=',JLOOP,' - error code ', IRET_GRIB + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) +END IF +END DO +! close the grib file +CALL GRIB_CLOSE_FILE(IUNIT) +! +! +!--------------------------------------------------------------------------------------- +!* 2.2 Research center with the first message +!--------------------------------------------------------------------------------------- +! +CALL GRIB_GET(IGRIB(1),'centre',ICENTER,IRET_GRIB) +IF (IRET_GRIB /= 0) THEN + WRITE(YMSG,*) 'Error in reading center - error code ', IRET_GRIB + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) +END IF +CALL GRIB_GET(IGRIB(1),'typeOfGrid',HGRID,IRET_GRIB) +IF (IRET_GRIB /= 0) THEN + WRITE(YMSG,*) 'Error in reading type of grid - error code ', IRET_GRIB + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) +END IF +! +IMODEL = -1 +SELECT CASE (ICENTER) + CASE (98) + WRITE (ILUOUT0,'(A)') & + ' | Grib file from European Center for Medium-range Weather Forecast' + IMODEL = 0 + ALLOCATE(ZPARAM(6)) + CASE (85) + SELECT CASE (HGRID) + CASE('lambert') + WRITE (ILUOUT0,'(A)') ' | Grib file from French Weather Service - Arome france model' + CALL GRIB_GET(IGRIB(1),'editionNumber',IVERSION,IRET_GRIB) + IF (IVERSION==2) THEN + IMODEL = 6 ! GRIB2 since summer 2018 (epygram) + ELSE + IMODEL = 1 ! GRIB1 befor summer 2018 (lfi2mv) + ENDIF + ALLOCATE(ZPARAM(10)) + CASE('mercator') + WRITE (ILUOUT0,'(A)') ' | Grib file from French Weather Service - Aladin reunion model' + IMODEL = 2 + ALLOCATE(ZPARAM(9)) + + CASE('unknown_PLPresent','reduced_stretched_rotated_gg') + WRITE (ILUOUT0,'(A)') ' | Grib file from French Weather Service - Arpege model' + ALLOCATE(ZPARAM(10)) + CALL GRIB_GET(IGRIB(1),'editionNumber',IVERSION,IRET_GRIB) + IF (IVERSION==2) THEN + IMODEL = 7 ! GRIB2 since summer 2018 (epygram) + ELSE + IMODEL = 3 ! GRIB1 befor summer 2018 (lfi2mv) + ENDIF + + CASE('regular_gg') + WRITE (ILUOUT0,'(A)') ' | Grib file from French Weather Service - Arpege model' + WRITE (ILUOUT0,'(A)') 'but same grid as ECMWF model (unstretched)' + IMODEL = 4 + ALLOCATE(ZPARAM(10)) + CASE('regular_ll') + WRITE (ILUOUT0,'(A)') ' | Grib file from French Weather Service - Mocage model' + IMODEL = 5 + ALLOCATE(ZPARAM(6)) + END SELECT + CASE (7) + WRITE (ILUOUT0,'(A)') ' | Grib file from National Center for Environmental Prediction' + IMODEL = 10 + ALLOCATE(ZPARAM(6)) +END SELECT +IF (IMODEL==-1) THEN + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE','unsupported Grib file format') +END IF +! +!--------------------------------------------------------------------------------------- +!* 2.3 Read and interpol orography +!--------------------------------------------------------------------------------------- +! +WRITE (ILUOUT0,'(A)') ' | Searching orography' +SELECT CASE (IMODEL) + CASE(0) ! ECMWF + CALL SEARCH_FIELD(IGRIB,INUM_ZS,KPARAM=129) + IF(INUM_ZS < 0) THEN + WRITE (ILUOUT0,'(A)')'Orography is missing - abort' + END IF + CASE(3,4,5) ! arpege et mocage + CALL SEARCH_FIELD(IGRIB,INUM_ZS,KPARAM=8) + IF(INUM_ZS < 0) THEN + WRITE (ILUOUT0,'(A)')'Orography is missing - abort' + ENDIF + CASE(1,2) ! aladin et aladin reunion + CALL SEARCH_FIELD(IGRIB,INUM_ZS,KPARAM=6) + IF(INUM_ZS < 0) THEN + WRITE (ILUOUT0,'(A)')'Orography is missing - abort' + ENDIF + CASE(6,7) ! arpege and arome GRIB2 + CALL SEARCH_FIELD(IGRIB,INUM_ZS,KDIS=0,KCAT=3,KNUMBER=4) + IF(INUM_ZS < 0) THEN + CALL SEARCH_FIELD(IGRIB,INUM_ZS,KDIS=0,KCAT=193,KNUMBER=5) + IF(INUM_ZS < 0) THEN + WRITE (ILUOUT0,'(A)')'Orography is missing - abort' + END IF + ENDIF + CASE(10) ! NCEP + CALL SEARCH_FIELD(IGRIB,INUM_ZS,KDIS=0,KCAT=3,KNUMBER=5,KTFFS=1) + IF(INUM_ZS < 0) THEN + WRITE (ILUOUT0,'(A)')'Orography is missing - abort' + ENDIF +END SELECT +ZPARAM(:)=-999. +CALL GRIB_GET(IGRIB(INUM_ZS),'Nj',INJ,IRET_GRIB) +ALLOCATE(IINLO(INJ)) +CALL COORDINATE_CONVERSION(IMODEL,IGRIB(INUM_ZS),IIU,IJU,ZLONOUT,ZLATOUT,& + ZXOUT,ZYOUT,INI,ZPARAM,IINLO) +ALLOCATE(ZPARAM_ZS(SIZE(ZPARAM))) +ZPARAM_ZS=ZPARAM +ALLOCATE(IINLO_ZS(SIZE(IINLO))) +IINLO_ZS=IINLO +CALL GRIB_GET_SIZE(IGRIB(INUM_ZS),'values',ISIZE) +ALLOCATE(ZVALUE(ISIZE)) +CALL GRIB_GET(IGRIB(INUM_ZS),'values',ZVALUE) +ALLOCATE(ZOUT(INO)) +CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,INI, & + ZVALUE,INO,ZXOUT,ZYOUT,ZOUT,.FALSE.,PTIME_HORI,.FALSE.) +DEALLOCATE(IINLO) +DEALLOCATE(ZVALUE) +! +IF (IMODEL/=10) THEN ! others than NCEP + ! Data given in archives are multiplied by the gravity acceleration + ZOUT = ZOUT / XG +END IF +! +! Stores the field in a 2 dimension array +IF (HFILE(1:3)=='ATM') THEN + ALLOCATE (XZS_LS(IIU,IJU)) + ALLOCATE (XZSMT_LS(IIU,IJU)) + CALL ARRAY_1D_TO_2D (INO,ZOUT,IIU,IJU,XZS_LS) + XZSMT_LS = XZS_LS ! no smooth orography in this case +ELSE IF (HFILE=='CHEM') THEN + ALLOCATE (XZS_SV_LS(IIU,IJU)) + CALL ARRAY_1D_TO_2D (INO,ZOUT,IIU,IJU,XZS_SV_LS) +END IF +DEALLOCATE (ZOUT) +! +!--------------------------------------------------------------------------------------- +!* 2.3 bis Read and interpol Sea Wave significant height +!--------------------------------------------------------------------------------------- +WRITE (ILUOUT0,'(A)') ' | Searching sea wave significant height' +SELECT CASE (IMODEL) + CASE(0) ! ECMWF + ALLOCATE (XZWS(IIU,IJU)) + GFIND=.FALSE. + ! + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=140229) + IF(INUM < 0) THEN + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=229) + ! + IF(INUM < 0) THEN + WRITE (YVAL,'( E15.8 )') XZWS_DEFAULT + WRITE (ILUOUT0,'(A)')' | !!! WARNING !!! Sea wave height is missing in '// & + 'the GRIB file - the default value of '//TRIM(YVAL)//' meters is used' + XZWS = XZWS_DEFAULT + ELSE + GFIND=.TRUE. + END IF + ELSE + GFIND=.TRUE. + END IF + ! + IF (GFIND) THEN + !!!!!!!!!!! Faire en sorte de le faire que pour le CASE(0) + ! Sea wave significant height disponible uniquement pour ECMWF + ! recuperation du tableau de valeurs + CALL GRIB_GET_SIZE(IGRIB(INUM),'values',ISIZE) + ALLOCATE(IINLO(INJ)) + CALL COORDINATE_CONVERSION(IMODEL,IGRIB(INUM),IIU,IJU,ZLONOUT,ZLATOUT,& + ZXOUT,ZYOUT,INI,ZPARAM,IINLO) + ALLOCATE(ZVALUE(ISIZE)) + CALL GRIB_GET(IGRIB(INUM),'values',ZVALUE) + ! Change 9999 value to -1 + WHERE(ZVALUE.EQ.9999.) ZVALUE=0. + ALLOCATE(ZOUT(INO)) + CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,INI, & + ZVALUE,INO,ZXOUT,ZYOUT,ZOUT,.FALSE.,PTIME_HORI,.FALSE.) + DEALLOCATE(IINLO) + DEALLOCATE(ZVALUE) + ! Stores the field in a 2 dimension array + CALL ARRAY_1D_TO_2D (INO,ZOUT,IIU,IJU,XZWS) + DEALLOCATE (ZOUT) + END IF +END SELECT +! +!--------------------------------------------------------------------------------------- +!* 2.4 Interpolation surface pressure +!--------------------------------------------------------------------------------------- +! +!* 2.4.1 Read pressure +! +WRITE (ILUOUT0,'(A)') ' | Searching pressure' + +SELECT CASE (IMODEL) + CASE(0) ! ECMWF + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=152) + IF( INUM < 0 ) THEN + WRITE (ILUOUT0,'(A)') ' | Logarithm of surface pressure is missing. It is then supposed that' + WRITE (ILUOUT0,'(A)') ' | this ECMWF file has atmospheric fields on pressure levels (e.g. ERA5)' + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=134) + IMODEL = 11 + END IF + CASE(1,2,3,4,5) ! arpege mocage aladin et aladin reunion + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=1) + CASE(6,7) ! NEW AROME,ARPEGE + CALL SEARCH_FIELD(IGRIB,INUM,KDIS=0,KCAT=3,KNUMBER=0) + CASE(10) ! NCEP + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=134) +END SELECT +IF( INUM < 0 ) call Print_msg( NVERB_FATAL, 'IO', 'READ_ALL_DATA_GRIB_CASE', 'surface pressure is missing' ) +! recuperation du tableau de valeurs +CALL GRIB_GET_SIZE(IGRIB(INUM),'values',ISIZE) +ALLOCATE(ZVALUE(ISIZE)) +CALL GRIB_GET(IGRIB(INUM),'values',ZVALUE) +! determination des tableaux ZPS_G et ZLNPS_G +SELECT CASE (IMODEL) + CASE(0,6,7) ! ECMWF + ALLOCATE (ZPS_G (ISIZE)) + ALLOCATE (ZLNPS_G(ISIZE)) + ZLNPS_G(:) = ZVALUE(1:ISIZE) + ZPS_G (:) = EXP(ZVALUE(1:ISIZE)) + CASE(1,2,3,4,5,10,11) ! arpege mocage aladin aladin-reunion NCEP ERA5 + ALLOCATE (ZPS_G (ISIZE)) + ALLOCATE (ZLNPS_G(ISIZE)) + ZPS_G (:) = ZVALUE(1:ISIZE) + ZLNPS_G(:) = LOG(ZVALUE(1:ISIZE)) +END SELECT +DEALLOCATE (ZVALUE) +! +!* 2.4.2 Removes pressure points not on orography points +! (if pressure is on a regular grid) +CALL GRIB_GET(IGRIB(INUM),'typeOfGrid',HGRID) +CALL GRIB_GET(IGRIB(INUM_ZS),'typeOfGrid',HGRID_ZS) +CALL GRIB_GET(IGRIB(INUM),'Nj',INJ) +CALL GRIB_GET(IGRIB(INUM_ZS),'Nj',INJ_ZS) +! +IF ( HGRID(1:7)=='regular' .AND. HGRID_ZS(1:7)=='reduced' .AND.& + INJ == INJ_ZS) THEN + call Print_msg( NVERB_FATAL, 'IO', 'READ_ALL_DATA_GRIB_CASE', & + 'HGRID(1:7)==regular .AND. HGRID_ZS(1:7)==reduced .AND. INJ == INJ_ZS' ) +ELSE + ALLOCATE(ZWORK_LNPS(SIZE(ZLNPS_G))) + ZWORK_LNPS(:) = ZLNPS_G(:) +ENDIF +! +IF (HFILE(1:3)=='ATM') THEN + ALLOCATE (XPS_LS(IIU,IJU)) +ELSE IF (HFILE=='CHEM') THEN + ALLOCATE (XPS_SV_LS(IIU,IJU)) +END IF +! +ALLOCATE(IINLO(INJ)) +CALL COORDINATE_CONVERSION(IMODEL,IGRIB(INUM),IIU,IJU,ZLONOUT,ZLATOUT,& + ZXOUT,ZYOUT,INI,ZPARAM,IINLO) +ALLOCATE(ZOUT(INO)) +CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,INI,& + ZWORK_LNPS,INO,ZXOUT,ZYOUT,ZOUT,.FALSE.,PTIME_HORI,.FALSE. ) +DEALLOCATE(ZWORK_LNPS) +DEALLOCATE(IINLO) +! +!* 2.4.3 conversion to surface pressure +! +ZOUT=EXP(ZOUT) +IF (HFILE(1:3)=='ATM') THEN + CALL ARRAY_1D_TO_2D (INO,ZOUT,IIU,IJU,XPS_LS(:,:)) +ELSE IF (HFILE=='CHEM') THEN + CALL ARRAY_1D_TO_2D (INO,ZOUT,IIU,IJU,XPS_SV_LS(:,:)) +END IF +!JUAN REALZ +CALL MPPDB_CHECK2D(XZS_LS,"XZS_LS",PRECISION) +!JUAN REALZ +DEALLOCATE (ZOUT) +DEALLOCATE (ZLNPS_G) +! +!--------------------------------------------------------------------------------------- +!* 2.5 Interpolation temperature and humidity +!--------------------------------------------------------------------------------------- +! +!* 2.5.1 Read T and Q on each level +! +WRITE (ILUOUT0,'(A)') ' | Reading T and Q fields' +! +IF (IMODEL/=10.AND.IMODEL/=11) THEN + SELECT CASE (IMODEL) + CASE(0) ! ECMWF + ISTARTLEVEL=1 + IT=130 + IQ=133 + CASE(1,2,3,4,5) ! arpege mocage aladin et aladin reunion + IT=11 + IQ=51 + ISTARTLEVEL=1 + CASE(6,7) !GRIB2 AROME AND ARPEGE + IT=130 + IQ=133 + ISTARTLEVEL=1 + END SELECT + + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IT,KLEV1=ISTARTLEVEL) + IF(INUM < 0) THEN + ISTARTLEVEL=0 + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IT,KLEV1=ISTARTLEVEL) + ENDIF + IF(INUM < 0) call Print_msg( NVERB_FATAL, 'IO', 'READ_ALL_DATA_GRIB_CASE', 'air temperature is missing' ) + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IQ,KLEV1=ISTARTLEVEL) + IF(INUM < 0) call Print_msg( NVERB_FATAL, 'IO', 'READ_ALL_DATA_GRIB_CASE', 'atmospheric specific humidity is missing' ) +ELSEIF (IMODEL==10) THEN ! NCEP + ISTARTLEVEL=1000 + IT=130 + IQ=157 + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IT,KLEV1=ISTARTLEVEL) + IF(INUM < 0) call Print_msg( NVERB_FATAL, 'IO', 'READ_ALL_DATA_GRIB_CASE', 'air temperature is missing' ) + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IQ,KLEV1=ISTARTLEVEL) + IF(INUM < 0) call Print_msg( NVERB_FATAL, 'IO', 'READ_ALL_DATA_GRIB_CASE', 'atmospheric relative humidity is missing' ) +ELSE ! ERA5 + ISTARTLEVEL=1000 + IT=130 + IQ=133 + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IT,KLEV1=ISTARTLEVEL) + IF(INUM < 0) call Print_msg( NVERB_FATAL, 'IO', 'READ_ALL_DATA_GRIB_CASE', 'air temperature is missing' ) + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IQ,KLEV1=ISTARTLEVEL) + IF(INUM < 0) call Print_msg( NVERB_FATAL, 'IO', 'READ_ALL_DATA_GRIB_CASE', 'atmospheric specific humidity is missing' ) +ENDIF +! +IF (IMODEL/=10.AND.IMODEL/=11) THEN ! others than NCEP AND ERA5 + CALL GRIB_GET(IGRIB(INUM),'NV',INLEVEL) + INLEVEL = NINT(INLEVEL / 2.) - 1 + CALL GRIB_GET_SIZE(IGRIB(INUM),'values',ISIZE) +ELSE + IF (IMODEL==10) THEN + INLEVEL=JP_GFS + ELSE + INLEVEL=JP_ERA + END IF +END IF +! +ALLOCATE (ZT_G(ISIZE,INLEVEL)) +ALLOCATE (ZQ_G(ISIZE,INLEVEL)) +! +IF (IMODEL/=10.AND.IMODEL/=11) THEN ! others than NCEP AND ERA5 + DO JLOOP1=1, INLEVEL + ILEV1 = JLOOP1-1+ISTARTLEVEL + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IQ,KLEV1=ILEV1) + IF (INUM< 0) THEN + WRITE(YMSG,*) 'atmospheric humidity level ',JLOOP1,' is missing' + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) + END IF + CALL GRIB_GET(IGRIB(INUM),'values',ZQ_G(:,INLEVEL-JLOOP1+1)) + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IT,KLEV1=ILEV1) + IF (INUM< 0) THEN + WRITE(YMSG,*) 'atmospheric temperature level ',JLOOP1,' is missing' + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) + END IF + CALL GRIB_GET(IGRIB(INUM),'values',ZT_G(:,INLEVEL-JLOOP1+1)) + CALL GRIB_GET(IGRIB(INUM),'Nj',INJ,IRET_GRIB) + END DO +ELSEIF (IMODEL==10) THEN ! NCEP + DO JLOOP1=1, INLEVEL + ILEV1 = IP_GFS(JLOOP1) + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IQ,KLEV1=ILEV1) + IF (INUM< 0) THEN + WRITE(YMSG,*) 'atmospheric humidity level ',JLOOP1,' is missing' + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) + END IF + CALL GRIB_GET(IGRIB(INUM),'values',ZQ_G(:,JLOOP1),IRET_GRIB) + CALL SEARCH_FIELD(IGRIB,INUM,KDIS=0,KCAT=0,KNUMBER=0,KLEV1=ILEV1,KTFFS=100) + IF (INUM< 0) THEN + WRITE(YMSG,*) 'atmospheric temperature level ',JLOOP1,' is missing' + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) + END IF + CALL GRIB_GET(IGRIB(INUM),'values',ZT_G(:,JLOOP1),IRET_GRIB) + CALL GRIB_GET(IGRIB(INUM),'Nj',INJ,IRET_GRIB) + END DO +ELSE ! ERA5 + DO JLOOP1=1, INLEVEL + ILEV1 = IP_ERA(JLOOP1) + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IQ,KLEV1=ILEV1) + IF (INUM< 0) THEN + WRITE(YMSG,*) 'atmospheric humidity level ',JLOOP1,' is missing' + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) + END IF + CALL GRIB_GET(IGRIB(INUM),'values',ZQ_G(:,JLOOP1),IRET_GRIB) + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IT,KLEV1=ILEV1) + IF (INUM< 0) THEN + WRITE(YMSG,*) 'atmospheric temperature level ',JLOOP1,' is missing' + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) + END IF + CALL GRIB_GET(IGRIB(INUM),'values',ZT_G(:,JLOOP1),IRET_GRIB) + CALL GRIB_GET(IGRIB(INUM),'Nj',INJ,IRET_GRIB) + END DO +END IF + +ALLOCATE(IINLO(INJ)) +CALL COORDINATE_CONVERSION(IMODEL,IGRIB(INUM),IIU,IJU,ZLONOUT,ZLATOUT,& + ZXOUT,ZYOUT,INI,ZPARAM,IINLO) +! +!* 2.5.2 Load level definition parameters A and B +! +IF (IMODEL/=10.AND.IMODEL/=11) THEN ! others than NCEP AND ERA5 + + IF (HFILE(1:3)=='ATM') THEN + XP00_LS = 101325. + ELSE IF (HFILE=='CHEM') THEN + XP00_SV_LS = 101325. + END IF +! + IF (INLEVEL > 0) THEN + IF (HFILE(1:3)=='ATM') THEN + ALLOCATE (XA_LS(INLEVEL)) + ALLOCATE (XB_LS(INLEVEL)) + ELSE IF (HFILE=='CHEM') THEN + ALLOCATE (XA_SV_LS(INLEVEL)) + ALLOCATE (XB_SV_LS(INLEVEL)) + END IF +! + CALL GRIB_GET(IGRIB(INUM),'PVPresent',IPVPRESENT) + IF (IPVPRESENT==1) THEN + CALL GRIB_GET_SIZE(IGRIB(INUM),'pv',IPV) + ALLOCATE(ZPV(IPV)) + CALL GRIB_GET(IGRIB(INUM),'pv',ZPV) + ELSE + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE','there is no PV value in this message') + ENDIF + SELECT CASE (IMODEL) + CASE (0,3,4,6,7) + DO JLOOP1 = 1, INLEVEL + XA_LS(1 + INLEVEL - JLOOP1) = ZPV(1+JLOOP1) / XP00_LS + XB_LS(1 + INLEVEL - JLOOP1) = ZPV(2+INLEVEL+JLOOP1) + END DO + CASE (1,2) + JLOOP2 = 2 + DO JLOOP1 = 1, INLEVEL + JLOOP2 = JLOOP2 + 1 + XA_LS(1 + INLEVEL - JLOOP1) = ZPV(JLOOP2) + JLOOP2 = JLOOP2 + 1 + XB_LS(1 + INLEVEL - JLOOP1) = ZPV(JLOOP2) + END DO + CASE (5) + DO JLOOP1 = 1, INLEVEL + IF (HFILE(1:3)=='ATM') THEN + XA_LS(1 + INLEVEL - JLOOP1) = ZPV(1+ JLOOP1) / XP00_LS**2 + XB_LS(1 + INLEVEL - JLOOP1) = ZPV(2+INLEVEL+JLOOP1) + ELSE IF (HFILE=='CHEM') THEN + XA_SV_LS(1 + INLEVEL - JLOOP1) = ZPV(1+ JLOOP1) / XP00_LS**2 + XB_SV_LS(1 + INLEVEL - JLOOP1) = ZPV(2+INLEVEL+JLOOP1) + END IF + END DO + END SELECT + ELSE + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE','level definition section is missing') + END IF +ELSE + ALLOCATE (XA_LS(INLEVEL)) + ALLOCATE (XB_LS(0)) + IF (IMODEL==10) THEN + XA_LS = 100.*IP_GFS + ELSE + XA_LS = 100.*IP_ERA + END IF +END IF +! +!* 2.5.3 Compute atmospheric pressure on grib grid +! +WRITE (ILUOUT0,'(A)') ' | Atmospheric pressure on Grib grid is being computed' + +ALLOCATE (ZPF_G(INI,INLEVEL)) +IF (IMODEL/=10.AND.IMODEL/=11) THEN ! others than NCEP and ERA5 + IF (HFILE(1:3)=='ATM') THEN + ZPF_G(:,:) = SPREAD(XA_LS,1,INI)*XP00_LS + & + SPREAD(XB_LS,1,INI)*SPREAD(ZPS_G(1:INI),2,INLEVEL) + ELSE IF (HFILE=='CHEM') THEN + ZPF_G(:,:) = SPREAD(XA_SV_LS,1,INI)*XP00_SV_LS + & + SPREAD(XB_SV_LS,1,INI)*SPREAD(ZPS_G(1:INI),2,INLEVEL) + END IF +ELSE + IF (IMODEL==10) THEN + ZPF_G(:,:) = 100.*SPREAD(IP_GFS,1,INI) + ELSE + ZPF_G(:,:) = 100.*SPREAD(IP_ERA,1,INI) + END IF +END IF +DEALLOCATE (ZPS_G) +! +ALLOCATE (ZEXNF_G(INI,INLEVEL)) +ZEXNF_G(:,:) = (ZPF_G(:,:)/XP00)**(XRD/XCPD) +! +ALLOCATE (ZEXNM_G(INI,INLEVEL)) +ZEXNM_G(:,1:INLEVEL-1) = (ZEXNF_G(:,1:INLEVEL-1)-ZEXNF_G(:,2:INLEVEL)) / & + (LOG(ZEXNF_G(:,1:INLEVEL-1))-LOG(ZEXNF_G(:,2:INLEVEL))) +ZEXNM_G(:,INLEVEL) = (ZPF_G(:,INLEVEL)/2./XP00)**(XRD/XCPD) +! +IF (IMODEL==10.OR.IMODEL==11) ZEXNM_G(:,:)=ZEXNF_G(:,:) ! for GFS and ERA5 on pressure levels +! +DEALLOCATE (ZEXNF_G) +DEALLOCATE (ZPF_G) +! +ALLOCATE (ZPM_G(INI,INLEVEL)) +ZPM_G(:,:) = XP00*(ZEXNM_G(:,:))**(XCPD/XRD) +! +!* 2.5.4 Compute the relative humidity and the interpolate Thetav, P, Q and H +! +IF (IMODEL==1) THEN + ! search cloud_water in Arome case (forecast) + ISTARTLEVEL = 1 + IPAR=246 + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IPAR,KLEV1=ISTARTLEVEL) + IF (INUM < 0) THEN + ISTARTLEVEL = 0 + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IPAR,KLEV1=ISTARTLEVEL) + END IF + IF (INUM > 0) THEN + WRITE (ILUOUT0,'(A)') ' | Grib file from French Weather Service - Arome model (forecast)' + LCPL_AROME=.TRUE. + NRR=6 + END IF + ! search also turbulent kinetic energy + ISTARTLEVEL = 1 + IPAR=251 + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IPAR,KLEV1=ISTARTLEVEL) + IF (INUM < 0) THEN + ISTARTLEVEL = 0 + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IPAR,KLEV1=ISTARTLEVEL) + END IF + IF (INUM > 0) CTURB='TKEL' +END IF + +IF (IMODEL==6) THEN ! GRIB2 AROME +! search cloud_water in Arome case (forecast) + ISTARTLEVEL = 1 + CALL SEARCH_FIELD(IGRIB,INUM,KDIS=0,KCAT=6,KNUMBER=6,KLEV1=ISTARTLEVEL) + IF (INUM < 0) THEN + ISTARTLEVEL = 0 + CALL SEARCH_FIELD(IGRIB,INUM,KDIS=0,KCAT=6,KNUMBER=6,KLEV1=ISTARTLEVEL) + END IF + IF (INUM < 0) THEN + ISTARTLEVEL = 1 + CALL SEARCH_FIELD(IGRIB,INUM,KDIS=0,KCAT=1,KNUMBER=0,KLEV1=ISTARTLEVEL) + END IF + IF (INUM > 0) THEN + WRITE (ILUOUT0,'(A)') ' | Grib file from French Weather Service - Arome model (forecast)' + LCPL_AROME=.TRUE. + NRR=6 + END IF + ! search also turbulent kinetic energy + ISTARTLEVEL = 1 + CALL SEARCH_FIELD(IGRIB,INUM,KDIS=0,KCAT=19,KNUMBER=11,KLEV1=ISTARTLEVEL) + IF (INUM < 0) THEN + ISTARTLEVEL = 0 + CALL SEARCH_FIELD(IGRIB,INUM,KDIS=0,KCAT=19,KNUMBER=11,KLEV1=ISTARTLEVEL) + END IF + IF (INUM > 0) CTURB='TKEL' +END IF +! +! +WRITE (ILUOUT0,'(A)') ' | Computing relative humidity on each level' +ALLOCATE (ZH_G(INI)) +ALLOCATE (ZH_LS(IIU,IJU,INLEVEL)) +IF (HFILE(1:3)=='ATM') THEN + ALLOCATE (XT_LS(IIU,IJU,INLEVEL)) + ALLOCATE (XQ_LS(IIU,IJU,INLEVEL,NRR)) ; XQ_LS=0. +ELSE IF (HFILE=='CHEM') THEN + ALLOCATE (XT_SV_LS(IIU,IJU,INLEVEL)) + ALLOCATE (XQ_SV_LS(IIU,IJU,INLEVEL,1)) +END IF +IF (CTURB=='TKEL') THEN + IF (ALLOCATED(XTKE_LS)) DEALLOCATE(XTKE_LS) + ALLOCATE(XTKE_LS(IIU,IJU,INLEVEL)) ; XTKE_LS=0. +ELSE + IF (ALLOCATED(XTKE_LS)) DEALLOCATE(XTKE_LS) + ALLOCATE(XTKE_LS(0,0,0)) +END IF +ALLOCATE (ZTHV_LS(IIU,IJU,INLEVEL)) +ALLOCATE (ZTHV_G(INI)) +ALLOCATE (ZRV_G(INI)) +ALLOCATE (ZOUT(INO)) +IF (IMODEL/=10) THEN ! others than NCEP + DO JLOOP1=1, INLEVEL + ! + ! Compute Theta V and relative humidity on grib grid + ! + ! (1/rv) = (1/q) - 1 + ! Thetav = T . (P0/P)^(Rd/Cpd) . ( (1 + (Rv/Rd).rv) / (1 + rv) ) + ! Hu = P / ( ( (Rd/Rv) . ((1/rv) - 1) + 1) . Es(T) ) + ! + ZRV_G(:) = 1. / (1./MAX(ZQ_G(:,JLOOP1),1.E-12) - 1.) + ! + ZTHV_G(:)=ZT_G(:,JLOOP1) * ((XP00/ZPM_G(:,JLOOP1))**(XRD/XCPD)) * & + ((1. + XRV*ZRV_G(:)/XRD) / (1. + ZRV_G(:))) + ! + ZH_G(1:INI) = 100. * ZPM_G(:,JLOOP1) / ( (XRD/XRV)*(1./ZRV_G(:)+1.)*SM_FOES(ZT_G(:,JLOOP1)) ) + ZH_G(:) = MAX(MIN(ZH_G(:),100.),0.) + ! + ! Interpolation : H + CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,INI, & + ZH_G,INO,ZXOUT,ZYOUT,ZOUT,.FALSE.,PTIME_HORI,.FALSE.) + CALL ARRAY_1D_TO_2D (INO,ZOUT,IIU,IJU,ZH_LS(:,:,JLOOP1)) + ZH_LS(:,:,JLOOP1) = MAX(MIN(ZH_LS(:,:,JLOOP1),100.),0.) + ! + ! interpolation : Theta V + CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,INI, & + ZTHV_G,INO,ZXOUT,ZYOUT,ZOUT,.FALSE.,PTIME_HORI,.FALSE.) + CALL ARRAY_1D_TO_2D (INO,ZOUT,IIU,IJU,ZTHV_LS(:,:,JLOOP1)) + ! + END DO +ELSE !GFS and ERA5 on pressure levels + DO JLOOP1=1, INLEVEL + ZH_G(:) =ZQ_G(:,JLOOP1) + ZRV_G(:) = (XRD/XRV)*SM_FOES(ZT_G(:,JLOOP1))*0.01*ZH_G(:) & + /(ZPM_G(:,JLOOP1) -SM_FOES(ZT_G(:,JLOOP1))*0.01*ZH_G(:)) + ZTHV_G(:)=ZT_G(:,JLOOP1) * ((XP00/ZPM_G(:,JLOOP1))**(XRD/XCPD)) * & + ((1. + XRV*ZRV_G(:)/XRD) / (1. + ZRV_G(:))) + ! + ! Interpolation : H + CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,INI, & + ZH_G,INO,ZXOUT,ZYOUT,ZOUT,.FALSE.,PTIME_HORI,.FALSE.) + CALL ARRAY_1D_TO_2D (INO,ZOUT,IIU,IJU,ZH_LS(:,:,JLOOP1)) + ZH_LS(:,:,JLOOP1) = MAX(MIN(ZH_LS(:,:,JLOOP1),100.),0.) + ! + ! interpolation : Theta V + CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,INI, & + ZTHV_G,INO,ZXOUT,ZYOUT,ZOUT,.FALSE.,PTIME_HORI,.FALSE.) + CALL ARRAY_1D_TO_2D (INO,ZOUT,IIU,IJU,ZTHV_LS(:,:,JLOOP1)) + ! + END DO +END IF + +DEALLOCATE (ZOUT) + + +!--------------------------------------------------------------------------------------- +!* 2.5.4.2 Read and interpol geopotential height for interpolation on isobaric surface Grid of NCEP +!--------------------------------------------------------------------------------------- +! +ALLOCATE (ZGH_G(ISIZE,INLEVEL)) +! +IF (IMODEL==10.OR.IMODEL==11) THEN !NCEP or ERA5 with pressure grid only + DO JLOOP1=1, INLEVEL + IF (IMODEL==10) THEN + ILEV1 = IP_GFS(JLOOP1) + CALL SEARCH_FIELD(IGRIB,INUM,KDIS=0,KCAT=3,KNUMBER=5,KLEV1=ILEV1) + ELSE + ILEV1 = IP_ERA(JLOOP1) + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=129,KLEV1=ILEV1) + END IF + IF (INUM< 0) THEN + !callabortstop + WRITE(YMSG,*) 'Geopotential height level ',JLOOP1,' is missing' + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_ALL_DATA_GRIB_CASE',YMSG) + END IF + ! + CALL GRIB_GET(IGRIB(INUM),'values',ZGH_G(:,JLOOP1),IRET_GRIB) + CALL GRIB_GET(IGRIB(INUM),'Nj',INJ,IRET_GRIB) + ! + IF (IMODEL/=10) THEN + ! Data given in archives are multiplied by the gravity acceleration + ZGH_G(:,JLOOP1) = ZGH_G(:,JLOOP1) / XG + END IF + ! + END DO + ! + CALL COORDINATE_CONVERSION(IMODEL,IGRIB(INUM_ZS),IIU,IJU,ZLONOUT,ZLATOUT,& + ZXOUT,ZYOUT,INI,ZPARAM,IINLO) + ! + ALLOCATE(ZOUT(INO)) + ALLOCATE(XGH_LS(IIU,IJU,INLEVEL)) + ! + DO JLOOP1=1, INLEVEL + CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,INI, & + ZGH_G(:,JLOOP1),INO,ZXOUT,ZYOUT,ZOUT,.FALSE.,PTIME_HORI,.FALSE.) + CALL ARRAY_1D_TO_2D (INO,ZOUT,IIU,IJU,XGH_LS(:,:,JLOOP1)) + END DO + DEALLOCATE(ZOUT) +END IF +! +!* 2.5.5 Compute atmospheric pressure on MESO-NH grid +! +WRITE (ILUOUT0,'(A)') ' | Atmospheric pressure on the Meso-NH grid is being computed' +ALLOCATE (ZPF_LS(IIU,IJU,INLEVEL)) +IF (IMODEL/=10.AND.IMODEL/=11) THEN ! others than NCEP and ERA5 + IF (HFILE(1:3)=='ATM') THEN + ZPF_LS(:,:,:) = SPREAD(SPREAD(XA_LS,1,IIU),2,IJU)*XP00_LS + & + SPREAD(SPREAD(XB_LS,1,IIU),2,IJU)*SPREAD(XPS_LS,3,INLEVEL) + ELSE IF (HFILE=='CHEM') THEN + ZPF_LS(:,:,:) = SPREAD(SPREAD(XA_SV_LS,1,IIU),2,IJU)*XP00_LS + & + SPREAD(SPREAD(XB_SV_LS,1,IIU),2,IJU)*SPREAD(XPS_SV_LS,3,INLEVEL) + END IF +ELSE + IF(IMODEL==10) THEN + ZPF_LS(:,:,:) = 100.*SPREAD(SPREAD(IP_GFS,1,IIU),2,IJU) + ELSE + ZPF_LS(:,:,:) = 100.*SPREAD(SPREAD(IP_ERA,1,IIU),2,IJU) + END IF +END IF +! +ALLOCATE (ZEXNF_LS(IIU,IJU,INLEVEL)) +ZEXNF_LS(:,:,:) = (ZPF_LS(:,:,:)/XP00)**(XRD/XCPD) +! +ALLOCATE (ZEXNM_LS(IIU,IJU,INLEVEL)) +ZEXNM_LS(:,:,1:INLEVEL-1) = (ZEXNF_LS(:,:,1:INLEVEL-1)-ZEXNF_LS(:,:,2:INLEVEL)) / & + (LOG(ZEXNF_LS(:,:,1:INLEVEL-1))-LOG(ZEXNF_LS(:,:,2:INLEVEL))) +ZEXNM_LS(:,:,INLEVEL) = (ZPF_LS(:,:,INLEVEL)/2./XP00)**(XRD/XCPD) +! +IF (IMODEL==10.OR.IMODEL==11) ZEXNM_LS(:,:,:)=ZEXNF_LS(:,:,:) ! for GFS and ERA5 on pressure levels +! +DEALLOCATE (ZEXNF_LS) +DEALLOCATE (ZPF_LS) +! +ALLOCATE (ZPM_LS(IIU,IJU,INLEVEL)) +ZPM_LS(:,:,:) = XP00*(ZEXNM_LS(:,:,:))**(XCPD/XRD) +! +!* 2.5.6 Compute the vapor mixing ratio and the final specific humdity +! +! The vapor mixing ratio is calculated by an interating process on rv and +! Thetav. Have a look to MODE_THERMO for further informations. +ALLOCATE (ZR_DUM(IIU,IJU,INLEVEL,1)) +ALLOCATE (ZRV_LS(IIU,IJU,INLEVEL)) +ALLOCATE (ZTEV_LS(IIU,IJU,INLEVEL)) +ZTEV_LS(:,:,:) = ZTHV_LS(:,:,:) * ZEXNM_LS(:,:,:) +ZRV_LS(:,:,:) = SM_PMR_HU(ZPM_LS(:,:,:), & +ZTEV_LS(:,:,:),ZH_LS(:,:,:),ZR_DUM(:,:,:,:),KITERMAX=100) +IF (HFILE(1:3)=='ATM') THEN + XQ_LS(:,:,:,1) = ZRV_LS(:,:,:) / (1. + ZRV_LS(:,:,:)) +ELSE IF (HFILE=='CHEM') THEN + XQ_SV_LS(:,:,:,1) = ZRV_LS(:,:,:) / (1. + ZRV_LS(:,:,:)) +ENDIF +!JUAN +CALL MPPDB_CHECK3D(XQ_LS(:,:,:,1),"XQ_LS",PRECISION) +!JUAN +DEALLOCATE (ZTEV_LS) +DEALLOCATE (ZH_LS) +DEALLOCATE (ZR_DUM) +! +!* 2.5.7 Compute T from the interpolated Theta V +! +! T = Thetav . (P/P0)^(Rd/Cpd) . ((1 + rv) / (1 + (Rv/Rd).rv)) +!! +IF (HFILE(1:3)=='ATM') THEN + XT_LS(:,:,:) = ZTHV_LS(:,:,:) * ZEXNM_LS(:,:,:) & + * ((1.+ZRV_LS(:,:,:))/(1.+(XRV/XRD)*ZRV_LS(:,:,:))) + CALL MPPDB_CHECK3D(XT_LS,"XT_LS",PRECISION) +ELSE IF (HFILE=='CHEM') THEN + XT_SV_LS(:,:,:) = ZTHV_LS(:,:,:) * ZEXNM_LS(:,:,:) & + * ((1.+ZRV_LS(:,:,:))/(1.+(XRV/XRD)*ZRV_LS(:,:,:))) + CALL MPPDB_CHECK3D(XT_SV_LS,"XT_SV_LS",PRECISION) +ENDIF +! +DEALLOCATE (ZRV_LS) +DEALLOCATE (ZTHV_LS) +DEALLOCATE (ZPM_LS) +DEALLOCATE (ZEXNM_LS) +! +!* 2.5.8 Read the other specific ratios (if Arome model) +! +IF (NRR >1) THEN + IF (IMODEL==1) THEN + WRITE (ILUOUT0,'(A)') ' | Reading Q fields (except humidity)' + DO JLOOP2=1,NRR-1 + IPAR=246+JLOOP2-1 + DO JLOOP1=1, INLEVEL + ILEV1 = JLOOP1-1+ISTARTLEVEL + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IPAR,KLEV1=ILEV1) + + IF (INUM < 0) THEN + WRITE(YMSG,*) 'Specific ratio ',IPAR,' at level ',JLOOP1,' is missing' + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) + END IF + CALL GRIB_GET_SIZE(IGRIB(INUM),'values',ISIZE) + ALLOCATE(ZVALUE(ISIZE)) + CALL GRIB_GET(IGRIB(INUM),'values',ZVALUE) + ALLOCATE(ZOUT(INO)) + CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,INI, & + ZVALUE,INO,ZXOUT,ZYOUT,ZOUT,.FALSE.,PTIME_HORI,.FALSE.) + CALL ARRAY_1D_TO_2D(INO,ZOUT,IIU,IJU,XQ_LS(:,:,INLEVEL-JLOOP1+1,1+JLOOP2)) + DEALLOCATE (ZVALUE) + DEALLOCATE (ZOUT) + END DO + END DO + ELSE ! GRIB2 AROME IMODEL =6 + WRITE (ILUOUT0,'(A)') ' | Reading Q fields (except humidity)' + DO JLOOP1=1, INLEVEL + ILEV1 = JLOOP1-1+ISTARTLEVEL + CALL SEARCH_FIELD(IGRIB,INUM,KDIS=0,KCAT=1,KNUMBER=83,KLEV1=ILEV1) + + IF (INUM < 0) THEN + WRITE(YMSG,*) 'Specific ratio ',IPAR,' at level ',JLOOP1,' is missing' + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) + END IF + CALL GRIB_GET_SIZE(IGRIB(INUM),'values',ISIZE) + ALLOCATE(ZVALUE(ISIZE)) + CALL GRIB_GET(IGRIB(INUM),'values',ZVALUE) + ALLOCATE(ZOUT(INO)) + CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,INI, & + ZVALUE,INO,ZXOUT,ZYOUT,ZOUT,.FALSE.,PTIME_HORI,.FALSE.) + CALL ARRAY_1D_TO_2D(INO,ZOUT,IIU,IJU,XQ_LS(:,:,INLEVEL-JLOOP1+1,2)) + DEALLOCATE (ZVALUE) + DEALLOCATE (ZOUT) + END DO + + DO JLOOP1=1, INLEVEL + ILEV1 = JLOOP1-1+ISTARTLEVEL + CALL SEARCH_FIELD(IGRIB,INUM,KDIS=0,KCAT=1,KNUMBER=85,KLEV1=ILEV1) + + IF (INUM < 0) THEN + WRITE(YMSG,*) 'Specific ratio for rain at level ',JLOOP1,' is missing' + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) + END IF + CALL GRIB_GET_SIZE(IGRIB(INUM),'values',ISIZE) + ALLOCATE(ZVALUE(ISIZE)) + CALL GRIB_GET(IGRIB(INUM),'values',ZVALUE) + ALLOCATE(ZOUT(INO)) + CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,INI, & + ZVALUE,INO,ZXOUT,ZYOUT,ZOUT,.FALSE.,PTIME_HORI,.FALSE.) + CALL ARRAY_1D_TO_2D(INO,ZOUT,IIU,IJU,XQ_LS(:,:,INLEVEL-JLOOP1+1,3)) + DEALLOCATE (ZVALUE) + DEALLOCATE (ZOUT) + END DO + + + DO JLOOP1=1, INLEVEL + ILEV1 = JLOOP1-1+ISTARTLEVEL + CALL SEARCH_FIELD(IGRIB,INUM,KDIS=0,KCAT=1,KNUMBER=84,KLEV1=ILEV1) + IF (INUM < 0) THEN + WRITE(YMSG,*) 'Specific ratio for ICE at level ',JLOOP1,' is missing' + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) + END IF + CALL GRIB_GET_SIZE(IGRIB(INUM),'values',ISIZE) + ALLOCATE(ZVALUE(ISIZE)) + CALL GRIB_GET(IGRIB(INUM),'values',ZVALUE) + ALLOCATE(ZOUT(INO)) + CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,INI, & + ZVALUE,INO,ZXOUT,ZYOUT,ZOUT,.FALSE.,PTIME_HORI,.FALSE.) + CALL ARRAY_1D_TO_2D(INO,ZOUT,IIU,IJU,XQ_LS(:,:,INLEVEL-JLOOP1+1,4)) + DEALLOCATE (ZVALUE) + DEALLOCATE (ZOUT) + END DO + + + DO JLOOP1=1, INLEVEL + ILEV1 = JLOOP1-1+ISTARTLEVEL + CALL SEARCH_FIELD(IGRIB,INUM,KDIS=0,KCAT=1,KNUMBER=86,KLEV1=ILEV1) + IF (INUM < 0) THEN + WRITE(YMSG,*) 'Specific ratio ',IPAR,' at level ',JLOOP1,' is missing' + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) + END IF + CALL GRIB_GET_SIZE(IGRIB(INUM),'values',ISIZE) + ALLOCATE(ZVALUE(ISIZE)) + CALL GRIB_GET(IGRIB(INUM),'values',ZVALUE) + ALLOCATE(ZOUT(INO)) + CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,INI, & + ZVALUE,INO,ZXOUT,ZYOUT,ZOUT,.FALSE.,PTIME_HORI,.FALSE.) + CALL ARRAY_1D_TO_2D(INO,ZOUT,IIU,IJU,XQ_LS(:,:,INLEVEL-JLOOP1+1,5)) + DEALLOCATE (ZVALUE) + DEALLOCATE (ZOUT) + END DO + + + DO JLOOP1=1, INLEVEL + ILEV1 = JLOOP1-1+ISTARTLEVEL + CALL SEARCH_FIELD(IGRIB,INUM,KDIS=0,KCAT=1,KNUMBER=201,KLEV1=ILEV1) + IF (INUM < 0) THEN + WRITE(YMSG,*) 'Specific ratio ',IPAR,' at level ',JLOOP1,' is missing' + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) + END IF + CALL GRIB_GET_SIZE(IGRIB(INUM),'values',ISIZE) + ALLOCATE(ZVALUE(ISIZE)) + CALL GRIB_GET(IGRIB(INUM),'values',ZVALUE) + ALLOCATE(ZOUT(INO)) + CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,INI, & + ZVALUE,INO,ZXOUT,ZYOUT,ZOUT,.FALSE.,PTIME_HORI,.FALSE.) + CALL ARRAY_1D_TO_2D(INO,ZOUT,IIU,IJU,XQ_LS(:,:,INLEVEL-JLOOP1+1,6)) + DEALLOCATE (ZVALUE) + DEALLOCATE (ZOUT) + END DO + END IF +END IF +! +IF (CTURB=='TKEL') THEN + WRITE (ILUOUT0,'(A)') ' | Reading TKE field' + DO JLOOP1=1, INLEVEL + ILEV1 = JLOOP1-1+ISTARTLEVEL + IF (IMODEL==1) THEN + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=251,KLEV1=ILEV1) + ELSE ! case 6 new arome + CALL SEARCH_FIELD(IGRIB,INUM,KDIS=0,KCAT=19,KNUMBER=11,KLEV1=ILEV1) + END IF + IF (INUM < 0) THEN + WRITE(YMSG,*) 'TKE at level ',JLOOP1,' is missing' + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) + END IF + CALL GRIB_GET_SIZE(IGRIB(INUM),'values',ISIZE) + ALLOCATE(ZVALUE(ISIZE)) + CALL GRIB_GET(IGRIB(INUM),'values',ZVALUE) + ALLOCATE(ZOUT(INO)) + CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,INI, & + ZVALUE,INO,ZXOUT,ZYOUT,ZOUT,.FALSE.,PTIME_HORI,.FALSE.) + CALL ARRAY_1D_TO_2D(INO,ZOUT,IIU,IJU,XTKE_LS(:,:,INLEVEL-JLOOP1+1)) + DEALLOCATE (ZVALUE) + DEALLOCATE (ZOUT) + END DO +END IF +DEALLOCATE(IINLO) +! +!--------------------------------------------------------------------------------------- +!* 2.6 Interpolation of MOCAGE variable +!--------------------------------------------------------------------------------------- + +IF (IMODEL==5) THEN + LUSECHEM = .TRUE. + IF (LORILAM) THEN + CORGANIC = "MPMPO" + LVARSIGI = .TRUE. + LVARSIGJ = .TRUE. + END IF + ! initialise NSV_* variables + CALL INI_NSV(IMI) + IF( HFILE=='ATM0' ) THEN + ALLOCATE (XSV_LS(IIU,IJU,INLEVEL,NSV)) + ELSE IF (HFILE=='CHEM' ) THEN + DEALLOCATE(XSV_LS) + ALLOCATE (XSV_LS(IIU,IJU,INLEVEL,NSV)) + ELSE + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE','Mocage model: Bad input argument in read_all_data_grib_case') + END IF + XSV_LS(:,:,:,:) = 0. + ILEV1=-1 +! + WRITE (ILUOUT0,'(A,A4,A)') ' | Reading Mocage species (ppp) from ',HFILE,' file' +! +!* 2.6.1 read mocage species +! +! open input file + CALL CH_OPEN_INPUT(YPRE_MOC, "MOC2MESONH", TZFILE, ILUOUT0, KVERB) + ICHANNEL = TZFILE%NLU +! +! read number of mocage species to transfer into mesonh + READ(ICHANNEL, *) IMOC + IF (KVERB >= 5) WRITE(ILUOUT0,*) "number of mocage species to transfer into mesonh : ", IMOC +! +! read data input format + READ(ICHANNEL,"(A)") YFORMAT + YFORMAT=UPCASE(YFORMAT) + IF (KVERB >= 5) WRITE(ILUOUT0,*) "input format is: ", YFORMAT +! +! allocate fields + ALLOCATE(YMNHNAME(IMOC)) + ALLOCATE(INUMGRIB(IMOC)) +! +! read variables names and Grib code + IF (INDEX(YFORMAT,'A') < INDEX(YFORMAT,'I')) THEN + DO JI = 1, IMOC + READ(ICHANNEL,YFORMAT) YMNHNAME(JI), INUMGRIB(JI) + WRITE(ILUOUT0,YFORMAT) YMNHNAME(JI), INUMGRIB(JI) + END DO + ELSE + DO JI = 1, IMOC + READ(ICHANNEL,YFORMAT) INUMGRIB(JI), YMNHNAME(JI) + WRITE(ILUOUT0,YFORMAT) INUMGRIB(JI), YMNHNAME(JI) + END DO + ENDIF + ! + ! close file + CALL IO_File_close(TZFILE) + TZFILE => NULL() + ! + !* 2.6.2 exchange mocage values onto prognostic variables XSV_LS + ! + IF (KVERB >= 10) WRITE(ILUOUT0,'(A,I4)') ' NEQ=',NEQ + ! + DO JNREAL = 1, NEQ + INACT = 0 + search_loop2 : DO JN = 1, IMOC + IF (CNAMES(JNREAL) .EQ. YMNHNAME(JN)) THEN + INACT = JN + EXIT search_loop2 + END IF + END DO search_loop2 + IF (INACT .NE. 0) THEN + DO JLOOP1=1, INLEVEL + ILEV1 = JLOOP1 + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=INUMGRIB(JN),KLEV1=ILEV1) + IF (INUM < 0) THEN + WRITE(YMSG,*) 'Atmospheric ',INUMGRIB(JN),' grib chemical species level ',JLOOP1,' is missing' + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) + END IF + CALL GRIB_GET(IGRIB(INUM),'Nj',INJ,IRET_GRIB) + ALLOCATE(IINLO(INJ)) + CALL COORDINATE_CONVERSION(IMODEL,IGRIB(INUM),IIU,IJU,ZLONOUT,ZLATOUT,& + ZXOUT,ZYOUT,INI,ZPARAM,IINLO) + CALL GRIB_GET_SIZE(IGRIB(INUM),'values',ISIZE) + ALLOCATE(ZVALUE(ISIZE)) + CALL GRIB_GET(IGRIB(INUM),'values',ZVALUE) + ALLOCATE(ZOUT(INO)) + CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,INI, & + ZVALUE,INO,ZXOUT,ZYOUT,ZOUT,.FALSE.,PTIME_HORI,.TRUE. ) + CALL ARRAY_1D_TO_2D(INO,ZOUT,IIU,IJU, & + XSV_LS(:,:,INLEVEL-JLOOP1+1,JNREAL)) + DEALLOCATE (ZVALUE) + DEALLOCATE (ZOUT) + DEALLOCATE(IINLO) + END DO + END IF + END DO + XSV_LS(:,:,:,:) = MAX(XSV_LS(:,:,:,:),0.) +ELSE + LORILAM = .FALSE. + LUSECHEM = .FALSE. + ! initialise NSV_* variables + CALL INI_NSV(1) + IF (NSV > 0) THEN + ALLOCATE (XSV_LS(IIU,IJU,INLEVEL,NSV)) + XSV_LS(:,:,:,:) = 0. + ELSE + ALLOCATE(XSV_LS(0,0,0,0)) + END IF +END IF +! +!--------------------------------------------------------------------------------------- +!* 2.7 Search, read, interpolate and project winds +!--------------------------------------------------------------------------------------- +! +! The way winds are processed depends upon the type of archive : +! +! -> ECMWF, NCEP +! Winds are projected from a standard lat,lon grid to MesoNH grid. This correcponds to +! a rotation of an angle : +! Alpha = k.(L-L0) - Beta +! k,L0 and Beta definiiton parameter of MesoNH grid +! L longitude of the point of the tangent coordinate system +! +! -> Aladin +! The grid used by Aladin files is the same than the one of MesoNH. ! +! So we have 2 sets of parameters : +! k L0 Beta for MesoNH +! k' L0' Beta' for Aladin (Beta'=0 for Aladin) +! We applied twice the formula seen for standard lat,lon grid and we get : +! Alpha = k.(L-L0) - Beta - k'.(L-L0') +! +! -> Arpege +! Arpege winds are given on the tangent coordinate system of the stretched grid. +! Therefore they have first to be projected on a standard lat,lon grid. This is done +! before the interpolation. The projection formulas were given by Meteo France. +! After this projection, the file is simil +! +IF (HFILE(1:3)=='ATM') THEN +ISTARTLEVEL = 1 +ALLOCATE (XU_LS(IIU,IJU,INLEVEL)) +ALLOCATE (XV_LS(IIU,IJU,INLEVEL)) +ALLOCATE (ZTU_LS(INO)) +ALLOCATE (ZTV_LS(INO)) +! +SELECT CASE (IMODEL) + CASE (0,6,7) + IPAR = 131 + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IPAR,KLEV1=ISTARTLEVEL) + IF (INUM< 0) THEN + ISTARTLEVEL = 0 + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IPAR,KLEV1=ISTARTLEVEL) + END IF + CASE (1,2,3) + IPAR = 33 + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IPAR,KLEV1=ISTARTLEVEL) + IF (INUM < 0) THEN + ISTARTLEVEL = 0 + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IPAR,KLEV1=ISTARTLEVEL) + END IF + CASE (10,11) + IPAR = 131 + ISTARTLEVEL = 1 +END SELECT + +DO JLOOP1 = ISTARTLEVEL, ISTARTLEVEL+INLEVEL-1 + IF (IMODEL/=10.AND.IMODEL/=11) THEN ! others than NCEP and ERA5 + ILEV1 = JLOOP1 + ELSE + IF(IMODEL==10) THEN + ILEV1 = IP_GFS(INLEVEL+ISTARTLEVEL-JLOOP1) + ELSE + ILEV1 = IP_ERA(INLEVEL+ISTARTLEVEL-JLOOP1) + END IF + END IF + ! read component u + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IPAR,KLEV1=ILEV1) + IF (INUM < 0) THEN + WRITE(YMSG,*) 'wind vector component "u" at level ',JLOOP1,' is missing' + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) + END IF + CALL GRIB_GET_SIZE(IGRIB(INUM),'values',ISIZE) + ALLOCATE(ZVALUE(ISIZE)) + CALL GRIB_GET(IGRIB(INUM),'values',ZVALUE) + IF (IMODEL==3.OR.(IMODEL==7)) THEN + ALLOCATE(ZTU0_LS(INI)) + ZTU0_LS(:) = ZVALUE(:) + ELSE + CALL GRIB_GET(IGRIB(INUM),'Nj',INJ,IRET_GRIB) + IF(ALLOCATED(IINLO)) DEALLOCATE (IINLO) + ALLOCATE(IINLO(INJ)) + CALL COORDINATE_CONVERSION(IMODEL,IGRIB(INUM),IIU,IJU,ZLONOUT,ZLATOUT,& + ZXOUT,ZYOUT,INI,ZPARAM,IINLO) + ALLOCATE(ZOUT(INO)) + CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,INI, & + ZVALUE,INO,ZXOUT,ZYOUT,ZOUT,.TRUE.,PTIME_HORI,.FALSE. ) + ZTU_LS(:) = ZOUT(:) + DEALLOCATE(IINLO) + DEALLOCATE(ZOUT) + END IF + DEALLOCATE (ZVALUE) + ! read component v and perform interpolation if not Arpege grid + IF (IMODEL/=10.AND.IMODEL/=11) THEN ! others than NCEP and ERA5 + ILEV1 = JLOOP1 + ELSE + IF(IMODEL==10) THEN + ILEV1 = IP_GFS(INLEVEL+ISTARTLEVEL-JLOOP1) + ELSE + ILEV1 = IP_ERA(INLEVEL+ISTARTLEVEL-JLOOP1) + END IF + END IF + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IPAR+1,KLEV1=ILEV1) + IF (INUM < 0) THEN + WRITE(YMSG,*) 'wind vector component "v" at level ',JLOOP1,' is missing' + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) + END IF + CALL GRIB_GET_SIZE(IGRIB(INUM),'values',ISIZE) + ALLOCATE(ZVALUE(ISIZE)) + CALL GRIB_GET(IGRIB(INUM),'values',ZVALUE) + IF ((IMODEL==3).OR.(IMODEL==7)) THEN + CALL GRIB_GET(IGRIB(INUM),'Nj',INJ,IRET_GRIB) + ALLOCATE(IINLO(INJ)) + CALL COORDINATE_CONVERSION(IMODEL,IGRIB(INUM),IIU,IJU,ZLONOUT,ZLATOUT,& + ZXOUT,ZYOUT,INI,ZPARAM,IINLO) + ALLOCATE(ZTV0_LS(INI)) + ZTV0_LS(:) = ZVALUE(:) + ELSE + CALL GRIB_GET(IGRIB(INUM),'Nj',INJ,IRET_GRIB) + ALLOCATE(IINLO(INJ)) + CALL COORDINATE_CONVERSION(IMODEL,IGRIB(INUM),IIU,IJU,ZLONOUT,ZLATOUT,& + ZXOUT,ZYOUT,INI,ZPARAM,IINLO) + ALLOCATE(ZOUT(INO)) + CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,INI, & + ZVALUE,INO,ZXOUT,ZYOUT,ZOUT,.TRUE.,PTIME_HORI,.FALSE.) + ZTV_LS(:) = ZOUT(:) + DEALLOCATE(ZOUT) + END IF + DEALLOCATE (ZVALUE) + ! interpolations for arpege grid + IF ((IMODEL==3).OR.(IMODEL==7)) THEN + ! Comes back to real winds instead of stretched winds + ! (but still with components according to Arpege grid axes) + ZLATPOLE = ZPARAM(7) * XPI/180. + ZLONPOLE = ZPARAM(8) * XPI/180. + ZC = ZPARAM(9) + ZD = ZC * ZC + JLOOP3 = 0 + JLOOP4 = 1 + ZLAT = ZPARAM(3) * XPI / 180. + DO JLOOP2=1, INI + ZLON = JLOOP3 * 2. * XPI / IINLO(JLOOP4) + ! Compute the scale factor + ZA = ((1.+ZD) - (1.-ZD)*SIN(ZLAT)) / (2. * ZC) + ZTU0_LS(JLOOP2) = ZTU0_LS(JLOOP2) * ZA + ZTV0_LS(JLOOP2) = ZTV0_LS(JLOOP2) * ZA + ! next parallel + JLOOP3 = JLOOP3 + 1 + IF (JLOOP3 == IINLO(JLOOP4)) THEN + JLOOP3 = 0 + ZLAT = ZLAT + (((ZPARAM(5)-ZPARAM(3))/(ZPARAM(2)-1)) * XPI / 180.) + JLOOP4 = JLOOP4 + 1 + END IF + END DO + ! + ! interpolation + CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,& + INI,ZTU0_LS,INO,ZXOUT,ZYOUT,ZTU_LS,.TRUE.,PTIME_HORI,.FALSE.) + CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,& + INI,ZTV0_LS,INO,ZXOUT,ZYOUT,ZTV_LS,.TRUE.,PTIME_HORI,.FALSE.) + DEALLOCATE(IINLO) + ! + ! Rotation of the components from Arpege grid axes to real sphere axes + ! + DO JLOOP2=1, INO + ZLAT = ZYOUT(JLOOP2) * XPI / 180. + ZLON = ZXOUT(JLOOP2) * XPI / 180. + ! Compute the rotation matrix + ZA = (ZD+1.) + (ZD-1.)*SIN(ZLAT) + ZB = (ZD-1.) + (ZD+1.)*SIN(ZLAT) + ZE = 2.*ZC*COS(ZLATPOLE)*COS(ZLAT)*COS(ZLON) + ZB*SIN(ZLATPOLE) + IF (ABS(ZE) .GE. ABS(ZA)) THEN + ZF = -2.*ZC*COS(ZLATPOLE)/ ( COS(ZLAT)* ((ZD+1.)+(ZD-1.)*SIN(ZLATPOLE)) ) + ZSIN = -ZF*SIN(ZLONPOLE-ZLON) + ZCOS = ZF*COS(ZLONPOLE-ZLON) + ELSE + ZF = 1. / SQRT(ZA*ZA - ZE*ZE) + ZSIN = -COS(ZLATPOLE)*SIN(ZLON)*ZA*ZF + ZCOS = (2.*ZC*SIN(ZLATPOLE)*COS(ZLAT)-ZB*COS(ZLATPOLE)*COS(ZLON))*ZF + ENDIF + ZTEMP = ZTU_LS(JLOOP2) + ZTU_LS(JLOOP2) = ZCOS*ZTEMP - ZSIN*ZTV_LS(JLOOP2) + ZTV_LS(JLOOP2) = ZSIN*ZTEMP + ZCOS*ZTV_LS(JLOOP2) + END DO + END IF + ! + ! Rotation of the components from the real sphere axes (Arpege, CEP) + ! or model axes (Aladin) to MESO-NH axes + ! + JLOOP4=0 + DO JJ=1,IJU + DO JI=1,IIU + JLOOP4=JLOOP4+1 + IF (IMODEL==2 .OR. IMODEL==1 ) THEN + IF (IMODEL==2) THEN ! ALADIN REUNION + ZALPHA=0 + ELSE !ALADIN + ZALPHA = (XRPK*(ZLONOUT(JLOOP4)-XLON0)-XBETA) - & + (SIN(ZPARAM(9)*XPI/180.)*(ZLONOUT(JLOOP4)-ZPARAM(10))) + ENDIF + ELSE ! CEP, ARPEGE (after projection) + ZALPHA = XRPK*(ZLONOUT(JLOOP4)-XLON0)-XBETA + ENDIF + ZALPHA = ZALPHA * XPI / 180. + XU_LS(JI,JJ,INLEVEL+ISTARTLEVEL-JLOOP1)= & + ZTU_LS(JLOOP4)*COS(ZALPHA) - ZTV_LS(JLOOP4)*SIN(ZALPHA) + XV_LS(JI,JJ,INLEVEL+ISTARTLEVEL-JLOOP1)= & + ZTU_LS(JLOOP4)*SIN(ZALPHA) + ZTV_LS(JLOOP4)*COS(ZALPHA) + ENDDO + ENDDO + IF ((IMODEL==3).OR.(IMODEL==7)) THEN ! deallocation of Arpege arrays + DEALLOCATE (ZTU0_LS) + DEALLOCATE (ZTV0_LS) + END IF +END DO +DEALLOCATE (ZTU_LS) +DEALLOCATE (ZTV_LS) +IF(ALLOCATED(IINLO)) DEALLOCATE (IINLO) +END IF +! +!------------------------------------------------------------------------------- +!* 2.8 Filter the characteristics of the large-scale vortex +!------------------------------------------------------------------------------- +IF (HFILE(1:3)=='ATM' .AND. LFILTERING) THEN + WRITE (ILUOUT0,'(A)') ' | Starting the filtering of the fields to remove large-scale vortex' + IF (INDEX(CFILTERING,'Q')/=0) THEN + WRITE (ILUOUT0,'(A)') ' -> Filtering of Q is now available!' + WRITE (ILUOUT0,'(A,A5)') ' CFILTERING= ',CFILTERING + ENDIF + ! + IF (INDEX(CFILTERING,'P')/=0) THEN + ! compute reduced surface pressure + ALLOCATE(ZTVF_LS(IIU,IJU),ZMSLP_LS(IIU,IJU)) + ! compute pressure reduced to first level above mean sea level + ! (rather than above ground level) + ZGAMREF=-6.5E-3 + !virtual temperature at the first level above ground + ZTVF_LS(:,:) = XT_LS(:,:,1)*(1.+XQ_LS(:,:,1,1)*(XRV/XRD-1)) + !virtual temperature averaged between first level above ground + ! and first level above sea level + ZTVF_LS(:,:) = ZTVF_LS(:,:)-0.5*ZGAMREF*XZS_LS(:,:) + ZMSLP_LS(:,:)=XPS_LS(:,:)*EXP(XG*XZS_LS(:,:)/(XRD*ZTVF_LS(:,:))) + ENDIF + ! + IF (INDEX(CFILTERING,'P')==0) THEN + IF (INDEX(CFILTERING,'Q')==0) THEN + CALL REMOVAL_VORTEX(XZS_LS,XU_LS,XV_LS,XT_LS) + ELSE + CALL REMOVAL_VORTEX(XZS_LS,XU_LS,XV_LS,XT_LS,PQ_LS=XQ_LS(:,:,:,1)) + ENDIF + ELSE + IF (INDEX(CFILTERING,'Q')==0) THEN + CALL REMOVAL_VORTEX(XZS_LS,XU_LS,XV_LS,XT_LS,PPS_LS=ZMSLP_LS) + ELSE + CALL REMOVAL_VORTEX(XZS_LS,XU_LS,XV_LS,XT_LS,PQ_LS=XQ_LS(:,:,:,1),PPS_LS=ZMSLP_LS) + ENDIF + XPS_LS(:,:) = ZMSLP_LS(:,:)*EXP(-XG*XZS_LS(:,:)/(XRD*ZTVF_LS(:,:))) + DEALLOCATE(ZTVF_LS,ZMSLP_LS) + ENDIF + ! +END IF +! +!--------------------------------------------------------------------------------------- +!* 2.9 Read date +!--------------------------------------------------------------------------------------- +! +WRITE (ILUOUT0,'(A)') ' | Reading date' +CALL GRIB_GET(IGRIB(INUM),'dataDate',IDATE,IRET_GRIB) +CALL GRIB_GET(IGRIB(INUM),'dataTime',ITIME,IRET_GRIB) +TPTCUR%xtime=ITIME/100*3600+(ITIME-(ITIME/100)*100)*60 +TPTCUR%nyear=IDATE/10000 +TPTCUR%nmonth=INT((IDATE-TPTCUR%nyear*10000)/100) +TPTCUR%nday=IDATE-TPTCUR%nyear*10000-TPTCUR%nmonth*100 +CALL GRIB_GET(IGRIB(INUM),'startStep',ITIMESTEP,IRET_GRIB) +CALL GRIB_GET(IGRIB(INUM),'stepUnits',CSTEPUNIT,IRET_GRIB) +IF (IMODEL==0.OR.IMODEL==11) THEN + ITWOZS=0 + IF ((TPTCUR%nyear ==2000).AND.(TPTCUR%nmonth >11)) ITWOZS=1 + IF ((TPTCUR%nyear ==2000).AND.(TPTCUR%nmonth ==11)) THEN + IF ( (TPTCUR%nday >20 ) .OR. & + ((TPTCUR%nday ==20 ).AND.(TPTCUR%xtime >=64800 ))) ITWOZS=1 + END IF + IF ( TPTCUR%nyear ==2001 ) ITWOZS=1 + IF ((TPTCUR%nyear ==2002).AND.(TPTCUR%nmonth <11)) ITWOZS=1 + IF ((TPTCUR%nyear ==2002).AND.(TPTCUR%nmonth ==11)) THEN + IF ( (TPTCUR%nday <24 ) .OR. & + ((TPTCUR%nday ==25 ).AND.(TPTCUR%xtime <64800 ))) ITWOZS=1 + END IF + IF (ITWOZS==1) & + WRITE(ILUOUT0,*) ' Check that both orography fields on 1st model level and on surface are used.' +END IF + +CALL MPPDB_CHECK3D(XU_LS,"XU_LS",PRECISION) +CALL MPPDB_CHECK3D(XV_LS,"XV_LS",PRECISION) + +SELECT CASE (CSTEPUNIT) ! Time unit indicator + CASE ('h') !hour + TPTCUR%xtime = TPTCUR%xtime + ITIMESTEP*3600. + CASE ('m') !minute + TPTCUR%xtime = TPTCUR%xtime + ITIMESTEP*60. + CASE ('s') !minute + TPTCUR%xtime = TPTCUR%xtime + ITIMESTEP + CASE DEFAULT + WRITE (ILUOUT0,'(A,A,A)') ' | error CSTEPUNIT=',CSTEPUNIT, ' is different of s,m or h' +END SELECT +CALL DATETIME_CORRECTDATE(TPTCUR) +IF (HFILE(1:3)=='ATM') THEN + CALL SM_PRINT_TIME(TPTCUR,TLUOUT0,'MESONH current date') + TDTCUR = TPTCUR + TDTMOD = TPTCUR + TDTSEG = TPTCUR + TDTEXP = TPTCUR +ELSE IF (HFILE=='CHEM') THEN + CALL SM_PRINT_TIME(TPTCUR,TLUOUT0,'current date in MesoNH format') +ENDIF +! +!------------------------------------------------------------------------------- +!* 2.10 Read and interpolate dummy fields listed in free-format part of nml file +!------------------------------------------------------------------------------- +IF (ODUMMY_REAL) THEN + ! + WRITE (ILUOUT0,'(A)') ' | Try to read 2D dummy fields' + ! + !* 2.10.1 read 2D dummy fields + ! + ! close file + CALL IO_File_close(TPPRE_REAL1) + ! open input file + CALL CH_OPEN_INPUT(TPPRE_REAL1%CNAME, "DUMMY_2D", TZFILE, ILUOUT0, KVERB) + ICHANNEL = TZFILE%NLU + ! + ! read number of dummy 2D fields to transfer into mesonh + READ(ICHANNEL, *) IMOC + IF (KVERB >= 5) WRITE(ILUOUT0,*) "number of dummy fields to transfer into Mesonh : ", IMOC + ALLOCATE(XDUMMY_2D(IIU,IJU,IMOC),CDUMMY_2D(IMOC)) + ALLOCATE(INUMGRIB(IMOC),INUMLEV(IMOC),INUMLEV1(IMOC),INUMLEV2(IMOC)) + INUMLEV(:)=-1 ; INUMLEV1(:)=-1 ; INUMLEV2(:)=-1 + ! + IVAR=0 + ! read variables names and Grib codes + DO JI = 1, IMOC + READ(ICHANNEL,'(A)') YINPLINE + YINPLINE= TRIM(ADJUSTL(YINPLINE)) + IF (LEN_TRIM(YINPLINE) == 0) CYCLE ! skip blank line + ! transform tab and comma character into blank + DO JJ=1,LEN_TRIM(YINPLINE) + IF (YINPLINE(JJ:JJ)==YPTAB .OR. YINPLINE(JJ:JJ)==YPCOM) YINPLINE(JJ:JJ)= ' ' + END DO + IF (KVERB >= 10) WRITE(ILUOUT0,*) 'Line read : ', YINPLINE + ! extract field name + INDX= INDEX(YINPLINE,' ') + YFIELD= YINPLINE(1:INDX-1) + IF (KVERB >= 5) WRITE(ILUOUT0,*) 'Field being treated : ', YFIELD + ITYP=105 + ILEV1=-1 + ILEV2=-1 + ! extract the parameter indicator + YINPLINE= ADJUSTL(YINPLINE(INDX:)) + INDX= INDEX(YINPLINE,' ') + IF (INDX == 1) THEN + WRITE(ILUOUT0,*) ' Parameter indicator is missing. ',YFIELD,' not treated.' + CYCLE + END IF + IVAR=IVAR+1 + READ(YINPLINE(1:INDX-1),*) IPAR + IF (NVERB>=5) WRITE(ILUOUT0,*) ' Parameter indicator: ',IPAR + ! extract the level indicator (optional) + YINPLINE= ADJUSTL(YINPLINE(INDX:)) + INDX= INDEX(YINPLINE,' ') + IF (INDX /= 1) THEN + READ(YINPLINE(1:INDX-1),*) ITYP + IF (NVERB>=5) WRITE(ILUOUT0,*) ' Level indicator is indicated: ',ITYP + END IF + ! extract the first level value (optional) + YINPLINE= ADJUSTL(YINPLINE(INDX:)) + INDX= INDEX(YINPLINE,' ') + IF (INDX /= 1) THEN + READ(YINPLINE(1:INDX-1),*) ILEV1 + IF (NVERB>=5) WRITE(ILUOUT0,*) ' Level1 value is indicated: ',ILEV1 + END IF + ! extract the second level value (optional) + YINPLINE= ADJUSTL(YINPLINE(INDX:)) + INDX= INDEX(YINPLINE,' ') + IF (INDX /= 1) THEN + READ(YINPLINE(1:INDX-1),*) ILEV2 + IF (NVERB>=5) WRITE(ILUOUT0,*) ' Level2 value is indicated: ',ILEV2 + END IF + ! + CDUMMY_2D(IVAR)=YFIELD ; INUMGRIB(IVAR)=IPAR + INUMLEV(IVAR)=ITYP ; INUMLEV1(IVAR)=ILEV1 ; INUMLEV2(IVAR)=ILEV2 + ! + END DO + ! + CALL IO_File_close(TZFILE) + TZFILE => NULL() + ! + IF (NVERB>=10) THEN + WRITE(ILUOUT0,*) CDUMMY_2D(1:IVAR) + WRITE(ILUOUT0,*) INUMGRIB(1:IVAR) + WRITE(ILUOUT0,*) INUMLEV(1:IVAR) + WRITE(ILUOUT0,*) INUMLEV1(1:IVAR) + WRITE(ILUOUT0,*) INUMLEV2(1:IVAR) + END IF + ! + IF (IVAR /= IMOC) THEN + WRITE (ILUOUT0,'(A,I3,A,I3,A)') ' -> Number of correct lines (',IVAR,') is different of ',IMOC,' - abort' + WRITE(YMSG,*) 'number of correct lines (',IVAR,') is different of ',IMOC + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) + END IF + ! + !* 2.10.2 read and interpolate variables onto dummy variables XDUMMY_2D + ! + DO JI = 1, IMOC + WRITE(ILUOUT0,'(A,4(I3,1X))') CDUMMY_2D(JI),INUMGRIB(JI),INUMLEV(JI),INUMLEV1(JI),INUMLEV2(JI) + CALL SEARCH_FIELD(IGRIB,INUM,KPARAM=IPAR,KLEV1=ILEV1) + IF (INUM < 0) THEN + WRITE (ILUOUT0,'(A,I3,A,I2,A)') ' -> 2D field ',INUMGRIB(JI),' is missing - abort' + WRITE(YMSG,*) '2D field ',INUMGRIB(JI),' is missing' + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_ALL_DATA_GRIB_CASE',YMSG) + END IF + CALL GRIB_GET(IGRIB(INUM),'Nj',INJ,IRET_GRIB) + ALLOCATE(IINLO(INJ)) + CALL COORDINATE_CONVERSION(IMODEL,IGRIB(INUM),IIU,IJU,ZLONOUT,ZLATOUT,& + ZXOUT,ZYOUT,INI,ZPARAM,IINLO) + CALL GRIB_GET_SIZE(IGRIB(INUM),'values',ISIZE) + ALLOCATE(ZVALUE(ISIZE)) + CALL GRIB_GET(IGRIB(INUM_ZS),'values',ZVALUE) + ALLOCATE(ZOUT(INO)) + CALL HORIBL(ZPARAM(3),ZPARAM(4),ZPARAM(5),ZPARAM(6),INT(ZPARAM(2)),IINLO,INI, & + ZVALUE,INO,ZXOUT,ZYOUT,ZOUT,.FALSE.,PTIME_HORI,.FALSE. ) + DEALLOCATE(IINLO) + DEALLOCATE(ZVALUE) + CALL ARRAY_1D_TO_2D(INO,ZOUT,IIU,IJU,XDUMMY_2D(:,:,JI)) + DEALLOCATE (ZOUT) + END DO +! +ENDIF +! +!--------------------------------------------------------------------------------------- +! +!* 3. VERTICAL GRID +! +IF (HFILE(1:3)=='ATM') THEN + WRITE (ILUOUT0,'(A)') ' | Reading of vertical grid in progress' + CALL READ_VER_GRID(TPPRE_REAL1) +END IF + +! +!--------------------------------------------------------------------------------------- +! +!* 4. Free all temporary allocations +! +DEALLOCATE (ZLATOUT) +DEALLOCATE (ZLONOUT) +DEALLOCATE (ZXOUT) +DEALLOCATE (ZYOUT) +DEALLOCATE(ZPARAM) +DEALLOCATE(ZPARAM_ZS) +DEALLOCATE(IINLO_ZS) +DO JLOOP=1,ICOUNT + CALL GRIB_RELEASE(IGRIB(JLOOP)) +ENDDO +DEALLOCATE(IGRIB) + +WRITE (ILUOUT0,'(A,A4,A)') ' -- Grib decoder for ',HFILE,' file ended successfully' +! +!--------------------------------------------------------------------------------------- +!--------------------------------------------------------------------------------------- +!--------------------------------------------------------------------------------------- +! +! + +! +CONTAINS +! +! +! ########################################################################## + SUBROUTINE ARRAY_1D_TO_2D (KN1,P1,KL1,KL2,P2) +! ########################################################################## +! +! Small routine used to store a linear array into a 2 dimension array +! +IMPLICIT NONE +INTEGER, INTENT(IN) :: KN1 +REAL,DIMENSION(KN1), INTENT(IN) :: P1 +INTEGER, INTENT(IN) :: KL1 +INTEGER, INTENT(IN) :: KL2 +REAL,DIMENSION(KL1,KL2),INTENT(OUT) :: P2 +INTEGER :: JLOOP1_A1T2 +INTEGER :: JLOOP2_A1T2 +INTEGER :: JPOS_A1T2 +! +IF (KN1 < KL1*KL2) THEN + CALL PRINT_MSG(NVERB_FATAL,'GEN','ARRAY_1D_TO_2D','sizes do not match') +END IF +JPOS_A1T2 = 1 +DO JLOOP2_A1T2 = 1, KL2 + DO JLOOP1_A1T2 = 1, KL1 + P2(JLOOP1_A1T2,JLOOP2_A1T2) = P1(JPOS_A1T2) + JPOS_A1T2 = JPOS_A1T2 + 1 + END DO +END DO +END SUBROUTINE ARRAY_1D_TO_2D +! +! +!--------------------------------------------------------------------------------------- +!--------------------------------------------------------------------------------------- +!--------------------------------------------------------------------------------------- +!################################################################################# +SUBROUTINE SEARCH_FIELD(KGRIB,KNUM,KPARAM,KDIS,KCAT,KNUMBER,KLEV1,KTFFS) +!################################################################################# +! search the grib message corresponding to KPARAM,KLTYPE,KLEV1,KLEV2 in all +! the KGIRB messages +! +USE MODD_LUNIT +USE GRIB_API +! +IMPLICIT NONE +! +! +INTEGER(KIND=kindOfInt),DIMENSION(:),INTENT(IN) :: KGRIB ! number of grib messages +INTEGER,INTENT(OUT) :: KNUM ! number of the message researched +INTEGER,INTENT(IN),OPTIONAL :: KPARAM ! INdicator of parameter/paramId +INTEGER,INTENT(IN),OPTIONAL :: KDIS ! Discipline (GRIB2) +INTEGER,INTENT(IN),OPTIONAL :: KCAT ! Catégorie (GRIB2) +INTEGER,INTENT(IN),OPTIONAL :: KNUMBER ! parameterNumber (GRIB2) +INTEGER,INTENT(IN),OPTIONAL :: KLEV1 ! Level +INTEGER,INTENT(IN),OPTIONAL :: KTFFS ! TypeOfFirstFixedSurface +! +! Declaration of local variables +! +INTEGER :: IFOUND ! Number of correct parameters +INTEGER :: ISEARCH ! Number of correct parameters to find +INTEGER :: IRET ! error code +INTEGER :: IPARAM,IDIS,ICAT,INUMBER,ITFFS +INTEGER :: ILEV1 ! Level parameter 1 +INTEGER :: JLOOP ! Dummy counter +INTEGER :: IVERSION +! Variables used to display messages +INTEGER :: ILUOUT0 ! Logical unit number of the listing +! +ILUOUT0 = TLUOUT0%NLU +! +ISEARCH=0 +! Initialize as not found +KNUM = -1 +! +IF (PRESENT(KPARAM)) ISEARCH=ISEARCH+1 +IF (PRESENT(KDIS)) ISEARCH=ISEARCH+1 +IF (PRESENT(KCAT)) ISEARCH=ISEARCH+1 +IF (PRESENT(KNUMBER)) ISEARCH=ISEARCH+1 +IF (PRESENT(KLEV1)) ISEARCH=ISEARCH+1 +IF(PRESENT(KTFFS)) ISEARCH=ISEARCH+1 +! +DO JLOOP=1,SIZE(KGRIB) + IFOUND = 0 + ! + CALL GRIB_GET(KGRIB(JLOOP),'editionNumber',IVERSION,IRET_GRIB) + IF (IRET_GRIB > 0) THEN + WRITE (ILUOUT0,'(A)')' | Error encountered in the Grib file, skipping field' + CYCLE + ELSE IF (IRET_GRIB == -6) THEN + WRITE (ILUOUT0,'(A)')' | ECMWF pseudo-Grib data encountered, skipping field' + CYCLE + ENDIF + ! + IF (PRESENT(KTFFS)) THEN + CALL GRIB_GET(KGRIB(JLOOP),'typeOfFirstFixedSurface',ITFFS,IRET_GRIB) + IF (IRET_GRIB > 0) THEN + WRITE (ILUOUT0,'(A)')' | Error encountered in the Grib file, skipping field' + CYCLE + ELSE IF (IRET_GRIB == -6) THEN + WRITE (ILUOUT0,'(A)')' | ECMWF pseudo-Grib data encountered, skipping field' + CYCLE + ENDIF + IF (ITFFS==KTFFS) THEN + IFOUND = IFOUND + 1 + ELSE + CYCLE + ENDIF + ENDIF + + IF (PRESENT(KPARAM)) THEN + IF (IVERSION == 2) THEN + CALL GRIB_GET(KGRIB(JLOOP),'paramId',IPARAM,IRET_GRIB) + ELSE + CALL GRIB_GET(KGRIB(JLOOP),'indicatorOfParameter',IPARAM,IRET_GRIB) + ENDIF + IF (IRET_GRIB > 0) THEN + WRITE (ILUOUT0,'(A)')' | Error encountered in the Grib file, skipping field' + CYCLE + ELSE IF (IRET_GRIB == -6) THEN + WRITE (ILUOUT0,'(A)')' | ECMWF pseudo-Grib data encountered, skipping field' + CYCLE + ENDIF + IF (IPARAM==KPARAM) THEN + IFOUND = IFOUND + 1 + ELSE + CYCLE + ENDIF + ENDIF + ! + IF (PRESENT(KDIS)) THEN + CALL GRIB_GET(KGRIB(JLOOP),'discipline',IDIS,IRET_GRIB) + IF (IRET_GRIB > 0) THEN + WRITE (ILUOUT0,'(A)')' | Error encountered in the Grib file, skipping field' + CYCLE + ELSE IF (IRET_GRIB == -6) THEN + WRITE (ILUOUT0,'(A)')' | ECMWF pseudo-Grib data encountered, skipping field' + CYCLE + ENDIF + IF (IDIS==KDIS) THEN + IFOUND = IFOUND + 1 + ELSE + CYCLE + ENDIF + ENDIF + IF (PRESENT(KCAT)) THEN + CALL GRIB_GET(KGRIB(JLOOP),'parameterCategory',ICAT,IRET_GRIB) + IF (IRET_GRIB > 0) THEN + WRITE (ILUOUT0,'(A)')' | Error encountered in the Grib file, skipping field' + CYCLE + ELSE IF (IRET_GRIB == -6) THEN + WRITE (ILUOUT0,'(A)')' | ECMWF pseudo-Grib data encountered, skipping field' + CYCLE + ENDIF + IF (ICAT==KCAT) THEN + IFOUND = IFOUND + 1 + ELSE + CYCLE + ENDIF + ENDIF + IF (PRESENT(KNUMBER)) THEN + CALL GRIB_GET(KGRIB(JLOOP),'parameterNumber',INUMBER,IRET_GRIB) + IF (IRET_GRIB > 0) THEN + WRITE (ILUOUT0,'(A)')' | Error encountered in the Grib file, skipping field' + CYCLE + ELSE IF (IRET_GRIB == -6) THEN + WRITE (ILUOUT0,'(A)')' | ECMWF pseudo-Grib data encountered, skipping field' + CYCLE + ENDIF + IF (INUMBER==KNUMBER) THEN + IFOUND = IFOUND + 1 + ELSE + CYCLE + ENDIF + ENDIF + ! + IF(PRESENT(KLEV1)) THEN + CALL GRIB_GET(KGRIB(JLOOP),'topLevel',ILEV1,IRET_GRIB) + IF (IRET_GRIB > 0) THEN + WRITE (ILUOUT0,'(A)')' | Error encountered in the Grib file, skipping field' + CYCLE + ELSE IF (IRET_GRIB == -6) THEN + WRITE (ILUOUT0,'(A)')' | ECMWF pseudo-Grib data encountered, skipping field' + CYCLE + ENDIF + IF (ILEV1==KLEV1) THEN + IFOUND = IFOUND + 1 + ELSE + CYCLE + ENDIF + ENDIF + ! + IF (IFOUND == ISEARCH) THEN + KNUM=JLOOP + EXIT + ELSE ! field not found + KNUM=-1 + END IF +END DO +! +END SUBROUTINE SEARCH_FIELD +!################################################################################# +SUBROUTINE COORDINATE_CONVERSION(KMODEL,KGRIB,KNOLON,KNOLARG,& + PLONOUT,PLATOUT,PLXOUT,PLYOUT,KNI,PPARAM,KINLO) +!################################################################################# +!perform coordinate conversion from lat/lon system to x,y (depends on the grib +! type) +!! AUTHOR +!! ------ +!! +!! G. Tanguy +!! +!! MODIFICATIONS +!! ------------- +!! +!! Original 08/06/2010 + +USE MODD_CST +USE MODI_LATLONTOXY +USE GRIB_API +! +IMPLICIT NONE +! +! +INTEGER(KIND=kindOfInt),INTENT(IN) :: KGRIB ! number of the grib message +INTEGER,INTENT(IN) :: KMODEL ! number of the model +INTEGER,INTENT(OUT) :: KNI ! number of points +INTEGER,INTENT(IN) :: KNOLON,KNOLARG ! Number of output points +REAL,DIMENSION( KNOLON*KNOLARG),INTENT(IN) :: PLONOUT ! Output coordinate, +REAL,DIMENSION( KNOLON*KNOLARG),INTENT(IN) :: PLATOUT ! lat/lon system +REAL,DIMENSION( KNOLON*KNOLARG),INTENT(INOUT) :: PLXOUT ! Converted output coordinates +REAL,DIMENSION( KNOLON*KNOLARG),INTENT(INOUT) :: PLYOUT ! (depends on Grib Grid type) +REAL,DIMENSION(:),INTENT(INOUT) :: PPARAM ! output parameters of +! the grid to avoid many calculations +INTEGER,DIMENSION(:),INTENT(INOUT) :: KINLO ! Number of points along a parallel +!=============================== +INTEGER :: IINLA ! Number of points along a meridian +INTEGER :: JLOOP1,JLOOP2 ! Dummy counter +INTEGER :: INO ! Number of output points +REAL :: ZILA1 ! Grib first point latitude +REAL :: ZILO1 ! Grib first point longitude +REAL :: ZILA2 ! Grib last point latitude +REAL :: ZILO2 ! Grib last point longitude +REAL :: ZILASP ! Grib streching pole lat +REAL :: ZILOSP ! Grib streching pole lon +LOGICAL :: GREADY ! Used to test if projection is needed +INTEGER :: ILENX ! nb points in X +INTEGER :: ILENY ! nb points in Y +INTEGER :: IEARTH ! +REAL :: ZSTRECH ! streching of arpege grid +INTEGER(KIND=kindOfInt) :: IMISSING ! dummy variable +! Aladin projection +REAL :: ZALALAT0 ! Grid definition parameters +REAL :: ZALALON0 ! | +REAL :: ZALALATOR ! | +REAL :: ZALALONOR ! | +REAL :: ZALARPK ! | +REAL, DIMENSION(:,:), ALLOCATABLE :: ZXM ! Intermediate arrays +REAL, DIMENSION(:,:), ALLOCATABLE :: ZYM ! | +REAL, DIMENSION(:,:), ALLOCATABLE :: ZLONM ! | +REAL, DIMENSION(:,:), ALLOCATABLE :: ZLATM ! | +! CEP projection +REAL, DIMENSION(:), ALLOCATABLE :: ZLATGRIB +REAL, DIMENSION(:), ALLOCATABLE :: ZLONGRIB +INTEGER :: INBLATGRIB,INBLONGRIB +!JUAN +INTEGER(KIND=kindOfInt),DIMENSION(:),ALLOCATABLE :: INLO_GRIB ! Number of points along a parallel +!JUAN +! +!-------------------------------------------------------------------------------- +! +!JUAN +ALLOCATE(INLO_GRIB(SIZE(KINLO))) +!JUAN +INO= KNOLON*KNOLARG +SELECT CASE (KMODEL) +! +CASE(0,5,11) ! CEP/MOCAGE/ERA5 +! en theorie il faut ces 4 lignes +! CALL GRIB_GET(KGRIB,'latitudeOfFirstGridPointInDegrees',ZILA1) +! CALL GRIB_GET(KGRIB,'longitudeOfFirstGridPointInDegrees',ZILO1) +! CALL GRIB_GET(KGRIB,'latitudeOfLastGridPointInDegrees',ZILA2) +! CALL GRIB_GET(KGRIB,'longitudeOfLastGridPointInDegrees',ZILO2) +! pourtant au passage de GRIB1 a GRIB2 les arrondi etait fait differement +! et on n'obtenais pas les meme resultat entre un fichier grib1 et le meme +! convertit en GRIB2 +! Du coup en faisant ce qui suit on prend une valeur recalculee par grib_api +! suivant l'ordre N de la gausienne donc plus precise et donc la meme entre le +! GRIB1 et le GRIB2 + CALL GRIB_GET(KGRIB,'Nj',IINLA,IRET_GRIB) + CALL GRIB_GET_SIZE(KGRIB,'latitudes',INBLATGRIB) + CALL GRIB_GET_SIZE(KGRIB,'longitudes',INBLONGRIB) + ALLOCATE(ZLATGRIB(INBLATGRIB)) + ALLOCATE(ZLONGRIB(INBLONGRIB)) + CALL GRIB_GET(KGRIB,'latitudes',ZLATGRIB) + CALL GRIB_GET(KGRIB,'longitudes',ZLONGRIB) + ZILA1=MAXVAL(ZLATGRIB) + ZILO1=MINVAL(ZLONGRIB) + ZILA2=MINVAL(ZLATGRIB) + ZILO2=MAXVAL(ZLONGRIB) + KNI=0 + CALL GRIB_IS_MISSING(KGRIB,'pl',IMISSING,IRET_GRIB) + IF (IRET_GRIB /= 0 .OR. IMISSING==1) THEN ! pl not present + CALL GRIB_GET(KGRIB,'Ni',INLO_GRIB(1),IRET_GRIB) + INLO_GRIB(2:)=INLO_GRIB(1) + KNI=IINLA*INLO_GRIB(1) + GREADY= (PPARAM(1)==INLO_GRIB(1) .AND. PPARAM(2)==IINLA .AND.& + PPARAM(3)==ZILA1 .AND. PPARAM(4)==ZILO1 .AND.& + PPARAM(5)==ZILA2 .AND. PPARAM(6)==ZILO2) + PPARAM(1)=INLO_GRIB(1) + PPARAM(2)=IINLA + PPARAM(3)=ZILA1 + PPARAM(4)=ZILO1 + PPARAM(5)=ZILA2 + PPARAM(6)=ZILO2 + ELSE ! pl present in the grib + CALL GRIB_GET(KGRIB,'pl',INLO_GRIB) + DO JLOOP1=1 ,IINLA + KNI = KNI + INLO_GRIB(JLOOP1) + ENDDO + GREADY= (PPARAM(1)==INLO_GRIB(1) .AND.& + PPARAM(3)==ZILA1 .AND. PPARAM(4)==ZILO1 .AND.& + PPARAM(5)==ZILA2 .AND. PPARAM(6)==ZILO2) + PPARAM(1)=INLO_GRIB(1) + PPARAM(2)=IINLA + PPARAM(3)=ZILA1 + PPARAM(4)=ZILO1 + PPARAM(5)=ZILA2 + PPARAM(6)=ZILO2 + END IF + IF (.NOT. GREADY) THEN + PLXOUT=PLONOUT + PLYOUT=PLATOUT + ENDIF +! +CASE(1,6) ! ALADIN +! + CALL GRIB_GET(KGRIB,'Nj',IINLA,IRET_GRIB) + CALL GRIB_GET(KGRIB,'Ni',INLO_GRIB(1),IRET_GRIB) + INLO_GRIB(2:)=INLO_GRIB(1) + CALL GRIB_GET(KGRIB,'DxInMetres',ILENX) + CALL GRIB_GET(KGRIB,'DyInMetres',ILENY) + CALL GRIB_GET(KGRIB,'LoVInDegrees',ZALALON0) + CALL GRIB_GET(KGRIB,'Latin1InDegrees',ZALALAT0) + KNI = IINLA*INLO_GRIB(1) + ZILA1 = 0. + ZILO1 = 0. + ZILA2 = ZILA1 + (IINLA -1)*ILENY + ZILO2 = ZILO1 + (INLO_GRIB(1)-1)*ILENX + GREADY= (PPARAM(1)==INLO_GRIB(1) .AND. PPARAM(2)==IINLA .AND.& + PPARAM(3)==ZILA1 .AND. PPARAM(4)==ZILO1 .AND.& + PPARAM(5)==ZILA2 .AND. PPARAM(6)==ZILO2.AND.& + PPARAM(7)==ILENX .AND. PPARAM(8)==ILENY.AND.& + PPARAM(9)==ZALALAT0 .AND. PPARAM(10)==ZALALON0) + IF(.NOT. GREADY) THEN + PPARAM(1)=INLO_GRIB(1) + PPARAM(2)=IINLA + PPARAM(3)=ZILA1 + PPARAM(4)=ZILO1 + PPARAM(5)=ZILA2 + PPARAM(6)=ZILO2 + PPARAM(7)=ILENX + PPARAM(8)=ILENY + PPARAM(9)=ZALALAT0 + PPARAM(10)=ZALALON0 +! + IF (ZALALON0 > 180.) ZALALON0 = ZALALON0 - 360. + CALL GRIB_GET(KGRIB,'latitudeOfFirstGridPointInDegrees',ZALALATOR) + CALL GRIB_GET(KGRIB,'longitudeOfFirstGridPointInDegrees',ZALALONOR) + IF (ZALALONOR > 180.) ZALALONOR = ZALALONOR - 360. + ZALARPK = SIN(ZALALAT0/180.*XPI) + ALLOCATE (ZXM(KNOLON,KNOLARG)) + ALLOCATE (ZYM(KNOLON,KNOLARG)) + ALLOCATE (ZLONM(KNOLON,KNOLARG)) + ALLOCATE (ZLATM(KNOLON,KNOLARG)) + JLOOP1=0 + DO JLOOP2=1, KNOLARG + ZLONM(1:KNOLON,JLOOP2) = PLONOUT(1+JLOOP1:KNOLON+JLOOP1) + ZLATM(1:KNOLON,JLOOP2) = PLATOUT(1+JLOOP1:KNOLON+JLOOP1) + JLOOP1 = JLOOP1+KNOLON + END DO + CALL SM_LATLONTOXY_A (ZALALAT0,ZALALON0,ZALARPK,ZALALATOR,ZALALONOR, & + ZXM,ZYM,ZLATM,ZLONM,KNOLON,KNOLARG,6367470.) + JLOOP1=0 + DO JLOOP2=1, KNOLARG + PLXOUT(1+JLOOP1:KNOLON+JLOOP1)=ZXM(1:KNOLON,JLOOP2) + PLYOUT(1+JLOOP1:KNOLON+JLOOP1)=ZYM(1:KNOLON,JLOOP2) + JLOOP1 = JLOOP1+KNOLON + ENDDO + DEALLOCATE (ZLATM) + DEALLOCATE (ZLONM) + DEALLOCATE (ZYM) + DEALLOCATE (ZXM) + END IF +! +CASE(2) ! ALADIN REUNION +! + CALL GRIB_GET(KGRIB,'Nj',IINLA,IRET_GRIB) + CALL GRIB_GET(KGRIB,'Ni',INLO_GRIB(1),IRET_GRIB) + INLO_GRIB(2:)=INLO_GRIB(1) + CALL GRIB_GET(KGRIB,'DiInMetres',ILENX) + CALL GRIB_GET(KGRIB,'DjInMetres',ILENY) + CALL GRIB_GET(KGRIB,'LaDInDegrees',ZALALAT0) + KNI = IINLA*INLO_GRIB(1) + ZILA1 = 0. + ZILO1 = 0. + ZILA2 = ZILA1 + (IINLA -1)*ILENY + ZILO2 = ZILO1 + (INLO_GRIB(1)-1)*ILENX + GREADY= (PPARAM(1)==INLO_GRIB(1) .AND. PPARAM(2)==IINLA .AND.& + PPARAM(3)==ZILA1 .AND. PPARAM(4)==ZILO1 .AND.& + PPARAM(5)==ZILA2 .AND. PPARAM(6)==ZILO2.AND.& + PPARAM(7)==ILENX .AND. PPARAM(8)==ILENY.AND.& + PPARAM(9)==ZALALAT0) + IF(.NOT. GREADY) THEN + PPARAM(1)=INLO_GRIB(1) + PPARAM(2)=IINLA + PPARAM(3)=ZILA1 + PPARAM(4)=ZILO1 + PPARAM(5)=ZILA2 + PPARAM(6)=ZILO2 + PPARAM(7)=ILENX + PPARAM(8)=ILENY + PPARAM(9)=ZALALAT0 + ZALALON0 = 0. + CALL GRIB_GET(KGRIB,'latitudeOfFirstGridPointInDegrees',ZALALATOR) + CALL GRIB_GET(KGRIB,'longitudeOfFirstGridPointInDegrees',ZALALONOR) + IF (ZALALONOR > 180.) ZALALONOR = ZALALONOR - 360. + ZALARPK = 0 + ALLOCATE (ZXM(KNOLON,KNOLARG)) + ALLOCATE (ZYM(KNOLON,KNOLARG)) + ALLOCATE (ZLONM(KNOLON,KNOLARG)) + ALLOCATE (ZLATM(KNOLON,KNOLARG)) + JLOOP1=0 + DO JLOOP2=1, KNOLARG + ZLONM(1:KNOLON,JLOOP2) = PLONOUT(1+JLOOP1:KNOLON+JLOOP1) + ZLATM(1:KNOLON,JLOOP2) = PLATOUT(1+JLOOP1:KNOLON+JLOOP1) + JLOOP1 = JLOOP1+KNOLON + END DO + CALL GRIB_GET(KGRIB,'earthIsOblate',IEARTH) + IF (IEARTH==0) THEN + CALL SM_LATLONTOXY_A (ZALALAT0,ZALALON0,ZALARPK,ZALALATOR,ZALALONOR, & + ZXM,ZYM,ZLATM,ZLONM,KNOLON,KNOLARG,6367470.) + ELSE + CALL SM_LATLONTOXY_A (ZALALAT0,ZALALON0,ZALARPK,ZALALATOR,ZALALONOR, & + ZXM,ZYM,ZLATM,ZLONM,KNOLON,KNOLARG) + END IF + JLOOP1=0 + DO JLOOP2=1, KNOLARG + PLXOUT(1+JLOOP1:KNOLON+JLOOP1)=ZXM(1:KNOLON,JLOOP2) + PLYOUT(1+JLOOP1:KNOLON+JLOOP1)=ZYM(1:KNOLON,JLOOP2) + JLOOP1 = JLOOP1+KNOLON + ENDDO + DEALLOCATE (ZLATM) + DEALLOCATE (ZLONM) + DEALLOCATE (ZYM) + DEALLOCATE (ZXM) + END IF +! +CASE(3,4,7) ! ARPEGE +! +!print*,"=========COORDINATE CONVERSION CASE ARPEGE =============" +! PROBLEME AVEC LES GRIB d'EPYGRAM +! dans longitudeOfLastGridPointInDegrees on la la longitude du dernier point du +! tableau (donc au pole sud) +! dans les GRIB1 ont avait la valeur max du tableau des longitude (donc à +! l'equateur) + CALL GRIB_GET(KGRIB,'latitudeOfFirstGridPointInDegrees',ZILA1) + CALL GRIB_GET(KGRIB,'longitudeOfFirstGridPointInDegrees',ZILO1) + CALL GRIB_GET(KGRIB,'latitudeOfLastGridPointInDegrees',ZILA2) + CALL GRIB_GET(KGRIB,'longitudeOfLastGridPointInDegrees',ZILO2) + CALL GRIB_GET(KGRIB,'latitudeOfStretchingPoleInDegrees',ZILASP) + CALL GRIB_GET(KGRIB,'longitudeOfStretchingPoleInDegrees',ZILOSP) + CALL GRIB_GET(KGRIB,'stretchingFactor',ZSTRECH) + CALL GRIB_GET(KGRIB,'Nj',IINLA,IRET_GRIB) +! + KNI=0 + CALL GRIB_IS_MISSING(KGRIB,'pl',IRET_GRIB) + IF (IRET_GRIB == 1) THEN ! regular + CALL GRIB_GET(KGRIB,'Ni',INLO_GRIB(1),IRET_GRIB) + INLO_GRIB(2:)=INLO_GRIB(1) + KNI=IINLA*INLO_GRIB(1) + GREADY= (PPARAM(1)==INLO_GRIB(1) .AND. PPARAM(2)==IINLA .AND.& + PPARAM(3)==ZILA1 .AND. PPARAM(4)==ZILO1 .AND.& + PPARAM(5)==ZILA2 .AND. PPARAM(6)==ZILO2 .AND.& + PPARAM(7)==ZILASP .AND. PPARAM(8)==ZILOSP .AND.& + PPARAM(9)==ZSTRECH) + ELSE ! quasi-regular + CALL GRIB_GET(KGRIB,'pl',INLO_GRIB) + DO JLOOP1=1 ,IINLA + KNI = KNI + INLO_GRIB(JLOOP1) + ENDDO + ZILO2=360.-360./(MAXVAL(INLO_GRIB)) + GREADY= (PPARAM(1)==INLO_GRIB(1) .AND.& + PPARAM(3)==ZILA1 .AND. PPARAM(4)==ZILO1 .AND.& + PPARAM(5)==ZILA2 .AND. PPARAM(6)==ZILO2 .AND.& + PPARAM(7)==ZILASP .AND. PPARAM(8)==ZILOSP .AND.& + PPARAM(9)==ZSTRECH) + END IF +! + IF (.NOT. GREADY) THEN + CALL ARPEGE_STRETCH_A(INO,ZILASP,ZILOSP, & + ZSTRECH,PLATOUT,PLONOUT,PLYOUT,PLXOUT) + PPARAM(1)=INLO_GRIB(1) + PPARAM(2)=IINLA + PPARAM(3)=ZILA1 + PPARAM(4)=ZILO1 + PPARAM(5)=ZILA2 + PPARAM(6)=ZILO2 + PPARAM(7)=ZILASP + PPARAM(8)=ZILOSP + PPARAM(9)=ZSTRECH + END IF +! +CASE(10) ! NCEP +! + CALL GRIB_GET(KGRIB,'latitudeOfFirstGridPointInDegrees',ZILA1) + CALL GRIB_GET(KGRIB,'longitudeOfFirstGridPointInDegrees',ZILO1) + CALL GRIB_GET(KGRIB,'latitudeOfLastGridPointInDegrees',ZILA2) + CALL GRIB_GET(KGRIB,'longitudeOfLastGridPointInDegrees',ZILO2) + CALL GRIB_GET(KGRIB,'Nj',IINLA,IRET_GRIB) + CALL GRIB_GET(KGRIB,'Ni',INLO_GRIB(1),IRET_GRIB) + INLO_GRIB(2:)=INLO_GRIB(1) + KNI=IINLA*INLO_GRIB(1) + GREADY= (PPARAM(1)==INLO_GRIB(1) .AND. PPARAM(2)==IINLA .AND.& + PPARAM(3)==ZILA1 .AND. PPARAM(4)==ZILO1 .AND.& + PPARAM(5)==ZILA2 .AND. PPARAM(6)==ZILO2) + PPARAM(1)=INLO_GRIB(1) + PPARAM(2)=IINLA + PPARAM(3)=ZILA1 + PPARAM(4)=ZILO1 + PPARAM(5)=ZILA2 + PPARAM(6)=ZILO2 + IF (.NOT. GREADY) THEN + PLXOUT=PLONOUT + PLYOUT=PLATOUT + ENDIF +END SELECT +!JUAN +KINLO=INLO_GRIB +!JUAN +END SUBROUTINE COORDINATE_CONVERSION +! +! ################################################################### + SUBROUTINE ARPEGE_STRETCH_A(KN,PLAP,PLOP,PCOEF,PLAR,PLOR,PLAC,PLOC) +! ################################################################### +!!**** *ARPEGE_STRETCH_A* - Projection to Arpege stretched grid +!! +!! PURPOSE +!! ------- +!! +!! Projection from standard Lat,Lon grid to Arpege stretched grid +!! +!! METHOD +!! ------ +!! +!! The projection is defined in two steps : +!! 1. A rotation to place the stretching pole at the north pole +!! 2. The stretching +!! This routine is a basic implementation of the informations founded in +!! 'Note de travail Arpege nr.3' +!! 'Transformation de coordonnees' +!! J.F.Geleyn 1988 +!! This document describes a slightly different transformation in 3 steps. Only the +!! two first steps are to be taken in account (at the time of writing this paper has +!! not been updated). +!! +!! EXTERNAL +!! -------- +!! +!! Module MODD_CST +!! XPI +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! REFERENCE +!! --------- +!! +!! This routine is based on : +!! 'Note de travail ARPEGE' number 3 +!! by J.F. GELEYN (may 1988) +!! +!! AUTHOR +!! ------ +!! +!! V.Bousquet +!! +!! MODIFICATIONS +!! ------------- +!! +!! Original 07/01/1999 +!! +!---------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! --------------- +! +USE MODD_CST +! +IMPLICIT NONE +! +!* 0.1. Declaration of arguments +! ----------------------------- +! +INTEGER, INTENT(IN) :: KN ! Number of points to convert +REAL, INTENT(IN) :: PLAP ! Latitude of stretching pole +REAL, INTENT(IN) :: PLOP ! Longitude of stretching pole +REAL, INTENT(IN) :: PCOEF ! Stretching coefficient +REAL, DIMENSION(KN), INTENT(IN) :: PLAR ! Lat. of points +REAL, DIMENSION(KN), INTENT(IN) :: PLOR ! Lon. of points +REAL, DIMENSION(KN), INTENT(OUT) :: PLAC ! Computed pseudo-lat. of points +REAL, DIMENSION(KN), INTENT(OUT) :: PLOC ! Computed pseudo-lon. of points +! +!* 0.2. Declaration of local variables +! ----------------------------------- +! +REAL :: ZSINSTRETCHLA ! Sine of stretching point lat. +REAL :: ZSINSTRETCHLO ! Sine of stretching point lon. +REAL :: ZCOSSTRETCHLA ! Cosine of stretching point lat. +REAL :: ZCOSSTRETCHLO ! Cosine of stretching point lon. +REAL :: ZSINLA ! Sine of computed point latitude +REAL :: ZSINLO ! Sine of computed point longitude +REAL :: ZCOSLA ! Cosine of computed point latitude +REAL :: ZCOSLO ! Cosine of computed point longitude +REAL :: ZSINLAS ! Sine of point's pseudo-latitude +REAL :: ZSINLOS ! Sine of point's pseudo-longitude +REAL :: ZCOSLOS ! Cosine of point's pseudo-lon. +REAL :: ZA,ZB,ZD ! Dummy variables used for +REAL :: ZX,ZY ! computations +! +INTEGER :: JLOOP1 ! Dummy loop counter +! +!---------------------------------------------------------------------------- +! +ZSINSTRETCHLA = SIN(PLAP*XPI/180.) +ZCOSSTRETCHLA = COS(PLAP*XPI/180.) +ZSINSTRETCHLO = SIN(PLOP*XPI/180.) +ZCOSSTRETCHLO = COS(PLOP*XPI/180.) +! L = longitude (0 = Greenwich, + toward east) +! l = latitude (90 = N.P., -90 = S.P.) +! p stands for stretching pole +PLAC(:) = PLAR(:) * XPI / 180. +PLOC(:) = PLOR(:) * XPI / 180. +! A = 1 + c.c +ZA = 1. + PCOEF*PCOEF +! B = 1 - c.c +ZB = 1. - PCOEF*PCOEF +DO JLOOP1=1, KN + ZSINLA = SIN(PLAC(JLOOP1)) + ZCOSLA = COS(PLAC(JLOOP1)) + ZSINLO = SIN(PLOC(JLOOP1)) + ZCOSLO = COS(PLOC(JLOOP1)) + ! X = cos(Lp-L) + ZX = ZCOSLO*ZCOSSTRETCHLO + ZSINLO*ZSINSTRETCHLO + ! Y = sin(Lp-L) + ZY = ZSINSTRETCHLO*ZCOSLO - ZSINLO*ZCOSSTRETCHLO + ! D = (1+c.c) + (1-c.c)(sin lp.sin l + cos lp.cos l.cos(Lp-L)) + ZD = ZA + ZB*(ZSINSTRETCHLA*ZSINLA+ZCOSSTRETCHLA*ZCOSLA*ZX) + ! (1-c.c)+(1+c.c)((sin lp.sin l + cos lp.cos l.cos(Lp-L)) + ! sin lr = ------------------------------------------------------- + ! D + ZSINLAS = (ZB + ZA*(ZSINSTRETCHLA*ZSINLA+ZCOSSTRETCHLA*ZCOSLA*ZX)) / ZD + ! D' = D * cos lr + ZD = ZD * (AMAX1(1e-6,SQRT(1.-ZSINLAS*ZSINLAS))) + ! 2.c.(cos lp.sin l - sin lp.cos l.cos(Lp-L)) + ! cos Lr = ------------------------------------------- + ! D' + ZCOSLOS = 2.*PCOEF*(ZCOSSTRETCHLA*ZSINLA-ZSINSTRETCHLA*ZCOSLA*ZX) / ZD + ! 2.c.cos l.cos(Lp-L) + ! sin Lr = ------------------- + ! D' + ZSINLOS = 2.*PCOEF*(ZCOSLA*ZY) / ZD + ! saturations (corrects calculation errors) + ZSINLAS = MAX(ZSINLAS,-1.) + ZSINLAS = MIN(ZSINLAS, 1.) + ZCOSLOS = MAX(ZCOSLOS,-1.) + ZCOSLOS = MIN(ZCOSLOS, 1.) + ! back from sine & cosine + PLAC(JLOOP1) = ASIN(ZSINLAS) + IF (ZSINLOS>0) THEN + PLOC(JLOOP1) = ACOS(ZCOSLOS) + ELSE + PLOC(JLOOP1) = -ACOS(ZCOSLOS) + ENDIF +ENDDO +PLOC(:) = PLOC(:) * 180. / XPI +PLAC(:) = PLAC(:) * 180. / XPI +RETURN +END SUBROUTINE ARPEGE_STRETCH_A +! +! +END SUBROUTINE READ_ALL_DATA_GRIB_CASE diff --git a/src/mesonh/ext/read_desfmn.f90 b/src/mesonh/ext/read_desfmn.f90 new file mode 100644 index 0000000000000000000000000000000000000000..b934de494a274525176ad6b72f7eb24eb02ddf65 --- /dev/null +++ b/src/mesonh/ext/read_desfmn.f90 @@ -0,0 +1,867 @@ +!MNH_LIC Copyright 1994-2021 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_READ_DESFM_n +! ###################### +! +INTERFACE +! + SUBROUTINE READ_DESFM_n(KMI,TPDATAFILE,HCONF,OFLAT,OUSERV, & + OUSERC,OUSERR,OUSERI,OUSECI,OUSERS,OUSERG,OUSERH, & + OUSECHEM,OUSECHAQ,OUSECHIC,OCH_PH,OCH_CONV_LINOX,OSALT, & + ODEPOS_SLT,ODUST,ODEPOS_DST, OCHTRANS, & + OORILAM,ODEPOS_AER,OLG,OPASPOL,OFIRE, & +#ifdef MNH_FOREFIRE + OFOREFIRE, & +#endif + OLNOX_EXPLICIT, & + OCONDSAMP,OBLOWSNOW, & + KRIMX,KRIMY,KSV_USER, & + HTURB,HTOM,ORMC01,HRAD,HDCONV,HSCONV,HCLOUD,HELEC,HEQNSYS ) +! +USE MODD_IO, ONLY: TFILEDATA +USE MODD_PARAMETERS +! +INTEGER, INTENT(IN) :: KMI ! Model index +TYPE(TFILEDATA), INTENT(IN) :: TPDATAFILE ! Datafile +CHARACTER (LEN=5), INTENT(OUT) :: HCONF ! configuration var. linked to FMfile +LOGICAL, INTENT(OUT) :: OFLAT ! Logical for zero orography +LOGICAL, INTENT(OUT) :: OUSERV ! use Rv mixing ratio +LOGICAL, INTENT(OUT) :: OUSERC ! use Rc mixing ratio +LOGICAL, INTENT(OUT) :: OUSERR ! use Rr mixing ratio +LOGICAL, INTENT(OUT) :: OUSERI ! use Ri mixing ratio +LOGICAL, INTENT(OUT) :: OUSECI ! use Ci concentration of Ice cristals +LOGICAL, INTENT(OUT) :: OUSERS ! use Rs mixing ratio +LOGICAL, INTENT(OUT) :: OUSERG ! use Rg mixing ratio +LOGICAL, INTENT(OUT) :: OUSERH ! use Rh mixing ratio +LOGICAL, INTENT(OUT) :: OUSECHEM ! Chemical flag +LOGICAL, INTENT(OUT) :: OUSECHAQ ! Aqueous Chemical flag +LOGICAL, INTENT(OUT) :: OUSECHIC ! Ice phase Chemical flag +LOGICAL, INTENT(OUT) :: OCH_PH ! pH flag +LOGICAL, INTENT(OUT) :: OCH_CONV_LINOX ! LiNOX flag +LOGICAL, INTENT(OUT) :: OLG ! lagrangian flag +LOGICAL, INTENT(OUT) :: OSALT ! Sea Salt flag +LOGICAL, INTENT(OUT) :: ODUST ! Dust flag +LOGICAL, INTENT(OUT) :: OPASPOL ! Passive pollutant flag +LOGICAL, INTENT(OUT) :: OFIRE ! Blaze flag +#ifdef MNH_FOREFIRE +LOGICAL, INTENT(OUT) :: OFOREFIRE! ForeFire flag +#endif +LOGICAL, INTENT(OUT) :: OLNOX_EXPLICIT ! explicit LNOx flag +LOGICAL, INTENT(OUT) :: OCONDSAMP! Conditional sampling flag +LOGICAL, INTENT(OUT) :: OBLOWSNOW ! Blowing snow flag +LOGICAL, INTENT(OUT) :: OORILAM ! Orilam flag +LOGICAL, INTENT(OUT) :: OCHTRANS ! Deep convection on scalar +LOGICAL,DIMENSION(JPMODELMAX),INTENT(OUT) :: ODEPOS_DST ! Dust Wet Deposition flag +LOGICAL,DIMENSION(JPMODELMAX),INTENT(OUT) :: ODEPOS_SLT ! Sea Salt Wet Deposition flag +LOGICAL,DIMENSION(JPMODELMAX),INTENT(OUT) :: ODEPOS_AER ! Aerosols Wet Deposition flag +INTEGER, INTENT(OUT) :: KRIMX, KRIMY ! number of points for the + ! horizontal relaxation for the outermost verticals +INTEGER, INTENT(OUT) :: KSV_USER ! number of additional scalar + ! variables in FMfile +CHARACTER (LEN=4), INTENT(OUT) :: HTURB ! Kind of turbulence parameterization + ! used to produce the FMfile +CHARACTER (LEN=4), INTENT(OUT) :: HTOM ! Kind of third order moment +LOGICAL, INTENT(OUT) :: ORMC01 ! flag for RMC01 SBL computations +CHARACTER (LEN=4), INTENT(OUT) :: HRAD ! Kind of radiation scheme +CHARACTER (LEN=4), INTENT(OUT) :: HDCONV ! Kind of deep convection scheme +CHARACTER (LEN=4), INTENT(OUT) :: HSCONV ! Kind of shallow convection scheme +CHARACTER (LEN=4), INTENT(OUT) :: HCLOUD ! Kind of microphysical scheme +CHARACTER (LEN=4), INTENT(OUT) :: HELEC ! Kind of electrical scheme +CHARACTER (LEN=*), INTENT(OUT) :: HEQNSYS! type of equations' system +END SUBROUTINE READ_DESFM_n +! +END INTERFACE +! +END MODULE MODI_READ_DESFM_n +! ######################################################################### + SUBROUTINE READ_DESFM_n(KMI,TPDATAFILE,HCONF,OFLAT,OUSERV, & + OUSERC,OUSERR,OUSERI,OUSECI,OUSERS,OUSERG,OUSERH, & + OUSECHEM,OUSECHAQ,OUSECHIC,OCH_PH,OCH_CONV_LINOX,OSALT, & + ODEPOS_SLT,ODUST,ODEPOS_DST, OCHTRANS, & + OORILAM,ODEPOS_AER,OLG,OPASPOL,OFIRE, & +#ifdef MNH_FOREFIRE + OFOREFIRE, & +#endif + OLNOX_EXPLICIT, & + OCONDSAMP,OBLOWSNOW, & + KRIMX,KRIMY,KSV_USER, & + HTURB,HTOM,ORMC01,HRAD,HDCONV,HSCONV,HCLOUD,HELEC,HEQNSYS ) +! ######################################################################### +! +!!**** *READ_DESFM_n * - routine to read the descriptor file DESFM +!! +!! PURPOSE +!! ------- +! The purpose of this routine is to read the descriptor file called +! DESFM. +! +!! +!!** METHOD +!! ------ +!! The descriptor file is read. Namelists (NAMXXXn) which contain +!! informations linked to one nested model are at the beginning of the file. +!! Namelists (NAMXXX) which contain variables common to all models +!! are at the end of the file. When the model index is different from 1, +!! the end of the file (namelists NAMXXX) is not read. +!! Some attributes of the FMfile are saved in order to check coherence +!! between initial file and the segment to perform (description given by +!! EXSEG file), i.e. : +!! - the configuration which has been used to produce the initial file +!! (CCONF) +!! - logical switch for flat configuration (zero orography) in initial file +!! (LFLAT) +!! - kind of moist variables in initial file (LUSERV,LUSERC,LUSERR, +!! LUSERI,LUSERS,LUSERG,LUSERH) +!! - number of additional scalar variables in initial file (NSV_USER) +!! - kind of turbulence parameterization used to produce the initial +!! file (CTURB) +!! - kind of mixing length used to produce the initial +!! file (CTURBLEN) +!! - time step of each model stored in PTSTEP_OLD, to correct the initial +!! field at t-dt in routine READ_FIELD in case of time step change +!! - type of equation system in order to verify that the anelastic is the +!! same for the initila file generation and the run +!! +!! +!! EXTERNAL +!! -------- +!! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODN_CONF : CCONF,LFLAT,CEQNSYS +!! +!! Module MODN_CONF1 : LUSERV,LUSERC,LUSERR,LUSERI,LUSECI, +!! LUSERS,LUSERG,LUSERH +!! +!! Module MODN_PARAM1 : CTURB,CRAD,CDCONV,CSCONV +!! +!! Module MODN_TURB$n : CTURBLEN +!! +!! Module MODN_DYN$n : NRIMX,NRIMY +!! +!! REFERENCE +!! --------- +!! Book2 of the documentation (routine READ_DESFM_n) +!! +!! +!! AUTHOR +!! ------ +!! V. Ducrocq * Meteo France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 07/06/94 +!! Modifications 17/10/94 (Stein) For LCORIO +!! Modifications 26/10/94 (Stein) remove NAM_GET from the Namelists +!! present in DESFM + change the namelist names +!! Modifications 09/01/95 (Stein) add the turbulence scheme +!! Modifications 09/01/95 (Stein) add the 1D switch +!! Modifications 13/02/95 (Stein) save HTURBLEN +!! Modifications 30/06/95 (Stein) add new namelists +!! Modifications 18/08/95 (Lafore) time step change +!! Modifications 15/09/95 (Pinty) add the radiations +!! Modifications 06/02/96 (J.Vila) add the new scalar advection scheme +!! Modifications 20/02/96 (Stein) add the LES namelist + cleaning +!! Modifications 25/04/96 (Suhre) add NAM_BLANK +!! Modifications 25/04/96 (Suhre) add NAM_FRC +!! Modifications 25/04/96 (Suhre) add NAM_CH_MNHCn and NAM_CH_SOLVER +!! Modifications 11/04/96 (Pinty) add the ice concentration +!! Modifications 11/01/97 (Pinty) add the deep convection +!! Modifications 22/07/96 (Lafore) gridnesting implementation +!! Modifications 22/06/97 (Stein ) save the equations' system+ cleaning +!! Modifications 09/07/97 (Masson) add NAM_PARAM_GROUND +!! Modifications 25/08/97 (Masson) add HGROUND +!! Modifications 25/10/97 (Stein ) new namelists +!! Modification 04/06/00 (Pinty) add C2R2 scheme +!! Modification 22/01/01 (Gazen) Add OUSECHEM and OLG +!! Modification 15/10/01 (Mallet) allow namelists in different orders +!! Modification 29/11/02 (Pinty) add C3R5, ICE2, ICE4, ELEC +!! Modification 01/2004 (Masson) removes surface (externalization) +!! Modification 01/2005 (Masson) removes 1D and 2D switches +!! Modification 03/2005 (Tulet) add dust, aerosols +!! Modification 03/2006 (O.Geoffroy) Add KHKO scheme +!! Modification 04/2010 (M. Leriche) Add aqueous + ice chemistry +!! Modification 07/2013 (Bosseur & Filippi) Adds Forefire +!! Modification 01/2015 (C. Barthe) Add explicit LNOx +!! Modification 2016 (B.VIE) LIMA +!! Modification 11/2016 (Ph. Wautelet) Allocate/initialise some output/backup structures +!! Modification 02/2018 (Q.Libois) ECRAD +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +!! Modification 07/2017 (V. Vionnet) Add blowing snow scheme +!! Modification 02/2021 (F.Auguste) add IBM +!! (T.Nagel) add turbulence recycling +!! (E.Jezequel) add stations read from CSV file +!! Modifications 12/2021 (A. Costes) add Blaze fire model +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +USE MODD_IO, ONLY: TFILEDATA +USE MODD_LUNIT_n, ONLY: TLUOUT +USE MODD_PARAMETERS +! +USE MODN_BACKUP +USE MODN_BUDGET +USE MODN_CONF +USE MODN_DYN +USE MODN_NESTING +USE MODN_OUTPUT +USE MODN_LES +USE MODN_CONF_n +USE MODN_DYN_n +USE MODN_ADV_n +USE MODN_PARAM_n +USE MODN_PARAM_RAD_n +USE MODN_PARAM_ECRAD_n +USE MODN_PARAM_KAFR_n +USE MODD_PARAM_MFSHALL_n, ONLY: PARAM_MFSHALLN_INIT +USE MODD_PARAM_ICE_n, ONLY : PARAM_ICEN_INIT +USE MODN_LUNIT_n +USE MODN_LBC_n +USE MODN_NUDGING_n +USE MODD_TURB_n, ONLY: TURBN_INIT, CTOM, LRMC01 +USE MODD_NEB_n, ONLY: NEBN_INIT +USE MODN_FRC +USE MODN_BLANK_n +USE MODN_CH_SOLVER_n +USE MODN_CH_MNHC_n +USE MODN_PARAM_C2R2, ONLY : HPARAM_CCN_C2R2=>HPARAM_CCN,HINI_CCN_C2R2=>HINI_CCN, & + HTYPE_CCN_C2R2=>HTYPE_CCN,LRAIN_C2R2=>LRAIN, & + LSEDC_C2R2=>LSEDC,LACTIT_C2R2=>LACTIT,XCHEN_C2R2=>XCHEN, & + XKHEN_C2R2=>XKHEN,XMUHEN_C2R2=>XMUHEN, & + XBETAHEN_C2R2=>XBETAHEN,XCONC_CCN_C2R2=>XCONC_CCN, & + XR_MEAN_CCN_C2R2=>XR_MEAN_CCN,XLOGSIG_CCN_C2R2=>XLOGSIG_CCN, & + XFSOLUB_CCN_C2R2=>XFSOLUB_CCN,XACTEMP_CCN_C2R2=>XACTEMP_CCN, & + XALPHAC_C2R2=>XALPHAC,XNUC_C2R2=>XNUC,XALPHAR_C2R2=>XALPHAR, & + XNUR_C2R2=>XNUR,XAERDIFF_C2R2=>XAERDIFF, & + XAERHEIGHT_C2R2=>XAERHEIGHT,NAM_PARAM_C2R2 +USE MODN_PARAM_C1R3, ONLY : XALPHAI_C1R3=>XALPHAI,XNUI_C1R3=>XNUI,XALPHAS_C1R3=>XALPHAS, & + XNUS_C1R3=>XNUS,XALPHAG_C1R3=>XALPHAG,XNUG_C1R3=>XNUG, & + XFACTNUC_DEP_C1R3=>XFACTNUC_DEP, & + XFACTNUC_CON_C1R3=>XFACTNUC_CON,LSEDI_C1R3=>LSEDI, & + LHHONI_C1R3=>LHHONI,CPRISTINE_ICE_C1R3,CHEVRIMED_ICE_C1R3, & + NAM_PARAM_C1R3 +USE MODN_ELEC +USE MODN_SERIES +USE MODN_SERIES_n +USE MODN_TURB_CLOUD +USE MODN_CH_ORILAM +USE MODN_DUST +USE MODN_SALT +USE MODN_PASPOL +USE MODN_VISCOSITY +USE MODN_DRAG_n +#ifdef MNH_FOREFIRE +USE MODN_FOREFIRE +#endif +USE MODN_CONDSAMP +USE MODN_LATZ_EDFLX +USE MODN_2D_FRC +USE MODN_BLOWSNOW_n +USE MODN_BLOWSNOW +USE MODN_STATION_n +! +USE MODN_PARAM_LIMA +! +USE MODE_MSG +USE MODE_POS +USE MODN_RECYCL_PARAM_n +USE MODN_IBM_PARAM_n +USE MODD_IBM_LSF, ONLY: LIBM_LSF +! +USE MODD_FIRE +USE MODN_FIRE +! +IMPLICIT NONE +! +!* 0.1 declarations of arguments +! +! +! +INTEGER, INTENT(IN) :: KMI ! Model index +TYPE(TFILEDATA), INTENT(IN) :: TPDATAFILE ! Datafile +CHARACTER (LEN=5), INTENT(OUT) :: HCONF ! configuration var. linked to FMfile +LOGICAL, INTENT(OUT) :: OFLAT ! Logical for zero orography +LOGICAL, INTENT(OUT) :: OUSERV ! use Rv mixing ratio +LOGICAL, INTENT(OUT) :: OUSERC ! use Rc mixing ratio +LOGICAL, INTENT(OUT) :: OUSERR ! use Rr mixing ratio +LOGICAL, INTENT(OUT) :: OUSERI ! use Ri mixing ratio +LOGICAL, INTENT(OUT) :: OUSECI ! use Ci concentration of Ice cristals +LOGICAL, INTENT(OUT) :: OUSERS ! use Rs mixing ratio +LOGICAL, INTENT(OUT) :: OUSERG ! use Rg mixing ratio +LOGICAL, INTENT(OUT) :: OUSERH ! use Rh mixing ratio +LOGICAL, INTENT(OUT) :: OUSECHEM ! Chemical flag +LOGICAL, INTENT(OUT) :: OUSECHAQ ! Aqueous Chemical flag +LOGICAL, INTENT(OUT) :: OUSECHIC ! Ice phase Chemical flag +LOGICAL, INTENT(OUT) :: OCH_PH ! pH flag +LOGICAL, INTENT(OUT) :: OCH_CONV_LINOX ! LiNOX flag +LOGICAL, INTENT(OUT) :: OLG ! lagrangian flag +INTEGER, INTENT(OUT) :: KRIMX, KRIMY ! number of points for the + ! horizontal relaxation for the outermost verticals +INTEGER, INTENT(OUT) :: KSV_USER ! number of additional scalar + ! variables in FMfile +CHARACTER (LEN=4), INTENT(OUT) :: HTURB ! Kind of turbulence parameterization + ! used to produce the FMfile +CHARACTER (LEN=4), INTENT(OUT) :: HTOM ! Kind of third order moment +LOGICAL, INTENT(OUT) :: ORMC01 ! flag for RMC01 SBL computations +CHARACTER (LEN=4), INTENT(OUT) :: HRAD ! Kind of radiation scheme +CHARACTER (LEN=4), INTENT(OUT) :: HDCONV ! Kind of deep convection scheme +CHARACTER (LEN=4), INTENT(OUT) :: HSCONV ! Kind of shallow convection scheme +CHARACTER (LEN=4), INTENT(OUT) :: HCLOUD ! Kind of microphysical scheme +CHARACTER (LEN=4), INTENT(OUT) :: HELEC ! Kind of electrical scheme +CHARACTER (LEN=*), INTENT(OUT) :: HEQNSYS! type of equations' system +LOGICAL, INTENT(OUT) :: OSALT ! Sea Salt flag +LOGICAL, INTENT(OUT) :: OPASPOL ! Passive pollutant flag +LOGICAL, INTENT(OUT) :: OFIRE ! Blaze flag +#ifdef MNH_FOREFIRE +LOGICAL, INTENT(OUT) :: OFOREFIRE ! ForeFire flag +#endif +LOGICAL, INTENT(OUT) :: OLNOX_EXPLICIT ! explicit LNOx flag +LOGICAL, INTENT(OUT) :: OCONDSAMP! Conditional sampling flag +LOGICAL, INTENT(OUT) :: OBLOWSNOW! Blowing snow flag +LOGICAL, INTENT(OUT) :: ODUST ! Dust flag +LOGICAL, INTENT(OUT) :: OORILAM ! Dust flag +LOGICAL, INTENT(OUT) :: OCHTRANS ! Deep convection on scalar + ! variables flag +LOGICAL,DIMENSION(JPMODELMAX),INTENT(OUT) :: ODEPOS_DST ! Dust Wet Deposition flag +LOGICAL,DIMENSION(JPMODELMAX),INTENT(OUT) :: ODEPOS_SLT ! Sea Salt Wet Deposition flag +LOGICAL,DIMENSION(JPMODELMAX),INTENT(OUT) :: ODEPOS_AER ! Aerosols Wet Deposition flag +! +!* 0.2 declarations of local variables +! +INTEGER :: ILUDES, & ! logical unit numbers of + ILUOUT ! DESFM file and output listing +LOGICAL :: GFOUND ! Return code when searching namelist +LOGICAL,DIMENSION(JPMODELMAX),SAVE :: LTEMPDEPOS_DST ! Dust Moist flag +LOGICAL,DIMENSION(JPMODELMAX),SAVE :: LTEMPDEPOS_SLT ! Sea Salt Moist flag +LOGICAL,DIMENSION(JPMODELMAX),SAVE :: LTEMPDEPOS_AER ! Orilam Moist flag +! +!------------------------------------------------------------------------------- +! +!* 1. READ DESFM FILE +! --------------- +! +CALL PRINT_MSG(NVERB_DEBUG,'IO','READ_DESFM_n','called for '//TRIM(TPDATAFILE%CNAME)) +! +IF (.NOT.ASSOCIATED(TPDATAFILE%TDESFILE)) & + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_DESFM_n','TDESFILE not associated for '//TRIM(TPDATAFILE%CNAME)) +! +ILUDES = TPDATAFILE%TDESFILE%NLU +ILUOUT = TLUOUT%NLU +! +CALL POSNAM(ILUDES,'NAM_LUNITN',GFOUND) +CALL INIT_NAM_LUNITN +IF (GFOUND) THEN + READ(UNIT=ILUDES,NML=NAM_LUNITn) + CALL UPDATE_NAM_LUNITN +END IF +CALL POSNAM(ILUDES,'NAM_CONFN',GFOUND) +CALL INIT_NAM_CONFN +IF (GFOUND) THEN + READ(UNIT=ILUDES,NML=NAM_CONFn) + CALL UPDATE_NAM_CONFN +END IF +CALL POSNAM(ILUDES,'NAM_DYNN',GFOUND) +CALL INIT_NAM_DYNN +IF (GFOUND) THEN + READ(UNIT=ILUDES,NML=NAM_DYNn) + CALL UPDATE_NAM_DYNN +END IF +CALL POSNAM(ILUDES,'NAM_ADVN',GFOUND) +CALL INIT_NAM_ADVN +IF (GFOUND) THEN + READ(UNIT=ILUDES,NML=NAM_ADVn) + CALL UPDATE_NAM_ADVN +END IF +CALL POSNAM(ILUDES,'NAM_PARAMN',GFOUND) +CALL INIT_NAM_PARAMn +IF (GFOUND) THEN + READ(UNIT=ILUDES,NML=NAM_PARAMn) + CALL UPDATE_NAM_PARAMn +END IF +CALL POSNAM(ILUDES,'NAM_PARAM_RADN',GFOUND) +CALL INIT_NAM_PARAM_RADn +IF (GFOUND) THEN + READ(UNIT=ILUDES,NML=NAM_PARAM_RADn) + CALL UPDATE_NAM_PARAM_RADn +END IF +#ifdef MNH_ECRAD +CALL POSNAM(ILUDES,'NAM_PARAM_ECRADN',GFOUND) +CALL INIT_NAM_PARAM_ECRADn +IF (GFOUND) THEN + READ(UNIT=ILUDES,NML=NAM_PARAM_ECRADn) + CALL UPDATE_NAM_PARAM_ECRADn +END IF +#endif +CALL POSNAM(ILUDES,'NAM_PARAM_KAFRN',GFOUND) +CALL INIT_NAM_PARAM_KAFRn +IF (GFOUND) THEN + READ(UNIT=ILUDES,NML=NAM_PARAM_KAFRn) + CALL UPDATE_NAM_PARAM_KAFRn +END IF +CALL PARAM_MFSHALLN_INIT(CPROGRAM, ILUDES, .FALSE., ILUOUT, .FALSE., .TRUE., .FALSE., 0) +CALL POSNAM(ILUDES,'NAM_LBCN',GFOUND) +CALL INIT_NAM_LBCn +IF (GFOUND) THEN + READ(UNIT=ILUDES,NML=NAM_LBCn) + CALL UPDATE_NAM_LBCn +END IF +CALL POSNAM(ILUDES,'NAM_NUDGINGN',GFOUND) +CALL INIT_NAM_NUDGINGn +IF (GFOUND) THEN + READ(UNIT=ILUDES,NML=NAM_NUDGINGn) + CALL UPDATE_NAM_NUDGINGn +END IF +CALL TURBN_INIT(CPROGRAM, ILUDES, .FALSE., ILUOUT, .FALSE., .TRUE., .FALSE., 0) +CALL NEBN_INIT(CPROGRAM, ILUDES, .FALSE., ILUOUT, .FALSE., .TRUE., .FALSE., 0) +CALL PARAM_ICEN_INIT(CPROGRAM, ILUDES, .FALSE., ILUOUT, .FALSE., .TRUE., .FALSE., 0) +CALL POSNAM(ILUDES,'NAM_CH_MNHCN',GFOUND) +CALL INIT_NAM_CH_MNHCn +IF (GFOUND) THEN + READ(UNIT=ILUDES,NML=NAM_CH_MNHCn) + CALL UPDATE_NAM_CH_MNHCn +END IF +CALL POSNAM(ILUDES,'NAM_CH_SOLVERn',GFOUND) +CALL INIT_NAM_CH_SOLVERn +IF (GFOUND) THEN + READ(UNIT=ILUDES,NML=NAM_CH_SOLVERn) + CALL UPDATE_NAM_CH_SOLVERn +END IF +CALL POSNAM(ILUDES,'NAM_DRAGN',GFOUND) +CALL INIT_NAM_DRAGn +IF (GFOUND) THEN + READ(UNIT=ILUDES,NML=NAM_DRAGn) + CALL UPDATE_NAM_DRAGn +END IF +CALL POSNAM(ILUDES,'NAM_IBM_PARAMN',GFOUND,ILUOUT) +CALL INIT_NAM_IBM_PARAMn +IF (GFOUND) THEN + READ(UNIT=ILUDES,NML=NAM_IBM_PARAMn) + CALL UPDATE_NAM_IBM_PARAMn +END IF +CALL POSNAM(ILUDES,'NAM_RECYCL_PARAMN',GFOUND,ILUOUT) +CALL INIT_NAM_RECYCL_PARAMn +IF (GFOUND) THEN + READ(UNIT=ILUDES,NML=NAM_RECYCL_PARAMn) + CALL UPDATE_NAM_RECYCL_PARAMn +END IF +CALL POSNAM(ILUDES,'NAM_SERIESN',GFOUND,ILUOUT) +CALL INIT_NAM_SERIESn +IF (GFOUND) THEN + READ(UNIT=ILUDES,NML=NAM_SERIESn) + CALL UPDATE_NAM_SERIESn +END IF +CALL POSNAM(ILUDES,'NAM_BLOWSNOWn',GFOUND,ILUOUT) +CALL INIT_NAM_BLOWSNOWn +IF (GFOUND) THEN + READ(UNIT=ILUDES,NML=NAM_BLOWSNOWn) + CALL UPDATE_NAM_BLOWSNOWn +END IF +CALL POSNAM(ILUDES,'NAM_BLANKN',GFOUND,ILUOUT) +CALL INIT_NAM_BLANKn +IF (GFOUND) THEN + READ(UNIT=ILUDES,NML=NAM_BLANKn) + CALL UPDATE_NAM_BLANKn +END IF +CALL POSNAM(ILUDES,'NAM_STATIONN',GFOUND,ILUOUT) +CALL INIT_NAM_STATIONn +IF (GFOUND) THEN + READ(UNIT=ILUDES,NML=NAM_STATIONn) + CALL UPDATE_NAM_STATIONn +END IF +! +! +IF (KMI == 1) THEN + CALL POSNAM(ILUDES,'NAM_CONF',GFOUND) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_CONF) + CALL POSNAM(ILUDES,'NAM_DYN',GFOUND) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_DYN) + CALL POSNAM(ILUDES,'NAM_NESTING',GFOUND) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_NESTING) + CALL POSNAM(ILUDES,'NAM_BACKUP',GFOUND) + IF (GFOUND) THEN + IF (.NOT.ALLOCATED(XBAK_TIME)) THEN + ALLOCATE(XBAK_TIME(NMODEL,JPOUTMAX)) + XBAK_TIME(:,:) = XNEGUNDEF + END IF + IF (.NOT.ALLOCATED(XOUT_TIME)) THEN + ALLOCATE(XOUT_TIME(NMODEL,JPOUTMAX)) !Allocate *OUT* variables to prevent + XOUT_TIME(:,:) = XNEGUNDEF + END IF + IF (.NOT.ALLOCATED(NBAK_STEP)) THEN + ALLOCATE(NBAK_STEP(NMODEL,JPOUTMAX)) + NBAK_STEP(:,:) = NNEGUNDEF + END IF + IF (.NOT.ALLOCATED(NOUT_STEP)) THEN + ALLOCATE(NOUT_STEP(NMODEL,JPOUTMAX)) !problems if NAM_OUTPUT does not exist + NOUT_STEP(:,:) = NNEGUNDEF + END IF + IF (.NOT.ALLOCATED(COUT_VAR)) THEN + ALLOCATE(COUT_VAR (NMODEL,JPOUTVARMAX)) + COUT_VAR(:,:) = '' + END IF + READ(UNIT=ILUDES,NML=NAM_BACKUP) + ELSE + CALL POSNAM(ILUDES,'NAM_FMOUT',GFOUND) + IF (GFOUND) CALL PRINT_MSG(NVERB_FATAL,'IO','READ_DESFM_n','use namelist NAM_BACKUP instead of namelist NAM_FMOUT') + END IF + CALL POSNAM(ILUDES,'NAM_OUTPUT',GFOUND) + IF (GFOUND) THEN + IF (.NOT.ALLOCATED(XBAK_TIME)) THEN + ALLOCATE(XBAK_TIME(NMODEL,JPOUTMAX)) !Allocate *BAK* variables to prevent + XBAK_TIME(:,:) = XNEGUNDEF + END IF + IF (.NOT.ALLOCATED(XOUT_TIME)) THEN + ALLOCATE(XOUT_TIME(NMODEL,JPOUTMAX)) + XOUT_TIME(:,:) = XNEGUNDEF + END IF + IF (.NOT.ALLOCATED(NBAK_STEP)) THEN + ALLOCATE(NBAK_STEP(NMODEL,JPOUTMAX)) !problems if NAM_BACKUP does not exist + NBAK_STEP(:,:) = NNEGUNDEF + END IF + IF (.NOT.ALLOCATED(NOUT_STEP)) THEN + ALLOCATE(NOUT_STEP(NMODEL,JPOUTMAX)) + NOUT_STEP(:,:) = NNEGUNDEF + END IF + IF (.NOT.ALLOCATED(COUT_VAR)) THEN + ALLOCATE(COUT_VAR (NMODEL,JPOUTVARMAX)) + COUT_VAR(:,:) = '' + END IF + READ(UNIT=ILUDES,NML=NAM_OUTPUT) + END IF +! Note: it is not useful to read the budget namelists in the .des files +! The value here (if present in file) don't need to be compared with the ones in the EXSEGn files +! CALL POSNAM(ILUDES,'NAM_BUDGET',GFOUND) +! IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_BUDGET) +! CALL POSNAM(ILUDES,'NAM_BU_RU',GFOUND) +! IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_BU_RU) +! CALL POSNAM(ILUDES,'NAM_BU_RV',GFOUND) +! IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_BU_RV) +! CALL POSNAM(ILUDES,'NAM_BU_RW',GFOUND) +! IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_BU_RW) +! CALL POSNAM(ILUDES,'NAM_BU_RTH',GFOUND) +! IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_BU_RTH) +! CALL POSNAM(ILUDES,'NAM_BU_RTKE',GFOUND) +! IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_BU_RTKE) +! CALL POSNAM(ILUDES,'NAM_BU_RRV',GFOUND) +! IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_BU_RRV) +! CALL POSNAM(ILUDES,'NAM_BU_RRC',GFOUND) +! IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_BU_RRC) +! CALL POSNAM(ILUDES,'NAM_BU_RRR',GFOUND) +! IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_BU_RRR) +! CALL POSNAM(ILUDES,'NAM_BU_RRI',GFOUND) +! IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_BU_RRI) +! CALL POSNAM(ILUDES,'NAM_BU_RRS',GFOUND) +! IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_BU_RRS) +! CALL POSNAM(ILUDES,'NAM_BU_RRG',GFOUND) +! IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_BU_RRG) +! CALL POSNAM(ILUDES,'NAM_BU_RRH',GFOUND) +! IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_BU_RRH) +! CALL POSNAM(ILUDES,'NAM_BU_RSV',GFOUND) +! IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_BU_RSV) + CALL POSNAM(ILUDES,'NAM_LES',GFOUND) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_LES) + CALL POSNAM(ILUDES,'NAM_PDF',GFOUND) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_PDF) + CALL POSNAM(ILUDES,'NAM_FRC',GFOUND) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_FRC) + CALL POSNAM(ILUDES,'NAM_PARAM_C2R2',GFOUND) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_PARAM_C2R2) + CALL POSNAM(ILUDES,'NAM_PARAM_C1R3',GFOUND) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_PARAM_C1R3) + CALL POSNAM(ILUDES,'NAM_PARAM_LIMA',GFOUND) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_PARAM_LIMA) + CALL POSNAM(ILUDES,'NAM_ELEC',GFOUND) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_ELEC) + CALL POSNAM(ILUDES,'NAM_SERIES',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_SERIES) + CALL POSNAM(ILUDES,'NAM_TURB_CLOUD',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_TURB_CLOUD) + CALL POSNAM(ILUDES,'NAM_CH_ORILAM',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_CH_ORILAM) + CALL POSNAM(ILUDES,'NAM_DUST',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_DUST) + CALL POSNAM(ILUDES,'NAM_SALT',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_SALT) + CALL POSNAM(ILUDES,'NAM_PASPOL',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_PASPOL) +#ifdef MNH_FOREFIRE + CALL POSNAM(ILUDES,'NAM_FOREFIRE',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_FOREFIRE) +#endif + CALL POSNAM(ILUDES,'NAM_FIRE',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_FIRE) + CALL POSNAM(ILUDES,'NAM_CONDSAMP',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_CONDSAMP) + CALL POSNAM(ILUDES,'NAM_BLOWSNOW',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_BLOWSNOW) + CALL POSNAM(ILUDES,'NAM_2D_FRC',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_2D_FRC) + LTEMPDEPOS_DST(:) = LDEPOS_DST(:) + LTEMPDEPOS_SLT(:) = LDEPOS_SLT(:) + LTEMPDEPOS_AER(:) = LDEPOS_AER(:) + CALL POSNAM(ILUDES,'NAM_LATZ_EDFLX',GFOUND) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_LATZ_EDFLX) + CALL POSNAM(ILUDES,'NAM_VISC',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_VISC) +END IF +! +!------------------------------------------------------------------------------- +! +!* 2. SAVE SOME FMFILE ATTRIBUTES +! --------------------------- +HCONF = CCONF +OFLAT = LFLAT +OUSERV = LUSERV +OUSERC = LUSERC +OUSERR = LUSERR +OUSERI = LUSERI +OUSECI = LUSECI +OUSERS = LUSERS +OUSERG = LUSERG +OUSERH = LUSERH +OUSECHEM = LUSECHEM +OUSECHAQ = LUSECHAQ +OUSECHIC = LUSECHIC +OCH_PH = LCH_PH +OCH_CONV_LINOX = LCH_CONV_LINOX +ODUST = LDUST +ODEPOS_DST(KMI) = LTEMPDEPOS_DST(KMI) +ODEPOS_SLT(KMI) = LTEMPDEPOS_SLT(KMI) +ODEPOS_AER(KMI) = LTEMPDEPOS_AER(KMI) +OCHTRANS = LCHTRANS +OSALT = LSALT +OORILAM = LORILAM +OLG = LLG +OPASPOL = LPASPOL +OFIRE = LBLAZE +#ifdef MNH_FOREFIRE +OFOREFIRE = LFOREFIRE +#endif +OLNOX_EXPLICIT = LLNOX_EXPLICIT +OCONDSAMP= LCONDSAMP +OBLOWSNOW= LBLOWSNOW +! Initially atmosphere free of blowing snow particles +IF(KMI>1) OBLOWSNOW=.FALSE. +KRIMX = NRIMX +KRIMY = NRIMY +KSV_USER = NSV_USER +HTURB = CTURB +HTOM = CTOM +ORMC01 = LRMC01 +HRAD = CRAD +HDCONV = CDCONV +HSCONV = CSCONV +HCLOUD = CCLOUD +HELEC = CELEC +HEQNSYS = CEQNSYS +! +!------------------------------------------------------------------------------- +! +!* 3. WRITE DESFM ON OUTPUT LISTING +! ------------------------------ +! +IF (NVERB >= 10) THEN + WRITE(UNIT=ILUOUT,FMT="(/,'DESCRIPTOR OF INITIAL FILE FOR MODEL ',I2)") KMI + WRITE(UNIT=ILUOUT,FMT="( '------------------------------------ ' )") +! + WRITE(UNIT=ILUOUT,FMT="('********** LOGICAL UNITSn **********')") + WRITE(UNIT=ILUOUT,NML=NAM_LUNITn) +! + WRITE(UNIT=ILUOUT,FMT="('********** CONFIGURATIONn **********')") + WRITE(UNIT=ILUOUT,NML=NAM_CONFn) +! + WRITE(UNIT=ILUOUT,FMT="('********** DYNAMICn ****************')") + WRITE(UNIT=ILUOUT,NML=NAM_DYNn) +! + WRITE(UNIT=ILUOUT,FMT="('********** ADVECTIONn **************')") + WRITE(UNIT=ILUOUT,NML=NAM_ADVn) +! + WRITE(UNIT=ILUOUT,FMT="('********** PARAMETERIZATIONSn ******')") + WRITE(UNIT=ILUOUT,NML=NAM_PARAMn) +! + WRITE(UNIT=ILUOUT,FMT="('********** RADIATIONSn *************')") + WRITE(UNIT=ILUOUT,NML=NAM_PARAM_RADn) +! +#ifdef MNH_ECRAD + WRITE(UNIT=ILUOUT,FMT="('********** ECRAD RADIATIONSn *************')") + WRITE(UNIT=ILUOUT,NML=NAM_PARAM_ECRADn) +#endif +! + WRITE(UNIT=ILUOUT,FMT="('********** DEEP CONVECTIONn ********')") + WRITE(UNIT=ILUOUT,NML=NAM_PARAM_KAFRn) +! + WRITE(UNIT=ILUOUT,FMT="('*** MASS FLUX SHALLOW CONVECTION ***')") + CALL PARAM_MFSHALLN_INIT(CPROGRAM, 0, .FALSE., ILUOUT, .FALSE., .FALSE., .FALSE., 2) +! + WRITE(UNIT=ILUOUT,FMT="('********** LBCn ********************')") + WRITE(UNIT=ILUOUT,NML=NAM_LBCn) +! + WRITE(UNIT=ILUOUT,FMT="('********** TURBn *******************')") + CALL TURBN_INIT(CPROGRAM, 0, .FALSE., ILUOUT, .FALSE., .FALSE., .FALSE., 2) +! + WRITE(UNIT=ILUOUT,FMT="('********** NEBn *******************')") + CALL NEBN_INIT(CPROGRAM, 0, .FALSE., ILUOUT, .FALSE., .FALSE., .FALSE., 2) +! + WRITE(UNIT=ILUOUT,FMT="('********** DRAGn *******************')") + WRITE(UNIT=ILUOUT,NML=NAM_DRAGn) +! + WRITE(UNIT=ILUOUT,FMT="('********** IBM FORCING *************')") + WRITE(UNIT=ILUOUT,NML=NAM_IBM_PARAMn) +! + WRITE(UNIT=ILUOUT,FMT="('********** RECYLING *************')") + WRITE(UNIT=ILUOUT,NML=NAM_RECYCL_PARAMn) +! + WRITE(UNIT=ILUOUT,FMT="('********** NUDGINGn ****************')") + WRITE(UNIT=ILUOUT,NML=NAM_NUDGINGn) +! + WRITE(UNIT=ILUOUT,FMT="('********** CHEMICAL MONITORn *******')") + WRITE(UNIT=ILUOUT,NML=NAM_CH_MNHCn) +! + WRITE(UNIT=ILUOUT,FMT="('********** CHEMICAL SOLVER *********')") + WRITE(UNIT=ILUOUT,NML=NAM_CH_SOLVERn) +! + WRITE(UNIT=ILUOUT,FMT="('********** BLOWSNOWn ***************')") + WRITE(UNIT=ILUOUT,NML=NAM_BLOWSNOWn) +! + WRITE(UNIT=ILUOUT,FMT="('********** BLANKn ******************')") + WRITE(UNIT=ILUOUT,NML=NAM_BLANKn) +! + WRITE(UNIT=ILUOUT,FMT="('********** STATIONn ******************')") + WRITE(UNIT=ILUOUT,NML=NAM_STATIONn) +! + WRITE(UNIT=ILUOUT,FMT="('************ ICE SCHEME ***********************')") + CALL PARAM_ICEN_INIT(CPROGRAM, 0, .FALSE., ILUOUT, .FALSE., .FALSE., .FALSE., 2) +! + IF (KMI==1) THEN + WRITE(UNIT=ILUOUT,FMT="(/,'PART OF INITIAL FILE COMMON TO ALL THE MODELS')") + WRITE(UNIT=ILUOUT,FMT="( '---------------------------------------------')") +! + WRITE(UNIT=ILUOUT,FMT="('************ CONFIGURATION ********************')") + WRITE(UNIT=ILUOUT,NML=NAM_CONF) +! + WRITE(UNIT=ILUOUT,FMT="('************ DYNAMIC **************************')") + WRITE(UNIT=ILUOUT,NML=NAM_DYN) +! +! Budget namelists not read anymore in READ_DESFM_n +! WRITE(UNIT=ILUOUT,FMT="('************ BUDGET ***************************')") +! WRITE(UNIT=ILUOUT,NML=NAM_BUDGET) +! ! +! WRITE(UNIT=ILUOUT,FMT="('************ U BUDGET *************************')") +! WRITE(UNIT=ILUOUT,NML=NAM_BU_RU) +! ! +! WRITE(UNIT=ILUOUT,FMT="('************ V BUDGET *************************')") +! WRITE(UNIT=ILUOUT,NML=NAM_BU_RV) +! ! +! WRITE(UNIT=ILUOUT,FMT="('************ W BUDGET *************************')") +! WRITE(UNIT=ILUOUT,NML=NAM_BU_RW) +! ! +! WRITE(UNIT=ILUOUT,FMT="('************ TH BUDGET ************************')") +! WRITE(UNIT=ILUOUT,NML=NAM_BU_RTH) +! ! +! WRITE(UNIT=ILUOUT,FMT="('************ TKE BUDGET ***********************')") +! WRITE(UNIT=ILUOUT,NML=NAM_BU_RTKE) +! ! +! WRITE(UNIT=ILUOUT,FMT="('************ RV BUDGET ************************')") +! WRITE(UNIT=ILUOUT,NML=NAM_BU_RRV) +! ! +! WRITE(UNIT=ILUOUT,FMT="('************ RC BUDGET ************************')") +! WRITE(UNIT=ILUOUT,NML=NAM_BU_RRC) +! ! +! WRITE(UNIT=ILUOUT,FMT="('************ RR BUDGET ************************')") +! WRITE(UNIT=ILUOUT,NML=NAM_BU_RRR) +! ! +! WRITE(UNIT=ILUOUT,FMT="('************ RI BUDGET ************************')") +! WRITE(UNIT=ILUOUT,NML=NAM_BU_RRI) +! ! +! WRITE(UNIT=ILUOUT,FMT="('************ RS BUDGET ************************')") +! WRITE(UNIT=ILUOUT,NML=NAM_BU_RRS) +! ! +! WRITE(UNIT=ILUOUT,FMT="('************ RG BUDGET ************************')") +! WRITE(UNIT=ILUOUT,NML=NAM_BU_RRG) +! ! +! WRITE(UNIT=ILUOUT,FMT="('************ RH BUDGET ************************')") +! WRITE(UNIT=ILUOUT,NML=NAM_BU_RRH) +! ! +! WRITE(UNIT=ILUOUT,FMT="('************ SVx BUDGET ***********************')") +! WRITE(UNIT=ILUOUT,NML=NAM_BU_RSV) +! + WRITE(UNIT=ILUOUT,FMT="('************ LES ******************************')") + WRITE(UNIT=ILUOUT,NML=NAM_LES) +! + WRITE(UNIT=ILUOUT,FMT="('************ PDF ******************************')") + WRITE(UNIT=ILUOUT,NML=NAM_PDF) +! + WRITE(UNIT=ILUOUT,FMT="('************ FORCING **************************')") + WRITE(UNIT=ILUOUT,NML=NAM_FRC) +! + WRITE(UNIT=ILUOUT,FMT="('************ ORILAM SCHEME ********************')") + WRITE(UNIT=ILUOUT,NML=NAM_CH_ORILAM) +! + WRITE(UNIT=ILUOUT,FMT="('************ SALT SCHEME **********************')") + WRITE(UNIT=ILUOUT,NML=NAM_SALT) +! + WRITE(UNIT=ILUOUT,FMT="('************ DUST SCHEME **********************')") + WRITE(UNIT=ILUOUT,NML=NAM_DUST) +! + WRITE(UNIT=ILUOUT,FMT="('************ PASSIVE POLLUTANT ***************')") + WRITE(UNIT=ILUOUT,NML=NAM_PASPOL) +! + WRITE(UNIT=ILUOUT,FMT="('************ VISCOSITY ***************')") + WRITE(UNIT=ILUOUT,NML=NAM_VISC) +! +#ifdef MNH_FOREFIRE + WRITE(UNIT=ILUOUT,FMT="('************ FOREFIRE ***************')") + WRITE(UNIT=ILUOUT,NML=NAM_FOREFIRE) +! +#endif +! +IF (LBLAZE) THEN + WRITE(UNIT=ILUOUT,FMT="('******************** BLAZE ********************')") + WRITE(UNIT=ILUOUT,NML=NAM_FIRE) +END IF +! + WRITE(UNIT=ILUOUT,FMT="('************ CONDITIONAL SAMPLING *************')") + WRITE(UNIT=ILUOUT,NML=NAM_CONDSAMP) + ! + WRITE(UNIT=ILUOUT,FMT="('********** BLOWING SNOW SCHEME******************')") + WRITE(UNIT=ILUOUT,NML=NAM_BLOWSNOW) +! + IF( CCLOUD == 'C2R2' ) THEN + WRITE(UNIT=ILUOUT,FMT="('************ C2R2 SCHEME **********************')") + WRITE(UNIT=ILUOUT,NML=NAM_PARAM_C2R2) + END IF +! + IF( CCLOUD == 'KHKO' ) THEN !modif + WRITE(UNIT=ILUOUT,FMT="('************ KHKO SCHEME **********************')") + WRITE(UNIT=ILUOUT,NML=NAM_PARAM_C2R2) + END IF +! + IF( CCLOUD == 'C3R5' ) THEN + WRITE(UNIT=ILUOUT,FMT="('************ C3R5 SCHEME **********************')") + WRITE(UNIT=ILUOUT,NML=NAM_PARAM_C2R2) + WRITE(UNIT=ILUOUT,NML=NAM_PARAM_C1R3) + END IF +! + IF( CCLOUD == 'LIMA' ) THEN + WRITE(UNIT=ILUOUT,FMT="('************ LIMA SCHEME **********************')") + WRITE(UNIT=ILUOUT,NML=NAM_PARAM_LIMA) + END IF +! + IF (CELEC /= 'NONE') THEN + WRITE(UNIT=ILUOUT,FMT="('************ ELEC SCHEME **********************')") + WRITE(UNIT=ILUOUT,NML=NAM_ELEC) + END IF +! + END IF +! +END IF +! +!------------------------------------------------------------------------------- +! +END SUBROUTINE READ_DESFM_n diff --git a/src/mesonh/ext/read_exsegn.f90 b/src/mesonh/ext/read_exsegn.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ec6816d3573b308fd1d0bcce8e72747b7f914a15 --- /dev/null +++ b/src/mesonh/ext/read_exsegn.f90 @@ -0,0 +1,3053 @@ +!MNH_LIC Copyright 1994-2021 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_READ_EXSEG_n +! ###################### +! +INTERFACE +! + SUBROUTINE READ_EXSEG_n(KMI,TPEXSEGFILE,HCONF,OFLAT,OUSERV, & + OUSERC,OUSERR,OUSERI,OUSECI,OUSERS,OUSERG,OUSERH, & + OUSECHEM,OUSECHAQ,OUSECHIC,OCH_PH,OCH_CONV_LINOX,OSALT, & + ODEPOS_SLT, ODUST,ODEPOS_DST, OCHTRANS, & + OORILAM,ODEPOS_AER, OLG,OPASPOL, OFIRE, & +#ifdef MNH_FOREFIRE + OFOREFIRE, & +#endif + OLNOX_EXPLICIT, & + OCONDSAMP,OBLOWSNOW, & + KRIMX,KRIMY, KSV_USER, & + HTURB,HTOM,ORMC01,HRAD,HDCONV,HSCONV,HCLOUD,HELEC, & + HEQNSYS,PTSTEP_ALL,HSTORAGE_TYPE,HINIFILEPGD ) +! +USE MODD_IO, ONLY: TFILEDATA +! +INTEGER, INTENT(IN) :: KMI ! Model index +TYPE(TFILEDATA), INTENT(IN) :: TPEXSEGFILE ! EXSEG file +! The following variables are read by READ_DESFM in DESFM descriptor : +CHARACTER (LEN=*), INTENT(IN) :: HCONF ! configuration var. linked to FMfile +LOGICAL, INTENT(IN) :: OFLAT ! Logical for zero orography +LOGICAL, INTENT(IN) :: OUSERV,OUSERC,OUSERR,OUSERI,OUSERS, & + OUSERG,OUSERH ! kind of moist variables in + ! FMfile +LOGICAL, INTENT(IN) :: OUSECI ! ice concentration in + ! FMfile +LOGICAL, INTENT(IN) :: OUSECHEM ! Chemical FLAG in FMFILE +LOGICAL, INTENT(IN) :: OUSECHAQ ! Aqueous chemical FLAG in FMFILE +LOGICAL, INTENT(IN) :: OUSECHIC ! Ice chemical FLAG in FMFILE +LOGICAL, INTENT(IN) :: OCH_PH ! pH FLAG in FMFILE +LOGICAL, INTENT(IN) :: OCH_CONV_LINOX ! LiNOx FLAG in FMFILE +LOGICAL, INTENT(IN) :: ODUST ! Dust FLAG in FMFILE +LOGICAL,DIMENSION(:), INTENT(IN) :: ODEPOS_DST ! Dust wet deposition FLAG in FMFILE +LOGICAL,DIMENSION(:), INTENT(IN) :: ODEPOS_SLT ! Sea Salt wet deposition FLAG in FMFILE +LOGICAL,DIMENSION(:), INTENT(IN) :: ODEPOS_AER ! Orilam wet deposition FLAG in FMFILE +LOGICAL, INTENT(IN) :: OSALT ! Sea Salt FLAG in FMFILE +LOGICAL, INTENT(IN) :: OORILAM ! Orilam FLAG in FMFILE +LOGICAL, INTENT(IN) :: OPASPOL ! Passive pollutant FLAG in FMFILE +LOGICAL, INTENT(IN) :: OFIRE ! Blaze FLAG in FMFILE +#ifdef MNH_FOREFIRE +LOGICAL, INTENT(IN) :: OFOREFIRE ! ForeFire FLAG in FMFILE +#endif +LOGICAL, INTENT(IN) :: OLNOX_EXPLICIT ! explicit LNOx FLAG in FMFILE +LOGICAL, INTENT(IN) :: OCONDSAMP ! Conditional sampling FLAG in FMFILE +LOGICAL, INTENT(IN) :: OBLOWSNOW ! Blowing snow FLAG in FMFILE +LOGICAL, INTENT(IN) :: OCHTRANS ! LCHTRANS FLAG in FMFILE + +LOGICAL, INTENT(IN) :: OLG ! lagrangian FLAG in FMFILE +INTEGER, INTENT(IN) :: KRIMX, KRIMY ! number of points for the + ! horizontal relaxation for the outermost verticals +INTEGER, INTENT(IN) :: KSV_USER ! number of additional scalar + ! variables in FMfile +CHARACTER (LEN=*), INTENT(IN) :: HTURB ! Kind of turbulence parameterization + ! used to produce FMFILE +CHARACTER (LEN=*), INTENT(IN) :: HTOM ! Kind of third order moment +LOGICAL, INTENT(IN) :: ORMC01 ! flag for RMC01 SBL computations +CHARACTER (LEN=*), INTENT(IN) :: HRAD ! Kind of radiation scheme +CHARACTER (LEN=4), INTENT(IN) :: HDCONV ! Kind of deep convection scheme +CHARACTER (LEN=4), INTENT(IN) :: HSCONV ! Kind of shallow convection scheme +CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! Kind of microphysical scheme +CHARACTER (LEN=4), INTENT(IN) :: HELEC ! Kind of electrical scheme +CHARACTER (LEN=*), INTENT(IN) :: HEQNSYS! type of equations' system +REAL,DIMENSION(:), INTENT(INOUT):: PTSTEP_ALL ! Time STEP of ALL models +CHARACTER (LEN=*), INTENT(IN) :: HSTORAGE_TYPE ! type of initial file +CHARACTER (LEN=*), INTENT(IN) :: HINIFILEPGD ! name of PGD file +! +END SUBROUTINE READ_EXSEG_n +! +END INTERFACE +! +END MODULE MODI_READ_EXSEG_n +! +! +! ######################################################################### + SUBROUTINE READ_EXSEG_n(KMI,TPEXSEGFILE,HCONF,OFLAT,OUSERV, & + OUSERC,OUSERR,OUSERI,OUSECI,OUSERS,OUSERG,OUSERH, & + OUSECHEM,OUSECHAQ,OUSECHIC,OCH_PH,OCH_CONV_LINOX,OSALT, & + ODEPOS_SLT, ODUST,ODEPOS_DST, OCHTRANS, & + OORILAM,ODEPOS_AER, OLG,OPASPOL, OFIRE, & +#ifdef MNH_FOREFIRE + OFOREFIRE, & +#endif + OLNOX_EXPLICIT, & + OCONDSAMP, OBLOWSNOW, & + KRIMX,KRIMY, KSV_USER, & + HTURB,HTOM,ORMC01,HRAD,HDCONV,HSCONV,HCLOUD,HELEC, & + HEQNSYS,PTSTEP_ALL,HSTORAGE_TYPE,HINIFILEPGD ) +! ######################################################################### +! +!!**** *READ_EXSEG_n * - routine to read the descriptor file EXSEG +!! +!! PURPOSE +!! ------- +! The purpose of this routine is to read the descriptor file called +! EXSEG and to control the coherence with FMfile data . +! +!! +!!** METHOD +!! ------ +!! The descriptor file is read. Namelists (NAMXXXn) which contain +!! variables linked to one nested model are at the beginning of the file. +!! Namelists (NAMXXX) which contain variables common to all models +!! are at the end of the file. When the model index is different from 1, +!! the end of the file (namelists NAMXXX) is not read. +!! +!! Coherence between the initial file (description read in DESFM file) +!! and the segment to perform (description read in EXSEG file) +!! is checked for segment achievement configurations +!! or postprocessing configuration. The get indicators are set according +!! to the following check : +!! +!! - segment achievement and preinit configurations : +!! +!! * if there is no turbulence kinetic energy in initial +!! file (HTURB='NONE'), and the segment to perform requires a turbulence +!! parameterization (CTURB /= 'NONE'), the get indicators for turbulence +!! kinetic energy variables are set to 'INIT'; i.e. these variables will be +!! set equal to zero by READ_FIELD according to the get indicators. +!! * The same procedure is applied to the dissipation of TKE. +!! * if there is no moist variables RRn in initial file (OUSERn=.FALSE.) +!! and the segment to perform requires moist variables RRn +!! (LUSERn=.TRUE.), the get indicators for moist variables RRn are set +!! equal to 'INIT'; i.e. these variables will be set equal to zero by +!! READ_FIELD according to the get indicators. +!! * if there are KSV_USER additional scalar variables in initial file and the +!! segment to perform needs more than KSV_USER additional variables, the get +!! indicators for these (NSV_USER-KSV_USER) additional scalar variables are set +!! equal to 'INIT'; i.e. these variables will be set equal to zero by +!! READ_FIELD according to the get indicators. If the segment to perform +!! needs less additional scalar variables than there are in initial file, +!! the get indicators for these (KSV_USER - NSV_USER) additional scalar variables are +!! set equal to 'SKIP'. +!! * warning messages are printed if the fields in initial file are the +!! same at time t and t-dt (HCONF='START') and a leap-frog advance +!! at first time step will be used for the segment to perform +!! (CCONF='RESTA'); It is likewise when HCONF='RESTA' and CCONF='START'. +!! * A warning message is printed if the orography in initial file is zero +!! (OFLAT=.TRUE.) and the segment to perform considers no-zero orography +!! (LFLAT=.FALSE.). It is likewise for LFLAT=.TRUE. and OFLAT=.FALSE.. +!! If the segment to perform requires zero orography (LFLAT=.TRUE.), the +!! orography (XZS) will not read in initial file but set equal to zero +!! by SET_GRID. +!! * check of the depths of the Lateral Damping Layer in x and y +!! direction is performed +!! * If some coupling files are specified, LSTEADYLS is set to T +!! * If no coupling files are specified, LSTEADYLS is set to F +!! +!! +!! EXTERNAL +!! -------- +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODN_CONF : CCONF,LTHINSHELL,LFLAT,NMODEL,NVERB +!! +!! Module MODN_DYN : LCORIO, LZDIFFU +!! +!! Module MODN_NESTING : NDAD(m),NDTRATIO(m),XWAY(m) +!! +!! Module MODN_BUDGET : CBUTYPE,XBULEN +!! +!! Module MODN_CONF1 : LUSERV,LUSERC,LUSERR,LUSERI,LUSERS,LUSERG,LUSERH,CSEG +!! +!! Module MODN_DYN1 : XTSTEP,CPRESOPT,NITR,XRELAX +!! +!! Module MODD_ADV1 : CMET_ADV_SCHEME,CSV_ADV_SCHEME,CUVW_ADV_SCHEME,NLITER +!! +!! Module MODN_PARAM1 : CTURB,CRAD,CDCONV,CSCONV +!! +!! Module MODN_LUNIT1 : +!! Module MODN_LBC1 : CLBCX,CLBCY,NLBLX,NLBLY,XCPHASE,XPOND +!! +!! Module MODN_TURB_n : CTURBLEN,CTURBDIM +!! +!! Module MODD_GET1: +!! CGETTKEM,CGETTKET, +!! CGETRVM,CGETRCM,CGETRRM,CGETRIM,CGETRSM,CGETRGM,CGETRHM +!! CGETRVT,CGETRCT,CGETRRT,CGETRIT,CGETRST,CGETRGT,CGETRHT,CGETSVM +!! CGETSVT,CGETSIGS,CGETSRCM,CGETSRCT +!! NCPL_NBR,NCPL_TIMES,NCPL_CUR +!! Module MODN_LES : contains declaration of the control parameters +!! for Large Eddy Simulations' storages +!! for the forcing +!! +!! REFERENCE +!! --------- +!! Book2 of the documentation (routine READ_EXSEG_n) +!! +!! +!! AUTHOR +!! ------ +!! V. Ducrocq * Meteo France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 07/06/94 +!! Modification 26/10/94 (Stein) remove NAM_GET from the Namelists +!! present in DESFM + change the namelist names +!! Modification 22/11/94 (Stein) add GET indicator for phi +!! Modification 21/12/94 (Stein) add GET indicator for LS fields +!! Modification 06/01/95 (Stein) bug in the test for Scalar Var. +!! Modifications 09/01/95 (Stein) add the turbulence scheme +!! Modifications 09/01/95 (Stein) add the 1D switch +!! Modifications 10/03/95 (Mallet) add coherence in coupling case +!! Modifications 16/03/95 (Stein) remove R from the historical variables +!! Modifications 01/03/95 (Hereil) add the budget namelists +!! Modifications 16/06/95 (Stein) coherence control for the +!! microphysical scheme + remove the wrong messge for RESTA conf +!! Modifications 30/06/95 (Stein) conditionnal reading of the fields +!! used by the moist turbulence scheme +!! Modifications 12/09/95 (Pinty) add the radiation scheme +!! Modification 06/02/96 (J.Vila) implement scalar advection schemes +!! Modifications 24/02/96 (Stein) change the default value for CCPLFILE +!! Modifications 02/05/96 (Stein Jabouille) change the Z0SEA activation +!! Modifications 24/05/96 (Stein) change the SRC SIGS control +!! Modifications 08/09/96 (Masson) the coupling file names are reset to +!! default value " " before reading in EXSEG1.nam +!! to avoid extra non-existant coupling files +!! +!! Modifications 25/04/95 (K.Suhre)add namelist NAM_BLANK +!! add read for LFORCING +!! 25/04/95 (K.Suhre)add namelist NAM_FRC +!! and switch checking +!! 06/08/96 (K.Suhre)add namelist NAM_CH_MNHCn +!! and NAM_CH_SOLVER +!! Modifications 10/10/96 (Stein) change SRC into SRCM and SRCT +!! Modifications 11/04/96 (Pinty) add the rain-ice microphysical scheme +!! Modifications 11/01/97 (Pinty) add the deep convection scheme +!! Modifications 22/05/97 (Lafore) gridnesting implementation +!! Modifications 22/06/97 (Stein) add the absolute pressure + cleaning +!! Modifications 25/08/97 (Masson) add tests on surface schemes +!! 22/10/97 (Stein) remove the RIMX /= 0 control +!! + new namelist + cleaning +!! Modifications 17/04/98 (Masson) add tests on character variables +!! Modification 15/03/99 (Masson) add tests on PROGRAM +!! Modification 04/01/00 (Masson) removes TSZ0 case +!! Modification 04/06/00 (Pinty) add C2R2 scheme +!! 11/12/00 (Tomasini) add CSEA_FLUX to MODD_PARAMn +!! delete the test on SST_FRC only in 1D +!! Modification 22/01/01 (Gazen) change NSV,KSV to NSV_USER,KSV_USER and add +!! NSV_* variables initialization +!! Modification 15/10/01 (Mallet) allow namelists in different orders +!! Modification 18/03/02 (Solmon) new radiation scheme test +!! Modification 29/11/02 (JP Pinty) add C3R5, ICE2, ICE4, ELEC +!! Modification 06/11/02 (Masson) new LES BL height diagnostic +!! Modification 06/11/02 (Jabouille) remove LTHINSHELL LFORCING test +!! Modification 01/12/03 (Gazen) change Chemical scheme interface +!! Modification 01/2004 (Masson) removes surface (externalization) +!! Modification 01/2005 (Masson) removes 1D and 2D switches +!! Modification 04/2005 (Tulet) add dust, orilam +!! Modification 03/2006 (O.Geoffroy) Add KHKO scheme +!! Modification 04/2006 (Maric) include 4th order advection scheme +!! Modification 05/2006 (Masson) add nudging +!! Modification 05/2006 Remove KEPS +!! Modification 04/2006 (Maric) include PPM advection scheme +!! Modification 04/2006 (J.Escobar) Bug dollarn add CALL UPDATE_NAM_CONFN +!! Modifications 01/2007 (Malardel,Pergaud) add the MF shallow +!! convection scheme MODN_PARAM_MFSHALL_n +!! Modification 09/2009 (J.Escobar) add more info on relaxation problems +!! Modification 09/2011 (J.Escobar) re-add 'ZRESI' choose +!! Modification 12/2011 (C.Lac) Adaptation to FIT temporal scheme +!! Modification 12/2012 (S.Bielli) add NAM_NCOUT for netcdf output (removed 08/07/2016) +!! Modification 02/2012 (Pialat/Tulet) add ForeFire +!! Modification 02/2012 (T.Lunet) add of new Runge-Kutta methods +!! Modification 01/2015 (C. Barthe) add explicit LNOx +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! M.Leriche 18/12/2015 : bug chimie glace dans prep_real_case +!! Modification 01/2016 (JP Pinty) Add LIMA +!! Modification 02/2016 (M.Leriche) treat gas and aq. chemicals separately +!! P.Wautelet 08/07/2016 : removed MNH_NCWRIT define +!! Modification 10/2016 (C.LAC) Add OSPLIT_WENO + Add droplet +!! deposition + Add max values +!! Modification 11/2016 (Ph. Wautelet) Allocate/initialise some output/backup structures +!! Modification 03/2017 (JP Chaboureau) Fix the initialization of +!! LUSERx-type variables for LIMA +!! M.Leriche 06/2017 for spawn and prep_real avoid abort if wet dep for +!! aerosol and no cloud scheme defined +!! Q.Libois 02/2018 ECRAD +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +!! Modification 07/2017 (V. Vionnet) add blowing snow scheme +!! Modification 01/2019 (Q. Rodier) define XCEDIS depending on BL89 or RM17 mixing length +!! Modification 01/2019 (P. Wautelet) bugs correction: incorrect writes +!! Modification 01/2019 (R. Honnert) remove SURF in CMF_UPDRAFT +!! Bielli S. 02/2019 Sea salt : significant sea wave height influences salt emission; 5 salt modes +! P. Wautelet 10/04/2019: replace ABORT and STOP calls by Print_msg +! C. Lac 11/2019: correction in the drag formula and application to building in addition to tree +! Q. Rodier 03/2020: add abort if use of any LHORELAX and cyclic conditions +! F.Auguste 02/2021: add IBM +! T.Nagel 02/2021: add turbulence recycling +! E.Jezequel 02/2021: add stations read from CSV file +! P. Wautelet 09/03/2021: simplify allocation of scalar variable names +! P. Wautelet 09/03/2021: move some chemistry initializations to ini_nsv +! P. Wautelet 10/03/2021: move scalar variable name initializations to ini_nsv +! R. Honnert 23/04/2021: add ADAP mixing length and delete HRIO and BOUT from CMF_UPDRAFT +! S. Riette 11/05/2021 HighLow cloud +! A. Costes 12/2021: add Blaze fire model +!------------------------------------------------------------------------------ +! +!* 0. DECLARATIONS +! ------------ +USE MODD_BLOWSNOW +USE MODD_BUDGET +USE MODD_CH_AEROSOL +USE MODD_CH_M9_n, ONLY : NEQ +USE MODD_CONDSAMP +USE MODD_CONF +USE MODD_CONF_n, ONLY: CSTORAGE_TYPE +USE MODD_CONFZ +! USE MODD_DRAG_n +USE MODD_DUST +USE MODD_DYN +USE MODD_DYN_n, ONLY : LHORELAX_SVLIMA, LHORELAX_SVFIRE +#ifdef MNH_FOREFIRE +USE MODD_FOREFIRE +#endif +USE MODD_GET_n +USE MODD_GR_FIELD_n +USE MODD_IO, ONLY: TFILEDATA +USE MODD_LUNIT_n, ONLY: TLUOUT +USE MODD_NSV,NSV_USER_n=>NSV_USER +USE MODD_PARAMETERS +USE MODD_PASPOL +USE MODD_SALT +USE MODD_VAR_ll, ONLY: NPROC +USE MODD_VISCOSITY + +USE MODE_MSG +USE MODE_POS + +USE MODI_INI_NSV +USE MODI_TEST_NAM_VAR + +USE MODN_2D_FRC +USE MODN_ADV_n ! The final filling of these modules for the model n is +USE MODN_BACKUP +USE MODN_BLANK_n +USE MODN_BLOWSNOW +USE MODN_BLOWSNOW_n +USE MODN_BUDGET +USE MODN_CH_MNHC_n +USE MODN_CH_ORILAM +USE MODN_CH_SOLVER_n +USE MODN_CONDSAMP +USE MODN_CONF +USE MODN_CONF_n +USE MODN_CONFZ +USE MODN_DRAGBLDG_n +USE MODN_DRAG_n +USE MODN_DRAGTREE_n +USE MODN_DUST +USE MODN_DYN +USE MODN_DYN_n ! to avoid the duplication of this routine for each model. +USE MODN_ELEC +USE MODN_EOL +USE MODN_EOL_ADNR +USE MODN_EOL_ALM +#ifdef MNH_FOREFIRE +USE MODN_FOREFIRE +#endif +USE MODN_FRC +USE MODN_IBM_PARAM_n +USE MODN_LATZ_EDFLX +USE MODN_LBC_n ! routine is used for each nested model. This has been done +USE MODN_LES +USE MODN_LUNIT_n +USE MODN_MEAN +USE MODN_NESTING +USE MODN_NUDGING_n +USE MODN_OUTPUT +USE MODN_PARAM_C1R3, ONLY : NAM_PARAM_C1R3, CPRISTINE_ICE_C1R3, & + CHEVRIMED_ICE_C1R3 +USE MODN_PARAM_C2R2, ONLY : EPARAM_CCN=>HPARAM_CCN, EINI_CCN=>HINI_CCN, & + WNUC=>XNUC, WALPHAC=>XALPHAC, NAM_PARAM_C2R2 +USE MODN_PARAM_ECRAD_n +USE MODD_PARAM_ICE_n, ONLY : PARAM_ICEN_INIT, PARAM_ICEN, CSUBG_AUCV_RC, CSUBG_AUCV_RI +USE MODN_PARAM_KAFR_n +USE MODN_PARAM_LIMA, ONLY : FINI_CCN=>HINI_CCN,NAM_PARAM_LIMA,NMOD_CCN,LSCAV, & + CPRISTINE_ICE_LIMA, CHEVRIMED_ICE_LIMA, NMOD_IFN, NMOD_IMM, & + LCOLD, LACTI, LNUCL, XALPHAC, XNUC, LMEYERS, LHAIL,& + LPTSPLIT, LSPRO, LADJ, LKHKO, LRAIN, LSNOW, FWARM=>LWARM,& + NMOM_C, NMOM_R, NMOM_I, NMOM_S, NMOM_G, NMOM_H +USE MODD_PARAM_MFSHALL_n, ONLY: PARAM_MFSHALLN_INIT +USE MODN_PARAM_n ! realized in subroutine ini_model n +USE MODN_PARAM_RAD_n +USE MODN_PASPOL +USE MODN_RECYCL_PARAM_n +USE MODN_SALT +USE MODN_SERIES +USE MODN_SERIES_n +USE MODN_STATION_n +USE MODD_TURB_n, ONLY: TURBN_INIT, CTOM, CTURBDIM, LRMC01, LHARAT +USE MODD_NEB_n, ONLY: NEBN_INIT, LSIGMAS, LSUBG_COND, CCONDENS, LSTATNW +USE MODN_TURB_CLOUD +USE MODN_VISCOSITY +USE MODD_FIRE +USE MODN_FIRE +! +IMPLICIT NONE +! +!* 0.1 declarations of arguments +! +! +! +INTEGER, INTENT(IN) :: KMI ! Model index +TYPE(TFILEDATA), INTENT(IN) :: TPEXSEGFILE ! EXSEG file +! The following variables are read by READ_DESFM in DESFM descriptor : +CHARACTER (LEN=*), INTENT(IN) :: HCONF ! configuration var. linked to FMfile +LOGICAL, INTENT(IN) :: OFLAT ! Logical for zero orography +LOGICAL, INTENT(IN) :: OUSERV,OUSERC,OUSERR,OUSERI,OUSERS, & + OUSERG,OUSERH ! kind of moist variables in + ! FMfile +LOGICAL, INTENT(IN) :: OUSECI ! ice concentration in + ! FMfile +LOGICAL, INTENT(IN) :: OUSECHEM ! Chemical FLAG in FMFILE +LOGICAL, INTENT(IN) :: OUSECHAQ ! Aqueous chemical FLAG in FMFILE +LOGICAL, INTENT(IN) :: OUSECHIC ! Ice chemical FLAG in FMFILE +LOGICAL, INTENT(IN) :: OCH_PH ! pH FLAG in FMFILE +LOGICAL, INTENT(IN) :: OCH_CONV_LINOX ! LiNOx FLAG in FMFILE +LOGICAL, INTENT(IN) :: ODUST ! Dust FLAG in FMFILE +LOGICAL,DIMENSION(:), INTENT(IN) :: ODEPOS_DST ! Dust Deposition FLAG in FMFILE +LOGICAL,DIMENSION(:), INTENT(IN) :: ODEPOS_SLT ! Sea Salt wet deposition FLAG in FMFILE +LOGICAL,DIMENSION(:), INTENT(IN) :: ODEPOS_AER ! Orilam wet deposition FLAG in FMFILE +LOGICAL, INTENT(IN) :: OSALT ! Sea Salt FLAG in FMFILE +LOGICAL, INTENT(IN) :: OORILAM ! Orilam FLAG in FMFILE +LOGICAL, INTENT(IN) :: OPASPOL ! Passive pollutant FLAG in FMFILE +LOGICAL, INTENT(IN) :: OFIRE ! Blaze FLAG in FMFILE +#ifdef MNH_FOREFIRE +LOGICAL, INTENT(IN) :: OFOREFIRE ! ForeFire FLAG in FMFILE +#endif +LOGICAL, INTENT(IN) :: OLNOX_EXPLICIT ! explicit LNOx FLAG in FMFILE +LOGICAL, INTENT(IN) :: OCONDSAMP ! Conditional sampling FLAG in FMFILE +LOGICAL, INTENT(IN) :: OCHTRANS ! LCHTRANS FLAG in FMFILE +LOGICAL, INTENT(IN) :: OBLOWSNOW ! Blowing snow FLAG in FMFILE + +LOGICAL, INTENT(IN) :: OLG ! lagrangian FLAG in FMFILE +INTEGER, INTENT(IN) :: KRIMX, KRIMY ! number of points for the + ! horizontal relaxation for the outermost verticals +INTEGER, INTENT(IN) :: KSV_USER ! number of additional scalar + ! variables in FMfile +CHARACTER (LEN=*), INTENT(IN) :: HTURB ! Kind of turbulence parameterization + ! used to produce FMFILE +CHARACTER (LEN=*), INTENT(IN) :: HTOM ! Kind of third order moment +LOGICAL, INTENT(IN) :: ORMC01 ! flag for RMC01 SBL computations +CHARACTER (LEN=*), INTENT(IN) :: HRAD ! Kind of radiation scheme +CHARACTER (LEN=4), INTENT(IN) :: HDCONV ! Kind of deep convection scheme +CHARACTER (LEN=4), INTENT(IN) :: HSCONV ! Kind of shallow convection scheme +CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! Kind of microphysical scheme +CHARACTER (LEN=4), INTENT(IN) :: HELEC ! Kind of electrical scheme +CHARACTER (LEN=*), INTENT(IN) :: HEQNSYS! type of equations' system +REAL,DIMENSION(:), INTENT(INOUT):: PTSTEP_ALL ! Time STEP of ALL models +CHARACTER (LEN=*), INTENT(IN) :: HSTORAGE_TYPE ! type of initial file +CHARACTER (LEN=*), INTENT(IN) :: HINIFILEPGD ! name of PGD file +! +!* 0.2 declarations of local variables +! +INTEGER :: ILUSEG,ILUOUT ! logical unit numbers of EXSEG file and outputlisting +INTEGER :: JS,JCI,JI,JSV ! Loop indexes +LOGICAL :: GRELAX +LOGICAL :: GFOUND ! Return code when searching namelist +! +!------------------------------------------------------------------------------- +! +!* 1. READ EXSEG FILE +! --------------- +! +CALL PRINT_MSG(NVERB_DEBUG,'IO','READ_EXSEG_n','called for '//TRIM(TPEXSEGFILE%CNAME)) +! +ILUSEG = TPEXSEGFILE%NLU +ILUOUT = TLUOUT%NLU +! +CALL INIT_NAM_LUNITN +CCPLFILE(:)=" " +CALL INIT_NAM_CONFN +CALL INIT_NAM_DYNN +CALL INIT_NAM_ADVN +CALL INIT_NAM_DRAGTREEN +CALL INIT_NAM_DRAGBLDGN +CALL INIT_NAM_PARAMN +CALL INIT_NAM_PARAM_RADN +#ifdef MNH_ECRAD +CALL INIT_NAM_PARAM_ECRADN +#endif +CALL INIT_NAM_PARAM_KAFRN +CALL INIT_NAM_LBCN +CALL INIT_NAM_NUDGINGN +CALL INIT_NAM_BLANKN +CALL INIT_NAM_DRAGN +CALL INIT_NAM_IBM_PARAMN +CALL INIT_NAM_RECYCL_PARAMN +CALL INIT_NAM_CH_MNHCN +CALL INIT_NAM_CH_SOLVERN +CALL INIT_NAM_SERIESN +CALL INIT_NAM_BLOWSNOWN +CALL INIT_NAM_STATIONn +! +WRITE(UNIT=ILUOUT,FMT="(/,'READING THE EXSEG.NAM FILE')") +CALL POSNAM(ILUSEG,'NAM_LUNITN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_LUNITn) +CALL POSNAM(ILUSEG,'NAM_CONFN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_CONFn) +CALL POSNAM(ILUSEG,'NAM_DYNN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_DYNn) +CALL POSNAM(ILUSEG,'NAM_ADVN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_ADVn) +CALL POSNAM(ILUSEG,'NAM_PARAMN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_PARAMn) +CALL POSNAM(ILUSEG,'NAM_PARAM_RADN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_PARAM_RADn) +#ifdef MNH_ECRAD +CALL POSNAM(ILUSEG,'NAM_PARAM_ECRADN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_PARAM_ECRADn) +#endif +CALL POSNAM(ILUSEG,'NAM_PARAM_KAFRN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_PARAM_KAFRn) +CALL PARAM_MFSHALLN_INIT(CPROGRAM, ILUSEG, .FALSE., ILUOUT, .FALSE., .TRUE., .FALSE., 0) +CALL POSNAM(ILUSEG,'NAM_LBCN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_LBCn) +CALL POSNAM(ILUSEG,'NAM_NUDGINGN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_NUDGINGn) +CALL TURBN_INIT(CPROGRAM, ILUSEG, .FALSE., ILUOUT, .FALSE., .TRUE., .FALSE., 0) +CALL NEBN_INIT(CPROGRAM, ILUSEG, .FALSE., ILUOUT, .FALSE., .TRUE., .FALSE., 0) +CALL PARAM_ICEN_INIT(CPROGRAM, ILUSEG, .FALSE., ILUOUT, .FALSE., .TRUE., .FALSE., 0) +CALL POSNAM(ILUSEG,'NAM_DRAGN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_DRAGn) +CALL POSNAM(ILUSEG,'NAM_IBM_PARAMN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_IBM_PARAMn) +CALL POSNAM(ILUSEG,'NAM_RECYCL_PARAMN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_RECYCL_PARAMn) +CALL POSNAM(ILUSEG,'NAM_CH_MNHCN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_CH_MNHCn) +CALL POSNAM(ILUSEG,'NAM_CH_SOLVERN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_CH_SOLVERn) +CALL POSNAM(ILUSEG,'NAM_SERIESN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_SERIESn) +CALL POSNAM(ILUSEG,'NAM_BLANKN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_BLANKn) +CALL POSNAM(ILUSEG,'NAM_BLOWSNOWN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_BLOWSNOWn) +CALL POSNAM(ILUSEG,'NAM_DRAGTREEN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_DRAGTREEn) +CALL POSNAM(ILUSEG,'NAM_DRAGBLDGN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_DRAGBLDGn) +CALL POSNAM(ILUSEG,'NAM_EOL',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_EOL) +CALL POSNAM(ILUSEG,'NAM_EOL_ADNR',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_EOL_ADNR) +CALL POSNAM(ILUSEG,'NAM_EOL_ALM',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_EOL_ALM) +CALL POSNAM(ILUSEG,'NAM_STATIONN',GFOUND,ILUOUT) +IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_STATIONn) +! +IF (KMI == 1) THEN + WRITE(UNIT=ILUOUT,FMT="(' namelists common to all the models ')") + CALL POSNAM(ILUSEG,'NAM_CONF',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_CONF) + CALL POSNAM(ILUSEG,'NAM_CONFZ',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_CONFZ) + CALL POSNAM(ILUSEG,'NAM_DYN',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_DYN) + CALL POSNAM(ILUSEG,'NAM_NESTING',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_NESTING) + CALL POSNAM(ILUSEG,'NAM_BACKUP',GFOUND,ILUOUT) + IF (GFOUND) THEN + !Should have been allocated before in READ_DESFM_n + IF (.NOT.ALLOCATED(XBAK_TIME)) THEN + ALLOCATE(XBAK_TIME(NMODEL,JPOUTMAX)) + XBAK_TIME(:,:) = XNEGUNDEF + END IF + IF (.NOT.ALLOCATED(XOUT_TIME)) THEN + ALLOCATE(XOUT_TIME(NMODEL,JPOUTMAX)) !Allocate *OUT* variables to prevent + XOUT_TIME(:,:) = XNEGUNDEF + END IF + IF (.NOT.ALLOCATED(NBAK_STEP)) THEN + ALLOCATE(NBAK_STEP(NMODEL,JPOUTMAX)) + NBAK_STEP(:,:) = NNEGUNDEF + END IF + IF (.NOT.ALLOCATED(NOUT_STEP)) THEN + ALLOCATE(NOUT_STEP(NMODEL,JPOUTMAX)) !problems if NAM_OUTPUT does not exist + NOUT_STEP(:,:) = NNEGUNDEF + END IF + IF (.NOT.ALLOCATED(COUT_VAR)) THEN + ALLOCATE(COUT_VAR (NMODEL,JPOUTVARMAX)) + COUT_VAR(:,:) = '' + END IF + READ(UNIT=ILUSEG,NML=NAM_BACKUP) + ELSE + CALL POSNAM(ILUSEG,'NAM_FMOUT',GFOUND) + IF (GFOUND) THEN + CALL PRINT_MSG(NVERB_FATAL,'IO','READ_EXSEG_n','use namelist NAM_BACKUP instead of namelist NAM_FMOUT') + ELSE + IF (CPROGRAM=='MESONH') CALL PRINT_MSG(NVERB_ERROR,'IO','READ_EXSEG_n','namelist NAM_BACKUP not found') + END IF + END IF + CALL POSNAM(ILUSEG,'NAM_OUTPUT',GFOUND,ILUOUT) + IF (GFOUND) THEN + !Should have been allocated before in READ_DESFM_n + IF (.NOT.ALLOCATED(XBAK_TIME)) THEN + ALLOCATE(XBAK_TIME(NMODEL,JPOUTMAX)) !Allocate *BAK* variables to prevent + XBAK_TIME(:,:) = XNEGUNDEF + END IF + IF (.NOT.ALLOCATED(XOUT_TIME)) THEN + ALLOCATE(XOUT_TIME(NMODEL,JPOUTMAX)) + XOUT_TIME(:,:) = XNEGUNDEF + END IF + IF (.NOT.ALLOCATED(NBAK_STEP)) THEN + ALLOCATE(NBAK_STEP(NMODEL,JPOUTMAX)) !problems if NAM_BACKUP does not exist + NBAK_STEP(:,:) = NNEGUNDEF + END IF + IF (.NOT.ALLOCATED(NOUT_STEP)) THEN + ALLOCATE(NOUT_STEP(NMODEL,JPOUTMAX)) + NOUT_STEP(:,:) = NNEGUNDEF + END IF + IF (.NOT.ALLOCATED(COUT_VAR)) THEN + ALLOCATE(COUT_VAR (NMODEL,JPOUTVARMAX)) + COUT_VAR(:,:) = '' + END IF + READ(UNIT=ILUSEG,NML=NAM_OUTPUT) + END IF + CALL POSNAM(ILUSEG,'NAM_BUDGET',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_BUDGET) + + CALL POSNAM(ILUSEG,'NAM_BU_RU',GFOUND,ILUOUT) + IF (GFOUND) THEN + IF ( ALLOCATED( CBULIST_RU ) ) THEN + CALL Print_msg( NVERB_WARNING, 'IO', 'READ_EXSEG_n', 'unexpected: CBULIST_RU was already allocated' ) + DEALLOCATE( CBULIST_RU ) + END IF + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RU(NBULISTMAXLINES) ) + CBULIST_RU(:) = '' + READ(UNIT=ILUSEG,NML=NAM_BU_RU) + ELSE + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RU(0) ) + END IF + + CALL POSNAM(ILUSEG,'NAM_BU_RV',GFOUND,ILUOUT) + IF (GFOUND) THEN + IF ( ALLOCATED( CBULIST_RV ) ) THEN + CALL Print_msg( NVERB_WARNING, 'IO', 'READ_EXSEG_n', 'unexpected: CBULIST_RV was already allocated' ) + DEALLOCATE( CBULIST_RV ) + END IF + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RV(NBULISTMAXLINES) ) + CBULIST_RV(:) = '' + READ(UNIT=ILUSEG,NML=NAM_BU_RV) + ELSE + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RV(0) ) + END IF + + CALL POSNAM(ILUSEG,'NAM_BU_RW',GFOUND,ILUOUT) + IF (GFOUND) THEN + IF ( ALLOCATED( CBULIST_RW ) ) THEN + CALL Print_msg( NVERB_WARNING, 'IO', 'READ_EXSEG_n', 'unexpected: CBULIST_RW was already allocated' ) + DEALLOCATE( CBULIST_RW ) + END IF + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RW(NBULISTMAXLINES) ) + CBULIST_RW(:) = '' + READ(UNIT=ILUSEG,NML=NAM_BU_RW) + ELSE + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RW(0) ) + END IF + + CALL POSNAM(ILUSEG,'NAM_BU_RTH',GFOUND,ILUOUT) + IF (GFOUND) THEN + IF ( ALLOCATED( CBULIST_RTH ) ) THEN + CALL Print_msg( NVERB_WARNING, 'IO', 'READ_EXSEG_n', 'unexpected: CBULIST_RTH was already allocated' ) + DEALLOCATE( CBULIST_RTH ) + END IF + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RTH(NBULISTMAXLINES) ) + CBULIST_RTH(:) = '' + READ(UNIT=ILUSEG,NML=NAM_BU_RTH) + ELSE + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RTH(0) ) + END IF + + CALL POSNAM(ILUSEG,'NAM_BU_RTKE',GFOUND,ILUOUT) + IF (GFOUND) THEN + IF ( ALLOCATED( CBULIST_RTKE ) ) THEN + CALL Print_msg( NVERB_WARNING, 'IO', 'READ_EXSEG_n', 'unexpected: CBULIST_RTKE was already allocated' ) + DEALLOCATE( CBULIST_RTKE ) + END IF + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RTKE(NBULISTMAXLINES) ) + CBULIST_RTKE(:) = '' + READ(UNIT=ILUSEG,NML=NAM_BU_RTKE) + ELSE + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RTKE(0) ) + END IF + + CALL POSNAM(ILUSEG,'NAM_BU_RRV',GFOUND,ILUOUT) + IF (GFOUND) THEN + IF ( ALLOCATED( CBULIST_RRV ) ) THEN + CALL Print_msg( NVERB_WARNING, 'IO', 'READ_EXSEG_n', 'unexpected: CBULIST_RRV was already allocated' ) + DEALLOCATE( CBULIST_RRV ) + END IF + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRV(NBULISTMAXLINES) ) + CBULIST_RRV(:) = '' + READ(UNIT=ILUSEG,NML=NAM_BU_RRV) + ELSE + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRV(0) ) + END IF + + CALL POSNAM(ILUSEG,'NAM_BU_RRC',GFOUND,ILUOUT) + IF (GFOUND) THEN + IF ( ALLOCATED( CBULIST_RRC ) ) THEN + CALL Print_msg( NVERB_WARNING, 'IO', 'READ_EXSEG_n', 'unexpected: CBULIST_RRC was already allocated' ) + DEALLOCATE( CBULIST_RRC ) + END IF + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRC(NBULISTMAXLINES) ) + CBULIST_RRC(:) = '' + READ(UNIT=ILUSEG,NML=NAM_BU_RRC) + ELSE + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRC(0) ) + END IF + + CALL POSNAM(ILUSEG,'NAM_BU_RRR',GFOUND,ILUOUT) + IF (GFOUND) THEN + IF ( ALLOCATED( CBULIST_RRR ) ) THEN + CALL Print_msg( NVERB_WARNING, 'IO', 'READ_EXSEG_n', 'unexpected: CBULIST_RRR was already allocated' ) + DEALLOCATE( CBULIST_RRR ) + END IF + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRR(NBULISTMAXLINES) ) + CBULIST_RRR(:) = '' + READ(UNIT=ILUSEG,NML=NAM_BU_RRR) + ELSE + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRR(0) ) + END IF + + CALL POSNAM(ILUSEG,'NAM_BU_RRI',GFOUND,ILUOUT) + IF (GFOUND) THEN + IF ( ALLOCATED( CBULIST_RRI ) ) THEN + CALL Print_msg( NVERB_WARNING, 'IO', 'READ_EXSEG_n', 'unexpected: CBULIST_RRI was already allocated' ) + DEALLOCATE( CBULIST_RRI ) + END IF + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRI(NBULISTMAXLINES) ) + CBULIST_RRI(:) = '' + READ(UNIT=ILUSEG,NML=NAM_BU_RRI) + ELSE + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRI(0) ) + END IF + + CALL POSNAM(ILUSEG,'NAM_BU_RRS',GFOUND,ILUOUT) + IF (GFOUND) THEN + IF ( ALLOCATED( CBULIST_RRS ) ) THEN + CALL Print_msg( NVERB_WARNING, 'IO', 'READ_EXSEG_n', 'unexpected: CBULIST_RRS was already allocated' ) + DEALLOCATE( CBULIST_RRS ) + END IF + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRS(NBULISTMAXLINES) ) + CBULIST_RRS(:) = '' + READ(UNIT=ILUSEG,NML=NAM_BU_RRS) + ELSE + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRS(0) ) + END IF + + CALL POSNAM(ILUSEG,'NAM_BU_RRG',GFOUND,ILUOUT) + IF (GFOUND) THEN + IF ( ALLOCATED( CBULIST_RRG ) ) THEN + CALL Print_msg( NVERB_WARNING, 'IO', 'READ_EXSEG_n', 'unexpected: CBULIST_RRG was already allocated' ) + DEALLOCATE( CBULIST_RRG ) + END IF + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRG(NBULISTMAXLINES) ) + CBULIST_RRG(:) = '' + READ(UNIT=ILUSEG,NML=NAM_BU_RRG) + ELSE + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRG(0) ) + END IF + + CALL POSNAM(ILUSEG,'NAM_BU_RRH',GFOUND,ILUOUT) + IF (GFOUND) THEN + IF ( ALLOCATED( CBULIST_RRH ) ) THEN + CALL Print_msg( NVERB_WARNING, 'IO', 'READ_EXSEG_n', 'unexpected: CBULIST_RRH was already allocated' ) + DEALLOCATE( CBULIST_RRH ) + END IF + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRH(NBULISTMAXLINES) ) + CBULIST_RRH(:) = '' + READ(UNIT=ILUSEG,NML=NAM_BU_RRH) + ELSE + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRH(0) ) + END IF + + CALL POSNAM(ILUSEG,'NAM_BU_RSV',GFOUND,ILUOUT) + IF (GFOUND) THEN + IF ( ALLOCATED( CBULIST_RSV ) ) THEN + CALL Print_msg( NVERB_WARNING, 'IO', 'READ_EXSEG_n', 'unexpected: CBULIST_RSV was already allocated' ) + DEALLOCATE( CBULIST_RSV ) + END IF + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RSV(NBULISTMAXLINES) ) + CBULIST_RSV(:) = '' + READ(UNIT=ILUSEG,NML=NAM_BU_RSV) + ELSE + ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RSV(0) ) + END IF + + CALL POSNAM(ILUSEG,'NAM_LES',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_LES) + CALL POSNAM(ILUSEG,'NAM_MEAN',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_MEAN) + CALL POSNAM(ILUSEG,'NAM_PDF',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_PDF) + CALL POSNAM(ILUSEG,'NAM_FRC',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_FRC) + CALL POSNAM(ILUSEG,'NAM_PARAM_C2R2',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_PARAM_C2R2) + CALL POSNAM(ILUSEG,'NAM_PARAM_C1R3',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_PARAM_C1R3) + CALL POSNAM(ILUSEG,'NAM_PARAM_LIMA',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_PARAM_LIMA) + CALL POSNAM(ILUSEG,'NAM_ELEC',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_ELEC) + CALL POSNAM(ILUSEG,'NAM_SERIES',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_SERIES) + CALL POSNAM(ILUSEG,'NAM_TURB_CLOUD',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_TURB_CLOUD) + CALL POSNAM(ILUSEG,'NAM_CH_ORILAM',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_CH_ORILAM) + CALL POSNAM(ILUSEG,'NAM_DUST',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_DUST) + CALL POSNAM(ILUSEG,'NAM_SALT',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_SALT) + CALL POSNAM(ILUSEG,'NAM_PASPOL',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_PASPOL) +#ifdef MNH_FOREFIRE + CALL POSNAM(ILUSEG,'NAM_FOREFIRE',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_FOREFIRE) +#endif + CALL POSNAM(ILUSEG,'NAM_CONDSAMP',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_CONDSAMP) + CALL POSNAM(ILUSEG,'NAM_2D_FRC',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_2D_FRC) + CALL POSNAM(ILUSEG,'NAM_LATZ_EDFLX',GFOUND) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_LATZ_EDFLX) + CALL POSNAM(ILUSEG,'NAM_FIRE',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_FIRE) + CALL POSNAM(ILUSEG,'NAM_BLOWSNOW',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_BLOWSNOW) + CALL POSNAM(ILUSEG,'NAM_VISC',GFOUND,ILUOUT) + IF (GFOUND) READ(UNIT=ILUSEG,NML=NAM_VISC) +END IF +! +!------------------------------------------------------------------------------- +! +CALL TEST_NAM_VAR(ILUOUT,'CPRESOPT',CPRESOPT,'RICHA','CGRAD','CRESI','ZRESI') +! +CALL TEST_NAM_VAR(ILUOUT,'CUVW_ADV_SCHEME',CUVW_ADV_SCHEME, & + 'CEN4TH','CEN2ND','WENO_K' ) +CALL TEST_NAM_VAR(ILUOUT,'CMET_ADV_SCHEME',CMET_ADV_SCHEME, & + &'PPM_00','PPM_01','PPM_02') +CALL TEST_NAM_VAR(ILUOUT,'CSV_ADV_SCHEME',CSV_ADV_SCHEME, & + &'PPM_00','PPM_01','PPM_02') +CALL TEST_NAM_VAR(ILUOUT,'CTEMP_SCHEME',CTEMP_SCHEME, & + &'RK11','RK21','RK33','RKC4','RK53','RK4B','RK62','RK65','NP32','SP32','LEFR') +! +CALL TEST_NAM_VAR(ILUOUT,'CTURB',CTURB,'NONE','TKEL') +CALL TEST_NAM_VAR(ILUOUT,'CRAD',CRAD,'NONE','FIXE','ECMW',& +#ifdef MNH_ECRAD + 'ECRA',& +#endif + 'TOPA') +CALL TEST_NAM_VAR(ILUOUT,'CCLOUD',CCLOUD,'NONE','REVE','KESS', & + & 'ICE3','ICE4','C2R2','C3R5','KHKO','LIMA') +CALL TEST_NAM_VAR(ILUOUT,'CDCONV',CDCONV,'NONE','KAFR') +CALL TEST_NAM_VAR(ILUOUT,'CSCONV',CSCONV,'NONE','KAFR','EDKF') +CALL TEST_NAM_VAR(ILUOUT,'CELEC',CELEC,'NONE','ELE3','ELE4') +! +CALL TEST_NAM_VAR(ILUOUT,'CAER',CAER,'TANR','TEGE','SURF','NONE') +CALL TEST_NAM_VAR(ILUOUT,'CAOP',CAOP,'CLIM','EXPL') +CALL TEST_NAM_VAR(ILUOUT,'CLW',CLW,'RRTM','MORC') +CALL TEST_NAM_VAR(ILUOUT,'CEFRADL',CEFRADL,'PRES','OCLN','MART','C2R2','LIMA') +CALL TEST_NAM_VAR(ILUOUT,'CEFRADI',CEFRADI,'FX40','LIOU','SURI','C3R5','LIMA') +CALL TEST_NAM_VAR(ILUOUT,'COPWLW',COPWLW,'SAVI','SMSH','LILI','MALA') +CALL TEST_NAM_VAR(ILUOUT,'COPILW',COPILW,'FULI','EBCU','SMSH','FU98') +CALL TEST_NAM_VAR(ILUOUT,'COPWSW',COPWSW,'SLIN','FOUQ','MALA') +CALL TEST_NAM_VAR(ILUOUT,'COPISW',COPISW,'FULI','EBCU','FU96') +! +CALL TEST_NAM_VAR(ILUOUT,'CLBCX(1)',CLBCX(1),'CYCL','WALL','OPEN') +CALL TEST_NAM_VAR(ILUOUT,'CLBCX(2)',CLBCX(2),'CYCL','WALL','OPEN') +CALL TEST_NAM_VAR(ILUOUT,'CLBCY(1)',CLBCY(1),'CYCL','WALL','OPEN') +CALL TEST_NAM_VAR(ILUOUT,'CLBCY(2)',CLBCY(2),'CYCL','WALL','OPEN') +! +CALL TURBN_INIT(CPROGRAM, 0, .FALSE., ILUOUT, .FALSE., .FALSE., .TRUE., 0) +CALL NEBN_INIT(CPROGRAM, 0, .FALSE., ILUOUT, .FALSE., .FALSE., .TRUE., 0) +! +CALL TEST_NAM_VAR(ILUOUT,'CCH_TDISCRETIZATION',CCH_TDISCRETIZATION, & + 'SPLIT ','CENTER ','LAGGED ') +! +CALL TEST_NAM_VAR(ILUOUT,'CCONF',CCONF,'START','RESTA') +CALL TEST_NAM_VAR(ILUOUT,'CEQNSYS',CEQNSYS,'LHE','DUR','MAE') +CALL TEST_NAM_VAR(ILUOUT,'CSPLIT',CSPLIT,'BSPLITTING','XSPLITTING','YSPLITTING') +! +CALL TEST_NAM_VAR(ILUOUT,'CBUTYPE',CBUTYPE,'NONE','CART','MASK') +! +CALL TEST_NAM_VAR(ILUOUT,'CRELAX_HEIGHT_TYPE',CRELAX_HEIGHT_TYPE,'FIXE','THGR') +! +CALL TEST_NAM_VAR(ILUOUT,'CLES_NORM_TYPE',CLES_NORM_TYPE,'NONE','CONV','EKMA','MOBU') +CALL TEST_NAM_VAR(ILUOUT,'CBL_HEIGHT_DEF',CBL_HEIGHT_DEF,'TKE','KE','WTV','FRI','DTH') +CALL TEST_NAM_VAR(ILUOUT,'CTURBLEN_CLOUD',CTURBLEN_CLOUD,'NONE','DEAR','DELT','BL89') +! +! The test on the mass flux scheme for shallow convection +! +CALL PARAM_MFSHALLN_INIT(CPROGRAM, 0, .FALSE., ILUOUT, .FALSE., .FALSE., .TRUE., 0) +! +! The test on the CSOLVER name is made elsewhere +! +CALL PARAM_ICEN_INIT(CPROGRAM, 0, .FALSE., ILUOUT, .FALSE., .FALSE., .TRUE., 0) +IF( CCLOUD == 'C3R5' ) THEN + CALL TEST_NAM_VAR(ILUOUT,'CPRISTINE_ICE_C1R3',CPRISTINE_ICE_C1R3, & + 'PLAT','COLU','BURO') + CALL TEST_NAM_VAR(ILUOUT,'CHEVRIMED_ICE_C1R3',CHEVRIMED_ICE_C1R3, & + 'GRAU','HAIL') +END IF +! +IF( CCLOUD == 'LIMA' ) THEN + CALL TEST_NAM_VAR(ILUOUT,'CPRISTINE_ICE_LIMA',CPRISTINE_ICE_LIMA, & + 'PLAT','COLU','BURO') + CALL TEST_NAM_VAR(ILUOUT,'CHEVRIMED_ICE_LIMA',CHEVRIMED_ICE_LIMA, & + 'GRAU','HAIL') +END IF +! Blaze +IF (LBLAZE) THEN + CALL TEST_NAM_VAR(ILUOUT,'CPROPAG_MODEL',CPROPAG_MODEL,'SANTONI2011') + CALL TEST_NAM_VAR(ILUOUT,'CHEAT_FLUX_MODEL',CHEAT_FLUX_MODEL,'CST','EXP','EXS') + CALL TEST_NAM_VAR(ILUOUT,'CLATENT_FLUX_MODEL',CLATENT_FLUX_MODEL,'CST','EXP') + CALL TEST_NAM_VAR(ILUOUT,'CFIRE_CPL_MODE',CFIRE_CPL_MODE,'2WAYCPL','FIR2ATM','ATM2FIR') + CALL TEST_NAM_VAR(ILUOUT,'CWINDFILTER',CWINDFILTER,'EWAM','WLIM') +END IF +IF(LBLOWSNOW) THEN + CALL TEST_NAM_VAR(ILUOUT,'CSNOWSEDIM',CSNOWSEDIM,'NONE','MITC','CARR','TABC') + IF (XALPHA_SNOW .NE. 3 .AND. CSNOWSEDIM=='TABC') THEN + WRITE(ILUOUT,*) '*****************************************' + WRITE(ILUOUT,*) '* XALPHA_SNW must be set to 3 when ' + WRITE(ILUOUT,*) '* CSNOWSEDIM = TABC ' + WRITE(ILUOUT,*) '* Update the look-up table in BLOWSNOW_SEDIM_LKT1D ' + WRITE(ILUOUT,*) '* to use TABC with a different value of XEMIALPHA_SNW' + WRITE(ILUOUT,*) '*****************************************' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + ENDIF +END IF +! Consistency checks between phyex modules +IF ((CSUBG_AUCV_RC == 'ADJU' .OR. CSUBG_AUCV_RI == 'ADJU') .AND. CCONDENS /= 'GAUS') THEN + CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'READ_EXSEGN', & + &"CSUBG_AUCV_RC and/or CSUBG_AUCV_RI cannot be 'ADJU' if CCONDENS is not 'GAUS'") +ENDIF +IF (.NOT. LHARAT .AND. LSTATNW) THEN + CALL PRINT_MSG(NVERB_FATAL, 'GEN', 'READ_EXSEGN', & + &'LSTATNW only tested in combination with HARATU and EDMFm!') +ENDIF +! +!-------------------------------------------------------------------------------! +!* 2. FIRST INITIALIZATIONS +! --------------------- +! +!* 2.1 Time step in gridnesting case +! +IF (KMI /= 1 .AND. NDAD(KMI) /= KMI) THEN + XTSTEP = PTSTEP_ALL(NDAD(KMI)) / NDTRATIO(KMI) +END IF +PTSTEP_ALL(KMI) = XTSTEP +! +!* 2.2 Fill the global configuration module +! +! Check coherence between the microphysical scheme and water species and +!initialize the logicals LUSERn +! +SELECT CASE ( CCLOUD ) + CASE ( 'NONE' ) + IF (.NOT. ( (.NOT. LUSERC) .AND. (.NOT. LUSERR) .AND. (.NOT. LUSERI) .AND. & + (.NOT. LUSERS) .AND. (.NOT. LUSERG) .AND. (.NOT. LUSERH) & + ) .AND. CPROGRAM=='MESONH' ) THEN +! + LUSERC=.FALSE. + LUSERR=.FALSE.; LUSERI=.FALSE. + LUSERS=.FALSE.; LUSERG=.FALSE. + LUSERH=.FALSE. +! + END IF +! + IF (CSUBG_AUCV_RC == 'SIGM') THEN +! + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU WANT TO USE THE SUBGRID AUTOCONVERSION SCHEME ' + WRITE(UNIT=ILUOUT,FMT=*) ' WITHOUT MICROPHYSICS' + WRITE(UNIT=ILUOUT,FMT=*) ' CSUBG_AUCV IS PUT TO "NONE"' +! + CSUBG_AUCV_RC = 'NONE' +! + END IF +! + CASE ( 'REVE' ) + IF (.NOT. ( LUSERV .AND. LUSERC .AND. (.NOT. LUSERR) .AND. (.NOT. LUSERI) & + .AND. (.NOT. LUSERS) .AND. (.NOT. LUSERG) .AND. (.NOT. LUSERH) & + ) ) THEN +! + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE A REVERSIBLE MICROPHYSICAL " ,& + &" SCHEME. YOU WILL ONLY HAVE VAPOR AND CLOUD WATER ",/, & + &" LUSERV AND LUSERC ARE TO TRUE AND THE OTHERS TO FALSE ")') +! + LUSERV=.TRUE. ; LUSERC=.TRUE. + LUSERR=.FALSE.; LUSERI=.FALSE. + LUSERS=.FALSE.; LUSERG=.FALSE. + LUSERH=.FALSE. + END IF +! + IF (CSUBG_AUCV_RC == 'SIGM') THEN +! + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU WANT TO USE BOTH A REVERSIBLE MICROPHYSICAL SCHEME ' + WRITE(UNIT=ILUOUT,FMT=*) ' AND THE SUBGRID AUTOCONVERSION SCHEME ' + WRITE(UNIT=ILUOUT,FMT=*) 'BUT YOU DO NOT HAVE RAIN in the "REVE" SCHEME' + WRITE(UNIT=ILUOUT,FMT=*) ' CSUBG_AUCV_RC IS PUT TO "NONE"' +! + CSUBG_AUCV_RC = 'NONE' +! + END IF +! + CASE ( 'KESS' ) + IF (.NOT. ( LUSERV .AND. LUSERC .AND. LUSERR .AND. (.NOT. LUSERI) .AND. & + (.NOT. LUSERS) .AND. (.NOT. LUSERG) .AND. (.NOT. LUSERH) & + ) ) THEN +! + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE A KESSLER MICROPHYSICAL " , & + &" SCHEME. YOU WILL ONLY HAVE VAPOR, CLOUD WATER AND RAIN ",/, & + &" LUSERV, LUSERC AND LUSERR ARE SET TO TRUE AND THE OTHERS TO FALSE ")') +! + LUSERV=.TRUE. ; LUSERC=.TRUE. ; LUSERR=.TRUE. + LUSERI=.FALSE.; LUSERS=.FALSE. + LUSERG=.FALSE.; LUSERH=.FALSE. + END IF +! + IF (CSUBG_AUCV_RC == 'SIGM') THEN +! + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU WANT TO USE BOTH A KESSLER MICROPHYSICAL SCHEME ' + WRITE(UNIT=ILUOUT,FMT=*) ' AND THE SUBGRID AUTOCONVERSION SCHEME USING' + WRITE(UNIT=ILUOUT,FMT=*) 'SIGMA_RC.' + WRITE(UNIT=ILUOUT,FMT=*) 'THIS IS NOT YET AVAILABLE.' + WRITE(UNIT=ILUOUT,FMT=*) 'SET CSUBG_AUCV_RC TO "CLFR" or "NONE" OR CCLOUD TO "ICE3"' +! + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF +! + CASE ( 'ICE3' ) + IF (.NOT. ( LUSERV .AND. LUSERC .AND. LUSERR .AND. LUSERI .AND. LUSECI & + .AND. LUSERS .AND. LUSERG .AND. (.NOT. LUSERH)) & + .AND. CPROGRAM=='MESONH' ) THEN + ! + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU WANT TO USE THE ice3 SIMPLE MIXED PHASE' + WRITE(UNIT=ILUOUT,FMT=*) 'MICROPHYSICAL SCHEME. YOU WILL ONLY HAVE VAPOR, CLOUD WATER,' + WRITE(UNIT=ILUOUT,FMT=*) 'RAIN WATER, CLOUD ICE (MIXING RATIO AND CONCENTRATION)' + WRITE(UNIT=ILUOUT,FMT=*) 'SNOW-AGGREGATES AND GRAUPELN.' + WRITE(UNIT=ILUOUT,FMT=*) 'LUSERV,LUSERC,LUSERR,LUSERI,LUSECI,LUSERS,LUSERG ARE SET TO TRUE' + WRITE(UNIT=ILUOUT,FMT=*) 'AND LUSERH TO FALSE' +! + LUSERV=.TRUE. ; LUSERC=.TRUE. ; LUSERR=.TRUE. + LUSERI=.TRUE. ; LUSECI=.TRUE. + LUSERS=.TRUE. ; LUSERG=.TRUE. + LUSERH=.FALSE. + END IF +! + IF (CSUBG_AUCV_RC == 'SIGM' .AND. .NOT. LSUBG_COND) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU WANT TO USE SUBGRID AUTOCONVERSION SCHEME' + WRITE(UNIT=ILUOUT,FMT=*) ' WITHOUT THE SUBGRID CONDENSATION SCHEME.' + WRITE(UNIT=ILUOUT,FMT=*) 'THIS IS NOT ALLOWED: CSUBG_AUCV_RC is SET to NONE' + CSUBG_AUCV_RC='NONE' + END IF +! + IF (CSUBG_AUCV_RC == 'CLFR' .AND. CSCONV /= 'EDKF') THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU WANT TO USE SUBGRID AUTOCONVERSION SCHEME' + WRITE(UNIT=ILUOUT,FMT=*) 'WITH THE CONVECTIVE CLOUD FRACTION WITHOUT EDKF' + WRITE(UNIT=ILUOUT,FMT=*) 'THIS IS NOT ALLOWED: CSUBG_AUCV_RC is SET to NONE' + CSUBG_AUCV_RC='NONE' + END IF +! + CASE ( 'ICE4' ) + IF (.NOT. ( LUSERV .AND. LUSERC .AND. LUSERR .AND. LUSERI .AND. LUSECI & + .AND. LUSERS .AND. LUSERG .AND. LUSERH) & + .AND. CPROGRAM=='MESONH' ) THEN + ! + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU WANT TO USE THE ice4 SIMPLE MIXED PHASE' + WRITE(UNIT=ILUOUT,FMT=*) 'MICROPHYSICAL SCHEME. YOU WILL ONLY HAVE VAPOR, CLOUD WATER,' + WRITE(UNIT=ILUOUT,FMT=*) 'RAIN WATER, CLOUD ICE (MIXING RATIO AND CONCENTRATION)' + WRITE(UNIT=ILUOUT,FMT=*) 'SNOW-AGGREGATES, GRAUPELN AND HAILSTONES.' + WRITE(UNIT=ILUOUT,FMT=*) 'LUSERV,LUSERC,LUSERR,LUSERI,LUSECI,LUSERS,LUSERG' + WRITE(UNIT=ILUOUT,FMT=*) 'AND LUSERH ARE SET TO TRUE' +! + LUSERV=.TRUE. ; LUSERC=.TRUE. ; LUSERR=.TRUE. + LUSERI=.TRUE. ; LUSECI=.TRUE. + LUSERS=.TRUE. ; LUSERG=.TRUE. ; LUSERH=.TRUE. + END IF +! + IF (CSUBG_AUCV_RC /= 'NONE' .AND. .NOT. LSUBG_COND) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU WANT TO USE SUBGRID AUTOCONVERSION SCHEME' + WRITE(UNIT=ILUOUT,FMT=*) ' WITHOUT THE SUBGRID CONDENSATION SCHEME.' + WRITE(UNIT=ILUOUT,FMT=*) 'THIS IS NOT ALLOWED: CSUBG_AUCV_RC is SET to NONE' + CSUBG_AUCV_RC='NONE' + END IF +! + CASE ( 'C2R2','C3R5', 'KHKO' ) + IF (( EPARAM_CCN == 'XXX') .OR. (EINI_CCN == 'XXX')) THEN + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE A 2-MOMENT MICROPHYSICAL ", & + &" SCHEME BUT YOU DIDNT FILL CORRECTLY NAM_PARAM_C2R2", & + &" YOU HAVE TO FILL HPARAM_CCN and HINI_CCN ")') + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF + IF (HCLOUD == 'NONE') THEN + CGETCLOUD = 'SKIP' + ELSE IF (HCLOUD == 'REVE' ) THEN + CGETCLOUD = 'INI1' + ELSE IF (HCLOUD == 'KESS' ) THEN + CGETCLOUD = 'INI2' + ELSE IF (HCLOUD == 'ICE3' ) THEN + IF (CCLOUD == 'C3R5') THEN + CGETCLOUD = 'INI2' + ELSE + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE THE WARM MICROPHYSICAL ", & + &" SCHEME BUT YOU WERE USING THE ICE3 SCHEME PREVIOUSLY.",/, & + &" AS THIS IS A LITTLE BIT STUPID IT IS NOT AUTHORIZED !!!")') + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF + ELSE + CGETCLOUD = 'READ' ! This is automatically done + END IF +! + IF ((CCLOUD == 'C2R2' ).OR. (CCLOUD == 'KHKO' )) THEN + IF (.NOT. ( LUSERV .AND. LUSERC .AND. LUSERR .AND. (.NOT. LUSERI) .AND. & + (.NOT. LUSERS) .AND. (.NOT. LUSERG) .AND. (.NOT. LUSERH) & + ) ) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE THE C2R2 MICROPHYSICAL ", & + &" SCHEME. YOU WILL ONLY HAVE VAPOR, CLOUD WATER AND RAIN ",/, & + &"LUSERV, LUSERC AND LUSERR ARE SET TO TRUE AND THE OTHERS TO FALSE ")') +! + LUSERV=.TRUE. ; LUSERC=.TRUE. ; LUSERR=.TRUE. + LUSERI=.FALSE.; LUSERS=.FALSE. + LUSERG=.FALSE.; LUSERH=.FALSE. + END IF + ELSE IF (CCLOUD == 'C3R5') THEN + IF (.NOT. ( LUSERV .AND. LUSERC .AND. LUSERR .AND. LUSERI .AND. & + LUSERS .AND. LUSERG .AND. (.NOT. LUSERH) & + ) ) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE THE C3R5 MICROPHYS. SCHEME.",& + &" YOU WILL HAVE VAPOR, CLOUD WATER/ICE, RAIN, SNOW AND GRAUPEL ",/, & + &"LUSERV, LUSERC, LUSERR, LUSERI, LUSERS, LUSERG ARE SET TO TRUE")' ) +! + LUSERV=.TRUE. ; LUSERC=.TRUE. ; LUSERR=.TRUE. + LUSERI=.TRUE. ; LUSECI=.TRUE. + LUSERS=.TRUE. ; LUSERG=.TRUE. + LUSERH=.FALSE. + END IF + ELSE IF (CCLOUD == 'LIMA') THEN + IF (.NOT. ( LUSERV .AND. LUSERC .AND. LUSERR .AND. LUSERI .AND. & + LUSERS .AND. LUSERG .AND. (.NOT. LUSERH) & + ) ) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE THE LIMA MICROPHYS. SCHEME.",& + &" YOU WILL HAVE VAPOR, CLOUD WATER/ICE, RAIN, SNOW AND GRAUPEL ",/, & + &"LUSERV, LUSERC, LUSERR, LUSERI, LUSERS, LUSERG ARE SET TO TRUE")' ) +! + LUSERV=.TRUE. ; LUSERC=.TRUE. ; LUSERR=.TRUE. + LUSERI=.TRUE. ; LUSECI=.TRUE. + LUSERS=.TRUE. ; LUSERG=.TRUE. + LUSERH=.FALSE. + END IF + END IF +! + IF (LSUBG_COND) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU WANT TO USE BOTH THE SIMPLE MIXED PHASE' + WRITE(UNIT=ILUOUT,FMT=*) 'MICROPHYS. SCHEME AND THE SUBGRID COND. SCHEME.' + WRITE(UNIT=ILUOUT,FMT=*) 'THIS IS NOT YET AVAILABLE.' + WRITE(UNIT=ILUOUT,FMT=*) 'SET LSUBG_COND TO FALSE OR CCLOUD TO "REVE", "KESS"' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF +! + IF ( CEFRADL /= 'C2R2') THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT=*) ' YOU DID NOT CHOOSE CEFRADL=C2R2 FOR RADIATION' + WRITE(UNIT=ILUOUT,FMT=*) ' IT IS ADVISED TO USE CEFRADL=C2R2 ' + WRITE(UNIT=ILUOUT,FMT=*) ' WITH A 2-MOMENT MICROPHYSICAL SCHEME' + END IF +! + IF ( CCLOUD == 'C3R5' .AND. CEFRADI /= 'C3R5') THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT=*) ' YOU DID NOT CHOOSE CEFRADI=C3R5 FOR RADIATION' + WRITE(UNIT=ILUOUT,FMT=*) ' IT IS ADVISED TO USE CEFRADI=C3R5 ' + WRITE(UNIT=ILUOUT,FMT=*) ' WITH A 2-MOMENT MICROPHYSICAL SCHEME' + END IF +! + IF ( WALPHAC /= 3.0 .OR. WNUC /= 2.0) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'IT IS ADVISED TO USE XALPHAC=3. and XNUC=2.' + WRITE(UNIT=ILUOUT,FMT=*) 'FOR STRATOCUMULUS WITH KHKO SCHEME. ' + END IF +! + IF ( CEFRADL /= 'C2R2') THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT=*) ' YOU DID NOT CHOOSE CEFRADL=C2R2 FOR RADIATION' + WRITE(UNIT=ILUOUT,FMT=*) ' IT IS ADVISED TO USE CEFRADL=C2R2 ' + WRITE(UNIT=ILUOUT,FMT=*) ' WITH A 2-MOMENT MICROPHYSICAL SCHEME' + END IF +! + CASE ( 'LIMA') + IF ((LACTI .AND. FINI_CCN == 'XXX')) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE A 2-MOMENT MICROPHYSICAL ", & + &" SCHEME BUT YOU DIDNT FILL CORRECTLY NAM_PARAM_LIMA", & + &" YOU HAVE TO FILL FINI_CCN ")') + call Print_msg( NVERB_FATAL, 'GEN', 'READ_EXSEG_n', '' ) + END IF +! + IF(LACTI .AND. NMOD_CCN == 0) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("ACTIVATION OF AEROSOL PARTICLES IS NOT ", & + &"POSSIBLE IF NMOD_CCN HAS VALUE ZERO. YOU HAVE TO SET AN UPPER ", & + &"VALUE OF NMOD_CCN IN ORDER TO USE LIMA WARM ACTIVATION SCHEME.")') + call Print_msg( NVERB_FATAL, 'GEN', 'READ_EXSEG_n', '' ) + END IF +! + IF(LNUCL .AND. NMOD_IFN == 0 .AND. (.NOT.LMEYERS)) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("NUCLEATION BY DEPOSITION AND CONTACT IS NOT ", & + &"POSSIBLE IF NMOD_IFN HAS VALUE ZERO. YOU HAVE TO SET AN UPPER", & + &"VALUE OF NMOD_IFN IN ORDER TO USE LIMA COLD NUCLEATION SCHEME.")') + END IF +! + IF (HCLOUD == 'NONE') THEN + CGETCLOUD = 'SKIP' + ELSE IF (HCLOUD == 'REVE' ) THEN + CGETCLOUD = 'INI1' + ELSE IF (HCLOUD == 'KESS' ) THEN + CGETCLOUD = 'INI2' + ELSE IF (HCLOUD == 'ICE3' ) THEN + CGETCLOUD = 'INI2' + ELSE + CGETCLOUD = 'READ' ! This is automatically done + END IF +! + IF (FWARM) THEN + LUSERV=.TRUE. ; LUSERC=.TRUE. ; LUSERR=.TRUE. + LUSERI=.FALSE.; LUSERS=.FALSE. ; LUSERG=.FALSE.; LUSERH=.FALSE. + END IF +! + IF (LCOLD) THEN + LUSERV=.TRUE. ; LUSERC=.TRUE. ; LUSERR=.TRUE. + LUSERI=.TRUE. ; LUSERS=.TRUE. ; LUSERG=.TRUE. + LUSERH=LHAIL + END IF + ! + IF (LSPRO) LADJ=.FALSE. + IF (.NOT.LRAIN) NMOM_R=0 + IF (.NOT.PARAM_ICEN%LWARM) THEN + NMOM_C=0 + NMOM_R=0 + END IF + IF (.NOT.LSNOW) THEN + NMOM_S=0 + NMOM_G=0 + NMOM_H=0 + LHAIL=.FALSE. + END IF + IF (.NOT.LHAIL) NMOM_H=0 + IF (.NOT.LCOLD) THEN + NMOM_I=0 + NMOM_S=0 + NMOM_G=0 + NMOM_H=0 + LSNOW=.FALSE. + LHAIL=.FALSE. + LNUCL=.FALSE. + NMOD_IFN=0 + NMOD_IMM=0 + END IF + IF (.NOT.LPTSPLIT) THEN + IF (NMOM_C==1) NMOM_C=2 + IF (NMOM_R==1) NMOM_R=2 + IF (NMOM_I==1) NMOM_I=2 + IF (NMOM_S==2 .OR. NMOM_G==2 .OR. (LHAIL .AND. NMOM_H==2)) THEN + NMOM_S=2 + NMOM_G=2 + IF (LHAIL) NMOM_H=2 + END IF + END IF +! + IF (LSUBG_COND .AND. (.NOT. LPTSPLIT)) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU MUST USE LPTSPLIT=T with CCLOUD=LIMA' + WRITE(UNIT=ILUOUT,FMT=*) 'AND LSUBG_COND ' + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','use LPTSPLIT=T with LIMA and LSUBG_COND=T') + END IF +! + IF (LSUBG_COND .AND. (.NOT. LADJ)) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU MUST USE LADJ=T with CCLOUD=LIMA' + WRITE(UNIT=ILUOUT,FMT=*) 'AND LSUBG_COND ' + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','use LADJ=T with LIMA and LSUBG_COND=T') + END IF +! + IF ( LKHKO .AND. (XALPHAC /= 3.0 .OR. XNUC /= 2.0) ) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'IT IS ADVISED TO USE XALPHAC=3. and XNUC=2.' + WRITE(UNIT=ILUOUT,FMT=*) 'FOR STRATOCUMULUS. ' + END IF +! + IF ( CEFRADL /= 'LIMA') THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT=*) ' YOU DID NOT CHOOSE CEFRADL=LIMA FOR RADIATION' + WRITE(UNIT=ILUOUT,FMT=*) ' IT IS ADVISED TO USE CEFRADL=LIMA ' + WRITE(UNIT=ILUOUT,FMT=*) ' WITH A 2-MOMENT MICROPHYSICAL SCHEME "LIMA"' + END IF +! +END SELECT +! +LUSERV_G(KMI) = LUSERV +LUSERC_G(KMI) = LUSERC +LUSERR_G(KMI) = LUSERR +LUSERI_G(KMI) = LUSERI +LUSERS_G(KMI) = LUSERS +LUSERG_G(KMI) = LUSERG +LUSERH_G(KMI) = LUSERH +LUSETKE(KMI) = (CTURB /= 'NONE') +! +!------------------------------------------------------------------------------- +! +!* 2.3 Chemical and NSV_* variables initializations +! +CALL UPDATE_NAM_IBM_PARAMN +CALL UPDATE_NAM_RECYCL_PARAMN +CALL UPDATE_NAM_PARAMN +CALL UPDATE_NAM_DYNN +CALL UPDATE_NAM_CONFN +! +IF (LORILAM .AND. .NOT. LUSECHEM) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU CANNOT USE ORILAM AEROSOL SCHEME WITHOUT ' + WRITE(ILUOUT,FMT=*) 'CHEMICAL GASEOUS CHEMISTRY ' + WRITE(ILUOUT,FMT=*) 'THEREFORE LUSECHEM IS SET TO TRUE ' + LUSECHEM=.TRUE. +END IF +! +IF (LUSECHAQ.AND.(.NOT.LUSECHEM)) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU WANT TO USE AQUEOUS PHASE CHEMISTRY' + WRITE(UNIT=ILUOUT,FMT=*) 'BUT THE CHEMISTRY IS NOT ACTIVATED' + WRITE(UNIT=ILUOUT,FMT=*) 'SET LUSECHEM TO TRUE IF YOU WANT REALLY USE CHEMISTRY' + WRITE(UNIT=ILUOUT,FMT=*) 'OR SET LUSECHAQ TO FALSE IF YOU DO NOT WANT USE IT' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') +END IF +IF (LUSECHAQ.AND.(.NOT.LUSERC).AND.CPROGRAM=='MESONH') THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU WANT TO USE AQUEOUS PHASE CHEMISTRY' + WRITE(UNIT=ILUOUT,FMT=*) 'BUT CLOUD MICROPHYSICS IS NOT ACTIVATED' + WRITE(UNIT=ILUOUT,FMT=*) 'LUSECHAQ IS SET TO FALSE' + LUSECHAQ = .FALSE. +END IF +IF (LUSECHAQ.AND.CCLOUD(1:3) == 'ICE'.AND. .NOT. LUSECHIC) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU WANT TO USE AQUEOUS PHASE CHEMISTRY' + WRITE(UNIT=ILUOUT,FMT=*) 'WITH MIXED PHASE CLOUD MICROPHYSICS' + WRITE(UNIT=ILUOUT,FMT=*) 'SET LUSECHIC TO TRUE IF YOU WANT TO ACTIVATE' + WRITE(UNIT=ILUOUT,FMT=*) 'ICE PHASE CHEMICAL SPECIES' + IF (LCH_RET_ICE) THEN + WRITE(UNIT=ILUOUT,FMT=*) 'LCH_RET_ICE TRUE MEANS ALL SOLUBLE' + WRITE(UNIT=ILUOUT,FMT=*) 'GASES ARE RETAINED IN ICE PHASE' + WRITE(UNIT=ILUOUT,FMT=*) 'WHEN SUPERCOOLED WATER FREEZES' + ELSE + WRITE(UNIT=ILUOUT,FMT=*) 'LCH_RET_ICE FALSE MEANS ALL SOLUBLE' + WRITE(UNIT=ILUOUT,FMT=*) 'GASES GO BACK TO THE GAS PHASE WHEN' + WRITE(UNIT=ILUOUT,FMT=*) 'SUPERCOOLED WATER FREEZES' + ENDIF +ENDIF +IF (LUSECHIC.AND. .NOT. CCLOUD(1:3) == 'ICE'.AND.CPROGRAM=='MESONH') THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU WANT TO USE ICE PHASE CHEMISTRY' + WRITE(UNIT=ILUOUT,FMT=*) 'BUT MIXED PHASE CLOUD MICROPHYSICS IS NOT ACTIVATED' + WRITE(UNIT=ILUOUT,FMT=*) 'LUSECHIC IS SET TO FALSE' + LUSECHIC= .FALSE. +ENDIF +IF (LCH_PH.AND. (.NOT. LUSECHAQ)) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'DIAGNOSTIC PH COMPUTATION IS ACTIVATED' + WRITE(UNIT=ILUOUT,FMT=*) 'BUT AQUEOUS PHASE CHEMISTRY IS NOT ACTIVATED' + WRITE(UNIT=ILUOUT,FMT=*) 'SET LUSECHAQ TO TRUE IF YOU WANT TO ACTIVATE IT' + WRITE(UNIT=ILUOUT,FMT=*) 'LCH_PH IS SET TO FALSE' + LCH_PH= .FALSE. +ENDIF +IF (LUSECHIC.AND.(.NOT.LUSECHAQ)) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU WANT TO USE ICE PHASE CHEMISTRY' + WRITE(UNIT=ILUOUT,FMT=*) 'BUT THE AQUEOUS PHASE CHEMISTRY IS NOT ACTIVATED' + WRITE(UNIT=ILUOUT,FMT=*) 'SET LUSECHAQ TO TRUE IF YOU WANT REALLY USE CLOUD CHEMISTRY' + WRITE(UNIT=ILUOUT,FMT=*) 'OR SET LUSECHIC TO FALSE IF YOU DO NOT WANT USE IT' +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') +END IF +IF ((LUSECHIC).AND.(LCH_RET_ICE)) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU WANT TO USE RETENTION OF SOLUBLE GASES IN ICE' + WRITE(UNIT=ILUOUT,FMT=*) 'BUT THE ICE PHASE CHEMISTRY IS ACTIVATED' + WRITE(UNIT=ILUOUT,FMT=*) 'FLAG LCH_RET_ICE IS ONLY USES WHEN LUSECHIC IS SET' + WRITE(UNIT=ILUOUT,FMT=*) 'TO FALSE IE NO CHEMICAL SPECIES IN ICE' +ENDIF +! +CALL UPDATE_NAM_CH_MNHCN +CALL INI_NSV(KMI) +! +! From this point, all NSV* variables contain valid values for model KMI +! +DO JSV = 1,NSV + LUSESV(JSV,KMI) = .TRUE. +END DO +! +IF ( CAOP=='EXPL' .AND. .NOT.LDUST .AND. .NOT.LORILAM & + .AND. .NOT.LSALT .AND. .NOT.(CCLOUD=='LIMA') ) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT=*) ' YOU WANT TO USE EXPLICIT AEROSOL OPTICAL ' + WRITE(UNIT=ILUOUT,FMT=*) 'PROPERTIES BUT YOU DONT HAVE DUST OR ' + WRITE(UNIT=ILUOUT,FMT=*) 'AEROSOL OR SALT THEREFORE CAOP=CLIM' + CAOP='CLIM' +END IF +!------------------------------------------------------------------------------- +! +!* 3. CHECK COHERENCE BETWEEN EXSEG VARIABLES AND FMFILE ATTRIBUTES +! ------------------------------------------------------------- +! +! +!* 3.1 Turbulence variable +! +IF ((CTURB /= 'NONE').AND.(HTURB == 'NONE')) THEN + CGETTKET ='INIT' + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT=*)'YOU WANT TO USE TURBULENCE KINETIC ENERGY TKE' + WRITE(UNIT=ILUOUT,FMT=*)'WHEREAS IT IS NOT IN INITIAL FMFILE' + WRITE(UNIT=ILUOUT,FMT=*)'TKE WILL BE INITIALIZED TO ZERO' +ELSE + IF (CTURB /= 'NONE') THEN + CGETTKET ='READ' + IF ((CCONF=='START') .AND. CPROGRAM /= 'DIAG') CGETTKET='INIT' + ELSE + CGETTKET ='SKIP' + END IF +END IF +! +! +IF ((CTOM == 'TM06').AND.(HTOM /= 'TM06')) THEN + CGETBL_DEPTH ='INIT' + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT=*)'YOU WANT TO USE BL DEPTH FOR THIRD ORDER MOMENTS' + WRITE(UNIT=ILUOUT,FMT=*)'WHEREAS IT IS NOT IN INITIAL FMFILE' + WRITE(UNIT=ILUOUT,FMT=*)'IT WILL BE INITIALIZED TO ZERO' +ELSE + IF (CTOM == 'TM06') THEN + CGETBL_DEPTH ='READ' + ELSE + CGETBL_DEPTH ='SKIP' + END IF +END IF +! +IF (LRMC01 .AND. .NOT. ORMC01) THEN + CGETSBL_DEPTH ='INIT' + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT=*)'YOU WANT TO USE SBL DEPTH FOR RMC01' + WRITE(UNIT=ILUOUT,FMT=*)'WHEREAS IT IS NOT IN INITIAL FMFILE' + WRITE(UNIT=ILUOUT,FMT=*)'IT WILL BE INITIALIZED TO ZERO' +ELSE + IF (LRMC01) THEN + CGETSBL_DEPTH ='READ' + ELSE + CGETSBL_DEPTH ='SKIP' + END IF +END IF +! +! +!* 3.2 Moist variables +! +IF (LUSERV.AND. (.NOT.OUSERV)) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE VAPOR VARIABLE Rv WHEREAS IT ", & + & "IS NOT IN INITIAL FMFILE",/, & + & "Rv WILL BE INITIALIZED TO ZERO")') + CGETRVT='INIT' +ELSE + IF (LUSERV) THEN + CGETRVT='READ' + ELSE + CGETRVT='SKIP' + END IF +END IF +! +IF (LUSERC.AND. (.NOT.OUSERC)) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE CLOUD VARIABLE Rc WHEREAS IT ", & + & " IS NOT IN INITIAL FMFILE",/, & + & "Rc WILL BE INITIALIZED TO ZERO")') + CGETRCT='INIT' +ELSE + IF (LUSERC) THEN + CGETRCT='READ' +! IF(CCONF=='START') CGETRCT='INIT' + ELSE + CGETRCT='SKIP' + END IF +END IF +! +IF (LUSERR.AND. (.NOT.OUSERR)) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE RAIN VARIABLE Rr WHEREAS IT ", & + & "IS NOT IN INITIAL FMFILE",/, & + & " Rr WILL BE INITIALIZED TO ZERO")') + + CGETRRT='INIT' +ELSE + IF (LUSERR) THEN + CGETRRT='READ' +! IF( (CCONF=='START').AND. CPROGRAM /= 'DIAG') CGETRRT='INIT' + ELSE + CGETRRT='SKIP' + END IF +END IF +! +IF (LUSERI.AND. (.NOT.OUSERI)) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE ICE VARIABLE Ri WHEREAS IT ", & + & "IS NOT IN INITIAL FMFILE",/, & + & " Ri WILL BE INITIALIZED TO ZERO")') + CGETRIT='INIT' +ELSE + IF (LUSERI) THEN + CGETRIT='READ' +! IF(CCONF=='START') CGETRIT='INIT' + ELSE + CGETRIT='SKIP' + END IF +END IF +! +IF (LUSECI.AND. (.NOT.OUSECI)) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE ICE CONC. VARIABLE Ci WHEREAS IT ",& + & "IS NOT IN INITIAL FMFILE",/, & + & " Ci WILL BE INITIALIZED TO ZERO")') + CGETCIT='INIT' +ELSE + IF (LUSECI) THEN + CGETCIT='READ' + ELSE + CGETCIT='SKIP' + END IF +END IF +! +IF (LUSERS.AND. (.NOT.OUSERS)) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE SNOW VARIABLE Rs WHEREAS IT ",& + & "IS NOT IN INITIAL FMFILE",/, & + & " Rs WILL BE INITIALIZED TO ZERO")') + CGETRST='INIT' +ELSE + IF (LUSERS) THEN + CGETRST='READ' +! IF ( (CCONF=='START').AND. CPROGRAM /= 'DIAG') CGETRST='INIT' + ELSE + CGETRST='SKIP' + END IF +END IF +! +IF (LUSERG.AND. (.NOT.OUSERG)) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE GRAUPEL VARIABLE Rg WHEREAS ",& + & " IT IS NOTIN INITIAL FMFILE",/, & + & "Rg WILL BE INITIALIZED TO ZERO")') + CGETRGT='INIT' +ELSE + IF (LUSERG) THEN + CGETRGT='READ' +! IF ( (CCONF=='START') .AND. CPROGRAM /= 'DIAG') CGETRGT='INIT' + ELSE + CGETRGT='SKIP' + END IF +END IF +! +IF (LUSERH.AND. (.NOT.OUSERH)) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE HAIL VARIABLE Rh WHEREAS",& + & "IT IS NOT IN INITIAL FMFILE",/, & + & " Rh WILL BE INITIALIZED TO ZERO")') + CGETRHT='INIT' +ELSE + IF (LUSERH) THEN + CGETRHT='READ' +! IF ( (CCONF=='START') .AND. CPROGRAM /= 'DIAG') CGETRHT='INIT' + ELSE + CGETRHT='SKIP' + END IF +END IF +! +IF (LUSERC.AND. (.NOT.OUSERC)) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'THE CLOUD FRACTION WILL BE INITIALIZED ACCORDING' + WRITE(UNIT=ILUOUT,FMT=*) 'TO CLOUD MIXING RATIO VALUE OR SET TO 0' + CGETCLDFR = 'INIT' +ELSE + IF ( LUSERC ) THEN + CGETCLDFR = 'READ' + IF ( (CCONF=='START') .AND. CPROGRAM /= 'DIAG') CGETCLDFR='INIT' + ELSE + CGETCLDFR = 'SKIP' + END IF +END IF +! +IF (LUSERI.AND. (.NOT.OUSERI)) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'THE ICE CLOUD FRACTION WILL BE INITIALIZED ACCORDING' + WRITE(UNIT=ILUOUT,FMT=*) 'TO CLOUD MIXING RATIO VALUE OR SET TO 0' + CGETICEFR = 'INIT' +ELSE + IF ( LUSERI ) THEN + CGETICEFR = 'READ' + IF ( (CCONF=='START') .AND. CPROGRAM /= 'DIAG') CGETICEFR='INIT' + ELSE + CGETICEFR = 'SKIP' + END IF +END IF +! +! +!* 3.3 Moist turbulence +! +IF ( LUSERC .AND. CTURB /= 'NONE' ) THEN + IF ( .NOT. (OUSERC .AND. HTURB /= 'NONE') ) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE MOIST TURBULENCE WHEREAS IT ",/, & + & " WAS NOT THE CASE FOR THE INITIAL FMFILE GENERATION",/, & + & "SRC AND SIGS ARE INITIALIZED TO 0")') + CGETSRCT ='INIT' + CGETSIGS ='INIT' + ELSE + CGETSRCT ='READ' + IF ( (CCONF=='START') .AND. CPROGRAM /= 'DIAG') CGETSRCT ='INIT' + CGETSIGS ='READ' + END IF +ELSE + CGETSRCT ='SKIP' + CGETSIGS ='SKIP' +END IF +! +IF(NMODEL_CLOUD==KMI .AND. CTURBLEN_CLOUD/='NONE') THEN + IF (CTURB=='NONE' .OR. .NOT.LUSERC) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO COMPUTE A MIXING LENGTH FOR CLOUD=", & + & ", WHEREAS YOU DO NOT SPECIFY A TURBULENCE SCHEME OR ", & + & "USE OF RC,",/," CTURBLEN_CLOUD IS SET TO NONE")') & + CTURBLEN_CLOUD + CTURBLEN_CLOUD='NONE' + END IF + IF( XCEI_MIN > XCEI_MAX ) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT='("PROBLEM OF CEI LIMITS FOR CLOUD MIXING ",/, & + & "LENGTH COMPUTATION: XCEI_MIN=",E9.3,", XCEI_MAX=",E9.3)')& + XCEI_MIN,XCEI_MAX + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF +END IF +! +IF ( LSIGMAS ) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE SIGMA_S FROM TURBULENCE SCHEME",/, & + & " IN ICE SUBGRID CONDENSATION, SO YOUR SIGMA_S"/, & + & " MIGHT BE SMALL ABOVE PBL DEPENDING ON LENGTH SCALE")') +END IF +! +IF (LSUBG_COND .AND. CTURB=='NONE' ) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU WANT TO USE SUBGRID CONDENSATION' + WRITE(UNIT=ILUOUT,FMT=*) ' WITHOUT TURBULENCE ' + WRITE(UNIT=ILUOUT,FMT=*) 'THIS IS NOT ALLOWED: LSUBG_COND is SET to FALSE' + LSUBG_COND=.FALSE. +END IF +! +IF (L1D .AND. CTURB/='NONE' .AND. CTURBDIM == '3DIM') THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU WANT TO USE 3D TURBULENCE IN 1D CONFIGURATION ' + WRITE(UNIT=ILUOUT,FMT=*) 'THIS IS NOT POSSIBLE: CTURBDIM IS SET TO 1DIM' + CTURBDIM = '1DIM' +END IF +! +!* 3.4 Additional scalar variables +! +IF (NSV_USER == KSV_USER) THEN + DO JS = 1,KSV_USER ! to read all the variables in initial file + CGETSVT(JS)='READ' ! and to initialize them +! IF(CCONF=='START')CGETSVT(JS)='INIT' ! with these values + END DO +ELSEIF (NSV_USER > KSV_USER) THEN + IF (KSV_USER == 0) THEN + CGETSVT(1:NSV_USER)='INIT' + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE MORE ADDITIONAL SCALAR " ,& + &" VARIABLES THAN THERE ARE IN INITIAL FMFILE",/, & + & "THE SUPPLEMENTARY VARIABLES HAVE BEEN INITIALIZED TO ZERO ")') + DO JS = 1,KSV_USER ! to read all the variables in initial file + CGETSVT(JS)='READ' ! and to initialize them +! IF(CCONF=='START')CGETSVT(JS)='INIT' ! with these values + END DO + DO JS = KSV_USER+1, NSV_USER ! to initialize to zero supplementary + CGETSVT(JS)='INIT' ! initial file) + END DO + END IF +ELSE + WRITE(UNIT=ILUOUT,FMT=9000) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE LESS ADDITIONAL SCALAR " ,& + &" VARIABLES THAN THERE ARE IN INITIAL FMFILE")') + DO JS = 1,NSV_USER ! to read the first NSV_USER variables in initial file + CGETSVT(JS)='READ' ! and to initialize with these values +! IF(CCONF=='START') CGETSVT(JS)='INIT' + END DO + DO JS = NSV_USER + 1, KSV_USER ! to skip the last (KSV_USER-NSV_USER) variables + CGETSVT(JS)='SKIP' + END DO +END IF +! +! C2R2 and KHKO SV case +! +IF (CCLOUD == 'C2R2' .OR. CCLOUD == 'C3R5' .OR. CCLOUD == 'KHKO') THEN + IF (HCLOUD == 'C2R2' .OR. HCLOUD == 'C3R5' .OR. HCLOUD == 'KHKO') THEN + CGETSVT(NSV_C2R2BEG:NSV_C2R2END)='READ' +! IF(CCONF=='START') CGETSVT(NSV_C2R2BEG:NSV_C2R2END)='INIT' + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO SCALAR VARIABLES FOR C2R2 & + & (or KHKO) SCHEME IN INITIAL FMFILE",/,& + & "THE C2R2 (or KHKO) VARIABLES HAVE BEEN INITIALIZED TO ZERO ")') + CGETSVT(NSV_C2R2BEG:NSV_C2R2END)='INIT' + END IF +END IF +! +! C3R5 SV case +! +IF (CCLOUD == 'C3R5') THEN + IF (HCLOUD == 'C3R5') THEN + CGETSVT(NSV_C1R3BEG:NSV_C1R3END)='READ' +! IF(CCONF=='START') CGETSVT(NSV_C1R3BEG:NSV_C1R3END)='INIT' + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO SCALAR VARIABLES FOR C3R5 & + &SCHEME IN INITIAL FMFILE",/,& + & "THE C1R3 VARIABLES HAVE BEEN INITIALIZED TO ZERO ")') + CGETSVT(NSV_C1R3BEG:NSV_C1R3END)='INIT' + END IF +END IF +! +! LIMA SV case +! +IF (CCLOUD == 'LIMA') THEN + IF (HCLOUD == 'LIMA') THEN + CGETSVT(NSV_LIMA_BEG:NSV_LIMA_END)='READ' +!!JPP IF(HSTORAGE_TYPE=='TT') CGETSVT(NSV_LIMA_BEG:NSV_LIMA_END)='INIT' + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO SCALAR VARIABLES FOR LIMA & + & SCHEME IN INITIAL FMFILE",/,& + & "THE LIMA VARIABLES HAVE BEEN INITIALIZED TO ZERO ")') + CGETSVT(NSV_LIMA_BEG:NSV_LIMA_END)='INIT' + END IF +END IF +! +! Electrical SV case +! +IF (CELEC /= 'NONE') THEN + IF (HELEC /= 'NONE') THEN + CGETSVT(NSV_ELECBEG:NSV_ELECEND)='READ' +! IF(CCONF=='START') CGETSVT(NSV_ELECBEG:NSV_ELECEND)='INIT' + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO SCALAR VARIABLES FOR ELECTRICAL & + &SCHEME IN INITIAL FMFILE",/,& + & "THE ELECTRICAL VARIABLES HAVE BEEN INITIALIZED TO ZERO ")') + CGETSVT(NSV_ELECBEG:NSV_ELECEND)='INIT' + END IF +END IF +! +! (explicit) LINOx SV case +! +IF (CELEC /= 'NONE' .AND. LLNOX_EXPLICIT) THEN + IF (HELEC /= 'NONE' .AND. OLNOX_EXPLICIT) THEN + CGETSVT(NSV_LNOXBEG:NSV_LNOXEND)='READ' + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO SCALAR VARIABLES FOR LINOX & + & IN INITIAL FMFILE",/,& + & "THE LINOX VARIABLES HAVE BEEN INITIALIZED TO ZERO ")') + CGETSVT(NSV_LNOXBEG:NSV_LNOXEND)='INIT' + END IF +END IF +! +! Chemical SV case (excluding aqueous chemical species) +! +IF (LUSECHEM) THEN + IF (OUSECHEM) THEN + CGETSVT(NSV_CHGSBEG:NSV_CHGSEND)='READ' + IF(CCONF=='START' .AND. LCH_INIT_FIELD ) CGETSVT(NSV_CHGSBEG:NSV_CHGSEND)='INIT' + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO SCALAR VARIABLES FOR CHEMICAL & + &SCHEME IN INITIAL FMFILE",/,& + & "THE CHEMICAL VARIABLES HAVE BEEN INITIALIZED TO ZERO ")') + CGETSVT(NSV_CHGSBEG:NSV_CHGSEND)='INIT' + END IF +END IF +! add aqueous chemical species +IF (LUSECHAQ) THEN + IF (OUSECHAQ) THEN + CGETSVT(NSV_CHACBEG:NSV_CHACEND)='READ' +! IF(CCONF=='START') CGETSVT(NSV_CHACBEG:NSV_CHACEND)='INIT' + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO SCALAR VARIABLES FOR CHEMICAL & + &SCHEME IN AQUEOUS PHASE IN INITIAL FMFILE",/,& + & "THE AQUEOUS PHASE CHEMICAL VARIABLES HAVE BEEN INITIALIZED TO ZERO ")') + CGETSVT(NSV_CHACBEG:NSV_CHACEND)='INIT' + END IF +END IF +! add ice phase chemical species +IF (LUSECHIC) THEN + IF (OUSECHIC) THEN + CGETSVT(NSV_CHICBEG:NSV_CHICEND)='READ' +! IF(CCONF=='START') CGETSVT(NSV_CHICBEG:NSV_CHICEND)='INIT' + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO SCALAR VARIABLES FOR CHEMICAL & + &SPECIES IN ICE PHASE IN INITIAL FMFILE",/,& + & "THE ICE PHASE CHEMICAL VARIABLES HAVE BEEN INITIALIZED TO ZERO ")') + CGETSVT(NSV_CHICBEG:NSV_CHICEND)='INIT' + END IF +END IF +! pH values = diagnostics +IF (LCH_PH .AND. .NOT. OCH_PH) THEN + CGETPHC ='INIT' !will be initialized to XCH_PHINIT + IF (LUSERR) THEN + CGETPHR = 'INIT' !idem + ELSE + CGETPHR = 'SKIP' + ENDIF +ELSE + IF (LCH_PH) THEN + CGETPHC ='READ' + IF (LUSERR) THEN + CGETPHR = 'READ' + ELSE + CGETPHR = 'SKIP' + ENDIF + ELSE + CGETPHC ='SKIP' + CGETPHR ='SKIP' + END IF +END IF +! +! Dust case +! +IF (LDUST) THEN + IF (ODUST) THEN + CGETSVT(NSV_DSTBEG:NSV_DSTEND)='READ' +! IF(CCONF=='START') CGETSVT(NSV_DSTBEG:NSV_DSTEND)='INIT' + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO SCALAR VARIABLES FOR DUST & + &SCHEME IN INITIAL FMFILE",/,& + & "THE DUST VARIABLES HAVE BEEN INITIALIZED TO ZERO ")') + CGETSVT(NSV_DSTBEG:NSV_DSTEND)='INIT' + END IF + IF (LDEPOS_DST(KMI)) THEN + + !UPG *PT + IF((CCLOUD /= 'ICE3').AND.(CCLOUD /= 'ICE4').AND.(CCLOUD /= 'KESS')& + .AND.(CCLOUD /= 'KHKO').AND.(CCLOUD /= 'C2R2').AND.(CCLOUD /= 'LIMA').AND. & + (CPROGRAM/='SPAWN').AND.(CPROGRAM/='REAL')) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT='("ERROR: WET DEPOSITION OF DUST IS ONLY CODED FOR THE",/,& + & "MICROPHYSICAL SCHEME as ICE3, ICE4, KESS, KHKO, LIMA and C2R2")') + !UPG *PT + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF + + IF (ODEPOS_DST(KMI) ) THEN + CGETSVT(NSV_DSTDEPBEG:NSV_DSTDEPEND)='READ' +! IF(CCONF=='START') CGETSVT(NSV_DSTDEPBEG:NSV_DSTDEPEND)='INIT' + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO SCALAR VARIABLES FOR RAIN and CLOUD DUST & + & SCHEME IN INITIAL FMFILE",/,& + & "THE MOIST DUST VARIABLES HAVE BEEN INITIALIZED TO ZERO ")') + CGETSVT(NSV_DSTDEPBEG:NSV_DSTDEPEND)='INIT' + END IF + END IF + + IF(NMODE_DST.GT.3 .OR. NMODE_DST.LT.1) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT='("DUST MODES MUST BE BETWEEN 1 and 3 ")') + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF +END IF +! +! Sea Salt case +! +IF (LSALT) THEN + IF (OSALT) THEN + CGETSVT(NSV_SLTBEG:NSV_SLTEND)='READ' + CGETZWS='READ' +! IF(CCONF=='START') CGETSVT(NSV_SLTBEG:NSV_SLTEND)='INIT' + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO SCALAR VARIABLES FOR SALT & + &SCHEME IN INITIAL FMFILE",/,& + & "THE SALT VARIABLES HAVE BEEN INITIALIZED TO ZERO ")') + CGETSVT(NSV_SLTBEG:NSV_SLTEND)='INIT' + CGETZWS='INIT' + END IF + IF (LDEPOS_SLT(KMI)) THEN + + !UPG*PT + IF((CCLOUD /= 'ICE3').AND.(CCLOUD /= 'ICE4').AND.(CCLOUD /= 'KESS')& + !.AND.(CCLOUD /= 'KHKO').AND.(CCLOUD /= 'C2R2').AND. & + .AND.(CCLOUD /= 'KHKO').AND.(CCLOUD /= 'C2R2').AND.(CCLOUD /= 'LIMA').AND. & + (CPROGRAM/='SPAWN').AND.(CPROGRAM/='REAL')) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT='("ERROR: WET DEPOSITION OF SEA SALT AEROSOLS IS ONLY CODED FOR THE",/,& + & "MICROPHYSICAL SCHEME as ICE3, ICE4, KESS, KHKO, LIMA and C2R2")') + !UPG*PT + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF + + IF (ODEPOS_SLT(KMI) ) THEN + CGETSVT(NSV_SLTDEPBEG:NSV_SLTDEPEND)='READ' +! IF(CCONF=='START') CGETSVT(NSV_SLTDEPBEG:NSV_SLTDEPEND)='INIT' + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO SCALAR VARIABLES FOR RAIN and CLOUD SEA SALT & + & SCHEME IN INITIAL FMFILE",/,& + & "THE MOIST SEA SALT VARIABLES HAVE BEEN INITIALIZED TO ZERO ")') + CGETSVT(NSV_SLTDEPBEG:NSV_SLTDEPEND)='INIT' + END IF + END IF + IF(NMODE_SLT.GT.8 .OR. NMODE_SLT.LT.1) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT='("SALT MODES MUST BE BETWEEN 1 and 8 ")') + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF +END IF +! +! Orilam SV case +! +IF (LORILAM) THEN + IF (OORILAM) THEN + CGETSVT(NSV_AERBEG:NSV_AEREND)='READ' +! IF(CCONF=='START') CGETSVT(NSV_AERBEG:NSV_AEREND)='INIT' + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO SCALAR VARIABLES FOR AEROSOL & + &SCHEME IN INITIAL FMFILE",/,& + & "THE AEROSOLS VARIABLES HAVE BEEN INITIALIZED TO ZERO ")') + CGETSVT(NSV_AERBEG:NSV_AEREND)='INIT' + END IF + IF (LDEPOS_AER(KMI)) THEN + + !UPG*PT + IF((CCLOUD /= 'ICE3').AND.(CCLOUD /= 'ICE4').AND.(CCLOUD /= 'KESS')& + .AND.(CCLOUD /= 'KHKO').AND.(CCLOUD /= 'C2R2').AND.(CCLOUD /= 'LIMA').AND. & + !.AND.(CCLOUD /= 'KHKO').AND.(CCLOUD /= 'C2R2').AND. & + (CPROGRAM/='SPAWN').AND.(CPROGRAM/='REAL')) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT='("ERROR: WET DEPOSITION OF ORILAM AEROSOLS IS ONLY CODED FOR THE",/,& + & "MICROPHYSICAL SCHEME as ICE3, ICE4, KESS, KHKO, LIMA and C2R2")') + !UPG*PT + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF + + IF (ODEPOS_AER(KMI) ) THEN + CGETSVT(NSV_AERDEPBEG:NSV_AERDEPEND)='READ' +! IF(CCONF=='START') CGETSVT(NSV_AERDEPBEG:NSV_AERDEPEND)='INIT' + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO SCALAR VARIABLES FOR RAIN and IN CLOUD & + & AEROSOL SCHEME IN INITIAL FMFILE",/,& + & "THE MOIST AEROSOL VARIABLES HAVE BEEN INITIALIZED TO ZERO ")') + CGETSVT(NSV_AERDEPBEG:NSV_AERDEPEND)='INIT' + END IF + END IF +END IF +! +! Lagrangian variables +! +IF (LINIT_LG .AND. .NOT.(LLG)) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("IT IS INCOHERENT TO HAVE LINIT_LG=.T. AND LLG=.F.",/,& + & "IF YOU WANT LAGRANGIAN TRACERS CHANGE LLG TO .T. ")') +ENDIF +IF (LLG) THEN + IF (OLG .AND. .NOT.(LINIT_LG .AND. CPROGRAM=='MESONH')) THEN + CGETSVT(NSV_LGBEG:NSV_LGEND)='READ' +! IF(CCONF=='START') CGETSVT(NSV_LGBEG:NSV_LGEND)='INIT' + ELSE + IF(.NOT.(LINIT_LG) .AND. CPROGRAM=='MESONH') THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO LAGRANGIAN VARIABLES IN INITIAL FMFILE",/,& + & "THE LAGRANGIAN VARIABLES HAVE BEEN REINITIALIZED")') + LINIT_LG=.TRUE. + ENDIF + CGETSVT(NSV_LGBEG:NSV_LGEND)='INIT' + END IF +END IF +! +! +! LINOx SV case +! +IF (.NOT.LUSECHEM .AND. LCH_CONV_LINOX) THEN + IF (.NOT.OUSECHEM .AND. OCH_CONV_LINOX) THEN + CGETSVT(NSV_LNOXBEG:NSV_LNOXEND)='READ' + ELSE + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO SCALAR VARIABLES FOR LINOX & + &IN INITIAL FMFILE",/,& + & "THE LINOX VARIABLES HAVE BEEN INITIALIZED TO ZERO ")') + CGETSVT(NSV_LNOXBEG:NSV_LNOXEND)='INIT' + END IF +END IF +! +! Passive pollutant case +! +IF (LPASPOL) THEN + IF (OPASPOL) THEN + CGETSVT(NSV_PPBEG:NSV_PPEND)='READ' +! IF(CCONF=='START') CGETSVT(NSV_PPBEG:NSV_PPEND)='INIT' + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO PASSIVE SCALAR VARIABLES IN INITIAL FMFILE",/,& + & "THE VARIABLES HAVE BEEN INITIALIZED TO ZERO")') + CGETSVT(NSV_PPBEG:NSV_PPEND)='INIT' + END IF +END IF +! +#ifdef MNH_FOREFIRE +! ForeFire +! +IF (LFOREFIRE) THEN + IF (OFOREFIRE) THEN + CGETSVT(NSV_FFBEG:NSV_FFEND)='READ' + IF(HSTORAGE_TYPE=='TT') THEN + CGETSVT(NSV_FFBEG:NSV_FFEND)='INIT' + END IF + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO FOREFIRE SCALAR VARIABLES IN INITIAL FMFILE",/,& + & "THE VARIABLES HAVE BEEN INITIALIZED TO ZERO")') + CGETSVT(NSV_FFBEG:NSV_FFEND)='INIT' + END IF +END IF +#endif +! Blaze smoke +! +IF (LBLAZE) THEN + IF (OFIRE) THEN + CGETSVT(NSV_FIREBEG:NSV_FIREEND)='READ' + IF(HSTORAGE_TYPE=='TT') THEN + CGETSVT(NSV_FIREBEG:NSV_FIREEND)='INIT' + END IF + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO BLAZE SCALAR VARIABLES IN INITIAL FMFILE",/,& + & "THE VARIABLES HAVE BEEN INITIALIZED TO ZERO")') + CGETSVT(NSV_FIREBEG:NSV_FIREEND)='INIT' + END IF +END IF +! +! Conditional sampling case +! +IF (LCONDSAMP) THEN + IF (OCONDSAMP) THEN + CGETSVT(NSV_CSBEG:NSV_CSEND)='READ' +! IF(CCONF=='START') CGETSVT(NSV_CSBEG:NSV_CSEND)='INIT' + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO PASSIVE SCALAR VARIABLES IN INITIAL FMFILE",/,& + & "THE VARIABLES HAVE BEEN INITIALIZED TO ZERO")') + CGETSVT(NSV_CSBEG:NSV_CSEND)='INIT' + END IF +END IF +! +! Blowing snow scheme +! +IF (LBLOWSNOW) THEN + IF (OBLOWSNOW) THEN + CGETSVT(NSV_SNWBEG:NSV_SNWEND)='READ' + ELSE + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='("THERE IS NO SCALAR VARIABLES FOR BLOWING SNOW & + &SCHEME IN INITIAL FMFILE",/,& + & "THE BLOWING SNOW VARIABLES HAVE BEEN INITIALIZED TO ZERO ")') + CGETSVT(NSV_SNWBEG:NSV_SNWEND)='INIT' + END IF +END IF +! +! +! +!* 3.5 Check coherence between the radiation control parameters +! +IF( CRAD == 'ECMW' .AND. CPROGRAM=='MESONH' ) THEN + IF(CLW == 'RRTM' .AND. COPILW == 'SMSH') THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'the SMSH parametrisation of LW optical properties for cloud ice' + WRITE(UNIT=ILUOUT,FMT=*) '(COPILW) can not be used with RRTM radiation scheme' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + ENDIF + IF(CLW == 'MORC' .AND. COPWLW == 'LILI') THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'the LILI parametrisation of LW optical properties for cloud water' + WRITE(UNIT=ILUOUT,FMT=*) '(COPWLW) can not be used with MORC radiation scheme' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + ENDIF + IF( .NOT. LSUBG_COND) THEN + WRITE(UNIT=ILUOUT,FMT=9000) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU DO NOT WANT TO USE SUBGRID CONDENSATION' + WRITE(UNIT=ILUOUT,FMT=*) 'THE OVERLAP OPTION IS NOVLP=5 IN ini_radconf.f90' + ELSE IF (CLW == 'MORC') THEN + WRITE(UNIT=ILUOUT,FMT=9000) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU WANT TO USE MORCRETTE LW SCHEME' + WRITE(UNIT=ILUOUT,FMT=*) 'THE OVERLAP OPTION IS NOVLP=5 IN ini_radconf.f90' + ELSE + WRITE(UNIT=ILUOUT,FMT=9000) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'THE OVERLAP OPTION IS NOVLP=6 IN ini_radconf.f90' + ENDIF +! + IF( LCLEAR_SKY .AND. XDTRAD_CLONLY /= XDTRAD) THEN + ! Check the validity of the LCLEAR_SKY approximation + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU WANT TO USE BOTH THE CLEAR-SKY APPROXIMATION' + WRITE(UNIT=ILUOUT,FMT=*) '(i.e. AVERAGE THE WHOLE CLOUDFREE VERTICALS BUT KEEP' + WRITE(UNIT=ILUOUT,FMT=*) 'ALL THE CLOUDY VERTICALS) AND' + WRITE(UNIT=ILUOUT,FMT=*) 'THE CLOUD-ONLY APPROXIMATION (i.e. YOU CALL MORE OFTEN THE' + WRITE(UNIT=ILUOUT,FMT=*) 'RADIATIONS FOR THE CLOUDY VERTICALS THAN FOR CLOUDFREE ONES).' + WRITE(UNIT=ILUOUT,FMT=*) 'THIS IS NOT POSSIBLE, SO CHOOSE BETWEEN :' + WRITE(UNIT=ILUOUT,FMT=*) 'XDTRAD_CLONLY = XDTRAD and LCLEAR_SKY = FALSE' +! + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF +! + IF( XDTRAD_CLONLY > XDTRAD ) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT='("BAD USE OF THE CLOUD-ONLY APPROXIMATION " ,& + &" XDTRAD SHOULD BE LARGER THAN XDTRAD_CLONLY ")') +! + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF +! + IF(( XDTRAD < XTSTEP ).OR. ( XDTRAD_CLONLY < XTSTEP )) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT='("THE RADIATION CALL XDTRAD OR XDTRAD_CLONLY " ,& + &" IS MORE FREQUENT THAN THE TIME STEP SO ADJUST XDTRAD OR XDTRAD_CLONLY ")') +! + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF +END IF +! +IF ( CRAD /= 'NONE' .AND. CPROGRAM=='MESONH' ) THEN + CGETRAD='READ' + IF( HRAD == 'NONE' .AND. CCONF=='RESTA') THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'YOU ARE PERFORMING A RESTART. FOR THIS SEGMENT, YOU ARE USING A RADIATION' + WRITE(UNIT=ILUOUT,FMT=*) 'SCHEME AND NO RADIATION SCHEME WAS USED FOR THE PREVIOUS SEGMENT.' + CGETRAD='INIT' + END IF + IF(CCONF=='START') THEN + CGETRAD='INIT' + END IF + IF(CCONF=='RESTA' .AND. (.NOT. LAERO_FT) .AND. (.NOT. LORILAM) & + .AND. (.NOT. LSALT) .AND. (.NOT. LDUST)) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT=*) '!!! WARNING !!! FOR REPRODUCTIBILITY BETWEEN START and START+RESTART,' + WRITE(UNIT=ILUOUT,FMT=*) 'YOU MUST USE LAERO_FT=T WITH CAER=TEGE IF CCONF=RESTA IN ALL SEGMENTS' + WRITE(UNIT=ILUOUT,FMT=*) 'TO UPDATE THE OZONE AND AEROSOLS CLIMATOLOGY USED BY THE RADIATION CODE;' + END IF +END IF +! +! 3.6 check the initialization of the deep convection scheme +! +IF ( (CDCONV /= 'KAFR') .AND. & + (CSCONV /= 'KAFR') .AND. LCHTRANS ) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE THE LCHTRANS OPTION= ",& + &"CONVECTIVE TRANSPORT OF TRACERS BUT IT CAN ONLY",& + &"BE USED FOR THE KAIN FRITSCH SCHEME ")') + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') +END IF +! +SELECT CASE ( CDCONV ) + CASE( 'KAFR' ) + IF (.NOT. ( LUSERV ) ) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE THE KAIN-FRITSCH DEEP CONV. ",& + &" SCHEME. YOU MUST HAVE VAPOR ",/,"LUSERV IS SET TO TRUE ")') + LUSERV=.TRUE. + ELSE IF (.NOT. ( LUSERI ) ) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE THE KAIN-FRITSCH",& + &" DEEP CONV. SCHEME. BUT THE DETRAINED CLOUD ICE WILL BE ADDED TO ",& + &" THE CLOUD WATER ")') + ELSE IF (.NOT. ( LUSERI.AND.LUSERC ) ) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE THE KAIN-FRITSCH",& + &" DEEP CONV. SCHEME. BUT THE DETRAINED CLOUD WATER AND CLOUD ICE ",& + &" WILL BE ADDED TO THE WATER VAPOR FIELD ")') + END IF + IF ( LCHTRANS .AND. NSV == 0 ) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE THE LCHTRANS OPTION= ",& + &"CONVECTIVE TRANSPORT OF TRACERS BUT YOUR TRACER ",& + &"NUMBER NSV IS ZERO ",/,"LCHTRANS IS SET TO FALSE")') + LCHTRANS=.FALSE. + END IF +END SELECT +! +IF ( CDCONV == 'KAFR' .AND. LCHTRANS .AND. NSV > 0 ) THEN + IF( OCHTRANS ) THEN + CGETSVCONV='READ' + ELSE + CGETSVCONV='INIT' + END IF +END IF +! +SELECT CASE ( CSCONV ) + CASE( 'KAFR' ) + IF (.NOT. ( LUSERV ) ) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE THE KAIN-FRITSCH SHALLOW CONV. ",& + &" SCHEME. YOU MUST HAVE VAPOR ",/,"LUSERV IS SET TO TRUE ")') + LUSERV=.TRUE. + ELSE IF (.NOT. ( LUSERI ) ) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE THE KAIN-FRITSCH",& + &" SHALLOW CONV. SCHEME. BUT THE DETRAINED CLOUD ICE WILL BE ADDED TO ",& + &" THE CLOUD WATER ")') + ELSE IF (.NOT. ( LUSERI.AND.LUSERC ) ) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE THE KAIN-FRITSCH",& + &" SHALLOW CONV. SCHEME. BUT THE DETRAINED CLOUD WATER AND CLOUD ICE ",& + &" WILL BE ADDED TO THE WATER VAPOR FIELD ")') + END IF + IF ( LCHTRANS .AND. NSV == 0 ) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE THE LCHTRANS OPTION= ",& + &"CONVECTIVE TRANSPORT OF TRACERS BUT YOUR TRACER ",& + &"NUMBER NSV IS ZERO ",/,"LCHTRANS IS SET TO FALSE")') + LCHTRANS=.FALSE. + END IF + CASE( 'EDKF' ) + IF (CTURB == 'NONE' ) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE THE EDKF ", & + &"SHALLOW CONVECTION WITHOUT TURBULENCE SCHEME : ", & + &"IT IS NOT POSSIBLE")') +! + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF +END SELECT +! +! +CGETCONV = 'SKIP' +! +IF ( (CDCONV /= 'NONE' .OR. CSCONV == 'KAFR' ) .AND. CPROGRAM=='MESONH') THEN + CGETCONV = 'READ' + IF( HDCONV == 'NONE' .AND. CCONF=='RESTA') THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(UNIT=ILUOUT,FMT='(" YOU ARE PERFORMING A RESTART. FOR THIS ",& + &" SEGMENT, YOU ARE USING A DEEP CONVECTION SCHEME AND NO DEEP ",& + &" CONVECTION SCHEME WAS USED FOR THE PREVIOUS SEGMENT. ")') +! + CGETCONV = 'INIT' + END IF + IF(CCONF=='START') THEN + CGETCONV = 'INIT' + END IF +END IF +! +!* 3.7 configuration and model version +! +IF (KMI == 1) THEN +! + IF (L1D.AND.(CLBCX(1)/='CYCL'.AND.CLBCX(2)/='CYCL' & + .AND.CLBCY(1)/='CYCL'.AND.CLBCY(2)/='CYCL')) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE A 1D MODEL VERSION WITH NON-CYCL",& + & "CLBCX OR CLBCY VALUES")') + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF + IF (L2D.AND.(CLBCY(1)/='CYCL'.AND.CLBCY(2)/='CYCL')) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE A 2D MODEL VERSION WITH NON-CYCL",& + & " CLBCY VALUES")') + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF + ! + IF ( (.NOT. LCARTESIAN) .AND. ( LCORIO) .AND. (.NOT. LGEOST_UV_FRC) ) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='("BE CAREFUL YOU COULD HAVE SPURIOUS MOTIONS " ,& + & " NEAR THE LBC AS LCORIO=T and LGEOST_UV_FRC=F")') + END IF + ! + IF ((.NOT.LFLAT).AND.OFLAT) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT=*) 'ZERO OROGRAPHY IN INITIAL FILE' + WRITE(UNIT=ILUOUT,FMT=*) '***** ALL TERMS HAVE BEEN NEVERTHELESS COMPUTED WITHOUT SIMPLIFICATION*****' + WRITE(UNIT=ILUOUT,FMT=*) 'THIS SHOULD LEAD TO ERRORS IN THE PRESSURE COMPUTATION' + END IF + IF (LFLAT.AND.(.NOT.OFLAT)) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='(" OROGRAPHY IS NOT EQUAL TO ZERO ", & + & "IN INITIAL FILE" ,/, & + & "******* OROGRAPHY HAS BEEN SET TO ZERO *********",/, & + & "ACCORDING TO ZERO OROGRAPHY, SIMPLIFICATIONS HAVE ", & + & "BEEN MADE IN COMPUTATIONS")') + END IF +END IF +! +!* 3.8 System of equations +! +IF ( HEQNSYS /= CEQNSYS ) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(ILUOUT,FMT=*) 'YOU HAVE CHANGED THE SYSTEM OF EQUATIONS' + WRITE(ILUOUT,FMT=*) 'THE ANELASTIC CONSTRAINT IS PERHAPS CHANGED :' + WRITE(ILUOUT,FMT=*) 'FOR THE INITIAL FILE YOU HAVE USED ',HEQNSYS + WRITE(ILUOUT,FMT=*) 'FOR THE RUN YOU PLAN TO USE ',CEQNSYS + WRITE(ILUOUT,FMT=*) 'THIS CAN LEAD TO A NUMERICAL EXPLOSION IN THE FIRST TIME STEPS' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') +END IF +! +! 3.9 Numerical schemes +! +IF ( (CUVW_ADV_SCHEME == 'CEN4TH') .AND. & + (CTEMP_SCHEME /= 'LEFR') .AND. (CTEMP_SCHEME /= 'RKC4') ) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT='("CEN4TH SCHEME HAS TO BE USED WITH ",& + &"CTEMP_SCHEME = LEFR of RKC4 ONLY")') + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') +END IF +! +IF ( (CUVW_ADV_SCHEME == 'WENO_K') .AND. LNUMDIFU ) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='("YOU WANT TO USE NUMERICAL DIFFUSION ",& + &"WITH WENO SCHEME ALREADY DIFFUSIVE")') +END IF +!------------------------------------------------------------------------------- +! +!* 4. CHECK COHERENCE BETWEEN EXSEG VARIABLES +! --------------------------------------- +! +!* 4.1 coherence between coupling variables in EXSEG file +! +IF (KMI == 1) THEN + NCPL_NBR = 0 + DO JCI = 1,JPCPLFILEMAX + IF (LEN_TRIM(CCPLFILE(JCI)) /= 0) THEN ! Finds the number + NCPL_NBR = NCPL_NBR + 1 ! of coupling files + ENDIF + IF (JCI/=JPCPLFILEMAX) THEN ! Deplaces the coupling files + IF ((LEN_TRIM(CCPLFILE(JCI)) == 0) .AND. &! names if one missing + (LEN_TRIM(CCPLFILE(JCI+1)) /= 0)) THEN + DO JI=JCI,JPCPLFILEMAX-1 + CCPLFILE(JI)=CCPLFILE(JI+1) + END DO + CCPLFILE(JPCPLFILEMAX)=' ' + END IF + END IF + END DO +! + IF (NCPL_NBR /= 0) THEN + LSTEADYLS = .FALSE. + ELSE + LSTEADYLS = .TRUE. + ENDIF +END IF +! +!* 4.3 check consistency in forcing switches +! +IF ( LFORCING ) THEN + IF ( LRELAX_THRV_FRC .AND. ( LTEND_THRV_FRC .OR. LGEOST_TH_FRC ) ) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU CHOSE A TEMPERATURE AND HUMIDITY RELAXATION' + WRITE(ILUOUT,FMT=*) 'TOGETHER WITH TENDENCY OR GEOSTROPHIC FORCING' + WRITE(ILUOUT,FMT=*) & + 'YOU MIGHT CHECK YOUR SWITCHES: LRELAX_THRV_FRC, LTEND_THRV_FRC, AND' + WRITE(ILUOUT,FMT=*) 'LGEOST_TH_FRC' + END IF +! + IF ( LRELAX_UV_FRC .AND. LRELAX_UVMEAN_FRC) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(ILUOUT,FMT=*) 'YOU MUST CHOOSE BETWEEN A RELAXATION APPLIED TO' + WRITE(ILUOUT,FMT=*) 'THE 3D FULL WIND FIELD (LRELAX_UV_FRC) OR' + WRITE(ILUOUT,FMT=*) 'THE HORIZONTAL MEAN WIND (LRELAX_UVMEAN_FRC)' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF +! + IF ( (LRELAX_UV_FRC .OR. LRELAX_UVMEAN_FRC) .AND. LGEOST_UV_FRC ) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(ILUOUT,FMT=*) 'YOU MUST NOT USE A WIND RELAXATION' + WRITE(ILUOUT,FMT=*) 'TOGETHER WITH A GEOSTROPHIC FORCING' + WRITE(ILUOUT,FMT=*) 'CHECK SWITCHES: LRELAX_UV_FRC, LRELAX_UVMEAN_FRC, LGEOST_UV_FRC' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF +! + IF ( CRELAX_HEIGHT_TYPE.NE."FIXE" .AND. CRELAX_HEIGHT_TYPE.NE."THGR" ) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(ILUOUT,FMT=*) 'CRELAX_HEIGHT_TYPE MUST BE EITHER "FIXE" OR "THGR"' + WRITE(ILUOUT,FMT=*) 'BUT IT IS "', CRELAX_HEIGHT_TYPE, '"' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF +! + IF ( .NOT.LCORIO .AND. LGEOST_UV_FRC ) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(ILUOUT,FMT=*) 'YOU CANNOT HAVE A GEOSTROPHIC FORCING WITHOUT' + WRITE(ILUOUT,FMT=*) 'ACTIVATING LCORIOLIS OPTION' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF +! + IF ( LPGROUND_FRC ) THEN + WRITE(ILUOUT,FMT=*) 'SURFACE PRESSURE FORCING NOT YET IMPLEMENTED' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF +! +END IF +! +IF (LTRANS .AND. .NOT. LFLAT ) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(ILUOUT,FMT=*) 'YOU ASK FOR A CONSTANT SPEED DOMAIN TRANSLATION ' + WRITE(ILUOUT,FMT=*) 'BUT NOT IN THE FLAT TERRAIN CASE:' + WRITE(ILUOUT,FMT=*) 'THIS IS NOT ALLOWED ACTUALLY' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') +END IF +! +!* 4.4 Check the coherence between the LUSERn and LHORELAX +! +IF (.NOT. LUSERV .AND. LHORELAX_RV) THEN + LHORELAX_RV=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX RV FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_RV=FALSE' +END IF +! +IF (.NOT. LUSERC .AND. LHORELAX_RC) THEN + LHORELAX_RC=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX RC FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_RC=FALSE' +END IF +! +IF (.NOT. LUSERR .AND. LHORELAX_RR) THEN + LHORELAX_RR=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX RR FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_RR=FALSE' +END IF +! +IF (.NOT. LUSERI .AND. LHORELAX_RI) THEN + LHORELAX_RI=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX RI FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_RI=FALSE' +END IF +! +IF (.NOT. LUSERS .AND. LHORELAX_RS) THEN + LHORELAX_RS=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX RS FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_RS=FALSE' +END IF +! +IF (.NOT. LUSERG .AND. LHORELAX_RG) THEN + LHORELAX_RG=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX RG FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_RG=FALSE' +END IF +! +IF (.NOT. LUSERH .AND. LHORELAX_RH) THEN + LHORELAX_RH=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX RH FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_RH=FALSE' +END IF +! +IF (CTURB=='NONE' .AND. LHORELAX_TKE) THEN + LHORELAX_TKE=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX TKE FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_TKE=FALSE' +END IF +! +! +IF (CCLOUD/='C2R2' .AND. CCLOUD/='KHKO' .AND. LHORELAX_SVC2R2) THEN + LHORELAX_SVC2R2=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX C2R2 or KHKO FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_SVC2R2=FALSE' +END IF +! +IF (CCLOUD/='C3R5' .AND. LHORELAX_SVC1R3) THEN + LHORELAX_SVC1R3=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX C3R5 FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_SVC1R3=FALSE' +END IF +! +IF (CCLOUD/='LIMA' .AND. LHORELAX_SVLIMA) THEN + LHORELAX_SVLIMA=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX LIMA FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_SVLIMA=FALSE' +END IF +! +IF (CELEC(1:3) /= 'ELE' .AND. LHORELAX_SVELEC) THEN + LHORELAX_SVELEC=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX ELEC FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_SVELEC=FALSE' +END IF +! +IF (.NOT. LUSECHEM .AND. LHORELAX_SVCHEM) THEN + LHORELAX_SVCHEM=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX CHEM FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_SVCHEM=FALSE' +END IF +! +IF (.NOT. LUSECHIC .AND. LHORELAX_SVCHIC) THEN + LHORELAX_SVCHIC=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX ICE CHEM FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_SVCHIC=FALSE' +END IF +! +IF (.NOT. LORILAM .AND. LHORELAX_SVAER) THEN + LHORELAX_SVAER=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX AEROSOL FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_SVAER=FALSE' +END IF + +IF (.NOT. LDUST .AND. LHORELAX_SVDST) THEN + LHORELAX_SVDST=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX DUST FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_SVDST=FALSE' +END IF + +IF (.NOT. LSALT .AND. LHORELAX_SVSLT) THEN + LHORELAX_SVSLT=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX SEA SALT FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_SVSLT=FALSE' +END IF + +IF (.NOT. LPASPOL .AND. LHORELAX_SVPP) THEN + LHORELAX_SVPP=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX PASSIVE POLLUTANT FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_SVPP=FALSE' +END IF +#ifdef MNH_FOREFIRE +IF (.NOT. LFOREFIRE .AND. LHORELAX_SVFF) THEN + LHORELAX_SVFF=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX FOREFIRE FLUXES BUT THEY DO NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_SVFF=FALSE' +END IF +#endif +IF (.NOT. LBLAZE .AND. LHORELAX_SVFIRE) THEN + LHORELAX_SVFIRE=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX BLAZE FLUXES BUT THEY DO NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_SVFIRE=FALSE' +END IF +IF (.NOT. LCONDSAMP .AND. LHORELAX_SVCS) THEN + LHORELAX_SVCS=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX CONDITIONAL SAMPLING FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_SVCS=FALSE' +END IF + +IF (.NOT. LBLOWSNOW .AND. LHORELAX_SVSNW) THEN + LHORELAX_SVSNW=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX BLOWING SNOW FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_SVSNW=FALSE' +END IF + +IF (ANY(LHORELAX_SV(NSV+1:))) THEN + LHORELAX_SV(NSV+1:)=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX SV(NSV+1:) FIELD BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_SV(NSV+1:)=FALSE' +END IF +! +!* 4.5 check the number of points for the horizontal relaxation +! +IF ( NRIMX > KRIMX .AND. .NOT.LHORELAX_SVELEC ) THEN + NRIMX = KRIMX + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO USE A LARGER NUMBER OF POINTS ' + WRITE(ILUOUT,FMT=*) 'FOR THE HORIZONTAL RELAXATION THAN THE ' + WRITE(ILUOUT,FMT=*) 'CORRESPONDING NUMBER OF LARGE SCALE FIELDS:' + WRITE(ILUOUT,FMT=*) 'IT IS THEREFORE REDUCED TO NRIMX =',NRIMX +END IF +! +IF ( L2D .AND. KRIMY>0 ) THEN + NRIMY = 0 + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO USE A 2D MODEL THEREFORE NRIMY=0 ' +END IF +! +IF ( NRIMY > KRIMY .AND. .NOT.LHORELAX_SVELEC ) THEN + NRIMY = KRIMY + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO USE A LARGER NUMBER OF POINTS ' + WRITE(ILUOUT,FMT=*) 'FOR THE HORIZONTAL RELAXATION THAN THE ' + WRITE(ILUOUT,FMT=*) 'CORRESPONDING NUMBER OF LARGE SCALE FIELDS:' + WRITE(ILUOUT,FMT=*) 'IT IS THEREFORE REDUCED TO NRIMY =',NRIMY +END IF +! +IF ( (.NOT. LHORELAX_UVWTH) .AND. (.NOT.(ANY(LHORELAX_SV))) .AND. & + (.NOT. LHORELAX_SVC2R2).AND. (.NOT. LHORELAX_SVC1R3) .AND. & + (.NOT. LHORELAX_SVLIMA).AND. & + (.NOT. LHORELAX_SVELEC).AND. (.NOT. LHORELAX_SVCHEM) .AND. & + (.NOT. LHORELAX_SVLG) .AND. (.NOT. LHORELAX_SVPP) .AND. & + (.NOT. LHORELAX_SVCS) .AND. (.NOT. LHORELAX_SVFIRE) .AND. & +#ifdef MNH_FOREFIRE + (.NOT. LHORELAX_SVFF) .AND. & +#endif + (.NOT. LHORELAX_RV) .AND. (.NOT. LHORELAX_RC) .AND. & + (.NOT. LHORELAX_RR) .AND. (.NOT. LHORELAX_RI) .AND. & + (.NOT. LHORELAX_RS) .AND. (.NOT. LHORELAX_RG) .AND. & + (.NOT. LHORELAX_RH) .AND. (.NOT. LHORELAX_TKE) .AND. & + (.NOT. LHORELAX_SVCHIC).AND. & + (NRIMX /= 0 .OR. NRIMY /= 0)) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(ILUOUT,FMT=*) 'YOU DO NOT WANT TO USE THE HORIZONTAL RELAXATION ' + WRITE(ILUOUT,FMT=*) 'THEREFORE NRIMX=NRIMY=0 ' + NRIMX=0 + NRIMY=0 +END IF +! +IF ((LHORELAX_UVWTH .OR. LHORELAX_SVPP .OR. & + LHORELAX_SVCS .OR. LHORELAX_SVFIRE .OR. & +#ifdef MNH_FOREFIRE + LHORELAX_SVFF .OR. & +#endif + LHORELAX_SVC2R2 .OR. LHORELAX_SVC1R3 .OR. & + LHORELAX_SVLIMA .OR. & + LHORELAX_SVELEC .OR. LHORELAX_SVCHEM .OR. & + LHORELAX_SVLG .OR. ANY(LHORELAX_SV) .OR. & + LHORELAX_RV .OR. LHORELAX_RC .OR. & + LHORELAX_RR .OR. LHORELAX_RI .OR. & + LHORELAX_RG .OR. LHORELAX_RS .OR. & + LHORELAX_RH .OR. LHORELAX_TKE.OR. & + LHORELAX_SVCHIC ) & + .AND. (NRIMX==0 .OR. (NRIMY==0 .AND. .NOT.(L2D) ))) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO USE THE HORIZONTAL RELAXATION ' + WRITE(ILUOUT,FMT=*) 'BUT NRIMX OR NRIMY=0 CHANGE YOUR VALUES ' + WRITE(ILUOUT,FMT=*) "LHORELAX_UVWTH=",LHORELAX_UVWTH + WRITE(ILUOUT,FMT=*) "LHORELAX_SVC2R2=",LHORELAX_SVC2R2 + WRITE(ILUOUT,FMT=*) "LHORELAX_SVC1R3=",LHORELAX_SVC1R3 + WRITE(ILUOUT,FMT=*) "LHORELAX_SVLIMA=",LHORELAX_SVLIMA + WRITE(ILUOUT,FMT=*) "LHORELAX_SVELEC=",LHORELAX_SVELEC + WRITE(ILUOUT,FMT=*) "LHORELAX_SVCHEM=",LHORELAX_SVCHEM + WRITE(ILUOUT,FMT=*) "LHORELAX_SVCHIC=",LHORELAX_SVCHIC + WRITE(ILUOUT,FMT=*) "LHORELAX_SVLG=",LHORELAX_SVLG + WRITE(ILUOUT,FMT=*) "LHORELAX_SVPP=",LHORELAX_SVPP + WRITE(ILUOUT,FMT=*) "LHORELAX_SVFIRE=",LHORELAX_SVFIRE +#ifdef MNH_FOREFIRE + WRITE(ILUOUT,FMT=*) "LHORELAX_SVFF=",LHORELAX_SVFF +#endif + WRITE(ILUOUT,FMT=*) "LHORELAX_SVCS=",LHORELAX_SVCS + WRITE(ILUOUT,FMT=*) "LHORELAX_SV=",LHORELAX_SV + WRITE(ILUOUT,FMT=*) "LHORELAX_RV=",LHORELAX_RV + WRITE(ILUOUT,FMT=*) "LHORELAX_RC=",LHORELAX_RC + WRITE(ILUOUT,FMT=*) "LHORELAX_RR=",LHORELAX_RR + WRITE(ILUOUT,FMT=*) "LHORELAX_RI=",LHORELAX_RI + WRITE(ILUOUT,FMT=*) "LHORELAX_RG=",LHORELAX_RG + WRITE(ILUOUT,FMT=*) "LHORELAX_RS=",LHORELAX_RS + WRITE(ILUOUT,FMT=*) "LHORELAX_RH=",LHORELAX_RH + WRITE(ILUOUT,FMT=*) "LHORELAX_TKE=", LHORELAX_TKE + WRITE(ILUOUT,FMT=*) "NRIMX=",NRIMX + WRITE(ILUOUT,FMT=*) "NRIMY=",NRIMY + WRITE(ILUOUT,FMT=*) "L2D=",L2D + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') +END IF +! +IF ((LHORELAX_UVWTH .OR. LHORELAX_SVPP .OR. & + LHORELAX_SVCS .OR. LHORELAX_SVFIRE .OR. & +#ifdef MNH_FOREFIRE + LHORELAX_SVFF .OR. & +#endif + LHORELAX_SVC2R2 .OR. LHORELAX_SVC1R3 .OR. & + LHORELAX_SVLIMA .OR. & + LHORELAX_SVELEC .OR. LHORELAX_SVCHEM .OR. & + LHORELAX_SVLG .OR. ANY(LHORELAX_SV) .OR. & + LHORELAX_RV .OR. LHORELAX_RC .OR. & + LHORELAX_RR .OR. LHORELAX_RI .OR. & + LHORELAX_RG .OR. LHORELAX_RS .OR. & + LHORELAX_RH .OR. LHORELAX_TKE.OR. & + LHORELAX_SVCHIC ) & + .AND. (KMI /=1)) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO USE THE HORIZONTAL RELAXATION ' + WRITE(ILUOUT,FMT=*) 'FOR A NESTED MODEL BUT THE COUPLING IS ALREADY DONE' + WRITE(ILUOUT,FMT=*) 'BY THE GRID NESTING. CHANGE LHORELAX TO FALSE' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') +END IF +! +IF ((LHORELAX_UVWTH .OR. LHORELAX_SVPP .OR. & + LHORELAX_SVCS .OR. LHORELAX_SVFIRE .OR. & +#ifdef MNH_FOREFIRE + LHORELAX_SVFF .OR. & +#endif + LHORELAX_SVC2R2 .OR. LHORELAX_SVC1R3 .OR. & + LHORELAX_SVLIMA .OR. & + LHORELAX_SVELEC .OR. LHORELAX_SVCHEM .OR. & + LHORELAX_SVLG .OR. ANY(LHORELAX_SV) .OR. & + LHORELAX_RV .OR. LHORELAX_RC .OR. & + LHORELAX_RR .OR. LHORELAX_RI .OR. & + LHORELAX_RG .OR. LHORELAX_RS .OR. & + LHORELAX_RH .OR. LHORELAX_TKE.OR. & + LHORELAX_SVCHIC ) & + .AND. (CLBCX(1)=='CYCL'.OR.CLBCX(2)=='CYCL' & + .OR.CLBCY(1)=='CYCL'.OR.CLBCY(2)=='CYCL')) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO USE THE HORIZONTAL RELAXATION ' + WRITE(ILUOUT,FMT=*) 'FOR CYCLIC CLBCX OR CLBCY VALUES' + WRITE(ILUOUT,FMT=*) 'CHANGE LHORELAX TO FALSE' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') +END IF +! +IF (KMI==1) THEN + GRELAX = .NOT.(OUSERV) .AND. LUSERV .AND. LHORELAX_RV +ELSE + GRELAX = .NOT.(LUSERV_G(NDAD(KMI))) .AND. LUSERV_G(KMI).AND. LHORELAX_RV +END IF +! +IF ( GRELAX ) THEN + LHORELAX_RV=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX THE RV FIELD' + WRITE(ILUOUT,FMT=*) 'TOWARDS THE LARGE SCALE FIELD OF MODEL',NDAD(KMI) + WRITE(ILUOUT,FMT=*) 'BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_RV=FALSE' +END IF +! +IF (KMI==1) THEN + GRELAX = .NOT.(OUSERC) .AND. LUSERC .AND. LHORELAX_RC +ELSE + GRELAX = .NOT.(LUSERC_G(NDAD(KMI))) .AND. LUSERC_G(KMI).AND. LHORELAX_RC +END IF +! +IF ( GRELAX ) THEN + LHORELAX_RC=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX THE RC FIELD' + WRITE(ILUOUT,FMT=*) 'TOWARDS THE LARGE SCALE FIELD OF MODEL',NDAD(KMI) + WRITE(ILUOUT,FMT=*) 'BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_RC=FALSE' +END IF +! +IF (KMI==1) THEN + GRELAX = .NOT.(OUSERR) .AND. LUSERR .AND. LHORELAX_RR +ELSE + GRELAX = .NOT.(LUSERR_G(NDAD(KMI))) .AND. LUSERR_G(KMI).AND. LHORELAX_RR +END IF +! +IF ( GRELAX ) THEN + LHORELAX_RR=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX THE RR FIELD' + WRITE(ILUOUT,FMT=*) 'TOWARDS THE LARGE SCALE FIELD OF MODEL',NDAD(KMI) + WRITE(ILUOUT,FMT=*) 'BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_RR=FALSE' +END IF +! +IF (KMI==1) THEN + GRELAX = .NOT.(OUSERI) .AND. LUSERI .AND. LHORELAX_RI +ELSE + GRELAX = .NOT.(LUSERI_G(NDAD(KMI))) .AND. LUSERI_G(KMI).AND. LHORELAX_RI +END IF +! +IF ( GRELAX ) THEN + LHORELAX_RI=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX THE RI FIELD' + WRITE(ILUOUT,FMT=*) 'TOWARDS THE LARGE SCALE FIELD OF MODEL',NDAD(KMI) + WRITE(ILUOUT,FMT=*) 'BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_RI=FALSE' +END IF +! +IF (KMI==1) THEN + GRELAX = .NOT.(OUSERG) .AND. LUSERG .AND. LHORELAX_RG +ELSE + GRELAX = .NOT.(LUSERG_G(NDAD(KMI))) .AND. LUSERG_G(KMI).AND. LHORELAX_RG +END IF +! +IF ( GRELAX ) THEN + LHORELAX_RG=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX THE RG FIELD' + WRITE(ILUOUT,FMT=*) 'TOWARDS THE LARGE SCALE FIELD OF MODEL',NDAD(KMI) + WRITE(ILUOUT,FMT=*) 'BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_RG=FALSE' +END IF +! +IF (KMI==1) THEN + GRELAX = .NOT.(OUSERH) .AND. LUSERH .AND. LHORELAX_RH +ELSE + GRELAX = .NOT.(LUSERH_G(NDAD(KMI))) .AND. LUSERH_G(KMI).AND. LHORELAX_RH +END IF +! +IF ( GRELAX ) THEN + LHORELAX_RH=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX THE RH FIELD' + WRITE(ILUOUT,FMT=*) 'TOWARDS THE LARGE SCALE FIELD OF MODEL',NDAD(KMI) + WRITE(ILUOUT,FMT=*) 'BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_RH=FALSE' +END IF +! +IF (KMI==1) THEN + GRELAX = .NOT.(OUSERS) .AND. LUSERS .AND. LHORELAX_RS +ELSE + GRELAX = .NOT.(LUSERS_G(NDAD(KMI))) .AND. LUSERS_G(KMI).AND. LHORELAX_RS +END IF +! +IF ( GRELAX ) THEN + LHORELAX_RS=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX THE RS FIELD' + WRITE(ILUOUT,FMT=*) 'TOWARDS THE LARGE SCALE FIELD OF MODEL',NDAD(KMI) + WRITE(ILUOUT,FMT=*) 'BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_RS=FALSE' +END IF +! +IF (KMI==1) THEN + GRELAX = HTURB=='NONE' .AND. LUSETKE(1).AND. LHORELAX_TKE +ELSE + GRELAX = .NOT.(LUSETKE(NDAD(KMI))) .AND. LUSETKE(KMI) .AND. LHORELAX_TKE +END IF +! +IF ( GRELAX ) THEN + LHORELAX_TKE=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX THE TKE FIELD' + WRITE(ILUOUT,FMT=*) 'TOWARDS THE LARGE SCALE FIELD OF MODEL',NDAD(KMI) + WRITE(ILUOUT,FMT=*) 'BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_TKE=FALSE' +END IF +! +! +DO JSV = 1,NSV_USER +! + IF (KMI==1) THEN + GRELAX = KSV_USER<JSV .AND. LUSESV(JSV,1).AND. LHORELAX_SV(JSV) + ELSE + GRELAX = .NOT.(LUSESV(JSV,NDAD(KMI))) .AND. LUSESV(JSV,KMI) .AND. LHORELAX_SV(JSV) + END IF + ! + IF ( GRELAX ) THEN + LHORELAX_SV(JSV)=.FALSE. + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO RELAX THE ',JSV,' SV FIELD' + WRITE(ILUOUT,FMT=*) 'TOWARDS THE LARGE SCALE FIELD OF MODEL',NDAD(KMI) + WRITE(ILUOUT,FMT=*) 'BUT IT DOES NOT EXIST.' + WRITE(ILUOUT,FMT=*) 'THEREFORE LHORELAX_SV(',JSV,')=FALSE' + END IF +END DO +! +!* 4.6 consistency in LES diagnostics choices +! +IF (CLES_NORM_TYPE=='EKMA' .AND. .NOT. LCORIO) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO USE THE EKMAN NORMALIZATION' + WRITE(ILUOUT,FMT=*) 'BUT CORIOLIS FORCE IS NOT USED (LCORIO=.FALSE.)' + WRITE(ILUOUT,FMT=*) 'THEN, NO NORMALIZATION IS PERFORMED' + CLES_NORM_TYPE='NONE' +END IF +! +!* 4.7 Check the coherence with LNUMDIFF +! +IF (L1D .AND. (LNUMDIFU .OR. LNUMDIFTH .OR. LNUMDIFSV) ) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU WANT TO USE HORIZONTAL DIFFUSION ' + WRITE(ILUOUT,FMT=*) 'BUT YOU ARE IN A COLUMN MODEL (L1D=.TRUE.).' + WRITE(ILUOUT,FMT=*) 'THEREFORE LNUMDIFU and LNUMDIFTH and LNUMDIFSV' + WRITE(ILUOUT,FMT=*) 'ARE SET TO FALSE' + LNUMDIFU=.FALSE. + LNUMDIFTH=.FALSE. + LNUMDIFSV=.FALSE. +END IF +! +IF (.NOT. LNUMDIFTH .AND. LZDIFFU) THEN + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(ILUOUT,FMT=*) 'YOU DO NOT WANT TO USE HORIZONTAL DIFFUSION (LNUMDIFTH=F)' + WRITE(ILUOUT,FMT=*) 'BUT YOU WANT TO USE Z-NUMERICAL DIFFUSION ' + WRITE(ILUOUT,FMT=*) 'THEREFORE LNUMDIFTH IS SET TO TRUE' + LNUMDIFTH=.TRUE. +END IF +! +!* 4.8 Other +! +IF (XTNUDGING < 4.*XTSTEP) THEN + XTNUDGING = 4.*XTSTEP + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='("TIME SCALE FOR NUDGING CAN NOT BE SMALLER THAN", & + & " FOUR TIMES THE TIME STEP")') + WRITE(ILUOUT,FMT=*) 'XTNUDGING is SET TO ',XTNUDGING +END IF +! +! +IF (XWAY(KMI) == 3. ) THEN + XWAY(KMI) = 2. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='("XWAY=3 DOES NOT EXIST ANYMORE; ", & + & " IT IS REPLACED BY XWAY=2 ")') +END IF +! +IF ( (KMI == 1) .AND. XWAY(KMI) /= 0. ) THEN + XWAY(KMI) = 0. + WRITE(UNIT=ILUOUT,FMT=9002) KMI + WRITE(UNIT=ILUOUT,FMT='("XWAY MUST BE EQUAL TO 0 FOR DAD MODEL")') +END IF +! +!JUANZ ZRESI solver need BSPLITTING +IF ( CPRESOPT == 'ZRESI' .AND. CSPLIT /= 'BSPLITTING' ) THEN + WRITE(UNIT=ILUOUT,FMT=9003) KMI + WRITE(UNIT=ILUOUT,FMT='("Paralleliez in Z solver CPRESOPT=ZRESI need also CSPLIT=BSPLITTING ")') + WRITE(ILUOUT,FMT=*) ' ERROR you have to set also CSPLIT=BSPLITTING ' + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') +END IF +! +IF ( LEN_TRIM(HINIFILEPGD)>0 ) THEN + IF ( CINIFILEPGD/=HINIFILEPGD ) THEN + WRITE(UNIT=ILUOUT,FMT=9001) KMI + WRITE(ILUOUT,FMT=*) ' ERROR : in EXSEG1.nam, in NAM_LUNITn you have CINIFILEPGD= ',CINIFILEPGD + WRITE(ILUOUT,FMT=*) ' whereas in .des you have CINIFILEPGD= ',HINIFILEPGD + WRITE(ILUOUT,FMT=*) ' Please check your Namelist ' + WRITE(ILUOUT,FMT=*) ' For example, you may have specified the un-nested PGD file instead of the nested PGD file ' + WRITE(ILUOUT,FMT=*) + WRITE(ILUOUT,FMT=*) '###############' + WRITE(ILUOUT,FMT=*) ' MESONH ABORTS' + WRITE(ILUOUT,FMT=*) '###############' + WRITE(ILUOUT,FMT=*) + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_EXSEG_n','') + END IF +ELSE + CINIFILEPGD = '' +!* note that after a spawning, there is no value for CINIFILEPGD in the .des file, +! so the checking cannot be made if the user starts a simulation directly from +! a spawned file (without the prep_real_case stage) +END IF +!------------------------------------------------------------------------------- +! +!* 5. WE DO NOT FORGET TO UPDATE ALL DOLLARN NAMELIST VARIABLES +! --------------------------------------------------------- +! +CALL UPDATE_NAM_LUNITN +CALL UPDATE_NAM_CONFN +CALL UPDATE_NAM_DRAGTREEN +CALL UPDATE_NAM_DRAGBLDGN +CALL UPDATE_NAM_DYNN +CALL UPDATE_NAM_ADVN +CALL UPDATE_NAM_PARAMN +CALL UPDATE_NAM_PARAM_RADN +#ifdef MNH_ECRAD +CALL UPDATE_NAM_PARAM_ECRADN +#endif +CALL UPDATE_NAM_PARAM_KAFRN +CALL UPDATE_NAM_LBCN +CALL UPDATE_NAM_NUDGINGN +CALL UPDATE_NAM_BLANKN +CALL UPDATE_NAM_CH_MNHCN +CALL UPDATE_NAM_CH_SOLVERN +CALL UPDATE_NAM_SERIESN +CALL UPDATE_NAM_BLOWSNOWN +CALL UPDATE_NAM_STATIONn +!------------------------------------------------------------------------------- +WRITE(UNIT=ILUOUT,FMT='(/)') +!------------------------------------------------------------------------------- +! +!* 6. FORMATS +! ------- +! +9000 FORMAT(/,'NOTE IN READ_EXSEG FOR MODEL ', I2, ' : ',/, & + '--------------------------------') +9001 FORMAT(/,'CAUTION ERROR IN READ_EXSEG FOR MODEL ', I2,' : ',/, & + '----------------------------------------' ) +9002 FORMAT(/,'WARNING IN READ_EXSEG FOR MODEL ', I2,' : ',/, & + '----------------------------------' ) +9003 FORMAT(/,'FATAL ERROR IN READ_EXSEG FOR MODEL ', I2,' : ',/, & + '--------------------------------------' ) +! +!------------------------------------------------------------------------------- +! +END SUBROUTINE READ_EXSEG_n diff --git a/src/mesonh/ext/read_field.f90 b/src/mesonh/ext/read_field.f90 new file mode 100644 index 0000000000000000000000000000000000000000..7354584343426cb3a1dfaba36e943f76680d9de3 --- /dev/null +++ b/src/mesonh/ext/read_field.f90 @@ -0,0 +1,2110 @@ +!MNH_LIC Copyright 1994-2021 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_READ_FIELD +! ###################### +! +INTERFACE +! + SUBROUTINE READ_FIELD(KOCEMI,TPINIFILE,KIU,KJU,KKU, & + HGETTKET,HGETRVT,HGETRCT,HGETRRT,HGETRIT,HGETCIT,HGETZWS, & + HGETRST,HGETRGT,HGETRHT,HGETSVT,HGETSRCT,HGETSIGS,HGETCLDFR,HGETICEFR, & + HGETBL_DEPTH,HGETSBL_DEPTH,HGETPHC,HGETPHR,HUVW_ADV_SCHEME, & + HTEMP_SCHEME,KSIZELBX_ll,KSIZELBXU_ll,KSIZELBY_ll,KSIZELBYV_ll, & + KSIZELBXTKE_ll,KSIZELBYTKE_ll, & + KSIZELBXR_ll,KSIZELBYR_ll,KSIZELBXSV_ll,KSIZELBYSV_ll, & + PUM,PVM,PWM,PDUM,PDVM,PDWM, & + PUT,PVT,PWT,PTHT,PPABST,PTKET,PRTKEMS, & + PRT,PSVT,PZWS,PCIT,PDRYMASST,PDRYMASSS, & + PSIGS,PSRCT,PCLDFR,PICEFR,PBL_DEPTH,PSBL_DEPTH,PWTHVMF,PPHC,PPHR, & + PLSUM,PLSVM,PLSWM,PLSTHM,PLSRVM, PLSZWSM, & + PLBXUM,PLBXVM,PLBXWM,PLBXTHM,PLBXTKEM,PLBXRM,PLBXSVM, & + PLBYUM,PLBYVM,PLBYWM,PLBYTHM,PLBYTKEM,PLBYRM,PLBYSVM, & + KFRC,TPDTFRC,PUFRC,PVFRC,PWFRC,PTHFRC,PRVFRC, & + PTENDTHFRC,PTENDRVFRC,PGXTHFRC,PGYTHFRC,PPGROUNDFRC,PATC, & + PTENDUFRC,PTENDVFRC, & + KADVFRC,TPDTADVFRC,PDTHFRC,PDRVFRC, & + KRELFRC,TPDTRELFRC, PTHREL, PRVREL, & + PVTH_FLUX_M,PWTH_FLUX_M,PVU_FLUX_M, & + PRUS_PRES,PRVS_PRES,PRWS_PRES,PRTHS_CLD,PRRS_CLD,PRSVS_CLD, & + PIBM_LSF,PIBM_XMUT,PUMEANW,PVMEANW,PWMEANW,PUMEANN,PVMEANN, & + PWMEANN,PUMEANE,PVMEANE,PWMEANE,PUMEANS,PVMEANS,PWMEANS, & + PLSPHI,PBMAP,PFMASE,PFMAWC,PFMWINDU,PFMWINDV,PFMWINDW,PFMHWS ) +! +USE MODD_IO, ONLY : TFILEDATA +USE MODD_TIME ! for type DATE_TIME +! +! +INTEGER, INTENT(IN) :: KOCEMI !Ocan model index +TYPE(TFILEDATA), INTENT(IN) :: TPINIFILE !Initial file +INTEGER, INTENT(IN) :: KIU, KJU, KKU + ! array sizes in x, y and z directions +! +CHARACTER (LEN=*), INTENT(IN) :: HGETTKET, & + HGETRVT,HGETRCT,HGETRRT, & + HGETRIT,HGETRST,HGETRGT,HGETRHT, & + HGETCIT,HGETSRCT, HGETZWS, & + HGETSIGS,HGETCLDFR,HGETICEFR,HGETBL_DEPTH, & + HGETSBL_DEPTH,HGETPHC,HGETPHR +CHARACTER (LEN=*), DIMENSION(:),INTENT(IN) :: HGETSVT +! +! GET indicators to know wether a given variable should or not be read in the +! FM file at time t-deltat and t +CHARACTER(LEN=6), INTENT(IN) :: HUVW_ADV_SCHEME ! advection scheme for wind +CHARACTER(LEN=4), INTENT(IN) :: HTEMP_SCHEME ! advection scheme for wind +! +! sizes of the West-east total LB area +INTEGER, INTENT(IN) :: KSIZELBX_ll,KSIZELBXU_ll ! for T,V,W and u +INTEGER, INTENT(IN) :: KSIZELBXTKE_ll ! for TKE +INTEGER, INTENT(IN) :: KSIZELBXR_ll,KSIZELBXSV_ll ! for Rx and SV +! sizes of the North-south total LB area +INTEGER, INTENT(IN) :: KSIZELBY_ll,KSIZELBYV_ll ! for T,U,W and v +INTEGER, INTENT(IN) :: KSIZELBYTKE_ll ! for TKE +INTEGER, INTENT(IN) :: KSIZELBYR_ll,KSIZELBYSV_ll ! for Rx and SV +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PUM,PVM,PWM ! U,V,W at t-dt +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PDUM,PDVM,PDWM ! Difference on U,V,W + ! between t+dt and t-dt +REAL, DIMENSION(:,:), INTENT(OUT) :: PBL_DEPTH ! BL depth +REAL, DIMENSION(:,:), INTENT(OUT) :: PSBL_DEPTH ! SBL depth +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PWTHVMF ! MassFlux buoyancy flux +! +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PUT,PVT,PWT ! U,V,W at t +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PTHT,PTKET ! theta, tke and +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PRTKEMS ! tke adv source +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PPABST ! pressure at t +REAL, DIMENSION(:,:,:,:), INTENT(OUT) :: PRT,PSVT ! moist and scalar + ! variables at t +REAL, DIMENSION(:,:), INTENT(INOUT) :: PZWS +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSRCT ! turbulent flux + ! <s'Rc'> at t +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PCIT ! ice conc. at t +REAL, INTENT(OUT) :: PDRYMASST ! Md(t) +REAL, INTENT(OUT) :: PDRYMASSS ! d Md(t) / dt +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSIGS ! =sqrt(<s's'>) for the + ! Subgrid Condensation +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PCLDFR ! cloud fraction +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PICEFR ! cloud fraction +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PPHC ! pH value in cloud water +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PPHR ! pH value in rainwater +! Larger Scale fields +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLSUM,PLSVM,PLSWM ! Wind +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLSTHM, PLSRVM ! Mass +! LB fields +REAL, DIMENSION(:,:), INTENT(OUT) :: PLSZWSM ! significant height of sea waves +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBXUM,PLBXVM,PLBXWM ! Wind +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBXTHM ! Mass +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBYUM,PLBYVM,PLBYWM ! Wind +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBYTHM ! Mass +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBXTKEM ! TKE +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBYTKEM +REAL, DIMENSION(:,:,:,:), INTENT(OUT) :: PLBXRM ,PLBXSVM ! Moisture and SV +REAL, DIMENSION(:,:,:,:), INTENT(OUT) :: PLBYRM ,PLBYSVM ! in x and y-dir. +! Forcing fields +INTEGER, INTENT(IN) :: KFRC ! number of forcing +TYPE (DATE_TIME), DIMENSION(:), INTENT(OUT) :: TPDTFRC ! date of forcing profs. +REAL, DIMENSION(:,:), INTENT(OUT) :: PUFRC,PVFRC,PWFRC ! forcing variables +REAL, DIMENSION(:,:), INTENT(OUT) :: PTHFRC,PRVFRC +REAL, DIMENSION(:,:), INTENT(OUT) :: PTENDUFRC,PTENDVFRC +REAL, DIMENSION(:,:), INTENT(OUT) :: PTENDTHFRC,PTENDRVFRC,PGXTHFRC,PGYTHFRC +REAL, DIMENSION(:), INTENT(OUT) :: PPGROUNDFRC +REAL, DIMENSION(:,:,:,:), INTENT(OUT) :: PATC +INTEGER, INTENT(IN) :: KADVFRC ! number of forcing +TYPE (DATE_TIME), DIMENSION(:), INTENT(OUT) :: TPDTADVFRC ! date of forcing profs. +REAL, DIMENSION(:,:,:,:), INTENT(OUT) :: PDTHFRC, PDRVFRC +INTEGER, INTENT(IN) :: KRELFRC ! number of forcing +TYPE (DATE_TIME), DIMENSION(:), INTENT(OUT) :: TPDTRELFRC ! date of forcing profs. +REAL, DIMENSION(:,:,:,:), INTENT(OUT) :: PTHREL, PRVREL +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PVTH_FLUX_M,PWTH_FLUX_M,PVU_FLUX_M ! Eddy fluxes +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS_PRES, PRVS_PRES, PRWS_PRES +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRTHS_CLD +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRS_CLD, PRSVS_CLD +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PIBM_LSF,PIBM_XMUT +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PUMEANW,PVMEANW,PWMEANW +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PUMEANN,PVMEANN,PWMEANN +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PUMEANE,PVMEANE,PWMEANE +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PUMEANS,PVMEANS,PWMEANS +! +! Fire Model fields +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLSPHI ! Fire Model Level Set function Phi [-] +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PBMAP ! Fire Model Burning map [s] +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PFMASE ! Fire Model Available Sensible Energy [J/m2] +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PFMAWC ! Fire Model Available Water Content [kg/m2] +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PFMWINDU ! Fire Model filtered u wind [m/s] +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PFMWINDV ! Fire Model filtered v wind [m/s] +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PFMWINDW ! Fire Model filtered w wind [m/s] +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PFMHWS ! Fire Model filtered horizontal wind speed [m/s] +! +END SUBROUTINE READ_FIELD +! +END INTERFACE +! +END MODULE MODI_READ_FIELD +! +! ######################################################################## + SUBROUTINE READ_FIELD(KOCEMI,TPINIFILE,KIU,KJU,KKU, & + HGETTKET,HGETRVT,HGETRCT,HGETRRT,HGETRIT,HGETCIT,HGETZWS, & + HGETRST,HGETRGT,HGETRHT,HGETSVT,HGETSRCT,HGETSIGS,HGETCLDFR,HGETICEFR, & + HGETBL_DEPTH,HGETSBL_DEPTH,HGETPHC,HGETPHR,HUVW_ADV_SCHEME, & + HTEMP_SCHEME,KSIZELBX_ll,KSIZELBXU_ll,KSIZELBY_ll,KSIZELBYV_ll, & + KSIZELBXTKE_ll,KSIZELBYTKE_ll, & + KSIZELBXR_ll,KSIZELBYR_ll,KSIZELBXSV_ll,KSIZELBYSV_ll, & + PUM,PVM,PWM,PDUM,PDVM,PDWM, & + PUT,PVT,PWT,PTHT,PPABST,PTKET,PRTKEMS, & + PRT,PSVT,PZWS,PCIT,PDRYMASST,PDRYMASSS, & + PSIGS,PSRCT,PCLDFR,PICEFR,PBL_DEPTH,PSBL_DEPTH,PWTHVMF,PPHC,PPHR, & + PLSUM,PLSVM,PLSWM,PLSTHM,PLSRVM,PLSZWSM, & + PLBXUM,PLBXVM,PLBXWM,PLBXTHM,PLBXTKEM,PLBXRM,PLBXSVM, & + PLBYUM,PLBYVM,PLBYWM,PLBYTHM,PLBYTKEM,PLBYRM,PLBYSVM, & + KFRC,TPDTFRC,PUFRC,PVFRC,PWFRC,PTHFRC,PRVFRC, & + PTENDTHFRC,PTENDRVFRC,PGXTHFRC,PGYTHFRC,PPGROUNDFRC,PATC, & + PTENDUFRC,PTENDVFRC, & + KADVFRC,TPDTADVFRC,PDTHFRC,PDRVFRC, & + KRELFRC,TPDTRELFRC, PTHREL, PRVREL, & + PVTH_FLUX_M,PWTH_FLUX_M,PVU_FLUX_M, & + PRUS_PRES,PRVS_PRES,PRWS_PRES,PRTHS_CLD,PRRS_CLD,PRSVS_CLD, & + PIBM_LSF,PIBM_XMUT,PUMEANW,PVMEANW,PWMEANW,PUMEANN,PVMEANN, & + PWMEANN,PUMEANE,PVMEANE,PWMEANE,PUMEANS,PVMEANS,PWMEANS, & + PLSPHI,PBMAP,PFMASE,PFMAWC,PFMWINDU,PFMWINDV,PFMWINDW,PFMHWS ) +! ######################################################################## +! +!!**** *READ_FIELD* - routine to read prognostic and surface fields +!! +!! PURPOSE +!! ------- +! The purpose of this routine is to initialize prognostic and +! surface fields by reading their value in initial file or by setting +! them to a fixed value. +! +!!** METHOD +!! ------ +!! According to the get indicators, the prognostics fields are : +!! - initialized by reading their value in the LFIFM file +!! if the corresponding indicators are equal to 'READ' +!! - initialized to zero if the corresponding indicators +!! are equal to 'INIT' +!! - not initialized if their corresponding indicators +!! are equal to 'SKIP' +!! +!! In case of time step change, all fields at t-dt are (linearly) +!! interpolated to get a consistant initial state before the segment +!! integration +!! +!! EXTERNAL +!! -------- +!! FMREAD : to read data in LFIFM file +!! INI_LS : to initialize larger scale fields +!! INI_LB : to initialize "2D" surfacic LB fields +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODD_CONF : NVERB,CCONF,CPROGRAM +!! +!! Module MODD_CTURB : XTKEMIN +!! +!! REFERENCE +!! --------- +!! Book2 of the documentation (routine READ_FIELD) +!! +!! +!! AUTHOR +!! ------ +!! V. Ducrocq * Meteo France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 15/06/94 +!! modification 22/11/94 add the pressure function (J.Stein) +!! modification 22/11/94 add the LS fields (J.Stein) +!! modification 06/01/95 add Md(t) (J.P.Lafore) +!! 26/03/95 add EPS var (J. Cuxart) +!! 30/06/95 add var related to the Subgrid condensation +!! (J.Stein) +!! 18/08/95 time step change case (J.P.Lafore) +!! 01/03/96 add the cloud fraction (J. Stein) +!! modification 13/12/95 add fmread of the forcing variables +!! (M.Georgelin) +!! modification 13/02/96 external control of the forcing (J.-P. Pinty) +!! 11/04/96 add the ice concentration (J.-P. Pinty) +!! 27/01/97 read ISVR 3D fields of SV (J.-P. Pinty) +!! 26/02/97 "surfacic" LS fieds introduction (J.P.Lafore) +!! (V MASSON) 03/03/97 positivity control for time step change +!! 10/04/97 proper treatment of minima for LS-fields (J.P.Lafore) +!! J. Stein 22/06/97 use the absolute pressure +!! J. Stein 22/10/97 cleaning + add the LB fields for u,v,w,theta,Rv +!! P. Bechtold 22/01/98 add SST and surface pressure forcing +!! V. Ducrocq 14/08/98 //, remove KIINF,KJINF,KISUP,KJSUP, +!! and introduce INI_LS and INI_LB +!! J. Stein 22/01/99 add the reading of STORAGE_TYPE to improve +!! the START case when the file contains 2 +!! instants MT +!! D. Gazen 22/01/01 use MODD_NSV to handle NSV floating indices +!! for the current model +!! V. Masson 01/2004 removes surface (externalization) +!! J.-P. Pinty 06/05/04 treat NSV_* for C1R3 and ELEC +!! 05/06 Remove EPS +!! M. Leriche 04/10 add pH in cloud water and rainwater +!! M. Leriche 07/10 treat NSV_* for ice phase chemical species +!! C.Lac 11/11 Suppress all the t-Dt fields +!! M.Tomasini, +!! P. Peyrille 06/12 2D west african monsoon : add reading of ADV forcing and addy fluxes +!! C.Lac 03/13 add prognostic supersaturation for C2R2/KHKO +!! Bosseur & Filippi 07/13 Adds Forefire +!! M. Leriche 11/14 correct bug in pH initialization +!! C.Lac 12/14 correction for reproducibility START/RESTA +!! Modification 01/2016 (JP Pinty) Add LIMA +!! M. Leriche 02/16 treat gas and aq. chemicals separately +!! C.Lac 10/16 CEN4TH with RKC4 + Correction on RK loop +!! 09/2017 Q.Rodier add LTEND_UV_FRC +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +!! V. Vionnet 07/17 add blowing snow scheme +!! P. Wautelet 01/2019 corrected intent of PDUM,PDVM,PDWM (OUT->INOUT) +! P. Wautelet 13/02/2019: removed PPABSM and PTSTEP dummy arguments (bugfix: PPABSM was intent(OUT)) +!! Bielli S. 02/2019 Sea salt : significant sea wave height influences salt emission; 5 salt modes +! P. Wautelet 14/03/2019: correct ZWS when variable not present in file +! M. Leriche 10/06/2019: in restart case read all immersion modes for LIMA +!! B. Vie 06/2020: Add prognostic supersaturation for LIMA +!! F. Auguste 02/2021: add fields necessary for IBM +!! T. Nagel 02/2021: add fields necessary for turbulence recycling +!! J.L. Redelsperger 03/2021: add necessary variables for Ocean LES case +!! A. Costes 12/2021: add Blaze fire model +!!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_2D_FRC +USE MODD_ADV_n +USE MODD_BLOWSNOW +USE MODD_BLOWSNOW_n +USE MODD_CH_AEROSOL +USE MODD_CH_M9_n, ONLY: CNAMES, CICNAMES +USE MODD_CONF +USE MODD_CONF_n +USE MODD_CST +USE MODD_TURB_n, ONLY: XTKEMIN +USE MODD_DUST +USE MODD_DYN_n, ONLY: LOCEAN +USE MODD_ELEC_DESCR, ONLY: CELECNAMES +use modd_field, only: tfielddata, tfieldlist, TYPEDATE, TYPEREAL,TYPELOG,TYPEINT +USE MODD_FIELD_n, only: XZWS_DEFAULT +#ifdef MNH_FOREFIRE +USE MODD_FOREFIRE +#endif +USE MODD_IBM_PARAM_n, ONLY: LIBM +USE MODD_ICE_C1R3_DESCR, ONLY: C1R3NAMES +USE MODD_IO, ONLY: TFILEDATA +USE MODD_LATZ_EDFLX +USE MODD_LG, ONLY: CLGNAMES +USE MODD_LUNIT_N, ONLY: TLUOUT +USE MODD_NSV +USE MODD_OCEANH +USE MODD_PARAM_C2R2, ONLY: LSUPSAT +! +USE MODD_PARAM_LIMA , ONLY: NMOD_CCN, LSCAV, LAERO_MASS, & + NMOD_IFN, NMOD_IMM, NINDICE_CCN_IMM, LHHONI +USE MODD_PARAM_LIMA_COLD, ONLY: CLIMA_COLD_NAMES +USE MODD_PARAM_LIMA_WARM, ONLY: CLIMA_WARM_NAMES, CAERO_MASS +USE MODD_PARAM_n, ONLY: CSCONV +USE MODD_PASPOL +USE MODD_RAIN_C2R2_DESCR, ONLY: C2R2NAMES +USE MODD_RECYCL_PARAM_n +USE MODD_REF, ONLY: LCOUPLES +USE MODD_SALT +USE MODD_TIME ! for type DATE_TIME +! +use mode_field, only: Find_field_id_from_mnhname +USE MODE_IO_FIELD_READ, only: IO_Field_read +USE MODE_MSG +USE MODE_TOOLS, ONLY: UPCASE +! +USE MODI_INI_LB +USE MODI_INI_LS +! +USE MODD_FIRE, ONLY: LBLAZE, LRESTA_ASE, LRESTA_AWC, LWINDFILTER, LRESTA_EWAM, LRESTA_WLIM, CWINDFILTER +! +IMPLICIT NONE +! +!* 0.1 declarations of arguments +! +! +! +INTEGER, INTENT(IN) :: KOCEMI !Ocan model index +TYPE(TFILEDATA), INTENT(IN) :: TPINIFILE !Initial file +INTEGER, INTENT(IN) :: KIU, KJU, KKU + ! array sizes in x, y and z directions +! +CHARACTER (LEN=*), INTENT(IN) :: HGETTKET, & + HGETRVT,HGETRCT,HGETRRT, & + HGETRIT,HGETRST,HGETRGT,HGETRHT, & + HGETCIT,HGETSRCT,HGETZWS, & + HGETSIGS,HGETCLDFR,HGETICEFR,HGETBL_DEPTH, & + HGETSBL_DEPTH,HGETPHC,HGETPHR +CHARACTER (LEN=*), DIMENSION(:),INTENT(IN) :: HGETSVT +! +! GET indicators to know wether a given variable should or not be read in the +! FM file at time t-deltat and t +! +CHARACTER(LEN=6), INTENT(IN) :: HUVW_ADV_SCHEME ! advection scheme for wind +CHARACTER(LEN=4), INTENT(IN) :: HTEMP_SCHEME ! advection scheme for wind +! +! sizes of the West-east total LB area +INTEGER, INTENT(IN) :: KSIZELBX_ll,KSIZELBXU_ll ! for T,V,W and u +INTEGER, INTENT(IN) :: KSIZELBXTKE_ll ! for TKE +INTEGER, INTENT(IN) :: KSIZELBXR_ll,KSIZELBXSV_ll ! for Rx and SV +! sizes of the North-south total LB area +INTEGER, INTENT(IN) :: KSIZELBY_ll,KSIZELBYV_ll ! for T,U,W and v +INTEGER, INTENT(IN) :: KSIZELBYTKE_ll ! for TKE +INTEGER, INTENT(IN) :: KSIZELBYR_ll,KSIZELBYSV_ll ! for Rx and SV +! +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PUM,PVM,PWM ! U,V,W at t-dt +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDUM,PDVM,PDWM ! Difference on U,V,W + ! between t+dt and t-dt +REAL, DIMENSION(:,:), INTENT(OUT) :: PBL_DEPTH ! BL depth +REAL, DIMENSION(:,:), INTENT(OUT) :: PSBL_DEPTH ! SBL depth +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PWTHVMF ! MassFlux buoyancy flux +! +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PUT,PVT,PWT ! U,V,W at t +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PTHT,PTKET ! theta, tke and +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PRTKEMS ! tke adv source +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PPABST ! pressure at t +REAL, DIMENSION(:,:,:,:), INTENT(OUT) :: PRT,PSVT ! moist and scalar + ! variables at t +REAL, DIMENSION(:,:), INTENT(INOUT) :: PZWS +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSRCT ! turbulent flux + ! <s'Rc'> at t +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PCIT ! ice conc. at t +REAL, INTENT(OUT) :: PDRYMASST ! Md(t) +REAL, INTENT(OUT) :: PDRYMASSS ! d Md(t) / dt +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSIGS ! =sqrt(<s's'>) for the + ! Subgrid Condensation +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PCLDFR ! cloud fraction +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PICEFR ! cloud fraction +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PPHC ! pH value in cloud water +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PPHR ! pH value in rainwater +! +! +! Larger Scale fields +REAL, DIMENSION(:,:), INTENT(OUT) :: PLSZWSM ! significant height of sea waves +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLSUM,PLSVM,PLSWM ! Wind +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLSTHM, PLSRVM ! Mass +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBXUM,PLBXVM,PLBXWM ! Wind +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBXTHM ! Mass +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBYUM,PLBYVM,PLBYWM ! Wind +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBYTHM ! Mass +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBXTKEM ! TKE +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLBYTKEM +REAL, DIMENSION(:,:,:,:), INTENT(OUT) :: PLBXRM ,PLBXSVM ! Moisture and SV +REAL, DIMENSION(:,:,:,:), INTENT(OUT) :: PLBYRM ,PLBYSVM ! in x and y-dir. +! +! +! Forcing fields +INTEGER, INTENT(IN) :: KFRC ! number of forcing +TYPE (DATE_TIME), DIMENSION(:), INTENT(OUT) :: TPDTFRC ! date of forcing profs. +REAL, DIMENSION(:,:), INTENT(OUT) :: PUFRC,PVFRC,PWFRC ! forcing variables +REAL, DIMENSION(:,:), INTENT(OUT) :: PTHFRC,PRVFRC +REAL, DIMENSION(:,:), INTENT(OUT) :: PTENDUFRC,PTENDVFRC +REAL, DIMENSION(:,:), INTENT(OUT) :: PTENDTHFRC,PTENDRVFRC,PGXTHFRC,PGYTHFRC +REAL, DIMENSION(:), INTENT(OUT) :: PPGROUNDFRC +REAL, DIMENSION(:,:,:,:), INTENT(OUT) :: PATC +INTEGER, INTENT(IN) :: KADVFRC ! number of forcing +TYPE (DATE_TIME), DIMENSION(:), INTENT(OUT) :: TPDTADVFRC ! date of forcing profs. +REAL, DIMENSION(:,:,:,:), INTENT(OUT) :: PDTHFRC, PDRVFRC +INTEGER, INTENT(IN) :: KRELFRC ! number of forcing +TYPE (DATE_TIME), DIMENSION(:), INTENT(OUT) :: TPDTRELFRC ! date of forcing profs. +REAL, DIMENSION(:,:,:,:), INTENT(OUT) :: PTHREL, PRVREL +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PVTH_FLUX_M,PWTH_FLUX_M,PVU_FLUX_M ! Eddy fluxes +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS_PRES, PRVS_PRES, PRWS_PRES +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRTHS_CLD +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRS_CLD, PRSVS_CLD +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PIBM_LSF ! LSF for IBM +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PIBM_XMUT ! Turbulent viscosity +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PUMEANW,PVMEANW,PWMEANW ! Velocity average at West boundary +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PUMEANN,PVMEANN,PWMEANN ! Velocity average at North boundary +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PUMEANE,PVMEANE,PWMEANE ! Velocity average at East boundary +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PUMEANS,PVMEANS,PWMEANS ! Velocity average at South boundary +! Fire Model fields +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PLSPHI ! Fire Model Level Set function Phi [-] +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PBMAP ! Fire Model Burning map [s] +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PFMASE ! Fire Model Available Sensible Energy [J/m2] +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PFMAWC ! Fire Model Available Water Content [kg/m2] +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PFMWINDU ! Fire Model filtered u wind [m/s] +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PFMWINDV ! Fire Model filtered v wind [m/s] +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PFMWINDW ! Fire Model filtered v wind [m/s] +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PFMHWS ! Fire Model filtered horizontal wind speed [m/s] +! +!* 0.2 declarations of local variables +! +INTEGER :: IID +INTEGER :: ILUOUT ! Unit number for prints +INTEGER :: IRESP +INTEGER :: ISV ! total number of scalar variables +INTEGER :: JSV ! Loop index for additional scalar variables +INTEGER :: JKLOOP,JRR ! Loop indexes +INTEGER :: IIUP,IJUP ! size of working window arrays +INTEGER :: JT ! loop index +LOGICAL :: GLSOURCE ! switch for the source term (for ini_ls and ini_lb) +LOGICAL :: ZLRECYCL ! switch if turbulence recycling is activated +CHARACTER(LEN=2) :: INDICE +CHARACTER(LEN=3) :: YFRC ! To mark the different forcing dates +CHARACTER(LEN=15) :: YVAL +REAL, DIMENSION(KIU,KJU,KKU) :: ZWORK ! to compute supersaturation +TYPE(TFIELDDATA) :: TZFIELD +! +!------------------------------------------------------------------------------- +! +!* 1. INITIALIZATION +! --------------- +! +GLSOURCE=.FALSE. +ZWORK = 0.0 +! +!------------------------------------------------------------------------------- +! +!* 2. READ PROGNOSTIC VARIABLES +! ------------------------- +! +!* 2.1 Time t: +! +IF (TPINIFILE%NMNHVERSION(1)<5) THEN + CALL FIND_FIELD_ID_FROM_MNHNAME('UT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'UM' + CALL IO_Field_read(TPINIFILE,TZFIELD,PUT) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('VT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'VM' + CALL IO_Field_read(TPINIFILE,TZFIELD,PVT) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('WT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'WM' + CALL IO_Field_read(TPINIFILE,TZFIELD,PWT) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('THT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'THM' + CALL IO_Field_read(TPINIFILE,TZFIELD,PTHT) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('PABST',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'PABSM' + CALL IO_Field_read(TPINIFILE,TZFIELD,PPABST) +ELSE + CALL IO_Field_read(TPINIFILE,'UT',PUT) + CALL IO_Field_read(TPINIFILE,'VT',PVT) + CALL IO_Field_read(TPINIFILE,'WT',PWT) + CALL IO_Field_read(TPINIFILE,'THT',PTHT) + CALL IO_Field_read(TPINIFILE,'PABST',PPABST) +ENDIF +! +SELECT CASE(HGETTKET) + CASE('READ') + IF (TPINIFILE%NMNHVERSION(1)<5) THEN + CALL FIND_FIELD_ID_FROM_MNHNAME('TKET',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'TKEM' + CALL IO_Field_read(TPINIFILE,TZFIELD,PTKET) + ELSE + CALL IO_Field_read(TPINIFILE,'TKET',PTKET) + END IF + IF ( ( (TPINIFILE%NMNHVERSION(1)==5 .AND. TPINIFILE%NMNHVERSION(2)>0) .OR. TPINIFILE%NMNHVERSION(1)>5 ) & + .AND. (CCONF == 'RESTA') .AND. LSPLIT_CFL) THEN + CALL IO_Field_read(TPINIFILE,'TKEMS',PRTKEMS) + END IF + CASE('INIT') + PTKET(:,:,:) = XTKEMIN + PRTKEMS(:,:,:) = 0. +END SELECT +! +SELECT CASE(HGETZWS) + CASE('READ') + CALL IO_Field_read(TPINIFILE,'ZWS',PZWS,IRESP) + !If the field ZWS is not in the file, set its value to XZWS_DEFAULT + !ZWS is present in files since MesoNH 5.4.2 + IF ( IRESP/=0 ) THEN + WRITE (YVAL,'( E15.8 )') XZWS_DEFAULT + CALL PRINT_MSG(NVERB_WARNING,'IO','READ_FIELD','ZWS not found in file: using default value: '//TRIM(YVAL)//' m') + PZWS(:,:) = XZWS_DEFAULT + END IF + + CASE('INIT') + PZWS(:,:)=0. +END SELECT +! +SELECT CASE(HGETRVT) ! vapor + CASE('READ') + IF (TPINIFILE%NMNHVERSION(1)<5) THEN + CALL FIND_FIELD_ID_FROM_MNHNAME('RVT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'RVM' + CALL IO_Field_read(TPINIFILE,TZFIELD,PRT(:,:,:,IDX_RVT)) + ELSE + CALL IO_Field_read(TPINIFILE,'RVT',PRT(:,:,:,IDX_RVT)) + END IF + CASE('INIT') + PRT(:,:,:,IDX_RVT) = 0. +END SELECT +! +SELECT CASE(HGETRCT) ! cloud + CASE('READ') + IF (TPINIFILE%NMNHVERSION(1)<5) THEN + CALL FIND_FIELD_ID_FROM_MNHNAME('RCT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'RCM' + CALL IO_Field_read(TPINIFILE,TZFIELD,PRT(:,:,:,IDX_RCT)) + ELSE + CALL IO_Field_read(TPINIFILE,'RCT',PRT(:,:,:,IDX_RCT)) + END IF + CASE('INIT') + PRT(:,:,:,IDX_RCT) = 0. +END SELECT +! +SELECT CASE(HGETRRT) ! rain + CASE('READ') + IF (TPINIFILE%NMNHVERSION(1)<5) THEN + CALL FIND_FIELD_ID_FROM_MNHNAME('RRT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'RRM' + CALL IO_Field_read(TPINIFILE,TZFIELD,PRT(:,:,:,IDX_RRT)) + ELSE + CALL IO_Field_read(TPINIFILE,'RRT',PRT(:,:,:,IDX_RRT)) + END IF + CASE('INIT') + PRT(:,:,:,IDX_RRT) = 0. +END SELECT +! +SELECT CASE(HGETRIT) ! cloud ice + CASE('READ') + IF (TPINIFILE%NMNHVERSION(1)<5) THEN + CALL FIND_FIELD_ID_FROM_MNHNAME('RIT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'RIM' + CALL IO_Field_read(TPINIFILE,TZFIELD,PRT(:,:,:,IDX_RIT)) + ELSE + CALL IO_Field_read(TPINIFILE,'RIT',PRT(:,:,:,IDX_RIT)) + END IF + CASE('INIT') + PRT(:,:,:,IDX_RIT) = 0. +END SELECT +! +SELECT CASE(HGETRST) ! snow + CASE('READ') + IF (TPINIFILE%NMNHVERSION(1)<5) THEN + CALL FIND_FIELD_ID_FROM_MNHNAME('RST',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'RSM' + CALL IO_Field_read(TPINIFILE,TZFIELD,PRT(:,:,:,IDX_RST)) + ELSE + CALL IO_Field_read(TPINIFILE,'RST',PRT(:,:,:,IDX_RST)) + END IF + CASE('INIT') + PRT(:,:,:,IDX_RST) = 0. +END SELECT +! +SELECT CASE(HGETRGT) ! graupel + CASE('READ') + IF (TPINIFILE%NMNHVERSION(1)<5) THEN + CALL FIND_FIELD_ID_FROM_MNHNAME('RGT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'RGM' + CALL IO_Field_read(TPINIFILE,TZFIELD,PRT(:,:,:,IDX_RGT)) + ELSE + CALL IO_Field_read(TPINIFILE,'RGT',PRT(:,:,:,IDX_RGT)) + END IF + CASE('INIT') + PRT(:,:,:,IDX_RGT) = 0. +END SELECT +! +SELECT CASE(HGETRHT) ! hail + CASE('READ') + IF (TPINIFILE%NMNHVERSION(1)<5) THEN + CALL FIND_FIELD_ID_FROM_MNHNAME('RHT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'RHM' + CALL IO_Field_read(TPINIFILE,TZFIELD,PRT(:,:,:,IDX_RHT)) + ELSE + CALL IO_Field_read(TPINIFILE,'RHT',PRT(:,:,:,IDX_RHT)) + END IF + CASE('INIT') + PRT(:,:,:,IDX_RHT) = 0. +END SELECT +! +SELECT CASE(HGETCIT) ! ice concentration + CASE('READ') + IF (SIZE(PCIT) /= 0 ) CALL IO_Field_read(TPINIFILE,'CIT',PCIT) + CASE('INIT') + PCIT(:,:,:)=0. +END SELECT +! +IF (LIBM .AND. CPROGRAM=='MESONH') THEN + ! + TZFIELD%CMNHNAME = 'LSFP' + TZFIELD%CLONGNAME = 'LSFP' + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + CALL IO_Field_read(TPINIFILE,TZFIELD,PIBM_LSF) + ! + TZFIELD%CMNHNAME = 'XMUT' + TZFIELD%CLONGNAME = 'XMUT' + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm2 s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + CALL IO_Field_read(TPINIFILE,TZFIELD,PIBM_XMUT) + ! +ENDIF +! +TZFIELD%CMNHNAME = 'RECYCLING' +TZFIELD%CLONGNAME = 'RECYCLING' +TZFIELD%CSTDNAME = '' +TZFIELD%CUNITS = '' +TZFIELD%CDIR = '--' +TZFIELD%NGRID = 1 +TZFIELD%NTYPE = TYPELOG +TZFIELD%NDIMS = 0 +TZFIELD%LTIMEDEP = .FALSE. +CALL IO_Field_read(TPINIFILE,TZFIELD,ZLRECYCL,IRESP) +!If field not found (file from older version of MesoNH) => set ZLRECYCL to false +IF ( IRESP /= 0 ) ZLRECYCL = .FALSE. + +IF (ZLRECYCL) THEN + ! + TZFIELD%CMNHNAME = 'RCOUNT' + TZFIELD%CLONGNAME = 'RCOUNT' + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = '--' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEINT + TZFIELD%NDIMS = 0 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_read(TPINIFILE,TZFIELD,NR_COUNT) + ! + IF (NR_COUNT .NE. 0) THEN + IF (LRECYCLW) THEN + TZFIELD%CMNHNAME = 'URECYCLW' + TZFIELD%CLONGNAME = 'URECYCLW' + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 2 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PUMEANW) + ! + TZFIELD%CMNHNAME = 'VRECYCLW' + TZFIELD%CLONGNAME = 'VRECYCLW' + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 3 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PVMEANW) + ! + TZFIELD%CMNHNAME = 'WRECYCLW' + TZFIELD%CLONGNAME = 'WRECYCLW' + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PWMEANW) + ! + ENDIF + IF (LRECYCLN) THEN + TZFIELD%CMNHNAME = 'URECYCLN' + TZFIELD%CLONGNAME = 'URECYCLN' + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 2 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PUMEANN) + ! + TZFIELD%CMNHNAME = 'VRECYCLN' + TZFIELD%CLONGNAME = 'VRECYCLN' + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 3 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PVMEANN) + ! + TZFIELD%CMNHNAME = 'WRECYCLN' + TZFIELD%CLONGNAME = 'WRECYCLN' + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PWMEANN) + ! + ENDIF + IF (LRECYCLE) THEN + TZFIELD%CMNHNAME = 'URECYCLE' + TZFIELD%CLONGNAME = 'URECYCLE' + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 2 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PUMEANE) + ! + TZFIELD%CMNHNAME = 'VRECYCLE' + TZFIELD%CLONGNAME = 'VRECYCLE' + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 3 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PVMEANE) + ! + TZFIELD%CMNHNAME = 'WRECYCLE' + TZFIELD%CLONGNAME = 'WRECYCLE' + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PWMEANE) + ! + ENDIF + IF (LRECYCLS) THEN + TZFIELD%CMNHNAME = 'URECYCLS' + TZFIELD%CLONGNAME = 'URECYCLS' + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 2 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PUMEANS) + ! + TZFIELD%CMNHNAME = 'VRECYCLS' + TZFIELD%CLONGNAME = 'VRECYCLS' + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 3 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PVMEANS) + ! + TZFIELD%CMNHNAME = 'WRECYCLS' + TZFIELD%CLONGNAME = 'WRECYCLS' + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PWMEANS) + ENDIF + ENDIF +ENDIF +! +! Scalar Variables Reading : Users, C2R2, C1R3, LIMA, ELEC, Chemical SV +! +ISV= SIZE(PSVT,4) +! +IF (NSV_USER>0) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'kg kg-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = 1, NSV_USER ! initialize according to the get indicators + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + WRITE(TZFIELD%CMNHNAME,'(A3,I3.3)')'SVT',JSV + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CCOMMENT = 'X_Y_Z_'//TRIM(TZFIELD%CMNHNAME) + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV)) + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! +IF (NSV_C2R2END>=NSV_C2R2BEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm-3' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_C2R2BEG,NSV_C2R2END + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + TZFIELD%CMNHNAME = TRIM(C2R2NAMES(JSV-NSV_C2R2BEG+1))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3)')'X_Y_Z_','SVT',JSV + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV)) + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + IF (LSUPSAT .AND. (HGETRVT == 'READ') ) THEN + ZWORK(:,:,:) = (PPABST(:,:,:)/XP00 )**(XRD/XCPD) + ZWORK(:,:,:) = PTHT(:,:,:)*ZWORK(:,:,:) + ZWORK(:,:,:) = EXP(XALPW-XBETAW/ZWORK(:,:,:)-XGAMW*ALOG(ZWORK(:,:,:))) + !rvsat + ZWORK(:,:,:) = (XMV / XMD)*ZWORK(:,:,:)/(PPABST(:,:,:)-ZWORK(:,:,:)) + ZWORK(:,:,:) = PRT(:,:,:,1)/ZWORK(:,:,:) + PSVT(:,:,:,NSV_C2R2END ) = ZWORK(:,:,:) + END IF + END SELECT + END DO +END IF +! +IF (NSV_C1R3END>=NSV_C1R3BEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm-3' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_C1R3BEG,NSV_C1R3END + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + TZFIELD%CMNHNAME = TRIM(C1R3NAMES(JSV-NSV_C1R3BEG+1))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3)')'X_Y_Z_','SVT',JSV + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV)) + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! +! LIMA variables +! +DO JSV = NSV_LIMA_BEG,NSV_LIMA_END + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + TZFIELD%CSTDNAME = '' + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3)')'X_Y_Z_','SVT',JSV + TZFIELD%CDIR = 'XY' + TZFIELD%CUNITS = 'kg-1' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. +! Nc + IF (JSV .EQ. NSV_LIMA_NC) THEN + TZFIELD%CMNHNAME = TRIM(CLIMA_WARM_NAMES(1))//'T' + END IF +! Nr + IF (JSV .EQ. NSV_LIMA_NR) THEN + TZFIELD%CMNHNAME = TRIM(CLIMA_WARM_NAMES(2))//'T' + END IF +! N CCN free + IF (JSV .GE. NSV_LIMA_CCN_FREE .AND. JSV .LT. NSV_LIMA_CCN_ACTI) THEN + WRITE(INDICE,'(I2.2)')(JSV - NSV_LIMA_CCN_FREE + 1) + TZFIELD%CMNHNAME = TRIM(CLIMA_WARM_NAMES(3))//INDICE//'T' + END IF +! N CCN acti + IF (JSV .GE. NSV_LIMA_CCN_ACTI .AND. JSV .LT. NSV_LIMA_CCN_ACTI + NMOD_CCN) THEN + WRITE(INDICE,'(I2.2)')(JSV - NSV_LIMA_CCN_ACTI + 1) + TZFIELD%CMNHNAME = TRIM(CLIMA_WARM_NAMES(4))//INDICE//'T' + END IF +! Scavenging + IF (JSV .EQ. NSV_LIMA_SCAVMASS) THEN + TZFIELD%CMNHNAME = TRIM(CAERO_MASS(1))//'T' + TZFIELD%CUNITS = 'kg kg-1' + END IF +! Ni + IF (JSV .EQ. NSV_LIMA_NI) THEN + TZFIELD%CMNHNAME = TRIM(CLIMA_COLD_NAMES(1))//'T' + END IF +! Ns + IF (JSV .EQ. NSV_LIMA_NS) THEN + TZFIELD%CMNHNAME = TRIM(CLIMA_COLD_NAMES(2))//'T' + END IF +! Ng + IF (JSV .EQ. NSV_LIMA_NG) THEN + TZFIELD%CMNHNAME = TRIM(CLIMA_COLD_NAMES(3))//'T' + END IF +! Nh + IF (JSV .EQ. NSV_LIMA_NH) THEN + TZFIELD%CMNHNAME = TRIM(CLIMA_COLD_NAMES(4))//'T' + END IF +! N IFN free + IF (JSV .GE. NSV_LIMA_IFN_FREE .AND. JSV .LT. NSV_LIMA_IFN_NUCL) THEN + WRITE(INDICE,'(I2.2)')(JSV - NSV_LIMA_IFN_FREE + 1) + TZFIELD%CMNHNAME = TRIM(CLIMA_COLD_NAMES(5))//INDICE//'T' + END IF +! N IFN nucl + IF (JSV .GE. NSV_LIMA_IFN_NUCL .AND. JSV .LT. NSV_LIMA_IFN_NUCL + NMOD_IFN) THEN + WRITE(INDICE,'(I2.2)')(JSV - NSV_LIMA_IFN_NUCL + 1) + TZFIELD%CMNHNAME = TRIM(CLIMA_COLD_NAMES(6))//INDICE//'T' + END IF +! N IMM nucl + IF (JSV .GE. NSV_LIMA_IMM_NUCL .AND. JSV .LT. NSV_LIMA_IMM_NUCL + NMOD_IMM) THEN + WRITE(INDICE,'(I2.2)')(NINDICE_CCN_IMM(JSV - NSV_LIMA_IMM_NUCL + 1)) + TZFIELD%CMNHNAME = TRIM(CLIMA_COLD_NAMES(7))//INDICE//'T' + END IF +! Hom. freez. of CCN + IF (JSV .EQ. NSV_LIMA_HOM_HAZE) THEN + TZFIELD%CMNHNAME = TRIM(CLIMA_COLD_NAMES(8))//'T' + END IF +! +! Super saturation + IF (JSV .EQ. NSV_LIMA_SPRO) THEN + TZFIELD%CMNHNAME = TRIM(CLIMA_WARM_NAMES(5))//'T' + END IF +! + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV)) + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + END SELECT +END DO +! +IF (NSV_ELECEND>=NSV_ELECBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_ELECBEG,NSV_ELECEND + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + TZFIELD%CMNHNAME = TRIM(CELECNAMES(JSV-NSV_ELECBEG+1))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + IF (JSV .GT. NSV_ELECBEG .AND. JSV .LT. NSV_ELECEND) THEN + TZFIELD%CUNITS = 'C m-3' + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3)')'X_Y_Z_','SVT',JSV + ELSE + TZFIELD%CUNITS = 'm-3' + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3,A8)')'X_Y_Z_','SVT',JSV,' (nb ions/m3)' + END IF + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV)) + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! +IF (NSV_CHGSEND>=NSV_CHGSBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppbv' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_CHGSBEG,NSV_CHGSEND + CNAMES(JSV-NSV_CHGSBEG+1) = UPCASE(CNAMES(JSV-NSV_CHGSBEG+1)) + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + TZFIELD%CMNHNAME = TRIM(CNAMES(JSV-NSV_CHGSBEG+1))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A4,I3.3)')'X_Y_Z_','CHIM',JSV + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV)) + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! +IF (NSV_CHACEND>=NSV_CHACBEG) THEN + TZFIELD%CSTDNAME = '' + !PW TODO: check units + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_CHACBEG,NSV_CHACEND + CNAMES(JSV-NSV_CHACBEG+NSV_CHGS+1) = UPCASE(CNAMES(JSV-NSV_CHACBEG+NSV_CHGS+1)) + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + TZFIELD%CMNHNAME = TRIM(CNAMES(JSV-NSV_CHACBEG+NSV_CHGS+1))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A4,I3.3,A4)')'X_Y_Z_','CHAQ',JSV,' (M)' + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV)) +!***ATTENTION: BUG ? field written with a M suffix, read with a T suffix + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! +IF (NSV_CHICEND>=NSV_CHICBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppp' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_CHICBEG,NSV_CHICEND + CICNAMES(JSV-NSV_CHICBEG+1) = UPCASE(CICNAMES(JSV-NSV_CHICBEG+1)) + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + TZFIELD%CMNHNAME = TRIM(CICNAMES(JSV-NSV_CHICBEG+1))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3)')'X_Y_Z_','SVT',JSV + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV)) + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! +IF (NSV_SLTEND>=NSV_SLTBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppp' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_SLTBEG,NSV_SLTEND + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + TZFIELD%CMNHNAME = TRIM(CSALTNAMES(JSV-NSV_SLTBEG+1))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3)')'X_Y_Z_','SVT',JSV + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV)) + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! +IF (NSV_SLTDEPEND>=NSV_SLTDEPBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppp' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_SLTDEPBEG,NSV_SLTDEPEND + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + TZFIELD%CMNHNAME = TRIM(CDESLTNAMES(JSV-NSV_SLTDEPBEG+1))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3)')'X_Y_Z_','SVT',JSV + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV)) + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! +IF (NSV_DSTEND>=NSV_DSTBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppp' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_DSTBEG,NSV_DSTEND + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + TZFIELD%CMNHNAME = TRIM(CDUSTNAMES(JSV-NSV_DSTBEG+1))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3)')'X_Y_Z_','SVT',JSV + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV)) + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! +IF (NSV_DSTDEPEND>=NSV_DSTDEPBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppp' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_DSTDEPBEG,NSV_DSTDEPEND + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + TZFIELD%CMNHNAME = TRIM(CDEDSTNAMES(JSV-NSV_DSTDEPBEG+1))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3)')'X_Y_Z_','SVT',JSV + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV)) + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! +IF (NSV_AEREND>=NSV_AERBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppp' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_AERBEG,NSV_AEREND + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + TZFIELD%CMNHNAME = TRIM(UPCASE(CAERONAMES(JSV-NSV_AERBEG+1)))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3)')'X_Y_Z_','SVT',JSV + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV)) + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! +IF (NSV_AERDEPEND>=NSV_AERDEPBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppp' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_AERDEPBEG,NSV_AERDEPEND + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + TZFIELD%CMNHNAME = TRIM(CDEAERNAMES(JSV-NSV_AERDEPBEG+1))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3)')'X_Y_Z_','SVT',JSV + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV)) + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! +IF (NSV_LGEND>=NSV_LGBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_LGBEG,NSV_LGEND + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + TZFIELD%CMNHNAME = TRIM(CLGNAMES(JSV-NSV_LGBEG+1))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3)')'X_Y_Z_','SVT',JSV + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV)) + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! +IF (NSV_PPEND>=NSV_PPBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_PPBEG,NSV_PPEND + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + WRITE(TZFIELD%CMNHNAME,'(A3,I3.3)')'SVT',JSV + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CCOMMENT = 'X_Y_Z_'//TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'kg kg-1' + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV),IRESP) + IF (IRESP/=0) THEN + PSVT(:,:,:,JSV) = 0. + END IF + ! + WRITE(TZFIELD%CMNHNAME,'(A3,I3.3)')'ATC',JSV+NSV_PPBEG-1 + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3)')'X_Y_Z_','ATC',JSV+NSV_PPBEG-1 + TZFIELD%CUNITS = 'm-3' + CALL IO_Field_read(TPINIFILE,TZFIELD,PATC(:,:,:,JSV-NSV_PPBEG+1),IRESP) + IF (IRESP/=0) THEN + PATC(:,:,:,JSV-NSV_PPBEG+1) = 0. + ENDIF + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + PATC(:,:,:,JSV-NSV_PPBEG+1) = 0. + END SELECT + END DO +END IF +! +#ifdef MNH_FOREFIRE +IF (NSV_FFEND>=NSV_FFBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'kg kg-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_FFBEG,NSV_FFEND + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + WRITE(TZFIELD%CMNHNAME,'(A3,I3.3)')'SVT',JSV + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CCOMMENT = 'X_Y_Z_'//TRIM(TZFIELD%CMNHNAME) + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV),IRESP) + IF (IRESP /= 0) THEN + PSVT(:,:,:,JSV) = 0. + END IF + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +#endif +! Blaze smoke variables +IF (NSV_FIREEND>=NSV_FIREBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'kg kg-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_FIREBEG,NSV_FIREEND + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + WRITE(TZFIELD%CMNHNAME,'(A3,I3.3)')'SVT',JSV + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CCOMMENT = 'X_Y_Z_'//TRIM(TZFIELD%CMNHNAME) + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV),IRESP) + IF (IRESP /= 0) THEN + PSVT(:,:,:,JSV) = 0. + END IF + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! +IF (NSV_CSEND>=NSV_CSBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'kg kg-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_CSBEG,NSV_CSEND + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + WRITE(TZFIELD%CMNHNAME,'(A3,I3.3)')'SVT',JSV + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CCOMMENT = 'X_Y_Z_'//TRIM(TZFIELD%CMNHNAME) + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV),IRESP) + IF (IRESP /= 0) THEN + PSVT(:,:,:,JSV) = 0. + END IF + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! Blaze fire model +IF (LBLAZE .AND. CCONF=='RESTA') THEN + ! Blaze is not compliant with MNHVERSION(1)<5 + ! Blaze begins with MNH 5.3.1 + CALL IO_Field_read(TPINIFILE,'LSPHI',PLSPHI,IRESP) + IF (IRESP /= 0) PLSPHI = 0. + CALL IO_Field_read(TPINIFILE,'BMAP',PBMAP,IRESP) + IF (IRESP /= 0) PBMAP = -1. + CALL IO_Field_read(TPINIFILE,'FMASE',PFMASE,IRESP) + IF(IRESP == 0) THEN + ! flag for the use of restart value for ASE initialization + LRESTA_ASE = .TRUE. + ELSE + PFMASE = 0. + END IF + CALL IO_Field_read(TPINIFILE,'FMAWC',PFMAWC,IRESP) + ! flag for the use of restart value for AWC initialization + IF(IRESP == 0) THEN + LRESTA_AWC = .TRUE. + ELSE + PFMAWC = 0. + END IF + ! read wind on fire grid if present + IF (LWINDFILTER) THEN + ! read in file only if wind filtering is required + SELECT CASE(CWINDFILTER) + CASE('EWAM') + ! read u + CALL IO_Field_read(TPINIFILE,'FMWINDU',PFMWINDU,IRESP) + ! flag for EWAM filtered u wind + IF(IRESP == 0) THEN + LRESTA_EWAM = .TRUE. + ELSE + PFMWINDU = 0. + END IF + ! read v + CALL IO_Field_read(TPINIFILE,'FMWINDV',PFMWINDV,IRESP) + ! flag for EWAM filtered v wind + IF(IRESP == 0 .AND. LRESTA_EWAM) THEN + ! u and v fields found + LRESTA_EWAM = .TRUE. + ELSE + ! u or v fields NOT found + LRESTA_EWAM = .FALSE. + END IF + IF (IRESP /= 0) PFMWINDV = 0. + ! read w + CALL IO_Field_read(TPINIFILE,'FMWINDW',PFMWINDW,IRESP) + ! flag for EWAM filtered w wind + IF(IRESP == 0 .AND. LRESTA_EWAM) THEN + ! u and v and w fields found + LRESTA_EWAM = .TRUE. + ELSE + ! u or v or w fields NOT found + LRESTA_EWAM = .FALSE. + END IF + IF (IRESP /= 0) PFMWINDW = 0. + + CASE('WLIM') + CALL IO_Field_read(TPINIFILE,'FMHWS',PFMHWS,IRESP) + ! flag for WLIM filtered horizontal wind speed + IF(IRESP == 0) THEN + LRESTA_WLIM = .TRUE. + ELSE + PFMHWS = 0. + END IF + END SELECT + END IF +END IF +! +IF (NSV_LNOXEND>=NSV_LNOXBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppp' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_LNOXBEG,NSV_LNOXEND + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + TZFIELD%CMNHNAME = 'LINOXT' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3)') 'X_Y_Z_','SVT',JSV + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV)) + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +! +IF (NSV_SNWEND>=NSV_SNWBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'kg kg-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + DO JSV = NSV_SNWBEG,NSV_SNWEND + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + TZFIELD%CMNHNAME = TRIM(CSNOWNAMES(JSV-NSV_SNWBEG+1))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3)') 'X_Y_Z_','SVT',JSV + CALL IO_Field_read(TPINIFILE,TZFIELD,PSVT(:,:,:,JSV)) + CASE ('INIT') + PSVT(:,:,:,JSV) = 0. + END SELECT + END DO +END IF +IF (NSV_SNW>=1) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'kg kg-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + DO JSV = 1,NSV_SNW + SELECT CASE(HGETSVT(JSV)) + CASE ('READ') + WRITE(TZFIELD%CMNHNAME,'(A10,I3.3)')'SNOWCANO_M',JSV + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A8,I3.3)') 'X_Y_Z_','SNOWCANO',JSV + CALL IO_Field_read(TPINIFILE,TZFIELD,XSNWCANO(:,:,JSV)) + CASE ('INIT') + XSNWCANO(:,:,JSV) = 0. + END SELECT + END DO + +END IF + +! +IF (CCONF == 'RESTA') THEN + IF (CTEMP_SCHEME/='LEFR') THEN + CALL IO_Field_read(TPINIFILE,'US_PRES',PRUS_PRES) + CALL IO_Field_read(TPINIFILE,'VS_PRES',PRVS_PRES) + CALL IO_Field_read(TPINIFILE,'WS_PRES',PRWS_PRES) + END IF + IF (LSPLIT_CFL) THEN + CALL IO_Field_read(TPINIFILE,'THS_CLD',PRTHS_CLD) + DO JRR = 1, SIZE(PRT,4) + SELECT CASE(JRR) + CASE (1) + CALL IO_Field_read(TPINIFILE,'RVS_CLD',PRRS_CLD(:,:,:,JRR)) + CASE (2) + CALL IO_Field_read(TPINIFILE,'RCS_CLD',PRRS_CLD(:,:,:,JRR)) + CASE (3) + CALL IO_Field_read(TPINIFILE,'RRS_CLD',PRRS_CLD(:,:,:,JRR)) + CASE (4) + CALL IO_Field_read(TPINIFILE,'RIS_CLD',PRRS_CLD(:,:,:,JRR)) + CASE (5) + CALL IO_Field_read(TPINIFILE,'RSS_CLD',PRRS_CLD(:,:,:,JRR)) + CASE (6) + CALL IO_Field_read(TPINIFILE,'RGS_CLD',PRRS_CLD(:,:,:,JRR)) + CASE (7) + CALL IO_Field_read(TPINIFILE,'RHS_CLD',PRRS_CLD(:,:,:,JRR)) + CASE DEFAULT + CALL PRINT_MSG(NVERB_FATAL,'GEN','READ_FIELD','PRT is too big') + END SELECT + END DO + DO JSV = NSV_C2R2BEG,NSV_C2R2END + IF (JSV == NSV_C2R2BEG ) THEN + TZFIELD%CMNHNAME = 'RSVS_CLD1' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'RSVS_CLD1' + TZFIELD%CUNITS = '1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_RHS_CLD' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PRSVS_CLD(:,:,:,JSV)) + END IF + IF (JSV == NSV_C2R2BEG ) THEN + TZFIELD%CMNHNAME = 'RSVS_CLD2' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'RSVS_CLD2' + TZFIELD%CUNITS = '1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_RHS_CLD' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PRSVS_CLD(:,:,:,JSV)) + END IF + END DO + END IF +END IF +! +!* 2.1 Time t-dt: +! +IF (CPROGRAM=='MESONH' .AND. HUVW_ADV_SCHEME(1:3)=='CEN' .AND. & + HTEMP_SCHEME == 'LEFR' ) THEN + IF (CCONF=='RESTA') THEN + CALL IO_Field_read(TPINIFILE,'UM', PUM) + CALL IO_Field_read(TPINIFILE,'VM', PVM) + CALL IO_Field_read(TPINIFILE,'WM', PWM) + CALL IO_Field_read(TPINIFILE,'DUM',PDUM) + CALL IO_Field_read(TPINIFILE,'DVM',PDVM) + CALL IO_Field_read(TPINIFILE,'DWM',PDWM) + ELSE + PUM = PUT + PVM = PVT + PWM = PWT + END IF +END IF +! +!* 2.2a 3D LS fields +! +! +CALL INI_LS(TPINIFILE,HGETRVT,GLSOURCE,PLSUM,PLSVM,PLSWM,PLSTHM,PLSRVM,PLSZWSM) +! +! +!* 2.2b 2D "surfacic" LB fields +! +! +CALL INI_LB(TPINIFILE,GLSOURCE,ISV, & + KSIZELBX_ll,KSIZELBXU_ll,KSIZELBY_ll,KSIZELBYV_ll, & + KSIZELBXTKE_ll,KSIZELBYTKE_ll, & + KSIZELBXR_ll,KSIZELBYR_ll,KSIZELBXSV_ll,KSIZELBYSV_ll, & + HGETTKET,HGETRVT,HGETRCT,HGETRRT,HGETRIT,HGETRST, & + HGETRGT,HGETRHT,HGETSVT, & + PLBXUM,PLBXVM,PLBXWM,PLBXTHM,PLBXTKEM,PLBXRM,PLBXSVM, & + PLBYUM,PLBYVM,PLBYWM,PLBYTHM,PLBYTKEM,PLBYRM,PLBYSVM ) +! +! +!* 2.3 Some special variables: +! +CALL IO_Field_read(TPINIFILE,'DRYMASST',PDRYMASST) ! dry mass +IF (CCONF=='RESTA') THEN + CALL IO_Field_read(TPINIFILE,'DRYMASSS',PDRYMASSS) ! dry mass tendency +ELSE + PDRYMASSS=XUNDEF ! should not be used +END IF +! +SELECT CASE(HGETSRCT) ! turbulent flux SRC at time t + CASE('READ') + CALL IO_Field_read(TPINIFILE,'SRCT',PSRCT) + CASE('INIT') + PSRCT(:,:,:)=0. +END SELECT +! +SELECT CASE(HGETSIGS) ! subgrid condensation + CASE('READ') + CALL IO_Field_read(TPINIFILE,'SIGS',PSIGS) + CASE('INIT') + PSIGS(:,:,:)=0. +END SELECT +! +SELECT CASE(HGETPHC) ! pH in cloud water + CASE('READ') + CALL IO_Field_read(TPINIFILE,'PHC',PPHC) + CASE('INIT') + PPHC(:,:,:)=0. +END SELECT +! +SELECT CASE(HGETPHR) ! pH in rainwater + CASE('READ') + CALL IO_Field_read(TPINIFILE,'PHR',PPHR) + CASE('INIT') + PPHR(:,:,:)=0. +END SELECT +! +IRESP=0 +IF(HGETCLDFR=='READ') THEN ! cloud fraction + CALL IO_Field_read(TPINIFILE,'CLDFR',PCLDFR,IRESP) +ENDIF +IF(HGETCLDFR=='INIT' .OR. IRESP /= 0) THEN + IF(SIZE(PRT,4) > 3) THEN + WHERE(PRT(:,:,:,2)+PRT(:,:,:,4) > 1.E-30) + PCLDFR(:,:,:) = 1. + ELSEWHERE + PCLDFR(:,:,:) = 0. + ENDWHERE + ELSE + WHERE(PRT(:,:,:,2) > 1.E-30) + PCLDFR(:,:,:) = 1. + ELSEWHERE + PCLDFR(:,:,:) = 0. + ENDWHERE + ENDIF +ENDIF +! +IRESP=0 +IF(HGETICEFR=='READ') THEN ! cloud fraction + CALL IO_Field_read(TPINIFILE,'ICEFR',PICEFR,IRESP) +ENDIF +IF(HGETCLDFR=='INIT' .OR. IRESP /= 0) THEN + IF(SIZE(PRT,4) > 3) THEN + WHERE(PRT(:,:,:,4) > 1.E-30) + PICEFR(:,:,:) = 1. + ELSEWHERE + PICEFR(:,:,:) = 0. + ENDWHERE + ELSE + PICEFR(:,:,:) = 0. + ENDIF +ENDIF +! +!* boundary layer depth +! +IF (HGETBL_DEPTH=='READ') THEN + CALL IO_Field_read(TPINIFILE,'BL_DEPTH',PBL_DEPTH) +ELSE + PBL_DEPTH(:,:)=XUNDEF +END IF +! +!* surface boundary layer depth +! +IF (HGETSBL_DEPTH=='READ') THEN + CALL IO_Field_read(TPINIFILE,'SBL_DEPTH',PSBL_DEPTH) +ELSE + PSBL_DEPTH(:,:)=0. +END IF +! +!* Contribution from MAss Flux parameterizations to vert. flux of buoyancy +! +SELECT CASE(HGETTKET) + CASE('READ') + IF (CSCONV=='EDKF') THEN + CALL IO_Field_read(TPINIFILE,'WTHVMF',PWTHVMF) + ELSE + PWTHVMF(:,:,:)=0 + ENDIF + CASE('INIT') + PWTHVMF(:,:,:)=0. +END SELECT +!------------------------------------------------------------------------------- +! +!* 2.4 READ FORCING VARIABLES +! ---------------------- +! +! READ FIELD ONLY FOR MODEL1 (identical for all model in GN) +IF (LOCEAN .AND. (.NOT.LCOUPLES) .AND. (KOCEMI==1)) THEN +! + CALL IO_Field_read(TPINIFILE,'NFRCLT',NFRCLT) + CALL IO_Field_read(TPINIFILE,'NINFRT',NINFRT) +! + TZFIELD%CMNHNAME = 'SSUFL_T' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'SSUFL' + TZFIELD%CUNITS = 'kg m-1 s-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'sfc stress along U to force ocean LES ' + TZFIELD%NGRID = 0 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + ALLOCATE(XSSUFL_T(NFRCLT)) + CALL IO_Field_read(TPINIFILE,TZFIELD,XSSUFL_T(:)) +! + TZFIELD%CMNHNAME = 'SSVFL_T' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'SSVFL' + TZFIELD%CUNITS = 'kg m-1 s-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'sfc stress along V to force ocean LES ' + TZFIELD%NGRID = 0 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. +ALLOCATE(XSSVFL_T(NFRCLT)) + CALL IO_Field_read(TPINIFILE,TZFIELD,XSSVFL_T(:)) +! + TZFIELD%CMNHNAME = 'SSTFL_T' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'SSTFL' + TZFIELD%CUNITS = 'kg m3 K m s-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'sfc total heat flux to force ocean LES ' + TZFIELD%NGRID = 0 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + ALLOCATE(XSSTFL_T(NFRCLT)) + CALL IO_Field_read(TPINIFILE,TZFIELD,XSSTFL_T(:)) +! + TZFIELD%CMNHNAME = 'SSOLA_T' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'SSOLA' + TZFIELD%CUNITS = 'kg m3 K m s-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'sfc solar flux at sfc to force ocean LES ' + TZFIELD%NGRID = 0 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + ALLOCATE(XSSOLA_T(NFRCLT)) + CALL IO_Field_read(TPINIFILE,TZFIELD,XSSOLA_T(:)) +! +END IF ! ocean sfc forcing end + +! +IF ( LFORCING ) THEN + DO JT=1,KFRC +! + WRITE (YFRC,'(I3.3)') JT +! + TZFIELD%CMNHNAME = 'DTFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'seconds since YYYY-MM-DD HH:MM:SS.S' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Date of forcing profile '//YFRC + TZFIELD%NGRID = 0 + TZFIELD%NTYPE = TYPEDATE + TZFIELD%NDIMS = 0 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,TPDTFRC(JT)) +! + TZFIELD%CMNHNAME = 'UFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Zonal component of horizontal forcing wind' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PUFRC(:,JT)) +! + TZFIELD%CMNHNAME = 'VFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Meridian component of horizontal forcing wind' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PVFRC(:,JT)) +! + TZFIELD%CMNHNAME = 'WFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Vertical forcing wind' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PWFRC(:,JT)) +! + TZFIELD%CMNHNAME = 'THFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'K' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Forcing potential temperature' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PTHFRC(:,JT)) +! + TZFIELD%CMNHNAME = 'RVFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'kg kg-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Forcing vapor mixing ratio' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PRVFRC(:,JT)) +! + TZFIELD%CMNHNAME = 'TENDTHFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'K s-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Large-scale potential temperature tendency for forcing' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PTENDTHFRC(:,JT)) +! + TZFIELD%CMNHNAME = 'TENDRVFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'kg kg-1 s-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Large-scale vapor mixing ratio tendency for forcing' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PTENDRVFRC(:,JT)) +! + TZFIELD%CMNHNAME = 'GXTHFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'K m-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Large-scale potential temperature gradient for forcing' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PGXTHFRC(:,JT)) +! + TZFIELD%CMNHNAME = 'GYTHFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'K m-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Large-scale potential temperature gradient for forcing' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PGYTHFRC(:,JT)) +! + TZFIELD%CMNHNAME = 'PGROUNDFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'Pa' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Forcing ground pressure' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 0 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PPGROUNDFRC(JT)) +! + TZFIELD%CMNHNAME = 'TENDUFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Large-scale U tendency for forcing' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PTENDUFRC(:,JT)) +! + TZFIELD%CMNHNAME = 'TENDVFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Large-scale V tendency for forcing' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PTENDVFRC(:,JT)) + END DO +END IF +! +!------------------------------------------------------------------------------- +IF (L2D_ADV_FRC) THEN + + DO JT=1,KADVFRC + WRITE (YFRC,'(I3.3)') JT + ! + TZFIELD%CMNHNAME = 'DTADV'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'seconds since YYYY-MM-DD HH:MM:SS.S' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Date and time of the advecting forcing '//YFRC + TZFIELD%NGRID = 0 + TZFIELD%NTYPE = TYPEDATE + TZFIELD%NDIMS = 0 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,TPDTADVFRC(JT)) + ! + TZFIELD%CMNHNAME = 'TH_ADV'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'K s-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PDTHFRC(:,:,:,JT)) + ! + TZFIELD%CMNHNAME = 'Q_ADV'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'kg kg-1 s-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PDRVFRC(:,:,:,JT)) + ENDDO +ENDIF +! +IF (L2D_REL_FRC) THEN + + DO JT=1,KRELFRC + WRITE (YFRC,'(I3.3)') JT + ! + TZFIELD%CMNHNAME = 'DTREL'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'seconds since YYYY-MM-DD HH:MM:SS.S' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Date and time of the relaxation forcing '//YFRC + TZFIELD%NGRID = 0 + TZFIELD%NTYPE = TYPEDATE + TZFIELD%NDIMS = 0 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,TPDTRELFRC(JT)) + ! + ! Relaxation + TZFIELD%CMNHNAME = 'TH_REL'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'K' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PTHREL(:,:,:,JT)) + ! + TZFIELD%CMNHNAME = 'Q_REL'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'kg kg-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_read(TPINIFILE,TZFIELD,PRVREL(:,:,:,JT)) + ENDDO +ENDIF +! +IF (LUV_FLX) THEN + IF ( CCONF /= 'START' .OR. CPROGRAM=='SPAWN ' ) THEN + CALL IO_Field_read(TPINIFILE,'VU_FLX',PVU_FLUX_M) + ELSE IF (CCONF == 'START') THEN + PVU_FLUX_M(:,:,:)=0. + END IF +ENDIF +! +IF (LTH_FLX) THEN + IF ( CCONF /= 'START' .OR. CPROGRAM=='SPAWN ' ) THEN + CALL IO_Field_read(TPINIFILE,'VT_FLX',PVTH_FLUX_M) + CALL IO_Field_read(TPINIFILE,'WT_FLX',PWTH_FLUX_M) + ELSE IF (CCONF == 'START') THEN + PWTH_FLUX_M(:,:,:)=0. + PVTH_FLUX_M(:,:,:)=0. + END IF +ENDIF +! +!------------------------------------------------------------------------------- +! +! +!* 3. PRINT ON OUTPUT-LISTING +! ---------------------- +! +IF (NVERB >= 10 .AND. .NOT. L1D) THEN + IIUP = SIZE(PUT,1) + IJUP = SIZE(PVT,2) + ILUOUT= TLUOUT%NLU +! + WRITE(ILUOUT,FMT=*) 'READ_FIELD: Some PUT values:' + WRITE(ILUOUT,FMT=*) '(1,1,JK) (IIU/2,IJU/2,JK) (IIU,IJU,JK) JK ' + DO JKLOOP=1,KKU + WRITE(ILUOUT,FMT=*) PUT(1,1,JKLOOP),PUT(IIUP/2,IJUP/2,JKLOOP), & + PUT(IIUP,KJU,JKLOOP),JKLOOP + END DO +! + WRITE(ILUOUT,FMT=*) 'READ_FIELD: Some PVT values:' + WRITE(ILUOUT,FMT=*) '(1,1,JK) (IIU/2,IJU/2,JK) (IIU,IJU,JK) JK ' + DO JKLOOP=1,KKU + WRITE(ILUOUT,FMT=*) PVT(1,1,JKLOOP),PVT(IIUP/2,IJUP/2,JKLOOP), & + PVT(IIUP,IJUP,JKLOOP),JKLOOP + END DO +! + WRITE(ILUOUT,FMT=*) 'READ_FIELD: Some PWT values:' + WRITE(ILUOUT,FMT=*) '(1,1,JK) (IIU/2,IJU/2,JK) (IIU,IJU,JK) JK ' + DO JKLOOP=1,KKU + WRITE(ILUOUT,FMT=*) PWT(1,1,JKLOOP),PWT(IIUP/2,IJUP/2,JKLOOP), & + PWT(IIUP,IJUP,JKLOOP),JKLOOP + END DO +! + WRITE(ILUOUT,FMT=*) 'READ_FIELD: Some PTHT values:' + WRITE(ILUOUT,FMT=*) '(1,1,JK) (IIU/2,IJU/2,JK) (IIU,IJU,JK) JK ' + DO JKLOOP=1,KKU + WRITE(ILUOUT,FMT=*) PTHT(1,1,JKLOOP),PTHT(IIUP/2,IJUP/2,JKLOOP), & + PTHT(IIUP,IJUP,JKLOOP),JKLOOP + END DO +! + IF(SIZE(PTKET,1) /=0) THEN + WRITE(ILUOUT,FMT=*) 'READ_FIELD: Some PTKET values:' + WRITE(ILUOUT,FMT=*) '(1,1,JK) (IIU/2,IJU/2,JK) (IIU,IJU,JK) JK ' + DO JKLOOP=1,KKU + WRITE(ILUOUT,FMT=*) PTKET(1,1,JKLOOP),PTKET(IIUP/2,IJUP/2,JKLOOP), & + PTKET(IIUP,IJUP,JKLOOP),JKLOOP + END DO + END IF +! + IF (SIZE(PRT,4) /= 0) THEN + WRITE(ILUOUT,FMT=*) 'READ_FIELD: Some PRT values:' + DO JRR = 1, SIZE(PRT,4) + WRITE(ILUOUT,FMT=*) 'JRR = ',JRR + WRITE(ILUOUT,FMT=*) '(1,1,JK) (IIU/2,IJU/2,JK) (IIU,IJU,JK) JK ' + DO JKLOOP=1,KKU + WRITE(ILUOUT,FMT=*) PRT(1,1,JKLOOP,JRR),PRT(IIUP/2,IJUP/2,JKLOOP,JRR), & + PRT(IIUP,IJUP,JKLOOP,JRR),JKLOOP + END DO + END DO +! + END IF +! + IF (SIZE(PSVT,4) /= 0) THEN + WRITE(ILUOUT,FMT=*) 'READ_FIELD: Some PSVT values:' + DO JRR = 1, SIZE(PSVT,4) + WRITE(ILUOUT,FMT=*) 'JRR = ',JRR + WRITE(ILUOUT,FMT=*) '(1,1,JK) (IIU/2,IJU/2,JK) (IIU,IJU,JK) JK ' + DO JKLOOP=1,KKU + WRITE(ILUOUT,FMT=*) PSVT(1,1,JKLOOP,JRR),PSVT(IIUP/2,IJUP/2,JKLOOP,JRR), & + PSVT(IIUP,IJUP,JKLOOP,JRR),JKLOOP + END DO + END DO +! + END IF +END IF +!------------------------------------------------------------------------------- +! +! +END SUBROUTINE READ_FIELD diff --git a/src/mesonh/ext/read_precip_field.f90 b/src/mesonh/ext/read_precip_field.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ec1548db7af023ba34f6b541138ac0a90e8d2bce --- /dev/null +++ b/src/mesonh/ext/read_precip_field.f90 @@ -0,0 +1,299 @@ +!MNH_LIC Copyright 1996-2020 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_READ_PRECIP_FIELD +! ############################# +! +! +! +INTERFACE +! + SUBROUTINE READ_PRECIP_FIELD(TPINIFILE,HPROGRAM,HCONF, & + HGETRCT,HGETRRT,HGETRST,HGETRGT,HGETRHT, & + PINPRC,PACPRC,PINDEP,PACDEP,PINPRR,PINPRR3D,PEVAP3D, & + PACPRR,PINPRS,PACPRS,PINPRG,PACPRG,PINPRH,PACPRH ) +! +USE MODD_IO, ONLY : TFILEDATA +! +!* 0.1 declarations of arguments +! +TYPE(TFILEDATA), INTENT(IN) :: TPINIFILE ! Initial file +CHARACTER (LEN=*), INTENT(IN) :: HPROGRAM ! +CHARACTER (LEN=*), INTENT(IN) :: HCONF ! +! +CHARACTER (LEN=*), INTENT(IN) :: HGETRCT, HGETRRT, HGETRST, HGETRGT, HGETRHT + ! Get indicator RCT,RRT,RST,RGT,RHT +! +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRC ! Droplet instant precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PACPRC ! Droplet accumulated precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINDEP ! Droplet instant deposition +REAL, DIMENSION(:,:), INTENT(INOUT) :: PACDEP ! Droplet accumulated dep +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRR ! Rain instant precip +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PINPRR3D ! Rain precipitation flux 3D +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PEVAP3D ! Rain evaporation flux 3D +REAL, DIMENSION(:,:), INTENT(INOUT) :: PACPRR ! Rain accumulated precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRS ! Snow instant precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PACPRS ! Snow accumulated precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRG ! Graupel instant precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PACPRG ! Graupel accumulated precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRH ! Hail instant precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PACPRH ! Hail accumulated precip +! +END SUBROUTINE READ_PRECIP_FIELD +! +END INTERFACE +! +END MODULE MODI_READ_PRECIP_FIELD +! +! ############################################################################## + SUBROUTINE READ_PRECIP_FIELD(TPINIFILE,HPROGRAM,HCONF, & + HGETRCT,HGETRRT,HGETRST,HGETRGT,HGETRHT, & + PINPRC,PACPRC,PINDEP,PACDEP,PINPRR,PINPRR3D,PEVAP3D, & + PACPRR,PINPRS,PACPRS,PINPRG,PACPRG,PINPRH,PACPRH ) +! ############################################################################## +! +!!**** *READ_PRECIP_FIELD* - routine to read precipitation surface fields +!! +!! PURPOSE +!! ------- +! Initialize precipitation fields by reading their value in an initial +! MNH file. +! +!!** METHOD +!! ------ +!! +!! +!! +!! EXTERNAL +!! -------- +!! FMREAD : to read data in LFIFM file +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! None +!! +!! REFERENCE +!! --------- +!! Book2 of the documentation (routine READ_PRECIP_FIELD) +!! +!! AUTHOR +!! ------ +!! J.-P. Pinty *Laboratoire d'Aerologie* +!! +!! MODIFICATIONS +!! ------------- +!! Original 13/06/96 +!! (J. Viviand) 04/02/97 convert precipitation rates in m/s +!! (V. Ducrocq) 14/08/98 // remove KIINF,KJINF,KISUP,KJSUP +!! (JP Pinty) 29/11/02 add C3R5, ICE2, ICE4 +!! (C.Lac) 04/03/13 add YGETxxx for FIT scheme +!! 10/2016 (C.Lac) Add droplet deposition +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 14/02/2019: remove CLUOUT/CLUOUT0 and associated variables +!! +!----------------------------------------------------------------------------- +! +!* 0. DECLARATIONS + +use modd_field, only: tfielddata, tfieldlist +USE MODD_IO, ONLY: TFILEDATA +USE MODD_PARAM_ICE_n, ONLY: LDEPOSC +USE MODD_PARAM_C2R2, ONLY: LDEPOC +USE MODD_PARAM_LIMA, ONLY: MDEPOC=>LDEPOC +! +use mode_field, only: Find_field_id_from_mnhname +USE MODE_IO_FIELD_READ, only: IO_Field_read +! +IMPLICIT NONE +! +!* 0.1 declarations of arguments +! +TYPE(TFILEDATA), INTENT(IN) :: TPINIFILE ! Initial file +CHARACTER (LEN=*), INTENT(IN) :: HPROGRAM ! +CHARACTER (LEN=*), INTENT(IN) :: HCONF ! +! +CHARACTER (LEN=*), INTENT(IN) :: HGETRCT, HGETRRT, HGETRST, HGETRGT, HGETRHT + ! Get indicator RCT,RRT,RST,RGT,RHT +! +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRC ! Droplet instant precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PACPRC ! Droplet accumulated precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINDEP ! Droplet instant deposition +REAL, DIMENSION(:,:), INTENT(INOUT) :: PACDEP ! Droplet accumulated dep +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRR ! Rain instant precip +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PINPRR3D ! Rain precipitation flux 3D +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PEVAP3D ! Rain evaporation flux 3D +REAL, DIMENSION(:,:), INTENT(INOUT) :: PACPRR ! Rain accumulated precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRS ! Snow instant precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PACPRS ! Snow accumulated precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRG ! Graupel instant precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PACPRG ! Graupel accumulated precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRH ! Hail instant precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PACPRH ! Hail accumulated precip +! +!* 0.2 declarations of local variables +! +REAL, DIMENSION(SIZE(PINPRR,1),SIZE(PINPRR,2)) :: Z2D ! 2D array to read data +REAL, DIMENSION(SIZE(PINPRR3D,1),SIZE(PINPRR3D,2),SIZE(PINPRR3D,3)) :: Z3D ! 3D array to read data + ! in initial file +INTEGER :: IID +INTEGER :: IRESP +CHARACTER(LEN=4) :: YGETRCT,YGETRRT,YGETRST,YGETRGT,YGETRHT +TYPE(TFIELDDATA) :: TZFIELD +! +!------------------------------------------------------------------------------- +! +!* 1.. INITIALIZATION +! ---------------- +! +IF ((HPROGRAM == 'MESONH') .AND. (HCONF == 'START')) THEN + YGETRCT = 'INIT' + YGETRRT = 'INIT' + YGETRST = 'INIT' + YGETRGT = 'INIT' + YGETRHT = 'INIT' +ELSE + YGETRCT = HGETRCT + YGETRRT = HGETRRT + YGETRST = HGETRST + YGETRGT = HGETRGT + YGETRHT = HGETRHT +END IF +!------------------------------------------------------------------------------- +! +!* 2.. READ PROGNOSTIC VARIABLES +! ------------------------- +! +IF (SIZE(PINPRC) /= 0 ) THEN + SELECT CASE(YGETRCT) + CASE ('READ') + CALL FIND_FIELD_ID_FROM_MNHNAME('INPRC',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm hour-1' + CALL IO_Field_read(TPINIFILE,TZFIELD,Z2D,IRESP) + IF (IRESP == 0) PINPRC(:,:)=Z2D(:,:)/(1000.*3600.) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('ACPRC',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm' + CALL IO_Field_read(TPINIFILE,TZFIELD,Z2D,IRESP) + IF (IRESP == 0) PACPRC(:,:)=Z2D(:,:)/(1000.) + CASE ('INIT') + PINPRC(:,:) = 0.0 + PACPRC(:,:) = 0.0 + END SELECT +END IF +! +IF (SIZE(PINDEP) /= 0 ) THEN + SELECT CASE(YGETRCT) + CASE ('READ') + CALL FIND_FIELD_ID_FROM_MNHNAME('INDEP',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm hour-1' + CALL IO_Field_read(TPINIFILE,TZFIELD,Z2D,IRESP) + IF (IRESP == 0) PINDEP(:,:)=Z2D(:,:)/(1000.*3600.) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('ACDEP',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm' + CALL IO_Field_read(TPINIFILE,TZFIELD,Z2D,IRESP) + IF (IRESP == 0) PACDEP(:,:)=Z2D(:,:)/(1000.) + CASE ('INIT') + PINDEP(:,:) = 0.0 + PACDEP(:,:) = 0.0 + END SELECT +END IF +! +IF (SIZE(PINPRR) /= 0 ) THEN + SELECT CASE(YGETRRT) + CASE ('READ') + CALL FIND_FIELD_ID_FROM_MNHNAME('INPRR',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm hour-1' + CALL IO_Field_read(TPINIFILE,TZFIELD,Z2D,IRESP) + IF (IRESP == 0) PINPRR(:,:)=Z2D(:,:)/(1000.*3600.) + ! + CALL IO_Field_read(TPINIFILE,'INPRR3D',Z3D,IRESP) + IF (IRESP == 0) PINPRR3D(:,:,:)=Z3D(:,:,:) + ! + CALL IO_Field_read(TPINIFILE,'EVAP3D',Z3D,IRESP) + IF (IRESP == 0) PEVAP3D(:,:,:)=Z3D(:,:,:) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('ACPRR',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm' + CALL IO_Field_read(TPINIFILE,TZFIELD,Z2D,IRESP) + IF (IRESP == 0) PACPRR(:,:)=Z2D(:,:)/(1000.) + CASE ('INIT') + PINPRR(:,:) = 0.0 + PINPRR3D(:,:,:) = 0.0 + PEVAP3D(:,:,:) = 0.0 + PACPRR(:,:) = 0.0 + END SELECT +END IF +! +IF (SIZE(PINPRS) /= 0 ) THEN + SELECT CASE(YGETRST) + CASE ('READ') + CALL FIND_FIELD_ID_FROM_MNHNAME('INPRS',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm hour-1' + CALL IO_Field_read(TPINIFILE,TZFIELD,Z2D,IRESP) + IF (IRESP == 0) PINPRS(:,:)=Z2D(:,:)/(1000.*3600.) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('ACPRS',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm' + CALL IO_Field_read(TPINIFILE,TZFIELD,Z2D,IRESP) + IF (IRESP == 0) PACPRS(:,:)=Z2D(:,:)/(1000.) + CASE ('INIT') + PINPRS(:,:) = 0.0 + PACPRS(:,:) = 0.0 + END SELECT +END IF +! +IF (SIZE(PINPRG) /= 0 ) THEN + SELECT CASE(YGETRGT) + CASE ('READ') + CALL FIND_FIELD_ID_FROM_MNHNAME('INPRG',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm hour-1' + CALL IO_Field_read(TPINIFILE,TZFIELD,Z2D,IRESP) + IF (IRESP == 0) PINPRG(:,:)=Z2D(:,:)/(1000.*3600.) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('ACPRG',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm' + CALL IO_Field_read(TPINIFILE,TZFIELD,Z2D,IRESP) + IF (IRESP == 0) PACPRG(:,:)=Z2D(:,:)/(1000.) + CASE ('INIT') + PINPRG(:,:) = 0.0 + PACPRG(:,:) = 0.0 + END SELECT +END IF +! +IF (SIZE(PINPRH) /= 0 ) THEN + SELECT CASE(YGETRHT) + CASE ('READ') + CALL FIND_FIELD_ID_FROM_MNHNAME('INPRH',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm hour-1' + CALL IO_Field_read(TPINIFILE,TZFIELD,Z2D,IRESP) + IF (IRESP == 0) PINPRH(:,:)=Z2D(:,:)/(1000.*3600.) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('ACPRH',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm' + CALL IO_Field_read(TPINIFILE,TZFIELD,Z2D,IRESP) + IF (IRESP == 0) PACPRH(:,:)=Z2D(:,:)/(1000.) + CASE ('INIT') + PINPRH(:,:) = 0.0 + PACPRH(:,:) = 0.0 + END SELECT +END IF +! +!------------------------------------------------------------------------------- +! +END SUBROUTINE READ_PRECIP_FIELD diff --git a/src/mesonh/ext/resolved_cloud.f90 b/src/mesonh/ext/resolved_cloud.f90 new file mode 100644 index 0000000000000000000000000000000000000000..1397ebaf22fb5e9b01546116312b5180b03682b7 --- /dev/null +++ b/src/mesonh/ext/resolved_cloud.f90 @@ -0,0 +1,1101 @@ +!MNH_LIC Copyright 1994-2021 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_RESOLVED_CLOUD +! ########################## +INTERFACE + SUBROUTINE RESOLVED_CLOUD ( HCLOUD, HACTCCN, HSCONV, HMF_CLOUD, & + KRR, KSPLITR, KSPLITG, KMI, KTCOUNT, & + HLBCX, HLBCY, TPFILE, HRAD, HTURBDIM, & + OSUBG_COND, OSIGMAS, HSUBG_AUCV, & + PTSTEP, PZZ, PRHODJ, PRHODREF, PEXNREF, & + PPABST, PTHT, PRT, PSIGS, PSIGQSAT, PMFCONV, & + PTHM, PRCM, PPABSTT, & + PW_ACT,PDTHRAD, PTHS, PRS, PSVT, PSVS, PSRCS, PCLDFR,& + PICEFR, & + PCIT, OSEDIC, OACTIT, OSEDC, OSEDI, & + ORAIN, OWARM, OHHONI, OCONVHG, & + PCF_MF,PRC_MF, PRI_MF, & + PINPRC,PINPRC3D,PINPRR,PINPRR3D, PEVAP3D, & + PINPRS,PINPRS3D,PINPRG,PINPRG3D,PINPRH,PINPRH3D, & + PSOLORG,PMI, & + PSPEEDC, PSPEEDR, PSPEEDS, PSPEEDG, PSPEEDH, & + PINDEP, PSUPSAT, PNACT, PNPRO,PSSPRO, PRAINFR, & + PHLC_HRC, PHLC_HCF, PHLI_HRI, PHLI_HCF, & + PSEA,PTOWN ) +! +USE MODD_IO, ONLY: TFILEDATA +! +CHARACTER(LEN=4), INTENT(IN) :: HCLOUD ! kind of cloud +CHARACTER(LEN=4), INTENT(IN) :: HACTCCN ! kind of CCN activation scheme + ! paramerization +CHARACTER(LEN=4), INTENT(IN) :: HSCONV ! Shallow convection scheme +CHARACTER(LEN=4), INTENT(IN) :: HMF_CLOUD! Type of statistical cloud +INTEGER, INTENT(IN) :: KRR ! Number of moist variables +INTEGER, INTENT(IN) :: KSPLITR ! Number of small time step + ! integrations for rain sedimendation +INTEGER, INTENT(IN) :: KSPLITG ! Number of small time step + ! integrations for ice sedimendation +INTEGER, INTENT(IN) :: KMI ! Model index +INTEGER, INTENT(IN) :: KTCOUNT ! Temporal loop counter +CHARACTER(LEN=4), DIMENSION(2), INTENT(IN) :: HLBCX,HLBCY ! X and Y-direc. LBC type +TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file +CHARACTER(len=4), INTENT(IN) :: HRAD ! Radiation scheme name +CHARACTER(len=4), INTENT(IN) :: HTURBDIM ! Dimensionality of the + ! turbulence scheme +LOGICAL, INTENT(IN) :: OSUBG_COND ! Switch for Subgrid Cond. +LOGICAL, INTENT(IN) :: OSIGMAS ! Switch for Sigma_s: + ! use values computed in CONDENSATION + ! or that from turbulence scheme +CHARACTER(LEN=4), INTENT(IN) :: HSUBG_AUCV + ! Kind of Subgrid autoconversion method +REAL, INTENT(IN) :: PTSTEP ! Time step :XTSTEP in namelist +! +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! Height (z) +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ !Dry density * Jacobian +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF! Reference dry air density +REAL, DIMENSION(:,:,:), INTENT(IN) :: PEXNREF ! Reference Exner function +! +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABST ! abs. pressure at time t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHT ! Theta at time t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT):: PRT ! Moist variables at time t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PSIGS ! Sigma_s at time t +REAL, INTENT(IN) :: PSIGQSAT! coeff applied to qsat variance contribution +REAL, DIMENSION(:,:,:), INTENT(IN) :: PMFCONV ! convective mass flux +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHM ! Theta at time t-Dt +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABSTT ! Pressure time t+Dt +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRCM ! Cloud water m.r. at time t-Dt +! +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PW_ACT ! W for CCN activation +REAL, DIMENSION(:,:,:), INTENT(IN) :: PDTHRAD! THeta RADiative Tendancy +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PTHS ! Theta source +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRS ! Moist variable sources +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PSVT ! Scalar variable at time t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PSVS ! Scalar variable sources +! +! +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSRCS ! Second-order flux + ! s'rc'/2Sigma_s2 at time t+1 + ! multiplied by Lambda_3 +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PCLDFR! Cloud fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PICEFR! Cloud fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PCIT ! Pristine ice number + ! concentration at time t +LOGICAL, INTENT(IN) :: OSEDIC! Switch to activate the + ! cloud droplet sedimentation + ! for ICE3 +LOGICAL, INTENT(IN) :: OACTIT ! Switch to activate the + ! activation through temp. + ! evolution in C2R2 and KHKO +LOGICAL, INTENT(IN) :: OSEDC ! Switch to activate the + ! cloud droplet sedimentation + ! for C2R2 or KHKO +LOGICAL, INTENT(IN) :: OSEDI ! Switch to activate the + ! cloud crystal sedimentation +LOGICAL, INTENT(IN) :: ORAIN ! Switch to activate the + ! raindrop formation +LOGICAL, INTENT(IN) :: OWARM ! Control of the rain formation + ! by slow warm microphysical + ! processes +LOGICAL, INTENT(IN) :: OHHONI! enable haze freezing +LOGICAL, INTENT(IN) :: OCONVHG! Switch for conversion from + ! hail to graupel +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PCF_MF! Convective Mass Flux Cloud fraction +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRC_MF! Convective Mass Flux liquid mixing ratio +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRI_MF! Convective Mass Flux solid mixing ratio +! +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRC ! Cloud instant precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRR ! Rain instant precip +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PINPRR3D ! sed flux of precip +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PEVAP3D ! evap profile +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRS ! Snow instant precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRG ! Graupel instant precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRH ! Hail instant precip +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PINPRC3D ! sed flux of precip +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PINPRS3D ! sed flux of precip +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PINPRG3D ! sed flux of precip +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PINPRH3D ! sed flux of precip +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSOLORG ![%] solubility fraction of soa +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PMI +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSPEEDC ! Cloud sedimentation speed +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSPEEDR ! Rain sedimentation speed +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSPEEDS ! Snow sedimentation speed +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSPEEDG ! Graupel sedimentation speed +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSPEEDH ! Hail sedimentation speed +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINDEP ! Cloud instant deposition +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSUPSAT !sursat +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PNACT !concentrtaion d'aérosols activés au temps t +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PNPRO !concentrtaion d'aérosols activés au temps t +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSSPRO !sursat +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PRAINFR ! Rain fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PHLC_HRC !HighLow liquid content +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PHLC_HCF !HighLow liquid cloud fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PHLI_HRI !HighLow ice content +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PHLI_HCF !HighLow ice clous fraction +REAL, DIMENSION(:,:), OPTIONAL, INTENT(IN) :: PSEA ! Land Sea mask +REAL, DIMENSION(:,:), OPTIONAL, INTENT(IN) :: PTOWN ! Town fraction +! +END SUBROUTINE RESOLVED_CLOUD +END INTERFACE +END MODULE MODI_RESOLVED_CLOUD +! +! ########################################################################## + SUBROUTINE RESOLVED_CLOUD ( HCLOUD, HACTCCN, HSCONV, HMF_CLOUD, & + KRR, KSPLITR, KSPLITG, KMI, KTCOUNT, & + HLBCX, HLBCY, TPFILE, HRAD, HTURBDIM, & + OSUBG_COND, OSIGMAS, HSUBG_AUCV, & + PTSTEP, PZZ, PRHODJ, PRHODREF, PEXNREF, & + PPABST, PTHT, PRT, PSIGS, PSIGQSAT, PMFCONV, & + PTHM, PRCM, PPABSTT, & + PW_ACT,PDTHRAD, PTHS, PRS, PSVT, PSVS, PSRCS, PCLDFR,& + PICEFR, & + PCIT, OSEDIC, OACTIT, OSEDC, OSEDI, & + ORAIN, OWARM, OHHONI, OCONVHG, & + PCF_MF,PRC_MF, PRI_MF, & + PINPRC,PINPRC3D,PINPRR,PINPRR3D, PEVAP3D, & + PINPRS,PINPRS3D,PINPRG,PINPRG3D,PINPRH,PINPRH3D, & + PSOLORG,PMI, & + PSPEEDC, PSPEEDR, PSPEEDS, PSPEEDG, PSPEEDH, & + PINDEP, PSUPSAT, PNACT, PNPRO,PSSPRO, PRAINFR, & + PHLC_HRC, PHLC_HCF, PHLI_HRI, PHLI_HCF, & + PSEA,PTOWN ) +! ########################################################################## +! +!!**** * - compute the resolved clouds and precipitation +!! +!! PURPOSE +!! ------- +!! The purpose of this routine is to compute the microphysical sources +!! related to the resolved clouds and precipitation +!! +!! +!!** METHOD +!! ------ +!! The main actions of this routine is to call the routines computing the +!! microphysical sources. Before that: +!! - it computes the real absolute pressure, +!! - negative values of the current guess of all mixing ratio are removed. +!! This is done by a global filling algorithm based on a multiplicative +!! method (Rood, 1987), in order to conserved the total mass in the +!! simulation domain. +!! - Sources are transformed in physical tendencies, by removing the +!! multiplicative term Rhod*J. +!! - External points values are filled owing to the use of cyclic +!! l.b.c., in order to performe computations on the full domain. +!! After calling to microphysical routines, the physical tendencies are +!! switched back to prognostic variables. +!! +!! +!! EXTERNAL +!! -------- +!! Subroutine SLOW_TERMS: Computes the explicit microphysical sources +!! Subroutine FAST_TERMS: Performs the saturation adjustment for l +!! Subroutine RAIN_ICE : Computes the explicit microphysical sources for i +!! Subroutine ICE_ADJUST: Performs the saturation adjustment for i+l +!! MIN_ll,SUM3D_ll : distributed functions equivalent to MIN and SUM +!! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODD_PARAMETERS : contains declarations of parameter variables +!! JPHEXT : Horizontal external points number +!! JPVEXT : Vertical external points number +!! Module MODD_CST +!! CST%XP00 ! Reference pressure +!! CST%XRD ! Gaz constant for dry air +!! CST%XCPD ! Cpd (dry air) +!! +!! REFERENCE +!! --------- +!! +!! Book1 and book2 of documentation ( routine RESOLVED_CLOUD ) +!! +!! AUTHOR +!! ------ +!! E. Richard * Laboratoire d'Aerologie* +!! +!! MODIFICATIONS +!! ------------- +!! Original 21/12/94 +!! Modifications: June 8, 1995 ( J.Stein ) +!! Cleaning to improve efficienty and clarity +!! in agreement with the MESO-NH coding norm +!! March 1, 1996 ( J.Stein ) +!! store the cloud fraction +!! March 18, 1996 ( J.Stein ) +!! check that ZMASSPOS /= 0 +!! Oct. 12, 1996 ( J.Stein ) +!! remove the negative values correction +!! for the KES2 case +!! Modifications: Dec 14, 1995 (J.-P. Pinty) +!! Add the mixed-phase option +!! Modifications: Jul 01, 1996 (J.-P. Pinty) +!! Change arg. list in routine FAST_TERMS +!! Modifications: Jan 27, 1997 (J.-P. Pinty) +!! add W and SV in arg. list +!! Modifications: March 23, 98 (E.Richard) +!! correction of negative value based on +!! rv+rc+ri and thetal or thetail conservation +!! Modifications: April 08, 98 (J.-P. Lafore and V. Ducrocq ) +!! modify the correction of negative values +!! Modifications: June 08, 00 (J.-P. Pinty and J.-M. Cohard) +!! add the C2R2 scheme +!! Modifications: April 08, 01 (J.-P. Pinty) +!! add the C3R5 scheme +!! Modifications: July 21, 01 (J.-P. Pinty) +!! Add OHHONI and PW_ACT (for haze freezing) +!! Modifications: Sept 21, 01 (J.-P. Pinty) +!! Add XCONC_CCN limitation +!! Modifications: Nov 21, 02 (J.-P. Pinty) +!! Add ICE4 and C3R5 options +!! June, 2005 (V. Masson) +!! Technical change in interface for scalar arguments +!! Modifications : March, 2006 (O.Geoffroy) +!! Add KHKO scheme +!! Modifications : March 2013 (O.Thouron) +!! Add prognostic supersaturation +!! July, 2015 (O.Nuissier/F.Duffourg) Add microphysics diagnostic for +!! aircraft, ballon and profiler +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! M.Mazoyer : 04/2016 : Temperature radiative tendency used for +!! activation by cooling (OACTIT) +!! Modification 01/2016 (JP Pinty) Add LIMA +!! 10/2016 M.Mazoyer New KHKO output fields +!! 10/2016 (C.Lac) Add droplet deposition +!! S.Riette : 11/2016 : ice_adjust before and after rain_ice +!! ICE3/ICE4 modified, old version under LRED=F +! P. Wautelet 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 01/02/2019: ZRSMIN is now allocatable (instead of size of XRTMIN which was sometimes not allocated) +! C. Lac 02/2019: add rain fraction as an output field +! P. Wautelet 02/2020: use the new data structures and subroutines for budgets +! B. Vie 03/2020: LIMA negativity checks after turbulence, advection and microphysics budgets +! B. Vie 03/03/2020: use DTHRAD instead of dT/dt in Smax diagnostic computation +! P. Wautelet 11/06/2020: bugfix: correct ZSVS array indices +! P. Wautelet 11/06/2020: bugfix: add "Non local correction for precipitating species" for ICE4 +! P. Wautelet + Benoit Vié 06/2020: improve removal of negative scalar variables + adapt the corresponding budgets +! P. Wautelet 23/06/2020: remove ZSVS and ZSVT to improve code readability +! P. Wautelet 30/06/2020: move removal of negative scalar variables to Sources_neg_correct +! P. Wautelet 30/06/2020: remove non-local corrections +! B. Vie 06/2020: add prognostic supersaturation for LIMA +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +USE MODD_BUDGET, ONLY: TBUDGETS, TBUCONF +USE MODD_CH_AEROSOL, ONLY: LORILAM +USE MODD_DUST, ONLY: LDUST +USE MODD_CST, ONLY: CST +USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t +USE MODD_DUST , ONLY: LDUST +USE MODD_IO, ONLY: TFILEDATA +USE MODD_NEB_n, ONLY: NEBN, CCONDENS, CLAMBDA3 +USE MODD_NSV, ONLY: NSV, NSV_C1R3END, NSV_C2R2BEG, NSV_C2R2END, & + NSV_LIMA_BEG, NSV_LIMA_END, NSV_LIMA_CCN_FREE, NSV_LIMA_IFN_FREE, & + NSV_LIMA_NC, NSV_LIMA_NI, NSV_LIMA_NR, NSV_AEREND,NSV_DSTEND,NSV_SLTEND +USE MODD_PARAM_C2R2, ONLY: LSUPSAT +USE MODD_PARAMETERS, ONLY: JPHEXT, JPVEXT +USE MODD_PARAM_ICE_n, ONLY: CSEDIM, LADJ_BEFORE, LADJ_AFTER, LRED, PARAM_ICEN +USE MODD_PARAM_LIMA, ONLY: LADJ, LCOLD, LPTSPLIT, LSPRO, NMOD_CCN, NMOD_IFN, NMOD_IMM +USE MODD_RAIN_ICE_DESCR_n, ONLY: XRTMIN, RAIN_ICE_DESCRN +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAMN +USE MODD_SALT, ONLY: LSALT +USE MODD_TURB_n, ONLY: TURBN +! +USE MODE_ll +USE MODE_FILL_DIMPHYEX, ONLY: FILL_DIMPHYEX +use mode_sources_neg_correct, only: Sources_neg_correct +! +USE MODI_C2R2_ADJUST +USE MODI_FAST_TERMS +USE MODI_GET_HALO +USE MODI_ICE_ADJUST +USE MODI_KHKO_NOTADJUST +USE MODI_LIMA +USE MODI_LIMA_ADJUST +USE MODI_LIMA_ADJUST_SPLIT +USE MODI_LIMA_COLD +USE MODI_LIMA_MIXED +USE MODI_LIMA_NOTADJUST +USE MODI_LIMA_WARM +USE MODI_RAIN_C2R2_KHKO +USE MODI_RAIN_ICE +USE MODI_RAIN_ICE_OLD +USE MODI_SHUMAN +USE MODI_SLOW_TERMS +USE MODI_AER2LIMA +! +IMPLICIT NONE +! +!* 0.1 Declarations of dummy arguments : +! +! +! +CHARACTER(LEN=4), INTENT(IN) :: HCLOUD ! kind of cloud paramerization +CHARACTER(LEN=4), INTENT(IN) :: HACTCCN ! kind of CCN activation scheme +CHARACTER(LEN=4), INTENT(IN) :: HSCONV ! Shallow convection scheme +CHARACTER(LEN=4), INTENT(IN) :: HMF_CLOUD! Type of statistical cloud +INTEGER, INTENT(IN) :: KRR ! Number of moist variables +INTEGER, INTENT(IN) :: KSPLITR ! Number of small time step + ! integrations for rain sedimendation +INTEGER, INTENT(IN) :: KSPLITG ! Number of small time step + ! integrations for ice sedimendation +INTEGER, INTENT(IN) :: KMI ! Model index +INTEGER, INTENT(IN) :: KTCOUNT ! Temporal loop counter +CHARACTER(LEN=4), DIMENSION(2), INTENT(IN) :: HLBCX,HLBCY ! X and Y-direc. LBC type +TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file +CHARACTER(len=4), INTENT(IN) :: HRAD ! Radiation scheme name +CHARACTER(len=4), INTENT(IN) :: HTURBDIM ! Dimensionality of the + ! turbulence scheme +LOGICAL, INTENT(IN) :: OSUBG_COND ! Switch for Subgrid Cond. +LOGICAL, INTENT(IN) :: OSIGMAS ! Switch for Sigma_s: + ! use values computed in CONDENSATION + ! or that from turbulence scheme +CHARACTER(LEN=4), INTENT(IN) :: HSUBG_AUCV + ! Kind of Subgrid autoconversion method +REAL, INTENT(IN) :: PTSTEP ! Time step :XTSTEP in namelist +! +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! Height (z) +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ !Dry density * Jacobian +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF! Reference dry air density +REAL, DIMENSION(:,:,:), INTENT(IN) :: PEXNREF ! Reference Exner function +! +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABST ! abs. pressure at time t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHT ! Theta at time t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT):: PRT ! Moist variables at time t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PSIGS ! Sigma_s at time t +REAL, INTENT(IN) :: PSIGQSAT! coeff applied to qsat variance contribution +REAL, DIMENSION(:,:,:), INTENT(IN) :: PMFCONV ! convective mass flux +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHM ! Theta at time t-Dt +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABSTT ! Pressure time t+Dt +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRCM ! Cloud water m.r. at time t-Dt +! +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PW_ACT ! W for CCN activation +REAL, DIMENSION(:,:,:), INTENT(IN) :: PDTHRAD! THeta RADiative Tendancy +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PTHS ! Theta source +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRS ! Moist variable sources +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PSVT ! Scalar variable at time t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PSVS ! Scalar variable sources +! +! +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSRCS ! Second-order flux + ! s'rc'/2Sigma_s2 at time t+1 + ! multiplied by Lambda_3 +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PCLDFR! Cloud fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PICEFR! Cloud fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PCIT ! Pristine ice number + ! concentration at time t +LOGICAL, INTENT(IN) :: OSEDIC! Switch to activate the + ! cloud droplet sedimentation + ! for ICE3 +LOGICAL, INTENT(IN) :: OACTIT ! Switch to activate the + ! activation through temp. + ! evolution in C2R2 and KHKO +LOGICAL, INTENT(IN) :: OSEDC ! Switch to activate the + ! cloud droplet sedimentation +LOGICAL, INTENT(IN) :: OSEDI ! Switch to activate the + ! cloud crystal sedimentation +LOGICAL, INTENT(IN) :: ORAIN ! Switch to activate the + ! raindrop formation +LOGICAL, INTENT(IN) :: OWARM ! Control of the rain formation + ! by slow warm microphysical + ! processes +LOGICAL, INTENT(IN) :: OHHONI! enable haze freezing +LOGICAL, INTENT(IN) :: OCONVHG! Switch for conversion from + ! hail to graupel +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PCF_MF! Convective Mass Flux Cloud fraction +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRC_MF! Convective Mass Flux liquid mixing ratio +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRI_MF! Convective Mass Flux solid mixing ratio +! +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRC ! Cloud instant precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRR ! Rain instant precip +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PINPRR3D ! sed flux of precip +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PEVAP3D ! evap profile +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRS ! Snow instant precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRG ! Graupel instant precip +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRH ! Hail instant precip +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PINPRC3D ! sed flux of precip +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PINPRS3D ! sed flux of precip +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PINPRG3D ! sed flux of precip +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PINPRH3D ! sed flux of precip +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSOLORG ![%] solubility fraction of soa +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PMI +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSPEEDC ! Cloud sedimentation speed +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSPEEDR ! Rain sedimentation speed +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSPEEDS ! Snow sedimentation speed +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSPEEDG ! Graupel sedimentation speed +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSPEEDH ! Hail sedimentation speed +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINDEP ! Cloud instant deposition +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSUPSAT !sursat +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PNACT !concentrtaion d'aérosols activés au temps t +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PNPRO !concentrtaion d'aérosols activés au temps t +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSSPRO !sursat +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PRAINFR ! Rain fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PHLC_HRC !HighLow liquid content +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PHLC_HCF !HighLow liquid cloud fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PHLI_HRI !HighLow ice content +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PHLI_HCF !HighLow ice clous fraction +REAL, DIMENSION(:,:), OPTIONAL, INTENT(IN) :: PSEA ! Land Sea mask +REAL, DIMENSION(:,:), OPTIONAL, INTENT(IN) :: PTOWN ! Town fraction +! +! +!* 0.2 Declarations of local variables : +! +INTEGER :: JRR,JSV ! Loop index for the moist and scalar variables +INTEGER :: IIB ! Define the physical domain +INTEGER :: IIE ! +INTEGER :: IJB ! +INTEGER :: IJE ! +INTEGER :: IKB ! +INTEGER :: IKE ! +INTEGER :: IKU +INTEGER :: IINFO_ll ! return code of parallel routine +INTEGER :: JK,JI,JL +! +! +! +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)):: ZDZZ +real, dimension(:,:,:), allocatable :: ZEXN +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)):: ZZZ + ! model layer height +! REAL :: ZMASSTOT ! total mass for one water category +! ! including the negative values +! REAL :: ZMASSPOS ! total mass for one water category +! ! after removing the negative values +! REAL :: ZRATIO ! ZMASSTOT / ZMASSCOR +! +INTEGER :: ISVBEG ! first scalar index for microphysics +INTEGER :: ISVEND ! last scalar index for microphysics +!UPG*PT +REAL, DIMENSION(:,:,:,:), ALLOCATABLE :: ZSVT ! scalar variable for microphysics only +!UPG*PT + +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3), KRR) :: ZFPR +! +INTEGER :: JMOD, JMOD_IFN +LOGICAL :: GWEST,GEAST,GNORTH,GSOUTH +LOGICAL :: LMFCONV ! =SIZE(PMFCONV)!=0 +! BVIE work array waiting for PINPRI +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2)):: ZINPRI +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)):: ZICEFR +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)):: ZPRCFR +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)):: ZTM +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2)) :: ZSIGQSAT2D +TYPE(DIMPHYEX_t) :: YLDIMPHYEX +REAL, DIMENSION(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3)):: ZDUM +ZSIGQSAT2D(:,:) = PSIGQSAT +! +!------------------------------------------------------------------------------ +! +!* 1. PRELIMINARY COMPUTATIONS +! ------------------------ +! +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +IKB=1+JPVEXT +IKE=SIZE(PZZ,3) - JPVEXT +IKU=SIZE(PZZ,3) +! +CALL FILL_DIMPHYEX(YLDIMPHYEX, SIZE(PZZ,1), SIZE(PZZ,2), SIZE(PZZ,3)) +! +GWEST = LWEST_ll() +GEAST = LEAST_ll() +GSOUTH = LSOUTH_ll() +GNORTH = LNORTH_ll() +! +LMFCONV=(SIZE(PMFCONV)/=0) +! +IF (HCLOUD == 'C2R2' .OR. HCLOUD == 'KHKO') THEN + ISVBEG = NSV_C2R2BEG + ISVEND = NSV_C2R2END +ELSE IF (HCLOUD == 'C3R5') THEN + ISVBEG = NSV_C2R2BEG + ISVEND = NSV_C1R3END +ELSE IF (HCLOUD == 'LIMA') THEN + ISVBEG = NSV_LIMA_BEG + IF (.NOT. LDUST .AND. .NOT. LSALT .AND. .NOT. LORILAM) THEN + ISVEND = NSV_LIMA_END + ELSE + IF (LORILAM) THEN + ISVEND = NSV_AEREND + END IF + IF (LDUST) THEN + ISVEND = NSV_DSTEND + END IF + IF (LSALT) THEN + ISVEND = NSV_SLTEND + END IF + END IF +ELSE + ISVBEG = 0 + ISVEND = 0 +END IF +! +! +! +!* 1. From ORILAM to LIMA: +! +IF (HCLOUD == 'LIMA' .AND. ((LORILAM).OR.(LDUST).OR.(LSALT))) THEN +! ORILAM : tendance s --> variable instant t +ALLOCATE(ZSVT(SIZE(PZZ,1),SIZE(PZZ,2),SIZE(PZZ,3),NSV)) + DO JSV = 1, NSV + ZSVT(:,:,:,JSV) = PSVS(:,:,:,JSV) * PTSTEP / PRHODJ(:,:,:) + END DO + +CALL AER2LIMA(ZSVT(IIB:IIE,IJB:IJE,IKB:IKE,:),& + PRHODREF(IIB:IIE,IJB:IJE,IKB:IKE), & + PRT(IIB:IIE,IJB:IJE,IKB:IKE,1),& + PPABST(IIB:IIE,IJB:IJE,IKB:IKE),& + PTHT(IIB:IIE,IJB:IJE,IKB:IKE), & + PZZ(IIB:IIE,IJB:IJE,IKB:IKE)) + +! LIMA : variable instant t --> tendance s + PSVS(:,:,:,NSV_LIMA_CCN_FREE) = ZSVT(:,:,:,NSV_LIMA_CCN_FREE) * & + PRHODJ(:,:,:) / PTSTEP + PSVS(:,:,:,NSV_LIMA_CCN_FREE+1) = ZSVT(:,:,:,NSV_LIMA_CCN_FREE+1) * & + PRHODJ(:,:,:) / PTSTEP + PSVS(:,:,:,NSV_LIMA_CCN_FREE+2) = ZSVT(:,:,:,NSV_LIMA_CCN_FREE+2) * & + PRHODJ(:,:,:) / PTSTEP + + PSVS(:,:,:,NSV_LIMA_IFN_FREE) = ZSVT(:,:,:,NSV_LIMA_IFN_FREE) * & + PRHODJ(:,:,:) / PTSTEP + PSVS(:,:,:,NSV_LIMA_IFN_FREE+1) = ZSVT(:,:,:,NSV_LIMA_IFN_FREE+1) * & + PRHODJ(:,:,:) / PTSTEP + +DEALLOCATE(ZSVT) +END IF + +!UPG*PT +! +! +!* 2. TRANSFORMATION INTO PHYSICAL TENDENCIES +! --------------------------------------- +! +PTHS(:,:,:) = PTHS(:,:,:) / PRHODJ(:,:,:) +DO JRR = 1,KRR + PRS(:,:,:,JRR) = PRS(:,:,:,JRR) / PRHODJ(:,:,:) +END DO +! +IF (HCLOUD=='C2R2' .OR. HCLOUD=='C3R5' .OR. HCLOUD=='KHKO' .OR. HCLOUD=='LIMA') THEN + DO JSV = ISVBEG, ISVEND + PSVS(:,:,:,JSV) = PSVS(:,:,:,JSV) / PRHODJ(:,:,:) + ENDDO +ENDIF +! +! complete the lateral boundaries to avoid possible problems +! +DO JI=1,JPHEXT + PTHS(JI,:,:) = PTHS(IIB,:,:) + PTHS(IIE+JI,:,:) = PTHS(IIE,:,:) + PTHS(:,JI,:) = PTHS(:,IJB,:) + PTHS(:,IJE+JI,:) = PTHS(:,IJE,:) +! + PRS(JI,:,:,:) = PRS(IIB,:,:,:) + PRS(IIE+JI,:,:,:) = PRS(IIE,:,:,:) + PRS(:,JI,:,:) = PRS(:,IJB,:,:) + PRS(:,IJE+JI,:,:) = PRS(:,IJE,:,:) +END DO +! +! complete the physical boundaries to avoid some computations +! +IF(GWEST .AND. HLBCX(1) /= 'CYCL') PRT(:IIB-1,:,:,2:) = 0.0 +IF(GEAST .AND. HLBCX(2) /= 'CYCL') PRT(IIE+1:,:,:,2:) = 0.0 +IF(GSOUTH .AND. HLBCY(1) /= 'CYCL') PRT(:,:IJB-1,:,2:) = 0.0 +IF(GNORTH .AND. HLBCY(2) /= 'CYCL') PRT(:,IJE+1:,:,2:) = 0.0 +! +IF (HCLOUD=='C2R2' .OR. HCLOUD=='C3R5' .OR. HCLOUD=='KHKO' .OR. HCLOUD=='LIMA') THEN +DO JI=1,JPHEXT + PSVS(JI, :, :, ISVBEG:ISVEND) = PSVS(IIB, :, :, ISVBEG:ISVEND) + PSVS(IIE+JI, :, :, ISVBEG:ISVEND) = PSVS(IIE, :, :, ISVBEG:ISVEND) + PSVS(:, JI, :, ISVBEG:ISVEND) = PSVS(:, IJB, :, ISVBEG:ISVEND) + PSVS(:, IJE+JI, :, ISVBEG:ISVEND) = PSVS(:, IJE, :, ISVBEG:ISVEND) +END DO + ! +! complete the physical boundaries to avoid some computations +! + IF(GWEST .AND. HLBCX(1) /= 'CYCL') PSVT(:IIB-1, :, :, ISVBEG:ISVEND) = 0.0 + IF(GEAST .AND. HLBCX(2) /= 'CYCL') PSVT(IIE+1:, :, :, ISVBEG:ISVEND) = 0.0 + IF(GSOUTH .AND. HLBCY(1) /= 'CYCL') PSVT(:, :IJB-1, :, ISVBEG:ISVEND) = 0.0 + IF(GNORTH .AND. HLBCY(2) /= 'CYCL') PSVT(:, IJE+1:, :, ISVBEG:ISVEND) = 0.0 +ENDIF +! +! complete the vertical boundaries +! +PTHS(:,:,IKB-1) = PTHS(:,:,IKB) +PTHS(:,:,IKE+1) = PTHS(:,:,IKE) +! +PRS(:,:,IKB-1,:) = PRS(:,:,IKB,:) +PRS(:,:,IKE+1,:) = PRS(:,:,IKE,:) +! +PRT(:,:,IKB-1,:) = PRT(:,:,IKB,:) +PRT(:,:,IKE+1,:) = PRT(:,:,IKE,:) +! +IF (HCLOUD == 'C2R2' .OR. HCLOUD == 'C3R5' .OR. HCLOUD == 'KHKO' & + .OR. HCLOUD == 'LIMA') THEN + PSVS(:,:,IKB-1,ISVBEG:ISVEND) = PSVS(:,:,IKB,ISVBEG:ISVEND) + PSVS(:,:,IKE+1,ISVBEG:ISVEND) = PSVS(:,:,IKE,ISVBEG:ISVEND) + PSVT(:,:,IKB-1,ISVBEG:ISVEND) = PSVT(:,:,IKB,ISVBEG:ISVEND) + PSVT(:,:,IKE+1,ISVBEG:ISVEND) = PSVT(:,:,IKE,ISVBEG:ISVEND) +ENDIF +! +! +!* 3. REMOVE NEGATIVE VALUES +! ---------------------- +! +!* 3.1 Non local correction for precipitating species (Rood 87) +! +! IF ( HCLOUD == 'KESS' & +! .OR. HCLOUD == 'ICE3' .OR. HCLOUD == 'ICE4' & +! .OR. HCLOUD == 'C2R2' .OR. HCLOUD == 'C3R5' & +! .OR. HCLOUD == 'KHKO' .OR. HCLOUD == 'LIMA' ) THEN +! ! +! DO JRR = 3,KRR +! SELECT CASE (JRR) +! CASE(3,5,6,7) ! rain, snow, graupel and hail +! +! IF ( MIN_ll( PRS(:,:,:,JRR), IINFO_ll) < 0.0 ) THEN +! ! +! ! compute the total water mass computation +! ! +! ZMASSTOT = MAX( 0. , SUM3D_ll( PRS(:,:,:,JRR), IINFO_ll ) ) +! ! +! ! remove the negative values +! ! +! PRS(:,:,:,JRR) = MAX( 0., PRS(:,:,:,JRR) ) +! ! +! ! compute the new total mass +! ! +! ZMASSPOS = MAX(XMNH_TINY,SUM3D_ll( PRS(:,:,:,JRR), IINFO_ll ) ) +! ! +! ! correct again in such a way to conserve the total mass +! ! +! ZRATIO = ZMASSTOT / ZMASSPOS +! PRS(:,:,:,JRR) = PRS(:,:,:,JRR) * ZRATIO +! ! +! END IF +! END SELECT +! END DO +! END IF +! +!* 3.2 Adjustement for liquid and solid cloud +! +! Remove non-physical negative values (unnecessary in a perfect world) + corresponding budgets +call Sources_neg_correct( hcloud, 'NEGA', krr, ptstep, ppabst, ptht, prt, pths, prs, psvs, prhodj ) +! +!* 3.4 Limitations of Na and Nc to the CCN max number concentration +! +! Commented by O.Thouron 03/2013 +!IF ((HCLOUD == 'C2R2' .OR. HCLOUD == 'C3R5' .OR. HCLOUD == 'KHKO') & +! .AND.(XCONC_CCN > 0)) THEN +! IF ((HACTCCN /= 'ABRK')) THEN +! ZSVT(:,:,:,1) = MIN( ZSVT(:,:,:,1),XCONC_CCN ) +! ZSVT(:,:,:,2) = MIN( ZSVT(:,:,:,2),XCONC_CCN ) +! ZSVS(:,:,:,1) = MIN( ZSVS(:,:,:,1),XCONC_CCN ) +! ZSVS(:,:,:,2) = MIN( ZSVS(:,:,:,2),XCONC_CCN ) +! END IF +!END IF +! +! +!------------------------------------------------------------------------------- +! +SELECT CASE ( HCLOUD ) + CASE ('REVE') +! +!* 4. REVERSIBLE MICROPHYSICAL SCHEME +! ------------------------------- +! + CALL FAST_TERMS ( KRR, KMI, HRAD, HTURBDIM, & + HSCONV, HMF_CLOUD, OSUBG_COND, PTSTEP, & + PRHODJ, PSIGS, PPABST, & + PCF_MF,PRC_MF, & + PRVT=PRT(:,:,:,1), PRCT=PRT(:,:,:,2), & + PRVS=PRS(:,:,:,1), PRCS=PRS(:,:,:,2), & + PTHS=PTHS, PSRCS=PSRCS, PCLDFR=PCLDFR ) +! + CASE ('KESS') +! +!* 5. KESSLER MICROPHYSICAL SCHEME +! ---------------------------- +! +! +!* 5.1 Compute the explicit microphysical sources +! + CALL SLOW_TERMS ( KSPLITR, PTSTEP, KMI, HSUBG_AUCV, & + PZZ, PRHODJ, PRHODREF, PCLDFR, & + PTHT, PRT(:,:,:,1), PRT(:,:,:,2), PRT(:,:,:,3), PPABST, & + PTHS, PRS(:,:,:,1), PRS(:,:,:,2), PRS(:,:,:,3), & + PINPRR, PINPRR3D, PEVAP3D ) +! +!* 5.2 Perform the saturation adjustment +! + CALL FAST_TERMS ( KRR, KMI, HRAD, HTURBDIM, & + HSCONV, HMF_CLOUD, OSUBG_COND, PTSTEP, & + PRHODJ, PSIGS, PPABST, & + PCF_MF,PRC_MF, & + PRVT=PRT(:,:,:,1), PRCT=PRT(:,:,:,2), & + PRVS=PRS(:,:,:,1), PRCS=PRS(:,:,:,2), PRRS=PRS(:,:,:,3), & + PTHS=PTHS, PSRCS=PSRCS, PCLDFR=PCLDFR ) +! +! + CASE ('C2R2','KHKO') +! +!* 7. 2-MOMENT WARM MICROPHYSICAL SCHEME C2R2 or KHKO +! --------------------------------------- +! +! +!* 7.1 Compute the explicit microphysical sources +! +! + CALL RAIN_C2R2_KHKO ( HCLOUD, OACTIT, OSEDC, ORAIN, KSPLITR, PTSTEP, KMI, & + TPFILE, PZZ, PRHODJ, PRHODREF, PEXNREF, & + PPABST, PTHT, PRT(:,:,:,1), PRT(:,:,:,2), PRT(:,:,:,3), & + PTHM, PRCM, PPABSTT, & + PW_ACT,PDTHRAD,PTHS, PRS(:,:,:,1),PRS(:,:,:,2),PRS(:,:,:,3), & + PSVT(:,:,:,NSV_C2R2BEG), PSVT(:,:,:,NSV_C2R2BEG+1), & + PSVT(:,:,:,NSV_C2R2BEG+2), PSVS(:,:,:,NSV_C2R2BEG), & + PSVS(:,:,:,NSV_C2R2BEG+1), PSVS(:,:,:,NSV_C2R2BEG+2), & + PINPRC, PINPRR, PINPRR3D, PEVAP3D , & + PSVT(:,:,:,:), PSOLORG, PMI, HACTCCN, & + PINDEP, PSUPSAT, PNACT ) +! +! +!* 7.2 Perform the saturation adjustment +! + IF (LSUPSAT) THEN + CALL KHKO_NOTADJUST (KRR, KTCOUNT,TPFILE, HRAD, & + PTSTEP, PRHODJ, PPABSTT, PPABST, PRHODREF, PZZ, & + PTHT,PRT(:,:,:,1),PRT(:,:,:,2),PRT(:,:,:,3), & + PTHS,PRS(:,:,:,1),PRS(:,:,:,2),PRS(:,:,:,3), & + PSVS(:,:,:,NSV_C2R2BEG+1), PSVS(:,:,:,NSV_C2R2BEG), & + PSVS(:,:,:,NSV_C2R2BEG+3), PCLDFR, PSRCS, PNPRO, PSSPRO ) +! + ELSE + CALL C2R2_ADJUST ( KRR,TPFILE, HRAD, & + HTURBDIM, OSUBG_COND, PTSTEP, & + PRHODJ, PSIGS, PPABST, & + PTHS=PTHS, PRVS=PRS(:,:,:,1), PRCS=PRS(:,:,:,2), & + PCNUCS=PSVS(:,:,:,NSV_C2R2BEG), & + PCCS=PSVS(:,:,:,NSV_C2R2BEG+1), & + PSRCS=PSRCS, PCLDFR=PCLDFR, PRRS=PRS(:,:,:,3) ) +! + END IF +! + CASE ('ICE3') +! +!* 9. MIXED-PHASE MICROPHYSICAL SCHEME (WITH 3 ICE SPECIES) +! ----------------------------------------------------- +! + allocate( zexn( size( pzz, 1 ), size( pzz, 2 ), size( pzz, 3 ) ) ) + ZEXN(:,:,:)= (PPABST(:,:,:)/CST%XP00)**(CST%XRD/CST%XCPD) +! +!* 9.1 Compute the explicit microphysical sources +! +! + DO JK=IKB,IKE + ZDZZ(:,:,JK)=PZZ(:,:,JK+1)-PZZ(:,:,JK) + ENDDO + ZZZ = MZF( PZZ ) + IF(LRED .AND. LADJ_BEFORE) THEN + CALL ICE_ADJUST (YLDIMPHYEX,CST, RAIN_ICE_PARAMN, NEBN, TURBN, & + PARAM_ICEN, TBUCONF, KRR, & + 'ADJU', & + PTSTEP, ZSIGQSAT2D, & + PRHODJ, PEXNREF, PRHODREF, PSIGS, LMFCONV,PMFCONV, PPABST, ZZZ, & + ZEXN, PCF_MF, PRC_MF, PRI_MF, & + ZDUM, ZDUM, ZDUM, ZDUM, ZDUM, & + PRV=PRS(:,:,:,1)*PTSTEP, PRC=PRS(:,:,:,2)*PTSTEP, & + PRVS=PRS(:,:,:,1), PRCS=PRS(:,:,:,2), & + PTH=PTHS*PTSTEP, PTHS=PTHS, & + OCOMPUTE_SRC=SIZE(PSRCS, 3)/=0, PSRCS=PSRCS, PCLDFR=PCLDFR, & + PRR=PRS(:,:,:,3)*PTSTEP, & + PRI=PRS(:,:,:,4)*PTSTEP, PRIS=PRS(:,:,:,4), & + PRS=PRS(:,:,:,5)*PTSTEP, & + PRG=PRS(:,:,:,6)*PTSTEP, & + TBUDGETS=TBUDGETS,KBUDGETS=SIZE(TBUDGETS), & + PHLC_HRC=PHLC_HRC, PHLC_HCF=PHLC_HCF, & + PHLI_HRI=PHLI_HRI, PHLI_HCF=PHLI_HCF ) + ENDIF + IF (LRED) THEN + CALL RAIN_ICE (YLDIMPHYEX,CST, PARAM_ICEN, RAIN_ICE_PARAMN, & + RAIN_ICE_DESCRN, TBUCONF,& + PTSTEP, KRR, ZEXN, & + ZDZZ, PRHODJ, PRHODREF, PEXNREF, PPABST, PCIT,PCLDFR,& + PHLC_HRC, PHLC_HCF, PHLI_HRI, PHLI_HCF, & + PTHT, PRT(:,:,:,1), PRT(:,:,:,2), & + PRT(:,:,:,3), PRT(:,:,:,4), & + PRT(:,:,:,5), PRT(:,:,:,6), & + PTHS, PRS(:,:,:,1), PRS(:,:,:,2), PRS(:,:,:,3), & + PRS(:,:,:,4), PRS(:,:,:,5), PRS(:,:,:,6), & + PINPRC,PINPRR, PEVAP3D, & + PINPRS, PINPRG, PINDEP, PRAINFR, PSIGS, & + TBUDGETS,SIZE(TBUDGETS), & + PSEA,PTOWN, PFPR=ZFPR ) + ELSE + CALL RAIN_ICE_OLD (YLDIMPHYEX, OSEDIC, CSEDIM, HSUBG_AUCV, OWARM, 1, IKU, 1, & + KSPLITR, PTSTEP, KRR, & + ZDZZ, PRHODJ, PRHODREF, PEXNREF, PPABST, PCIT, PCLDFR,& + PTHT, PRT(:,:,:,1), PRT(:,:,:,2), & + PRT(:,:,:,3), PRT(:,:,:,4), & + PRT(:,:,:,5), PRT(:,:,:,6), & + PTHS, PRS(:,:,:,1), PRS(:,:,:,2), PRS(:,:,:,3), & + PRS(:,:,:,4), PRS(:,:,:,5), PRS(:,:,:,6), & + PINPRC,PINPRR, PINPRR3D, PEVAP3D, & + PINPRS, PINPRG, PSIGS,PINDEP, PRAINFR, & + PSEA, PTOWN, PFPR=ZFPR) + END IF + +! +!* 9.2 Perform the saturation adjustment over cloud ice and cloud water +! +! + IF (.NOT. LRED .OR. (LRED .AND. LADJ_AFTER) ) THEN + CALL ICE_ADJUST (YLDIMPHYEX,CST, RAIN_ICE_PARAMN, NEBN, TURBN, & + PARAM_ICEN, TBUCONF, KRR, & + 'DEPI', & + PTSTEP, ZSIGQSAT2D, & + PRHODJ, PEXNREF, PRHODREF, PSIGS, LMFCONV, PMFCONV,PPABST, ZZZ, & + ZEXN, PCF_MF, PRC_MF, PRI_MF, & + ZDUM, ZDUM, ZDUM, ZDUM, ZDUM, & + PRV=PRS(:,:,:,1)*PTSTEP, PRC=PRS(:,:,:,2)*PTSTEP, & + PRVS=PRS(:,:,:,1), PRCS=PRS(:,:,:,2), & + PTH=PTHS*PTSTEP, PTHS=PTHS, & + OCOMPUTE_SRC=SIZE(PSRCS, 3)/=0, PSRCS=PSRCS, PCLDFR=PCLDFR, & + PRR=PRS(:,:,:,3)*PTSTEP, & + PRI=PRS(:,:,:,4)*PTSTEP, PRIS=PRS(:,:,:,4), & + PRS=PRS(:,:,:,5)*PTSTEP, & + PRG=PRS(:,:,:,6)*PTSTEP, & + TBUDGETS=TBUDGETS,KBUDGETS=SIZE(TBUDGETS), & + PHLC_HRC=PHLC_HRC, PHLC_HCF=PHLC_HCF, & + PHLI_HRI=PHLI_HRI, PHLI_HCF=PHLI_HCF ) + END IF + + deallocate( zexn ) +! + CASE ('ICE4') +! +!* 10. MIXED-PHASE MICROPHYSICAL SCHEME (WITH 4 ICE SPECIES) +! ----------------------------------------------------- +! + allocate( zexn( size( pzz, 1 ), size( pzz, 2 ), size( pzz, 3 ) ) ) + ZEXN(:,:,:)= (PPABST(:,:,:)/CST%XP00)**(CST%XRD/CST%XCPD) +! +!* 10.1 Compute the explicit microphysical sources +! +! + DO JK=IKB,IKE + ZDZZ(:,:,JK)=PZZ(:,:,JK+1)-PZZ(:,:,JK) + ENDDO + ZZZ = MZF( PZZ ) + IF(LRED .AND. LADJ_BEFORE) THEN + CALL ICE_ADJUST (YLDIMPHYEX,CST, RAIN_ICE_PARAMN, NEBN, TURBN, & + PARAM_ICEN, TBUCONF, KRR, & + 'ADJU', & + PTSTEP, ZSIGQSAT2D, & + PRHODJ, PEXNREF, PRHODREF, PSIGS, LMFCONV,PMFCONV, PPABST, ZZZ, & + ZEXN, PCF_MF, PRC_MF, PRI_MF, & + ZDUM, ZDUM, ZDUM, ZDUM, ZDUM, & + PRV=PRS(:,:,:,1)*PTSTEP, PRC=PRS(:,:,:,2)*PTSTEP, & + PRVS=PRS(:,:,:,1), PRCS=PRS(:,:,:,2), & + PTH=PTHS*PTSTEP, PTHS=PTHS, & + OCOMPUTE_SRC=SIZE(PSRCS, 3)/=0, PSRCS=PSRCS, PCLDFR=PCLDFR, & + PRR=PRS(:,:,:,3)*PTSTEP, & + PRI=PRS(:,:,:,4)*PTSTEP, PRIS=PRS(:,:,:,4), & + PRS=PRS(:,:,:,5)*PTSTEP, & + PRG=PRS(:,:,:,6)*PTSTEP, & + TBUDGETS=TBUDGETS,KBUDGETS=SIZE(TBUDGETS), & + PRH=PRS(:,:,:,7)*PTSTEP, & + PHLC_HRC=PHLC_HRC, PHLC_HCF=PHLC_HCF, & + PHLI_HRI=PHLI_HRI, PHLI_HCF=PHLI_HCF ) + ENDIF + IF (LRED) THEN + CALL RAIN_ICE (YLDIMPHYEX,CST, PARAM_ICEN, RAIN_ICE_PARAMN, & + RAIN_ICE_DESCRN, TBUCONF,& + PTSTEP, KRR, ZEXN, & + ZDZZ, PRHODJ, PRHODREF, PEXNREF, PPABST, PCIT, PCLDFR,& + PHLC_HRC, PHLC_HCF, PHLI_HRI, PHLI_HCF, & + PTHT, PRT(:,:,:,1), PRT(:,:,:,2), & + PRT(:,:,:,3), PRT(:,:,:,4), & + PRT(:,:,:,5), PRT(:,:,:,6), & + PTHS, PRS(:,:,:,1), PRS(:,:,:,2), PRS(:,:,:,3), & + PRS(:,:,:,4), PRS(:,:,:,5), PRS(:,:,:,6), & + PINPRC, PINPRR, PEVAP3D, & + PINPRS, PINPRG, PINDEP, PRAINFR, PSIGS, & + TBUDGETS,SIZE(TBUDGETS), & + PSEA, PTOWN, & + PRT(:,:,:,7), PRS(:,:,:,7), PINPRH, PFPR=ZFPR ) + ELSE + CALL RAIN_ICE_OLD (YLDIMPHYEX, OSEDIC, CSEDIM, HSUBG_AUCV, OWARM, 1, IKU, 1, & + KSPLITR, PTSTEP, KRR, & + ZDZZ, PRHODJ, PRHODREF, PEXNREF, PPABST, PCIT, PCLDFR,& + PTHT, PRT(:,:,:,1), PRT(:,:,:,2), & + PRT(:,:,:,3), PRT(:,:,:,4), & + PRT(:,:,:,5), PRT(:,:,:,6), & + PTHS, PRS(:,:,:,1), PRS(:,:,:,2), PRS(:,:,:,3), & + PRS(:,:,:,4), PRS(:,:,:,5), PRS(:,:,:,6), & + PINPRC,PINPRR, PINPRR3D, PEVAP3D, & + PINPRS, PINPRG, PSIGS,PINDEP, PRAINFR, & + PSEA, PTOWN, & + PRT(:,:,:,7), PRS(:,:,:,7), PINPRH, PFPR=ZFPR) + END IF + + +! +!* 10.2 Perform the saturation adjustment over cloud ice and cloud water +! + IF (.NOT. LRED .OR. (LRED .AND. LADJ_AFTER) ) THEN + CALL ICE_ADJUST (YLDIMPHYEX,CST, RAIN_ICE_PARAMN, NEBN, TURBN, & + PARAM_ICEN, TBUCONF, KRR, & + 'DEPI', & + PTSTEP, ZSIGQSAT2D, & + PRHODJ, PEXNREF, PRHODREF, PSIGS, LMFCONV, PMFCONV,PPABST, ZZZ, & + ZEXN, PCF_MF, PRC_MF, PRI_MF, & + ZDUM, ZDUM, ZDUM, ZDUM, ZDUM, & + PRV=PRS(:,:,:,1)*PTSTEP, PRC=PRS(:,:,:,2)*PTSTEP, & + PRVS=PRS(:,:,:,1), PRCS=PRS(:,:,:,2), & + PTH=PTHS*PTSTEP, PTHS=PTHS, & + OCOMPUTE_SRC=SIZE(PSRCS, 3)/=0, PSRCS=PSRCS, PCLDFR=PCLDFR, & + PRR=PRS(:,:,:,3)*PTSTEP, & + PRI=PRS(:,:,:,4)*PTSTEP, PRIS=PRS(:,:,:,4), & + PRS=PRS(:,:,:,5)*PTSTEP, & + PRG=PRS(:,:,:,6)*PTSTEP, & + TBUDGETS=TBUDGETS,KBUDGETS=SIZE(TBUDGETS), & + PRH=PRS(:,:,:,7)*PTSTEP, & + PHLC_HRC=PHLC_HRC, PHLC_HCF=PHLC_HCF, & + PHLI_HRI=PHLI_HRI, PHLI_HCF=PHLI_HCF ) + END IF + + deallocate( zexn ) +! +! +!* 12. 2-MOMENT MIXED-PHASE MICROPHYSICAL SCHEME LIMA +! -------------------------------------------------------------- +! +! +!* 12.1 Compute the explicit microphysical sources +! + CASE ('LIMA') + ! + DO JK=IKB,IKE + ZDZZ(:,:,JK)=PZZ(:,:,JK+1)-PZZ(:,:,JK) + ENDDO + ZZZ = MZF( PZZ ) + IF (LPTSPLIT) THEN + CALL LIMA (1, IKU, 1, & + PTSTEP, TPFILE, & + PRHODREF, PEXNREF, ZDZZ, & + PRHODJ, PPABST, & + NMOD_CCN, NMOD_IFN, NMOD_IMM, & + PDTHRAD, PTHT, PRT, & + PSVT(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END), PW_ACT, & + PTHS, PRS, PSVS(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END), & + PINPRC, PINDEP, PINPRR, ZINPRI, PINPRS, PINPRG, PINPRH, & + PEVAP3D, PCLDFR, PICEFR, PRAINFR ) + ELSE + + IF (OWARM) CALL LIMA_WARM(OACTIT, OSEDC, ORAIN, KSPLITR, PTSTEP, KMI, & + TPFILE, KRR, PZZ, PRHODJ, & + PRHODREF, PEXNREF, PW_ACT, PPABST, & + PDTHRAD, & + PTHT, PRT, PSVT(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END), & + PTHS, PRS, PSVS(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END), & + PINPRC, PINPRR, PINDEP, PINPRR3D, PEVAP3D ) +! + IF (LCOLD) CALL LIMA_COLD(OSEDI, OHHONI, KSPLITG, PTSTEP, KMI, & + KRR, PZZ, PRHODJ, & + PRHODREF, PEXNREF, PPABST, PW_ACT, & + PTHT, PRT, PSVT(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END), & + PTHS, PRS, PSVS(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END), & + PINPRS, PINPRG, PINPRH ) +! + IF (OWARM .AND. LCOLD) CALL LIMA_MIXED(OSEDI, OHHONI, KSPLITG, PTSTEP, KMI, & + KRR, PZZ, PRHODJ, & + PRHODREF, PEXNREF, PPABST, PW_ACT, & + PTHT, PRT, PSVT(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END), & + PTHS, PRS, PSVS(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END) ) + ENDIF +! +!* 12.2 Perform the saturation adjustment +! + IF (LSPRO) THEN + CALL LIMA_NOTADJUST (KMI, TPFILE, HRAD, & + PTSTEP, PRHODJ, PPABSTT, PPABST, PRHODREF, PEXNREF, PZZ, & + PTHT,PRT, PSVT(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END), & + PTHS,PRS, PSVS(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END), & + PCLDFR, PICEFR, PRAINFR, PSRCS ) + ELSE IF (LPTSPLIT) THEN + CALL LIMA_ADJUST_SPLIT(YLDIMPHYEX, KRR, KMI, TPFILE, CCONDENS, CLAMBDA3, & + OSUBG_COND, OSIGMAS, PTSTEP, PSIGQSAT, & + PRHODREF, PRHODJ, PEXNREF, PSIGS, PMFCONV, PPABST, PPABSTT, ZZZ,& + PDTHRAD, PW_ACT, & + PRT, PRS, PSVT(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END), & + PSVS(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END), & + PTHS, PSRCS, PCLDFR, PICEFR, PRC_MF, PRI_MF, PCF_MF ) + ELSE + CALL LIMA_ADJUST(KRR, KMI, TPFILE, & + OSUBG_COND, PTSTEP, & + PRHODREF, PRHODJ, PEXNREF, PPABST, PPABSTT, & + PRT, PRS, PSVT(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END), & + PSVS(:,:,:,NSV_LIMA_BEG:NSV_LIMA_END), & + PTHS, PSRCS, PCLDFR, PICEFR, PRAINFR ) + ENDIF +! +END SELECT +! +IF(HCLOUD=='ICE3' .OR. HCLOUD=='ICE4' ) THEN + PINPRC3D=ZFPR(:,:,:,2) / CST%XRHOLW + PINPRR3D=ZFPR(:,:,:,3) / CST%XRHOLW + PINPRS3D=ZFPR(:,:,:,5) / CST%XRHOLW + PINPRG3D=ZFPR(:,:,:,6) / CST%XRHOLW + IF(KRR==7) PINPRH3D=ZFPR(:,:,:,7) / CST%XRHOLW + WHERE (PRT(:,:,:,2) > 1.E-04 ) + PSPEEDC=ZFPR(:,:,:,2) / (PRT(:,:,:,2) * PRHODREF(:,:,:)) + ENDWHERE + WHERE (PRT(:,:,:,3) > 1.E-04 ) + PSPEEDR=ZFPR(:,:,:,3) / (PRT(:,:,:,3) * PRHODREF(:,:,:)) + ENDWHERE + WHERE (PRT(:,:,:,5) > 1.E-04 ) + PSPEEDS=ZFPR(:,:,:,5) / (PRT(:,:,:,5) * PRHODREF(:,:,:)) + ENDWHERE + WHERE (PRT(:,:,:,6) > 1.E-04 ) + PSPEEDG=ZFPR(:,:,:,6) / (PRT(:,:,:,6) * PRHODREF(:,:,:)) + ENDWHERE + IF(KRR==7) THEN + WHERE (PRT(:,:,:,7) > 1.E-04 ) + PSPEEDH=ZFPR(:,:,:,7) / (PRT(:,:,:,7) * PRHODREF(:,:,:)) + ENDWHERE + ENDIF +ENDIF + +! Remove non-physical negative values (unnecessary in a perfect world) + corresponding budgets +call Sources_neg_correct( hcloud, 'NECON', krr, ptstep, ppabst, ptht, prt, pths, prs, psvs, prhodj ) + +!------------------------------------------------------------------------------- +! +! +!* 13. SWITCH BACK TO THE PROGNOSTIC VARIABLES +! --------------------------------------- +! +PTHS(:,:,:) = PTHS(:,:,:) * PRHODJ(:,:,:) +! +DO JRR = 1,KRR + PRS(:,:,:,JRR) = PRS(:,:,:,JRR) * PRHODJ(:,:,:) +END DO +! +IF (HCLOUD=='C2R2' .OR. HCLOUD=='C3R5' .OR. HCLOUD=='KHKO' .OR. HCLOUD=='LIMA') THEN + DO JSV = ISVBEG, ISVEND + PSVS(:,:,:,JSV) = PSVS(:,:,:,JSV) * PRHODJ(:,:,:) + ENDDO +ENDIF + +!------------------------------------------------------------------------------- +! +END SUBROUTINE RESOLVED_CLOUD diff --git a/src/mesonh/ext/rrcolss.f90 b/src/mesonh/ext/rrcolss.f90 new file mode 100644 index 0000000000000000000000000000000000000000..0dac2fa04b4ba96dba68bb07e5ded522557851ea --- /dev/null +++ b/src/mesonh/ext/rrcolss.f90 @@ -0,0 +1,315 @@ +!MNH_LIC Copyright 1995-2019 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_RRCOLSS +! ################### +! +INTERFACE +! + SUBROUTINE RRCOLSS( KND, PALPHAS, PNUS, PALPHAR, PNUR, & + PESR, PEXMASSR, PFALLS, PEXFALLS, PFALLEXPS, PFALLR, PEXFALLR, & + PLBDASMAX, PLBDARMAX, PLBDASMIN, PLBDARMIN, & + PDINFTY, PRRCOLSS, PAG, PBS, PAS ) +! +INTEGER, INTENT(IN) :: KND ! Number of discrete size intervals in DS and DR +! +REAL, INTENT(IN) :: PALPHAS ! First shape parameter of the aggregates + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PNUS ! Second shape parameter of the aggregates + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PALPHAR ! First shape parameter of the rain + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PNUR ! Second shape parameter of the rain + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PESR ! Efficiency of aggregates collecting rain +REAL, INTENT(IN) :: PEXMASSR ! Mass exponent of rain +REAL, INTENT(IN) :: PFALLS ! Fall speed constant of aggregates +REAL, INTENT(IN) :: PEXFALLS ! Fall speed exponent of aggregates +REAL, INTENT(IN) :: PFALLEXPS ! Fall speed exponential of aggregates (Thompson 2008) +REAL, INTENT(IN) :: PFALLR ! Fall speed constant of rain +REAL, INTENT(IN) :: PEXFALLR ! Fall speed exponent of rain +REAL, INTENT(IN) :: PLBDASMAX ! Maximun slope of size distribution of aggregates +REAL, INTENT(IN) :: PLBDARMAX ! Maximun slope of size distribution of rain +REAL, INTENT(IN) :: PLBDASMIN ! Minimun slope of size distribution of aggregates +REAL, INTENT(IN) :: PLBDARMIN ! Minimun slope of size distribution of rain +REAL, INTENT(IN) :: PDINFTY ! Factor to define the largest diameter up to + ! which the diameter integration is performed +REAL, INTENT(IN) :: PAG, PBS, PAS +! +REAL, DIMENSION(:,:), INTENT(INOUT) :: PRRCOLSS! Scaled fall speed difference in + ! the mass collection kernel as a + ! function of LAMBDAX and LAMBDAZ +! + END SUBROUTINE RRCOLSS +! +END INTERFACE +! + END MODULE MODI_RRCOLSS +! ######################################################################## + SUBROUTINE RRCOLSS( KND, PALPHAS, PNUS, PALPHAR, PNUR, & + PESR, PEXMASSR, PFALLS, PEXFALLS, PFALLEXPS, PFALLR, PEXFALLR, & + PLBDASMAX, PLBDARMAX, PLBDASMIN, PLBDARMIN, & + PDINFTY, PRRCOLSS, PAG, PBS, PAS ) +! ######################################################################## +! +! +! +!!**** * - Build up a look-up table containing the scaled fall speed +!! difference between size distributed particles of aggregates and Z +!! +!! +!! PURPOSE +!! ------- +!! The purpose of this routine is to integrate numerically the scaled fall +!! speed difference between aggregates and rain for use in collection +!! kernels. A first integral of the form +!! +!! infty Dz_max +!! / / +!! |{| } +!! |{| E_xz (Dx+Dz)^2 |cxDx^dx-czDz^dz| Dz^bz n(Dz) dDz} n(Dx) dDx +!! |{| } +!! / / +!! 0 Dz_min +!! +!! is evaluated and normalised by a second integral of the form +!! +!! infty +!! / / +!! |{| } +!! |{| (Dx+Dz)^2 Dz^bz n(Dz) dDz} n(Dx) dDx +!! |{| } +!! / / +!! 0 +!! +!! The result is stored in a two-dimensional array. +!! +!!** METHOD +!! ------ +!! The free parameters of the size distribution function of aggregates and Z +!! (slope parameter LAMBDA) are discretized with a geometrical rate in a +!! specific range +!! LAMBDA = exp( (Log(LAMBDA_max) - Log(LAMBDA_min))/N_interval ) +!! The two above integrals are performed using the trapezoidal scheme. +!! +!! EXTERNAL +!! -------- +!! MODI_GENERAL_GAMMA: Generalized gamma distribution law +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! MODD_CST : XPI,XRHOLW +!! MODD_RAIN_ICE_DESCR: XAS,XAS,XBS +!! +!! REFERENCE +!! --------- +!! B.S. Ferrier , 1994 : A Double-Moment Multiple-Phase Four-Class +!! Bulk Ice Scheme,JAS,51,249-280. +!! +!! AUTHOR +!! ------ +!! J.-P. Pinty * Laboratoire d'Aerologie * +!! +!! MODIFICATIONS +!! ------------- +!! Original 8/11/95 +!! +! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function +! J. Wurtz 03/2022: new snow characteristics +! +!------------------------------------------------------------------------------- +! +! +!* 0. DECLARATIONS +! ------------ +! +! +USE MODI_GENERAL_GAMMA +! +USE MODD_CST +USE MODD_RAIN_ICE_DESCR_n +! +IMPLICIT NONE +! +! +!* 0.1 Declarations of dummy arguments +! ------------------------------- +! +! +INTEGER, INTENT(IN) :: KND ! Number of discrete size intervals in DS and DR +! +REAL, INTENT(IN) :: PALPHAS ! First shape parameter of the aggregates + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PNUS ! Second shape parameter of the aggregates + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PALPHAR ! First shape parameter of the rain + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PNUR ! Second shape parameter of the rain + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PESR ! Efficiency of aggregates collecting rain +REAL, INTENT(IN) :: PEXMASSR ! Mass exponent of rain +REAL, INTENT(IN) :: PFALLS ! Fall speed constant of aggregates +REAL, INTENT(IN) :: PEXFALLS ! Fall speed exponent of aggregates +REAL, INTENT(IN) :: PFALLEXPS ! Fall speed exponential of aggregates (Thompson 2008) +REAL, INTENT(IN) :: PFALLR ! Fall speed constant of rain +REAL, INTENT(IN) :: PEXFALLR ! Fall speed exponent of rain +REAL, INTENT(IN) :: PLBDASMAX ! Maximun slope of size distribution of aggregates +REAL, INTENT(IN) :: PLBDARMAX ! Maximun slope of size distribution of rain +REAL, INTENT(IN) :: PLBDASMIN ! Minimun slope of size distribution of aggregates +REAL, INTENT(IN) :: PLBDARMIN ! Minimun slope of size distribution of rain +REAL, INTENT(IN) :: PDINFTY ! Factor to define the largest diameter up to + ! which the diameter integration is performed +REAL, INTENT(IN) :: PAG, PBS, PAS +! +REAL, DIMENSION(:,:), INTENT(INOUT) :: PRRCOLSS! Scaled fall speed difference in + ! the mass collection kernel as a + ! function of LAMBDAX and LAMBDAZ +! +! +!* 0.2 Declarations of local variables +! ------------------------------- +! +! +INTEGER :: JLBDAS ! Slope index of the size distribution of aggregates +INTEGER :: JLBDAR ! Slope index of the size distribution of rain +INTEGER :: JDS ! Diameter index of a particle of aggregates +INTEGER :: JDR ! Diameter index of a particle of rain +! +INTEGER :: INR ! Number of diameter step for the partial integration +! +! +REAL :: ZLBDAS ! Current slope parameter LAMBDA of aggregates +REAL :: ZLBDAR ! Current slope parameter LAMBDA of rain +REAL :: ZDLBDAS ! Growth rate of the slope parameter LAMBDA of aggregates +REAL :: ZDLBDAR ! Growth rate of the slope parameter LAMBDA of rain +REAL :: ZDDS ! Integration step of the diameter of aggregates +REAL :: ZDDSCALR! Integration step of the diameter of rain (scaling integral) +REAL :: ZDDCOLLR! Integration step of the diameter of rain (fallspe integral) +REAL :: ZDS ! Current diameter of the particle aggregates +REAL :: ZDR ! Current diameter of the rain +REAL :: ZDRMAX ! Maximal diameter of the raindrops where the integration ends +REAL :: ZCOLLR ! Single integral of the mass weighted fall speed difference + ! over the spectrum of rain +REAL :: ZCOLLDRMAX ! Maximum ending point for the partial integral +REAL :: ZCOLLSR ! Double integral of the mass weighted fall speed difference + ! over the spectra of aggregates and rain +REAL :: ZSCALR ! Single integral of the scaling factor over + ! the spectrum of rain +REAL :: ZSCALSR ! Double integral of the scaling factor over + ! the spectra of aggregates and rain +REAL :: ZFUNC ! Ancillary function +REAL :: ZCST1 +! +! +!------------------------------------------------------------------------------- +! +! +!* 1 COMPUTE THE SCALED VELOCITY DIFFERENCE IN THE MASS +!* COLLECTION KERNEL, +! ------------------------------------------------- +! +! +! +!* 1.0 Initialization +! +PRRCOLSS(:,:) = 0.0 +ZCST1 = (3.0/XPI)/XRHOLW +! +!* 1.1 Compute the growth rate of the slope factors LAMBDA +! +ZDLBDAS = EXP( LOG(PLBDASMAX/PLBDASMIN)/REAL(SIZE(PRRCOLSS(:,:),1)-1) ) +ZDLBDAR = EXP( LOG(PLBDARMAX/PLBDARMIN)/REAL(SIZE(PRRCOLSS(:,:),2)-1) ) +! +!* 1.2 Scan the slope factors LAMBDAX and LAMBDAZ +! +DO JLBDAS = 1,SIZE(PRRCOLSS(:,:),1) + ZLBDAS = PLBDASMIN * ZDLBDAS ** (JLBDAS-1) +! +!* 1.3 Compute the diameter steps +! + ZDDS = PDINFTY / (REAL(KND) * ZLBDAS) + DO JLBDAR = 1,SIZE(PRRCOLSS(:,:),2) + ZLBDAR = PLBDARMIN * ZDLBDAR ** (JLBDAR-1) +! +!* 1.4 Initialize the collection integrals +! + ZSCALSR = 0.0 + ZCOLLSR = 0.0 +! +!* 1.5 Compute the diameter steps +! + ZDDSCALR = PDINFTY / (REAL(KND) * ZLBDAR) +! +!* 1.6 Scan over the diameters DS and DR +! + DO JDS = 1,KND-1 + ZDS = ZDDS * REAL(JDS) + ZSCALR = 0.0 + ZCOLLR = 0.0 + DO JDR = 1,KND-1 + ZDR = ZDDSCALR * REAL(JDR) +! +!* 1.7 Compute the normalization factor by integration over the +! dimensional spectrum of rain +! + ZSCALR = ZSCALR + (ZDS+ZDR)**2 * ZDR**PEXMASSR & + * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDR) + END DO +! +!* 1.8 Compute the scaled fall speed difference by partial +! integration over the dimensional spectrum of rain +! + ZFUNC = PAG - PAS*ZDS**(PBS-3.0) ! approximate limit is Ds=240 microns + IF( ZFUNC>0.0 ) THEN + ZDRMAX = ZDS*( ZCST1*ZFUNC )**0.3333333 + ELSE + ZDRMAX = PDINFTY / ZLBDAR + END IF + IF( ZDS>1.0E-4 ) THEN ! allow computation if Ds>100 microns + ! corresponding to a maximal density of the aggregates of XRHOLW + IF( ZDRMAX >= 0.5*ZDDSCALR ) THEN + INR = CEILING( ZDRMAX/ZDDSCALR ) + ZDDCOLLR = ZDRMAX / REAL(INR) + IF (INR>=KND ) THEN + INR = KND + ZDDCOLLR = ZDDSCALR + END IF + DO JDR = 1,INR-1 + ZDR = ZDDCOLLR * REAL(JDR) + ZCOLLR = ZCOLLR + (ZDS+ZDR)**2 * ZDR**PEXMASSR & + * PESR * ABS(PFALLS*ZDS**PEXFALLS * EXP(-(PFALLEXPS*ZDS)**PALPHAS)-PFALLR*ZDR**PEXFALLR) & + * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDR) + END DO + ZCOLLDRMAX = (ZDS+ZDRMAX)**2 * ZDRMAX**PEXMASSR & + * PESR * ABS(PFALLS*ZDS**PEXFALLS* EXP(-(PFALLEXPS*ZDS)**PALPHAS)-PFALLR*ZDRMAX**PEXFALLR) & + * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDRMAX) + ZCOLLR = (ZCOLLR + 0.5*ZCOLLDRMAX)*(ZDDCOLLR/ZDDSCALR) +! +!* 1.9 Compute the normalization factor by integration over the +! dimensional spectrum of aggregates +! + ZFUNC = GENERAL_GAMMA(PALPHAS,PNUS,ZLBDAS,ZDS) + ZSCALSR = ZSCALSR + ZSCALR * ZFUNC +! +!* 1.10 Compute the scaled fall speed difference by integration over +! the dimensional spectrum of aggregates +! + ZCOLLSR = ZCOLLSR + ZCOLLR * ZFUNC + END IF +! +! Otherwise ZDRMAX = 0.0 so the density of the graupel cannot be reached +! and so PRRCOLSS(JLBDAS,JLBDAR) = 0.0 ! +! + END IF + END DO +! +!* 1.11 Scale the fall speed difference +! + IF( ZSCALSR>0.0 ) PRRCOLSS(JLBDAS,JLBDAR) = ZCOLLSR / ZSCALSR + END DO +END DO +! +END SUBROUTINE RRCOLSS diff --git a/src/mesonh/ext/rscolrg.f90 b/src/mesonh/ext/rscolrg.f90 new file mode 100644 index 0000000000000000000000000000000000000000..26969afcd4b3282beafb10e659a0b0d547cfc125 --- /dev/null +++ b/src/mesonh/ext/rscolrg.f90 @@ -0,0 +1,315 @@ +!MNH_LIC Copyright 1995-2019 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_RSCOLRG +! ################### +! +INTERFACE +! + SUBROUTINE RSCOLRG( KND, PALPHAS, PZNUS, PALPHAR, PNUR, & + PESR, PEXMASSS, PFALLS, PEXFALLS, PFALLEXPS, PFALLR, PEXFALLR, & + PLBDASMAX, PLBDARMAX, PLBDASMIN, PLBDARMIN, & + PDINFTY, PRSCOLRG,PAG, PBS, PAS ) +! +INTEGER, INTENT(IN) :: KND ! Number of discrete size intervals in DS and DR +! +REAL, INTENT(IN) :: PALPHAS ! First shape parameter of the aggregates + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PZNUS ! Second shape parameter of the aggregates + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PALPHAR ! First shape parameter of the rain + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PNUR ! Second shape parameter of the rain + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PESR ! Efficiency of the aggregates collecting rain +REAL, INTENT(IN) :: PEXMASSS ! Mass exponent of the aggregates +REAL, INTENT(IN) :: PFALLS ! Fall speed constant of the aggregates +REAL, INTENT(IN) :: PEXFALLS ! Fall speed exponent of the aggregates +REAL, INTENT(IN) :: PFALLEXPS ! Fall speed exponential constant of the aggregates +REAL, INTENT(IN) :: PFALLR ! Fall speed constant of rain +REAL, INTENT(IN) :: PEXFALLR ! Fall speed exponent of rain +REAL, INTENT(IN) :: PLBDASMAX ! Maximun slope of size distribution of the aggregates +REAL, INTENT(IN) :: PLBDARMAX ! Maximun slope of size distribution of rain +REAL, INTENT(IN) :: PLBDASMIN ! Minimun slope of size distribution of the aggregates +REAL, INTENT(IN) :: PLBDARMIN ! Minimun slope of size distribution of rain +REAL, INTENT(IN) :: PDINFTY ! Factor to define the largest diameter up to + ! which the diameter integration is performed +REAL, INTENT(IN) :: PAG, PBS, PAS +! +REAL, DIMENSION(:,:), INTENT(INOUT) :: PRSCOLRG! Scaled fall speed difference in + ! the mass collection kernel as a + ! function of LAMBDAX and LAMBDAZ +! + END SUBROUTINE RSCOLRG +! +END INTERFACE +! + END MODULE MODI_RSCOLRG +! ######################################################################## + SUBROUTINE RSCOLRG( KND, PALPHAS, PZNUS, PALPHAR, PNUR, & + PESR, PEXMASSS, PFALLS, PEXFALLS, PFALLEXPS, PFALLR, PEXFALLR, & + PLBDASMAX, PLBDARMAX, PLBDASMIN, PLBDARMIN, & + PDINFTY, PRSCOLRG,PAG, PBS, PAS ) +! ######################################################################## +! +! +! +!!**** * - Build up a look-up table containing the scaled fall speed +!! difference between size distributed particles of the aggregates and Z +!! +!! +!! PURPOSE +!! ------- +!! The purpose of this routine is to integrate numerically the scaled fall +!! speed difference between aggregates and rain for use in collection +!! kernels. A first integral of the form +!! +!! infty Dz_max +!! / / +!! |{| } +!! |{| E_xz (Dx+Dz)^2 |cxDx^dx-czDz^dz| Dz^bz n(Dz) dDz} n(Dx) dDx +!! |{| } +!! / / +!! 0 Dz_min +!! +!! is evaluated and normalised by a second integral of the form +!! +!! infty +!! / / +!! |{| } +!! |{| (Dx+Dz)^2 Dz^bz n(Dz) dDz} n(Dx) dDx +!! |{| } +!! / / +!! 0 +!! +!! The result is stored in a two-dimensional array. +!! +!!** METHOD +!! ------ +!! The free parameters of the size distribution function of the aggregates +!! and Z (slope parameter LAMBDA) are discretized with a geometrical rate +!! in a specific range +!! LAMBDA = exp( (Log(LAMBDA_max) - Log(LAMBDA_min))/N_interval ) +!! The two above integrals are performed using the trapezoidal scheme. +!! +!! EXTERNAL +!! -------- +!! MODI_GENERAL_GAMMA: Generalized gamma distribution law +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! MODD_CST : XPI,XRHOLW +!! MODD_RAIN_ICE_DESCR: XAS,XAS,XBS +!! +!! REFERENCE +!! --------- +!! B.S. Ferrier , 1994 : A Double-Moment Multiple-Phase Four-Class +!! Bulk Ice Scheme,JAS,51,249-280. +!! +!! AUTHOR +!! ------ +!! J.-P. Pinty * Laboratoire d'Aerologie * +!! +!! MODIFICATIONS +!! ------------- +!! Original 8/11/95 +!! +! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function +! J. Wurtz 03/2022: new snow characteristics +! +!------------------------------------------------------------------------------- +! +! +!* 0. DECLARATIONS +! ------------ +! +USE MODI_GENERAL_GAMMA +! +USE MODD_CST +USE MODD_RAIN_ICE_DESCR_n +! +IMPLICIT NONE +! +!* 0.1 Declarations of dummy arguments +! ------------------------------- +! +! +INTEGER, INTENT(IN) :: KND ! Number of discrete size intervals in DS and DR +! +REAL, INTENT(IN) :: PALPHAS ! First shape parameter of the aggregates + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PZNUS ! Second shape parameter of the aggregates + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PALPHAR ! First shape parameter of the rain + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PNUR ! Second shape parameter of the rain + ! size distribution (generalized gamma law) +REAL, INTENT(IN) :: PESR ! Efficiency of the aggregates collecting rain +REAL, INTENT(IN) :: PEXMASSS ! Mass exponent of the aggregates +REAL, INTENT(IN) :: PFALLS ! Fall speed constant of the aggregates +REAL, INTENT(IN) :: PEXFALLS ! Fall speed exponent of the aggregates +REAL, INTENT(IN) :: PFALLEXPS ! Fall speed exponential constant of the aggregates +REAL, INTENT(IN) :: PFALLR ! Fall speed constant of rain +REAL, INTENT(IN) :: PEXFALLR ! Fall speed exponent of rain +REAL, INTENT(IN) :: PLBDASMAX ! Maximun slope of size distribution of the aggregates +REAL, INTENT(IN) :: PLBDARMAX ! Maximun slope of size distribution of rain +REAL, INTENT(IN) :: PLBDASMIN ! Minimun slope of size distribution of the aggregates +REAL, INTENT(IN) :: PLBDARMIN ! Minimun slope of size distribution of rain +REAL, INTENT(IN) :: PDINFTY ! Factor to define the largest diameter up to + ! which the diameter integration is performed +REAL, INTENT(IN) :: PAG, PBS, PAS +! +REAL, DIMENSION(:,:), INTENT(INOUT) :: PRSCOLRG! Scaled fall speed difference in + ! the mass collection kernel as a + ! function of LAMBDAX and LAMBDAZ +! +! +!* 0.2 Declarations of local variables +! ------------------------------- +! +! +INTEGER :: JLBDAS ! Slope index of the size distribution of the aggregates +INTEGER :: JLBDAR ! Slope index of the size distribution of rain +INTEGER :: JDS ! Diameter index of a particle of the aggregates +INTEGER :: JDR ! Diameter index of a particle of rain +! +INTEGER :: INR ! Number of diameter step for the partial integration +! +REAL :: ZLBDAS ! Current slope parameter LAMBDA of the aggregates +REAL :: ZLBDAR ! Current slope parameter LAMBDA of rain +REAL :: ZDLBDAS ! Growth rate of the slope parameter LAMBDA of the aggregates +REAL :: ZDLBDAR ! Growth rate of the slope parameter LAMBDA of rain +REAL :: ZDDS ! Integration step of the diameter of the aggregates +REAL :: ZDDSCALR! Integration step of the diameter of rain (scaling integral) +REAL :: ZDDCOLLR! Integration step of the diameter of rain (fallspe integral) +REAL :: ZDS ! Current diameter of the particle aggregates +REAL :: ZDR ! Current diameter of the raindrops +REAL :: ZDRMIN ! Minimal diameter of the raindrops where the integration starts +REAL :: ZDRMAX ! Maximal diameter of the raindrops where the integration ends +REAL :: ZCOLLR ! Single integral of the mass weighted fall speed difference + ! over the spectrum of rain +REAL :: ZCOLLDRMIN ! Minimum ending point for the partial integral +REAL :: ZCOLLSR ! Double integral of the mass weighted fall speed difference + ! over the spectra of the aggregates and rain +REAL :: ZSCALR ! Single integral of the scaling factor over + ! the spectrum of rain +REAL :: ZSCALSR ! Double integral of the scaling factor over + ! the spectra of the aggregates and rain +REAL :: ZFUNC ! Ancillary function +REAL :: ZCST1 +! +! +!------------------------------------------------------------------------------- +! +! +!* 1 COMPUTE THE SCALED VELOCITY DIFFERENCE IN THE MASS +!* COLLECTION KERNEL, +! ------------------------------------------------- +! +! +!* 1.0 Initialization +! +PRSCOLRG(:,:) = 0.0 +ZCST1 = (3.0/XPI)/XRHOLW +! +!* 1.1 Compute the growth rate of the slope factors LAMBDA +! +ZDLBDAR = EXP( LOG(PLBDARMAX/PLBDARMIN)/REAL(SIZE(PRSCOLRG(:,:),1)-1) ) +ZDLBDAS = EXP( LOG(PLBDASMAX/PLBDASMIN)/REAL(SIZE(PRSCOLRG(:,:),2)-1) ) +! +!* 1.2 Scan the slope factors LAMBDAX and LAMBDAZ +! +DO JLBDAR = 1,SIZE(PRSCOLRG(:,:),1) + ZLBDAR = PLBDARMIN * ZDLBDAR ** (JLBDAR-1) + ZDRMAX = PDINFTY / ZLBDAR +! +!* 1.3 Compute the diameter steps +! + ZDDSCALR = PDINFTY / (REAL(KND) * ZLBDAR) + DO JLBDAS = 1,SIZE(PRSCOLRG(:,:),2) + ZLBDAS = PLBDASMIN * ZDLBDAS ** (JLBDAS-1) +! +!* 1.4 Initialize the collection integrals +! + ZSCALSR = 0.0 + ZCOLLSR = 0.0 +! +!* 1.5 Compute the diameter steps +! + ZDDS = PDINFTY / (REAL(KND) * ZLBDAS) +! +!* 1.6 Scan over the diameters DS and DR +! + DO JDS = 1,KND-1 + ZDS = ZDDS * REAL(JDS) + ZSCALR = 0.0 + ZCOLLR = 0.0 + DO JDR = 1,KND-1 + ZDR = ZDDSCALR * REAL(JDR) +! +!* 1.7 Compute the normalization factor by integration over the +! dimensional spectrum of rain +! + ZSCALR = ZSCALR + (ZDS+ZDR)**2 * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDR) + END DO +! +!* 1.8 Compute the scaled fall speed difference by partial +! integration over the dimensional spectrum of rain +! + ZFUNC = PAG - PAS*ZDS**(PBS-3.0) ! approximate limit is Ds=240 microns + IF( ZFUNC>0.0 ) THEN + ZDRMIN = ZDS*( ZCST1*ZFUNC )**0.3333333 + ELSE + ZDRMIN = 0.0 + END IF + IF( ZDS>1.0E-4 ) THEN ! allow computation if Ds>100 microns + ! corresponding to a maximal density of the aggregates of XRHOLW + IF( (ZDRMAX-ZDRMIN) >= 0.5*ZDDSCALR ) THEN + INR = CEILING( (ZDRMAX-ZDRMIN)/ZDDSCALR ) + ZDDCOLLR = (ZDRMAX-ZDRMIN) / REAL(INR) + DO JDR = 1,INR-1 + ZDR = ZDDCOLLR * REAL(JDR) + ZDRMIN + ZCOLLR = ZCOLLR + (ZDS+ZDR)**2 & + * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDR) & + * PESR * ABS(PFALLS*ZDS**PEXFALLS*EXP(-(ZDS*PFALLEXPS)**PALPHAS)-PFALLR*ZDR**PEXFALLR) + END DO + IF( ZDRMIN>0.0 ) THEN + ZCOLLDRMIN = (ZDS+ZDRMIN)**2 & + * GENERAL_GAMMA(PALPHAR,PNUR,ZLBDAR,ZDRMIN) & + * PESR * ABS(PFALLS*ZDS**PEXFALLS*EXP(-(ZDS*PFALLEXPS)**PALPHAS)-PFALLR*ZDRMIN**PEXFALLR) + ELSE + ZCOLLDRMIN = 0.0 + END IF + ZCOLLR = (ZCOLLR + 0.5*ZCOLLDRMIN)*(ZDDCOLLR/ZDDSCALR) +! +!* 1.9 Compute the normalization factor by integration over the +! dimensional spectrum of the aggregates +! + ZFUNC = (ZDS**PEXMASSS) * GENERAL_GAMMA(PALPHAS,PZNUS,ZLBDAS,ZDS) + ZSCALSR = ZSCALSR + ZSCALR * ZFUNC +! +!* 1.10 Compute the scaled fall speed difference by integration over +! the dimensional spectrum of the aggregates +! + ZCOLLSR = ZCOLLSR + ZCOLLR * ZFUNC +! +! Otherwise ZDRMIN>ZDRMAX so PRRCOLSS(JLBDAS,JLBDAR) = 0.0 ! +! + END IF +! +! Otherwise ZDRMAX = 0.0 so the density of the graupel cannot be reached +! and so PRRCOLSS(JLBDAS,JLBDAR) = 0.0 ! +! + END IF + END DO +! +!* 1.10 Scale the fall speed difference +! + IF( ZSCALSR>0.0 ) PRSCOLRG(JLBDAR,JLBDAS) = ZCOLLSR / ZSCALSR + END DO +END DO +! +END SUBROUTINE RSCOLRG diff --git a/src/mesonh/ext/series_cloud_elec.f90 b/src/mesonh/ext/series_cloud_elec.f90 new file mode 100644 index 0000000000000000000000000000000000000000..139d71d0caac4492e3acd7bb7718421575b34902 --- /dev/null +++ b/src/mesonh/ext/series_cloud_elec.f90 @@ -0,0 +1,619 @@ +!MNH_LIC Copyright 2010-2020 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_SERIES_CLOUD_ELEC +! ############################# +! +INTERFACE + SUBROUTINE SERIES_CLOUD_ELEC (KTCOUNT, PTSTEP, & + PZZ, PRHODJ, PRHODREF, PEXNREF, & + PRT, PRS, PSVT, & + PTHT, PWT, PPABST, PCIT, & + TPFILE_SERIES_CLOUD_ELEC, & + PINPRR ) +! +USE MODD_IO, ONLY: TFILEDATA +! +INTEGER, INTENT(IN) :: KTCOUNT ! Temporal loop counter +! +REAL, INTENT(IN) :: PTSTEP ! Double time step except for cold start +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! Height (z) +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Dry density * Jacobian +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF! Reference density +REAL, DIMENSION(:,:,:), INTENT(IN) :: PEXNREF ! Reference Exner function +! +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRT ! Moist variables at time t +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRS ! Moist variable sources +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVT ! Scalar variable at time t +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHT ! Theta at time t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PWT ! Vertical velocity at t-dt +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABST ! ab. pressure at time t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PCIT ! Pristine ice number + ! concentration at time t +TYPE(TFILEDATA), INTENT(IN) :: TPFILE_SERIES_CLOUD_ELEC +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRR ! Rain instant precip +! +END SUBROUTINE SERIES_CLOUD_ELEC +END INTERFACE +END MODULE MODI_SERIES_CLOUD_ELEC +! +! +! ############################################################### + SUBROUTINE SERIES_CLOUD_ELEC (KTCOUNT, PTSTEP, & + PZZ, PRHODJ, PRHODREF, PEXNREF, & + PRT, PRS, PSVT, & + PTHT, PWT, PPABST, PCIT, & + TPFILE_SERIES_CLOUD_ELEC, & + PINPRR ) +! ############################################################### +! +!!**** * - +!! +!! PURPOSE +!! ------- +!! +!! METHOD +!! ------ +!! +!! EXTERNAL +!! -------- +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! C. Bovalo * LA * +!! +!! MODIFICATIONS +!! ------------- +!! Original : Avril 2010 +!! Modifications: +!! C. Barthe * LACy * Dec. 2010 add some parameters +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! Philippe Wautelet: 10/01/2019: use NEWUNIT argument of OPEN +!! Philippe Wautelet: 22/01/2019: use standard FLUSH statement instead of non standard intrinsics +! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function +! P. Wautelet 28/05/2019: move COUNTJV function to tools.f90 +! +!------------------------------------------------------------------------------- +! +! 0. DECLARATIONS +! ------------ +! +USE MODD_CONF, ONLY: CEXP +USE MODD_CST +USE MODD_DYN_n, ONLY: XDXHATM, XDYHATM +USE MODD_ELEC_DESCR +USE MODD_ELEC_PARAM +USE MODD_GRID_n, ONLY: XXHAT, XYHAT, XZHAT +USE MODD_IO, ONLY: TFILEDATA +USE MODD_NSV, ONLY: NSV_ELECBEG, NSV_ELECEND +USE MODD_PARAMETERS +USE MODD_RAIN_ICE_DESCR_n +USE MODD_RAIN_ICE_PARAM_n +USE MODD_REF + +USE MODI_MOMG +USE MODI_RADAR_RAIN_ICE + +USE MODE_ELEC_ll +USE MODE_ll +use mode_tools, only: Countjv + +IMPLICIT NONE +! +!* 0.1 Declarations of dummy arguments : +! +INTEGER, INTENT(IN) :: KTCOUNT ! Temporal loop counter +! +REAL, INTENT(IN) :: PTSTEP ! Double time step except for cold start +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! Height (z) +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Dry density * Jacobian +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF! Reference density +REAL, DIMENSION(:,:,:), INTENT(IN) :: PEXNREF ! Reference Exner function +! +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRT ! Moist variables at time t +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRS ! Moist variable sources +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVT ! Scalar variable at time t +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHT ! Theta at time t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PWT ! Vertical velocity at t-dt +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABST ! ab. pressure at time t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PCIT ! Pristine ice number + ! concentration at time t +TYPE(TFILEDATA), INTENT(IN) :: TPFILE_SERIES_CLOUD_ELEC +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRR ! Rain instant precip +! +! +!* 0.2 Declarations of local variables : +! +INTEGER :: II, IJ, IK +INTEGER :: IIB,IIE ! Indices for the first and last inner mass point along x +INTEGER :: IJB,IJE ! Indices for the first and last inner mass point along y +INTEGER :: IKB,IKE ! Indices for the first and last inner mass point along z +INTEGER :: JCOUNT_STOP +INTEGER :: ICOUNT ! counter for iwp computation +INTEGER :: IPROC ! my proc number +INTEGER :: IPROC_MAX ! proc that contains max value +INTEGER :: IINFO_ll ! return code of parallel routine +INTEGER :: ILU ! unit number for IO +! +INTEGER, SAVE :: JCOUNT +! +INTEGER, DIMENSION(SIZE(PRT,1),SIZE(PRT,2)) :: IFLAG +! +REAL :: ZRHO00 ! Surface reference air density +REAL :: ZMASS_SP ! Precipitation snow mass (kg) +REAL :: ZMASS_GP ! Precipitation graupel mass (kg) +REAL :: ZFLUX_I ! Ice crystal mass flux (kg m/s) +REAL :: ZFLUX_SP ! Precipitation snow mass flux (kg m/s) +REAL :: ZFLUX_SNP ! Non precipitation snow mass flux (kg m/s) +REAL :: ZFLUX_G ! Graupel mass flux (kg m/s) +REAL :: ZCLD_TOP_REF ! Cloud top height (m) from radar refl. +REAL :: ZCLD_TOP_MR ! Cloud top height (m) from mixing ratio +REAL :: ZICE_MASS ! Ice mass (kg) +! +REAL, SAVE :: ZMASS_C ! Cloud water mass (kg) +REAL, SAVE :: ZMASS_R ! Rain water mass (kg) +REAL, SAVE :: ZMASS_I ! Ice crystal mass (kg) +REAL, SAVE :: ZMASS_S ! Snow mass (kg) +REAL, SAVE :: ZMASS_G ! Graupel mass (kg) +REAL, SAVE :: ZMASS_ICE_P ! Precipitation ice mass (kg) +REAL, SAVE :: ZFLUX_PROD ! Ice mass flux product (kg^2 m^2/s^2) +REAL, SAVE :: ZFLUX_PRECIP ! Precipitation ice mass flux (kg m/s) +REAL, SAVE :: ZFLUX_NPRECIP ! Non-precipitation ice mass flux (kg m/s) +REAL, SAVE :: ZVOL_UP5 ! Updraft volume for W > 5 m/s (m^3) +REAL, SAVE :: ZVOL_UP10 ! Updraft volume for W > 10 m/s (m^3) +REAL, SAVE :: ZWMAX ! Maximum vertical velocity (m/s) +REAL, SAVE :: ZVOL_G ! Graupel volume (m^3) +REAL, SAVE :: ZIWP ! Ice water path (kg/m^2) +REAL, SAVE :: ZCTH_MR ! Cloud top height / m.r. > 1.e-4 kg/kg (m) +REAL, SAVE :: ZCTH_REF ! Cloud top height / Z > 20 dBZ (m) +REAL, SAVE :: ZCLD_VOL ! Cloud volume (m^3) +REAL, SAVE :: ZDBZMAX ! Max radar reflectivity (dBZ) +REAL, SAVE :: ZINPRR ! Rain instant precip. (mm/H) +REAL, SAVE :: ZMAX_INPRR ! Maximum rain instant. precip. (mm/H) +! +REAL, DIMENSION(SIZE(XRTMIN)) :: ZRTMIN +! XRTMIN = Minimum value for the mixing ratio +! ZRTMIN = Minimum value for the source (tendency) +! +REAL, DIMENSION(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3)) :: & + ZTCT ! Temperature in Degrees Celsius +REAL, DIMENSION(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3)) :: & + ZWORK31, ZWORK32, ZWORK33, ZWORK34 +! +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZCLOUD +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZLAMBDAS +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZLAMBDAG +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZVTS +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZVTG +! +LOGICAL, SAVE :: GFIRSTCALL = .TRUE. +! +! +!------------------------------------------------------------------------------- +! +!* 1. COMPUTE THE LOOP BOUNDS AND SOME PARAMETERS +! ------------------------------------------- +! +JCOUNT_STOP = INT(NTSAVE_SERIES/PTSTEP) +! +!* 1.1 beginning and end indexes of the physical subdomain +! +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +IKB = 1 + JPVEXT +IKE = SIZE(PZZ,3) - JPVEXT +! +! +!* 1.2 compute some parameters +! +! temperature : K -> C +ZTCT(:,:,:) = (PTHT(:,:,:) * (PPABST(:,:,:) / XP00)**(XRD/XCPD)) - XTT +! +! total mixing ratio +ALLOCATE(ZCLOUD(SIZE(PRT,1),SIZE(PRT,2),SIZE(PRT,3))) +ZCLOUD(:,:,:) = 0. +ZCLOUD(IIB:IIE,IJB:IJE,IKB:IKE) = PRT(IIB:IIE,IJB:IJE,IKB:IKE,2) + & + PRT(IIB:IIE,IJB:IJE,IKB:IKE,3) + & + PRT(IIB:IIE,IJB:IJE,IKB:IKE,4) + & + PRT(IIB:IIE,IJB:IJE,IKB:IKE,5) + & + PRT(IIB:IIE,IJB:IJE,IKB:IKE,6) +! +! +!* 1.3 compute the terminal fall speed +! +! the mean terminal fall speed is computed following: +! V_mean = Int(v(D) n(D) dD) / Int(n(D) dD) +! +ALLOCATE(ZLAMBDAS(SIZE(PRT,1), SIZE(PRT,2), SIZE(PRT,3))) +ALLOCATE(ZLAMBDAG(SIZE(PRT,1), SIZE(PRT,2), SIZE(PRT,3))) +ALLOCATE(ZVTS(SIZE(PRT,1), SIZE(PRT,2), SIZE(PRT,3))) +ALLOCATE(ZVTG(SIZE(PRT,1), SIZE(PRT,2), SIZE(PRT,3))) +! +ZLAMBDAS(:,:,:) = 0. +ZLAMBDAG(:,:,:) = 0. +ZVTS(:,:,:) = 0. +ZVTG(:,:,:) = 0. +! +! Surface reference air density +ZRHO00 = XP00 / (XRD * XTHVREFZ(IKB)) +! +! for snow +WHERE (PRT(:,:,:,5) .GT. 1.E-12) + ZLAMBDAS(:,:,:) = MIN(XLBDAS_MAX, & + XLBS * (PRHODREF(:,:,:) * & + MAX(PRT(:,:,:,5), XRTMIN(5)))**XLBEXS) + ZVTS(:,:,:) = XCS * MOMG(XALPHAS, XNUS, XBS+XDS) * ZLAMBDAS(:,:,:)**(-XDS) * & + (ZRHO00 / PRHODREF(:,:,:))**XCEXVT / MOMG(XALPHAS, XNUS, XBS) +ELSEWHERE + ZLAMBDAS(:,:,:) = 0. + ZVTS(:,:,:) = 0. +END WHERE +! +! for graupel +WHERE(PRT(:,:,:,6) .GT. 1.E-12) + ZLAMBDAG(:,:,:) = XLBG * (PRHODREF(:,:,:) * & + MAX(PRT(:,:,:,6), XRTMIN(6)))**XLBEXG + ZVTG(:,:,:) = XCG * MOMG(XALPHAG, XNUG, XBG+XDG) * ZLAMBDAG(:,:,:)**(-XDG) * & + (ZRHO00 / PRHODREF(:,:,:))**XCEXVT / MOMG(XALPHAG, XNUG, XBG) +ELSEWHERE + ZLAMBDAG(:,:,:) = 0. + ZVTG(:,:,:) = 0. +END WHERE +! +DEALLOCATE(ZLAMBDAS) +DEALLOCATE(ZLAMBDAG) +! +! +!------------------------------------------------------------------------------- +! +!* 2. INITIALIZE THE VARIABLES +! ------------------------ +! +IF (GFIRSTCALL) THEN + GFIRSTCALL = .FALSE. +! + JCOUNT = 0 + ZMASS_C = 0. + ZMASS_R = 0. + ZMASS_I = 0. + ZMASS_S = 0. + ZMASS_G = 0. + ZMASS_ICE_P = 0. + ZFLUX_PROD = 0. + ZFLUX_PRECIP = 0. + ZFLUX_NPRECIP = 0. + ZVOL_UP5 = 0. + ZVOL_UP10 = 0. + ZVOL_G = 0. + ZWMAX = 0. + ZDBZMAX = 0. + ZCTH_REF = 0. + ZCTH_MR = 0. + ZCLD_VOL = 0. + ZINPRR = 0. + ZMAX_INPRR = 0. +END IF +! +ZICE_MASS = 0. +ZMASS_SP = 0. +ZMASS_GP = 0. +ZFLUX_I = 0. +ZFLUX_SP = 0. +ZFLUX_SNP = 0. +ZFLUX_G = 0. +ZCLD_TOP_REF = 0. +ZCLD_TOP_MR = 0. +! +!------------------------------------------------------------------------------- +! +!* 3. COMPUTE THE DYNAMICAL AND MICROPHYSICAL PARAMETERS +! -------------------------------------------------- +! +JCOUNT = JCOUNT + 1 +! +!* 3.1 compute the maximum vertical velocity +! +ZWMAX = ZWMAX + MAXVAL(PWT(IIB:IIE,IJB:IJE,IKB:IKE)) +! +! +!* 3.2 compute the maximum radar reflectivity +! +CALL RADAR_RAIN_ICE (PRT, PCIT, PRHODREF, ZTCT, & + ZWORK31, ZWORK32, ZWORK33, ZWORK34) +! +ZDBZMAX = ZDBZMAX + MAXVAL(ZWORK31(IIB:IIE,IJB:IJE,IKB:IKE)) +! +! +!* 3.3 compute the mass of the different microphysical species +! +ZMASS_C = ZMASS_C + SUM(PRT(IIB:IIE,IJB:IJE,IKB:IKE,2) * & + PRHODJ(IIB:IIE,IJB:IJE,IKB:IKE)) +! +ZMASS_R = ZMASS_R + SUM(PRT(IIB:IIE,IJB:IJE,IKB:IKE,3) * & + PRHODJ(IIB:IIE,IJB:IJE,IKB:IKE)) +! +ZMASS_I = ZMASS_I + SUM(PRT(IIB:IIE,IJB:IJE,IKB:IKE,4) * & + PRHODJ(IIB:IIE,IJB:IJE,IKB:IKE)) +! +ZMASS_S = ZMASS_S + SUM(PRT(IIB:IIE,IJB:IJE,IKB:IKE,5) * & + PRHODJ(IIB:IIE,IJB:IJE,IKB:IKE)) +! +ZMASS_G = ZMASS_G + SUM(PRT(IIB:IIE,IJB:IJE,IKB:IKE,6) * & + PRHODJ(IIB:IIE,IJB:IJE,IKB:IKE)) +! +! +!* 3.4 compute the ice mass fluxes +! +!* 3.4.1 non-precipitation ice mass flux +! +IFLAG(:,:) = 0 +ICOUNT = 0 +! +DO II = IIB, IIE + DO IJ = IJB, IJE + DO IK = IKB, IKE +! +!* 3.4.1 non-precipitation ice crystal mass flux +! + IF (ZTCT(II,IJ,IK) .LT. 0. .AND. PWT(II,IJ,IK) .GT. 0.) THEN + ZFLUX_I = ZFLUX_I + & + PWT(II,IJ,IK) * PRT(II,IJ,IK,4) * PRHODJ(II,IJ,IK) + END IF +! +!* 3.4.2 non-precipitation snow mass flux +! + IF (ZTCT(II,IJ,IK) .LT. 0. .AND. PWT(II,IJ,IK) .GT. ZVTS(II,IJ,IK)) THEN + ZFLUX_SNP = ZFLUX_SNP + & + (PWT(II,IJ,IK) - ZVTS(II,IJ,IK)) * PRT(II,IJ,IK,5) * & + PRHODJ(II,IJ,IK) + END IF +! +!* 3.4.3 precipitation snow mass flux +! + IF (ZTCT(II,IJ,IK) .LT. 0. .AND. PWT(II,IJ,IK) .LT. ZVTS(II,IJ,IK)) THEN + ZMASS_SP = ZMASS_SP + PRT(II,IJ,IK,5) * PRHODJ(II,IJ,IK) + ZFLUX_SP = ZFLUX_SP + & + (PWT(II,IJ,IK) - ZVTS(II,IJ,IK)) * PRT(II,IJ,IK,5) * & + PRHODJ(II,IJ,IK) + END IF +! +!* 3.4.4 precipitation graupel mass flux +! + IF (ZTCT(II,IJ,IK) .LT. 0. .AND. PWT(II,IJ,IK) .LT. ZVTG(II,IJ,IK)) THEN + ZMASS_GP = ZMASS_GP + PRT(II,IJ,IK,6) * PRHODJ(II,IJ,IK) + ZFLUX_G = ZFLUX_G + & + (PWT(II,IJ,IK) - ZVTG(II,IJ,IK)) * PRT(II,IJ,IK,6) * & + PRHODJ(II,IJ,IK) + END IF +! +! +!* 3.5 compute the updraft volume +! +! Updraft volume for W > 5 m/s + IF (ZTCT(II,IJ,IK) .LT. -5. .AND. PWT(II,IJ,IK) .GT. 5.) THEN + ZVOL_UP5 = ZVOL_UP5 + XDXHATM * XDYHATM * & + (PZZ(II,IJ,IK+1) - PZZ(II,IJ,IK-1)) / 2. + END IF +! +! Updraft volume for W > 10 m/s + IF (ZTCT(II,IJ,IK) .LT. -5. .AND. PWT(II,IJ,IK) .GT. 10.) THEN + ZVOL_UP10 = ZVOL_UP10 + XDXHATM * XDYHATM * & + (PZZ(II,IJ,IK+1) - PZZ(II,IJ,IK-1)) / 2. + END IF +! +! +!* 3.6 total ice mass +! + IF (ZTCT(II,IJ,IK) .LT. -10. .AND. ZWORK31(II,IJ,IK) .GT. 18.) THEN + ZICE_MASS = ZICE_MASS + (PRT(II,IJ,IK,4) + PRT(II,IJ,IK,5) + PRT(II,IJ,IK,6)) * & + PRHODJ(II,IJ,IK) + IFLAG(II,IJ) = IFLAG(II,IJ) + 1 + END IF + END DO ! end loop ik +! + IF (IFLAG(II,IJ) .GE. 1) THEN + ICOUNT = ICOUNT + 1 + END IF + END DO ! end loop ij +END DO ! end loop ii +! +DEALLOCATE(ZVTS) +DEALLOCATE(ZVTG) +! +! +!* 3.7 precipitation and non precipitation ice mass flux product +! +IF (ZFLUX_G .LT. 0. .AND. ZFLUX_I .GT. 0.) THEN + ZFLUX_PROD = ZFLUX_PROD - (ZFLUX_I + ZFLUX_SNP) * (ZFLUX_G + ZFLUX_SP) +END IF +! +! precipitation ice mass flux +IF ((ZFLUX_G+ZFLUX_SP) .LT. 0.) THEN + ZFLUX_PRECIP = ZFLUX_PRECIP - (ZFLUX_G + ZFLUX_SP) +END IF +! +! non-precipitation ice mass flux +IF ((ZFLUX_I+ZFLUX_SNP) .GT. 0.) THEN + ZFLUX_NPRECIP = ZFLUX_NPRECIP + (ZFLUX_I + ZFLUX_SNP) +END IF +! +! +!* 3.8 compute the precipitation ice mass +! +IF ((ZMASS_GP .GT. 0.) .OR. (ZMASS_SP .GT. 0.)) THEN + ZMASS_ICE_P = ZMASS_ICE_P + ZMASS_GP + ZMASS_SP +END IF +! +! +!* 3.9 compute the ice water path +! +CALL SUM_ELEC_ll(ZICE_MASS) +CALL SUM_ELEC_ll(ICOUNT) +! +IF (ICOUNT .GT. 0) THEN + ZIWP = ZIWP + ZICE_MASS / (REAL(ICOUNT) * XDXHATM * XDYHATM) +END IF +! +! +!* 3.10 compute the cloud top height +! +DO II = IIB, IIE + DO IJ = IJB, IJE + DO IK = IKB, IKE +! maximum height of the 20 dBZ echo + IF (ZWORK31(II,IJ,IK) .GT. 20. .AND. PZZ(II,IJ,IK) .GT. ZCLD_TOP_REF) THEN + ZCLD_TOP_REF = PZZ(II,IJ,IK) + END IF +! +! maximum height with mixing ratio > 1.e-4 + IF (ZCLOUD(II,IJ,IK) .GT. 1.E-4 .AND. PZZ(II,IJ,IK) .GT. ZCLD_TOP_REF) THEN + ZCLD_TOP_MR = PZZ(II,IJ,IK) + END IF +! +! +!* 3.11 compute the cloud volume +! + IF (ZCLOUD(II,IJ,IK) .GT. 1.E-4) THEN + ZCLD_VOL = ZCLD_VOL + XDXHATM * XDYHATM * & + (PZZ(II,IJ,IK+1) - PZZ(II,IJ,IK-1)) / 2. + END IF +! + END DO + END DO +END DO +! +DEALLOCATE(ZCLOUD) +! +ZCTH_MR = ZCTH_MR + ZCLD_TOP_MR +ZCTH_REF = ZCTH_REF + ZCLD_TOP_REF +! +! +!* 3.12 compute the instantaneous precipitation rate +! +ZMAX_INPRR = ZMAX_INPRR + MAXVAL(PINPRR(IIB:IIE,IJB:IJE)) +ZINPRR = ZINPRR + SUM(PINPRR(IIB:IIE,IJB:IJE)) +! +!------------------------------------------------------------------------------- +! +!* 4. FROM LOCAL TO GLOBAL VARIABLES +! ------------------------------ +! +CALL MAX_ELEC_ll (ZCTH_REF, IPROC_MAX) +CALL MAX_ELEC_ll (ZCTH_MR, IPROC_MAX) +CALL MAX_ELEC_ll (ZDBZMAX, IPROC_MAX) +CALL MAX_ELEC_ll (ZMAX_INPRR,IPROC_MAX) +CALL MAX_ELEC_ll (ZWMAX, IPROC_MAX) +! +! +!------------------------------------------------------------------------------- +! +!* 5. SAVE THE DATA IN AN ASCII FILE +! ------------------------------ +! +CALL MYPROC_ELEC_ll(IPROC) +! +IF (JCOUNT == JCOUNT_STOP) THEN +! + ZINPRR = ZINPRR * 3.6E6 ! m/s --> mm/H + ZMAX_INPRR = ZMAX_INPRR * 3.6E6 ! m/s --> mm/H +! + CALL REDUCESUM_ll (ZVOL_UP5, IINFO_ll) + CALL REDUCESUM_ll (ZVOL_UP10, IINFO_ll) + CALL REDUCESUM_ll (ZMASS_C, IINFO_ll) + CALL REDUCESUM_ll (ZMASS_R, IINFO_ll) + CALL REDUCESUM_ll (ZMASS_I, IINFO_ll) + CALL REDUCESUM_ll (ZMASS_S, IINFO_ll) + CALL REDUCESUM_ll (ZMASS_G, IINFO_ll) + CALL REDUCESUM_ll (ZMASS_ICE_P, IINFO_ll) + CALL REDUCESUM_ll (ZFLUX_PROD, IINFO_ll) + CALL REDUCESUM_ll (ZFLUX_PRECIP, IINFO_ll) + CALL REDUCESUM_ll (ZFLUX_NPRECIP, IINFO_ll) + CALL REDUCESUM_ll (ZCLD_VOL, IINFO_ll) + CALL REDUCESUM_ll (ZINPRR, IINFO_ll) +! + IF (IPROC == 0) THEN + ILU = TPFILE_SERIES_CLOUD_ELEC%NLU + WRITE (ILU, FMT='(I6,19(E12.4))') & + INT(KTCOUNT*PTSTEP), & ! time + ZCTH_REF/REAL(JCOUNT), & ! cloud top height from Z + ZCTH_MR/REAL(JCOUNT), & ! cloud top height from m.r. + ZDBZMAX/REAL(JCOUNT), & ! maximum radar reflectivity + ZWMAX/REAL(JCOUNT), & ! maximum vertical velocity + ZVOL_UP5/REAL(JCOUNT), & ! updraft volume for W > 5 m/s + ZVOL_UP10/REAL(JCOUNT), & ! updraft volume for W > 10 m/s + ZMASS_C/REAL(JCOUNT), & ! cloud droplets mass + ZMASS_R/REAL(JCOUNT), & ! rain mass + ZMASS_I/REAL(JCOUNT), & ! ice crystal mass + ZMASS_S/REAL(JCOUNT), & ! snow mass + ZMASS_G/REAL(JCOUNT), & ! graupel mass + ZMASS_ICE_P/REAL(JCOUNT), & ! precipitation ice mass + ZFLUX_PROD/REAL(JCOUNT), & ! ice mass flux product + ZFLUX_PRECIP/REAL(JCOUNT), & ! precipitation ice mass flux + ZFLUX_NPRECIP/REAL(JCOUNT), & ! non-precipitation ice mass flux + ZIWP/REAL(JCOUNT), & ! ice water path + ZCLD_VOL/REAL(JCOUNT), & ! cloud volume + ZINPRR/REAL(JCOUNT), & ! Rain instant precip + ZMAX_INPRR/REAL(JCOUNT) ! maximum rain instant. precip. + FLUSH(UNIT=ILU) + END IF +! + JCOUNT = 0 + ZMASS_C = 0. + ZMASS_R = 0. + ZMASS_I = 0. + ZMASS_S = 0. + ZMASS_G = 0. + ZMASS_ICE_P = 0. + ZFLUX_PROD = 0. + ZFLUX_PRECIP = 0. + ZFLUX_NPRECIP = 0. + ZVOL_UP5 = 0. + ZVOL_UP10 = 0. + ZWMAX = 0. + ZDBZMAX = 0. + ZCTH_REF = 0. + ZCTH_MR = 0. + ZIWP = 0. + ZCLD_VOL = 0. + ZINPRR = 0. + ZMAX_INPRR = 0. +END IF +! +!------------------------------------------------------------------------------- +! +CONTAINS +! +!------------------------------------------------------------------------------- +! ############################################## + FUNCTION MOMG0D(PALPHA, PNU, PP) RESULT(PMOMG) +! ############################################## +! +USE MODI_GAMMA +! +IMPLICIT NONE +! +REAL, INTENT(IN) :: PALPHA, PNU +REAL, INTENT(IN) :: PP +REAL :: PMOMG +! +! +PMOMG = GAMMA(PNU+PP/PALPHA) / GAMMA(PNU) +! +END FUNCTION MOMG0D +! +!------------------------------------------------------------------------------- + +! +END SUBROUTINE SERIES_CLOUD_ELEC diff --git a/src/mesonh/ext/set_conc_ice_c1r3.f90 b/src/mesonh/ext/set_conc_ice_c1r3.f90 new file mode 100644 index 0000000000000000000000000000000000000000..0dfe34119bcd614b71adf0c7c6e3e9d8a8e006b4 --- /dev/null +++ b/src/mesonh/ext/set_conc_ice_c1r3.f90 @@ -0,0 +1,129 @@ +!MNH_LIC Copyright 2001-2018 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_SET_CONC_ICE_C1R3 +! ############################# +! +INTERFACE +! + SUBROUTINE SET_CONC_ICE_C1R3 (PRHODREF,PRT,PSVT) +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF ! Reference density +! +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRT ! microphysical mixing ratios +! +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PSVT ! microphys. concentrations +! +! +END SUBROUTINE SET_CONC_ICE_C1R3 +! +END INTERFACE +! +END MODULE MODI_SET_CONC_ICE_C1R3 +! +! ########################################################## + SUBROUTINE SET_CONC_ICE_C1R3 (PRHODREF,PRT,PSVT) +! ########################################################## +! +!!**** *SET_CONC_ICE_C1R3 * - initialize the ice crystal +!! concentration for a RESTArt simulation of the C1R3 scheme +!! +!! +!! PURPOSE +!! ------- +!! The purpose of this routine is to initialize the pristine ice crystal +!! concentrations when the cloud ice mixing ratios are only available. +!! This routine is used to initialize the small ice crystal concentrations +!! using the r_i of a previous ICE3 run but also to compute the LB tendencies +!! in ONE_WAY$n in case of grid-nesting when the optional argument PTIME is +!! set (a C3R5 run embedded in a ICE3 run). +!! +!!** METHOD +!! ------ +!! The method uses the contact nucleation formulation of Meyers as a rough +!! estimate (a function of the temperature). A limiting value of XCONCI_MAX +!! is also assumed in the case of very cold temperatures +!! +!! EXTERNAL +!! -------- +!! None +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODD_ICE_C1R3_DESCR, ONLY : XRTMIN, XCTMIN +!! Module MODD_ICE_C1R3_PARAM, ONLY : XCONCI_INI +!! Module MODD_CONF, ONLY : NVERB +!! +!! REFERENCE +!! --------- +!! Book2 of documentation ( routine SET_CONC_ICE_C1R3 ) +!! +!! AUTHOR +!! ------ +!! J.-P. Pinty * Laboratoire d'Aerologie* +!! +!! MODIFICATIONS +!! ------------- +!! Original 15/04/01 +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +!! +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_CST, ONLY : XRHOLI +USE MODD_CONF, ONLY : NVERB +USE MODD_ICE_C1R3_DESCR, ONLY : XRTMIN, XCTMIN +USE MODD_ICE_C1R3_PARAM, ONLY : XCONCI_MAX, XNUC_CON, XEXTT_CON, XEX_CON +USE MODD_LUNIT_n, ONLY : TLUOUT +USE MODD_RAIN_ICE_DESCR_n, ONLY : XAI, XBI +! +IMPLICIT NONE +! +!* 0.1 Declarations of dummy arguments : +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF ! Reference density +! +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRT ! microphysical mixing ratios +! +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PSVT ! microphys. concentrations +! +!* 0.2 Declarations of local variables : +! +INTEGER :: IRESP ! Return code of FM routines +INTEGER :: ILUOUT ! Logical unit number of output-listing +! +! +!------------------------------------------------------------------------------- +!* 1. RETRIEVE LOGICAL UNIT NUMBER +! ---------------------------- +! +ILUOUT = TLUOUT%NLU +! +!* 2. INITIALIZATION +! -------------- +! +! Assume the ice crystal concentration according to the +! contact nucleation formulation of Meyers et al. (1992) +! +WHERE ( PRT(:,:,:,4) > XRTMIN(4) ) + PSVT(:,:,:,4) = MIN( PRHODREF(:,:,:) / & + ( XRHOLI * XAI*(10.E-06)**XBI * PRT(:,:,:,4) ), & + XCONCI_MAX ) + PSVT(:,:,:,5) = 0.0 +END WHERE +WHERE ( PRT(:,:,:,4) <= XRTMIN(4) ) + PRT(:,:,:,4) = 0.0 + PSVT(:,:,:,4) = 0.0 + PSVT(:,:,:,5) = 0.0 +END WHERE +IF( NVERB >= 5 ) THEN + WRITE (UNIT=ILUOUT,FMT=*) "!INI_MODEL$n: The cloud ice concentration has " + WRITE (UNIT=ILUOUT,FMT=*) "been roughly initialised to a value of 1 per liter" +END IF +! +END SUBROUTINE SET_CONC_ICE_C1R3 diff --git a/src/mesonh/ext/set_msk.f90 b/src/mesonh/ext/set_msk.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ba4da88bfda2972c8bff2174907cb9e2d884710a --- /dev/null +++ b/src/mesonh/ext/set_msk.f90 @@ -0,0 +1,286 @@ +!MNH_LIC Copyright 1995-2021 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. +!----------------------------------------------------------------- +! ######spl + MODULE MODI_SET_MSK +!#################### +! +INTERFACE +! +SUBROUTINE SET_MSK(PRT,PRHODREF,OBU_MSK) +! +REAL , DIMENSION (:,:,:,:),INTENT(IN) :: PRT +REAL , DIMENSION (:,:,:),INTENT(IN) :: PRHODREF +LOGICAL , DIMENSION (:,:,:),INTENT(OUT) :: OBU_MSK +! +END SUBROUTINE SET_MSK +! +END INTERFACE +! +END MODULE MODI_SET_MSK +! +! ######spl + SUBROUTINE SET_MSK(PRT,PRHODREF,OBU_MSK) +! ############################### +! +!!****SET_MSK** -routine to define the mask based on SET_MASK +!! +!! +!! PURPOSE +!! ------- +! The purpose of this routine is to test the occurence or not of the +! different criteria, used to compute the budgets. It also updates the +! number of occurence of the different criteria. +! +!!** METHOD +!! ------ +!! According to each criterion associated to one zone, the mask is +!! set to TRUE at each point where the criterion is confirmed, at each +!! time step of the model. +!! +!! +!! EXTERNAL +!! -------- +!! NONE +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! REFERENCE +!! --------- +!! Book2 of MESO-NH documentation (routine BUDGET) +!! +!! +!! AUTHOR +!! ------ +!! J. Nicolau * Meteo France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 27/02/95 +!! T.Montmerle 15/07/96 Computation of masks for convective and stratiform parts +!! Biju Thomas 29/03/99 Identified nonprecipitating convective cells and only +!! precipitating anvils as stratiform part +!! O. Caumont 09/04/08 Use in RADAR_SIMULATOR +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_FIELD_n +USE MODD_RAIN_ICE_PARAM_n , ONLY : XFSEDR,XEXSEDR +USE MODD_RAIN_ICE_DESCR_n , ONLY : XCEXVT +USE MODD_CST , ONLY : XRHOLW +USE MODD_PARAMETERS +USE MODD_CONF +USE MODE_ll +USE MODD_LUNIT, ONLY : TLUOUT0 +USE MODD_ARGSLIST_ll, ONLY : LIST_ll +! +! +IMPLICIT NONE +! +! +!* 0.1 Declarations of arguments : +! +REAL , DIMENSION (:,:,:,:),INTENT(IN) :: PRT +REAL , DIMENSION (:,:,:),INTENT(IN) :: PRHODREF +LOGICAL , DIMENSION (:,:,:),INTENT(OUT) :: OBU_MSK +! +!* 0.2 Declarations of local variables : +! +INTEGER :: IIB,IJB ! Lower bounds and Upper bounds +INTEGER :: IIE,IJE ! of the physical sub-domain +INTEGER :: IKB,IKE ! in x, y and z directions +INTEGER :: IIU,IJU!,IKU +! +REAL,DIMENSION(:,:,:), ALLOCATABLE :: ZMASK ! signature de l'insertion + ! dans un masque (0 ou 1.) +REAL,DIMENSION(:,:), ALLOCATABLE :: ZCONVECT ! signature du domaine convectif +REAL,DIMENSION(:,:), ALLOCATABLE :: ZSURFPP ! precipitation au sol +REAL,DIMENSION(:,:), ALLOCATABLE :: ZMAXWATER ! teneur maximale en eau + ! recensee sur la verticale +REAL,DIMENSION(:,:), ALLOCATABLE :: ZMIMX,ZMIPX ! I,I+1 and I,I-1 precipitation sums +REAL,DIMENSION(:,:), ALLOCATABLE :: ZMEANX_MY,ZMEANX_PY ! J,J+1 and J,J-1 precipitation sums +REAL,DIMENSION(:,:), ALLOCATABLE :: ZMEANX, ZMEANXY +REAL :: ZAVER_PR,ZREPSILON,ZTOTWATER,ZREPSILON1 +REAL :: ZCRS,ZCEXRS,ZCEXVT,ZREPSILON2,ZREPSILON3 +INTEGER :: I,J,JILOOP,JJLOOP,JKLOOP +INTEGER :: ILUOUT0 +INTEGER :: IRESP +INTEGER :: IBUIL,IBUJL,IBUIH,IBUJH +!INTEGER :: IBUSIL,IBUSJL,IBUSIH,IBUSJH +!INTEGER :: IINFO_ll ! return code of parallel routine +!TYPE(LIST_ll), POINTER :: TZFIELDS_ll ! list of fields to exchange +!------------------------------------------------------------------------------- +! +ILUOUT0 = TLUOUT0%NLU +! +!* 1. COMPUTES THE PHYSICAL SUBDOMAIN BOUNDS +! --------------------------------------- +! +IKB = 1 + JPVEXT +IKE = SIZE(PRT,3) - JPVEXT +IIU = SIZE(PRT,1) +IJU = SIZE(PRT,2) +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +! +! ---------------------- +ALLOCATE( ZMASK(IIU,IJU,4) ) +ALLOCATE( ZSURFPP(IIU,IJU) ) +ALLOCATE(ZMIMX(IIU,IJU),ZMIPX(IIU,IJU),ZMEANX(IIU,IJU)) +ALLOCATE(ZMEANX_MY(IIU,IJU),ZMEANX_PY(IIU,IJU),ZMEANXY(IIU,IJU)) +ALLOCATE( ZCONVECT(IIU,IJU) ) +ALLOCATE( ZMAXWATER(IIU,IJU) ) +! +!* 2. DEFINITION OF THE MASK +! ---------------------- +! initialization to FALSE on the extended subdomain +OBU_MSK(:,:,:)=.FALSE. +ZMASK(:,:,:)=0. +ZSURFPP(:,:)=0. +ZCONVECT(:,:)=0. +ZMAXWATER(:,:)=0. +ZREPSILON=5.E-6 +ZREPSILON1=5.E-4 +ZREPSILON2=5.0 +ZREPSILON3=5.E-6 +ZAVER_PR=0. + +!********************************************************************** +! CAUTION: Definition of parameters +! depends on the model configuration WARM or COLD +! ----------------------------------------------- + +!********************************************************************** +!partie a activer pour le cas chaud, en activant USE MODD_CLOUDPAR et en +!desactivant USE MODD_RAIN_ICE_PARAM et USE MODD_RAIN_ICE_DESCR qui servent +!au cas froid. En activant tout, XCEXVT est defini deux fois, donc une fois +!de trop. +!********************************************************************** +!IF (CCLOUD == 'REVE' .OR. CCLOUD == 'KESS' .OR. CCLOUD == 'KES2') THEN +! ZCRS=XCRS +! ZCEXRS=XCEXRS +! ZCEXVT=XCEXVT +!ELSE IF (CCLOUD == 'ICE3') THEN +!********************************************************************** + + ZCRS=XFSEDR + ZCEXRS=XEXSEDR + ZCEXVT=XCEXVT +!END IF + +! Total solid and liquid water (qr+qc+qs+qi+qg) (= cloudy area) +! ------------------------------------------------------------- + +DO JKLOOP=IKB,IKE + DO JJLOOP=IJB,IJE + DO JILOOP=IIB,IIE + ZTOTWATER = PRT(JILOOP,JJLOOP,JKLOOP,2) & + +PRT(JILOOP,JJLOOP,JKLOOP,3) & + +PRT(JILOOP,JJLOOP,JKLOOP,4) & + +PRT(JILOOP,JJLOOP,JKLOOP,5) & + +PRT(JILOOP,JJLOOP,JKLOOP,6) + ZMAXWATER(JILOOP,JJLOOP)=MAX(ZMAXWATER(JILOOP,JJLOOP),ZTOTWATER) + END DO + END DO +END DO + +! Computation of ground precipitation +! ----------------------------------- + +! Precipitation (mm/h) +ZSURFPP(IIB:IIE,IJB:IJE)=ZCRS*PRT(IIB:IIE,IJB:IJE,IKB,3)**ZCEXRS & + *PRHODREF(IIB:IIE,IJB:IJE,IKB)**(ZCEXRS-ZCEXVT)*3.6E6/XRHOLW + +! Lateral Boundaries for Precipitation +! (cyclic case in Y-direction, OPEN in X-direction) + ZSURFPP(1,IJB:IJE)=ZSURFPP(IIB,IJB:IJE) + ZSURFPP(IIU,IJB:IJE)=ZSURFPP(IIE,IJB:IJE) + ZSURFPP(1:IIU,1)=ZSURFPP(1:IIU,IJB) + ZSURFPP(1:IIU,IJU)=ZSURFPP(1:IIU,IJE) + +! +! Predefinition of the Convective region criteria +! ------------------------------------------------ +ZMIPX(:,:)=0. +ZMIMX(:,:)=0. +ZMEANX(:,:)=0. +! +ZMIPX(1:IIU-1,:)=ZSURFPP(1:IIU-1,:)+ZSURFPP(2:IIU,:) +ZMIMX(2:IIU,:)=ZSURFPP(2:IIU,:)+ZSURFPP(1:IIU-1,:) + +DO J=IJB+1,IJE-1 + DO I=3,IIE-1 + ZAVER_PR=(SUM(ZSURFPP(I-2:I+2,J-2:J+2))-ZSURFPP(I,J))/24. + +! threshold at 4 mm/h + IF(ZSURFPP(I,J) >= MAX(4.,2.*ZAVER_PR) & + .AND.(ZMAXWATER(I,J) >= ZREPSILON)) ZCONVECT(I-1:I+1,J-1:J+1)=1. + IF(ZSURFPP(I,J) >= 20.) ZCONVECT(I,J)=1. + IF(ZMAXWATER(I,J) >= ZREPSILON)THEN + DO JKLOOP=2,IKE + IF(PRT(I,J,JKLOOP,2) >= ZREPSILON1) ZCONVECT(I,J)=1. + IF(XWT(I,J,JKLOOP) >= ZREPSILON2) ZCONVECT(I,J)=1. + END DO + END IF + END DO +END DO + +!------------------------------------------ +!* MASK Definition +!------------------------------------------ +IBUIL=IIB+1 +IBUIH = IIE-1 +IBUJL = IJB+1 +IBUJH = IJE-1 +DO JILOOP=IBUIL,IBUIH + DO JJLOOP=IBUJL,IBUJH +!------------------------------------------ +!* Zone 1: Convective Zone +!------------------------------------------ + ZMASK(JILOOP,JJLOOP,1)=ZCONVECT(JILOOP,JJLOOP) +!------------------------------------------ +!* Zone 2: Stratiforme Zone +!------------------------------------------ + IF (ZMAXWATER(JILOOP,JJLOOP) >= 10.*ZREPSILON.AND.ZMASK(JILOOP,JJLOOP,1)/=1.) THEN + DO JKLOOP=IKB,IKE + IF(PRT(JILOOP,JJLOOP,JKLOOP,3) >= ZREPSILON3) ZMASK(JILOOP,JJLOOP,2)=1. + END DO + END IF +!------------------------------------------ +!* Zone 3: Clear air Zone +!------------------------------------------ + IF (ZMASK(JILOOP,JJLOOP,1)/=1. .AND. ZMASK(JILOOP,JJLOOP,2)/=1.) ZMASK(JILOOP,JJLOOP,3)=1. +!------------------------------------------ +!* Zone 4: Total Domain +!------------------------------------------ + ZMASK(JILOOP,JJLOOP,4)=1. + + END DO +END DO +! +!----------------------------------------------------------------------- +! + +OBU_MSK(IIB:IIE,IJB:IJE,:)=ZMASK(IIB:IIE,IJB:IJE,:)>0.8 + + +! +!* 2. INCREASE IN SURFACE ARRAY +! ------------------------- +! +DEALLOCATE( ZMASK ) +DEALLOCATE( ZCONVECT ) +DEALLOCATE( ZSURFPP ) +DEALLOCATE( ZMAXWATER ) +DEALLOCATE(ZMIMX,ZMIPX,ZMEANX) +DEALLOCATE(ZMEANX_MY,ZMEANX_PY,ZMEANXY) +! +!------------------------------------------------------------------------------- +! +END SUBROUTINE SET_MSK diff --git a/src/mesonh/ext/set_rsou.f90 b/src/mesonh/ext/set_rsou.f90 new file mode 100644 index 0000000000000000000000000000000000000000..6c2ea6b2f9203cc2eca4d01697a0975155c40f95 --- /dev/null +++ b/src/mesonh/ext/set_rsou.f90 @@ -0,0 +1,1640 @@ +!MNH_LIC Copyright 1994-2021 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_SET_RSOU +! #################### +! +INTERFACE +! + SUBROUTINE SET_RSOU(TPFILE,TPEXPREFILE,HFUNU,HFUNV,KILOC,KJLOC,OBOUSS,& + PJ,OSHIFT,PCORIOZ) +! +USE MODD_IO, ONLY : TFILEDATA +! +TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! outpput data file +TYPE(TFILEDATA), INTENT(IN) :: TPEXPREFILE ! input data file +CHARACTER(LEN=*), INTENT(IN) :: HFUNU ! type of variation of U + ! in y direction +CHARACTER(LEN=*), INTENT(IN) :: HFUNV ! type of variation of V + ! in x direction +INTEGER, INTENT(IN) :: KILOC ! I Localisation of vertical profile +INTEGER, INTENT(IN) :: KJLOC ! J Localisation of vertical profile +LOGICAL, INTENT(IN) :: OBOUSS ! logical switch for Boussinesq version +REAL, DIMENSION(:,:,:), INTENT(IN) :: PJ ! jacobien +LOGICAL, INTENT(IN) :: OSHIFT ! logical switch for vertical shift +! +REAL, DIMENSION(:,:,:), INTENT(OUT), OPTIONAL :: PCORIOZ ! Coriolis parameter + ! (exceptionnaly 3D array) +! +END SUBROUTINE SET_RSOU +! +END INTERFACE +! +END MODULE MODI_SET_RSOU +! +! ######################################################################## + SUBROUTINE SET_RSOU(TPFILE,TPEXPREFILE,HFUNU,HFUNV,KILOC,KJLOC,OBOUSS, & + PJ,OSHIFT,PCORIOZ) +! ######################################################################## +! +!!**** *SET_RSOU * - to initialize mass fiels from a radiosounding +!! +!! PURPOSE +!! ------- +! The purpose of this routine is to initialize the mass field (theta,r, +! thetavrefz,rhorefz) on model grid from a radiosounding located at point +! (KILOC,KJLOC). +! +! The free-formatted part of EXPRE file contains the radiosounding data.The data +! are stored in following order : +! +! - year,month,day, time (these variables are read in PREINIT program) +! - kind of data in EXPRE file (see below for more explanations about +! YKIND) +! - ZGROUND +! - PGROUND +! - temperature variable at ground ( depending on the data Kind ) +! - moist variable at ground ( depending on the data Kind ) +! - number of wind data levels ( variable ILEVELU) +! - height , dd , ff | +! or or | ILEVELU times +! pressure, U , V | +! - number of mass levels ( variable ILEVELM), including the ground +! level +! - height , T , Td | +! or or or | (ILEVELM-1) times +! pressure, THeta_Dry , Mixing Ratio | +! or or | +! THeta_V , relative HUmidity| +! +! NB : the first mass level is at ground +! +! The following kind of data is permitted : +! YKIND = 'STANDARD' : ZGROUND, PGROUND, TGROUND, TDGROUND +! (Pressure, dd, ff) , +! (Pressure, T, Td) +! YKIND = 'PUVTHVMR' : zGROUND, PGROUND, ThvGROUND, RGROUND +! (Pressure, U, V) , +! (Pressure, THv, R) +! YKIND = 'PUVTHVHU' : zGROUND, PGROUND, ThvGROUND, HuGROUND +! (Pressure, U, V) , +! (Pressure, THv, Hu) +! YKIND = 'ZUVTHVHU' : zGROUND, PGROUND, ThvGROUND, HuGROUND +! (height, U, V) , +! (height, THv, Hu) +! YKIND = 'ZUVTHVMR' : zGROUND, PGROUND, ThvGROUND, RGROUND +! (height, U, V) , +! (height, THv, R) +! YKIND = 'PUVTHDMR' : zGROUND, PGROUND, ThdGROUND, RGROUND +! (Pressure, U, V) , +! (Pressure, THd, R) +! YKIND = 'PUVTHDHU' : zGROUND, PGROUND, ThdGROUND, HuGROUND +! (Pressure, U, V) , +! (Pressure, THd, Hu) +! YKIND = 'ZUVTHDMR' : zGROUND, PGROUND, ThdGROUND, +! RGROUND +! (height, U, V) , +! (height, THd, R) +! YKIND = 'PUVTHU' : ZGROUND, PGROUND, TGROUND, HuGROUND +! (Pressure, U, V) , +! (Pressure, T, Hu) +! +! For ocean-LES case the following kind of data is permitted +! +! YKIND = 'IDEALOCE' : ZGROUND (Water depth),PGROUND(Sfc Atmos Press), +! TGROUND (SST), RGROUND (SSS) +! (Depth , U, V) starting from sfc +! (Depth, T, S) +! (Time, LE, H, SW_d,SW_u,LW_d,LW_u,Stress_X,Stress_Y) +! +! YKIND = 'STANDOCE' : (Depth , Temp, Salinity, U, V) starting from sfc +! (Time, LE, H, SW_d,SW_u,LW_d,LW_u,Stress_X,Stress_Y) +! +!!** METHOD +!! ------ +!! The radiosounding is first read, then data are converted in order to +!! always obtain the following variables (case YKIND = 'ZUVTHVMR') : +!! (height,U,V) and (height,Thetav,r) which are the model variables. +!! That is to say : +!! - YKIND = 'STANDARD' : +!! dd,ff converted in U,V +!! Td + pressure ----> r +!! T,r ---> Tv + pressure ----> thetav +!! Pressure + thetav + ZGROUND ----> height (for mass levels) +!! Thetav at mass levels ----> thetav at wind levels +!! Pressure + thetav + ZGROUND + PGROUND ---->height (for wind levels) +!! - YKIND = 'PUVTHVMR' : +!! Pressure + thetav + ZGROUND ----> height (for mass levels) +!! Thetav at mass levels ----> thetav at wind levels +!! Pressure + thetav + ZGROUND + PGROUND ---->height (for wind levels) +!! - YKIND = 'PUVTHVHU' : +!! thetav + pressure ----> Tv +pressure +Hu ----> r +!! Pressure + thetav + ZGROUND ----> height (for mass levels) +!! Thetav at mass levels ----> thetav at wind levels +!! Pressure + thetav + ZGROUND + PGROUND ---->height (for wind levels) +!! - YKIND = 'ZUVTHVHU' : +!! height +thetav + PGROUND -----> pressure (for mass levels) +!! thetav + pressure ----> Tv +pressure +Hu ----> r +!! - YKIND = 'PUVTHDVMR' : +!! thetad + r ----> thetav +!! pressure + thetav + ZGROUND ----> height (for mass levels) +!! Thetav at mass levels ----> thetav at wind levels +!! Pressure + thetav + ZGROUND + PGROUND ---->height (for wind levels) +!! - YKIND = 'PUVTHDHU' : +!! thetad + pressure -----> T +!! T + pressure + Hu -----> r +!! thetad + r -----> thetav +!! pressure + thetav + ZGROUND ----> height (for mass levels) +!! Thetav at mass levels ----> thetav at wind levels +!! Pressure + thetav + ZGROUND + PGROUND ---->height (for wind levels) +!! - YKIND = 'ZUVTHDHU' : +!! thetad + r -----> thetav +!! - YKIND = 'PUVTHU' : +!! T + pressure -----> thetad +!! T + pressure + Hu -----> r +!! thetad + r -----> thetav +!! pressure + thetav + ZGROUND ----> height (for mass levels) +!! Thetav at mass levels ----> thetav at wind levels +!! +!! The following basic formula are used : +!! Rd es(Td) +!! r = -- ---------- +!! Rv P - es(Td) +!! +!! 1 + (Rv/Rd) r +!! Tv = -------------- T +!! 1 + r +!! +!! P00 Rd/Cpd 1 + (Rv/Rd) r +!! Thetav = Tv ( ---- ) = Thetad ( --------------) +!! P 1 + r +!! The integration of hydrostatic relation is used to compute height from +!! pressure and vice-versa. This is done by HEIGHT_PRESS and PRESS_HEIGHT +!! routines. +!! +!! Then, these data are interpolated on a vertical grid which is +!! a mixed grid calaculated with VERT_COORD from the vertical levels of MNH +!! grid and with a constant ororgraphy equal to the altitude of the vertical +!! profile (ZZGROUND) (It permits to keep low levels information with a +!! shifting function (as in PREP_REAL_CASE)) +!! +!! Then, the 3D mass and wind fields are deduced in SET_MASS +!! +!! +!! EXTERNAL +!! -------- +!! SET_MASS : to compute mass field on 3D-model grid +!! Module MODE_THERMO : contains thermodynamic routines +!! SM_FOES : To compute saturation vapor pressure from +!! temperature +!! SM_PMR_HU : to compute vapor mixing ratio from pressure, virtual +!! temperature and relative humidity +!! HEIGHT_PRESS : to compute height from pressure and thetav +!! by integration of hydrostatic relation +!! PRESS_HEIGHT : to compute pressure from height and thetav +!! by integration of hydrostatic relation +!! THETAVPU_THETAVPM : to interpolate thetav on wind levels +!! from thetav on mass levels +!! +!! Module MODI_HEIGHT_PRESS : interface for function HEIGHT_PRESS +!! Module MODI_PRESS_HEIGHT : interface for function PRESS_HEIGHT +!! Module MODI_THETAVPU_THETAVPM : interface for function +!! THETAVPU_THETVPM +!! Module MODI_SET_MASS : interface for subroutine SET_MASS +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODD_CST : contains physical constants +!! XPI : Pi +!! XRV : Gas constant for vapor +!! XRD : Gas constant for dry air +!! XCPD : Specific heat for dry air at constant pressure +!! +!! Module MODD_LUNIT1 : contains logical unit names +!! TLUOUT : name of output-listing +!! +!! Module MODD_CONF : contains configuration variables for all models. +!! NVERB : verbosity level for output-listing +!! +!! Module MODD_GRID1 : contains grid variables +!! XZHAT : height of w-levels of vertical model grid without orography +!! +!! REFERENCE +!! --------- +!! Book2 of MESO-NH documentation (routine SET_RSOU) +!! +!! +!! AUTHOR +!! ------ +!! V. Ducrocq * Meteo France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 25/08/94 +!! J.Stein 06/12/94 change the way to prescribe the horizontal wind +!! variations + cleaning +!! J.Stein 18/01/95 bug corrections in the ILEVELM readings +!! J.Stein 16/04/95 put the same names of the declarative modules +!! in the descriptive part +!! J.Stein 30/01/96 use the RS ground pressure to initialize the +!! hydrostatic pressure computation +!! V.Masson 02/09/96 add allocation of ZTHVU in two cases +!! P.Jabouille 14/02/96 bug in extrapolation of ZMRM below the first level +!! Jabouille/Masson 05/12/02 add ZUVTHLMR case and hydrometeor initialization +!! P.Jabouille 29/10/03 add hydrometeor initialization for ZUVTHDMR case +!! G. Tanguy 26/10/10 change the interpolation of the RS : we use now a +!! mixed grid (PREP_REAL_CASE method) +!! add PUVTHU case +!! V.Masson 12/08/13 Parallelization of the initilization profile +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 19/04/2019: removed unused dummy arguments and variables +! JL Redelsperger 01/2021: Ocean LES cases added +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_CONF +USE MODD_CONF_n +USE MODD_CST +USE MODD_NEB_n, ONLY: NEBN +USE MODD_DYN_n, ONLY: LOCEAN +USE MODD_FIELD_n +USE MODD_GRID +USE MODD_GRID_n +USE MODD_LUNIT_n, ONLY: TLUOUT +USE MODD_IO, ONLY: TFILEDATA +USE MODD_NETCDF +USE MODD_OCEANH +USE MODD_PARAMETERS, ONLY: JPHEXT +USE MODD_TYPE_DATE +! +USE MODE_ll +USE MODE_MSG +USE MODE_THERMO +! +USE MODI_COMPUTE_EXNER_FROM_GROUND +USE MODI_HEIGHT_PRESS +USE MODI_PRESS_HEIGHT +USE MODI_SET_MASS +USE MODI_SHUMAN +USE MODI_THETAVPU_THETAVPM +USE MODI_VERT_COORD +! +USE NETCDF ! for reading the NR files +! +IMPLICIT NONE +! +! +!* 0.1 Declarations of arguments : +! +TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! outpput data file +TYPE(TFILEDATA), INTENT(IN) :: TPEXPREFILE ! input data file +CHARACTER(LEN=*), INTENT(IN) :: HFUNU ! type of variation of U + ! in y direction +CHARACTER(LEN=*), INTENT(IN) :: HFUNV ! type of variation of V + ! in x direction +INTEGER, INTENT(IN) :: KILOC ! I Localisation of vertical profile +INTEGER, INTENT(IN) :: KJLOC ! J Localisation of vertical profile +LOGICAL, INTENT(IN) :: OBOUSS ! logical switch for Boussinesq version +LOGICAL, INTENT(IN) :: OSHIFT ! logical switch for vertical shift +REAL, DIMENSION(:,:,:), INTENT(OUT), OPTIONAL :: PCORIOZ ! Coriolis parameter + ! (exceptionnaly 3D array) +REAL, DIMENSION(:,:,:), INTENT(IN) :: PJ ! jacobien +! +! +!* 0.2 Declarations of local variables : +! +INTEGER :: ILUPRE ! logical unit number of the EXPRE return code +INTEGER :: ILUOUT ! Logical unit number for output-listing +! local variables for reading sea sfc flux forcing for ocean model +INTEGER :: IFRCLT +REAL, DIMENSION(:), ALLOCATABLE :: ZSSUFL_T,ZSSVFL_T,ZSSTFL_T,ZSSOLA_T ! +TYPE (DATE_TIME), DIMENSION(:), ALLOCATABLE :: ZFRCLT ! date/time of sea surface forcings +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! variables read in EXPRE file at the RS/CTD levels +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +CHARACTER(LEN=8) :: YKIND ! Kind of variables in + ! EXPRE FILE +INTEGER :: ILEVELU ! number of wind levels +REAL, DIMENSION(:), ALLOCATABLE :: ZHEIGHTU ! Height at wind levels +REAL, DIMENSION(:), ALLOCATABLE :: ZPRESSU ! Pressure at wind levels +REAL, DIMENSION(:), ALLOCATABLE :: ZTHVU ! Thetav at wind levels +REAL, DIMENSION(:), ALLOCATABLE :: ZU,ZV ! wind components +REAL, DIMENSION(:), ALLOCATABLE :: ZDD,ZFF ! dd (direction) and ff(force) + ! for wind +REAL :: ZZGROUND,ZPGROUND ! height and Pressure at ground +REAL :: ZTGROUND,ZTHVGROUND,ZTHDGROUND,ZTHLGROUND, & + ZTDGROUND,ZMRGROUND,ZHUGROUND + ! temperature and moisture + ! variables at ground +INTEGER :: ILEVELM ! number of mass levels +REAL, DIMENSION(:), ALLOCATABLE :: ZHEIGHTM ! Height at mass levels +REAL, DIMENSION(:), ALLOCATABLE :: ZPRESSM ! Pressure at mass levels +REAL, DIMENSION(:), ALLOCATABLE :: ZTHV ! Thetav at mass levels +REAL, DIMENSION(:), ALLOCATABLE :: ZTHD ! Theta (dry) at mass levels +REAL, DIMENSION(:), ALLOCATABLE :: ZTHL ! Thetal at mass levels +REAL, DIMENSION(:), ALLOCATABLE :: ZTH ! Theta at mass levels +REAL, DIMENSION(:), ALLOCATABLE :: ZT ! Temperature at mass levels +REAL, DIMENSION(:), ALLOCATABLE :: ZMR ! Vapor mixing ratio at mass levels +REAL, DIMENSION(:), ALLOCATABLE :: ZMRC ! cloud mixing ratio at mass levels +REAL, DIMENSION(:), ALLOCATABLE :: ZMRI ! ice mixing ratio or cloud concentration +REAL, DIMENSION(:), ALLOCATABLE :: ZRT ! total mixing ratio +REAL, DIMENSION(:), ALLOCATABLE :: ZPRESS ! pressure at mass level +REAL, DIMENSION(:), ALLOCATABLE :: ZHU ! relative humidity at mass levels +REAL, DIMENSION(:), ALLOCATABLE :: ZTD ! Td at mass levels +REAL, DIMENSION(:), ALLOCATABLE :: ZTV ! Tv at mass levels +REAL, DIMENSION(:), ALLOCATABLE :: ZEXN +REAL, DIMENSION(:), ALLOCATABLE :: ZCPH +REAL, DIMENSION(:), ALLOCATABLE :: ZLVOCPEXN +REAL, DIMENSION(:), ALLOCATABLE :: ZLSOCPEXN +REAL, DIMENSION(SIZE(XZHAT)) :: ZZFLUX_PROFILE ! altitude of flux points on the initialization columns +REAL, DIMENSION(SIZE(XZHAT)) :: ZZMASS_PROFILE ! altitude of mass points on the initialization columns +! +! fields on the grid of the model without orography +! +REAL, DIMENSION(SIZE(XZHAT)) :: ZUW,ZVW ! Wind at w model grid levels +REAL, DIMENSION(SIZE(XZHAT)) :: ZMRM ! vapor mixing ratio at mass model + !grid levels +REAL, DIMENSION(SIZE(XZHAT)) :: ZMRCM,ZMRIM +REAL, DIMENSION(SIZE(XZHAT)) :: ZTHVM ! Temperature at mass model grid levels +REAL, DIMENSION(SIZE(XZHAT)) :: ZTHLM ! Thetal at mass model grid levels +REAL, DIMENSION(SIZE(XZHAT)) :: ZTHM ! Thetal at mass model grid levels +REAL, DIMENSION(SIZE(XZHAT)) :: ZRHODM ! density at mass model grid level +REAL, DIMENSION(:), ALLOCATABLE :: ZMRT ! Total Vapor mixing ratio at mass levels on mixed grid +REAL, DIMENSION(:), ALLOCATABLE :: ZEXNMASS ! exner fonction at mass level +REAL, DIMENSION(:), ALLOCATABLE :: ZEXNFLUX ! exner fonction at flux level +REAL :: ZEXNSURF ! exner fonction at surface +REAL, DIMENSION(:), ALLOCATABLE :: ZPREFLUX ! pressure at flux model grid level +REAL, DIMENSION(:), ALLOCATABLE :: ZFRAC_ICE ! ice fraction +REAL, DIMENSION(:), ALLOCATABLE :: ZRSATW, ZRSATI +REAL :: ZDZSDH,ZDZ1SDH,ZDZ2SDH ! interpolation + ! working arrays +REAL, DIMENSION(:,:), ALLOCATABLE :: ZBUF +! +INTEGER :: JK,JKLEV,JKU,JKM,JKT,JJ,JI,JO,JLOOP ! Loop indexes +INTEGER :: IKU ! Upper bound in z direction +REAL :: ZRDSCPD,ZRADSDG, & ! Rd/Cpd, Pi/180., + ZRVSRD,ZRDSRV, & ! Rv/Rd, Rd/Rv + ZPTOP ! Pressure at domain top +LOGICAL :: GUSERC ! use of input data cloud +INTEGER :: IIB, IIE, IJB, IJE +INTEGER :: IXOR_ll, IYOR_ll +INTEGER :: IINFO_ll +LOGICAL :: GPROFILE_IN_PROC ! T : initialization profile is in current processor +! +REAL,DIMENSION(SIZE(XXHAT),SIZE(XYHAT)) ::ZZS_LS +REAL,DIMENSION(SIZE(XXHAT),SIZE(XYHAT),SIZE(XZHAT)) ::ZZFLUX_MX,ZZMASS_MX ! mixed grid +!------------------------------------------------------------------------------- +! For standard ocean version, reading external files +CHARACTER(LEN=256) :: yinfile, yinfisf ! files to be read +INTEGER :: IDX +INTEGER(KIND=CDFINT) :: INZ, INLATI, INLONGI +INTEGER(KIND=CDFINT) :: incid, ivarid, idimid, idimlen +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZOC_TEMPERATURE,ZOC_SALINITY,ZOC_U,ZOC_V +REAL, DIMENSION(:), ALLOCATABLE :: ZOC_DEPTH +REAL, DIMENSION(:), ALLOCATABLE :: ZOC_LE,ZOC_H +REAL, DIMENSION(:), ALLOCATABLE :: ZOC_SW_DOWN,ZOC_SW_UP,ZOC_LW_DOWN,ZOC_LW_UP +REAL, DIMENSION(:), ALLOCATABLE :: ZOC_TAUX,ZOC_TAUY + +!-------------------------------------------------------------------------------- +! +!* 1. PROLOGUE : INITIALIZE SOME CONSTANTS, RETRIEVE LOGICAL +! UNIT NUMBERS AND READ KIND OF DATA IN EXPRE FILE +! ------------------------------------------------------- +! +CALL GET_INDICE_ll(IIB,IJB,IIE,IJE) +CALL GET_OR_ll('B',IXOR_ll,IYOR_ll) +! +!* 1.1 initialize some constants +! +ZRDSCPD = XRD / XCPD +ZRADSDG = XPI/180. +ZRVSRD = XRV/XRD +ZRDSRV = XRD/XRV +! +!* 1.2 Retrieve logical unit numbers +! +ILUPRE = TPEXPREFILE%NLU +ILUOUT = TLUOUT%NLU +! +!* 1.3 Read data kind in EXPRE file +! +READ(ILUPRE,*) YKIND +WRITE(ILUOUT,*) 'YKIND read in set_rsou: ', YKIND +! +IF(LUSERC .AND. YKIND/='PUVTHDMR' .AND. YKIND/='ZUVTHDMR' .AND. YKIND/='ZUVTHLMR') THEN + CALL PRINT_MSG(NVERB_FATAL,'GEN','SET_RSOU','hydrometeors are not allowed for YKIND = '//trim(YKIND)) +ENDIF +! +IF(YKIND=='ZUVTHLMR' .AND. .NOT. LUSERC) THEN +!callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','SET_RSOU','LUSERC=T is required for YKIND=ZUVTHLMR') +ENDIF +! +GUSERC=.FALSE. +IF(LUSERC .AND. (YKIND == 'PUVTHDMR' .OR. YKIND == 'ZUVTHDMR')) GUSERC=.TRUE. +!------------------------------------------------------------------------------- +! +!* 2. READ DATA AND CONVERT IN (height,U,V), (height,Thetav,r) +! -------------------------------------------------------- +! +SELECT CASE(YKIND) +! +! 2.0.1 Ocean case 1 +! + CASE ('IDEALOCE') +! + XP00=XP00OCEAN + ! Read data in PRE_IDEA1.nam + ! Surface + WRITE(ILUOUT,FMT=*) 'Reading data for ideal ocean :IDEALOCE' + READ(ILUPRE,*) ZPTOP ! P_atmosphere at sfc =P top domain + READ(ILUPRE,*) ZTGROUND ! SST + READ(ILUPRE,*) ZMRGROUND ! SSS + WRITE(ILUOUT,FMT=*) 'Patm SST SSS', ZPTOP,ZTGROUND,ZMRGROUND + READ(ILUPRE,*) ILEVELU ! Read number of Current levels + ! Allocate required memory + ALLOCATE(ZHEIGHTU(ILEVELU),ZU(ILEVELU),ZV(ILEVELU)) + ALLOCATE(ZOC_U(ILEVELU,1,1),ZOC_V(ILEVELU,1,1)) + WRITE(ILUOUT,FMT=*) 'Level number for Current in data', ILEVELU + ! Read U and V at each wind level + DO JKU = 1,ILEVELU + READ(ILUPRE,*) ZHEIGHTU(JKU),ZOC_U(JKU,1,1),ZOC_V(JKU,1,1) + ! WRITE(ILUOUT,FMT=*) 'Leveldata D(m) under sfc: U_cur, V_cur', JKU, ZHEIGHTU(JKU),ZU(JKU),ZV(JKU) + END DO + DO JKU=1,ILEVELU + ! Z axis reoriented as in the model + IDX = ILEVELU-JKU+1 + ZU(JKU) = ZOC_U(IDX,1,1) + ZV(JKU) = ZOC_V(IDX,1,1) + ! ZHEIGHT used only in set_ rsou, defined as such ZHEIGHT(ILEVELM)=H_model + ! Z oriented in same time to have a model domain axis going + ! from 0m (ocean bottom/model bottom) towards H (ocean sfc/model top) + END DO + ! Read number of mass levels + READ(ILUPRE,*) ILEVELM + ! Allocate required memory + ALLOCATE(ZOC_DEPTH(ILEVELM)) + ALLOCATE(ZHEIGHTM(ILEVELM)) + ALLOCATE(ZTHL(ILEVELM),ZTH(ILEVELM),ZTHV(ILEVELM)) + ALLOCATE(ZMR(ILEVELM),ZRT(ILEVELM)) + ALLOCATE(ZOC_TEMPERATURE(ILEVELM,1,1),ZOC_SALINITY(ILEVELM,1,1)) + ! Read T and S at each mass level + DO JKM= 2,ILEVELM + READ(ILUPRE,*) ZOC_DEPTH(JKM),ZOC_TEMPERATURE(JKM,1,1),ZOC_SALINITY(JKM,1,1) + END DO + ! Complete the mass arrays with the ground informations read in EXPRE file + ZOC_DEPTH(1) = 0. + ZOC_TEMPERATURE(1,1,1)= ZTGROUND + ZOC_SALINITY(1,1,1)= ZMRGROUND + !!!!!!!!!!!!!!!!!!!!!!!!Inversing Axis!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! Going from the data (axis downward i.e inverse model) grid to the model grid (axis upward) + ! Uniform bathymetry; depth goes from ocean sfc downwards (data grid) + ! ZHEIGHT goes from the model domain bottom up to the sfc ocean (top of model domain) + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ZZGROUND = 0. + ZTGROUND = ZOC_TEMPERATURE(ILEVELM,1,1) + ZMRGROUND = ZOC_SALINITY(ILEVELM,1,1) + DO JKM= 1,ILEVELM + ! Z upward axis (oriented as in the model), i.e. + ! going from 0m (ocean bottom/model bottom) upward to H (ocean sfc/model top) + ! ZHEIGHT used only in set_ rsou, defined as such ZHEIGHT(ILEVELM)=H_model + IDX = ILEVELM-JKM+1 + ZTH(JKM) = ZOC_TEMPERATURE(IDX,1,1) + ZMR(JKM) = ZOC_SALINITY(IDX,1,1) + ZHEIGHTM(JKM)= ZOC_DEPTH(ILEVELM)- ZOC_DEPTH(IDX) + WRITE(ILUOUT,FMT=*) 'Model oriented initial data: JKM IDX depth T S ZHEIGHTM', & + JKM,IDX,ZOC_DEPTH(IDX),ZTH(JKM),ZMR(JKM),ZHEIGHTM(JKM) + END DO + ! mass levels of the RS + ZTHV = ZTH ! TV==THETA=TL + ZTHL = ZTH + ZRT = ZMR + !!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! READ Sea Surface Forcing ! + !!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! Reading the forcings from prep_idea1.nam + READ(ILUPRE,*) IFRCLT ! Number of time-dependent forcing + IF (IFRCLT > 99*8) THEN + ! CAUTION: number of forcing times is limited by the WRITE format 99(8E10.3) + ! and also by the name of forcing variables (format I3.3) + ! You have to modify those if you need more forcing times + CALL PRINT_MSG(NVERB_FATAL,'IO','SET_RSOU','maximum forcing times NFRCLT is 99*8') + END IF +! + WRITE(UNIT=ILUOUT,FMT='(" THERE ARE ",I2," SFC FLUX FORCINGs AT:")') IFRCLT + ALLOCATE(ZFRCLT(IFRCLT)) + ALLOCATE(ZSSUFL_T(IFRCLT)); ZSSUFL_T = 0.0 + ALLOCATE(ZSSVFL_T(IFRCLT)); ZSSVFL_T = 0.0 + ALLOCATE(ZSSTFL_T(IFRCLT)); ZSSTFL_T = 0.0 + ALLOCATE(ZSSOLA_T(IFRCLT)); ZSSOLA_T = 0.0 + DO JKT = 1,IFRCLT + WRITE(ILUOUT,FMT='(A, I4)') "SET_RSOU/Reading Sea Surface forcing: Number=", JKT + READ(ILUPRE,*) ZFRCLT(JKT)%nyear, ZFRCLT(JKT)%nmonth, & + ZFRCLT(JKT)%nday, ZFRCLT(JKT)%xtime + READ(ILUPRE,*) ZSSUFL_T(JKT) + READ(ILUPRE,*) ZSSVFL_T(JKT) + READ(ILUPRE,*) ZSSTFL_T(JKT) + READ(ILUPRE,*) ZSSOLA_T(JKT) + END DO +! + DO JKT = 1 , IFRCLT + WRITE(UNIT=ILUOUT,FMT='(F9.0, "s, date:", I3, "/", I3, "/", I5)') & + ZFRCLT(JKT)%xtime, ZFRCLT(JKT)%nday, & + ZFRCLT(JKT)%nmonth, ZFRCLT(JKT)%nyear + END DO + NINFRT= INT(ZFRCLT(2)%xtime) + WRITE(ILUOUT,FMT='(A)') & + "Number U-Stress, V-Stress, Heat turb Flux, Solar Flux Interval(s)",NINFRT + DO JKT = 1, IFRCLT + WRITE(ILUOUT,FMT='(I10,99(3F10.2))') JKT, ZSSUFL_T(JKT),ZSSVFL_T(JKT),ZSSTFL_T(JKT) + END DO + NFRCLT = IFRCLT + ALLOCATE(TFRCLT(NFRCLT)) + ALLOCATE(XSSUFL_T(NFRCLT));XSSUFL_T(:)=0. + ALLOCATE(XSSVFL_T(NFRCLT));XSSVFL_T(:)=0. + ALLOCATE(XSSTFL_T(NFRCLT));XSSTFL_T(:)=0. + ALLOCATE(XSSOLA_T(NFRCLT));XSSOLA_T(:)=0. +! + DO JKT=1,NFRCLT + TFRCLT(JKT)= ZFRCLT(JKT) + XSSUFL_T(JKT)=ZSSUFL_T(JKT)/XRH00OCEAN + XSSVFL_T(JKT)=ZSSVFL_T(JKT)/XRH00OCEAN + ! working in SI + XSSTFL_T(JKT)=ZSSTFL_T(JKT) /(3900.*XRH00OCEAN) + XSSOLA_T(JKT)=ZSSOLA_T(JKT) /(3900.*XRH00OCEAN) + END DO + DEALLOCATE(ZFRCLT) + DEALLOCATE(ZSSUFL_T) + DEALLOCATE(ZSSVFL_T) + DEALLOCATE(ZSSTFL_T) + DEALLOCATE(ZSSOLA_T) +! +!-------------------------------------------------------------------------------- +! 2.0.2 Ocean standard initialize from netcdf files +! U,V,T,S at Z levels + Forcings at model TOP (sea surface) +!-------------------------------------------------------------------------------- +! + CASE ('STANDOCE') +! + XP00=XP00OCEAN + READ(ILUPRE,*) ZPTOP ! P_atmosphere at sfc =P top domain + READ(ILUPRE,*) YINFILE, YINFISF + WRITE(ILUOUT,FMT=*) 'Netcdf files to read:', YINFILE, YINFISF + ! Open file containing initial profiles + CALL check(nf90_open(yinfile,NF90_NOWRITE,incid), "opening NC file") + ! Reading dimensions and lengths + CALL check( nf90_inq_dimid(incid, "depth",idimid), "getting depth dimension id" ) + CALL check( nf90_inquire_dimension(incid, idimid, len=INZ), "getting INZ" ) + CALL check( nf90_inquire_dimension(incid, INT(2,KIND=CDFINT), len=INLONGI), "getting NLONG" ) + CALL check( nf90_inquire_dimension(incid, INT(1,KIND=CDFINT), len=INLATI), "getting NLAT" ) +! + WRITE(ILUOUT,FMT=*) 'NB LEVLS READ INZ, NLONG NLAT ', INZ, INLONGI,INLATI + ALLOCATE(ZOC_TEMPERATURE(INLATI,INLONGI,INZ),ZOC_SALINITY(INLATI,INLONGI,INZ)) + ALLOCATE(ZOC_U(INLATI,INLONGI,INZ),ZOC_V(INLATI,INLONGI,INZ)) + ALLOCATE(ZOC_DEPTH(INZ)) + WRITE(ILUOUT,FMT=*) 'NETCDF READING ==> Temp' + CALL check(nf90_inq_varid(incid,"temperature",ivarid), "getting temp ivarid") + CALL check(nf90_get_var(incid,ivarid,ZOC_TEMPERATURE), "reading temp") + WRITE(ILUOUT,FMT=*) 'Netcdf Reading ==> salinity' + CALL check(nf90_inq_varid(incid,"salinity",ivarid), "getting salinity ivarid") + CALL check(nf90_get_var(incid,ivarid,ZOC_SALINITY), "reading salinity") + WRITE(ILUOUT,FMT=*) 'Netcdf ==> Reading depth' + CALL check(nf90_inq_varid(incid,"depth",ivarid), "getting depth ivarid") + CALL check(nf90_get_var(incid,ivarid,ZOC_DEPTH), "reading depth") + WRITE(ILUOUT,FMT=*) 'depth: max min ', MAXVAL(ZOC_DEPTH),MINVAL(ZOC_DEPTH) + WRITE(ILUOUT,FMT=*) 'depth 1 nz: ', ZOC_DEPTH(1),ZOC_DEPTH(INZ) + WRITE(ILUOUT,FMT=*) 'Netcdf Reading ==> Currents' + CALL check(nf90_inq_varid(incid,"u",ivarid), "getting u ivarid") + CALL check(nf90_get_var(incid,ivarid,ZOC_U), "reading u") + CALL check(nf90_inq_varid(incid,"v",ivarid), "getting v ivarid") + CALL check(nf90_get_var(incid,ivarid,ZOC_V), "reading v") + CALL check(nf90_close(incid), "closing yinfile") + WRITE(ILUOUT,FMT=*) 'End of initial file reading' +! + DO JKM=1,INZ + ZOC_TEMPERATURE(1,1,JKM)=ZOC_TEMPERATURE(1,1,JKM)+273.15 + WRITE(ILUOUT,FMT=*) 'Z T(Kelvin) S(Sverdup) U V K',& + JKM,ZOC_DEPTH(JKM),ZOC_TEMPERATURE(1,1,JKM),ZOC_SALINITY(1,1,JKM),ZOC_U(1,1,JKM),ZOC_V(1,1,JKM), JKM + ENDDO + ! number of data levels + ILEVELM=INZ + ! Model bottom + ZTGROUND = ZOC_TEMPERATURE(1,1,ILEVELM) + ZMRGROUND = ZOC_SALINITY(1,1,ILEVELM) + ZZGROUND=0. + ! Allocate required memory + ALLOCATE(ZHEIGHTM(ILEVELM)) + ALLOCATE(ZT(ILEVELM)) + ALLOCATE(ZTV(ILEVELM)) + ALLOCATE(ZMR(ILEVELM)) + ALLOCATE(ZTHV(ILEVELM)) + ALLOCATE(ZTHL(ILEVELM)) + ALLOCATE(ZRT(ILEVELM)) + ! Going from the inverse model grid (data) to the normal one + DO JKM= 1,ILEVELM + ! Z axis reoriented as in the model + IDX = ILEVELM-JKM+1 + ZT(JKM) = ZOC_TEMPERATURE(1,1,IDX) + ZMR(JKM) = ZOC_SALINITY(1,1,IDX) + ! ZHEIGHT used only in set_ rsou, defined as such ZHEIGHT(ILEVELM)=H_model + ! Z oriented in same time to have a model domain axis going + ! from 0m (ocean bottom/model bottom) towards H (ocean sfc/model top) + ! translation/inversion + ZHEIGHTM(JKM) = -ZOC_DEPTH(IDX) + ZOC_DEPTH(ILEVELM) + WRITE(ILUOUT,FMT=*) 'End gridmodel comput: JKM IDX depth T S ZHEIGHTM', & + JKM,IDX,ZOC_DEPTH(IDX),ZT(JKM),ZMR(JKM),ZHEIGHTM(JKM) + END DO + ! complete ther variables + ZTV = ZT + ZTHV = ZT + ZRT = ZMR + ZTHL = ZT + ZTH = ZT + ! INIT --- U V ----- + ILEVELU = INZ ! Same nb of levels for u,v,T,S + !Assume that current and temp are given at same level + ALLOCATE(ZHEIGHTU(ILEVELU)) + ALLOCATE(ZU(ILEVELU),ZV(ILEVELU)) + ZHEIGHTU=ZHEIGHTM + DO JKM= 1,ILEVELU + ! Z axis reoriented as in the model + IDX = ILEVELU-JKM+1 + ZU(JKM) = ZOC_U(1,1,IDX) + ZV(JKM) = ZOC_V(1,1,IDX) + ! ZHEIGHT used only in set_ rsou, defined as such ZHEIGHT(ILEVELM)=H_model + ! Z oriented in same time to have a model domain axis going + ! from 0m (ocean bottom/model bottom) towards H (ocean sfc/model top) + END DO +! + DEALLOCATE(ZOC_TEMPERATURE) + DEALLOCATE(ZOC_SALINITY) + DEALLOCATE(ZOC_U) + DEALLOCATE(ZOC_V) + DEALLOCATE(ZOC_DEPTH) +! + ! Reading/initializing surface forcings +! + WRITE(ILUOUT,FMT=*) 'netcdf sfc forcings file to be read:',yinfisf + ! Open of sfc forcing file + CALL check(nf90_open(yinfisf,NF90_NOWRITE,incid), "opening NC file") + ! Reading dimension and length + CALL check( nf90_inq_dimid(incid,"t",idimid), "getting time dimension id" ) + CALL check( nf90_inquire_dimension(incid, idimid, len=idimlen), "getting idimlen " ) +! + WRITE(ILUOUT,FMT=*) 'nb sfc-forcing time idimlen=',idimlen + ALLOCATE(ZOC_LE(idimlen)) + ALLOCATE(ZOC_H(idimlen)) + ALLOCATE(ZOC_SW_DOWN(idimlen)) + ALLOCATE(ZOC_SW_UP(idimlen)) + ALLOCATE(ZOC_LW_DOWN(idimlen)) + ALLOCATE(ZOC_LW_UP(idimlen)) + ALLOCATE(ZOC_TAUX(idimlen)) + ALLOCATE(ZOC_TAUY(idimlen)) +! + WRITE(ILUOUT,FMT=*)'Netcdf Reading ==> LE' + CALL check(nf90_inq_varid(incid,"LE",ivarid), "getting LE ivarid") + CALL check(nf90_get_var(incid,ivarid,ZOC_LE), "reading LE flux") + WRITE(ILUOUT,FMT=*)'Netcdf Reading ==> H' + CALL check(nf90_inq_varid(incid,"H",ivarid), "getting H ivarid") + CALL check(nf90_get_var(incid,ivarid,ZOC_H), "reading H flux") + WRITE(ILUOUT,FMT=*) 'Netcdf Reading ==> SW_DOWN' + CALL check(nf90_inq_varid(incid,"SW_DOWN",ivarid), "getting SW_DOWN ivarid") + CALL check(nf90_get_var(incid,ivarid,ZOC_SW_DOWN), "reading SW_DOWN") + WRITE(ILUOUT,FMT=*) 'Netcdf Reading ==> SW_UP' + CALL check(nf90_inq_varid(incid,"SW_UP",ivarid), "getting SW_UP ivarid") + CALL check(nf90_get_var(incid,ivarid,ZOC_SW_UP), "reading SW_UP") + WRITE(ILUOUT,FMT=*) 'Netcdf Reading ==> LW_DOWN' + CALL check(nf90_inq_varid(incid,"LW_DOWN",ivarid), "getting LW_DOWN ivarid") + CALL check(nf90_get_var(incid,ivarid,ZOC_LW_DOWN), "reading LW_DOWN") + WRITE(ILUOUT,FMT=*) 'Netcdf Reading ==> LW_UP' + CALL check(nf90_inq_varid(incid,"LW_UP",ivarid), "getting LW_UP ivarid") + CALL check(nf90_get_var(incid,ivarid,ZOC_LW_UP), "reading LW_UP") + WRITE(ILUOUT,FMT=*) 'Netcdf Reading ==> TAUX' + CALL check(nf90_inq_varid(incid,"TAUX",ivarid), "getting TAUX ivarid") + CALL check(nf90_get_var(incid,ivarid,ZOC_TAUX), "reading TAUX") + WRITE(ILUOUT,FMT=*) 'Netcdf Reading ==> TAUY' + CALL check(nf90_inq_varid(incid,"TAUY",ivarid), "getting TAUY ivarid") + CALL check(nf90_get_var(incid,ivarid,ZOC_TAUY), "reading TAUY") + CALL check(nf90_close(incid), "closing yinfifs") +! + WRITE(ILUOUT,FMT=*) ' Forcing-Number LE H SW_down SW_up LW_down LW_up TauX TauY' + DO JKM = 1, idimlen + WRITE(ILUOUT,FMT=*) JKM, ZOC_LE(JKM), ZOC_H(JKM),ZOC_SW_DOWN(JKM),ZOC_SW_UP(JKM),& + ZOC_LW_DOWN(JKM),ZOC_LW_UP(JKM),ZOC_TAUX(JKM),ZOC_TAUY(JKM) + ENDDO + ! IFRCLT FORCINGS at sea surface + IFRCLT=idimlen + ALLOCATE(ZFRCLT(IFRCLT)) + ALLOCATE(ZSSUFL_T(IFRCLT)); ZSSUFL_T = 0.0 + ALLOCATE(ZSSVFL_T(IFRCLT)); ZSSVFL_T = 0.0 + ALLOCATE(ZSSTFL_T(IFRCLT)); ZSSTFL_T = 0.0 + ALLOCATE(ZSSOLA_T(IFRCLT)); ZSSOLA_T = 0.0 + DO JKT=1,IFRCLT + ! Initial file for CINDY-DYNAMO: all fluxes correspond to the absolute value (>0) + ! modele ocean: axe z dirigé du bas vers la sfc de l'océan + ! => flux dirigé vers le haut (positif ocean vers l'atmopshere i.e. bas vers le haut) + ZSSOLA_T(JKT)=ZOC_SW_DOWN(JKT)-ZOC_SW_UP(JKT) + ZSSTFL_T(JKT)=(ZOC_LW_DOWN(JKT)-ZOC_LW_UP(JKT)-ZOC_LE(JKT)-ZOC_H(JKT)) + ! assume that Tau given on file is along Ox + ! rho_air UW_air = rho_ocean UW_ocean= N/m2 + ! uw_ocean + ZSSUFL_T(JKT)=ZOC_TAUX(JKT) + ZSSVFL_T(JKT)=ZOC_TAUY(JKT) + WRITE(ILUOUT,FMT=*) 'Forcing Nb Sol NSol UW_oc VW',& + JKT,ZSSOLA_T(JKT),ZSSTFL_T(JKT),ZSSUFL_T(JKT),ZSSVFL_T(JKT) + ENDDO + ! Allocate and Writing the corresponding variables in module MODD_OCEAN_FRC + NFRCLT=IFRCLT + ! value to read later on file ? + NINFRT=600 + ALLOCATE(TFRCLT(NFRCLT)) + ALLOCATE(XSSUFL_T(NFRCLT));XSSUFL_T(:)=0. + ALLOCATE(XSSVFL_T(NFRCLT));XSSVFL_T(:)=0. + ALLOCATE(XSSTFL_T(NFRCLT));XSSTFL_T(:)=0. + ALLOCATE(XSSOLA_T(NFRCLT));XSSOLA_T(:)=0. + ! on passe en unités SI, signe, etc pour le modele ocean + ! W/m2 => SI : /(CP_mer * rho_mer) + ! a revoir dans tt le code pour mettre de svaleurs plus exactes + DO JKT=1,NFRCLT + TFRCLT(JKT)= ZFRCLT(JKT) + XSSUFL_T(JKT)=ZSSUFL_T(JKT)/XRH00OCEAN + XSSVFL_T(JKT)=ZSSVFL_T(JKT)/XRH00OCEAN + XSSTFL_T(JKT)=ZSSTFL_T(JKT) /(3900.*XRH00OCEAN) + XSSOLA_T(JKT)=ZSSOLA_T(JKT) /(3900.*XRH00OCEAN) + END DO + DEALLOCATE(ZFRCLT) + DEALLOCATE(ZSSUFL_T) + DEALLOCATE(ZSSVFL_T) + DEALLOCATE(ZSSTFL_T) + DEALLOCATE(ZSSOLA_T) + DEALLOCATE(ZOC_LE) + DEALLOCATE(ZOC_H) + DEALLOCATE(ZOC_SW_DOWN) + DEALLOCATE(ZOC_SW_UP) + DEALLOCATE(ZOC_LW_DOWN) + DEALLOCATE(ZOC_LW_UP) + DEALLOCATE(ZOC_TAUX) + DEALLOCATE(ZOC_TAUY) + ! END OCEAN STANDARD +! +! +!* 2.1 ATMOSPHERIC STANDARD case : ZGROUND, PGROUND, TGROUND, TDGROUND +! (Pressure, dd, ff) , +! (Pressure, T, Td) +! + CASE ('STANDARD') + + READ(ILUPRE,*) ZZGROUND ! Read data at ground level + READ(ILUPRE,*) ZPGROUND + READ(ILUPRE,*) ZTGROUND + READ(ILUPRE,*) ZTDGROUND +! + READ(ILUPRE,*) ILEVELU ! Read number of wind levels + ALLOCATE(ZPRESSU(ILEVELU)) ! Allocate memory for arrays to be read + ALLOCATE(ZDD(ILEVELU),ZFF(ILEVELU)) + ALLOCATE(ZHEIGHTU(ILEVELU)) ! Allocate memory for needed + ALLOCATE(ZU(ILEVELU),ZV(ILEVELU)) ! arrays + ALLOCATE(ZTHVU(ILEVELU)) ! Allocate memory for intermediate + ! arrays +! + DO JKU = 1,ILEVELU ! Read data at wind levels + READ(ILUPRE,*) ZPRESSU(JKU),ZDD(JKU),ZFF(JKU) + END DO +! + READ(ILUPRE,*) ILEVELM ! Read number of mass levels + ! including the ground level + ALLOCATE(ZPRESSM(ILEVELM)) ! Allocate memory for arrays to be read + ALLOCATE(ZT(ILEVELM)) + ALLOCATE(ZTD(ILEVELM)) + ALLOCATE(ZHEIGHTM(ILEVELM)) ! Allocate memory for needed + ALLOCATE(ZTHV(ILEVELM)) ! arrays + ALLOCATE(ZMR(ILEVELM)) + ALLOCATE(ZTV(ILEVELM)) ! Allocate memory for intermediate arrays + ALLOCATE(ZTHL(ILEVELM)) + ALLOCATE(ZRT(ILEVELM)) +! +! + DO JKM= 2,ILEVELM ! Read data at mass levels + READ(ILUPRE,*) ZPRESSM(JKM),ZT(JKM),ZTD(JKM) + END DO + ZPRESSM(1)=ZPGROUND ! Mass level 1 is at the ground + ZT(1)=ZTGROUND + ZTD(1)=ZTDGROUND +! +! recover the North-South and West-East wind components + ZU(:) = ZFF(:)*COS(ZRADSDG*(270.-ZDD(:)) ) + ZV(:) = ZFF(:)*SIN(ZRADSDG*(270.-ZDD(:)) ) +! +! compute vapor mixing ratio + ZMR(:) = SM_FOES(ZTD(:)) & + / ( (ZPRESSM(:) - SM_FOES(ZTD(:))) * ZRVSRD ) +! +! compute Tv + ZTV(:) = ZT(:) * (1. + ZRVSRD * ZMR(:))/(1.+ZMR(:)) +! +! compute thetav + ZTHV(:) = ZTV(:) * (XP00/ ZPRESSM(:)) **(ZRDSCPD) +! +! compute height at the mass levels of the RS + ZHEIGHTM(:) = HEIGHT_PRESS(ZPRESSM,ZTHV,ZPGROUND,ZTHV(1),ZZGROUND) +! +! compute thetav and height at the wind levels of the RS + ZTHVU(:) = THETAVPU_THETAVPM(ZPRESSM,ZPRESSU,ZTHV) + ZHEIGHTU(:) = HEIGHT_PRESS(ZPRESSU,ZTHVU,ZPGROUND,ZTHV(1),ZZGROUND) +! +! Compute Thetal and Rt + ZRT(:)=ZMR(:) + ZTHL(:)=ZTHV(:)*(1+ZRT(:))/(1+ZRVSRD*ZRT(:)) +! +!* 2.2 PUVTHVMR case : zGROUND, PGROUND, ThvGROUND, RGROUND +! (Pressure, U, V) , +! (Pressure, THv, R) +! + CASE ('PUVTHVMR') +! +! Read data at ground level + READ(ILUPRE,*) ZZGROUND + READ(ILUPRE,*) ZPGROUND + READ(ILUPRE,*) ZTHVGROUND + READ(ILUPRE,*) ZMRGROUND +! +! Read number of wind levels + READ(ILUPRE,*) ILEVELU +! +! Allocate the required memory + ALLOCATE(ZPRESSU(ILEVELU)) + ALLOCATE(ZU(ILEVELU),ZV(ILEVELU)) + ALLOCATE(ZHEIGHTU(ILEVELU)) + ALLOCATE(ZTHVU(ILEVELU)) +! +! Read the data at each wind level of the RS + DO JKU =1,ILEVELU + READ(ILUPRE,*) ZPRESSU(JKU),ZU(JKU),ZV(JKU) + END DO +! +! Read number of mass levels + READ(ILUPRE,*) ILEVELM +! +! Allocate the required memory + ALLOCATE(ZPRESSM(ILEVELM)) + ALLOCATE(ZHEIGHTM(ILEVELM)) + ALLOCATE(ZTHV(ILEVELM)) + ALLOCATE(ZMR(ILEVELM)) + ALLOCATE(ZTHL(ILEVELM)) + ALLOCATE(ZRT(ILEVELM)) +! +! Read the data at each mass level of the RS + DO JKM = 2,ILEVELM + READ(ILUPRE,*) ZPRESSM(JKM),ZTHV(JKM),ZMR(JKM) + END DO +! +! Complete the mass arrays with the ground informations read in EXPRE file + ZPRESSM(1) = ZPGROUND + ZTHV(1) = ZTHVGROUND + ZMR(1) = ZMRGROUND +! +! Compute height of the mass levels of the RS + ZHEIGHTM(:) = HEIGHT_PRESS(ZPRESSM,ZTHV,ZPGROUND,ZTHV(1),ZZGROUND) +! +! Compute thetav and heigth at the wind levels of the RS + ZTHVU(:) = THETAVPU_THETAVPM(ZPRESSM,ZPRESSU,ZTHV) + ZHEIGHTU(:) = HEIGHT_PRESS(ZPRESSU,ZTHVU,ZPGROUND,ZTHV(1),ZZGROUND) +! +! on interpole thetal(=theta quand il n'y a pas d'eau liquide) et r total + ZRT(:)=ZMR(:) + ZTHL(:)=ZTHV(:)*(1+ZRT(:))/(1+ZRVSRD*ZRT(:)) +! +!* 2.3 PUVTHVHU case : zGROUND, PGROUND, ThvGROUND, HuGROUND +! (Pressure, U, V) , +! (Pressure, THv, Hu) +! + CASE ('PUVTHVHU') +! +! Read data at ground level + READ(ILUPRE,*) ZZGROUND + READ(ILUPRE,*) ZPGROUND + READ(ILUPRE,*) ZTHVGROUND + READ(ILUPRE,*) ZHUGROUND +! +! Read number of wind levels + READ(ILUPRE,*) ILEVELU +! +! Allocate the required memory + ALLOCATE(ZPRESSU(ILEVELU)) + ALLOCATE(ZU(ILEVELU),ZV(ILEVELU)) + ALLOCATE(ZHEIGHTU(ILEVELU)) + ALLOCATE(ZTHVU(ILEVELU)) +! +! Read the data at each wind level of the RS + DO JKU =1,ILEVELU + READ(ILUPRE,*) ZPRESSU(JKU),ZU(JKU),ZV(JKU) + END DO +! +! Read number of mass levels + READ(ILUPRE,*) ILEVELM +! +! Allocate the required memory + ALLOCATE(ZPRESSM(ILEVELM)) + ALLOCATE(ZTHV(ILEVELM)) + ALLOCATE(ZHU(ILEVELM)) + ALLOCATE(ZHEIGHTM(ILEVELM)) + ALLOCATE(ZMR(ILEVELM)) + ALLOCATE(ZTV(ILEVELM)) + ALLOCATE(ZTHL(ILEVELM)) + ALLOCATE(ZRT(ILEVELM)) +! +! Read the data at each mass level of the RS + DO JKM = 2,ILEVELM + READ(ILUPRE,*) ZPRESSM(JKM),ZTHV(JKM),ZHU(JKM) + END DO +! +! Complete the mass arrays with the ground informations read in EXPRE file + ZPRESSM(1) = ZPGROUND ! Mass level 1 is at the ground + ZTHV(1) = ZTHVGROUND + ZHU(1) = ZHUGROUND +! +! Compute Tv + ZTV(:)=ZTHV(:) * (ZPRESSM(:) / XP00) ** ZRDSCPD +! +! Compte mixing ratio + ZMR(:)=SM_PMR_HU(ZPRESSM(:),ZTV(:),ZHU(:),SPREAD(ZMR(:),2,1)) +! +! Compute height of the mass levels of the RS + ZHEIGHTM(:) = HEIGHT_PRESS(ZPRESSM,ZTHV,ZPGROUND,ZTHV(1),ZZGROUND) +! +! Compute thetav and height of the wind levels of the RS + ZTHVU(:) = THETAVPU_THETAVPM(ZPRESSM,ZPRESSU,ZTHV) + ZHEIGHTU(:) = HEIGHT_PRESS(ZPRESSU,ZTHVU,ZPGROUND,ZTHV(1),ZZGROUND) +! +! on interpole thetal(=theta quand il n'y a pas d'eau liquide) et r total + ZRT(:)=ZMR(:) + ZTHL(:)=ZTHV(:)*(1+ZRT(:))/(1+ZRVSRD*ZRT(:)) +! +!* 2.4 ZUVTHVHU case : zGROUND, PGROUND, ThvGROUND, HuGROUND +! (height, U, V) , +! (height, THv, Hu) +! + CASE ('ZUVTHVHU') +! Read data at ground level + READ(ILUPRE,*) ZZGROUND + READ(ILUPRE,*) ZPGROUND + READ(ILUPRE,*) ZTHVGROUND + READ(ILUPRE,*) ZHUGROUND +! +! Read number of wind levels + READ(ILUPRE,*) ILEVELU +! +! Allocate the required memory + ALLOCATE(ZPRESSU(ILEVELU)) + ALLOCATE(ZHEIGHTU(ILEVELU)) + ALLOCATE(ZU(ILEVELU),ZV(ILEVELU)) +! +! +! Read the data at each wind level of the RS + DO JKU = 1,ILEVELU + READ(ILUPRE,*) ZHEIGHTU(JKU),ZU(JKU),ZV(JKU) + END DO +! +! Read number of mass levels + READ(ILUPRE,*) ILEVELM +! +! Allocate the required memory + ALLOCATE(ZHEIGHTM(ILEVELM)) + ALLOCATE(ZTHV(ILEVELM)) + ALLOCATE(ZHU(ILEVELM)) + ALLOCATE(ZMR(ILEVELM)) + ALLOCATE(ZPRESSM(ILEVELM)) + ALLOCATE(ZTV(ILEVELM)) + ALLOCATE(ZTHL(ILEVELM)) + ALLOCATE(ZRT(ILEVELM)) +! +! Read the data at each mass level of the RS + DO JKM = 2,ILEVELM + READ(ILUPRE,*) ZHEIGHTM(JKM),ZTHV(JKM),ZHU(JKM) + END DO +! +! Complete the mass arrays with the ground informations read in EXPRE file + ZHEIGHTM(1) = ZZGROUND ! Mass level 1 is at the ground + ZTHV(1) = ZTHVGROUND + ZHU(1) = ZHUGROUND +! +! Compute Pressure at the mass levels of the RS + ZPRESSM= PRESS_HEIGHT(ZHEIGHTM,ZTHV,ZPGROUND,ZTHV(1),ZHEIGHTM(1)) +! +! Compute Tv and the mixing ratio at the mass levels of the RS + ZTV(:)=ZTHV(:) * (ZPRESSM(:) / XP00) ** ZRDSCPD + ZMR(:)=SM_PMR_HU(ZPRESSM(:),ZTV(:),ZHU(:),SPREAD(ZMR(:),2,1)) +! +! on interpole thetal(=theta quand il n'y a pas d'eau liquide) et r total + ZRT(:)=ZMR(:) + ZTHL(:)=ZTHV(:)*(1+ZRT(:))/(1+ZRVSRD*ZRT(:)) +! +! +!* 2.5 ZUVTHVMR case : zGROUND, PGROUND, ThvGROUND, RGROUND +! (height, U, V) , +! (height, THv, R) +! +! + CASE ('ZUVTHVMR') +! Read data at ground level + READ(ILUPRE,*) ZZGROUND + READ(ILUPRE,*) ZPGROUND + READ(ILUPRE,*) ZTHVGROUND + READ(ILUPRE,*) ZMRGROUND +! +! Read number of wind levels + READ(ILUPRE,*) ILEVELU +! +! Allocate the required memory + ALLOCATE(ZHEIGHTU(ILEVELU)) + ALLOCATE(ZU(ILEVELU),ZV(ILEVELU)) +! +! Read the data at each wind level of the RS + DO JKU = 1,ILEVELU + READ(ILUPRE,*) ZHEIGHTU(JKU),ZU(JKU),ZV(JKU) + END DO +! +! Read number of mass levels + READ(ILUPRE,*) ILEVELM +! +! Allocate the required memory + ALLOCATE(ZHEIGHTM(ILEVELM)) + ALLOCATE(ZTHV(ILEVELM)) + ALLOCATE(ZMR(ILEVELM)) + ALLOCATE(ZTHL(ILEVELM)) + ALLOCATE(ZRT(ILEVELM)) +! +! Read the data at each mass level of the RS + DO JKM=2,ILEVELM + READ(ILUPRE,*) ZHEIGHTM(JKM),ZTHV(JKM),ZMR(JKM) + END DO +! +! Complete the mass arrays with the ground informations read in EXPRE file + ZHEIGHTM(1)= ZZGROUND ! Mass level 1 is at the ground + ZTHV(1) = ZTHVGROUND + ZMR(1) = ZMRGROUND +! on interpole thetal(=theta quand il n'y a pas d'eau liquide) et r total + ZRT(:)=ZMR(:) + ZTHL(:)=ZTHV(:)*(1+ZRT(:))/(1+ZRVSRD*ZRT(:)) +! +! +!* 2.6 PUVTHDMR case : zGROUND, PGROUND, ThdGROUND, RGROUND +! (Pressure, U, V) , +! (Pressure, THd, R) +! + CASE ('PUVTHDMR') +! Read data at ground level + READ(ILUPRE,*) ZZGROUND + READ(ILUPRE,*) ZPGROUND + READ(ILUPRE,*) ZTHDGROUND + READ(ILUPRE,*) ZMRGROUND +! +! Read number of wind levels + READ(ILUPRE,*) ILEVELU +! +! Allocate the required memory + ALLOCATE(ZPRESSU(ILEVELU)) + ALLOCATE(ZU(ILEVELU),ZV(ILEVELU)) + ALLOCATE(ZTHVU(ILEVELU)) + ALLOCATE(ZHEIGHTU(ILEVELU)) +! +! Read the data at each wind level of the RS + DO JKU =1,ILEVELU + READ(ILUPRE,*) ZPRESSU(JKU),ZU(JKU),ZV(JKU) + END DO +! +! Read number of mass levels + READ(ILUPRE,*) ILEVELM +! +! Allocate the required memory + ALLOCATE(ZPRESSM(ILEVELM)) + ALLOCATE(ZTHD(ILEVELM)) + ALLOCATE(ZMR(ILEVELM)) + ALLOCATE(ZMRC(ILEVELM)) + ZMRC=0 + ALLOCATE(ZMRI(ILEVELM)) + ZMRI=0 + ALLOCATE(ZHEIGHTM(ILEVELM)) + ALLOCATE(ZTHV(ILEVELM)) + ALLOCATE(ZTHL(ILEVELM)) + ALLOCATE(ZRT(ILEVELM)) +! +! Read the data at each mass level of the RS + DO JKM=2,ILEVELM + IF(LUSERI) THEN + READ(ILUPRE,*) ZPRESSM(JKM),ZTHD(JKM),ZMR(JKM),ZMRC(JKM),ZMRI(JKM) + ELSEIF (GUSERC) THEN + READ(ILUPRE,*) ZPRESSM(JKM),ZTHD(JKM),ZMR(JKM),ZMRC(JKM) + ELSE + READ(ILUPRE,*) ZPRESSM(JKM),ZTHD(JKM),ZMR(JKM) + ENDIF + END DO +! +! Complete the mass arrays with the ground informations read in EXPRE file + ZPRESSM(1) = ZPGROUND ! Mass level 1 is at the ground + ZTHD(1) = ZTHDGROUND + ZMR(1) = ZMRGROUND + IF(GUSERC) ZMRC(1) = ZMRC(2) + IF(LUSERI) ZMRI(1) = ZMRI(2) +! +! Compute thetav at the mass levels of the RS + ZTHV(:) = ZTHD(:) * (1. + ZRVSRD *ZMR(:))/(1.+ZMR(:)+ZMRC(:)+ZMRI(:)) +! +! Compute the heights at the mass levels of the RS + ZHEIGHTM(:) = HEIGHT_PRESS(ZPRESSM,ZTHV,ZPGROUND,ZTHV(1),ZZGROUND) +! +! Compute thetav and heights of the wind levels + ZTHVU(:) = THETAVPU_THETAVPM(ZPRESSM,ZPRESSU,ZTHV) + ZHEIGHTU(:) = HEIGHT_PRESS(ZPRESSU,ZTHVU,ZPGROUND,ZTHV(1),ZZGROUND) +! +! Compute Theta l and Rt + IF (.NOT. GUSERC .AND. .NOT. LUSERI) THEN + ZRT(:)=ZMR(:) + ZTHL(:)=ZTHV(:)*(1+ZRT(:))/(1+ZRVSRD*ZRT(:)) + ELSE + ALLOCATE(ZEXN(ILEVELM)) + ALLOCATE(ZT(ILEVELM)) + ALLOCATE(ZCPH(ILEVELM)) + ALLOCATE(ZLVOCPEXN(ILEVELM)) + ALLOCATE(ZLSOCPEXN(ILEVELM)) + ZRT(:)=ZMR(:)+ZMRI(:)+ZMRC(:) + ZEXN(:)=(ZPRESSM/XP00) ** (XRD/XCPD) + ZT(:)=ZTHV*(ZPRESSM(:)/XP00)**(ZRDSCPD)*(1+ZRT(:))/(1+ZRVSRD*ZRT(:)) + ZCPH(:)=XCPD+ XCPV * ZMR(:)+ XCL *ZMRC(:) + XCI * ZMRI(:) + ZLVOCPEXN(:) = (XLVTT + (XCPV-XCL) * (ZT(:)-XTT))/(ZCPH*ZEXN(:)) + ZLSOCPEXN(:) = (XLSTT + (XCPV-XCI) * (ZT(:)-XTT))/(ZCPH*ZEXN(:)) + ZTHL(:)=ZTHV(:)*(1+ZRT(:))/(1+ZRVSRD*ZRT(:))-ZLVOCPEXN(:)*ZMRC(:)-ZLSOCPEXN(:)*ZMRI(:) + DEALLOCATE(ZEXN) + DEALLOCATE(ZT) + DEALLOCATE(ZCPH) + DEALLOCATE(ZLVOCPEXN) + DEALLOCATE(ZLSOCPEXN) + ENDIF +! +! +!* 2.7 PUVTHDHU case : zGROUND, PGROUND, ThdGROUND, HuGROUND +! (Pressure, U, V) , +! (Pressure, THd, Hu) +! + CASE ('PUVTHDHU') +! Read data at ground level + READ(ILUPRE,*) ZZGROUND + READ(ILUPRE,*) ZPGROUND + READ(ILUPRE,*) ZTHDGROUND + READ(ILUPRE,*) ZHUGROUND +! +! Read number of wind levels + READ(ILUPRE,*) ILEVELU +! +! Allocate the required memory + ALLOCATE(ZPRESSU(ILEVELU)) + ALLOCATE(ZU(ILEVELU),ZV(ILEVELU)) + ALLOCATE(ZTHVU(ILEVELU)) + ALLOCATE(ZHEIGHTU(ILEVELU)) +! +! Read the data at each wind level of the RS + DO JKU = 1,ILEVELU + READ(ILUPRE,*) ZPRESSU(JKU),ZU(JKU),ZV(JKU) + END DO +! +! Read number of mass levels + READ(ILUPRE,*) ILEVELM +! +! Allocate the required memory + ALLOCATE(ZPRESSM(ILEVELM)) + ALLOCATE(ZTHD(ILEVELM)) + ALLOCATE(ZHU(ILEVELM)) + ALLOCATE(ZHEIGHTM(ILEVELM)) + ALLOCATE(ZTHV(ILEVELM)) + ALLOCATE(ZMR(ILEVELM)) + ALLOCATE(ZT(ILEVELM)) + ALLOCATE(ZTHL(ILEVELM)) + ALLOCATE(ZRT(ILEVELM)) +! +! Read the data at each mass level of the RS + DO JKM =2,ILEVELM + READ(ILUPRE,*) ZPRESSM(JKM),ZTHD(JKM), ZHU(JKM) + END DO +! Complete the mass arrays with the ground informations read in EXPRE file + ZPRESSM(1) = ZPGROUND ! Mass level 1 is at the ground + ZTHD(1) = ZTHDGROUND + ZHU(1) = ZHUGROUND +! + ZT(:) = ZTHD(:) * (ZPRESSM(:)/XP00)**ZRDSCPD ! compute T and mixing ratio + ZMR(:) = ZRDSRV*SM_FOES(ZT(:))/((ZPRESSM(:)*100./ZHU(:)) -SM_FOES(ZT(:))) + +! Compute thetav at the mass levels of the RS + ZTHV(:) = ZTHD(:) * (1. + ZRVSRD *ZMR(:))/(1.+ZMR(:)) +! +! Compute height at mass levels + ZHEIGHTM(:) = HEIGHT_PRESS(ZPRESSM,ZTHV,ZPGROUND,ZTHV(1),ZZGROUND) +! +! Compute thetav and heights of the wind levels + ZTHVU(:) = THETAVPU_THETAVPM(ZPRESSM,ZPRESSU,ZTHV) + ZHEIGHTU(:) = HEIGHT_PRESS(ZPRESSU,ZTHVU,ZPGROUND,ZTHV(1),ZZGROUND) +! +! Compute thetal and Rt + ZRT(:)=ZMR(:) + ZTHL(:)=ZTHV(:)*(1+ZRT(:))/(1+ZRVSRD*ZRT(:)) +! +!* 2.8 ZUVTHDMR case : zGROUND, PGROUND, ThdGROUND, RGROUND +! (height, U, V) , +! (height, THd, R) +! + CASE ('ZUVTHDMR') +! Read data at ground level + READ(ILUPRE,*) ZZGROUND + READ(ILUPRE,*) ZPGROUND + READ(ILUPRE,*) ZTHDGROUND + READ(ILUPRE,*) ZMRGROUND +! +! Read number of wind levels + READ(ILUPRE,*) ILEVELU +! +! Allocate required memory + ALLOCATE(ZHEIGHTU(ILEVELU)) + ALLOCATE(ZU(ILEVELU),ZV(ILEVELU)) +! +! Read the data at each wind level of the RS + DO JKU = 1,ILEVELU + READ(ILUPRE,*) ZHEIGHTU(JKU),ZU(JKU),ZV(JKU) + END DO +! +! Read number of mass levels + READ(ILUPRE,*) ILEVELM +! +! Allocate required memory + ALLOCATE(ZHEIGHTM(ILEVELM)) + ALLOCATE(ZTHD(ILEVELM)) + ALLOCATE(ZMR(ILEVELM)) + ALLOCATE(ZTHV(ILEVELM)) + ALLOCATE(ZMRC(ILEVELM)) + ZMRC=0 + ALLOCATE(ZMRI(ILEVELM)) + ZMRI=0 + ALLOCATE(ZTHL(ILEVELM)) + ALLOCATE(ZRT(ILEVELM)) +! +! Read the data at each mass level of the RS + DO JKM= 2,ILEVELM + IF(LUSERI) THEN + READ(ILUPRE,*) ZHEIGHTM(JKM),ZTHD(JKM),ZMR(JKM),ZMRC(JKM),ZMRI(JKM) + ELSEIF (GUSERC) THEN + READ(ILUPRE,*) ZHEIGHTM(JKM),ZTHD(JKM),ZMR(JKM),ZMRC(JKM) + ELSE + READ(ILUPRE,*) ZHEIGHTM(JKM),ZTHD(JKM),ZMR(JKM) + ENDIF + END DO +! Complete the mass arrays with the ground informations read in EXPRE file + ZHEIGHTM(1) = ZZGROUND ! Mass level 1 is at ground + ZTHD(1) = ZTHDGROUND + ZMR(1) = ZMRGROUND + IF(GUSERC) ZMRC(1) = ZMRC(2) + IF(LUSERI) ZMRI(1) = ZMRI(2) +! Compute thetav at the mass levels of the RS + IF(LUSERI) THEN + ZTHV(:) = ZTHD(:) * (1. + ZRVSRD *ZMR(:))/(1.+ZMR(:)+ZMRC(:)+ZMRI(:)) + ELSEIF (GUSERC) THEN + ZTHV(:) = ZTHD(:) * (1. + ZRVSRD *ZMR(:))/(1.+ZMR(:)+ZMRC(:)) + ELSE + ZTHV(:) = ZTHD(:) * (1. + ZRVSRD *ZMR(:))/(1.+ZMR(:)) + ENDIF +! +! Compute Theta l and Rt + IF (.NOT. GUSERC .AND. .NOT. LUSERI) THEN + ZRT(:)=ZMR(:) + ZTHL(:)=ZTHV(:)*(1+ZRT(:))/(1+ZRVSRD*ZRT(:)) + ELSE + ALLOCATE(ZEXN(ILEVELM)) + ALLOCATE(ZEXNFLUX(ILEVELM)) + ALLOCATE(ZT(ILEVELM)) + ALLOCATE(ZCPH(ILEVELM)) + ALLOCATE(ZLVOCPEXN(ILEVELM)) + ALLOCATE(ZLSOCPEXN(ILEVELM)) + ZRT(:)=ZMR(:)+ZMRI(:)+ZMRC(:) + ZEXNSURF=(ZPGROUND/XP00) ** (XRD/XCPD) + CALL COMPUTE_EXNER_FROM_GROUND(ZTHV,ZHEIGHTM,ZEXNSURF,ZEXNFLUX,ZEXN) + ZT(:)=ZTHV*ZEXN(:)*(1+ZRT(:))/(1+ZRVSRD*ZRT(:)) + ZCPH(:)=XCPD+ XCPV * ZMR(:)+ XCL *ZMRC(:) + XCI * ZMRI(:) + ZLVOCPEXN(:) = (XLVTT + (XCPV-XCL) * (ZT(:)-XTT))/(ZCPH*ZEXN(:)) + ZLSOCPEXN(:) = (XLSTT + (XCPV-XCI) * (ZT(:)-XTT))/(ZCPH*ZEXN(:)) + ZTHL(:)=ZTHV(:)*(1+ZRT(:))/(1+ZRVSRD*ZRT(:))-ZLVOCPEXN(:)*ZMRC(:)-ZLSOCPEXN(:)*ZMRI(:) + DEALLOCATE(ZEXN) + DEALLOCATE(ZEXNFLUX) + DEALLOCATE(ZT) + DEALLOCATE(ZCPH) + DEALLOCATE(ZLVOCPEXN) + DEALLOCATE(ZLSOCPEXN) + ENDIF +! +! 2.9 ZUVTHLMR case : zGROUND, PGROUND, ThdGROUND, RGROUND +! (height, U, V) +! (height, THL, Rt) + +! + CASE ('ZUVTHLMR') +! Read data at ground level + READ(ILUPRE,*) ZZGROUND + READ(ILUPRE,*) ZPGROUND + READ(ILUPRE,*) ZTHLGROUND + READ(ILUPRE,*) ZMRGROUND +! +! Read number of wind levels + READ(ILUPRE,*) ILEVELU +! +! Allocate required memory + ALLOCATE(ZHEIGHTU(ILEVELU)) + ALLOCATE(ZU(ILEVELU),ZV(ILEVELU)) +! +! Read the data at each wind level of the RS + DO JKU = 1,ILEVELU + READ(ILUPRE,*) ZHEIGHTU(JKU),ZU(JKU),ZV(JKU) + END DO +! +! Read number of mass levels + READ(ILUPRE,*) ILEVELM +! +! Allocate required memory + ALLOCATE(ZHEIGHTM(ILEVELM)) + ALLOCATE(ZTHL(ILEVELM)) + ALLOCATE(ZTH(ILEVELM)) + ALLOCATE(ZMR(ILEVELM)) + ALLOCATE(ZTHV(ILEVELM)) + ALLOCATE(ZMRC(ILEVELM)) + ZMRC=0 + ALLOCATE(ZMRI(ILEVELM)) + ZMRI=0 + ALLOCATE(ZRT(ILEVELM)) +! +! Read the data at each mass level of the RS + DO JKM= 2,ILEVELM +! IF(LUSERI) THEN +! READ(ILUPRE,*) ZHEIGHTM(JKM),ZTHL(JKM),ZMR(JKM),ZMRC(JKM),ZMRI(JKM) +! ELSEIF (GUSERC) THEN + IF (GUSERC) THEN + READ(ILUPRE,*) ZHEIGHTM(JKM),ZTHL(JKM),ZMR(JKM),ZMRC(JKM) + ELSE + READ(ILUPRE,*) ZHEIGHTM(JKM),ZTHL(JKM),ZMR(JKM) + ENDIF + END DO +! Complete the mass arrays with the ground informations read in EXPRE file + ZHEIGHTM(1) = ZZGROUND ! Mass level 1 is at ground + ZTHL(1) = ZTHLGROUND + ZMR(1) = ZMRGROUND + IF(GUSERC) ZMRC(1) = ZMRC(2) +! IF(LUSERI) ZMRI(1) = ZMRI(2) +! +! Compute Rt + ZRT(:)=ZMR+ZMRC+ZMRI +! +!* 2.10 PUVTHU case : zGROUND, PGROUND, TempGROUND, HuGROUND +! (Pressure, U, V) , +! (Pressure, Temp, Hu) +! + CASE ('PUVTHU') +! Read data at ground level + READ(ILUPRE,*) ZZGROUND + READ(ILUPRE,*) ZPGROUND + READ(ILUPRE,*) ZTGROUND + READ(ILUPRE,*) ZHUGROUND +! +! Read number of wind levels + READ(ILUPRE,*) ILEVELU +! +! Allocate the required memory + ALLOCATE(ZPRESSU(ILEVELU)) + ALLOCATE(ZU(ILEVELU),ZV(ILEVELU)) + ALLOCATE(ZTHVU(ILEVELU)) + ALLOCATE(ZHEIGHTU(ILEVELU)) +! +! Read the data at each wind level of the RS + DO JKU = 1,ILEVELU + READ(ILUPRE,*) ZPRESSU(JKU),ZU(JKU),ZV(JKU) + END DO +! +! Read number of mass levels + READ(ILUPRE,*) ILEVELM +! +! Allocate the required memory + ALLOCATE(ZPRESSM(ILEVELM)) + ALLOCATE(ZTHD(ILEVELM)) + ALLOCATE(ZHU(ILEVELM)) + ALLOCATE(ZHEIGHTM(ILEVELM)) + ALLOCATE(ZTHV(ILEVELM)) + ALLOCATE(ZMR(ILEVELM)) + ALLOCATE(ZT(ILEVELM)) + ALLOCATE(ZTHL(ILEVELM)) + ALLOCATE(ZRT(ILEVELM)) + +! +! Read the data at each mass level of the RS + DO JKM =2,ILEVELM + READ(ILUPRE,*) ZPRESSM(JKM),ZT(JKM), ZHU(JKM) + END DO +! Complete the mass arrays with the ground informations read in EXPRE file + ZPRESSM(1) = ZPGROUND ! Mass level 1 is at the ground + ZT(1) = ZTGROUND + ZHU(1) = ZHUGROUND +! + ZTHD(:) = ZT(:) / (ZPRESSM(:)/XP00)**ZRDSCPD ! compute THD and mixing ratio + ZMR(:) = ZRDSRV*SM_FOES(ZT(:))/((ZPRESSM(:)*100./ZHU(:)) -SM_FOES(ZT(:))) +! Compute thetav at the mass levels of the RS + ZTHV(:) = ZTHD(:) * (1. + ZRVSRD *ZMR(:))/(1.+ZMR(:)) +! +! Compute height at mass levels + ZHEIGHTM(:) = HEIGHT_PRESS(ZPRESSM,ZTHV,ZPGROUND,ZTHV(1),ZZGROUND) +! +! Compute thetav and heights of the wind levels + ZTHVU(:) = THETAVPU_THETAVPM(ZPRESSM,ZPRESSU,ZTHV) + ZHEIGHTU(:) = HEIGHT_PRESS(ZPRESSU,ZTHVU,ZPGROUND,ZTHV(1),ZZGROUND) +! +! on interpole thetal(=theta quand il n'y a pas d'eau liquide) et r total + ZRT(:)=ZMR(:) + ZTHL(:)=ZTHV(:)*(1+ZRT(:))/(1+ZRVSRD*ZRT(:)) + CASE DEFAULT + CALL PRINT_MSG(NVERB_FATAL,'GEN','SET_RSOU','data type YKIND='//TRIM(YKIND)//' in PREFILE unknown') +END SELECT +! +!------------------------------------------------------------------------------- +! +!* 3. INTERPOLATE ON THE VERTICAL MIXED MODEL GRID +! --------------------------------------------------------- +! +! +! +IKU=SIZE(XZHAT) +! +!* 3.1 Compute mixed grid +! +IF (PRESENT(PCORIOZ)) THEN +! LGEOSBAL=T (no shift allowed, MNH grid without ororgraphy) + ZZS_LS(:,:)=0 +ELSE + IF (OSHIFT) THEN + ZZS_LS(:,:)=ZZGROUND + ELSE + ZZS_LS(:,:)=0 + ENDIF +ENDIF +CALL VERT_COORD(LSLEVE,ZZS_LS,ZZS_LS,XLEN1,XLEN2,XZHAT,ZZFLUX_MX) +ZZMASS_MX(:,:,:)=MZF(ZZFLUX_MX) +ZZMASS_MX(:,:,IKU)=1.5*ZZFLUX_MX(:,:,IKU)-0.5*ZZFLUX_MX(:,:,IKU-1) +! +!* 3.2 Interpolate and extrapolate U and V on w- mixed grid levels +! +!* vertical grid at initialization profile location +GPROFILE_IN_PROC=(KILOC+JPHEXT-IXOR_ll+1>=IIB .AND. KILOC+JPHEXT-IXOR_ll+1<=IIE) & + & .AND. (KJLOC+JPHEXT-IYOR_ll+1>=IJB .AND. KJLOC+JPHEXT-IYOR_ll+1<=IJE) +! +IF (GPROFILE_IN_PROC) THEN + ZZMASS_PROFILE(:) = ZZMASS_MX(KILOC+JPHEXT-IXOR_ll+1,KJLOC+JPHEXT-IYOR_ll+1,:) + ZZFLUX_PROFILE(:) = ZZFLUX_MX(KILOC+JPHEXT-IXOR_ll+1,KJLOC+JPHEXT-IYOR_ll+1,:) +ELSE + ZZMASS_PROFILE(:) = 0. + ZZFLUX_PROFILE(:) = 0. +END IF +DO JK = 1,IKU + CALL REDUCESUM_ll(ZZMASS_PROFILE(JK), IINFO_ll) + CALL REDUCESUM_ll(ZZFLUX_PROFILE(JK), IINFO_ll) +END DO + +! interpolation of U and V +DO JK = 1,IKU + IF (ZZFLUX_PROFILE(JK) <= ZHEIGHTU(1)) THEN ! extrapolation below the first level + ZDZSDH = (ZZFLUX_PROFILE(JK) - ZHEIGHTU(1)) / (ZHEIGHTU(2) - ZHEIGHTU(1)) + ZUW(JK) = ZU(1) + (ZU(2) - ZU(1)) * ZDZSDH + ZVW(JK) = ZV(1) + (ZV(2) - ZV(1)) * ZDZSDH + ELSE IF (ZZFLUX_PROFILE(JK) > ZHEIGHTU(ILEVELU) ) THEN ! extrapolation above the last + ZDZSDH = (ZZFLUX_PROFILE(JK) - ZHEIGHTU(ILEVELU)) & ! level + / (ZHEIGHTU(ILEVELU) - ZHEIGHTU(ILEVELU-1)) + ZUW(JK) = ZU(ILEVELU) + (ZU(ILEVELU) -ZU(ILEVELU -1)) * ZDZSDH + ZVW(JK) = ZV(ILEVELU) + (ZV(ILEVELU) -ZV(ILEVELU -1)) * ZDZSDH + ELSE ! interpolation between the first and last levels + DO JKLEV = 1,ILEVELU-1 + IF ( (ZZFLUX_PROFILE(JK) > ZHEIGHTU(JKLEV)).AND. & + (ZZFLUX_PROFILE(JK) <= ZHEIGHTU(JKLEV+1)) )THEN + ZDZ1SDH = (ZZFLUX_PROFILE(JK) - ZHEIGHTU(JKLEV)) & + / (ZHEIGHTU(JKLEV+1)-ZHEIGHTU(JKLEV)) + ZDZ2SDH = (ZHEIGHTU(JKLEV+1) - ZZFLUX_PROFILE(JK) ) & + / (ZHEIGHTU(JKLEV+1)-ZHEIGHTU(JKLEV)) + ZUW(JK) = (ZU(JKLEV) * ZDZ2SDH) + (ZU(JKLEV+1) *ZDZ1SDH) + ZVW(JK) = (ZV(JKLEV) * ZDZ2SDH) + (ZV(JKLEV+1) *ZDZ1SDH) + END IF + END DO + END IF +END DO +! +!* 3.3 Interpolate and extrapolate Thetav and r on mass mixed grid levels +! +ZMRCM=0 +ZMRIM=0 +DO JK = 1,IKU + IF (ZZMASS_PROFILE(JK) <= ZHEIGHTM(1)) THEN ! extrapolation below the first level + ZDZSDH = (ZZMASS_PROFILE(JK) - ZHEIGHTM(1)) / (ZHEIGHTM(2) - ZHEIGHTM(1)) + ZTHLM(JK) = ZTHL(1) + (ZTHL(2) - ZTHL(1)) * ZDZSDH + ZMRM(JK) = ZRT(1) + (ZRT(2) - ZRT(1)) * ZDZSDH + IF (GUSERC) ZMRCM(JK) = ZMRC(1) + (ZMRC(2) - ZMRC(1)) * ZDZSDH + IF (LUSERI) ZMRIM(JK) = ZMRI(1) + (ZMRI(2) - ZMRI(1)) * ZDZSDH + ELSE IF (ZZMASS_PROFILE(JK) > ZHEIGHTM(ILEVELM) ) THEN ! extrapolation above the last + ZDZSDH = (ZZMASS_PROFILE(JK) - ZHEIGHTM(ILEVELM)) & ! level + / (ZHEIGHTM(ILEVELM) - ZHEIGHTM(ILEVELM-1)) + ZTHLM(JK) = ZTHL(ILEVELM) + (ZTHL(ILEVELM) -ZTHL(ILEVELM -1)) * ZDZSDH + ZMRM(JK) = ZRT(ILEVELM) + (ZRT(ILEVELM) -ZRT(ILEVELM -1)) * ZDZSDH + IF (GUSERC) ZMRCM(JK) = ZMRC(ILEVELM) + (ZMRC(ILEVELM) -ZMRC(ILEVELM -1)) * ZDZSDH + IF (LUSERI) ZMRIM(JK) = ZMRI(ILEVELM) + (ZMRI(ILEVELM) -ZMRI(ILEVELM -1)) * ZDZSDH + ELSE ! interpolation between the first and last levels + DO JKLEV = 1,ILEVELM-1 + IF ( (ZZMASS_PROFILE(JK) > ZHEIGHTM(JKLEV)).AND. & + (ZZMASS_PROFILE(JK) <= ZHEIGHTM(JKLEV+1)) )THEN + ZDZ1SDH = (ZZMASS_PROFILE(JK) - ZHEIGHTM(JKLEV)) & + / (ZHEIGHTM(JKLEV+1)-ZHEIGHTM(JKLEV)) + ZDZ2SDH = (ZHEIGHTM(JKLEV+1) - ZZMASS_PROFILE(JK) ) & + / (ZHEIGHTM(JKLEV+1)-ZHEIGHTM(JKLEV)) + ZTHLM(JK) = (ZTHL(JKLEV) * ZDZ2SDH) + (ZTHL(JKLEV+1) *ZDZ1SDH) + ZMRM(JK) = (ZRT(JKLEV) * ZDZ2SDH) + (ZRT(JKLEV+1) *ZDZ1SDH) + IF (GUSERC) ZMRCM(JK) = (ZMRC(JKLEV) * ZDZ2SDH) + (ZMRC(JKLEV+1) *ZDZ1SDH) + IF (LUSERI) ZMRIM(JK) = (ZMRI(JKLEV) * ZDZ2SDH) + (ZMRI(JKLEV+1) *ZDZ1SDH) + END IF + END DO + END IF +END DO +! +! Compute thetaV rv ri and Rc with adjustement +ALLOCATE(ZEXNFLUX(IKU)) +ALLOCATE(ZEXNMASS(IKU)) +ALLOCATE(ZPRESS(IKU)) +ALLOCATE(ZPREFLUX(IKU)) +ALLOCATE(ZFRAC_ICE(IKU)) +ALLOCATE(ZRSATW(IKU)) +ALLOCATE(ZRSATI(IKU)) +ALLOCATE(ZMRT(IKU)) +ALLOCATE(ZBUF(IKU,16)) +ZMRT=ZMRM+ZMRCM+ZMRIM +ZTHVM=ZTHLM +! +IF (LOCEAN) THEN + ZRHODM(:)=XRH00OCEAN*(1.-XALPHAOC*(ZTHLM(:) - XTH00OCEAN)& + +XBETAOC* (ZMRM(:) - XSA00OCEAN)) + ZPREFLUX(IKU)=ZPTOP + DO JK=IKU-1,2,-1 + ZPREFLUX(JK) = ZPREFLUX(JK+1) + XG*ZRHODM(JK)*(ZZFLUX_PROFILE(JK+1)-ZZFLUX_PROFILE(JK)) + END DO + ZPGROUND=ZPREFLUX(2) + WRITE(ILUOUT,FMT=*)'ZPGROUND i.e. Pressure at ocean domain bottom',ZPGROUND + ZTHM=ZTHVM +ELSE +! Atmospheric case + ZEXNSURF=(ZPGROUND/XP00)**(XRD/XCPD) + DO JLOOP=1,20 ! loop for pression + CALL COMPUTE_EXNER_FROM_GROUND(ZTHVM,ZZMASS_PROFILE(:),ZEXNSURF,ZEXNFLUX,ZEXNMASS) + ZPRESS(:)=XP00*(ZEXNMASS(:))**(XCPD/XRD) + CALL TH_R_FROM_THL_RT(CST,NEBN,SIZE(ZPRESS,1),'T',ZFRAC_ICE,ZPRESS,ZTHLM,ZMRT,ZTHM,ZMRM,ZMRCM,ZMRIM, & + ZRSATW, ZRSATI,OOCEAN=.FALSE.,& + PBUF=ZBUF) + ZTHVM(:)=ZTHM(:)*(1.+XRV/XRD*ZMRM(:))/(1.+(ZMRM(:)+ZMRIM(:)+ZMRCM(:))) + ENDDO +ENDIF +! +DEALLOCATE(ZEXNFLUX) +DEALLOCATE(ZEXNMASS) +DEALLOCATE(ZPRESS) +DEALLOCATE(ZFRAC_ICE) +DEALLOCATE(ZRSATW) +DEALLOCATE(ZRSATI) +DEALLOCATE(ZMRT) +DEALLOCATE(ZBUF) +!------------------------------------------------------------------------------- +! +!* 4. COMPUTE FIELDS ON THE MODEL GRID (WITH OROGRAPHY) +! ------------------------------------------------- +CALL SET_MASS(TPFILE,GPROFILE_IN_PROC, ZZFLUX_PROFILE, & + KILOC+JPHEXT,KJLOC+JPHEXT,ZZS_LS,ZZMASS_MX,ZZFLUX_MX,ZPGROUND,& + ZTHVM,ZMRM,ZUW,ZVW,OSHIFT,OBOUSS,PJ,HFUNU,HFUNV, & + PMRCM=ZMRCM,PMRIM=ZMRIM,PCORIOZ=PCORIOZ) +! +DEALLOCATE(ZPREFLUX) +DEALLOCATE(ZHEIGHTM) +DEALLOCATE(ZTHV) +DEALLOCATE(ZMR) +DEALLOCATE(ZTHL) +!------------------------------------------------------------------------------- +CONTAINS + SUBROUTINE CHECK( ISTATUS, YLOC ) + INTEGER(KIND=CDFINT), INTENT(IN) :: ISTATUS + CHARACTER(LEN=*), INTENT(IN) :: YLOC + + IF( ISTATUS /= NF90_NOERR ) THEN + CALL PRINT_MSG( NVERB_ERROR, 'IO', 'SET_RSOU', 'error at ' // Trim( yloc) // ': ' // NF90_STRERROR( ISTATUS ) ) + END IF + END SUBROUTINE check + ! + INCLUDE "th_r_from_thl_rt.func.h" + INCLUDE "compute_frac_ice.func.h" + ! +END SUBROUTINE SET_RSOU diff --git a/src/mesonh/ext/shallow_mf_pack.f90 b/src/mesonh/ext/shallow_mf_pack.f90 new file mode 100644 index 0000000000000000000000000000000000000000..9506b704203fedb9349487a11d4f49525bc9ddba --- /dev/null +++ b/src/mesonh/ext/shallow_mf_pack.f90 @@ -0,0 +1,372 @@ +!MNH_LIC Copyright 2010-2021 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_SHALLOW_MF_PACK +! ###################### +! +INTERFACE +! ################################################################# + SUBROUTINE SHALLOW_MF_PACK(KRR,KRRL,KRRI, & + TPFILE,PTIME_LES, & + PTSTEP, & + PDZZ, PZZ, PDX,PDY, & + PRHODJ, PRHODREF, & + PPABSM, PEXN, & + PSFTH,PSFRV, & + PTHM,PRM,PUM,PVM,PTKEM,PSVM, & + PRTHS,PRRS,PRUS,PRVS,PRSVS, & + PSIGMF,PRC_MF,PRI_MF,PCF_MF,PFLXZTHVMF ) +! ################################################################# +!! +use MODD_IO, only: TFILEDATA +use modd_precision, only: MNHTIME +! +!* 1.1 Declaration of Arguments +! +! +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. +TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file +REAL(kind=MNHTIME),DIMENSION(2), INTENT(OUT) :: PTIME_LES ! time spent in LES computations +REAL, INTENT(IN) :: PTSTEP ! Dynamical timestep + +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! Height of flux point +REAL, DIMENSION(:,:,:), INTENT(IN) :: PDZZ ! Metric coefficients +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! dry density * Grid size +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF ! dry density of the + ! reference state +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABSM ! Pressure at time t-1 +REAL, DIMENSION(:,:,:), INTENT(IN) :: PEXN ! Exner function at t-dt + +REAL, DIMENSION(:,:), INTENT(IN) :: PSFTH,PSFRV ! normal surface fluxes of theta and Rv +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHM ! Theta at t-dt +REAL, DIMENSION(:,:,:,:),INTENT(IN):: PRM ! water var. at t-dt +REAL, DIMENSION(:,:,:), INTENT(IN) :: PUM,PVM ! wind components at t-dt +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! tke at t-dt + +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM ! scalar variable a t-dt + +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS,PRVS,PRTHS ! Meso-NH sources +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRS +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRSVS ! Scalar sources +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSIGMF,PRC_MF,PRI_MF,PCF_MF ! cloud info for the cloud scheme +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PFLXZTHVMF ! Thermal production for TKE scheme +! +REAL, INTENT(IN) :: PDX,PDY ! Size of mesh in X/Y directions +END SUBROUTINE SHALLOW_MF_PACK + +END INTERFACE +! +END MODULE MODI_SHALLOW_MF_PACK + +! ################################################################# + SUBROUTINE SHALLOW_MF_PACK(KRR,KRRL,KRRI, & + TPFILE,PTIME_LES, & + PTSTEP, & + PDZZ, PZZ, PDX,PDY, & + PRHODJ, PRHODREF, & + PPABSM, PEXN, & + PSFTH,PSFRV, & + PTHM,PRM,PUM,PVM,PTKEM,PSVM, & + PRTHS,PRRS,PRUS,PRVS,PRSVS, & + PSIGMF,PRC_MF,PRI_MF,PCF_MF,PFLXZTHVMF ) +! ################################################################# +!! +!!**** *SHALLOW_MF_PACK* - +!! +!! +!! PURPOSE +!! ------- +!!**** The purpose of this routine is +!! +! +!!** METHOD +!! ------ +!! +!! EXTERNAL +!! -------- +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! REFERENCE +!! --------- +!! +!! +!! AUTHOR +!! ------ +!! V.Masson 09/2010 +! -------------------------------------------------------------------------- +! Modifications: +! R. Honnert 07/2012: introduction of vertical wind for the height of the thermal +! M. Leriche 02/2017: avoid negative values for sv tendencies +! P. Wautelet 05/2016-04/2018: new data structures and calls for I/O +! S. Riette 11/2016: support for CFRAC_ICE_SHALLOW_MF +! P. Wautelet 28/03/2019: use MNHTIME for time measurement variables +! P. Wautelet 02/2020: use the new data structures and subroutines for budgets +! -------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_CST, ONLY: CST +USE MODD_NEB_n, ONLY: NEBN +USE MODD_TURB_n, ONLY: TURBN +USE MODD_CTURB, ONLY: CSTURB +USE MODD_PARAM_MFSHALL_n, ONLY: PARAM_MFSHALLN, LMF_FLX +USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t +! +USE MODE_FILL_DIMPHYEX, ONLY: FILL_DIMPHYEX +! +USE MODD_BUDGET, ONLY: TBUDGETS,TBUCONF,lbudget_th,nbudget_th +USE MODD_CONF +USE MODD_IO, ONLY: TFILEDATA +USE modd_field, ONLY: tfielddata, TYPEREAL +USE MODD_NSV, ONLY: XSVMIN, NSV_LGBEG, NSV_LGEND +USE MODD_PARAMETERS +USE MODD_PARAM_MFSHALL_n +USE modd_precision, ONLY: MNHTIME + +USE mode_budget, ONLY: Budget_store_init, Budget_store_end, Budget_store_add +USE MODE_IO_FIELD_WRITE, ONLY: IO_Field_write + +USE MODI_DIAGNOS_LES_MF +USE MODI_SHALLOW_MF +USE MODI_SHUMAN +! +IMPLICIT NONE + +!* 0.1 Declaration of Arguments +! +! +! +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. +TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file +REAL(kind=MNHTIME),DIMENSION(2), INTENT(OUT) :: PTIME_LES ! time spent in LES computations +REAL, INTENT(IN) :: PTSTEP ! Dynamical timestep + +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! Height of flux point +REAL, DIMENSION(:,:,:), INTENT(IN) :: PDZZ ! Metric coefficients +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! dry density * Grid size +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF ! dry density of the + ! reference state +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABSM ! Pressure at time t-1 +REAL, DIMENSION(:,:,:), INTENT(IN) :: PEXN ! Exner function at t-dt + +REAL, DIMENSION(:,:), INTENT(IN) :: PSFTH,PSFRV ! normal surface fluxes of theta and Rv +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHM ! Theta at t-dt +REAL, DIMENSION(:,:,:,:),INTENT(IN):: PRM ! water var. at t-dt +REAL, DIMENSION(:,:,:), INTENT(IN) :: PUM,PVM ! wind components at t-dt +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTKEM ! tke at t-dt + +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVM ! scalar variable a t-dt + +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS,PRVS,PRTHS ! Meso-NH sources +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRS +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRSVS ! Scalar sources +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PSIGMF,PRC_MF,PRI_MF,PCF_MF ! cloud info for the cloud scheme +REAL, DIMENSION(:,:,:), INTENT(OUT) :: PFLXZTHVMF ! Thermal production for TKE scheme +! +REAL, INTENT(IN) :: PDX,PDY ! Size of mesh in X/Y directions +! 0.2 Declaration of local variables +! +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZDUDT_TURB ! tendency of U by turbulence only +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZDVDT_TURB ! tendency of V by turbulence only +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZDTHLDT_TURB ! tendency of thl by turbulence only +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZDRTDT_TURB ! tendency of rt by turbulence only +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3),SIZE(PSVM,4)) :: ZDSVDT_TURB ! tendency of Sv by turbulence only +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZDUDT_MF ! tendency of U by massflux scheme +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZDVDT_MF ! tendency of V by massflux scheme +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZDTHLDT_MF ! tendency of thl by massflux scheme +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZDRTDT_MF ! tendency of Rt by massflux scheme +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3),SIZE(PSVM,4)) :: ZDSVDT_MF ! tendency of Sv by massflux scheme +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZSIGMF,ZRC_MF,ZRI_MF,ZCF_MF ! cloud info for the cloud scheme +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZFLXZTHVMF ! Thermal production for TKE scheme +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZFLXZTHMF +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZFLXZRMF +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZFLXZUMF +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZFLXZVMF +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZTHL_UP ! updraft characteristics +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZRT_UP ! updraft characteristics +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZRV_UP ! updraft characteristics +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZU_UP ! updraft characteristics +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZV_UP ! updraft characteristics +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZRC_UP ! updraft characteristics +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZRI_UP ! updraft characteristics +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZTHV_UP ! updraft characteristics +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZW_UP ! updraft characteristics +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZFRAC_UP ! updraft characteristics +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZEMF ! updraft characteristics +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZDETR ! updraft characteristics +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZENTR ! updraft characteristics +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZUMM ! wind on mass point +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZVMM ! wind on mass point +! +INTEGER,DIMENSION(SIZE(PTHM,1)*SIZE(PTHM,2)) :: IKLCL,IKETL,IKCTL ! level of LCL,ETL and CTL +INTEGER :: IIU, IJU, IKU, IKB, IKE, IRR, ISV +INTEGER :: JK,JRR,JSV ! Loop counters + + +TYPE(TFIELDDATA) :: TZFIELD +TYPE(DIMPHYEX_t) :: YLDIMPHYEXPACK +!------------------------------------------------------------------------ +! +!!! 1. Initialisation +CALL FILL_DIMPHYEX(YLDIMPHYEXPACK, SIZE(PZZ,1), SIZE(PZZ,2), SIZE(PZZ,3)) +! +! Internal Domain +IIU=SIZE(PTHM,1) +IJU=SIZE(PTHM,2) +IKU=SIZE(PTHM,3) +IKB=1+JPVEXT +IKE=IKU-JPVEXT +! +! number of moist var +IRR=SIZE(PRM,4) +! number of scalar var +ISV=SIZE(PSVM,4) +! +! wind on mass points +ZUMM=MXF(PUM) +ZVMM=MYF(PVM) +! +!!! 2. Call of the physical parameterization of massflux vertical transport +! +! +CALL SHALLOW_MF(YLDIMPHYEXPACK, CST, NEBN, PARAM_MFSHALLN, TURBN, CSTURB,& + KRR,KRRL,KRRI,ISV, & + LNOMIXLG,NSV_LGBEG,NSV_LGEND, & + PTSTEP, & + PDZZ, PZZ, & + PRHODJ,PRHODREF, & + PPABSM, PEXN, & + PSFTH,PSFRV, & + PTHM,PRM,ZUMM,ZVMM,PTKEM,PSVM, & + ZDUDT_MF,ZDVDT_MF, & + ZDTHLDT_MF,ZDRTDT_MF,ZDSVDT_MF, & + ZSIGMF,ZRC_MF,ZRI_MF,ZCF_MF,ZFLXZTHVMF, & + ZFLXZTHMF,ZFLXZRMF,ZFLXZUMF,ZFLXZVMF, & + ZTHL_UP,ZRT_UP,ZRV_UP,ZRC_UP,ZRI_UP, & + ZU_UP, ZV_UP, ZTHV_UP, ZW_UP, & + ZFRAC_UP,ZEMF,ZDETR,ZENTR, & + IKLCL,IKETL,IKCTL,PDX,PDY,PRSVS,XSVMIN, & + TBUCONF, TBUDGETS,SIZE(TBUDGETS) ) +! +! Fill non-declared-explicit-dimensions output variables +PSIGMF(:,:,:) = ZSIGMF(:,:,:) +PRC_MF(:,:,:) = ZRC_MF(:,:,:) +PRI_MF(:,:,:) = ZRI_MF(:,:,:) +PCF_MF(:,:,:) = ZCF_MF(:,:,:) +PFLXZTHVMF(:,:,:) = ZFLXZTHVMF(:,:,:) +! +!!! 3. Compute source terms for Meso-NH pronostic variables +!!! ---------------------------------------------------- +! +! As the pronostic variable of Meso-Nh are not (yet) the conservative variables +! the thl tendency is put in th and the rt tendency in rv +! the adjustment will do later the repartition between vapor and cloud +PRTHS(:,:,:) = PRTHS(:,:,:) + & + PRHODJ(:,:,:)*ZDTHLDT_MF(:,:,:) +PRRS(:,:,:,1) = PRRS(:,:,:,1) + & + PRHODJ(:,:,:)*ZDRTDT_MF(:,:,:) +PRUS(:,:,:) = PRUS(:,:,:) +MXM( & + PRHODJ(:,:,:)*ZDUDT_MF(:,:,:)) +PRVS(:,:,:) = PRVS(:,:,:) +MYM( & + PRHODJ(:,:,:)*ZDVDT_MF(:,:,:)) +! +DO JSV=1,ISV + IF (LNOMIXLG .AND. JSV >= NSV_LGBEG .AND. JSV<= NSV_LGEND) CYCLE + PRSVS(:,:,:,JSV) = MAX((PRSVS(:,:,:,JSV) + & + PRHODJ(:,:,:)*ZDSVDT_MF(:,:,:,JSV)),XSVMIN(JSV)) +END DO +! +!!! 4. Prints the fluxes in output file +! +IF ( LMF_FLX .AND. tpfile%lopened ) THEN + ! stores the conservative potential temperature vertical flux + TZFIELD%CMNHNAME = 'MF_THW_FLX' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'MF_THW_FLX' + TZFIELD%CUNITS = 'K m s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_MF_THW_FLX' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZFLXZTHMF) + ! + ! stores the conservative mixing ratio vertical flux + TZFIELD%CMNHNAME = 'MF_RCONSW_FLX' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'MF_RCONSW_FLX' + TZFIELD%CUNITS = 'K m s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_MF_RCONSW_FLX' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZFLXZRMF) + ! + ! stores the theta_v vertical flux + TZFIELD%CMNHNAME = 'MF_THVW_FLX' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'MF_THVW_FLX' + TZFIELD%CUNITS = 'K m s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_MF_THVW_FLX' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,PFLXZTHVMF) + ! + IF (PARAM_MFSHALLN%LMIXUV) THEN + ! stores the U momentum vertical flux + TZFIELD%CMNHNAME = 'MF_UW_FLX' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'MF_UW_FLX' + TZFIELD%CUNITS = 'm2 s-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_MF_UW_FLX' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZFLXZUMF) + ! + ! stores the V momentum vertical flux + TZFIELD%CMNHNAME = 'MF_VW_FLX' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'MF_VW_FLX' + TZFIELD%CUNITS = 'm2 s-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_MF_VW_FLX' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZFLXZVMF) + ! + END IF +END IF +! +!!! 5. Externalised LES Diagnostic for Mass Flux Scheme +!!! ------------------------------------------------ +! + CALL DIAGNOS_LES_MF(IIU,IJU,IKU,PTIME_LES, & + ZTHL_UP,ZRT_UP,ZRV_UP,ZRC_UP,ZRI_UP, & + ZU_UP,ZV_UP,ZTHV_UP,ZW_UP, & + ZFRAC_UP,ZEMF,ZDETR,ZENTR, & + ZFLXZTHMF,ZFLXZTHVMF,ZFLXZRMF, & + ZFLXZUMF,ZFLXZVMF, & + IKLCL,IKETL,IKCTL ) +! +END SUBROUTINE SHALLOW_MF_PACK diff --git a/src/mesonh/ext/spawn_model2.f90 b/src/mesonh/ext/spawn_model2.f90 new file mode 100644 index 0000000000000000000000000000000000000000..94d209b0056b06677b312ab0d1113335878bd9b6 --- /dev/null +++ b/src/mesonh/ext/spawn_model2.f90 @@ -0,0 +1,1690 @@ +!MNH_LIC Copyright 1995-2021 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_SPAWN_MODEL2 +!######################## +! +INTERFACE +! + SUBROUTINE SPAWN_MODEL2 (KRR,KSV_USER,HTURB,HSURF,HCLOUD, & + HCHEM_INPUT_FILE,HSPAFILE,HSPANBR, & + HSONFILE,HINIFILE,HINIFILEPGD,OSPAWN_SURF ) +! +INTEGER, INTENT(IN) :: KRR ! Number of moist variables +INTEGER, INTENT(IN) :: KSV_USER ! Number of Users Scalar Variables +CHARACTER (LEN=4), INTENT(IN) :: HTURB ! Kind of turbulence parameterization +CHARACTER (LEN=4), INTENT(IN) :: HSURF ! Kind of surface parameterization +CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! Kind of cloud parameterization + ! model 2 physical domain +CHARACTER (LEN=*), INTENT(IN) :: HSPAFILE ! possible name of the output FM-file +CHARACTER (LEN=*), INTENT(IN) :: HSPANBR ! NumBeR associated to the SPAwned file +CHARACTER (LEN=*), INTENT(IN) :: HSONFILE ! name of the input FM-file SON +CHARACTER (LEN=80), INTENT(IN) :: HCHEM_INPUT_FILE +CHARACTER (LEN=*), INTENT(IN) :: HINIFILE ! Input file +CHARACTER (LEN=*), INTENT(IN) :: HINIFILEPGD ! Input pgd file +LOGICAL, INTENT(IN) :: OSPAWN_SURF ! flag to spawn surface fields +! +END SUBROUTINE SPAWN_MODEL2 +! +END INTERFACE +! +END MODULE MODI_SPAWN_MODEL2 +! ######spl + SUBROUTINE SPAWN_MODEL2 (KRR,KSV_USER,HTURB,HSURF,HCLOUD, & + HCHEM_INPUT_FILE,HSPAFILE,HSPANBR, & + HSONFILE,HINIFILE,HINIFILEPGD,OSPAWN_SURF ) +! ####################################################################### +! +!!**** *SPAWN_MODEL2 * - subroutine to prepare by horizontal interpolation and +!! write an initial FM-file spawned from an other FM-file. +!! +!! PURPOSE +!! ------- +!! +!! Initializes by horizontal interpolation, the model 2 in a sub-domain of +!! model 1, possibly overwrites model 2 information by model SON1, +!! and writes the resulting fields in a FM-file. +!! +!! +!!** METHOD +!! ------ +!! +!! In this routine, only the model 2 variables are known through the +!! MODD_... calls. +!! +!! The directives to perform the preparation of the initial FM +!! file are stored in EXSPA.nam file. +!! +!! The following SPAWN_MODEL2 routine : +!! +!! - sets default values of DESFM files +!! - reads the namelists part of EXSPA file which gives the +!! directives concerning the spawning to perform +!! - controls the domain size of model 2 and initializes its +!! configuration for parameterizations and LBC +!! - allocates memory for arrays +!! - computes the interpolation coefficients needed to spawn model 2 +!! 2 types of interpolations are used: +!! 1. Clark and Farley (JAS 1984) on 9 points +!! 2. Bikhardt on 16 points +!! - initializes fields +!! - reads SON1 fields and overwrites on common domain +!! - writes the DESFM file (variables written have been initialized +!! by reading the DESFM file concerning the model 1) +!! - writes the LFIFM file. +!! +!! Finally some control prints are performed on the output listing. +!! +!! EXTERNAL +!! -------- +!! +!! Module MODE_GRIDPROJ : contains conformal projection routines +!! SM_GRIDPROJ : to compute some grid variables, in +!! case of conformal projection. +!! Module MODE_GRIDCART : contains cartesian geometry routines +!! SM_GRIDCART : to compute some grid variables, in +!! case of cartesian geometry. +!! SET_REF : to compute rhoJ +!! TOTAL_DMASS : to compute the total mass of dry air +!! ANEL_BALANCE2 : to apply an anelastic correction in the case of changing +!! resolution between the two models +!! IO_File_open : to open a FM-file (DESFM + LFIFM) +!! WRITE_DESFM : to write the DESFM file +!! WRITE_LFIFM : to write the LFIFM file +!! IO_File_close : to close a FM-file (DESFM + LFIFM) +!! INI_BIKHARDT2 : initializes Bikhardt coefficients +!! +!! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! Module MODD_PARAMETERS : contains parameters +!! Module MODD_CONF : contains configuration variables for all models +!! Module MODD_CTURB : +!! XTKEMIN : mimimum value for the TKE +!! Module MODD_GRID : contains grid variables for all models +!! Module USE MODD_DYN : contains configuration for the dynamics +!! Module MODD_REF : contains reference state variables for +!! all models +!! +!! Module MODD_DIM2 : contains dimensions +!! Module MODD_CONF2 : contains configuration variables +!! Module MODD_GRID2 : contains grid variables +!! Module MODD_TIME2 : contains time variables and uses MODD_TIME +!! Module MODD_REF2 : contains reference state variables +!! Module MODD_FIELD2 : contains prognostic variables +!! Module MODD_LSFIELD2 : contains Larger Scale fields +!! Module MODD_GR_FIELD2 : contains surface fields +!! Module MODD_DYN2 : contains dynamic control variables for model 2 +!! Module MODD_LBC2 : contains lbc control variables for model 2 +!! Module MODD_PARAM2 : contains configuration for physical parameterizations +!! +!! REFERENCE +!! --------- +!! +!! PROGRAM SPAWN_MODEL2 (Book2 of the documentation) +!! +!! +!! AUTHOR +!! ------ +!! +!! J.P. Lafore * METEO-FRANCE * +!! +!! MODIFICATIONS +!! ------------- +!! +!! Original 11/01/95 +!! Modification 27/04/95 (I.Mallet) remove R from the historical variables +!! Modification 16/04/96 (Lafore) Different resolution ratio case introduction +!! Modification 24/04/96 (Lafore & Masson) Initialization of LUSERWs +!! Modification 24/04/96 (Masson) Correction of positivity on Rw and TKE +!! Modification 25/04/96 (Masson) Copies of internal zs on external points +!! Modification 02/05/96 (Stein Jabouille) initialize CCONF +!! Modification 31/05/96 (Lafore) Cumputing time analysis +!! Modification 10/06/96 (Masson) Call to anel_balance in all cases +!! Modification 10/06/96 (Masson) Bikhardt and Clark_and_Farley coefficients +!! incorporated in modules +!! Modification 12/06/96 (Masson) default values of NJMAX and KDYRATIO +!! if 2D version of the model +!! Modification 13/06/96 (Masson) choice of the name of the spawned file +!! Modification 30/07/96 (Lafore) MY_NAME and DAD_NAME writing for nesting +!! Modification 25/09/96 (Masson) grid optionnaly given by a fm file +!! and number of points given relatively +!! to model 1 +!! Modification 10/10/96 (Masson) L1D and L2D verifications +!! Modification 12/11/96 (Masson) allocations of XSRCM and XSRCT +!! Modification 19/11/96 (Masson) add deep convection +!! Modification 26/11/96 (Lafore) spawning configuration writing on the FM-file +!! Modification 26/11/96 (Lafore) replacing of TOTAL_DMASS by REAL_DMASS +!! Modification 27/02/97 (Lafore) "surfacic" LS fields +!! Modification 10/04/97 (Lafore) proper treatment of minima +!! Modification 09/07/97 (Masson) absolute pressure and directional z0 +!! Modification 10/07/97 (Masson) routines SPAWN_PRESSURE2 and DRY_MASS +!! Modification 17/07/97 (Masson) vertical interpolations and EPS +!! Modification 29/07/97 (Masson) split mode_lfifm_pgd +!! Modification 10/08/97 (Lafore) initialization of LUSERV +!! Modification 14/09/97 (Masson) use of relative humidity +!! Modification 08/12/97 (Masson) deallocation of model 1 variables +!! Modification 24/12/97 (Masson) directional z0 parameters and orographies +!! Modification 20/07/98 (Stein ) add the LB fields +!! Modification 15/03/99 (Masson) cover types +!! Modification 15/07/99 (Jabouille) shift domain initialization in INI_SIZE_SPAWN +!! Modification 04/01/00 (Masson) removes TSZ0 option +!! Modification 29/11/02 (Pinty) add C3R5, ICE2, ICE4 +!! Modification 07/07/05 (D.Barbary) spawn with 2 input files (father+son1) +!! Modification 20/05/06 Remove EPS, Clark and Farley interpolation +!! Replace DRY_MASS by TOTAL_DMASS +!! Modification 06/12 (M.Tomasini) Interpolation of the advective forcing (ADVFRC) +!! and of the turbulent fluxes (EDDY_FLUX) +!! Modification 07/13 (Bosseur & Filippi) Adds Forefire +!! 24/04/2014 (J.escobar) bypass CRAY internal compiler error on IIJ computation +!! Modification 06/2014 (C.Lac) Initialization of physical param of +!! model2 before the call to ini_nsv +!! Modification 05/02/2015 (M.Moge) parallelization of SPAWNING +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! J.Escobar 02/05/2016 : test ZZS_MAX in // +!! P.Wautelet 08/07/2016 : removed MNH_NCWRIT define +!! J.Escobar 12/07/2016 : add test on NRIMY & change the one on NRIMX with >= +!! Modification 01/2016 (JP Pinty) Add LIMA +!! 10/2016 (C.Lac) Add droplet deposition +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 07/02/2019: force TYPE to a known value for IO_File_add2list +! S. Bielli 02/2019: sea salt: significant sea wave height influences salt emission; 5 salt modes +! P. Wautelet 22/02/2019: replace Hollerith edit descriptor (deleted from Fortran 95 standard) +! P. Wautelet 14/03/2019: correct ZWS when variable not present in file +! P. Wautelet 10/04/2019: replace ABORT and STOP calls by Print_msg +! P. Wautelet 20/05/2019: add name argument to ADDnFIELD_ll + new ADD4DFIELD_ll subroutine +! P. Wautelet 09/03/2021: move some chemistry initializations to ini_nsv +! P. Wautelet 24/03/2021: bugfix: allocate XLSRVM, XINPAP and XACPAP to zero size when not needed +!! 03/2021 (JL Redelsperger) Ocean model case +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_PARAMETERS ! Declarative modules +USE MODD_CST +USE MODD_CONF +USE MODD_CTURB +USE MODD_GRID +USE MODD_REF +USE MODD_DYN +USE MODD_NESTING +USE MODD_SPAWN +USE MODD_NSV +USE MODD_PASPOL +! +USE MODD_DIM_n +USE MODD_DYN_n +USE MODD_CONF_n +USE MODD_LBC_n +USE MODD_GRID_n +USE MODD_TIME_n +USE MODD_REF_n +USE MODD_FIELD_n +USE MODD_LSFIELD_n +USE MODD_DUMMY_GR_FIELD_n +USE MODD_PRECIP_n +USE MODD_ELEC_n +USE MODD_LUNIT_n +USE MODD_PARAM_n +USE MODD_TURB_n +USE MODD_METRICS_n +USE MODD_CH_MNHC_n +USE MODD_PASPOL_n +!$20140515 +USE MODD_VAR_ll, ONLY : NPROC +USE MODD_IO, ONLY: TFILEDATA,TFILE_DUMMY,TFILE_SURFEX +use modd_precision, only: MNHREAL_MPI +! +USE MODE_GRIDCART ! Executive modules +USE MODE_GRIDPROJ +USE MODE_ll +USE MODE_MSG +! +USE MODI_READ_HGRID +USE MODI_SPAWN_GRID2 +USE MODI_SPAWN_FIELD2 +USE MODI_SPAWN_SURF +USE MODI_VER_INTERP_FIELD +USE MODI_SPAWN_PRESSURE2 +USE MODI_SPAWN_SURF2_RAIN +USE MODI_SET_REF +USE MODI_TOTAL_DMASS +USE MODI_ANEL_BALANCE_n +USE MODI_WRITE_DESFM_n +USE MODI_WRITE_LFIFM_n +USE MODI_METRICS +USE MODI_INI_BIKHARDT_n +USE MODI_DEALLOCATE_MODEL1 +USE MODI_BOUNDARIES +USE MODI_INI_NSV +!$20140710 +USE MODI_UPDATE_METRICS +! +USE MODE_IO_FIELD_READ, only: IO_Field_read +USE MODE_IO_FIELD_WRITE, only: IO_Header_write +USE MODE_IO_FILE, only: IO_File_close, IO_File_open +USE MODE_IO_MANAGE_STRUCT, only: IO_File_add2list +USE MODE_MODELN_HANDLER +USE MODE_MPPDB +! +USE MODE_THERMO +! +USE MODI_SECOND_MNH +! +! Modules for EDDY_FLUX +USE MODD_LATZ_EDFLX +USE MODD_DEF_EDDY_FLUX_n +USE MODD_DEF_EDDYUV_FLUX_n +USE MODD_ADVFRC_n +USE MODD_RELFRC_n +USE MODD_2D_FRC +! +!USE MODE_LB_ll, ONLY : SET_LB_FIELD_ll +USE MODI_GET_SIZEX_LB +USE MODI_GET_SIZEY_LB +! +USE MODD_LIMA_PRECIP_SCAVENGING_n +USE MODD_PARAM_LIMA, ONLY : MDEPOC=>LDEPOC, LSCAV +USE MODD_PARAM_ICE_n, ONLY : LDEPOSC +USE MODD_PARAM_C2R2, ONLY : LDEPOC +USE MODD_PASPOL, ONLY : LPASPOL +! +USE MODD_MPIF +USE MODD_VAR_ll +use modd_precision, only: LFIINT +! +IMPLICIT NONE +! +!* 0.1.1 Declarations of global variables not declared in the modules : +! +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZJ ! Jacobian +! +! +!* 0.1.2 Declarations of dummy arguments : +! +INTEGER, INTENT(IN) :: KRR ! Number of moist variables +INTEGER, INTENT(IN) :: KSV_USER ! Number of Users Scalar Variables +CHARACTER (LEN=4), INTENT(IN) :: HTURB ! Kind of turbulence parameterization +CHARACTER (LEN=4), INTENT(IN) :: HSURF ! Kind of surface parameterization +CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! Kind of cloud parameterization +CHARACTER (LEN=*), INTENT(IN) :: HSPAFILE ! possible name of the output FM-file +CHARACTER (LEN=*), INTENT(IN) :: HSPANBR ! NumBeR associated to the SPAwned file +CHARACTER (LEN=*), INTENT(IN) :: HSONFILE ! name of the input FM-file SON +CHARACTER (LEN=80), INTENT(IN) :: HCHEM_INPUT_FILE +CHARACTER (LEN=*), INTENT(IN) :: HINIFILE ! Input file +CHARACTER (LEN=*), INTENT(IN) :: HINIFILEPGD ! Input pgd file +LOGICAL, INTENT(IN) :: OSPAWN_SURF ! flag to spawn surface fields +! +!* 0.1.3 Declarations of local variables : +! +! +INTEGER :: ILUOUT ! Logical unit number for the output listing +INTEGER(KIND=LFIINT) :: INPRAR ! Number of articles predicted in the LFIFM file +! +! +INTEGER :: IIU ! Upper dimension in x direction +INTEGER :: IJU ! Upper dimension in y direction +INTEGER :: IKU ! Upper dimension in z direction +INTEGER :: IIB ! indice I Beginning in x direction +INTEGER :: IJB ! indice J Beginning in y direction +INTEGER :: IKB ! indice K Beginning in z direction +INTEGER :: IIE ! indice I End in x direction +INTEGER :: IJE ! indice J End in y direction +INTEGER :: IKE ! indice K End in z direction +INTEGER :: JK ! Loop index in z direction +INTEGER :: JLOOP,JKLOOP ! Loop indexes +INTEGER :: JSV ! loop index for scalar variables +INTEGER :: JRR ! loop index for moist variables +! +REAL, DIMENSION(:,:), ALLOCATABLE :: ZZS_LS ! large scale interpolated zs +REAL, DIMENSION(:,:), ALLOCATABLE :: ZZSMT_LS ! large scale interpolated smooth zs +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZZZ_LS ! large scale interpolated z +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZTHVT ! virtual potential temperature +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZHUT ! relative humidity +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZSUMRT ! sum of water ratios +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZRHOD ! dry density +! +REAL :: ZTIME1,ZTIME2,ZSTART,ZEND,ZTOT,ZALL,ZPERCALL ! for computing time analysis +REAL :: ZGRID2, ZSURF2, ZFIELD2, ZVER, & + ZPRESSURE2, ZANEL, ZWRITE, ZMISC +REAL :: ZPERCGRID2,ZPERCSURF2,ZPERCFIELD2, ZPERCVER, & + ZPERCPRESSURE2, ZPERCANEL, ZPERCWRITE,ZPERCMISC +! +INTEGER, DIMENSION(2) :: IIJ +INTEGER :: IK4000 +INTEGER :: IMI ! Old Model index +! +! Spawning variables for the SON 1 (input one) +INTEGER :: IIMAXSON,IJMAXSON ! physical dimensions +INTEGER :: IIUSON,IJUSON ! upper dimensions +INTEGER :: IXSIZESON,IYSIZESON ! sizes according to model1 grid +INTEGER :: IDXRATIOSON,IDYRATIOSON ! x and y-resolution ratios +INTEGER :: IXORSON,IYORSON ! horizontal position +INTEGER :: IXENDSON,IYENDSON !in x and y directions +! Common indexes for the SON 2 (output one, model2) +INTEGER :: IIB2 ! indice I Beginning in x direction +INTEGER :: IJB2 ! indice J Beginning in y direction +INTEGER :: IIE2 ! indice I End in x direction +INTEGER :: IJE2 ! indice J End in y direction +! Common indexes for the SON 1 (input one) +INTEGER :: IIB1 ! indice I Beginning in x direction +INTEGER :: IJB1 ! indice J Beginning in y direction +INTEGER :: IIE1 ! indice I End in x direction +INTEGER :: IJE1 ! indice J End in y direction +! Logical for no common domain between the 2 sons or no input son +LOGICAL :: GNOSON = .TRUE. +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZWORK3D ! working array +CHARACTER(LEN=28) :: YDAD_SON +!$ +INTEGER :: IINFO_ll +TYPE(LIST_ll), POINTER :: TZFIELDS_ll=>NULL() ! list of fields to exchange +INTEGER :: NXOR_TMP, NYOR_TMP, NXEND_TMP, NYEND_TMP +INTEGER :: IISIZEXF,IJSIZEXF,IISIZEXFU,IJSIZEXFU ! dimensions of the +INTEGER :: IISIZEX4,IJSIZEX4,IISIZEX2,IJSIZEX2 ! West-east LB arrays +INTEGER :: IISIZEYF,IJSIZEYF,IISIZEYFV,IJSIZEYFV ! dimensions of the +INTEGER :: IISIZEY4,IJSIZEY4,IISIZEY2,IJSIZEY2 ! North-south LB arrays +! +CHARACTER(LEN=4) :: YLBTYPE +! +INTEGER,DIMENSION(:,:),ALLOCATABLE :: IJCOUNT +! +REAL :: ZZS_MAX, ZZS_MAX_ll +! +TYPE(TFILEDATA),POINTER :: TZFILE => NULL() +TYPE(TFILEDATA),POINTER :: TZSONFILE => NULL() +!------------------------------------------------------------------------------- +! +! Save model index and switch to model 2 variables +IMI = GET_CURRENT_MODEL_INDEX() +CALL GOTO_MODEL(2) +CSTORAGE_TYPE='TT' +! +ILUOUT=TLUOUT%NLU +! +!* 1. INITIALIZATIONS : +! --------------- +! +!* 1.1 time analysis : +! ------------- +! +ZTIME1 = 0 +ZTIME2 = 0 +ZSTART = 0 +ZEND = 0 +ZGRID2 = 0 +ZSURF2 = 0 +ZFIELD2= 0 +ZANEL = 0 +ZWRITE = 0 +ZPERCGRID2 = 0 +ZPERCSURF2 = 0 +ZPERCFIELD2= 0 +ZPERCANEL = 0 +ZPERCWRITE = 0 +! +CALL SECOND_MNH(ZSTART) +! +ZTIME1 = ZSTART +! +!* 1.2 deallocates not used model 1 variables : +! -------------------------------------- +! +CALL DEALLOCATE_MODEL1(1) +CALL DEALLOCATE_MODEL1(2) +! +!------------------------------------------------------------------------------- +! +! +!* 3. PROLOGUE: +! -------- +! +!* 3.1 Compute dimensions of model 2 and other indices +! +NIMAX_ll = NXSIZE * NDXRATIO +NJMAX_ll = NYSIZE * NDYRATIO +! +IF (NIMAX_ll==1 .AND. NJMAX_ll==1) THEN + L1D=.TRUE. + L2D=.FALSE. +ELSE IF (NJMAX_ll==1) THEN + L1D=.FALSE. + L2D=.TRUE. +ELSE + L1D=.FALSE. + L2D=.FALSE. +END IF +! +CALL GET_DIM_EXT_ll('B',IIU,IJU) +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +! +NIMAX = IIE-IIB+1 +NJMAX = IJE-IJB+1 +!$ +IKU = SIZE(XTHVREFZ,1) +NKMAX = IKU - 2*JPVEXT ! initialization of NKMAX (MODD_DIM2) +! +IKB = 1 + JPVEXT +IKE = IKU - JPVEXT +! +! +!* 3.2 Position of model 2 domain relative to model 1 and controls +! +!$20140506 the condition on NXSIZE*NXRATIO ==IIE-IIB+1 only works for monoproc +!$then cancel it +!IF ( (NXSIZE*NDXRATIO) /= (IIE-IIB+1) ) THEN +! WRITE(ILUOUT,*) 'SPAWN_MODEL2: MODEL 2 DOMAIN X-SIZE INCOHERENT WITH THE', & +! ' MODEL1 MESH ',' IIB = ',IIB,' IIE = ', IIE ,'NDXRATIO = ',NDXRATIO +! !callabortstop +! CALL PRINT_MSG(NVERB_FATAL,'GEN','SPAWN_MODEL2','') +!END IF +!$ +!$20140506 the condition on NXSIZE*NXRATIO ==IIE-IIB+1 only works for monoproc +!$then cancel it +!IF ( (NYSIZE*NDYRATIO) /= (IJE-IJB+1) ) THEN +! WRITE(ILUOUT,*) 'SPAWN_MODEL2: MODEL 2 DOMAIN Y-SIZE INCOHERENT WITH THE', & +! ' MODEL1 MESH ',' IJB = ',IJB,' IJE = ', IJE ,'NDYRATIO = ',NDYRATIO +! !callabortstop +! CALL PRINT_MSG(NVERB_FATAL,'GEN','SPAWN_MODEL2','') +!END IF +!$ +! +!* 3.3 Treatement of a SON 1 model (input) +! +IF (LEN_TRIM(HSONFILE) /= 0 ) THEN +! +! 3.3.1 Opening the son input file and reading the grid +! + WRITE(ILUOUT,*) 'SPAWN_MODEL2: spawning with a SON input file :',TRIM(HSONFILE) + CALL IO_File_add2list(TZSONFILE,TRIM(HSONFILE),'MNH','READ',KLFITYPE=2,KLFIVERB=NVERB) + CALL IO_File_open(TZSONFILE) + CALL IO_Field_read(TZSONFILE,'DAD_NAME',YDAD_SON) + CALL IO_Field_read(TZSONFILE,'IMAX', IIMAXSON) + CALL IO_Field_read(TZSONFILE,'JMAX', IJMAXSON) + CALL IO_Field_read(TZSONFILE,'XOR', IXORSON) + CALL IO_Field_read(TZSONFILE,'YOR', IYORSON) + CALL IO_Field_read(TZSONFILE,'DXRATIO', IDXRATIOSON) + CALL IO_Field_read(TZSONFILE,'DYRATIO', IDYRATIOSON) + ! + IF (ADJUSTL(ADJUSTR(YDAD_SON)).NE.ADJUSTL(ADJUSTR(CMY_NAME(1)))) THEN + WRITE(ILUOUT,*) 'SPAWN_MODEL2: DAD of SON file is different from the one of model2' + WRITE(ILUOUT,*) ' DAD of SON = ',TRIM(YDAD_SON),' DAD of model2 = ',TRIM(CMY_NAME(1)) + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','SPAWN_MODEL2','DAD of SON file is different from the one of model2') + END IF + IF ( IDXRATIOSON /= NDXRATIO ) THEN + WRITE(ILUOUT,*) 'SPAWN_MODEL2: RATIOX of input SON file is different from the one of model2' ,& + ' RATIOX SON = ',IDXRATIOSON,' RATIOX model2 = ',NDXRATIO + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','SPAWN_MODEL2','RATIOX of input SON file is different from the one of model2') + END IF + IF ( IDYRATIOSON /= NDYRATIO ) THEN + WRITE(ILUOUT,*) 'SPAWN_MODEL2: RATIOY of input SON file is different from the one of model2' ,& + ' RATIOY SON = ',IDYRATIOSON,' RATIOY model2 = ',NDYRATIO + !callabortstop + CALL PRINT_MSG(NVERB_FATAL,'GEN','SPAWN_MODEL2','RATIOY of input SON file is different from the one of model2') + END IF + ! + IIUSON=IIMAXSON+2*JPHEXT + IJUSON=IJMAXSON+2*JPHEXT +! +! 3.3.2 Correspondance of indexes between the input SON and model2 +! + IXSIZESON = IIMAXSON/IDXRATIOSON + IYSIZESON = IJMAXSON/IDYRATIOSON + IXENDSON = IXORSON+IXSIZESON + IYENDSON = IYORSON+IYSIZESON +! Is a common domain between the input SON and the output son (model2)? + IF( ( MIN(NXEND-1,IXENDSON)-MAX(NXOR,IXORSON) > 0 ) .OR. & + ( MIN(NYEND-1,IYENDSON)-MAX(NYOR,IYORSON) > 0 ) ) THEN + GNOSON=.FALSE. + ! Common domain for the model2 (output son) indexes + IIB2 = (MAX(NXOR,IXORSON)-NXOR)*NDXRATIO+1+JPHEXT + IJB2 = (MAX(NYOR,IYORSON)-NYOR)*NDYRATIO+1+JPHEXT + IIE2 = (MIN(NXEND-1,IXENDSON)-NXOR)*NDXRATIO+JPHEXT + IJE2 = (MIN(NYEND-1,IYENDSON)-NYOR)*NDYRATIO+JPHEXT + ! Common domain for the SON 1 (input one) indexes + IIB1 = (MAX(NXOR,IXORSON)-IXORSON)*NDXRATIO+1+JPHEXT + IJB1 = (MAX(NYOR,IYORSON)-IYORSON)*NDYRATIO+1+JPHEXT + IIE1 = (MIN(NXEND-1,IXENDSON)-IXORSON)*NDXRATIO+JPHEXT + IJE1 = (MIN(NYEND-1,IYENDSON)-IYORSON)*NDYRATIO+JPHEXT + ! + WRITE(ILUOUT,*) ' common domain in the SON grid (IB,IE=', & + 1+JPHEXT,'-',IIMAXSON+JPHEXT,' ; JB,JE=', & + 1+JPHEXT,'-',IJMAXSON+JPHEXT,'):' + WRITE(ILUOUT,*) 'I=',IIB1,'->',IIE1,' ; J=',IJB1,'->',IJE1 + WRITE(ILUOUT,*) ' common domain in the model2 grid (IB,IE=', & + 1+JPHEXT,'-',NXSIZE*NDXRATIO+JPHEXT,' ; JB,JE=', & + 1+JPHEXT,'-',NYSIZE*NDYRATIO+JPHEXT,'):' + WRITE(ILUOUT,*) 'I=',IIB2,'->',IIE2,' ; J=',IJB2,'->',IJE2 + ELSE + WRITE(ILUOUT,*) 'SPAWN_MODEL2: no common domain between input SON and model2:' + WRITE(ILUOUT,*) ' the input SON fields are not taken into account, spawned fields are computed from model1' + END IF +END IF +! +!* 3.4 Initialization of model 2 configuration +! +NRR = KRR ! for MODD_CONF2 +NSV_USER = KSV_USER +IF (NSV_CHEM>0) THEN + LUSECHEM=.TRUE. + IF (NSV_CHAC>0) THEN + LUSECHAQ=.TRUE. + ENDIF + IF (NSV_CHIC>0) THEN + LUSECHIC=.TRUE. + ENDIF + CCHEM_INPUT_FILE = HCHEM_INPUT_FILE +END IF +! +CTURB = HTURB ! for MODD_PARAM2 +CRAD = 'NONE' ! radiation will have to be restarted +CSURF = HSURF ! for surface call +CCLOUD = HCLOUD +CDCONV = 'NONE' ! deep convection will have to be restarted +CSCONV = 'NONE' ! shallow convection will have to be restarted +! +! cas LIMA +! +!IF (HCLOUD=='LIMA') THEN +! CCLOUD='LIMA' +! NMOD_CCN=3 +! LSCAV=.FALSE. +! LAERO_MASS=.FALSE. +! NMOD_IFN=2 +! NMOD_IMM=1 +! LHHONI=.FALSE. +!ENDIF +! +CALL INI_NSV(2) ! NSV* are set equal for model 2 and model 1. + ! NSV is set to the total number of SV for model 2 +! +IF (NRR==0) THEN + LUSERV=.FALSE. ! as the default is .T. +ELSE + IDX_RVT = 1 +END IF +IF (NRR>1) THEN + LUSERC=.TRUE. + IDX_RCT = 2 +END IF +IF (NRR>2) THEN + LUSERR=.TRUE. + IDX_RRT = 2 +END IF +IF (NRR>3) THEN + LUSERI=.TRUE. + IDX_RIT = 2 +END IF +IF (NRR>4) THEN + LUSERS=.TRUE. + IDX_RST = 2 +END IF +IF (NRR>5) THEN + LUSERG=.TRUE. + IDX_RGT = 2 +END IF +IF (NRR>6) THEN + LUSERH=.TRUE. + IDX_RHT = 2 +END IF +! +! +! +!* 3.5 model 2 configuration in MODD_NESTING to be written +!* on the FM-file to allow nesting or coupling +! +CCPLFILE(:) = ' ' +LSTEADYLS=.TRUE. +! +NDXRATIO_ALL(:) = 0 +NDYRATIO_ALL(:) = 0 +NDXRATIO_ALL(2) = NDXRATIO +NDYRATIO_ALL(2) = NDYRATIO +NXOR_ALL(2) = NXOR +NYOR_ALL(2) = NYOR +NXEND_ALL(2) = NXEND +NYEND_ALL(2) = NYEND +! +!* 3.6 size of the RIM area for lbc +! +NRIMX=MIN(JPRIMMAX,IIU/2-1) +IF ( .NOT. L2D ) THEN + NRIMY=MIN(JPRIMMAX,IJU/2-1) +ELSE + NRIMY=0 +END IF +IF (NRIMX >= IIU/2-1) THEN ! Error ! this case is not supported - it should be, but there is a bug + call Print_msg( NVERB_FATAL, 'GEN', 'SPAWN_MODEL2', 'The size of the LBX zone is too big for the size of the subdomains. '// & + 'Try with less processes, a smaller LBX size or a bigger grid in X.' ) +ENDIF +IF ( ( .NOT. L2D ) .AND. (NRIMY >= IJU/2-1) ) THEN ! Error ! this case is not supported - it should be, but there is a bug + call Print_msg( NVERB_FATAL, 'GEN', 'SPAWN_MODEL2', 'The size of the LBY zone is too big for the size of the subdomains. '// & + 'Try with less processes, a smaller LBY size or a bigger grid in Y.' ) +ENDIF +! +LHORELAX_UVWTH=.TRUE. +LHORELAX_RV=LUSERV +LHORELAX_RC=LUSERC +LHORELAX_RR=LUSERR +LHORELAX_RI=LUSERI +LHORELAX_RS=LUSERS +LHORELAX_RG=LUSERG +LHORELAX_RH=LUSERH +! +IF (CTURB/='NONE') LHORELAX_TKE =.TRUE. +LHORELAX_SV(:)=.FALSE. +DO JSV=1,NSV + LHORELAX_SV(JSV)=.TRUE. +END DO +IF (NSV_CHEM > 0) LHORELAX_SVCHEM = .TRUE. +IF (NSV_CHIC > 0) LHORELAX_SVCHIC = .TRUE. +IF (NSV_C2R2 > 0) LHORELAX_SVC2R2 = .TRUE. +IF (NSV_C1R3 > 0) LHORELAX_SVC1R3 = .TRUE. +IF (NSV_ELEC > 0) LHORELAX_SVELEC = .TRUE. +IF (NSV_AER > 0) LHORELAX_SVAER = .TRUE. +IF (NSV_DST > 0) LHORELAX_SVDST = .TRUE. +IF (NSV_SLT > 0) LHORELAX_SVSLT = .TRUE. +IF (NSV_PP > 0) LHORELAX_SVPP = .TRUE. +#ifdef MNH_FOREFIRE +IF (NSV_FF > 0) LHORELAX_SVFF = .TRUE. +#endif +IF (NSV_CS > 0) LHORELAX_SVCS = .TRUE. +LHORELAX_SVLG = .FALSE. +IF (NSV_LIMA > 0) LHORELAX_SVLIMA = .TRUE. +! +!------------------------------------------------------------------------------- +! +!* 4. ALLOCATE MEMORY FOR ARRAYS : +! ----------------------------- +! +!* 4.1 Global variables absent from the modules : +! +ALLOCATE(ZJ(IIU,IJU,IKU)) +! +!* 4.2 Prognostic (and diagnostic) variables (module MODD_FIELD2) : +! +ALLOCATE(XZWS(IIU,IJU)); XZWS(:,:) = XZWS_DEFAULT +ALLOCATE(XLSZWSM(IIU,IJU)) +ALLOCATE(XUT(IIU,IJU,IKU)) +ALLOCATE(XVT(IIU,IJU,IKU)) +ALLOCATE(XWT(IIU,IJU,IKU)) +ALLOCATE(XTHT(IIU,IJU,IKU)) +IF (CTURB/='NONE') THEN + ALLOCATE(XTKET(IIU,IJU,IKU)) +ELSE + ALLOCATE(XTKET(0,0,0)) +END IF +ALLOCATE(XPABST(IIU,IJU,IKU)) +ALLOCATE(XRT(IIU,IJU,IKU,NRR)) +ALLOCATE(XSVT(IIU,IJU,IKU,NSV)) +! +IF (CTURB /= 'NONE' .AND. NRR>1) THEN + ALLOCATE(XSRCT(IIU,IJU,IKU)) + ALLOCATE(XSIGS(IIU,IJU,IKU)) +ELSE + ALLOCATE(XSRCT(0,0,0)) + ALLOCATE(XSIGS(0,0,0)) +END IF +! +! +!* 4.4 Grid variables (module MODD_GRID2 and MODD_METRICS2): +! +ALLOCATE(XXHAT(IIU),XYHAT(IJU),XZHAT(IKU)) +ALLOCATE(XZTOP) +ALLOCATE(XMAP(IIU,IJU)) +ALLOCATE(XLAT(IIU,IJU)) +ALLOCATE(XLON(IIU,IJU)) +ALLOCATE(XDXHAT(IIU),XDYHAT(IJU)) +ALLOCATE(XZS(IIU,IJU)) +ALLOCATE(XZSMT(IIU,IJU)) +ALLOCATE(XZZ(IIU,IJU,IKU)) +! +ALLOCATE(XDXX(IIU,IJU,IKU)) +ALLOCATE(XDYY(IIU,IJU,IKU)) +ALLOCATE(XDZX(IIU,IJU,IKU)) +ALLOCATE(XDZY(IIU,IJU,IKU)) +ALLOCATE(XDZZ(IIU,IJU,IKU)) +! +ALLOCATE(ZZS_LS(IIU,IJU)) +ALLOCATE(ZZSMT_LS(IIU,IJU)) +ALLOCATE(ZZZ_LS(IIU,IJU,IKU)) +! +!* 4.5 Reference state variables (module MODD_REF2): +! +ALLOCATE(XRHODREF(IIU,IJU,IKU),XTHVREF(IIU,IJU,IKU),XRVREF(IIU,IJU,IKU)) +ALLOCATE(XRHODJ(IIU,IJU,IKU),XEXNREF(IIU,IJU,IKU)) +! +!* 4.6 Larger Scale fields (module MODD_LSFIELD2): +! + ! LS fields for vertical relaxation and diffusion +ALLOCATE(XLSUM(IIU,IJU,IKU)) +ALLOCATE(XLSVM(IIU,IJU,IKU)) +ALLOCATE(XLSWM(IIU,IJU,IKU)) +ALLOCATE(XLSTHM(IIU,IJU,IKU)) +IF ( NRR >= 1) THEN + ALLOCATE(XLSRVM(IIU,IJU,IKU)) +ELSE + ALLOCATE(XLSRVM(0,0,0)) +ENDIF + ! LB fields for lbc coupling +! +!get the size of the local portion of the LB zone in X and Y direction +CALL GET_SIZEX_LB(NIMAX_ll,NJMAX_ll,NRIMX, & + IISIZEXF,IJSIZEXF,IISIZEXFU,IJSIZEXFU, & + IISIZEX4,IJSIZEX4,IISIZEX2,IJSIZEX2) +CALL GET_SIZEY_LB(NIMAX_ll,NJMAX_ll,NRIMY, & + IISIZEYF,IJSIZEYF,IISIZEYFV,IJSIZEYFV, & + IISIZEY4,IJSIZEY4,IISIZEY2,IJSIZEY2) +!on fait des choses inutiles avec GET_SIZEX_LB, on pourrait utiliser seulement GET_LOCAL_LB_SIZE_X_ll +!ILOCLBSIZEX = GET_LOCAL_LB_SIZE_X_ll( NRIMX ) +!ILOCLBSIZEY = GET_LOCAL_LB_SIZE_Y_ll( NRIMY ) +! + ALLOCATE(XLBXUM(IISIZEXFU,IJU,IKU)) +!! ALLOCATE(XLBXUM(2*NRIMX+2*JPHEXT,IJU,IKU)) +! +IF ( .NOT. L2D ) THEN + ALLOCATE(XLBYUM(IIU,IJSIZEYF,IKU)) +!! ALLOCATE(XLBYUM(IIU,2*NRIMY+2*JPHEXT,IKU)) +ELSE + ALLOCATE(XLBYUM(0,0,0)) +END IF +! +ALLOCATE(XLBXVM(IISIZEXF,IJU,IKU)) +!! ALLOCATE(XLBXVM(2*NRIMX+2*JPHEXT,IJU,IKU)) +! +IF ( .NOT. L2D ) THEN + IF ( NRIMY == 0 ) THEN + ALLOCATE(XLBYVM(IIU,IJSIZEY4,IKU)) + ELSE + ALLOCATE(XLBYVM(IIU,IJSIZEYFV,IKU)) +!! ALLOCATE(XLBYVM(IIU,2*NRIMY+2*JPHEXT,IKU)) + END IF +ELSE + ALLOCATE(XLBYVM(0,0,0)) +END IF +! +ALLOCATE(XLBXWM(IISIZEXF,IJU,IKU)) +!! ALLOCATE(XLBXWM(2*NRIMX+2*JPHEXT,IJU,IKU)) +! +IF ( .NOT. L2D ) THEN + ALLOCATE(XLBYWM(IIU,IJSIZEYF,IKU)) +!! ALLOCATE(XLBYWM(IIU,2*NRIMY+2*JPHEXT,IKU)) +ELSE + ALLOCATE(XLBYWM(0,0,0)) +END IF +! +ALLOCATE(XLBXTHM(IISIZEXF,IJU,IKU)) +!!ALLOCATE(XLBXTHM(2*NRIMX+2*JPHEXT,IJU,IKU)) +! +IF ( .NOT. L2D ) THEN + ALLOCATE(XLBYTHM(IIU,IJSIZEYF,IKU)) +!! ALLOCATE(XLBYTHM(IIU,2*NRIMY+2*JPHEXT,IKU)) +ELSE + ALLOCATE(XLBYTHM(0,0,0)) +END IF +! +IF (CTURB /= 'NONE') THEN + ALLOCATE(XLBXTKEM(IISIZEXF,IJU,IKU)) +!! ALLOCATE(XLBXTKEM(2*NRIMX+2*JPHEXT,IJU,IKU)) +ELSE + ALLOCATE(XLBXTKEM(0,0,0)) +END IF +! +IF (CTURB /= 'NONE' .AND. (.NOT. L2D)) THEN + ALLOCATE(XLBYTKEM(IIU,IJSIZEYF,IKU)) +!! ALLOCATE(XLBYTKEM(IIU,2*NRIMY+2*JPHEXT,IKU)) +ELSE + ALLOCATE(XLBYTKEM(0,0,0)) +END IF +! +ALLOCATE(XLBXRM(IISIZEXF,IJU,IKU,NRR)) +!!ALLOCATE(XLBXRM(2*NRIMX+2*JPHEXT,IJU,IKU,NRR)) +! +IF (.NOT. L2D ) THEN + ALLOCATE(XLBYRM(IIU,IJSIZEYF,IKU,NRR)) +!! ALLOCATE(XLBYRM(IIU,2*NRIMY+2*JPHEXT,IKU,NRR)) +ELSE + ALLOCATE(XLBYRM(0,0,0,0)) +END IF +! +ALLOCATE(XLBXSVM(IISIZEXF,IJU,IKU,NSV)) +!!ALLOCATE(XLBXSVM(2*NRIMX+2*JPHEXT,IJU,IKU,NSV)) +! +IF (.NOT. L2D ) THEN + ALLOCATE(XLBYSVM(IIU,IJSIZEYF,IKU,NSV)) +!! ALLOCATE(XLBYSVM(IIU,2*NRIMY+2*JPHEXT,IKU,NSV)) +ELSE + ALLOCATE(XLBYSVM(0,0,0,0)) +END IF +! +NSIZELBX_ll=2*NRIMX+2*JPHEXT +NSIZELBXU_ll=2*NRIMX+2*JPHEXT +NSIZELBY_ll=2*NRIMY+2*JPHEXT +NSIZELBYV_ll=2*NRIMY+2*JPHEXT +NSIZELBXR_ll=2*NRIMX+2*JPHEXT +NSIZELBXSV_ll=2*NRIMX+2*JPHEXT +NSIZELBXTKE_ll=2*NRIMX+2*JPHEXT +NSIZELBYTKE_ll=2*NRIMY+2*JPHEXT +NSIZELBYR_ll=2*NRIMY+2*JPHEXT +NSIZELBYSV_ll=2*NRIMY+2*JPHEXT +! +! +! 4.8 precipitation variables ! same allocations than in ini_micron +! +IF (CCLOUD /= 'NONE' .AND. CCLOUD /= 'REVE') THEN + ALLOCATE(XINPRR(IIU,IJU)) + ALLOCATE(XINPRR3D(IIU,IJU,IKU)) + ALLOCATE(XEVAP3D(IIU,IJU,IKU)) + ALLOCATE(XACPRR(IIU,IJU)) +ELSE + ALLOCATE(XINPRR(0,0)) + ALLOCATE(XINPRR3D(0,0,0)) + ALLOCATE(XEVAP3D(0,0,0)) + ALLOCATE(XACPRR(0,0)) +END IF +! +IF (CCLOUD(1:3) == 'ICE' .OR. CCLOUD == 'C2R2' & + .OR. CCLOUD == 'KHKO' .OR. CCLOUD == 'LIMA') THEN + ALLOCATE(XINPRC(IIU,IJU)) + ALLOCATE(XACPRC(IIU,IJU)) +ELSE + ALLOCATE(XINPRC(0,0)) + ALLOCATE(XACPRC(0,0)) +END IF +! +IF (( CCLOUD(1:3) == 'ICE' .AND.LDEPOSC) .OR. & + ((CCLOUD=='C2R2' .OR. CCLOUD=='KHKO').AND.LDEPOC) .OR. & + ( CCLOUD=='LIMA' .AND.MDEPOC)) THEN + ALLOCATE(XINDEP(IIU,IJU)) + ALLOCATE(XACDEP(IIU,IJU)) +ELSE + ALLOCATE(XINDEP(0,0)) + ALLOCATE(XACDEP(0,0)) +END IF +! +IF (CCLOUD(1:3) == 'ICE' .OR. CCLOUD == 'C3R5'.OR. CCLOUD == 'LIMA') THEN + ALLOCATE(XINPRS(IIU,IJU)) + ALLOCATE(XACPRS(IIU,IJU)) +ELSE + ALLOCATE(XINPRS(0,0)) + ALLOCATE(XACPRS(0,0)) +END IF +! +IF (CCLOUD == 'C3R5' .OR. CCLOUD == 'ICE3' .OR. CCLOUD == 'ICE4'.OR. CCLOUD == 'LIMA' ) THEN + ALLOCATE(XINPRG(IIU,IJU)) + ALLOCATE(XACPRG(IIU,IJU)) +ELSE + ALLOCATE(XINPRG(0,0)) + ALLOCATE(XACPRG(0,0)) +END IF +! +IF (CCLOUD == 'ICE4'.OR. CCLOUD == 'LIMA') THEN + ALLOCATE(XINPRH(IIU,IJU)) + ALLOCATE(XACPRH(IIU,IJU)) +ELSE + ALLOCATE(XINPRH(0,0)) + ALLOCATE(XACPRH(0,0)) +END IF +! +IF ( CCLOUD=='LIMA' .AND. LSCAV ) THEN + ALLOCATE(XINPAP(IIU,IJU)) + ALLOCATE(XACPAP(IIU,IJU)) + XINPAP(:,:)=0.0 + XACPAP(:,:)=0.0 +ELSE + ALLOCATE(XINPAP(0,0)) + ALLOCATE(XACPAP(0,0)) +END IF +! +! 4.8bis electric variables +! +IF (CELEC /= 'NONE' ) THEN + ALLOCATE(XNI_SDRYG(IIU,IJU,IKU)) + ALLOCATE(XNI_IDRYG(IIU,IJU,IKU)) + ALLOCATE(XNI_IAGGS(IIU,IJU,IKU)) + ALLOCATE(XEFIELDU(IIU,IJU,IKU)) + ALLOCATE(XEFIELDV(IIU,IJU,IKU)) + ALLOCATE(XEFIELDW(IIU,IJU,IKU)) + ALLOCATE(XESOURCEFW(IIU,IJU,IKU)) + ALLOCATE(XIND_RATE(IIU,IJU,IKU)) + ALLOCATE(XIONSOURCEFW(IIU,IJU,IKU)) + ALLOCATE(XEW(IIU,IJU,IKU)) + ALLOCATE(XCION_POS_FW(IIU,IJU,IKU)) + ALLOCATE(XCION_NEG_FW(IIU,IJU,IKU)) + ALLOCATE(XMOBIL_POS(IIU,IJU,IKU)) + ALLOCATE(XMOBIL_NEG(IIU,IJU,IKU)) +ELSE + ALLOCATE(XNI_SDRYG(0,0,0)) + ALLOCATE(XNI_IDRYG(0,0,0)) + ALLOCATE(XNI_IAGGS(0,0,0)) + ALLOCATE(XEFIELDU(0,0,0)) + ALLOCATE(XEFIELDV(0,0,0)) + ALLOCATE(XEFIELDW(0,0,0)) + ALLOCATE(XESOURCEFW(0,0,0)) + ALLOCATE(XIND_RATE(0,0,0)) + ALLOCATE(XIONSOURCEFW(0,0,0)) + ALLOCATE(XEW(0,0,0)) + ALLOCATE(XCION_POS_FW(0,0,0)) + ALLOCATE(XCION_NEG_FW(0,0,0)) + ALLOCATE(XMOBIL_POS(0,0,0)) + ALLOCATE(XMOBIL_NEG(0,0,0)) +END IF +! +! +! +! 4.9 Passive pollutant variable +! +IF (LPASPOL) THEN + ALLOCATE( XATC(IIU,IJU,IKU,NSV_PP) ) + ELSE + ALLOCATE( XATC(0,0,0,0)) +END IF +! +! 4.10 Advective forcing variable for 2D (Modif MT) +! +! +IF (L2D_ADV_FRC) THEN + WRITE(ILUOUT,*) 'SPAWN_MODEL2: L2D_ADV_FRC IS SET TO ',L2D_ADV_FRC,' SO ADVECTIVE FORCING WILL BE SPAWN: NADVFRC=',NADVFRC + ALLOCATE(TDTADVFRC(NADVFRC)) + ALLOCATE(XDTHFRC(IIU,IJU,IKU,NADVFRC)) + ALLOCATE(XDRVFRC(IIU,IJU,IKU,NADVFRC)) + WRITE(ILUOUT,*) 'SPAWN_MODEL2: ALLOCATION OF ADV FORCING VARIABLES MADE' +ELSE + ALLOCATE(TDTADVFRC(0)) + ALLOCATE(XDTHFRC(0,0,0,0)) + ALLOCATE(XDRVFRC(0,0,0,0)) +END IF +IF (L2D_REL_FRC) THEN + WRITE(ILUOUT,*) 'SPAWN_MODEL2: L2D_REL_FRC IS SET TO ',L2D_REL_FRC,' SO RELAXATION FORCING WILL BE SPAWN: NRELFRC=',NRELFRC + ALLOCATE(TDTRELFRC(NRELFRC)) + ALLOCATE(XTHREL(IIU,IJU,IKU,NRELFRC)) + ALLOCATE(XRVREL(IIU,IJU,IKU,NRELFRC)) + WRITE(ILUOUT,*) 'SPAWN_MODEL2: ALLOCATION OF REL FORCING VARIABLES MADE' +ELSE + ALLOCATE(TDTRELFRC(0)) + ALLOCATE(XTHREL(0,0,0,0)) + ALLOCATE(XRVREL(0,0,0,0)) +END IF +! +! 4.11 Turbulent fluxes for 2D (Modif MT) +! +! +IF (LUV_FLX) THEN + WRITE(ILUOUT,*) 'SPAWN_MODEL2: XUV_FLX1 IS SET TO ',XUV_FLX1,' SO XVU_FLUX WILL BE SPAWN' + ALLOCATE(XVU_FLUX_M(IIU,IJU,IKU)) + WRITE(ILUOUT,*) 'SPAWN_MODEL2: ALLOCATION OF XVU_FLUX_M MADE' +ELSE + ALLOCATE(XVU_FLUX_M(0,0,0)) +END IF +! +IF (LTH_FLX) THEN + WRITE(ILUOUT,*) 'SPAWN_MODEL2: XTH_FLX IS SET TO ',XTH_FLX,' SO XVTH_FLUX and XWTH_FLUX WILL BE SPAWN' + ALLOCATE(XVTH_FLUX_M(IIU,IJU,IKU)) + ALLOCATE(XWTH_FLUX_M(IIU,IJU,IKU)) + WRITE(ILUOUT,*) 'SPAWN_MODEL2: ALLOCATION OF XVTH_FLUX_M and XWTH_FLUX_M MADE' +ELSE + ALLOCATE(XVTH_FLUX_M(0,0,0)) + ALLOCATE(XWTH_FLUX_M(0,0,0)) +END IF +! +!------------------------------------------------------------------------------- +! +!* 5. INITIALIZE ALL THE MODEL VARIABLES +! ---------------------------------- +! +!* 5.1 Bikhardt interpolation coefficients computation : +! +CALL INI_BIKHARDT_n(NDXRATIO,NDYRATIO,2) +! +CALL SECOND_MNH(ZTIME2) +! +ZMISC = ZTIME2 - ZTIME1 +! +!* 5.2 Spatial and Temporal grid (for MODD_GRID2 and MODD_TIME2) : +! +CALL SECOND_MNH(ZTIME1) +! +IF(NPROC.GT.1)THEN + CALL GO_TOMODEL_ll(2, IINFO_ll) + CALL GET_FEEDBACK_COORD_ll(NXOR_TMP,NYOR_TMP,NXEND_TMP,NYEND_TMP,IINFO_ll) !phys domain +ELSE + NXOR_TMP = NXOR + NYOR_TMP = NYOR + NXEND_TMP= NXEND + NYEND_TMP = NYEND +ENDIF +XZS=0. +CALL SPAWN_GRID2 (NXOR,NYOR,NXEND,NYEND,NDXRATIO,NDYRATIO, & + XLONORI,XLATORI,XXHAT,XYHAT,XZHAT,XZTOP,LSLEVE,XLEN1,XLEN2, & + XZS,XZSMT,ZZS_LS,ZZSMT_LS,TDTMOD,TDTCUR ) +! +CALL MPPDB_CHECK2D(ZZS_LS,"SPAWN_MOD2:ZZS_LS",PRECISION) +CALL MPPDB_CHECK2D(ZZSMT_LS,"SPAWN_MOD2:ZZSMT_LS",PRECISION) +CALL MPPDB_CHECK2D(XZS,"SPAWN_MOD2:XZS",PRECISION) +CALL MPPDB_CHECK2D(XZSMT,"SPAWN_MOD2:XZSMT",PRECISION) +! +CALL SECOND_MNH(ZTIME2) +! +ZGRID2 = ZTIME2 - ZTIME1 +! +!* 5.3 Calculation of the grid +! +ZTIME1 = ZTIME2 +! +IF (LCARTESIAN) THEN + CALL SM_GRIDCART(XXHAT,XYHAT,XZHAT,ZZS_LS,LSLEVE,XLEN1,XLEN2,ZZSMT_LS,XDXHAT,XDYHAT,ZZZ_LS,ZJ) + CALL SM_GRIDCART(XXHAT,XYHAT,XZHAT,XZS ,LSLEVE,XLEN1,XLEN2,XZSMT ,XDXHAT,XDYHAT,XZZ ,ZJ) +ELSE + CALL SM_GRIDPROJ(XXHAT,XYHAT,XZHAT,ZZS_LS,LSLEVE,XLEN1,XLEN2,ZZSMT_LS,& + XLATORI,XLONORI,XMAP,XLAT,XLON,XDXHAT,XDYHAT,ZZZ_LS,ZJ) + CALL SM_GRIDPROJ(XXHAT,XYHAT,XZHAT,XZS ,LSLEVE,XLEN1,XLEN2,XZSMT ,& + XLATORI,XLONORI,XMAP,XLAT,XLON,XDXHAT,XDYHAT,XZZ ,ZJ) +END IF +! +!* 5.4 Compute the metric coefficients +! +CALL ADD3DFIELD_ll( TZFIELDS_ll, XZZ, 'SPAWN_MODEL2::XZZ' ) +CALL UPDATE_HALO_ll(TZFIELDS_ll,IINFO_ll) +CALL CLEANLIST_ll(TZFIELDS_ll) +! +CALL METRICS(XMAP,XDXHAT,XDYHAT,XZZ,XDXX,XDYY,XDZX,XDZY,XDZZ) +! +CALL MPPDB_CHECK3D(XDXX,"spawnmod2-beforeupdate_metrics:XDXX",PRECISION) +CALL MPPDB_CHECK3D(XDYY,"spawnmod2-beforeupdate_metrics:XDYY",PRECISION) +CALL MPPDB_CHECK3D(XDZX,"spawnmod2-beforeupdate_metrics:XDZX",PRECISION) +CALL MPPDB_CHECK3D(XDZY,"spawnmod2-beforeupdate_metrics:XDZY",PRECISION) +! +CALL UPDATE_METRICS(CLBCX,CLBCY,XDXX,XDYY,XDZX,XDZY,XDZZ) +! +CALL MPPDB_CHECK3D(XDXX,"spawnmod2-aftrupdate_metrics:XDXX",PRECISION) +CALL MPPDB_CHECK3D(XDYY,"spawnmod2-aftrupdate_metrics:XDYY",PRECISION) +CALL MPPDB_CHECK3D(XDZX,"spawnmod2-aftrupdate_metrics:XDZX",PRECISION) +CALL MPPDB_CHECK3D(XDZY,"spawnmod2-aftrupdate_metrics:XDZY",PRECISION) +!$ +! +!* 5.5 3D Reference state variables : +! +CALL SET_REF(0,TFILE_DUMMY, & + XZZ,XZHAT,ZJ,XDXX,XDYY,CLBCX,CLBCY, & + XREFMASS,XMASS_O_PHI0,XLINMASS, & + XRHODREF,XTHVREF,XRVREF,XEXNREF,XRHODJ) +! +CALL SECOND_MNH(ZTIME2) +! +ZMISC = ZMISC + ZTIME2 - ZTIME1 +! +!* 5.6 Prognostic variables and Larger scale fields : +! +ZTIME1 = ZTIME2 +! +!* horizontal interpolation +! +ALLOCATE(ZTHVT(IIU,IJU,IKU)) +ALLOCATE(ZHUT(IIU,IJU,IKU)) +! +MPPDB_CHECK_LB = .TRUE. +IF (GNOSON) THEN + CALL SPAWN_FIELD2 (NXOR,NYOR,NXEND,NYEND,NDXRATIO,NDYRATIO,CTURB, & + XUT,XVT,XWT,ZTHVT,XRT,ZHUT,XTKET,XSVT,XZWS,XATC, & + XSRCT,XSIGS, & + XLSUM,XLSVM,XLSWM,XLSTHM,XLSRVM,XLSZWSM, & + XDTHFRC,XDRVFRC,XTHREL,XRVREL, & + XVU_FLUX_M,XVTH_FLUX_M,XWTH_FLUX_M ) + CALL MPPDB_CHECK3D(XUT,"SPAWN_M2 after SPAWN_FIELD2:XUT",PRECISION) +ELSE + CALL MPPDB_CHECK3D(XUT,"SPAWN_M2 before SPAWN_FIELD2:XUT",PRECISION) + CALL SPAWN_FIELD2 (NXOR,NYOR,NXEND,NYEND,NDXRATIO,NDYRATIO,CTURB, & + XUT,XVT,XWT,ZTHVT,XRT,ZHUT,XTKET,XSVT,XZWS,XATC, & + XSRCT,XSIGS, & + XLSUM,XLSVM,XLSWM,XLSTHM,XLSRVM,XLSZWSM, & + XDTHFRC,XDRVFRC,XTHREL,XRVREL, & + XVU_FLUX_M, XVTH_FLUX_M,XWTH_FLUX_M, & + TZSONFILE,IIUSON,IJUSON, & + IIB2,IJB2,IIE2,IJE2, & + IIB1,IJB1,IIE1,IJE1 ) + CALL MPPDB_CHECK3D(XUT,"SPAWN_M2 after SPAWN_FIELD2:XUT",PRECISION) +END IF +! +CALL MPPDB_CHECK3D(XUT,"SPAWN_MOD2aftFIELD2:XUT",PRECISION) +CALL MPPDB_CHECK3D(XVT,"SPAWN_MOD2aftFIELD2:XVT",PRECISION) +!$ +!* correction of positivity +! +IF (SIZE(XLSRVM,1)>0) XLSRVM = MAX(0.,XLSRVM) +IF (SIZE(XRT,1)>0) XRT = MAX(0.,XRT) +IF (SIZE(ZHUT,1)>0) ZHUT = MIN(MAX(ZHUT,0.),100.) +IF (SIZE(XTKET,1)>0) XTKET = MAX(XTKEMIN,XTKET) +! +CALL SECOND_MNH(ZTIME2) +! +ZFIELD2 = ZTIME2 - ZTIME1 +! +ZTIME1 = ZTIME2 +! +!* vertical interpolation +! +ZZS_MAX = ABS( MAXVAL(XZS(:,:))) +CALL MPI_ALLREDUCE(ZZS_MAX, ZZS_MAX_ll, 1, MNHREAL_MPI, MPI_MAX, & + NMNH_COMM_WORLD,IINFO_ll) +IF ( (ZZS_MAX_ll>0.) .AND. (NDXRATIO/=1 .OR. NDYRATIO/=1) ) THEN + CALL MPPDB_CHECK3D(XUT,"SPAWN_M2 before VER_INTERP_FIELD:XUT",PRECISION) + CALL VER_INTERP_FIELD (CTURB,NRR,NSV,ZZZ_LS,XZZ, & + XUT,XVT,XWT,ZTHVT,XRT,ZHUT,XTKET,XSVT, & + XSRCT,XSIGS, & + XLSUM,XLSVM,XLSWM,XLSTHM,XLSRVM ) + ! + CALL MPPDB_CHECK3D(XUT,"SPAWN_M2aftVERINTER:XUT",PRECISION) + CALL MPPDB_CHECK3D(XVT,"SPAWN_M2aftVERINTER:XVT",PRECISION) + CALL MPPDB_CHECK3D(XWT,"SPAWN_M2aftVERINTER:XWT",PRECISION) + CALL MPPDB_CHECK3D(ZHUT,"SPAWN_M2aftVERINTER:ZHUT",PRECISION) + CALL MPPDB_CHECK3D(XTKET,"SPAWN_M2aftVERINTER:XTKET",PRECISION) + CALL MPPDB_CHECK3D(XSRCT,"SPAWN_M2aftVERINTER:XSRCT",PRECISION) +ENDIF +! +CALL SECOND_MNH(ZTIME2) +! +ZVER = ZTIME2 - ZTIME1 +! +!* 5.7 Absolute pressure : +! +ZTIME1 = ZTIME2 +! +CALL SPAWN_PRESSURE2(NXOR,NYOR,NXEND,NYEND,NDXRATIO,NDYRATIO, & + ZZZ_LS,XZZ,ZTHVT,XPABST ) +! +IF (.NOT.GNOSON) THEN + ALLOCATE(ZWORK3D(IIUSON,IJUSON,IKU)) + CALL IO_Field_read(TZSONFILE,'PABST',ZWORK3D) + XPABST(IIB2:IIE2,IJB2:IJE2,:) = ZWORK3D(IIB1:IIE1,IJB1:IJE1,:) + DEALLOCATE(ZWORK3D) +END IF +! +IF (NVERB>=2) THEN + IK4000 = COUNT(XZHAT(:)<4000.) + IIJ = MAXLOC( SUM(ZHUT(IIB:IIE,IJB:IJE,JPVEXT+1:IK4000),3), & + MASK=COUNT(ZHUT(IIB:IIE,IJB:IJE,JPVEXT+1:IKE) & + >=MAXVAL(ZHUT(IIB:IIE,IJB:IJE,JPVEXT+1:IKE))-0.01,DIM=3 ) & + >=1 ) & + + JPHEXT + WRITE(ILUOUT,*) ' ' + WRITE(ILUOUT,*) 'humidity (I=',IIJ(1),';J=',IIJ(2),')' + DO JK=IKB,IKE + WRITE(ILUOUT,'(F6.2," %")') ZHUT(IIJ(1),IIJ(2),JK) + END DO +END IF +!* 5.8 Retrieve model thermodynamical variables : +! +ALLOCATE(ZSUMRT(IIU,IJU,IKU)) +ZSUMRT(:,:,:) = 0. +IF (NRR==0) THEN + XTHT(:,:,:) = ZTHVT(:,:,:) +ELSE + IF (NDXRATIO/=1 .OR. NDYRATIO/=1) THEN + XRT(:,:,:,1) = SM_PMR_HU(XPABST(:,:,:), & + ZTHVT(:,:,:)*(XPABST(:,:,:)/XP00)**(XRD/XCPD), & + ZHUT(:,:,:),XRT(:,:,:,:),KITERMAX=100 ) + END IF + ! + DO JRR=1,NRR + ZSUMRT(:,:,:) = ZSUMRT(:,:,:) + XRT(:,:,:,JRR) + END DO + XTHT(:,:,:) = ZTHVT(:,:,:)/(1.+XRV/XRD*XRT(:,:,:,1))*(1.+ZSUMRT(:,:,:)) + CALL MPPDB_CHECK3D(XTHT,"SPAWN_MOD2:XTHT",PRECISION) +END IF +! +DEALLOCATE (ZHUT) +! +CALL SECOND_MNH(ZTIME2) +ZPRESSURE2=ZTIME2-ZTIME1 +! +!* 5.9 Large Scale field for lbc treatment: +! +! +!* 5.9.1 West-East LB zones +! +! +!JUAN A REVOIR TODO_JPHEXT +! <<<<<<< spawn_model2.f90 + MPPDB_CHECK_LB = .TRUE. + CALL MPPDB_CHECK3D(XUT,"SPAWN_MOD2 before lbc treatment:XUT",PRECISION) + CALL MPPDB_CHECK3D(XVT,"SPAWN_MOD2 before lbc treatment:XVT",PRECISION) + MPPDB_CHECK_LB = .FALSE. + YLBTYPE = 'LBU' + CALL SET_LB_FIELD_ll( YLBTYPE, XUT, XLBXUM, XLBYUM, IIB, IJB, IIE, IJE, 1, 0, 0, 0 ) + ! copy XUT(IIB:IIB+NRIMX,:,:) instead of XUT(IIB-1:IIB-1+NRIMX,:,:) in XLBXUM + CALL SET_LB_FIELD_ll( YLBTYPE, XVT, XLBXVM, XLBYVM, IIB, IJB, IIE, IJE, 0, 0, 1, 0 ) + ! copy XVT(:,IJB:IJB+NRIMY,:) instead of XVT(:,IJB-1:IJB-1+NRIMY,:) in XLBYVM + CALL SET_LB_FIELD_ll( YLBTYPE, XWT, XLBXWM, XLBYWM, IIB, IJB, IIE, IJE, 0, 0, 0, 0 ) + CALL SET_LB_FIELD_ll( YLBTYPE, XTHT, XLBXTHM, XLBYTHM, IIB, IJB, IIE, IJE, 0, 0, 0, 0 ) + IF (HTURB /= 'NONE') THEN + CALL SET_LB_FIELD_ll( YLBTYPE, XTKET, XLBXTKEM, XLBYTKEM, IIB, IJB, IIE, IJE, 0, 0, 0, 0 ) + ENDIF + IF (NRR >= 1) THEN + DO JRR =1,NRR + CALL SET_LB_FIELD_ll( YLBTYPE, XRT(:,:,:,JRR), XLBXRM(:,:,:,JRR), XLBYRM(:,:,:,JRR), IIB, IJB, IIE, IJE, 0, 0, 0, 0 ) + END DO + END IF + IF (NSV /= 0) THEN + DO JSV = 1, NSV + CALL SET_LB_FIELD_ll( YLBTYPE, XSVT(:,:,:,JSV), XLBXSVM(:,:,:,JSV), XLBYSVM(:,:,:,JSV), IIB, IJB, IIE, IJE, 0, 0, 0, 0 ) + END DO +!!$======= +!!$! +!!$XLBXUM(1:NRIMX+JPHEXT,:,:) = XUT(2:NRIMX+JPHEXT+1,:,:) +!!$XLBXUM(NRIMX+JPHEXT+1:2*NRIMX+2*JPHEXT,:,:) = XUT(IIE+1-NRIMX:IIE+JPHEXT,:,:) +!!$IF( .NOT. L2D ) THEN +!!$ XLBYUM(:,1:NRIMY+JPHEXT,:) = XUT(:,1:NRIMY+JPHEXT,:) +!!$ XLBYUM(:,NRIMY+JPHEXT+1:2*NRIMY+2*JPHEXT,:) = XUT(:,IJE+1-NRIMY:IJE+JPHEXT,:) +!!$END IF +!!$! +!!$!* 5.9.2 V variable +!!$! +!!$! +!!$XLBXVM(1:NRIMX+JPHEXT,:,:) = XVT(1:NRIMX+JPHEXT,:,:) +!!$XLBXVM(NRIMX+JPHEXT+1:2*NRIMX+2*JPHEXT,:,:) = XVT(IIE+1-NRIMX:IIE+JPHEXT,:,:) +!!$IF( .NOT. L2D ) THEN +!!$ XLBYVM(:,1:NRIMY+JPHEXT,:) = XVT(:,2:NRIMY+JPHEXT+1,:) +!!$ XLBYVM(:,NRIMY+JPHEXT+1:2*NRIMY+2*JPHEXT,:) = XVT(:,IJE+1-NRIMY:IJE+JPHEXT,:) +!!$END IF +!!$! +!!$!* 5.9.3 W variable +!!$! +!!$! +!!$XLBXWM(1:NRIMX+JPHEXT,:,:) = XWT(1:NRIMX+JPHEXT,:,:) +!!$XLBXWM(NRIMX+JPHEXT+1:2*NRIMX+2*JPHEXT,:,:) = XWT(IIE+1-NRIMX:IIE+JPHEXT,:,:) +!!$IF( .NOT. L2D ) THEN +!!$ XLBYWM(:,1:NRIMY+JPHEXT,:) = XWT(:,1:NRIMY+JPHEXT,:) +!!$ XLBYWM(:,NRIMY+JPHEXT+1:2*NRIMY+2*JPHEXT,:) = XWT(:,IJE+1-NRIMY:IJE+JPHEXT,:) +!!$END IF +!!$! +!!$!* 5.9.4 TH variable +!!$! +!!$! +!!$XLBXTHM(1:NRIMX+JPHEXT,:,:) = XTHT(1:NRIMX+JPHEXT,:,:) +!!$XLBXTHM(NRIMX+JPHEXT+1:2*NRIMX+2*JPHEXT,:,:) = XTHT(IIE+1-NRIMX:IIE+JPHEXT,:,:) +!!$IF( .NOT. L2D ) THEN +!!$ XLBYTHM(:,1:NRIMY+JPHEXT,:) = XTHT(:,1:NRIMY+JPHEXT,:) +!!$ XLBYTHM(:,NRIMY+JPHEXT+1:2*NRIMY+2*JPHEXT,:) = XTHT(:,IJE+1-NRIMY:IJE+JPHEXT,:) +!!$END IF +!!$! +!!$!* 5.9.5 TKE variable +!!$! +!!$! +!!$IF (HTURB /= 'NONE') THEN +!!$ XLBXTKEM(1:NRIMX+JPHEXT,:,:) = XTKET(1:NRIMX+JPHEXT,:,:) +!!$ XLBXTKEM(NRIMX+JPHEXT+1:2*NRIMX+2*JPHEXT,:,:) = XTKET(IIE+1-NRIMX:IIE+JPHEXT,:,:) +!!$ IF( .NOT. L2D ) THEN +!!$ XLBYTKEM(:,1:NRIMY+JPHEXT,:) = XTKET(:,1:NRIMY+JPHEXT,:) +!!$ XLBYTKEM(:,NRIMY+JPHEXT+1:2*NRIMY+2*JPHEXT,:) = XTKET(:,IJE+1-NRIMY:IJE+JPHEXT,:) +!!$>>>>>>> 1.3.2.4.2.2.2.6.2.3.2.6.2.1 + END IF +! +! <<<<<<< spawn_model2.f90 + CALL MPPDB_CHECKLB(XLBXUM,"SPAWN_MOD2 before SPAWN_SURF2_RAIN",PRECISION,'LBXU',NRIMX) + CALL MPPDB_CHECKLB(XLBXVM,"SPAWN_MOD2 before SPAWN_SURF2_RAIN:XLBXVM",PRECISION,'LBXU',NRIMX) + CALL MPPDB_CHECKLB(XLBXWM,"SPAWN_MOD2 before SPAWN_SURF2_RAIN:XLBXWM",PRECISION,'LBXU',NRIMX) + CALL MPPDB_CHECKLB(XLBYUM,"SPAWN_MOD2 before SPAWN_SURF2_RAIN:XLBYUM",PRECISION,'LBYV',NRIMY) + CALL MPPDB_CHECKLB(XLBYVM,"SPAWN_MOD2 before SPAWN_SURF2_RAIN:XLBYVM",PRECISION,'LBYV',NRIMY) + CALL MPPDB_CHECKLB(XLBYWM,"SPAWN_MOD2 before SPAWN_SURF2_RAIN:XLBYWM",PRECISION,'LBYV',NRIMY) +!!$======= +!!$!* 5.9.6 moist variables +!!$! +!!$IF (NRR >= 1) THEN +!!$ DO JRR =1,NRR +!!$ XLBXRM(1:NRIMX+JPHEXT,:,:,JRR) = XRT(1:NRIMX+JPHEXT,:,:,JRR) +!!$ XLBXRM(NRIMX+JPHEXT+1:2*NRIMX+2*JPHEXT,:,:,JRR) = XRT(IIE+1-NRIMX:IIE+JPHEXT,:,:,JRR) +!!$ IF( .NOT. L2D ) THEN +!!$ XLBYRM(:,1:NRIMY+JPHEXT,:,JRR) = XRT(:,1:NRIMY+JPHEXT,:,JRR) +!!$ XLBYRM(:,NRIMY+JPHEXT+1:2*NRIMY+2*JPHEXT,:,JRR) = XRT(:,IJE+1-NRIMY:IJE+JPHEXT,:,JRR) +!!$ END IF +!!$ END DO +!!$END IF +!!$! +!!$!* 5.9.7 scalar variables +!!$! +!!$IF (NSV /= 0) THEN +!!$ DO JSV = 1, NSV +!!$ XLBXSVM(1:NRIMX+JPHEXT,:,:,JSV) = XSVT(1:NRIMX+JPHEXT,:,:,JSV) +!!$ XLBXSVM(NRIMX+JPHEXT+1:2*NRIMX+2*JPHEXT,:,:,JSV) = XSVT(IIE+1-NRIMX:IIE+JPHEXT,:,:,JSV) +!!$ IF( .NOT. L2D ) THEN +!!$ XLBYSVM(:,1:NRIMY+JPHEXT,:,JSV) = XSVT(:,1:NRIMY+JPHEXT,:,JSV) +!!$ XLBYSVM(:,NRIMY+JPHEXT+1:2*NRIMY+2*JPHEXT,:,JSV) = XSVT(:,IJE+1-NRIMY:IJE+JPHEXT,:,JSV) +!!$ END IF +!!$ END DO +!!$ENDIF +!!$>>>>>>> 1.3.2.4.2.2.2.6.2.3.2.6.2.1 +! +!* 5.10 Surface precipitation computation +! +IF (SIZE(XINPRR) /= 0 ) THEN + IF (GNOSON) & + CALL SPAWN_SURF2_RAIN (NXOR,NYOR,NXEND,NYEND,NDXRATIO,NDYRATIO, & + XINPRC,XACPRC,XINDEP,XACDEP,XINPRR,XINPRR3D,XEVAP3D, & + XACPRR,XINPRS,XACPRS,XINPRG,XACPRG,& + XINPRH,XACPRH ) + IF (.NOT.GNOSON) & + CALL SPAWN_SURF2_RAIN (NXOR,NYOR,NXEND,NYEND,NDXRATIO,NDYRATIO, & + XINPRC,XACPRC,XINDEP,XACDEP,XINPRR,XINPRR3D,XEVAP3D, & + XACPRR,XINPRS,XACPRS,XINPRG,XACPRG,XINPRH,XACPRH, & + TZSONFILE,IIUSON,IJUSON, & + IIB2,IJB2,IIE2,IJE2, & + IIB1,IJB1,IIE1,IJE1 ) +ENDIF +! +!* 5.11 Total mass of dry air Md computation : +! +ZTIME1 = ZTIME2 +! +ALLOCATE(ZRHOD(IIU,IJU,IKU)) +! +IF (LOCEAN) THEN + ZRHOD(:,:,:)=XRH00OCEAN*(1.-XALPHAOC*(ZTHVT(:,:,:)-XTH00OCEAN)+XBETAOC*(XRT(:,:,:,1)-XSA00OCEAN)) +ELSE + ZRHOD(:,:,:)=XPABST(:,:,:)/(XPABST(:,:,:)/XP00)**(XRD/XCPD) & + /(XRD*ZTHVT(:,:,:)*(1.+ZSUMRT(:,:,:))) +ENDIF +!$20140709 + CALL MPPDB_CHECK3D(ZRHOD,"SPAWN_MOD2:ZRHOD",PRECISION) + CALL MPPDB_CHECK3D(XPABST,"SPAWN_MOD2:XPABST",PRECISION) + CALL MPPDB_CHECK3D(ZSUMRT,"SPAWN_MOD2:ZSUMRT",PRECISION) +!$20140710 until here all ok after UPHALO(XZZ) +! +CALL TOTAL_DMASS(ZJ,ZRHOD,XDRYMASST) +! +DEALLOCATE (ZRHOD) +DEALLOCATE (ZSUMRT,ZTHVT) +! +CALL SECOND_MNH(ZTIME2) +! +ZMISC = ZMISC + ZTIME2 - ZTIME1 +! +!* 5.12 Deallocation of model 1 variables : +! +ZTIME1 = ZTIME2 +! +CALL DEALLOCATE_MODEL1(3) +! +CALL SECOND_MNH(ZTIME2) +! +ZMISC = ZMISC + ZTIME2 - ZTIME1 +! +!* 5.13 Anelastic correction : +! +CALL SECOND_MNH(ZTIME1) +! +IF (.NOT. L1D) THEN + CALL ANEL_BALANCE_n + CALL BOUNDARIES ( & + 0.,CLBCX,CLBCY,NRR,NSV,1, & + XLBXUM,XLBXVM,XLBXWM,XLBXTHM,XLBXTKEM,XLBXRM,XLBXSVM, & + XLBYUM,XLBYVM,XLBYWM,XLBYTHM,XLBYTKEM,XLBYRM,XLBYSVM, & + XLBXUM,XLBXVM,XLBXWM,XLBXTHM,XLBXTKEM,XLBXRM,XLBXSVM, & + XLBYUM,XLBYVM,XLBYWM,XLBYTHM,XLBYTKEM,XLBYRM,XLBYSVM, & + XRHODJ,XRHODREF, & + XUT, XVT, XWT, XTHT, XTKET, XRT, XSVT, XSRCT ) +END IF +! +CALL SECOND_MNH(ZTIME2) +! +ZANEL = ZTIME2 - ZTIME1 +! +! +! +!------------------------------------------------------------------------------- +! +!* 6. WRITE THE FMFILE +! ---------------- +! +CALL SECOND_MNH(ZTIME1) +! +INPRAR = 22 + 2*(4+NRR+NSV) ! 22 = number of grid variables + reference state + ! variables +dimension variables + ! 2*(4+NRR+NSV) = number of prognostic variables + ! at time t and t-dt +IF ( ( LEN_TRIM(HSPAFILE) /= 0 ) .AND. ( ADJUSTL(HSPAFILE) /= ADJUSTL(CINIFILE) ) ) THEN + CMY_NAME(2)=HSPAFILE +ELSE + CMY_NAME(2)=ADJUSTL(ADJUSTR(CINIFILE)//'.spa'//ADJUSTL(HSPANBR)) + IF (.NOT.GNOSON) & + CMY_NAME(2)=ADJUSTL(ADJUSTR(CINIFILE)//'.spr'//ADJUSTL(HSPANBR)) +END IF +! +CALL IO_File_add2list(TZFILE,CMY_NAME(2),'MNH','WRITE',KLFINPRAR=INPRAR,KLFITYPE=1,KLFIVERB=NVERB) +! +CALL IO_File_open(TZFILE) +! +CALL WRITE_DESFM_n(2,TZFILE) +! +IF (LBAL_ONLY) THEN ! same relation with its DAD for model2 and for model1 + NDXRATIO_ALL(2) = NDXRATIO_ALL(1) + NDYRATIO_ALL(2) = NDYRATIO_ALL(1) + NXOR_ALL(2) = NXOR_ALL(1) + NYOR_ALL(2) = NYOR_ALL(1) + NXEND_ALL(2) = NXEND_ALL(1) + NYEND_ALL(2) = NYEND_ALL(1) + CDAD_NAME(2) = CDAD_NAME(1) + IF (CDADSPAFILE == '' ) THEN + IF (NDXRATIO_ALL(1) == 1 .AND. NDYRATIO_ALL(1) == 1 & + .AND. NXOR_ALL(1) == 1 .AND. NYOR_ALL(1) == 1 ) THEN + ! for spawning with ratio=1 + ! if the DAD of model 1 is itself, the DAD of model 2 also. + CDAD_NAME(2)=CMY_NAME(2) + ENDIF + ENDIF + ! case of model with DAD + IF (CDADSPAFILE /='') CDAD_NAME(2)=CDADSPAFILE +ELSE + CDAD_NAME(2)=CMY_NAME(1) ! model 1 becomes the DAD of model 2 (spawned one) +ENDIF +! +CALL IO_Header_write(TZFILE,HDAD_NAME=CDAD_NAME(2)) +CALL WRITE_LFIFM_n(TZFILE,CDAD_NAME(2)) +! +CALL SECOND_MNH(ZTIME2) +! +ZWRITE = ZTIME2 - ZTIME1 +! +!------------------------------------------------------------------------------- +! +!* 7. Surface variables : +! +ZTIME1 = ZTIME2 +! +TFILE_SURFEX => TZFILE +CALL SPAWN_SURF(HINIFILE,HINIFILEPGD,TZFILE,OSPAWN_SURF) +NULLIFY(TFILE_SURFEX) +! +CALL SECOND_MNH(ZTIME2) +! +ZSURF2 = ZTIME2 - ZTIME1 +! +!------------------------------------------------------------------------------- +! +!* 8. CLOSES THE FMFILE +! ----------------- +! +CALL IO_File_close(TZFILE) +IF (ASSOCIATED(TZSONFILE)) THEN + CALL IO_File_close(TZSONFILE) +END IF +! +!------------------------------------------------------------------------------- +! +!* 9. PRINTS ON OUTPUT-LISTING +! ------------------------ +! +WRITE(ILUOUT,FMT=9900) XZHAT(1) +! +DO JLOOP = 2,IKU + WRITE(ILUOUT,FMT=9901) JLOOP,XZHAT(JLOOP),XZHAT(JLOOP)-XZHAT(JLOOP-1) +END DO +! +IF (NVERB >= 5) THEN + WRITE(ILUOUT,*) 'SPAWN_MODEL2: LUSERV,LUSERC=',LUSERV,LUSERC + WRITE(ILUOUT,*) 'SPAWN_MODEL2: LUSERR,LUSERI,LUSERS=',LUSERR,LUSERI,LUSERS + WRITE(ILUOUT,*) 'SPAWN_MODEL2: LUSERG,LUSERH,NSV=',LUSERG,LUSERH,NSV + WRITE(ILUOUT,*) 'SPAWN_MODEL2: NRR=',NRR + WRITE(ILUOUT,*) 'SPAWN_MODEL2: NVERB=',NVERB + WRITE(ILUOUT,*) 'SPAWN_MODEL2: XLON0,XLAT0,XBETA=',XLON0,XLAT0,XBETA + WRITE(ILUOUT,*) 'SPAWN_MODEL2: LCARTESIAN=',LCARTESIAN + WRITE(ILUOUT,*) 'SPAWN_MODEL2: LOCEAN,LCOUPLES=',LOCEAN,LCOUPLES + IF(LCARTESIAN) THEN + WRITE(ILUOUT,*) 'SPAWN_MODEL2: No map projection used.' + ELSE + WRITE(ILUOUT,*) 'SPAWN_MODEL2: XRPK,XLONORI,XLATORI=',XRPK,XLONORI,XLATORI + IF (ABS(XRPK) == 1.) THEN + WRITE(ILUOUT,*) 'SPAWN_MODEL2: Polar stereo used.' + ELSE IF (XRPK == 0.) THEN + WRITE(ILUOUT,*) 'SPAWN_MODEL2: Mercator used.' + ELSE + WRITE(ILUOUT,*) 'SPAWN_MODEL2: Lambert used, cone factor=',XRPK + END IF + END IF +END IF +! +IF (NVERB >= 10) THEN + WRITE(ILUOUT,*) 'SPAWN_MODEL2: IIB, IJB, IKB=',IIB,IJB,IKB + WRITE(ILUOUT,*) 'SPAWN_MODEL2: IIU, IJU, IKU=',IIU,IJU,IKU +END IF +! +IF(NVERB >= 10) THEN !Value control + WRITE(ILUOUT,*) 'SPAWN_MODEL2: Some XZS values:' + WRITE(ILUOUT,*) XZS(1,IJU),XZS((IIU-1)/2,IJU),XZS(IIU,IJU) + WRITE(ILUOUT,*) XZS(1,(IJU-1)/2),XZS((IIU-1)/2,(IJU-1)/2),XZS(IIU,(IJU-1)/2) + WRITE(ILUOUT,*) XZS(1,1) ,XZS((IIU-1)/2,1) ,XZS(IIU,1) +END IF +! +IF(NVERB >= 10) THEN !Value control + WRITE(ILUOUT,*) 'SPAWN_MODEL2: Some XUT values:' + WRITE(ILUOUT,*) ' (1,IJU/2,JK) (IIU/2,1,JK) (IIU/2,IJU/2,JK) & + &(IIU/2,IJU,JK) (IIU,IJU/2,JK)' + DO JKLOOP=1,IKU + WRITE(ILUOUT,*) 'JK = ',JKLOOP + WRITE(ILUOUT,*) XUT(1,IJU/2,JKLOOP),XUT(IIU/2,1,JKLOOP), & + XUT(IIU/2,IJU/2,JKLOOP),XUT(IIU/2,IJU,JKLOOP), & + XUT(IIU,IJU/2,JKLOOP) + END DO + WRITE(ILUOUT,*) 'SPAWN_MODEL2: Some XVT values:' + WRITE(ILUOUT,*) ' (1,IJU/2,JK) (IIU/2,1,JK) (IIU/2,IJU/2,JK) & + &(IIU/2,IJU,JK) (IIU,IJU/2,JK)' + DO JKLOOP=1,IKU + WRITE(ILUOUT,*) 'JK = ',JKLOOP + WRITE(ILUOUT,*) XVT(1,IJU/2,JKLOOP),XVT(IIU/2,1,JKLOOP), & + XVT(IIU/2,IJU/2,JKLOOP),XVT(IIU/2,IJU,JKLOOP), & + XVT(IIU,IJU/2,JKLOOP) + END DO + WRITE(ILUOUT,*) 'SPAWN_MODEL2: Some XWT values:' + WRITE(ILUOUT,*) ' (1,IJU/2,JK) (IIU/2,1,JK) (IIU/2,IJU/2,JK) & + &(IIU/2,IJU,JK) (IIU,IJU/2,JK)' + DO JKLOOP=1,IKU + WRITE(ILUOUT,*) 'JK = ',JKLOOP + WRITE(ILUOUT,*) XWT(1,IJU/2,JKLOOP),XWT(IIU/2,1,JKLOOP), & + XWT(IIU/2,IJU/2,JKLOOP),XWT(IIU/2,IJU,JKLOOP), & + XWT(IIU,IJU/2,JKLOOP) + END DO + WRITE(ILUOUT,*) 'SPAWN_MODEL2: Some XTHT values:' + WRITE(ILUOUT,*) ' (1,IJU/2,JK) (IIU/2,1,JK) (IIU/2,IJU/2,JK) & + &(IIU/2,IJU,JK) (IIU,IJU/2,JK)' + DO JKLOOP=1,IKU + WRITE(ILUOUT,*) 'JK = ',JKLOOP + WRITE(ILUOUT,*) XTHT(1,IJU/2,JKLOOP),XTHT(IIU/2,1,JKLOOP), & + XTHT(IIU/2,IJU/2,JKLOOP),XTHT(IIU/2,IJU,JKLOOP), & + XTHT(IIU,IJU/2,JKLOOP) + END DO + IF(NRR >= 1) THEN + WRITE(ILUOUT,*) 'SPAWN_MODEL2: Some XRT values:' + WRITE(ILUOUT,*) ' (1,IJU/2,JK) (IIU/2,1,JK) (IIU/2,IJU/2,JK) & + &(IIU/2,IJU,JK) (IIU,IJU/2,JK)' + DO JKLOOP=1,IKU + WRITE(ILUOUT,*) 'JK = ',JKLOOP + WRITE(ILUOUT,*) XRT(1,IJU/2,JKLOOP,1),XRT(IIU/2,1,JKLOOP,1), & + XRT(IIU/2,IJU/2,JKLOOP,1),XRT(IIU/2,IJU,JKLOOP,1), & + XRT(IIU,IJU/2,JKLOOP,1) + END DO + END IF + ! + IF (LUV_FLX) THEN + WRITE(ILUOUT,*)'SPAWN_MODEL2: Some EDDY_FLUX values XVU_FLUX(IIU/2,2,:)=',XVU_FLUX_M(IIU/2,2,:) + END IF + ! + IF (LTH_FLX) THEN + WRITE(ILUOUT,*)'SPAWN_MODEL2: Some EDDY_FLUX values XVTH_FLUX(IIU/2,2,:)=',XVTH_FLUX_M(IIU/2,2,:) + WRITE(ILUOUT,*)'SPAWN_MODEL2: Some EDDY_FLUX values XWTH_FLUX(IIU/2,2,:)=',XWTH_FLUX_M(IIU/2,2,:) + END IF + ! +END IF +! +WRITE(ILUOUT,*) 'SPAWN_MODEL2: SPAWN_MODEL2 ENDS CORRECTLY.' +! +CALL SECOND_MNH (ZEND) +! +ZTOT = ZEND - ZSTART ! for computing time analysis +! +ZALL = ZGRID2 + ZSURF2 + ZMISC + ZFIELD2 + ZVER + ZPRESSURE2 + ZANEL + ZWRITE +! +ZPERCALL = 100.*ZALL/ZTOT +! +ZPERCGRID2 = 100.*ZGRID2/ZTOT +ZPERCSURF2 = 100.*ZSURF2/ZTOT +ZPERCMISC = 100.*ZMISC/ZTOT +ZPERCFIELD2 = 100.*ZFIELD2/ZTOT +ZPERCVER = 100.*ZVER/ZTOT +ZPERCPRESSURE2 = 100.*ZPRESSURE2/ZTOT +ZPERCANEL = 100.*ZANEL/ZTOT +ZPERCWRITE = 100.*ZWRITE/ZTOT +! +WRITE(ILUOUT,*) +WRITE(ILUOUT,*) ' ------------------------------------------------------------ ' +WRITE(ILUOUT,*) '| |' +WRITE(ILUOUT,*) '| COMPUTING TIME ANALYSIS in SPAWN_MODEL2 |' +WRITE(ILUOUT,*) '| |' +WRITE(ILUOUT,*) '|------------------------------------------------------------|' +WRITE(ILUOUT,*) '| | | |' +WRITE(ILUOUT,*) '| ROUTINE NAME | CPU-TIME | PERCENTAGE % |' +WRITE(ILUOUT,*) '| | | |' +WRITE(ILUOUT,*) '|---------------------|-------------------|------------------|' +WRITE(ILUOUT,*) '| | | |' +WRITE(UNIT=ILUOUT,FMT=1) ZGRID2 ,ZPERCGRID2 +WRITE(UNIT=ILUOUT,FMT=3) ZFIELD2,ZPERCFIELD2 +WRITE(UNIT=ILUOUT,FMT=8) ZVER,ZPERCVER +WRITE(UNIT=ILUOUT,FMT=7) ZPRESSURE2,ZPERCPRESSURE2 +WRITE(UNIT=ILUOUT,FMT=2) ZSURF2 ,ZPERCSURF2 +WRITE(UNIT=ILUOUT,FMT=4) ZANEL ,ZPERCANEL +WRITE(UNIT=ILUOUT,FMT=5) ZWRITE ,ZPERCWRITE +WRITE(UNIT=ILUOUT,FMT=9) ZMISC ,ZPERCMISC +WRITE(UNIT=ILUOUT,FMT=6) ZTOT ,ZPERCALL +WRITE(ILUOUT,*) ' ------------------------------------------------------------ ' +! +! FORMATS +! ------- +! +1 FORMAT(' | SPAWN_GRID2 | ',F8.3,' | ',F8.3,' |') +3 FORMAT(' | SPAWN_FIELD2 | ',F8.3,' | ',F8.3,' |') +8 FORMAT(' | VER_INTERP_FIELD | ',F8.3,' | ',F8.3,' |') +7 FORMAT(' | SPAWN_PRESSURE2 | ',F8.3,' | ',F8.3,' |') +2 FORMAT(' | SPAWN_SURF2 | ',F8.3,' | ',F8.3,' |') +4 FORMAT(' | ANEL_BALANCE2 | ',F8.3,' | ',F8.3,' |') +5 FORMAT(' | WRITE | ',F8.3,' | ',F8.3,' |') +9 FORMAT(' | MISCELLANEOUS | ',F8.3,' | ',F8.3,' |') +6 FORMAT(' | SPAWN_MODEL2 | ',F8.3,' | ',F8.3,' |') +! +! +CALL IO_File_close(TLUOUT) +! +9900 FORMAT(' K = 001 ZHAT = ',E14.7) +9901 FORMAT(' K = ',I3.3,' ZHAT = ',E14.7,' DZ = ' ,E14.7) +! +!------------------------------------------------------------------------------- +! +! +! Switch back to model index of calling routine +CALL GOTO_MODEL(IMI) +! +END SUBROUTINE SPAWN_MODEL2 diff --git a/src/mesonh/ext/to_elec_fieldn.f90 b/src/mesonh/ext/to_elec_fieldn.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a6822298d897cb7c93e22205048645c57db9da56 --- /dev/null +++ b/src/mesonh/ext/to_elec_fieldn.f90 @@ -0,0 +1,184 @@ +!MNH_LIC Copyright 2002-2019 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_TO_ELEC_FIELD_n +! ########################### +! +INTERFACE + SUBROUTINE TO_ELEC_FIELD_n(PRT, PSVT, PRHODJ, KTCOUNT, KRR, & + PEFIELDU, PEFIELDV, PEFIELDW, PPHIT) +! +INTEGER, INTENT(IN) :: KTCOUNT ! counter value of the + ! model temporal loop +INTEGER, INTENT(IN) :: KRR ! Number of moist variables +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Jacobian +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVT ! Scalar variables with + ! electric charge density +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRT ! Mixing ratio +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PEFIELDU ! 3 components +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PEFIELDV ! of the +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PEFIELDW ! electric field +REAL, DIMENSION(:,:,:), OPTIONAL, INTENT(OUT) :: PPHIT ! Electrostatic potential + +END SUBROUTINE TO_ELEC_FIELD_n +END INTERFACE +END MODULE MODI_TO_ELEC_FIELD_n +! +! ############################################################### + SUBROUTINE TO_ELEC_FIELD_n(PRT, PSVT, PRHODJ, KTCOUNT, KRR, & + PEFIELDU, PEFIELDV, PEFIELDW, PPHIT) +! ############################################################### +! +! +!!**** * - compute the electric field +!! +!! PURPOSE +!! ------- +!! The purpose of this routine is to compute... +!! +!! +!!** METHOD +!! ------ +!! +!! EXTERNAL +!! -------- +!! None +!! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! C. Barthe, G. Molinie, J.-P. Pinty *Laboratoire d'Aerologie* +!! +!! MODIFICATIONS +!! ------------- +!! Original 2002 +!! C. Barthe 06/11/09 update to version 4.8.1 +!! M. Chong 26/01/10 Add Small ions +! P. Wautelet 20/05/2019: add name argument to ADDnFIELD_ll + new ADD4DFIELD_ll subroutine +!! +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_REF_n, ONLY : XRHODREF +USE MODD_PARAMETERS, ONLY : JPVEXT +USE MODD_RAIN_ICE_DESCR_n, ONLY : XRTMIN +USE MODD_ELEC_DESCR, ONLY : XRELAX_ELEC, XECHARGE +USE MODD_ELEC_n, ONLY : XESOURCEFW +! +USE MODI_ELEC_FIELD_n +! +USE MODE_ll +! +IMPLICIT NONE +! +!* 0.1 Declarations of dummy arguments : +! +INTEGER, INTENT(IN) :: KTCOUNT ! counter value of the + ! model temporal loop +INTEGER, INTENT(IN) :: KRR ! Number of moist variables +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Jacobian +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PSVT ! Scalar variables with + ! electric charge density +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRT ! Mixing ratio +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PEFIELDU ! 3 components +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PEFIELDV ! of the +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PEFIELDW ! electric field +REAL, DIMENSION(:,:,:), OPTIONAL, INTENT(OUT) :: PPHIT ! Electrostatic potential +! +! +!* 0.2 Declarations of local variables : +! +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZW ! work array +! +INTEGER :: IIB ! Define +INTEGER :: IIE ! the +INTEGER :: IJB ! physical +INTEGER :: IJE ! domain +INTEGER :: IKB ! +INTEGER :: IKE ! +INTEGER :: IIU, IJU, IKU +INTEGER :: II +INTEGER :: IINFO_ll +! +TYPE(LIST_ll), POINTER :: TZFIELDS_ll ! list of fields to exchange +! +! +!------------------------------------------------------------------------------- +! +!* 1. COMPUTE THE LOOP BOUNDS +! ----------------------- +! +NULLIFY(TZFIELDS_ll) +! +! Compute loop bounds +! +CALL GET_PHYSICAL_ll(IIB,IJB,IIE,IJE) +CALL GET_DIM_EXT_ll('B',IIU,IJU) +! +IKB = 1 + JPVEXT +IKU = SIZE(XESOURCEFW,3) +IKE = IKU - JPVEXT +! +! allocations +! +ALLOCATE(ZW(SIZE(PSVT,1),SIZE(PSVT,2),SIZE(PSVT,3))) +ZW(:,:,:) = 0. +! +! +!------------------------------------------------------------------------------- +! +!* 2. TRANSFORM PSVT from C/kg INTO C/m3 and SUM +! ---------------------------------- +! +DO II = 1, KRR+1 + ZW(:,:,:) = ZW(:,:,:) + PSVT(:,:,:,II) * XRHODREF(:,:,:) +END DO +! +!------------------------------------------------------------------------------- +! +!* 3. BOUNDARY CONDITIONS +! ------------------- +! +ZW(:,:,1:IKB-1) = 0.0 ! Setup to neutralize the computation on the + ! first ligne of the tridiagonal system starting + ! at IKB-1 +ZW(:,:,IKE:IKE+JPVEXT) = XESOURCEFW(:,:,IKE:IKE+JPVEXT) +! +CALL ADD3DFIELD_ll( TZFIELDS_ll, ZW, 'TO_ELEC_FIELD_n::ZW' ) +CALL UPDATE_HALO_ll(TZFIELDS_ll,IINFO_ll) +CALL CLEANLIST_ll(TZFIELDS_ll) +! +! +!------------------------------------------------------------------------------- +! +!* 4. COMPUTE THE ELECTRIC FIELD +! -------------------------- +! +IF (PRESENT(PPHIT)) THEN + CALL ELEC_FIELD_n (ZW, KTCOUNT, XRELAX_ELEC, PRHODJ, & + PEFIELDU, PEFIELDV, PEFIELDW, PPHIT) +ELSE + CALL ELEC_FIELD_n (ZW, KTCOUNT, XRELAX_ELEC, PRHODJ, & + PEFIELDU, PEFIELDV, PEFIELDW) +ENDIF +! +DEALLOCATE(ZW) +! +! +!------------------------------------------------------------------------------- +! +END SUBROUTINE TO_ELEC_FIELD_n + diff --git a/src/mesonh/ext/two_wayn.f90 b/src/mesonh/ext/two_wayn.f90 new file mode 100644 index 0000000000000000000000000000000000000000..b2299ee4ac537dace171013da289b8b8f0fc0b5b --- /dev/null +++ b/src/mesonh/ext/two_wayn.f90 @@ -0,0 +1,1309 @@ +!MNH_LIC Copyright 1997-2020 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_TWO_WAY_n +! ################### +! +INTERFACE +! + SUBROUTINE TWO_WAY_n (KRR,KSV,PRHODJ,KMI,PTSTEP, & + PUM ,PVM, PWM, PTHM, PRM, PSVM, & + PRUS,PRVS,PRWS,PRTHS,PRRS,PRSVS, & + PINPRC,PINPRR,PINPRS,PINPRG,PINPRH,PPRCONV,PPRSCONV, & + PDIRFLASWD,PSCAFLASWD,PDIRSRFSWD,OMASKkids ) +! +INTEGER, INTENT(IN) :: KRR ! Number of moist variables +INTEGER, INTENT(IN) :: KSV ! Number of Scalar Variables +INTEGER, INTENT(IN) :: KMI ! Model index +! +REAL, INTENT(IN) :: PTSTEP ! Timestep duration +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! (Rho) dry * Jacobian +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PUM, PVM, PWM ! Variables at t-dt +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHM +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM, PSVM +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS, PRVS, PRWS ! Source +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRTHS +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRS, PRSVS ! terms +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRC,PINPRR,PINPRS,PINPRG,PINPRH, & + PPRCONV,PPRSCONV ! precipitating variables +LOGICAL, DIMENSION(:,:), INTENT(INOUT) :: OMASKkids ! true where kids exist +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDIRFLASWD,PSCAFLASWD ! Long wave radiation +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDIRSRFSWD ! Long wave radiation +! +END SUBROUTINE TWO_WAY_n +! +END INTERFACE +! +END MODULE MODI_TWO_WAY_n +! ####################################################################### + SUBROUTINE TWO_WAY_n (KRR,KSV,PRHODJ,KMI,PTSTEP, & + PUM ,PVM, PWM, PTHM, PRM, PSVM, & + PRUS,PRVS,PRWS,PRTHS,PRRS,PRSVS, & + PINPRC,PINPRR,PINPRS,PINPRG,PINPRH,PPRCONV,PPRSCONV, & + PDIRFLASWD,PSCAFLASWD,PDIRSRFSWD,OMASKkids ) +! ####################################################################### +! +!!**** *TWO_WAY_n* - Relaxation of all fields toward the average value obtained +!!**** by the nested model $n for TWO_WAY interactive gridnesting +!! +!! PURPOSE +!! ------- +!! The purpose of TWO_WAY_n is: +!! - first to average the fine scale fields of the inner model $n to +!! the coarse mesh scale of the present outer model DAD($n). +!! - second to apply the relaxation toward these average fields over the +!! intersecting domain +! +! +!!** METHOD +!! ------ +!! Use a simple top hat horizontal average applied in the inner domain +!! except in a halo inner band of IHALO width (default value 0). +!! The relaxation equation writes: +!! ___ t-1 +!! | \ rhodj * a | +!! d (RHODJ * A) | t-1 /__ | +!! -------------- = -K * RHODJ * |A - ----------------- | +!! dt 2W | ___ | +!! | \ rhodj | +!! | /__ | +!! +!! In this routine $n denotes the nested model (with all variables X...,N...). +!! KMI is the number of father model (all variables P..., K...) +!! +!! EXTERNAL +!! -------- +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! MODULE MODD_CONF_n : all +!! +!! MODULE MODD_NESTING: NDT_2_WAY +!! +!! REFERENCE +!! --------- +!! +!! +!! AUTHOR +!! ------ +!! J. P. Lafore *Meteo-France* +!! +!! MODIFICATIONS +!! ------------- +!! Original 12/11/97 +!! 20/01/98 remove the TKE and EPS change +!! P. Jabouille 03/04/00 parallelisation +!! N. Asencio 18/07/05 Add the surface parameters : precipitating +!! hydrometeors, the Short and Long Wave +!! + MASKkids array +!! 20/05/06 Remove EPS +!! M. Leriche 16/07/10 Add ice phase chemical species +!! V.Masson, C.Lac 08/10 Corrections in relaxation +!! J. Escobar 27/06/2011 correction for gridnesting with different SHAPE +!! Bosseur & Filippi 07/2013 Adds Forefire +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! Modification 01/2016 (JP Pinty) Add LIMA +! P. Wautelet 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 29/03/2019: bugfix: use correct sizes for 3rd dimension in allocation and loops when CRAD/='NONE' +!------------------------------------------------------------------------------ +! +!* 0. DECLARATIONS +! ------------ +USE MODE_ll +USE MODE_MODELN_HANDLER +! +USE MODD_PARAMETERS ! Declarative modules +USE MODD_NESTING +USE MODD_CONF +USE MODD_NSV +USE MODD_PARAM_ICE_n, ONLY : LSEDIC +USE MODD_PARAM_C2R2, ONLY : LSEDC +USE MODD_PARAM_LIMA, ONLY : NSEDC => LSEDC +! +USE MODD_FIELD_n ! modules relative to the inner (fine scale) model $n +USE MODD_PRECIP_n , ONLY : XINPRC,XINPRR,XINPRS,XINPRG,XINPRH +USE MODD_RADIATIONS_n ,ONLY:XDIRFLASWD,XSCAFLASWD,XDIRSRFSWD +USE MODD_DEEP_CONVECTION_n ,ONLY : XPRCONV,XPRSCONV +USE MODD_REF_n +USE MODD_CONF_n +USE MODD_PARAM_n +USE MODI_SHUMAN +! +! +IMPLICIT NONE +! +!* 0.1 declarations of arguments +! +INTEGER, INTENT(IN) :: KRR ! Number of moist variables +INTEGER, INTENT(IN) :: KSV ! Number of SV (father model) +INTEGER, INTENT(IN) :: KMI ! Model index +! +REAL, INTENT(IN) :: PTSTEP ! Timestep duration +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! (Rho) dry * Jacobian +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PUM, PVM, PWM ! Variables at t-dt +REAL, DIMENSION(:,:,:), INTENT(IN) :: PTHM +REAL, DIMENSION(:,:,:,:), INTENT(IN) :: PRM, PSVM +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRUS, PRVS, PRWS ! Source +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRTHS +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRRS, PRSVS ! terms +REAL, DIMENSION(:,:), INTENT(INOUT) :: PINPRC,PINPRR,PINPRS,PINPRG,PINPRH & + ,PPRCONV,PPRSCONV ! precipitating variables +LOGICAL, DIMENSION(:,:), INTENT(INOUT) :: OMASKkids ! true where kids exist +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDIRFLASWD,PSCAFLASWD ! Long wave radiation +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PDIRSRFSWD ! Long wave radiation +! +!* 0.2 declarations of local variables +! +! +INTEGER :: IIB,IJB,IIE,IJE +INTEGER :: IKU,IKB +INTEGER :: II1,II2,IJ1,IJ2,II1U,IJ1V,IWEST,ISOUTH,IDIST +INTEGER :: IXOR,IXEND ! horizontal position (i,j) of the ORigin and END +INTEGER :: IYOR,IYEND ! of the inner model $n domain, relative to outer model subdomain +INTEGER :: IXORU,IYORV ! particular case dure to C grid +INTEGER :: IDXRATIO,IDYRATIO ! x and y-direction resolution RATIO +INTEGER :: IXOR_ll,IYOR_ll ! origin's coordinates of extended subdomain +INTEGER :: IXDIM,IYDIM ! size of the extended dad subdomain +! +INTEGER :: JX,JY,JVAR ! loop index +INTEGER :: IRR,ISV_USER ! number of moist and scalar var commun to both models +! +REAL :: ZK2W ! Relaxation value +REAL, DIMENSION(SIZE(PTHM,1),SIZE(PTHM,2),SIZE(PTHM,3)) :: ZAVE_RHODJ +! +! intermediate arrays for model communication +REAL, DIMENSION(:, :, :), ALLOCATABLE :: ZTUM, ZTVM, ZTWM, ZTTHM +REAL, DIMENSION(:, :, :, :), ALLOCATABLE :: ZTRM, ZTSVM +REAL, DIMENSION(:, :, :), ALLOCATABLE :: ZUM, ZVM, ZWM, ZTHM +REAL, DIMENSION(:, :, :, :), ALLOCATABLE :: ZRM, ZSVM +REAL, DIMENSION(:, :, :), ALLOCATABLE :: ZTRHODJ, ZTRHODJU, ZTRHODJV +REAL, DIMENSION(:, :, :), ALLOCATABLE :: ZRHODJ, ZRHODJU, ZRHODJV +REAL, DIMENSION(:, :), ALLOCATABLE ::ZTINPRC,ZTINPRR,ZTINPRS,ZTINPRG,ZTINPRH,& + ZTPRCONV,ZTPRSCONV +REAL, DIMENSION(:, :,:), ALLOCATABLE :: ZTDIRFLASWD,ZTSCAFLASWD +REAL, DIMENSION(:, :,:), ALLOCATABLE :: ZTDIRSRFSWD +REAL, DIMENSION(:, :), ALLOCATABLE ::ZINPRC,ZINPRR,ZINPRS,ZINPRG,ZINPRH,& + ZPRCONV,ZPRSCONV +REAL, DIMENSION(:, :,:), ALLOCATABLE :: ZDIRFLASWD,ZSCAFLASWD +REAL, DIMENSION(:, :,:), ALLOCATABLE :: ZDIRSRFSWD +! +INTEGER :: IINFO_ll, IDIMX, IDIMY ! size of intermediate arrays +INTEGER :: IHALO ! band size where relaxation is not performed +LOGICAL :: LINTER ! flag for intersection or not with the child domain +INTEGER :: IMI ! Current model index KMI==NDAD(IMI) +! +INTEGER :: IIBC,IJBC,IIEC,IJEC +! +!------------------------------------------------------------------------------- +! +!* 1. PROLOGUE: +! +IMI = GET_CURRENT_MODEL_INDEX() +! +CALL GO_TOMODEL_ll(IMI, IINFO_ll) +CALL GET_INDICE_ll(IIB,IJB,IIE,IJE) +! +CALL GO_TOMODEL_ll(KMI, IINFO_ll) +CALL GET_CHILD_DIM_ll(IMI, IDIMX, IDIMY, IINFO_ll) +! +! here we need to go back to SON domain for boundaries test +CALL GO_TOMODEL_ll(IMI, IINFO_ll) +! +IKU = SIZE(PTHM,3) +IKB = JPVEXT+1 +! +IDXRATIO = NDXRATIO_ALL(IMI) +IDYRATIO = NDYRATIO_ALL(IMI) +! +IRR = MIN(KRR,NRR) +ISV_USER = MIN(NSV_USER_A(KMI),NSV_USER_A(IMI)) +! +! 1.1 Allocate array of horizontal average fields +! +ALLOCATE(ZTUM(IDIMX, IDIMY, SIZE(PUM, 3))) +ALLOCATE(ZTVM(IDIMX, IDIMY, SIZE(PUM, 3))) +ALLOCATE(ZTWM(IDIMX, IDIMY, SIZE(PUM, 3))) +ALLOCATE(ZTTHM(IDIMX, IDIMY, SIZE(PUM, 3))) +IF (IRR /= 0) THEN + ALLOCATE(ZTRM(IDIMX, IDIMY, SIZE(PUM, 3),IRR)) + ELSE + ALLOCATE(ZTRM(0,0,0,0)) +ENDIF +IF (KSV /= 0) THEN + ALLOCATE(ZTSVM(IDIMX, IDIMY, SIZE(PUM, 3),KSV)) +ELSE + ALLOCATE(ZTSVM(0,0,0,0)) +ENDIF +! +IF (LUSERC .AND. ( (LSEDIC .AND. CCLOUD(1:3) == 'ICE') .OR. & + (LSEDC .AND. (CCLOUD == 'C2R2' .OR. CCLOUD == 'KHKO')) .OR.& + (NSEDC .AND. CCLOUD == 'LIMA') )) THEN + ALLOCATE(ZTINPRC(IDIMX, IDIMY)) +ELSE + ALLOCATE(ZTINPRC(0,0)) +ENDIF +IF (LUSERR) THEN + ALLOCATE(ZTINPRR(IDIMX, IDIMY)) +ELSE + ALLOCATE(ZTINPRR(0,0)) +ENDIF +IF (LUSERS) THEN + ALLOCATE(ZTINPRS(IDIMX, IDIMY)) +ELSE + ALLOCATE(ZTINPRS(0,0)) +ENDIF +IF (LUSERG) THEN + ALLOCATE(ZTINPRG(IDIMX, IDIMY)) +ELSE + ALLOCATE(ZTINPRG(0,0)) +ENDIF +IF (LUSERH) THEN + ALLOCATE(ZTINPRH(IDIMX, IDIMY)) +ELSE + ALLOCATE(ZTINPRH(0,0)) +ENDIF +IF (CDCONV /= 'NONE') THEN + ALLOCATE(ZTPRCONV (IDIMX, IDIMY)) + ALLOCATE(ZTPRSCONV(IDIMX, IDIMY)) + ELSE + ALLOCATE(ZTPRCONV (0,0)) + ALLOCATE(ZTPRSCONV(0,0)) +END IF +IF (CRAD /= 'NONE') THEN + ALLOCATE(ZTDIRFLASWD(IDIMX, IDIMY, SIZE(PDIRFLASWD,3))) + ALLOCATE(ZTSCAFLASWD(IDIMX, IDIMY, SIZE(PSCAFLASWD,3))) + ALLOCATE(ZTDIRSRFSWD(IDIMX, IDIMY, SIZE(PDIRSRFSWD,3))) +ELSE + ALLOCATE(ZTDIRFLASWD(0,0,0)) + ALLOCATE(ZTSCAFLASWD(0,0,0)) + ALLOCATE(ZTDIRSRFSWD(0,0,0)) +ENDIF +! +ALLOCATE(ZTRHODJ (IDIMX, IDIMY, SIZE(PUM, 3))) +ALLOCATE(ZTRHODJU(IDIMX, IDIMY, SIZE(PUM, 3))) +ALLOCATE(ZTRHODJV(IDIMX, IDIMY, SIZE(PUM, 3))) +! +! +ZK2W = 1. / (PTSTEP * NDT_2_WAY(NDAD(IMI))) +! +!------------------------------------------------------------------------------- +! +!* 2. AVERAGE OF SCALAR VARIABLES +! --------------------------- +! +IIBC=JPHEXT+2 +IIEC=IDIMX-JPHEXT-1 +IJBC=JPHEXT+2 +IJEC=IDIMY-JPHEXT-1 +! +!* 2.1 summation of rhodj +! +ZTRHODJ(:,:,:) = 0. +DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTRHODJ(IIBC:IIEC,IJBC:IJEC,:) = ZTRHODJ(IIBC:IIEC,IJBC:IJEC,:) & + +XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:) + END DO +END DO +! +!* 2.2 temperature +! +ZTTHM(:,:,:) = 0. +DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTTHM(IIBC:IIEC,IJBC:IJEC,:) = ZTTHM(IIBC:IIEC,IJBC:IJEC,:) & + +XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:) & + *XTHT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:) +! + END DO +END DO +! +! +!* 2.5 moist variables +! +DO JVAR=1,IRR + ZTRM(:,:,:,JVAR) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTRM(IIBC:IIEC,IJBC:IJEC,:,JVAR) = ZTRM(IIBC:IIEC,IJBC:IJEC,:,JVAR) & + +XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:) & + *XRT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:,JVAR) + END DO + END DO +END DO +! +!* 2.6 scalar variables SV +! +! User scalar variables +IF (KSV /= 0) THEN + DO JVAR=1,ISV_USER + ZTSVM(:,:,:,JVAR) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR) = ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR) & + +XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:) & + *XSVT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:,JVAR) + END DO + END DO + END DO +! C2R2 scalar variables +IF (NSV_C2R2_A(IMI) > 0) THEN + ! nested model uses C2R2 microphysical scheme + DO JVAR=1,NSV_C2R2_A(KMI) + ZTSVM(:,:,:,JVAR-1+NSV_C2R2BEG_A(KMI)) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_C2R2BEG_A(KMI)) = & + &ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_C2R2BEG_A(KMI))+& + &XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:)*& + &XSVT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:,JVAR-1+NSV_C2R2BEG_A(IMI)) + END DO + END DO + END DO +END IF +! C1R3 scalar variables +IF (NSV_C1R3_A(IMI) > 0) THEN + ! nested model uses C1R3 microphysical scheme + DO JVAR=1,NSV_C1R3_A(KMI) + ZTSVM(:,:,:,JVAR-1+NSV_C1R3BEG_A(KMI)) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_C1R3BEG_A(KMI)) = & + &ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_C1R3BEG_A(KMI))+& + &XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:)*& + &XSVT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:,JVAR-1+NSV_C1R3BEG_A(IMI)) + END DO + END DO + END DO +END IF +! LIMA scalar variables +IF (NSV_LIMA_A(IMI) > 0) THEN + ! nested model uses LIMA microphysical scheme + DO JVAR=1,NSV_LIMA_A(KMI) + ZTSVM(:,:,:,JVAR-1+NSV_LIMA_BEG_A(KMI)) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_LIMA_BEG_A(KMI)) = & + &ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_LIMA_BEG_A(KMI))+& + &XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:)*& + &XSVT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:,JVAR-1+NSV_LIMA_BEG_A(IMI)) + END DO + END DO + END DO +END IF +! Electrical scalar variables +IF (NSV_ELEC_A(IMI) > 0) THEN + ! nested model uses electrical scheme + DO JVAR=1,NSV_ELEC_A(KMI) + ZTSVM(:,:,:,JVAR-1+NSV_ELECBEG_A(KMI)) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_ELECBEG_A(KMI)) = & + &ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_ELECBEG_A(KMI))+& + &XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:)*& + &XSVT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:,JVAR-1+NSV_ELECBEG_A(IMI)) + END DO + END DO + END DO +END IF +! Chemical scalar variables +DO JVAR=1,NSV_CHEM_A(KMI) + ZTSVM(:,:,:,JVAR-1+NSV_CHEMBEG_A(KMI)) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_CHEMBEG_A(KMI)) = & + &ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_CHEMBEG_A(KMI))+& + &XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:)*& + &XSVT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:,JVAR-1+NSV_CHEMBEG_A(IMI)) + END DO + END DO +END DO +! Ice phase chemical scalar variables +IF (NSV_CHIC_A(IMI) > 0) THEN + ! nested model uses aqueous chemistry and ice3/4 scheme + DO JVAR=1,NSV_CHIC_A(KMI) + ZTSVM(:,:,:,JVAR-1+NSV_CHICBEG_A(KMI)) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_CHICBEG_A(KMI)) = & + &ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_CHICBEG_A(KMI))+& + &XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:)*& + &XSVT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:,JVAR-1+NSV_CHICBEG_A(IMI)) + END DO + END DO + END DO +END IF +! NOX variables +DO JVAR=1,NSV_LNOX_A(KMI) + ZTSVM(:,:,:,JVAR-1+NSV_LNOXBEG_A(KMI)) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_LNOXBEG_A(KMI)) = & + &ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_LNOXBEG_A(KMI))+& + &XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:)*& + &XSVT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:,JVAR-1+NSV_LNOXBEG_A(IMI)) + END DO + END DO +END DO +! Orilam scalar variables +DO JVAR=1,NSV_AER_A(KMI) + ZTSVM(:,:,:,JVAR-1+NSV_AERBEG_A(KMI)) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_AERBEG_A(KMI)) = & + &ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_AERBEG_A(KMI))+& + &XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:)*& + &XSVT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:,JVAR-1+NSV_AERBEG_A(IMI)) + END DO + END DO +END DO +DO JVAR=1,NSV_AERDEP_A(KMI) + ZTSVM(:,:,:,JVAR-1+NSV_AERDEPBEG_A(KMI)) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_AERDEPBEG_A(KMI)) = & + &ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_AERDEPBEG_A(KMI))+& + &XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:)*& + &XSVT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:,JVAR-1+NSV_AERDEPBEG_A(IMI)) + END DO + END DO +END DO +! Dust scalar variables +DO JVAR=1,NSV_DST_A(KMI) + ZTSVM(:,:,:,JVAR-1+NSV_DSTBEG_A(KMI)) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_DSTBEG_A(KMI)) = & + &ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_DSTBEG_A(KMI))+& + &XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:)*& + &XSVT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:,JVAR-1+NSV_DSTBEG_A(IMI)) + END DO + END DO +END DO +DO JVAR=1,NSV_DSTDEP_A(KMI) + ZTSVM(:,:,:,JVAR-1+NSV_DSTDEPBEG_A(KMI)) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_DSTDEPBEG_A(KMI)) = & + &ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_DSTDEPBEG_A(KMI))+& + &XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:)*& + &XSVT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:,JVAR-1+NSV_DSTDEPBEG_A(IMI)) + END DO + END DO +END DO +! Salt scalar variables +DO JVAR=1,NSV_SLT_A(KMI) + ZTSVM(:,:,:,JVAR-1+NSV_SLTBEG_A(KMI)) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_SLTBEG_A(KMI)) = & + &ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_SLTBEG_A(KMI))+& + &XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:)*& + &XSVT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:,JVAR-1+NSV_SLTBEG_A(IMI)) + END DO + END DO +END DO +DO JVAR=1,NSV_SLTDEP_A(KMI) + ZTSVM(:,:,:,JVAR-1+NSV_SLTDEPBEG_A(KMI)) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_SLTDEPBEG_A(KMI)) = & + &ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_SLTDEPBEG_A(KMI))+& + &XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:)*& + &XSVT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:,JVAR-1+NSV_SLTDEPBEG_A(IMI)) + END DO + END DO +END DO +! lagrangian variables +DO JVAR=1,NSV_LG_A(KMI) + ZTSVM(:,:,:,JVAR-1+NSV_LGBEG_A(KMI)) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_LGBEG_A(KMI)) = & + &ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_LGBEG_A(KMI))+& + &XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:)*& + &XSVT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:,JVAR-1+NSV_LGBEG_A(IMI)) + END DO + END DO +END DO +END IF +! Passive scalar variables +IF (NSV_PP_A(IMI) > 0) THEN +DO JVAR=1,NSV_PP_A(KMI) + ZTSVM(:,:,:,JVAR-1+NSV_PPBEG_A(KMI)) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_PPBEG_A(KMI)) = & + &ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_PPBEG_A(KMI))+& + &XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:)*& + &XSVT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:,JVAR-1+NSV_PPBEG_A(IMI)) + END DO + END DO +END DO +END IF +#ifdef MNH_FOREFIRE +! ForeFire variables +IF (NSV_FF_A(IMI) > 0) THEN +DO JVAR=1,NSV_FF_A(KMI) + ZTSVM(:,:,:,JVAR-1+NSV_FFBEG_A(KMI)) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_FFBEG_A(KMI)) = & + &ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_FFBEG_A(KMI))+& + &XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:)*& + &XSVT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:,JVAR-1+NSV_FFBEG_A(IMI)) + END DO + END DO +END DO +END IF +#endif +! Conditional sampling variables +IF (NSV_CS_A(IMI) > 0) THEN +DO JVAR=1,NSV_CS_A(KMI) + ZTSVM(:,:,:,JVAR-1+NSV_CSBEG_A(KMI)) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_CSBEG_A(KMI)) = & + &ZTSVM(IIBC:IIEC,IJBC:IJEC,:,JVAR-1+NSV_CSBEG_A(KMI))+& + &XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:)*& + &XSVT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:,JVAR-1+NSV_CSBEG_A(IMI)) + END DO + END DO +END DO +END IF +! Precipitating variables + IF (LUSERR) THEN + ZTINPRR(:,:) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTINPRR(IIBC:IIEC,IJBC:IJEC) = ZTINPRR(IIBC:IIEC,IJBC:IJEC) & + +XINPRR(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO) + END DO + END DO + ZTINPRR(IIBC:IIEC,IJBC:IJEC)=ZTINPRR(IIBC:IIEC,IJBC:IJEC)/(IDXRATIO*IDYRATIO) + END IF +! + IF (LUSERC .AND. ((LSEDIC .AND. CCLOUD(1:3) == 'ICE') .OR. & + (LSEDC .AND. (CCLOUD == 'C2R2' .OR. CCLOUD == 'KHKO')) .OR.& + (NSEDC .AND. CCLOUD == 'LIMA') )) THEN + ZTINPRC(:,:) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTINPRC(IIBC:IIEC,IJBC:IJEC) = ZTINPRC(IIBC:IIEC,IJBC:IJEC) & + +XINPRC(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO) + END DO + END DO + ZTINPRC(IIBC:IIEC,IJBC:IJEC)=ZTINPRC(IIBC:IIEC,IJBC:IJEC)/(IDXRATIO*IDYRATIO) + END IF +! + IF (LUSERS) THEN + ZTINPRS(:,:) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTINPRS(IIBC:IIEC,IJBC:IJEC) = ZTINPRS(IIBC:IIEC,IJBC:IJEC) & + +XINPRS(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO) + END DO + END DO + ZTINPRS(IIBC:IIEC,IJBC:IJEC) = ZTINPRS(IIBC:IIEC,IJBC:IJEC)/(IDXRATIO*IDYRATIO) + END IF +! + IF (LUSERG) THEN + ZTINPRG(:,:) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTINPRG(IIBC:IIEC,IJBC:IJEC) = ZTINPRG(IIBC:IIEC,IJBC:IJEC) & + +XINPRG(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO) + END DO + END DO + ZTINPRG(IIBC:IIEC,IJBC:IJEC) =ZTINPRG(IIBC:IIEC,IJBC:IJEC)/(IDXRATIO*IDYRATIO) + END IF +! + IF (LUSERH) THEN + ZTINPRH(:,:) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTINPRH(IIBC:IIEC,IJBC:IJEC) = ZTINPRH(IIBC:IIEC,IJBC:IJEC) & + +XINPRH(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO) + END DO + END DO + ZTINPRH(IIBC:IIEC,IJBC:IJEC) =ZTINPRH(IIBC:IIEC,IJBC:IJEC)/(IDXRATIO*IDYRATIO) + END IF +! + IF (CDCONV /= 'NONE') THEN + ZTPRCONV(:,:) = 0. + ZTPRSCONV(:,:) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTPRCONV(IIBC:IIEC,IJBC:IJEC) = ZTPRCONV(IIBC:IIEC,IJBC:IJEC) & + +XPRCONV(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO) + ZTPRSCONV(IIBC:IIEC,IJBC:IJEC) = ZTPRSCONV(IIBC:IIEC,IJBC:IJEC) & + +XPRSCONV(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO) + END DO + END DO + ZTPRCONV(IIBC:IIEC,IJBC:IJEC) = ZTPRCONV(IIBC:IIEC,IJBC:IJEC)/(IDXRATIO*IDYRATIO) + ZTPRSCONV(IIBC:IIEC,IJBC:IJEC) = ZTPRSCONV(IIBC:IIEC,IJBC:IJEC)/(IDXRATIO*IDYRATIO) + END IF +! Short Wave and Long Wave variables + IF (CRAD /= 'NONE') THEN + ZTDIRFLASWD(:,:,:) = 0. + ZTSCAFLASWD(:,:,:) = 0. + ZTDIRSRFSWD(:,:,:) = 0. + DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTDIRFLASWD(IIBC:IIEC,IJBC:IJEC,:) = ZTDIRFLASWD(IIBC:IIEC,IJBC:IJEC,:)& + +XDIRFLASWD(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:) + ZTSCAFLASWD(IIBC:IIEC,IJBC:IJEC,:) = ZTSCAFLASWD(IIBC:IIEC,IJBC:IJEC,:)& + +XSCAFLASWD(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:) + ZTDIRSRFSWD(IIBC:IIEC,IJBC:IJEC,:) = ZTDIRSRFSWD(IIBC:IIEC,IJBC:IJEC,:)& + +XDIRSRFSWD(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,:) + END DO + END DO + ZTDIRFLASWD(IIBC:IIEC,IJBC:IJEC,:) = ZTDIRFLASWD(IIBC:IIEC,IJBC:IJEC,:)/(IDXRATIO*IDYRATIO) + ZTSCAFLASWD(IIBC:IIEC,IJBC:IJEC,:) = ZTSCAFLASWD(IIBC:IIEC,IJBC:IJEC,:)/(IDXRATIO*IDYRATIO) + ZTDIRSRFSWD(IIBC:IIEC,IJBC:IJEC,:) = ZTDIRSRFSWD(IIBC:IIEC,IJBC:IJEC,:)/(IDXRATIO*IDYRATIO) + END IF +! +!------------------------------------------------------------------------------- +! +!* 3. AVERAGE OF WIND VARIABLES +! ------------------------- +! +!* 3.1 vertical wind W +! +ZTWM(:,:,:) = 0. +DO JX=1,IDXRATIO + DO JY=1,IDYRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTWM(IIBC:IIEC,IJBC:IJEC,IKB) = ZTWM(IIBC:IIEC,IJBC:IJEC,IKB) & + +2.*XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,IKB) & + *XWT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,IKB) +! + ZTWM(IIBC:IIEC,IJBC:IJEC,IKB+1:IKU) = ZTWM(IIBC:IIEC,IJBC:IJEC,IKB+1:IKU) & + +(XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,IKB+1:IKU ) & + + XRHODJ(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,IKB :IKU-1))& + *XWT(II1:II2:IDXRATIO,IJ1:IJ2:IDYRATIO,IKB+1:IKU) + END DO +END DO +! +!* 3.2 horizontal wind U +! +ZTRHODJU(:,:,:) = 0. +! +IF(LWEST_ll()) THEN + II1U = IIB+IDXRATIO !C grid + IWEST=JPHEXT+3 +ELSE + II1U = IIB + IWEST=JPHEXT+2 +ENDIF +! +II2 = IIE+1-IDXRATIO +! +DO JY=1,IDYRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTRHODJU(IWEST:IIEC,IJBC:IJEC,:) = ZTRHODJU(IWEST:IIEC,IJBC:IJEC,:) & + +XRHODJ(II1U :II2 :IDXRATIO,IJ1:IJ2:IDYRATIO,:) & + +XRHODJ(II1U-1:II2-1:IDXRATIO,IJ1:IJ2:IDYRATIO,:) +END DO +! +! +ZTUM(:,:,:) = 0. +DO JY=1,IDYRATIO + IJ1 = IJB+JY-1 + IJ2 = IJE+JY-IDYRATIO + ZTUM(IWEST:IIEC,IJBC:IJEC,:) = ZTUM(IWEST:IIEC,IJBC:IJEC,:) & + +(XRHODJ(II1U :II2 :IDXRATIO,IJ1:IJ2:IDYRATIO,:) & + +XRHODJ(II1U-1:II2-1:IDXRATIO,IJ1:IJ2:IDYRATIO,:)) & + *XUT(II1U :II2 :IDXRATIO,IJ1:IJ2:IDYRATIO,:) +END DO +! +! +!* 3.3 horizontal wind V +! +ZTRHODJV(:,:,:) = 0. +! +IF(LSOUTH_ll() .AND. .NOT. L2D) THEN + IJ1V = IJB+IDYRATIO !C grid + ISOUTH=JPHEXT+3 +ELSE + IJ1V = IJB + ISOUTH=JPHEXT+2 +ENDIF +! +IJ2 = IJE+1-IDYRATIO +! +DO JX=1,IDXRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + ZTRHODJV(IIBC:IIEC,ISOUTH:IJEC,:) = ZTRHODJV(IIBC:IIEC,ISOUTH:IJEC,:) & + +XRHODJ(II1:II2:IDXRATIO,IJ1V :IJ2 :IDYRATIO,:) & + +XRHODJ(II1:II2:IDXRATIO,IJ1V-1:IJ2-1:IDYRATIO,:) +END DO +! +! +ZTVM(:,:,:) = 0. +DO JX=1,IDXRATIO + II1 = IIB+JX-1 + II2 = IIE+JX-IDXRATIO + ZTVM(IIBC:IIEC,ISOUTH:IJEC,:) = ZTVM(IIBC:IIEC,ISOUTH:IJEC,:) & + +(XRHODJ(II1:II2:IDXRATIO,IJ1V :IJ2 :IDYRATIO,:) & + + XRHODJ(II1:II2:IDXRATIO,IJ1V-1:IJ2-1:IDYRATIO,:)) & + *XVT(II1:II2:IDXRATIO,IJ1V :IJ2 :IDYRATIO,:) +END DO +! +! +!* 4. EXCHANGE OF DATA +! ---------------- +! +! +CALL GO_TOMODEL_ll(IMI, IINFO_ll) +CALL GET_FEEDBACK_COORD_ll(IXOR,IYOR,IXEND,IYEND,IINFO_ll) ! physical domain's origine +! +! +IF (IINFO_ll == 0) THEN + LINTER=.TRUE. +ELSE + LINTER=.FALSE. +ENDIF +! +! Allocate array which will receive average child fields +! +IF (LINTER) THEN + ALLOCATE(ZUM(IXOR:IXEND,IYOR:IYEND, SIZE(PUM, 3))) + ALLOCATE(ZVM(IXOR:IXEND,IYOR:IYEND, SIZE(PUM, 3))) + ALLOCATE(ZWM(IXOR:IXEND,IYOR:IYEND, SIZE(PUM, 3))) + ALLOCATE(ZTHM(IXOR:IXEND,IYOR:IYEND, SIZE(PUM, 3))) + ALLOCATE(ZRHODJ (IXOR:IXEND,IYOR:IYEND, SIZE(PUM, 3))) + ALLOCATE(ZRHODJU(IXOR:IXEND,IYOR:IYEND, SIZE(PUM, 3))) + ALLOCATE(ZRHODJV(IXOR:IXEND,IYOR:IYEND, SIZE(PUM, 3))) + IF (IRR /= 0) THEN + ALLOCATE(ZRM(IXOR:IXEND,IYOR:IYEND, SIZE(PUM, 3),IRR)) + END IF + IF (KSV /= 0) THEN + ALLOCATE(ZSVM(IXOR:IXEND,IYOR:IYEND, SIZE(PUM, 3),KSV)) + ENDIF + IF (LUSERR) THEN + ALLOCATE(ZINPRR(IXOR:IXEND,IYOR:IYEND)) + ELSE + ALLOCATE(ZINPRR(0,0)) + END IF + IF (LUSERC .AND. ((LSEDIC .AND. CCLOUD(1:3) == 'ICE') .OR. & + (LSEDC .AND. (CCLOUD == 'C2R2' .OR. CCLOUD == 'KHKO')) .OR.& + (NSEDC .AND. CCLOUD == 'LIMA') )) THEN + ALLOCATE(ZINPRC(IXOR:IXEND,IYOR:IYEND)) + ELSE + ALLOCATE(ZINPRC(0,0)) + END IF + IF (LUSERS) THEN + ALLOCATE(ZINPRS(IXOR:IXEND,IYOR:IYEND)) + ELSE + ALLOCATE(ZINPRS(0,0)) + END IF + IF (LUSERG) THEN + ALLOCATE(ZINPRG(IXOR:IXEND,IYOR:IYEND)) + ELSE + ALLOCATE(ZINPRG(0,0)) + END IF + IF (LUSERH) THEN + ALLOCATE(ZINPRH(IXOR:IXEND,IYOR:IYEND)) + ELSE + ALLOCATE(ZINPRH(0,0)) + END IF + IF (CDCONV /= 'NONE') THEN + ALLOCATE(ZPRCONV(IXOR:IXEND,IYOR:IYEND)) + ALLOCATE(ZPRSCONV(IXOR:IXEND,IYOR:IYEND)) + ELSE + ALLOCATE(ZPRCONV(0,0)) + ALLOCATE(ZPRSCONV(0,0)) + END IF + IF (CRAD /= 'NONE') THEN + ALLOCATE(ZDIRFLASWD(IXOR:IXEND,IYOR:IYEND, SIZE(PDIRFLASWD, 3))) + ALLOCATE(ZSCAFLASWD(IXOR:IXEND,IYOR:IYEND, SIZE(PSCAFLASWD, 3))) + ALLOCATE(ZDIRSRFSWD(IXOR:IXEND,IYOR:IYEND, SIZE(PDIRSRFSWD, 3))) + ELSE + !3rd dimension size can also be allocated with a zero size + ALLOCATE( ZDIRFLASWD(0, 0, SIZE( PDIRFLASWD, 3 )) ) + ALLOCATE( ZSCAFLASWD(0, 0, SIZE( PSCAFLASWD, 3 )) ) + ALLOCATE( ZDIRSRFSWD(0, 0, SIZE( PDIRSRFSWD, 3 )) ) + ENDIF +ELSE + ALLOCATE(ZUM(0,0,0)) + ALLOCATE(ZVM(0,0,0)) + ALLOCATE(ZWM(0,0,0)) + ALLOCATE(ZTHM(0,0,0)) + IF (IRR /= 0) ALLOCATE(ZRM(0,0,0,IRR)) + IF (KSV /= 0) ALLOCATE(ZSVM(0,0,0,KSV)) + ALLOCATE(ZRHODJ (0,0,0)) + ALLOCATE(ZRHODJU(0,0,0)) + ALLOCATE(ZRHODJV(0,0,0)) + ALLOCATE(ZINPRC(0,0)) + ALLOCATE(ZINPRR(0,0)) + ALLOCATE(ZINPRS(0,0)) + ALLOCATE(ZINPRG(0,0)) + ALLOCATE(ZINPRH(0,0)) + ALLOCATE(ZPRCONV(0,0)) + ALLOCATE(ZPRSCONV(0,0)) + !3rd dimension of ZDIRFLASWD, ZSCAFLASWD and ZDIRSRFSWD is allocated with a not necessarily zero size + !because it needs to be to this size for the SET_LSFIELD_2WAY_ll loops if CRAD/='NONE' + ALLOCATE( ZDIRFLASWD(0, 0, SIZE( PDIRFLASWD, 3 )) ) + ALLOCATE( ZSCAFLASWD(0, 0, SIZE( PSCAFLASWD, 3 )) ) + ALLOCATE( ZDIRSRFSWD(0, 0, SIZE( PDIRSRFSWD, 3 )) ) +ENDIF +! +! Initialize the list for the forcing +! +CALL SET_LSFIELD_2WAY_ll(ZUM, ZTUM) +CALL SET_LSFIELD_2WAY_ll(ZVM, ZTVM) +CALL SET_LSFIELD_2WAY_ll(ZWM, ZTWM) +CALL SET_LSFIELD_2WAY_ll(ZTHM, ZTTHM) +DO JVAR=1,IRR + CALL SET_LSFIELD_2WAY_ll(ZRM(:,:,:,JVAR), ZTRM(:,:,:,JVAR)) +ENDDO +DO JVAR=1,KSV + CALL SET_LSFIELD_2WAY_ll(ZSVM(:,:,:,JVAR), ZTSVM(:,:,:,JVAR)) +ENDDO +IF (LUSERR) THEN + CALL SET_LSFIELD_2WAY_ll(ZINPRR , ZTINPRR) +END IF +! +IF (LUSERC .AND. ((LSEDIC .AND. CCLOUD(1:3) == 'ICE') .OR. & + (LSEDC .AND. (CCLOUD == 'C2R2' .OR. CCLOUD == 'KHKO')) .OR.& + (NSEDC .AND. CCLOUD == 'LIMA') )) THEN + CALL SET_LSFIELD_2WAY_ll(ZINPRC , ZTINPRC) +END IF +IF (LUSERS) THEN + CALL SET_LSFIELD_2WAY_ll(ZINPRS , ZTINPRS) +END IF +IF (LUSERG) THEN + CALL SET_LSFIELD_2WAY_ll(ZINPRG , ZTINPRG) +END IF +IF (LUSERH) THEN + CALL SET_LSFIELD_2WAY_ll(ZINPRH , ZTINPRH) +END IF +IF (CDCONV /= 'NONE') THEN + CALL SET_LSFIELD_2WAY_ll(ZPRCONV , ZTPRCONV) + CALL SET_LSFIELD_2WAY_ll(ZPRSCONV , ZTPRSCONV) +END IF +IF (CRAD /= 'NONE') THEN + DO JVAR = 1, SIZE( PDIRFLASWD, 3 ) + CALL SET_LSFIELD_2WAY_ll(ZDIRFLASWD(:,:,JVAR) , ZTDIRFLASWD(:,:,JVAR)) + END DO + DO JVAR = 1, SIZE( PSCAFLASWD, 3 ) + CALL SET_LSFIELD_2WAY_ll(ZSCAFLASWD(:,:,JVAR) , ZTSCAFLASWD(:,:,JVAR)) + END DO + DO JVAR = 1, SIZE( PDIRSRFSWD, 3 ) + CALL SET_LSFIELD_2WAY_ll(ZDIRSRFSWD(:,:,JVAR) , ZTDIRSRFSWD(:,:,JVAR)) + END DO +END IF +CALL SET_LSFIELD_2WAY_ll(ZRHODJ, ZTRHODJ) +CALL SET_LSFIELD_2WAY_ll(ZRHODJU, ZTRHODJU) +CALL SET_LSFIELD_2WAY_ll(ZRHODJV, ZTRHODJV) +! +CALL LS_FEEDBACK_ll(IINFO_ll) +CALL GO_TOMODEL_ll(KMI, IINFO_ll) +CALL UNSET_LSFIELD_2WAY_ll(IMI) +! +DEALLOCATE(ZTUM,ZTVM,ZTWM,ZTTHM,ZTRHODJ,ZTRHODJU,ZTRHODJV) +DEALLOCATE(ZTRM,ZTSVM) +DEALLOCATE(ZTINPRC,ZTINPRR,ZTINPRS,ZTINPRG,ZTINPRH,ZTPRCONV,ZTPRSCONV) +DEALLOCATE(ZTDIRFLASWD,ZTSCAFLASWD,ZTDIRSRFSWD) +! +IF (.NOT. LINTER) THEN ! no computation for the dad subdomain + DEALLOCATE(ZUM,ZVM,ZWM,ZTHM,ZRHODJ,ZRHODJU,ZRHODJV) + IF (IRR /= 0) DEALLOCATE(ZRM) + IF (KSV /= 0) DEALLOCATE(ZSVM) + DEALLOCATE(ZINPRC,ZINPRR,ZINPRS,ZINPRG,ZINPRH,ZPRCONV,ZPRSCONV) + DEALLOCATE(ZDIRFLASWD,ZSCAFLASWD,ZDIRSRFSWD) +RETURN +ENDIF +! +! +! 5. RELAXATION +! ----------- +! 5.1 Compute the bounds of relaxation area +! +IHALO=2 +!!$IF (JPHEXT/=1) STOP ! boundaries are hard coded supposing JPHEXT=1 +! +CALL GET_OR_ll('B',IXOR_ll,IYOR_ll) +CALL GET_DIM_EXT_ll('B',IXDIM,IYDIM) +! +IF(LWEST_ll()) THEN + IDIST=IXOR_ll+1-(NXOR_ALL(IMI)+1) ! comparison of first physical + ! points of subdomain and current processor +ELSE + IDIST=IXOR_ll+NHALO-(NXOR_ALL(IMI)+1)! comparison of first physical + ! points of subdomain and current processor +ENDIF +! +IF(IDIST<=0) THEN ! west side of the child domain + IXOR=IXOR+IHALO +ENDIF +! +IF(IDIST>=1 .AND. IDIST<=IHALO-1) THEN + IXOR=IXOR+IHALO-IDIST +ENDIF +! +! C grid for v component +IF(IDIST >=IHALO+1) IXORU=IXOR ! interior child domain +IF(IDIST>=1 .AND. IDIST<=IHALO) IXORU=IXOR+1 ! partial overlapping of the relaxation area +IF(IDIST<=0) IXORU=IXOR+1 +! +IF(LEAST_ll()) THEN + IDIST=(NXEND_ALL(IMI)-1)-(IXOR_ll-1+IXDIM-1) ! comparison of last physical + ! points of subdomain and current processor +ELSE + IDIST=(NXEND_ALL(IMI)-1)-(IXOR_ll-1+IXDIM-NHALO)! comparison of last physical + ! points of subdomain and current processor +ENDIF +! +IF(IDIST<=0) IXEND=IXEND-IHALO ! east side of the child domain +IF(IDIST>=1 .AND. IDIST<=IHALO-1) IXEND=IXEND-IHALO+IDIST +! +! +IF(.NOT.L2D) THEN + IF(LSOUTH_ll()) THEN + IDIST=IYOR_ll+1-(NYOR_ALL(IMI)+1)! comparison of first physical + ! points of subdomain and current processor + ELSE + IDIST=IYOR_ll+NHALO-(NYOR_ALL(IMI)+1)! comparison of first physical + ! points of subdomain and current processor + ENDIF +! + IF(IDIST<=0) THEN ! south side of the child domain + IYOR=IYOR+IHALO + ENDIF +! + IF(IDIST>=1 .AND. IDIST<=IHALO-1) THEN + IYOR=IYOR+IHALO-IDIST + ENDIF +! +! C grid for v component + IF(IDIST >=IHALO+1) IYORV=IYOR ! interior child domain + IF(IDIST>=1 .AND. IDIST<=IHALO) IYORV=IYOR+1 ! partial overlapping of the relaxation area + IF(IDIST<=0) IYORV=IYOR+1 +! +! +! + IF(LNORTH_ll()) THEN + IDIST=(NYEND_ALL(IMI)-1)-(IYOR_ll-1+IYDIM-1)! comparison of last physical + ! points of subdomain and current processor + ELSE + IDIST=(NYEND_ALL(IMI)-1)-(IYOR_ll-1+IYDIM-NHALO)! comparison of last physical + ! points of subdomain and current processor + ENDIF + IF(IDIST<=0) IYEND=IYEND-IHALO ! north side of the child domain + IF(IDIST>=1 .AND. IDIST<=IHALO-1) IYEND=IYEND-IHALO+IDIST +! +ELSE + IYORV=IYOR+1 ! no parallelized +ENDIF + +! at this point, IXOR:IXEND,IYOR:IYEND define the 2way area outside +! the relaxation area + IF (LUSERR) THEN + PINPRR(IXOR:IXEND,IYOR:IYEND)=ZINPRR(IXOR:IXEND,IYOR:IYEND) + ENDIF + IF (LUSERC .AND. ((LSEDIC .AND. CCLOUD(1:3) == 'ICE') .OR. & + (LSEDC .AND. (CCLOUD == 'C2R2' .OR. CCLOUD == 'KHKO')) .OR.& + (NSEDC .AND. CCLOUD == 'LIMA') )) THEN + PINPRC(IXOR:IXEND,IYOR:IYEND)=ZINPRC(IXOR:IXEND,IYOR:IYEND) + ENDIF + IF (LUSERS) THEN + PINPRS(IXOR:IXEND,IYOR:IYEND)=ZINPRS(IXOR:IXEND,IYOR:IYEND) + ENDIF + IF (LUSERG) THEN + PINPRG(IXOR:IXEND,IYOR:IYEND)=ZINPRG(IXOR:IXEND,IYOR:IYEND) + ENDIF + IF (LUSERH) THEN + PINPRH(IXOR:IXEND,IYOR:IYEND)=ZINPRH(IXOR:IXEND,IYOR:IYEND) + ENDIF + IF (CDCONV /= 'NONE') THEN + PPRCONV(IXOR:IXEND,IYOR:IYEND)=ZPRCONV(IXOR:IXEND,IYOR:IYEND) + PPRSCONV(IXOR:IXEND,IYOR:IYEND)=ZPRSCONV(IXOR:IXEND,IYOR:IYEND) + END IF + IF (CRAD /= 'NONE') THEN + PDIRFLASWD(IXOR:IXEND,IYOR:IYEND,:)=ZDIRFLASWD(IXOR:IXEND,IYOR:IYEND,:) + PSCAFLASWD(IXOR:IXEND,IYOR:IYEND,:)=ZSCAFLASWD(IXOR:IXEND,IYOR:IYEND,:) + PDIRSRFSWD(IXOR:IXEND,IYOR:IYEND,:)=ZDIRSRFSWD(IXOR:IXEND,IYOR:IYEND,:) + ENDIF + DEALLOCATE(ZINPRC,ZINPRR,ZINPRS,ZINPRG,ZINPRH,ZPRCONV,ZPRSCONV) + DEALLOCATE(ZDIRFLASWD,ZSCAFLASWD,ZDIRSRFSWD) +! +!* initialize the OMASKkids array +! +OMASKkids(IXOR:IXEND,IYOR:IYEND)=.TRUE. +! +! +! 5.2 relaxation computation +! +PRTHS(IXOR:IXEND,IYOR:IYEND,:) = PRTHS(IXOR:IXEND,IYOR:IYEND,:) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * ( PTHM(IXOR:IXEND,IYOR:IYEND,:) & + -ZTHM(IXOR:IXEND,IYOR:IYEND,:)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +! +DO JVAR=1,IRR + PRRS(IXOR:IXEND,IYOR:IYEND,:,JVAR) = PRRS(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * (PRM(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + -ZRM(IXOR:IXEND,IYOR:IYEND,:,JVAR)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +ENDDO +! +! User scalar variables +DO JVAR=1,ISV_USER + PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) = PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * (PSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + -ZSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +ENDDO +! C2R2 scalar variables +DO JVAR=NSV_C2R2BEG_A(KMI),NSV_C2R2END_A(KMI) + PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) = PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * (PSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + -ZSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +ENDDO +! C1R3 scalar variables +DO JVAR=NSV_C1R3BEG_A(KMI),NSV_C1R3END_A(KMI) + PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) = PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * (PSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + -ZSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +ENDDO +! LIMA scalar variables +DO JVAR=NSV_LIMA_BEG_A(KMI),NSV_LIMA_END_A(KMI) + PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) = PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * (PSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + -ZSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +ENDDO +! Electrical scalar variables +DO JVAR=NSV_ELECBEG_A(KMI),NSV_ELECEND_A(KMI) + PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) = PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * (PSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + -ZSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +ENDDO +! Chemical scalar variables +DO JVAR=NSV_CHEMBEG_A(KMI),NSV_CHEMEND_A(KMI) + PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) = PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * (PSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + -ZSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +ENDDO +! Ice phase chemical scalar variables +DO JVAR=NSV_CHICBEG_A(KMI),NSV_CHICEND_A(KMI) + PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) = PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * (PSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + -ZSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +ENDDO +! NOX variables +DO JVAR=NSV_LNOXBEG_A(KMI),NSV_LNOXEND_A(KMI) + PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) = PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * (PSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + -ZSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +ENDDO +! Orilam scalar variables +DO JVAR=NSV_AERBEG_A(KMI),NSV_AEREND_A(KMI) + PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) = PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * (PSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + -ZSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +ENDDO +DO JVAR=NSV_AERDEPBEG_A(KMI),NSV_AERDEPEND_A(KMI) + PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) = PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * (PSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + -ZSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +ENDDO +! Dust scalar variables +DO JVAR=NSV_DSTBEG_A(KMI),NSV_DSTEND_A(KMI) + PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) = PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * (PSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + -ZSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +ENDDO +DO JVAR=NSV_DSTDEPBEG_A(KMI),NSV_DSTDEPEND_A(KMI) + PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) = PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * (PSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + -ZSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +ENDDO +! Salt scalar variables +DO JVAR=NSV_SLTBEG_A(KMI),NSV_SLTEND_A(KMI) + PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) = PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * (PSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + -ZSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +ENDDO +DO JVAR=NSV_SLTDEPBEG_A(KMI),NSV_SLTDEPEND_A(KMI) + PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) = PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * (PSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + -ZSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +ENDDO +! Lagrangian scalar variables +DO JVAR=NSV_LGBEG_A(KMI),NSV_LGEND_A(KMI) + PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) = PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * (PSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + -ZSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +ENDDO +! Passive pollutant variables +DO JVAR=NSV_PPBEG_A(KMI),NSV_PPEND_A(KMI) + PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) = PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * (PSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + -ZSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +ENDDO +#ifdef MNH_FOREFIRE + +! ForeFire variables +DO JVAR=NSV_FFBEG_A(KMI),NSV_FFEND_A(KMI) + PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) = PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * (PSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + -ZSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +ENDDO +#endif +! Conditional sampling variables +DO JVAR=NSV_CSBEG_A(KMI),NSV_CSEND_A(KMI) + PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) = PRSVS(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + - ZK2W * PRHODJ(IXOR:IXEND,IYOR:IYEND,:) * (PSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR) & + -ZSVM(IXOR:IXEND,IYOR:IYEND,:,JVAR)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +ENDDO +! +ZRHODJ(IXOR:IXEND,IYOR:IYEND,IKB) = 2.*ZRHODJ(IXOR:IXEND,IYOR:IYEND,IKB) +ZRHODJ(IXOR:IXEND,IYOR:IYEND,IKB+1:IKU) = ZRHODJ(IXOR:IXEND,IYOR:IYEND,IKB+1:IKU) & + +ZRHODJ(IXOR:IXEND,IYOR:IYEND,IKB:IKU-1) +! +ZAVE_RHODJ=MZM(PRHODJ) +PRWS(IXOR:IXEND,IYOR:IYEND,:) = PRWS(IXOR:IXEND,IYOR:IYEND,:) & + - ZK2W * ZAVE_RHODJ(IXOR:IXEND,IYOR:IYEND,:) * ( PWM(IXOR:IXEND,IYOR:IYEND,:) & + -ZWM(IXOR:IXEND,IYOR:IYEND,:)/ZRHODJ(IXOR:IXEND,IYOR:IYEND,:) ) +! +ZAVE_RHODJ=MXM(PRHODJ) +PRUS(IXORU:IXEND,IYOR:IYEND,:) = PRUS(IXORU:IXEND,IYOR:IYEND,:) & + - ZK2W * ZAVE_RHODJ(IXORU:IXEND,IYOR:IYEND,:) * ( PUM(IXORU:IXEND,IYOR:IYEND,:) & + -ZUM(IXORU:IXEND,IYOR:IYEND,:)/ZRHODJU(IXORU:IXEND,IYOR:IYEND,:) ) +! +ZAVE_RHODJ=MYM(PRHODJ) +PRVS(IXOR:IXEND,IYORV:IYEND,:) = PRVS(IXOR:IXEND,IYORV:IYEND,:) & + - ZK2W * ZAVE_RHODJ(IXOR:IXEND,IYORV:IYEND,:) * ( PVM(IXOR:IXEND,IYORV:IYEND,:) & + -ZVM(IXOR:IXEND,IYORV:IYEND,:)/ZRHODJV(IXOR:IXEND,IYORV:IYEND,:) ) +! +DEALLOCATE(ZUM,ZVM,ZWM,ZTHM,ZRHODJ,ZRHODJU,ZRHODJV) +IF (IRR /= 0) DEALLOCATE(ZRM) +IF (KSV /= 0) DEALLOCATE(ZSVM) +!------------------------------------------------------------------------------ +! +END SUBROUTINE TWO_WAY_n diff --git a/src/mesonh/ext/ver_interp_field.f90 b/src/mesonh/ext/ver_interp_field.f90 new file mode 100644 index 0000000000000000000000000000000000000000..d0092e917c7f9f1ea3232c1eba012cccf5d80b71 --- /dev/null +++ b/src/mesonh/ext/ver_interp_field.f90 @@ -0,0 +1,327 @@ +!MNH_LIC Copyright 1997-2020 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_VER_INTERP_FIELD +!####################### +! +INTERFACE +! + SUBROUTINE VER_INTERP_FIELD(HTURB,KRR,KSV,PZZ_LS,PZZ, & + PUT,PVT,PWT,PTHVT,PRT,PHUT,PTKET,PSVT, & + PSRCT,PSIGS, & + PLSUM,PLSVM,PLSWM,PLSTHM,PLSRVM ) +! +CHARACTER (LEN=4), INTENT(IN) :: HTURB ! Kind of turbulence parameterization +INTEGER, INTENT(IN) :: KRR ! number of moist variables +INTEGER, INTENT(IN) :: KSV ! number of scalar variables +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ_LS ! initial 3D grid +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! new 3D grid +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PUT,PVT,PWT ! model 2 +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PTKET ! variables +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRT,PSVT ! at t +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PTHVT,PHUT ! +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSRCT,PSIGS ! secondary + ! prognostic variables + ! Larger Scale fields +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PLSUM, PLSVM, PLSWM ! Wind +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PLSTHM, PLSRVM ! Mass +END SUBROUTINE VER_INTERP_FIELD +! +END INTERFACE +! +END MODULE MODI_VER_INTERP_FIELD +! +! ########################################################################## + SUBROUTINE VER_INTERP_FIELD(HTURB,KRR,KSV,PZZ_LS,PZZ, & + PUT,PVT,PWT,PTHVT,PRT,PHUT,PTKET,PSVT, & + PSRCT,PSIGS, & + PLSUM,PLSVM,PLSWM,PLSTHM,PLSRVM ) +! ########################################################################## +! +!!**** *VER_INTERP_FIELD * - interpolate the 3D and LS 2D fields from one +!! vertical grid PZZ_LS to another PZZ +!! +!! PURPOSE +!! ------- +!! +!! +!!** METHOD +!! ------ +!! +!! +!! EXTERNAL +!! -------- +!! +!! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! REFERENCE +!! --------- +!! +!! Book1 of the documentation +!! SUBROUTINE VER_INTERP_FIELD (Book2 of the documentation) +!! +!! +!! AUTHOR +!! ------ +!! +!! V. Masson * METEO-FRANCE * +!! +!! MODIFICATIONS +!! ------------- +!! +!! Original 17/07/97 +!! 14/09/97 (V. Masson) Interpolation of relative humidity +!! 05/06 Remobe KEPS +!! 2014 (M.Faivre) +! P. Wautelet 20/05/2019: add name argument to ADDnFIELD_ll + new ADD4DFIELD_ll subroutine +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_CONF_n, ONLY : CONF_MODEL +USE MODD_TURB_n, ONLY: XTKEMIN +USE MODD_PARAMETERS +USE MODD_VER_INTERP_LIN +! +USE MODI_SHUMAN +USE MODI_COEF_VER_INTERP_LIN +USE MODI_VER_INTERP_LIN +!$20140709 +USE MODD_ARGSLIST_ll, ONLY : LIST_ll +USE MODD_FIELD_n ! modules relative to the outer model $n +USE MODD_LSFIELD_n +USE MODE_MPPDB +!$20140710 +USE MODE_ll +USE MODD_LBC_n +! +IMPLICIT NONE +! +!* 0.1 Declarations of dummy arguments : +! +! +CHARACTER (LEN=4), INTENT(IN) :: HTURB ! Kind of turbulence parameterization +INTEGER, INTENT(IN) :: KRR ! number of moist variables +INTEGER, INTENT(IN) :: KSV ! number of scalar variables +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ_LS ! initial 3D grid +REAL, DIMENSION(:,:,:), INTENT(IN) :: PZZ ! new 3D grid +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PUT,PVT,PWT ! model 2 +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PTKET ! variables +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PRT,PSVT ! at t +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PTHVT,PHUT ! +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PSRCT,PSIGS ! secondary + ! prognostic variables + ! Larger Scale fields +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PLSUM, PLSVM, PLSWM ! Wind +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PLSTHM, PLSRVM ! Mass +!* 0.2 Declarations of local variables +! +INTEGER :: JRR, JSV +INTEGER :: IKU +INTEGER :: IKB +REAL, DIMENSION(SIZE(PZZ_LS,1),SIZE(PZZ_LS,2),SIZE(PZZ_LS,3)) :: ZGRID1, ZGRID2 +!$20140709 +TYPE(LIST_ll), POINTER :: TZLSFIELD_ll ! list of LS fields +INTEGER :: IINFO_ll +!$20140710 +INTEGER JI,JJ,IIB,IJB,IIE,IJE +! +!------------------------------------------------------------------------------- +! +!* 1. Prologue +! -------- +! +IKU=SIZE(PZZ,3) +! +IKB=1+JPVEXT +!$20140710 +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +! +!------------------------------------------------------------------------------- +! +!* 2. variables which always exist +! ---------------------------- +! +!* 2.1 U component +! ----------- +! +!* shift of grids to mass points +ZGRID1(:,:,:)=MZF(PZZ_LS(:,:,:)) +ZGRID1(:,:,IKU)=2.*ZGRID1(:,:,IKU-1)-ZGRID1(:,:,IKU-2) +ZGRID2(:,:,:)=MZF(PZZ(:,:,:)) +ZGRID2(:,:,IKU)=2.*ZGRID2(:,:,IKU-1)-ZGRID2(:,:,IKU-2) +!* move the first physical level if above the target grid +ZGRID1(:,:,1:IKB)=MIN(ZGRID1(:,:,1:IKB),ZGRID2(:,:,1:IKB)) +!$20140710 +CALL MPPDB_CHECK3D(ZGRID1,"VERINTERPFIELDbefMXM:ZGRID1",PRECISION) +CALL MPPDB_CHECK3D(ZGRID2,"VERINTERPFIELDbefMXM:ZGRID2",PRECISION) +!* shift to U points +!$20140710pb with MXM,MYM: MPPDB pb +!$if cancel MXM, MYM then PUM,PVM are ok +ZGRID1(:,:,:)=MXM(ZGRID1(:,:,:)) +ZGRID2(:,:,:)=MXM(ZGRID2(:,:,:)) +DO JI=JPHEXT,1,-1 + ZGRID1(JI,:,:)=2.*ZGRID1(JI+1,:,:)-ZGRID1(JI+2,:,:) + ZGRID2(JI,:,:)=2.*ZGRID2(JI+1,:,:)-ZGRID2(JI+2,:,:) +ENDDO +!$20140710 update_halo +NULLIFY(TZLSFIELD_ll) +CALL ADD3DFIELD_ll( TZLSFIELD_ll, ZGRID1, 'VER_INTERP_FIELD::ZGRID1' ) +CALL ADD3DFIELD_ll( TZLSFIELD_ll, ZGRID2, 'VER_INTERP_FIELD::ZGRID2' ) +CALL UPDATE_HALO_ll(TZLSFIELD_ll,IINFO_ll) +CALL CLEANLIST_ll(TZLSFIELD_ll) +! +!$20140710 +CALL MPPDB_CHECK3D(ZGRID1,"VERINTERPFIELDaftMXM:ZGRID1",PRECISION) +CALL MPPDB_CHECK3D(ZGRID2,"VERINTERPFIELDaftMXM:ZGRID2",PRECISION) +! +!$20140710 add NKLIN and XCOEFLIN in COEF_VER_INTERP +CALL COEF_VER_INTERP_LIN(ZGRID1(:,:,:),ZGRID2(:,:,:)) +! +PUT (:,:,:) = VER_INTERP_LIN(PUT (:,:,:),NKLIN(:,:,:),XCOEFLIN(:,:,:)) +PLSUM (:,:,:) = VER_INTERP_LIN(PLSUM (:,:,:),NKLIN(:,:,:),XCOEFLIN(:,:,:)) +!$20140709 +CALL MPPDB_CHECK3D(PUT,"VERINTERPFIELD:PUT",PRECISION) +!$ +! +!* 2.2 V component +! ----------- +! +!* shift of grids to mass points +ZGRID1(:,:,:)=MZF(PZZ_LS(:,:,:)) +ZGRID1(:,:,IKU)=2.*ZGRID1(:,:,IKU-1)-ZGRID1(:,:,IKU-2) +ZGRID2(:,:,:)=MZF(PZZ(:,:,:)) +ZGRID2(:,:,IKU)=2.*ZGRID2(:,:,IKU-1)-ZGRID2(:,:,IKU-2) +!* move the first physical level if above the target grid +ZGRID1(:,:,1:IKB)=MIN(ZGRID1(:,:,1:IKB),ZGRID2(:,:,1:IKB)) +!* shift to V points + +ZGRID1(:,:,:)=MYM(ZGRID1(:,:,:)) +ZGRID2(:,:,:)=MYM(ZGRID2(:,:,:)) +DO JJ=JPHEXT,1,-1 + ZGRID1(:,JJ,:)=2.*ZGRID1(:,JJ+1,:)-ZGRID1(:,JJ+2,:) + ZGRID2(:,JJ,:)=2.*ZGRID2(:,JJ+1,:)-ZGRID2(:,JJ+2,:) +ENDDO +!$20140711 updatehalo(zg1,2) also here +NULLIFY(TZLSFIELD_ll) +CALL ADD3DFIELD_ll( TZLSFIELD_ll, ZGRID1, 'VER_INTERP_FIELD::ZGRID1' ) +CALL ADD3DFIELD_ll( TZLSFIELD_ll, ZGRID2, 'VER_INTERP_FIELD::ZGRID2' ) +CALL UPDATE_HALO_ll(TZLSFIELD_ll,IINFO_ll) +CALL CLEANLIST_ll(TZLSFIELD_ll) +!$ +CALL COEF_VER_INTERP_LIN(ZGRID1(:,:,:),ZGRID2(:,:,:)) +! +!$20140710 +CALL MPPDB_CHECK3D(XCOEFLIN,"VERINTERPFIELDaftVerinterplin:XCOEFLIN",PRECISION) +PVT (:,:,:) = VER_INTERP_LIN(PVT (:,:,:),NKLIN(:,:,:),XCOEFLIN(:,:,:)) +PLSVM (:,:,:) = VER_INTERP_LIN(PLSVM (:,:,:),NKLIN(:,:,:),XCOEFLIN(:,:,:)) +!$20140710 +CALL MPPDB_CHECK3D(PVT,"VERINTERPFIELDaftVerinterplin:PVT",PRECISION) +! +!* 2.3 W component +! ----------- +! +ZGRID1(:,:,:)=PZZ_LS(:,:,:) +ZGRID2(:,:,:)=PZZ (:,:,:) +!* move the first physical level if above the target grid +ZGRID1(:,:,1:IKB)=MIN(ZGRID1(:,:,1:IKB),ZGRID2(:,:,1:IKB)) +! +CALL COEF_VER_INTERP_LIN(ZGRID1(:,:,:),ZGRID2(:,:,:)) +! +PWT (:,:,:) = VER_INTERP_LIN(PWT (:,:,:),NKLIN(:,:,:),XCOEFLIN(:,:,:)) +PLSWM (:,:,:) = VER_INTERP_LIN(PLSWM (:,:,:),NKLIN(:,:,:),XCOEFLIN(:,:,:)) +! +!* 2.4 thermodynamical variables +! ------------------------- +! +!* shift of grids to mass points +ZGRID1(:,:,:)=MZF(PZZ_LS(:,:,:)) +ZGRID1(:,:,IKU)=2.*ZGRID1(:,:,IKU-1)-ZGRID1(:,:,IKU-2) +ZGRID2(:,:,:)=MZF(PZZ(:,:,:)) +ZGRID2(:,:,IKU)=2.*ZGRID2(:,:,IKU-1)-ZGRID2(:,:,IKU-2) +! +CALL COEF_VER_INTERP_LIN(ZGRID1(:,:,:),ZGRID2(:,:,:)) +! +PTHVT (:,:,:) = VER_INTERP_LIN(PTHVT (:,:,:),NKLIN(:,:,:),XCOEFLIN(:,:,:)) +PLSTHM(:,:,:) = VER_INTERP_LIN(PLSTHM(:,:,:),NKLIN(:,:,:),XCOEFLIN(:,:,:)) +! +IF ( SIZE(PLSRVM,1) /= 0 ) THEN + PLSRVM(:,:,:) = VER_INTERP_LIN(PLSRVM(:,:,:),NKLIN(:,:,:),XCOEFLIN(:,:,:)) + PLSRVM=MAX(PLSRVM,0.) +END IF +! +!------------------------------------------------------------------------------- +! +!* 3. moist variables +! --------------- +! +DO JRR=1,KRR + PRT (:,:,:,JRR) = VER_INTERP_LIN(PRT (:,:,:,JRR),NKLIN(:,:,:),XCOEFLIN(:,:,:)) + PRT (:,:,:,JRR) = MAX(PRT(:,:,:,JRR),0.) +END DO +! +IF (CONF_MODEL(1)%NRR>=1) THEN + PHUT(:,:,:) = VER_INTERP_LIN(PHUT (:,:,:),NKLIN(:,:,:),XCOEFLIN(:,:,:)) + PHUT(:,:,:) = MIN(MAX(PHUT(:,:,:),0.),100.) +END IF +! +!------------------------------------------------------------------------------- +! +!* 4. scalar variables +! ---------------- +! +DO JSV=1,KSV + PSVT (:,:,:,JSV) = VER_INTERP_LIN(PSVT (:,:,:,JSV),NKLIN(:,:,:),XCOEFLIN(:,:,:)) + PSVT (:,:,:,JSV) = MAX(PSVT(:,:,:,JSV),0.) +END DO +! +!------------------------------------------------------------------------------- +! +!* 5. TKE variable +! ------------ +! +!* shift of grids to mass points +ZGRID1(:,:,:)=MZF(PZZ_LS(:,:,:)) +ZGRID1(:,:,IKU)=2.*ZGRID1(:,:,IKU-1)-ZGRID1(:,:,IKU-2) +ZGRID2(:,:,:)=MZF(PZZ(:,:,:)) +ZGRID2(:,:,IKU)=2.*ZGRID2(:,:,IKU-1)-ZGRID2(:,:,IKU-2) +!* move the first physical level if above the target grid +ZGRID1(:,:,1:IKB)=MIN(ZGRID1(:,:,1:IKB),ZGRID2(:,:,1:IKB)) +! +CALL COEF_VER_INTERP_LIN(ZGRID1(:,:,:),ZGRID2(:,:,:)) +! +IF (HTURB /= 'NONE') THEN + PTKET(:,:,:) = VER_INTERP_LIN(PTKET (:,:,:),NKLIN(:,:,:),XCOEFLIN(:,:,:)) + PTKET=MAX(PTKET,XTKEMIN) +ENDIF +! +! +!------------------------------------------------------------------------------- +! +!* 6. secondary prognostic variables +! ------------------------------ +! +IF (KRR > 1 .AND. HTURB /= 'NONE') THEN + PSRCT (:,:,:) = VER_INTERP_LIN(PSRCT (:,:,:),NKLIN(:,:,:),XCOEFLIN(:,:,:)) + PSIGS (:,:,:) = VER_INTERP_LIN(PSIGS (:,:,:),NKLIN(:,:,:),XCOEFLIN(:,:,:)) +ENDIF +! +!------------------------------------------------------------------------------- +! +DEALLOCATE(NKLIN) +DEALLOCATE(XCOEFLIN) +!------------------------------------------------------------------------------- +! +END SUBROUTINE VER_INTERP_FIELD +! diff --git a/src/mesonh/ext/write_desfmn.f90 b/src/mesonh/ext/write_desfmn.f90 new file mode 100644 index 0000000000000000000000000000000000000000..75559dfcb77b974c1ffb13aa791609fd1014b2e4 --- /dev/null +++ b/src/mesonh/ext/write_desfmn.f90 @@ -0,0 +1,714 @@ +!MNH_LIC Copyright 1994-2021 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_WRITE_DESFM_n +! ######################### +! +INTERFACE +! +SUBROUTINE WRITE_DESFM_n(KMI,TPDATAFILE) +! +USE MODD_IO, ONLY: TFILEDATA +! +INTEGER, INTENT(IN) :: KMI ! Model index +TYPE(TFILEDATA), INTENT(IN) :: TPDATAFILE ! Datafile +! +END SUBROUTINE WRITE_DESFM_n +! +END INTERFACE +! +END MODULE MODI_WRITE_DESFM_n +! +! +! ################################################### + SUBROUTINE WRITE_DESFM_n(KMI,TPDATAFILE) +! ################################################### +! +!!**** *WRITE_DESFM_n * - routine to write a descriptor file ( DESFM ) +!! +!! PURPOSE +!! ------- +! The purpose of this routine is to write the descriptive part of a Mesonh +! file (FM-file). The resulting file is called DESFM. +! +!! +!!** METHOD +!! ------ +!! +!! This routine writes in the file HDESFM, previously opened, the group of +!! all the namelists used to specify a Mesonh simulation. +!! If verbose option is high enough : NVERB>=5, the variables in descriptor +!! file are printed on the right output-listing corresponding tomodel _n. +!! +!! EXTERNAL +!! -------- +!! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! Module MODN_LUNIT_n : contains declarations of namelist NAM_LUNITn +!! and module MODD_LUNIT_n +!! +!! +!! Module MODN_CONF_n : contains declaration of namelist NAM_CONFn and +!! uses module MODD_CONF1 (configuration variables +!! for model _n ) +!! +!! Module MODN_DYN_n : contains declaration of namelist NAM_DYNn and +!! uses module MODD_DYN_n (dynamic control variables +!! for model _n ) +!! +!! Module MODN_ADV_n : contains declaration of namelist NAM_ADVn and +!! uses module MODD_ADV_n (control variables for the +!! advection scheme for model _n ) +!! +!! Module MODN_PARAM_n : contains declaration of namelist NAM_PARAMn and +!! uses module MODD_PARAM_n (names of the physical +!! parameterizations for model _n ) +!! +!! Module MODN_PARAM_RAD_n : contains declaration of the control parameters +!! for calling the radiation scheme +!! +!! Module MODN_PARAM_KAFR_n : contains declaration of control parameters +!! for calling the deep convection scheme +!! +!! Module MODN_LBC_n : contains declaration of namelis NAM_LBCn and +!! uses module MODD_LBC_n (lateral boundary conditions) +!! +!! +!! Module MODN_TURB_n : contains declaration of turbulence scheme options +!! present in the namelist +!! +!! Module MODN_CONF : contains declaration of namelist NAM_CONF and +!! uses module MODD_CONF (configuration variables) +!! +!! Module MODN_DYN : contains the declaration of namelist NAM_DYN and +!! uses module MODD_DYN (dynamic control variables) +!! +!! Module MODN_BUDGET : contains declaration of all the namelists +!! related to the budget computations +!! +!! Module MODN_LES : contains declaration of the control parameters +!! for Large Eddy Simulations' storages +!! Module MODN_BLANK_n : contains declaration of MesoNH developper variables +!! for test and debugging purposes. +!! +!! +!! REFERENCE +!! --------- +!! None +!! +!! +!! AUTHOR +!! ------ +!! V. Ducrocq * Meteo France * +!! +!! MODIFICATIONS +!! ------------- +!! Original 07/06/94 +!! Updated V.Ducrocq 06/09/94 +!! Updated J.Stein 20/10/94 to include NAM_OUTn +!! Updated J.Stein 24/10/94 change routine name +!! Updated J.Stein 26/10/94 add the OWRIGET argument +!! Updated J.Stein 06/12/94 add the LS fields +!! Updated J.Stein 09/01/95 add the turbulence scheme +!! Updated J.Stein 09/01/95 add the 1D switch +!! Updated J.Stein 20/03/95 remove R from the historical var. +!! Updated Ph.Hereil 20/06/95 add the budgets +!! Updated J.-P. Pinty 15/09/95 add the radiations +!! Updated J.Vila 06/02/96 implementation of scalar +!! advection schemes +!! Updated J.Stein 20/02/96 cleaning + add the LES namelist +!! Modifications 25/04/96 (Suhre) add NAM_BLANK +!! Modifications 25/04/96 (Suhre) add NAM_FRC +!! Modifications 25/04/96 (Suhre) add NAM_CH_MNHCn and NAM_CH_SOLVER +!! Modifications 11/04/96 (Pinty) add the ice concentration +!! Modifications 11/01/97 (Pinty) add the deep convection +!! Temporary Modification (Masson 06/09/96) manual write of the first and +!! third namelists because of compiler version. +!! Modifications J.-P. Lafore 22/07/96 gridnesting implementation +!! Modifications J.-P. Lafore 29/07/96 add NAM_FMOUT (renamed in NAM_OUTPUT/NAM_BACKUP) +!! Modifications V. Masson 10/07/97 add NAM_PARAM_GROUNDn +!! Modifications V. Masson 28/07/97 supress LSTEADY_DMASS +!! Modifications P. Jabouille 03/10/01 LHORELAX_ modifications +!! Modifications P. Jabouille 12/03/02 conditional writing of namelists +!! Modifications J.-P. Pinty 29/11/02 add C3R5, ICE2, ICE4, CELEC +!! Modification V. Masson 01/2004 removes surface (externalization) +!! Modification P. Tulet 01/2005 add dust, orilam +!! Modification 05/2006 Remove EPS and OWRIGET +!! Modification 01/2016 (JP Pinty) Add LIMA +!! 02/2018 Q.Libois ECRAD +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +!! Modification V. Vionnet 07/2017 add blowing snow variables +!! Modification F.Auguste 02/2021 add IBM +!! E.Jezequel 02/2021 add stations read from CSV file +!! Modification A. Costes 12/2021 add Blaze fire model +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +USE MODD_CONF +USE MODD_DYN_n, ONLY: LHORELAX_SVLIMA, LHORELAX_SVFIRE +USE MODD_IO, ONLY: TFILEDATA +USE MODD_LUNIT_n, ONLY: TLUOUT +USE MODD_PARAMETERS +! +USE MODE_MSG +! +USE MODN_BACKUP +USE MODN_CONF +USE MODN_DYN +USE MODN_NESTING +USE MODN_OUTPUT +USE MODN_BUDGET +USE MODN_LES +USE MODN_DYN_n +USE MODN_ADV_n +USE MODN_PARAM_n +USE MODN_PARAM_RAD_n +USE MODN_PARAM_ECRAD_n +USE MODN_PARAM_KAFR_n +USE MODD_PARAM_MFSHALL_n, ONLY: PARAM_MFSHALLN_INIT +USE MODD_PARAM_ICE_n, ONLY: PARAM_ICEN_INIT +USE MODN_CONF_n +USE MODN_LUNIT_n +USE MODN_LBC_n +USE MODN_NUDGING_n +USE MODD_TURB_n, ONLY: TURBN_INIT +USE MODD_NEB_n, ONLY: NEBN_INIT +USE MODN_BLANK_n +USE MODN_FRC +USE MODN_CH_MNHC_n +USE MODN_CH_SOLVER_n +USE MODN_PARAM_C2R2 +USE MODN_PARAM_C1R3 +USE MODN_PARAM_LIMA +USE MODN_ELEC +USE MODN_SERIES +USE MODN_SERIES_n +USE MODN_TURB_CLOUD +USE MODN_CH_ORILAM +USE MODN_DUST +USE MODN_SALT +USE MODN_PASPOL +USE MODN_CONDSAMP +USE MODN_2D_FRC +USE MODN_LATZ_EDFLX +#ifdef MNH_FOREFIRE +USE MODN_FOREFIRE +USE MODD_FOREFIRE_n, ONLY : FFCOUPLING +#endif +USE MODN_BLOWSNOW_n +USE MODN_BLOWSNOW +USE MODN_IBM_PARAM_n +USE MODN_RECYCL_PARAM_n +USE MODD_IBM_LSF, ONLY: LIBM_LSF +USE MODN_STATION_n +USE MODD_FIRE +USE MODN_FIRE +! +IMPLICIT NONE +! +!* 0.1 declarations of arguments +! +INTEGER, INTENT(IN) :: KMI ! Model index +TYPE(TFILEDATA), INTENT(IN) :: TPDATAFILE ! Datafile +! +!* 0.2 declarations of local variables +! +INTEGER :: ILUSEG ! logical unit number of EXSEG file +INTEGER :: ILUOUT ! Logical unit number for output-listing TLUOUT file +! +LOGICAL :: GHORELAX_UVWTH, & + GHORELAX_RV, GHORELAX_RC, GHORELAX_RR, & + GHORELAX_RI, GHORELAX_RS, GHORELAX_RG, & + GHORELAX_TKE, GHORELAX_SVC2R2, GHORELAX_SVPP, & + GHORELAX_SVCS, GHORELAX_SVCHIC, GHORELAX_SVFIRE,& +#ifdef MNH_FOREFIRE + GHORELAX_SVFF, & +#endif + GHORELAX_SVCHEM, GHORELAX_SVC1R3, & + GHORELAX_SVELEC, GHORELAX_SVLIMA,GHORELAX_SVSNW +LOGICAL :: GHORELAX_SVDST, GHORELAX_SVSLT, GHORELAX_SVAER +LOGICAL, DIMENSION(JPSVMAX) :: GHORELAX_SV +! +!------------------------------------------------------------------------------- +! +!* 1. UPDATE DESFM FILE +! ----------------- +! +CALL PRINT_MSG(NVERB_DEBUG,'IO','WRITE_DESFM_n','called for '//TRIM(TPDATAFILE%CNAME)) +! +IF (.NOT.ASSOCIATED(TPDATAFILE%TDESFILE)) & + CALL PRINT_MSG(NVERB_FATAL,'IO','WRITE_DESFM_n','TDESFILE not associated for '//TRIM(TPDATAFILE%CNAME)) +! +ILUSEG = TPDATAFILE%TDESFILE%NLU +! +CALL INIT_NAM_LUNITn +WRITE(UNIT=ILUSEG,NML=NAM_LUNITn) +IF (CPROGRAM/='MESONH') THEN + LUSECI=.FALSE. + NSV_USER = 0 +ENDIF +CALL INIT_NAM_CONFn +WRITE(UNIT=ILUSEG,NML=NAM_CONFn) +! +! +CALL INIT_NAM_DYNn +IF (CPROGRAM/='MESONH') THEN ! impose default value for next simulation + GHORELAX_UVWTH = LHORELAX_UVWTH + GHORELAX_RV = LHORELAX_RV + GHORELAX_RC = LHORELAX_RC + GHORELAX_RR = LHORELAX_RR + GHORELAX_RI = LHORELAX_RI + GHORELAX_RS = LHORELAX_RS + GHORELAX_RG = LHORELAX_RG + GHORELAX_TKE = LHORELAX_TKE + GHORELAX_SV(:) = LHORELAX_SV(:) + GHORELAX_SVC2R2= LHORELAX_SVC2R2 + GHORELAX_SVC1R3= LHORELAX_SVC1R3 + GHORELAX_SVLIMA= LHORELAX_SVLIMA + GHORELAX_SVELEC= LHORELAX_SVELEC + GHORELAX_SVCHEM= LHORELAX_SVCHEM + GHORELAX_SVCHIC= LHORELAX_SVCHIC + GHORELAX_SVDST = LHORELAX_SVDST + GHORELAX_SVSLT = LHORELAX_SVSLT + GHORELAX_SVPP = LHORELAX_SVPP + GHORELAX_SVFIRE = LHORELAX_SVFIRE +#ifdef MNH_FOREFIRE + GHORELAX_SVFF = LHORELAX_SVFF +#endif + GHORELAX_SVCS = LHORELAX_SVCS + GHORELAX_SVAER = LHORELAX_SVAER + GHORELAX_SVSNW = LHORELAX_SVSNW +! + LHORELAX_UVWTH = .FALSE. + LHORELAX_RV = .FALSE. + LHORELAX_RC = .FALSE. + LHORELAX_RR = .FALSE. + LHORELAX_RI = .FALSE. + LHORELAX_RS = .FALSE. + LHORELAX_RG = .FALSE. + LHORELAX_TKE = .FALSE. + LHORELAX_SV(:) = .FALSE. + LHORELAX_SVC2R2= .FALSE. + LHORELAX_SVC1R3= .FALSE. + LHORELAX_SVLIMA= .FALSE. + LHORELAX_SVELEC= .FALSE. + LHORELAX_SVCHEM= .FALSE. + LHORELAX_SVCHIC= .FALSE. + LHORELAX_SVLG = .FALSE. + LHORELAX_SVPP = .FALSE. + LHORELAX_SVFIRE = .FALSE. +#ifdef MNH_FOREFIRE + LHORELAX_SVFF = .FALSE. +#endif + LHORELAX_SVCS = .FALSE. + LHORELAX_SVDST= .FALSE. + LHORELAX_SVSLT= .FALSE. + LHORELAX_SVAER= .FALSE. + LHORELAX_SVSNW= .FALSE. +ELSE !return to namelist meaning of LHORELAX_SV + GHORELAX_SV(:) = LHORELAX_SV(:) + LHORELAX_SV(NSV_USER+1:)=.FALSE. +END IF +WRITE(UNIT=ILUSEG,NML=NAM_DYNn) +! +IF (LIBM_LSF) THEN + ! + CALL INIT_NAM_IBM_PARAMn + ! + WRITE(UNIT=ILUSEG,NML=NAM_IBM_PARAMn) + ! + IF (CPROGRAM/='MESONH') THEN + LIBM = .FALSE. + LIBM_TROUBLE = .FALSE. + CIBM_ADV = 'NOTHIN' + END IF + ! +END IF +! +CALL INIT_NAM_ADVn +WRITE(UNIT=ILUSEG,NML=NAM_ADVn) +IF (CPROGRAM/='MESONH') THEN + CTURB = 'NONE' + CRAD = 'NONE' + CCLOUD = 'NONE' + CDCONV = 'NONE' + CSCONV = 'NONE' + CELEC = 'NONE' + CACTCCN = 'NONE' +END IF +CALL INIT_NAM_PARAMn +WRITE(UNIT=ILUSEG,NML=NAM_PARAMn) +! +CALL INIT_NAM_PARAM_RADn +IF(CRAD /= 'NONE') WRITE(UNIT=ILUSEG,NML=NAM_PARAM_RADn) +#ifdef MNH_ECRAD +CALL INIT_NAM_PARAM_ECRADn +IF(CRAD /= 'NONE') WRITE(UNIT=ILUSEG,NML=NAM_PARAM_ECRADn) +#endif +! +CALL INIT_NAM_PARAM_KAFRn +IF(CDCONV /= 'NONE' .OR. CSCONV == 'KAFR') & + WRITE(UNIT=ILUSEG,NML=NAM_PARAM_KAFRn) +! +IF (CSCONV == 'EDKF' ) CALL PARAM_MFSHALLN_INIT(CPROGRAM, 0, .FALSE., ILUSEG, .FALSE., .FALSE., .FALSE., 1) +! +CALL INIT_NAM_LBCn +WRITE(UNIT=ILUSEG,NML=NAM_LBCn) +! +CALL INIT_NAM_NUDGINGn +WRITE(UNIT=ILUSEG,NML=NAM_NUDGINGn) +! +IF(CTURB /= 'NONE') CALL TURBN_INIT(CPROGRAM, 0, .FALSE., ILUSEG, .FALSE., .FALSE., .FALSE., 1) +! +CALL NEBN_INIT(CPROGRAM, 0, .FALSE., ILUSEG, .FALSE., .FALSE., .FALSE., 1) +! +CALL INIT_NAM_BLANKn +WRITE(UNIT=ILUSEG,NML=NAM_BLANKn) +! +!IF (CPROGRAM/='MESONH') THEN +! LUSECHEM = .FALSE. +! LORILAM = .FALSE. +! LDEPOS_AER = .FALSE. +! LDUST = .FALSE. +! LDEPOS_DST = .FALSE. +! LSALT = .FALSE. +! LDEPOS_SLT = .FALSE. +! LPASPOL = .FALSE. +! LCONDSAMP = .FALSE. +!END IF +CALL INIT_NAM_CH_MNHCn +IF(LUSECHEM .OR. LCH_CONV_LINOX .OR. LCH_CONV_SCAV) & + WRITE(UNIT=ILUSEG,NML=NAM_CH_MNHCn) +! +CALL INIT_NAM_CH_SOLVERn +IF(LUSECHEM) WRITE(UNIT=ILUSEG,NML=NAM_CH_SOLVERn) +! +CALL INIT_NAM_BLOWSNOWn +IF(LBLOWSNOW) WRITE(UNIT=ILUSEG,NML=NAM_BLOWSNOWn) +IF(LBLOWSNOW) WRITE(UNIT=ILUSEG,NML=NAM_BLOWSNOW) +! +CALL INIT_NAM_STATIONn +IF(LSTATION) WRITE(UNIT=ILUSEG,NML=NAM_STATIONn) +! +IF(LDUST) WRITE(UNIT=ILUSEG,NML=NAM_DUST) +IF(LSALT) WRITE(UNIT=ILUSEG,NML=NAM_SALT) +IF(LPASPOL) WRITE(UNIT=ILUSEG,NML=NAM_PASPOL) +#ifdef MNH_FOREFIRE +IF(FFCOUPLING) WRITE(UNIT=ILUSEG,NML=NAM_FOREFIRE) +#endif +IF(LBLAZE) WRITE(UNIT=ILUSEG,NML=NAM_PASPOL) +IF(LCONDSAMP) WRITE(UNIT=ILUSEG,NML=NAM_CONDSAMP) +IF(LORILAM.AND.LUSECHEM) WRITE(UNIT=ILUSEG,NML=NAM_CH_ORILAM) +! +CALL INIT_NAM_SERIESn +IF(LSERIES) WRITE(UNIT=ILUSEG,NML=NAM_SERIESn) +IF(L2D_ADV_FRC .OR. L2D_REL_FRC) WRITE(UNIT=ILUSEG,NML=NAM_2D_FRC) +! +IF (LUV_FLX .OR. LTH_FLX) WRITE(UNIT=ILUSEG,NML=NAM_LATZ_EDFLX) +! +IF (CPROGRAM/='MESONH') THEN + LLG = .FALSE. +END IF +WRITE(UNIT=ILUSEG,NML=NAM_CONF) +WRITE(UNIT=ILUSEG,NML=NAM_DYN) +WRITE(UNIT=ILUSEG,NML=NAM_NESTING) +!WRITE(UNIT=ILUSEG,NML=NAM_BACKUP) +!WRITE(UNIT=ILUSEG,NML=NAM_OUTPUT) +IF(CBUTYPE /= 'NONE') THEN + IF(CBUTYPE=='SKIP') CBUTYPE='CART' + WRITE(UNIT=ILUSEG,NML=NAM_BUDGET) +END IF +IF(LBU_RU) WRITE(UNIT=ILUSEG,NML=NAM_BU_RU) +IF(LBU_RV) WRITE(UNIT=ILUSEG,NML=NAM_BU_RV) +IF(LBU_RW) WRITE(UNIT=ILUSEG,NML=NAM_BU_RW) +IF(LBU_RTH) WRITE(UNIT=ILUSEG,NML=NAM_BU_RTH) +IF(LBU_RTKE) WRITE(UNIT=ILUSEG,NML=NAM_BU_RTKE) +IF(LBU_RRV) WRITE(UNIT=ILUSEG,NML=NAM_BU_RRV) +IF(LBU_RRC) WRITE(UNIT=ILUSEG,NML=NAM_BU_RRC) +IF(LBU_RRR) WRITE(UNIT=ILUSEG,NML=NAM_BU_RRR) +IF(LBU_RRI) WRITE(UNIT=ILUSEG,NML=NAM_BU_RRI) +IF(LBU_RRS) WRITE(UNIT=ILUSEG,NML=NAM_BU_RRS) +IF(LBU_RRG) WRITE(UNIT=ILUSEG,NML=NAM_BU_RRG) +IF(LBU_RRH) WRITE(UNIT=ILUSEG,NML=NAM_BU_RRH) +IF(LBU_RSV) WRITE(UNIT=ILUSEG,NML=NAM_BU_RSV) +IF(LLES_MEAN .OR. LLES_RESOLVED .OR. LLES_SUBGRID .OR. LLES_UPDRAFT & +.OR. LLES_DOWNDRAFT .OR. LLES_SPECTRA) WRITE(UNIT=ILUSEG,NML=NAM_LES) +IF(LFORCING .OR. LTRANS) WRITE(UNIT=ILUSEG,NML=NAM_FRC) +IF(CCLOUD(1:3) == 'ICE') CALL PARAM_ICEN_INIT(CPROGRAM, 0, .FALSE., ILUSEG, .FALSE., .FALSE., .FALSE., 1) +IF(CCLOUD == 'C2R2' .OR. CCLOUD == 'C3R5' .OR. CCLOUD == 'KHKO') & + WRITE(UNIT=ILUSEG,NML=NAM_PARAM_C2R2) +IF(CCLOUD == 'C3R5' ) WRITE(UNIT=ILUSEG,NML=NAM_PARAM_C1R3) +IF(CCLOUD == 'LIMA' ) WRITE(UNIT=ILUSEG,NML=NAM_PARAM_LIMA) +IF(CELEC /= 'NONE') WRITE(UNIT=ILUSEG,NML=NAM_ELEC) +IF(LSERIES) WRITE(UNIT=ILUSEG,NML=NAM_SERIES) +IF(NMODEL_CLOUD/=NUNDEF) WRITE(UNIT=ILUSEG,NML=NAM_TURB_CLOUD) +IF(CTURB /= 'NONE') CALL TURBN_INIT(CPROGRAM, 0, .FALSE., ILUSEG, .FALSE., .FALSE., .FALSE., 1) +CALL NEBN_INIT(CPROGRAM, 0, .FALSE., ILUSEG, .FALSE., .FALSE., .FALSE., 1) +! +! +! +!------------------------------------------------------------------------------- +! +!* 2. WRITE UPDATED DESFM ON OUTPUT LISTING +! ------------------------------------- +! +IF (NVERB >= 5) THEN +! + ILUOUT = TLUOUT%NLU +! + WRITE(UNIT=ILUOUT,FMT="(/,'DESCRIPTOR OF SEGMENT FOR MODEL ',I2)") KMI + WRITE(UNIT=ILUOUT,FMT="( '------------------------------- ' )") +! + WRITE(UNIT=ILUOUT,FMT="('********** LOGICAL UNITSn **********')") + WRITE(UNIT=ILUOUT,NML=NAM_LUNITn) +! + WRITE(UNIT=ILUOUT,FMT="('********** CONFIGURATIONn **********')") + WRITE(UNIT=ILUOUT,NML=NAM_CONFn) +! +! + WRITE(UNIT=ILUOUT,FMT="('********** DYNAMICn ****************')") + WRITE(UNIT=ILUOUT,NML=NAM_DYNn) +! + WRITE(UNIT=ILUOUT,FMT="('********** ADVECTIONn **************')") + WRITE(UNIT=ILUOUT,NML=NAM_ADVn) + ! + IF (LIBM_LSF) THEN + WRITE(UNIT=ILUOUT,FMT="('********** IBM_PARAMn **************')") + WRITE(UNIT=ILUOUT,NML=NAM_IBM_PARAMn) + ENDIF + ! + IF (LRECYCL) THEN + WRITE(UNIT=ILUOUT,FMT="('********** RECYCL_PARAMn **************')") + WRITE(UNIT=ILUOUT,NML=NAM_RECYCL_PARAMn) + ENDIF + ! + WRITE(UNIT=ILUOUT,FMT="('********** PARAMETERIZATIONSn ******')") + WRITE(UNIT=ILUOUT,NML=NAM_PARAMn) +! + WRITE(UNIT=ILUOUT,FMT="('********** RADIATIONn **************')") + WRITE(UNIT=ILUOUT,NML=NAM_PARAM_RADn) +#ifdef MNH_ECRAD + WRITE(UNIT=ILUOUT,FMT="('********** ECRADn **************')") + WRITE(UNIT=ILUOUT,NML=NAM_PARAM_ECRADn) +#endif +! + WRITE(UNIT=ILUOUT,FMT="('********** CONVECTIONn *************')") + WRITE(UNIT=ILUOUT,NML=NAM_PARAM_KAFRn) +! + WRITE(UNIT=ILUOUT,FMT="('************ PARAM_MFSHALLn *******')") + CALL PARAM_MFSHALLN_INIT(CPROGRAM, 0, .FALSE., ILUOUT, .FALSE., .FALSE., .FALSE., 2) +! + WRITE(UNIT=ILUOUT,FMT="('********** LBCn ********************')") + WRITE(UNIT=ILUOUT,NML=NAM_LBCn) +! + WRITE(UNIT=ILUOUT,FMT="('********** NUDGINGn*****************')") + WRITE(UNIT=ILUOUT,NML=NAM_NUDGINGn) +! + WRITE(UNIT=ILUOUT,FMT="('********** TURBn *******************')") + CALL TURBN_INIT(CPROGRAM, 0, .FALSE., ILUOUT, .FALSE., .FALSE., .FALSE., 2) +! + WRITE(UNIT=ILUOUT,FMT="('********** NEBn *******************')") + CALL NEBN_INIT(CPROGRAM, 0, .FALSE., ILUOUT, .FALSE., .FALSE., .FALSE., 2) +! + WRITE(UNIT=ILUOUT,FMT="('********** CHEMICAL MONITORn *******')") + WRITE(UNIT=ILUOUT,NML=NAM_CH_MNHCn) +! + WRITE(UNIT=ILUOUT,FMT="('************ CHEMICAL SOLVERn ******************')") + WRITE(UNIT=ILUOUT,NML=NAM_CH_SOLVERn) +! + WRITE(UNIT=ILUOUT,FMT="('************ TEMPORAL SERIESn ******************')") + WRITE(UNIT=ILUOUT,NML=NAM_SERIESn) +! + WRITE(UNIT=ILUOUT,FMT="('********** BLOWING SNOW SCHEME ****************')") + WRITE(UNIT=ILUOUT,NML=NAM_BLOWSNOWn) +! + WRITE(UNIT=ILUOUT,FMT="('********** BLANKn *****************************')") + WRITE(UNIT=ILUOUT,NML=NAM_BLANKn) +! + WRITE(UNIT=ILUOUT,FMT="('************ ICE SCHEME ***********************')") + CALL PARAM_ICEN_INIT(CPROGRAM, 0, .FALSE., ILUOUT, .FALSE., .FALSE., .FALSE., 2) +! + IF (KMI==1) THEN + WRITE(UNIT=ILUOUT,FMT="(/,'PART OF SEGMENT FILE COMMON TO ALL THE MODELS')") + WRITE(UNIT=ILUOUT,FMT="( '---------------------------------------------')") +! + WRITE(UNIT=ILUOUT,FMT="('************ CONFIGURATION ********************')") + WRITE(UNIT=ILUOUT,NML=NAM_CONF) +! + WRITE(UNIT=ILUOUT,FMT="('************ DYNAMIC **************************')") + WRITE(UNIT=ILUOUT,NML=NAM_DYN) +! + WRITE(UNIT=ILUOUT,FMT="(/,'********** NESTING **************************')") + WRITE(UNIT=ILUOUT,NML=NAM_NESTING) +! +! WRITE(UNIT=ILUOUT,FMT="(/,'********** BACKUP ***************************')") +! WRITE(UNIT=ILUOUT,NML=NAM_BACKUP) +! +! WRITE(UNIT=ILUOUT,FMT="(/,'********** OUTPUT ***************************')") +! WRITE(UNIT=ILUOUT,NML=NAM_OUTPUT) +! + WRITE(UNIT=ILUOUT,FMT="('************ BUDGET ***************************')") + WRITE(UNIT=ILUOUT,NML=NAM_BUDGET) +! + IF ( .NOT. ALLOCATED( CBULIST_RU ) ) ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RU(0) ) + WRITE(UNIT=ILUOUT,FMT="('************ U BUDGET *************************')") + WRITE(UNIT=ILUOUT,NML=NAM_BU_RU) +! + IF ( .NOT. ALLOCATED( CBULIST_RV ) ) ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RV(0) ) + WRITE(UNIT=ILUOUT,FMT="('************ V BUDGET *************************')") + WRITE(UNIT=ILUOUT,NML=NAM_BU_RV) +! + IF ( .NOT. ALLOCATED( CBULIST_RW ) ) ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RW(0) ) + WRITE(UNIT=ILUOUT,FMT="('************ W BUDGET *************************')") + WRITE(UNIT=ILUOUT,NML=NAM_BU_RW) +! + IF ( .NOT. ALLOCATED( CBULIST_RTH ) ) ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RTH(0) ) + WRITE(UNIT=ILUOUT,FMT="('************ TH BUDGET ************************')") + WRITE(UNIT=ILUOUT,NML=NAM_BU_RTH) +! + IF ( .NOT. ALLOCATED( CBULIST_RTKE ) ) ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RTKE(0) ) + WRITE(UNIT=ILUOUT,FMT="('************ TKE BUDGET ***********************')") + WRITE(UNIT=ILUOUT,NML=NAM_BU_RTKE) +! + IF ( .NOT. ALLOCATED( CBULIST_RRV ) ) ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRV(0) ) + WRITE(UNIT=ILUOUT,FMT="('************ RV BUDGET ************************')") + WRITE(UNIT=ILUOUT,NML=NAM_BU_RRV) +! + IF ( .NOT. ALLOCATED( CBULIST_RRC ) ) ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRC(0) ) + WRITE(UNIT=ILUOUT,FMT="('************ RC BUDGET ************************')") + WRITE(UNIT=ILUOUT,NML=NAM_BU_RRC) +! + IF ( .NOT. ALLOCATED( CBULIST_RRR ) ) ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRR(0) ) + WRITE(UNIT=ILUOUT,FMT="('************ RR BUDGET ************************')") + WRITE(UNIT=ILUOUT,NML=NAM_BU_RRR) +! + IF ( .NOT. ALLOCATED( CBULIST_RRI ) ) ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRI(0) ) + WRITE(UNIT=ILUOUT,FMT="('************ RI BUDGET ************************')") + WRITE(UNIT=ILUOUT,NML=NAM_BU_RRI) +! + IF ( .NOT. ALLOCATED( CBULIST_RRS ) ) ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRS(0) ) + WRITE(UNIT=ILUOUT,FMT="('************ RS BUDGET ************************')") + WRITE(UNIT=ILUOUT,NML=NAM_BU_RRS) +! + IF ( .NOT. ALLOCATED( CBULIST_RRG ) ) ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRG(0) ) + WRITE(UNIT=ILUOUT,FMT="('************ RG BUDGET ************************')") + WRITE(UNIT=ILUOUT,NML=NAM_BU_RRG) +! + IF ( .NOT. ALLOCATED( CBULIST_RRH ) ) ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RRH(0) ) + WRITE(UNIT=ILUOUT,FMT="('************ RH BUDGET ************************')") + WRITE(UNIT=ILUOUT,NML=NAM_BU_RRH) +! + IF ( .NOT. ALLOCATED( CBULIST_RSV ) ) ALLOCATE( CHARACTER(LEN=NBULISTMAXLEN) :: CBULIST_RSV(0) ) + WRITE(UNIT=ILUOUT,FMT="('************ SVx BUDGET ***********************')") + WRITE(UNIT=ILUOUT,NML=NAM_BU_RSV) +! + WRITE(UNIT=ILUOUT,FMT="('************ LES ******************************')") + WRITE(UNIT=ILUOUT,NML=NAM_LES) +! + WRITE(UNIT=ILUOUT,FMT="('************ FORCING **************************')") + WRITE(UNIT=ILUOUT,NML=NAM_FRC) +! + WRITE(UNIT=ILUOUT,FMT="('********** DUST SCHEME ************************')") + WRITE(UNIT=ILUOUT,NML=NAM_DUST) +! + WRITE(UNIT=ILUOUT,FMT="('********** PASPOL *****************************')") + WRITE(UNIT=ILUOUT,NML=NAM_PASPOL) +! +#ifdef MNH_FOREFIRE + WRITE(UNIT=ILUOUT,FMT="('********** FOREFIRE *****************************')") + WRITE(UNIT=ILUOUT,NML=NAM_FOREFIRE) +! +#endif +! +IF (LBLAZE) THEN + WRITE(UNIT=ILUOUT,FMT="('******************** BLAZE ********************')") + WRITE(UNIT=ILUOUT,NML=NAM_FIRE) +END IF +! + WRITE(UNIT=ILUOUT,FMT="('********** CONDSAMP****************************')") + WRITE(UNIT=ILUOUT,NML=NAM_CONDSAMP) +! + WRITE(UNIT=ILUOUT,FMT="('********** SALT SCHEME ************************')") + WRITE(UNIT=ILUOUT,NML=NAM_SALT) +! + WRITE(UNIT=ILUOUT,FMT="('********** BLOWING SNOW SCHEME ****************')") + WRITE(UNIT=ILUOUT,NML=NAM_BLOWSNOW) +! + WRITE(UNIT=ILUOUT,FMT="('************ ORILAM SCHEME ********************')") + WRITE(UNIT=ILUOUT,NML=NAM_CH_ORILAM) +! + IF( CCLOUD == 'C2R2' .OR. CCLOUD == 'C3R5') THEN + WRITE(UNIT=ILUOUT,FMT="('*********** C2R2 SCHEME *********************')") + WRITE(UNIT=ILUOUT,NML=NAM_PARAM_C2R2) + IF( CCLOUD == 'C3R5' ) THEN + WRITE(UNIT=ILUOUT,FMT="('*********** C1R3 SCHEME *********************')") + WRITE(UNIT=ILUOUT,NML=NAM_PARAM_C1R3) + END IF + END IF +! + IF( CCLOUD == 'LIMA' ) THEN + WRITE(UNIT=ILUOUT,FMT="('*********** LIMA SCHEME *********************')") + WRITE(UNIT=ILUOUT,NML=NAM_PARAM_LIMA) + END IF +! + IF( CCLOUD == 'KHKO' ) THEN + WRITE(UNIT=ILUOUT,FMT="('*********** KHKO SCHEME *********************')") + WRITE(UNIT=ILUOUT,NML=NAM_PARAM_C2R2) + END IF +! + IF( CELEC /= 'NONE' ) THEN + WRITE(UNIT=ILUOUT,FMT="('*********** ELEC SCHEME *********************')") + WRITE(UNIT=ILUOUT,NML=NAM_ELEC) + END IF +! + WRITE(UNIT=ILUOUT,FMT="('************ TEMPORAL SERIES ****************')") + WRITE(UNIT=ILUOUT,NML=NAM_SERIES) +! + WRITE(UNIT=ILUOUT,FMT="('************ MIXING LENGTH FOR CLOUD ***********')") + WRITE(UNIT=ILUOUT,NML=NAM_TURB_CLOUD) +! + END IF +! +END IF +! +IF (CPROGRAM /='MESONH') THEN !return to previous LHORELAX_ + LHORELAX_UVWTH = GHORELAX_UVWTH + LHORELAX_RV = GHORELAX_RV + LHORELAX_RC = GHORELAX_RC + LHORELAX_RR = GHORELAX_RR + LHORELAX_RI = GHORELAX_RI + LHORELAX_RS = GHORELAX_RS + LHORELAX_RG = GHORELAX_RG + LHORELAX_TKE = GHORELAX_TKE + LHORELAX_SV(:) = GHORELAX_SV(:) + LHORELAX_SVC2R2= GHORELAX_SVC2R2 + LHORELAX_SVC1R3= GHORELAX_SVC1R3 + LHORELAX_SVLIMA= GHORELAX_SVLIMA + LHORELAX_SVELEC= GHORELAX_SVELEC + LHORELAX_SVCHEM= GHORELAX_SVCHEM + LHORELAX_SVCHIC= GHORELAX_SVCHIC + LHORELAX_SVLG = .FALSE. + LHORELAX_SVDST = GHORELAX_SVDST + LHORELAX_SVSLT = GHORELAX_SVSLT + LHORELAX_SVPP = GHORELAX_SVPP + LHORELAX_SVFIRE = GHORELAX_SVFIRE +#ifdef MNH_FOREFIRE + LHORELAX_SVFF = GHORELAX_SVFF +#endif + LHORELAX_SVCS = GHORELAX_SVCS + LHORELAX_SVAER = GHORELAX_SVAER + LHORELAX_SVSNW = GHORELAX_SVSNW +ELSE + LHORELAX_SV(:) = GHORELAX_SV(:) +ENDIF +CALL UPDATE_NAM_DYNn +!------------------------------------------------------------------------------ +! +END SUBROUTINE WRITE_DESFM_n diff --git a/src/mesonh/ext/write_lesn.f90 b/src/mesonh/ext/write_lesn.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e5a3cb8f76ea01537ba72ca3975c4d438593c932 --- /dev/null +++ b/src/mesonh/ext/write_lesn.f90 @@ -0,0 +1,1319 @@ +!MNH_LIC Copyright 2000-2021 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 mode_write_les_n +!###################### + +use modd_field, only: tfield_metadata_base + +implicit none + +private + +public :: Write_les_n + + +character(len=:), allocatable :: cgroup +character(len=:), allocatable :: cgroupcomment + +logical :: ldoavg ! Compute and store time average +logical :: ldonorm ! Compute and store normalized field + +type(tfield_metadata_base) :: tfield +type(tfield_metadata_base) :: tfieldx +type(tfield_metadata_base) :: tfieldy + +interface Les_diachro_write + module procedure Les_diachro_write_1D, Les_diachro_write_2D, Les_diachro_write_3D, Les_diachro_write_4D +end interface + +contains + +!################################### +subroutine Write_les_n( tpdiafile ) +!################################### +! +! +!!**** *WRITE_LES_n* writes the LES final diagnostics for model _n +!! +!! +!! PURPOSE +!! ------- +!! +!! EXTERNAL +!! -------- +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! V. Masson +!! +!! MODIFICATIONS +!! ------------- +!! Original 07/02/00 +!! 01/02/01 (D. Gazen) add module MODD_NSV for NSV variable +!! 06/11/02 (V. Masson) some minor bugs +!! 01/04/03 (V. Masson) idem +!! 10/10/09 (P. Aumond) Add user multimaskS +!! 11/15 (C.Lac) Add production terms of TKE +!! 10/2016 (C.Lac) Add droplet deposition +! P. Wautelet 05/2016-04/2018: new data structures and calls for I/O +! C. Lac 02/2019: add rain fraction as a LES diagnostic +! P. Wautelet 13/09/2019: budget: simplify and modernize date/time management +! P. Wautelet 12/10/2020: remove HLES_AVG dummy argument and group all 4 calls +! P. Wautelet 13/10/2020: bugfix: correct some names for LES_DIACHRO_2PT diagnostics (Ri) +! P. Wautelet 26/10/2020: bugfix: correct some comments and conditions + add missing RES_RTPZ +! P. Wautelet 26/10/2020: restructure subroutines to use tfield_metadata_base type +! -------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +use modd_conf_n, only: luserv, luserc, luserr, luseri, lusers, luserg, luserh +use modd_io, only: tfiledata +use modd_field, only: NMNHDIM_BUDGET_LES_TIME, NMNHDIM_BUDGET_LES_LEVEL, NMNHDIM_BUDGET_LES_SV, NMNHDIM_BUDGET_LES_MASK, & + NMNHDIM_BUDGET_LES_PDF, & + NMNHDIM_SPECTRA_2PTS_NI, NMNHDIM_SPECTRA_2PTS_NJ, NMNHDIM_SPECTRA_LEVEL, NMNHDIM_UNUSED, & + TYPEREAL +use modd_grid_n, only: xdxhat, xdyhat +use modd_nsv, only: nsv +use modd_les +use modd_les_n +use modd_param_n, only: ccloud +use modd_param_c2r2, only: ldepoc +USE MODD_PARAM_ICE_n, only: ldeposc +use modd_parameters, only: XUNDEF + +use mode_les_spec_n, only: Les_spec_n +use mode_modeln_handler, only: Get_current_model_index +use mode_write_les_budget_n, only: Write_les_budget_n +use mode_write_les_rt_budget_n, only: Write_les_rt_budget_n +use mode_write_les_sv_budget_n, only: Write_les_sv_budget_n + +IMPLICIT NONE +! +!* 0.1 declarations of arguments +! +TYPE(TFILEDATA), INTENT(IN) :: TPDIAFILE! file to write +! +! +!* 0.2 declaration of local variables +! +INTEGER :: IMASK +! +INTEGER :: JSV ! scalar loop counter +INTEGER :: JI ! loop counter +! +character(len=3) :: ynum +CHARACTER(len=5) :: YGROUP +character(len=7), dimension(nles_masks) :: ymasks +! +logical :: gdoavg ! Compute and store time average +logical :: gdonorm ! Compute and store normalized field +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZAVG_PTS_ll +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZUND_PTS_ll +REAL :: ZCART_PTS_ll +INTEGER :: IMI ! Current model inde +! +!------------------------------------------------------------------------------- +! +IF (.NOT. LLES) RETURN +! +! +!* 1. Initializations +! --------------- +! +IMI = GET_CURRENT_MODEL_INDEX() +! +! +!* 1.1 Normalization variables +! ----------------------- +! +IF (CLES_NORM_TYPE/='NONE' ) THEN + CALL LES_ALLOCATE('XLES_NORM_M', (/NLES_TIMES/)) + CALL LES_ALLOCATE('XLES_NORM_S', (/NLES_TIMES/)) + CALL LES_ALLOCATE('XLES_NORM_K', (/NLES_TIMES/)) + CALL LES_ALLOCATE('XLES_NORM_RHO',(/NLES_TIMES/)) + CALL LES_ALLOCATE('XLES_NORM_RV', (/NLES_TIMES/)) + CALL LES_ALLOCATE('XLES_NORM_SV', (/NLES_TIMES,NSV/)) + CALL LES_ALLOCATE('XLES_NORM_P', (/NLES_TIMES/)) + ! + IF (CLES_NORM_TYPE=='CONV') THEN + WHERE (XLES_WSTAR(:)>0.) + XLES_NORM_M(:) = XLES_BL_HEIGHT(:) + XLES_NORM_S(:) = XLES_NORM_M(:) / XLES_WSTAR(:) + XLES_NORM_K(:) = XLES_Q0(:) / XLES_WSTAR(:) + XLES_NORM_RHO(:) = XLES_MEAN_RHO(1,:,1) + XLES_NORM_RV(:) = XLES_E0(:) / XLES_WSTAR(:) + XLES_NORM_P(:) = XLES_MEAN_RHO(1,:,1) * XLES_WSTAR(:)**2 + ELSEWHERE + XLES_NORM_M(:) = 0. + XLES_NORM_S(:) = 0. + XLES_NORM_K(:) = 0. + XLES_NORM_RHO(:) = 0. + XLES_NORM_RV(:) = 0. + XLES_NORM_P(:) = 0. + END WHERE + DO JSV=1,NSV + WHERE (XLES_WSTAR(:)>0.) + XLES_NORM_SV(:,JSV)= XLES_SV0(:,JSV) / XLES_WSTAR(:) + ELSEWHERE + XLES_NORM_SV(:,JSV)= 0. + END WHERE + END DO + ELSE IF (CLES_NORM_TYPE=='EKMA') THEN + WHERE (XLES_USTAR(:)>0.) + XLES_NORM_M(:) = XLES_BL_HEIGHT(:) + XLES_NORM_S(:) = XLES_NORM_M(:) / XLES_USTAR(:) + XLES_NORM_K(:) = XLES_Q0(:) / XLES_USTAR(:) + XLES_NORM_RHO(:) = XLES_MEAN_RHO(1,:,1) + XLES_NORM_RV(:) = XLES_E0(:) / XLES_USTAR(:) + XLES_NORM_P(:) = XLES_MEAN_RHO(1,:,1) * XLES_USTAR(:)**2 + ELSEWHERE + XLES_NORM_M(:) = 0. + XLES_NORM_S(:) = 0. + XLES_NORM_K(:) = 0. + XLES_NORM_RHO(:) = 0. + XLES_NORM_RV(:) = 0. + XLES_NORM_P(:) = 0. + END WHERE + DO JSV=1,NSV + WHERE (XLES_USTAR(:)>0.) + XLES_NORM_SV(:,JSV)= XLES_SV0(:,JSV) / XLES_USTAR(:) + ELSEWHERE + XLES_NORM_SV(:,JSV)= 0. + END WHERE + END DO + ELSE IF (CLES_NORM_TYPE=='MOBU') THEN + XLES_NORM_M(:) = XLES_MO_LENGTH(:) + WHERE (XLES_USTAR(:)>0.) + XLES_NORM_S(:) = XLES_NORM_M(:) / XLES_USTAR(:) + XLES_NORM_K(:) = XLES_Q0(:) / XLES_USTAR(:) + XLES_NORM_RHO(:) = XLES_MEAN_RHO(1,:,1) + XLES_NORM_RV(:) = XLES_E0(:) / XLES_USTAR(:) + XLES_NORM_P(:) = XLES_MEAN_RHO(1,:,1) * XLES_USTAR(:)**2 + ELSEWHERE + XLES_NORM_S(:) = 0. + XLES_NORM_K(:) = 0. + XLES_NORM_RHO(:) = 0. + XLES_NORM_RV(:) = 0. + XLES_NORM_P(:) = 0. + END WHERE + DO JSV=1,NSV + WHERE (XLES_USTAR(:)>0.) + XLES_NORM_SV(:,JSV)= XLES_SV0(:,JSV) / XLES_USTAR(:) + ELSEWHERE + XLES_NORM_SV(:,JSV)= 0. + END WHERE + END DO + END IF +END IF +! +!* 1.2 Initializations for WRITE_DIACHRO +! --------------------------------- +! +NLES_CURRENT_TIMES=NLES_TIMES +! +CALL LES_ALLOCATE('XLES_CURRENT_Z',(/NLES_K/)) + +XLES_CURRENT_Z(:) = XLES_Z(:) +! +XLES_CURRENT_ZS = XLES_ZS +! +NLES_CURRENT_IINF=NLESn_IINF(IMI) +NLES_CURRENT_ISUP=NLESn_ISUP(IMI) +NLES_CURRENT_JINF=NLESn_JINF(IMI) +NLES_CURRENT_JSUP=NLESn_JSUP(IMI) +! +XLES_CURRENT_DOMEGAX=XDXHAT(1) +XLES_CURRENT_DOMEGAY=XDYHAT(1) + +tfield%ngrid = 0 !Not on the Arakawa grid +tfield%ntype = TYPEREAL +! +!* 2. (z,t) profiles (all masks) +! -------------- +IMASK = 1 +ymasks(imask) = 'cart' +IF (LLES_NEB_MASK) THEN + IMASK=IMASK+1 + ymasks(imask) = 'neb' + IMASK=IMASK+1 + ymasks(imask) = 'clear' +END IF +IF (LLES_CORE_MASK) THEN + IMASK=IMASK+1 + ymasks(imask) = 'core' + IMASK=IMASK+1 + ymasks(imask) = 'env' +END IF +IF (LLES_MY_MASK) THEN + DO JI=1,NLES_MASKS_USER + IMASK=IMASK+1 + Write( ynum, '( i3.3 )' ) ji + ymasks(imask) = 'user' // ynum + END DO +END IF +IF (LLES_CS_MASK) THEN + IMASK=IMASK+1 + ymasks(imask) = 'cs1' + IMASK=IMASK+1 + ymasks(imask) = 'cs2' + IMASK=IMASK+1 + ymasks(imask) = 'cs3' +END IF +! +!* 2.0 averaging diagnostics +! --------------------- +! +ALLOCATE(ZAVG_PTS_ll (NLES_K,NLES_TIMES,NLES_MASKS)) +ALLOCATE(ZUND_PTS_ll (NLES_K,NLES_TIMES,NLES_MASKS)) + +ZAVG_PTS_ll(:,:,:) = NLES_AVG_PTS_ll(:,:,:) +ZUND_PTS_ll(:,:,:) = NLES_UND_PTS_ll(:,:,:) +ZCART_PTS_ll = (NLESn_ISUP(IMI)-NLESn_IINF(IMI)+1) * (NLESn_JSUP(IMI)-NLESn_JINF(IMI)+1) + +tfield%ndims = 3 +tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL +tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME +tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_MASK +tfield%ndimlist(4:) = NMNHDIM_UNUSED + +ldoavg = xles_temp_mean_start /= XUNDEF .and. xles_temp_mean_end /= XUNDEF +ldonorm = .false. + +cgroup = 'Miscellaneous' +cgroupcomment = 'Miscellaneous terms (geometry, various unclassified averaged terms...)' + +call Les_diachro_write( tpdiafile, zavg_pts_ll, 'AVG_PTS', 'number of points used for averaging', '1', ymasks ) +call Les_diachro_write( tpdiafile, zavg_pts_ll / zcart_pts_ll, 'AVG_PTSF', 'fraction of points used for averaging', '1', ymasks ) +call Les_diachro_write( tpdiafile, zund_pts_ll, 'UND_PTS', 'number of points below orography', '1', ymasks ) +call Les_diachro_write( tpdiafile, zund_pts_ll / zcart_pts_ll, 'UND_PTSF', 'fraction of points below orography', '1', ymasks ) + +DEALLOCATE(ZAVG_PTS_ll) +DEALLOCATE(ZUND_PTS_ll) +! +!* 2.1 mean quantities +! --------------- +! +cgroup = 'Mean' +cgroupcomment = 'Mean vertical profiles of the model variables' + +tfield%ndims = 3 +tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL +tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME +tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_MASK +tfield%ndimlist(4:) = NMNHDIM_UNUSED + +ldoavg = xles_temp_mean_start /= XUNDEF .and. xles_temp_mean_end /= XUNDEF +ldonorm = trim(cles_norm_type) /= 'NONE' + +call Les_diachro_write( tpdiafile, XLES_MEAN_U, 'MEAN_U', 'Mean U Profile', 'm s-1', ymasks ) +call Les_diachro_write( tpdiafile, XLES_MEAN_V, 'MEAN_V', 'Mean V Profile', 'm s-1', ymasks ) +call Les_diachro_write( tpdiafile, XLES_MEAN_W, 'MEAN_W', 'Mean W Profile', 'm s-1', ymasks ) +call Les_diachro_write( tpdiafile, XLES_MEAN_P, 'MEAN_PRE', 'Mean pressure Profile', 'Pa', ymasks ) +call Les_diachro_write( tpdiafile, XLES_MEAN_DP, 'MEAN_DP', 'Mean Dyn production TKE Profile', 'm2 s-3', ymasks ) +call Les_diachro_write( tpdiafile, XLES_MEAN_TP, 'MEAN_TP', 'Mean Thermal production TKE Profile', 'm2 s-3', ymasks ) +call Les_diachro_write( tpdiafile, XLES_MEAN_TR, 'MEAN_TR', 'Mean transport production TKE Profile', 'm2 s-3', ymasks ) +call Les_diachro_write( tpdiafile, XLES_MEAN_DISS, 'MEAN_DISS', 'Mean Dissipation TKE Profile', 'm2 s-3', ymasks ) +call Les_diachro_write( tpdiafile, XLES_MEAN_LM, 'MEAN_LM', 'Mean mixing length Profile', 'm', ymasks ) +call Les_diachro_write( tpdiafile, XLES_MEAN_RHO, 'MEAN_RHO', 'Mean density Profile', 'kg m-3', ymasks ) +call Les_diachro_write( tpdiafile, XLES_MEAN_Th, 'MEAN_TH', 'Mean potential temperature Profile', 'K', ymasks ) +call Les_diachro_write( tpdiafile, XLES_MEAN_Mf, 'MEAN_MF', 'Mass-flux Profile', 'm s-1', ymasks ) +if ( luserc ) & +call Les_diachro_write( tpdiafile, XLES_MEAN_Thl, 'MEAN_THL', 'Mean liquid potential temperature Profile', 'K', ymasks ) +if ( luserv ) & +call Les_diachro_write( tpdiafile, XLES_MEAN_Thv, 'MEAN_THV', 'Mean virtual potential temperature Profile', 'K', ymasks ) +if ( luserc ) & +call Les_diachro_write( tpdiafile, XLES_MEAN_Rt, 'MEAN_RT', 'Mean Rt Profile', 'kg kg-1', ymasks ) +if ( luserv ) & +call Les_diachro_write( tpdiafile, XLES_MEAN_Rv, 'MEAN_RV', 'Mean Rv Profile', 'kg kg-1', ymasks ) +if ( luserv ) & +call Les_diachro_write( tpdiafile, XLES_MEAN_Rehu, 'MEAN_REHU', 'Mean Rh Profile', 'percent', ymasks ) +if ( luserv ) & +call Les_diachro_write( tpdiafile, XLES_MEAN_Qs, 'MEAN_QS', 'Mean Qs Profile', 'kg kg-1', ymasks ) +if ( luserc ) & +call Les_diachro_write( tpdiafile, XLES_MEAN_KHt, 'MEAN_KHT', 'Eddy-diffusivity (temperature) Profile', 'm2 s-1', ymasks ) +if ( luserc ) & +call Les_diachro_write( tpdiafile, XLES_MEAN_KHr, 'MEAN_KHR', 'Eddy-diffusivity (vapor) Profile', 'm2 s-1', ymasks ) +if ( luserc ) & +call Les_diachro_write( tpdiafile, XLES_MEAN_Rc, 'MEAN_RC', 'Mean Rc Profile', 'kg kg-1', ymasks ) +if ( luserc ) & +call Les_diachro_write( tpdiafile, XLES_MEAN_Cf, 'MEAN_CF', 'Mean Cf Profile', '1', ymasks ) +if ( luserc ) & +call Les_diachro_write( tpdiafile, XLES_MEAN_INDCf, 'MEAN_INDCF', 'Mean Cf>1-6 Profile (0 or 1)', '1', ymasks ) +if ( luserc ) & +call Les_diachro_write( tpdiafile, XLES_MEAN_INDCf2, 'MEAN_INDCF2', 'Mean Cf>1-5 Profile (0 or 1)', '1', ymasks ) +if ( luserr ) & +call Les_diachro_write( tpdiafile, XLES_MEAN_Rr, 'MEAN_RR', 'Mean Rr Profile', 'kg kg-1', ymasks ) +if ( luserr ) & +call Les_diachro_write( tpdiafile, XLES_MEAN_RF, 'MEAN_RF', 'Mean RF Profile', '1', ymasks ) +if ( luseri ) & +call Les_diachro_write( tpdiafile, XLES_MEAN_Ri, 'MEAN_RI', 'Mean Ri Profile', 'kg kg-1', ymasks ) +if ( luseri ) & +call Les_diachro_write( tpdiafile, XLES_MEAN_If, 'MEAN_IF', 'Mean If Profile', '1', ymasks ) +if ( lusers ) & +call Les_diachro_write( tpdiafile, XLES_MEAN_Rs, 'MEAN_RS', 'Mean Rs Profile', 'kg kg-1', ymasks ) +if ( luserg ) & +call Les_diachro_write( tpdiafile, XLES_MEAN_Rg, 'MEAN_RG', 'Mean Rg Profile', 'kg kg-1', ymasks ) +if ( luserh ) & +call Les_diachro_write( tpdiafile, XLES_MEAN_Rh, 'MEAN_RH', 'Mean Rh Profile', 'kg kg-1', ymasks ) + +if ( nsv > 0 ) then + tfield%ndims = 4 + tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_MASK + tfield%ndimlist(4) = NMNHDIM_BUDGET_LES_SV + tfield%ndimlist(5:) = NMNHDIM_UNUSED + + call Les_diachro_write( tpdiafile, XLES_MEAN_Sv, 'MEAN_SV', 'Mean Sv Profiles', 'kg kg-1', ymasks ) + + tfield%ndims = 3 + !tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + !tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + !tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_MASK + tfield%ndimlist(4) = NMNHDIM_UNUSED + !tfield%ndimlist(5:) = NMNHDIM_UNUSED +end if + +call Les_diachro_write( tpdiafile, XLES_MEAN_WIND, 'MEANWIND', 'Profile of Mean Modulus of Wind', 'm s-1', ymasks ) +call Les_diachro_write( tpdiafile, XLES_RESOLVED_MASSFX, 'MEANMSFX', 'Total updraft mass flux', 'kg m-2 s-1', ymasks ) + +if ( lles_pdf ) then + cgroup = 'PDF' + cgroupcomment = '' + + tfield%ndims = 4 + !tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + !tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + !tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_MASK + tfield%ndimlist(4) = NMNHDIM_BUDGET_LES_PDF + tfield%ndimlist(5:) = NMNHDIM_UNUSED + + call Les_diachro_write( tpdiafile, XLES_PDF_TH, 'PDF_TH', 'Pdf potential temperature Profiles', '1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_PDF_W, 'PDF_W', 'Pdf vertical velocity Profiles', '1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_PDF_THV, 'PDF_THV', 'Pdf virtual pot. temp. Profiles', '1', ymasks ) + if ( luserv ) & + call Les_diachro_write( tpdiafile, XLES_PDF_RV, 'PDF_RV', 'Pdf Rv Profiles', '1', ymasks ) + if ( luserc ) then + call Les_diachro_write( tpdiafile, XLES_PDF_RC, 'PDF_RC', 'Pdf Rc Profiles', '1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_PDF_RT, 'PDF_RT', 'Pdf Rt Profiles', '1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_PDF_THL, 'PDF_THL', 'Pdf Thl Profiles', '1', ymasks ) + end if + if ( luserr ) & + call Les_diachro_write( tpdiafile, XLES_PDF_RR, 'PDF_RR', 'Pdf Rr Profiles', '1', ymasks ) + if ( luseri ) & + call Les_diachro_write( tpdiafile, XLES_PDF_RI, 'PDF_RI', 'Pdf Ri Profiles', '1', ymasks ) + if ( lusers ) & + call Les_diachro_write( tpdiafile, XLES_PDF_RS, 'PDF_RS', 'Pdf Rs Profiles', '1', ymasks ) + if ( luserg ) & + call Les_diachro_write( tpdiafile, XLES_PDF_RG, 'PDF_RG', 'Pdf Rg Profiles', '1', ymasks ) +end if +! +!* 2.2 resolved quantities +! ------------------- +! +if ( lles_resolved ) then + !Prepare metadata (used in Les_diachro_write calls) + ldoavg = xles_temp_mean_start /= XUNDEF .and. xles_temp_mean_end /= XUNDEF + ldonorm = trim(cles_norm_type) /= 'NONE' + + cgroup = 'Resolved' + cgroupcomment = 'Mean vertical profiles of the resolved fluxes, variances and covariances' + + tfield%ndims = 3 + tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_MASK + tfield%ndimlist(4:) = NMNHDIM_UNUSED + + call Les_diachro_write( tpdiafile, XLES_RESOLVED_U2, 'RES_U2', 'Resolved <u2> variance', 'm2 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_V2, 'RES_V2', 'Resolved <v2> variance', 'm2 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_W2, 'RES_W2', 'Resolved <w2> variance', 'm2 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_UV, 'RES_UV', 'Resolved <uv> Flux', 'm2 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WU, 'RES_WU', 'Resolved <wu> Flux', 'm2 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WV, 'RES_WV', 'Resolved <wv> Flux', 'm2 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_Ke, 'RES_KE', 'Resolved TKE Profile', 'm2 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_P2, 'RES_P2', 'Resolved pressure variance', 'Pa2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_UP, 'RES_UPZ', 'Resolved <up> horizontal Flux', 'Pa s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_VP, 'RES_VPZ', 'Resolved <vp> horizontal Flux', 'Pa s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WP, 'RES_WPZ', 'Resolved <wp> vertical Flux', 'Pa s-1', ymasks ) + + if ( luserv ) & + call Les_diachro_write( tpdiafile, XLES_RESOLVED_ThThv, 'RES_THTV', & + 'Resolved potential temperature - virtual potential temperature covariance', 'K2', ymasks ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_RESOLVED_ThlThv, 'RES_TLTV', & + 'Resolved liquid potential temperature - virtual potential temperature covariance', 'K2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_Th2, 'RES_TH2', 'Resolved potential temperature variance', 'K2', ymasks ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_RESOLVED_Thl2, 'RES_THL2', 'Resolved liquid potential temperature variance', 'K2',& + ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_UTh, 'RES_UTH', 'Resolved <uth> horizontal Flux', 'm K s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_VTh, 'RES_VTH', 'Resolved <vth> horizontal Flux', 'm K s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WTh, 'RES_WTH', 'Resolved <wth> vertical Flux', 'm K s-1', ymasks ) + + if ( luserc ) then + call Les_diachro_write( tpdiafile, XLES_RESOLVED_UThl, 'RES_UTHL', 'Resolved <uthl> horizontal Flux', 'm K s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_VThl, 'RES_VTHL', 'Resolved <vthl> horizontal Flux', 'm K s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WThl, 'RES_WTHL', 'Resolved <wthl> vertical Flux', 'm K s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_Rt2, 'RES_RT2', 'Resolved total water variance', 'kg2 kg-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WRt, 'RES_WRT', 'Resolved <wrt> vertical Flux', 'm kg kg-1 s-1', ymasks ) + end if + + if ( luserv ) then + call Les_diachro_write( tpdiafile, XLES_RESOLVED_UThv, 'RES_UTHV', 'Resolved <uthv> horizontal Flux', 'm K s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_VThv, 'RES_VTHV', 'Resolved <vthv> horizontal Flux', 'm K s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WThv, 'RES_WTHV', 'Resolved <wthv> vertical Flux', 'm K s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_Rv2, 'RES_RV2', 'Resolved water vapor variance', 'kg2 kg-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_ThRv, 'RES_THRV', 'Resolved <thrv> covariance', 'K kg kg-1', ymasks ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_RESOLVED_ThlRv, 'RES_TLRV', 'Resolved <thlrv> covariance', 'K kg kg-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_ThvRv, 'RES_TVRV', 'Resolved <thvrv> covariance', 'K kg kg-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_URv, 'RES_URV', 'Resolved <urv> horizontal flux', 'm kg kg-1 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_VRv, 'RES_VRV', 'Resolved <vrv> horizontal flux', 'm kg kg-1 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WRv, 'RES_WRV', 'Resolved <wrv> vertical flux', 'm kg kg-1 s-1', ymasks ) + end if + + if ( luserc ) then + call Les_diachro_write( tpdiafile, XLES_RESOLVED_Rc2, 'RES_RC2', 'Resolved cloud water variance', 'kg2 kg-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_ThRc, 'RES_THRC', 'Resolved <thrc> covariance', 'K kg kg-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_ThlRc, 'RES_TLRC', 'Resolved <thlrc> covariance', 'K kg kg-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_ThvRc, 'RES_TVRC', 'Resolved <thvrc> covariance', 'K kg kg-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_URc, 'RES_URC', 'Resolved <urc> horizontal flux', 'm kg kg-1 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_VRc, 'RES_VRC', 'Resolved <vrc> horizontal flux', 'm kg kg-1 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WRc, 'RES_WRC', 'Resolved <wrc> vertical flux', 'm kg kg-1 s-1', ymasks ) + end if + + if ( luseri ) then + call Les_diachro_write( tpdiafile, XLES_RESOLVED_Ri2, 'RES_RI2', 'Resolved cloud ice variance', 'kg2 kg-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_ThRi, 'RES_THRI', 'Resolved <thri> covariance', 'K kg kg-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_ThlRi, 'RES_TLRI', 'Resolved <thlri> covariance', 'K kg kg-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_ThvRi, 'RES_TVRI', 'Resolved <thvri> covariance', 'K kg kg-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_URi, 'RES_URI', 'Resolved <uri> horizontal flux', 'm kg kg-1 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_VRi, 'RES_VRI', 'Resolved <vri> horizontal flux', 'm kg kg-1 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WRi, 'RES_WRI', 'Resolved <wri> vertical flux', 'm kg kg-1 s-1', ymasks ) + end if + + if ( luserr ) then + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WRr, 'RES_WRR', 'Resolved <wrr> vertical flux', 'm kg kg-1 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_INPRR3D, 'INPRR3D', 'Precipitation flux', 'm s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_MAX_INPRR3D, 'MAXINPR3D', 'Max Precip flux', 'm s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_EVAP3D, 'EVAP3D', 'Evaporation profile', 'kg kg-1 s-1', ymasks ) + end if + + if ( nsv > 0 ) then + tfield%ndims = 4 + tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_MASK + tfield%ndimlist(4) = NMNHDIM_BUDGET_LES_SV + tfield%ndimlist(5:) = NMNHDIM_UNUSED + + call Les_diachro_write( tpdiafile, XLES_RESOLVED_Sv2, 'RES_SV2', 'Resolved scalar variables variances', 'kg2 kg-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_ThSv, 'RES_THSV', 'Resolved <ThSv> variance', 'K kg kg-1', ymasks ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_RESOLVED_ThlSv, 'RES_TLSV', 'Resolved <ThlSv> variance', 'K kg kg-1', ymasks ) + if ( luserv ) & + call Les_diachro_write( tpdiafile, XLES_RESOLVED_ThvSv, 'RES_TVSV', 'Resolved <ThvSv> variance', 'K kg kg-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_USv, 'RES_USV', 'Resolved <uSv> horizontal flux', 'm kg kg-1 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_VSv, 'RES_VSV', 'Resolved <vSv> horizontal flux', 'm kg kg-1 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WSv, 'RES_WSV', 'Resolved <wSv> vertical flux', 'm kg kg-1 s-1', ymasks ) + + tfield%ndims = 3 + !tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + !tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + !tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_MASK + tfield%ndimlist(4) = NMNHDIM_UNUSED + !tfield%ndimlist(5:) = NMNHDIM_UNUSED + end if + + call Les_diachro_write( tpdiafile, XLES_RESOLVED_U3, 'RES_U3', 'Resolved <u3>', 'm3 s-3', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_V3, 'RES_V3', 'Resolved <v3>', 'm3 s-3', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_W3, 'RES_W3', 'Resolved <w3>', 'm3 s-3', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_U4, 'RES_U4', 'Resolved <u4>', 'm4 s-4', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_V4, 'RES_V4', 'Resolved <v4>', 'm4 s-4', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_W4, 'RES_W4', 'Resolved <w4>', 'm4 s-4', ymasks ) + + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WThl2, 'RES_WTL2', 'Resolved <wThl2>', 'm K2 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_W2Thl, 'RES_W2TL', 'Resolved <w2Thl>', 'm2 K s-2', ymasks ) + + if ( luserv ) then + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WRv2, 'RES_WRV2', 'Resolved <wRv2>', 'm kg2 kg-2 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_W2Rv, 'RES_W2RV', 'Resolved <w2Rv>', 'm2 kg kg-1 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WRt2, 'RES_WRT2', 'Resolved <wRt2>', 'm kg2 kg-2 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_W2Rt, 'RES_W2RT', 'Resolved <w2Rt>', 'm2 kg kg-1 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WThlRv, 'RE_WTLRV', 'Resolved <wThlRv>', 'm K kg kg-1 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WThlRt, 'RE_WTLRT', 'Resolved <wThlRt>', 'm K kg kg-1 s-1', ymasks ) + end if + + if ( luserc ) then + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WRc2, 'RES_WRC2', 'Resolved <wRc2>', 'm kg2 kg-2 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_W2Rc, 'RES_W2RC', 'Resolved <w2Rc>', 'm2 kg kg-1 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WThlRc, 'RE_WTLRC', 'Resolved <wThlRc>', 'm K kg kg-1 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WRvRc, 'RE_WRVRC', 'Resolved <wRvRc>', 'm kg2 kg-2 s-1', ymasks ) + end if + + if ( luseri ) then + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WRi2, 'RES_WRI2', 'Resolved <wRi2>', 'm kg2 kg-2 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_W2Ri, 'RES_W2RI', 'Resolved <w2Ri>', 'm2 kg kg-1 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WThlRi, 'RE_WTLRI', 'Resolved <wThlRi>', 'm K kg kg-1 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WRvRi, 'RE_WRVRI', 'Resolved <wRvRi>', 'm kg2 kg-2 s-1', ymasks ) + end if + + if ( nsv > 0 ) then + tfield%ndims = 4 + tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_MASK + tfield%ndimlist(4) = NMNHDIM_BUDGET_LES_SV + tfield%ndimlist(5:) = NMNHDIM_UNUSED + + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WSv2, 'RES_WSV2', 'Resolved <wSv2>', 'm kg2 kg-2 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_W2Sv, 'RES_W2SV', 'Resolved <w2Sv>', 'm2 kg kg-1 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WThlSv, 'RE_WTLSV', 'Resolved <wThlSv>', 'm K kg kg-1 s-1', ymasks ) + if ( luserv ) & + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WRvSv, 'RE_WRVSV', 'Resolved <wRvSv>', 'm kg2 kg-2 s-1', ymasks ) + + tfield%ndims = 3 + !tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + !tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + !tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_MASK + tfield%ndimlist(4) = NMNHDIM_UNUSED + !tfield%ndimlist(5:) = NMNHDIM_UNUSED + end if + + call Les_diachro_write( tpdiafile, XLES_RESOLVED_ThlPz, 'RES_TLPZ', 'Resolved <Thldp/dz>', 'K Pa m-1', ymasks ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_RESOLVED_RtPz, 'RES_RTPZ', 'Resolved <Rtdp/dz>', 'kg2 kg-2 Pa m-1', ymasks ) + if ( luserv ) & + call Les_diachro_write( tpdiafile, XLES_RESOLVED_RvPz, 'RES_RVPZ', 'Resolved <Rvdp/dz>', 'kg2 kg-2 Pa m-1', ymasks ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_RESOLVED_RcPz, 'RES_RCPZ', 'Resolved <Rcdp/dz>', 'kg2 kg-2 Pa m-1', ymasks ) + if ( luseri ) & + call Les_diachro_write( tpdiafile, XLES_RESOLVED_RiPz, 'RES_RIPZ', 'Resolved <Ridp/dz>', 'kg2 kg-2 Pa m-1', ymasks ) + + if ( nsv > 0 ) then + tfield%ndims = 4 + tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_MASK + tfield%ndimlist(4) = NMNHDIM_BUDGET_LES_SV + tfield%ndimlist(5:) = NMNHDIM_UNUSED + + call Les_diachro_write( tpdiafile, XLES_RESOLVED_SvPz, 'RES_SVPZ', 'Resolved <Svdp/dz>', 'kg2 kg-2 Pa m-1', ymasks ) + + tfield%ndims = 3 + !tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + !tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + !tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_MASK + tfield%ndimlist(4) = NMNHDIM_UNUSED + !tfield%ndimlist(5:) = NMNHDIM_UNUSED + end if + + call Les_diachro_write( tpdiafile, XLES_RESOLVED_UKe, 'RES_UKE', 'Resolved flux of resolved kinetic energy', 'm3 s-3', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_VKe, 'RES_VKE', 'Resolved flux of resolved kinetic energy', 'm3 s-3', ymasks ) + call Les_diachro_write( tpdiafile, XLES_RESOLVED_WKe, 'RES_WKE', 'Resolved flux of resolved kinetic energy', 'm3 s-3', ymasks ) +end if +! +! +!* 2.3 subgrid quantities +! ------------------ +! +if ( lles_subgrid ) then + !Prepare metadata (used in Les_diachro_write calls) + ldoavg = xles_temp_mean_start /= XUNDEF .and. xles_temp_mean_end /= XUNDEF + ldonorm = trim(cles_norm_type) /= 'NONE' + + cgroup = 'Subgrid' + cgroupcomment = 'Mean vertical profiles of the subgrid fluxes, variances and covariances' + + tfield%ndims = 3 + tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_MASK + tfield%ndimlist(4:) = NMNHDIM_UNUSED + + call Les_diachro_write( tpdiafile, XLES_SUBGRID_Tke, 'SBG_TKE', 'Subgrid TKE', 'm2 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_U2, 'SBG_U2', 'Subgrid <u2> variance', 'm2 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_V2, 'SBG_V2', 'Subgrid <v2> variance', 'm2 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_W2, 'SBG_W2', 'Subgrid <w2> variance', 'm2 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_UV, 'SBG_UV', 'Subgrid <uv> flux', 'm2 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_WU, 'SBG_WU', 'Subgrid <wu> flux', 'm2 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_WV, 'SBG_WV', 'Subgrid <wv> flux', 'm2 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_Thl2, 'SBG_THL2', 'Subgrid liquid potential temperature variance', & + 'K2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_UThl, 'SBG_UTHL', 'Subgrid horizontal flux of liquid potential temperature', & + 'm K s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_VThl, 'SBG_VTHL', 'Subgrid horizontal flux of liquid potential temperature', & + 'm K s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_WThl, 'SBG_WTHL', 'Subgrid vertical flux of liquid potential temperature', & + 'm K s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_WP, 'SBG_WP', 'Subgrid <wp> vertical Flux', 'm Pa s-1', ymasks ) + + call Les_diachro_write( tpdiafile, XLES_SUBGRID_THLUP_MF, 'THLUP_MF', 'Subgrid <thl> of updraft', 'K', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_RTUP_MF, 'RTUP_MF', 'Subgrid <rt> of updraft', 'kg kg-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_RVUP_MF, 'RVUP_MF', 'Subgrid <rv> of updraft', 'kg kg-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_RCUP_MF, 'RCUP_MF', 'Subgrid <rc> of updraft', 'kg kg-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_RIUP_MF, 'RIUP_MF', 'Subgrid <ri> of updraft', 'kg kg-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_WUP_MF, 'WUP_MF', 'Subgrid <w> of updraft', 'm s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_MASSFLUX, 'MAFLX_MF', 'Subgrid <MF> of updraft', 'kg m-2 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_DETR, 'DETR_MF', 'Subgrid <detr> of updraft', 'kg m-3 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_ENTR, 'ENTR_MF', 'Subgrid <entr> of updraft', 'kg m-3 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_FRACUP, 'FRCUP_MF', 'Subgrid <FracUp> of updraft', '1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_THVUP_MF, 'THVUP_MF', 'Subgrid <thv> of updraft', 'K', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_WTHLMF, 'WTHL_MF', 'Subgrid <wthl> of mass flux convection scheme', & + 'm K s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_WRTMF, 'WRT_MF', 'Subgrid <wrt> of mass flux convection scheme', & + 'm kg kg-1 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_WTHVMF, 'WTHV_MF', 'Subgrid <wthv> of mass flux convection scheme', & + 'm K s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_WUMF, 'WU_MF', 'Subgrid <wu> of mass flux convection scheme', & + 'm2 s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_WVMF, 'WV_MF', 'Subgrid <wv> of mass flux convection scheme', & + 'm2 s-2', ymasks ) + + call Les_diachro_write( tpdiafile, XLES_SUBGRID_PHI3, 'SBG_PHI3', 'Subgrid Phi3 function', '1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_LMix, 'SBG_LMIX', 'Subgrid Mixing Length', '1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_LDiss, 'SBG_LDIS', 'Subgrid Dissipation Length', '1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_Km, 'SBG_KM', 'Eddy diffusivity for momentum', 'm2 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_Kh, 'SBG_KH', 'Eddy diffusivity for heat', 'm2 s-1', ymasks ) + + if ( luserv ) then + call Les_diachro_write( tpdiafile, XLES_SUBGRID_WThv, 'SBG_WTHV', 'Subgrid vertical flux of liquid potential temperature', & + 'm K s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_Rt2, 'SBG_RT2', 'Subgrid total water variance', 'kg2 kg-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_ThlRt, 'SBG_TLRT', 'Subgrid <thlrt> covariance', 'K kg kg-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_URt, 'SBG_URT', 'Subgrid total water horizontal flux', & + 'm kg kg-1 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_VRt, 'SBG_VRT', 'Subgrid total water horizontal flux', & + 'm kg kg-1 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_WRt, 'SBG_WRT', 'Subgrid total water vertical flux', & + 'm kg kg-1 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_PSI3, 'SBG_PSI3', 'Subgrid Psi3 function', '1', ymasks ) + end if + + if ( luserc ) then + call Les_diachro_write( tpdiafile, XLES_SUBGRID_Rc2, 'SBG_RC2', 'Subgrid cloud water variance', 'kg2 kg-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_URc, 'SBG_URC', 'Subgrid cloud water horizontal flux', 'm kg kg-1 s-1', & + ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_VRc, 'SBG_VRC', 'Subgrid cloud water horizontal flux', 'm kg kg-1 s-1', & + ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_WRc, 'SBG_WRC', 'Subgrid cloud water vertical flux', 'm kg kg-1 s-1', & + ymasks ) + end if + + if ( nsv > 0 ) then + tfield%ndims = 4 + tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_MASK + tfield%ndimlist(4) = NMNHDIM_BUDGET_LES_SV + tfield%ndimlist(5:) = NMNHDIM_UNUSED + + call Les_diachro_write( tpdiafile, XLES_SUBGRID_USv, 'SBG_USV', 'Subgrid <uSv> horizontal flux', 'm kg kg-1 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_VSv, 'SBG_VSV', 'Subgrid <vSv> horizontal flux', 'm kg kg-1 s-1', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_WSv, 'SBG_WSV', 'Subgrid <wSv> vertical flux', 'm kg kg-1 s-1', ymasks ) + + tfield%ndims = 3 + !tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + !tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + !tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_MASK + tfield%ndimlist(4) = NMNHDIM_UNUSED + !tfield%ndimlist(5:) = NMNHDIM_UNUSED + + + end if + + call Les_diachro_write( tpdiafile, XLES_SUBGRID_UTke, 'SBG_UTKE', 'Subgrid flux of subgrid kinetic energy', 'm3 s-3', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_VTke, 'SBG_VTKE', 'Subgrid flux of subgrid kinetic energy', 'm3 s-3', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_WTke, 'SBG_WTKE', 'Subgrid flux of subgrid kinetic energy', 'm3 s-3', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_W2Thl, 'SBG_W2TL', 'Subgrid flux of subgrid kinetic energy', 'm2 K s-2', ymasks ) + call Les_diachro_write( tpdiafile, XLES_SUBGRID_WThl2, 'SBG_WTL2', 'Subgrid flux of subgrid kinetic energy', 'm K2 s-1', ymasks ) +end if + + +!Prepare metadata (used in Les_diachro_write calls) +tfield%ndims = 2 +tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL +tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME +tfield%ndimlist(3:) = NMNHDIM_UNUSED + +ldoavg = xles_temp_mean_start /= XUNDEF .and. xles_temp_mean_end /= XUNDEF +ldonorm = trim(cles_norm_type) /= 'NONE' +! +!* 2.4 Updraft quantities +! ------------------ +! +if ( lles_updraft ) then + cgroup = 'Updraft' + cgroupcomment = 'Updraft vertical profiles of some resolved and subgrid fluxes, variances and covariances' + + call Les_diachro_write( tpdiafile, XLES_UPDRAFT, 'UP_FRAC', 'Updraft fraction', '1' ) + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_W, 'UP_W', 'Updraft W mean value', 'm s-1' ) + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Th, 'UP_TH', 'Updraft potential temperature mean value', 'K' ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Thl, 'UP_THL', 'Updraft liquid potential temperature mean value', 'K' ) + if ( luserv ) & + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Thv, 'UP_THV', 'Updraft virtual potential temperature mean value', 'K' ) + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Ke, 'UP_KE', 'Updraft resolved TKE mean value', 'm2 s-2' ) + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Tke, 'UP_TKE', 'Updraft subgrid TKE mean value', 'm2 s-2' ) + if ( luserv ) & + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Rv, 'UP_RV', 'Updraft water vapor mean value', 'kg kg-1' ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Rc, 'UP_RC', 'Updraft cloud water mean value', 'kg kg-1' ) + if ( luserr ) & + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Rr, 'UP_RR', 'Updraft rain mean value', 'kg kg-1' ) + if ( luseri ) & + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Ri, 'UP_RI', 'Updraft ice mean value', 'kg kg-1' ) + if ( lusers ) & + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Rs, 'UP_RS', 'Updraft snow mean value', 'kg kg-1' ) + if ( luserg ) & + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Rg, 'UP_RG', 'Updraft graupel mean value', 'kg kg-1' ) + if ( luserh ) & + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Rh, 'UP_RH', 'Updraft hail mean value', 'kg kg-1' ) + + if ( nsv > 0 ) then + tfield%ndims = 3 + tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_SV + tfield%ndimlist(4:) = NMNHDIM_UNUSED + + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Sv, 'UP_SV', 'Updraft scalar variables mean values', 'kg kg-1' ) + + tfield%ndims = 2 + !tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + !tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + tfield%ndimlist(3) = NMNHDIM_UNUSED + !tfield%ndimlist(4:) = NMNHDIM_UNUSED + end if + + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Th2, 'UP_TH2', 'Updraft resolved Theta variance', 'K2' ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Thl2, 'UP_THL2', 'Updraft resolved Theta_l variance', 'K2' ) + if ( luserv ) & + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_ThThv, 'UP_THTV', 'Updraft resolved Theta Theta_v covariance', 'K2' ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_ThlThv, 'UP_TLTV', 'Updraft resolved Theta_l Theta_v covariance', 'K2' ) + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_WTh, 'UP_WTH', 'Updraft resolved WTh flux', 'm K s-1' ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_WThl, 'UP_WTHL', 'Updraft resolved WThl flux', 'm K s-1' ) + if ( luserv ) & + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_WThv, 'UP_WTHV', 'Updraft resolved WThv flux', 'm K s-1' ) + + if ( luserv ) then + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Rv2, 'UP_RV2', 'Updraft resolved water vapor variance', 'kg2 kg-2' ) + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_ThRv, 'UP_THRV', 'Updraft resolved <thrv> covariance', 'K kg kg-1' ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_ThlRv, 'UP_THLRV', 'Updraft resolved <thlrv> covariance', 'K kg kg-1' ) + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_ThvRv, 'UP_THVRV', 'Updraft resolved <thvrv> covariance', 'K kg kg-1' ) + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_WRv, 'UP_WRV', 'Updraft resolved <wrv> vertical flux', 'm kg kg-1 s-1' ) + end if + + if ( luserc ) then + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Rc2, 'UP_RC2', 'Updraft resolved cloud water variance', 'kg2 kg-2' ) + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_ThRc, 'UP_THRC', 'Updraft resolved <thrc> covariance', 'K kg kg-1' ) + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_ThlRc, 'UP_THLRC', 'Updraft resolved <thlrc> covariance', 'K kg kg-1' ) + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_ThvRc, 'UP_THVRC', 'Updraft resolved <thvrc> covariance', 'K kg kg-1' ) + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_WRc, 'UP_WRC', 'Updraft resolved <wrc> vertical flux', 'm kg kg-1 s-1' ) + end if + + if ( luseri ) then + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Ri2, 'UP_RI2', 'Updraft resolved cloud ice variance', 'kg2 kg-2' ) + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_ThRi, 'UP_THRI', 'Updraft resolved <thri> covariance', 'K kg kg-1' ) + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_ThlRi, 'UP_THLRI', 'Updraft resolved <thlri> covariance', 'K kg kg-1' ) + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_ThvRi, 'UP_THVRI', 'Updraft resolved <thvri> covariance', 'K kg kg-1' ) + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_WRi, 'UP_WRI', 'Updraft resolved <wri> vertical flux', 'm kg kg-1 s-1' ) + end if + + + if ( nsv > 0 ) then + tfield%ndims = 3 + tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_SV + tfield%ndimlist(4:) = NMNHDIM_UNUSED + + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_Sv2, 'UP_SV2', 'Updraft resolved scalar variables variances', 'kg2 kg-2' ) + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_ThSv, 'UP_THSV', 'Updraft resolved <ThSv> variance', 'K kg kg-1' ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_ThlSv, 'UP_THLSV', 'Updraft resolved <ThlSv> variance', 'K kg kg-1' ) + if ( luserv ) & + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_ThvSv, 'UP_THVSV', 'Updraft resolved <ThvSv> variance', 'K kg kg-1' ) + call Les_diachro_write( tpdiafile, XLES_UPDRAFT_WSv, 'UP_WSV', 'Updraft resolved <wSv> vertical flux', 'm kg kg-1 s-1' ) + + tfield%ndims = 2 + !tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + !tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + tfield%ndimlist(3) = NMNHDIM_UNUSED + !tfield%ndimlist(4:) = NMNHDIM_UNUSED + end if +end if +! +! +!* 2.5 Downdraft quantities +! -------------------- +! +if ( lles_downdraft ) then + cgroup = 'Downdraft' + cgroupcomment = 'Downdraft vertical profiles of some resolved and subgrid fluxes, variances and covariances' + + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT, 'DW_FRAC', 'Downdraft fraction', '1' ) + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_W, 'DW_W', 'Downdraft W mean value', 'm s-1' ) + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Th, 'DW_TH', 'Downdraft potential temperature mean value', 'K' ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Thl, 'DW_THL', 'Downdraft liquid potential temperature mean value', 'K' ) + if ( luserv ) & + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Thv, 'DW_THV', 'Downdraft virtual potential temperature mean value', 'K' ) + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Ke, 'DW_KE', 'Downdraft resolved TKE mean value', 'm2 s-2' ) + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Tke, 'DW_TKE', 'Downdraft subgrid TKE mean value', 'm2 s-2' ) + if ( luserv ) & + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Rv, 'DW_RV', 'Downdraft water vapor mean value', 'kg kg-1' ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Rc, 'DW_RC', 'Downdraft cloud water mean value', 'kg kg-1' ) + if ( luserr ) & + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Rr, 'DW_RR', 'Downdraft rain mean value', 'kg kg-1' ) + if ( luseri ) & + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Ri, 'DW_RI', 'Downdraft ice mean value', 'kg kg-1' ) + if ( lusers ) & + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Rs, 'DW_RS', 'Downdraft snow mean value', 'kg kg-1' ) + if ( luserg ) & + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Rg, 'DW_RG', 'Downdraft graupel mean value', 'kg kg-1' ) + if ( luserh ) & + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Rh, 'DW_RH', 'Downdraft hail mean value', 'kg kg-1' ) + + if ( nsv > 0 ) then + tfield%ndims = 3 + tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_SV + tfield%ndimlist(4:) = NMNHDIM_UNUSED + + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Sv, 'DW_SV', 'Downdraft scalar variables mean values', 'kg kg-1' ) + + tfield%ndims = 2 + !tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + !tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + tfield%ndimlist(3) = NMNHDIM_UNUSED + !tfield%ndimlist(4:) = NMNHDIM_UNUSED + end if + + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Th2, 'DW_TH2', 'Downdraft resolved Theta variance', 'K2' ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Thl2, 'DW_THL2', 'Downdraft resolved Theta_l variance', 'K2' ) + if ( luserv ) & + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_ThThv, 'DW_THTV', 'Downdraft resolved Theta Theta_v covariance', 'K2' ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_ThlThv, 'DW_TLTV', 'Downdraft resolved Theta_l Theta_v covariance', 'K2' ) + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_WTh, 'DW_WTH', 'Downdraft resolved WTh flux', 'm K s-1' ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_WThl, 'DW_WTHL', 'Downdraft resolved WThl flux', 'm K s-1' ) + if ( luserv ) & + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_WThv, 'DW_WTHV', 'Downdraft resolved WThv flux', 'm K s-1' ) + + if ( luserv ) then + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Rv2, 'DW_RV2', 'Downdraft resolved water vapor variance', 'kg2 kg-2' ) + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_ThRv, 'DW_THRV', 'Downdraft resolved <thrv> covariance', 'K kg kg-1' ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_ThlRv, 'DW_THLRV', 'Downdraft resolved <thlrv> covariance', 'K kg kg-1' ) + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_ThvRv, 'DW_THVRV', 'Downdraft resolved <thvrv> covariance', 'K kg kg-1' ) + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_WRv, 'DW_WRV', 'Downdraft resolved <wrv> vertical flux', & + 'm kg kg-1 s-1' ) + end if + + if ( luserc ) then + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Rc2, 'DW_RC2', 'Downdraft resolved cloud water variance', 'kg2 kg-2' ) + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_ThRc, 'DW_THRC', 'Downdraft resolved <thrc> covariance', 'K kg kg-1' ) + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_ThlRc, 'DW_THLRC', 'Downdraft resolved <thlrc> covariance', 'K kg kg-1' ) + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_ThvRc, 'DW_THVRC', 'Downdraft resolved <thvrc> covariance', 'K kg kg-1' ) + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_WRc, 'DW_WRC', 'Downdraft resolved <wrc> vertical flux', & + 'm kg kg-1 s-1' ) + end if + + if ( luseri ) then + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Ri2, 'DW_RI2', 'Downdraft resolved cloud ice variance', 'kg2 kg-2' ) + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_ThRi, 'DW_THRI', 'Downdraft resolved <thri> covariance', 'K kg kg-1' ) + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_ThlRi, 'DW_THLRI', 'Downdraft resolved <thlri> covariance', 'K kg kg-1' ) + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_ThvRi, 'DW_THVRI', 'Downdraft resolved <thvri> covariance', 'K kg kg-1' ) + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_WRi, 'DW_WRI', 'Downdraft resolved <wri> vertical flux', & + 'm kg kg-1 s-1' ) + end if + + + if ( nsv > 0 ) then + tfield%ndims = 3 + tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + tfield%ndimlist(3) = NMNHDIM_BUDGET_LES_SV + tfield%ndimlist(4:) = NMNHDIM_UNUSED + + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_Sv2, 'DW_SV2', 'Downdraft resolved scalar variables variances', & + 'kg2 kg-2' ) + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_ThSv, 'DW_THSV', 'Downdraft resolved <ThSv> variance', & + 'K kg kg-1' ) + if ( luserc ) & + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_ThlSv, 'DW_THLSV', 'Downdraft resolved <ThlSv> variance', & + 'K kg kg-1' ) + if ( luserv ) & + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_ThvSv, 'DW_THVSV', 'Downdraft resolved <ThvSv> variance', & + 'K kg kg-1' ) + call Les_diachro_write( tpdiafile, XLES_DOWNDRAFT_WSv, 'DW_WSV', 'Downdraft resolved <wSv> vertical flux', & + 'm kg kg-1 s-1' ) + + tfield%ndims = 2 + !tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL + !tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME + tfield%ndimlist(3) = NMNHDIM_UNUSED + !tfield%ndimlist(4:) = NMNHDIM_UNUSED + end if +end if +! +!------------------------------------------------------------------------------- +! +!* 3. surface normalization parameters +! -------------------------------- +! +cgroup = 'Radiation' +cgroupcomment = 'Radiative terms' + +!Prepare metadata (used in Les_diachro_write calls) +tfield%ndims = 2 +tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_LEVEL +tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_TIME +tfield%ndimlist(3:) = NMNHDIM_UNUSED + +ldoavg = xles_temp_mean_start /= XUNDEF .and. xles_temp_mean_end /= XUNDEF +ldonorm = .false. + +call Les_diachro_write( tpdiafile, XLES_SWU, 'SWU', 'SW upward radiative flux', 'W m-2' ) +call Les_diachro_write( tpdiafile, XLES_SWD, 'SWD', 'SW downward radiative flux', 'W m-2' ) +call Les_diachro_write( tpdiafile, XLES_LWU, 'LWU', 'LW upward radiative flux', 'W m-2' ) +call Les_diachro_write( tpdiafile, XLES_LWD, 'LWD', 'LW downward radiative flux', 'W m-2' ) +call Les_diachro_write( tpdiafile, XLES_DTHRADSW, 'DTHRADSW', 'SW radiative temperature tendency', 'K s-1' ) +call Les_diachro_write( tpdiafile, XLES_DTHRADLW, 'DTHRADLW', 'LW radiative temperature tendency', 'K s-1' ) +!writes mean_effective radius at all levels +call Les_diachro_write( tpdiafile, XLES_RADEFF, 'RADEFF', 'Mean effective radius', 'micron' ) + + +cgroup = 'Surface' +cgroupcomment = 'Averaged surface fields' + +! !Prepare metadate (used in Les_diachro_write calls) +tfield%ndims = 1 +tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_TIME +tfield%ndimlist(2:) = NMNHDIM_UNUSED + +call Les_diachro_write( tpdiafile, XLES_Q0, 'Q0', 'Sensible heat flux at the surface', 'm K s-1' ) +if ( luserv ) & +call Les_diachro_write( tpdiafile, XLES_E0, 'E0', 'Latent heat flux at the surface', 'kg kg-1 m s-1' ) + +if ( nsv > 0 ) then + tfield%ndims = 2 + tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_TIME + tfield%ndimlist(2) = NMNHDIM_BUDGET_LES_SV + tfield%ndimlist(3:) = NMNHDIM_UNUSED + + call Les_diachro_write( tpdiafile, XLES_SV0, 'SV0', 'Scalar variable fluxes at the surface', 'kg kg-1 m s-1' ) + + tfield%ndims = 1 + !tfield%ndimlist(1) = NMNHDIM_BUDGET_LES_TIME + tfield%ndimlist(2) = NMNHDIM_UNUSED + !tfield%ndimlist(3:) = NMNHDIM_UNUSED +end if + +call Les_diachro_write( tpdiafile, XLES_USTAR, 'Ustar', 'Friction velocity', 'm s-1' ) +call Les_diachro_write( tpdiafile, XLES_WSTAR, 'Wstar', 'Convective velocity', 'm s-1' ) +call Les_diachro_write( tpdiafile, XLES_MO_LENGTH, 'L_MO', 'Monin-Obukhov length', 'm' ) +if ( luserr ) & +call Les_diachro_write( tpdiafile, XLES_PRECFR, 'PREC_FRAC', 'Fraction of columns where rain at surface', '1' ) +if ( luserr ) & +call Les_diachro_write( tpdiafile, XLES_INPRR, 'INST_PREC', 'Instantaneous precipitation rate', 'mm day-1' ) +if ( luserc ) & +call Les_diachro_write( tpdiafile, XLES_INPRC, 'INST_SEDIM', 'Instantaneous cloud precipitation rate', 'mm day-1' ) +if ( luserc .and. ( ldeposc .or. ldepoc ) ) & +call Les_diachro_write( tpdiafile, XLES_INDEP, 'INST_DEPOS', 'Instantaneous cloud deposition rate', 'mm day-1' ) +if ( luserr ) & +call Les_diachro_write( tpdiafile, XLES_RAIN_INPRR, 'RAIN_PREC', 'Instantaneous precipitation rate over rainy grid cells', & + 'mm day-1' ) +if ( luserr ) & +call Les_diachro_write( tpdiafile, XLES_ACPRR, 'ACCU_PREC', 'Accumulated precipitation rate', 'mm' ) + + +cgroup = 'Miscellaneous' +cgroupcomment = 'Miscellaneous terms (geometry, various unclassified averaged terms...)' + +call Les_diachro_write( tpdiafile, XLES_BL_HEIGHT, 'BL_H', 'Boundary Layer Height', 'm' ) +call Les_diachro_write( tpdiafile, XLES_INT_TKE, 'INT_TKE', 'Vertical integrated TKE', 'm2 s-2' ) +if ( luserc ) & +call Les_diachro_write( tpdiafile, XLES_ZCB, 'ZCB', 'Cloud base Height', 'm' ) +if ( luserc ) & +call Les_diachro_write( tpdiafile, XLES_CFtot, 'ZCFTOT', 'Total cloud cover (rc>1e-6)', '1' ) +if ( luserc ) & +call Les_diachro_write( tpdiafile, XLES_CF2tot, 'ZCF2TOT', 'Total cloud cover (rc>1e-5)', '1' ) +if ( luserc ) & +call Les_diachro_write( tpdiafile, XLES_LWP, 'LWP', 'Liquid Water path', 'kg m-2' ) +if ( luserc ) & +call Les_diachro_write( tpdiafile, XLES_LWPVAR, 'LWPVAR', 'Liquid Water path variance', 'kg m-4' ) +if ( luserr ) & +call Les_diachro_write( tpdiafile, XLES_RWP, 'RWP', 'Rain Water path', 'kg m-2' ) +if ( luseri ) & +call Les_diachro_write( tpdiafile, XLES_IWP, 'IWP', 'Ice Water path', 'kg m-2' ) +if ( lusers ) & +call Les_diachro_write( tpdiafile, XLES_SWP, 'SWP', 'Snow Water path', 'kg m-2' ) +if ( luserg ) & +call Les_diachro_write( tpdiafile, XLES_GWP, 'GWP', 'Graupel Water path', 'kg m-2' ) +if ( luserh ) & +call Les_diachro_write( tpdiafile, XLES_HWP, 'HWP', 'Hail Water path', 'kg m-2' ) +if ( luserc ) & +call Les_diachro_write( tpdiafile, XLES_ZMAXCF, 'ZMAXCF', 'Height of Cloud fraction maximum (rc>1e-6)', 'm' ) +if ( luserc ) & +call Les_diachro_write( tpdiafile, XLES_ZMAXCF2, 'ZMAXCF2', 'Height of Cloud fraction maximum (rc>1e-5)', 'm' ) + +!------------------------------------------------------------------------------- +! +!* 4. LES budgets +! ----------- +! +call Write_les_budget_n( tpdiafile ) + +if ( luserv ) call Write_les_rt_budget_n( tpdiafile ) + +if ( nsv > 0 ) call Write_les_sv_budget_n( tpdiafile ) +! +!------------------------------------------------------------------------------- +! +!* 5. (ni,z,t) and (nj,z,t) 2points correlations +! ------------------------------------------ +! +if ( nspectra_k > 0 ) then + tfieldx%cstdname = '' + tfieldx%ngrid = 0 !Not on the Arakawa grid + tfieldx%ntype = TYPEREAL + tfieldx%ndims = 3 + tfieldx%ndimlist(1) = NMNHDIM_SPECTRA_2PTS_NI + tfieldx%ndimlist(2) = NMNHDIM_SPECTRA_LEVEL + tfieldx%ndimlist(3) = NMNHDIM_BUDGET_LES_TIME + tfieldx%ndimlist(4:) = NMNHDIM_UNUSED + + tfieldy%cstdname = '' + tfieldy%ngrid = 0 !Not on the Arakawa grid + tfieldy%ntype = TYPEREAL + tfieldy%ndims = 3 + tfieldy%ndimlist(1) = NMNHDIM_SPECTRA_2PTS_NJ + tfieldy%ndimlist(2) = NMNHDIM_SPECTRA_LEVEL + tfieldy%ndimlist(3) = NMNHDIM_BUDGET_LES_TIME + tfieldy%ndimlist(4:) = NMNHDIM_UNUSED + + call Les_diachro_2pt_write( tpdiafile, XCORRi_UU, XCORRj_UU, 'UU', 'U*U 2 points correlations', 'm2 s-2' ) + call Les_diachro_2pt_write( tpdiafile, XCORRi_VV, XCORRj_VV, 'VV', 'V*V 2 points correlations', 'm2 s-2' ) + call Les_diachro_2pt_write( tpdiafile, XCORRi_WW, XCORRj_WW, 'WW', 'W*W 2 points correlations', 'm2 s-2' ) + call Les_diachro_2pt_write( tpdiafile, XCORRi_UV, XCORRj_UV, 'UV', 'U*V 2 points correlations', 'm2 s-2' ) + call Les_diachro_2pt_write( tpdiafile, XCORRi_WU, XCORRj_WU, 'WU', 'W*U 2 points correlations', 'm2 s-2' ) + call Les_diachro_2pt_write( tpdiafile, XCORRi_WV, XCORRj_WV, 'WV', 'W*V 2 points correlations', 'm2 s-2' ) + + call Les_diachro_2pt_write( tpdiafile, XCORRi_ThTh, XCORRj_ThTh, 'THTH', 'Th*Th 2 points correlations', 'K2' ) + if ( luserc ) & + call Les_diachro_2pt_write( tpdiafile, XCORRi_ThlThl, XCORRj_ThlThl, 'TLTL', 'Thl*Thl 2 points correlations', 'K2' ) + call Les_diachro_2pt_write( tpdiafile, XCORRi_WTh, XCORRj_WTh, 'WTH', 'W*Th 2 points correlations', 'm K s-1' ) + if ( luserc ) & + call Les_diachro_2pt_write( tpdiafile, XCORRi_WThl, XCORRj_WThl, 'WTHL', 'W*Thl 2 points correlations', 'm K s-1' ) + + if ( luserv ) then + call Les_diachro_2pt_write( tpdiafile, XCORRi_RvRv, XCORRj_RvRv, 'RVRV', 'rv*rv 2 points correlations', 'kg2 kg-2' ) + call Les_diachro_2pt_write( tpdiafile, XCORRi_ThRv, XCORRj_ThRv, 'THRV', 'TH*RV 2 points correlations', 'K kg kg-1' ) + if ( luserc ) & + call Les_diachro_2pt_write( tpdiafile, XCORRi_ThlRv, XCORRj_ThlRv, 'TLRV', 'thl*rv 2 points correlations', 'K kg kg-1' ) + call Les_diachro_2pt_write( tpdiafile, XCORRi_WRv, XCORRj_WRv, 'WRV', 'W*rv 2 points correlations', 'm kg s-1 kg-1' ) + end if + + if ( luserc ) then + call Les_diachro_2pt_write( tpdiafile, XCORRi_RcRc, XCORRj_RcRc, 'RCRC', 'rc*rc 2 points correlations', 'kg2 kg-2' ) + call Les_diachro_2pt_write( tpdiafile, XCORRi_ThRc, XCORRj_ThRc, 'THRC', 'th*rc 2 points correlations', 'K kg kg-1' ) + call Les_diachro_2pt_write( tpdiafile, XCORRi_ThlRc, XCORRj_ThlRc, 'TLRC', 'thl*rc 2 points correlations', 'K kg kg-1' ) + call Les_diachro_2pt_write( tpdiafile, XCORRi_WRc, XCORRj_WRc, 'WRC', 'W*rc 2 points correlations', 'm kg s-1 kg-1' ) + end if + + if ( luseri ) then + call Les_diachro_2pt_write( tpdiafile, XCORRi_RiRi, XCORRj_RiRi, 'RIRI', 'ri*ri 2 points correlations', 'kg2 kg-2' ) + call Les_diachro_2pt_write( tpdiafile, XCORRi_ThRi, XCORRj_ThRi, 'THRI', 'th*ri 2 points correlations', 'K kg kg-1' ) + call Les_diachro_2pt_write( tpdiafile, XCORRi_ThlRi, XCORRj_ThlRi, 'TLRI', 'thl*ri 2 points correlations', 'K kg kg-1' ) + call Les_diachro_2pt_write( tpdiafile, XCORRi_WRi, XCORRj_WRi, 'WRI', 'W*ri 2 points correlations', 'm kg s-1 kg-1' ) + end if + +!PW: TODO: ameliorer le ygroup (tenir compte de ce qu'est la variable scalaire et pas juste son jsv!) + do jsv = 1, nsv + Write( ygroup, fmt = "( a2, i3.3 )" ) "SS", jsv + call Les_diachro_2pt_write( tpdiafile, XCORRi_SvSv(:,:,:,JSV), XCORRj_SvSv(:,:,:,JSV), ygroup, & + 'Sv*Sv 2 points correlations','kg2 kg-2' ) + end do + +!PW: TODO: ameliorer le ygroup (tenir compte de ce qu'est la variable scalaire et pas juste son jsv!) + do jsv = 1, nsv + Write( ygroup, fmt = "( a2, i3.3 )" ) "WS", jsv + call Les_diachro_2pt_write( tpdiafile, XCORRi_WSv(:,:,:,JSV), XCORRj_WSv(:,:,:,JSV), ygroup, & + 'W*Sv 2 points correlations','m kg s-1 kg-1' ) + end do +end if +! +!------------------------------------------------------------------------------- +! +!* 6. spectra and time-averaged profiles (if first call to WRITE_LES_n) +! ---------------------------------- +! +call Les_spec_n( tpdiafile ) +! +!------------------------------------------------------------------------------- +! +!* 7. deallocations +! ------------- +! +CALL LES_DEALLOCATE('XLES_CURRENT_Z') + +IF (CLES_NORM_TYPE/='NONE' ) THEN + CALL LES_DEALLOCATE('XLES_NORM_M') + CALL LES_DEALLOCATE('XLES_NORM_S') + CALL LES_DEALLOCATE('XLES_NORM_K') + CALL LES_DEALLOCATE('XLES_NORM_RHO') + CALL LES_DEALLOCATE('XLES_NORM_RV') + CALL LES_DEALLOCATE('XLES_NORM_SV') + CALL LES_DEALLOCATE('XLES_NORM_P') +END IF + +end subroutine Write_les_n + +!------------------------------------------------------------------------------ + +subroutine Les_diachro_write_1D( tpdiafile, pdata, hmnhname, hcomment, hunits ) + +use modd_io, only: tfiledata + +use mode_les_diachro, only: Les_diachro + +type(tfiledata), intent(in) :: tpdiafile ! file to write +real, dimension(:), intent(in) :: pdata +character(len=*), intent(in) :: hmnhname +character(len=*), intent(in) :: hcomment +character(len=*), intent(in) :: hunits + +tfield%cmnhname = hmnhname +tfield%clongname = hmnhname +tfield%ccomment = hcomment +tfield%cunits = hunits + +call Les_diachro( tpdiafile, tfield, cgroup, cgroupcomment, ldoavg, ldonorm, pdata ) + +end subroutine Les_diachro_write_1D + +!------------------------------------------------------------------------------ + +subroutine Les_diachro_write_2D( tpdiafile, pdata, hmnhname, hcomment, hunits ) + +use modd_io, only: tfiledata + +use mode_les_diachro, only: Les_diachro + +type(tfiledata), intent(in) :: tpdiafile ! file to write +real, dimension(:,:), intent(in) :: pdata +character(len=*), intent(in) :: hmnhname +character(len=*), intent(in) :: hcomment +character(len=*), intent(in) :: hunits + +tfield%cmnhname = hmnhname +tfield%clongname = hmnhname +tfield%ccomment = hcomment +tfield%cunits = hunits + +call Les_diachro( tpdiafile, tfield, cgroup, cgroupcomment, ldoavg, ldonorm, pdata ) + +end subroutine Les_diachro_write_2D + +!------------------------------------------------------------------------------ + +subroutine Les_diachro_write_3D( tpdiafile, pdata, hmnhname, hcomment, hunits, hmasks ) + +use modd_io, only: tfiledata + +use mode_les_diachro, only: Les_diachro + +type(tfiledata), intent(in) :: tpdiafile ! file to write +real, dimension(:,:,:), intent(in) :: pdata +character(len=*), intent(in) :: hmnhname +character(len=*), intent(in) :: hcomment +character(len=*), intent(in) :: hunits +character(len=*), dimension(:), optional, intent(in) :: hmasks + +tfield%cmnhname = hmnhname +tfield%clongname = hmnhname +tfield%ccomment = hcomment +tfield%cunits = hunits + +call Les_diachro( tpdiafile, tfield, cgroup, cgroupcomment, ldoavg, ldonorm, pdata, hmasks = hmasks ) + +end subroutine Les_diachro_write_3D + +!------------------------------------------------------------------------------ + +subroutine Les_diachro_write_4D( tpdiafile, pdata, hmnhname, hcomment, hunits, hmasks ) + +use modd_io, only: tfiledata + +use mode_les_diachro, only: Les_diachro + +type(tfiledata), intent(in) :: tpdiafile ! file to write +real, dimension(:,:,:,:), intent(in) :: pdata +character(len=*), intent(in) :: hmnhname +character(len=*), intent(in) :: hcomment +character(len=*), intent(in) :: hunits +character(len=*), dimension(:), optional, intent(in) :: hmasks + +tfield%cmnhname = hmnhname +tfield%clongname = hmnhname +tfield%ccomment = hcomment +tfield%cunits = hunits + +call Les_diachro( tpdiafile, tfield, cgroup, cgroupcomment, ldoavg, ldonorm, pdata, hmasks = hmasks ) + +end subroutine Les_diachro_write_4D + +!------------------------------------------------------------------------------ + +subroutine Les_diachro_2pt_write( tpdiafile, zcorri, zcorrj, hmnhname, hcomment, hunits ) + +use modd_io, only: tfiledata + +use mode_les_diachro, only: Les_diachro_2pt + +type(tfiledata), intent(in) :: tpdiafile ! file to write +real, dimension(:,:,:), intent(in) :: zcorri ! 2 pts correlation data +real, dimension(:,:,:), intent(in) :: zcorrj ! 2 pts correlation data +character(len=*), intent(in) :: hmnhname +character(len=*), intent(in) :: hcomment +character(len=*), intent(in) :: hunits + +tfieldx%cmnhname = hmnhname +tfieldx%clongname = hmnhname +tfieldx%ccomment = hcomment +tfieldx%cunits = hunits + +tfieldy%cmnhname = hmnhname +tfieldy%clongname = hmnhname +tfieldy%ccomment = hcomment +tfieldy%cunits = hunits + +call Les_diachro_2pt( tpdiafile, tfieldx, tfieldy, zcorri, zcorrj ) + +end subroutine Les_diachro_2pt_write + +!------------------------------------------------------------------------------ + +end module mode_write_les_n diff --git a/src/mesonh/ext/write_lfifm1_for_diag.f90 b/src/mesonh/ext/write_lfifm1_for_diag.f90 new file mode 100644 index 0000000000000000000000000000000000000000..aedaff6be38490ff7abe6b69f93592cf4991c13c --- /dev/null +++ b/src/mesonh/ext/write_lfifm1_for_diag.f90 @@ -0,0 +1,4153 @@ +!MNH_LIC Copyright 1994-2021 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_WRITE_LFIFM1_FOR_DIAG +!################################ +INTERFACE + SUBROUTINE WRITE_LFIFM1_FOR_DIAG(TPFILE,HDADFILE) +! +USE MODD_IO, ONLY: TFILEDATA +! +TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! outpput data file +CHARACTER(LEN=28), INTENT(IN) :: HDADFILE ! corresponding FM-file name of + ! its DAD model +! +END SUBROUTINE WRITE_LFIFM1_FOR_DIAG +END INTERFACE +END MODULE MODI_WRITE_LFIFM1_FOR_DIAG +! +! ################################################## + SUBROUTINE WRITE_LFIFM1_FOR_DIAG(TPFILE,HDADFILE) +! ################################################## +! +!!**** *WRITE_LFIFM1* - routine to write a LFIFM file for model 1 +!! +!! PURPOSE +!! ------- +! The purpose of this routine is to write an initial LFIFM File +! of name YFMFILE2//'.lfi' with the FM routines. +! +!!** METHOD +!! ------ +!! The data are written in the LFIFM file : +!! - dimensions +!! - grid variables +!! - configuration variables +!! - prognostic variables at time t and t-dt +!! - 1D anelastic reference state +!! +!! The localization on the model grid is also indicated : +!! +!! IGRID = 1 for mass grid point +!! IGRID = 2 for U grid point +!! IGRID = 3 for V grid point +!! IGRID = 4 for w grid point +!! IGRID = 0 for meaningless case +!! +!! +!! EXTERNAL +!! -------- +!! FMWRIT : FM-routine to write a record +!! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! Module MODD_DIM1 : contains dimensions +!! Module MODD_TIME1 : contains time variables and uses MODD_TIME +!! Module MODD_GRID : contains spatial grid variables for all models +!! Module MODD_GRID1 : contains spatial grid variables +!! Module MODD_REF : contains reference state variables +!! Module MODD_LUNIT1: contains logical unit variables. +!! Module MODD_CONF : contains configuration variables for all models +!! Module MODD_CONF1 : contains configuration variables +!! Module MODD_FIELD1 : contains prognostic variables +!! Module MODD_GR_FIELD1 : contains surface prognostic variables +!! Module MODD_LSFIELD1 : contains Larger Scale variables +!! Module MODD_PARAM1 : contains parameterization options +!! Module MODD_TURB1 : contains turbulence options +!! Module MODD_FRC : contains forcing variables +!! +!! REFERENCE +!! --------- +!! +!! +!! AUTHOR +!! ------ +!! V. Ducrocq *Meteo France* +!! +!! MODIFICATIONS +!! ------------- +!! Original 06/05/94 +!! V. Ducrocq 27/06/94 +!! J.Stein 20/10/94 (name of the FMFILE) +!! J.Stein 06/12/94 add the LS fields +!! J.P. Lafore 09/01/95 add the DRYMASST +!! J.Stein 20/01/95 add TKE and change the ycomment for the water +!! variables +!! J.Stein 23/01/95 add a TKE switch and MODD_PARAM1 +!! J.Stein 16/03/95 remove R from the historical variables +!! J.Stein 20/03/95 add the EPS var. +!! J.Stein 30/06/95 add the variables related to the subgrid condens +!! S. Belair 01/09/95 add surface variables and ground parameters +!! J.-P. Pinty 15/09/95 add the radiation parameters +!! J.Stein 23/01/96 add the TSZ0 option for the surface scheme +!! M.Georgelin 13/12/95 add the forcing variables +!! J.-P. Pinty 15/02/96 add external control for the forcing +!! J.Stein P.Bougeault 15/03/96 add the cloud fraction and change the +!! surface parameters for TSZ0 option +!! J.Stein P.Jabouille 30/04/96 add the storage type +!! J.Stein P.Jabouille 20/05/96 switch for XSIGS and XSRC +!! J.Stein 10/10/96 change Xsrc into XSRCM and XRCT +!! J.P. Lafore 30/07/96 add YFMFILE2 and HDADFILE writing +!! corresponding to MY_NAME and DAD_NAME (for nesting) +!! V.Masson 08/10/96 add LTHINSHELL +!! J.-P. Pinty 15/12/96 add the microphysics (ice) +!! J.-P. Pinty 11/01/97 add the deep convection +!! J.-P. Pinty 27/01/97 split the recording of the SV array +!! J.-P. Pinty 29/01/97 set recording of PRCONV and PACCONV in mm/h and +!! mm respectively +!! J. Viviand 04/02/97 convert precipitation rates in mm/h +!! P. Hereil 04/12/97 add the calculation of cloud top and moist PV +!! P.Hereil N Asencio 3/02/98 add the calculation of precipitation on large scale grid mesh +!! N Asencio 2/10/98 suppress flux calculation if start file +!! V Masson 25/11/98 places dummy arguments in module MODD_DIAG_FLAG +!! V Masson 04/01/00 removes TSZ0 option +!! J.-P. Pinty 29/11/02 add C3R5, ICE2, ICE4, CELEC +!! V Masson 01/2004 removes surface (externalization) +!! P. Tulet 01/2005 add dust, orilam +!! M. Leriche 04/2007 add aqueous concentration in M +!! O. Caumont 03/2008 add simulation of radar observations +!! O. Caumont 14/09/2009 modifications to allow for polar outputs (radar diagnostics) +!! October 2009 (G. Tanguy) add ILENCH=LEN(YCOMMENT) after +!! change of YCOMMENT +!! G. Tanguy 10/2009 add possibility to run radar after +!! PREP_REAL_CASE with AROME +!! O. Caumont 01/2011 [radar diagnostics] add control check for NMAX; revise comments +!! O. Caumont 05/2011 [radar diagnostics] change output format +!! G.Tanguy/ JP Pinty/ JP Chabureau 18/05/2011 : add lidar simulator +!! S.Bielli 12/2012 : add latitude and longitude +!! F. Duffourg 02/2013 : add new fields +!! J.Escobar 21/03/2013: for HALOK get correctly local array dim/bound +!! J. escobar 27/03/2014 : write LAT/LON only in not CARTESIAN case +!! G.Delautier 2014 : remplace MODD_RAIN_C2R2_PARAM par MODD_RAIN_C2R2_KHKO_PARAM +!! C. Augros 2014 : new radar simulator (T matrice) +!! D.Ricard 2015 : add THETAES + POVOES (LMOIST_ES=T) +!! Modification 01/2016 (JP Pinty) Add LIMA +!! C.Lac 04/2016 : add visibility and droplet deposition +!! 10/2017 (G.Delautier) New boundary layer height : replace LBLTOP by CBLTOP +!! T.Dauhut 10/2017 : add parallel 3D clustering +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +!! D.Ricard and P.Marquet 2016-2017 : THETAL + THETAS1 POVOS1 or THETAS2 POVOS2 +!! if LMOIST_L LMOIST_S1 or LMOIST_S2 +! P. Wautelet 08/02/2019: minor bug: compute ZWORK36 only when needed +! S Bielli 02/2019: sea salt: significant sea wave height influences salt emission; 5 salt modes +! P. Wautelet 18/03/2020: remove ICE2 option +! B. Vie 06/2020 Add prognostic supersaturation for LIMA +! P. Wautelet 11/03/2021: bugfix: correct name for NSV_LIMA_IMM_NUCL +! J.L Redelsperger 03/2021 Adding OCEAN LES Case and Autocoupled O-A LES +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODD_DIM_n +USE MODD_CONF +USE MODD_CONF_n +use modd_field, only: tfielddata, tfieldlist, TYPEINT, TYPEREAL +USE MODD_GRID +USE MODD_GRID_n +USE MODD_IO, ONLY : TFILEDATA +USE MODD_METRICS_n +USE MODD_TIME +USE MODD_TIME_n +USE MODD_DYN_n +USE MODD_FIELD_n +USE MODD_GR_FIELD_n +USE MODD_LSFIELD_n +USE MODD_PARAM_n +USE MODD_CURVCOR_n +USE MODD_REF +USE MODD_REF_n +USE MODD_LUNIT, ONLY : TLUOUT0 +USE MODD_LUNIT_n +USE MODD_TURB_n +USE MODD_RADIATIONS_n +USE MODD_FRC +USE MODD_PRECIP_n +USE MODD_CST +USE MODD_CLOUDPAR +USE MODD_DEEP_CONVECTION_n +USE MODD_PARAM_KAFR_n +USE MODD_NESTING +USE MODD_PARAMETERS +USE MODD_DIAG_FLAG +USE MODD_NSV +USE MODD_CH_M9_n, ONLY : CNAMES, NEQAQ +USE MODD_RAIN_C2R2_DESCR, ONLY : C2R2NAMES +USE MODD_ICE_C1R3_DESCR, ONLY : C1R3NAMES +USE MODD_ELEC_DESCR, ONLY : CELECNAMES +USE MODD_RAIN_C2R2_KHKO_PARAM +USE MODD_ICE_C1R3_PARAM +USE MODD_PARAM_ICE_n, ONLY : LSEDIC +USE MODD_PARAM_LIMA, ONLY : NMOD_CCN, NMOD_IFN, NMOD_IMM, NINDICE_CCN_IMM,& + LSCAV, LHHONI, LAERO_MASS, & + LLIMA_DIAG, & + NSPECIE, XMDIAM_IFN, XSIGMA_IFN, ZFRAC=>XFRAC,& + XR_MEAN_CCN, XLOGSIG_CCN, NMOM_S, NMOM_G, NMOM_H +USE MODD_PARAM_LIMA_WARM, ONLY : CLIMA_WARM_CONC, CAERO_MASS +USE MODD_PARAM_LIMA_COLD, ONLY : CLIMA_COLD_CONC +USE MODD_LG, ONLY : CLGNAMES +USE MODD_PASPOL, ONLY : LPASPOL +USE MODD_CONDSAMP, ONLY : LCONDSAMP +! +USE MODD_DIAG_FLAG +USE MODD_RADAR, ONLY: XLAT_RAD,XELEV,& + XSTEP_RAD,NBRAD,NBELEV,NBAZIM,NBSTEPMAX,& + NCURV_INTERPOL,LATT,LCART_RAD,NPTS_H,NPTS_V,XGRID,& + LREFR,LDNDZ,NMAX,CNAME_RAD,NDIFF,& + XLON_RAD,XALT_RAD,XLAM_RAD,XDT_RAD,LWBSCS,LWREFL +use modd_precision, only: MNHREAL_MPI +! +USE MODI_RADAR_SIMULATOR +! +USE MODD_DUST +USE MODD_CSTS_DUST +USE MODD_SALT +USE MODD_BLOWSNOW +USE MODD_CH_AEROSOL +USE MODD_CH_AERO_n +USE MODD_CH_MNHC_n +USE MODE_DUST_PSD +USE MODE_SALT_PSD +USE MODE_BLOWSNOW_PSD +USE MODE_AERO_PSD +USE MODI_GRADIENT_M +USE MODI_GRADIENT_W +USE MODI_GRADIENT_U +USE MODI_GRADIENT_V +USE MODI_SHUMAN +USE MODI_RADAR_RAIN_ICE +USE MODI_INI_RADAR +USE MODI_COMPUTE_MEAN_PRECIP +USE MODI_UV_TO_ZONAL_AND_MERID +USE MODI_CALCSOUND +USE MODI_FREE_ATM_PROFILE +USE MODI_GPS_ZENITH +USE MODI_CONTRAV +! +use mode_field, only: Find_field_id_from_mnhname +USE MODE_GRIDPROJ +USE MODE_GATHER_ll +USE MODE_IO_FIELD_WRITE, only: IO_Field_write +USE MODE_IO_FILE, only: IO_File_close, IO_File_open +USE MODE_IO_MANAGE_STRUCT, only: IO_File_add2list +USE MODE_ll +use mode_msg +USE MODE_THERMO +USE MODE_TOOLS, ONLY: UPCASE +USE MODE_MODELN_HANDLER +USE MODI_LIDAR +USE MODI_CLUSTERING +! +USE MODD_MPIF +USE MODD_VAR_ll +! +IMPLICIT NONE +! +!* 0.1 Declarations of arguments +! +TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! outpput data file +CHARACTER(LEN=28), INTENT(IN) :: HDADFILE ! corresponding FM-file name of + ! its DAD model +! +!* 0.2 Declarations of local variables +! +INTEGER :: IRESP ! return-code for the file routines +! +CHARACTER(LEN=3) :: YFRC ! to mark the time of the forcing +CHARACTER(LEN=31) :: YFGRI ! file name for GPS stations +! +INTEGER :: IIU,IJU,IKU,IIB,IJB,IKB,IIE,IJE,IKE ! Arrays bounds +! +INTEGER :: JLOOP,JI,JJ,JK,JSV,JT,JH,JV,JEL ! loop index +INTEGER :: IMI ! Current model index +! +REAL :: ZRV_OV_RD ! XRV / XRD +REAL :: ZGAMREF ! Standard atmosphere lapse rate (K/m) +REAL :: ZX0D ! work real scalar +REAL :: ZLATOR, ZLONOR ! geographical coordinates of 1st mass point +REAL :: ZXHATM, ZYHATM ! conformal coordinates of 1st mass point +REAL, DIMENSION(:), ALLOCATABLE :: ZXHAT_ll ! Position x in the conformal + ! plane (array on the complete domain) +REAL, DIMENSION(:), ALLOCATABLE :: ZYHAT_ll ! Position y in the conformal + ! plane (array on the complete domain) +! +REAL,DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZPOVO +REAL,DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZTEMP +REAL,DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZVOX,ZVOY,ZVOZ +REAL,DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZCORIOZ +REAL,DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZWORK31,ZWORK32 +REAL,DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZWORK33,ZWORK34 +REAL,DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2)) :: ZWORK21,ZWORK22 +REAL,DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2)) :: ZWORK23,ZWORK24 +REAL,DIMENSION(:,:,:,:,:), ALLOCATABLE :: ZWORK42 ! reflectivity on a cartesian grid (PREFL_CART) +REAL,DIMENSION(:,:,:,:,:), ALLOCATABLE :: ZWORK42_BIS +REAL,DIMENSION(:,:,:), ALLOCATABLE :: ZWORK43 ! latlon coordinates of cartesian grid points (PLATLON) +REAL,DIMENSION(:,:,:), ALLOCATABLE :: ZPHI,ZTHETAE,ZTHETAV +REAL,DIMENSION(:,:,:), ALLOCATABLE :: ZTHETAES,ZTHETAL,ZTHETAS1,ZTHETAS2 +REAL,DIMENSION(:,:,:), ALLOCATABLE :: ZVISIKUN,ZVISIGUL,ZVISIZHA +INTEGER, DIMENSION(:,:), ALLOCATABLE :: IWORK1 +integer :: ICURR,INBOUT,IERR +! +REAL,DIMENSION(SIZE(XSVT,1),SIZE(XSVT,2),SIZE(XSVT,3),NSP+NCARB+NSOA,JPMODE):: ZPTOTA +REAL,DIMENSION(SIZE(XSVT,1),SIZE(XSVT,2),SIZE(XSVT,3),NMODE_DST*2):: ZSDSTDEP +REAL,DIMENSION(SIZE(XSVT,1),SIZE(XSVT,2),SIZE(XSVT,3),NMODE_SLT*2):: ZSSLTDEP +REAL,DIMENSION(:,:,:,:), ALLOCATABLE :: ZSIG_DST, ZRG_DST, ZN0_DST +REAL,DIMENSION(:,:,:,:), ALLOCATABLE :: ZSIG_SLT, ZRG_SLT, ZN0_SLT +REAL,DIMENSION(:,:,:), ALLOCATABLE :: ZBET_SNW, ZRG_SNW +REAL,DIMENSION(:,:,:,:), ALLOCATABLE :: ZMA_SNW +REAL,DIMENSION(:,:,:), ALLOCATABLE :: ZRHOT, ZTMP ! work array +! +! GBOTUP = True does clustering from bottom up to top, False top down to surface +LOGICAL :: GBOTUP ! clustering propagation +LOGICAL,DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: GCLOUD ! mask +INTEGER,DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ICLUSTERID, ICLUSTERLV +REAL, DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZCLDSIZE + +!ECRITURE DANS UN FICHIER ASCII DE RESULTATS +!INITIALISATION DU NOM DE FICHIER CREE EN PARALLELE AVEC CELUI LFI +TYPE(TFILEDATA),POINTER :: TZRSFILE +INTEGER :: ILURS +CHARACTER(LEN=32) :: YRS +CHARACTER(LEN=3),DIMENSION(:),ALLOCATABLE :: YRAD +CHARACTER(LEN=2*INT(NBSTEPMAX*XSTEP_RAD/XGRID)*2*9+1), DIMENSION(:), ALLOCATABLE :: CLATLON +CHARACTER(LEN=2*9) :: CBUFFER +CHARACTER(LEN=4) :: YELEV +CHARACTER(LEN=3) :: YGRID_SIZE +INTEGER :: IEL,IIELV +CHARACTER(LEN=5) :: YVIEW ! Upward or Downward integration +INTEGER :: IACCMODE +! +!------------------------------------------------------------------------------- +INTEGER :: IAUX ! work variable +REAL,DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZWORK35,ZWORK36, ZW1, ZW2, ZW3 +REAL,DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2)) :: ZWORK25,ZWORK26 +REAL :: ZEAU ! Mean precipitable water +INTEGER, DIMENSION(SIZE(XZZ,1),SIZE(XZZ,2)) ::IKTOP ! level in which is the altitude 3000m +REAL, DIMENSION(SIZE(XZZ,1),SIZE(XZZ,2),SIZE(XZZ,3)) :: ZDELTAZ ! interval (m) between two levels K +INTEGER :: ILUOUT0 ! Logical unit number for output-listing +! +CHARACTER(LEN=2) :: INDICE +CHARACTER(LEN=100) :: YMSG +INTEGER :: IID +TYPE(TFIELDDATA) :: TZFIELD +TYPE(TFIELDDATA),DIMENSION(2) :: TZFIELD2 +! +! LIMA LIDAR +REAL,DIMENSION(:,:,:,:), ALLOCATABLE :: ZTMP1, ZTMP2, ZTMP3, ZTMP4 +! +! hauteur couche limite +REAL,DIMENSION(:,:,:),ALLOCATABLE :: ZZZ_GRID1 +REAL,DIMENSION(:,:),ALLOCATABLE :: ZTHVSOL,ZSHMIX +REAL,DIMENSION(:,:,:),ALLOCATABLE :: ZZONWIND,ZMERWIND,ZFFWIND2,ZRIB +! +!------------------------------------------------------------------------------- +! +!* 0. ARRAYS BOUNDS INITIALIZATION +! +CALL GET_DIM_EXT_ll ('B',IIU,IJU) +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +IKU=NKMAX+2*JPVEXT +IKB=1+JPVEXT +IKE=IKU-JPVEXT + +IMI = GET_CURRENT_MODEL_INDEX() +ILUOUT0 = TLUOUT0%NLU +TZRSFILE => NULL() +!------------------------------------------------------------------------------- +! +!* 1. WRITES IN THE LFI FILE +! ---------------------- +! +!* 1.0 TPFILE%CNAME and HDADFILE : +! +CALL IO_Field_write(TPFILE,'MASDEV', NMASDEV) +CALL IO_Field_write(TPFILE,'BUGFIX', NBUGFIX) +CALL IO_Field_write(TPFILE,'BIBUSER', CBIBUSER) +CALL IO_Field_write(TPFILE,'PROGRAM', CPROGRAM) +! +CALL IO_Field_write(TPFILE,'L1D', L1D) +CALL IO_Field_write(TPFILE,'L2D', L2D) +CALL IO_Field_write(TPFILE,'PACK', LPACK) +! +CALL IO_Field_write(TPFILE,'MY_NAME', TPFILE%CNAME) +CALL IO_Field_write(TPFILE,'DAD_NAME', HDADFILE) +! +IF (LEN_TRIM(HDADFILE)>0) THEN + CALL IO_Field_write(TPFILE,'DXRATIO',NDXRATIO_ALL(1)) + CALL IO_Field_write(TPFILE,'DYRATIO',NDYRATIO_ALL(1)) + CALL IO_Field_write(TPFILE,'XOR', NXOR_ALL(1)) + CALL IO_Field_write(TPFILE,'YOR', NYOR_ALL(1)) +END IF +! +CALL IO_Field_write(TPFILE,'SURF', CSURF) +! +!* 1.1 Type and Dimensions : +! +CALL IO_Field_write(TPFILE,'STORAGE_TYPE','DI') +! +CALL IO_Field_write(TPFILE,'IMAX',NIMAX_ll) +CALL IO_Field_write(TPFILE,'JMAX',NJMAX_ll) +CALL IO_Field_write(TPFILE,'KMAX',NKMAX) +! +CALL IO_Field_write(TPFILE,'JPHEXT',JPHEXT) +! +!* 1.2 Grid variables : +! +IF (.NOT.LCARTESIAN) THEN + CALL IO_Field_write(TPFILE,'RPK', XRPK) + CALL IO_Field_write(TPFILE,'LONORI',XLONORI) + CALL IO_Field_write(TPFILE,'LATORI',XLATORI) +! +!* diagnostic of 1st mass point +! + ALLOCATE(ZXHAT_ll(NIMAX_ll+ 2 * JPHEXT),ZYHAT_ll(NJMAX_ll+2 * JPHEXT)) + CALL GATHERALL_FIELD_ll('XX',XXHAT,ZXHAT_ll,IRESP) !// + CALL GATHERALL_FIELD_ll('YY',XYHAT,ZYHAT_ll,IRESP) !// + ZXHATM = 0.5 * (ZXHAT_ll(1)+ZXHAT_ll(2)) + ZYHATM = 0.5 * (ZYHAT_ll(1)+ZYHAT_ll(2)) + CALL SM_LATLON(XLATORI,XLONORI,ZXHATM,ZYHATM,ZLATOR,ZLONOR) + DEALLOCATE(ZXHAT_ll,ZYHAT_ll) +! + CALL IO_Field_write(TPFILE,'LONOR',ZLONOR) + CALL IO_Field_write(TPFILE,'LATOR',ZLATOR) +! +END IF +! +CALL IO_Field_write(TPFILE,'THINSHELL',LTHINSHELL) +CALL IO_Field_write(TPFILE,'LAT0',XLAT0) +CALL IO_Field_write(TPFILE,'LON0',XLON0) +CALL IO_Field_write(TPFILE,'BETA',XBETA) +! +CALL IO_Field_write(TPFILE,'XHAT',XXHAT) +CALL IO_Field_write(TPFILE,'YHAT',XYHAT) +CALL IO_Field_write(TPFILE,'ZHAT',XZHAT) +CALL IO_Field_write(TPFILE,'ZTOP',XZTOP) +! +CALL IO_Field_write(TPFILE,'ZS', XZS) +CALL IO_Field_write(TPFILE,'ZWS', XZWS) +CALL IO_Field_write(TPFILE,'ZSMT', XZSMT) +CALL IO_Field_write(TPFILE,'SLEVE',LSLEVE) +! +IF (LSLEVE) THEN + CALL IO_Field_write(TPFILE,'LEN1',XLEN1) + CALL IO_Field_write(TPFILE,'LEN2',XLEN2) +END IF +! +! +CALL IO_Field_write(TPFILE,'DTMOD',TDTMOD) +CALL IO_Field_write(TPFILE,'DTCUR',TDTCUR) +CALL IO_Field_write(TPFILE,'DTEXP',TDTEXP) +CALL IO_Field_write(TPFILE,'DTSEG',TDTSEG) +! +!* 1.3 Configuration variables : +! +CALL IO_Field_write(TPFILE,'CARTESIAN',LCARTESIAN) +CALL IO_Field_write(TPFILE,'LBOUSS', LBOUSS) +CALL IO_Field_write(TPFILE,'LOCEAN', LOCEAN) +CALL IO_Field_write(TPFILE,'LCOUPLES', LCOUPLES) +! +IF (LCARTESIAN .AND. LWIND_ZM) THEN + LWIND_ZM=.FALSE. + PRINT*,'YOU ARE IN CARTESIAN GEOMETRY SO LWIND_ZM IS FORCED TO FALSE' +END IF +!* 1.4 Reference state variables : +! +IF (LCOUPLES.AND.LOCEAN) THEN + CALL IO_Field_write(TPFILE,'RHOREFZ',XRHODREFZO) + CALL IO_Field_write(TPFILE,'THVREFZ',XTHVREFZO) + CALL IO_Field_write(TPFILE,'EXNTOP', XEXNTOPO) +ELSE + CALL IO_Field_write(TPFILE,'RHOREFZ',XRHODREFZ) + CALL IO_Field_write(TPFILE,'THVREFZ',XTHVREFZ) + CALL IO_Field_write(TPFILE,'EXNTOP', XEXNTOP) +END IF +! +CALL IO_Field_write(TPFILE,'RHODREF',XRHODREF) +CALL IO_Field_write(TPFILE,'THVREF', XTHVREF) +! +! +!* 1.5 Variables necessary for plots +! +! PABST,THT,POVOM for cross sections at constant pressure +! level or constant theta level or constant PV level +! +IF (INDEX(CISO,'PR') /= 0) THEN + CALL IO_Field_write(TPFILE,'PABST',XPABST) +END IF +! +IF (INDEX(CISO,'TK') /= 0) THEN + CALL IO_Field_write(TPFILE,'THT',XTHT) +END IF +! +ZCORIOZ(:,:,:)=SPREAD( XCORIOZ(:,:),DIM=3,NCOPIES=IKU ) +ZVOX(:,:,:)=GY_W_VW(XWT,XDYY,XDZZ,XDZY)-GZ_V_VW(XVT,XDZZ) +ZVOX(:,:,2)=ZVOX(:,:,3) +ZVOY(:,:,:)=GZ_U_UW(XUT,XDZZ)-GX_W_UW(XWT,XDXX,XDZZ,XDZX) +ZVOY(:,:,2)=ZVOY(:,:,3) +ZVOZ(:,:,:)=GX_V_UV(XVT,XDXX,XDZZ,XDZX)-GY_U_UV(XUT,XDYY,XDZZ,XDZY) +ZVOZ(:,:,2)=ZVOZ(:,:,3) +ZVOZ(:,:,1)=ZVOZ(:,:,3) +ZWORK31(:,:,:)=GX_M_M(XTHT,XDXX,XDZZ,XDZX) +ZWORK32(:,:,:)=GY_M_M(XTHT,XDYY,XDZZ,XDZY) +ZWORK33(:,:,:)=GZ_M_M(XTHT,XDZZ) +ZPOVO(:,:,:)= ZWORK31(:,:,:)*MZF(MYF(ZVOX(:,:,:))) & + + ZWORK32(:,:,:)*MZF(MXF(ZVOY(:,:,:))) & + + ZWORK33(:,:,:)*(MYF(MXF(ZVOZ(:,:,:))) + ZCORIOZ(:,:,:)) +ZPOVO(:,:,:)= ZPOVO(:,:,:)*1E6/XRHODREF(:,:,:) +ZPOVO(:,:,1) =-1.E+11 +ZPOVO(:,:,IKU)=-1.E+11 +IF (INDEX(CISO,'EV') /= 0) THEN + TZFIELD%CMNHNAME = 'POVOT' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'POVOT' + TZFIELD%CUNITS = 'PVU' ! 1 PVU = 1e-6 m^2 s^-1 K kg^-1 + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_POtential VOrticity' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZPOVO) +END IF +! +! +IF (LVAR_RS) THEN + CALL IO_Field_write(TPFILE,'UT',XUT) + CALL IO_Field_write(TPFILE,'VT',XVT) + ! + IF (LWIND_ZM) THEN + TZFIELD2(1)%CMNHNAME = 'UM_ZM' + TZFIELD2(1)%CSTDNAME = '' + TZFIELD2(1)%CLONGNAME = 'UM_ZM' + TZFIELD2(1)%CUNITS = 'm s-1' + TZFIELD2(1)%CDIR = 'XY' + TZFIELD2(1)%CCOMMENT = 'Zonal component of horizontal wind' + TZFIELD2(1)%NGRID = 2 + TZFIELD2(1)%NTYPE = TYPEREAL + TZFIELD2(1)%NDIMS = 3 + TZFIELD2(1)%LTIMEDEP = .TRUE. + ! + TZFIELD2(2)%CMNHNAME = 'VM_ZM' + TZFIELD2(2)%CSTDNAME = '' + TZFIELD2(2)%CLONGNAME = 'VM_ZM' + TZFIELD2(2)%CUNITS = 'm s-1' + TZFIELD2(2)%CDIR = 'XY' + TZFIELD2(2)%CCOMMENT = 'Meridian component of horizontal wind' + TZFIELD2(2)%NGRID = 3 + TZFIELD2(2)%NTYPE = TYPEREAL + TZFIELD2(2)%NDIMS = 3 + TZFIELD2(2)%LTIMEDEP = .TRUE. + ! + CALL UV_TO_ZONAL_AND_MERID(XUT,XVT,23,TPFILE=TPFILE,TZFIELDS=TZFIELD2) + END IF + ! + CALL IO_Field_write(TPFILE,'WT',XWT) + ! + ! write mixing ratio for water vapor required to plot radio-soundings + ! + IF (LUSERV) THEN + CALL IO_Field_write(TPFILE,'RVT',XRT(:,:,:,IDX_RVT)) + END IF +END IF +! +!* Latitude and Longitude arrays +! +IF (.NOT.LCARTESIAN) THEN + CALL IO_Field_write(TPFILE,'LAT',XLAT) + CALL IO_Field_write(TPFILE,'LON',XLON) +END IF +! +! +!------------------------------------------------------------------------------- +! +!* 1.6 Other pronostic variables +! +ZTEMP(:,:,:)=XTHT(:,:,:)*(XPABST(:,:,:)/ XP00) **(XRD/XCPD) +! +IF (LVAR_TURB) THEN + IF (CTURB /= 'NONE') THEN + CALL IO_Field_write(TPFILE,'TKET',XTKET) + ! + IF( NRR > 1 ) THEN + CALL IO_Field_write(TPFILE,'SRCT',XSRCT) + CALL IO_Field_write(TPFILE,'SIGS',XSIGS) + END IF + ! + IF(CTOM=='TM06') THEN + CALL IO_Field_write(TPFILE,'BL_DEPTH',XBL_DEPTH) + END IF + END IF +END IF +! +!* Rains +! +IF (LVAR_PR .AND. LUSERR .AND. SIZE(XINPRR)>0 ) THEN + ! + ! explicit species + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('INPRR',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm hour-1' + CALL IO_Field_write(TPFILE,TZFIELD,XINPRR*3.6E6) + ! + CALL IO_Field_write(TPFILE,'INPRR3D',XINPRR3D) + CALL IO_Field_write(TPFILE,'EVAP3D', XEVAP3D) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('ACPRR',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm' + CALL IO_Field_write(TPFILE,TZFIELD,XACPRR*1.0E3) + ! + IF (CCLOUD(1:3) == 'ICE' .OR. CCLOUD == 'C2R2' .OR. CCLOUD == 'C3R5' .OR.& + CCLOUD == 'KHKO' .OR. CCLOUD == 'LIMA') THEN + IF (SIZE(XINPRC) /= 0 ) THEN + CALL FIND_FIELD_ID_FROM_MNHNAME('INPRC',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm hour-1' + CALL IO_Field_write(TPFILE,TZFIELD,XINPRC*3.6E6) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('ACPRC',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm' + CALL IO_Field_write(TPFILE,TZFIELD,XACPRC*1.0E3) + END IF + IF (SIZE(XINDEP) /= 0 ) THEN + CALL FIND_FIELD_ID_FROM_MNHNAME('INDEP',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm hour-1' + CALL IO_Field_write(TPFILE,TZFIELD,XINDEP*3.6E6) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('ACDEP',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm' + CALL IO_Field_write(TPFILE,TZFIELD,XACDEP*1.0E3) + END IF + END IF + IF (CCLOUD(1:3) == 'ICE' .OR. CCLOUD == 'C3R5' .OR. CCLOUD == 'LIMA') THEN + CALL FIND_FIELD_ID_FROM_MNHNAME('INPRS',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm hour-1' + CALL IO_Field_write(TPFILE,TZFIELD,XINPRS*3.6E6) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('ACPRS',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm' + CALL IO_Field_write(TPFILE,TZFIELD,XACPRS*1.0E3) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('INPRG',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm hour-1' + CALL IO_Field_write(TPFILE,TZFIELD,XINPRG*3.6E6) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('ACPRG',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm' + CALL IO_Field_write(TPFILE,TZFIELD,XACPRG*1.0E3) + ! + IF (SIZE(XINPRH) /= 0 ) THEN + CALL FIND_FIELD_ID_FROM_MNHNAME('INPRH',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm hour-1' + CALL IO_Field_write(TPFILE,TZFIELD,XINPRH*3.6E6) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('ACPRH',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm' + CALL IO_Field_write(TPFILE,TZFIELD,XACPRH*1.0E3) + ENDIF + ! + ZWORK21(:,:) = XINPRR(:,:) + XINPRS(:,:) + XINPRG(:,:) + IF (SIZE(XINPRC) /= 0 ) & + ZWORK21(:,:) = ZWORK21(:,:) + XINPRC(:,:) + IF (SIZE(XINPRH) /= 0 ) & + ZWORK21(:,:) = ZWORK21(:,:) + XINPRH(:,:) + CALL FIND_FIELD_ID_FROM_MNHNAME('INPRT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm hour-1' + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21*3.6E6) + ! + ZWORK21(:,:) = XACPRR(:,:) + XACPRS(:,:) + XACPRG(:,:) + IF (SIZE(XINPRC) /= 0 ) & + ZWORK21(:,:) = ZWORK21(:,:) + XACPRC(:,:) + IF (SIZE(XINPRH) /= 0 ) & + ZWORK21(:,:) = ZWORK21(:,:) + XACPRH(:,:) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('ACPRT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm' + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21*1.0E3) + ! + END IF + ! + !* Convective rain + ! + IF (CDCONV /= 'NONE') THEN + CALL FIND_FIELD_ID_FROM_MNHNAME('PRCONV',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm hour-1' + CALL IO_Field_write(TPFILE,TZFIELD,XPRCONV*3.6E6) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('PACCONV',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm' + CALL IO_Field_write(TPFILE,TZFIELD,XPACCONV*1.0E3) + ! + CALL FIND_FIELD_ID_FROM_MNHNAME('PRSCONV',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'mm hour-1' + CALL IO_Field_write(TPFILE,TZFIELD,XPRSCONV*3.6E6) + END IF +END IF +IF (LVAR_PR ) THEN + !Precipitable water in kg/m**2 + ZWORK21(:,:) = 0. + ZWORK22(:,:) = 0. + ZWORK23(:,:) = 0. + ZWORK31(:,:,:) = DZF(XZZ(:,:,:)) + DO JK = IKB,IKE + !* Calcul de qtot + IF (CCLOUD(1:3) == 'ICE' .OR. CCLOUD == 'LIMA') THEN + ZWORK23(IIB:IIE,IJB:IJE) = XRT(IIB:IIE,IJB:IJE,JK,1) + & + XRT(IIB:IIE,IJB:IJE,JK,2) + XRT(IIB:IIE,IJB:IJE,JK,3) + & + XRT(IIB:IIE,IJB:IJE,JK,4) + XRT(IIB:IIE,IJB:IJE,JK,5) + & + XRT(IIB:IIE,IJB:IJE,JK,6) + ELSE + ZWORK23(IIB:IIE,IJB:IJE) = XRT(IIB:IIE,IJB:IJE,JK,1) + ENDIF + !* Calcul de l'eau precipitable + ZWORK21(IIB:IIE,IJB:IJE)=XRHODREF(IIB:IIE,IJB:IJE,JK)* & + ZWORK23(IIB:IIE,IJB:IJE)* ZWORK31(IIB:IIE,IJB:IJE,JK) + !* Sum + ZWORK22(IIB:IIE,IJB:IJE) = ZWORK22(IIB:IIE,IJB:IJE)+ZWORK21(IIB:IIE,IJB:IJE) + ZWORK21(:,:) = 0. + ZWORK23(:,:) = 0. + END DO + !* Precipitable water in kg/m**2 + TZFIELD%CMNHNAME = 'PRECIP_WAT' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'PRECIP_WAT' + TZFIELD%CUNITS = 'kg m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK22) +ENDIF +! +! +!* Flux d'humidite et d'hydrometeores +IF (LHU_FLX) THEN + ZWORK35(:,:,:) = XRHODREF(:,:,:) * XRT(:,:,:,1) + ZWORK31(:,:,:) = MXM(ZWORK35(:,:,:)) * XUT(:,:,:) + ZWORK32(:,:,:) = MYM(ZWORK35(:,:,:)) * XVT(:,:,:) + ZWORK35(:,:,:) = GX_U_M(ZWORK31,XDXX,XDZZ,XDZX) + GY_V_M(ZWORK32,XDYY,XDZZ,XDZY) + IF (CCLOUD(1:3) == 'ICE' .OR. CCLOUD == 'LIMA') THEN + ZWORK36(:,:,:) = ZWORK35(:,:,:) + XRHODREF(:,:,:) * (XRT(:,:,:,2) + & + XRT(:,:,:,3) + XRT(:,:,:,4) + XRT(:,:,:,5) + XRT(:,:,:,6)) + ZWORK33(:,:,:) = MXM(ZWORK36(:,:,:)) * XUT(:,:,:) + ZWORK34(:,:,:) = MYM(ZWORK36(:,:,:)) * XVT(:,:,:) + ZWORK36(:,:,:) = GX_U_M(ZWORK33,XDXX,XDZZ,XDZX) + GY_V_M(ZWORK34,XDYY,XDZZ,XDZY) + ENDIF + ! + ! Integration sur 3000 m + ! + IKTOP(:,:)=0 + DO JK=1,IKU-1 + WHERE (((XZZ(:,:,JK) -XZS(:,:))<= 3000.0) .AND. ((XZZ(:,:,JK+1) -XZS(:,:))> 3000.0)) + IKTOP(:,:)=JK + END WHERE + END DO + ZDELTAZ(:,:,:)=DZF(XZZ) + ZWORK21(:,:) = 0. + ZWORK22(:,:) = 0. + ZWORK25(:,:) = 0. + DO JJ=1,IJU + DO JI=1,IIU + IAUX=IKTOP(JI,JJ) + DO JK=IKB,IAUX-1 + ZWORK21(JI,JJ) = ZWORK21(JI,JJ) + ZWORK31(JI,JJ,JK) * ZDELTAZ(JI,JJ,JK) + ZWORK22(JI,JJ) = ZWORK22(JI,JJ) + ZWORK32(JI,JJ,JK) * ZDELTAZ(JI,JJ,JK) + ZWORK25(JI,JJ) = ZWORK25(JI,JJ) + ZWORK35(JI,JJ,JK) * ZDELTAZ(JI,JJ,JK) + ENDDO + IF (IAUX >= IKB) THEN + ZDELTAZ(JI,JJ,IAUX)= 3000. - (XZZ(JI,JJ,IAUX) -XZS(JI,JJ)) + ZWORK21(JI,JJ) = ZWORK21(JI,JJ) + ZWORK31(JI,JJ,IAUX) * ZDELTAZ(JI,JJ,IAUX) + ZWORK22(JI,JJ) = ZWORK22(JI,JJ) + ZWORK32(JI,JJ,IAUX) * ZDELTAZ(JI,JJ,IAUX) + ZWORK25(JI,JJ) = ZWORK25(JI,JJ) + ZWORK35(JI,JJ,IAUX) * ZDELTAZ(JI,JJ,IAUX) + ENDIF + ENDDO + ENDDO + IF (CCLOUD(1:3) == 'ICE' .OR. CCLOUD == 'LIMA') THEN + ZWORK23(:,:) = 0. + ZWORK24(:,:) = 0. + ZWORK26(:,:) = 0. + DO JJ=1,IJU + DO JI=1,IIU + IAUX=IKTOP(JI,JJ) + DO JK=IKB,IAUX-1 + ZWORK23(JI,JJ) = ZWORK23(JI,JJ) + ZWORK33(JI,JJ,JK) * ZDELTAZ(JI,JJ,JK) + ZWORK24(JI,JJ) = ZWORK24(JI,JJ) + ZWORK34(JI,JJ,JK) * ZDELTAZ(JI,JJ,JK) + ZWORK26(JI,JJ) = ZWORK26(JI,JJ) + ZWORK36(JI,JJ,JK) * ZDELTAZ(JI,JJ,JK) + ENDDO + IF (IAUX >= IKB) THEN + ZDELTAZ(JI,JJ,IAUX)= 3000. - (XZZ(JI,JJ,IAUX) -XZS(JI,JJ)) + ZWORK23(JI,JJ) = ZWORK23(JI,JJ) + ZWORK33(JI,JJ,IAUX) * ZDELTAZ(JI,JJ,IAUX) + ZWORK24(JI,JJ) = ZWORK24(JI,JJ) + ZWORK34(JI,JJ,IAUX) * ZDELTAZ(JI,JJ,IAUX) + ZWORK26(JI,JJ) = ZWORK26(JI,JJ) + ZWORK36(JI,JJ,IAUX) * ZDELTAZ(JI,JJ,IAUX) + ENDIF + ENDDO + ENDDO + ENDIF + ! Ecriture + ! composantes U et V du flux surfacique d'humidite + TZFIELD%CMNHNAME = 'UM90' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'UM90' + TZFIELD%CUNITS = 'kg s-1 m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = '' + TZFIELD%NGRID = 2 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + ! + TZFIELD%CMNHNAME = 'VM90' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'VM90' + TZFIELD%CUNITS = 'kg s-1 m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = '' + TZFIELD%NGRID = 3 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK32) + ! composantes U et V du flux d'humidite integre sur 3000 metres + TZFIELD%CMNHNAME = 'UM91' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'UM91' + TZFIELD%CUNITS = 'kg s-1 m-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = '' + TZFIELD%NGRID = 2 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) + ! + TZFIELD%CMNHNAME = 'VM91' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'VM91' + TZFIELD%CUNITS = 'kg s-1 m-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = '' + TZFIELD%NGRID = 3 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK22) + ! + ! Convergence d'humidite + TZFIELD%CMNHNAME = 'HMCONV' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'HMCONV' + TZFIELD%CUNITS = 'kg s-1 m-3' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Horizontal CONVergence of moisture flux' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,-ZWORK35) + ! + ! Convergence d'humidite integre sur 3000 metres + TZFIELD%CMNHNAME = 'HMCONV3000' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'HMCONV3000' + TZFIELD%CUNITS = 'kg s-1 m-3' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Horizontal CONVergence of moisture flux' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,-ZWORK25) + ! + IF (CCLOUD(1:3) == 'ICE' .OR. CCLOUD == 'LIMA') THEN + ! composantes U et V du flux surfacique d'hydrometeores + TZFIELD%CMNHNAME = 'UM92' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'UM92' + TZFIELD%CUNITS = 'kg s-1 m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = '' + TZFIELD%NGRID = 2 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK33) + ! + TZFIELD%CMNHNAME = 'VM92' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'VM92' + TZFIELD%CUNITS = 'kg s-1 m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = '' + TZFIELD%NGRID = 3 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK34) + ! composantes U et V du flux d'hydrometeores integre sur 3000 metres + TZFIELD%CMNHNAME = 'UM93' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'UM93' + TZFIELD%CUNITS = 'kg s-1 m-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = '' + TZFIELD%NGRID = 2 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK23) + ! + TZFIELD%CMNHNAME = 'VM93' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'VM93' + TZFIELD%CUNITS = 'kg s-1 m-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = '' + TZFIELD%NGRID = 3 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK24) + ! Convergence d'hydrometeores + TZFIELD%CMNHNAME = 'HMCONV_TT' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'HMCONV_TT' + TZFIELD%CUNITS = 'kg s-1 m-3' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Horizontal CONVergence of hydrometeor flux' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,-ZWORK36) + ! Convergence d'hydrometeores integre sur 3000 metres + TZFIELD%CMNHNAME = 'HMCONV3000_TT' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'HMCONV3000_TT' + TZFIELD%CUNITS = 'kg s-1 m-3' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Horizontal CONVergence of hydrometeor flux' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,-ZWORK26) + ENDIF +ENDIF +! +!* Moist variables +! +IF (LVAR_MRW .OR. LLIMA_DIAG) THEN + IF (NRR >=1) THEN + ! Moist variables are written individually in file + TZFIELD%CSTDNAME = '' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + IF (LUSERV) THEN + TZFIELD%CMNHNAME = 'MRV' + TZFIELD%CLONGNAME = 'MRV' + TZFIELD%CUNITS = 'g kg-1' + TZFIELD%CCOMMENT = 'X_Y_Z_MRV' + CALL IO_Field_write(TPFILE,TZFIELD,XRT(:,:,:,IDX_RVT)*1.E3) + END IF + IF (LUSERC) THEN + TZFIELD%CMNHNAME = 'MRC' + TZFIELD%CLONGNAME = 'MRC' + TZFIELD%CUNITS = 'g kg-1' + TZFIELD%CCOMMENT = 'X_Y_Z_MRC' + CALL IO_Field_write(TPFILE,TZFIELD,XRT(:,:,:,IDX_RCT)*1.E3) +! + TZFIELD%CMNHNAME = 'VRC' + TZFIELD%CLONGNAME = 'VRC' + TZFIELD%CUNITS = '1' !vol/vol + TZFIELD%CCOMMENT = 'X_Y_Z_VRC (vol/vol)' + CALL IO_Field_write(TPFILE,TZFIELD,XRT(:,:,:,IDX_RCT)*XRHODREF(:,:,:)/1.E3) + END IF + IF (LUSERR) THEN + TZFIELD%CMNHNAME = 'MRR' + TZFIELD%CLONGNAME = 'MRR' + TZFIELD%CUNITS = 'g kg-1' + TZFIELD%CCOMMENT = 'X_Y_Z_MRR' + CALL IO_Field_write(TPFILE,TZFIELD,XRT(:,:,:,IDX_RRT)*1.E3) +! + TZFIELD%CMNHNAME = 'VRR' + TZFIELD%CLONGNAME = 'VRR' + TZFIELD%CUNITS = '1' !vol/vol + TZFIELD%CCOMMENT = 'X_Y_Z_VRR (vol/vol)' + CALL IO_Field_write(TPFILE,TZFIELD,XRT(:,:,:,IDX_RRT)*XRHODREF(:,:,:)/1.E3) + END IF + IF (LUSERI) THEN + TZFIELD%CMNHNAME = 'MRI' + TZFIELD%CLONGNAME = 'MRI' + TZFIELD%CUNITS = 'g kg-1' + TZFIELD%CCOMMENT = 'X_Y_Z_MRI' + CALL IO_Field_write(TPFILE,TZFIELD,XRT(:,:,:,IDX_RIT)*1.E3) +! + IF (LUSECI) THEN + CALL IO_Field_write(TPFILE,'CIT',XCIT(:,:,:)) + END IF + END IF + IF (LUSERS) THEN + TZFIELD%CMNHNAME = 'MRS' + TZFIELD%CLONGNAME = 'MRS' + TZFIELD%CUNITS = 'g kg-1' + TZFIELD%CCOMMENT = 'X_Y_Z_MRS' + CALL IO_Field_write(TPFILE,TZFIELD,XRT(:,:,:,IDX_RST)*1.E3) + END IF + IF (LUSERG) THEN + TZFIELD%CMNHNAME = 'MRG' + TZFIELD%CLONGNAME = 'MRG' + TZFIELD%CUNITS = 'g kg-1' + TZFIELD%CCOMMENT = 'X_Y_Z_MRG' + CALL IO_Field_write(TPFILE,TZFIELD,XRT(:,:,:,IDX_RGT)*1.E3) + END IF + IF (LUSERH) THEN + TZFIELD%CMNHNAME = 'MRH' + TZFIELD%CLONGNAME = 'MRH' + TZFIELD%CUNITS = 'g kg-1' + TZFIELD%CCOMMENT = 'X_Y_Z_MRH' + CALL IO_Field_write(TPFILE,TZFIELD,XRT(:,:,:,IDX_RHT)*1.E3) + END IF + END IF +END IF +! +!* Scalar Variables +! +! User scalar variables +! individually in the file +IF (LVAR_MRSV) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'g kg-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = 1,NSV_USER + WRITE(TZFIELD%CMNHNAME,'(A4,I3.3)')'MRSV',JSV + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A4,I3.3)')'X_Y_Z_','MRSV',JSV + CALL IO_Field_write(TPFILE,TZFIELD,XSVT(:,:,:,JSV)*1.E3) + END DO +END IF +! microphysical C2R2 scheme scalar variables +IF(LVAR_MRW) THEN + IF (NSV_C2R2END>=NSV_C2R2BEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_C2R2BEG,NSV_C2R2END + TZFIELD%CMNHNAME = TRIM(C2R2NAMES(JSV-NSV_C2R2BEG+1))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + IF (JSV < NSV_C2R2END) THEN + TZFIELD%CUNITS = 'cm-3' + ZWORK31(:,:,:)=XSVT(:,:,:,JSV)*1.E-6 + ELSE + TZFIELD%CUNITS = 'l-1' + ZWORK31(:,:,:)=XSVT(:,:,:,JSV)*1.E-3 + END IF + WRITE(TZFIELD%CCOMMENT,'(A6,A4,I3.3)')'X_Y_Z_','MRSV',JSV + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + END DO + END IF + ! microphysical C3R5 scheme additional scalar variables + IF (NSV_C1R3END>=NSV_C1R3BEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'l-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_C1R3BEG,NSV_C1R3END + TZFIELD%CMNHNAME = TRIM(C1R3NAMES(JSV-NSV_C1R3BEG+1))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3)')'X_Y_Z_','SVT',JSV + CALL IO_Field_write(TPFILE,TZFIELD,XSVT(:,:,:,JSV)*1.E-3) + END DO + END IF +END IF +! +! microphysical LIMA scheme scalar variables +! +IF (LLIMA_DIAG) THEN + IF (NSV_LIMA_END>=NSV_LIMA_BEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + END IF + ! + DO JSV = NSV_LIMA_BEG,NSV_LIMA_END + ! + TZFIELD%CUNITS = 'cm-3' + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3)')'X_Y_Z_','SVT',JSV + ! +! Nc + IF (JSV .EQ. NSV_LIMA_NC) THEN + TZFIELD%CMNHNAME = TRIM(CLIMA_WARM_CONC(1))//'T' + END IF +! Nr + IF (JSV .EQ. NSV_LIMA_NR) THEN + TZFIELD%CMNHNAME = TRIM(CLIMA_WARM_CONC(2))//'T' + END IF +! N CCN free + IF (JSV .GE. NSV_LIMA_CCN_FREE .AND. JSV .LT. NSV_LIMA_CCN_ACTI) THEN + WRITE(INDICE,'(I2.2)')(JSV - NSV_LIMA_CCN_FREE + 1) + TZFIELD%CMNHNAME = TRIM(CLIMA_WARM_CONC(3))//INDICE//'T' + END IF +! N CCN acti + IF (JSV .GE. NSV_LIMA_CCN_ACTI .AND. JSV .LT. NSV_LIMA_CCN_ACTI + NMOD_CCN) THEN + WRITE(INDICE,'(I2.2)')(JSV - NSV_LIMA_CCN_ACTI + 1) + TZFIELD%CMNHNAME = TRIM(CLIMA_WARM_CONC(4))//INDICE//'T' + END IF +! Scavenging + IF (JSV .EQ. NSV_LIMA_SCAVMASS) THEN + TZFIELD%CMNHNAME = TRIM(CAERO_MASS(1))//'T' + TZFIELD%CUNITS = 'kg cm-3' + END IF +! Ni + IF (JSV .EQ. NSV_LIMA_NI) THEN + TZFIELD%CMNHNAME = TRIM(CLIMA_COLD_CONC(1))//'T' + END IF +! Ns + IF (JSV .EQ. NSV_LIMA_NS) THEN + TZFIELD%CMNHNAME = TRIM(CLIMA_COLD_CONC(2))//'T' + END IF +! Ng + IF (JSV .EQ. NSV_LIMA_NG) THEN + TZFIELD%CMNHNAME = TRIM(CLIMA_COLD_CONC(3))//'T' + END IF +! Nh + IF (JSV .EQ. NSV_LIMA_NH) THEN + TZFIELD%CMNHNAME = TRIM(CLIMA_COLD_CONC(4))//'T' + END IF +! N IFN free + IF (JSV .GE. NSV_LIMA_IFN_FREE .AND. JSV .LT. NSV_LIMA_IFN_NUCL) THEN + WRITE(INDICE,'(I2.2)')(JSV - NSV_LIMA_IFN_FREE + 1) + TZFIELD%CMNHNAME = TRIM(CLIMA_COLD_CONC(5))//INDICE//'T' + END IF +! N IFN nucl + IF (JSV .GE. NSV_LIMA_IFN_NUCL .AND. JSV .LT. NSV_LIMA_IFN_NUCL + NMOD_IFN) THEN + WRITE(INDICE,'(I2.2)')(JSV - NSV_LIMA_IFN_NUCL + 1) + TZFIELD%CMNHNAME = TRIM(CLIMA_COLD_CONC(6))//INDICE//'T' + END IF +! N IMM nucl + IF (JSV .GE. NSV_LIMA_IMM_NUCL .AND. JSV .LT. NSV_LIMA_IMM_NUCL + NMOD_IMM) THEN + WRITE(INDICE,'(I2.2)')(NINDICE_CCN_IMM(JSV - NSV_LIMA_IMM_NUCL + 1)) + TZFIELD%CMNHNAME = TRIM(CLIMA_COLD_CONC(7))//INDICE//'T' + END IF +! Hom. freez. of CCN + IF (JSV .EQ. NSV_LIMA_HOM_HAZE) THEN + TZFIELD%CMNHNAME = TRIM(CLIMA_COLD_CONC(8))//'T' + END IF + ! +! Supersaturation + IF (JSV .EQ. NSV_LIMA_SPRO) THEN + TZFIELD%CMNHNAME = TRIM(CLIMA_WARM_CONC(5))//'T' + END IF + ! + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + ZWORK31(:,:,:)=XSVT(:,:,:,JSV)*1.E-6*XRHODREF(:,:,:) + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + END DO +! + IF (LUSERC) THEN + TZFIELD%CMNHNAME = 'LWC' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'LWC' + TZFIELD%CUNITS = 'g m-3' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_LWC' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ZWORK31(:,:,:)=XRT(:,:,:,2)*1.E3*XRHODREF(:,:,:) + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + END IF +! + IF (LUSERI) THEN + TZFIELD%CMNHNAME = 'IWC' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'IWC' + TZFIELD%CUNITS = 'g m-3' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_MRI' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ZWORK31(:,:,:)=XRT(:,:,:,4)*1.E3*XRHODREF(:,:,:) + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + END IF +! +END IF +! +! chemical scalar variables in gas phase ppbv +IF (LCHEMDIAG) THEN + DO JSV = NSV_CHGSBEG,NSV_CHGSEND + TZFIELD%CMNHNAME = TRIM(UPCASE(CNAMES(JSV-NSV_CHGSBEG+1)))//'T' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ppbv' + TZFIELD%CDIR = 'XY' + WRITE(TZFIELD%CCOMMENT,'(A6,A4,I3.3)')'X_Y_Z_','CHIM',JSV + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,XSVT(:,:,:,JSV)*1.E9) + END DO +END IF +IF (LCHAQDIAG) THEN !aqueous concentration in M + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'M' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + ZWORK31(:,:,:)=0. + DO JSV = NSV_CHACBEG, NSV_CHACBEG-1+NEQAQ/2 !cloud water + TZFIELD%CMNHNAME = TRIM(CNAMES(JSV-NSV_CHACBEG+NSV_CHGS+1))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A4,I3.3)')'X_Y_Z_','CHAQ',JSV + WHERE(((XRT(:,:,:,2)*XRHODREF(:,:,:))/1.e3) .GE. XRTMIN_AQ) + ZWORK31(:,:,:)=(XSVT(:,:,:,JSV)*1000.)/(XMD*1.E+3*XRT(:,:,:,2)) + ENDWHERE + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + END DO + ! + ZWORK31(:,:,:)=0. + DO JSV = NSV_CHACBEG+NEQAQ/2, NSV_CHACEND !rain water + TZFIELD%CMNHNAME = TRIM(CNAMES(JSV-NSV_CHACBEG+NSV_CHGS+1))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A4,I3.3)')'X_Y_Z_','CHAQ',JSV + WHERE(((XRT(:,:,:,3)*XRHODREF(:,:,:))/1.e3) .GE. XRTMIN_AQ) + ZWORK31(:,:,:)=(XSVT(:,:,:,JSV)*1000.)/(XMD*1.E+3*XRT(:,:,:,3)) + ENDWHERE + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + END DO +! ZWORK31(:,:,:)=0. +! DO JSV = NSV_CHICBEG,NSV_CHICEND ! ice phase +! TZFIELD%CMNHNAME = TRIM(CICNAMES(JSV-NSV_CHICBEG+1))//'T' +! TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) +! WRITE(TZFIELD%CCOMMENT,'(A6,A4,I3.3,A4)')'X_Y_Z_','CHIC',JSV,' (M)' +! WHERE(((XRT(:,:,:,3)*XRHODREF(:,:,:))/1.e3) .GE. XRTMIN_AQ) +! ZWORK31(:,:,:)=(XSVT(:,:,:,JSV)*1000.)/(XMD*1.E+3*XRT(:,:,:,3)) +! ENDWHERE +! CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) +! END DO +END IF + +! Passive polluant scalar variables +IF (LPASPOL) THEN + ALLOCATE(ZRHOT( SIZE(XTHT,1), SIZE(XTHT,2),SIZE(XTHT,3))) + ALLOCATE(ZTMP( SIZE(XTHT,1), SIZE(XTHT,2),SIZE(XTHT,3))) +! +!* Density +! + ZRHOT(:,:,:)=XPABST(:,:,:)/(XRD*XTHT(:,:,:)*((XPABST(:,:,:)/XP00)**(XRD/XCPD))) +! +!* Conversion g/m3. +! + ZRHOT(:,:,:)=ZRHOT(:,:,:)*1000.0 + ! + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'g m-3' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = 1,NSV_PP + ZTMP(:,:,:)=ABS( XSVT(:,:,:,JSV+NSV_PPBEG-1)*ZRHOT(:,:,:) ) + WRITE(TZFIELD%CMNHNAME,'(A3,I3.3)')'PPT',JSV + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CCOMMENT = 'X_Y_Z_'//TRIM(TZFIELD%CMNHNAME) + CALL IO_Field_write(TPFILE,TZFIELD,ZTMP) + END DO + DEALLOCATE(ZTMP) + DEALLOCATE(ZRHOT) +END IF +! Conditional sampling variables +IF (LCONDSAMP) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = '1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_CSBEG,NSV_CSEND + WRITE(TZFIELD%CMNHNAME,'(A3,I3.3)')'CST',JSV + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CCOMMENT = 'X_Y_Z_'//TRIM(TZFIELD%CMNHNAME) + CALL IO_Field_write(TPFILE,TZFIELD,XSVT(:,:,:,JSV)) + END DO +END IF +! +! Blowing snow variables +! +IF(LBLOWSNOW) THEN + TZFIELD%CMNHNAME = 'SNWSUBL3D' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'kg m-3 s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_INstantaneous 3D Drifting snow sublimation flux' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,XSNWSUBL3D(:,:,:)) + ! + ZWORK21(:,:) = 0. + DO JK = IKB,IKE + ZWORK21(:,:) = ZWORK21(:,:)+XSNWSUBL3D(:,:,JK) * & + (XZZ(:,:,JK+1)-XZZ(:,:,JK))/XRHOLW*3600*24 + END DO + ZWORK21(:,:) = ZWORK21(:,:)*1000. ! vapor water in mm unit + ! + TZFIELD%CMNHNAME = 'COL_SNWSUBL' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'mm day-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Column Sublimation Rate (mmSWE/day)' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21(:,:)) + ! + IF(.NOT.ALLOCATED(ZBET_SNW)) & + ALLOCATE(ZBET_SNW(SIZE(XSVT,1), SIZE(XSVT,2), SIZE(XSVT,3))) + IF(.NOT.ALLOCATED(ZRG_SNW)) & + ALLOCATE(ZRG_SNW(SIZE(XSVT,1), SIZE(XSVT,2), SIZE(XSVT,3))) + IF(.NOT.ALLOCATED(ZMA_SNW)) & + ALLOCATE(ZMA_SNW(SIZE(XSVT,1), SIZE(XSVT,2), SIZE(XSVT,3),NBLOWSNOW3D)) + ! + CALL PPP2SNOW(XSVT(:,:,:,NSV_SNWBEG:NSV_SNWEND),XRHODREF,& + PBET3D=ZBET_SNW, PRG3D=ZRG_SNW, PM3D=ZMA_SNW) + ! + TZFIELD%CMNHNAME = 'SNWRGA' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'RG (mean) SNOW' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZRG_SNW(:,:,:)) + ! + TZFIELD%CMNHNAME = 'SNWBETA' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'BETA SNOW' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZBET_SNW(:,:,:)) + ! + TZFIELD%CMNHNAME = 'SNWNOA' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'm-3' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'NUM CONC SNOW (#/m3)' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZMA_SNW(:,:,:,1)) + ! + TZFIELD%CMNHNAME = 'SNWMASS' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'kg m-3' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'MASS CONC SNOW' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZMA_SNW(:,:,:,2)) + ! + ZWORK21(:,:) = 0. + DO JK = IKB,IKE + ZWORK21(:,:) = ZWORK21(:,:)+ZMA_SNW(:,:,JK,2) * & + (XZZ(:,:,JK+1)-XZZ(:,:,JK))/XRHOLW + END DO + ZWORK21(:,:) = ZWORK21(:,:)*1000. ! vapor water in mm unit + TZFIELD%CMNHNAME = 'THDS' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'mm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_THickness of Drifting Snow (mm SWE)' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21(:,:)) +END IF +! Lagrangian variables +IF (LTRAJ) THEN + TZFIELD%CSTDNAME = '' + !PW TODO: check units + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_LGBEG,NSV_LGEND + TZFIELD%CMNHNAME = TRIM(CLGNAMES(JSV-NSV_LGBEG+1))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A20,I3.3,A4)')'X_Y_Z_','Lagrangian variable ',JSV,' (M)' + CALL IO_Field_write(TPFILE,TZFIELD,XSVT(:,:,:,JSV)) + END DO + ! X coordinate + DO JK=1,IKU + DO JJ=1,IJU + DO JI=1,IIU-1 + ZWORK31(JI,JJ,JK)=0.5*(XXHAT(JI)+XXHAT(JI+1)) + END DO + ZWORK31(IIU,JJ,JK)=2.*ZWORK31(IIU-1,JJ,JK) - ZWORK31(IIU-2,JJ,JK) + END DO + END DO + TZFIELD%CMNHNAME = 'X' + TZFIELD%CLONGNAME = 'X' + TZFIELD%CCOMMENT = 'X_Y_Z_X coordinate' + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + ! Y coordinate + DO JK=1,IKU + DO JI=1,IIU + DO JJ=1,IJU-1 + ZWORK31(JI,JJ,JK)=0.5*(XYHAT(JJ)+XYHAT(JJ+1)) + END DO + ZWORK31(JI,IJU,JK)=2.*ZWORK31(JI,IJU-1,JK) - ZWORK31(JI,IJU-2,JK) + END DO + END DO + TZFIELD%CMNHNAME = 'Y' + TZFIELD%CLONGNAME = 'Y' + TZFIELD%CCOMMENT = 'X_Y_Z_Y coordinate' + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) +END IF +! linox scalar variables +IF (.NOT.(LUSECHEM .OR. LCHEMDIAG) .AND. LCH_CONV_LINOX) THEN + DO JSV = NSV_LNOXBEG,NSV_LNOXEND + TZFIELD%CMNHNAME = 'LINOXT' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ppbv' + TZFIELD%CDIR = 'XY' + WRITE(TZFIELD%CCOMMENT,'(A6,A4,I3.3)')'X_Y_Z_','LNOX',JSV + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,XSVT(:,:,:,JSV)*1.E9) + END DO +END IF +IF (LELECDIAG .AND. CELEC .NE. "NONE") THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_ELECBEG,NSV_ELECEND + TZFIELD%CMNHNAME = TRIM(CELECNAMES(JSV-NSV_ELECBEG+1))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + IF (JSV .GT. NSV_ELECBEG .AND. JSV .LT. NSV_ELECEND) THEN + TZFIELD%CUNITS = 'C m-3' + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3)')'X_Y_Z_','SVT',JSV + ELSE + TZFIELD%CUNITS = 'm-3' + WRITE(TZFIELD%CCOMMENT,'(A6,A3,I3.3,A8)')'X_Y_Z_','SVT',JSV,' (nb ions/m3)' + END IF + ZWORK31(:,:,:)=XSVT(:,:,:,JSV) * XRHODREF(:,:,:) ! C/kg --> C/m3 + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + END DO +END IF +! Sea Salt variables +IF (LSALT) THEN + IF(.NOT.ALLOCATED(ZSIG_SLT)) & + ALLOCATE(ZSIG_SLT(SIZE(XSVT,1), SIZE(XSVT,2), SIZE(XSVT,3), NMODE_SLT)) + IF(.NOT.ALLOCATED(ZRG_SLT)) & + ALLOCATE(ZRG_SLT(SIZE(XSVT,1), SIZE(XSVT,2), SIZE(XSVT,3), NMODE_SLT)) + IF(.NOT.ALLOCATED(ZN0_SLT)) & + ALLOCATE(ZN0_SLT(SIZE(XSVT,1), SIZE(XSVT,2), SIZE(XSVT,3), NMODE_SLT)) + ! + TZFIELD%CSTDNAME = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CUNITS = 'ppbv' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_SLTBEG,NSV_SLTEND + TZFIELD%CMNHNAME = TRIM(UPCASE(CSALTNAMES(JSV-NSV_SLTBEG+1)))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A4,I3.3)')'X_Y_Z_','SALT',JSV + CALL IO_Field_write(TPFILE,TZFIELD,XSVT(:,:,:,JSV)*1.E9) + END DO + ! + CALL PPP2SALT(XSVT(:,:,:,NSV_SLTBEG:NSV_SLTEND),XRHODREF,& + PSIG3D=ZSIG_SLT, PRG3D=ZRG_SLT, PN3D=ZN0_SLT) + ! + TZFIELD%CSTDNAME = '' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JJ=1,NMODE_SLT + WRITE(TZFIELD%CMNHNAME,'(A6,I1)')'SLTRGA',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'um' + WRITE(TZFIELD%CCOMMENT,'(A18,I1)')'RG (nb) SALT MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZRG_SLT(:,:,:,JJ)) + ! + WRITE(TZFIELD%CMNHNAME,'(A7,I1)')'SLTRGAM',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'um' + WRITE(TZFIELD%CCOMMENT,'(A17,I1)')'RG (m) SALT MODE ',JJ + ZWORK31(:,:,:)=ZRG_SLT(:,:,:,JJ) / (EXP(-3.*(LOG(ZSIG_SLT(:,:,:,JJ)))**2)) + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + ! + WRITE(TZFIELD%CMNHNAME,'(A6,I1)')'SLTN0A',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'm-3' + WRITE(TZFIELD%CCOMMENT,'(A13,I1)')'N0 SALT MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZN0_SLT(:,:,:,JJ)) + ! + WRITE(TZFIELD%CMNHNAME,'(A7,I1)')'SLTSIGA',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = '1' + WRITE(TZFIELD%CCOMMENT,'(A16,I1)')'SIGMA SALT MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZSIG_SLT(:,:,:,JJ)) + !SALT MASS CONCENTRATION + WRITE(TZFIELD%CMNHNAME,'(A4,I1)')'SLTMSS',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ug m-3' + WRITE(TZFIELD%CCOMMENT,'(A14,I1)')'MASSCONC MODE ',JJ + ZWORK31(:,:,:)= ZN0_SLT(:,:,:,JJ)*4./3.*3.14*2500.*1e9 & !kg-->ug + * (ZRG_SLT(:,:,:,JJ)**3)*1.d-18 & !um-->m + * exp(4.5*log(ZSIG_SLT(:,:,:,JJ))*log(ZSIG_SLT(:,:,:,JJ))) + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + !SALT BURDEN (g/m2) + ZWORK21(:,:)=0.0 + DO JK=IKB,IKE + ZWORK31(:,:,JK) = ZWORK31(:,:,JK) *(XZZ(:,:,JK+1)-XZZ(:,:,JK)) & + *1.d-6 ! Convert to ug/m2-->g/m2 in each layer + END DO + DO JK=IKB,IKE + DO JT=IJB,IJE + DO JI=IIB,IIE + ZWORK21(JI,JT)=ZWORK21(JI,JT)+ZWORK31(JI,JT,JK) + ENDDO + ENDDO + ENDDO + WRITE(TZFIELD%CMNHNAME,'(A7,I1)')'SLTBRDN',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'g m-2' + WRITE(TZFIELD%CCOMMENT,'(A6,I1)')'BURDEN',JJ + TZFIELD%NDIMS = 2 + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) + ! + TZFIELD%NDIMS = 3 + ENDDO +END IF +IF (LSALT.AND.LDEPOS_SLT(IMI)) THEN + ! + ZSSLTDEP=XSVT(:,:,:,NSV_SLTDEPBEG:NSV_SLTDEPEND) + ! + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppbv' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = 1,NSV_SLTDEP + TZFIELD%CMNHNAME = TRIM(UPCASE(CDESLTNAMES(JSV)))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A4,I3.3)')'X_Y_Z_','SALTDEP',JSV + CALL IO_Field_write(TPFILE,TZFIELD,ZSSLTDEP(:,:,:,JSV)*1.E9) + END DO + ! + DO JJ=1,NMODE_SLT + ! FOR CLOUDS + WRITE(TZFIELD%CMNHNAME,'(A9,I1)')'SLTDEPN0A',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A16,I1)')'N0 DUSTDEP MODE ',JJ + TZFIELD%CUNITS = 'm-3' + ! CLOUD: CALCULATE MOMENT 3 FROM TOTAL AEROSOL MASS + ZWORK31(:,:,:) = ZSSLTDEP(:,:,:,JJ) &!==>molec_{aer}/molec_{air} + *(XMOLARWEIGHT_DUST/XMD) &!==>kg_{aer}/kg_{air} + *XRHODREF(:,:,:) &!==>kg_{aer}/m3_{air} + /XDENSITY_DUST &!==>m3_{aer}/m3_{air} + *XM3TOUM3 &!==>um3_{aer}/m3_{air} + /(XPI*4./3.) !==>um3_{aer}/m3_{air} + !==>volume 3rd moment + !CLOUD: CALCULATE MOMENT 0 FROM DISPERSION AND MEAN RADIUS + ZWORK31(:,:,:) = ZWORK31(:,:,:)/ & + ((ZRG_SLT(:,:,:,JJ)**3)* & + EXP(4.5 * LOG(ZSIG_SLT(:,:,:,JJ))**2)) + !CLOUD: RETURN TO CONCENTRATION #/m3 + ZWORK31(:,:,:)= ZWORK31(:,:,:) * XMD/ & + (XAVOGADRO*XRHODREF(:,:,:)) + !CLOUD: Get number concentration (#/molec_{air}==>#/m3) + ZWORK31(:,:,:)= & + ZWORK31(:,:,:) & !#/molec_{air} + * XAVOGADRO & !==>#/mole + / XMD & !==>#/kg_{air} + * XRHODREF(:,:,:) !==>#/m3 + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + ! CLOUD: DUST MASS CONCENTRATION + WRITE(TZFIELD%CMNHNAME,'(A9,I1)')'SLTDEPMSS',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A17,I1)')'DEPMASSCONC MODE ',JJ + TZFIELD%CUNITS = 'ug m-3' + ZWORK31(:,:,:)= ZWORK31(:,:,:)*4./3.*3.14*2500.*1e9 & !kg-->ug + * (ZRG_SLT(:,:,:,JJ)**3)*1.d-18 & !um-->m + * exp(4.5*log(ZSIG_SLT(:,:,:,JJ))*log(ZSIG_SLT(:,:,:,JJ))) + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + ! FOR RAIN DROPS + WRITE(TZFIELD%CMNHNAME,'(A9,I1)')'SLTDEPN0A',JJ+NMODE_SLT + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A16,I1)')'N0 DUSTDEP MODE ',JJ+NMODE_SLT + TZFIELD%CUNITS = 'm-3' + ! RAIN: CALCULATE MOMENT 3 FROM TOTAL AEROSOL MASS + ZWORK31(:,:,:) = ZSSLTDEP(:,:,:,JJ+NMODE_SLT) &!==>molec_{aer}/molec_{air} + *(XMOLARWEIGHT_DUST/XMD) &!==>kg_{aer}/kg_{air} + *XRHODREF(:,:,:) &!==>kg_{aer}/m3_{air} + /XDENSITY_DUST &!==>m3_{aer}/m3_{air} + *XM3TOUM3 &!==>um3_{aer}/m3_{air} + /(XPI*4./3.) !==>um3_{aer}/m3_{air} + !==>volume 3rd moment + !RAIN: CALCULATE MOMENT 0 FROM DISPERSION AND MEAN RADIUS + ZWORK31(:,:,:)= ZWORK31(:,:,:)/ & + ((ZRG_SLT(:,:,:,JJ)**3)* & + EXP(4.5 * LOG(ZSIG_SLT(:,:,:,JJ))**2)) + !RAIN: RETURN TO CONCENTRATION #/m3 + ZWORK31(:,:,:)= ZWORK31(:,:,:) * XMD/ & + (XAVOGADRO*XRHODREF(:,:,:)) + !RAIN: Get number concentration (#/molec_{air}==>#/m3) + ZWORK31(:,:,:)= & + ZWORK31(:,:,:) & !#/molec_{air} + * XAVOGADRO & !==>#/mole + / XMD & !==>#/kg_{air} + * XRHODREF(:,:,:) !==>#/m3 + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + ! RAIN: DUST MASS CONCENTRATION + WRITE(TZFIELD%CMNHNAME,'(A9,I1)')'SLTDEPMSS',JJ+NMODE_SLT + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A17,I1)')'DEPMASSCONC MODE ',JJ+NMODE_SLT + TZFIELD%CUNITS = 'ug m-3' + ZWORK31(:,:,:)= ZWORK31(:,:,:)*4./3.*3.14*2500.*1e9 & !kg-->ug + * (ZRG_SLT(:,:,:,JJ)**3)*1.d-18 & !um-->m + * exp(4.5*log(ZSIG_SLT(:,:,:,JJ))*log(ZSIG_SLT(:,:,:,JJ))) + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + END DO +! +END IF +! Dust variables +IF (LDUST) THEN + IF(.NOT.ALLOCATED(ZSIG_DST)) & + ALLOCATE(ZSIG_DST(SIZE(XSVT,1), SIZE(XSVT,2), SIZE(XSVT,3), NMODE_DST)) + IF(.NOT.ALLOCATED(ZRG_DST)) & + ALLOCATE(ZRG_DST(SIZE(XSVT,1), SIZE(XSVT,2), SIZE(XSVT,3), NMODE_DST)) + IF(.NOT.ALLOCATED(ZN0_DST)) & + ALLOCATE(ZN0_DST(SIZE(XSVT,1), SIZE(XSVT,2), SIZE(XSVT,3), NMODE_DST)) + ! + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppbv' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_DSTBEG,NSV_DSTEND + TZFIELD%CMNHNAME = TRIM(UPCASE(CDUSTNAMES(JSV-NSV_DSTBEG+1)))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A4,I3.3)')'X_Y_Z_','DUST',JSV + CALL IO_Field_write(TPFILE,TZFIELD,XSVT(:,:,:,JSV)*1.E9) + END DO + ! + CALL PPP2DUST(XSVT(:,:,:,NSV_DSTBEG:NSV_DSTEND),XRHODREF,& + PSIG3D=ZSIG_DST, PRG3D=ZRG_DST, PN3D=ZN0_DST) + DO JJ=1,NMODE_DST + WRITE(TZFIELD%CMNHNAME,'(A6,I1)')'DSTRGA',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'um' + WRITE(TZFIELD%CCOMMENT,'(A18,I1)')'RG (nb) DUST MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZRG_DST(:,:,:,JJ)) + ! + WRITE(TZFIELD%CMNHNAME,'(A7,I1)')'DSTRGAM',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'um' + WRITE(TZFIELD%CCOMMENT,'(A17,I1)')'RG (m) DUST MODE ',JJ + ZWORK31(:,:,:)=ZRG_DST(:,:,:,JJ) / (EXP(-3.*(LOG(ZSIG_DST(:,:,:,JJ)))**2)) + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + ! + WRITE(TZFIELD%CMNHNAME,'(A6,I1)')'DSTN0A',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'm-3' + WRITE(TZFIELD%CCOMMENT,'(A13,I1)')'N0 DUST MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZN0_DST(:,:,:,JJ)) + ! + WRITE(TZFIELD%CMNHNAME,'(A7,I1)')'DSTSIGA',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = '1' + WRITE(TZFIELD%CCOMMENT,'(A16,I1)')'SIGMA DUST MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZSIG_DST(:,:,:,JJ)) + !DUST MASS CONCENTRATION + WRITE(TZFIELD%CMNHNAME,'(A4,I1)')'DSTMSS',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ug m-3' + WRITE(TZFIELD%CCOMMENT,'(A14,I1)')'MASSCONC MODE ',JJ + ZWORK31(:,:,:)= ZN0_DST(:,:,:,JJ)*4./3.*3.14*2500.*1e9 & !kg-->ug + * (ZRG_DST(:,:,:,JJ)**3)*1.d-18 & !um-->m + * exp(4.5*log(ZSIG_DST(:,:,:,JJ))*log(ZSIG_DST(:,:,:,JJ))) + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + !DUST BURDEN (g/m2) + ZWORK21(:,:)=0.0 + DO JK=IKB,IKE + ZWORK31(:,:,JK) = ZWORK31(:,:,JK) *(XZZ(:,:,JK+1)-XZZ(:,:,JK)) & + *1.d-6 ! Convert to ug/m2-->g/m2 in each layer + END DO + DO JK=IKB,IKE + DO JT=IJB,IJE + DO JI=IIB,IIE + ZWORK21(JI,JT)=ZWORK21(JI,JT)+ZWORK31(JI,JT,JK) + ENDDO + ENDDO + ENDDO + WRITE(TZFIELD%CMNHNAME,'(A7,I1)')'DSTBRDN',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'g m-2' + WRITE(TZFIELD%CCOMMENT,'(A6,I1)')'BURDEN',JJ + TZFIELD%NDIMS = 2 + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) + ! + TZFIELD%NDIMS = 3 + ENDDO +END IF +IF (LDUST.AND.LDEPOS_DST(IMI)) THEN + ! + ZSDSTDEP=XSVT(:,:,:,NSV_DSTDEPBEG:NSV_DSTDEPEND) + ! + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppbv' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = 1,NSV_DSTDEP + TZFIELD%CMNHNAME = TRIM(UPCASE(CDEDSTNAMES(JSV)))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A4,I3.3)')'X_Y_Z_','DUSTDEP',JSV + CALL IO_Field_write(TPFILE,TZFIELD,ZSDSTDEP(:,:,:,JSV)*1.E9) + END DO + ! + DO JJ=1,NMODE_DST + ! FOR CLOUDS + WRITE(TZFIELD%CMNHNAME,'(A9,I1)')'DSTDEPN0A',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A16,I1)')'N0 DUSTDEP MODE ',JJ + TZFIELD%CUNITS = 'm-3' + ! CLOUD: CALCULATE MOMENT 3 FROM TOTAL AEROSOL MASS + ZWORK31(:,:,:) = ZSDSTDEP(:,:,:,JJ) &!==>molec_{aer}/molec_{air} + *(XMOLARWEIGHT_DUST/XMD) &!==>kg_{aer}/kg_{air} + *XRHODREF(:,:,:) &!==>kg_{aer}/m3_{air} + /XDENSITY_DUST &!==>m3_{aer}/m3_{air} + *XM3TOUM3 &!==>um3_{aer}/m3_{air} + /(XPI*4./3.) !==>um3_{aer}/m3_{air} + !==>volume 3rd moment + !CLOUD: CALCULATE MOMENT 0 FROM DISPERSION AND MEAN RADIUS + ZWORK31(:,:,:)= ZWORK31(:,:,:)/ & + ((ZRG_DST(:,:,:,JJ)**3)* & + EXP(4.5 * LOG(ZSIG_DST(:,:,:,JJ))**2)) + !CLOUD: RETURN TO CONCENTRATION #/m3 + ZWORK31(:,:,:)= ZWORK31(:,:,:) * XMD/ & + (XAVOGADRO*XRHODREF(:,:,:)) + !CLOUD: Get number concentration (#/molec_{air}==>#/m3) + ZWORK31(:,:,:)= & + ZWORK31(:,:,:) & !#/molec_{air} + * XAVOGADRO & !==>#/mole + / XMD & !==>#/kg_{air} + * XRHODREF(:,:,:) !==>#/m3 + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + ! CLOUD: DUST MASS CONCENTRATION + WRITE(TZFIELD%CMNHNAME,'(A9,I1)')'DSTDEPMSS',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A17,I1)')'DEPMASSCONC MODE ',JJ + TZFIELD%CUNITS = 'ug m-3' + ZWORK31(:,:,:)= ZWORK31(:,:,:)*4./3.*3.14*2500.*1e9 & !kg-->ug + * (ZRG_DST(:,:,:,JJ)**3)*1.d-18 & !um-->m + * exp(4.5*log(ZSIG_DST(:,:,:,JJ))*log(ZSIG_DST(:,:,:,JJ))) + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + ! FOR RAIN DROPS + WRITE(TZFIELD%CMNHNAME,'(A9,I1)')'DSTDEPN0A',JJ+NMODE_DST + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A16,I1)')'N0 DUSTDEP MODE ',JJ+NMODE_DST + TZFIELD%CUNITS = 'm-3' + ! RAIN: CALCULATE MOMENT 3 FROM TOTAL AEROSOL MASS + ZWORK31(:,:,:)=ZSDSTDEP(:,:,:,JJ+NMODE_DST) &!==>molec_{aer}/molec_{air} + *(XMOLARWEIGHT_DUST/XMD) &!==>kg_{aer}/kg_{air} + *XRHODREF(:,:,:) &!==>kg_{aer}/m3_{air} + *(1.d0/XDENSITY_DUST) &!==>m3_{aer}/m3_{air} + *XM3TOUM3 &!==>um3_{aer}/m3_{air} + /(XPI*4./3.) !==>um3_{aer}/m3_{air} + !==>volume 3rd moment + !RAIN: CALCULATE MOMENT 0 FROM DISPERSION AND MEAN RADIUS + ZWORK31(:,:,:)= ZWORK31(:,:,:)/ & + ((ZRG_DST(:,:,:,JJ)**3)* & + EXP(4.5 * LOG(ZSIG_DST(:,:,:,JJ))**2)) + !RAIN: RETURN TO CONCENTRATION #/m3 + ZWORK31(:,:,:)= ZWORK31(:,:,:) * XMD/ & + (XAVOGADRO*XRHODREF(:,:,:)) + !RAIN: Get number concentration (#/molec_{air}==>#/m3) + ZWORK31(:,:,:)= & + ZWORK31(:,:,:) & !#/molec_{air} + * XAVOGADRO & !==>#/mole + / XMD & !==>#/kg_{air} + * XRHODREF(:,:,:) !==>#/m3 + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + ! RAIN: DUST MASS CONCENTRATION + WRITE(TZFIELD%CMNHNAME,'(A9,I1)')'DSTDEPMSS',JJ+NMODE_DST + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A17,I1)')'DEPMASSCONC MODE ',JJ+NMODE_DST + TZFIELD%CUNITS = 'ug m-3' + ZWORK31(:,:,:)= ZWORK31(:,:,:)*4./3.*3.14*2500.*1e9 & !kg-->ug + * (ZRG_DST(:,:,:,JJ)**3)*1.d-18 & !um-->m + * exp(4.5*log(ZSIG_DST(:,:,:,JJ))*log(ZSIG_DST(:,:,:,JJ))) + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + END DO +! +END IF +! Aerosol +IF ((LCHEMDIAG).AND.(LORILAM).AND.(LUSECHEM)) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppbv' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_AERBEG,NSV_AEREND + TZFIELD%CMNHNAME = TRIM(UPCASE(CAERONAMES(JSV-NSV_AERBEG+1)))//'T' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A4,I3.3)')'X_Y_Z_','AERO',JSV + CALL IO_Field_write(TPFILE,TZFIELD,XSVT(:,:,:,JSV)*1.E9) + END DO + ! + IF (.NOT.(ASSOCIATED(XN3D))) & + ALLOCATE(XN3D(SIZE(XSVT,1),SIZE(XSVT,2),SIZE(XSVT,3),JPMODE)) + IF (.NOT.(ASSOCIATED(XRG3D))) & + ALLOCATE(XRG3D(SIZE(XSVT,1),SIZE(XSVT,2),SIZE(XSVT,3),JPMODE)) + IF (.NOT.(ASSOCIATED(XSIG3D))) & + ALLOCATE(XSIG3D(SIZE(XSVT,1),SIZE(XSVT,2),SIZE(XSVT,3),JPMODE)) + ! + CALL PPP2AERO(XSVT(:,:,:,NSV_AERBEG:NSV_AEREND), XRHODREF, & + PSIG3D=XSIG3D, PRG3D=XRG3D, PN3D=XN3D, PCTOTA=ZPTOTA) + DO JJ=1,JPMODE + WRITE(TZFIELD%CMNHNAME,'(A3,I1)')'RGA',JJ + TZFIELD%CLONGNAME = 'RGA' + TZFIELD%CUNITS = 'um' + WRITE(TZFIELD%CCOMMENT,'(A21,I1)')'RG (nb) AEROSOL MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,XRG3D(:,:,:,JJ)) + ! + WRITE(TZFIELD%CMNHNAME,'(A4,I1)')'RGAM',JJ + TZFIELD%CLONGNAME = 'RGAM' + TZFIELD%CUNITS = 'um' + WRITE(TZFIELD%CCOMMENT,'(A20,I1)')'RG (m) AEROSOL MODE ',JJ + ZWORK31(:,:,:)=XRG3D(:,:,:,JJ) / (EXP(-3.*(LOG(XSIG3D(:,:,:,JJ)))**2)) + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + ! + WRITE(TZFIELD%CMNHNAME,'(A3,I1)')'N0A',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'cm-3' + WRITE(TZFIELD%CCOMMENT,'(A16,I1)')'N0 AEROSOL MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,XN3D(:,:,:,JJ)*1.E-6) + ! + WRITE(TZFIELD%CMNHNAME,'(A4,I1)')'SIGA',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = '1' + WRITE(TZFIELD%CCOMMENT,'(A19,I1)')'SIGMA AEROSOL MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,XSIG3D(:,:,:,JJ)) + ! + WRITE(TZFIELD%CMNHNAME,'(A4,I1)')'MSO4',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ug m-3' + WRITE(TZFIELD%CCOMMENT,'(A22,I1)')'MASS SO4 AEROSOL MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZPTOTA(:,:,:,JP_AER_SO4,JJ)) + ! + WRITE(TZFIELD%CMNHNAME,'(A4,I1)')'MNO3',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ug m-3' + WRITE(TZFIELD%CCOMMENT,'(A22,I1)')'MASS NO3 AEROSOL MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZPTOTA(:,:,:,JP_AER_NO3,JJ)) + ! + WRITE(TZFIELD%CMNHNAME,'(A4,I1)')'MNH3',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ug m-3' + WRITE(TZFIELD%CCOMMENT,'(A22,I1)')'MASS NH3 AEROSOL MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZPTOTA(:,:,:,JP_AER_NH3,JJ)) + ! + WRITE(TZFIELD%CMNHNAME,'(A4,I1)')'MH2O',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ug m-3' + WRITE(TZFIELD%CCOMMENT,'(A22,I1)')'MASS H2O AEROSOL MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZPTOTA(:,:,:,JP_AER_H2O,JJ)) + ! + IF (NSOA .EQ. 10) THEN + WRITE(TZFIELD%CMNHNAME,'(A5,I1)')'MSOA1',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ug m-3' + WRITE(TZFIELD%CCOMMENT,'(A23,I1)')'MASS SOA1 AEROSOL MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZPTOTA(:,:,:,JP_AER_SOA1,JJ)) + ! + WRITE(TZFIELD%CMNHNAME,'(A5,I1)')'MSOA2',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ug m-3' + WRITE(TZFIELD%CCOMMENT,'(A23,I1)')'MASS SOA2 AEROSOL MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZPTOTA(:,:,:,JP_AER_SOA2,JJ)) + ! + WRITE(TZFIELD%CMNHNAME,'(A5,I1)')'MSOA3',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ug m-3' + WRITE(TZFIELD%CCOMMENT,'(A23,I1)')'MASS SOA3 AEROSOL MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZPTOTA(:,:,:,JP_AER_SOA3,JJ)) + ! + WRITE(TZFIELD%CMNHNAME,'(A5,I1)')'MSOA4',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ug m-3' + WRITE(TZFIELD%CCOMMENT,'(A23,I1)')'MASS SOA4 AEROSOL MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZPTOTA(:,:,:,JP_AER_SOA4,JJ)) + ! + WRITE(TZFIELD%CMNHNAME,'(A5,I1)')'MSOA5',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ug m-3' + WRITE(TZFIELD%CCOMMENT,'(A23,I1)')'MASS SOA5 AEROSOL MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZPTOTA(:,:,:,JP_AER_SOA5,JJ)) + ! + WRITE(TZFIELD%CMNHNAME,'(A5,I1)')'MSOA6',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ug m-3' + WRITE(TZFIELD%CCOMMENT,'(A23,I1)')'MASS SOA6 AEROSOL MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZPTOTA(:,:,:,JP_AER_SOA6,JJ)) + ! + WRITE(TZFIELD%CMNHNAME,'(A5,I1)')'MSOA7',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ug m-3' + WRITE(TZFIELD%CCOMMENT,'(A23,I1)')'MASS SOA7 AEROSOL MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZPTOTA(:,:,:,JP_AER_SOA7,JJ)) + ! + WRITE(TZFIELD%CMNHNAME,'(A5,I1)')'MSOA8',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ug m-3' + WRITE(TZFIELD%CCOMMENT,'(A23,I1)')'MASS SOA8 AEROSOL MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZPTOTA(:,:,:,JP_AER_SOA8,JJ)) + ! + WRITE(TZFIELD%CMNHNAME,'(A5,I1)')'MSOA9',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ug m-3' + WRITE(TZFIELD%CCOMMENT,'(A23,I1)')'MASS SOA9 AEROSOL MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZPTOTA(:,:,:,JP_AER_SOA9,JJ)) + ! + WRITE(TZFIELD%CMNHNAME,'(A6,I1)')'MSOA10',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ug m-3' + WRITE(TZFIELD%CCOMMENT,'(A24,I1)')'MASS SOA10 AEROSOL MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZPTOTA(:,:,:,JP_AER_SOA10,JJ)) + END IF + ! + WRITE(TZFIELD%CMNHNAME,'(A3,I1)')'MOC',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ug m-3' + WRITE(TZFIELD%CCOMMENT,'(A21,I1)')'MASS OC AEROSOL MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZPTOTA(:,:,:,JP_AER_OC,JJ)) + ! + WRITE(TZFIELD%CMNHNAME,'(A3,I1)')'MBC',JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'ug m-3' + WRITE(TZFIELD%CCOMMENT,'(A21,I1)')'MASS BC AEROSOL MODE ',JJ + CALL IO_Field_write(TPFILE,TZFIELD,ZPTOTA(:,:,:,JP_AER_BC,JJ)) + ENDDO +END IF +! +!* Large Scale variables +! +IF (LVAR_LS) THEN + CALL IO_Field_write(TPFILE,'LSUM', XLSUM) + CALL IO_Field_write(TPFILE,'LSVM', XLSVM) + ! + IF (LWIND_ZM) THEN + TZFIELD2(1)%CMNHNAME = 'LSUM_ZM' + TZFIELD2(1)%CSTDNAME = '' + TZFIELD2(1)%CLONGNAME = 'LSUM_ZM' + TZFIELD2(1)%CUNITS = 'm s-1' + TZFIELD2(1)%CDIR = 'XY' + TZFIELD2(1)%CCOMMENT = 'Large Scale Zonal component of horizontal wind' + TZFIELD2(1)%NGRID = 2 + TZFIELD2(1)%NTYPE = TYPEREAL + TZFIELD2(1)%NDIMS = 3 + TZFIELD2(1)%LTIMEDEP = .TRUE. + ! + TZFIELD2(2)%CMNHNAME = 'LSVM_ZM' + TZFIELD2(2)%CSTDNAME = '' + TZFIELD2(2)%CLONGNAME = 'LSVM_ZM' + TZFIELD2(2)%CUNITS = 'm s-1' + TZFIELD2(2)%CDIR = 'XY' + TZFIELD2(2)%CCOMMENT = 'Large Scale Meridian component of horizontal wind' + TZFIELD2(2)%NGRID = 3 + TZFIELD2(2)%NTYPE = TYPEREAL + TZFIELD2(2)%NDIMS = 3 + TZFIELD2(2)%LTIMEDEP = .TRUE. + ! + CALL UV_TO_ZONAL_AND_MERID(XLSUM,XLSVM,23,TPFILE=TPFILE,TZFIELDS=TZFIELD2) + ENDIF + ! + CALL IO_Field_write(TPFILE,'LSWM', XLSWM) + CALL IO_Field_write(TPFILE,'LSTHM',XLSTHM) +! + IF (LUSERV) THEN + CALL FIND_FIELD_ID_FROM_MNHNAME('LSRVM',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CUNITS = 'g kg-1' + CALL IO_Field_write(TPFILE,TZFIELD,XLSRVM(:,:,:)*1.E3) + END IF +END IF +! +!* Forcing variables +! +IF (LVAR_FRC .AND. LFORCING) THEN +! + DO JT=1,NFRC + WRITE (YFRC,'(I3.3)') JT +! + TZFIELD%CMNHNAME = 'UFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Zonal component of horizontal forcing wind' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_write(TPFILE,TZFIELD,XUFRC(:,JT)) +! + TZFIELD%CMNHNAME = 'VFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Meridian component of horizontal forcing wind' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_write(TPFILE,TZFIELD,XVFRC(:,JT)) +! + TZFIELD%CMNHNAME = 'WFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Vertical forcing wind' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_write(TPFILE,TZFIELD,XWFRC(:,JT)) +! + TZFIELD%CMNHNAME = 'THFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'K' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Forcing potential temperature' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_write(TPFILE,TZFIELD,XTHFRC(:,JT)) +! + TZFIELD%CMNHNAME = 'RVFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'kg kg-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Forcing vapor mixing ratio' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_write(TPFILE,TZFIELD,XRVFRC(:,JT)) +! + TZFIELD%CMNHNAME = 'TENDTHFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'K s-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Large-scale potential temperature tendency for forcing' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_write(TPFILE,TZFIELD,XTENDTHFRC(:,JT)) +! + TZFIELD%CMNHNAME = 'TENDRVFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'kg kg-1 s-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Large-scale vapor mixing ratio tendency for forcing' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_write(TPFILE,TZFIELD,XTENDRVFRC(:,JT)) +! + TZFIELD%CMNHNAME = 'GXTHFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'K m-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Large-scale potential temperature gradient for forcing' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_write(TPFILE,TZFIELD,XGXTHFRC(:,JT)) +! + TZFIELD%CMNHNAME = 'GYTHFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'K m-1' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Large-scale potential temperature gradient for forcing' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_write(TPFILE,TZFIELD,XGYTHFRC(:,JT)) +! + TZFIELD%CMNHNAME = 'PGROUNDFRC'//YFRC + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'Pa' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Forcing ground pressure' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 0 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_write(TPFILE,TZFIELD,XPGROUNDFRC(JT)) +! + END DO +END IF +! +!------------------------------------------------------------------------------- +! +!* 1.7 Some diagnostic variables +! +IF (LTPZH .OR. LCOREF) THEN +! +!* Temperature in celsius + TZFIELD%CMNHNAME = 'TEMP' + TZFIELD%CSTDNAME = 'air_temperature' + TZFIELD%CLONGNAME = 'TEMP' + TZFIELD%CUNITS = 'celsius' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_TEMPerature' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ZWORK31(:,:,:)=ZTEMP(:,:,:) - XTT + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) +! +!* Pressure in hPa + CALL FIND_FIELD_ID_FROM_MNHNAME('PABST',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'PRES' + TZFIELD%CUNITS = 'hPa' + CALL IO_Field_write(TPFILE,TZFIELD,XPABST(:,:,:)*1E-2) +! +!* Geopotential in meters + CALL IO_Field_write(TPFILE,'ALT',XZZ) +! +!* Relative humidity in percent + IF (LUSERV) THEN + ZWORK31(:,:,:)=SM_FOES(ZTEMP(:,:,:)) + ZWORK33(:,:,:)=ZWORK31(:,:,:) + ZWORK31(:,:,:)=(XMV/XMD)*ZWORK31(:,:,:)/(XPABST(:,:,:)-ZWORK31(:,:,:)) + ZWORK32(:,:,:)=100.*XRT(:,:,:,1)/ZWORK31(:,:,:) + IF (CCLOUD(1:3) =='ICE' .OR. CCLOUD =='C3R5' .OR. CCLOUD == 'LIMA') THEN + WHERE ( ZTEMP(:,:,:)< XTT) + ZWORK31(:,:,:) = EXP( XALPI - XBETAI/ZTEMP(:,:,:) & + - XGAMI*ALOG(ZTEMP(:,:,:)) ) !saturation over ice + ZWORK33(:,:,:)=ZWORK31(:,:,:) + ZWORK31(:,:,:)=(XMV/XMD)*ZWORK31(:,:,:)/(XPABST(:,:,:)-ZWORK31(:,:,:)) + ZWORK32(:,:,:)=100.*XRT(:,:,:,1)/ZWORK31(:,:,:) + END WHERE + END IF + ! + TZFIELD%CMNHNAME = 'REHU' + TZFIELD%CSTDNAME = 'relative_humidity' + TZFIELD%CLONGNAME = 'REHU' + TZFIELD%CUNITS = 'percent' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_RElative HUmidity' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK32) + ! + TZFIELD%CMNHNAME = 'VPRES' + TZFIELD%CSTDNAME = 'water_vapor_partial_pressure_in_air' + TZFIELD%CLONGNAME = 'VPRES' + TZFIELD%CUNITS = 'hPa' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Vapor PRESsure' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ZWORK33(:,:,:)=ZWORK33(:,:,:)*ZWORK32(:,:,:)*1E-4 + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK33) + ! + IF (LCOREF) THEN + ZWORK33(:,:,:)=(77.6*( XPABST(:,:,:)*1E-2 & + +ZWORK33(:,:,:)*4810/ZTEMP(:,:,:)) & + -6*ZWORK33(:,:,:) )/ZTEMP(:,:,:) + TZFIELD%CMNHNAME = 'COREF' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'COREF' + TZFIELD%CUNITS = '1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_REFraction COindex (N-units)' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK33) + ! + ZWORK33(:,:,:)=ZWORK33(:,:,:)+MZF(XZZ(:,:,:))*1E6/XRADIUS + TZFIELD%CMNHNAME = 'MCOREF' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'MCOREF' + TZFIELD%CUNITS = '1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Modified REFraction COindex (M-units)' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK33) + END IF + ELSE + PRINT*, 'NO WATER VAPOR IN ',TPFILE%CNAME,' RELATIVE HUMIDITY IS NOT COMPUTED' + END IF +! +END IF +! +!------------------------------------------------------------------------------- +! +!* Virtual potential temperature +! +IF ( LMOIST_V .OR. LMSLP .OR. CBLTOP/='NONE' ) THEN + ALLOCATE(ZTHETAV(IIU,IJU,IKU)) +! + IF(NRR > 0) THEN +! compute the ratio : 1 + total water mass / dry air mass + ZRV_OV_RD = XRV / XRD + ZTHETAV(:,:,:) = 1. + XRT(:,:,:,1) + DO JLOOP = 2,1+NRRL+NRRI + ZTHETAV(:,:,:) = ZTHETAV(:,:,:) + XRT(:,:,:,JLOOP) + END DO +! compute the virtual potential temperature when water is present in any form + ZTHETAV(:,:,:) = XTHT(:,:,:) * (1.+XRT(:,:,:,1)*ZRV_OV_RD) / ZTHETAV(:,:,:) + ELSE +! compute the virtual potential temperature when water is absent + ZTHETAV(:,:,:) = XTHT(:,:,:) + END IF +! + IF (LMOIST_V .AND. NRR > 0) THEN +! Virtual potential temperature + TZFIELD%CMNHNAME = 'THETAV' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'THETAV' + TZFIELD%CUNITS = 'K' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Virtual potential temperature' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZTHETAV) + END IF +! +END IF +! +!------------------------------------------------------------------------------- +! +!* Fog Visibility +! +IF (LVISI) THEN +! + IF ((CCLOUD /= 'NONE') .AND. (CCLOUD /='REVE')) ALLOCATE(ZVISIKUN(IIU,IJU,IKU)) + IF ((CCLOUD == 'C2R2') .OR. (CCLOUD =='KHKO')) THEN + ALLOCATE(ZVISIGUL(IIU,IJU,IKU)) + ALLOCATE(ZVISIZHA(IIU,IJU,IKU)) + END IF +! + IF ((CCLOUD /= 'NONE') .AND. (CCLOUD /='REVE')) THEN + ZVISIKUN(:,:,:) = 10000. + WHERE ( XRT(:,:,:,2) >= 1E-08 ) + ZVISIKUN(:,:,:) =0.027/(XRT(:,:,:,2)*XRHODREF(:,:,:))**0.88*1000. + END WHERE +! Visibity Kunkel + TZFIELD%CMNHNAME = 'VISIKUN' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'VISIKUN' + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Visibility Kunkel' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZVISIKUN) +! + IF ((CCLOUD == 'C2R2') .OR. (CCLOUD =='KHKO')) THEN + ZVISIGUL(:,:,:) = 10000. + ZVISIZHA(:,:,:) = 10000. + WHERE ( (XRT(:,:,:,2) >= 1E-08 ) .AND. (XSVT(:,:,:,NSV_C2R2BEG+1) >=0.001 ) ) + ZVISIGUL(:,:,:) =1.002/(XRT(:,:,:,2)*XRHODREF(:,:,:)*XSVT(:,:,:,NSV_C2R2BEG+1))**0.6473*1000. + ZVISIZHA(:,:,:) =0.187/(XRT(:,:,:,2)*XRHODREF(:,:,:)*XSVT(:,:,:,NSV_C2R2BEG+1))**0.34*1000. + END WHERE +! Visibity Gultepe + TZFIELD%CMNHNAME = 'VISIGUL' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'VISIGUL' + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Visibility Gultepe' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZVISIGUL) +! Visibity Zhang + TZFIELD%CMNHNAME = 'VISIZHA' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'VISIZHA' + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Visibility Zhang' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZVISIZHA) +! + DEALLOCATE(ZVISIGUL,ZVISIZHA) + END IF + DEALLOCATE(ZVISIKUN) + END IF +! +END IF +! +!------------------------------------------------------------------------------- +! +!* Thetae computation according eq.(21), (43) of Bolton 1980 (MWR108,p 1046-1053) +! +IF (( LMOIST_E .OR. LBV_FR ) .AND. (NRR>0)) THEN + ALLOCATE(ZTHETAE(IIU,IJU,IKU)) + ! + ZWORK31(:,:,:) = MAX(XRT(:,:,:,1),1.E-10) + ZTHETAE(:,:,:)= ( 2840./ & + (3.5*ALOG(XTHT(:,:,:)*( XPABST(:,:,:)/XP00 )**(XRD/XCPD) ) & + - ALOG( XPABST(:,:,:)*0.01*ZWORK31(:,:,:) / ( 0.622+ZWORK31(:,:,:) ) ) & + -4.805 ) ) + 55. + ZTHETAE(:,:,:)= XTHT(:,:,:) * EXP( (3376. / ZTHETAE(:,:,:) - 2.54) & + *ZWORK31(:,:,:) *(1. +0.81 *ZWORK31(:,:,:)) ) +! + IF (LMOIST_E) THEN + TZFIELD%CMNHNAME = 'THETAE' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'THETAE' + TZFIELD%CUNITS = 'K' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Equivalent potential temperature' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZTHETAE) + END IF +END IF +!------------------------------------------------------------------------------- +! +!* Thetaes computation +! +IF (LMOIST_ES .AND. (NRR>0)) THEN + ALLOCATE(ZTHETAES(IIU,IJU,IKU)) + ZWORK31(:,:,:) = MAX(QSAT(ZTEMP(:,:,:),XPABST(:,:,:)),1.E-10) + ZTHETAES(:,:,:)= ( 2840./ & + (3.5*ALOG(XTHT(:,:,:)*( XPABST(:,:,:)/XP00 )**(XRD/XCPD) ) & + - ALOG( XPABST(:,:,:)*0.01*ZWORK31(:,:,:) / ( 0.622+ZWORK31(:,:,:) ) ) & + -4.805 ) ) + 55. + ZTHETAES(:,:,:)= XTHT(:,:,:) * EXP( (3376. / ZTHETAE(:,:,:) - 2.54) & + *ZWORK31(:,:,:) *(1. +0.81 *ZWORK31(:,:,:)) ) + TZFIELD%CMNHNAME = 'THETAES' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'THETAES' + TZFIELD%CUNITS = 'K' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Equivalent Saturated potential temperature' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZTHETAES) +ENDIF +! +!------------------------------------------------------------------------------- +!* The Liquid-Water potential temperature (Betts, 1973) +! (also needed for THETAS1 or THETAS2) +! +IF ( LMOIST_L .OR. LMOIST_S1 .OR. LMOIST_S2 ) THEN +! + ALLOCATE(ZTHETAL(IIU,IJU,IKU)) +! + IF(NRR > 1) THEN +! The latent heat of Vaporization: + ZWORK31(:,:,:) = XLVTT + (XCPV-XCL)*(ZTEMP(:,:,:)-XTT) +! The latent heat of Sublimation: + ZWORK32(:,:,:) = XLSTT + (XCPV-XCI)*(ZTEMP(:,:,:)-XTT) +! The numerator in the exponential +! and the total water mixing ratio: + ZTHETAL(:,:,:) = 0.0 + ZWORK33(:,:,:) = XRT(:,:,:,1) + DO JLOOP = 2,1+NRRL + ZTHETAL(:,:,:) = ZTHETAL(:,:,:) + XRT(:,:,:,JLOOP)*ZWORK31(:,:,:) + ZWORK33(:,:,:) = ZWORK33(:,:,:) + XRT(:,:,:,JLOOP) + END DO + DO JLOOP = 1+NRRL+1,1+NRRL+NRRI + ZTHETAL(:,:,:) = ZTHETAL(:,:,:) + XRT(:,:,:,JLOOP)*ZWORK32(:,:,:) + ZWORK33(:,:,:) = ZWORK33(:,:,:) + XRT(:,:,:,JLOOP) + END DO +! compute the liquid-water potential temperature +! theta_l = theta * exp[ -(L_vap * ql + L_sub * qi) / (c_pd * T) ] +! when water is present in any form: + ZTHETAL(:,:,:) = XTHT(:,:,:) & + * exp(-ZTHETAL(:,:,:)/(1.0+ZWORK33(:,:,:))/XCPD/ZTEMP(:,:,:)) + ELSE +! compute the liquid-water potential temperature +! when water is absent: + ZTHETAL(:,:,:) = XTHT(:,:,:) + END IF +! + IF (LMOIST_L .AND. NRR > 0) THEN + ! Liquid-Water potential temperature + TZFIELD%CMNHNAME = 'THETAL' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'THETAL' + TZFIELD%CUNITS = 'K' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Liquid water potential temperature' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZTHETAL) + END IF +! +END IF +! +!------------------------------------------------------------------------------- +! +!* The Moist-air Entropy potential temperature (Marquet, QJ2011, HDR2016) +! +IF ( LMOIST_S1 .OR. LMOIST_S2 ) THEN + IF (LMOIST_S1) THEN + ALLOCATE(ZTHETAS1(IIU,IJU,IKU)) + END IF + IF (LMOIST_S2) THEN + ALLOCATE(ZTHETAS2(IIU,IJU,IKU)) + END IF +! +! The total water (ZWORK31) and condensed water (ZWORK32) mixing ratios: + ZWORK32(:,:,:) = 0.0 + IF(NRR > 0) THEN + DO JLOOP = 2,1+NRRL+NRRI + ZWORK32(:,:,:) = ZWORK32(:,:,:) + XRT(:,:,:,JLOOP) + END DO + END IF + ZWORK31(:,:,:) = ZWORK32(:,:,:) + XRT(:,:,:,1) +! + IF (LMOIST_S1) THEN +!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - +! thetas1 = thetal * exp[ 5.87 * qt ] ; with qt=rt/(1+rt) +!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ZTHETAS1(:,:,:) = ZTHETAL(:,:,:) * & + exp( 5.87*ZWORK31(:,:,:)/(1.0+ZWORK31(:,:,:)) ) + END IF + IF (LMOIST_S2) THEN +!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +! thetas2 = thetal * exp[ (5.87-0.46*ln(rv/0.0124)-0.46*qc) * qt ] +! where qt=rt/(1+rt) and qc=rc/(1+rt) +!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ZWORK33(:,:,:) = 5.87 - 0.46 * log(MAX(XRT(:,:,:,1),1.E-10)/0.0124) + ZTHETAS2(:,:,:) = ZTHETAL(:,:,:) * & + exp( ZWORK33(:,:,:)*ZWORK31(:,:,:)/(1.0+ZWORK31(:,:,:)) & + - 0.46*ZWORK32(:,:,:)/(1.0+ZWORK31(:,:,:)) ) + END IF + IF (LMOIST_S1) THEN +! The Moist-air Entropy potential temperature (1st order) + TZFIELD%CMNHNAME = 'THETAS1' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'THETAS1' + TZFIELD%CUNITS = 'K' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Moist air Entropy (1st order) potential temperature' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZTHETAS1) + END IF + IF (LMOIST_S2) THEN +! The Moist-air Entropy potential temperature (2nd order) + TZFIELD%CMNHNAME = 'THETAS2' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'THETAS2' + TZFIELD%CUNITS = 'K' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Moist air Entropy (2nd order) potential temperature' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZTHETAS2) + END IF +! +END IF +! +!------------------------------------------------------------------------------- +!! +! +!* Vorticity quantities +! +IF (LVORT) THEN +! Vorticity x + ZWORK31(:,:,:)=MYF(MZF(MXM(ZVOX(:,:,:)))) + TZFIELD%CMNHNAME = 'UM1' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'UM1' + TZFIELD%CUNITS = 's-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_x component of vorticity' + TZFIELD%NGRID = 2 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) +! +! Vorticity y + ZWORK32(:,:,:)=MZF(MXF(MYM(ZVOY(:,:,:)))) + TZFIELD%CMNHNAME = 'VM1' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'VM1' + TZFIELD%CUNITS = 's-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_y component of vorticity' + TZFIELD%NGRID = 3 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK32) + ! + IF (LWIND_ZM) THEN + TZFIELD2(1)%CMNHNAME = 'UM1_ZM' + TZFIELD2(1)%CSTDNAME = '' + TZFIELD2(1)%CLONGNAME = 'UM1_ZM' + TZFIELD2(1)%CUNITS = 'm s-1' + TZFIELD2(1)%CDIR = 'XY' + TZFIELD2(1)%CCOMMENT = 'Zonal component of horizontal vorticity' + TZFIELD2(1)%NGRID = 2 + TZFIELD2(1)%NTYPE = TYPEREAL + TZFIELD2(1)%NDIMS = 3 + TZFIELD2(1)%LTIMEDEP = .TRUE. + ! + TZFIELD2(2)%CMNHNAME = 'VM1_ZM' + TZFIELD2(2)%CSTDNAME = '' + TZFIELD2(2)%CLONGNAME = 'VM1_ZM' + TZFIELD2(2)%CUNITS = 'm s-1' + TZFIELD2(2)%CDIR = 'XY' + TZFIELD2(2)%CCOMMENT = 'Meridian component of horizontal vorticity' + TZFIELD2(2)%NGRID = 3 + TZFIELD2(2)%NTYPE = TYPEREAL + TZFIELD2(2)%NDIMS = 3 + TZFIELD2(2)%LTIMEDEP = .TRUE. + ! + CALL UV_TO_ZONAL_AND_MERID(ZWORK31,ZWORK32,23,TPFILE=TPFILE,TZFIELDS=TZFIELD2) + ENDIF +! +! Vorticity z + ZWORK31(:,:,:)=MXF(MYF(MZM(ZVOZ(:,:,:)))) + TZFIELD%CMNHNAME = 'WM1' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'WM1' + TZFIELD%CUNITS = 's-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_relative vorticity' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) +! +! Absolute Vorticity + ZWORK31(:,:,:)=MYF(MXF(ZVOZ(:,:,:))) + ZCORIOZ(:,:,:) + TZFIELD%CMNHNAME = 'ABVOR' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'ABVOR' + TZFIELD%CUNITS = 's-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_z ABsolute VORticity' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) +! +END IF +! +IF ( LMEAN_POVO ) THEN + ! + ALLOCATE(IWORK1(SIZE(XTHT,1),SIZE(XTHT,2))) + ! + IWORK1(:,:)=0 + ZWORK21(:,:)=0. + IF (XMEAN_POVO(1)>XMEAN_POVO(2)) THEN + !Invert values (smallest must be first) + ZX0D = XMEAN_POVO(1) + XMEAN_POVO(1) = XMEAN_POVO(2) + XMEAN_POVO(2) = ZX0D + END IF + DO JK=IKB,IKE + WHERE((XPABST(:,:,JK)>XMEAN_POVO(1)).AND.(XPABST(:,:,JK)<XMEAN_POVO(2))) + ZWORK21(:,:)=ZWORK21(:,:)+ZPOVO(:,:,JK) + IWORK1(:,:)=IWORK1(:,:)+1 + END WHERE + END DO + WHERE (IWORK1(:,:)>0) ZWORK21(:,:)=ZWORK21(:,:)/REAL( IWORK1(:,:) ) + TZFIELD%CMNHNAME = 'MEAN_POVO' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'MEAN_POVO' + TZFIELD%CUNITS = 'PVU' ! 1 PVU = 1e-6 m^2 s^-1 K kg^-1 + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_MEAN of POtential VOrticity' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) +END IF +! +! Virtual Potential Vorticity in PV units +IF (LMOIST_V .AND. (NRR>0) ) THEN + ZWORK31(:,:,:)=GX_M_M(ZTHETAV,XDXX,XDZZ,XDZX) + ZWORK32(:,:,:)=GY_M_M(ZTHETAV,XDYY,XDZZ,XDZY) + ZWORK33(:,:,:)=GZ_M_M(ZTHETAV,XDZZ) + ZWORK34(:,:,:)= ZWORK31(:,:,:)*MZF(MYF(ZVOX(:,:,:))) & + + ZWORK32(:,:,:)*MZF(MXF(ZVOY(:,:,:))) & + + ZWORK33(:,:,:)*(MYF(MXF(ZVOZ(:,:,:))) + ZCORIOZ(:,:,:)) + ZWORK34(:,:,:)=ZWORK34(:,:,:)*1E6/XRHODREF(:,:,:) + TZFIELD%CMNHNAME = 'POVOV' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'POVOV' + TZFIELD%CUNITS = 'PVU' ! 1 PVU = 1e-6 m^2 s^-1 K kg^-1 + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Virtual POtential VOrticity' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK34) +! + IF (LMEAN_POVO) THEN + IWORK1(:,:)=0 + ZWORK21(:,:)=0. + DO JK=IKB,IKE + WHERE((XPABST(:,:,JK)>XMEAN_POVO(1)).AND.(XPABST(:,:,JK)<XMEAN_POVO(2))) + ZWORK21(:,:)=ZWORK21(:,:)+ZWORK34(:,:,JK) + IWORK1(:,:)=IWORK1(:,:)+1 + END WHERE + END DO + WHERE(IWORK1(:,:)>0) ZWORK21(:,:)=ZWORK21(:,:)/REAL( IWORK1(:,:) ) + TZFIELD%CMNHNAME = 'MEAN_POVOV' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'MEAN_POVOV' + TZFIELD%CUNITS = 'PVU' ! 1 PVU = 1e-6 m^2 s^-1 K kg^-1 + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_MEAN of Virtual POtential VOrticity' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) + END IF +END IF +! +! Equivalent Potential Vorticity in PV units +IF (LMOIST_E .AND. (NRR>0) ) THEN +! + ZWORK31(:,:,:)=GX_M_M(ZTHETAE,XDXX,XDZZ,XDZX) + ZWORK32(:,:,:)=GY_M_M(ZTHETAE,XDYY,XDZZ,XDZY) + ZWORK33(:,:,:)=GZ_M_M(ZTHETAE,XDZZ) + ZWORK34(:,:,:)= ZWORK31(:,:,:)*MZF(MYF(ZVOX(:,:,:))) & + + ZWORK32(:,:,:)*MZF(MXF(ZVOY(:,:,:))) & + + ZWORK33(:,:,:)*(MYF(MXF(ZVOZ(:,:,:))) + ZCORIOZ(:,:,:)) + ZWORK34(:,:,:)=ZWORK34(:,:,:)*1E6/XRHODREF(:,:,:) + TZFIELD%CMNHNAME = 'POVOE' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'POVOE' + TZFIELD%CUNITS = 'PVU' ! 1 PVU = 1e-6 m^2 s^-1 K kg^-1 + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Equivalent POtential VOrticity' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK34) +! + IF (LMEAN_POVO) THEN + IWORK1(:,:)=0 + ZWORK21(:,:)=0. + DO JK=IKB,IKE + WHERE((XPABST(:,:,JK)>XMEAN_POVO(1)).AND.(XPABST(:,:,JK)<XMEAN_POVO(2))) + ZWORK21(:,:)=ZWORK21(:,:)+ZWORK34(:,:,JK) + IWORK1(:,:)=IWORK1(:,:)+1 + END WHERE + END DO + WHERE(IWORK1(:,:)>0) ZWORK21(:,:)=ZWORK21(:,:)/REAL( IWORK1(:,:) ) + TZFIELD%CMNHNAME = 'MEAN_POVOE' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'MEAN_POVOE' + TZFIELD%CUNITS = 'PVU' ! 1 PVU = 1e-6 m^2 s^-1 K kg^-1 + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_MEAN of Equivalent POtential VOrticity' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) + DEALLOCATE(IWORK1) + END IF + ! +END IF +! +! Equivalent Saturated Potential Vorticity in PV units +IF (LMOIST_ES .AND. (NRR>0) ) THEN + ZWORK31(:,:,:)=GX_M_M(ZTHETAES,XDXX,XDZZ,XDZX) + ZWORK32(:,:,:)=GY_M_M(ZTHETAES,XDYY,XDZZ,XDZY) + ZWORK33(:,:,:)=GZ_M_M(ZTHETAES,XDZZ) + ZWORK34(:,:,:)= ZWORK31(:,:,:)*MZF(MYF(ZVOX(:,:,:))) & + + ZWORK32(:,:,:)*MZF(MXF(ZVOY(:,:,:))) & + + ZWORK33(:,:,:)*(MYF(MXF(ZVOZ(:,:,:))) + ZCORIOZ(:,:,:)) + ZWORK34(:,:,:)=ZWORK34(:,:,:)*1E6/XRHODREF(:,:,:) + TZFIELD%CMNHNAME = 'POVOES' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'POVOES' + TZFIELD%CUNITS = 'PVU' ! 1 PVU = 1e-6 m^2 s^-1 K kg^-1 + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Equivalent Saturated POtential VOrticity' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK34) +ENDIF +! +! +!------------------------------------------------------------------------------- +! +!* Horizontal divergence +! +IF (LDIV) THEN +! + ZWORK31=GX_U_M(XUT,XDXX,XDZZ,XDZX) + GY_V_M(XVT,XDYY,XDZZ,XDZY) + TZFIELD%CMNHNAME = 'HDIV' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'HDIV' + TZFIELD%CUNITS = 's-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Horizontal DIVergence' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) +! + IF (LUSERV) THEN + TZFIELD%CMNHNAME = 'HMDIV' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'HMDIV' + TZFIELD%CUNITS = 'kg m-3 s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Horizontal Moisture DIVergence HMDIV' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ZWORK31=MXM(XRHODREF*XRT(:,:,:,1))*XUT + ZWORK32=MYM(XRHODREF*XRT(:,:,:,1))*XVT + ZWORK33=GX_U_M(ZWORK31,XDXX,XDZZ,XDZX) + GY_V_M(ZWORK32,XDYY,XDZZ,XDZY) + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK33) + END IF +! +ENDIF +! +!------------------------------------------------------------------------------- +! +!* Clustering +! +IF (LCLSTR) THEN + GCLOUD(:,:,:)=.FALSE. + GBOTUP=LBOTUP + IF (CFIELD=='W') THEN + WHERE(XWT(:,:,:).GT.XTHRES) GCLOUD(:,:,:)=.TRUE. + END IF + IF (CFIELD=='CLOUD') THEN + WHERE((XRT(:,:,:,2)+XRT(:,:,:,4)+XRT(:,:,:,5)+XRT(:,:,:,6)).GT.XTHRES) GCLOUD(:,:,:)=.TRUE. + END IF + PRINT *,'CALL CLUSTERING COUNT(GCLOUD)=',COUNT(GCLOUD) + CALL CLUSTERING(GBOTUP,GCLOUD,XWT,ICLUSTERID,ICLUSTERLV,ZCLDSIZE) + PRINT *,'GOT OUT OF CLUSTERING' + ! + TZFIELD%CMNHNAME = 'CLUSTERID' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'CLUSTERID' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_CLUSTER (ID NUMBER)' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEINT + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ICLUSTERID) + ! + TZFIELD%CMNHNAME = 'CLUSTERLV' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'CLUSTERLV' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_CLUSTER (BASE OR TOP LEVEL)' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEINT + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ICLUSTERLV) + ! + TZFIELD%CMNHNAME = 'CLDSIZE' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'CLDSIZE' + TZFIELD%CUNITS = '' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_CLDSIZE (HOR. SECTION)' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZCLDSIZE) +END IF +! +!------------------------------------------------------------------------------- +! +!* Geostrophic and Ageostrophic wind (m/s) +! +IF (LGEO .OR. LAGEO) THEN + ALLOCATE(ZPHI(IIU,IJU,IKU)) + IF(CEQNSYS=='MAE' .OR. CEQNSYS=='DUR') THEN + ZPHI(:,:,:)=(XPABST(:,:,:)/XP00)**(XRD/XCPD)-XEXNREF(:,:,:) + ! + ZPHI(1,1,:)=2*ZPHI(1,2,:)-ZPHI(1,3,:) + ZPHI(1,IJU,:)=2*ZPHI(1,IJU-1,:)-ZPHI(1,IJU-2,:) + ZPHI(IIU,1,:)=2*ZPHI(IIU,2,:)-ZPHI(IIU,3,:) + ZPHI(IIU,IJU,:)=2*ZPHI(IIU,IJU-1,:)-ZPHI(IIU,IJU-2,:) + ZWORK31(:,:,:)=-MXM(GY_M_M(ZPHI,XDYY,XDZZ,XDZY)*XCPD*XTHVREF/ZCORIOZ) + ! + ZPHI(1,1,:)=2*ZPHI(2,1,:)-ZPHI(3,1,:) + ZPHI(IIU,1,:)=2*ZPHI(IIU-1,1,:)-ZPHI(IIU-2,1,:) + ZPHI(1,IJU,:)=2*ZPHI(2,IJU,:)-ZPHI(3,IJU,:) + ZPHI(IIU,IJU,:)=2*ZPHI(IIU-1,IJU,:)-ZPHI(IIU-2,IJU,:) + ZWORK32(:,:,:)=MYM(GX_M_M(ZPHI,XDXX,XDZZ,XDZX)*XCPD*XTHVREF/ZCORIOZ) + ! + ELSE IF(CEQNSYS=='LHE') THEN + ZPHI(:,:,:)= ((XPABST(:,:,:)/XP00)**(XRD/XCPD)-XEXNREF(:,:,:)) & + * XCPD * XTHVREF(:,:,:) + ! + ZPHI(1,1,:)=2*ZPHI(1,2,:)-ZPHI(1,3,:) + ZPHI(1,IJU,:)=2*ZPHI(1,IJU-1,:)-ZPHI(1,IJU-2,:) + ZPHI(IIU,1,:)=2*ZPHI(IIU,2,:)-ZPHI(IIU,3,:) + ZPHI(IIU,IJU,:)=2*ZPHI(IIU,IJU-1,:)-ZPHI(IIU,IJU-2,:) + ZWORK31(:,:,:)=-MXM(GY_M_M(ZPHI,XDYY,XDZZ,XDZY)/ZCORIOZ) + ! + ZPHI(1,1,:)=2*ZPHI(2,1,:)-ZPHI(3,1,:) + ZPHI(IIU,1,:)=2*ZPHI(IIU-1,1,:)-ZPHI(IIU-2,1,:) + ZPHI(1,IJU,:)=2*ZPHI(2,IJU,:)-ZPHI(3,IJU,:) + ZPHI(IIU,IJU,:)=2*ZPHI(IIU-1,IJU,:)-ZPHI(IIU-2,IJU,:) + ZWORK32(:,:,:)=MYM(GX_M_M(ZPHI,XDXX,XDZZ,XDZX)/ZCORIOZ) + END IF + DEALLOCATE(ZPHI) +! + IF (LGEO) THEN + TZFIELD%CMNHNAME = 'UM88' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'UM88' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_U component of GEOstrophic wind' + TZFIELD%NGRID = 2 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) +! + TZFIELD%CMNHNAME = 'VM88' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'VM88' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_V component of GEOstrophic wind' + TZFIELD%NGRID = 3 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK32) + ! + IF (LWIND_ZM) THEN + TZFIELD2(1)%CMNHNAME = 'UM88_ZM' + TZFIELD2(1)%CSTDNAME = '' + TZFIELD2(1)%CLONGNAME = 'UM88_ZM' + TZFIELD2(1)%CUNITS = 'm s-1' + TZFIELD2(1)%CDIR = 'XY' + TZFIELD2(1)%CCOMMENT = 'Zonal component of GEOstrophic wind' + TZFIELD2(1)%NGRID = 2 + TZFIELD2(1)%NTYPE = TYPEREAL + TZFIELD2(1)%NDIMS = 3 + TZFIELD2(1)%LTIMEDEP = .TRUE. + ! + TZFIELD2(2)%CMNHNAME = 'VM88_ZM' + TZFIELD2(2)%CSTDNAME = '' + TZFIELD2(2)%CLONGNAME = 'VM88_ZM' + TZFIELD2(2)%CUNITS = 'm s-1' + TZFIELD2(2)%CDIR = 'XY' + TZFIELD2(2)%CCOMMENT = 'Meridian component of GEOstrophic wind' + TZFIELD2(2)%NGRID = 3 + TZFIELD2(2)%NTYPE = TYPEREAL + TZFIELD2(2)%NDIMS = 3 + TZFIELD2(2)%LTIMEDEP = .TRUE. + ! + CALL UV_TO_ZONAL_AND_MERID(ZWORK31,ZWORK32,23,TPFILE=TPFILE,TZFIELDS=TZFIELD2) + ENDIF +! +! wm necessary to plot vertical cross sections of wind vectors + CALL FIND_FIELD_ID_FROM_MNHNAME('WT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'WM88' + TZFIELD%CLONGNAME = 'WM88' + CALL IO_Field_write(TPFILE,TZFIELD,XWT) + END IF +! + IF (LAGEO) THEN + ZWORK31(:,:,:)=XUT(:,:,:)-ZWORK31(:,:,:) + ZWORK32(:,:,:)=XVT(:,:,:)-ZWORK32(:,:,:) + ! + TZFIELD%CMNHNAME = 'UM89' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'UM89' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_U component of AGEOstrophic wind' + TZFIELD%NGRID = 2 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + ! + TZFIELD%CMNHNAME = 'VM89' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'VM89' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_V component of AGEOstrophic wind' + TZFIELD%NGRID = 3 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK32) + ! + IF (LWIND_ZM) THEN + TZFIELD2(1)%CMNHNAME = 'UM89_ZM' + TZFIELD2(1)%CSTDNAME = '' + TZFIELD2(1)%CLONGNAME = 'UM89_ZM' + TZFIELD2(1)%CUNITS = 'm s-1' + TZFIELD2(1)%CDIR = 'XY' + TZFIELD2(1)%CCOMMENT = 'Zonal component of AGEOstrophic wind' + TZFIELD2(1)%NGRID = 2 + TZFIELD2(1)%NTYPE = TYPEREAL + TZFIELD2(1)%NDIMS = 3 + TZFIELD2(1)%LTIMEDEP = .TRUE. + ! + TZFIELD2(2)%CMNHNAME = 'VM89_ZM' + TZFIELD2(2)%CSTDNAME = '' + TZFIELD2(2)%CLONGNAME = 'VM89_ZM' + TZFIELD2(2)%CUNITS = 'm s-1' + TZFIELD2(2)%CDIR = 'XY' + TZFIELD2(2)%CCOMMENT = 'Meridian component of AGEOstrophic wind' + TZFIELD2(2)%NGRID = 3 + TZFIELD2(2)%NTYPE = TYPEREAL + TZFIELD2(2)%NDIMS = 3 + TZFIELD2(2)%LTIMEDEP = .TRUE. + ! + CALL UV_TO_ZONAL_AND_MERID(ZWORK31,ZWORK32,23,TPFILE=TPFILE,TZFIELDS=TZFIELD2) + ENDIF +! +! wm necessary to plot vertical cross sections of wind vectors + CALL FIND_FIELD_ID_FROM_MNHNAME('WT',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%CMNHNAME = 'WM89' + TZFIELD%CLONGNAME = 'WM89' + CALL IO_Field_write(TPFILE,TZFIELD,XWT) + END IF +! +END IF +! +!------------------------------------------------------------------------------- +! +!* Contravariant wind field +! +! +IF(LWIND_CONTRAV) THEN!$ + CALL CONTRAV ((/"TEST","TEST"/),(/"TEST","TEST"/),XUT,XVT,XWT,XDXX,XDYY,XDZZ,XDZX,XDZY, & + ZWORK31,ZWORK32,ZWORK33,2) + ! + TZFIELD%CMNHNAME = 'WNORM' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'WNORM' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_W surface normal wind' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK33) +END IF +!------------------------------------------------------------------------------- +! +!* Mean Sea Level Pressure in hPa +! +IF (LMSLP) THEN + ZGAMREF=-6.5E-3 +! Exner function at the first mass point + ZWORK21(:,:) = (XPABST(:,:,IKB) /XP00)**(XRD/XCPD) +! virtual temperature at the first mass point + ZWORK21(:,:) = ZWORK21(:,:) * ZTHETAV(:,:,IKB) +! virtual temperature at ground level + ZWORK21(:,:) = ZWORK21(:,:) - ZGAMREF*((XZZ(:,:,IKB)+XZZ(:,:,IKB+1))/2.-XZS(:,:)) +! virtual temperature at sea level + ZWORK22(:,:) = ZWORK21(:,:) - ZGAMREF*XZS(:,:) +! average underground virtual temperature + ZWORK22(:,:) = 0.5*(ZWORK21(:,:)+ZWORK22(:,:)) +! surface pressure + ZWORK21(:,:) = ( XPABST(:,:,IKB) + XPABST(:,:,IKB-1) )*.5 +! sea level pressure (hPa) + ZWORK22(:,:) = 1.E-2*ZWORK21(:,:)*EXP(XG*XZS(:,:)/(XRD*ZWORK22(:,:))) +! + TZFIELD%CMNHNAME = 'MSLP' + TZFIELD%CSTDNAME = 'air_pressure_at_sea_level' + TZFIELD%CLONGNAME = 'MSLP' + TZFIELD%CUNITS = 'hPa' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Mean Sea Level Pressure' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK22) +END IF +!------------------------------------------------------------------------------- +! +!* Vapor, cloud water and ice thickness +! +IF (LTHW) THEN +! + ZWORK21(:,:) = 0. + IF(SIZE(XRT,4)>=1)THEN + DO JK = IKB,IKE + ZWORK21(:,:) = ZWORK21(:,:)+XRHODREF(:,:,JK)*XRT(:,:,JK,1) * & + (XZZ(:,:,JK+1)-XZZ(:,:,JK))/XRHOLW + END DO + ZWORK21(:,:) = ZWORK21(:,:)*1000. ! vapor water in mm unit + TZFIELD%CMNHNAME = 'THVW' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'THVW' + TZFIELD%CUNITS = 'mm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_THickness of Vapor Water' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) + END IF + ! + ZWORK21(:,:) = 0. + IF(SIZE(XRT,4)>=2)THEN + DO JK = IKB,IKE + ZWORK21(:,:) = ZWORK21(:,:)+XRHODREF(:,:,JK)*XRT(:,:,JK,2) * & + (XZZ(:,:,JK+1)-XZZ(:,:,JK))/XRHOLW + END DO + ZWORK21(:,:) = ZWORK21(:,:)*1000. ! cloud water in mm unit + TZFIELD%CMNHNAME = 'THCW' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'THCW' + TZFIELD%CUNITS = 'mm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_THickness of Cloud Water' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) + END IF + ! + ZWORK21(:,:) = 0. + IF(SIZE(XRT,4)>=3)THEN + DO JK = IKB,IKE + ZWORK21(:,:) = ZWORK21(:,:)+XRHODREF(:,:,JK)*XRT(:,:,JK,3) * & + (XZZ(:,:,JK+1)-XZZ(:,:,JK))/XRHOLW + END DO + ZWORK21(:,:) = ZWORK21(:,:)*1000. ! rain water in mm unit + TZFIELD%CMNHNAME = 'THRW' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'THRW' + TZFIELD%CUNITS = 'mm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_THickness of Rain Water' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) + END IF + ! + ZWORK21(:,:) = 0. + IF(SIZE(XRT,4)>=4)THEN + DO JK = IKB,IKE + ZWORK21(:,:) = ZWORK21(:,:)+XRHODREF(:,:,JK)*XRT(:,:,JK,4) * & + (XZZ(:,:,JK+1)-XZZ(:,:,JK))/XRHOLW + END DO + ZWORK21(:,:) = ZWORK21(:,:)*1000. ! ice thickness in mm unit + TZFIELD%CMNHNAME = 'THIC' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'THIC' + TZFIELD%CUNITS = 'mm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_THickness of ICe' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) + END IF + ! + ZWORK21(:,:) = 0. + IF(SIZE(XRT,4)>=5)THEN + DO JK = IKB,IKE + ZWORK21(:,:) = ZWORK21(:,:)+XRHODREF(:,:,JK)*XRT(:,:,JK,5) * & + (XZZ(:,:,JK+1)-XZZ(:,:,JK))/XRHOLW + END DO + ZWORK21(:,:) = ZWORK21(:,:)*1000. ! snow thickness in mm unit + TZFIELD%CMNHNAME = 'THSN' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'THSN' + TZFIELD%CUNITS = 'mm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_THickness of SNow' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) + END IF + ! + ZWORK21(:,:) = 0. + IF(SIZE(XRT,4)>=6)THEN + DO JK = IKB,IKE + ZWORK21(:,:) = ZWORK21(:,:)+XRHODREF(:,:,JK)*XRT(:,:,JK,6) * & + (XZZ(:,:,JK+1)-XZZ(:,:,JK))/XRHOLW + END DO + ZWORK21(:,:) = ZWORK21(:,:)*1000. ! graupel thickness in mm unit + TZFIELD%CMNHNAME = 'THGR' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'THGR' + TZFIELD%CUNITS = 'mm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_THickness of GRaupel' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) + END IF + ! + ZWORK21(:,:) = 0. + IF(SIZE(XRT,4)>=7)THEN + DO JK = IKB,IKE + ZWORK21(:,:) = ZWORK21(:,:)+XRHODREF(:,:,JK)*XRT(:,:,JK,7) * & + (XZZ(:,:,JK+1)-XZZ(:,:,JK))/XRHOLW + END DO + ZWORK21(:,:) = ZWORK21(:,:)*1000. ! hail thickness in mm unit + TZFIELD%CMNHNAME = 'THHA' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'THHA' + TZFIELD%CUNITS = 'mm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_THickness of HAil' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) + END IF +END IF +! +!------------------------------------------------------------------------------- +! +!* Accumulated and instantaneous total precip rates in mm and mm/h +! +IF (LTOTAL_PR .AND. SIZE (XACPRR)>0 ) THEN + ZWORK21(:,:) = 0. + ! + IF (LUSERR) THEN + ZWORK21(:,:) = XACPRR(:,:)*1E3 + END IF + IF (CCLOUD(1:3) == 'ICE' .OR. CCLOUD == 'C3R5' .OR. CCLOUD == 'LIMA') THEN + ZWORK21(:,:) = ZWORK21(:,:) + (XACPRS(:,:) + XACPRG(:,:))*1E3 + IF (SIZE(XINPRC) /= 0 ) & + ZWORK21(:,:) = ZWORK21(:,:) + XACPRC(:,:) *1E3 + IF (SIZE(XINPRH) /= 0 ) & + ZWORK21(:,:) = ZWORK21(:,:) + XACPRH(:,:) *1E3 + END IF + IF (CCLOUD == 'C2R2' .OR. CCLOUD == 'C3R5' .OR. CCLOUD == 'KHKO' & + .OR. CCLOUD == 'LIMA' ) THEN + IF (SIZE(XINPRC) /= 0 ) & + ZWORK21(:,:) = ZWORK21(:,:) + XACPRC(:,:) *1E3 + END IF + IF (CDCONV /= 'NONE') THEN + ZWORK21(:,:) = ZWORK21(:,:) + XPACCONV(:,:)*1E3 + END IF + IF (LUSERR .OR. CCLOUD(1:3) == 'ICE' .OR. CCLOUD == 'C3R5' .OR. & + CCLOUD == 'LIMA' .OR. CDCONV /= 'NONE') THEN + TZFIELD%CMNHNAME = 'ACTOPR' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'ACTOPR' + TZFIELD%CUNITS = 'mm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_ACccumulated TOtal Precipitation Rate' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) + ELSE + PRINT * ,'YOU WANT TO COMPUTE THE ACCUMULATED RAIN' + PRINT * ,'BUT NO RAIN IS PRESENT IN THE MODEL' + END IF + ! + ! calculation of the mean accumulated precipitations in the mesh-grid of a + !large-scale model + IF (LMEAN_PR .AND. LUSERR) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'mm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Large Scale ACccumulated TOtal Precipitation Rate' + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JK=1,SIZE(XMEAN_PR),2 + IF (XMEAN_PR(JK) .NE. XUNDEF .AND. XMEAN_PR(JK+1) .NE. XUNDEF) THEN + PRINT * ,'MEAN accumulated RAIN: GRID ', XMEAN_PR(JK), XMEAN_PR(JK+1) + CALL COMPUTE_MEAN_PRECIP(ZWORK21,XMEAN_PR(JK:JK+1),ZWORK22,TZFIELD%NGRID) + ! + JI=INT(XMEAN_PR(JK)) + JJ=INT(XMEAN_PR(JK+1)) + WRITE(TZFIELD%CMNHNAME,'(A9,2I2.2)')'LS_ACTOPR',JI,JJ + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK22) + END IF + END DO + ! + END IF + ! + ! + ZWORK21(:,:) = 0. + ! + IF (LUSERR) THEN + ZWORK21(:,:) = XINPRR(:,:)*3.6E6 + END IF + IF (CCLOUD(1:3) == 'ICE' .OR. CCLOUD == 'C3R5' .OR. CCLOUD == 'LIMA') THEN + ZWORK21(:,:) = ZWORK21(:,:) + (XINPRS(:,:) + XINPRG(:,:))*3.6E6 + IF (SIZE(XINPRC) /= 0 ) & + ZWORK21(:,:) = ZWORK21(:,:) + XINPRC(:,:) *3.6E6 + IF (SIZE(XINPRH) /= 0 ) & + ZWORK21(:,:) = ZWORK21(:,:) + XINPRH(:,:) *3.6E6 + END IF + IF (CCLOUD == 'C2R2' .OR. CCLOUD == 'C3R5' .OR. CCLOUD == 'KHKO' & + .OR. CCLOUD == 'LIMA' ) THEN + IF (SIZE(XINPRC) /= 0 ) & + ZWORK21(:,:) = ZWORK21(:,:) + XINPRC(:,:) *3.6E6 + END IF + IF (CDCONV /= 'NONE') THEN + ZWORK21(:,:) = ZWORK21(:,:) + XPRCONV(:,:)*3.6E6 + END IF + IF (LUSERR .OR. CCLOUD(1:3) == 'ICE' .OR. CCLOUD == 'C3R5' .OR. & + CCLOUD == 'LIMA' .OR. CDCONV /= 'NONE') THEN + TZFIELD%CMNHNAME = 'INTOPR' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'INTOPR' + TZFIELD%CUNITS = 'mm hour-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_INstantaneous TOtal Precipitation Rate' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) + ELSE + PRINT * ,'YOU WANT TO COMPUTE THE RAIN RATE' + PRINT * ,'BUT NO RAIN IS PRESENT IN THE MODEL' + END IF +! + ! calculation of the mean instantaneous precipitations in the mesh-grid of a + ! large-scale model + IF (LMEAN_PR .AND. LUSERR) THEN + CALL COMPUTE_MEAN_PRECIP(ZWORK21,XMEAN_PR,ZWORK22,TZFIELD%NGRID) +! + TZFIELD%CMNHNAME = 'LS_INTOPR' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'LS_INTOPR' + TZFIELD%CUNITS = 'mm hour-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Large Scale INstantaneous TOtal Precipitation Rate' + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK22) + END IF +! +END IF +! +!------------------------------------------------------------------------------- +! +!* CAPEMAX, CINMAX (corresponding to CAPEMAX), CAPE, CIN, DCAPE, VKE in J/kg +! +IF (NCAPE >=0 .AND. LUSERV) THEN + ZWORK31(:,:,:) = XRT(:,:,:,1) * 1000. ! vapour mixing ratio in g/kg + ZWORK32(:,:,:)=0.0 + ZWORK33(:,:,:)=0.0 + ZWORK34(:,:,:)=0.0 + CALL CALCSOUND( XPABST(:,:,IKB:IKE)* 0.01 ,ZTEMP(:,:,IKB:IKE)- XTT, & + ZWORK31(:,:,IKB:IKE), & + ZWORK32(:,:,IKB:IKE),ZWORK33(:,:,IKB:IKE), & + ZWORK34(:,:,IKB:IKE),ZWORK21,ZWORK22 ) + ! + TZFIELD%CMNHNAME = 'CAPEMAX' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'CAPEMAX' + TZFIELD%CUNITS = 'J kg-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_MAX of Convective Available Potential Energy' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) + ! + TZFIELD%CMNHNAME = 'CINMAX' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'CINMAX' + TZFIELD%CUNITS = 'J kg-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_MAX of Convective INhibition energy' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK22) + ! + IF (NCAPE >=1) THEN + TZFIELD%CMNHNAME = 'CAPE3D' + TZFIELD%CSTDNAME = 'atmosphere_convective_available_potential_energy' + TZFIELD%CLONGNAME = 'CAPE3D' + TZFIELD%CUNITS = 'J kg-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Convective Available Potential Energy' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK32) + ! + TZFIELD%CMNHNAME = 'CIN3D' + TZFIELD%CSTDNAME = 'atmosphere_convective_inhibition' + TZFIELD%CLONGNAME = 'CIN3D' + TZFIELD%CUNITS = 'J kg-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Convective INhibition energy' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK33) + ! + TZFIELD%CMNHNAME = 'DCAPE3D' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'DCAPE3D' + TZFIELD%CUNITS = 'J kg-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = '' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK34) + END IF + ! + IF (NCAPE >=2) THEN + ZWORK31(:,:,1:IKU-1)= 0.5*(XWT(:,:,1:IKU-1)+XWT(:,:,2:IKU)) + ZWORK31(:,:,IKU) = 0. + ZWORK31=0.5*ZWORK31**2 + ! + TZFIELD%CMNHNAME = 'VKE' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'VKE' + TZFIELD%CUNITS = 'J kg-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Vertical Kinetic Energy' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + END IF +ENDIF +! +!------------------------------------------------------------------------------- +! +!* B-V frequency to assess thermal tropopause +! +IF (LBV_FR) THEN + ZWORK32(:,:,:)=DZM(XTHT(:,:,:))/ MZM(XTHT(:,:,:)) + DO JK=1,IKU + DO JJ=1,IJU + DO JI=1,IIU + IF(ZWORK32(JI,JJ,JK)<0.) THEN + ZWORK31(JI,JJ,JK)= -1.*SQRT( ABS( XG*ZWORK32(JI,JJ,JK)/ XDZZ(JI,JJ,JK) ) ) + ELSE + ZWORK31(JI,JJ,JK)= SQRT( ABS( XG*ZWORK32(JI,JJ,JK)/ XDZZ(JI,JJ,JK) ) ) + END IF + ENDDO + ENDDO + ENDDO + ! + TZFIELD%CMNHNAME = 'BV' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'BV' + TZFIELD%CUNITS = 's-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Brunt-Vaissala frequency' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) +! + IF (NRR > 0) THEN + ZWORK32(:,:,:)=DZM(ZTHETAE(:,:,:))/ MZM(ZTHETAE(:,:,:)) + DO JK=1,IKU + DO JJ=1,IJU + DO JI=1,IIU + IF (ZWORK32(JI,JJ,JK)<0.) THEN + ZWORK31(JI,JJ,JK)= -1.*SQRT( ABS( XG*ZWORK32(JI,JJ,JK)/ XDZZ(JI,JJ,JK) ) ) + ELSE + ZWORK31(JI,JJ,JK)= SQRT( ABS( XG*ZWORK32(JI,JJ,JK)/ XDZZ(JI,JJ,JK) ) ) + END IF + ENDDO + ENDDO + ENDDO +! + TZFIELD%CMNHNAME = 'BVE' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'BVE' + TZFIELD%CUNITS = 's-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Equivalent Brunt-Vaissala frequency' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + END IF +END IF +! +IF(ALLOCATED(ZTHETAE)) DEALLOCATE(ZTHETAE) +IF(ALLOCATED(ZTHETAES)) DEALLOCATE(ZTHETAES) +!------------------------------------------------------------------------------- +! +!* GPS synthetic ZTD, ZHD, ZWD +! +IF ( NGPS>=0 ) THEN + ! surface temperature + ZGAMREF=-6.5E-3 + ZWORK21(:,:) = ZTEMP(:,:,IKB) - ZGAMREF*((XZZ(:,:,IKB)+XZZ(:,:,IKB+1))/2.-XZS(:,:)) + ! + YFGRI=ADJUSTL(ADJUSTR(TPFILE%CNAME)//'GPS') + CALL GPS_ZENITH (YFGRI,XRT(:,:,:,1),ZTEMP,XPABST,ZWORK21,ZWORK22,ZWORK23,ZWORK24) + ! + TZFIELD%CMNHNAME = 'ZTD' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'ZTD' + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Zenithal Total Delay' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK22) + ! + IF (NGPS>=1) THEN + TZFIELD%CMNHNAME = 'ZHD' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'ZHD' + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Zenithal Hydrostatic Delay' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK23) + ! + TZFIELD%CMNHNAME = 'ZWD' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'ZWD' + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Zenithal Wet Delay' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK24) + ! + END IF + ! +END IF +! +!------------------------------------------------------------------------------- +! +!* Radar reflectivities +! +IF(LRADAR .AND. LUSERR) THEN +! CASE PREP_REAL_CASE after arome + IF (CCLOUD=='NONE' .OR. CCLOUD=='KESS') THEN + DEALLOCATE(XCIT) + ALLOCATE(XCIT(IIU,IJU,IKU)) + XCIT(:,:,:)=800. + CALL INI_RADAR('PLAT') + ELSE IF (CCLOUD=='LIMA') THEN + DEALLOCATE(XCIT) + ALLOCATE(XCIT(IIU,IJU,IKU)) + XCIT(:,:,:)=XSVT(:,:,:,NSV_LIMA_NI) + CALL INI_RADAR('PLAT') + END IF +! + IF (NMOM_S.GE.2) ZW1(:,:,:)=XSVT(:,:,:,NSV_LIMA_NS) + IF (NMOM_G.GE.2) ZW2(:,:,:)=XSVT(:,:,:,NSV_LIMA_NG) + IF (NMOM_H.GE.2) ZW3(:,:,:)=XSVT(:,:,:,NSV_LIMA_NH) + IF (NVERSION_RAD == 1) THEN +! original version of radar diagnostics + WRITE(ILUOUT0,*) 'radar diagnostics from RADAR_RAIN_ICE routine' + IF (CCLOUD=='LIMA') THEN + CALL RADAR_RAIN_ICE (XRT, XCIT, XRHODREF, ZTEMP, ZWORK31, ZWORK32, & + ZWORK33, ZWORK34,XSVT(:,:,:,NSV_LIMA_NR), & + ZW1(:,:,:),ZW2(:,:,:),ZW3(:,:,:) ) + ELSE + CALL RADAR_RAIN_ICE (XRT, XCIT, XRHODREF, ZTEMP, ZWORK31, ZWORK32, & + ZWORK33, ZWORK34 ) + ENDIF +! + TZFIELD%CMNHNAME = 'RARE' + TZFIELD%CSTDNAME = 'equivalent_reflectivity_factor' + TZFIELD%CLONGNAME = 'RARE' + TZFIELD%CUNITS = 'dBZ' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_RAdar REflectivity' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) +! + TZFIELD%CMNHNAME = 'VDOP' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'VDOP' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_radar DOPpler fall speed' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK32) +! + TZFIELD%CMNHNAME = 'ZDR' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'ZDR' + TZFIELD%CUNITS = 'dBZ' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Differential polar Reflectivity' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK33) +! + TZFIELD%CMNHNAME = 'KDP' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'KDP' + TZFIELD%CUNITS = 'degree km-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Differential Phase Reflectivity' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK34) +! + ELSE + ! + WRITE(ILUOUT0,*) 'radar diagnostics from RADAR_SIMULATOR routine' + + NBRAD=COUNT(XLAT_RAD(:) /= XUNDEF) + NMAX=INT(NBSTEPMAX*XSTEP_RAD/XGRID) + IF(NBSTEPMAX*XSTEP_RAD/XGRID/=NMAX .AND. (LCART_RAD)) THEN + CALL PRINT_MSG(NVERB_FATAL,'GEN','WRITE_LFIFM1_FOR_DIAG', & + 'NBSTEPMAX*XSTEP_RAD/XGRID is not an integer; please choose another combination') + ENDIF + DO JI=1,NBRAD + NBELEV(JI)=COUNT(XELEV(JI,:) /= XUNDEF) + WRITE(ILUOUT0,*) 'Number of ELEVATIONS : ', NBELEV(JI), 'FOR RADAR:', JI + END DO + IIELV=MAXVAL(NBELEV(1:NBRAD)) + WRITE(ILUOUT0,*) 'Maximum number of ELEVATIONS',IIELV + WRITE(ILUOUT0,*) 'YOU HAVE ASKED FOR ', NBRAD, 'RADARS' + ! + IF (LCART_RAD) NBAZIM=8*NMAX ! number of azimuths + WRITE(ILUOUT0,*) ' Number of AZIMUTHS : ', NBAZIM + IF (LCART_RAD) THEN + ALLOCATE(ZWORK43(NBRAD,4*NMAX,2*NMAX)) + ELSE + ALLOCATE(ZWORK43(1,NBAZIM,1)) + END IF +!! Some controls... + IF(NBRAD/=COUNT(XLON_RAD(:) /= XUNDEF).OR.NBRAD/=COUNT(XALT_RAD(:) /= XUNDEF).OR. & + NBRAD/=COUNT(XLAM_RAD(:) /= XUNDEF).OR.NBRAD/=COUNT(XDT_RAD(:) /= XUNDEF).OR. & + NBRAD/=COUNT(CNAME_RAD(:) /= "UNDEF")) THEN + CALL PRINT_MSG(NVERB_FATAL,'GEN','WRITE_LFIFM1_FOR_DIAG','inconsistency in DIAG1.nam') + END IF + IF(NCURV_INTERPOL==0.AND.(LREFR.OR.LDNDZ)) THEN + LREFR=.FALSE. + LDNDZ=.FALSE. + WRITE(ILUOUT0,*) "Warning: cannot output refractivity nor its vertical gradient when NCURV_INTERPOL=0" + END IF + IF(MOD(NPTS_H,2)==0) THEN + NPTS_H=NPTS_H+1 + WRITE(ILUOUT0,*) "Warning: NPTS_H has to be ODD. Setting it to ",NPTS_H + END IF + IF(MOD(NPTS_V,2)==0) THEN + NPTS_V=NPTS_V+1 + WRITE(ILUOUT0,*) "Warning: NPTS_V has to be ODD. Setting it to ",NPTS_V + END IF + IF(LWBSCS.AND.LWREFL) THEN + LWREFL=.FALSE. + WRITE(ILUOUT0,*) "Warning: LWREFL cannot be set to .TRUE. if LWBSCS is also set to .TRUE.. Setting LWREFL to .FALSE.." + END IF + IF(CCLOUD=="LIMA" .AND. NDIFF/=7) THEN + WRITE(YMSG,*) 'NDIFF=',NDIFF,' not available with CCLOUD=LIMA' + CALL PRINT_MSG(NVERB_FATAL,'GEN','WRITE_LFIFM1_FOR_DIAG',YMSG) + END IF + INBOUT=28 !28: Temperature + RHR, RHS, RHG, ZDA, ZDS, ZDG, KDR, KDS, KDG + IF (CCLOUD=='LIMA') INBOUT=INBOUT+1 ! rain concentration CRT + IF(LREFR) INBOUT=INBOUT+1 !+refractivity + IF(LDNDZ) INBOUT=INBOUT+1 !+refractivity vertical gradient + IF(LATT) INBOUT=INBOUT+12 !+AER-AEG AVR-AVG (vertical specific attenuation) and ATR-ATG + IF ( CCLOUD=='ICE4' ) THEN + INBOUT=INBOUT+5 ! HAIL ZEH RHH ZDH KDH M_H + IF (LATT) THEN + INBOUT=INBOUT+3 ! AEH AVH ATH + ENDIF + END IF + WRITE(ILUOUT0,*) "Nombre de variables dans ZWORK42 en sortie de radar_simulator:",INBOUT + + IF (LCART_RAD) THEN + ALLOCATE(ZWORK42(NBRAD,IIELV,2*NMAX,2*NMAX,INBOUT)) + ELSE + ALLOCATE(ZWORK42(NBRAD,IIELV,NBAZIM,NBSTEPMAX+1,INBOUT)) + ALLOCATE(ZWORK42_BIS(NBRAD,IIELV,NBAZIM,NBSTEPMAX+1,INBOUT)) + END IF + ! + IF (CCLOUD=='LIMA') THEN + CALL RADAR_SIMULATOR(XUT,XVT,XWT,XRT,XSVT(:,:,:,NSV_LIMA_NI),XRHODREF,& + ZTEMP,XPABST,ZWORK42,ZWORK43,XSVT(:,:,:,NSV_LIMA_NR)) + ELSE ! ICE3 + CALL RADAR_SIMULATOR(XUT,XVT,XWT,XRT,XCIT,XRHODREF,ZTEMP,XPABSM,ZWORK42,ZWORK43) + ENDIF + ALLOCATE(YRAD(INBOUT)) + YRAD(1:8)=(/"ZHH","ZDR","KDP","CSR","ZER","ZEI","ZES","ZEG"/) + ICURR=9 + IF (CCLOUD=='ICE4') THEN + YRAD(ICURR)="ZEH" + ICURR=ICURR+1 + END IF + YRAD(ICURR)="VRU" + ICURR=ICURR+1 + IF(LATT) THEN + IF (CCLOUD=='ICE4') THEN + YRAD(ICURR:ICURR+14)=(/"AER","AEI","AES","AEG","AEH","AVR","AVI","AVS","AVG","AVH","ATR","ATI","ATS","ATG","ATH"/) + ICURR=ICURR+15 + ELSE + YRAD(ICURR:ICURR+11)=(/"AER","AEI","AES","AEG","AVR","AVI","AVS","AVG","ATR","ATI","ATS","ATG"/) + ICURR=ICURR+12 + END IF + END IF + YRAD(ICURR:ICURR+2)=(/"RHV","PDP","DHV"/) + ICURR=ICURR+3 + YRAD(ICURR:ICURR+2)=(/"RHR","RHS","RHG"/) + ICURR=ICURR+3 + IF (CCLOUD=='ICE4') THEN + YRAD(ICURR)="RHH" + ICURR=ICURR+1 + END IF + YRAD(ICURR:ICURR+2)=(/"ZDA","ZDS","ZDG"/) + ICURR=ICURR+3 + IF (CCLOUD=='ICE4') THEN + YRAD(ICURR)="ZDH" + ICURR=ICURR+1 + END IF + YRAD(ICURR:ICURR+2)=(/"KDR","KDS","KDG"/) + ICURR=ICURR+3 + IF (CCLOUD=='ICE4') THEN + YRAD(ICURR)="KDH" + ICURR=ICURR+1 + END IF + YRAD(ICURR:ICURR+4)=(/"HAS","M_R","M_I","M_S","M_G"/) + ICURR=ICURR+5 + IF (CCLOUD=='ICE4') THEN + YRAD(ICURR)="M_H" + ICURR=ICURR+1 + END IF + YRAD(ICURR:ICURR+1)=(/"CIT","TEM"/) + ICURR=ICURR+2 + IF (CCLOUD=='LIMA') THEN + YRAD(ICURR)="CRT" + ICURR=ICURR+1 + ENDIF + IF(LREFR) THEN + YRAD(ICURR)="RFR" + ICURR=ICURR+1 + END IF + IF(LDNDZ) THEN + YRAD(ICURR)="DNZ" + ICURR=ICURR+1 + END IF + IF (LCART_RAD) THEN + DO JI=1,NBRAD + IEL=NBELEV(JI) + ! writing latlon in internal files + ALLOCATE(CLATLON(2*NMAX)) + CLATLON="" + DO JV=2*NMAX,1,-1 + DO JH=1,2*NMAX + WRITE(CBUFFER,'(2(f8.3,1X))') ZWORK43(JI,2*JH-1,JV),ZWORK43(JI,2*JH,JV) + CLATLON(JV)=TRIM(CLATLON(JV)) // " " // TRIM(CBUFFER) + END DO + CLATLON(JV)=TRIM(ADJUSTL(CLATLON(JV))) + END DO + DO JEL=1,IEL + WRITE(YELEV,'(I2.2,A1,I1.1)') FLOOR(XELEV(JI,JEL)),'.',& + INT(ANINT(10.*XELEV(JI,JEL))-10*INT(XELEV(JI,JEL))) + WRITE(YGRID_SIZE,'(I3.3)') 2*NMAX + DO JJ=1,SIZE(ZWORK42(:,:,:,:,:),5) + YRS=YRAD(JJ)//CNAME_RAD(JI)(1:3)//YELEV//YGRID_SIZE//TRIM(TPFILE%CNAME) + CALL IO_File_add2list(TZRSFILE,YRS,'TXT','WRITE',KRECL=8192) + CALL IO_File_open(TZRSFILE,HSTATUS='NEW') + ILURS = TZRSFILE%NLU + WRITE(ILURS,'(A,4F12.6,2I5)') '**domaine LATLON ',ZWORK43(JI,1,1),ZWORK43(JI,4*NMAX-1,2*NMAX), & + ZWORK43(JI,2,1),ZWORK43(JI,4*NMAX,2*NMAX),2*NMAX,2*NMAX !! HEADER + DO JV=2*NMAX,1,-1 + DO JH=1,2*NMAX + WRITE(ILURS,'(E11.5,1X)',ADVANCE='NO') ZWORK42(JI,JEL,JH,JV,JJ) + END DO + WRITE(ILURS,*) '' + END DO + + DO JV=2*NMAX,1,-1 + WRITE(ILURS,*) CLATLON(JV) + END DO + CALL IO_File_close(TZRSFILE) + TZRSFILE => NULL() + END DO + END DO + DEALLOCATE(CLATLON) + END DO + ELSE ! polar output + CALL MPI_ALLREDUCE(ZWORK42, ZWORK42_BIS, SIZE(ZWORK42), MNHREAL_MPI, MPI_MAX, NMNH_COMM_WORLD, IERR) + DO JI=1,NBRAD + IEL=NBELEV(JI) + DO JEL=1,IEL + WRITE(YELEV,'(I2.2,A1,I1.1)') FLOOR(XELEV(JI,JEL)),'.',& + INT(ANINT(10.*XELEV(JI,JEL))-10*INT(XELEV(JI,JEL))) + DO JJ=1,SIZE(ZWORK42(:,:,:,:,:),5) + YRS="P"//YRAD(JJ)//CNAME_RAD(JI)(1:3)//YELEV//TRIM(TPFILE%CNAME) + CALL IO_File_add2list(TZRSFILE,YRS,'TXT','WRITE') + CALL IO_File_open(TZRSFILE) + ILURS = TZRSFILE%NLU + DO JH=1,NBAZIM + DO JV=1,NBSTEPMAX+1 + WRITE(ILURS,"(F15.7)") ZWORK42_BIS(JI,JEL,JH,JV,JJ) + END DO + END DO + CALL IO_File_close(TZRSFILE) + TZRSFILE => NULL() + END DO + END DO + END DO + END IF !polar output + DEALLOCATE(ZWORK42,ZWORK43) + END IF +END IF +! +IF (LLIDAR) THEN + PRINT *,'CALL LIDAR/RADAR with TPFILE%CNAME =',TPFILE%CNAME + YVIEW=' ' + YVIEW=TRIM(CVIEW_LIDAR) + PRINT *,'CVIEW_LIDAR REQUESTED ',YVIEW + IF (YVIEW/='NADIR'.AND.YVIEW/='ZENIT') YVIEW='NADIR' + PRINT *,'CVIEW_LIDAR USED ',YVIEW + PRINT *,'XALT_LIDAR REQUESTED (m) ',XALT_LIDAR + PRINT *,'XWVL_LIDAR REQUESTED (m) ',XWVL_LIDAR + IF (XWVL_LIDAR==XUNDEF) XWVL_LIDAR=0.532E-6 + IF (XWVL_LIDAR<1.E-7.OR.XWVL_LIDAR>2.E-6) THEN + PRINT *,'CAUTION: THE XWVL_LIDAR REQUESTED IS OUTSIDE THE USUAL RANGE' + XWVL_LIDAR=0.532E-6 + ENDIF + PRINT *,'XWVL_LIDAR USED (m) ',XWVL_LIDAR +! + IF (LDUST) THEN + IACCMODE=MIN(2,NMODE_DST) + ALLOCATE(ZTMP1(SIZE(XSVT,1), SIZE(XSVT,2), SIZE(XSVT,3), 1)) + ALLOCATE(ZTMP2(SIZE(XSVT,1), SIZE(XSVT,2), SIZE(XSVT,3), 1)) + ALLOCATE(ZTMP3(SIZE(XSVT,1), SIZE(XSVT,2), SIZE(XSVT,3), 1)) + ZTMP1(:,:,:,1)=ZN0_DST(:,:,:,IACCMODE) + ZTMP2(:,:,:,1)=ZRG_DST(:,:,:,IACCMODE) + ZTMP3(:,:,:,1)=ZSIG_DST(:,:,:,IACCMODE) + SELECT CASE ( CCLOUD ) + CASE('KESS''ICE3','ICE4') + CALL LIDAR(CCLOUD, YVIEW, XALT_LIDAR, XWVL_LIDAR, XZZ, XRHODREF, ZTEMP, XCLDFR, & + XRT, ZWORK31, ZWORK32, & + PDSTC=ZTMP1, & + PDSTD=ZTMP2, & + PDSTS=ZTMP3) + CASE('C2R2') + CALL LIDAR(CCLOUD, YVIEW, XALT_LIDAR, XWVL_LIDAR, XZZ, XRHODREF, ZTEMP, XCLDFR, & + XRT, ZWORK31, ZWORK32, & + PCT=XSVT(:,:,:,NSV_C2R2BEG+1:NSV_C2R2END), & + PDSTC=ZTMP1, & + PDSTD=ZTMP2, & + PDSTS=ZTMP3) + CASE('C3R5') + CALL LIDAR(CCLOUD, YVIEW, XALT_LIDAR, XWVL_LIDAR, XZZ, XRHODREF, ZTEMP, XCLDFR, & + XRT, ZWORK31, ZWORK32, & + PCT=XSVT(:,:,:,NSV_C2R2BEG+1:NSV_C1R3END-1), & + PDSTC=ZTMP1, & + PDSTD=ZTMP2, & + PDSTS=ZTMP3) + CASE('LIMA') +! PCT(2) = droplets (3)=drops (4)=ice crystals + ALLOCATE(ZTMP4(SIZE(XSVT,1), SIZE(XSVT,2), SIZE(XSVT,3), 4)) + ZTMP4(:,:,:,1)=0. + ZTMP4(:,:,:,2)=XSVT(:,:,:,NSV_LIMA_NC) + ZTMP4(:,:,:,3)=XSVT(:,:,:,NSV_LIMA_NR) + ZTMP4(:,:,:,4)=XSVT(:,:,:,NSV_LIMA_NI) +! + CALL LIDAR(CCLOUD, YVIEW, XALT_LIDAR, XWVL_LIDAR, XZZ, XRHODREF, ZTEMP, MAX(XCLDFR,XICEFR),& + XRT, ZWORK31, ZWORK32, & + PCT=ZTMP4, & + PDSTC=ZTMP1, & + PDSTD=ZTMP2, & + PDSTS=ZTMP3) +! + END SELECT + ELSE + SELECT CASE ( CCLOUD ) + CASE('KESS','ICE3','ICE4') + CALL LIDAR(CCLOUD, YVIEW, XALT_LIDAR, XWVL_LIDAR, XZZ, XRHODREF, ZTEMP, XCLDFR, & + XRT, ZWORK31, ZWORK32) + CASE('C2R2') + CALL LIDAR(CCLOUD, YVIEW, XALT_LIDAR, XWVL_LIDAR, XZZ, XRHODREF, ZTEMP, XCLDFR, & + XRT, ZWORK31, ZWORK32, & + PCT=XSVT(:,:,:,NSV_C2R2BEG+1:NSV_C2R2END)) + CASE('C3R5') + CALL LIDAR(CCLOUD, YVIEW, XALT_LIDAR, XWVL_LIDAR, XZZ, XRHODREF, ZTEMP, XCLDFR, & + XRT, ZWORK31, ZWORK32, & + PCT=XSVT(:,:,:,NSV_C2R2BEG+1:NSV_C1R3END-1)) + CASE('LIMA') +! PCT(2) = droplets (3)=drops (4)=ice crystals + ALLOCATE(ZTMP4(SIZE(XSVT,1), SIZE(XSVT,2), SIZE(XSVT,3), 4)) + ZTMP4(:,:,:,1)=0. + ZTMP4(:,:,:,2)=XSVT(:,:,:,NSV_LIMA_NC) + ZTMP4(:,:,:,3)=XSVT(:,:,:,NSV_LIMA_NR) + ZTMP4(:,:,:,4)=XSVT(:,:,:,NSV_LIMA_NI) +! + CALL LIDAR(CCLOUD, YVIEW, XALT_LIDAR, XWVL_LIDAR, XZZ, XRHODREF, ZTEMP, MAX(XCLDFR,XICEFR),& + XRT, ZWORK31, ZWORK32, & + PCT=ZTMP4) + END SELECT + ENDIF +! + IF( ALLOCATED(ZTMP1) ) DEALLOCATE(ZTMP1) + IF( ALLOCATED(ZTMP2) ) DEALLOCATE(ZTMP2) + IF( ALLOCATED(ZTMP3) ) DEALLOCATE(ZTMP3) + IF( ALLOCATED(ZTMP4) ) DEALLOCATE(ZTMP4) +! + TZFIELD%CMNHNAME = 'LIDAR' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'LIDAR' + TZFIELD%CUNITS = 'm-1 sr-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Normalized_Lidar_Profile' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) +! + TZFIELD%CMNHNAME = 'LIPAR' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'LIPAR' + TZFIELD%CUNITS = 'm-1 sr-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Particle_Lidar_Profile' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK32) +! +END IF +! +!------------------------------------------------------------------------------- +! +!* Height of boundary layer +! +IF (CBLTOP == 'THETA') THEN + ! + ! methode de la parcelle + ! + ALLOCATE(ZSHMIX(IIU,IJU)) + + ZWORK31(:,:,1:IKU-1)=0.5*(XZZ(:,:,1:IKU-1)+XZZ(:,:,2:IKU)) + ZWORK31(:,:,IKU)=2.*ZWORK31(:,:,IKU-1)-ZWORK31(:,:,IKU-2) + ZWORK21(:,:) = ZTHETAV(:,:,IKB)+0.5 + ZSHMIX(:,:) = 0.0 + DO JJ=1,IJU + DO JI=1,IIU + DO JK=IKB,IKE + IF ( ZTHETAV(JI,JJ,JK).GT.ZWORK21(JI,JJ) ) THEN + ZSHMIX(JI,JJ) = ZWORK31(JI,JJ,JK-1) & + +( ZWORK31(JI,JJ,JK) - ZWORK31 (JI,JJ,JK-1) ) & + /( ZTHETAV(JI,JJ,JK) - ZTHETAV(JI,JJ,JK-1) ) & + *( ZWORK21(JI,JJ) - ZTHETAV(JI,JJ,JK-1) ) + EXIT + END IF + END DO + END DO + END DO + ZSHMIX(:,:)=ZSHMIX(:,:)-XZS(:,:) + ZSHMIX(:,:)=MAX(ZSHMIX(:,:),50.0) + ! + TZFIELD%CMNHNAME = 'HBLTOP' + TZFIELD%CSTDNAME = 'atmosphere_boundary_layer_thickness' + TZFIELD%CLONGNAME = 'HBLTOP' + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'Height of Boundary Layer TOP' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSHMIX) + ! + DEALLOCATE(ZSHMIX) +ELSEIF (CBLTOP == 'RICHA') THEN + ! + ! methode du "bulk Richardson number" + ! + ALLOCATE(ZRIB(IIU,IJU,IKU)) + ALLOCATE(ZSHMIX(IIU,IJU)) + + ZWORK31(:,:,1:IKU-1)=0.5*(XZZ(:,:,1:IKU-1)+XZZ(:,:,2:IKU)) + ZWORK31(:,:,IKU)=2.*ZWORK31(:,:,IKU-1)-ZWORK31(:,:,IKU-2) + ZWORK32=MXF(XUT) + ZWORK33=MYF(XVT) + ZWORK34=ZWORK32**2+ZWORK33**2 + DO JK=IKB,IKE + ZRIB(:,:,JK)=XG*ZWORK31(:,:,JK)*(ZTHETAV(:,:,JK)-ZTHETAV(:,:,IKB))/(ZTHETAV(:,:,IKB)*ZWORK34(:,:,JK)) + ENDDO + ZSHMIX=0.0 + DO JJ=1,IJU + DO JI=1,IIU + DO JK=IKB,IKE + IF ( ZRIB(JI,JJ,JK).GT.0.25 ) THEN + ZSHMIX(JI,JJ) = ZWORK31(JI,JJ,JK-1) & + +( ZWORK31(JI,JJ,JK) - ZWORK31(JI,JJ,JK-1) ) & + *( 0.25 - ZRIB(JI,JJ,JK-1) ) & + /( ZRIB(JI,JJ,JK) - ZRIB(JI,JJ,JK-1) ) + EXIT + END IF + END DO + END DO + END DO + ZSHMIX(:,:)=ZSHMIX(:,:)-XZS(:,:) + ! + TZFIELD%CMNHNAME = 'HBLTOP' + TZFIELD%CSTDNAME = 'atmosphere_boundary_layer_thickness' + TZFIELD%CLONGNAME = 'HBLTOP' + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'Height of Boundary Layer TOP' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZSHMIX) + ! + DEALLOCATE(ZRIB,ZSHMIX) +ENDIF + ! used before 5-3-1 version + ! + !ZGAMREF=3.5E-3 ! K/m + !ZWORK31(:,:,1:IKU-1)=0.5*(XZZ(:,:,1:IKU-1)+XZZ(:,:,2:IKU)) + !ZWORK31(:,:,IKU)=2.*ZWORK31(:,:,IKU-1)-ZWORK31(:,:,IKU-2) + !CALL FREE_ATM_PROFILE(ZTHETAV,ZWORK31,XZS,XZSMT,ZGAMREF,ZWORK32,ZWORK33) +! +IF (ALLOCATED(ZTHETAV)) DEALLOCATE(ZTHETAV) +! +! +!* Ligthning +! +IF ( LCH_CONV_LINOX ) THEN + CALL IO_Field_write(TPFILE,'IC_RATE', XIC_RATE) + CALL IO_Field_write(TPFILE,'CG_RATE', XCG_RATE) + CALL IO_Field_write(TPFILE,'IC_TOTAL_NB',XIC_TOTAL_NUMBER) + CALL IO_Field_write(TPFILE,'CG_TOTAL_NB',XCG_TOTAL_NUMBER) +END IF +!------------------------------------------------------------------------------- +!------------------------------------------------------------------------------- +! +!* 1.8 My own variables : +! +!------------------------------------------------------------------------------- +!------------------------------------------------------------------------------- +! +!------------------------------------------------------------------------------- +END SUBROUTINE WRITE_LFIFM1_FOR_DIAG diff --git a/src/mesonh/ext/write_lfifm1_for_diag_supp.f90 b/src/mesonh/ext/write_lfifm1_for_diag_supp.f90 new file mode 100644 index 0000000000000000000000000000000000000000..39191ae30c86d5caaad6792b2f89ff21a9ad33a7 --- /dev/null +++ b/src/mesonh/ext/write_lfifm1_for_diag_supp.f90 @@ -0,0 +1,1591 @@ +!MNH_LIC Copyright 2000-2021 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_WRITE_LFIFM1_FOR_DIAG_SUPP +! ###################################### +INTERFACE +! + SUBROUTINE WRITE_LFIFM1_FOR_DIAG_SUPP(TPFILE) +! +USE MODD_IO, ONLY: TFILEDATA +! +!* 0.1 Declarations of arguments +! +TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file +! +END SUBROUTINE WRITE_LFIFM1_FOR_DIAG_SUPP +! +END INTERFACE +! +END MODULE MODI_WRITE_LFIFM1_FOR_DIAG_SUPP +! +! ############################################## + SUBROUTINE WRITE_LFIFM1_FOR_DIAG_SUPP(TPFILE) +! ############################################## +! +!!**** *WRITE_LFIFM1_FOR_DIAG_SUPP* - write records in the diag file +!! +!! PURPOSE +!! ------- +! The purpose of this routine is to write in the file +! of name YFMFILE//'.lfi' with the FM routines. +! +!!** METHOD +!! ------ +!! The data are written in the LFIFM file : +!! - diagnostics from the convection +!! - diagnostics from the radiatif transfer code +!! +!! The localization on the model grid is also indicated : +!! IGRID = 1 for mass grid point +!! IGRID = 2 for U grid point +!! IGRID = 3 for V grid point +!! IGRID = 4 for w grid point +!! IGRID = 0 for meaningless case +!! +!! EXTERNAL +!! -------- +!! FMWRIT : FM-routine to write a record +!! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! J. Stein *Meteo France* +!! +!! MODIFICATIONS +!! ------------- +!! Original 13/09/00 +!! N. Asencio 15/09/00 computation of temperature and height of clouds is moved +!! here and deleted in WRITE_LFIFM1_FOR_DIAG routine +!! I. Mallet 02/11/00 add the call to RADTR_SATEL +!! J.-P. Chaboureau 11/12/03 add call the CALL_RTTOV (table NRTTOVINFO to +!! choose the platform, the satellite, the sensor for all channels +!! (see the table in rttov science and validation report) and the +!! type of calculations in the namelist: 0 = tb, 1 = tb + jacobian, +!! 2 = tb + adjoint, 3 = tb + jacobian + adjoint) +!! V. Masson 01/2004 removes surface (externalization) +!! October 2009 (G. Tanguy) add ILENCH=LEN(YCOMMENT) after +!! change of YCOMMENT +!! October 2011 (C.Lac) FF10MAX : interpolation of 10m wind +!! between 2 Meso-NH levels if 10m is above the first atmospheric level +!! 2015 : D.Ricard add UM10/VM10 for LCARTESIAN=T cases +!! J.Escobar : 15/09/2015 : WENO5 & JPHEXT <> 1 +!! P.Tulet : Diag for salt and orilam +!! J.-P. Chaboureau 07/03/2016 fix the dimensions of local arrays +!! P.Wautelet : 11/07/2016 : removed MNH_NCWRIT define +!! J.-P. Chaboureau 31/10/2016 add the call to RTTOV11 +!! F. Brosse 10/2016 add chemical production destruction terms outputs +!! M.Leriche 01/07/2017 Add DIAG chimical surface fluxes +!! J.-P. Chaboureau 01/2018 add altitude interpolation +!! J.-P. Chaboureau 01/2018 add coarse graining +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +!! J.-P. Chaboureau 07/2018 bug fix on XEMIS when calling CALL_RTTOVxx +!! J.-P. Chaboureau 09/04/2021 add the call to RTTOV13 +!------------------------------------------------------------------------------- +! +!* 0. DECLARATIONS +! ------------ +! +USE MODE_ll +USE MODD_CST +use modd_field, only: tfielddata, tfieldlist, TYPEINT, TYPEREAL +USE MODD_IO, ONLY: TFILEDATA +USE MODD_PARAMETERS +USE MODD_CONF_n +USE MODD_CONF +USE MODD_DEEP_CONVECTION_n +USE MODD_DIM_n +USE MODD_FIELD_n +USE MODD_GRID_n +USE MODD_LUNIT_n +USE MODD_PARAM_n +USE MODD_PARAM_KAFR_n +USE MODD_PARAM_RAD_n +USE MODD_RADIATIONS_n +USE MODD_TIME_n +USE MODD_TURB_n +USE MODD_NEB_n, ONLY: LSIGMAS, LSUBG_COND, VSIGQSAT +USE MODD_REF_n, ONLY: XRHODREF +USE MODD_DIAG_FLAG +USE MODD_NSV, ONLY : NSV,NSV_USER,NSV_C2R2BEG,NSV_C2R2END, & + NSV_C1R3BEG, NSV_C1R3END,NSV_ELECBEG,NSV_ELECEND, & + NSV_CHEMBEG, NSV_CHEMEND,NSV_LGBEG, NSV_LGEND +USE MODD_CH_M9_n, ONLY: CNAMES +USE MODD_RAIN_C2R2_DESCR, ONLY: C2R2NAMES +USE MODD_ICE_C1R3_DESCR, ONLY: C1R3NAMES +USE MODD_ELEC_DESCR, ONLY: CELECNAMES +USE MODD_LG, ONLY: CLGNAMES +USE MODD_DUST, ONLY: LDUST +USE MODD_SALT, ONLY: LSALT +USE MODD_CH_AEROSOL, ONLY: LORILAM +USE MODD_CH_MNHC_n +USE MODD_CH_BUDGET_n +USE MODD_CH_PRODLOSSTOT_n +USE MODD_CH_FLX_n, ONLY: XCHFLX +USE MODD_RAD_TRANSF +USE MODD_DIAG_IN_RUN, ONLY: XCURRENT_ZON10M,XCURRENT_MER10M, & + XCURRENT_SFCO2,XCURRENT_SWD, XCURRENT_LWD, & + XCURRENT_SWU, XCURRENT_LWU +! +USE MODD_DYN_n +USE MODD_CURVCOR_n +USE MODD_METRICS_n +USE MODD_DIAG_BLANK +USE MODI_PINTER +USE MODI_ZINTER +USE MODI_GRADIENT_M +USE MODI_GRADIENT_W +USE MODI_GRADIENT_U +USE MODI_GRADIENT_V +USE MODI_GRADIENT_UV +! +USE MODI_SHUMAN +USE MODE_NEIGHBORAVG +#ifdef MNH_RTTOV_8 +USE MODI_CALL_RTTOV8 +#endif +#ifdef MNH_RTTOV_11 +USE MODI_CALL_RTTOV11 +#endif +#ifdef MNH_RTTOV_13 +USE MODI_CALL_RTTOV13 +#endif +USE MODI_RADTR_SATEL +USE MODI_UV_TO_ZONAL_AND_MERID +! +use mode_field, only: Find_field_id_from_mnhname +USE MODE_IO_FIELD_WRITE, only: IO_Field_write +! +USE MODI_GET_SURF_UNDEF +! +IMPLICIT NONE +! +!* 0.1 Declarations of arguments +! +TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file +! +!* 0.2 Declarations of local variables +! +INTEGER :: IIU,IJU,IKU,IIB,IJB,IKB,IIE,IJE,IKE ! Arrays bounds +INTEGER :: IKRAD +! +INTEGER :: JI,JJ,JK,JSV ! loop index +! +! variables for Diagnostic variables related to deep convection +REAL,DIMENSION(:,:), ALLOCATABLE :: ZWORK21,ZWORK22 +! +! variables for computation of temperature and height of clouds +REAL :: ZCLMR ! value of mixing ratio tendency for detection of cloud top +LOGICAL, DIMENSION(:,:), ALLOCATABLE :: GMASK2 +INTEGER, DIMENSION(:,:), ALLOCATABLE :: IWORK1, IWORK2 +INTEGER, DIMENSION(:,:), ALLOCATABLE :: ICL_HE_ST +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZWORK31,ZTEMP +! +! variables needed for the transfer radiatif diagnostic code +INTEGER :: ITOTGEO +INTEGER, DIMENSION (JPGEOST) :: INDGEO +CHARACTER(LEN=8), DIMENSION (JPGEOST) :: YNAM_SAT +REAL, DIMENSION(:,:), ALLOCATABLE :: ZIRBT, ZWVBT +REAL :: ZUNDEF ! undefined value in SURFEX +! +! variables needed for 10m wind +INTEGER :: ILEVEL +! +INTEGER :: IPRES, ITH +CHARACTER(LEN=4) :: YCAR4 +CHARACTER(LEN=4), DIMENSION(SIZE(XISOPR)) :: YPRES +CHARACTER(LEN=4), DIMENSION(SIZE(XISOTH)) :: YTH +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZWORK32,ZWORK33,ZWORK34,ZWRES,ZPRES,ZWTH +REAL, DIMENSION(:), ALLOCATABLE :: ZTH +REAL,DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZPOVO +REAL,DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZVOX,ZVOY,ZVOZ +REAL,DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZCORIOZ +TYPE(TFIELDDATA) :: TZFIELD +TYPE(TFIELDDATA),DIMENSION(2) :: TZFIELD2 +! +! variables needed for altitude interpolation +INTEGER :: IAL +REAL :: ZFILLVAL +REAL, DIMENSION(:), ALLOCATABLE :: ZAL +REAL, DIMENSION(:,:,:), ALLOCATABLE :: ZWAL +! +! variables needed for coarse graining +REAL,DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZUT_PRM,ZVT_PRM,ZWT_PRM +REAL,DIMENSION(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) :: ZUU_AVG,ZVV_AVG,ZWW_AVG +INTEGER :: IDX, IID, IRESP +CHARACTER(LEN=3) :: YDX +!------------------------------------------------------------------------------- +! +!* 0. ARRAYS BOUNDS INITIALIZATION +! +IIU=SIZE(XTHT,1) +IJU=SIZE(XTHT,2) +IKU=SIZE(XTHT,3) +CALL GET_INDICE_ll (IIB,IJB,IIE,IJE) +IKB=1+JPVEXT +IKE=IKU-JPVEXT +! +ALLOCATE(ZWORK21(IIU,IJU)) +ALLOCATE(ZWORK31(IIU,IJU,IKU)) +ALLOCATE(ZTEMP(IIU,IJU,IKU)) +ZTEMP(:,:,:)=XTHT(:,:,:)*(XPABST(:,:,:)/ XP00) **(XRD/XCPD) +! +!------------------------------------------------------------------------------- +! +!* 1. DIAGNOSTIC RELATED TO CONVECTION +! -------------------------------- +! +!* Diagnostic variables related to deep convection +! +IF (NCONV_KF >= 0) THEN +! + CALL IO_Field_write(TPFILE,'CAPE',XCAPE) +! + ! top height (km) of convective clouds + ZWORK21(:,:)= 0. + DO JJ=IJB,IJE + DO JI=IIB,IIE + IF (NCLTOPCONV(JI,JJ)/=0) ZWORK21(JI,JJ)= XZZ(JI,JJ,NCLTOPCONV(JI,JJ))/1.E3 + END DO + END DO + TZFIELD%CMNHNAME = 'CLTOPCONV' + TZFIELD%CSTDNAME = 'convective_cloud_top_altitude' + TZFIELD%CLONGNAME = 'CLTOPCONV' + TZFIELD%CUNITS = 'km' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Top of Convective Cloud' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) +! + ! base height (km) of convective clouds + ZWORK21(:,:)= 0. + DO JJ=IJB,IJE + DO JI=IIB,IIE + IF (NCLBASCONV(JI,JJ)/=0) ZWORK21(JI,JJ)= XZZ(JI,JJ,NCLBASCONV(JI,JJ))/1.E3 + END DO + END DO + TZFIELD%CMNHNAME = 'CLBASCONV' + TZFIELD%CSTDNAME = 'convective_cloud_base_altitude' + TZFIELD%CLONGNAME = 'CLBASCONV' + TZFIELD%CUNITS = 'km' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Base of Convective Cloud' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) +! +END IF +IF (NCONV_KF >= 1) THEN +! + CALL IO_Field_write(TPFILE,'DTHCONV',XDTHCONV) + CALL IO_Field_write(TPFILE,'DRVCONV',XDRVCONV) + CALL IO_Field_write(TPFILE,'DRCCONV',XDRCCONV) + CALL IO_Field_write(TPFILE,'DRICONV',XDRICONV) +! + IF ( LCHTRANS .AND. NSV > 0 ) THEN + ! User scalar variables + IF (NSV_USER>0) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 's-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = 1, NSV_USER + WRITE(TZFIELD%CMNHNAME,'(A7,I3.3)')'DSVCONV',JSV + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A2,I3.3,A20)')'X_Y_Z_','SV',JSV,' CONVective tendency' + CALL IO_Field_write(TPFILE,TZFIELD,XDSVCONV(:,:,:,JSV)) + END DO + END IF + ! microphysical C2R2 scheme scalar variables + IF (NSV_C2R2END>=NSV_C2R2BEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 's-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_C2R2BEG, NSV_C2R2END + TZFIELD%CMNHNAME = 'DSVCONV_'//TRIM(C2R2NAMES(JSV-NSV_C2R2BEG+1)) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CCOMMENT = 'X_Y_Z_'//TRIM(C2R2NAMES(JSV-NSV_C2R2BEG+1))//' CONVective tendency' + CALL IO_Field_write(TPFILE,TZFIELD,XDSVCONV(:,:,:,JSV)) + END DO + END IF + ! microphysical C3R5 scheme additional scalar variables + IF (NSV_C1R3END>=NSV_C1R3BEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 's-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_C1R3BEG,NSV_C1R3END + TZFIELD%CMNHNAME = 'DSVCONV_'//TRIM(C1R3NAMES(JSV-NSV_C1R3BEG+1)) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CCOMMENT = 'X_Y_Z_'//TRIM(C1R3NAMES(JSV-NSV_C1R3BEG+1))//' CONVective tendency' + CALL IO_Field_write(TPFILE,TZFIELD,XDSVCONV(:,:,:,JSV)) + END DO + END IF + ! electrical scalar variables + IF (NSV_ELECEND>=NSV_ELECBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 's-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_ELECBEG,NSV_ELECEND + TZFIELD%CMNHNAME = 'DSVCONV_'//TRIM(CELECNAMES(JSV-NSV_ELECBEG+1)) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CCOMMENT = 'X_Y_Z_'//TRIM(CELECNAMES(JSV-NSV_ELECBEG+1))//' CONVective tendency' + CALL IO_Field_write(TPFILE,TZFIELD,XDSVCONV(:,:,:,JSV)) + END DO + END IF + ! chemical scalar variables + IF (NSV_CHEMEND>=NSV_CHEMBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 's-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_CHEMBEG, NSV_CHEMEND + TZFIELD%CMNHNAME = 'DSVCONV_'//TRIM(CNAMES(JSV-NSV_CHEMBEG+1)) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CCOMMENT = 'X_Y_Z_'//TRIM(CNAMES(JSV-NSV_CHEMBEG+1))//' CONVective tendency' + CALL IO_Field_write(TPFILE,TZFIELD,XDSVCONV(:,:,:,JSV)) + END DO + END IF + ! lagrangian variables + IF (NSV_LGEND>=NSV_LGBEG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 's-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_LGBEG,NSV_LGEND + TZFIELD%CMNHNAME = 'DSVCONV_'//TRIM(CLGNAMES(JSV-NSV_LGBEG+1)) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CCOMMENT = 'X_Y_Z_'//TRIM(CLGNAMES(JSV-NSV_LGBEG+1))//' CONVective tendency' + CALL IO_Field_write(TPFILE,TZFIELD,XDSVCONV(:,:,:,JSV)) + END DO + END IF + END IF +! +END IF +IF (NCONV_KF >= 2) THEN + CALL IO_Field_write(TPFILE,'PRLFLXCONV',XPRLFLXCONV) + CALL IO_Field_write(TPFILE,'PRSFLXCONV',XPRSFLXCONV) + CALL IO_Field_write(TPFILE,'UMFCONV', XUMFCONV) + CALL IO_Field_write(TPFILE,'DMFCONV', XDMFCONV) +END IF +!------------------------------------------------------------------------------- +! +!* Height and temperature of clouds top +! +IF (LCLD_COV .AND. LUSERC) THEN + ALLOCATE(IWORK1(IIU,IJU),IWORK2(IIU,IJU)) + ALLOCATE(ICL_HE_ST(IIU,IJU)) + ALLOCATE(GMASK2(IIU,IJU)) + ALLOCATE(ZWORK22(IIU,IJU)) +! +! Explicit clouds +! + ICL_HE_ST(:,:)=IKB !initialization + IWORK1(:,:)=IKB ! with the + IWORK2(:,:)=IKB ! ground values + ZCLMR=1.E-4 ! detection of clouds for cloud mixing ratio > .1g/kg +! + GMASK2(:,:)=.TRUE. + ZWORK31(:,:,:)= MZM( XRT(:,:,:,2) ) ! cloud mixing ratio at zz levels + DO JK=IKE,IKB,-1 + WHERE ( (GMASK2(:,:)).AND.(ZWORK31(:,:,JK)>ZCLMR) ) + GMASK2(:,:)=.FALSE. + IWORK1(:,:)=JK + END WHERE + END DO +! + IF (LUSERI) THEN + GMASK2(:,:)=.TRUE. + ZWORK31(:,:,:)= MZM( XRT(:,:,:,4) ) ! cloud mixing ratio at zz levels + DO JK=IKE,IKB,-1 + WHERE ( (GMASK2(:,:)).AND.(ZWORK31(:,:,JK)>ZCLMR) ) + GMASK2(:,:)=.FALSE. + IWORK2(:,:)=JK + END WHERE + END DO + END IF +! + ZWORK21(:,:)=0. + DO JJ=IJB,IJE + DO JI=IIB,IIE + ICL_HE_ST(JI,JJ)=MAX(IWORK1(JI,JJ),IWORK2(JI,JJ) ) + ZWORK21(JI,JJ) =XZZ(JI,JJ,ICL_HE_ST(JI,JJ)) ! height (m) of explicit clouds + END DO + END DO +! + WHERE ( ZWORK21(:,:)==XZZ(:,:,IKB) ) ZWORK21=0. ! set the height to + ! 0 if there is no cloud + ZWORK21(:,:)=ZWORK21(:,:)/1.E3 ! height (km) of explicit clouds +! + TZFIELD%CMNHNAME = 'HECL' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'HECL' + TZFIELD%CUNITS = 'km' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Height of Explicit CLoud top' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) +! +! Higher top of the different species of clouds +! + IWORK1(:,:)=IKB ! initialization with the ground values + ZWORK31(:,:,:)=MZM(ZTEMP(:,:,:)) ! temperature (K) at zz levels + IF(CRAD/='NONE') ZWORK31(:,:,IKB)=XTSRAD(:,:) + ZWORK21(:,:)=0. + ZWORK22(:,:)=0. + DO JJ=IJB,IJE + DO JI=IIB,IIE + IWORK1(JI,JJ)=ICL_HE_ST(JI,JJ) + IF (NCONV_KF >=0) & + IWORK1(JI,JJ)= MAX(ICL_HE_ST(JI,JJ),NCLTOPCONV(JI,JJ)) + ZWORK21(JI,JJ)= XZZ(JI,JJ,IWORK1(JI,JJ)) ! max. cloud height (m) + ZWORK22(JI,JJ)= ZWORK31(JI,JJ,IWORK1(JI,JJ))-XTT ! cloud temperature (C) + END DO + END DO +! + IF (NCONV_KF <0) THEN + PRINT*,'YOU DO NOT ASK FOR CONVECTIVE DIAGNOSTICS (NCONV_KF<0), SO' + PRINT*,' HC not written in FM-file (equal to HEC)' + ELSE + WHERE ( ZWORK21(:,:)==XZZ(:,:,IKB) ) ZWORK21(:,:)=0. ! set the height to + ! 0 if there is no cloud + ZWORK21(:,:)=ZWORK21(:,:)/1.E3 ! max. cloud height (km) +! + TZFIELD%CMNHNAME = 'HCL' + TZFIELD%CSTDNAME = 'cloud_top_altitude' + TZFIELD%CLONGNAME = 'HCL' + TZFIELD%CUNITS = 'km' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Height of CLoud top' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) + ENDIF +! + TZFIELD%CMNHNAME = 'TCL' + TZFIELD%CSTDNAME = 'air_temperature_at_cloud_top' + TZFIELD%CLONGNAME = 'TCL' + TZFIELD%CUNITS = 'celsius' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Height of CLoud top' + TZFIELD%NGRID = 4 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK22) +! + CALL IO_Field_write(TPFILE,'CLDFR',XCLDFR) + CALL IO_Field_write(TPFILE,'ICEFR',XICEFR) +! +! Visibility +! + ZWORK31(:,:,:)= 1.E4 ! 10 km for clear sky + WHERE (XRT(:,:,:,2) > 0.) + ZWORK31(:,:,:)=3.9E3/(144.7*(XRHODREF(:,:,:)*1.E3*XRT(:,:,:,2)/(1.+XRT(:,:,:,2)))**0.88) + END WHERE +! + TZFIELD%CMNHNAME = 'VISI_HOR' + TZFIELD%CSTDNAME = 'visibility_in_air' + TZFIELD%CLONGNAME = 'VISI_HOR' + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_VISI_HOR' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) +! + DEALLOCATE(IWORK1,IWORK2,ICL_HE_ST,GMASK2,ZWORK22) +END IF +! +!------------------------------------------------------------------------------- +! +!* 2. DIAGNOSTIC RELATED TO RADIATIONS +! -------------------------------- +! +IF (NRAD_3D >= 0) THEN + IF (CRAD /= 'NONE') THEN + CALL IO_Field_write(TPFILE,'DTHRAD', XDTHRAD) + CALL IO_Field_write(TPFILE,'FLALWD', XFLALWD) + CALL IO_Field_write(TPFILE,'DIRFLASWD', XDIRFLASWD) + CALL IO_Field_write(TPFILE,'SCAFLASWD', XSCAFLASWD) + CALL IO_Field_write(TPFILE,'DIRSRFSWD', XDIRSRFSWD) + CALL IO_Field_write(TPFILE,'CLEARCOL_TM1',NCLEARCOL_TM1) + CALL IO_Field_write(TPFILE,'ZENITH', XZENITH) + CALL IO_Field_write(TPFILE,'AZIM', XAZIM) + CALL IO_Field_write(TPFILE,'DIR_ALB', XDIR_ALB) + CALL IO_Field_write(TPFILE,'SCA_ALB', XSCA_ALB) + ! + CALL PRINT_MSG(NVERB_INFO,'IO','WRITE_LFIFM1_FOR_DIAG_SUPP','EMIS: writing only first band') + CALL FIND_FIELD_ID_FROM_MNHNAME('EMIS',IID,IRESP) + TZFIELD = TFIELDLIST(IID) + TZFIELD%NDIMS = 2 + CALL IO_Field_write(TPFILE,TZFIELD,XEMIS(:,:,1)) + ! + CALL IO_Field_write(TPFILE,'TSRAD', XTSRAD) + ELSE + PRINT*,'YOU WANT DIAGNOSTICS RELATED TO RADIATION' + PRINT*,' BUT NO RADIATIVE SCHEME WAS ACTIVATED IN THE MODEL' + END IF +END IF +IF (NRAD_3D >= 1) THEN + IF (LDUST) THEN +!Dust optical depth between two vertical levels + ZWORK31(:,:,:)=0. + DO JK=IKB,IKE + IKRAD = JK - JPVEXT + ZWORK31(:,:,JK)= XAER(:,:,IKRAD,3) + END DO + TZFIELD%CMNHNAME = 'DSTAOD3D' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'DSTAOD3D' + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_DuST Aerosol Optical Depth' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) +!Dust optical depth + ZWORK21(:,:)=0.0 + DO JK=IKB,IKE + IKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + ZWORK21(JI,JJ)=ZWORK21(JI,JJ)+XAER(JI,JJ,IKRAD,3) + ENDDO + ENDDO + ENDDO + TZFIELD%CMNHNAME = 'DSTAOD2D' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'DSTAOD2D' + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_DuST Aerosol Optical Depth' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) +!Dust extinction (optical depth per km) + DO JK=IKB,IKE + IKRAD = JK - JPVEXT + ZWORK31(:,:,JK)= XAER(:,:,IKRAD,3)/(XZZ(:,:,JK+1)-XZZ(:,:,JK))*1.D3 + ENDDO + TZFIELD%CMNHNAME = 'DSTEXT' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'DSTEXT' + TZFIELD%CUNITS = 'km-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_DuST EXTinction' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + END IF + IF (LSALT) THEN +!Salt optical depth between two vertical levels + ZWORK31(:,:,:)=0. + DO JK=IKB,IKE + IKRAD = JK - JPVEXT + ZWORK31(:,:,JK)= XAER(:,:,IKRAD,2) + END DO + TZFIELD%CMNHNAME = 'SLTAOD3D' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'SLTAOD3D' + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Salt Aerosol Optical Depth' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) +!Salt optical depth + ZWORK21(:,:)=0.0 + DO JK=IKB,IKE + IKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + ZWORK21(JI,JJ)=ZWORK21(JI,JJ)+XAER(JI,JJ,IKRAD,2) + ENDDO + ENDDO + ENDDO + TZFIELD%CMNHNAME = 'SLTAOD2D' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'SLTAOD2D' + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Salt Aerosol Optical Depth' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) +!Salt extinction (optical depth per km) + DO JK=IKB,IKE + IKRAD = JK - JPVEXT + ZWORK31(:,:,JK)= XAER(:,:,IKRAD,2)/(XZZ(:,:,JK+1)-XZZ(:,:,JK))*1.D3 + ENDDO + TZFIELD%CMNHNAME = 'SLTEXT' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'SLTEXT' + TZFIELD%CUNITS = 'km-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Salt EXTinction' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + END IF + IF (LORILAM) THEN +!Orilam anthropogenic optical depth between two vertical levels + ZWORK31(:,:,:)=0. + DO JK=IKB,IKE + IKRAD = JK - JPVEXT + ZWORK31(:,:,JK)= XAER(:,:,IKRAD,4) + END DO + TZFIELD%CMNHNAME = 'AERAOD3D' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'AERAOD3D' + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Anthropogenic Aerosol Optical Depth' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) +!Orilam anthropogenic optical depth + ZWORK21(:,:)=0.0 + DO JK=IKB,IKE + IKRAD = JK - JPVEXT + DO JJ=IJB,IJE + DO JI=IIB,IIE + ZWORK21(JI,JJ)=ZWORK21(JI,JJ)+XAER(JI,JJ,IKRAD,4) + ENDDO + ENDDO + ENDDO + TZFIELD%CMNHNAME = 'AERAOD2D' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'AERAOD2D' + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Anthropogenic Aerosol Optical Depth' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) +!Orilam anthropogenic extinction (optical depth per km) + DO JK=IKB,IKE + IKRAD = JK - JPVEXT + ZWORK31(:,:,JK)= XAER(:,:,IKRAD,4)/(XZZ(:,:,JK+1)-XZZ(:,:,JK))*1.D3 + ENDDO + TZFIELD%CMNHNAME = 'AEREXT' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'AEREXT' + TZFIELD%CUNITS = 'km-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Z_Anthropogenic EXTinction' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) + END IF +END IF +! +!------------------------------------------------------------------------------- +! Net surface gaseous fluxes +!print*,'LCHEMDIAG, NSV_CHEMBEG, NSV_CHEMEND=',& +!LCHEMDIAG, NSV_CHEMBEG, NSV_CHEMEND + +IF (LCHEMDIAG) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppb m s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = NSV_CHEMBEG, NSV_CHEMEND + TZFIELD%CMNHNAME = 'FLX_'//TRIM(CNAMES(JSV-NSV_CHEMBEG+1)) + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + WRITE(TZFIELD%CCOMMENT,'(A6,A,A)')'X_Y_Z_',TRIM(CNAMES(JSV-NSV_CHEMBEG+1)),' Net chemical flux' + CALL IO_Field_write(TPFILE,TZFIELD,XCHFLX(:,:,JSV-NSV_CHEMBEG+1) * 1E9) + END DO +END IF +!------------------------------------------------------------------------------- +! +!* Brightness temperatures from the radiatif transfer code (Morcrette, 1991) +! +IF (LEN_TRIM(CRAD_SAT) /= 0 .AND. NRR /=0) THEN + ALLOCATE (ZIRBT(IIU,IJU),ZWVBT(IIU,IJU)) + ITOTGEO=0 + IF (INDEX(CRAD_SAT,'GOES-E') /= 0) THEN + ITOTGEO= ITOTGEO+1 + INDGEO(ITOTGEO) = 1 + YNAM_SAT(ITOTGEO) = 'GOES-E' + END IF + IF (INDEX(CRAD_SAT,'GOES-W') /= 0) THEN + ITOTGEO= ITOTGEO+1 + INDGEO(ITOTGEO) = 2 + YNAM_SAT(ITOTGEO) = 'GOES-W' + END IF + IF (INDEX(CRAD_SAT,'GMS') /= 0) THEN + ITOTGEO= ITOTGEO+1 + INDGEO(ITOTGEO) = 3 + YNAM_SAT(ITOTGEO) = 'GMS' + END IF + IF (INDEX(CRAD_SAT,'INDSAT') /= 0) THEN + ITOTGEO= ITOTGEO+1 + INDGEO(ITOTGEO) = 4 + YNAM_SAT(ITOTGEO) = 'INDSAT' + END IF + IF (INDEX(CRAD_SAT,'METEOSAT') /= 0) THEN + ITOTGEO= ITOTGEO+1 + INDGEO(ITOTGEO) = 5 + YNAM_SAT(ITOTGEO) = 'METEOSAT' + END IF + PRINT*,'YOU ASK FOR BRIGHTNESS TEMPERATURES FOR ',ITOTGEO,' SATELLITE(S)' + IF (NRR==1) THEN + PRINT*,' THERE IS ONLY VAPOR WATER IN YOUR ATMOSPHERE' + PRINT*,' IRBT WILL NOT TAKE INTO ACCOUNT CLOUDS.' + END IF + ! + DO JI=1,ITOTGEO + ZIRBT(:,:) = XUNDEF + ZWVBT(:,:) = XUNDEF + CALL RADTR_SATEL( TDTCUR%nyear, TDTCUR%nmonth, TDTCUR%nday, TDTCUR%xtime, & + NDLON, NFLEV, NSTATM, NRAD_COLNBR, XEMIS(:,:,1), & + XCCO2, XTSRAD, XSTATM, XTHT, XRT, XPABST, XZZ, & + XSIGS, XMFCONV, MAX(XCLDFR,XICEFR), LUSERI, LSIGMAS, & + LSUBG_COND, LRAD_SUBG_COND, ZIRBT, ZWVBT, & + INDGEO(JI), VSIGQSAT ) + ! + TZFIELD%CMNHNAME = TRIM(YNAM_SAT(JI))//'_IRBT' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'K' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = TRIM(YNAM_SAT(JI))//' Infra-Red Brightness Temperature' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZIRBT) + ! + TZFIELD%CMNHNAME = TRIM(YNAM_SAT(JI))//'_WVBT' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'K' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = TRIM(YNAM_SAT(JI))//' Water-Vapor Brightness Temperature' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWVBT) + END DO + DEALLOCATE(ZIRBT,ZWVBT) +END IF +! +!------------------------------------------------------------------------------- +! +!* Brightness temperatures from the Radiatif Transfer for Tiros Operational +! Vertical Sounder (RTTOV) code +! +IF (NRTTOVINFO(1,1) /= NUNDEF) THEN +! PRINT*,'YOU ASK FOR BRIGHTNESS TEMPERATURE COMPUTED BY THE RTTOV CODE' +#if defined(MNH_RTTOV_8) + CALL CALL_RTTOV8(NDLON, NFLEV, NSTATM, XEMIS(:,:,1), XTSRAD, XSTATM, XTHT, XRT, & + XPABST, XZZ, XMFCONV, MAX(XCLDFR,XICEFR), XUT(:,:,IKB), XVT(:,:,IKB), & + LUSERI, NRTTOVINFO, TPFILE ) +#elif defined(MNH_RTTOV_11) + CALL CALL_RTTOV11(NDLON, NFLEV, XEMIS(:,:,1), XTSRAD, XTHT, XRT, & + XPABST, XZZ, XMFCONV, MAX(XCLDFR,XICEFR), XUT(:,:,IKB), XVT(:,:,IKB), & + LUSERI, NRTTOVINFO, TPFILE ) +#elif defined(MNH_RTTOV_13) + CALL CALL_RTTOV13(NDLON, NFLEV, XEMIS(:,:,1), XTSRAD, XTHT, XRT, & + XPABST, XZZ, XMFCONV, MAX(XCLDFR,XICEFR), XUT(:,:,IKB), XVT(:,:,IKB), & + LUSERI, NRTTOVINFO, TPFILE ) +#else +PRINT *, "RTTOV LIBRARY NOT AVAILABLE = ###CALL_RTTOV####" +#endif +END IF +! +!------------------------------------------------------------------------------- +! +!* 3. DIAGNOSTIC RELATED TO SURFACE +! ----------------------------- +! +IF (CSURF=='EXTE') THEN +!! Since SURFEX7 (masdev49) XCURRENT_ZON10M and XCURRENT_MER10M +!! are equal to XUNDEF of SURFEX if the first atmospheric level +!! is under 10m + CALL GET_SURF_UNDEF(ZUNDEF) +! + ILEVEL=IKB + !While there are XUNDEF values and we aren't at model's top + DO WHILE(ANY(XCURRENT_ZON10M(IIB:IIE,IJB:IJE)==ZUNDEF) .AND. (ILEVEL/=IKE-1) ) + + !Where interpolation is needed and possible + !(10m is between ILEVEL and ILEVEL+1 or 10m is below the bottom level) + WHERE(XCURRENT_ZON10M(IIB:IIE,IJB:IJE)==ZUNDEF .AND. & + ( XZHAT(ILEVEL+1) + XZHAT(ILEVEL+2)) /2. >10.) + + !Interpolation between ILEVEL and ILEVEL+1 + XCURRENT_ZON10M(IIB:IIE,IJB:IJE)=XUT(IIB:IIE,IJB:IJE,ILEVEL) + & + (XUT(IIB:IIE,IJB:IJE,ILEVEL+1)-XUT(IIB:IIE,IJB:IJE,ILEVEL)) * & + ( 10.- (XZHAT(ILEVEL)+XZHAT(ILEVEL+1))/2. ) / & + ( (XZHAT(ILEVEL+2)-XZHAT(ILEVEL)) /2.) + XCURRENT_MER10M(IIB:IIE,IJB:IJE)=XVT(IIB:IIE,IJB:IJE,ILEVEL) + & + (XVT(IIB:IIE,IJB:IJE,ILEVEL+1)-XVT(IIB:IIE,IJB:IJE,ILEVEL)) * & + (10.- (XZHAT(ILEVEL)+XZHAT(ILEVEL+1))/2. ) / & + ( (XZHAT(ILEVEL+2)-XZHAT(ILEVEL)) /2.) + END WHERE + ILEVEL=ILEVEL+1 !level just higher + END DO + ! + ! in this case (argument KGRID=0), input winds are ZONal and MERidian + ! and, output ones are in MesoNH grid + IF (.NOT. LCARTESIAN) THEN + TZFIELD2(1)%CMNHNAME = 'UM10' + TZFIELD2(1)%CSTDNAME = '' + TZFIELD2(1)%CLONGNAME = 'UM10' + TZFIELD2(1)%CUNITS = 'm s-1' + TZFIELD2(1)%CDIR = 'XY' + TZFIELD2(1)%CCOMMENT = 'Zonal wind at 10m' + TZFIELD2(1)%NGRID = 1 + TZFIELD2(1)%NTYPE = TYPEREAL + TZFIELD2(1)%NDIMS = 2 + TZFIELD2(1)%LTIMEDEP = .TRUE. + ! + TZFIELD2(2)%CMNHNAME = 'VM10' + TZFIELD2(2)%CSTDNAME = '' + TZFIELD2(2)%CLONGNAME = 'VM10' + TZFIELD2(2)%CUNITS = 'm s-1' + TZFIELD2(2)%CDIR = 'XY' + TZFIELD2(2)%CCOMMENT = 'Meridian wind at 10m' + TZFIELD2(2)%NGRID = 1 + TZFIELD2(2)%NTYPE = TYPEREAL + TZFIELD2(2)%NDIMS = 2 + TZFIELD2(2)%LTIMEDEP = .TRUE. + ! + CALL UV_TO_ZONAL_AND_MERID(XCURRENT_ZON10M,XCURRENT_MER10M,KGRID=0,TPFILE=TPFILE,TZFIELDS=TZFIELD2) + ELSE + TZFIELD%CMNHNAME = 'UM10' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'UM10' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'Zonal wind at 10m' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,XCURRENT_ZON10M) + ! + TZFIELD%CMNHNAME = 'VM10' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'VM10' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'Meridian wind at 10m' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,XCURRENT_MER10M) + ENDIF + ! + IF (SIZE(XTKET)>0) THEN + ZWORK21(:,:) = SQRT(XCURRENT_ZON10M(:,:)**2+XCURRENT_MER10M(:,:)**2) + ZWORK21(:,:) = ZWORK21(:,:) + 4. * SQRT(XTKET(:,:,IKB)) + TZFIELD%CMNHNAME = 'FF10MAX' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'FF10MAX' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_FF10MAX' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK21) + END IF + ! + IF(ANY(XCURRENT_SFCO2/=XUNDEF))THEN + TZFIELD%CMNHNAME = 'SFCO2' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'SFCO2' + TZFIELD%CUNITS = 'mg m-2 s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'CO2 Surface flux' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,XCURRENT_SFCO2) + END IF + ! + IF(ANY(XCURRENT_SWD/=XUNDEF))THEN + TZFIELD%CMNHNAME = 'SWD' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'SWD' + TZFIELD%CUNITS = 'W m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'incoming ShortWave at the surface' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,XCURRENT_SWD) + END IF + ! + IF(ANY(XCURRENT_SWU/=XUNDEF))THEN + TZFIELD%CMNHNAME = 'SWU' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'SWU' + TZFIELD%CUNITS = 'W m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'outcoming ShortWave at the surface' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,XCURRENT_SWU) + END IF +! + IF(ANY(XCURRENT_LWD/=XUNDEF))THEN + TZFIELD%CMNHNAME = 'LWD' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'LWD' + TZFIELD%CUNITS = 'W m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'incoming LongWave at the surface' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,XCURRENT_LWD) + END IF +! + IF(ANY(XCURRENT_LWU/=XUNDEF))THEN + TZFIELD%CMNHNAME = 'LWU' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'LWU' + TZFIELD%CUNITS = 'W m-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'outcoming LongWave at the surface' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,XCURRENT_LWU) + END IF +END IF + +! MODIF FP NOV 2012 +!------------------------------------------------------------------------------- +! +!* 4. DIAGNOSTIC ON PRESSURE LEVELS +! ----------------------------- +! +IF (LISOPR .AND. XISOPR(1)/=0.) THEN +! +! +ALLOCATE(ZWORK32(IIU,IJU,IKU)) +ALLOCATE(ZWORK33(IIU,IJU,IKU)) +ALLOCATE(ZWORK34(IIU,IJU,IKU)) +! +! ************************************************* +! Determine the pressure level where to interpolate +! ************************************************* + IPRES=0 + DO JI=1,SIZE(XISOPR) + IF (XISOPR(JI)<=10..OR.XISOPR(JI)>1000.) EXIT + IPRES=IPRES+1 + WRITE(YCAR4,'(I4)') INT(XISOPR(JI)) + YPRES(IPRES)=ADJUSTL(YCAR4) + END DO + + ALLOCATE(ZWRES(IIU,IJU,IPRES)) + ZWRES(:,:,:)=XUNDEF + ALLOCATE(ZPRES(IIU,IJU,IPRES)) + IPRES=0 + DO JI=1,SIZE(XISOPR) + IF (XISOPR(JI)<=10..OR.XISOPR(JI)>1000.) EXIT + IPRES=IPRES+1 + ZPRES(:,:,IPRES)=XISOPR(JI)*100. + END DO + PRINT *,'PRESSURE LEVELS WHERE TO INTERPOLATE=',ZPRES(1,1,:) + ! + TZFIELD%CSTDNAME = '' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + ! +! +!* Standard Variables +! +! ********************* +! Potential Temperature +! ********************* + CALL PINTER(XTHT, XPABST, XZZ, ZTEMP, ZWRES, ZPRES, & + IIU, IJU, IKU, IKB, IPRES, 'LOG', 'RHU.') + DO JK=1,IPRES + TZFIELD%CMNHNAME = 'THT'//TRIM(YPRES(JK))//'HPA' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'K' + TZFIELD%CCOMMENT = 'X_Y_potential temperature '//TRIM(YPRES(JK))//' hPa' + CALL IO_Field_write(TPFILE,TZFIELD,ZWRES(:,:,JK)) + END DO +! ********************* +! Wind +! ********************* + ZWORK31(:,:,:) = MXF(XUT(:,:,:)) + CALL PINTER(ZWORK31, XPABST, XZZ, ZTEMP, ZWRES, ZPRES, & + IIU, IJU, IKU, IKB, IPRES, 'LOG', 'RHU.') + DO JK=1,IPRES + TZFIELD%CMNHNAME = 'UT'//TRIM(YPRES(JK))//'HPA' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CCOMMENT = 'X_Y_U component of wind '//TRIM(YPRES(JK))//' hPa' + CALL IO_Field_write(TPFILE,TZFIELD,ZWRES(:,:,JK)) + END DO + ! + ZWORK31(:,:,:) = MYF(XVT(:,:,:)) + CALL PINTER(ZWORK31, XPABST, XZZ, ZTEMP, ZWRES, ZPRES, & + IIU, IJU, IKU, IKB, IPRES, 'LOG', 'RHU.') + DO JK=1,IPRES + TZFIELD%CMNHNAME = 'VT'//TRIM(YPRES(JK))//'HPA' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CCOMMENT = 'X_Y_V component of wind '//TRIM(YPRES(JK))//' hPa' + CALL IO_Field_write(TPFILE,TZFIELD,ZWRES(:,:,JK)) + END DO +! ********************* +! Water Vapour Mixing Ratio +! ********************* + CALL PINTER(XRT(:,:,:,1), XPABST, XZZ, ZTEMP, ZWRES, ZPRES, & + IIU, IJU, IKU, IKB, IPRES, 'LOG', 'RHU.') + DO JK=1,IPRES + TZFIELD%CMNHNAME = 'MRV'//TRIM(YPRES(JK))//'HPA' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'g kg-1' + TZFIELD%CCOMMENT = 'X_Y_Vapor Mixing Ratio '//TRIM(YPRES(JK))//' hPa' + CALL IO_Field_write(TPFILE,TZFIELD,ZWRES(:,:,JK)*1.E3) + END DO +! ********************* +! Geopotential in meters +! ********************* + ZWORK31(:,:,:) = MZF(XZZ(:,:,:)) + CALL PINTER(ZWORK31, XPABST, XZZ, ZTEMP, ZWRES, ZPRES, & + IIU, IJU, IKU, IKB, IPRES, 'LOG', 'RHU.') + DO JK=1,IPRES + TZFIELD%CMNHNAME = 'ALT'//TRIM(YPRES(JK))//'HPA' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'm' + TZFIELD%CCOMMENT = 'X_Y_ALTitude '//TRIM(YPRES(JK))//' hPa' + CALL IO_Field_write(TPFILE,TZFIELD,ZWRES(:,:,JK)) + END DO +! + DEALLOCATE(ZWRES,ZPRES,ZWORK32,ZWORK33,ZWORK34) +END IF +! +!------------------------------------------------------------------------------- +! +!* 5. DIAGNOSTIC ON POTENTIEL TEMPERATURE LEVELS +! ----------------------------- +! +IF (LISOTH .AND.XISOTH(1)/=0.) THEN +! +! +ALLOCATE(ZWORK32(IIU,IJU,IKU)) +ALLOCATE(ZWORK33(IIU,IJU,IKU)) +ALLOCATE(ZWORK34(IIU,IJU,IKU)) +! +! ************************************************* +! Determine the potentiel temperature level where to interpolate +! ************************************************* + ITH=0 + DO JI=1,SIZE(XISOTH) + IF (XISOTH(JI)<=100..OR.XISOTH(JI)>1000.) EXIT + ITH=ITH+1 + WRITE(YCAR4,'(I4)') INT(XISOTH(JI)) + YTH(ITH)=ADJUSTL(YCAR4) + END DO + + ALLOCATE(ZWTH(IIU,IJU,ITH)) + ZWTH(:,:,:)=XUNDEF + ALLOCATE(ZTH(ITH)) + ZTH(:) = XISOTH(1:ITH) + + PRINT *,'POTENTIAL TEMPERATURE LEVELS WHERE TO INTERPOLATE=',ZTH(:) + ! + TZFIELD%CSTDNAME = '' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 2 + TZFIELD%LTIMEDEP = .TRUE. + ! +! +!* Standard Variables +! +! ********************* +! Pressure +! ********************* + CALL ZINTER(XPABST, XTHT, ZWTH, ZTH, IIU, IJU, IKU, IKB, ITH, XUNDEF) + DO JK=1,ITH + TZFIELD%CMNHNAME = 'PABST'//TRIM(YTH(JK))//'K' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'Pa' + TZFIELD%CCOMMENT = 'X_Y_pressure '//TRIM(YTH(JK))//' K' + CALL IO_Field_write(TPFILE,TZFIELD,ZWTH(:,:,JK)) + END DO +! ********************* +! Potential Vorticity +! ********************* + ZCORIOZ(:,:,:)=SPREAD( XCORIOZ(:,:),DIM=3,NCOPIES=IKU ) + ZVOX(:,:,:)=GY_W_VW(XWT,XDYY,XDZZ,XDZY)-GZ_V_VW(XVT,XDZZ) + ZVOX(:,:,2)=ZVOX(:,:,3) + ZVOY(:,:,:)=GZ_U_UW(XUT,XDZZ)-GX_W_UW(XWT,XDXX,XDZZ,XDZX) + ZVOY(:,:,2)=ZVOY(:,:,3) + ZVOZ(:,:,:)=GX_V_UV(XVT,XDXX,XDZZ,XDZX)-GY_U_UV(XUT,XDYY,XDZZ,XDZY) + ZVOZ(:,:,2)=ZVOZ(:,:,3) + ZVOZ(:,:,1)=ZVOZ(:,:,3) + ZWORK31(:,:,:)=GX_M_M(XTHT,XDXX,XDZZ,XDZX) + ZWORK32(:,:,:)=GY_M_M(XTHT,XDYY,XDZZ,XDZY) + ZWORK33(:,:,:)=GZ_M_M(XTHT,XDZZ) + ZPOVO(:,:,:)= ZWORK31(:,:,:)*MZF(MYF(ZVOX(:,:,:))) & + + ZWORK32(:,:,:)*MZF(MXF(ZVOY(:,:,:))) & + + ZWORK33(:,:,:)*(MYF(MXF(ZVOZ(:,:,:))) + ZCORIOZ(:,:,:)) + ZPOVO(:,:,:)= ZPOVO(:,:,:)*1E6/XRHODREF(:,:,:) + ZPOVO(:,:,1) =-1.E+11 + ZPOVO(:,:,IKU)=-1.E+11 + CALL ZINTER(ZPOVO, XTHT, ZWTH, ZTH, IIU, IJU, IKU, IKB, ITH, XUNDEF) + DO JK=1,ITH + TZFIELD%CMNHNAME = 'POVOT'//TRIM(YTH(JK))//'K' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'PVU' + TZFIELD%CCOMMENT = 'X_Y_POtential VOrticity '//TRIM(YTH(JK))//' K' + CALL IO_Field_write(TPFILE,TZFIELD,ZWTH(:,:,JK)) + END DO +! ********************* +! Wind +! ********************* + ZWORK31(:,:,:) = MXF(XUT(:,:,:)) + CALL ZINTER(ZWORK31, XTHT, ZWTH, ZTH, IIU, IJU, IKU, IKB, ITH, XUNDEF) + DO JK=1,ITH + TZFIELD%CMNHNAME = 'UT'//TRIM(YTH(JK))//'K' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CCOMMENT = 'X_Y_U component of wind '//TRIM(YTH(JK))//' K' + CALL IO_Field_write(TPFILE,TZFIELD,ZWTH(:,:,JK)) + END DO + ! + ZWORK31(:,:,:) = MYF(XVT(:,:,:)) + CALL ZINTER(ZWORK31, XTHT, ZWTH, ZTH, IIU, IJU, IKU, IKB, ITH, XUNDEF) + DO JK=1,ITH + TZFIELD%CMNHNAME = 'VT'//TRIM(YTH(JK))//'K' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CCOMMENT = 'X_Y_V component of wind '//TRIM(YTH(JK))//' K' + CALL IO_Field_write(TPFILE,TZFIELD,ZWTH(:,:,JK)) + END DO +! + DEALLOCATE(ZWTH,ZTH,ZWORK32,ZWORK33,ZWORK34) +END IF +!------------------------------------------------------------------------------- +! +!* 6. DIAGNOSTIC ON ALTITUDE LEVELS +! ----------------------------- +! +IF (LISOAL .AND.XISOAL(1)/=0.) THEN +! +! + ZFILLVAL = -99999. + ALLOCATE(ZWORK32(IIU,IJU,IKU)) + ALLOCATE(ZWORK33(IIU,IJU,IKU)) +! +! ************************************************* +! Determine the altitude level where to interpolate +! ************************************************* + IAL=0 + DO JI=1,SIZE(XISOAL) + IF (XISOAL(JI)<0.) EXIT + IAL=IAL+1 + END DO + ALLOCATE(ZWAL(IIU,IJU,IAL)) + ZWAL(:,:,:)=XUNDEF + ALLOCATE(ZAL(IAL)) + ZAL(:) = XISOAL(1:IAL) + PRINT *,'ALTITUDE LEVELS WHERE TO INTERPOLATE=',ZAL(:) +! ********************* +! Altitude +! ********************* + TZFIELD%CMNHNAME = 'ALT_ALT' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'ALT_ALT' + TZFIELD%CUNITS = 'm' + TZFIELD%CDIR = '--' + TZFIELD%CCOMMENT = 'Z_alt ALT' + TZFIELD%NGRID = 0 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 1 + TZFIELD%LTIMEDEP = .FALSE. + CALL IO_Field_write(TPFILE,TZFIELD,ZAL) +! +!* Standard Variables +! +! ********************* +! Cloud +! ********************* + ZWORK31(:,:,:) = 0. + IF (SIZE(XRT,4) >= 2) ZWORK31(:,:,:) = XRT(:,:,:,2) ! Rc + IF (SIZE(XRT,4) >= 4) ZWORK31(:,:,:) = ZWORK31(:,:,:) + XRT(:,:,:,4) !Ri + ZWORK31(:,:,:) = ZWORK31(:,:,:)*1.E3 + CALL ZINTER(ZWORK31, XZZ, ZWAL, ZAL, IIU, IJU, IKU, IKB, IAL, XUNDEF) + WHERE(ZWAL.EQ.XUNDEF) ZWAL=ZFILLVAL + TZFIELD%CMNHNAME = 'ALT_CLOUD' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'ALT_CLOUD' + TZFIELD%CUNITS = 'g kg-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_cloud ALT' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWAL) +! ********************* +! Precipitation +! ********************* + ZWORK31(:,:,:) = 0. + IF (SIZE(XRT,4) >= 3) ZWORK31(:,:,:) = XRT(:,:,:,3) ! Rr + IF (SIZE(XRT,4) >= 5) ZWORK31(:,:,:) = ZWORK31(:,:,:) + XRT(:,:,:,5) !Rsnow + IF (SIZE(XRT,4) >= 6) ZWORK31(:,:,:) = ZWORK31(:,:,:) + XRT(:,:,:,6) !Rgraupel + IF (SIZE(XRT,4) >= 7) ZWORK31(:,:,:) = ZWORK31(:,:,:) + XRT(:,:,:,7) !Rhail + ZWORK31(:,:,:) = ZWORK31(:,:,:)*1.E3 + CALL ZINTER(ZWORK31, XZZ, ZWAL, ZAL, IIU, IJU, IKU, IKB, IAL, XUNDEF) + WHERE(ZWAL.EQ.XUNDEF) ZWAL=ZFILLVAL + TZFIELD%CMNHNAME = 'ALT_PRECIP' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'ALT_PRECIP' + TZFIELD%CUNITS = 'g kg-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_precipitation ALT' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWAL) +! ********************* +! Potential temperature +! ********************* + CALL ZINTER(XTHT, XZZ, ZWAL, ZAL, IIU, IJU, IKU, IKB, IAL, XUNDEF) + WHERE(ZWAL.EQ.XUNDEF) ZWAL=ZFILLVAL + TZFIELD%CMNHNAME = 'ALT_THETA' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'ALT_THETA' + TZFIELD%CUNITS = 'K' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_potential temperature ALT' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWAL) +! ********************* +! Pressure +! ********************* + CALL ZINTER(XPABST, XZZ, ZWAL, ZAL, IIU, IJU, IKU, IKB, IAL, XUNDEF) + WHERE(ZWAL.EQ.XUNDEF) ZWAL=ZFILLVAL + TZFIELD%CMNHNAME = 'ALT_PRESSURE' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'ALT_PRESSURE' + TZFIELD%CUNITS = 'Pa' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_pressure ALT' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWAL) +! ********************* +! Potential Vorticity +! ********************* + ZCORIOZ(:,:,:)=SPREAD( XCORIOZ(:,:),DIM=3,NCOPIES=IKU ) + ZVOX(:,:,:)=GY_W_VW(XWT,XDYY,XDZZ,XDZY)-GZ_V_VW(XVT,XDZZ) + ZVOX(:,:,2)=ZVOX(:,:,3) + ZVOY(:,:,:)=GZ_U_UW(XUT,XDZZ)-GX_W_UW(XWT,XDXX,XDZZ,XDZX) + ZVOY(:,:,2)=ZVOY(:,:,3) + ZVOZ(:,:,:)=GX_V_UV(XVT,XDXX,XDZZ,XDZX)-GY_U_UV(XUT,XDYY,XDZZ,XDZY) + ZVOZ(:,:,2)=ZVOZ(:,:,3) + ZVOZ(:,:,1)=ZVOZ(:,:,3) + ZWORK31(:,:,:)=GX_M_M(XTHT,XDXX,XDZZ,XDZX) + ZWORK32(:,:,:)=GY_M_M(XTHT,XDYY,XDZZ,XDZY) + ZWORK33(:,:,:)=GZ_M_M(XTHT,XDZZ) + ZPOVO(:,:,:)= ZWORK31(:,:,:)*MZF(MYF(ZVOX(:,:,:))) & + + ZWORK32(:,:,:)*MZF(MXF(ZVOY(:,:,:))) & + + ZWORK33(:,:,:)*(MYF(MXF(ZVOZ(:,:,:))) + ZCORIOZ(:,:,:)) + ZPOVO(:,:,:)= ZPOVO(:,:,:)*1E6/XRHODREF(:,:,:) + ZPOVO(:,:,1) =-1.E+11 + ZPOVO(:,:,IKU)=-1.E+11 + CALL ZINTER(ZPOVO, XZZ, ZWAL, ZAL, IIU, IJU, IKU, IKB, IAL, XUNDEF) + WHERE(ZWAL.EQ.XUNDEF) ZWAL=ZFILLVAL + TZFIELD%CMNHNAME = 'ALT_PV' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'ALT_PV' + TZFIELD%CUNITS = 'PVU' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_Potential Vorticity ALT' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWAL) +! ********************* +! Wind +! ********************* + ZWORK31(:,:,:) = MXF(XUT(:,:,:)) + CALL ZINTER(ZWORK31, XZZ, ZWAL, ZAL, IIU, IJU, IKU, IKB, IAL, XUNDEF) + WHERE(ZWAL.EQ.XUNDEF) ZWAL=ZFILLVAL + TZFIELD%CMNHNAME = 'ALT_U' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'ALT_U' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_U component of wind ALT' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWAL) + ! + ZWORK31(:,:,:) = MYF(XVT(:,:,:)) + CALL ZINTER(ZWORK31, XZZ, ZWAL, ZAL, IIU, IJU, IKU, IKB, IAL, XUNDEF) + WHERE(ZWAL.EQ.XUNDEF) ZWAL=ZFILLVAL + TZFIELD%CMNHNAME = 'ALT_V' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'ALT_V' + TZFIELD%CUNITS = 'm s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_V component of wind ALT' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWAL) +! ********************* +! Dust extinction (optical depth per km) +! ********************* + IF (NRAD_3D >= 1.AND.LDUST) THEN + DO JK=IKB,IKE + IKRAD = JK - JPVEXT + ZWORK31(:,:,JK)= XAER(:,:,IKRAD,3)/(XZZ(:,:,JK+1)-XZZ(:,:,JK))*1.D3 + ENDDO + CALL ZINTER(ZWORK31, XZZ, ZWAL, ZAL, IIU, IJU, IKU, IKB, IAL, XUNDEF) + WHERE(ZWAL.EQ.XUNDEF) ZWAL=ZFILLVAL + TZFIELD%CMNHNAME = 'ALT_DSTEXT' + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'ALT_DSTEXT' + TZFIELD%CUNITS = 'km-1' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'X_Y_DuST EXTinction ALT' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWAL) + END IF +! +! ********************* + DEALLOCATE(ZWAL,ZAL,ZWORK32,ZWORK33) +END IF +! +!------------------------------------------------------------------------------- +! +!* 7. COARSE GRAINING DIAGNOSTIC +! -------------------------- +! +IF (LCOARSE) THEN + IDX = NDXCOARSE +!------------------------------- +! AVERAGE OF TKE BY BLOCK OF IDX POINTS + CALL BLOCKAVG(XUT,IDX,IDX,ZWORK31) + ZUT_PRM=XUT-ZWORK31 + CALL BLOCKAVG(XVT,IDX,IDX,ZWORK31) + ZVT_PRM=XVT-ZWORK31 + CALL BLOCKAVG(XWT,IDX,IDX,ZWORK31) + ZWT_PRM=XWT-ZWORK31 +! + ZWORK31=MXF(ZUT_PRM*ZUT_PRM) + CALL BLOCKAVG(ZWORK31,IDX,IDX,ZUU_AVG) + ZWORK31=MYF(ZVT_PRM*ZVT_PRM) + CALL BLOCKAVG(ZWORK31,IDX,IDX,ZVV_AVG) + ZWORK31=MZF(ZWT_PRM*ZWT_PRM) + CALL BLOCKAVG(ZWORK31,IDX,IDX,ZWW_AVG) + CALL BLOCKAVG(XTKET,IDX,IDX,ZWORK31) + ZWORK31=0.5*( ZUU_AVG+ZVV_AVG+ZWW_AVG ) + ZWORK31 + WRITE (YDX,FMT='(I3.3)') IDX + TZFIELD%CMNHNAME = 'TKEBAVG'//YDX + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'TKEBAVG'//YDX + TZFIELD%CUNITS = 'm2 s-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'TKE_BLOCKAVG'//YDX + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) +!--------------------------------- +! MOVING AVERAGE OF TKE OVER IDX+1 POINTS + IDX = IDX/2 + CALL MOVINGAVG(XUT,IDX,IDX,ZWORK31) + ZUT_PRM=XUT-ZWORK31 + CALL MOVINGAVG(XVT,IDX,IDX,ZWORK31) + ZVT_PRM=XVT-ZWORK31 + CALL MOVINGAVG(XWT,IDX,IDX,ZWORK31) + ZWT_PRM=XWT-ZWORK31 +! + ZWORK31=MXF(ZUT_PRM*ZUT_PRM) + CALL MOVINGAVG(ZWORK31,IDX,IDX,ZUU_AVG) + ZWORK31=MYF(ZVT_PRM*ZVT_PRM) + CALL MOVINGAVG(ZWORK31,IDX,IDX,ZVV_AVG) + ZWORK31=MZF(ZWT_PRM*ZWT_PRM) + CALL MOVINGAVG(ZWORK31,IDX,IDX,ZWW_AVG) + CALL MOVINGAVG(XTKET,IDX,IDX,ZWORK31) + ZWORK31=0.5*( ZUU_AVG+ZVV_AVG+ZWW_AVG ) + ZWORK31 + WRITE (YDX,FMT='(I3.3)') 2*IDX+1 + TZFIELD%CMNHNAME = 'TKEMAVG'//YDX + TZFIELD%CSTDNAME = '' + TZFIELD%CLONGNAME = 'TKEMAVG'//YDX + TZFIELD%CUNITS = 'm2 s-2' + TZFIELD%CDIR = 'XY' + TZFIELD%CCOMMENT = 'TKE_MOVINGAVG'//YDX + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + CALL IO_Field_write(TPFILE,TZFIELD,ZWORK31) +END IF +! +!------------------------------------------------------------------------------- +! +!* 8. DIAGNOSTIC RELATED TO CHEMISTRY +! ------------------------------- +! +IF (NEQ_BUDGET>0) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + ! + TZFIELD%CUNITS = 'ppp s-1' + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 4 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = 1, NEQ_BUDGET + TZFIELD%CMNHNAME = TRIM(CNAMES_BUDGET(JSV))//'_BUDGET' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CCOMMENT = 'X_Y_Z_'//TRIM(CNAMES_BUDGET(JSV))//'_BUDGET' + CALL IO_Field_write(TPFILE,TZFIELD,XTCHEM(JSV)%XB_REAC(:,:,:,:)) + END DO + ! + TZFIELD%CUNITS = '' + TZFIELD%NTYPE = TYPEINT + TZFIELD%NDIMS = 1 + ! + DO JSV=1, NEQ_BUDGET + TZFIELD%CMNHNAME = TRIM(CNAMES_BUDGET(JSV))//'_CHREACLIST' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CCOMMENT = TRIM(CNAMES_BUDGET(JSV))//'_REACTION_LIST' + CALL IO_Field_write(TPFILE,TZFIELD,XTCHEM(JSV)%NB_REAC(:)) + END DO +END IF +! +! +! chemical prod/loss terms +IF (NEQ_PLT>0) THEN + TZFIELD%CSTDNAME = '' + TZFIELD%CUNITS = 'ppp s-1' + TZFIELD%CDIR = 'XY' + TZFIELD%NGRID = 1 + TZFIELD%NTYPE = TYPEREAL + TZFIELD%NDIMS = 3 + TZFIELD%LTIMEDEP = .TRUE. + ! + DO JSV = 1, NEQ_PLT + TZFIELD%CMNHNAME = TRIM(CNAMES_PRODLOSST(JSV))//'_PROD' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CCOMMENT = 'X_Y_Z_'//TRIM(CNAMES_PRODLOSST(JSV))//'_PROD' + CALL IO_Field_write(TPFILE,TZFIELD,XPROD(:,:,:,JSV)) + ! + TZFIELD%CMNHNAME = TRIM(CNAMES_PRODLOSST(JSV))//'_LOSS' + TZFIELD%CLONGNAME = TRIM(TZFIELD%CMNHNAME) + TZFIELD%CCOMMENT = 'X_Y_Z_'//TRIM(CNAMES_PRODLOSST(JSV))//'_LOSS' + CALL IO_Field_write(TPFILE,TZFIELD,XLOSS(:,:,:,JSV)) + END DO +END IF +! +! +DEALLOCATE(ZWORK21,ZWORK31,ZTEMP) +! +END SUBROUTINE WRITE_LFIFM1_FOR_DIAG_SUPP diff --git a/src/mesonh/ext/xy_to_latlon.f90 b/src/mesonh/ext/xy_to_latlon.f90 new file mode 100644 index 0000000000000000000000000000000000000000..71c8fc6274c4850c494dab82a3254b7ffa7bb90f --- /dev/null +++ b/src/mesonh/ext/xy_to_latlon.f90 @@ -0,0 +1,203 @@ +!MNH_LIC Copyright 1996-2020 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. +!----------------------------------------------------------------- +! #################### + PROGRAM XY_TO_LATLON +! #################### +! +!!**** *XY_TO_LATLON* program to compute latitude and longiude from x and y +!! for a MESONH file +!! +!! PURPOSE +!! ------- +!! +!! METHOD +!! ------ +!! +!! EXTERNAL +!! -------- +!! +!! module MODE_GRIDPROJ : contains projection routines +!! SM_LATLON and SM_XYHAT +!! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! module MODD_GRID : variables for projection: +!! XLAT0,XLON0,XRPK,XBETA +!! +!! module MODD_PGDDIM : specify the dimentions of the data arrays: +!! NPGDIMAX and NPGDJMAX +!! +!! module MODD_PGDGRID : grid variables: +!! XPGDLONOR,XPGDLATOR: longitude and latitude of the +!! origine point for the conformal projection. +!! XPGDXHAT,XPGDYHAT: position x,y in the conformal plane +!! +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! +!! V. Masson Meteo-France +!! +!! MODIFICATION +!! ------------ +!! +!! Original 26/01/96 +!! +!! no transfer of the file when closing Dec. 09, 1996 (V.Masson) +!! + changes call to READ_HGRID +! P. Wautelet 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 07/02/2019: force TYPE to a known value for IO_File_add2list +! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function +! P. Wautelet 14/04/2020: add missing initializations (XY_TO_LATLON was not working) +!---------------------------------------------------------------------------- +! +!* 0. DECLARATION +! ----------- +! +use MODD_CONF, only: CPROGRAM +USE MODD_DIM_n +USE MODD_GRID +USE MODD_IO, ONLY: TFILEDATA +USE MODD_PGDDIM +USE MODD_PGDGRID +USE MODD_PARAMETERS +USE MODD_LUNIT +! +USE MODE_FIELD, ONLY: INI_FIELD_LIST +USE MODE_GRIDPROJ +USE MODE_IO, only: IO_Config_set, IO_Init +use MODE_IO_FIELD_READ, only: IO_Field_read +USE MODE_IO_FILE, only: IO_File_close, IO_File_open +USE MODE_IO_MANAGE_STRUCT, only: IO_File_add2list +USE MODE_MODELN_HANDLER, ONLY: GOTO_MODEL +use MODE_SPLITTINGZ_ll +! +USE MODE_INI_CST, ONLY: INI_CST +USE MODI_READ_HGRID +! +USE MODN_CONFIO, ONLY: NAM_CONFIO +! +IMPLICIT NONE +! +!* 0.2 Declaration of variables +! ------------------------ +! +CHARACTER(LEN=28) :: YINIFILE ! name of input FM file +CHARACTER(LEN=28) :: YNAME ! true name of input FM file +CHARACTER(LEN=28) :: YDAD ! name of dad of input FM file +CHARACTER(LEN=2) :: YSTORAGE_TYPE +INTEGER :: INAM ! Logical unit for namelist file +INTEGER :: ILUOUT0 ! Logical unit for output file. +INTEGER :: IRESP ! Return-code if problem eraised. +REAL :: ZI,ZJ ! input positions of the point +INTEGER :: II,IJ ! integer positions of the point +REAL :: ZXHAT ! output conformal coodinate x +REAL :: ZYHAT ! output conformal coodinate y +REAL :: ZLAT ! output latitude +REAL :: ZLON ! output longitude +TYPE(TFILEDATA),POINTER :: TZINIFILE => NULL() +TYPE(TFILEDATA),POINTER :: TZNMLFILE => NULL() +! +!* 0.3 Declaration of namelists +! ------------------------ +! +NAMELIST/NAM_INIFILE/ YINIFILE +!---------------------------------------------------------------------------- +! + WRITE(*,*) '+---------------------------------+' + WRITE(*,*) '| program xy_to_latlon |' + WRITE(*,*) '+---------------------------------+' + WRITE(*,*) '' + WRITE(*,*) 'Warning: I and J are integer for flux points' +! +!* 1. Initializations +! --------------- +! +CALL GOTO_MODEL(1) +! +CALL VERSION() +! +CPROGRAM='LAT2XY' +! +CALL IO_Init() +! +CALL INI_CST() +! +CALL INI_FIELD_LIST(1) +! +!* 2. Reading of namelist file +! ------------------------ +! +CALL IO_File_add2list(TZNMLFILE,'XY2LATLON1.nam','NML','READ') +CALL IO_File_open(TZNMLFILE) +INAM=TZNMLFILE%NLU +READ(INAM,NAM_INIFILE) +! +READ(INAM,NAM_CONFIO) +CALL IO_Config_set() +CALL IO_File_close(TZNMLFILE) +! +!* 1. Opening of MESONH file +! ---------------------- +! +CALL IO_File_add2list(TZINIFILE,TRIM(YINIFILE),'MNH','READ',KLFITYPE=2,KLFIVERB=2) +CALL IO_File_open(TZINIFILE) +! +CALL IO_Field_read(TZINIFILE,'IMAX', NIMAX) +CALL IO_Field_read(TZINIFILE,'JMAX', NJMAX) +NKMAX = 1 +CALL IO_Field_read(TZINIFILE,'JPHEXT',JPHEXT) +! +CALL SET_JP_ll(1,JPHEXT,JPVEXT,JPHEXT) +CALL SET_DIM_ll(NIMAX, NJMAX, NKMAX) +CALL INI_PARAZ_ll(IRESP) +! +!* 2. Reading of MESONH file +! ---------------------- +! +CALL READ_HGRID(0,TZINIFILE,YNAME,YDAD,YSTORAGE_TYPE) +! +!* 3. Closing of MESONH file +! ---------------------- +! +CALL IO_File_close(TZINIFILE) +! +!------------------------------------------------------------------------------- +! +!* 4. Reading of I and J +! ------------------ +! +DO + WRITE(*,*) '-------------------------------------------------------------------' + WRITE(*,*) 'please enter index I (real, quit or q to stop):' + READ(*,*,ERR=1) ZI + WRITE(*,*) 'please enter index J (real, quit or q to stop):' + READ(*,*,ERR=1) ZJ +! + II=MAX(MIN(INT(ZI),NPGDIMAX+2*JPHEXT-1),1) + IJ=MAX(MIN(INT(ZJ),NPGDJMAX+2*JPHEXT-1),1) + ZXHAT=XPGDXHAT(II) + (ZI-REAL(II)) * ( XPGDXHAT(II+1) - XPGDXHAT(II) ) + ZYHAT=XPGDYHAT(IJ) + (ZJ-REAL(IJ)) * ( XPGDYHAT(IJ+1) - XPGDYHAT(IJ) ) +! + WRITE(*,*) 'x=', ZXHAT + WRITE(*,*) 'y=', ZYHAT +! + CALL SM_LATLON(XPGDLATOR,XPGDLONOR, & + ZXHAT,ZYHAT,ZLAT,ZLON) +! + WRITE(*,*) 'lat=', ZLAT + WRITE(*,*) 'lon=', ZLON +END DO +1 WRITE(*,*) 'good bye' +! +!------------------------------------------------------------------------------- +! +END PROGRAM XY_TO_LATLON diff --git a/src/mesonh/ext/zoom_pgd.f90 b/src/mesonh/ext/zoom_pgd.f90 new file mode 100644 index 0000000000000000000000000000000000000000..8caa8ccb640fc9c5bfff4ff7353b87586c9586e8 --- /dev/null +++ b/src/mesonh/ext/zoom_pgd.f90 @@ -0,0 +1,272 @@ +!MNH_LIC Copyright 2005-2021 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. +!----------------------------------------------------------------- +! ################ + PROGRAM ZOOM_PGD +! ################ +!! +!! PURPOSE +!! ------- +!! This program zooms the physiographic data fields. +!! +!! METHOD +!! ------ +!! +!! +!! EXTERNAL +!! -------- +!! +!! +!! IMPLICIT ARGUMENTS +!! ------------------ +!! +!! +!! REFERENCE +!! --------- +!! +!! AUTHOR +!! ------ +!! +!! V. Masson Meteo-France +!! +!! MODIFICATION +!! ------------ +!! +!! Original march 2005 +!! 10/10/2011 J.Escobar call INI_PARAZ_ll +!! 30/03/2012 S.Bielli Add NAM_NCOUT +!! 06/2016 (G.Delautier) phasage surfex 8 +!! 08/07/2016 P.Wautelet Removed MNH_NCWRIT define +!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 07/02/2019: force TYPE to a known value for IO_File_add2list +! P. Wautelet 14/02/2019: remove CLUOUT/CLUOUT0 and associated variables +! P. Wautelet 06/07/2021: use FINALIZE_MNH +!---------------------------------------------------------------------------- +! +!* 0. DECLARATION +! ----------- +! +USE MODD_CONF, ONLY : CPROGRAM, L1D, L2D, LPACK +USE MODD_IO, only: TFILE_OUTPUTLISTING, TFILEDATA +USE MODD_LUNIT, ONLY : TLUOUT0, TOUTDATAFILE +USE MODD_PARAMETERS, ONLY : XUNDEF, NUNDEF, JPVEXT, JPHEXT, JPMODELMAX +USE MODD_PARAM_n, ONLY : CSURF +USE MODD_DIM_n, ONLY : NIMAX, NJMAX +USE MODD_CONF_n, ONLY : CSTORAGE_TYPE +use modd_precision, only: LFIINT +! +USE MODE_FINALIZE_MNH, only: FINALIZE_MNH +USE MODE_POS +USE MODE_IO, only: IO_Config_set, IO_Init +USE MODE_IO_FIELD_READ, only: IO_Field_read +USE MODE_IO_FIELD_WRITE, only: IO_Field_write, IO_Header_write +USE MODE_IO_FILE, only: IO_File_close, IO_File_open +USE MODE_IO_MANAGE_STRUCT, only: IO_File_add2list +USE MODE_ll +USE MODE_MSG +USE MODE_MODELN_HANDLER +! +USE MODI_READ_HGRID +USE MODI_WRITE_HGRID +USE MODI_SET_SUBDOMAIN +!JUANZ +USE MODE_SPLITTINGZ_ll +!JUANZ +! +USE MODI_VERSION +USE MODI_READ_ALL_NAMELISTS +USE MODI_ZOOM_PGD_SURF_ATM +USE MODI_WRITE_PGD_SURF_ATM_N +USE MODD_MNH_SURFEX_n +! +USE MODN_CONFIO, ONLY : NAM_CONFIO +USE MODE_INI_CST, ONLY: INI_CST +! +IMPLICIT NONE +! +! +!* 0.2 Declaration of local variables +! ------------------------------ +! +INTEGER :: IRESP ! return code for I/O +INTEGER :: ILUOUT0 +INTEGER :: ILUNAM +INTEGER :: IINFO_ll +CHARACTER(LEN=28) :: CPGDFILE ! name of the PGD file +CHARACTER(LEN=28) :: YZOOMFILE ! name of the output file +CHARACTER(LEN=2) :: YZOOMNBR +CHARACTER(LEN=28) :: YMY_NAME,YDAD_NAME +CHARACTER(LEN=28) :: YPGDFILE +CHARACTER(LEN=2) :: YSTORAGE_TYPE +LOGICAL :: GFOUND +INTEGER :: IXOR_DAD,IYOR_DAD ! compared to Dad file, if any +INTEGER :: IXOR,IYOR ! given or computed +INTEGER :: IDXRATIO,IDYRATIO +TYPE(TFILEDATA),POINTER :: TZNMLFILE => NULL() +TYPE(TFILEDATA),POINTER :: TZPGDFILE => NULL() +TYPE(TFILEDATA),POINTER :: TZZOOMFILE => NULL() +! +REAL, DIMENSION(:,:), ALLOCATABLE :: ZZS1,ZZSMT1,ZZS2,ZZSMT2 +! +NAMELIST/NAM_PGDFILE/CPGDFILE,YZOOMFILE,YZOOMNBR +!------------------------------------------------------------------------------ +! +CALL GOTO_MODEL(1) +CALL VERSION +CPROGRAM='ZOOMPG' +CSTORAGE_TYPE = 'PG' +! +CALL INI_CST +! +! +!* 1. Set default names and parallelized I/O +! -------------------------------------- +! +CALL IO_Init() +! +CALL IO_File_add2list(TLUOUT0,'OUTPUT_LISTING0','OUTPUTLISTING','WRITE') +CALL IO_File_open(TLUOUT0) +TFILE_OUTPUTLISTING => TLUOUT0 +ILUOUT0=TLUOUT0%NLU +! +CALL IO_File_add2list(TZNMLFILE,'PRE_ZOOM1.nam','NML','READ') +CALL IO_File_open(TZNMLFILE) +ILUNAM = TZNMLFILE%NLU +! +CPGDFILE = 'PGDFILE' ! name of the input file +YZOOMFILE = '' +YZOOMNBR = '00' +CALL POSNAM(ILUNAM,'NAM_PGDFILE',GFOUND,ILUOUT0) +IF (GFOUND) READ(UNIT=ILUNAM,NML=NAM_PGDFILE) +CALL POSNAM(ILUNAM,'NAM_CONFIO',GFOUND,ILUOUT0) +IF (GFOUND) READ(UNIT=ILUNAM,NML=NAM_CONFIO) +CALL IO_Config_set() +! +!------------------------------------------------------------------------------ +! +!* 2. ZOOM OF PGD DOMAIN +! ------------------ +! +!* 2.1 Open PGD file +! ------------- +! +CALL IO_File_add2list(TZPGDFILE,TRIM(CPGDFILE),'PGD','READ',KLFINPRAR=INT(1,KIND=LFIINT),KLFITYPE=2,KLFIVERB=5) +CALL IO_File_open(TZPGDFILE) +! +!* 2.2 Reading of initial grid +! ----------------------- +! +CALL READ_HGRID(1,TZPGDFILE,YMY_NAME,YDAD_NAME,YSTORAGE_TYPE) +! +! NIMAX, NJMAX: size of input domain +ALLOCATE(ZZS1 (NIMAX+2*JPHEXT,NJMAX+2*JPHEXT)) +ALLOCATE(ZZSMT1(NIMAX+2*JPHEXT,NJMAX+2*JPHEXT)) +CALL IO_Field_read(TZPGDFILE,'ZS',ZZS1) +CALL IO_Field_read(TZPGDFILE,'ZSMT',ZZSMT1) +! +!* 2.3 Define subdomain +! ---------------- +! +CALL SET_SUBDOMAIN(TZNMLFILE,TZPGDFILE,IXOR_DAD,IYOR_DAD,IXOR,IYOR,IDXRATIO,IDYRATIO) +! +CALL IO_File_close(TZNMLFILE) +! +! NIMAX, NJMAX: size of output domain +! +CALL SET_JP_ll(JPMODELMAX,JPHEXT,JPVEXT,JPHEXT) +CALL SET_DAD0_ll() +CALL SET_DIM_ll(NIMAX, NJMAX, 1) +CALL SET_LBX_ll('OPEN',1) +CALL SET_LBY_ll('OPEN', 1) +CALL SET_XRATIO_ll(1, 1) +CALL SET_YRATIO_ll(1, 1) +CALL SET_XOR_ll(1, 1) +CALL SET_XEND_ll(NIMAX+2*JPHEXT, 1) +CALL SET_YOR_ll(1, 1) +CALL SET_YEND_ll(NJMAX+2*JPHEXT, 1) +CALL SET_DAD_ll(0, 1) +!JUANZ CALL INI_PARA_ll(IINFO_ll) +CALL INI_PARAZ_ll(IINFO_ll) +! +! +!* 2.4 Writing of final grid +! --------------------- +! +IF ( (LEN_TRIM(YZOOMFILE) == 0) .OR. (ADJUSTL(YZOOMFILE) == ADJUSTL(CPGDFILE)) ) THEN + YZOOMFILE=ADJUSTL(ADJUSTR(CPGDFILE)//'.z'//ADJUSTL(YZOOMNBR)) +END IF +! +CALL IO_File_add2list(TZZOOMFILE,TRIM(YZOOMFILE),'PGD','WRITE',KLFINPRAR=INT(1,KIND=LFIINT),KLFITYPE=1,KLFIVERB=5) +!PW: TODO: points to dad file (if existing) ! TZZOOMFILE%TDADFILE => +! +CALL IO_File_open(TZZOOMFILE) +CALL WRITE_HGRID(1,TZZOOMFILE) +! +!* 2.5 Preparation of surface physiographic fields +! ------------------------------------------- +! +CALL IO_Field_read(TZPGDFILE,'SURF',CSURF) +! +! +IF (CSURF=='EXTE') THEN + CALL SURFEX_ALLOC_LIST(1) + YSURF_CUR => YSURF_LIST(1) + CALL READ_ALL_NAMELISTS(YSURF_CUR,'MESONH','PRE',.FALSE.) + YPGDFILE = CPGDFILE + CPGDFILE = YZOOMFILE + TOUTDATAFILE => TZZOOMFILE + CALL GOTO_SURFEX(1) + CALL ZOOM_PGD_SURF_ATM(YSURF_CUR,'MESONH',YPGDFILE,'MESONH',YZOOMFILE,'MESONH') +! +!* 2.6 Writes the physiographic fields +! ------------------------------- +! + CALL WRITE_PGD_SURF_ATM_n(YSURF_CUR,'MESONH') +ELSE + ALLOCATE(ZZS2(NIMAX+2*JPHEXT,NJMAX+2*JPHEXT)) + ZZS2(:,:)=ZZS1(IXOR:IXOR+NIMAX+2*JPHEXT-1,IYOR:IYOR+NJMAX+2*JPHEXT-1) + CALL IO_Field_write(TZZOOMFILE,'ZS',ZZS2) +END IF +! +ALLOCATE(ZZSMT2(NIMAX+2*JPHEXT,NJMAX+2*JPHEXT)) +ZZSMT2(:,:)=ZZSMT1(IXOR:IXOR+NIMAX+2*JPHEXT-1,IYOR:IYOR+NJMAX+2*JPHEXT-1) +CALL IO_Field_write(TZZOOMFILE,'ZSMT',ZZSMT2) +! +!* 2.7 Write configuration variables in the output file +! ------------------------------------------------ +! +CALL IO_Header_write(TZZOOMFILE) +CALL IO_Field_write(TZZOOMFILE,'DXRATIO',IDXRATIO) +CALL IO_Field_write(TZZOOMFILE,'DYRATIO',IDYRATIO) +CALL IO_Field_write(TZZOOMFILE,'XOR', IXOR_DAD) +CALL IO_Field_write(TZZOOMFILE,'YOR', IYOR_DAD) +CALL IO_Field_write(TZZOOMFILE,'L1D', L1D) +CALL IO_Field_write(TZZOOMFILE,'L2D', L2D) +CALL IO_Field_write(TZZOOMFILE,'PACK', LPACK) +CALL IO_Field_write(TZZOOMFILE,'SURF', CSURF) +CALL IO_File_close(TZZOOMFILE) +! +!* 2.8 Shift to new PGD file +! --------------------- +! +CPGDFILE = YZOOMFILE +! +!------------------------------------------------------------------------------ +! +!* 3. CLOSE PARALLELIZED I/O +! ---------------------- +! +CALL IO_File_close(TZPGDFILE) +! +WRITE(ILUOUT0,*) +WRITE(ILUOUT0,*) '***************************' +WRITE(ILUOUT0,*) '* ZOOM_PGD ends correctly *' +WRITE(ILUOUT0,*) '***************************' +! +CALL FINALIZE_MNH() +! +!------------------------------------------------------------------------------- +! +END PROGRAM ZOOM_PGD diff --git a/src/mesonh/micro/ice_adjust_elec.f90 b/src/mesonh/micro/ice_adjust_elec.f90 index 5c8b704f97fc191e0dee9ec7d03e64b094a127af..1364390488de5defa834070dd9d8f61d8af02de5 100644 --- a/src/mesonh/micro/ice_adjust_elec.f90 +++ b/src/mesonh/micro/ice_adjust_elec.f90 @@ -172,9 +172,9 @@ USE MODD_CST USE MODD_ELEC_DESCR, ONLY : XRTMIN_ELEC, XQTMIN, XFC, XFI, XECHARGE USE MODD_NSV, ONLY : NSV_ELECBEG, NSV_ELECEND USE MODD_PARAMETERS -USE MODD_RAIN_ICE_DESCR, ONLY : XRTMIN, XBI -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM -USE MODD_NEB, ONLY: NEB +USE MODD_RAIN_ICE_DESCR_n, ONLY : XRTMIN, XBI +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAMN +USE MODD_NEB_n, ONLY: NEBN USE MODD_TURB_n, ONLY: TURBN USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t @@ -385,11 +385,11 @@ DO JITER = 1, ITERMAX ZSIGQSAT2D(:,:)=PSIGQSAT ZW4 = 1. ! PRODREF is not used if HL variables are not present ! - CALL CONDENSATION(D, CST, RAIN_ICE_PARAM, NEB, TURBN, & + CALL CONDENSATION(D, CST, RAIN_ICE_PARAMN, NEBN, TURBN, & &'T', 'CB02', 'CB', & &PPABST, PZZ, ZW4, ZT, ZW3_IN, ZW3, ZW1_IN, ZW1, ZW2_IN, ZW2, & &PRRS*PTSTEP, PRSS*PTSTEP, PRGS*PTSTEP, PSIGS, .FALSE., PMFCONV, PCLDFR, PSRCS, .FALSE., & - &OSIGMAS, .FALSE., .FALSE., & + &OSIGMAS, .FALSE., & &ZDUM, ZDUM, ZDUM, ZDUM, ZDUM, ZSIGQSAT2D, & &ZLV, ZLS, ZCPH) ! diff --git a/src/mesonh/micro/ini_ice_c1r3.f90 b/src/mesonh/micro/ini_ice_c1r3.f90 index 3c4c6e266751e09f8aa78e26667b9c3d77ce2bf4..360dd740c72b299e0089caa7bf3c8ee39312c56f 100644 --- a/src/mesonh/micro/ini_ice_c1r3.f90 +++ b/src/mesonh/micro/ini_ice_c1r3.f90 @@ -110,7 +110,7 @@ USE MODD_REF ! use mode_msg ! -USE MODD_RAIN_ICE_DESCR, ONLY : XFVELOS +USE MODD_RAIN_ICE_DESCR_n, ONLY : XFVELOS ! USE MODI_GAMMA USE MODI_GAMMA_INC diff --git a/src/mesonh/micro/ini_neb.F90 b/src/mesonh/micro/ini_neb.F90 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/mesonh/micro/ini_param_elec.f90 b/src/mesonh/micro/ini_param_elec.f90 index 4b889da2e9ea859f05d5d6303ac3778b0161ca32..f622d89499d0ec8fcff83cd8fae6602f90939c2d 100644 --- a/src/mesonh/micro/ini_param_elec.f90 +++ b/src/mesonh/micro/ini_param_elec.f90 @@ -99,9 +99,9 @@ USE MODD_ELEC_PARAM USE MODD_IO, ONLY: TFILEDATA USE MODD_NSV, ONLY: NSV_ELECEND USE MODD_PARAMETERS -USE MODD_PARAM_ICE -USE MODD_RAIN_ICE_DESCR -USE MODD_RAIN_ICE_PARAM +USE MODD_PARAM_ICE_n +USE MODD_RAIN_ICE_DESCR_n +USE MODD_RAIN_ICE_PARAM_n USE MODD_VAR_ll ! USE MODE_IO_FIELD_READ, only: IO_Field_read diff --git a/src/mesonh/micro/ini_rain_ice_elec.f90 b/src/mesonh/micro/ini_rain_ice_elec.f90 index f926dc064811621ab57deddb76b4bbbbbed435f0..1830461a0b3a85fbbbc8cf9c0fb794765a8b26bd 100644 --- a/src/mesonh/micro/ini_rain_ice_elec.f90 +++ b/src/mesonh/micro/ini_rain_ice_elec.f90 @@ -96,9 +96,9 @@ END MODULE MODI_INI_RAIN_ICE_ELEC USE MODD_CST USE MODD_LUNIT USE MODD_PARAMETERS -USE MODD_PARAM_ICE -USE MODD_RAIN_ICE_DESCR -USE MODD_RAIN_ICE_PARAM +USE MODD_PARAM_ICE_n +USE MODD_RAIN_ICE_DESCR_n +USE MODD_RAIN_ICE_PARAM_n USE MODD_REF USE MODD_ELEC_PARAM, ONLY : XGAMINC_RIM3, XFCI USE MODD_ELEC_DESCR, ONLY : XFS @@ -172,8 +172,6 @@ REAL :: PDRYLBDAR_MAX, PDRYLBDAR_MIN REAL :: PWETLBDAS_MAX, PWETLBDAG_MAX, PWETLBDAS_MIN, PWETLBDAG_MIN REAL :: PWETLBDAH_MAX, PWETLBDAH_MIN ! -IF(.NOT.ASSOCIATED(XCEXVT)) CALL RAIN_ICE_DESCR_ASSOCIATE() -IF(.NOT.ASSOCIATED(XFSEDC)) CALL RAIN_ICE_PARAM_ASSOCIATE() ! !------------------------------------------------------------------------------- ! @@ -208,13 +206,6 @@ IF (CSEDIM == 'SPLI') THEN END DO SPLIT END IF ! -IF (ASSOCIATED(XRTMIN)) THEN ! In case of nesting microphysics constants of - ! MODD_RAIN_ICE_PARAM are computed only once, - ! but if INI_RAIN_ICE has been called already - ! one must change the XRTMIN size. - CALL RAIN_ICE_DESCR_DEALLOCATE() -END IF -! IF (HCLOUD == 'ICE4') THEN CALL RAIN_ICE_DESCR_ALLOCATE(7) ELSE IF (HCLOUD == 'ICE3') THEN diff --git a/src/mesonh/micro/lima_nucleation_procs.f90 b/src/mesonh/micro/lima_nucleation_procs.f90 new file mode 100644 index 0000000000000000000000000000000000000000..d5afeef9669aeb479c931e5efde7f17e9b0a67de --- /dev/null +++ b/src/mesonh/micro/lima_nucleation_procs.f90 @@ -0,0 +1,392 @@ +!MNH_LIC Copyright 2018-2021 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_LIMA_NUCLEATION_PROCS +! ############################### +! +INTERFACE + SUBROUTINE LIMA_NUCLEATION_PROCS (PTSTEP, TPFILE, PRHODJ, & + PRHODREF, PEXNREF, PPABST, PT, PDTHRAD, PW_NU,& + PTHT, PRVT, PRCT, PRRT, PRIT, PRST, PRGT, & + PCCT, PCRT, PCIT, & + PNFT, PNAT, PIFT, PINT, PNIT, PNHT, & + PCLDFR, PICEFR, PPRCFR ) +! +USE MODD_IO, ONLY: TFILEDATA +! +REAL, INTENT(IN) :: PTSTEP ! Double Time step +TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Reference density +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF ! Reference density +REAL, DIMENSION(:,:,:), INTENT(IN) :: PEXNREF ! Reference Exner function +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABST ! abs. pressure at time t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PT ! Temperature +REAL, DIMENSION(:,:,:), INTENT(IN) :: PDTHRAD ! Radiative temperature tendency +REAL, DIMENSION(:,:,:), INTENT(IN) :: PW_NU ! updraft velocity used for +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PTHT ! Theta at t +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRVT ! Water vapor m.r. at t +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRCT ! Cloud water m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRRT ! Rain water m.r. at t +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRIT ! Pristine ice m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRST ! Snow m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRGT ! Graupel m.r. at t +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PCCT ! Cloud water conc. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PCRT ! Rain water conc. at t +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PCIT ! Prinstine ice conc. at t +! +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PNFT ! CCN C. available at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PNAT ! CCN C. activated at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PIFT ! IFN C. available at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PINT ! IFN C. activated at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PNIT ! Coated IFN activated at t +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PNHT ! CCN hom freezing +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PCLDFR ! Cloud fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PICEFR ! Ice fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PPRCFR ! Precipitation fraction +! +END SUBROUTINE LIMA_NUCLEATION_PROCS +END INTERFACE +END MODULE MODI_LIMA_NUCLEATION_PROCS +! ############################################################################# +SUBROUTINE LIMA_NUCLEATION_PROCS (PTSTEP, TPFILE, PRHODJ, & + PRHODREF, PEXNREF, PPABST, PT, PDTHRAD, PW_NU,& + PTHT, PRVT, PRCT, PRRT, PRIT, PRST, PRGT, & + PCCT, PCRT, PCIT, & + PNFT, PNAT, PIFT, PINT, PNIT, PNHT, & + PCLDFR, PICEFR, PPRCFR ) +! ############################################################################# +! +!! PURPOSE +!! ------- +!! Compute nucleation processes for the time-split version of LIMA +!! +!! AUTHOR +!! ------ +!! B. Vié * CNRM * +!! +!! MODIFICATIONS +!! ------------- +!! Original 15/03/2018 +! M. Leriche 06/2019: missing update of PNFT after CCN hom. ncl. +! P. Wautelet 27/02/2020: bugfix: PNFT was not updated after LIMA_CCN_HOM_FREEZING +! P. Wautelet 27/02/2020: add Z_TH_HINC variable (for budgets) +! P. Wautelet 02/2020: use the new data structures and subroutines for budgets +! B. Vie 03/03/2020: use DTHRAD instead of dT/dt in Smax diagnostic computation +! B. Vie 03/2022: Add option for 1-moment pristine ice +!------------------------------------------------------------------------------- +! +use modd_budget, only: lbu_enable, lbudget_th, lbudget_rv, lbudget_rc, lbudget_rr, & + lbudget_ri, lbudget_rs, lbudget_rg, lbudget_rh, lbudget_sv, & + NBUDGET_TH, NBUDGET_RV, NBUDGET_RC, NBUDGET_RI, NBUDGET_SV1, & + tbudgets +USE MODD_IO, ONLY: TFILEDATA +USE MODD_PARAMETERS, ONLY : JPHEXT, JPVEXT +USE MODD_NSV, ONLY : NSV_LIMA_NC, NSV_LIMA_NR, NSV_LIMA_CCN_FREE, NSV_LIMA_CCN_ACTI, & + NSV_LIMA_NI, NSV_LIMA_IFN_FREE, NSV_LIMA_IFN_NUCL, NSV_LIMA_IMM_NUCL, NSV_LIMA_HOM_HAZE +USE MODD_PARAM_LIMA, ONLY : LCOLD, LNUCL, LMEYERS, LSNOW, LWARM, LACTI, LRAIN, LHHONI, & + NMOD_CCN, NMOD_IFN, NMOD_IMM, XCTMIN, XRTMIN, LSPRO, NMOM_I, NMOM_C +USE MODD_NEB_n, ONLY : LSUBG_COND + +use mode_budget, only: Budget_store_add, Budget_store_init, Budget_store_end + +USE MODI_LIMA_CCN_ACTIVATION +USE MODI_LIMA_CCN_HOM_FREEZING +USE MODI_LIMA_MEYERS_NUCLEATION +USE MODI_LIMA_PHILLIPS_IFN_NUCLEATION +USE MODE_RAIN_ICE_NUCLEATION +! +!------------------------------------------------------------------------------- +! +IMPLICIT NONE +! +!------------------------------------------------------------------------------- +! +REAL, INTENT(IN) :: PTSTEP ! Double Time step +TYPE(TFILEDATA), INTENT(IN) :: TPFILE ! Output file +! +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODJ ! Reference density +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRHODREF ! Reference density +REAL, DIMENSION(:,:,:), INTENT(IN) :: PEXNREF ! Reference Exner function +REAL, DIMENSION(:,:,:), INTENT(IN) :: PPABST ! abs. pressure at time t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PT ! Temperature +REAL, DIMENSION(:,:,:), INTENT(IN) :: PDTHRAD ! Radiative temperature tendency +REAL, DIMENSION(:,:,:), INTENT(IN) :: PW_NU ! updraft velocity used for +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PTHT ! Theta at t +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRVT ! Water vapor m.r. at t +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRCT ! Cloud water m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRRT ! Rain water m.r. at t +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PRIT ! Rain water m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRST ! Rain water m.r. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PRGT ! Rain water m.r. at t +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PCCT ! Cloud water conc. at t +REAL, DIMENSION(:,:,:), INTENT(IN) :: PCRT ! Rain water conc. at t +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PCIT ! Prinstine ice conc. at t +! +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PNFT ! CCN C. available at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PNAT ! CCN C. activated at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PIFT ! IFN C. available at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PINT ! IFN C. activated at t +REAL, DIMENSION(:,:,:,:), INTENT(INOUT) :: PNIT ! Coated IFN activated at t +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PNHT ! CCN hom. freezing +! +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PCLDFR ! Cloud fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PICEFR ! Ice fraction +REAL, DIMENSION(:,:,:), INTENT(INOUT) :: PPRCFR ! Precipitation fraction +! +!------------------------------------------------------------------------------- +! +REAL, DIMENSION(SIZE(PT,1),SIZE(PT,2),SIZE(PT,3)) :: Z_TH_HIND, Z_RI_HIND, Z_CI_HIND, Z_TH_HINC, Z_RC_HINC, Z_CC_HINC +REAL, DIMENSION(SIZE(PT,1),SIZE(PT,2),SIZE(PT,3)) :: ZTHS, ZRIS, ZRVS, ZRHT, ZCIT, ZT +! +integer :: idx +INTEGER :: JL +! +!------------------------------------------------------------------------------- +! +IF ( LWARM .AND. LACTI .AND. NMOD_CCN >=1 .AND. NMOM_C.GE.2) THEN + + IF (.NOT.LSUBG_COND .AND. .NOT.LSPRO) THEN + + if ( lbu_enable ) then + if ( lbudget_th ) call Budget_store_init( tbudgets(NBUDGET_TH), 'HENU', ptht(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_rv ) call Budget_store_init( tbudgets(NBUDGET_RV), 'HENU', prvt(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_rc ) call Budget_store_init( tbudgets(NBUDGET_RC), 'HENU', prct(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_sv ) then + call Budget_store_init( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_nc), 'HENU', pcct(:, :, :) * prhodj(:, :, :) / ptstep ) + do jl = 1, nmod_ccn + idx = NBUDGET_SV1 - 1 + nsv_lima_ccn_free - 1 + jl + call Budget_store_init( tbudgets(idx), 'HENU', pnft(:, :, :, jl) * prhodj(:, :, :) / ptstep ) + idx = NBUDGET_SV1 - 1 + nsv_lima_ccn_acti - 1 + jl + call Budget_store_init( tbudgets(idx), 'HENU', pnat(:, :, :, jl) * prhodj(:, :, :) / ptstep ) + end do + end if + end if + + CALL LIMA_CCN_ACTIVATION( TPFILE, & + PRHODREF, PEXNREF, PPABST, PT, PDTHRAD, PW_NU, & + PTHT, PRVT, PRCT, PCCT, PRRT, PNFT, PNAT, PCLDFR ) + if ( lbu_enable ) then + if ( lbudget_th ) call Budget_store_end( tbudgets(NBUDGET_TH), 'HENU', ptht(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_rv ) call Budget_store_end( tbudgets(NBUDGET_RV), 'HENU', prvt(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_rc ) call Budget_store_end( tbudgets(NBUDGET_RC), 'HENU', prct(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_sv ) then + call Budget_store_end( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_nc), 'HENU', pcct(:, :, :) * prhodj(:, :, :) / ptstep ) + do jl = 1, nmod_ccn + idx = NBUDGET_SV1 - 1 + nsv_lima_ccn_free - 1 + jl + call Budget_store_end( tbudgets(idx), 'HENU', pnft(:, :, :, jl) * prhodj(:, :, :) / ptstep ) + idx = NBUDGET_SV1 - 1 + nsv_lima_ccn_acti - 1 + jl + call Budget_store_end( tbudgets(idx), 'HENU', pnat(:, :, :, jl) * prhodj(:, :, :) / ptstep ) + end do + end if + end if + + END IF + + WHERE(PCLDFR(:,:,:)<1.E-10 .AND. PRCT(:,:,:)>XRTMIN(2) .AND. PCCT(:,:,:)>XCTMIN(2)) PCLDFR(:,:,:)=1. + +END IF +! +!------------------------------------------------------------------------------- +! +IF ( LCOLD .AND. LNUCL .AND. NMOM_I>=2 .AND. .NOT.LMEYERS .AND. NMOD_IFN >= 1 ) THEN + if ( lbu_enable ) then + if ( lbudget_sv ) then + do jl = 1, nmod_ifn + idx = NBUDGET_SV1 - 1 + nsv_lima_ifn_free - 1 + jl + call Budget_store_init( tbudgets(idx), 'HIND', pift(:, :, :, jl) * prhodj(:, :, :) / ptstep ) + idx = NBUDGET_SV1 - 1 + nsv_lima_ifn_nucl - 1 + jl + call Budget_store_init( tbudgets(idx), 'HIND', pint(:, :, :, jl) * prhodj(:, :, :) / ptstep ) + end do + + do jl = 1, nmod_ccn + idx = NBUDGET_SV1 - 1 + nsv_lima_ccn_acti - 1 + jl + call Budget_store_init( tbudgets(idx), 'HINC', pnat(:, :, :, jl) * prhodj(:, :, :) / ptstep ) + end do + do jl = 1, nmod_imm + idx = NBUDGET_SV1 - 1 + nsv_lima_imm_nucl - 1 + jl + call Budget_store_init( tbudgets(idx), 'HINC', pnit(:, :, :, jl) * prhodj(:, :, :) / ptstep ) + end do + end if + end if + + CALL LIMA_PHILLIPS_IFN_NUCLEATION (PTSTEP, & + PRHODREF, PEXNREF, PPABST, & + PTHT, PRVT, PRCT, PRRT, PRIT, PRST, PRGT, & + PCCT, PCIT, PNAT, PIFT, PINT, PNIT, & + Z_TH_HIND, Z_RI_HIND, Z_CI_HIND, & + Z_TH_HINC, Z_RC_HINC, Z_CC_HINC, & + PICEFR ) + WHERE(PICEFR(:,:,:)<1.E-10 .AND. PRIT(:,:,:)>XRTMIN(4) .AND. PCIT(:,:,:)>XCTMIN(4)) PICEFR(:,:,:)=1. +! + if ( lbu_enable ) then + if ( lbudget_th ) call Budget_store_add( tbudgets(NBUDGET_TH), 'HIND', z_th_hind(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_rv ) call Budget_store_add( tbudgets(NBUDGET_RV), 'HIND', -z_ri_hind(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_ri ) call Budget_store_add( tbudgets(NBUDGET_RI), 'HIND', z_ri_hind(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_sv ) then + call Budget_store_add( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_ni), 'HIND', z_ci_hind(:, :, :) * prhodj(:, :, :) / ptstep ) + do jl = 1, nmod_ifn + idx = NBUDGET_SV1 - 1 + nsv_lima_ifn_free - 1 + jl + call Budget_store_end( tbudgets(idx), 'HIND', pift(:, :, :, jl) * prhodj(:, :, :) / ptstep ) + idx = NBUDGET_SV1 - 1 + nsv_lima_ifn_nucl - 1 + jl + call Budget_store_end( tbudgets(idx), 'HIND', pint(:, :, :, jl) * prhodj(:, :, :) / ptstep ) + end do + end if + + if ( lbudget_th ) call Budget_store_add( tbudgets(NBUDGET_TH), 'HINC', z_th_hinc(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_rc ) call Budget_store_add( tbudgets(NBUDGET_RC), 'HINC', z_rc_hinc(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_ri ) call Budget_store_add( tbudgets(NBUDGET_RI), 'HINC', -z_rc_hinc(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_sv ) then + if (nmom_c.ge.2) then + call Budget_store_add( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_nc), 'HINC', z_cc_hinc(:, :, :) * prhodj(:, :, :) / ptstep ) + end if + call Budget_store_add( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_ni), 'HINC', -z_cc_hinc(:, :, :) * prhodj(:, :, :) / ptstep ) + do jl = 1, nmod_ccn + idx = NBUDGET_SV1 - 1 + nsv_lima_ccn_acti - 1 + jl + call Budget_store_end( tbudgets(idx), 'HINC', pnat(:, :, :, jl) * prhodj(:, :, :) / ptstep ) + end do + do jl = 1, nmod_imm + idx = NBUDGET_SV1 - 1 + nsv_lima_imm_nucl - 1 + jl + call Budget_store_end( tbudgets(idx), 'HINC', pnit(:, :, :, jl) * prhodj(:, :, :) / ptstep ) + end do + end if + end if +END IF +! +!------------------------------------------------------------------------------- +! +IF (LCOLD .AND. LNUCL .AND. NMOM_I>=2 .AND. LMEYERS) THEN + CALL LIMA_MEYERS_NUCLEATION (PTSTEP, & + PRHODREF, PEXNREF, PPABST, & + PTHT, PRVT, PRCT, PRRT, PRIT, PRST, PRGT, & + PCCT, PCIT, PINT, & + Z_TH_HIND, Z_RI_HIND, Z_CI_HIND, & + Z_TH_HINC, Z_RC_HINC, Z_CC_HINC, & + PICEFR ) + WHERE(PICEFR(:,:,:)<1.E-10 .AND. PRIT(:,:,:)>XRTMIN(4) .AND. PCIT(:,:,:)>XCTMIN(4)) PICEFR(:,:,:)=1. + ! + if ( lbu_enable ) then + if ( lbudget_th ) call Budget_store_add( tbudgets(NBUDGET_TH), 'HIND', z_th_hind(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_rv ) call Budget_store_add( tbudgets(NBUDGET_RV), 'HIND', -z_ri_hind(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_ri ) call Budget_store_add( tbudgets(NBUDGET_RI), 'HIND', z_ri_hind(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_sv ) then + call Budget_store_add( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_ni), 'HIND', z_ci_hind(:, :, :) * prhodj(:, :, :) / ptstep ) + if (nmod_ifn > 0 ) & + call Budget_store_add( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_ifn_nucl), 'HIND', & + z_ci_hind(:, :, :) * prhodj(:, :, :) / ptstep ) + end if + + if ( lbudget_th ) call Budget_store_add( tbudgets(NBUDGET_TH), 'HINC', z_th_hinc(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_rc ) call Budget_store_add( tbudgets(NBUDGET_RC), 'HINC', z_rc_hinc(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_ri ) call Budget_store_add( tbudgets(NBUDGET_RI), 'HINC', -z_rc_hinc(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_sv ) then + if (nmom_c.ge.2) then + call Budget_store_add( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_nc), 'HINC', z_cc_hinc(:, :, :) * prhodj(:, :, :) / ptstep ) + end if + call Budget_store_add( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_ni), 'HINC', -z_cc_hinc(:, :, :) * prhodj(:, :, :) / ptstep ) + if (nmod_ifn > 0 ) & + call Budget_store_add( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_ifn_nucl), 'HINC', & + -z_cc_hinc(:, :, :) * prhodj(:, :, :) / ptstep ) + end if + end if +END IF +! +!------------------------------------------------------------------------------- +! +IF (LCOLD .AND. LNUCL .AND. NMOM_I.EQ.1) THEN + WHERE(PICEFR(:,:,:)<1.E-10 .AND. PRIT(:,:,:)>XRTMIN(4) .AND. PCIT(:,:,:)>XCTMIN(4)) PICEFR(:,:,:)=1. + ! + ZTHS=PTHT/PTSTEP + ZRVS=PRVT/PTSTEP + ZRIS=PRIT/PTSTEP + ZRHT=0. + ZCIT=PCIT + ZT=PT + CALL RAIN_ICE_NUCLEATION(1+JPHEXT, SIZE(PT,1)-JPHEXT, 1+JPHEXT, SIZE(PT,2)-JPHEXT, 1+JPVEXT, SIZE(PT,3)-JPVEXT, 6, & + PTSTEP, PTHT, PPABST, PRHODJ, PRHODREF, PRVT, PRCT, PRRT, PRIT, PRST, PRGT, & + ZCIT, PEXNREF, ZTHS, ZRVS, ZRIS, ZT, ZRHT) + ! +! Z_TH_HIND=ZTHS*PTSTEP-PTHT +! Z_RI_HIND=ZRIS*PTSTEP-PRIT +! Z_CI_HIND=ZCIT-PCIT + PCIT=ZCIT + PRIT=ZRIS*PTSTEP + PTHT=ZTHS*PTSTEP + PRVT=ZRVS*PTSTEP +! Z_TH_HINC=0. +! Z_RC_HINC=0. +! Z_CC_HINC=0. +! ! +! if ( lbu_enable ) then +! if ( lbudget_th ) call Budget_store_add( tbudgets(NBUDGET_TH), 'HIND', z_th_hind(:, :, :) * prhodj(:, :, :) / ptstep ) +! if ( lbudget_rv ) call Budget_store_add( tbudgets(NBUDGET_RV), 'HIND', -z_ri_hind(:, :, :) * prhodj(:, :, :) / ptstep ) +! if ( lbudget_ri ) call Budget_store_add( tbudgets(NBUDGET_RI), 'HIND', z_ri_hind(:, :, :) * prhodj(:, :, :) / ptstep ) +! if ( lbudget_sv ) then +! call Budget_store_add( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_ni), 'HIND', z_ci_hind(:, :, :) * prhodj(:, :, :) / ptstep ) +! if (nmod_ifn > 0 ) & +! call Budget_store_add( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_ifn_nucl), 'HIND', & +! z_ci_hind(:, :, :) * prhodj(:, :, :) / ptstep ) +! end if +! +! if ( lbudget_th ) call Budget_store_add( tbudgets(NBUDGET_TH), 'HINC', z_th_hinc(:, :, :) * prhodj(:, :, :) / ptstep ) +! if ( lbudget_rc ) call Budget_store_add( tbudgets(NBUDGET_RC), 'HINC', z_rc_hinc(:, :, :) * prhodj(:, :, :) / ptstep ) +! if ( lbudget_ri ) call Budget_store_add( tbudgets(NBUDGET_RI), 'HINC', -z_rc_hinc(:, :, :) * prhodj(:, :, :) / ptstep ) +! if ( lbudget_sv ) then +! call Budget_store_add( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_nc), 'HINC', z_cc_hinc(:, :, :) * prhodj(:, :, :) / ptstep ) +! call Budget_store_add( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_ni), 'HINC', -z_cc_hinc(:, :, :) * prhodj(:, :, :) / ptstep ) +! if (nmod_ifn > 0 ) & +! call Budget_store_add( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_ifn_nucl), 'HINC', & +! -z_cc_hinc(:, :, :) * prhodj(:, :, :) / ptstep ) +! end if +! end if +END IF +! +!------------------------------------------------------------------------------- +! +IF ( LCOLD .AND. LNUCL .AND. LHHONI .AND. NMOD_CCN >= 1 .AND. NMOM_I.GE.2) THEN + if ( lbu_enable ) then + if ( lbudget_th ) call Budget_store_init( tbudgets(NBUDGET_TH), 'HONH', PTHT(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_rv ) call Budget_store_init( tbudgets(NBUDGET_RV), 'HONH', PRVT(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_ri ) call Budget_store_init( tbudgets(NBUDGET_RI), 'HONH', PRIT(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_sv ) then + call Budget_store_init( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_ni), 'HONH', PCIT(:, :, :) * prhodj(:, :, :) / ptstep ) + do jl = 1, nmod_ccn + idx = NBUDGET_SV1 - 1 + nsv_lima_ccn_free - 1 + jl + call Budget_store_init( tbudgets(idx), 'HONH', PNFT(:, :, :, jl) * prhodj(:, :, :) / ptstep ) + end do + call Budget_store_init( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_hom_haze), 'HONH', PNHT(:, :, :) * prhodj(:, :, :) / ptstep ) + end if + end if + + CALL LIMA_CCN_HOM_FREEZING (PRHODREF, PEXNREF, PPABST, PW_NU, & + PTHT, PRVT, PRCT, PRRT, PRIT, PRST, PRGT, & + PCCT, PCRT, PCIT, PNFT, PNHT, & + PICEFR ) + WHERE(PICEFR(:,:,:)<1.E-10 .AND. PRIT(:,:,:)>XRTMIN(4) .AND. PCIT(:,:,:)>XCTMIN(4)) PICEFR(:,:,:)=1. +! + if ( lbu_enable ) then + if ( lbudget_th ) call Budget_store_end( tbudgets(NBUDGET_TH), 'HONH', PTHT(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_rv ) call Budget_store_end( tbudgets(NBUDGET_RV), 'HONH', PRVT(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_ri ) call Budget_store_end( tbudgets(NBUDGET_RI), 'HONH', PRIT(:, :, :) * prhodj(:, :, :) / ptstep ) + if ( lbudget_sv ) then + call Budget_store_end( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_ni), 'HONH', PCIT(:, :, :) * prhodj(:, :, :) / ptstep ) + do jl = 1, nmod_ccn + idx = NBUDGET_SV1 - 1 + nsv_lima_ccn_free - 1 + jl + call Budget_store_end( tbudgets(idx), 'HONH', PNFT(:, :, :, jl) * prhodj(:, :, :) / ptstep ) + end do + call Budget_store_end( tbudgets(NBUDGET_SV1 - 1 + nsv_lima_hom_haze), 'HONH', PNHT(:, :, :) * prhodj(:, :, :) / ptstep ) + end if + end if +ENDIF +! +!------------------------------------------------------------------------------- +! +END SUBROUTINE LIMA_NUCLEATION_PROCS diff --git a/src/mesonh/micro/modi_ini_rain_ice.F90 b/src/mesonh/micro/modi_ini_rain_ice.F90 deleted file mode 100644 index 24dd0d68de12ce2b27d5d2ef3f0a9e60f1978fa1..0000000000000000000000000000000000000000 --- a/src/mesonh/micro/modi_ini_rain_ice.F90 +++ /dev/null @@ -1,23 +0,0 @@ -! ######spl - MODULE MODI_INI_RAIN_ICE -! ######################## -! -INTERFACE - SUBROUTINE INI_RAIN_ICE ( KLUOUT, PTSTEP, PDZMIN, KSPLITR, HCLOUD ) -! -INTEGER, INTENT(IN) :: KLUOUT ! Logical unit number for prints -INTEGER, INTENT(OUT):: KSPLITR ! Number of small time step - ! integration for rain - ! sedimendation -! -REAL, INTENT(IN) :: PTSTEP ! Effective Time step -! -REAL, INTENT(IN) :: PDZMIN ! minimun vertical mesh size -! -CHARACTER (LEN=4), INTENT(IN) :: HCLOUD ! Indicator of the cloud scheme -! -END SUBROUTINE INI_RAIN_ICE -! -END INTERFACE -! -END MODULE MODI_INI_RAIN_ICE diff --git a/src/mesonh/micro/radar_rain_ice.f90 b/src/mesonh/micro/radar_rain_ice.f90 index cf97a981ade422f5d257a46c93a48cf234056ce1..00422ba2ef02d6d6d1ca4ed1ca3c1e79e6976cfd 100644 --- a/src/mesonh/micro/radar_rain_ice.f90 +++ b/src/mesonh/micro/radar_rain_ice.f90 @@ -98,8 +98,8 @@ END MODULE MODI_RADAR_RAIN_ICE ! USE MODD_CST USE MODD_REF -USE MODD_PARAM_ICE, ONLY: LSNOW_T_I=>LSNOW_T -USE MODD_RAIN_ICE_DESCR, ONLY: XALPHAR_I=>XALPHAR,XNUR_I=>XNUR,XLBEXR_I=>XLBEXR,& +USE MODD_PARAM_ICE_n, ONLY: LSNOW_T_I=>LSNOW_T +USE MODD_RAIN_ICE_DESCR_n, ONLY: XALPHAR_I=>XALPHAR,XNUR_I=>XNUR,XLBEXR_I=>XLBEXR,& XLBR_I=>XLBR,XCCR_I=>XCCR,XBR_I=>XBR,XAR_I=>XAR,& XALPHAC_I=>XALPHAC,XNUC_I=>XNUC,& XLBC_I=>XLBC,XBC_I=>XBC,XAC_I=>XAC,& diff --git a/src/mesonh/micro/radtr_satel.f90 b/src/mesonh/micro/radtr_satel.f90 index 5c79550bb3f34b5eb7929616036b6468aa5c01ec..3367a09a68651b38e4c25ecb45f4f5b6e2de9e3d 100644 --- a/src/mesonh/micro/radtr_satel.f90 +++ b/src/mesonh/micro/radtr_satel.f90 @@ -111,8 +111,8 @@ END MODULE MODI_RADTR_SATEL USE MODD_CST USE MODD_PARAMETERS USE MODD_GRID_n -USE MODD_RAIN_ICE_PARAM, ONLY: RAIN_ICE_PARAM -USE MODD_NEB, ONLY: NEB +USE MODD_RAIN_ICE_PARAM_n, ONLY: RAIN_ICE_PARAMN +USE MODD_NEB_n, ONLY: NEBN USE MODD_TURB_n, ONLY: TURBN USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t ! @@ -497,11 +497,11 @@ IF( SIZE(PRT(:,:,:,:),4) >= 2 ) THEN ! PRT(:,:,:,2), PRT(:,:,:,5), PRT(:,:,:,6), PSIGS, PMFCONV, ZNCLD, & ! ZSIGRC, OUSERI, OSIGMAS, .FALSE., .FALSE., & ! ZDUM, ZDUM, ZDUM, ZDUM, ZDUM, ZSIGQSAT2D ) - CALL CONDENSATION(D, CST, RAIN_ICE_PARAM, NEB, TURBN, & + CALL CONDENSATION(D, CST, RAIN_ICE_PARAMN, NEBN, TURBN, & &'T', 'CB02', 'CB', & &PPABST, PZZ, ZRHO, ZTEMP, ZRV_IN, ZRV_OUT, ZRC_IN, ZRC_OUT, ZRI_IN, ZRI_OUT, & &PRT(:,:,:,2), PRT(:,:,:,5), PRT(:,:,:,6), PSIGS, .FALSE., PMFCONV, ZNCLD, ZSIGRC, .FALSE., & - &OSIGMAS, .FALSE., .FALSE., & + &OSIGMAS, .FALSE., & &ZDUM, ZDUM, ZDUM, ZDUM, ZDUM, ZSIGQSAT2D) DEALLOCATE(ZTEMP,ZSIGRC) DEALLOCATE(ZRV_OUT) diff --git a/src/mesonh/micro/rain_ice_elec.f90 b/src/mesonh/micro/rain_ice_elec.f90 index d1a432f20b26e1f371778fd54366e65bb2e0c784..263168049ecee420dc896ebfd9f4d60afd5276cd 100644 --- a/src/mesonh/micro/rain_ice_elec.f90 +++ b/src/mesonh/micro/rain_ice_elec.f90 @@ -219,9 +219,9 @@ USE MODD_LES USE MODE_ll USE MODD_NSV, ONLY: NSV_ELECBEG, NSV_ELECEND ! Scalar variables for budgets USE MODD_PARAMETERS -USE MODD_PARAM_ICE -USE MODD_RAIN_ICE_DESCR -USE MODD_RAIN_ICE_PARAM +USE MODD_PARAM_ICE_n +USE MODD_RAIN_ICE_DESCR_n +USE MODD_RAIN_ICE_PARAM_n USE MODD_REF, ONLY: XTHVREFZ use mode_budget, only: Budget_store_add, Budget_store_init, Budget_store_end diff --git a/src/mesonh/micro/rain_ice_fast_rg.f90 b/src/mesonh/micro/rain_ice_fast_rg.f90 index 0799d824aa16f617ead6073703f4ba18f4229347..f0a5001b7c0cc5b2c3e92a6e47cc5c83e02136dc 100644 --- a/src/mesonh/micro/rain_ice_fast_rg.f90 +++ b/src/mesonh/micro/rain_ice_fast_rg.f90 @@ -33,9 +33,9 @@ SUBROUTINE RAIN_ICE_FAST_RG(KRR, OMICRO, PRHODREF, PRVT, PRCT, PRRT, PRIT, PRST, use modd_budget, only: lbudget_th, lbudget_rc, lbudget_rr, lbudget_ri, lbudget_rs, lbudget_rg, lbudget_rh, & NBUDGET_TH, NBUDGET_RC, NBUDGET_RR, NBUDGET_RI, NBUDGET_RS, NBUDGET_RG, NBUDGET_RH, & tbudgets -use MODD_CST, only: XCI, XCL, XCPV, XESTT, XLMTT, XLVTT, XMD, XMV, XRV, XTT -use MODD_RAIN_ICE_DESCR, only: XBS, XCEXVT, XCXG, XCXS, XDG, XRTMIN -use MODD_RAIN_ICE_PARAM, only: NDRYLBDAG, NDRYLBDAR, NDRYLBDAS, X0DEPG, X1DEPG, XCOLEXIG, XCOLEXSG, XCOLIG, XCOLSG, XDRYINTP1G, & +USE MODD_CST, only: XCI, XCL, XCPV, XESTT, XLMTT, XLVTT, XMD, XMV, XRV, XTT +USE MODD_RAIN_ICE_DESCR_n, only: XBS, XCEXVT, XCXG, XCXS, XDG, XRTMIN +USE MODD_RAIN_ICE_PARAM_n, only: NDRYLBDAG, NDRYLBDAR, NDRYLBDAS, X0DEPG, X1DEPG, XCOLEXIG, XCOLEXSG, XCOLIG, XCOLSG, XDRYINTP1G, & XDRYINTP1R, XDRYINTP1S, XDRYINTP2G, XDRYINTP2R, XDRYINTP2S, XEX0DEPG, XEX1DEPG, XEXICFRR, & XEXRCFRI, XFCDRYG, XFIDRYG, XFRDRYG, XFSDRYG, XICFRR, XKER_RDRYG, XKER_SDRYG, XLBRDRYG1, & XLBRDRYG2, XLBRDRYG3, XLBSDRYG1, XLBSDRYG2, XLBSDRYG3, XRCFRI diff --git a/src/mesonh/micro/rain_ice_fast_rh.f90 b/src/mesonh/micro/rain_ice_fast_rh.f90 index d41b61143d2db7ef49ab7926d371e2dc53a7b972..64775254bcc4742ef44a89d2b20f4f5857f5cc4f 100644 --- a/src/mesonh/micro/rain_ice_fast_rh.f90 +++ b/src/mesonh/micro/rain_ice_fast_rh.f90 @@ -30,9 +30,9 @@ SUBROUTINE RAIN_ICE_FAST_RH(OMICRO, PRHODREF, PRVT, PRCT, PRIT, PRST, PRGT, PRHT use modd_budget, only: lbudget_th, lbudget_rc, lbudget_rr, lbudget_ri, lbudget_rs, lbudget_rg, lbudget_rh, & NBUDGET_TH, NBUDGET_RC, NBUDGET_RR, NBUDGET_RI, NBUDGET_RS, NBUDGET_RG, NBUDGET_RH, & tbudgets -use MODD_CST, only: XCI, XCL, XCPV, XESTT, XLMTT, XLVTT, XMD, XMV, XRV, XTT -use MODD_RAIN_ICE_DESCR, only: XBG, XBS, XCEXVT, XCXG, XCXH, XCXS, XDH, XLBEXH, XLBH, XRTMIN -use MODD_RAIN_ICE_PARAM, only: NWETLBDAG, NWETLBDAH, NWETLBDAS, X0DEPH, X1DEPH, & +USE MODD_CST, only: XCI, XCL, XCPV, XESTT, XLMTT, XLVTT, XMD, XMV, XRV, XTT +USE MODD_RAIN_ICE_DESCR_n, only: XBG, XBS, XCEXVT, XCXG, XCXH, XCXS, XDH, XLBEXH, XLBH, XRTMIN +USE MODD_RAIN_ICE_PARAM_n, only: NWETLBDAG, NWETLBDAH, NWETLBDAS, X0DEPH, X1DEPH, & XEX0DEPH, XEX1DEPH, XFGWETH, XFSWETH, XFWETH, XKER_GWETH, XKER_SWETH, & XLBGWETH1, XLBGWETH2, XLBGWETH3, XLBSWETH1, XLBSWETH2, XLBSWETH3, & XWETINTP1G, XWETINTP1H, XWETINTP1S, XWETINTP2G, XWETINTP2H, XWETINTP2S diff --git a/src/mesonh/micro/rain_ice_fast_ri.f90 b/src/mesonh/micro/rain_ice_fast_ri.f90 index edb36a38b90fded9262d13f47e042247f5b448d5..3bb56e144f895b6259a55367c365379dcf7adc12 100644 --- a/src/mesonh/micro/rain_ice_fast_ri.f90 +++ b/src/mesonh/micro/rain_ice_fast_ri.f90 @@ -27,9 +27,9 @@ SUBROUTINE RAIN_ICE_FAST_RI(OMICRO, PRHODREF, PRIT, PRHODJ, PZT, PSSI, PLSFACT, use modd_budget, only: lbudget_th, lbudget_rc, lbudget_ri, & NBUDGET_TH, NBUDGET_RC, NBUDGET_RI, & tbudgets -use MODD_CST, only: XTT -use MODD_RAIN_ICE_DESCR, only: XDI, XLBEXI, XLBI, XRTMIN -use MODD_RAIN_ICE_PARAM, only: X0DEPI, X2DEPI +USE MODD_CST, only: XTT +USE MODD_RAIN_ICE_DESCR_n, only: XDI, XLBEXI, XLBI, XRTMIN +USE MODD_RAIN_ICE_PARAM_n, only: X0DEPI, X2DEPI use mode_budget, only: Budget_store_add, Budget_store_end, Budget_store_init diff --git a/src/mesonh/micro/rain_ice_fast_rs.f90 b/src/mesonh/micro/rain_ice_fast_rs.f90 index 682a1ba3fe3148aa37be1f6e705b789fd84542ec..5cbebbff1123031ba64e266fc7c874471a9a2ef0 100644 --- a/src/mesonh/micro/rain_ice_fast_rs.f90 +++ b/src/mesonh/micro/rain_ice_fast_rs.f90 @@ -31,9 +31,9 @@ SUBROUTINE RAIN_ICE_FAST_RS(PTSTEP, OMICRO, PRHODREF, PRVT, PRCT, PRRT, PRST, PR use modd_budget, only: lbudget_th, lbudget_rc, lbudget_rr, lbudget_rs, lbudget_rg, & NBUDGET_TH, NBUDGET_RC, NBUDGET_RR, NBUDGET_RS, NBUDGET_RG, & tbudgets -use MODD_CST, only: XCL, XCPV, XESTT, XLMTT, XLVTT, XMD, XMV, XRV, XTT -use MODD_RAIN_ICE_DESCR, only: XBS, XCEXVT, XCXS, XRTMIN -use MODD_RAIN_ICE_PARAM, only: NACCLBDAR, NACCLBDAS, NGAMINC, X0DEPS, X1DEPS, XACCINTP1R, XACCINTP1S, XACCINTP2R, XACCINTP2S, & +USE MODD_CST, only: XCL, XCPV, XESTT, XLMTT, XLVTT, XMD, XMV, XRV, XTT +USE MODD_RAIN_ICE_DESCR_n, only: XBS, XCEXVT, XCXS, XRTMIN +USE MODD_RAIN_ICE_PARAM_n, only: NACCLBDAR, NACCLBDAS, NGAMINC, X0DEPS, X1DEPS, XACCINTP1R, XACCINTP1S, XACCINTP2R, XACCINTP2S, & XCRIMSG, XCRIMSS, XEX0DEPS, XEX1DEPS, XEXCRIMSG, XEXCRIMSS, XEXSRIMCG, XFRACCSS, & XFSACCRG, XFSCVMG, XGAMINC_RIM1, XGAMINC_RIM1, XGAMINC_RIM2, XKER_RACCS, & XKER_RACCSS, XKER_SACCRG, XLBRACCS1, XLBRACCS2, XLBRACCS3, XLBSACCR1, XLBSACCR2, XLBSACCR3, & diff --git a/src/mesonh/micro/rain_ice_nucleation.f90 b/src/mesonh/micro/rain_ice_nucleation.f90 index 701e30282f15c6c3083767192f3d33f07f177d02..34b9c8efb4d90c5989bf421b25e3c15e56165f99 100644 --- a/src/mesonh/micro/rain_ice_nucleation.f90 +++ b/src/mesonh/micro/rain_ice_nucleation.f90 @@ -29,9 +29,9 @@ SUBROUTINE RAIN_ICE_NUCLEATION(KIB, KIE, KJB, KJE, KKTB, KKTE,KRR,PTSTEP,& use modd_budget, only: lbudget_th, lbudget_rv, lbudget_ri, & NBUDGET_TH, NBUDGET_RV, NBUDGET_RI, & tbudgets -use MODD_CST, only: XALPI, XALPW, XBETAI, XBETAW, XCI, XCL, XCPD, XCPV, XGAMI, XGAMW, & +USE MODD_CST, only: XALPI, XALPW, XBETAI, XBETAW, XCI, XCL, XCPD, XCPV, XGAMI, XGAMW, & XLSTT, XMD, XMV, XP00, XRD, XTT -use MODD_RAIN_ICE_PARAM, only: XALPHA1, XALPHA2, XBETA1, XBETA2, XMNU0, XNU10, XNU20 +USE MODD_RAIN_ICE_PARAM_n, only: XALPHA1, XALPHA2, XBETA1, XBETA2, XMNU0, XNU10, XNU20 use mode_budget, only: Budget_store_init, Budget_store_end use mode_tools, only: Countjv diff --git a/src/mesonh/micro/rain_ice_old.f90 b/src/mesonh/micro/rain_ice_old.f90 index 6645e796b47be4aee5b48ea208e72ec8f09bbfa3..4fc2a8c796592f5227380045c0435df43a0a282a 100644 --- a/src/mesonh/micro/rain_ice_old.f90 +++ b/src/mesonh/micro/rain_ice_old.f90 @@ -224,29 +224,29 @@ END MODULE MODI_RAIN_ICE_OLD !* 0. DECLARATIONS ! ------------ ! -use modd_budget, only: lbu_enable -use MODD_CONF, only: LCHECK -use MODD_CST, only: XCI, XCL, XCPD, XCPV, XLSTT, XLVTT, XTT, & +USE modd_budget, only: lbu_enable +USE MODD_CONF, only: LCHECK +USE MODD_CST, only: XCI, XCL, XCPD, XCPV, XLSTT, XLVTT, XTT, & XALPI, XBETAI, XGAMI, XMD, XMV, XTT -use MODD_LES, only: LLES_CALL -use MODD_PARAMETERS, only: JPVEXT -use MODD_PARAM_ICE, only: CSUBG_PR_PDF, LDEPOSC -use MODD_RAIN_ICE_DESCR, only: RAIN_ICE_DESCR, XLBEXR, XLBR, XRTMIN -use MODD_RAIN_ICE_PARAM, only: XCRIAUTC +USE MODD_LES, only: LLES_CALL +USE MODD_PARAMETERS, only: JPVEXT +USE MODD_PARAM_ICE_n, only: CSUBG_PR_PDF, LDEPOSC +USE MODD_RAIN_ICE_DESCR_n, only: RAIN_ICE_DESCRN, XLBEXR, XLBR, XRTMIN +USE MODD_RAIN_ICE_PARAM_n, only: XCRIAUTC USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t -use MODE_MSG -use MODE_RAIN_ICE_FAST_RG, only: RAIN_ICE_FAST_RG -use MODE_RAIN_ICE_FAST_RH, only: RAIN_ICE_FAST_RH -use MODE_RAIN_ICE_FAST_RI, only: RAIN_ICE_FAST_RI -use MODE_RAIN_ICE_FAST_RS, only: RAIN_ICE_FAST_RS -use MODE_RAIN_ICE_NUCLEATION, only: RAIN_ICE_NUCLEATION -use MODE_RAIN_ICE_SEDIMENTATION_SPLIT, only: RAIN_ICE_SEDIMENTATION_SPLIT -use MODE_RAIN_ICE_SEDIMENTATION_STAT, only: RAIN_ICE_SEDIMENTATION_STAT -use MODE_RAIN_ICE_SLOW, only: RAIN_ICE_SLOW -use MODE_RAIN_ICE_WARM, only: RAIN_ICE_WARM -use mode_tools, only: Countjv -use mode_tools_ll, only: GET_INDICE_ll +USE MODE_MSG +USE MODE_RAIN_ICE_FAST_RG, only: RAIN_ICE_FAST_RG +USE MODE_RAIN_ICE_FAST_RH, only: RAIN_ICE_FAST_RH +USE MODE_RAIN_ICE_FAST_RI, only: RAIN_ICE_FAST_RI +USE MODE_RAIN_ICE_FAST_RS, only: RAIN_ICE_FAST_RS +USE MODE_RAIN_ICE_NUCLEATION, only: RAIN_ICE_NUCLEATION +USE MODE_RAIN_ICE_SEDIMENTATION_SPLIT, only: RAIN_ICE_SEDIMENTATION_SPLIT +USE MODE_RAIN_ICE_SEDIMENTATION_STAT, only: RAIN_ICE_SEDIMENTATION_STAT +USE MODE_RAIN_ICE_SLOW, only: RAIN_ICE_SLOW +USE MODE_RAIN_ICE_WARM, only: RAIN_ICE_WARM +USE mode_tools, only: Countjv +USE mode_tools_ll, only: GET_INDICE_ll USE MODE_ICE4_RAINFR_VERT ! @@ -756,7 +756,7 @@ IF( IMICRO >= 0 ) THEN DO JL=1,IMICRO PRAINFR(I1(JL),I2(JL),I3(JL)) = ZRF(JL) END DO - CALL ICE4_RAINFR_VERT(D, RAIN_ICE_DESCR, PRAINFR, PRRT(:,:,:), & + CALL ICE4_RAINFR_VERT(D, RAIN_ICE_DESCRN, PRAINFR, PRRT(:,:,:), & RESHAPE( SOURCE = [ ( 0., JL = 1, SIZE( PRSS ) ) ], SHAPE = SHAPE( PRSS ) ), & RESHAPE( SOURCE = [ ( 0., JL = 1, SIZE( PRGS ) ) ], SHAPE = SHAPE( PRGS ) ) ) DO JL=1,IMICRO @@ -942,7 +942,7 @@ ELSE call Print_msg( NVERB_FATAL, 'GEN', 'RAIN_ICE_OLD', 'no sedimentation scheme for HSEDIM='//HSEDIM ) END IF !sedimentation of rain fraction -CALL ICE4_RAINFR_VERT(D, RAIN_ICE_DESCR, PRAINFR, PRRS(:,:,:)*PTSTEP, & +CALL ICE4_RAINFR_VERT(D, RAIN_ICE_DESCRN, PRAINFR, PRRS(:,:,:)*PTSTEP, & PRSS(:,:,:)*PTSTEP, PRGS(:,:,:)*PTSTEP) ! !------------------------------------------------------------------------------- diff --git a/src/mesonh/micro/rain_ice_sedimentation_split.f90 b/src/mesonh/micro/rain_ice_sedimentation_split.f90 index 370cc07ef9bea548c8fe2aef7dfd5aab70afffd2..0240caabe19ba979068a66eb234965edee8af32b 100644 --- a/src/mesonh/micro/rain_ice_sedimentation_split.f90 +++ b/src/mesonh/micro/rain_ice_sedimentation_split.f90 @@ -30,11 +30,11 @@ SUBROUTINE RAIN_ICE_SEDIMENTATION_SPLIT(KIB, KIE, KJB, KJE, KKB, KKE, KKTB, KKTE use modd_budget, only: lbudget_rc, lbudget_rr, lbudget_ri, lbudget_rs, lbudget_rg, lbudget_rh, & NBUDGET_RC, NBUDGET_RR, NBUDGET_RI, NBUDGET_RS, NBUDGET_RG, NBUDGET_RH, & tbudgets -use MODD_CST, only: XCPD, XP00, XRD, XRHOLW -use MODD_PARAM_ICE, only: XVDEPOSC -use MODD_RAIN_ICE_DESCR, only: XCC, XCONC_LAND, xconc_sea, xconc_urban, XDC, XCEXVT, & +USE MODD_CST, only: XCPD, XP00, XRD, XRHOLW +USE MODD_PARAM_ICE_n, only: XVDEPOSC +USE MODD_RAIN_ICE_DESCR_n, only: XCC, XCONC_LAND, xconc_sea, xconc_urban, XDC, XCEXVT, & XALPHAC, XNUC, XALPHAC2, XNUC2, XLBEXC, XRTMIN, XLBEXC, XLBC -use MODD_RAIN_ICE_PARAM, only: XEXSEDG, XEXSEDH, XEXCSEDI, XEXSEDR, XEXSEDS, & +USE MODD_RAIN_ICE_PARAM_n, only: XEXSEDG, XEXSEDH, XEXCSEDI, XEXSEDR, XEXSEDS, & XFSEDG, XFSEDH, XFSEDI, XFSEDR, XFSEDS, XFSEDC use mode_budget, only: Budget_store_init, Budget_store_end diff --git a/src/mesonh/micro/rain_ice_sedimentation_stat.f90 b/src/mesonh/micro/rain_ice_sedimentation_stat.f90 index 68eff90a2773e9ab61b3280428467a96662383ff..e25073ed075b47fcb13ab41774fec7db282e6ff0 100644 --- a/src/mesonh/micro/rain_ice_sedimentation_stat.f90 +++ b/src/mesonh/micro/rain_ice_sedimentation_stat.f90 @@ -30,11 +30,11 @@ SUBROUTINE RAIN_ICE_SEDIMENTATION_STAT( KIB, KIE, KJB, KJE, KKB, KKE, KKTB, KKTE use modd_budget, only: lbudget_rc, lbudget_rr, lbudget_ri, lbudget_rs, lbudget_rg, lbudget_rh, & NBUDGET_RC, NBUDGET_RR, NBUDGET_RI, NBUDGET_RS, NBUDGET_RG, NBUDGET_RH, & tbudgets -use MODD_CST, only: XRHOLW -use MODD_PARAM_ICE, only: LDEPOSC, XVDEPOSC -use MODD_RAIN_ICE_PARAM, only: XEXSEDG, XEXSEDH, XEXCSEDI, XEXSEDR, XEXSEDS, & +USE MODD_CST, only: XRHOLW +USE MODD_PARAM_ICE_n, only: LDEPOSC, XVDEPOSC +USE MODD_RAIN_ICE_PARAM_n, only: XEXSEDG, XEXSEDH, XEXCSEDI, XEXSEDR, XEXSEDS, & XFSEDC, XFSEDG, XFSEDH, XFSEDI, XFSEDR, XFSEDS -use MODD_RAIN_ICE_DESCR, only: XALPHAC, XALPHAC2, XCC, XCEXVT, XCONC_LAND, XCONC_SEA, XCONC_URBAN, & +USE MODD_RAIN_ICE_DESCR_n, only: XALPHAC, XALPHAC2, XCC, XCEXVT, XCONC_LAND, XCONC_SEA, XCONC_URBAN, & XDC, XLBC, XLBEXC, XNUC, XNUC2, XRTMIN use mode_budget, only: Budget_store_init, Budget_store_end diff --git a/src/mesonh/micro/rain_ice_slow.f90 b/src/mesonh/micro/rain_ice_slow.f90 index 4f590c70d81c87262cfe19e85325f1d4206b6f80..a0f241b330ce141ab91b2ba11c58d5cce3d95a3f 100644 --- a/src/mesonh/micro/rain_ice_slow.f90 +++ b/src/mesonh/micro/rain_ice_slow.f90 @@ -29,9 +29,9 @@ SUBROUTINE RAIN_ICE_SLOW(OMICRO, PINVTSTEP, PRHODREF, use modd_budget, only: lbudget_th, lbudget_rv, lbudget_rc, lbudget_rr, lbudget_ri, lbudget_rs, lbudget_rg, & NBUDGET_TH, NBUDGET_RV, NBUDGET_RC, NBUDGET_RR, NBUDGET_RI, NBUDGET_RS, NBUDGET_RG, & tbudgets -use MODD_CST, only: XALPI, XBETAI, XCI, XCPV, XGAMI, XLSTT, XMNH_HUGE_12_LOG, XP00, XRV, XTT -use MODD_RAIN_ICE_DESCR, only: XCEXVT, XLBDAS_MAX, XLBEXG, XLBEXS, XLBG, XLBS, XRTMIN, XBS -use MODD_RAIN_ICE_PARAM, only: X0DEPG, X0DEPS, X1DEPG, X1DEPS, XACRIAUTI, XALPHA3, XBCRIAUTI, XBETA3, XCOLEXIS, XCRIAUTI, & +USE MODD_CST, only: XALPI, XBETAI, XCI, XCPV, XGAMI, XLSTT, XMNH_HUGE_12_LOG, XP00, XRV, XTT +USE MODD_RAIN_ICE_DESCR_n, only: XCEXVT, XLBDAS_MAX, XLBEXG, XLBEXS, XLBG, XLBS, XRTMIN, XBS +USE MODD_RAIN_ICE_PARAM_n, only: X0DEPG, X0DEPS, X1DEPG, X1DEPS, XACRIAUTI, XALPHA3, XBCRIAUTI, XBETA3, XCOLEXIS, XCRIAUTI, & XEX0DEPG, XEX0DEPS, XEX1DEPG, XEX1DEPS, XEXIAGGS, XFIAGGS, XHON, XSCFAC, XTEXAUTI, XTIMAUTI use mode_budget, only: Budget_store_add diff --git a/src/mesonh/micro/rain_ice_warm.f90 b/src/mesonh/micro/rain_ice_warm.f90 index 133dc888b8a8c74c6ca2708e58baf37b7587fc1a..c9471dc0b6d0987a9e95c744efdc1a8584fa25e4 100644 --- a/src/mesonh/micro/rain_ice_warm.f90 +++ b/src/mesonh/micro/rain_ice_warm.f90 @@ -29,10 +29,10 @@ SUBROUTINE RAIN_ICE_WARM(OMICRO, KMICRO, K1, K2, K3, use modd_budget, only: lbudget_th, lbudget_rv, lbudget_rc, lbudget_rr, & NBUDGET_TH, NBUDGET_RV, NBUDGET_RC, NBUDGET_RR, & tbudgets -use MODD_CST, only: XALPW, XBETAW, XCL, XCPV, XGAMW, XLVTT, XMD, XMV, XRV, XTT -use MODD_PARAM_ICE, only: CSUBG_RC_RR_ACCR, CSUBG_RR_EVAP -use MODD_RAIN_ICE_DESCR, only: XCEXVT, XRTMIN -use MODD_RAIN_ICE_PARAM, only: X0EVAR, X1EVAR, XCRIAUTC, XEX0EVAR, XEX1EVAR, XEXCACCR, XFCACCR, XTIMAUTC +USE MODD_CST, only: XALPW, XBETAW, XCL, XCPV, XGAMW, XLVTT, XMD, XMV, XRV, XTT +USE MODD_PARAM_ICE_n, only: CSUBG_RC_RR_ACCR, CSUBG_RR_EVAP +USE MODD_RAIN_ICE_DESCR_n, only: XCEXVT, XRTMIN +USE MODD_RAIN_ICE_PARAM_n, only: X0EVAR, X1EVAR, XCRIAUTC, XEX0EVAR, XEX1EVAR, XEXCACCR, XFCACCR, XTIMAUTC use mode_budget, only: Budget_store_add use MODE_MSG diff --git a/src/mesonh/turb/mode_ibm_mixinglength.F90 b/src/mesonh/turb/mode_ibm_mixinglength.F90 index bc584c94082a6a3b64adb527556d6373f11e944b..608af23415bcba280ec196b3d60deda7e21367cb 100644 --- a/src/mesonh/turb/mode_ibm_mixinglength.F90 +++ b/src/mesonh/turb/mode_ibm_mixinglength.F90 @@ -54,6 +54,7 @@ SUBROUTINE IBM_MIXINGLENGTH(D,PLM,PLEPS,PMU,PHI,PTKE) USE MODD_IBM_PARAM_n USE MODD_REF_n, ONLY: XRHODJ,XRHODREF USE MODD_CTURB + USE MODD_TURB_n, ONLY: XCED USE MODD_CST USE MODD_GRID_n, ONLY: XZZ ! diff --git a/src/mesonh/turb/modn_param_mfshalln.f90 b/src/mesonh/turb/modn_param_mfshalln.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/testprogs/aux/modd_misc.F90 b/src/testprogs/aux/modd_misc.F90 new file mode 100644 index 0000000000000000000000000000000000000000..d63e327ee37ef333d369c472e1e6c4da2feb20ad --- /dev/null +++ b/src/testprogs/aux/modd_misc.F90 @@ -0,0 +1,41 @@ +MODULE MODD_MISC +! +USE MODD_BUDGET, ONLY: NBUDGET_RH, TBUDGETDATA, TBUDGETCONF_t +USE MODD_IO, ONLY: TFILEDATA +IMPLICIT NONE +! +!> @file +!! MODD_MISC - definition of a structure containing all the control parameters for the testprogs +!! +!! This is a structure specifically built for the available testprogs. +!! This would certainly be a bad idea to take this structure for an example on how to plug PHYEX +!! in a real model. +!! +!! The idea is to put here all the constants needed to call the parametrisations in order to reduce +!! the number of objects to deal with in the calling loop. +TYPE MISC_t + REAL :: PTSTEP + CHARACTER(LEN=4) :: HBUNAME + LOGICAL :: LMFCONV + INTEGER :: KRR, KRRL, KRRI, KSV + LOGICAL :: OCOMPUTE_SRC + TYPE(TBUDGETDATA), DIMENSION(NBUDGET_RH) :: YLBUDGET + INTEGER :: NBUDGET + TYPE(TBUDGETCONF_t) :: TBUCONF + LOGICAL :: ONOMIXLG + INTEGER :: KSV_LGBEG, KSV_LGEND + REAL :: PDX, PDY + INTEGER :: KMI, KSPLIT, KGRADIENTS + CHARACTER(LEN=4),DIMENSION(2) :: HLBCX, HLBCY + CHARACTER(LEN=6) :: CPROGRAM + INTEGER :: KSV_LIMA_NR, KSV_LIMA_NS, KSV_LIMA_NG, KSV_LIMA_NH + LOGICAL :: O2D, OFLAT, OCOUPLES, OBLOWSNOW, OOCEAN, ODEEPOC + LOGICAL :: OIBM, OFLYER + TYPE(TFILEDATA) :: ZTFILE + REAL :: ZCEI_MAX, ZCEI_MIN, ZCOEF_AMPL_SAT + REAL :: PRSNOW + LOGICAL :: ODIAG_IN_RUN + CHARACTER(LEN=4) :: HTURBLEN_CL + CHARACTER(LEN=4) :: CMICRO +END TYPE MISC_t +END MODULE MODD_MISC diff --git a/src/testprogs/ice_adjust/main_ice_adjust.F90 b/src/testprogs/ice_adjust/main_ice_adjust.F90 index b373caf49f589db86af8aa62198cc0cb078d1991..3b5be116571719da6d89c3a0bd1c9091eac28157 100644 --- a/src/testprogs/ice_adjust/main_ice_adjust.F90 +++ b/src/testprogs/ice_adjust/main_ice_adjust.F90 @@ -5,20 +5,12 @@ USE GETDATA_ICE_ADJUST_MOD USE COMPUTE_DIFF USE MODI_ICE_ADJUST USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t -USE MODD_CST, ONLY: CST -USE MODD_NEB, ONLY: NEB -USE MODD_TURB_n, ONLY: TURBN, TURB_GOTO_MODEL -USE MODD_RAIN_ICE_PARAM, ONLY : RAIN_ICE_PARAM_t, RAIN_ICE_PARAM_ASSOCIATE -USE MODI_INI_CST -USE MODI_INI_NEB -USE MODI_INI_RAIN_ICE -USE MODD_BUDGET !, ONLY: TBUCONF_ASSOCIATE, TBUDGETDATA, NBUDGET_RI, TBUCONF +USE MODD_PHYEX, ONLY: PHYEX_t USE STACK_MOD USE OMP_LIB USE YOMHOOK, ONLY : LHOOK, DR_HOOK USE PARKIND1, ONLY : JPRB, JPIM - IMPLICIT NONE INTEGER :: KLON @@ -65,21 +57,13 @@ INTEGER :: NPROMA, NGPBLKS, NFLEVG INTEGER :: IBL, JLON, JLEV TYPE(DIMPHYEX_t) :: D, D0 -TYPE(RAIN_ICE_PARAM_t) :: ICEP -CHARACTER(LEN=1) :: HFRAC_ICE -CHARACTER(LEN=4) :: HBUNAME -LOGICAL :: OCND2 -LOGICAL :: LHGT_QS -LOGICAL :: LMFCONV -REAL :: PTSTEP -TYPE(TBUDGETDATA), DIMENSION(NBUDGET_RI) :: YLBUDGET +TYPE(PHYEX_t) :: PHYEX LOGICAL :: LLCHECK LOGICAL :: LLCHECKDIFF LOGICAL :: LLDIFF INTEGER :: IBLOCK1, IBLOCK2 INTEGER :: ISTSZ, JBLK1, JBLK2 INTEGER :: NTID, ITID -INTEGER :: JRR REAL, ALLOCATABLE :: PSTACK(:,:) TYPE (STACK) :: YLSTACK @@ -132,55 +116,7 @@ IF (LLVERBOSE) PRINT *, " KLEV = ", KLEV, " KRR = ", KRR PRINT *, " NPROMA = ", NPROMA, " KLEV = ", KLEV, " NGPBLKS = ", NGPBLKS -CALL RAIN_ICE_PARAM_ASSOCIATE -CALL INI_CST -CALL INI_NEB -CALL TURB_GOTO_MODEL(1, 1) -TURBN%LSTATNW=.FALSE. -CALL TBUCONF_ASSOCIATE -LBU_ENABLE=.FALSE. -LBUDGET_U=.FALSE. -LBUDGET_V=.FALSE. -LBUDGET_W=.FALSE. -LBUDGET_TH=.FALSE. -LBUDGET_TKE=.FALSE. -LBUDGET_RV=.FALSE. -LBUDGET_RC=.FALSE. -LBUDGET_RR=.FALSE. -LBUDGET_RI=.FALSE. -LBUDGET_RS=.FALSE. -LBUDGET_RG=.FALSE. -LBUDGET_RH=.FALSE. -LBUDGET_SV=.FALSE. - -! Taken from ini_rain_ice.F90; we only need these for ice_adjust.F90 -ICEP%XCRIAUTI = 0.2E-4 -ICEP%XCRIAUTC = 0.5E-3 -ICEP%XACRIAUTI = 0.06 -ICEP%XBCRIAUTI = -3.5 - -! As provided by S. Riette, AROME specific - -ICEP%XCRIAUTC = 1.0000000000000000E-003 -ICEP%XCRIAUTI = 2.0000000000000001E-004 -ICEP%XACRIAUTI = 6.2974856647312144E-002 -ICEP%XBCRIAUTI = -3.3840957210994582 - - -HFRAC_ICE = 'S' -TURBN%CCONDENS = 'CB02' -TURBN%CLAMBDA3 = 'CB' -HBUNAME = 'DEPI' -TURBN%LSUBG_COND = .TRUE. -TURBN%LSIGMAS = .TRUE. -OCND2 = .FALSE. -LHGT_QS = .FALSE. -TURBN%CSUBG_MF_PDF = 'TRIANGLE' -PTSTEP = 50.000000000000000 -LMFCONV = .TRUE. -DO JRR=1, NBUDGET_RI - YLBUDGET(JRR)%NBUDGET=JRR -ENDDO +CALL INIT_PHYEX(KRR, PHYEX) D0%NIT = NPROMA D0%NIB = 1 @@ -215,7 +151,7 @@ DO ITIME = 1, NTIME TSD = OMP_GET_WTIME () !$acc data & -!$acc & copyin (D0, CST, ICEP, NEB, TURBN, KRR, HFRAC_ICE, HCONDENS, HLAMBDA3, HBUNAME, OSUBG_COND, OSIGMAS, OCND2, LHGT_QS, HSUBG_MF_PDF, PTSTEP, LMFCONV, & +!$acc & copyin (D0, PHYEX, & !$acc & ZSIGQSAT, PRHODJ, PEXNREF, PRHODREF, PSIGS, PMFCONV, PPABSM, ZZZ, PCF_MF, PRC_MF, PRI_MF, ZDUM1, ZDUM2, ZDUM3, ZDUM4, ZDUM5, ZRS, ZICE_CLD_WGT) & !$acc & copy (PRS, PTHS), & !$acc & copyout (PSRCS, PCLDFR, PHLC_HRC, PHLC_HCF, PHLI_HRI, PHLI_HCF) & @@ -269,19 +205,19 @@ JBLK2 = (NGPBLKS * (ITID+1)) / NTID YLSTACK%U = 0 #endif - CALL ICE_ADJUST (D, CST, ICEP, NEB, TURBN, TBUCONF, KRR, HFRAC_ICE, HBUNAME, & - & OCND2, LHGT_QS, PTSTEP, ZSIGQSAT (:, :, IBL), PRHODJ=PRHODJ (:, :, :, IBL), & + CALL ICE_ADJUST (D, PHYEX%CST, PHYEX%RAIN_ICE_PARAMN, PHYEX%NEBN, PHYEX%TURBN, PHYEX%PARAM_ICEN, PHYEX%MISC%TBUCONF, PHYEX%MISC%KRR, PHYEX%MISC%HBUNAME, & + & PHYEX%MISC%PTSTEP, ZSIGQSAT (:, :, IBL), PRHODJ=PRHODJ (:, :, :, IBL), & & PEXNREF=PEXNREF (:, :, :, IBL), & - & PRHODREF=PRHODREF (:, :, :, IBL), PSIGS=PSIGS (:, :, :, IBL), LMFCONV=LMFCONV, PMFCONV=PMFCONV (:, :, :, IBL), & + & PRHODREF=PRHODREF (:, :, :, IBL), PSIGS=PSIGS (:, :, :, IBL), LMFCONV=PHYEX%MISC%LMFCONV, PMFCONV=PMFCONV (:, :, :, IBL), & & PPABST=PPABSM (:, :, :, IBL), PZZ=ZZZ (:, :, :, IBL), PEXN=PEXNREF (:, :, :, IBL), PCF_MF=PCF_MF (:, :, :, IBL), & & PRC_MF=PRC_MF (:, :, :, IBL), PRI_MF=PRI_MF (:, :, :, IBL), & & PICLDFR=ZDUM1(:, :, :, IBL), PWCLDFR=ZDUM2(:, :, :, IBL), PSSIO=ZDUM3(:, :, :, IBL), & & PSSIU=ZDUM4(:, :, :, IBL), PIFR=ZDUM5(:, :, :, IBL), & & PRV=ZRS(:, :, :, 1, IBL), PRC=ZRS(:, :, :, 2, IBL), & & PRVS=PRS(:, :, :, 1, IBL), PRCS=PRS(:, :, :, 2, IBL), PTH=ZRS(:, :, :, 0, IBL), PTHS=PTHS (:, :, :, IBL), & - & OCOMPUTE_SRC=.TRUE., & + & OCOMPUTE_SRC=PHYEX%MISC%OCOMPUTE_SRC, & & PSRCS=PSRCS (:, :, :, IBL), PCLDFR=PCLDFR (:, :, :, IBL), PRR=ZRS(:, :, :, 3, IBL), PRI=ZRS(:, :, :, 4, IBL), & - & PRIS=PRS(:, :, :, 4, IBL), PRS=ZRS(:, :, :, 5, IBL), PRG=ZRS(:, :, :, 6, IBL), TBUDGETS=YLBUDGET, KBUDGETS=NBUDGET_RI, & + & PRIS=PRS(:, :, :, 4, IBL), PRS=ZRS(:, :, :, 5, IBL), PRG=ZRS(:, :, :, 6, IBL), TBUDGETS=PHYEX%MISC%YLBUDGET, KBUDGETS=PHYEX%MISC%NBUDGET, & & PICE_CLD_WGT=ZICE_CLD_WGT(:, :, IBL), & & PHLC_HRC=PHLC_HRC(:, :, :, IBL), PHLC_HCF=PHLC_HCF(:, :, :, IBL), & & PHLI_HRI=PHLI_HRI(:, :, :, IBL), PHLI_HCF=PHLI_HCF(:, :, :, IBL) & @@ -323,7 +259,6 @@ WRITE (*,'(A,F8.4,A)') ' i.e. ',1000.*(TE-TS)/(NPROMA*NGPBLKS)/NTIME,' PRINT *, " ZTD = ", ZTD, ZTD / REAL (NPROMA*NGPBLKS*NTIME) PRINT *, " ZTC = ", ZTC, ZTC / REAL (NPROMA*NGPBLKS*NTIME) - IF (LLCHECK .OR. LLSTAT .OR. LLCHECKDIFF) THEN DO IBL = IBLOCK1, IBLOCK2 PRINT *, " IBL = ", IBL @@ -346,4 +281,114 @@ ENDIF STOP -END +CONTAINS + +SUBROUTINE INIT_PHYEX(KRR, PHYEX) + +USE MODD_BUDGET, ONLY: TBUCONF_ASSOCIATE, NBUDGET_RI, TBUCONF, LBU_ENABLE, LBUDGET_U, LBUDGET_V, LBUDGET_W, LBUDGET_TH, & + LBUDGET_TKE, LBUDGET_RV, LBUDGET_RC, LBUDGET_RR, LBUDGET_RI, LBUDGET_RS, LBUDGET_RG, LBUDGET_RH, LBUDGET_SV +USE MODD_PHYEX, ONLY: PHYEX_t +USE MODI_INI_PHYEX, ONLY: INI_PHYEX + +IMPLICIT NONE + +! ----------------------------------------------------------------------- +! DUMMY VARIABLES +INTEGER, INTENT(IN) :: KRR +TYPE(PHYEX_t), INTENT(OUT) :: PHYEX + +!----------------------------------------------------------------------- +! LOCAL VARIABLES +INTEGER :: IULOUT, JRR +REAL :: ZDZMIN +CHARACTER(LEN=6) :: CPROGRAM +CHARACTER(LEN=4) :: CMICRO, CSCONV, CTURB +REAL :: PTSTEP +! ----------------------------------------------------------------------- + +IULOUT=20 +CPROGRAM='AROME' +ZDZMIN=20. +CMICRO='ICE3' +CSCONV='NONE' +CTURB='TKEL' +PTSTEP = 50.000000000000000 + +!Default values +CALL INI_PHYEX(CPROGRAM, 0, .TRUE., IULOUT, 0, 1, & + &PTSTEP, ZDZMIN, & + &CMICRO, CSCONV, CTURB, & + &LDDEFAULTVAL=.TRUE., LDREADNAM=.FALSE., LDCHECK=.FALSE., KPRINT=0, LDINIT=.FALSE., & + &PHYEX_OUT=PHYEX) + +!Control parameters +PHYEX%MISC%PTSTEP = PTSTEP +PHYEX%MISC%HBUNAME = 'DEPI' +PHYEX%MISC%LMFCONV = .TRUE. +PHYEX%MISC%KRR = KRR +PHYEX%MISC%OCOMPUTE_SRC = .TRUE. + +!Emulate the namelist reading +PHYEX%PARAM_ICEN%LCRIAUTI=.TRUE. +PHYEX%PARAM_ICEN%XCRIAUTI_NAM=0.2E-3 +PHYEX%PARAM_ICEN%XT0CRIAUTI_NAM=-5. +PHYEX%PARAM_ICEN%XCRIAUTC_NAM=0.1E-2 +PHYEX%PARAM_ICEN%LOCND2=.FALSE. +PHYEX%PARAM_ICEN%CSEDIM='STAT' +PHYEX%PARAM_ICEN%LWARM=.TRUE. +PHYEX%PARAM_ICEN%LSEDIC=.TRUE. +PHYEX%PARAM_ICEN%CSNOWRIMING='M90 ' +PHYEX%PARAM_ICEN%XFRACM90=0.1 ! Fraction used for the Murakami 1990 formulation +PHYEX%PARAM_ICEN%LCONVHG=.TRUE. ! TRUE to allow the conversion from hail to graupel +PHYEX%PARAM_ICEN%LCRFLIMIT=.TRUE. !True to limit rain contact freezing to possible heat exchange +PHYEX%PARAM_ICEN%LFEEDBACKT=.TRUE. ! When .TRUE. feed back on temperature is taken into account +PHYEX%PARAM_ICEN%LEVLIMIT=.TRUE. ! When .TRUE. water vapour pressure is limited by saturation +PHYEX%PARAM_ICEN%LNULLWETG=.TRUE. ! When .TRUE. graupel wet growth is activated with null rate (to allow water shedding) +PHYEX%PARAM_ICEN%LWETGPOST=.TRUE. ! When .TRUE. graupel wet growth is activated with positive temperature (to allow water shedding) +PHYEX%PARAM_ICEN%LNULLWETH=.TRUE. ! Same as LNULLWETG but for hail +PHYEX%PARAM_ICEN%LWETHPOST=.TRUE. ! Same as LWETGPOST but for hail +PHYEX%PARAM_ICEN%LSEDIM_AFTER=.FALSE. ! Sedimentation done after microphysics +PHYEX%PARAM_ICEN%XSPLIT_MAXCFL=0.8 +PHYEX%PARAM_ICEN%LDEPOSC=.FALSE. ! water deposition on vegetation +PHYEX%PARAM_ICEN%XVDEPOSC=0.02 ! deposition speed (2 cm.s-1) +PHYEX%PARAM_ICEN%CSUBG_RC_RR_ACCR='NONE' +PHYEX%PARAM_ICEN%CSUBG_RR_EVAP='NONE' +PHYEX%PARAM_ICEN%CSUBG_PR_PDF='SIGM' +PHYEX%NEBN%LSUBG_COND = .TRUE. +PHYEX%NEBN%LSIGMAS = .TRUE. +PHYEX%NEBN%CFRAC_ICE_ADJUST='S' ! Ice/liquid partition rule to use in adjustment +PHYEX%NEBN%CFRAC_ICE_SHALLOW_MF='S' ! Ice/liquid partition rule to use in shallow_mf + +!Param initialisation +CALL INI_PHYEX(CPROGRAM, 0, .TRUE., IULOUT, 0, 1, & + &PTSTEP, ZDZMIN, & + &CMICRO, CSCONV, CTURB, & + &LDDEFAULTVAL=.FALSE., LDREADNAM=.FALSE., LDCHECK=.TRUE., KPRINT=2, LDINIT=.TRUE., & + &PHYEX_IN=PHYEX, PHYEX_OUT=PHYEX) + +!Budgets +CALL TBUCONF_ASSOCIATE +PHYEX%MISC%NBUDGET=NBUDGET_RI +DO JRR=1, PHYEX%MISC%NBUDGET + PHYEX%MISC%YLBUDGET(JRR)%NBUDGET=JRR +ENDDO +LBU_ENABLE=.FALSE. +LBUDGET_U=.FALSE. +LBUDGET_V=.FALSE. +LBUDGET_W=.FALSE. +LBUDGET_TH=.FALSE. +LBUDGET_TKE=.FALSE. +LBUDGET_RV=.FALSE. +LBUDGET_RC=.FALSE. +LBUDGET_RR=.FALSE. +LBUDGET_RI=.FALSE. +LBUDGET_RS=.FALSE. +LBUDGET_RG=.FALSE. +LBUDGET_RH=.FALSE. +LBUDGET_SV=.FALSE. +PHYEX%MISC%TBUCONF=TBUCONF + +END SUBROUTINE INIT_PHYEX + +END PROGRAM + diff --git a/src/testprogs/rain_ice/main_rain_ice.F90 b/src/testprogs/rain_ice/main_rain_ice.F90 index 21e51992e9b8768ccf2fab1ca7054b4bab36b280..1f6cf515fca8067dc92ba02faa74fc5ba607ba23 100644 --- a/src/testprogs/rain_ice/main_rain_ice.F90 +++ b/src/testprogs/rain_ice/main_rain_ice.F90 @@ -3,21 +3,14 @@ PROGRAM MAIN_RAIN_ICE USE XRD_GETOPTIONS USE GETDATA_RAIN_ICE_MOD USE COMPUTE_DIFF -USE MODD_CONF -USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t -USE MODD_CST, ONLY: CST_t, CST -USE MODD_RAIN_ICE_DESCR, ONLY : RAIN_ICE_DESCR -USE MODD_RAIN_ICE_PARAM, ONLY : RAIN_ICE_PARAM -USE MODD_PARAM_ICE, ONLY: PARAM_ICE USE MODI_RAIN_ICE -USE MODI_INI_CST -USE MODD_BUDGET!, ONLY: TBUCONF_ASSOCIATE, TBUDGETDATA, NBUDGET_RH, TBUCONF +USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t +USE MODD_PHYEX, ONLY: PHYEX_t USE STACK_MOD USE OMP_LIB USE YOMHOOK, ONLY : LHOOK, DR_HOOK USE PARKIND1, ONLY : JPRB, JPIM - IMPLICIT NONE INTEGER :: KLON @@ -57,16 +50,7 @@ INTEGER :: NPROMA, NGPBLKS, NFLEVG INTEGER :: IBL, JLON, JLEV TYPE(DIMPHYEX_t) :: D, D0 -CHARACTER (LEN=4) :: CSUBG_AUCV_RC -CHARACTER (LEN=80) :: CSUBG_AUCV_RI -CHARACTER (LEN=4) :: CSEDIM -CHARACTER (LEN=4) :: CMICRO -REAL :: PTSTEP -LOGICAL :: OWARM -LOGICAL :: OCND2 -LOGICAL :: LCRIAUTI -REAL :: ZCRIAUTI, ZT0CRIAUTI, ZCRIAUTC -TYPE(TBUDGETDATA), DIMENSION(NBUDGET_RH) :: YLBUDGET +TYPE(PHYEX_t) :: PHYEX LOGICAL :: LLCHECK LOGICAL :: LLCHECKDIFF LOGICAL :: LLDIFF @@ -75,8 +59,6 @@ INTEGER :: ISTSZ, JBLK1, JBLK2 INTEGER :: NTID, ITID INTEGER :: JRR - -INTEGER :: IPROMA REAL, ALLOCATABLE :: PSTACK(:,:) TYPE (STACK) :: YLSTACK @@ -129,29 +111,7 @@ IF (LLVERBOSE) PRINT *, " KLEV = ", KLEV, " KRR = ", KRR PRINT *, " NPROMA = ", NPROMA, " KLEV = ", KLEV, " NGPBLKS = ", NGPBLKS -CMICRO='ICE3' - -PTSTEP = 25.0000000000000 -KRR = 6 -OCND2 = .FALSE. -CSEDIM = 'STAT' -CSUBG_AUCV_RC = 'PDF' -CSUBG_AUCV_RI = 'NONE' -OWARM = .TRUE. - -LCRIAUTI=.TRUE. -ZCRIAUTI=0.2E-3 -ZT0CRIAUTI=-5. -ZCRIAUTC=0.1E-2 - -CALL INIT_PHYEX (20, OWARM, CMICRO, CSEDIM, & - & LCRIAUTI, ZCRIAUTI, ZT0CRIAUTI, ZCRIAUTC) - -PARAM_ICE%LSEDIC = .TRUE. - -DO JRR=1, NBUDGET_RH - YLBUDGET(JRR)%NBUDGET=JRR -ENDDO +CALL INIT_PHYEX(KRR, PHYEX) D0%NIT = NPROMA D0%NIB = 1 @@ -186,7 +146,7 @@ DO ITIME = 1, NTIME TSD = OMP_GET_WTIME () !directives pas a jour !$acc data & -!directives pas a jour !$acc & copyin (D0, CST, ICEP, NEB, KRR, HFRAC_ICE, HCONDENS, HLAMBDA3, HBUNAME, OSUBG_COND, OSIGMAS, OCND2, HSUBG_MF_PDF, PTSTEP, LMFCONV, & +!directives pas a jour !$acc & copyin (D0, PHYEX, OSIGMAS, & !directives pas a jour !$acc & ZSIGQSAT, PRHODJ, PEXNREF, PRHODREF, PSIGS, PMFCONV, PPABSM, ZZZ, PCF_MF, PRC_MF, PRI_MF, ZRS, ZICE_CLD_WGT) & !directives pas a jour !$acc & copy (PRS, PTHS), & !directives pas a jour !$acc & copyout (PSRCS, PCLDFR, PHLC_HRC, PHLC_HCF, PHLI_HRI, PHLI_HCF) & @@ -195,7 +155,7 @@ DO ITIME = 1, NTIME TSC = OMP_GET_WTIME () #ifdef USE_OPENMP -!$OMP PARALLEL PRIVATE (D, ITID, JBLK1, JBLK2, IPROMA, ISIZE) +!$OMP PARALLEL PRIVATE (D, ITID, JBLK1, JBLK2, ISIZE) #endif #ifdef _OPENACC @@ -240,14 +200,10 @@ JBLK2 = (NGPBLKS * (ITID+1)) / NTID YLSTACK%U = 0 #endif -IPROMA=COUNT(LLMICRO(D%NIB:D%NIE,D%NJB:D%NJE,D%NKTB:D%NKTE,IBL)) -CALL RAIN_ICE (D, CST, PARAM_ICE, RAIN_ICE_PARAM, & - & RAIN_ICE_DESCR, TBUCONF, & - & IPROMA, & - & OCND2=OCND2, & - & HSUBG_AUCV_RC=CSUBG_AUCV_RC, HSUBG_AUCV_RI=CSUBG_AUCV_RI,& - & PTSTEP=2*PTSTEP, & - & KRR=KRR, PEXN=PEXNREF(:,:,:,IBL), & +CALL RAIN_ICE (D, PHYEX%CST, PHYEX%PARAM_ICEN, PHYEX%RAIN_ICE_PARAMN, & + & PHYEX%RAIN_ICE_DESCRN, PHYEX%MISC%TBUCONF, & + & PTSTEP=PHYEX%MISC%PTSTEP, & + & KRR=PHYEX%MISC%KRR, PEXN=PEXNREF(:,:,:,IBL), & & PDZZ=PDZZ(:,:,:,IBL), PRHODJ=PRHODJ(:,:,:,IBL), PRHODREF=PRHODREF(:,:,:,IBL),PEXNREF=PEXNREF2(:,:,:,IBL),& & PPABST=PPABSM(:,:,:,IBL), PCIT=PCIT(:,:,:,IBL), PCLDFR=PCLDFR(:,:,:,IBL), & & PHLC_HRC=PHLC_HRC(:,:,:,IBL), PHLC_HCF=PHLC_HCF(:,:,:,IBL), & @@ -262,7 +218,7 @@ CALL RAIN_ICE (D, CST, PARAM_ICE, RAIN_ICE_PARAM, & & PINPRC=ZINPRC(:,:,IBL),PINPRR=PINPRR(:,:,IBL),PEVAP3D=PEVAP(:,:,:,IBL),& & PINPRS=PINPRS(:,:,IBL), PINPRG=PINPRG(:,:,IBL), PINDEP=ZINDEP(:,:,IBL), PRAINFR=ZRAINFR(:,:,:,IBL), & & PSIGS=PSIGS(:,:,:,IBL), & - & TBUDGETS=YLBUDGET, KBUDGETS=SIZE(YLBUDGET), & + & TBUDGETS=PHYEX%MISC%YLBUDGET, KBUDGETS=PHYEX%MISC%NBUDGET, & & PSEA=PSEA, PTOWN=PTOWN, PFPR=PFPR(:,:,:,:,IBL)) #ifdef _OPENACC @@ -298,7 +254,6 @@ WRITE (*,'(A,F8.4,A)') ' i.e. ',1000.*(TE-TS)/(NPROMA*NGPBLKS)/NTIME,' PRINT *, " ZTD = ", ZTD, ZTD / REAL (NPROMA*NGPBLKS*NTIME) PRINT *, " ZTC = ", ZTC, ZTC / REAL (NPROMA*NGPBLKS*NTIME) - IF (LLCHECK .OR. LLSTAT .OR. LLCHECKDIFF) THEN DO IBL = IBLOCK1, IBLOCK2 PRINT *, " IBL = ", IBL @@ -333,36 +288,88 @@ STOP CONTAINS -SUBROUTINE INIT_PHYEX(KULOUT,LDWARM,CMICRO,CCSEDIM,LDCRIAUTI,& - PCRIAUTI,PT0CRIAUTI,PCRIAUTC) - -USE MODD_RAIN_ICE_DESCR -USE MODD_RAIN_ICE_PARAM -USE MODD_PARAM_ICE -USE MODD_TURB_N, ONLY: TURB_GOTO_MODEL, CSUBG_MF_PDF +SUBROUTINE INIT_PHYEX(KRR, PHYEX) -USE MODI_INI_RAIN_ICE +USE MODD_BUDGET, ONLY: TBUCONF_ASSOCIATE, NBUDGET_RH, TBUCONF, LBU_ENABLE, LBUDGET_U, LBUDGET_V, LBUDGET_W, LBUDGET_TH, & + LBUDGET_TKE, LBUDGET_RV, LBUDGET_RC, LBUDGET_RR, LBUDGET_RI, LBUDGET_RS, LBUDGET_RG, LBUDGET_RH, LBUDGET_SV +USE MODD_PHYEX, ONLY: PHYEX_t +USE MODI_INI_PHYEX, ONLY: INI_PHYEX IMPLICIT NONE + ! ----------------------------------------------------------------------- -! DUMMY INTEGER SCALARS -INTEGER, INTENT (IN) :: KULOUT -LOGICAL, INTENT (IN) :: LDWARM -CHARACTER(4), INTENT (IN) :: CMICRO -CHARACTER(4), INTENT (IN) :: CCSEDIM -LOGICAL, INTENT (IN) :: LDCRIAUTI -REAL, INTENT (IN) :: PCRIAUTI -REAL, INTENT (IN) :: PT0CRIAUTI -REAL, INTENT (IN) :: PCRIAUTC +! DUMMY VARIABLES +INTEGER, INTENT(IN) :: KRR +TYPE(PHYEX_t), INTENT(OUT) :: PHYEX + !----------------------------------------------------------------------- ! LOCAL VARIABLES -REAL :: ZCRI0, ZTCRI0 +INTEGER :: IULOUT, JRR +REAL :: ZDZMIN +CHARACTER(LEN=6) :: CPROGRAM +CHARACTER(LEN=4) :: CMICRO, CSCONV, CTURB +REAL :: PTSTEP ! ----------------------------------------------------------------------- -CALL INI_CST -CALL TURB_GOTO_MODEL(1,1) -CALL PARAM_ICE_ASSOCIATE +IULOUT=20 +CPROGRAM='AROME' +ZDZMIN=20. +CMICRO='ICE3' +CSCONV='NONE' +CTURB='TKEL' +PTSTEP = 25.0000000000000 + +!Default values +CALL INI_PHYEX(CPROGRAM, 0, .TRUE., IULOUT, 0, 1, & + &PTSTEP, ZDZMIN, & + &CMICRO, CSCONV, CTURB, & + &LDDEFAULTVAL=.TRUE., LDREADNAM=.FALSE., LDCHECK=.FALSE., KPRINT=0, LDINIT=.FALSE., & + &PHYEX_OUT=PHYEX) + +!Control parameters +PHYEX%MISC%PTSTEP = 2*PTSTEP +PHYEX%MISC%KRR = KRR + +!Emulate the namelist reading +PHYEX%PARAM_ICEN%LCRIAUTI=.TRUE. +PHYEX%PARAM_ICEN%XCRIAUTI_NAM=0.2E-3 +PHYEX%PARAM_ICEN%XT0CRIAUTI_NAM=-5. +PHYEX%PARAM_ICEN%XCRIAUTC_NAM=0.1E-2 +PHYEX%PARAM_ICEN%LOCND2=.FALSE. +PHYEX%PARAM_ICEN%CSEDIM='STAT' +PHYEX%PARAM_ICEN%LWARM=.TRUE. +PHYEX%PARAM_ICEN%LSEDIC=.TRUE. +PHYEX%PARAM_ICEN%CSNOWRIMING='M90 ' +PHYEX%PARAM_ICEN%XFRACM90=0.1 ! Fraction used for the Murakami 1990 formulation +PHYEX%PARAM_ICEN%LCONVHG=.TRUE. ! TRUE to allow the conversion from hail to graupel +PHYEX%PARAM_ICEN%LCRFLIMIT=.TRUE. !True to limit rain contact freezing to possible heat exchange +PHYEX%PARAM_ICEN%LFEEDBACKT=.TRUE. ! When .TRUE. feed back on temperature is taken into account +PHYEX%PARAM_ICEN%LEVLIMIT=.TRUE. ! When .TRUE. water vapour pressure is limited by saturation +PHYEX%PARAM_ICEN%LNULLWETG=.TRUE. ! When .TRUE. graupel wet growth is activated with null rate (to allow water shedding) +PHYEX%PARAM_ICEN%LWETGPOST=.TRUE. ! When .TRUE. graupel wet growth is activated with positive temperature (to allow water shedding) +PHYEX%PARAM_ICEN%LNULLWETH=.TRUE. ! Same as LNULLWETG but for hail +PHYEX%PARAM_ICEN%LWETHPOST=.TRUE. ! Same as LWETGPOST but for hail +PHYEX%PARAM_ICEN%LSEDIM_AFTER=.FALSE. ! Sedimentation done after microphysics +PHYEX%PARAM_ICEN%XSPLIT_MAXCFL=0.8 +PHYEX%PARAM_ICEN%LDEPOSC=.FALSE. ! water deposition on vegetation +PHYEX%PARAM_ICEN%XVDEPOSC=0.02 ! deposition speed (2 cm.s-1) +PHYEX%PARAM_ICEN%CSUBG_RC_RR_ACCR='NONE' +PHYEX%PARAM_ICEN%CSUBG_RR_EVAP='NONE' +PHYEX%PARAM_ICEN%CSUBG_PR_PDF='SIGM' + +!Param initialisation +CALL INI_PHYEX(CPROGRAM, 0, .TRUE., IULOUT, 0, 1, & + &PTSTEP, ZDZMIN, & + &CMICRO, CSCONV, CTURB, & + &LDDEFAULTVAL=.FALSE., LDREADNAM=.FALSE., LDCHECK=.TRUE., KPRINT=2, LDINIT=.TRUE., & + &PHYEX_IN=PHYEX, PHYEX_OUT=PHYEX) + +!Budgets CALL TBUCONF_ASSOCIATE +PHYEX%MISC%NBUDGET=NBUDGET_RH +DO JRR=1, PHYEX%MISC%NBUDGET + PHYEX%MISC%YLBUDGET(JRR)%NBUDGET=JRR +ENDDO LBU_ENABLE=.FALSE. LBUDGET_U=.FALSE. LBUDGET_V=.FALSE. @@ -377,58 +384,7 @@ LBUDGET_RS=.FALSE. LBUDGET_RG=.FALSE. LBUDGET_RH=.FALSE. LBUDGET_SV=.FALSE. - -! 1. Set implicit default values for MODD_PARAM_ICE -LWARM=LDWARM -CPRISTINE_ICE='PLAT' -CSEDIM=CCSEDIM -CSUBG_AUCV_RC='PDF' -CSUBG_AUCV_RI='NONE' -CSUBG_RC_RR_ACCR='NONE' -CSUBG_RR_EVAP='NONE' -CSUBG_PR_PDF='SIGM' -CSUBG_MF_PDF='TRIANGLE' -! Snow riming -CSNOWRIMING='M90 ' -XFRACM90=0.1 ! Fraction used for the Murakami 1990 formulation -! -LFEEDBACKT=.TRUE. ! When .TRUE. feed back on temperature is taken into account -LEVLIMIT=.TRUE. ! When .TRUE. water vapour pressure is limited by saturation -LNULLWETG=.TRUE. ! When .TRUE. graupel wet growth is activated with null rate (to allow water shedding) -LWETGPOST=.TRUE. ! When .TRUE. graupel wet growth is activated with positive temperature (to allow water shedding) -LNULLWETH=.TRUE. ! Same as LNULLWETG but for hail -LWETHPOST=.TRUE. ! Same as LWETGPOST but for hail -LCONVHG=.TRUE. ! TRUE to allow the conversion from hail to graupel -LCRFLIMIT=.TRUE. !True to limit rain contact freezing to possible heat exchange -CFRAC_ICE_ADJUST='S' ! Ice/liquid partition rule to use in adjustment -CFRAC_ICE_SHALLOW_MF='S' ! Ice/liquid partition rule to use in shallow_mf -LSEDIM_AFTER=.FALSE. ! Sedimentation done after microphysics -XSPLIT_MAXCFL=0.8 -LDEPOSC=.FALSE. ! water deposition on vegetation -XVDEPOSC=0.02 ! deposition speed (2 cm.s-1) -LPACK_INTERP=.TRUE. -LPACK_MICRO=.TRUE. -! -! 2. Set implicit default values for MODD_RAIN_ICE_DESCR -! et MODD_RAIN_ICE_PARAM -! -CALL INI_RAIN_ICE (KULOUT, CMICRO) -!update values from namparar -IF (LDCRIAUTI) THEN - - XCRIAUTI=PCRIAUTI - XCRIAUTC=PCRIAUTC - XT0CRIAUTI=PT0CRIAUTI - !second point to determine 10**(aT+b) law - ZTCRI0=-40.0 - ZCRI0=1.25E-6 - - XBCRIAUTI=-( LOG10(XCRIAUTI) - LOG10(ZCRI0)*PT0CRIAUTI/ZTCRI0 )& - *ZTCRI0/(XT0CRIAUTI-ZTCRI0) - XACRIAUTI=(LOG10(ZCRI0)-XBCRIAUTI)/ZTCRI0 - -ENDIF -! ----------------------------------------------------------------------- +PHYEX%MISC%TBUCONF=TBUCONF END SUBROUTINE INIT_PHYEX diff --git a/src/testprogs/rain_ice_old/getdata_rain_ice_old_mod.F90 b/src/testprogs/rain_ice_old/getdata_rain_ice_old_mod.F90 index 246b1f70022e9da3d120c54c070d806501f878b8..fb21d3bcc6200a72a0cb36713f2022e604a95f2d 100644 --- a/src/testprogs/rain_ice_old/getdata_rain_ice_old_mod.F90 +++ b/src/testprogs/rain_ice_old/getdata_rain_ice_old_mod.F90 @@ -1,7 +1,7 @@ MODULE GETDATA_RAIN_ICE_OLD_MOD USE OMP_LIB -USE MODD_RAIN_ICE_PARAM, ONLY : RAIN_ICE_PARAM +USE MODD_RAIN_ICE_PARAM_n, ONLY : RAIN_ICE_PARAMN USE ISO_FORTRAN_ENV, ONLY: OUTPUT_UNIT diff --git a/src/testprogs/rain_ice_old/main_rain_ice_old.F90 b/src/testprogs/rain_ice_old/main_rain_ice_old.F90 index 983d08f837136c34f4431dffb7d7c7332aa2791b..f202b25ea2c18e6e6dc4185af9b4b980b5da6125 100644 --- a/src/testprogs/rain_ice_old/main_rain_ice_old.F90 +++ b/src/testprogs/rain_ice_old/main_rain_ice_old.F90 @@ -10,9 +10,9 @@ program main_rain_ice_old use modd_dimphyex, only: dimphyex_t use modd_cst, only: cst - use modd_rain_ice_param, only: rain_ice_param - use modd_rain_ice_descr, only: rain_ice_descr - use modd_param_ice, only: param_ice + use modd_rain_ice_param_n, only: rain_ice_paramn + use modd_rain_ice_descr_n, only: rain_ice_descrn + use modd_param_ice_n, only: param_icen use modd_budget use iso_fortran_env, only: output_unit @@ -100,8 +100,8 @@ program main_rain_ice_old subroutine init_gmicro(D, krr, n_gp_blocks, odmicro, prt, pssio, ocnd2, prht) use modd_dimphyex, only: dimphyex_t - use modd_rain_ice_descr, only: xrtmin - use modd_rain_ice_param, only: xfrmin + use modd_rain_ice_descr_n, only: xrtmin + use modd_rain_ice_param_n, only: xfrmin implicit none @@ -241,8 +241,8 @@ ENDDO if (isize .gt. 0) then - call rain_ice_old(D=D, cst=cst, parami=param_ice, & - icep=rain_ice_param, iced=rain_ice_descr, buconf=tbuconf, & + call rain_ice_old(D=D, cst=cst, parami=param_icen, & + icep=rain_ice_paramn, iced=rain_ice_descrn, buconf=tbuconf, & osedic=osedic, ocnd2=ocnd2, & lkogan=lkogan, lmodicedep=lmodicedep, & hsedim=c_sedim, hsubg_aucv_rc=csubg_aucv_rc, owarm=owarm, & @@ -358,13 +358,16 @@ end program subroutine init_rain_ice_old(kulout) - use modd_rain_ice_param, only: rain_ice_param_associate - use modd_rain_ice_descr, only: rain_ice_descr_associate - use modd_param_ice + use modd_param_ice_n, only: param_ice_goto_model + use modd_rain_ice_param_n, only: rain_ice_param_goto_model + use modd_rain_ice_descr_n, only: rain_ice_descr_goto_model + use modd_cloudpar_n, only: cloudpar_goto_model + use modd_param_ice_n - use modi_ini_rain_ice + use mode_ini_rain_ice - use modi_ini_cst + use mode_ini_cst + use mode_ini_tiwmx use modd_budget use modd_les, only: tles @@ -375,12 +378,19 @@ subroutine init_rain_ice_old(kulout) integer, intent (in) :: kulout character(len=4) :: c_micro + integer :: isplitr call ini_cst call ini_tiwmx - call param_ice_associate + call cloudpar_goto_model(1, 1) + call param_ice_goto_model(1, 1) + call rain_ice_descr_goto_model(1, 1) + call rain_ice_param_goto_model(1, 1) + + call param_icen_init('AROME', 0, .false., kulout, & + &.true., .false., .false., 0) call tbuconf_associate @@ -409,7 +419,7 @@ subroutine init_rain_ice_old(kulout) ! 2. set implicit default values for modd_rain_ice_descr and modd_rain_ice_param - call ini_rain_ice(kulout, c_micro) + call ini_rain_ice(kulout, 50., 20., isplitr, c_micro) end subroutine init_rain_ice_old @@ -417,8 +427,8 @@ end subroutine init_rain_ice_old subroutine init_gmicro(D, krr, n_gp_blocks, odmicro, prt, pssio, ocnd2, prht) use modd_dimphyex, only: dimphyex_t - use modd_rain_ice_descr, only: xrtmin - use modd_rain_ice_param, only: xfrmin + use modd_rain_ice_descr_n, only: xrtmin + use modd_rain_ice_param_n, only: xfrmin use iso_fortran_env, only: output_unit implicit none diff --git a/src/testprogs/shallow/main_shallow.F90 b/src/testprogs/shallow/main_shallow.F90 index 21a7dea9bfd95ecbbb714ca12a83205785adbebc..a94f4452dbb281f85c5f1b7ac9843703446d2169 100644 --- a/src/testprogs/shallow/main_shallow.F90 +++ b/src/testprogs/shallow/main_shallow.F90 @@ -3,21 +3,14 @@ PROGRAM MAIN_SHALLOW USE XRD_GETOPTIONS USE GETDATA_SHALLOW_MOD USE COMPUTE_DIFF -USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t -USE MODD_CST, ONLY: CST -USE MODD_NEB, ONLY: NEB -USE MODD_PARAM_MFSHALL_n, ONLY: PARAM_MFSHALLN, PARAM_MFSHALL_GOTO_MODEL -USE MODD_CTURB -USE MODD_TURB_n, ONLY: TURBN USE MODI_SHALLOW_MF -USE MODI_INI_CST -USE MODI_INI_NEB +USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t +USE MODD_PHYEX, ONLY: PHYEX_t USE STACK_MOD USE OMP_LIB USE YOMHOOK, ONLY : LHOOK, DR_HOOK USE PARKIND1, ONLY : JPRB, JPIM - IMPLICIT NONE INTEGER :: KLON @@ -110,12 +103,7 @@ INTEGER :: NPROMA, NGPBLKS, NFLEVG INTEGER :: IBL, JLON, JLEV TYPE(DIMPHYEX_t) :: D, D0 -CHARACTER (LEN=4) :: HMF_CLOUD, HMF_UPDRAFT -CHARACTER (LEN=1) :: HFRAC_ICE -LOGICAL :: OMIXUV, ONOMIXLG, OSTATNW -REAL :: ZIMPL -INTEGER :: KSV_LGBEG, KSV_LGEND -REAL :: PTSTEP +TYPE(PHYEX_t) :: PHYEX LOGICAL :: LLCHECK LOGICAL :: LLCHECKDIFF LOGICAL :: LLDIFF @@ -123,7 +111,6 @@ INTEGER :: IBLOCK1, IBLOCK2 INTEGER :: ISTSZ, JBLK1, JBLK2 INTEGER :: NTID, ITID - REAL, ALLOCATABLE :: PSTACK(:,:) TYPE (STACK) :: YLSTACK @@ -194,19 +181,7 @@ IF (LLVERBOSE) PRINT *, " KLEV = ", KLEV, " KRR = ", KRR PRINT *, " NPROMA = ", NPROMA, " KLEV = ", KLEV, " NGPBLKS = ", NGPBLKS -KSV_LGBEG = 0 -KSV_LGEND = 0 -HMF_CLOUD='DIRE' -HMF_UPDRAFT='EDKF' -HFRAC_ICE='S' -OMIXUV=.TRUE. -ONOMIXLG=.FALSE. -ZIMPL=1. -OSTATNW=.FALSE. -! -PTSTEP = 25.0000000000000 - -CALL INIT_PHYEX () +CALL INIT_PHYEX(KRR, KRRL, KRRI, KSV, PHYEX) D0%NIT = NPROMA D0%NIB = 1 @@ -245,7 +220,7 @@ DO ITIME = 1, NTIME TSD = OMP_GET_WTIME () !!! !directives pas a jour !$acc data & -!!! !directives pas a jour !$acc & copyin (D0, CST, ICEP, NEB, KRR, HFRAC_ICE, HCONDENS, HLAMBDA3, HBUNAME, OSUBG_COND, OSIGMAS, OCND2, HSUBG_MF_PDF, PTSTEP, LMFCONV, & +!!! !directives pas a jour !$acc & copyin (D0, CST, ICEP, NEBN, KRR, HCONDENS, HLAMBDA3, HBUNAME, OSIGMAS, OCND2, PTSTEP, LMFCONV, & !!! !directives pas a jour !$acc & ZSIGQSAT, PTHM, PEXNREF, PRHODREF, PSIGS, PMFCONV, PPABSM, ZZZ, PCF_MF, PRC_MF, PRI_MF, ZRS, ZICE_CLD_WGT) & !!! !directives pas a jour !$acc & copy (PRS, PTHS), & !!! !directives pas a jour !$acc & copyout (PSRCS, PCLDFR, PHLC_HRC, PHLC_HCF, PHLI_HRI, PHLI_HCF) & @@ -301,10 +276,10 @@ JBLK2 = (NGPBLKS * (ITID+1)) / NTID YLSTACK%U = 0 #endif - CALL SHALLOW_MF(D, CST, NEB, PARAM_MFSHALLN, TURBN, CSTURB, & - &KRR=KRR, KRRL=KRRL, KRRI=KRRI, KSV=KSV, & - &HFRAC_ICE=HFRAC_ICE,ONOMIXLG=ONOMIXLG,KSV_LGBEG=KSV_LGBEG,KSV_LGEND=KSV_LGEND, & - &PIMPL_MF=ZIMPL, PTSTEP=PTSTEP, & + CALL SHALLOW_MF(D, PHYEX%CST, PHYEX%NEBN, PHYEX%PARAM_MFSHALLN, PHYEX%TURBN, PHYEX%CSTURB, & + &KRR=PHYEX%MISC%KRR, KRRL=PHYEX%MISC%KRRL, KRRI=PHYEX%MISC%KRRI, KSV=PHYEX%MISC%KSV, & + &ONOMIXLG=PHYEX%MISC%ONOMIXLG,KSV_LGBEG=PHYEX%MISC%KSV_LGBEG,KSV_LGEND=PHYEX%MISC%KSV_LGEND, & + &PTSTEP=PHYEX%MISC%PTSTEP, & &PDZZ=PDZZF(:,:,:,IBL),PZZ=PZZ(:,:,:,IBL), & &PRHODJ=PRHODJ(:,:,:,IBL),PRHODREF=PRHODREF(:,:,:,IBL), & &PPABSM=PPABSM(:,:,:,IBL),PEXNM=PEXNM(:,:,:,IBL), & @@ -320,7 +295,7 @@ JBLK2 = (NGPBLKS * (ITID+1)) / NTID &PRC_UP=PRC_UP(:,:,:,IBL),PRI_UP=PRI_UP(:,:,:,IBL), & &PU_UP=PU_UP(:,:,:,IBL), PV_UP=PV_UP(:,:,:,IBL), PTHV_UP=PTHV_UP(:,:,:,IBL), PW_UP=PW_UP(:,:,:,IBL), & &PFRAC_UP=PFRAC_UP(:,:,:,IBL),PEMF=PEMF(:,:,:,IBL),PDETR=ZDETR(:,:,:,IBL),PENTR=ZENTR(:,:,:,IBL), & - &KKLCL=IKLCL(:,:,IBL),KKETL=IKETL(:,:,IBL),KKCTL=IKCTL(:,:,IBL),PDX=0.,PDY=0.,KBUDGETS=0 ) + &KKLCL=IKLCL(:,:,IBL),KKETL=IKETL(:,:,IBL),KKCTL=IKCTL(:,:,IBL),PDX=PHYEX%MISC%PDX,PDY=PHYEX%MISC%PDY,KBUDGETS=PHYEX%MISC%NBUDGET ) #ifdef _OPENACC ENDDO @@ -402,110 +377,87 @@ STOP CONTAINS -SUBROUTINE INIT_PHYEX() -USE MODD_TURB_N, ONLY: TURB_GOTO_MODEL +SUBROUTINE INIT_PHYEX(KRR, KRRL, KRRI, KSV, PHYEX) + +USE MODD_BUDGET, ONLY: TBUCONF_ASSOCIATE, NBUDGET_RI, TBUCONF, LBU_ENABLE, LBUDGET_U, LBUDGET_V, LBUDGET_W, LBUDGET_TH, & + LBUDGET_TKE, LBUDGET_RV, LBUDGET_RC, LBUDGET_RR, LBUDGET_RI, LBUDGET_RS, LBUDGET_RG, LBUDGET_RH, LBUDGET_SV +USE MODD_PHYEX, ONLY: PHYEX_t +USE MODI_INI_PHYEX, ONLY: INI_PHYEX + IMPLICIT NONE -! -CALL INI_CST -CALL INI_NEB -CALL TURB_GOTO_MODEL(1,1) -CALL CTURB_ASSOCIATE() -!CALL TBUCONF_ASSOCIATE -CALL PARAM_MFSHALL_GOTO_MODEL(1,1) -!LBU_ENABLE=.FALSE. -!LBUDGET_U=.FALSE. -!LBUDGET_V=.FALSE. -!LBUDGET_W=.FALSE. -!LBUDGET_TH=.FALSE. -!LBUDGET_TKE=.FALSE. -!LBUDGET_RV=.FALSE. -!LBUDGET_RC=.FALSE. -!LBUDGET_RR=.FALSE. -!LBUDGET_RI=.FALSE. -!LBUDGET_RS=.FALSE. -!LBUDGET_RG=.FALSE. -!LBUDGET_RH=.FALSE. -!LBUDGET_SV=.FALSE. - -PARAM_MFSHALLN%XALP_PERT = 0.3 -PARAM_MFSHALLN%XABUO = 1. -PARAM_MFSHALLN%XBENTR = 1. -PARAM_MFSHALLN%XBDETR = 0. -PARAM_MFSHALLN%XCMF = 0.065 -PARAM_MFSHALLN%XENTR_MF = 0.035 -PARAM_MFSHALLN%XCRAD_MF = 50. -PARAM_MFSHALLN%XENTR_DRY = 0.55 -PARAM_MFSHALLN%XDETR_DRY = 10. -PARAM_MFSHALLN%XDETR_LUP = 1. -PARAM_MFSHALLN%XKCF_MF = 2.75 -PARAM_MFSHALLN%XKRC_MF = 1. -PARAM_MFSHALLN%XTAUSIGMF = 600. -PARAM_MFSHALLN%XPRES_UV = 0.5 -PARAM_MFSHALLN%XFRAC_UP_MAX= 0.33 -PARAM_MFSHALLN%XALPHA_MF = 2. -PARAM_MFSHALLN%XSIGMA_MF = 20. -PARAM_MFSHALLN%XA1 = 2. -PARAM_MFSHALLN%XB = 0.002 -PARAM_MFSHALLN%XC = 0.012 -PARAM_MFSHALLN%XBETA1 = 0.9 -PARAM_MFSHALLN%XR = 2. -PARAM_MFSHALLN%XLAMBDA_MF = 0. -PARAM_MFSHALLN%LGZ = .FALSE. -PARAM_MFSHALLN%XGZ=1. -PARAM_MFSHALLN%CMF_UPDRAFT=HMF_UPDRAFT -PARAM_MFSHALLN%CMF_CLOUD=HMF_CLOUD -PARAM_MFSHALLN%LMIXUV=OMIXUV -TURBN%LHARAT=.FALSE. -TURBN%CTURBDIM = '1DIM' -TURBN%XIMPL=1. -TURBN%CTURBLEN='BL89' -TURBN%LSTATNW=.FALSE. -TURBN%LTURB_DIAG=.FALSE. -TURBN%LTURB_FLX=.FALSE. -TURBN%LSUBG_COND=.TRUE. -TURBN%LRMC01=.FALSE. -TURBN%CTOM='NONE' -TURBN%LLEONARD=.FALSE. - -XCED = 0.85 -XCEP = 2.11 -XA0 = 0.6 -XA2 = 1. -XA3 = 0. -XCTD = 1.2 -IF (TURBN%LSTATNW) THEN - XCTP = 4.0 - ELSE - XCTP = 4.65 -ENDIF -XA5 = 1./3. -XCET = 0.40 -XALPSBL = 4.63 -XRM17 = 0.5 ! Rodier et al 2017 -XCMFS= 2./3./XCEP*(1.-XA0) !Constant for the momentum flux due to shear (RS) -XCSHF= 2./3./XCTP !Constant for the sensible heat flux(RS) -XCHF= XCSHF !Constant for the humidity flux(RS) -XCTV= 2./3./XCTP/XCTD !Constant for the temperature variance(RS) -XCHV= XCTV !Constant for the humidity variance(RS) -XCHT1= XCTV/2. !Constants for the temperature-humidity correlation(RS) -XCHT2= XCTV/2. -XCPR1= XCTV !Constants for the turbulent Prandtl and Schmidt numbers -XCPR2= XCHT1 -XCPR3= XCPR2 ! used only for the Schmidt number for scalar variables -XCPR4= XCPR2 -XCPR5= XCPR2 -XTKEMIN=1.E-6 -!XLINI=10. ! BL mixing length -XLINI=0.1 ! BL mixing length -XLINF=1.E-10! to prevent division by zero -XPHI_LIM = 3. -XCDP = 1.46 -XCDD = 1.83 -XCDT = 0.42 -XSBL_O_BL = 0.05 ! SBL height / BL height ratio -XFTOP_O_FSURF = 0.05 ! Fraction of surface (heat or momentum) flux used to define top of BL - -! + +! ----------------------------------------------------------------------- +! DUMMY VARIABLES +INTEGER, INTENT(IN) :: KRR, KRRL, KRRI, KSV +TYPE(PHYEX_t), INTENT(OUT) :: PHYEX + +!----------------------------------------------------------------------- +! LOCAL VARIABLES +INTEGER :: IULOUT, JRR +REAL :: ZDZMIN +CHARACTER(LEN=6) :: CPROGRAM +CHARACTER(LEN=4) :: CMICRO, CSCONV, CTURB +REAL :: PTSTEP +! ----------------------------------------------------------------------- + +IULOUT=20 +CPROGRAM='AROME' +ZDZMIN=999. +CMICRO='NONE' +CSCONV='EDKF' +CTURB='TKEL' +PTSTEP = 25.0000000000000 + +!Default values +CALL INI_PHYEX(CPROGRAM, 0, .TRUE., IULOUT, 0, 1, & + &PTSTEP, ZDZMIN, & + &CMICRO, CSCONV, CTURB, & + &LDDEFAULTVAL=.TRUE., LDREADNAM=.FALSE., LDCHECK=.FALSE., KPRINT=0, LDINIT=.FALSE., & + &PHYEX_OUT=PHYEX) + +!Control parameters +PHYEX%MISC%PTSTEP = PTSTEP +PHYEX%MISC%KSV_LGBEG = 0 +PHYEX%MISC%KSV_LGEND = 0 +PHYEX%MISC%ONOMIXLG=.FALSE. +PHYEX%MISC%KRR = KRR +PHYEX%MISC%KRRL = KRRL +PHYEX%MISC%KRRI = KRRI +PHYEX%MISC%KSV = KSV + +!Emulate the namelist reading +PHYEX%NEBN%LSUBG_COND=.TRUE. +PHYEX%NEBN%CFRAC_ICE_SHALLOW_MF='S' + +!Param initialisation +CALL INI_PHYEX(CPROGRAM, 0, .TRUE., IULOUT, 0, 1, & + &PTSTEP, ZDZMIN, & + &CMICRO, CSCONV, CTURB, & + &LDDEFAULTVAL=.FALSE., LDREADNAM=.FALSE., LDCHECK=.TRUE., KPRINT=2, LDINIT=.TRUE., & + &PHYEX_IN=PHYEX, PHYEX_OUT=PHYEX) + +!Budgets +CALL TBUCONF_ASSOCIATE +PHYEX%MISC%NBUDGET=0 +DO JRR=1, PHYEX%MISC%NBUDGET + PHYEX%MISC%YLBUDGET(JRR)%NBUDGET=JRR +ENDDO +LBU_ENABLE=.FALSE. +LBUDGET_U=.FALSE. +LBUDGET_V=.FALSE. +LBUDGET_W=.FALSE. +LBUDGET_TH=.FALSE. +LBUDGET_TKE=.FALSE. +LBUDGET_RV=.FALSE. +LBUDGET_RC=.FALSE. +LBUDGET_RR=.FALSE. +LBUDGET_RI=.FALSE. +LBUDGET_RS=.FALSE. +LBUDGET_RG=.FALSE. +LBUDGET_RH=.FALSE. +LBUDGET_SV=.FALSE. +PHYEX%MISC%TBUCONF=TBUCONF + END SUBROUTINE INIT_PHYEX END PROGRAM diff --git a/src/testprogs/turb_mnh/main_turb.F90 b/src/testprogs/turb_mnh/main_turb.F90 index 4ae56d40fc2b8f7f0df3f802ae866c0e64f2a5e5..3cc56801a581221458f84c61b4600a1c5dce335c 100644 --- a/src/testprogs/turb_mnh/main_turb.F90 +++ b/src/testprogs/turb_mnh/main_turb.F90 @@ -3,20 +3,14 @@ PROGRAM MAIN_TURB USE XRD_GETOPTIONS USE GETDATA_TURB_MOD USE COMPUTE_DIFF -USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t -USE MODD_CST, ONLY: CST -USE MODD_CTURB -USE MODD_LES, ONLY: TLES -USE MODD_TURB_n, ONLY: TURBN -USE MODD_IO, ONLY: TFILEDATA USE MODI_TURB -USE MODI_INI_CST -USE MODD_BUDGET!, ONLY: TBUCONF_ASSOCIATE, TBUDGETDATA, NBUDGET_RH, TBUCONF +USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t +USE MODD_PHYEX, ONLY: PHYEX_t USE STACK_MOD USE OMP_LIB USE YOMHOOK, ONLY : LHOOK, DR_HOOK USE PARKIND1, ONLY : JPRB, JPIM - +USE MODD_LES, ONLY: TLES_t IMPLICIT NONE @@ -119,16 +113,7 @@ INTEGER :: NPROMA, NGPBLKS, NFLEVG INTEGER :: IBL, JLON, JLEV TYPE(DIMPHYEX_t) :: D, D0 -INTEGER :: IMI, ISPLIT, KSV_LGBEG, KSV_LGEND, KGRADIENTS -INTEGER :: KSV_LIMA_NR, KSV_LIMA_NS, KSV_LIMA_NG, KSV_LIMA_NH -CHARACTER(LEN=4),DIMENSION(2) :: HLBCX, HLBCY -CHARACTER(LEN=6) :: HPROGRAM -LOGICAL :: O2D, ONOMIXLG, OFLAT, OCOUPLES, OBLOWSNOW, OCOMPUTE_SRC, OOCEAN, ODEEPOC -TYPE(TFILEDATA) :: ZTFILE -REAL :: ZCEI_MAX, ZCEI_MIN, ZCOEF_AMPL_SAT -CHARACTER (LEN=4) :: CMICRO -REAL :: PTSTEP -TYPE(TBUDGETDATA), DIMENSION(NBUDGET_RH) :: YLBUDGET +TYPE(PHYEX_t) :: PHYEX LOGICAL :: LLCHECK LOGICAL :: LLCHECKDIFF LOGICAL :: LLDIFF @@ -136,7 +121,7 @@ INTEGER :: IBLOCK1, IBLOCK2 INTEGER :: ISTSZ, JBLK1, JBLK2 INTEGER :: NTID, ITID INTEGER :: JRR - +TYPE(TLES_t) :: TLES REAL, ALLOCATABLE :: PSTACK(:,:) TYPE (STACK) :: YLSTACK @@ -212,40 +197,8 @@ IF (LLVERBOSE) PRINT *, " KLEV = ", KLEV, " KRR = ", KRR PRINT *, " NPROMA = ", NPROMA, " KLEV = ", KLEV, " NGPBLKS = ", NGPBLKS -IMI = 1 -HLBCX(:)='CYCLCYCL' -HLBCY(:)='CYCLCYCL' -ISPLIT = 1 -KSV_LGBEG = 0 -KSV_LGEND = 0 -HPROGRAM='AROME ' -O2D=.FALSE. -ONOMIXLG=.FALSE. -OFLAT=.FALSE. -OCOUPLES=.FALSE. -OBLOWSNOW=.FALSE. -OCOMPUTE_SRC=SIZE(PSIGS, 3)/=0 -OOCEAN=.FALSE. -ODEEPOC=.FALSE. -CMICRO='ICE3' -ZTFILE%LOPENED=.FALSE. -ZCEI_MAX=1.0 -ZCEI_MIN=0.0 -ZCOEF_AMPL_SAT=0.0 -KGRADIENTS=0 -KSV_LIMA_NR=0 -KSV_LIMA_NS=0 -KSV_LIMA_NG=0 -KSV_LIMA_NH=0 +CALL INIT_PHYEX(KRR, KRRL, KRRI, KSV, SIZE(PSIGS, 3), PHYEX) TLES%LLES=.FALSE. -! -PTSTEP = 25.0000000000000 - -CALL INIT_PHYEX () - -DO JRR=1, NBUDGET_RH - YLBUDGET(JRR)%NBUDGET=JRR -ENDDO D0%NIT = NPROMA D0%NIB = 1 @@ -284,7 +237,7 @@ DO ITIME = 1, NTIME TSD = OMP_GET_WTIME () !!! !directives pas a jour !$acc data & -!!! !directives pas a jour !$acc & copyin (D0, CST, ICEP, NEB, KRR, HFRAC_ICE, HCONDENS, HLAMBDA3, HBUNAME, OSUBG_COND, OSIGMAS, OCND2, HSUBG_MF_PDF, PTSTEP, LMFCONV, & +!!! !directives pas a jour !$acc & copyin (D0, PHYEX, KRR, HFRAC_ICE, HCONDENS, HLAMBDA3, HBUNAME, OSIGMAS, OCND2, LMFCONV, & !!! !directives pas a jour !$acc & ZSIGQSAT, PRHODJ, PEXNREF, PRHODREF, PSIGS, PMFCONV, PPABSM, ZZZ, PCF_MF, PRC_MF, PRI_MF, ZRS, ZICE_CLD_WGT) & !!! !directives pas a jour !$acc & copy (PRS, PTHS), & !!! !directives pas a jour !$acc & copyout (PSRCS, PCLDFR, PHLC_HRC, PHLC_HCF, PHLI_HRI, PHLI_HCF) & @@ -339,17 +292,16 @@ JBLK2 = (NGPBLKS * (ITID+1)) / NTID YLSTACK%L = 0 YLSTACK%U = 0 #endif - -CALL TURB (CST,CSTURB,TBUCONF,TURBN, D, TLES,& - & IMI, KRR, KRRL, KRRI, HLBCX, HLBCY, KGRADIENTS, 1,& - & ISPLIT,IMI, KSV, KSV_LGBEG, KSV_LGEND, & - & HPROGRAM, & - & KSV_LIMA_NR, KSV_LIMA_NS, KSV_LIMA_NG, KSV_LIMA_NH,& - & O2D, ONOMIXLG, OFLAT, OCOUPLES,OBLOWSNOW,.FALSE.,.TRUE.,& - & OCOMPUTE_SRC, 1.0, & - & OOCEAN,ODEEPOC, .FALSE., & - & 'NONE',CMICRO, & - & 2*PTSTEP,ZTFILE, & +CALL TURB(PHYEX%CST, PHYEX%CSTURB, PHYEX%MISC%TBUCONF, PHYEX%TURBN, PHYEX%NEBN, D, TLES,& + & PHYEX%MISC%KMI, PHYEX%MISC%KRR, PHYEX%MISC%KRRL, PHYEX%MISC%KRRI, PHYEX%MISC%HLBCX, PHYEX%MISC%HLBCY, PHYEX%MISC%KGRADIENTS, 1,& + & PHYEX%MISC%KSPLIT,PHYEX%MISC%KMI, PHYEX%MISC%KSV, PHYEX%MISC%KSV_LGBEG, PHYEX%MISC%KSV_LGEND, & + & PHYEX%MISC%CPROGRAM, & + & PHYEX%MISC%KSV_LIMA_NR, PHYEX%MISC%KSV_LIMA_NS, PHYEX%MISC%KSV_LIMA_NG, PHYEX%MISC%KSV_LIMA_NH,& + & PHYEX%MISC%O2D, PHYEX%MISC%ONOMIXLG, PHYEX%MISC%OFLAT, PHYEX%MISC%OCOUPLES, PHYEX%MISC%OBLOWSNOW,PHYEX%MISC%OIBM,& + & PHYEX%MISC%OFLYER, PHYEX%MISC%OCOMPUTE_SRC, PHYEX%MISC%PRSNOW, & + & PHYEX%MISC%OOCEAN, PHYEX%MISC%ODEEPOC, PHYEX%MISC%ODIAG_IN_RUN, & + & PHYEX%MISC%HTURBLEN_CL,PHYEX%MISC%CMICRO, & + & PHYEX%MISC%PTSTEP,PHYEX%MISC%ZTFILE, & & ZDXX(:,:,:,IBL),ZDYY(:,:,:,IBL),ZDZZ(:,:,:,IBL),ZDZX(:,:,:,IBL),ZDZY(:,:,:,IBL),ZZZ(:,:,:,IBL), & & ZDIRCOSXW,ZDIRCOSYW,ZDIRCOSZW,ZCOSSLOPE,ZSINSLOPE, & & PRHODJ(:,:,:,IBL),PTHVREF(:,:,:,IBL), PHGRAD, PZS, & @@ -357,12 +309,12 @@ CALL TURB (CST,CSTURB,TBUCONF,TURBN, D, TLES,& & PPABSM(:,:,:,IBL),PUM(:,:,:,IBL),PVM(:,:,:,IBL),PWM(:,:,:,IBL),PTKEM(:,:,:,IBL),ZSVM(:,:,:,:,IBL),PSRCM(:,:,:,IBL), & & PLENGTHM(:,:,:,IBL),PLENGTHH(:,:,:,IBL),MFMOIST(:,:,:,IBL), & & ZBL_DEPTH(:,:,IBL),ZSBL_DEPTH(:,:,IBL), & - & ZCEI(:,:,:,IBL),ZCEI_MIN,ZCEI_MAX,ZCOEF_AMPL_SAT, & + & ZCEI(:,:,:,IBL),PHYEX%MISC%ZCEI_MIN,PHYEX%MISC%ZCEI_MAX,PHYEX%MISC%ZCOEF_AMPL_SAT, & & PTHM(:,:,:,IBL),ZRM(:,:,:,:,IBL), & & PRUS(:,:,:,IBL),PRVS(:,:,:,IBL),PRWS(:,:,:,IBL),PRTHS(:,:,:,IBL),ZRRS(:,:,:,:,IBL),ZRSVS(:,:,:,:,IBL),PRTKES_OUT(:,:,:,IBL), & & PSIGS(:,:,:,IBL), & & PFLXZTHVMF(:,:,:,IBL),ZWTH(:,:,:,IBL),ZWRC(:,:,:,IBL),ZWSV(:,:,:,:,IBL),PDP(:,:,:,IBL),PTP(:,:,:,IBL),PTDIFF(:,:,:,IBL),PTDISS(:,:,:,IBL),& - & YLBUDGET, KBUDGETS=SIZE(YLBUDGET),PEDR=PEDR(:,:,:,IBL),PTPMF=PTPMF(:,:,:,IBL),& + & PHYEX%MISC%YLBUDGET, KBUDGETS=PHYEX%MISC%NBUDGET,PEDR=PEDR(:,:,:,IBL),PTPMF=PTPMF(:,:,:,IBL),& & PDRUS_TURB=PDRUS_TURB(:,:,:,IBL),PDRVS_TURB=PDRVS_TURB(:,:,:,IBL), & & PDRTHLS_TURB=PDRTHLS_TURB(:,:,:,IBL),PDRRTS_TURB=PDRRTS_TURB(:,:,:,IBL),PDRSVS_TURB=ZDRSVS_TURB(:,:,:,:,IBL)) @@ -444,14 +396,99 @@ STOP CONTAINS -SUBROUTINE INIT_PHYEX() -USE MODD_TURB_N, ONLY: TURB_GOTO_MODEL +SUBROUTINE INIT_PHYEX(KRR, KRRL, KRRI, KSV, KSIZE_PSIGS, PHYEX) + +USE MODD_BUDGET, ONLY: TBUCONF_ASSOCIATE, NBUDGET_RI, TBUCONF, LBU_ENABLE, LBUDGET_U, LBUDGET_V, LBUDGET_W, LBUDGET_TH, & + LBUDGET_TKE, LBUDGET_RV, LBUDGET_RC, LBUDGET_RR, LBUDGET_RI, LBUDGET_RS, LBUDGET_RG, LBUDGET_RH, LBUDGET_SV +USE MODD_PHYEX, ONLY: PHYEX_t +USE MODI_INI_PHYEX, ONLY: INI_PHYEX + IMPLICIT NONE -! -CALL INI_CST -CALL TURB_GOTO_MODEL(1,1) -CALL CTURB_ASSOCIATE() + +! ----------------------------------------------------------------------- +! DUMMY VARIABLES +INTEGER, INTENT(IN) :: KRR, KRRL, KRRI, KSV, KSIZE_PSIGS +TYPE(PHYEX_t), INTENT(OUT) :: PHYEX + +!----------------------------------------------------------------------- +! LOCAL VARIABLES +INTEGER :: IULOUT, JRR +REAL :: ZDZMIN +CHARACTER(LEN=6) :: CPROGRAM +CHARACTER(LEN=4) :: CMICRO, CSCONV, CTURB +REAL :: PTSTEP +! ----------------------------------------------------------------------- + +IULOUT=20 +CPROGRAM='AROME' +ZDZMIN=999. +CMICRO='ICE3' +CSCONV='NONE' +CTURB='TKEL' +PTSTEP = 25.0000000000000 + +!Default values +CALL INI_PHYEX(CPROGRAM, 0, .TRUE., IULOUT, 0, 1, & + &PTSTEP, ZDZMIN, & + &CMICRO, CSCONV, CTURB, & + &LDDEFAULTVAL=.TRUE., LDREADNAM=.FALSE., LDCHECK=.FALSE., KPRINT=0, LDINIT=.FALSE., & + &PHYEX_OUT=PHYEX) + +!Control parameters +PHYEX%MISC%PTSTEP = 2*PTSTEP +PHYEX%MISC%KSV_LGBEG = 0 +PHYEX%MISC%KSV_LGEND = 0 +PHYEX%MISC%ONOMIXLG=.FALSE. +PHYEX%MISC%KRR = KRR +PHYEX%MISC%KRRL = KRRL +PHYEX%MISC%KRRI = KRRI +PHYEX%MISC%KSV = KSV +PHYEX%MISC%KMI = 1 +PHYEX%MISC%KGRADIENTS =0 +PHYEX%MISC%HLBCX(:)='CYCLCYCL' +PHYEX%MISC%HLBCY(:)='CYCLCYCL' +PHYEX%MISC%KSPLIT = 1 +PHYEX%MISC%CPROGRAM=CPROGRAM +PHYEX%MISC%O2D=.FALSE. +PHYEX%MISC%OFLAT=.FALSE. +PHYEX%MISC%OCOUPLES=.FALSE. +PHYEX%MISC%OBLOWSNOW=.FALSE. +PHYEX%MISC%OCOMPUTE_SRC=KSIZE_PSIGS/=0 +PHYEX%MISC%OOCEAN=.FALSE. +PHYEX%MISC%ODEEPOC=.FALSE. +PHYEX%MISC%ZTFILE%LOPENED=.FALSE. +PHYEX%MISC%ZCEI_MAX=1.0 +PHYEX%MISC%ZCEI_MIN=0.0 +PHYEX%MISC%ZCOEF_AMPL_SAT=0.0 +PHYEX%MISC%KSV_LIMA_NR=0 +PHYEX%MISC%KSV_LIMA_NS=0 +PHYEX%MISC%KSV_LIMA_NG=0 +PHYEX%MISC%KSV_LIMA_NH=0 +PHYEX%MISC%OIBM=.FALSE. +PHYEX%MISC%OFLYER=.TRUE. +PHYEX%MISC%PRSNOW=1.0 +PHYEX%MISC%ODIAG_IN_RUN=.FALSE. +PHYEX%MISC%HTURBLEN_CL='NONE' +PHYEX%MISC%CMICRO=CMICRO + +!Emulate the namelist reading +PHYEX%NEBN%LSUBG_COND=.TRUE. +PHYEX%TURBN%XLINI=0.1 !This line should not exist to reproduce operational setup but the testprogs reference run + !was done (erroneously) with XLINI=0.1 + +!Param initialisation +CALL INI_PHYEX(CPROGRAM, 0, .TRUE., IULOUT, 0, 1, & + &PTSTEP, ZDZMIN, & + &CMICRO, CSCONV, CTURB, & + &LDDEFAULTVAL=.FALSE., LDREADNAM=.FALSE., LDCHECK=.TRUE., KPRINT=2, LDINIT=.TRUE., & + &PHYEX_IN=PHYEX, PHYEX_OUT=PHYEX) + +!Budgets CALL TBUCONF_ASSOCIATE +PHYEX%MISC%NBUDGET=NBUDGET_RI +DO JRR=1, PHYEX%MISC%NBUDGET + PHYEX%MISC%YLBUDGET(JRR)%NBUDGET=JRR +ENDDO LBU_ENABLE=.FALSE. LBUDGET_U=.FALSE. LBUDGET_V=.FALSE. @@ -466,58 +503,8 @@ LBUDGET_RS=.FALSE. LBUDGET_RG=.FALSE. LBUDGET_RH=.FALSE. LBUDGET_SV=.FALSE. +PHYEX%MISC%TBUCONF=TBUCONF -TURBN%LHARAT=.FALSE. -TURBN%CTURBDIM = '1DIM' -TURBN%XIMPL=1. -TURBN%CTURBLEN='BL89' -TURBN%LSTATNW=.FALSE. -TURBN%LTURB_DIAG=.FALSE. -TURBN%LTURB_FLX=.FALSE. -TURBN%LSUBG_COND=.TRUE. -TURBN%LRMC01=.FALSE. -TURBN%CTOM='NONE' -TURBN%LLEONARD=.FALSE. - -XCED = 0.85 -XCEP = 2.11 -XA0 = 0.6 -XA2 = 1. -XA3 = 0. -XCTD = 1.2 -IF (TURBN%LSTATNW) THEN - XCTP = 4.0 - ELSE - XCTP = 4.65 -ENDIF -XA5 = 1./3. -XCET = 0.40 -XALPSBL = 4.63 -XRM17 = 0.5 ! Rodier et al 2017 -XCMFS= 2./3./XCEP*(1.-XA0) !Constant for the momentum flux due to shear (RS) -XCSHF= 2./3./XCTP !Constant for the sensible heat flux(RS) -XCHF= XCSHF !Constant for the humidity flux(RS) -XCTV= 2./3./XCTP/XCTD !Constant for the temperature variance(RS) -XCHV= XCTV !Constant for the humidity variance(RS) -XCHT1= XCTV/2. !Constants for the temperature-humidity correlation(RS) -XCHT2= XCTV/2. -XCPR1= XCTV !Constants for the turbulent Prandtl and Schmidt numbers -XCPR2= XCHT1 -XCPR3= XCPR2 ! used only for the Schmidt number for scalar variables -XCPR4= XCPR2 -XCPR5= XCPR2 -XTKEMIN=1.E-6 -!XLINI=10. ! BL mixing length -XLINI=0.1 ! BL mixing length -XLINF=1.E-10! to prevent division by zero -XPHI_LIM = 3. -XCDP = 1.46 -XCDD = 1.83 -XCDT = 0.42 -XSBL_O_BL = 0.05 ! SBL height / BL height ratio -XFTOP_O_FSURF = 0.05 ! Fraction of surface (heat or momentum) flux used to define top of BL - -! END SUBROUTINE INIT_PHYEX END PROGRAM diff --git a/tools/check_commit_ial.sh b/tools/check_commit_ial.sh index f20bbafae7ea849a4d874d807c7ba0e4c59a307f..0fa1bf6229e7d148c5065ef77921915c31e6f233 100755 --- a/tools/check_commit_ial.sh +++ b/tools/check_commit_ial.sh @@ -17,6 +17,7 @@ set -e #small_3D_alt7: CMF_CLOUD='STAT', LOSIGMAS=.FALSE. #Needs 2 corrections in original cycle 48 #small_3D_alt8: CMF_UPDRAFT='RHCJ' #small_3D_alt9: CCLOUD='OLD3', OCND2=.T. +#small_3D_alt10: LCRIAUTI=F #The small_3D_alt7 needed a correction in apl_arome which has been introduced in d37dd1f. But the reference pack has been modified # afterwards to enable this test case to be run (documented in INSTALL_pack_ial.md). In consequence, the reference @@ -37,6 +38,8 @@ set -e # the commit d10ed48 in 48t3 (29 september 2022) when running in 48t3 # Between edc3f88 and d10ed48 only the reference change, physics source code is identical. +#The small_3D_alt10 is not included in the list because it is not sufficiently different from other tests + #Special pack names: # - recompil: original source code (everything under mpa) # - split_48t1: original 48t1 source code but with physics source code under phyex directory @@ -197,8 +200,14 @@ function ial_version_content2cycle { # variable content_ial_version must contain the source code of ial_version.json content_ial_version=$content_ial_version python3 -c "import json; import os; print(json.loads(os.environ['content_ial_version'])['cycle'])" } +function ial_version_content2scripttag { + # variable content_ial_version must contain the source code of ial_version.json + content_ial_version=$content_ial_version python3 -c "import json; import os; print(json.loads(os.environ['content_ial_version']).get('scripttag', ''))" +} + #Name is choosen such as it can be produced with a main pack: PHYEX/${cycle}_XXXXXXXXX.01.${gmkpack_l}.${gmkpack_o} +scripttag="" fromdir='' if echo $commit | grep '/' | grep -v '^tags/' > /dev/null; then fromdir=$commit @@ -209,6 +218,7 @@ if echo $commit | grep '/' | grep -v '^tags/' > /dev/null; then cycle=$(apl_arome_content2cycle) else cycle=$(ial_version_content2cycle) + scripttag=$(ial_version_content2scripttag) fi fi packBranch=$(echo $commit | sed 's/\//'${separator}'/g' | sed 's/:/'${separator}'/g' | sed 's/\./'${separator}'/g') @@ -373,6 +383,9 @@ if [ $packcreation -eq 1 ]; then [ -f $EXT/apl_arome.F90 ] && mv $EXT/apl_arome.F90 ../arpifs/phys_dmn/ [ -f $EXT/suphmpa.F90 ] && mv $EXT/suphmpa.F90 ../arpifs/phys_dmn/ [ -f $EXT/vdfhghtnhl.F90 ] && mv $EXT/vdfhghtnhl.F90 ../arpifs/phys_dmn/ + [ -f $EXT/cpg_opts_type_mod.fypp ] && mv $EXT/cpg_opts_type_mod.fypp ../arpifs/module/ + [ -f $EXT/aplpar.F90 ] && mv $EXT/aplpar.F90 ../arpifs/phys_dmn/ + [ -f $EXT/su0yomb.F90 ] && mv $EXT/su0yomb.F90 ../arpifs/setup/ #Special mpa case [ -f $EXT/modd_spp_type.F90 ] && mv $EXT/modd_spp_type.F90 ../mpa/micro/externals/ [ -f $EXT/spp_mod_type.F90 ] && mv $EXT/spp_mod_type.F90 ../mpa/micro/externals/ @@ -445,7 +458,7 @@ if [ $run -ge 1 ]; then cd $HOMEPACK/$name mkdir -p conf_tests/$t cd conf_tests/$t - MYLIB=$name TESTDIR=$dirconf/$t exescript Output_run $dirconf/$t/aro${cycle}.sh + MYLIB=$name TESTDIR=$dirconf/$t exescript Output_run $dirconf/$t/aro${cycle}${scripttag}.sh done fi diff --git a/tools/check_commit_mesonh.sh b/tools/check_commit_mesonh.sh index 83cc1f7c79422ff52ba70c395cc19cb758a4a770..c4964bf68af5b4b73cdb3cec2fa902b6af780685 100755 --- a/tools/check_commit_mesonh.sh +++ b/tools/check_commit_mesonh.sh @@ -260,8 +260,8 @@ if [ $compilation -eq 1 ]; then set +e #file ends with a test that can return false . ../conf/profile_mesonh-* #This lines modifies the list of loaded modules set -e - make -j 8 | tee ../Output_compilation - make installmaster | tee -a ../Output_compilation + make -j 8 2>&1 | tee ../Output_compilation + make installmaster 2>&1 | tee -a ../Output_compilation command -v module && module load $modulelist #restore loaded modules fi diff --git a/tools/conf_tests/big_3D/aro48t3_nam1.sh b/tools/conf_tests/big_3D/aro48t3_nam1.sh new file mode 100644 index 0000000000000000000000000000000000000000..2f964fcdf0bffce2395ba8edfbd326bdf3b5efb8 --- /dev/null +++ b/tools/conf_tests/big_3D/aro48t3_nam1.sh @@ -0,0 +1,651 @@ +#!/bin/bash +#SBATCH -p normal256 +#SBATCH --export=MYLIB,HOMEPACK,TESTDIR +#SBATCH -n 1280 +#SBATCH -c 4 +#SBATCH -N 40 +#SBATCH -t 00:40:00 +#SBATCH --mem=247000 +#SBATCH --exclusiv + +# Job management : +# -------------- +JOB_INITDIR=$SLURM_SUBMIT_DIR +export JOB_NAME=arome_e700 +export JOB_ID=$SLURM_JOB_ID + +echo JOB_INITDIR=$JOB_INITDIR +echo JOB_NAME=$JOB_NAME +echo JOB_ID=$JOB_ID + +# ============================================================================= + +# RESOURCES ALLOCATIONS +# ===================== + +# Number of nodes/mpi-tasks/omp-threads: +# ------------------------------------- +NNODES=$SLURM_JOB_NUM_NODES +# Number of MPI tasks per node: +MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) +# Number of OPEN-MP threads per MPI task: +export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK +# Total number of MPI tasks: +MPI_TASKS=$SLURM_NTASKS +# Number of tasks reserved for the I/O server : 2 (hyperthreaded) nodes +NTASKS_IO=$(($(grep processor /proc/cpuinfo | wc -l)/1/$OMP_NUM_THREADS)) + +echo NNODES=$NNODES +echo MPITASKS_PER_NODE=$MPITASKS_PER_NODE +echo +# Number of MPI tasks and OMP threads used in the application : +echo MPI_TASKS=$MPI_TASKS +echo OMP_NUM_THREADS=$OMP_NUM_THREADS + +# ============================================================================= + +# SYSTEM PREFERENCES +# ================== + +# OMP/MPI submission management : +# ----------------------------- +# LOCAL_MPI_WRAPPER : could be "mpiauto", "mpdrun", "mpiexec" ... or empty string +# LOCAL_STACK_LIMIT : could be "unlimited" or empty string + +set -x +#LOCAL_MPI_WRAPPER="/opt/softs/mpiauto/mpiauto --wrap --wrap-stdeo --wrap-stdeo-pack" +LOCAL_MPI_WRAPPER="/opt/softs/mpiauto/mpiauto" +LOCAL_STACK_LIMIT=unlimited +ulimit -l unlimited +set +x + +# Specific environment variables : +# ------------------------------ +set -x +export OMP_STACKSIZE=4G +export KMP_STACKSIZE=4G +export KMP_MONITOR_STACKSIZE=4G +export I_MPI_HARD_FINALIZE=1 +export I_MPI_SCALABLE_OPTIMIZATION=0 +export I_MPI_DAPL_UD_RNDV_EP_NUM=4 +export I_MPI_SHM_SPIN_COUNT=10 +export I_MPI_SPIN_COUNT=10 +set +x + +# File systems : +# ------------ +# Global file system: +export TMPGFS=$TMPDIR +export WORKGFS=$WORKDIR/benchmarks +#MTOOL export TMPGFS=$MTOOL_STEP_WORKSPACE +# Local file system (if preferred): +export TMPLOC=$TMPGFS +echo TMPGFS=$TMPGFS +echo TMPLOC=$TMPLOC + +# Local disks synchronization : +# --------------------------- +export ISYNC=0 +if [ "$MTOOL_IS" = "ON" ] ; then +# synchronization is needed anyway between the steps + export ISYNC=1 +elif [ $NNODES -gt 1 ] && [ "$TMPLOC" != "$TMPGFS" ] ; then +# Local disk synchronization needed: + export ISYNC=1 +fi +echo ISYNC=$ISYNC + +# Miscellaneous : +# ------------- + +# ============================================================================= + +# USER PREFERENCES +# ================ + +#export NAMELDIR=/home/gmap/mrpm/khatib/pack/48t1_main.01#myref/run/cy47.forecast_arome_e700/Namelists +export NAMELDIR=$TESTDIR/Namelists + +HOMEPACK=${HOMEPACK:=$HOME/pack} +export BINDIR=$HOMEPACK/$MYLIB/bin +#export BINDIR=/home/gmap/mrpm/khatib/pack/48t1_main.01#myref/bin +OUTPUTDIR=${OUTPUTDIR:-$PWD} #No cd command have been done before this line + + + +export DATADIR=/scratch/work/khatib/data/cy47.forecast_arome_e700 +#export REFDIR=/home/gmap/mrpm/khatib/benchmarks/apps/modules/cy47.forecast_arome_e700/References +export TOOLSDIR=/home/gmap/mrpm/khatib/benchmarks/tools +#export ROOTDIR_ODB=/home/gmap/mrpm/khatib/odbpools/36t1_bench/cy47.forecast_arome_e700 + +# Check reliability of auxilary directories : +# ----------------------------------------- +ierr=0 +#for var in NAMELDIR BINDIR DATADIR REFDIR TOOLSDIR ; do +for var in NAMELDIR BINDIR DATADIR TOOLSDIR ; do + eval "dir=\$$var" + if [ ! "$dir" ] ; then + echo "$var is not set." + ierr=1 + fi + if [ $ierr -ne 0 ] ; then + exit 1 + fi +done +ierr=0 +for dir in $NAMELDIR $BINDIR $REFDIR $TOOLSDIR ; do + if [ ! -d $dir ] ; then + echo "$dir does not exists." + ierr=1 + fi + if [ $ierr -ne 0 ] ; then + exit 1 + fi +done + +echo TOOLSDIR=$TOOLSDIR +echo NAMELDIR=$NAMELDIR +echo DATADIR=$DATADIR +#echo REFDIR=$REFDIR +echo BINDIR=$BINDIR +#echo ROOTDIR_ODB=$ROOTDIR_ODB + +export PATH=$TOOLSDIR:$PATH +export TOOLSDIR +export DATADIR + +# Software default environment variables : +# -------------------------------------- +set -x +export DR_HOOK=0 +export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_SILENT=1 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export MPL_MBX_SIZE=2048000000 +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export EC_MEMINFO=0 +export OPENBLAS_NUM_THREADS=1 +export MKL_CBWR="AUTO,STRICT" +export MKL_NUM_THREADS=1 +export MKL_DEBUG_CPU_TYPE=5 +set +x + +# Profilers management : +# -------------------- +# FTRACE_JOB : profiler switch +# =0 : no profiler +# =1 : integrated DrHook profiler +# =2 : specific profiler +# +export FTRACE_JOB=1 +echo "FTRACE_JOB=$FTRACE_JOB" + +if [ $FTRACE_JOB -ne 0 ] ; then +# profilings main directory: + if [ -d $JOB_INITDIR ] ; then +# Use the initial job's dir + FTRACE_DIR=$JOB_INITDIR + else +# Set one : + FTRACEDIR= + if [ ! "$FTRACEDIR" ] ; then + echo "FTRACEDIR is not set." + exit 1 + fi + if [ ! -d $FTRACEDIR ] ; then + mkdir -p $FTRACEDIR + if [ $? -ne 0 ] ; then + echo "Can't make directory $FTRACEDIR" + exit 1 + fi + fi + FTRACE_DIR=$FTRACEDIR + fi + SCRATCH_FTRACE_DIR=$TMPGFS +# SCRATCH_FTRACE_DIR=$FTRACE_DIR + if [ $FTRACE_JOB -eq 1 ] ; then + set -x + export DR_HOOK=1 + export DR_HOOK_OPT=prof +# Directory of individual profiles : + export PROFDIR=$SCRATCH_FTRACE_DIR/${JOB_NAME}.d${JOB_ID} +# Merged profiles report filename : + export PROFMRG=$FTRACE_DIR/${JOB_NAME}.h${JOB_ID} + set +x + elif [ $FTRACE_JOB -ge 2 ] ; then + set -x +# Directory of individual profiles : + export PROFDIR=$SCRATCH_FTRACE_DIR/${JOB_NAME}.f${JOB_ID} +# Merged profiles report filename : + export PROFMRG=$FTRACE_DIR/${JOB_NAME}.t${JOB_ID} + set +x + fi +fi + +set +x + +# Listings : +# -------- +set -x +export ECHO_MPSH=OFF +export OUTPUT_LISTING=YES +export LOGDIR=$JOB_INITDIR/${JOB_NAME}.l${JOB_ID} +set +x + +# ODB archives : +# ------------ +# if set to 1, archived Odbs will be gzipped : +set -x +export ARCHIVE_AND_ZIP_ODB=0 +set +x + +# Directory for application output data files : +# ------------------------------------------- +echo +OUTDIR= +OUTDIR=${OUTDIR:=$TMPGFS} +if [ "$TMPGFS" != "$TMPLOC" ] ; then + if [ "$OUTDIR" = "$TMPLOC" ] ; then + echo "Output files on LOCAL file system" + elif [ "$OUTDIR" = "$TMPGFS" ] ; then + echo "Output files on GLOBAL file system" + else + echo "Output files on directory : $OUTDIR" + fi +else + echo "Output files on directory : $OUTDIR" +fi + +# NFS temporary directory for small I/Os +echo +TMPNFS=$(mktemp -d --tmpdir=/tmp/$LOGNAME) +if [ -d $TMPNFS ] ; then + echo "temporary directory on NFS for small I/Os : $TMPNFS" +else + TMPNFS="." +fi + +# ============================================================================= + +# APPLICATION TUNING +# ================== + +# ARPEGE : Forecast +# ***************** + +mkdir -p $TMPLOC +if [ $ISYNC -gt 0 ] ; then + mkdir -p $TMPGFS + cd $TMPGFS +else + cd $TMPLOC +fi + +# Driver-specific environment variables : +# ------------------------------------- +set -x +NAMELIST=namel_previ.48 +CTRLLIST=extra_namelists48.list +LINKS=links_inline48.scpt +EXECUTABLE=MASTERODB +#REFLIST=$REFDIR/forecast.out +EXPLIST=./NODE.001_01 +set +x + +#MTOOL common join=step_2 + +# Namelists modifications : +# ----------------------- + +set -x + +# Number of MPI tasks for the I/O server : +NPROC_IO=$NTASKS_IO + +# Remaining number of MPI tasks : +NPROC=$((MPI_TASKS-NPROC_IO)) + +# Memory cache optimisation: +NPROMA=-16 +NFPROMA=-24 + +# Overall scalar optimisation: +LOPT_SCALAR=.TRUE. + +# Output packing distribution: +NSTROUT=${NPROC} +NSTRIN=${NPROC} + +NPRGPEW=16 +#NPRGPNS=((NPROC/NPRGPEW)) +NPRTRV=16 +#NPRTRW=((NPROC/NPRTRV)) + +set +x + +cat > namelist_mods2 <<EOF + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + LSEDIC=.TRUE., + / + &NAMPARAR + LOSEDIC=-, + CFRAC_ICE_ADJUST=-, + CFRAC_ICE_SHALLOW_MF=-, + CSEDIM=-, + CSNOWRIMING=-, + LCONVHG=-, + LCRFLIMIT=-, + LEVLIMIT=-, + LFEEDBACKT=-, + LNULLWETG=-, + LNULLWETH=-, + LSEDIM_AFTER=-, + LWETGPOST=-, + LWETHPOST=-, + NMAXITER_MICRO=-, + XFRACM90=-, + XMRSTEP=-, + XSPLIT_MAXCFL=-, + XTSTEP_TS=-, + LCRIAUTI=-, + RCRIAUTC=-, + RCRIAUTI=-, + RT0CRIAUTI=-, + / + &NAMTRANS + LFFTW=.TRUE., + / + &NAMPAR0 + NPRINTLEV=1, + LOPT_SCALAR=${LOPT_SCALAR}, + MBX_SIZE=2048000000, + NPROC=${NPROC}, + NPRGPNS=-, + NPRGPEW=-, + NPRTRW=-, + NPRTRV=-, + / + &NAMDIM + NPROMA=$NPROMA, + / + &NAMFPSC2 + NFPROMA=$NFPROMA, + / + &NAMFPSC2_DEP + NFPROMA_DEP=$NFPROMA, + / + &NAMPAR1 + LSPLIT=.TRUE., + NSTRIN=${NSTRIN}, + NSTROUT=${NSTROUT}, + / + &NAMFA + CMODEL=' ', + / + &NAMIAU + LIAU=.FALSE., + / + &NAMARG + CNMEXP='0000', + / + &NAMCT0 + CSCRIPT_LAMRTC=' ', + CSCRIPT_PPSERVER=' ', + CFPNCF='ECHFP', + NSDITS(0)=0, + NFRSDI=4, + NFPOS=1, + / + &NAMCT1 + N1POS=1, + / + &NAMFPC + CFPDIR='${OUTDIR}/PF', + / + &NAMOPH + CFNHWF='${OUTDIR}/ECHIS', + CFPATH='${OUTDIR}/', + / + &NAMIO_SERV + NPROC_IO=${NPROC_IO}, + NMSG_LEVEL_SERVER=1, + NMSG_LEVEL_CLIENT=1, + NPROCESS_LEVEL=5, + / + &NAMRIP + CSTOP='h24', + TSTEP=50., + / +EOF +cat namelist_mods2 > namelist_modset +\rm -f namelist_mods2 +echo +echo Namelists adaptations : +cat namelist_modset +echo + +set +x +cp $NAMELDIR/$NAMELIST namelist +perl -w $TOOLSDIR/xpnam namelist --dfile=namelist_modset +set -x +echo +/bin/cat namelist.new +set +x +\rm -f namelist_modset namelist +\mv namelist.new fort.4 +set -x + +#MTOOL common + +# ============================================================================= + +# DRIVER +# ====== + +# ****************************** +# * fetch initial data files * +# ****************************** + +#MTOOL common join=step_1 + +set -x +$TOOLSDIR/getdata.sh +set +x + +#MTOOL common + +#MTOOL common join=step_2 + +for file in $(cat $NAMELDIR/$CTRLLIST) ; do + set -x + cp $NAMELDIR/$file . + set +x +done +if [ -s $NAMELDIR/$LINKS ] ; then + set -x + cp $NAMELDIR/$LINKS . + chmod 755 $LINKS + . ./$LINKS + \rm $LINKS + set +x +fi + +#MTOOL common + +# *************** +# * Executable * +# *************** + +#MTOOL common join=step_1 + +echo +set -x +cp $BINDIR/$EXECUTABLE . +set +x +if [ ! -f $EXECUTABLE ] ; then + echo "executable $BINDIR/$EXECUTABLE could not be copied." + exit 1 +fi + +#MTOOL common + +# ******************************** +# * Prepare parallel executions * +# ******************************** + +#MTOOL common join=step_2 + +if [ "$LOCAL_STACK_LIMIT" ] ; then + set -x + ulimit -s $LOCAL_STACK_LIMIT + set +x +fi +# for mpsh : +export MPSH_NPES=$NNODES + +# grib_api environment variables may be determined by the executable : +. grib_api_profile $EXECUTABLE + +# Intel mpi fabric setup depending on what is found in the executable : +. intel_mpi_fabric $EXECUTABLE + +#MTOOL common + +set -x +cd $TMPLOC +set +x +. rttov_profile + +# ******************************************************* +# * Unarchive datasets and local disks Synchronisation * +# ******************************************************* + +if [ $ISYNC -eq 0 ] ; then + set -x +#MTOOL common join=step_1 + $TOOLSDIR/input_sync.sh +#MTOOL common + set +x +else + set -x +#MTOOL common join=step_2 + $TOOLSDIR/input_sync.sh +#MTOOL common + set +x +fi + +# *************** +# * Execution * +# *************** + +#MTOOL common join=step_2 + +mkdir -p $OUTDIR +echo +if [ $(echo $LOCAL_MPI_WRAPPER | grep -c mpiauto) -ne 0 ] ; then + set -x + time $LOCAL_MPI_WRAPPER -np $MPI_TASKS -nnp $MPITASKS_PER_NODE -- ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +elif [ "$LOCAL_MPI_WRAPPER" = "srun" ] ; then + set -x + time $LOCAL_MPI_WRAPPER ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +elif [ "$LOCAL_MPI_WRAPPER" ] ; then + set -x + time $LOCAL_MPI_WRAPPER -np $MPI_TASKS ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +else + set -x + time ./$EXECUTABLE \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +fi + +# ********************** +# * Post-processings * +# ********************** + +echo +if [ "$OUTPUT_LISTING" = "YES" ] ; then + set -x + $TOOLSDIR/outsync.sh + set +x +fi + +if [ $FTRACE_JOB -gt 0 ] ; then + set -x + $TOOLSDIR/profsync.sh + set +x +fi + +set -x +ls -l $OUTDIR +set +x + +set -x +#errorcode returned by executable is not reliable (always different from 0) +if grep " NSTEP = 1728 CNT0" NODE.001_01 > /dev/null; then + cp $EXPLIST $OUTPUTDIR/ +else + mkdir $OUTPUTDIR/error + cp $EXPLIST $OUTPUTDIR/error/ +fi +#if [ -f $REFLIST ] && [ -f $EXPLIST ] ; then $TOOLSDIR/diffNODE.001_01 $EXPLIST $REFLIST ; fi +set +x +# **************** +# * Cleanups * +# **************** + +set -x +cd $TMPGFS +$TOOLSDIR/cleansync.sh +set +x + +#MTOOL common + +# **************** +# * Epilogue * +# **************** + +set -x +$TOOLSDIR/epilog.sh +set +x +if [ "$MTOOL_IS" != "ON" ] && [ "$AUTO_CLEAN" = "ON" ] ; then + cd $HOME + \rm -rf $TMPGFS +fi + +#MTOOL step id=step_1 target=FRONTEND +#MTOOL step id=step_2 target=SUPERCOMPUTER diff --git a/tools/conf_tests/big_3D/aro48t3_nam2.sh b/tools/conf_tests/big_3D/aro48t3_nam2.sh new file mode 100644 index 0000000000000000000000000000000000000000..a4ccbd729d43f33ae6333ac8b4453b9f0b590027 --- /dev/null +++ b/tools/conf_tests/big_3D/aro48t3_nam2.sh @@ -0,0 +1,653 @@ +#!/bin/bash +#SBATCH -p normal256 +#SBATCH --export=MYLIB,HOMEPACK,TESTDIR +#SBATCH -n 1280 +#SBATCH -c 4 +#SBATCH -N 40 +#SBATCH -t 00:40:00 +#SBATCH --mem=247000 +#SBATCH --exclusiv + +# Job management : +# -------------- +JOB_INITDIR=$SLURM_SUBMIT_DIR +export JOB_NAME=arome_e700 +export JOB_ID=$SLURM_JOB_ID + +echo JOB_INITDIR=$JOB_INITDIR +echo JOB_NAME=$JOB_NAME +echo JOB_ID=$JOB_ID + +# ============================================================================= + +# RESOURCES ALLOCATIONS +# ===================== + +# Number of nodes/mpi-tasks/omp-threads: +# ------------------------------------- +NNODES=$SLURM_JOB_NUM_NODES +# Number of MPI tasks per node: +MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) +# Number of OPEN-MP threads per MPI task: +export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK +# Total number of MPI tasks: +MPI_TASKS=$SLURM_NTASKS +# Number of tasks reserved for the I/O server : 2 (hyperthreaded) nodes +NTASKS_IO=$(($(grep processor /proc/cpuinfo | wc -l)/1/$OMP_NUM_THREADS)) + +echo NNODES=$NNODES +echo MPITASKS_PER_NODE=$MPITASKS_PER_NODE +echo +# Number of MPI tasks and OMP threads used in the application : +echo MPI_TASKS=$MPI_TASKS +echo OMP_NUM_THREADS=$OMP_NUM_THREADS + +# ============================================================================= + +# SYSTEM PREFERENCES +# ================== + +# OMP/MPI submission management : +# ----------------------------- +# LOCAL_MPI_WRAPPER : could be "mpiauto", "mpdrun", "mpiexec" ... or empty string +# LOCAL_STACK_LIMIT : could be "unlimited" or empty string + +set -x +#LOCAL_MPI_WRAPPER="/opt/softs/mpiauto/mpiauto --wrap --wrap-stdeo --wrap-stdeo-pack" +LOCAL_MPI_WRAPPER="/opt/softs/mpiauto/mpiauto" +LOCAL_STACK_LIMIT=unlimited +ulimit -l unlimited +set +x + +# Specific environment variables : +# ------------------------------ +set -x +export OMP_STACKSIZE=4G +export KMP_STACKSIZE=4G +export KMP_MONITOR_STACKSIZE=4G +export I_MPI_HARD_FINALIZE=1 +export I_MPI_SCALABLE_OPTIMIZATION=0 +export I_MPI_DAPL_UD_RNDV_EP_NUM=4 +export I_MPI_SHM_SPIN_COUNT=10 +export I_MPI_SPIN_COUNT=10 +set +x + +# File systems : +# ------------ +# Global file system: +export TMPGFS=$TMPDIR +export WORKGFS=$WORKDIR/benchmarks +#MTOOL export TMPGFS=$MTOOL_STEP_WORKSPACE +# Local file system (if preferred): +export TMPLOC=$TMPGFS +echo TMPGFS=$TMPGFS +echo TMPLOC=$TMPLOC + +# Local disks synchronization : +# --------------------------- +export ISYNC=0 +if [ "$MTOOL_IS" = "ON" ] ; then +# synchronization is needed anyway between the steps + export ISYNC=1 +elif [ $NNODES -gt 1 ] && [ "$TMPLOC" != "$TMPGFS" ] ; then +# Local disk synchronization needed: + export ISYNC=1 +fi +echo ISYNC=$ISYNC + +# Miscellaneous : +# ------------- + +# ============================================================================= + +# USER PREFERENCES +# ================ + +#export NAMELDIR=/home/gmap/mrpm/khatib/pack/48t1_main.01#myref/run/cy47.forecast_arome_e700/Namelists +export NAMELDIR=$TESTDIR/Namelists + +HOMEPACK=${HOMEPACK:=$HOME/pack} +export BINDIR=$HOMEPACK/$MYLIB/bin +#export BINDIR=/home/gmap/mrpm/khatib/pack/48t1_main.01#myref/bin +OUTPUTDIR=${OUTPUTDIR:-$PWD} #No cd command have been done before this line + + + +export DATADIR=/scratch/work/khatib/data/cy47.forecast_arome_e700 +#export REFDIR=/home/gmap/mrpm/khatib/benchmarks/apps/modules/cy47.forecast_arome_e700/References +export TOOLSDIR=/home/gmap/mrpm/khatib/benchmarks/tools +#export ROOTDIR_ODB=/home/gmap/mrpm/khatib/odbpools/36t1_bench/cy47.forecast_arome_e700 + +# Check reliability of auxilary directories : +# ----------------------------------------- +ierr=0 +#for var in NAMELDIR BINDIR DATADIR REFDIR TOOLSDIR ; do +for var in NAMELDIR BINDIR DATADIR TOOLSDIR ; do + eval "dir=\$$var" + if [ ! "$dir" ] ; then + echo "$var is not set." + ierr=1 + fi + if [ $ierr -ne 0 ] ; then + exit 1 + fi +done +ierr=0 +for dir in $NAMELDIR $BINDIR $REFDIR $TOOLSDIR ; do + if [ ! -d $dir ] ; then + echo "$dir does not exists." + ierr=1 + fi + if [ $ierr -ne 0 ] ; then + exit 1 + fi +done + +echo TOOLSDIR=$TOOLSDIR +echo NAMELDIR=$NAMELDIR +echo DATADIR=$DATADIR +#echo REFDIR=$REFDIR +echo BINDIR=$BINDIR +#echo ROOTDIR_ODB=$ROOTDIR_ODB + +export PATH=$TOOLSDIR:$PATH +export TOOLSDIR +export DATADIR + +# Software default environment variables : +# -------------------------------------- +set -x +export DR_HOOK=0 +export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_SILENT=1 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export MPL_MBX_SIZE=2048000000 +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export EC_MEMINFO=0 +export OPENBLAS_NUM_THREADS=1 +export MKL_CBWR="AUTO,STRICT" +export MKL_NUM_THREADS=1 +export MKL_DEBUG_CPU_TYPE=5 +set +x + +# Profilers management : +# -------------------- +# FTRACE_JOB : profiler switch +# =0 : no profiler +# =1 : integrated DrHook profiler +# =2 : specific profiler +# +export FTRACE_JOB=1 +echo "FTRACE_JOB=$FTRACE_JOB" + +if [ $FTRACE_JOB -ne 0 ] ; then +# profilings main directory: + if [ -d $JOB_INITDIR ] ; then +# Use the initial job's dir + FTRACE_DIR=$JOB_INITDIR + else +# Set one : + FTRACEDIR= + if [ ! "$FTRACEDIR" ] ; then + echo "FTRACEDIR is not set." + exit 1 + fi + if [ ! -d $FTRACEDIR ] ; then + mkdir -p $FTRACEDIR + if [ $? -ne 0 ] ; then + echo "Can't make directory $FTRACEDIR" + exit 1 + fi + fi + FTRACE_DIR=$FTRACEDIR + fi + SCRATCH_FTRACE_DIR=$TMPGFS +# SCRATCH_FTRACE_DIR=$FTRACE_DIR + if [ $FTRACE_JOB -eq 1 ] ; then + set -x + export DR_HOOK=1 + export DR_HOOK_OPT=prof +# Directory of individual profiles : + export PROFDIR=$SCRATCH_FTRACE_DIR/${JOB_NAME}.d${JOB_ID} +# Merged profiles report filename : + export PROFMRG=$FTRACE_DIR/${JOB_NAME}.h${JOB_ID} + set +x + elif [ $FTRACE_JOB -ge 2 ] ; then + set -x +# Directory of individual profiles : + export PROFDIR=$SCRATCH_FTRACE_DIR/${JOB_NAME}.f${JOB_ID} +# Merged profiles report filename : + export PROFMRG=$FTRACE_DIR/${JOB_NAME}.t${JOB_ID} + set +x + fi +fi + +set +x + +# Listings : +# -------- +set -x +export ECHO_MPSH=OFF +export OUTPUT_LISTING=YES +export LOGDIR=$JOB_INITDIR/${JOB_NAME}.l${JOB_ID} +set +x + +# ODB archives : +# ------------ +# if set to 1, archived Odbs will be gzipped : +set -x +export ARCHIVE_AND_ZIP_ODB=0 +set +x + +# Directory for application output data files : +# ------------------------------------------- +echo +OUTDIR= +OUTDIR=${OUTDIR:=$TMPGFS} +if [ "$TMPGFS" != "$TMPLOC" ] ; then + if [ "$OUTDIR" = "$TMPLOC" ] ; then + echo "Output files on LOCAL file system" + elif [ "$OUTDIR" = "$TMPGFS" ] ; then + echo "Output files on GLOBAL file system" + else + echo "Output files on directory : $OUTDIR" + fi +else + echo "Output files on directory : $OUTDIR" +fi + +# NFS temporary directory for small I/Os +echo +TMPNFS=$(mktemp -d --tmpdir=/tmp/$LOGNAME) +if [ -d $TMPNFS ] ; then + echo "temporary directory on NFS for small I/Os : $TMPNFS" +else + TMPNFS="." +fi + +# ============================================================================= + +# APPLICATION TUNING +# ================== + +# ARPEGE : Forecast +# ***************** + +mkdir -p $TMPLOC +if [ $ISYNC -gt 0 ] ; then + mkdir -p $TMPGFS + cd $TMPGFS +else + cd $TMPLOC +fi + +# Driver-specific environment variables : +# ------------------------------------- +set -x +NAMELIST=namel_previ.48 +CTRLLIST=extra_namelists48.list +LINKS=links_inline48.scpt +EXECUTABLE=MASTERODB +#REFLIST=$REFDIR/forecast.out +EXPLIST=./NODE.001_01 +set +x + +#MTOOL common join=step_2 + +# Namelists modifications : +# ----------------------- + +set -x + +# Number of MPI tasks for the I/O server : +NPROC_IO=$NTASKS_IO + +# Remaining number of MPI tasks : +NPROC=$((MPI_TASKS-NPROC_IO)) + +# Memory cache optimisation: +NPROMA=-16 +NFPROMA=-24 + +# Overall scalar optimisation: +LOPT_SCALAR=.TRUE. + +# Output packing distribution: +NSTROUT=${NPROC} +NSTRIN=${NPROC} + +NPRGPEW=16 +#NPRGPNS=((NPROC/NPRGPEW)) +NPRTRV=16 +#NPRTRW=((NPROC/NPRTRV)) + +set +x + +cat > namelist_mods2 <<EOF + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + LSEDIC=.TRUE., + / + &NAM_PARAM_MFSHALLn + / + &NAMPARAR + LOSEDIC=-, + CFRAC_ICE_ADJUST=-, + CFRAC_ICE_SHALLOW_MF=-, + CSEDIM=-, + CSNOWRIMING=-, + LCONVHG=-, + LCRFLIMIT=-, + LEVLIMIT=-, + LFEEDBACKT=-, + LNULLWETG=-, + LNULLWETH=-, + LSEDIM_AFTER=-, + LWETGPOST=-, + LWETHPOST=-, + NMAXITER_MICRO=-, + XFRACM90=-, + XMRSTEP=-, + XSPLIT_MAXCFL=-, + XTSTEP_TS=-, + LCRIAUTI=-, + RCRIAUTC=-, + RCRIAUTI=-, + RT0CRIAUTI=-, + / + &NAMTRANS + LFFTW=.TRUE., + / + &NAMPAR0 + NPRINTLEV=1, + LOPT_SCALAR=${LOPT_SCALAR}, + MBX_SIZE=2048000000, + NPROC=${NPROC}, + NPRGPNS=-, + NPRGPEW=-, + NPRTRW=-, + NPRTRV=-, + / + &NAMDIM + NPROMA=$NPROMA, + / + &NAMFPSC2 + NFPROMA=$NFPROMA, + / + &NAMFPSC2_DEP + NFPROMA_DEP=$NFPROMA, + / + &NAMPAR1 + LSPLIT=.TRUE., + NSTRIN=${NSTRIN}, + NSTROUT=${NSTROUT}, + / + &NAMFA + CMODEL=' ', + / + &NAMIAU + LIAU=.FALSE., + / + &NAMARG + CNMEXP='0000', + / + &NAMCT0 + CSCRIPT_LAMRTC=' ', + CSCRIPT_PPSERVER=' ', + CFPNCF='ECHFP', + NSDITS(0)=0, + NFRSDI=4, + NFPOS=1, + / + &NAMCT1 + N1POS=1, + / + &NAMFPC + CFPDIR='${OUTDIR}/PF', + / + &NAMOPH + CFNHWF='${OUTDIR}/ECHIS', + CFPATH='${OUTDIR}/', + / + &NAMIO_SERV + NPROC_IO=${NPROC_IO}, + NMSG_LEVEL_SERVER=1, + NMSG_LEVEL_CLIENT=1, + NPROCESS_LEVEL=5, + / + &NAMRIP + CSTOP='h24', + TSTEP=50., + / +EOF +cat namelist_mods2 > namelist_modset +\rm -f namelist_mods2 +echo +echo Namelists adaptations : +cat namelist_modset +echo + +set +x +cp $NAMELDIR/$NAMELIST namelist +perl -w $TOOLSDIR/xpnam namelist --dfile=namelist_modset +set -x +echo +/bin/cat namelist.new +set +x +\rm -f namelist_modset namelist +\mv namelist.new fort.4 +set -x + +#MTOOL common + +# ============================================================================= + +# DRIVER +# ====== + +# ****************************** +# * fetch initial data files * +# ****************************** + +#MTOOL common join=step_1 + +set -x +$TOOLSDIR/getdata.sh +set +x + +#MTOOL common + +#MTOOL common join=step_2 + +for file in $(cat $NAMELDIR/$CTRLLIST) ; do + set -x + cp $NAMELDIR/$file . + set +x +done +if [ -s $NAMELDIR/$LINKS ] ; then + set -x + cp $NAMELDIR/$LINKS . + chmod 755 $LINKS + . ./$LINKS + \rm $LINKS + set +x +fi + +#MTOOL common + +# *************** +# * Executable * +# *************** + +#MTOOL common join=step_1 + +echo +set -x +cp $BINDIR/$EXECUTABLE . +set +x +if [ ! -f $EXECUTABLE ] ; then + echo "executable $BINDIR/$EXECUTABLE could not be copied." + exit 1 +fi + +#MTOOL common + +# ******************************** +# * Prepare parallel executions * +# ******************************** + +#MTOOL common join=step_2 + +if [ "$LOCAL_STACK_LIMIT" ] ; then + set -x + ulimit -s $LOCAL_STACK_LIMIT + set +x +fi +# for mpsh : +export MPSH_NPES=$NNODES + +# grib_api environment variables may be determined by the executable : +. grib_api_profile $EXECUTABLE + +# Intel mpi fabric setup depending on what is found in the executable : +. intel_mpi_fabric $EXECUTABLE + +#MTOOL common + +set -x +cd $TMPLOC +set +x +. rttov_profile + +# ******************************************************* +# * Unarchive datasets and local disks Synchronisation * +# ******************************************************* + +if [ $ISYNC -eq 0 ] ; then + set -x +#MTOOL common join=step_1 + $TOOLSDIR/input_sync.sh +#MTOOL common + set +x +else + set -x +#MTOOL common join=step_2 + $TOOLSDIR/input_sync.sh +#MTOOL common + set +x +fi + +# *************** +# * Execution * +# *************** + +#MTOOL common join=step_2 + +mkdir -p $OUTDIR +echo +if [ $(echo $LOCAL_MPI_WRAPPER | grep -c mpiauto) -ne 0 ] ; then + set -x + time $LOCAL_MPI_WRAPPER -np $MPI_TASKS -nnp $MPITASKS_PER_NODE -- ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +elif [ "$LOCAL_MPI_WRAPPER" = "srun" ] ; then + set -x + time $LOCAL_MPI_WRAPPER ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +elif [ "$LOCAL_MPI_WRAPPER" ] ; then + set -x + time $LOCAL_MPI_WRAPPER -np $MPI_TASKS ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +else + set -x + time ./$EXECUTABLE \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +fi + +# ********************** +# * Post-processings * +# ********************** + +echo +if [ "$OUTPUT_LISTING" = "YES" ] ; then + set -x + $TOOLSDIR/outsync.sh + set +x +fi + +if [ $FTRACE_JOB -gt 0 ] ; then + set -x + $TOOLSDIR/profsync.sh + set +x +fi + +set -x +ls -l $OUTDIR +set +x + +set -x +#errorcode returned by executable is not reliable (always different from 0) +if grep " NSTEP = 1728 CNT0" NODE.001_01 > /dev/null; then + cp $EXPLIST $OUTPUTDIR/ +else + mkdir $OUTPUTDIR/error + cp $EXPLIST $OUTPUTDIR/error/ +fi +#if [ -f $REFLIST ] && [ -f $EXPLIST ] ; then $TOOLSDIR/diffNODE.001_01 $EXPLIST $REFLIST ; fi +set +x +# **************** +# * Cleanups * +# **************** + +set -x +cd $TMPGFS +$TOOLSDIR/cleansync.sh +set +x + +#MTOOL common + +# **************** +# * Epilogue * +# **************** + +set -x +$TOOLSDIR/epilog.sh +set +x +if [ "$MTOOL_IS" != "ON" ] && [ "$AUTO_CLEAN" = "ON" ] ; then + cd $HOME + \rm -rf $TMPGFS +fi + +#MTOOL step id=step_1 target=FRONTEND +#MTOOL step id=step_2 target=SUPERCOMPUTER diff --git a/tools/conf_tests/big_3D/aro48t3_nam3.sh b/tools/conf_tests/big_3D/aro48t3_nam3.sh new file mode 100644 index 0000000000000000000000000000000000000000..3553057bbc3b01c37f3bd84c89b9f268d35ad72d --- /dev/null +++ b/tools/conf_tests/big_3D/aro48t3_nam3.sh @@ -0,0 +1,661 @@ +#!/bin/bash +#SBATCH -p normal256 +#SBATCH --export=MYLIB,HOMEPACK,TESTDIR +#SBATCH -n 1280 +#SBATCH -c 4 +#SBATCH -N 40 +#SBATCH -t 00:40:00 +#SBATCH --mem=247000 +#SBATCH --exclusiv + +# Job management : +# -------------- +JOB_INITDIR=$SLURM_SUBMIT_DIR +export JOB_NAME=arome_e700 +export JOB_ID=$SLURM_JOB_ID + +echo JOB_INITDIR=$JOB_INITDIR +echo JOB_NAME=$JOB_NAME +echo JOB_ID=$JOB_ID + +# ============================================================================= + +# RESOURCES ALLOCATIONS +# ===================== + +# Number of nodes/mpi-tasks/omp-threads: +# ------------------------------------- +NNODES=$SLURM_JOB_NUM_NODES +# Number of MPI tasks per node: +MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) +# Number of OPEN-MP threads per MPI task: +export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK +# Total number of MPI tasks: +MPI_TASKS=$SLURM_NTASKS +# Number of tasks reserved for the I/O server : 2 (hyperthreaded) nodes +NTASKS_IO=$(($(grep processor /proc/cpuinfo | wc -l)/1/$OMP_NUM_THREADS)) + +echo NNODES=$NNODES +echo MPITASKS_PER_NODE=$MPITASKS_PER_NODE +echo +# Number of MPI tasks and OMP threads used in the application : +echo MPI_TASKS=$MPI_TASKS +echo OMP_NUM_THREADS=$OMP_NUM_THREADS + +# ============================================================================= + +# SYSTEM PREFERENCES +# ================== + +# OMP/MPI submission management : +# ----------------------------- +# LOCAL_MPI_WRAPPER : could be "mpiauto", "mpdrun", "mpiexec" ... or empty string +# LOCAL_STACK_LIMIT : could be "unlimited" or empty string + +set -x +#LOCAL_MPI_WRAPPER="/opt/softs/mpiauto/mpiauto --wrap --wrap-stdeo --wrap-stdeo-pack" +LOCAL_MPI_WRAPPER="/opt/softs/mpiauto/mpiauto" +LOCAL_STACK_LIMIT=unlimited +ulimit -l unlimited +set +x + +# Specific environment variables : +# ------------------------------ +set -x +export OMP_STACKSIZE=4G +export KMP_STACKSIZE=4G +export KMP_MONITOR_STACKSIZE=4G +export I_MPI_HARD_FINALIZE=1 +export I_MPI_SCALABLE_OPTIMIZATION=0 +export I_MPI_DAPL_UD_RNDV_EP_NUM=4 +export I_MPI_SHM_SPIN_COUNT=10 +export I_MPI_SPIN_COUNT=10 +set +x + +# File systems : +# ------------ +# Global file system: +export TMPGFS=$TMPDIR +export WORKGFS=$WORKDIR/benchmarks +#MTOOL export TMPGFS=$MTOOL_STEP_WORKSPACE +# Local file system (if preferred): +export TMPLOC=$TMPGFS +echo TMPGFS=$TMPGFS +echo TMPLOC=$TMPLOC + +# Local disks synchronization : +# --------------------------- +export ISYNC=0 +if [ "$MTOOL_IS" = "ON" ] ; then +# synchronization is needed anyway between the steps + export ISYNC=1 +elif [ $NNODES -gt 1 ] && [ "$TMPLOC" != "$TMPGFS" ] ; then +# Local disk synchronization needed: + export ISYNC=1 +fi +echo ISYNC=$ISYNC + +# Miscellaneous : +# ------------- + +# ============================================================================= + +# USER PREFERENCES +# ================ + +#export NAMELDIR=/home/gmap/mrpm/khatib/pack/48t1_main.01#myref/run/cy47.forecast_arome_e700/Namelists +export NAMELDIR=$TESTDIR/Namelists + +HOMEPACK=${HOMEPACK:=$HOME/pack} +export BINDIR=$HOMEPACK/$MYLIB/bin +#export BINDIR=/home/gmap/mrpm/khatib/pack/48t1_main.01#myref/bin +OUTPUTDIR=${OUTPUTDIR:-$PWD} #No cd command have been done before this line + + + +export DATADIR=/scratch/work/khatib/data/cy47.forecast_arome_e700 +#export REFDIR=/home/gmap/mrpm/khatib/benchmarks/apps/modules/cy47.forecast_arome_e700/References +export TOOLSDIR=/home/gmap/mrpm/khatib/benchmarks/tools +#export ROOTDIR_ODB=/home/gmap/mrpm/khatib/odbpools/36t1_bench/cy47.forecast_arome_e700 + +# Check reliability of auxilary directories : +# ----------------------------------------- +ierr=0 +#for var in NAMELDIR BINDIR DATADIR REFDIR TOOLSDIR ; do +for var in NAMELDIR BINDIR DATADIR TOOLSDIR ; do + eval "dir=\$$var" + if [ ! "$dir" ] ; then + echo "$var is not set." + ierr=1 + fi + if [ $ierr -ne 0 ] ; then + exit 1 + fi +done +ierr=0 +for dir in $NAMELDIR $BINDIR $REFDIR $TOOLSDIR ; do + if [ ! -d $dir ] ; then + echo "$dir does not exists." + ierr=1 + fi + if [ $ierr -ne 0 ] ; then + exit 1 + fi +done + +echo TOOLSDIR=$TOOLSDIR +echo NAMELDIR=$NAMELDIR +echo DATADIR=$DATADIR +#echo REFDIR=$REFDIR +echo BINDIR=$BINDIR +#echo ROOTDIR_ODB=$ROOTDIR_ODB + +export PATH=$TOOLSDIR:$PATH +export TOOLSDIR +export DATADIR + +# Software default environment variables : +# -------------------------------------- +set -x +export DR_HOOK=0 +export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_SILENT=1 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export MPL_MBX_SIZE=2048000000 +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export EC_MEMINFO=0 +export OPENBLAS_NUM_THREADS=1 +export MKL_CBWR="AUTO,STRICT" +export MKL_NUM_THREADS=1 +export MKL_DEBUG_CPU_TYPE=5 +set +x + +# Profilers management : +# -------------------- +# FTRACE_JOB : profiler switch +# =0 : no profiler +# =1 : integrated DrHook profiler +# =2 : specific profiler +# +export FTRACE_JOB=1 +echo "FTRACE_JOB=$FTRACE_JOB" + +if [ $FTRACE_JOB -ne 0 ] ; then +# profilings main directory: + if [ -d $JOB_INITDIR ] ; then +# Use the initial job's dir + FTRACE_DIR=$JOB_INITDIR + else +# Set one : + FTRACEDIR= + if [ ! "$FTRACEDIR" ] ; then + echo "FTRACEDIR is not set." + exit 1 + fi + if [ ! -d $FTRACEDIR ] ; then + mkdir -p $FTRACEDIR + if [ $? -ne 0 ] ; then + echo "Can't make directory $FTRACEDIR" + exit 1 + fi + fi + FTRACE_DIR=$FTRACEDIR + fi + SCRATCH_FTRACE_DIR=$TMPGFS +# SCRATCH_FTRACE_DIR=$FTRACE_DIR + if [ $FTRACE_JOB -eq 1 ] ; then + set -x + export DR_HOOK=1 + export DR_HOOK_OPT=prof +# Directory of individual profiles : + export PROFDIR=$SCRATCH_FTRACE_DIR/${JOB_NAME}.d${JOB_ID} +# Merged profiles report filename : + export PROFMRG=$FTRACE_DIR/${JOB_NAME}.h${JOB_ID} + set +x + elif [ $FTRACE_JOB -ge 2 ] ; then + set -x +# Directory of individual profiles : + export PROFDIR=$SCRATCH_FTRACE_DIR/${JOB_NAME}.f${JOB_ID} +# Merged profiles report filename : + export PROFMRG=$FTRACE_DIR/${JOB_NAME}.t${JOB_ID} + set +x + fi +fi + +set +x + +# Listings : +# -------- +set -x +export ECHO_MPSH=OFF +export OUTPUT_LISTING=YES +export LOGDIR=$JOB_INITDIR/${JOB_NAME}.l${JOB_ID} +set +x + +# ODB archives : +# ------------ +# if set to 1, archived Odbs will be gzipped : +set -x +export ARCHIVE_AND_ZIP_ODB=0 +set +x + +# Directory for application output data files : +# ------------------------------------------- +echo +OUTDIR= +OUTDIR=${OUTDIR:=$TMPGFS} +if [ "$TMPGFS" != "$TMPLOC" ] ; then + if [ "$OUTDIR" = "$TMPLOC" ] ; then + echo "Output files on LOCAL file system" + elif [ "$OUTDIR" = "$TMPGFS" ] ; then + echo "Output files on GLOBAL file system" + else + echo "Output files on directory : $OUTDIR" + fi +else + echo "Output files on directory : $OUTDIR" +fi + +# NFS temporary directory for small I/Os +echo +TMPNFS=$(mktemp -d --tmpdir=/tmp/$LOGNAME) +if [ -d $TMPNFS ] ; then + echo "temporary directory on NFS for small I/Os : $TMPNFS" +else + TMPNFS="." +fi + +# ============================================================================= + +# APPLICATION TUNING +# ================== + +# ARPEGE : Forecast +# ***************** + +mkdir -p $TMPLOC +if [ $ISYNC -gt 0 ] ; then + mkdir -p $TMPGFS + cd $TMPGFS +else + cd $TMPLOC +fi + +# Driver-specific environment variables : +# ------------------------------------- +set -x +NAMELIST=namel_previ.48 +CTRLLIST=extra_namelists48.list +LINKS=links_inline48.scpt +EXECUTABLE=MASTERODB +#REFLIST=$REFDIR/forecast.out +EXPLIST=./NODE.001_01 +set +x + +#MTOOL common join=step_2 + +# Namelists modifications : +# ----------------------- + +set -x + +# Number of MPI tasks for the I/O server : +NPROC_IO=$NTASKS_IO + +# Remaining number of MPI tasks : +NPROC=$((MPI_TASKS-NPROC_IO)) + +# Memory cache optimisation: +NPROMA=-16 +NFPROMA=-24 + +# Overall scalar optimisation: +LOPT_SCALAR=.TRUE. + +# Output packing distribution: +NSTROUT=${NPROC} +NSTRIN=${NPROC} + +NPRGPEW=16 +#NPRGPNS=((NPROC/NPRGPEW)) +NPRTRV=16 +#NPRTRW=((NPROC/NPRTRV)) + +set +x + +cat > namelist_mods2 <<EOF + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + LSEDIC=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + LOSIGMAS=-, + LOSUBG_COND=-, + VSIGQSAT=-, + LOSEDIC=-, + CFRAC_ICE_ADJUST=-, + CFRAC_ICE_SHALLOW_MF=-, + CSEDIM=-, + CSNOWRIMING=-, + LCONVHG=-, + LCRFLIMIT=-, + LEVLIMIT=-, + LFEEDBACKT=-, + LNULLWETG=-, + LNULLWETH=-, + LSEDIM_AFTER=-, + LWETGPOST=-, + LWETHPOST=-, + NMAXITER_MICRO=-, + XFRACM90=-, + XMRSTEP=-, + XSPLIT_MAXCFL=-, + XTSTEP_TS=-, + LCRIAUTI=-, + RCRIAUTC=-, + RCRIAUTI=-, + RT0CRIAUTI=-, + / + &NAMTRANS + LFFTW=.TRUE., + / + &NAMPAR0 + NPRINTLEV=1, + LOPT_SCALAR=${LOPT_SCALAR}, + MBX_SIZE=2048000000, + NPROC=${NPROC}, + NPRGPNS=-, + NPRGPEW=-, + NPRTRW=-, + NPRTRV=-, + / + &NAMDIM + NPROMA=$NPROMA, + / + &NAMFPSC2 + NFPROMA=$NFPROMA, + / + &NAMFPSC2_DEP + NFPROMA_DEP=$NFPROMA, + / + &NAMPAR1 + LSPLIT=.TRUE., + NSTRIN=${NSTRIN}, + NSTROUT=${NSTROUT}, + / + &NAMFA + CMODEL=' ', + / + &NAMIAU + LIAU=.FALSE., + / + &NAMARG + CNMEXP='0000', + / + &NAMCT0 + CSCRIPT_LAMRTC=' ', + CSCRIPT_PPSERVER=' ', + CFPNCF='ECHFP', + NSDITS(0)=0, + NFRSDI=4, + NFPOS=1, + / + &NAMCT1 + N1POS=1, + / + &NAMFPC + CFPDIR='${OUTDIR}/PF', + / + &NAMOPH + CFNHWF='${OUTDIR}/ECHIS', + CFPATH='${OUTDIR}/', + / + &NAMIO_SERV + NPROC_IO=${NPROC_IO}, + NMSG_LEVEL_SERVER=1, + NMSG_LEVEL_CLIENT=1, + NPROCESS_LEVEL=5, + / + &NAMRIP + CSTOP='h24', + TSTEP=50., + / +EOF +cat namelist_mods2 > namelist_modset +\rm -f namelist_mods2 +echo +echo Namelists adaptations : +cat namelist_modset +echo + +set +x +cp $NAMELDIR/$NAMELIST namelist +perl -w $TOOLSDIR/xpnam namelist --dfile=namelist_modset +set -x +echo +/bin/cat namelist.new +set +x +\rm -f namelist_modset namelist +\mv namelist.new fort.4 +set -x + +#MTOOL common + +# ============================================================================= + +# DRIVER +# ====== + +# ****************************** +# * fetch initial data files * +# ****************************** + +#MTOOL common join=step_1 + +set -x +$TOOLSDIR/getdata.sh +set +x + +#MTOOL common + +#MTOOL common join=step_2 + +for file in $(cat $NAMELDIR/$CTRLLIST) ; do + set -x + cp $NAMELDIR/$file . + set +x +done +if [ -s $NAMELDIR/$LINKS ] ; then + set -x + cp $NAMELDIR/$LINKS . + chmod 755 $LINKS + . ./$LINKS + \rm $LINKS + set +x +fi + +#MTOOL common + +# *************** +# * Executable * +# *************** + +#MTOOL common join=step_1 + +echo +set -x +cp $BINDIR/$EXECUTABLE . +set +x +if [ ! -f $EXECUTABLE ] ; then + echo "executable $BINDIR/$EXECUTABLE could not be copied." + exit 1 +fi + +#MTOOL common + +# ******************************** +# * Prepare parallel executions * +# ******************************** + +#MTOOL common join=step_2 + +if [ "$LOCAL_STACK_LIMIT" ] ; then + set -x + ulimit -s $LOCAL_STACK_LIMIT + set +x +fi +# for mpsh : +export MPSH_NPES=$NNODES + +# grib_api environment variables may be determined by the executable : +. grib_api_profile $EXECUTABLE + +# Intel mpi fabric setup depending on what is found in the executable : +. intel_mpi_fabric $EXECUTABLE + +#MTOOL common + +set -x +cd $TMPLOC +set +x +. rttov_profile + +# ******************************************************* +# * Unarchive datasets and local disks Synchronisation * +# ******************************************************* + +if [ $ISYNC -eq 0 ] ; then + set -x +#MTOOL common join=step_1 + $TOOLSDIR/input_sync.sh +#MTOOL common + set +x +else + set -x +#MTOOL common join=step_2 + $TOOLSDIR/input_sync.sh +#MTOOL common + set +x +fi + +# *************** +# * Execution * +# *************** + +#MTOOL common join=step_2 + +mkdir -p $OUTDIR +echo +if [ $(echo $LOCAL_MPI_WRAPPER | grep -c mpiauto) -ne 0 ] ; then + set -x + time $LOCAL_MPI_WRAPPER -np $MPI_TASKS -nnp $MPITASKS_PER_NODE -- ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +elif [ "$LOCAL_MPI_WRAPPER" = "srun" ] ; then + set -x + time $LOCAL_MPI_WRAPPER ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +elif [ "$LOCAL_MPI_WRAPPER" ] ; then + set -x + time $LOCAL_MPI_WRAPPER -np $MPI_TASKS ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +else + set -x + time ./$EXECUTABLE \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +fi + +# ********************** +# * Post-processings * +# ********************** + +echo +if [ "$OUTPUT_LISTING" = "YES" ] ; then + set -x + $TOOLSDIR/outsync.sh + set +x +fi + +if [ $FTRACE_JOB -gt 0 ] ; then + set -x + $TOOLSDIR/profsync.sh + set +x +fi + +set -x +ls -l $OUTDIR +set +x + +set -x +#errorcode returned by executable is not reliable (always different from 0) +if grep " NSTEP = 1728 CNT0" NODE.001_01 > /dev/null; then + cp $EXPLIST $OUTPUTDIR/ +else + mkdir $OUTPUTDIR/error + cp $EXPLIST $OUTPUTDIR/error/ +fi +#if [ -f $REFLIST ] && [ -f $EXPLIST ] ; then $TOOLSDIR/diffNODE.001_01 $EXPLIST $REFLIST ; fi +set +x +# **************** +# * Cleanups * +# **************** + +set -x +cd $TMPGFS +$TOOLSDIR/cleansync.sh +set +x + +#MTOOL common + +# **************** +# * Epilogue * +# **************** + +set -x +$TOOLSDIR/epilog.sh +set +x +if [ "$MTOOL_IS" != "ON" ] && [ "$AUTO_CLEAN" = "ON" ] ; then + cd $HOME + \rm -rf $TMPGFS +fi + +#MTOOL step id=step_1 target=FRONTEND +#MTOOL step id=step_2 target=SUPERCOMPUTER diff --git a/tools/conf_tests/big_3D/aro48t3_nam4.sh b/tools/conf_tests/big_3D/aro48t3_nam4.sh new file mode 100644 index 0000000000000000000000000000000000000000..b58b396f0f7491cf59006645d7418d37f2a5c1a4 --- /dev/null +++ b/tools/conf_tests/big_3D/aro48t3_nam4.sh @@ -0,0 +1,661 @@ +#!/bin/bash +#SBATCH -p normal256 +#SBATCH --export=MYLIB,HOMEPACK,TESTDIR +#SBATCH -n 1280 +#SBATCH -c 4 +#SBATCH -N 40 +#SBATCH -t 00:40:00 +#SBATCH --mem=247000 +#SBATCH --exclusiv + +# Job management : +# -------------- +JOB_INITDIR=$SLURM_SUBMIT_DIR +export JOB_NAME=arome_e700 +export JOB_ID=$SLURM_JOB_ID + +echo JOB_INITDIR=$JOB_INITDIR +echo JOB_NAME=$JOB_NAME +echo JOB_ID=$JOB_ID + +# ============================================================================= + +# RESOURCES ALLOCATIONS +# ===================== + +# Number of nodes/mpi-tasks/omp-threads: +# ------------------------------------- +NNODES=$SLURM_JOB_NUM_NODES +# Number of MPI tasks per node: +MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) +# Number of OPEN-MP threads per MPI task: +export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK +# Total number of MPI tasks: +MPI_TASKS=$SLURM_NTASKS +# Number of tasks reserved for the I/O server : 2 (hyperthreaded) nodes +NTASKS_IO=$(($(grep processor /proc/cpuinfo | wc -l)/1/$OMP_NUM_THREADS)) + +echo NNODES=$NNODES +echo MPITASKS_PER_NODE=$MPITASKS_PER_NODE +echo +# Number of MPI tasks and OMP threads used in the application : +echo MPI_TASKS=$MPI_TASKS +echo OMP_NUM_THREADS=$OMP_NUM_THREADS + +# ============================================================================= + +# SYSTEM PREFERENCES +# ================== + +# OMP/MPI submission management : +# ----------------------------- +# LOCAL_MPI_WRAPPER : could be "mpiauto", "mpdrun", "mpiexec" ... or empty string +# LOCAL_STACK_LIMIT : could be "unlimited" or empty string + +set -x +#LOCAL_MPI_WRAPPER="/opt/softs/mpiauto/mpiauto --wrap --wrap-stdeo --wrap-stdeo-pack" +LOCAL_MPI_WRAPPER="/opt/softs/mpiauto/mpiauto" +LOCAL_STACK_LIMIT=unlimited +ulimit -l unlimited +set +x + +# Specific environment variables : +# ------------------------------ +set -x +export OMP_STACKSIZE=4G +export KMP_STACKSIZE=4G +export KMP_MONITOR_STACKSIZE=4G +export I_MPI_HARD_FINALIZE=1 +export I_MPI_SCALABLE_OPTIMIZATION=0 +export I_MPI_DAPL_UD_RNDV_EP_NUM=4 +export I_MPI_SHM_SPIN_COUNT=10 +export I_MPI_SPIN_COUNT=10 +set +x + +# File systems : +# ------------ +# Global file system: +export TMPGFS=$TMPDIR +export WORKGFS=$WORKDIR/benchmarks +#MTOOL export TMPGFS=$MTOOL_STEP_WORKSPACE +# Local file system (if preferred): +export TMPLOC=$TMPGFS +echo TMPGFS=$TMPGFS +echo TMPLOC=$TMPLOC + +# Local disks synchronization : +# --------------------------- +export ISYNC=0 +if [ "$MTOOL_IS" = "ON" ] ; then +# synchronization is needed anyway between the steps + export ISYNC=1 +elif [ $NNODES -gt 1 ] && [ "$TMPLOC" != "$TMPGFS" ] ; then +# Local disk synchronization needed: + export ISYNC=1 +fi +echo ISYNC=$ISYNC + +# Miscellaneous : +# ------------- + +# ============================================================================= + +# USER PREFERENCES +# ================ + +#export NAMELDIR=/home/gmap/mrpm/khatib/pack/48t1_main.01#myref/run/cy47.forecast_arome_e700/Namelists +export NAMELDIR=$TESTDIR/Namelists + +HOMEPACK=${HOMEPACK:=$HOME/pack} +export BINDIR=$HOMEPACK/$MYLIB/bin +#export BINDIR=/home/gmap/mrpm/khatib/pack/48t1_main.01#myref/bin +OUTPUTDIR=${OUTPUTDIR:-$PWD} #No cd command have been done before this line + + + +export DATADIR=/scratch/work/khatib/data/cy47.forecast_arome_e700 +#export REFDIR=/home/gmap/mrpm/khatib/benchmarks/apps/modules/cy47.forecast_arome_e700/References +export TOOLSDIR=/home/gmap/mrpm/khatib/benchmarks/tools +#export ROOTDIR_ODB=/home/gmap/mrpm/khatib/odbpools/36t1_bench/cy47.forecast_arome_e700 + +# Check reliability of auxilary directories : +# ----------------------------------------- +ierr=0 +#for var in NAMELDIR BINDIR DATADIR REFDIR TOOLSDIR ; do +for var in NAMELDIR BINDIR DATADIR TOOLSDIR ; do + eval "dir=\$$var" + if [ ! "$dir" ] ; then + echo "$var is not set." + ierr=1 + fi + if [ $ierr -ne 0 ] ; then + exit 1 + fi +done +ierr=0 +for dir in $NAMELDIR $BINDIR $REFDIR $TOOLSDIR ; do + if [ ! -d $dir ] ; then + echo "$dir does not exists." + ierr=1 + fi + if [ $ierr -ne 0 ] ; then + exit 1 + fi +done + +echo TOOLSDIR=$TOOLSDIR +echo NAMELDIR=$NAMELDIR +echo DATADIR=$DATADIR +#echo REFDIR=$REFDIR +echo BINDIR=$BINDIR +#echo ROOTDIR_ODB=$ROOTDIR_ODB + +export PATH=$TOOLSDIR:$PATH +export TOOLSDIR +export DATADIR + +# Software default environment variables : +# -------------------------------------- +set -x +export DR_HOOK=0 +export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_SILENT=1 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export MPL_MBX_SIZE=2048000000 +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export EC_MEMINFO=0 +export OPENBLAS_NUM_THREADS=1 +export MKL_CBWR="AUTO,STRICT" +export MKL_NUM_THREADS=1 +export MKL_DEBUG_CPU_TYPE=5 +set +x + +# Profilers management : +# -------------------- +# FTRACE_JOB : profiler switch +# =0 : no profiler +# =1 : integrated DrHook profiler +# =2 : specific profiler +# +export FTRACE_JOB=1 +echo "FTRACE_JOB=$FTRACE_JOB" + +if [ $FTRACE_JOB -ne 0 ] ; then +# profilings main directory: + if [ -d $JOB_INITDIR ] ; then +# Use the initial job's dir + FTRACE_DIR=$JOB_INITDIR + else +# Set one : + FTRACEDIR= + if [ ! "$FTRACEDIR" ] ; then + echo "FTRACEDIR is not set." + exit 1 + fi + if [ ! -d $FTRACEDIR ] ; then + mkdir -p $FTRACEDIR + if [ $? -ne 0 ] ; then + echo "Can't make directory $FTRACEDIR" + exit 1 + fi + fi + FTRACE_DIR=$FTRACEDIR + fi + SCRATCH_FTRACE_DIR=$TMPGFS +# SCRATCH_FTRACE_DIR=$FTRACE_DIR + if [ $FTRACE_JOB -eq 1 ] ; then + set -x + export DR_HOOK=1 + export DR_HOOK_OPT=prof +# Directory of individual profiles : + export PROFDIR=$SCRATCH_FTRACE_DIR/${JOB_NAME}.d${JOB_ID} +# Merged profiles report filename : + export PROFMRG=$FTRACE_DIR/${JOB_NAME}.h${JOB_ID} + set +x + elif [ $FTRACE_JOB -ge 2 ] ; then + set -x +# Directory of individual profiles : + export PROFDIR=$SCRATCH_FTRACE_DIR/${JOB_NAME}.f${JOB_ID} +# Merged profiles report filename : + export PROFMRG=$FTRACE_DIR/${JOB_NAME}.t${JOB_ID} + set +x + fi +fi + +set +x + +# Listings : +# -------- +set -x +export ECHO_MPSH=OFF +export OUTPUT_LISTING=YES +export LOGDIR=$JOB_INITDIR/${JOB_NAME}.l${JOB_ID} +set +x + +# ODB archives : +# ------------ +# if set to 1, archived Odbs will be gzipped : +set -x +export ARCHIVE_AND_ZIP_ODB=0 +set +x + +# Directory for application output data files : +# ------------------------------------------- +echo +OUTDIR= +OUTDIR=${OUTDIR:=$TMPGFS} +if [ "$TMPGFS" != "$TMPLOC" ] ; then + if [ "$OUTDIR" = "$TMPLOC" ] ; then + echo "Output files on LOCAL file system" + elif [ "$OUTDIR" = "$TMPGFS" ] ; then + echo "Output files on GLOBAL file system" + else + echo "Output files on directory : $OUTDIR" + fi +else + echo "Output files on directory : $OUTDIR" +fi + +# NFS temporary directory for small I/Os +echo +TMPNFS=$(mktemp -d --tmpdir=/tmp/$LOGNAME) +if [ -d $TMPNFS ] ; then + echo "temporary directory on NFS for small I/Os : $TMPNFS" +else + TMPNFS="." +fi + +# ============================================================================= + +# APPLICATION TUNING +# ================== + +# ARPEGE : Forecast +# ***************** + +mkdir -p $TMPLOC +if [ $ISYNC -gt 0 ] ; then + mkdir -p $TMPGFS + cd $TMPGFS +else + cd $TMPLOC +fi + +# Driver-specific environment variables : +# ------------------------------------- +set -x +NAMELIST=namel_previ.48 +CTRLLIST=extra_namelists48.list +LINKS=links_inline48.scpt +EXECUTABLE=MASTERODB +#REFLIST=$REFDIR/forecast.out +EXPLIST=./NODE.001_01 +set +x + +#MTOOL common join=step_2 + +# Namelists modifications : +# ----------------------- + +set -x + +# Number of MPI tasks for the I/O server : +NPROC_IO=$NTASKS_IO + +# Remaining number of MPI tasks : +NPROC=$((MPI_TASKS-NPROC_IO)) + +# Memory cache optimisation: +NPROMA=-16 +NFPROMA=-24 + +# Overall scalar optimisation: +LOPT_SCALAR=.TRUE. + +# Output packing distribution: +NSTROUT=${NPROC} +NSTRIN=${NPROC} + +NPRGPEW=16 +#NPRGPNS=((NPROC/NPRGPEW)) +NPRTRV=16 +#NPRTRW=((NPROC/NPRTRV)) + +set +x + +cat > namelist_mods2 <<EOF + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + LSEDIC=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + LOSIGMAS=-, + LOSUBG_COND=-, + VSIGQSAT=-, + LOSEDIC=-, + CFRAC_ICE_ADJUST=-, + CFRAC_ICE_SHALLOW_MF=-, + CSEDIM=-, + CSNOWRIMING=-, + LCONVHG=-, + LCRFLIMIT=-, + LEVLIMIT=-, + LFEEDBACKT=-, + LNULLWETG=-, + LNULLWETH=-, + LSEDIM_AFTER=-, + LWETGPOST=-, + LWETHPOST=-, + NMAXITER_MICRO=-, + XFRACM90=-, + XMRSTEP=-, + XSPLIT_MAXCFL=-, + XTSTEP_TS=-, + LCRIAUTI=-, + RCRIAUTC=-, + RCRIAUTI=-, + RT0CRIAUTI=-, + / + &NAMTRANS + LFFTW=.TRUE., + / + &NAMPAR0 + NPRINTLEV=1, + LOPT_SCALAR=${LOPT_SCALAR}, + MBX_SIZE=2048000000, + NPROC=${NPROC}, + NPRGPNS=-, + NPRGPEW=-, + NPRTRW=-, + NPRTRV=-, + / + &NAMDIM + NPROMA=$NPROMA, + / + &NAMFPSC2 + NFPROMA=$NFPROMA, + / + &NAMFPSC2_DEP + NFPROMA_DEP=$NFPROMA, + / + &NAMPAR1 + LSPLIT=.TRUE., + NSTRIN=${NSTRIN}, + NSTROUT=${NSTROUT}, + / + &NAMFA + CMODEL=' ', + / + &NAMIAU + LIAU=.FALSE., + / + &NAMARG + CNMEXP='0000', + / + &NAMCT0 + CSCRIPT_LAMRTC=' ', + CSCRIPT_PPSERVER=' ', + CFPNCF='ECHFP', + NSDITS(0)=0, + NFRSDI=4, + NFPOS=1, + / + &NAMCT1 + N1POS=1, + / + &NAMFPC + CFPDIR='${OUTDIR}/PF', + / + &NAMOPH + CFNHWF='${OUTDIR}/ECHIS', + CFPATH='${OUTDIR}/', + / + &NAMIO_SERV + NPROC_IO=${NPROC_IO}, + NMSG_LEVEL_SERVER=1, + NMSG_LEVEL_CLIENT=1, + NPROCESS_LEVEL=5, + / + &NAMRIP + CSTOP='h24', + TSTEP=50., + / +EOF +cat namelist_mods2 > namelist_modset +\rm -f namelist_mods2 +echo +echo Namelists adaptations : +cat namelist_modset +echo + +set +x +cp $NAMELDIR/$NAMELIST namelist +perl -w $TOOLSDIR/xpnam namelist --dfile=namelist_modset +set -x +echo +/bin/cat namelist.new +set +x +\rm -f namelist_modset namelist +\mv namelist.new fort.4 +set -x + +#MTOOL common + +# ============================================================================= + +# DRIVER +# ====== + +# ****************************** +# * fetch initial data files * +# ****************************** + +#MTOOL common join=step_1 + +set -x +$TOOLSDIR/getdata.sh +set +x + +#MTOOL common + +#MTOOL common join=step_2 + +for file in $(cat $NAMELDIR/$CTRLLIST) ; do + set -x + cp $NAMELDIR/$file . + set +x +done +if [ -s $NAMELDIR/$LINKS ] ; then + set -x + cp $NAMELDIR/$LINKS . + chmod 755 $LINKS + . ./$LINKS + \rm $LINKS + set +x +fi + +#MTOOL common + +# *************** +# * Executable * +# *************** + +#MTOOL common join=step_1 + +echo +set -x +cp $BINDIR/$EXECUTABLE . +set +x +if [ ! -f $EXECUTABLE ] ; then + echo "executable $BINDIR/$EXECUTABLE could not be copied." + exit 1 +fi + +#MTOOL common + +# ******************************** +# * Prepare parallel executions * +# ******************************** + +#MTOOL common join=step_2 + +if [ "$LOCAL_STACK_LIMIT" ] ; then + set -x + ulimit -s $LOCAL_STACK_LIMIT + set +x +fi +# for mpsh : +export MPSH_NPES=$NNODES + +# grib_api environment variables may be determined by the executable : +. grib_api_profile $EXECUTABLE + +# Intel mpi fabric setup depending on what is found in the executable : +. intel_mpi_fabric $EXECUTABLE + +#MTOOL common + +set -x +cd $TMPLOC +set +x +. rttov_profile + +# ******************************************************* +# * Unarchive datasets and local disks Synchronisation * +# ******************************************************* + +if [ $ISYNC -eq 0 ] ; then + set -x +#MTOOL common join=step_1 + $TOOLSDIR/input_sync.sh +#MTOOL common + set +x +else + set -x +#MTOOL common join=step_2 + $TOOLSDIR/input_sync.sh +#MTOOL common + set +x +fi + +# *************** +# * Execution * +# *************** + +#MTOOL common join=step_2 + +mkdir -p $OUTDIR +echo +if [ $(echo $LOCAL_MPI_WRAPPER | grep -c mpiauto) -ne 0 ] ; then + set -x + time $LOCAL_MPI_WRAPPER -np $MPI_TASKS -nnp $MPITASKS_PER_NODE -- ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +elif [ "$LOCAL_MPI_WRAPPER" = "srun" ] ; then + set -x + time $LOCAL_MPI_WRAPPER ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +elif [ "$LOCAL_MPI_WRAPPER" ] ; then + set -x + time $LOCAL_MPI_WRAPPER -np $MPI_TASKS ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +else + set -x + time ./$EXECUTABLE \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +fi + +# ********************** +# * Post-processings * +# ********************** + +echo +if [ "$OUTPUT_LISTING" = "YES" ] ; then + set -x + $TOOLSDIR/outsync.sh + set +x +fi + +if [ $FTRACE_JOB -gt 0 ] ; then + set -x + $TOOLSDIR/profsync.sh + set +x +fi + +set -x +ls -l $OUTDIR +set +x + +set -x +#errorcode returned by executable is not reliable (always different from 0) +if grep " NSTEP = 1728 CNT0" NODE.001_01 > /dev/null; then + cp $EXPLIST $OUTPUTDIR/ +else + mkdir $OUTPUTDIR/error + cp $EXPLIST $OUTPUTDIR/error/ +fi +#if [ -f $REFLIST ] && [ -f $EXPLIST ] ; then $TOOLSDIR/diffNODE.001_01 $EXPLIST $REFLIST ; fi +set +x +# **************** +# * Cleanups * +# **************** + +set -x +cd $TMPGFS +$TOOLSDIR/cleansync.sh +set +x + +#MTOOL common + +# **************** +# * Epilogue * +# **************** + +set -x +$TOOLSDIR/epilog.sh +set +x +if [ "$MTOOL_IS" != "ON" ] && [ "$AUTO_CLEAN" = "ON" ] ; then + cd $HOME + \rm -rf $TMPGFS +fi + +#MTOOL step id=step_1 target=FRONTEND +#MTOOL step id=step_2 target=SUPERCOMPUTER diff --git a/tools/conf_tests/big_3D/aro48t3_nam5.sh b/tools/conf_tests/big_3D/aro48t3_nam5.sh new file mode 100644 index 0000000000000000000000000000000000000000..321f19f25f154334348481d0d0169653244de8eb --- /dev/null +++ b/tools/conf_tests/big_3D/aro48t3_nam5.sh @@ -0,0 +1,663 @@ +#!/bin/bash +#SBATCH -p normal256 +#SBATCH --export=MYLIB,HOMEPACK,TESTDIR +#SBATCH -n 1280 +#SBATCH -c 4 +#SBATCH -N 40 +#SBATCH -t 00:40:00 +#SBATCH --mem=247000 +#SBATCH --exclusiv + +# Job management : +# -------------- +JOB_INITDIR=$SLURM_SUBMIT_DIR +export JOB_NAME=arome_e700 +export JOB_ID=$SLURM_JOB_ID + +echo JOB_INITDIR=$JOB_INITDIR +echo JOB_NAME=$JOB_NAME +echo JOB_ID=$JOB_ID + +# ============================================================================= + +# RESOURCES ALLOCATIONS +# ===================== + +# Number of nodes/mpi-tasks/omp-threads: +# ------------------------------------- +NNODES=$SLURM_JOB_NUM_NODES +# Number of MPI tasks per node: +MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) +# Number of OPEN-MP threads per MPI task: +export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK +# Total number of MPI tasks: +MPI_TASKS=$SLURM_NTASKS +# Number of tasks reserved for the I/O server : 2 (hyperthreaded) nodes +NTASKS_IO=$(($(grep processor /proc/cpuinfo | wc -l)/1/$OMP_NUM_THREADS)) + +echo NNODES=$NNODES +echo MPITASKS_PER_NODE=$MPITASKS_PER_NODE +echo +# Number of MPI tasks and OMP threads used in the application : +echo MPI_TASKS=$MPI_TASKS +echo OMP_NUM_THREADS=$OMP_NUM_THREADS + +# ============================================================================= + +# SYSTEM PREFERENCES +# ================== + +# OMP/MPI submission management : +# ----------------------------- +# LOCAL_MPI_WRAPPER : could be "mpiauto", "mpdrun", "mpiexec" ... or empty string +# LOCAL_STACK_LIMIT : could be "unlimited" or empty string + +set -x +#LOCAL_MPI_WRAPPER="/opt/softs/mpiauto/mpiauto --wrap --wrap-stdeo --wrap-stdeo-pack" +LOCAL_MPI_WRAPPER="/opt/softs/mpiauto/mpiauto" +LOCAL_STACK_LIMIT=unlimited +ulimit -l unlimited +set +x + +# Specific environment variables : +# ------------------------------ +set -x +export OMP_STACKSIZE=4G +export KMP_STACKSIZE=4G +export KMP_MONITOR_STACKSIZE=4G +export I_MPI_HARD_FINALIZE=1 +export I_MPI_SCALABLE_OPTIMIZATION=0 +export I_MPI_DAPL_UD_RNDV_EP_NUM=4 +export I_MPI_SHM_SPIN_COUNT=10 +export I_MPI_SPIN_COUNT=10 +set +x + +# File systems : +# ------------ +# Global file system: +export TMPGFS=$TMPDIR +export WORKGFS=$WORKDIR/benchmarks +#MTOOL export TMPGFS=$MTOOL_STEP_WORKSPACE +# Local file system (if preferred): +export TMPLOC=$TMPGFS +echo TMPGFS=$TMPGFS +echo TMPLOC=$TMPLOC + +# Local disks synchronization : +# --------------------------- +export ISYNC=0 +if [ "$MTOOL_IS" = "ON" ] ; then +# synchronization is needed anyway between the steps + export ISYNC=1 +elif [ $NNODES -gt 1 ] && [ "$TMPLOC" != "$TMPGFS" ] ; then +# Local disk synchronization needed: + export ISYNC=1 +fi +echo ISYNC=$ISYNC + +# Miscellaneous : +# ------------- + +# ============================================================================= + +# USER PREFERENCES +# ================ + +#export NAMELDIR=/home/gmap/mrpm/khatib/pack/48t1_main.01#myref/run/cy47.forecast_arome_e700/Namelists +export NAMELDIR=$TESTDIR/Namelists + +HOMEPACK=${HOMEPACK:=$HOME/pack} +export BINDIR=$HOMEPACK/$MYLIB/bin +#export BINDIR=/home/gmap/mrpm/khatib/pack/48t1_main.01#myref/bin +OUTPUTDIR=${OUTPUTDIR:-$PWD} #No cd command have been done before this line + + + +export DATADIR=/scratch/work/khatib/data/cy47.forecast_arome_e700 +#export REFDIR=/home/gmap/mrpm/khatib/benchmarks/apps/modules/cy47.forecast_arome_e700/References +export TOOLSDIR=/home/gmap/mrpm/khatib/benchmarks/tools +#export ROOTDIR_ODB=/home/gmap/mrpm/khatib/odbpools/36t1_bench/cy47.forecast_arome_e700 + +# Check reliability of auxilary directories : +# ----------------------------------------- +ierr=0 +#for var in NAMELDIR BINDIR DATADIR REFDIR TOOLSDIR ; do +for var in NAMELDIR BINDIR DATADIR TOOLSDIR ; do + eval "dir=\$$var" + if [ ! "$dir" ] ; then + echo "$var is not set." + ierr=1 + fi + if [ $ierr -ne 0 ] ; then + exit 1 + fi +done +ierr=0 +for dir in $NAMELDIR $BINDIR $REFDIR $TOOLSDIR ; do + if [ ! -d $dir ] ; then + echo "$dir does not exists." + ierr=1 + fi + if [ $ierr -ne 0 ] ; then + exit 1 + fi +done + +echo TOOLSDIR=$TOOLSDIR +echo NAMELDIR=$NAMELDIR +echo DATADIR=$DATADIR +#echo REFDIR=$REFDIR +echo BINDIR=$BINDIR +#echo ROOTDIR_ODB=$ROOTDIR_ODB + +export PATH=$TOOLSDIR:$PATH +export TOOLSDIR +export DATADIR + +# Software default environment variables : +# -------------------------------------- +set -x +export DR_HOOK=0 +export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_SILENT=1 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export MPL_MBX_SIZE=2048000000 +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export EC_MEMINFO=0 +export OPENBLAS_NUM_THREADS=1 +export MKL_CBWR="AUTO,STRICT" +export MKL_NUM_THREADS=1 +export MKL_DEBUG_CPU_TYPE=5 +set +x + +# Profilers management : +# -------------------- +# FTRACE_JOB : profiler switch +# =0 : no profiler +# =1 : integrated DrHook profiler +# =2 : specific profiler +# +export FTRACE_JOB=1 +echo "FTRACE_JOB=$FTRACE_JOB" + +if [ $FTRACE_JOB -ne 0 ] ; then +# profilings main directory: + if [ -d $JOB_INITDIR ] ; then +# Use the initial job's dir + FTRACE_DIR=$JOB_INITDIR + else +# Set one : + FTRACEDIR= + if [ ! "$FTRACEDIR" ] ; then + echo "FTRACEDIR is not set." + exit 1 + fi + if [ ! -d $FTRACEDIR ] ; then + mkdir -p $FTRACEDIR + if [ $? -ne 0 ] ; then + echo "Can't make directory $FTRACEDIR" + exit 1 + fi + fi + FTRACE_DIR=$FTRACEDIR + fi + SCRATCH_FTRACE_DIR=$TMPGFS +# SCRATCH_FTRACE_DIR=$FTRACE_DIR + if [ $FTRACE_JOB -eq 1 ] ; then + set -x + export DR_HOOK=1 + export DR_HOOK_OPT=prof +# Directory of individual profiles : + export PROFDIR=$SCRATCH_FTRACE_DIR/${JOB_NAME}.d${JOB_ID} +# Merged profiles report filename : + export PROFMRG=$FTRACE_DIR/${JOB_NAME}.h${JOB_ID} + set +x + elif [ $FTRACE_JOB -ge 2 ] ; then + set -x +# Directory of individual profiles : + export PROFDIR=$SCRATCH_FTRACE_DIR/${JOB_NAME}.f${JOB_ID} +# Merged profiles report filename : + export PROFMRG=$FTRACE_DIR/${JOB_NAME}.t${JOB_ID} + set +x + fi +fi + +set +x + +# Listings : +# -------- +set -x +export ECHO_MPSH=OFF +export OUTPUT_LISTING=YES +export LOGDIR=$JOB_INITDIR/${JOB_NAME}.l${JOB_ID} +set +x + +# ODB archives : +# ------------ +# if set to 1, archived Odbs will be gzipped : +set -x +export ARCHIVE_AND_ZIP_ODB=0 +set +x + +# Directory for application output data files : +# ------------------------------------------- +echo +OUTDIR= +OUTDIR=${OUTDIR:=$TMPGFS} +if [ "$TMPGFS" != "$TMPLOC" ] ; then + if [ "$OUTDIR" = "$TMPLOC" ] ; then + echo "Output files on LOCAL file system" + elif [ "$OUTDIR" = "$TMPGFS" ] ; then + echo "Output files on GLOBAL file system" + else + echo "Output files on directory : $OUTDIR" + fi +else + echo "Output files on directory : $OUTDIR" +fi + +# NFS temporary directory for small I/Os +echo +TMPNFS=$(mktemp -d --tmpdir=/tmp/$LOGNAME) +if [ -d $TMPNFS ] ; then + echo "temporary directory on NFS for small I/Os : $TMPNFS" +else + TMPNFS="." +fi + +# ============================================================================= + +# APPLICATION TUNING +# ================== + +# ARPEGE : Forecast +# ***************** + +mkdir -p $TMPLOC +if [ $ISYNC -gt 0 ] ; then + mkdir -p $TMPGFS + cd $TMPGFS +else + cd $TMPLOC +fi + +# Driver-specific environment variables : +# ------------------------------------- +set -x +NAMELIST=namel_previ.48 +CTRLLIST=extra_namelists48.list +LINKS=links_inline48.scpt +EXECUTABLE=MASTERODB +#REFLIST=$REFDIR/forecast.out +EXPLIST=./NODE.001_01 +set +x + +#MTOOL common join=step_2 + +# Namelists modifications : +# ----------------------- + +set -x + +# Number of MPI tasks for the I/O server : +NPROC_IO=$NTASKS_IO + +# Remaining number of MPI tasks : +NPROC=$((MPI_TASKS-NPROC_IO)) + +# Memory cache optimisation: +NPROMA=-16 +NFPROMA=-24 + +# Overall scalar optimisation: +LOPT_SCALAR=.TRUE. + +# Output packing distribution: +NSTROUT=${NPROC} +NSTRIN=${NPROC} + +NPRGPEW=16 +#NPRGPNS=((NPROC/NPRGPEW)) +NPRTRV=16 +#NPRTRW=((NPROC/NPRTRV)) + +set +x + +cat > namelist_mods2 <<EOF + &NAM_NEBN + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + LSEDIC=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + LOSIGMAS=-, + LOSUBG_COND=-, + VSIGQSAT=-, + LOSEDIC=-, + CFRAC_ICE_ADJUST=-, + CFRAC_ICE_SHALLOW_MF=-, + CSEDIM=-, + CSNOWRIMING=-, + LCONVHG=-, + LCRFLIMIT=-, + LEVLIMIT=-, + LFEEDBACKT=-, + LNULLWETG=-, + LNULLWETH=-, + LSEDIM_AFTER=-, + LWETGPOST=-, + LWETHPOST=-, + NMAXITER_MICRO=-, + XFRACM90=-, + XMRSTEP=-, + XSPLIT_MAXCFL=-, + XTSTEP_TS=-, + LCRIAUTI=-, + RCRIAUTC=-, + RCRIAUTI=-, + RT0CRIAUTI=-, + / + &NAMTRANS + LFFTW=.TRUE., + / + &NAMPAR0 + NPRINTLEV=1, + LOPT_SCALAR=${LOPT_SCALAR}, + MBX_SIZE=2048000000, + NPROC=${NPROC}, + NPRGPNS=-, + NPRGPEW=-, + NPRTRW=-, + NPRTRV=-, + / + &NAMDIM + NPROMA=$NPROMA, + / + &NAMFPSC2 + NFPROMA=$NFPROMA, + / + &NAMFPSC2_DEP + NFPROMA_DEP=$NFPROMA, + / + &NAMPAR1 + LSPLIT=.TRUE., + NSTRIN=${NSTRIN}, + NSTROUT=${NSTROUT}, + / + &NAMFA + CMODEL=' ', + / + &NAMIAU + LIAU=.FALSE., + / + &NAMARG + CNMEXP='0000', + / + &NAMCT0 + CSCRIPT_LAMRTC=' ', + CSCRIPT_PPSERVER=' ', + CFPNCF='ECHFP', + NSDITS(0)=0, + NFRSDI=4, + NFPOS=1, + / + &NAMCT1 + N1POS=1, + / + &NAMFPC + CFPDIR='${OUTDIR}/PF', + / + &NAMOPH + CFNHWF='${OUTDIR}/ECHIS', + CFPATH='${OUTDIR}/', + / + &NAMIO_SERV + NPROC_IO=${NPROC_IO}, + NMSG_LEVEL_SERVER=1, + NMSG_LEVEL_CLIENT=1, + NPROCESS_LEVEL=5, + / + &NAMRIP + CSTOP='h24', + TSTEP=50., + / +EOF +cat namelist_mods2 > namelist_modset +\rm -f namelist_mods2 +echo +echo Namelists adaptations : +cat namelist_modset +echo + +set +x +cp $NAMELDIR/$NAMELIST namelist +perl -w $TOOLSDIR/xpnam namelist --dfile=namelist_modset +set -x +echo +/bin/cat namelist.new +set +x +\rm -f namelist_modset namelist +\mv namelist.new fort.4 +set -x + +#MTOOL common + +# ============================================================================= + +# DRIVER +# ====== + +# ****************************** +# * fetch initial data files * +# ****************************** + +#MTOOL common join=step_1 + +set -x +$TOOLSDIR/getdata.sh +set +x + +#MTOOL common + +#MTOOL common join=step_2 + +for file in $(cat $NAMELDIR/$CTRLLIST) ; do + set -x + cp $NAMELDIR/$file . + set +x +done +if [ -s $NAMELDIR/$LINKS ] ; then + set -x + cp $NAMELDIR/$LINKS . + chmod 755 $LINKS + . ./$LINKS + \rm $LINKS + set +x +fi + +#MTOOL common + +# *************** +# * Executable * +# *************** + +#MTOOL common join=step_1 + +echo +set -x +cp $BINDIR/$EXECUTABLE . +set +x +if [ ! -f $EXECUTABLE ] ; then + echo "executable $BINDIR/$EXECUTABLE could not be copied." + exit 1 +fi + +#MTOOL common + +# ******************************** +# * Prepare parallel executions * +# ******************************** + +#MTOOL common join=step_2 + +if [ "$LOCAL_STACK_LIMIT" ] ; then + set -x + ulimit -s $LOCAL_STACK_LIMIT + set +x +fi +# for mpsh : +export MPSH_NPES=$NNODES + +# grib_api environment variables may be determined by the executable : +. grib_api_profile $EXECUTABLE + +# Intel mpi fabric setup depending on what is found in the executable : +. intel_mpi_fabric $EXECUTABLE + +#MTOOL common + +set -x +cd $TMPLOC +set +x +. rttov_profile + +# ******************************************************* +# * Unarchive datasets and local disks Synchronisation * +# ******************************************************* + +if [ $ISYNC -eq 0 ] ; then + set -x +#MTOOL common join=step_1 + $TOOLSDIR/input_sync.sh +#MTOOL common + set +x +else + set -x +#MTOOL common join=step_2 + $TOOLSDIR/input_sync.sh +#MTOOL common + set +x +fi + +# *************** +# * Execution * +# *************** + +#MTOOL common join=step_2 + +mkdir -p $OUTDIR +echo +if [ $(echo $LOCAL_MPI_WRAPPER | grep -c mpiauto) -ne 0 ] ; then + set -x + time $LOCAL_MPI_WRAPPER -np $MPI_TASKS -nnp $MPITASKS_PER_NODE -- ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +elif [ "$LOCAL_MPI_WRAPPER" = "srun" ] ; then + set -x + time $LOCAL_MPI_WRAPPER ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +elif [ "$LOCAL_MPI_WRAPPER" ] ; then + set -x + time $LOCAL_MPI_WRAPPER -np $MPI_TASKS ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +else + set -x + time ./$EXECUTABLE \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +fi + +# ********************** +# * Post-processings * +# ********************** + +echo +if [ "$OUTPUT_LISTING" = "YES" ] ; then + set -x + $TOOLSDIR/outsync.sh + set +x +fi + +if [ $FTRACE_JOB -gt 0 ] ; then + set -x + $TOOLSDIR/profsync.sh + set +x +fi + +set -x +ls -l $OUTDIR +set +x + +set -x +#errorcode returned by executable is not reliable (always different from 0) +if grep " NSTEP = 1728 CNT0" NODE.001_01 > /dev/null; then + cp $EXPLIST $OUTPUTDIR/ +else + mkdir $OUTPUTDIR/error + cp $EXPLIST $OUTPUTDIR/error/ +fi +#if [ -f $REFLIST ] && [ -f $EXPLIST ] ; then $TOOLSDIR/diffNODE.001_01 $EXPLIST $REFLIST ; fi +set +x +# **************** +# * Cleanups * +# **************** + +set -x +cd $TMPGFS +$TOOLSDIR/cleansync.sh +set +x + +#MTOOL common + +# **************** +# * Epilogue * +# **************** + +set -x +$TOOLSDIR/epilog.sh +set +x +if [ "$MTOOL_IS" != "ON" ] && [ "$AUTO_CLEAN" = "ON" ] ; then + cd $HOME + \rm -rf $TMPGFS +fi + +#MTOOL step id=step_1 target=FRONTEND +#MTOOL step id=step_2 target=SUPERCOMPUTER diff --git a/tools/conf_tests/big_3D/aro48t3_nam6.sh b/tools/conf_tests/big_3D/aro48t3_nam6.sh new file mode 100644 index 0000000000000000000000000000000000000000..b6da23d53e1341bc467c1c5b9bdb8c34ec6993d8 --- /dev/null +++ b/tools/conf_tests/big_3D/aro48t3_nam6.sh @@ -0,0 +1,663 @@ +#!/bin/bash +#SBATCH -p normal256 +#SBATCH --export=MYLIB,HOMEPACK,TESTDIR +#SBATCH -n 1280 +#SBATCH -c 4 +#SBATCH -N 40 +#SBATCH -t 00:40:00 +#SBATCH --mem=247000 +#SBATCH --exclusiv + +# Job management : +# -------------- +JOB_INITDIR=$SLURM_SUBMIT_DIR +export JOB_NAME=arome_e700 +export JOB_ID=$SLURM_JOB_ID + +echo JOB_INITDIR=$JOB_INITDIR +echo JOB_NAME=$JOB_NAME +echo JOB_ID=$JOB_ID + +# ============================================================================= + +# RESOURCES ALLOCATIONS +# ===================== + +# Number of nodes/mpi-tasks/omp-threads: +# ------------------------------------- +NNODES=$SLURM_JOB_NUM_NODES +# Number of MPI tasks per node: +MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) +# Number of OPEN-MP threads per MPI task: +export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK +# Total number of MPI tasks: +MPI_TASKS=$SLURM_NTASKS +# Number of tasks reserved for the I/O server : 2 (hyperthreaded) nodes +NTASKS_IO=$(($(grep processor /proc/cpuinfo | wc -l)/1/$OMP_NUM_THREADS)) + +echo NNODES=$NNODES +echo MPITASKS_PER_NODE=$MPITASKS_PER_NODE +echo +# Number of MPI tasks and OMP threads used in the application : +echo MPI_TASKS=$MPI_TASKS +echo OMP_NUM_THREADS=$OMP_NUM_THREADS + +# ============================================================================= + +# SYSTEM PREFERENCES +# ================== + +# OMP/MPI submission management : +# ----------------------------- +# LOCAL_MPI_WRAPPER : could be "mpiauto", "mpdrun", "mpiexec" ... or empty string +# LOCAL_STACK_LIMIT : could be "unlimited" or empty string + +set -x +#LOCAL_MPI_WRAPPER="/opt/softs/mpiauto/mpiauto --wrap --wrap-stdeo --wrap-stdeo-pack" +LOCAL_MPI_WRAPPER="/opt/softs/mpiauto/mpiauto" +LOCAL_STACK_LIMIT=unlimited +ulimit -l unlimited +set +x + +# Specific environment variables : +# ------------------------------ +set -x +export OMP_STACKSIZE=4G +export KMP_STACKSIZE=4G +export KMP_MONITOR_STACKSIZE=4G +export I_MPI_HARD_FINALIZE=1 +export I_MPI_SCALABLE_OPTIMIZATION=0 +export I_MPI_DAPL_UD_RNDV_EP_NUM=4 +export I_MPI_SHM_SPIN_COUNT=10 +export I_MPI_SPIN_COUNT=10 +set +x + +# File systems : +# ------------ +# Global file system: +export TMPGFS=$TMPDIR +export WORKGFS=$WORKDIR/benchmarks +#MTOOL export TMPGFS=$MTOOL_STEP_WORKSPACE +# Local file system (if preferred): +export TMPLOC=$TMPGFS +echo TMPGFS=$TMPGFS +echo TMPLOC=$TMPLOC + +# Local disks synchronization : +# --------------------------- +export ISYNC=0 +if [ "$MTOOL_IS" = "ON" ] ; then +# synchronization is needed anyway between the steps + export ISYNC=1 +elif [ $NNODES -gt 1 ] && [ "$TMPLOC" != "$TMPGFS" ] ; then +# Local disk synchronization needed: + export ISYNC=1 +fi +echo ISYNC=$ISYNC + +# Miscellaneous : +# ------------- + +# ============================================================================= + +# USER PREFERENCES +# ================ + +#export NAMELDIR=/home/gmap/mrpm/khatib/pack/48t1_main.01#myref/run/cy47.forecast_arome_e700/Namelists +export NAMELDIR=$TESTDIR/Namelists + +HOMEPACK=${HOMEPACK:=$HOME/pack} +export BINDIR=$HOMEPACK/$MYLIB/bin +#export BINDIR=/home/gmap/mrpm/khatib/pack/48t1_main.01#myref/bin +OUTPUTDIR=${OUTPUTDIR:-$PWD} #No cd command have been done before this line + + + +export DATADIR=/scratch/work/khatib/data/cy47.forecast_arome_e700 +#export REFDIR=/home/gmap/mrpm/khatib/benchmarks/apps/modules/cy47.forecast_arome_e700/References +export TOOLSDIR=/home/gmap/mrpm/khatib/benchmarks/tools +#export ROOTDIR_ODB=/home/gmap/mrpm/khatib/odbpools/36t1_bench/cy47.forecast_arome_e700 + +# Check reliability of auxilary directories : +# ----------------------------------------- +ierr=0 +#for var in NAMELDIR BINDIR DATADIR REFDIR TOOLSDIR ; do +for var in NAMELDIR BINDIR DATADIR TOOLSDIR ; do + eval "dir=\$$var" + if [ ! "$dir" ] ; then + echo "$var is not set." + ierr=1 + fi + if [ $ierr -ne 0 ] ; then + exit 1 + fi +done +ierr=0 +for dir in $NAMELDIR $BINDIR $REFDIR $TOOLSDIR ; do + if [ ! -d $dir ] ; then + echo "$dir does not exists." + ierr=1 + fi + if [ $ierr -ne 0 ] ; then + exit 1 + fi +done + +echo TOOLSDIR=$TOOLSDIR +echo NAMELDIR=$NAMELDIR +echo DATADIR=$DATADIR +#echo REFDIR=$REFDIR +echo BINDIR=$BINDIR +#echo ROOTDIR_ODB=$ROOTDIR_ODB + +export PATH=$TOOLSDIR:$PATH +export TOOLSDIR +export DATADIR + +# Software default environment variables : +# -------------------------------------- +set -x +export DR_HOOK=0 +export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_SILENT=1 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export MPL_MBX_SIZE=2048000000 +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export EC_MEMINFO=0 +export OPENBLAS_NUM_THREADS=1 +export MKL_CBWR="AUTO,STRICT" +export MKL_NUM_THREADS=1 +export MKL_DEBUG_CPU_TYPE=5 +set +x + +# Profilers management : +# -------------------- +# FTRACE_JOB : profiler switch +# =0 : no profiler +# =1 : integrated DrHook profiler +# =2 : specific profiler +# +export FTRACE_JOB=1 +echo "FTRACE_JOB=$FTRACE_JOB" + +if [ $FTRACE_JOB -ne 0 ] ; then +# profilings main directory: + if [ -d $JOB_INITDIR ] ; then +# Use the initial job's dir + FTRACE_DIR=$JOB_INITDIR + else +# Set one : + FTRACEDIR= + if [ ! "$FTRACEDIR" ] ; then + echo "FTRACEDIR is not set." + exit 1 + fi + if [ ! -d $FTRACEDIR ] ; then + mkdir -p $FTRACEDIR + if [ $? -ne 0 ] ; then + echo "Can't make directory $FTRACEDIR" + exit 1 + fi + fi + FTRACE_DIR=$FTRACEDIR + fi + SCRATCH_FTRACE_DIR=$TMPGFS +# SCRATCH_FTRACE_DIR=$FTRACE_DIR + if [ $FTRACE_JOB -eq 1 ] ; then + set -x + export DR_HOOK=1 + export DR_HOOK_OPT=prof +# Directory of individual profiles : + export PROFDIR=$SCRATCH_FTRACE_DIR/${JOB_NAME}.d${JOB_ID} +# Merged profiles report filename : + export PROFMRG=$FTRACE_DIR/${JOB_NAME}.h${JOB_ID} + set +x + elif [ $FTRACE_JOB -ge 2 ] ; then + set -x +# Directory of individual profiles : + export PROFDIR=$SCRATCH_FTRACE_DIR/${JOB_NAME}.f${JOB_ID} +# Merged profiles report filename : + export PROFMRG=$FTRACE_DIR/${JOB_NAME}.t${JOB_ID} + set +x + fi +fi + +set +x + +# Listings : +# -------- +set -x +export ECHO_MPSH=OFF +export OUTPUT_LISTING=YES +export LOGDIR=$JOB_INITDIR/${JOB_NAME}.l${JOB_ID} +set +x + +# ODB archives : +# ------------ +# if set to 1, archived Odbs will be gzipped : +set -x +export ARCHIVE_AND_ZIP_ODB=0 +set +x + +# Directory for application output data files : +# ------------------------------------------- +echo +OUTDIR= +OUTDIR=${OUTDIR:=$TMPGFS} +if [ "$TMPGFS" != "$TMPLOC" ] ; then + if [ "$OUTDIR" = "$TMPLOC" ] ; then + echo "Output files on LOCAL file system" + elif [ "$OUTDIR" = "$TMPGFS" ] ; then + echo "Output files on GLOBAL file system" + else + echo "Output files on directory : $OUTDIR" + fi +else + echo "Output files on directory : $OUTDIR" +fi + +# NFS temporary directory for small I/Os +echo +TMPNFS=$(mktemp -d --tmpdir=/tmp/$LOGNAME) +if [ -d $TMPNFS ] ; then + echo "temporary directory on NFS for small I/Os : $TMPNFS" +else + TMPNFS="." +fi + +# ============================================================================= + +# APPLICATION TUNING +# ================== + +# ARPEGE : Forecast +# ***************** + +mkdir -p $TMPLOC +if [ $ISYNC -gt 0 ] ; then + mkdir -p $TMPGFS + cd $TMPGFS +else + cd $TMPLOC +fi + +# Driver-specific environment variables : +# ------------------------------------- +set -x +NAMELIST=namel_previ.48 +CTRLLIST=extra_namelists48.list +LINKS=links_inline48.scpt +EXECUTABLE=MASTERODB +#REFLIST=$REFDIR/forecast.out +EXPLIST=./NODE.001_01 +set +x + +#MTOOL common join=step_2 + +# Namelists modifications : +# ----------------------- + +set -x + +# Number of MPI tasks for the I/O server : +NPROC_IO=$NTASKS_IO + +# Remaining number of MPI tasks : +NPROC=$((MPI_TASKS-NPROC_IO)) + +# Memory cache optimisation: +NPROMA=-16 +NFPROMA=-24 + +# Overall scalar optimisation: +LOPT_SCALAR=.TRUE. + +# Output packing distribution: +NSTROUT=${NPROC} +NSTRIN=${NPROC} + +NPRGPEW=16 +#NPRGPNS=((NPROC/NPRGPEW)) +NPRTRV=16 +#NPRTRW=((NPROC/NPRTRV)) + +set +x + +cat > namelist_mods2 <<EOF + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + LSEDIC=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + LOSIGMAS=-, + LOSUBG_COND=-, + VSIGQSAT=-, + LOSEDIC=-, + CFRAC_ICE_ADJUST=-, + CFRAC_ICE_SHALLOW_MF=-, + CSEDIM=-, + CSNOWRIMING=-, + LCONVHG=-, + LCRFLIMIT=-, + LEVLIMIT=-, + LFEEDBACKT=-, + LNULLWETG=-, + LNULLWETH=-, + LSEDIM_AFTER=-, + LWETGPOST=-, + LWETHPOST=-, + NMAXITER_MICRO=-, + XFRACM90=-, + XMRSTEP=-, + XSPLIT_MAXCFL=-, + XTSTEP_TS=-, + LCRIAUTI=-, + RCRIAUTC=-, + RCRIAUTI=-, + RT0CRIAUTI=-, + / + &NAMTRANS + LFFTW=.TRUE., + / + &NAMPAR0 + NPRINTLEV=1, + LOPT_SCALAR=${LOPT_SCALAR}, + MBX_SIZE=2048000000, + NPROC=${NPROC}, + NPRGPNS=-, + NPRGPEW=-, + NPRTRW=-, + NPRTRV=-, + / + &NAMDIM + NPROMA=$NPROMA, + / + &NAMFPSC2 + NFPROMA=$NFPROMA, + / + &NAMFPSC2_DEP + NFPROMA_DEP=$NFPROMA, + / + &NAMPAR1 + LSPLIT=.TRUE., + NSTRIN=${NSTRIN}, + NSTROUT=${NSTROUT}, + / + &NAMFA + CMODEL=' ', + / + &NAMIAU + LIAU=.FALSE., + / + &NAMARG + CNMEXP='0000', + / + &NAMCT0 + CSCRIPT_LAMRTC=' ', + CSCRIPT_PPSERVER=' ', + CFPNCF='ECHFP', + NSDITS(0)=0, + NFRSDI=4, + NFPOS=1, + / + &NAMCT1 + N1POS=1, + / + &NAMFPC + CFPDIR='${OUTDIR}/PF', + / + &NAMOPH + CFNHWF='${OUTDIR}/ECHIS', + CFPATH='${OUTDIR}/', + / + &NAMIO_SERV + NPROC_IO=${NPROC_IO}, + NMSG_LEVEL_SERVER=1, + NMSG_LEVEL_CLIENT=1, + NPROCESS_LEVEL=5, + / + &NAMRIP + CSTOP='h24', + TSTEP=50., + / +EOF +cat namelist_mods2 > namelist_modset +\rm -f namelist_mods2 +echo +echo Namelists adaptations : +cat namelist_modset +echo + +set +x +cp $NAMELDIR/$NAMELIST namelist +perl -w $TOOLSDIR/xpnam namelist --dfile=namelist_modset +set -x +echo +/bin/cat namelist.new +set +x +\rm -f namelist_modset namelist +\mv namelist.new fort.4 +set -x + +#MTOOL common + +# ============================================================================= + +# DRIVER +# ====== + +# ****************************** +# * fetch initial data files * +# ****************************** + +#MTOOL common join=step_1 + +set -x +$TOOLSDIR/getdata.sh +set +x + +#MTOOL common + +#MTOOL common join=step_2 + +for file in $(cat $NAMELDIR/$CTRLLIST) ; do + set -x + cp $NAMELDIR/$file . + set +x +done +if [ -s $NAMELDIR/$LINKS ] ; then + set -x + cp $NAMELDIR/$LINKS . + chmod 755 $LINKS + . ./$LINKS + \rm $LINKS + set +x +fi + +#MTOOL common + +# *************** +# * Executable * +# *************** + +#MTOOL common join=step_1 + +echo +set -x +cp $BINDIR/$EXECUTABLE . +set +x +if [ ! -f $EXECUTABLE ] ; then + echo "executable $BINDIR/$EXECUTABLE could not be copied." + exit 1 +fi + +#MTOOL common + +# ******************************** +# * Prepare parallel executions * +# ******************************** + +#MTOOL common join=step_2 + +if [ "$LOCAL_STACK_LIMIT" ] ; then + set -x + ulimit -s $LOCAL_STACK_LIMIT + set +x +fi +# for mpsh : +export MPSH_NPES=$NNODES + +# grib_api environment variables may be determined by the executable : +. grib_api_profile $EXECUTABLE + +# Intel mpi fabric setup depending on what is found in the executable : +. intel_mpi_fabric $EXECUTABLE + +#MTOOL common + +set -x +cd $TMPLOC +set +x +. rttov_profile + +# ******************************************************* +# * Unarchive datasets and local disks Synchronisation * +# ******************************************************* + +if [ $ISYNC -eq 0 ] ; then + set -x +#MTOOL common join=step_1 + $TOOLSDIR/input_sync.sh +#MTOOL common + set +x +else + set -x +#MTOOL common join=step_2 + $TOOLSDIR/input_sync.sh +#MTOOL common + set +x +fi + +# *************** +# * Execution * +# *************** + +#MTOOL common join=step_2 + +mkdir -p $OUTDIR +echo +if [ $(echo $LOCAL_MPI_WRAPPER | grep -c mpiauto) -ne 0 ] ; then + set -x + time $LOCAL_MPI_WRAPPER -np $MPI_TASKS -nnp $MPITASKS_PER_NODE -- ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +elif [ "$LOCAL_MPI_WRAPPER" = "srun" ] ; then + set -x + time $LOCAL_MPI_WRAPPER ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +elif [ "$LOCAL_MPI_WRAPPER" ] ; then + set -x + time $LOCAL_MPI_WRAPPER -np $MPI_TASKS ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +else + set -x + time ./$EXECUTABLE \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +fi + +# ********************** +# * Post-processings * +# ********************** + +echo +if [ "$OUTPUT_LISTING" = "YES" ] ; then + set -x + $TOOLSDIR/outsync.sh + set +x +fi + +if [ $FTRACE_JOB -gt 0 ] ; then + set -x + $TOOLSDIR/profsync.sh + set +x +fi + +set -x +ls -l $OUTDIR +set +x + +set -x +#errorcode returned by executable is not reliable (always different from 0) +if grep " NSTEP = 1728 CNT0" NODE.001_01 > /dev/null; then + cp $EXPLIST $OUTPUTDIR/ +else + mkdir $OUTPUTDIR/error + cp $EXPLIST $OUTPUTDIR/error/ +fi +#if [ -f $REFLIST ] && [ -f $EXPLIST ] ; then $TOOLSDIR/diffNODE.001_01 $EXPLIST $REFLIST ; fi +set +x +# **************** +# * Cleanups * +# **************** + +set -x +cd $TMPGFS +$TOOLSDIR/cleansync.sh +set +x + +#MTOOL common + +# **************** +# * Epilogue * +# **************** + +set -x +$TOOLSDIR/epilog.sh +set +x +if [ "$MTOOL_IS" != "ON" ] && [ "$AUTO_CLEAN" = "ON" ] ; then + cd $HOME + \rm -rf $TMPGFS +fi + +#MTOOL step id=step_1 target=FRONTEND +#MTOOL step id=step_2 target=SUPERCOMPUTER diff --git a/tools/conf_tests/big_3D/aro48t3_nam7.sh b/tools/conf_tests/big_3D/aro48t3_nam7.sh new file mode 100644 index 0000000000000000000000000000000000000000..a25b33f658cc63e564d1df86f6998fd7a9f1a387 --- /dev/null +++ b/tools/conf_tests/big_3D/aro48t3_nam7.sh @@ -0,0 +1,663 @@ +#!/bin/bash +#SBATCH -p normal256 +#SBATCH --export=MYLIB,HOMEPACK,TESTDIR +#SBATCH -n 1280 +#SBATCH -c 4 +#SBATCH -N 40 +#SBATCH -t 00:40:00 +#SBATCH --mem=247000 +#SBATCH --exclusiv + +# Job management : +# -------------- +JOB_INITDIR=$SLURM_SUBMIT_DIR +export JOB_NAME=arome_e700 +export JOB_ID=$SLURM_JOB_ID + +echo JOB_INITDIR=$JOB_INITDIR +echo JOB_NAME=$JOB_NAME +echo JOB_ID=$JOB_ID + +# ============================================================================= + +# RESOURCES ALLOCATIONS +# ===================== + +# Number of nodes/mpi-tasks/omp-threads: +# ------------------------------------- +NNODES=$SLURM_JOB_NUM_NODES +# Number of MPI tasks per node: +MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) +# Number of OPEN-MP threads per MPI task: +export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK +# Total number of MPI tasks: +MPI_TASKS=$SLURM_NTASKS +# Number of tasks reserved for the I/O server : 2 (hyperthreaded) nodes +NTASKS_IO=$(($(grep processor /proc/cpuinfo | wc -l)/1/$OMP_NUM_THREADS)) + +echo NNODES=$NNODES +echo MPITASKS_PER_NODE=$MPITASKS_PER_NODE +echo +# Number of MPI tasks and OMP threads used in the application : +echo MPI_TASKS=$MPI_TASKS +echo OMP_NUM_THREADS=$OMP_NUM_THREADS + +# ============================================================================= + +# SYSTEM PREFERENCES +# ================== + +# OMP/MPI submission management : +# ----------------------------- +# LOCAL_MPI_WRAPPER : could be "mpiauto", "mpdrun", "mpiexec" ... or empty string +# LOCAL_STACK_LIMIT : could be "unlimited" or empty string + +set -x +#LOCAL_MPI_WRAPPER="/opt/softs/mpiauto/mpiauto --wrap --wrap-stdeo --wrap-stdeo-pack" +LOCAL_MPI_WRAPPER="/opt/softs/mpiauto/mpiauto" +LOCAL_STACK_LIMIT=unlimited +ulimit -l unlimited +set +x + +# Specific environment variables : +# ------------------------------ +set -x +export OMP_STACKSIZE=4G +export KMP_STACKSIZE=4G +export KMP_MONITOR_STACKSIZE=4G +export I_MPI_HARD_FINALIZE=1 +export I_MPI_SCALABLE_OPTIMIZATION=0 +export I_MPI_DAPL_UD_RNDV_EP_NUM=4 +export I_MPI_SHM_SPIN_COUNT=10 +export I_MPI_SPIN_COUNT=10 +set +x + +# File systems : +# ------------ +# Global file system: +export TMPGFS=$TMPDIR +export WORKGFS=$WORKDIR/benchmarks +#MTOOL export TMPGFS=$MTOOL_STEP_WORKSPACE +# Local file system (if preferred): +export TMPLOC=$TMPGFS +echo TMPGFS=$TMPGFS +echo TMPLOC=$TMPLOC + +# Local disks synchronization : +# --------------------------- +export ISYNC=0 +if [ "$MTOOL_IS" = "ON" ] ; then +# synchronization is needed anyway between the steps + export ISYNC=1 +elif [ $NNODES -gt 1 ] && [ "$TMPLOC" != "$TMPGFS" ] ; then +# Local disk synchronization needed: + export ISYNC=1 +fi +echo ISYNC=$ISYNC + +# Miscellaneous : +# ------------- + +# ============================================================================= + +# USER PREFERENCES +# ================ + +#export NAMELDIR=/home/gmap/mrpm/khatib/pack/48t1_main.01#myref/run/cy47.forecast_arome_e700/Namelists +export NAMELDIR=$TESTDIR/Namelists + +HOMEPACK=${HOMEPACK:=$HOME/pack} +export BINDIR=$HOMEPACK/$MYLIB/bin +#export BINDIR=/home/gmap/mrpm/khatib/pack/48t1_main.01#myref/bin +OUTPUTDIR=${OUTPUTDIR:-$PWD} #No cd command have been done before this line + + + +export DATADIR=/scratch/work/khatib/data/cy47.forecast_arome_e700 +#export REFDIR=/home/gmap/mrpm/khatib/benchmarks/apps/modules/cy47.forecast_arome_e700/References +export TOOLSDIR=/home/gmap/mrpm/khatib/benchmarks/tools +#export ROOTDIR_ODB=/home/gmap/mrpm/khatib/odbpools/36t1_bench/cy47.forecast_arome_e700 + +# Check reliability of auxilary directories : +# ----------------------------------------- +ierr=0 +#for var in NAMELDIR BINDIR DATADIR REFDIR TOOLSDIR ; do +for var in NAMELDIR BINDIR DATADIR TOOLSDIR ; do + eval "dir=\$$var" + if [ ! "$dir" ] ; then + echo "$var is not set." + ierr=1 + fi + if [ $ierr -ne 0 ] ; then + exit 1 + fi +done +ierr=0 +for dir in $NAMELDIR $BINDIR $REFDIR $TOOLSDIR ; do + if [ ! -d $dir ] ; then + echo "$dir does not exists." + ierr=1 + fi + if [ $ierr -ne 0 ] ; then + exit 1 + fi +done + +echo TOOLSDIR=$TOOLSDIR +echo NAMELDIR=$NAMELDIR +echo DATADIR=$DATADIR +#echo REFDIR=$REFDIR +echo BINDIR=$BINDIR +#echo ROOTDIR_ODB=$ROOTDIR_ODB + +export PATH=$TOOLSDIR:$PATH +export TOOLSDIR +export DATADIR + +# Software default environment variables : +# -------------------------------------- +set -x +export DR_HOOK=0 +export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_SILENT=1 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export MPL_MBX_SIZE=2048000000 +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export EC_MEMINFO=0 +export OPENBLAS_NUM_THREADS=1 +export MKL_CBWR="AUTO,STRICT" +export MKL_NUM_THREADS=1 +export MKL_DEBUG_CPU_TYPE=5 +set +x + +# Profilers management : +# -------------------- +# FTRACE_JOB : profiler switch +# =0 : no profiler +# =1 : integrated DrHook profiler +# =2 : specific profiler +# +export FTRACE_JOB=1 +echo "FTRACE_JOB=$FTRACE_JOB" + +if [ $FTRACE_JOB -ne 0 ] ; then +# profilings main directory: + if [ -d $JOB_INITDIR ] ; then +# Use the initial job's dir + FTRACE_DIR=$JOB_INITDIR + else +# Set one : + FTRACEDIR= + if [ ! "$FTRACEDIR" ] ; then + echo "FTRACEDIR is not set." + exit 1 + fi + if [ ! -d $FTRACEDIR ] ; then + mkdir -p $FTRACEDIR + if [ $? -ne 0 ] ; then + echo "Can't make directory $FTRACEDIR" + exit 1 + fi + fi + FTRACE_DIR=$FTRACEDIR + fi + SCRATCH_FTRACE_DIR=$TMPGFS +# SCRATCH_FTRACE_DIR=$FTRACE_DIR + if [ $FTRACE_JOB -eq 1 ] ; then + set -x + export DR_HOOK=1 + export DR_HOOK_OPT=prof +# Directory of individual profiles : + export PROFDIR=$SCRATCH_FTRACE_DIR/${JOB_NAME}.d${JOB_ID} +# Merged profiles report filename : + export PROFMRG=$FTRACE_DIR/${JOB_NAME}.h${JOB_ID} + set +x + elif [ $FTRACE_JOB -ge 2 ] ; then + set -x +# Directory of individual profiles : + export PROFDIR=$SCRATCH_FTRACE_DIR/${JOB_NAME}.f${JOB_ID} +# Merged profiles report filename : + export PROFMRG=$FTRACE_DIR/${JOB_NAME}.t${JOB_ID} + set +x + fi +fi + +set +x + +# Listings : +# -------- +set -x +export ECHO_MPSH=OFF +export OUTPUT_LISTING=YES +export LOGDIR=$JOB_INITDIR/${JOB_NAME}.l${JOB_ID} +set +x + +# ODB archives : +# ------------ +# if set to 1, archived Odbs will be gzipped : +set -x +export ARCHIVE_AND_ZIP_ODB=0 +set +x + +# Directory for application output data files : +# ------------------------------------------- +echo +OUTDIR= +OUTDIR=${OUTDIR:=$TMPGFS} +if [ "$TMPGFS" != "$TMPLOC" ] ; then + if [ "$OUTDIR" = "$TMPLOC" ] ; then + echo "Output files on LOCAL file system" + elif [ "$OUTDIR" = "$TMPGFS" ] ; then + echo "Output files on GLOBAL file system" + else + echo "Output files on directory : $OUTDIR" + fi +else + echo "Output files on directory : $OUTDIR" +fi + +# NFS temporary directory for small I/Os +echo +TMPNFS=$(mktemp -d --tmpdir=/tmp/$LOGNAME) +if [ -d $TMPNFS ] ; then + echo "temporary directory on NFS for small I/Os : $TMPNFS" +else + TMPNFS="." +fi + +# ============================================================================= + +# APPLICATION TUNING +# ================== + +# ARPEGE : Forecast +# ***************** + +mkdir -p $TMPLOC +if [ $ISYNC -gt 0 ] ; then + mkdir -p $TMPGFS + cd $TMPGFS +else + cd $TMPLOC +fi + +# Driver-specific environment variables : +# ------------------------------------- +set -x +NAMELIST=namel_previ.48 +CTRLLIST=extra_namelists48.list +LINKS=links_inline48.scpt +EXECUTABLE=MASTERODB +#REFLIST=$REFDIR/forecast.out +EXPLIST=./NODE.001_01 +set +x + +#MTOOL common join=step_2 + +# Namelists modifications : +# ----------------------- + +set -x + +# Number of MPI tasks for the I/O server : +NPROC_IO=$NTASKS_IO + +# Remaining number of MPI tasks : +NPROC=$((MPI_TASKS-NPROC_IO)) + +# Memory cache optimisation: +NPROMA=-16 +NFPROMA=-24 + +# Overall scalar optimisation: +LOPT_SCALAR=.TRUE. + +# Output packing distribution: +NSTROUT=${NPROC} +NSTRIN=${NPROC} + +NPRGPEW=16 +#NPRGPNS=((NPROC/NPRGPEW)) +NPRTRV=16 +#NPRTRW=((NPROC/NPRTRV)) + +set +x + +cat > namelist_mods2 <<EOF + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + LSEDIC=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + / + &NAMPARAR + LOSIGMAS=-, + LOSUBG_COND=-, + VSIGQSAT=-, + LOSEDIC=-, + CFRAC_ICE_ADJUST=-, + CFRAC_ICE_SHALLOW_MF=-, + CSEDIM=-, + CSNOWRIMING=-, + LCONVHG=-, + LCRFLIMIT=-, + LEVLIMIT=-, + LFEEDBACKT=-, + LNULLWETG=-, + LNULLWETH=-, + LSEDIM_AFTER=-, + LWETGPOST=-, + LWETHPOST=-, + NMAXITER_MICRO=-, + XFRACM90=-, + XMRSTEP=-, + XSPLIT_MAXCFL=-, + XTSTEP_TS=-, + LCRIAUTI=-, + RCRIAUTC=-, + RCRIAUTI=-, + RT0CRIAUTI=-, + / + &NAMTRANS + LFFTW=.TRUE., + / + &NAMPAR0 + NPRINTLEV=1, + LOPT_SCALAR=${LOPT_SCALAR}, + MBX_SIZE=2048000000, + NPROC=${NPROC}, + NPRGPNS=-, + NPRGPEW=-, + NPRTRW=-, + NPRTRV=-, + / + &NAMDIM + NPROMA=$NPROMA, + / + &NAMFPSC2 + NFPROMA=$NFPROMA, + / + &NAMFPSC2_DEP + NFPROMA_DEP=$NFPROMA, + / + &NAMPAR1 + LSPLIT=.TRUE., + NSTRIN=${NSTRIN}, + NSTROUT=${NSTROUT}, + / + &NAMFA + CMODEL=' ', + / + &NAMIAU + LIAU=.FALSE., + / + &NAMARG + CNMEXP='0000', + / + &NAMCT0 + CSCRIPT_LAMRTC=' ', + CSCRIPT_PPSERVER=' ', + CFPNCF='ECHFP', + NSDITS(0)=0, + NFRSDI=4, + NFPOS=1, + / + &NAMCT1 + N1POS=1, + / + &NAMFPC + CFPDIR='${OUTDIR}/PF', + / + &NAMOPH + CFNHWF='${OUTDIR}/ECHIS', + CFPATH='${OUTDIR}/', + / + &NAMIO_SERV + NPROC_IO=${NPROC_IO}, + NMSG_LEVEL_SERVER=1, + NMSG_LEVEL_CLIENT=1, + NPROCESS_LEVEL=5, + / + &NAMRIP + CSTOP='h24', + TSTEP=50., + / +EOF +cat namelist_mods2 > namelist_modset +\rm -f namelist_mods2 +echo +echo Namelists adaptations : +cat namelist_modset +echo + +set +x +cp $NAMELDIR/$NAMELIST namelist +perl -w $TOOLSDIR/xpnam namelist --dfile=namelist_modset +set -x +echo +/bin/cat namelist.new +set +x +\rm -f namelist_modset namelist +\mv namelist.new fort.4 +set -x + +#MTOOL common + +# ============================================================================= + +# DRIVER +# ====== + +# ****************************** +# * fetch initial data files * +# ****************************** + +#MTOOL common join=step_1 + +set -x +$TOOLSDIR/getdata.sh +set +x + +#MTOOL common + +#MTOOL common join=step_2 + +for file in $(cat $NAMELDIR/$CTRLLIST) ; do + set -x + cp $NAMELDIR/$file . + set +x +done +if [ -s $NAMELDIR/$LINKS ] ; then + set -x + cp $NAMELDIR/$LINKS . + chmod 755 $LINKS + . ./$LINKS + \rm $LINKS + set +x +fi + +#MTOOL common + +# *************** +# * Executable * +# *************** + +#MTOOL common join=step_1 + +echo +set -x +cp $BINDIR/$EXECUTABLE . +set +x +if [ ! -f $EXECUTABLE ] ; then + echo "executable $BINDIR/$EXECUTABLE could not be copied." + exit 1 +fi + +#MTOOL common + +# ******************************** +# * Prepare parallel executions * +# ******************************** + +#MTOOL common join=step_2 + +if [ "$LOCAL_STACK_LIMIT" ] ; then + set -x + ulimit -s $LOCAL_STACK_LIMIT + set +x +fi +# for mpsh : +export MPSH_NPES=$NNODES + +# grib_api environment variables may be determined by the executable : +. grib_api_profile $EXECUTABLE + +# Intel mpi fabric setup depending on what is found in the executable : +. intel_mpi_fabric $EXECUTABLE + +#MTOOL common + +set -x +cd $TMPLOC +set +x +. rttov_profile + +# ******************************************************* +# * Unarchive datasets and local disks Synchronisation * +# ******************************************************* + +if [ $ISYNC -eq 0 ] ; then + set -x +#MTOOL common join=step_1 + $TOOLSDIR/input_sync.sh +#MTOOL common + set +x +else + set -x +#MTOOL common join=step_2 + $TOOLSDIR/input_sync.sh +#MTOOL common + set +x +fi + +# *************** +# * Execution * +# *************** + +#MTOOL common join=step_2 + +mkdir -p $OUTDIR +echo +if [ $(echo $LOCAL_MPI_WRAPPER | grep -c mpiauto) -ne 0 ] ; then + set -x + time $LOCAL_MPI_WRAPPER -np $MPI_TASKS -nnp $MPITASKS_PER_NODE -- ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +elif [ "$LOCAL_MPI_WRAPPER" = "srun" ] ; then + set -x + time $LOCAL_MPI_WRAPPER ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +elif [ "$LOCAL_MPI_WRAPPER" ] ; then + set -x + time $LOCAL_MPI_WRAPPER -np $MPI_TASKS ./$EXECUTABLE </dev/null \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +else + set -x + time ./$EXECUTABLE \ + errorcode=$? + 2>&1 | grep -v "FA[DC]GR[AM]: Field .* is not declared in \`faFieldName.def'" + set +x +fi + +# ********************** +# * Post-processings * +# ********************** + +echo +if [ "$OUTPUT_LISTING" = "YES" ] ; then + set -x + $TOOLSDIR/outsync.sh + set +x +fi + +if [ $FTRACE_JOB -gt 0 ] ; then + set -x + $TOOLSDIR/profsync.sh + set +x +fi + +set -x +ls -l $OUTDIR +set +x + +set -x +#errorcode returned by executable is not reliable (always different from 0) +if grep " NSTEP = 1728 CNT0" NODE.001_01 > /dev/null; then + cp $EXPLIST $OUTPUTDIR/ +else + mkdir $OUTPUTDIR/error + cp $EXPLIST $OUTPUTDIR/error/ +fi +#if [ -f $REFLIST ] && [ -f $EXPLIST ] ; then $TOOLSDIR/diffNODE.001_01 $EXPLIST $REFLIST ; fi +set +x +# **************** +# * Cleanups * +# **************** + +set -x +cd $TMPGFS +$TOOLSDIR/cleansync.sh +set +x + +#MTOOL common + +# **************** +# * Epilogue * +# **************** + +set -x +$TOOLSDIR/epilog.sh +set +x +if [ "$MTOOL_IS" != "ON" ] && [ "$AUTO_CLEAN" = "ON" ] ; then + cd $HOME + \rm -rf $TMPGFS +fi + +#MTOOL step id=step_1 target=FRONTEND +#MTOOL step id=step_2 target=SUPERCOMPUTER diff --git a/tools/conf_tests/small_3D/aro48t3_nam1.sh b/tools/conf_tests/small_3D/aro48t3_nam1.sh new file mode 100755 index 0000000000000000000000000000000000000000..7d80b4bcfe0c0fb65e65c2b3d1c49a19a519d7ea --- /dev/null +++ b/tools/conf_tests/small_3D/aro48t3_nam1.sh @@ -0,0 +1,1211 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +mv *.dat $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D/aro48t3_nam2.sh b/tools/conf_tests/small_3D/aro48t3_nam2.sh new file mode 100755 index 0000000000000000000000000000000000000000..1ece8ca706fe7df6032544c19692a4e24bd67b4c --- /dev/null +++ b/tools/conf_tests/small_3D/aro48t3_nam2.sh @@ -0,0 +1,1213 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLn + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +mv *.dat $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D/aro48t3_nam3.sh b/tools/conf_tests/small_3D/aro48t3_nam3.sh new file mode 100755 index 0000000000000000000000000000000000000000..3cfb3ad943f6ffacc2126c28e41f1adb6b3b4e4b --- /dev/null +++ b/tools/conf_tests/small_3D/aro48t3_nam3.sh @@ -0,0 +1,1215 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE., + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +mv *.dat $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D/aro48t3_nam4.sh b/tools/conf_tests/small_3D/aro48t3_nam4.sh new file mode 100755 index 0000000000000000000000000000000000000000..38912291211c7eb69d6a6dda0dc34dd61bf121f9 --- /dev/null +++ b/tools/conf_tests/small_3D/aro48t3_nam4.sh @@ -0,0 +1,1215 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE., + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +mv *.dat $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D/aro48t3_nam5.sh b/tools/conf_tests/small_3D/aro48t3_nam5.sh new file mode 100755 index 0000000000000000000000000000000000000000..505b8cd11eb071493afacdeb8d11b1689022f475 --- /dev/null +++ b/tools/conf_tests/small_3D/aro48t3_nam5.sh @@ -0,0 +1,1217 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE., + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +mv *.dat $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D/aro48t3_nam6.sh b/tools/conf_tests/small_3D/aro48t3_nam6.sh new file mode 100755 index 0000000000000000000000000000000000000000..97e795e26d986c6a8e7844b169a5923369371238 --- /dev/null +++ b/tools/conf_tests/small_3D/aro48t3_nam6.sh @@ -0,0 +1,1217 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE., + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +mv *.dat $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D/aro48t3_nam7.sh b/tools/conf_tests/small_3D/aro48t3_nam7.sh new file mode 100755 index 0000000000000000000000000000000000000000..b23317e7f26d8d7a37daae0a2d4a867aaa0ef5b1 --- /dev/null +++ b/tools/conf_tests/small_3D/aro48t3_nam7.sh @@ -0,0 +1,1217 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + LSIGMAS=.TRUE., + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +mv *.dat $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt1/aro48t3_nam1.sh b/tools/conf_tests/small_3D_alt1/aro48t3_nam1.sh new file mode 100755 index 0000000000000000000000000000000000000000..a5484ca4e8ff290424c09104dde7f637a0a23c77 --- /dev/null +++ b/tools/conf_tests/small_3D_alt1/aro48t3_nam1.sh @@ -0,0 +1,1210 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='T', + CFRAC_ICE_SHALLOW_MF='T', + CSEDIM='SPLI', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=10, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=25., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt1/aro48t3_nam2.sh b/tools/conf_tests/small_3D_alt1/aro48t3_nam2.sh new file mode 100755 index 0000000000000000000000000000000000000000..4dc6f929a82c3753183bd5feda01fd7e1e72eaf5 --- /dev/null +++ b/tools/conf_tests/small_3D_alt1/aro48t3_nam2.sh @@ -0,0 +1,1212 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='T', + CFRAC_ICE_SHALLOW_MF='T', + CSEDIM='SPLI', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=10, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=25., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLn + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt1/aro48t3_nam3.sh b/tools/conf_tests/small_3D_alt1/aro48t3_nam3.sh new file mode 100755 index 0000000000000000000000000000000000000000..6462779681c28bf4b04d0772447c499b5b4c26a3 --- /dev/null +++ b/tools/conf_tests/small_3D_alt1/aro48t3_nam3.sh @@ -0,0 +1,1214 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='T', + CFRAC_ICE_SHALLOW_MF='T', + CSEDIM='SPLI', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=10, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=25., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt1/aro48t3_nam4.sh b/tools/conf_tests/small_3D_alt1/aro48t3_nam4.sh new file mode 100755 index 0000000000000000000000000000000000000000..b7390334ac62f481dcce86e48f814be55bccfd09 --- /dev/null +++ b/tools/conf_tests/small_3D_alt1/aro48t3_nam4.sh @@ -0,0 +1,1214 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='T', + CFRAC_ICE_SHALLOW_MF='T', + CSEDIM='SPLI', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=10, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=25., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt1/aro48t3_nam5.sh b/tools/conf_tests/small_3D_alt1/aro48t3_nam5.sh new file mode 100755 index 0000000000000000000000000000000000000000..065bb8235cc1edd57077944010a4924e04ef365e --- /dev/null +++ b/tools/conf_tests/small_3D_alt1/aro48t3_nam5.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='T', + CFRAC_ICE_SHALLOW_MF='T', + CSEDIM='SPLI', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=10, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=25., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt1/aro48t3_nam6.sh b/tools/conf_tests/small_3D_alt1/aro48t3_nam6.sh new file mode 100755 index 0000000000000000000000000000000000000000..97b9e5731ae9e9e4dfda09dbe8806f8890d480b1 --- /dev/null +++ b/tools/conf_tests/small_3D_alt1/aro48t3_nam6.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='T', + CFRAC_ICE_SHALLOW_MF='T', + / + &NAM_PARAM_ICEN + CSEDIM='SPLI', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=10, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=25., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt1/aro48t3_nam7.sh b/tools/conf_tests/small_3D_alt1/aro48t3_nam7.sh new file mode 100755 index 0000000000000000000000000000000000000000..167c02c546ab3ac1cfdbd946a9909916eb983259 --- /dev/null +++ b/tools/conf_tests/small_3D_alt1/aro48t3_nam7.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='T', + CFRAC_ICE_SHALLOW_MF='T', + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, +/ + &NAM_PARAM_ICEN + CSEDIM='SPLI', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=10, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=25., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt10/aro48t1.sh b/tools/conf_tests/small_3D_alt10/aro48t1.sh new file mode 100755 index 0000000000000000000000000000000000000000..09cfbbbaa92e08f23451c6734048d3bd55fb2725 --- /dev/null +++ b/tools/conf_tests/small_3D_alt10/aro48t1.sh @@ -0,0 +1,1207 @@ +#!/bin/bash +#SBATCH -n 2 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=2 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAMPARAR + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CMICRO='ICE3', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LCRIAUTI=.FALSE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LFPREC3D=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LOLSMC=.TRUE., + LOSEDIC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + NPRINTFR=10000, + NPTP=1, + RCRIAUTC=0.001, + RCRIAUTI=0.0002, + RT0CRIAUTI=-5., + VSIGQSAT=0.02, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt10/aro48t3.sh b/tools/conf_tests/small_3D_alt10/aro48t3.sh new file mode 100755 index 0000000000000000000000000000000000000000..071374265738ad53bcb443365b55bbb85212893b --- /dev/null +++ b/tools/conf_tests/small_3D_alt10/aro48t3.sh @@ -0,0 +1,1207 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAMPARAR + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CMICRO='ICE3', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LCRIAUTI=.FALSE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LFPREC3D=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LOLSMC=.TRUE., + LOSEDIC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + NPRINTFR=10000, + NPTP=1, + RCRIAUTC=0.001, + RCRIAUTI=0.0002, + RT0CRIAUTI=-5., + VSIGQSAT=0.02, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt10/aro48t3_nam1.sh b/tools/conf_tests/small_3D_alt10/aro48t3_nam1.sh new file mode 100755 index 0000000000000000000000000000000000000000..7d80b4bcfe0c0fb65e65c2b3d1c49a19a519d7ea --- /dev/null +++ b/tools/conf_tests/small_3D_alt10/aro48t3_nam1.sh @@ -0,0 +1,1211 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +mv *.dat $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt10/aro48t3_nam2.sh b/tools/conf_tests/small_3D_alt10/aro48t3_nam2.sh new file mode 100755 index 0000000000000000000000000000000000000000..1ece8ca706fe7df6032544c19692a4e24bd67b4c --- /dev/null +++ b/tools/conf_tests/small_3D_alt10/aro48t3_nam2.sh @@ -0,0 +1,1213 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLn + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +mv *.dat $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt10/aro48t3_nam3.sh b/tools/conf_tests/small_3D_alt10/aro48t3_nam3.sh new file mode 100755 index 0000000000000000000000000000000000000000..1e13b6f73b1903358f830ca362b50503bc042fb1 --- /dev/null +++ b/tools/conf_tests/small_3D_alt10/aro48t3_nam3.sh @@ -0,0 +1,1215 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +mv *.dat $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt10/aro48t3_nam4.sh b/tools/conf_tests/small_3D_alt10/aro48t3_nam4.sh new file mode 100755 index 0000000000000000000000000000000000000000..c770e65cad20b152211a27762aa3255d906825b7 --- /dev/null +++ b/tools/conf_tests/small_3D_alt10/aro48t3_nam4.sh @@ -0,0 +1,1215 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +mv *.dat $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt10/aro48t3_nam5.sh b/tools/conf_tests/small_3D_alt10/aro48t3_nam5.sh new file mode 100755 index 0000000000000000000000000000000000000000..e8204d1dbcf6c1b1605fc44a4d4213cf6dc093ea --- /dev/null +++ b/tools/conf_tests/small_3D_alt10/aro48t3_nam5.sh @@ -0,0 +1,1217 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +mv *.dat $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt10/aro48t3_nam6.sh b/tools/conf_tests/small_3D_alt10/aro48t3_nam6.sh new file mode 100755 index 0000000000000000000000000000000000000000..4a3e615e012d0c537be2570362f089f2d02f4839 --- /dev/null +++ b/tools/conf_tests/small_3D_alt10/aro48t3_nam6.sh @@ -0,0 +1,1217 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +mv *.dat $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt10/aro48t3_nam7.sh b/tools/conf_tests/small_3D_alt10/aro48t3_nam7.sh new file mode 100755 index 0000000000000000000000000000000000000000..b9885e9e2d00336a89affd2d6a9a5306666a1ff8 --- /dev/null +++ b/tools/conf_tests/small_3D_alt10/aro48t3_nam7.sh @@ -0,0 +1,1217 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +mv *.dat $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt10/data b/tools/conf_tests/small_3D_alt10/data new file mode 120000 index 0000000000000000000000000000000000000000..de58adb51323a1eed02c267745adcda655759093 --- /dev/null +++ b/tools/conf_tests/small_3D_alt10/data @@ -0,0 +1 @@ +../small_3D/data \ No newline at end of file diff --git a/tools/conf_tests/small_3D_alt2/aro48t3_nam1.sh b/tools/conf_tests/small_3D_alt2/aro48t3_nam1.sh new file mode 100755 index 0000000000000000000000000000000000000000..110153398a03425d99e78c6a0d1eb5aaf53e2c73 --- /dev/null +++ b/tools/conf_tests/small_3D_alt2/aro48t3_nam1.sh @@ -0,0 +1,1210 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + NMAXITER_MICRO=1, + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.FALSE., + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt2/aro48t3_nam2.sh b/tools/conf_tests/small_3D_alt2/aro48t3_nam2.sh new file mode 100755 index 0000000000000000000000000000000000000000..6043a46a9693e7a51046f7947b22a9533836c972 --- /dev/null +++ b/tools/conf_tests/small_3D_alt2/aro48t3_nam2.sh @@ -0,0 +1,1212 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + NMAXITER_MICRO=1, + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.FALSE., + / + &NAM_PARAM_MFSHALLn + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt2/aro48t3_nam3.sh b/tools/conf_tests/small_3D_alt2/aro48t3_nam3.sh new file mode 100755 index 0000000000000000000000000000000000000000..a7c1bb72545f814bc28d6abf7c64845ab654787f --- /dev/null +++ b/tools/conf_tests/small_3D_alt2/aro48t3_nam3.sh @@ -0,0 +1,1214 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + NMAXITER_MICRO=1, + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.FALSE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt2/aro48t3_nam4.sh b/tools/conf_tests/small_3D_alt2/aro48t3_nam4.sh new file mode 100755 index 0000000000000000000000000000000000000000..7d7ca783b3f166b8bc1ff1ccbbd44de690b4d666 --- /dev/null +++ b/tools/conf_tests/small_3D_alt2/aro48t3_nam4.sh @@ -0,0 +1,1214 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + NMAXITER_MICRO=1, + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.FALSE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt2/aro48t3_nam5.sh b/tools/conf_tests/small_3D_alt2/aro48t3_nam5.sh new file mode 100755 index 0000000000000000000000000000000000000000..5c9cf2d686944a7f1f99a3ff34a44cc2495f9e9b --- /dev/null +++ b/tools/conf_tests/small_3D_alt2/aro48t3_nam5.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + NMAXITER_MICRO=1, + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.FALSE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt2/aro48t3_nam6.sh b/tools/conf_tests/small_3D_alt2/aro48t3_nam6.sh new file mode 100755 index 0000000000000000000000000000000000000000..d3ad72bcc26e174cda84d4d088c87f0f4a113fc7 --- /dev/null +++ b/tools/conf_tests/small_3D_alt2/aro48t3_nam6.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + NMAXITER_MICRO=1, + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.FALSE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt2/aro48t3_nam7.sh b/tools/conf_tests/small_3D_alt2/aro48t3_nam7.sh new file mode 100755 index 0000000000000000000000000000000000000000..314971d296c77ada92b20bc0064c6e1efc76c095 --- /dev/null +++ b/tools/conf_tests/small_3D_alt2/aro48t3_nam7.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + NMAXITER_MICRO=1, + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.FALSE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt3/aro48t3_nam1.sh b/tools/conf_tests/small_3D_alt3/aro48t3_nam1.sh new file mode 100755 index 0000000000000000000000000000000000000000..fd4e650b14b1d7cdd22a65ca60795b1a310e46b4 --- /dev/null +++ b/tools/conf_tests/small_3D_alt3/aro48t3_nam1.sh @@ -0,0 +1,1212 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + CSUBG_RC_RR_ACCR='PRFR', + CSUBG_RR_EVAP='PRFR', + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt3/aro48t3_nam2.sh b/tools/conf_tests/small_3D_alt3/aro48t3_nam2.sh new file mode 100755 index 0000000000000000000000000000000000000000..f18ed5f2785732d5126428a7e0abb4c2fc4b4be6 --- /dev/null +++ b/tools/conf_tests/small_3D_alt3/aro48t3_nam2.sh @@ -0,0 +1,1214 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + CSUBG_RC_RR_ACCR='PRFR', + CSUBG_RR_EVAP='PRFR', + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLn + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt3/aro48t3_nam3.sh b/tools/conf_tests/small_3D_alt3/aro48t3_nam3.sh new file mode 100755 index 0000000000000000000000000000000000000000..3044add207a1ba707f342d8f6d503cba71d8ad91 --- /dev/null +++ b/tools/conf_tests/small_3D_alt3/aro48t3_nam3.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + CSUBG_RC_RR_ACCR='PRFR', + CSUBG_RR_EVAP='PRFR', + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt3/aro48t3_nam4.sh b/tools/conf_tests/small_3D_alt3/aro48t3_nam4.sh new file mode 100755 index 0000000000000000000000000000000000000000..528738714bdfbfeef4fd682ec684e770b7f49118 --- /dev/null +++ b/tools/conf_tests/small_3D_alt3/aro48t3_nam4.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + CSUBG_RC_RR_ACCR='PRFR', + CSUBG_RR_EVAP='PRFR', + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt3/aro48t3_nam5.sh b/tools/conf_tests/small_3D_alt3/aro48t3_nam5.sh new file mode 100755 index 0000000000000000000000000000000000000000..0956eb0390f81b6bc4f9a1de68443a57cab50f21 --- /dev/null +++ b/tools/conf_tests/small_3D_alt3/aro48t3_nam5.sh @@ -0,0 +1,1218 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + CSUBG_RC_RR_ACCR='PRFR', + CSUBG_RR_EVAP='PRFR', + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt3/aro48t3_nam6.sh b/tools/conf_tests/small_3D_alt3/aro48t3_nam6.sh new file mode 100755 index 0000000000000000000000000000000000000000..e16956113fcfc21bfc1b3f74fae0908e45793104 --- /dev/null +++ b/tools/conf_tests/small_3D_alt3/aro48t3_nam6.sh @@ -0,0 +1,1218 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + CSUBG_RC_RR_ACCR='PRFR', + CSUBG_RR_EVAP='PRFR', + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt3/aro48t3_nam7.sh b/tools/conf_tests/small_3D_alt3/aro48t3_nam7.sh new file mode 100755 index 0000000000000000000000000000000000000000..22db139387dfa08eec600e3c8f30ceb7ed49e43b --- /dev/null +++ b/tools/conf_tests/small_3D_alt3/aro48t3_nam7.sh @@ -0,0 +1,1218 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + CSUBG_RC_RR_ACCR='PRFR', + CSUBG_RR_EVAP='PRFR', + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt4/aro48t3_nam1.sh b/tools/conf_tests/small_3D_alt4/aro48t3_nam1.sh new file mode 100755 index 0000000000000000000000000000000000000000..df424da69409a391e96d7836efb461d93a5968d7 --- /dev/null +++ b/tools/conf_tests/small_3D_alt4/aro48t3_nam1.sh @@ -0,0 +1,1210 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='T', + CFRAC_ICE_SHALLOW_MF='T', + CSEDIM='SPLI', + CSNOWRIMING='OLD', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=10, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=25., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt4/aro48t3_nam2.sh b/tools/conf_tests/small_3D_alt4/aro48t3_nam2.sh new file mode 100755 index 0000000000000000000000000000000000000000..932c0d6557edcd69d37c56153922a33273b13d5f --- /dev/null +++ b/tools/conf_tests/small_3D_alt4/aro48t3_nam2.sh @@ -0,0 +1,1212 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='T', + CFRAC_ICE_SHALLOW_MF='T', + CSEDIM='SPLI', + CSNOWRIMING='OLD', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=10, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=25., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLn + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt4/aro48t3_nam3.sh b/tools/conf_tests/small_3D_alt4/aro48t3_nam3.sh new file mode 100755 index 0000000000000000000000000000000000000000..2e9b7dcb05c9edb399a9910833c68ffceba9b69c --- /dev/null +++ b/tools/conf_tests/small_3D_alt4/aro48t3_nam3.sh @@ -0,0 +1,1214 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='T', + CFRAC_ICE_SHALLOW_MF='T', + CSEDIM='SPLI', + CSNOWRIMING='OLD', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=10, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=25., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt4/aro48t3_nam4.sh b/tools/conf_tests/small_3D_alt4/aro48t3_nam4.sh new file mode 100755 index 0000000000000000000000000000000000000000..d4a25096a4184fa2e6c5bc8277273e527dd13c5a --- /dev/null +++ b/tools/conf_tests/small_3D_alt4/aro48t3_nam4.sh @@ -0,0 +1,1214 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='T', + CFRAC_ICE_SHALLOW_MF='T', + CSEDIM='SPLI', + CSNOWRIMING='OLD', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=10, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=25., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt4/aro48t3_nam5.sh b/tools/conf_tests/small_3D_alt4/aro48t3_nam5.sh new file mode 100755 index 0000000000000000000000000000000000000000..0617e36f8fff9a0167d3c45ecdd8bf6d476974ec --- /dev/null +++ b/tools/conf_tests/small_3D_alt4/aro48t3_nam5.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='T', + CFRAC_ICE_SHALLOW_MF='T', + CSEDIM='SPLI', + CSNOWRIMING='OLD', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=10, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=25., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt4/aro48t3_nam6.sh b/tools/conf_tests/small_3D_alt4/aro48t3_nam6.sh new file mode 100755 index 0000000000000000000000000000000000000000..b610507ab05cd121ff30bc99c17e3293e83c6822 --- /dev/null +++ b/tools/conf_tests/small_3D_alt4/aro48t3_nam6.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='T', + CFRAC_ICE_SHALLOW_MF='T', + / + &NAM_PARAM_ICEN + CSEDIM='SPLI', + CSNOWRIMING='OLD', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=10, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=25., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt4/aro48t3_nam7.sh b/tools/conf_tests/small_3D_alt4/aro48t3_nam7.sh new file mode 100755 index 0000000000000000000000000000000000000000..2baeac2545809792d88b095063d449774477e1f3 --- /dev/null +++ b/tools/conf_tests/small_3D_alt4/aro48t3_nam7.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='T', + CFRAC_ICE_SHALLOW_MF='T', + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAM_PARAM_ICEN + CSEDIM='SPLI', + CSNOWRIMING='OLD', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=10, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=25., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt5/aro48t3_nam1.sh b/tools/conf_tests/small_3D_alt5/aro48t3_nam1.sh new file mode 100755 index 0000000000000000000000000000000000000000..c2d0e209ef0ded9f8c5ff3170b7279c9a45a9a4c --- /dev/null +++ b/tools/conf_tests/small_3D_alt5/aro48t3_nam1.sh @@ -0,0 +1,1222 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSH%CLNAME='SURFACCGREL2', + GFP_XLSH%CLNAME='SURFINSGREL2', + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFPLSH=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YH_NL%LGP=.TRUE., + YH_NL%NREQIN=0, + YH_NL%NCOUPLING=-1, + YH_NL%REFVALC=0., + YH_NL%LPT=.FALSE., + YH_NL%LREQOUT=.TRUE., + YH_NL%LQM=.TRUE., + YH_NL%LSLHD=.FALSE., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE. + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAMPARAR + CMICRO='ICE4', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXPLSH=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt5/aro48t3_nam2.sh b/tools/conf_tests/small_3D_alt5/aro48t3_nam2.sh new file mode 100755 index 0000000000000000000000000000000000000000..18c5d0b9e255f756b62e031728c64e81d7d6544c --- /dev/null +++ b/tools/conf_tests/small_3D_alt5/aro48t3_nam2.sh @@ -0,0 +1,1224 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSH%CLNAME='SURFACCGREL2', + GFP_XLSH%CLNAME='SURFINSGREL2', + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFPLSH=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YH_NL%LGP=.TRUE., + YH_NL%NREQIN=0, + YH_NL%NCOUPLING=-1, + YH_NL%REFVALC=0., + YH_NL%LPT=.FALSE., + YH_NL%LREQOUT=.TRUE., + YH_NL%LQM=.TRUE., + YH_NL%LSLHD=.FALSE., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE. + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLn + / + &NAMPARAR + CMICRO='ICE4', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXPLSH=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt5/aro48t3_nam3.sh b/tools/conf_tests/small_3D_alt5/aro48t3_nam3.sh new file mode 100755 index 0000000000000000000000000000000000000000..4db39ee641cf1b37a5cf3d750848c8bacbee5dd9 --- /dev/null +++ b/tools/conf_tests/small_3D_alt5/aro48t3_nam3.sh @@ -0,0 +1,1226 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSH%CLNAME='SURFACCGREL2', + GFP_XLSH%CLNAME='SURFINSGREL2', + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFPLSH=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YH_NL%LGP=.TRUE., + YH_NL%NREQIN=0, + YH_NL%NCOUPLING=-1, + YH_NL%REFVALC=0., + YH_NL%LPT=.FALSE., + YH_NL%LREQOUT=.TRUE., + YH_NL%LQM=.TRUE., + YH_NL%LSLHD=.FALSE., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE. + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE4', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXPLSH=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt5/aro48t3_nam4.sh b/tools/conf_tests/small_3D_alt5/aro48t3_nam4.sh new file mode 100755 index 0000000000000000000000000000000000000000..8798c821bc835e2de8e06685d190061256563746 --- /dev/null +++ b/tools/conf_tests/small_3D_alt5/aro48t3_nam4.sh @@ -0,0 +1,1226 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSH%CLNAME='SURFACCGREL2', + GFP_XLSH%CLNAME='SURFINSGREL2', + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFPLSH=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YH_NL%LGP=.TRUE., + YH_NL%NREQIN=0, + YH_NL%NCOUPLING=-1, + YH_NL%REFVALC=0., + YH_NL%LPT=.FALSE., + YH_NL%LREQOUT=.TRUE., + YH_NL%LQM=.TRUE., + YH_NL%LSLHD=.FALSE., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE. + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE4', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXPLSH=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt5/aro48t3_nam5.sh b/tools/conf_tests/small_3D_alt5/aro48t3_nam5.sh new file mode 100755 index 0000000000000000000000000000000000000000..ad648c01a1e6d0370fca1600c2c9dd0ede68cb0d --- /dev/null +++ b/tools/conf_tests/small_3D_alt5/aro48t3_nam5.sh @@ -0,0 +1,1228 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSH%CLNAME='SURFACCGREL2', + GFP_XLSH%CLNAME='SURFINSGREL2', + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFPLSH=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YH_NL%LGP=.TRUE., + YH_NL%NREQIN=0, + YH_NL%NCOUPLING=-1, + YH_NL%REFVALC=0., + YH_NL%LPT=.FALSE., + YH_NL%LREQOUT=.TRUE., + YH_NL%LQM=.TRUE., + YH_NL%LSLHD=.FALSE., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE. + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE4', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXPLSH=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt5/aro48t3_nam6.sh b/tools/conf_tests/small_3D_alt5/aro48t3_nam6.sh new file mode 100755 index 0000000000000000000000000000000000000000..0fe7ac3ca96f18df4962186cbaf357be2217948b --- /dev/null +++ b/tools/conf_tests/small_3D_alt5/aro48t3_nam6.sh @@ -0,0 +1,1228 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSH%CLNAME='SURFACCGREL2', + GFP_XLSH%CLNAME='SURFINSGREL2', + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFPLSH=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YH_NL%LGP=.TRUE., + YH_NL%NREQIN=0, + YH_NL%NCOUPLING=-1, + YH_NL%REFVALC=0., + YH_NL%LPT=.FALSE., + YH_NL%LREQOUT=.TRUE., + YH_NL%LQM=.TRUE., + YH_NL%LSLHD=.FALSE., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE. + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE4', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXPLSH=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt5/aro48t3_nam7.sh b/tools/conf_tests/small_3D_alt5/aro48t3_nam7.sh new file mode 100755 index 0000000000000000000000000000000000000000..7474ab7e51f77b7868bff534652ae8fc96e6dbed --- /dev/null +++ b/tools/conf_tests/small_3D_alt5/aro48t3_nam7.sh @@ -0,0 +1,1228 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSH%CLNAME='SURFACCGREL2', + GFP_XLSH%CLNAME='SURFINSGREL2', + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFPLSH=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YH_NL%LGP=.TRUE., + YH_NL%NREQIN=0, + YH_NL%NCOUPLING=-1, + YH_NL%REFVALC=0., + YH_NL%LPT=.FALSE., + YH_NL%LREQOUT=.TRUE., + YH_NL%LQM=.TRUE., + YH_NL%LSLHD=.FALSE., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE. + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + / + &NAMPARAR + CMICRO='ICE4', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXPLSH=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt6/aro48t3_nam1.sh b/tools/conf_tests/small_3D_alt6/aro48t3_nam1.sh new file mode 100755 index 0000000000000000000000000000000000000000..25fe82eb49ed8046a7b2a90add97773de36b8308 --- /dev/null +++ b/tools/conf_tests/small_3D_alt6/aro48t3_nam1.sh @@ -0,0 +1,1212 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAMPARAR + CMF_UPDRAFT='RAHA' + CMF_CLOUD='BIGA' + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt6/aro48t3_nam2.sh b/tools/conf_tests/small_3D_alt6/aro48t3_nam2.sh new file mode 100755 index 0000000000000000000000000000000000000000..3776375fc9373c098fdd0adb2e103b6076164d5b --- /dev/null +++ b/tools/conf_tests/small_3D_alt6/aro48t3_nam2.sh @@ -0,0 +1,1214 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLn + CMF_UPDRAFT='RAHA' + CMF_CLOUD='BIGA' + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt6/aro48t3_nam3.sh b/tools/conf_tests/small_3D_alt6/aro48t3_nam3.sh new file mode 100755 index 0000000000000000000000000000000000000000..374cb3b2154fff559a02c7821092d51a0524bf58 --- /dev/null +++ b/tools/conf_tests/small_3D_alt6/aro48t3_nam3.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + CMF_UPDRAFT='RAHA' + CMF_CLOUD='BIGA' + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt6/aro48t3_nam4.sh b/tools/conf_tests/small_3D_alt6/aro48t3_nam4.sh new file mode 100755 index 0000000000000000000000000000000000000000..0191ffe0c9dffc504030b389cab85f0128a40f17 --- /dev/null +++ b/tools/conf_tests/small_3D_alt6/aro48t3_nam4.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + CMF_UPDRAFT='RAHA' + CMF_CLOUD='BIGA' + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt6/aro48t3_nam5.sh b/tools/conf_tests/small_3D_alt6/aro48t3_nam5.sh new file mode 100755 index 0000000000000000000000000000000000000000..1befd6f79dfb8b98f1b34ed2dad9138d7229d1ae --- /dev/null +++ b/tools/conf_tests/small_3D_alt6/aro48t3_nam5.sh @@ -0,0 +1,1218 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + CMF_UPDRAFT='RAHA' + CMF_CLOUD='BIGA' + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt6/aro48t3_nam6.sh b/tools/conf_tests/small_3D_alt6/aro48t3_nam6.sh new file mode 100755 index 0000000000000000000000000000000000000000..bfc21838966fec1b87e74f4e4a682372275120e6 --- /dev/null +++ b/tools/conf_tests/small_3D_alt6/aro48t3_nam6.sh @@ -0,0 +1,1218 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + CMF_UPDRAFT='RAHA' + CMF_CLOUD='BIGA' + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt6/aro48t3_nam7.sh b/tools/conf_tests/small_3D_alt6/aro48t3_nam7.sh new file mode 100755 index 0000000000000000000000000000000000000000..84a216ca347cadae70476fcc87f2a458fad98acb --- /dev/null +++ b/tools/conf_tests/small_3D_alt6/aro48t3_nam7.sh @@ -0,0 +1,1218 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + CMF_UPDRAFT='RAHA' + CMF_CLOUD='BIGA' + / + &NAM_TURBN + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt7/aro48t3_nam1.sh b/tools/conf_tests/small_3D_alt7/aro48t3_nam1.sh new file mode 100755 index 0000000000000000000000000000000000000000..6460ba86c87326b88ee642f69acb4f44492906e0 --- /dev/null +++ b/tools/conf_tests/small_3D_alt7/aro48t3_nam1.sh @@ -0,0 +1,1212 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAMPARAR + CMF_UPDRAFT='EDKF' + CMF_CLOUD='STAT' + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.FALSE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt7/aro48t3_nam2.sh b/tools/conf_tests/small_3D_alt7/aro48t3_nam2.sh new file mode 100755 index 0000000000000000000000000000000000000000..123ac973e5b2e9d13fde09010cb5736e41128c11 --- /dev/null +++ b/tools/conf_tests/small_3D_alt7/aro48t3_nam2.sh @@ -0,0 +1,1214 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLn + CMF_UPDRAFT='EDKF' + CMF_CLOUD='STAT' + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.FALSE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt7/aro48t3_nam3.sh b/tools/conf_tests/small_3D_alt7/aro48t3_nam3.sh new file mode 100755 index 0000000000000000000000000000000000000000..885f549fed9bcf03ec374f5812f49b686d5fd355 --- /dev/null +++ b/tools/conf_tests/small_3D_alt7/aro48t3_nam3.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + CMF_UPDRAFT='EDKF' + CMF_CLOUD='STAT' + / + &NAM_TURBN + LSIGMAS=.FALSE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt7/aro48t3_nam4.sh b/tools/conf_tests/small_3D_alt7/aro48t3_nam4.sh new file mode 100755 index 0000000000000000000000000000000000000000..5c5d24846397a37101454b9ee4fc02d2c8915cb1 --- /dev/null +++ b/tools/conf_tests/small_3D_alt7/aro48t3_nam4.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + CMF_UPDRAFT='EDKF' + CMF_CLOUD='STAT' + / + &NAM_TURBN + LSIGMAS=.FALSE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt7/aro48t3_nam5.sh b/tools/conf_tests/small_3D_alt7/aro48t3_nam5.sh new file mode 100755 index 0000000000000000000000000000000000000000..2abca909beb58f14bc404ed57dc2e738870f3812 --- /dev/null +++ b/tools/conf_tests/small_3D_alt7/aro48t3_nam5.sh @@ -0,0 +1,1218 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + CMF_UPDRAFT='EDKF' + CMF_CLOUD='STAT' + / + &NAM_TURBN + LSIGMAS=.FALSE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt7/aro48t3_nam6.sh b/tools/conf_tests/small_3D_alt7/aro48t3_nam6.sh new file mode 100755 index 0000000000000000000000000000000000000000..ad34f70cdfe63dfddd81d9c741a3e1262fee3e0a --- /dev/null +++ b/tools/conf_tests/small_3D_alt7/aro48t3_nam6.sh @@ -0,0 +1,1218 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + CMF_UPDRAFT='EDKF' + CMF_CLOUD='STAT' + / + &NAM_TURBN + LSIGMAS=.FALSE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt7/aro48t3_nam7.sh b/tools/conf_tests/small_3D_alt7/aro48t3_nam7.sh new file mode 100755 index 0000000000000000000000000000000000000000..91afc15aeba6d52e70bf94b3cbfc7f240b5efe52 --- /dev/null +++ b/tools/conf_tests/small_3D_alt7/aro48t3_nam7.sh @@ -0,0 +1,1218 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + LSIGMAS=.FALSE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + CMF_UPDRAFT='EDKF' + CMF_CLOUD='STAT' + / + &NAM_TURBN + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt8/aro48t3_nam1.sh b/tools/conf_tests/small_3D_alt8/aro48t3_nam1.sh new file mode 100755 index 0000000000000000000000000000000000000000..e2e52da38667cadcfd4212fa2fac8cccf12bc112 --- /dev/null +++ b/tools/conf_tests/small_3D_alt8/aro48t3_nam1.sh @@ -0,0 +1,1211 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAMPARAR + CMF_UPDRAFT='RHCJ' + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt8/aro48t3_nam2.sh b/tools/conf_tests/small_3D_alt8/aro48t3_nam2.sh new file mode 100755 index 0000000000000000000000000000000000000000..597b7613d84693d600a8425f61f515fdd2c9891d --- /dev/null +++ b/tools/conf_tests/small_3D_alt8/aro48t3_nam2.sh @@ -0,0 +1,1213 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLn + CMF_UPDRAFT='RHCJ' + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt8/aro48t3_nam3.sh b/tools/conf_tests/small_3D_alt8/aro48t3_nam3.sh new file mode 100755 index 0000000000000000000000000000000000000000..dc3f3499847572a884f4df56fcad07193b3027d8 --- /dev/null +++ b/tools/conf_tests/small_3D_alt8/aro48t3_nam3.sh @@ -0,0 +1,1215 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + CMF_UPDRAFT='RHCJ' + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt8/aro48t3_nam4.sh b/tools/conf_tests/small_3D_alt8/aro48t3_nam4.sh new file mode 100755 index 0000000000000000000000000000000000000000..df8a38cf18ad41881f9b0508d3c7eb591a990e19 --- /dev/null +++ b/tools/conf_tests/small_3D_alt8/aro48t3_nam4.sh @@ -0,0 +1,1215 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + CMF_UPDRAFT='RHCJ' + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt8/aro48t3_nam5.sh b/tools/conf_tests/small_3D_alt8/aro48t3_nam5.sh new file mode 100755 index 0000000000000000000000000000000000000000..ec6d64f64f7a2da3628fd8055b2bf6d0a4e09fab --- /dev/null +++ b/tools/conf_tests/small_3D_alt8/aro48t3_nam5.sh @@ -0,0 +1,1217 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + CMF_UPDRAFT='RHCJ' + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt8/aro48t3_nam6.sh b/tools/conf_tests/small_3D_alt8/aro48t3_nam6.sh new file mode 100755 index 0000000000000000000000000000000000000000..d6575d7fec4ce82a553039951180216c3ff4b554 --- /dev/null +++ b/tools/conf_tests/small_3D_alt8/aro48t3_nam6.sh @@ -0,0 +1,1217 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + CMF_UPDRAFT='RHCJ' + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt8/aro48t3_nam7.sh b/tools/conf_tests/small_3D_alt8/aro48t3_nam7.sh new file mode 100755 index 0000000000000000000000000000000000000000..2c2c24fdaba59f81bacbe8e689b6a0313292eaa8 --- /dev/null +++ b/tools/conf_tests/small_3D_alt8/aro48t3_nam7.sh @@ -0,0 +1,1217 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIC=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + CMF_UPDRAFT='RHCJ' + / + &NAM_TURBN + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt9/aro48t3_nam1.sh b/tools/conf_tests/small_3D_alt9/aro48t3_nam1.sh new file mode 100755 index 0000000000000000000000000000000000000000..498e19b91566d2523ebc153da7cd095b04519ca6 --- /dev/null +++ b/tools/conf_tests/small_3D_alt9/aro48t3_nam1.sh @@ -0,0 +1,1210 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + / + &NAMPARAR + CMICRO='ICE3', + LOCND2=.TRUE., + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt9/aro48t3_nam2.sh b/tools/conf_tests/small_3D_alt9/aro48t3_nam2.sh new file mode 100755 index 0000000000000000000000000000000000000000..52ff2e943ba2041b59a9dc34bdd96a6bb1c18e3a --- /dev/null +++ b/tools/conf_tests/small_3D_alt9/aro48t3_nam2.sh @@ -0,0 +1,1212 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + / + &NAM_PARAM_MFSHALLn + / + &NAMPARAR + CMICRO='ICE3', + LOCND2=.TRUE., + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt9/aro48t3_nam3.sh b/tools/conf_tests/small_3D_alt9/aro48t3_nam3.sh new file mode 100755 index 0000000000000000000000000000000000000000..fcf1edb64a837417d0f13558a11924dc7fb8c883 --- /dev/null +++ b/tools/conf_tests/small_3D_alt9/aro48t3_nam3.sh @@ -0,0 +1,1214 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LOCND2=.TRUE., + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt9/aro48t3_nam4.sh b/tools/conf_tests/small_3D_alt9/aro48t3_nam4.sh new file mode 100755 index 0000000000000000000000000000000000000000..8e62e25625caaa2b55810f9f02728fd84b75aab0 --- /dev/null +++ b/tools/conf_tests/small_3D_alt9/aro48t3_nam4.sh @@ -0,0 +1,1214 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LOCND2=.TRUE., + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt9/aro48t3_nam5.sh b/tools/conf_tests/small_3D_alt9/aro48t3_nam5.sh new file mode 100755 index 0000000000000000000000000000000000000000..ab8f900c08c9e105241d7870bfffc54c22bd905e --- /dev/null +++ b/tools/conf_tests/small_3D_alt9/aro48t3_nam5.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LOCND2=.TRUE., + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt9/aro48t3_nam6.sh b/tools/conf_tests/small_3D_alt9/aro48t3_nam6.sh new file mode 100755 index 0000000000000000000000000000000000000000..76f640eebd8221a6b0f3169699ae195d1ec1c916 --- /dev/null +++ b/tools/conf_tests/small_3D_alt9/aro48t3_nam6.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LOCND2=.TRUE., + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_alt9/aro48t3_nam7.sh b/tools/conf_tests/small_3D_alt9/aro48t3_nam7.sh new file mode 100755 index 0000000000000000000000000000000000000000..e9a934e92725d716066ff62a4fba9a5ba11b0f21 --- /dev/null +++ b/tools/conf_tests/small_3D_alt9/aro48t3_nam7.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 4 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=4 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + / + &NAMPARAR + CMICRO='ICE3', + LOCND2=.TRUE., + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_np1/aro48t3_nam1.sh b/tools/conf_tests/small_3D_np1/aro48t3_nam1.sh new file mode 100755 index 0000000000000000000000000000000000000000..2daec409016d81bd7f077244cd5c6389d62234e4 --- /dev/null +++ b/tools/conf_tests/small_3D_np1/aro48t3_nam1.sh @@ -0,0 +1,1210 @@ +#!/bin/bash +#SBATCH -n 1 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=1 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + LSEDIM_AFTER=.FALSE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_np1/aro48t3_nam2.sh b/tools/conf_tests/small_3D_np1/aro48t3_nam2.sh new file mode 100755 index 0000000000000000000000000000000000000000..331599dc8cb43914d476c36e1ab2ebd650737425 --- /dev/null +++ b/tools/conf_tests/small_3D_np1/aro48t3_nam2.sh @@ -0,0 +1,1212 @@ +#!/bin/bash +#SBATCH -n 1 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=1 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLn + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + LSEDIM_AFTER=.FALSE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_np1/aro48t3_nam3.sh b/tools/conf_tests/small_3D_np1/aro48t3_nam3.sh new file mode 100755 index 0000000000000000000000000000000000000000..788b1f24d897e72e8f6b478dd2221615f10bacfa --- /dev/null +++ b/tools/conf_tests/small_3D_np1/aro48t3_nam3.sh @@ -0,0 +1,1214 @@ +#!/bin/bash +#SBATCH -n 1 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=1 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LSEDIM_AFTER=.FALSE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_np1/aro48t3_nam4.sh b/tools/conf_tests/small_3D_np1/aro48t3_nam4.sh new file mode 100755 index 0000000000000000000000000000000000000000..36296839df44c55af373acd4c1bd2ea72a573e4c --- /dev/null +++ b/tools/conf_tests/small_3D_np1/aro48t3_nam4.sh @@ -0,0 +1,1214 @@ +#!/bin/bash +#SBATCH -n 1 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=1 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LSEDIM_AFTER=.FALSE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_np1/aro48t3_nam5.sh b/tools/conf_tests/small_3D_np1/aro48t3_nam5.sh new file mode 100755 index 0000000000000000000000000000000000000000..8e5dff8021e0a3bba471d85b8e27feebba60cdcd --- /dev/null +++ b/tools/conf_tests/small_3D_np1/aro48t3_nam5.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 1 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=1 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LSEDIM_AFTER=.FALSE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_np1/aro48t3_nam6.sh b/tools/conf_tests/small_3D_np1/aro48t3_nam6.sh new file mode 100755 index 0000000000000000000000000000000000000000..fcacc01752cbef4be5222257038580fe0805c9e7 --- /dev/null +++ b/tools/conf_tests/small_3D_np1/aro48t3_nam6.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 1 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=1 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LSEDIM_AFTER=.FALSE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_np1/aro48t3_nam7.sh b/tools/conf_tests/small_3D_np1/aro48t3_nam7.sh new file mode 100755 index 0000000000000000000000000000000000000000..09531cc3cda1f3517ff7bde18ab2a05b8a61aa92 --- /dev/null +++ b/tools/conf_tests/small_3D_np1/aro48t3_nam7.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 1 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB variable must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=1 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LSEDIM_AFTER=.FALSE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_np2/aro48t3_nam1.sh b/tools/conf_tests/small_3D_np2/aro48t3_nam1.sh new file mode 100755 index 0000000000000000000000000000000000000000..563655115ee8c052daadc1926e0a1ea20bd29166 --- /dev/null +++ b/tools/conf_tests/small_3D_np2/aro48t3_nam1.sh @@ -0,0 +1,1210 @@ +#!/bin/bash +#SBATCH -n 2 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=2 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_np2/aro48t3_nam2.sh b/tools/conf_tests/small_3D_np2/aro48t3_nam2.sh new file mode 100755 index 0000000000000000000000000000000000000000..0b0dc710c750d2fed79bf7a6f4b720ce96a3d20a --- /dev/null +++ b/tools/conf_tests/small_3D_np2/aro48t3_nam2.sh @@ -0,0 +1,1212 @@ +#!/bin/bash +#SBATCH -n 2 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=2 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLn + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + LOSIGMAS=.TRUE., + LOSUBG_COND=.TRUE., + NPRINTFR=10000, + NPTP=1, + VSIGQSAT=0.02, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_np2/aro48t3_nam3.sh b/tools/conf_tests/small_3D_np2/aro48t3_nam3.sh new file mode 100755 index 0000000000000000000000000000000000000000..938f2e8312c15cc4ba780b3eb977a26b8518dabb --- /dev/null +++ b/tools/conf_tests/small_3D_np2/aro48t3_nam3.sh @@ -0,0 +1,1214 @@ +#!/bin/bash +#SBATCH -n 2 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=2 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICE + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_np2/aro48t3_nam4.sh b/tools/conf_tests/small_3D_np2/aro48t3_nam4.sh new file mode 100755 index 0000000000000000000000000000000000000000..a8f33b84c6dd632c9bc5e745803d125d0af5732d --- /dev/null +++ b/tools/conf_tests/small_3D_np2/aro48t3_nam4.sh @@ -0,0 +1,1214 @@ +#!/bin/bash +#SBATCH -n 2 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=2 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_np2/aro48t3_nam5.sh b/tools/conf_tests/small_3D_np2/aro48t3_nam5.sh new file mode 100755 index 0000000000000000000000000000000000000000..d37af68b83ea24b5099fe78fca2abccfeb0c2bbb --- /dev/null +++ b/tools/conf_tests/small_3D_np2/aro48t3_nam5.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 2 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=2 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + / + &NAM_PARAM_ICEN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_np2/aro48t3_nam6.sh b/tools/conf_tests/small_3D_np2/aro48t3_nam6.sh new file mode 100755 index 0000000000000000000000000000000000000000..72a94a3f82b09eb7905a671dc9316e81d96a9f70 --- /dev/null +++ b/tools/conf_tests/small_3D_np2/aro48t3_nam6.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 2 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=2 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x diff --git a/tools/conf_tests/small_3D_np2/aro48t3_nam7.sh b/tools/conf_tests/small_3D_np2/aro48t3_nam7.sh new file mode 100755 index 0000000000000000000000000000000000000000..5eb89996800be13b15d16a14041cf323ca5a381f --- /dev/null +++ b/tools/conf_tests/small_3D_np2/aro48t3_nam7.sh @@ -0,0 +1,1216 @@ +#!/bin/bash +#SBATCH -n 2 +#SBATCH --mem=20000 +#SBATCH --export=MYLIB,HOME,HOMEPACK,TMPDIR,OUTPUTDIR,TESTDIR +#SBATCH -t 00:10:00 +#SBATCH -N 1 +#SBATCH -p normal256 + +#The MYLIB varibale must contain the gmkpack pack name +#The TESTDIR variable must contain the test directory +#Results will be stored in the local directory + +#Other environment varaibles that can be set: +#OUTPUTDIR + +date + +OUTPUTDIR=${OUTPUTDIR:-$PWD} +case=riette2 +#rekchemin="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #Resources for the run must be in the same directory as this script +rekchemin=$TESTDIR + +NPROC=2 +NSTRIN=$NPROC +NSTROUT=1 +NPRTRW_NPRTRV="" +NPRTRW_NPRTRV=" NPRTRW=$NPROC, + NPRTRV=1," +export OMP_NUM_THREADS=1 + +#MYLIB=48t1_main.01%jpdup + +export DR_HOOK=1 +#export DR_HOOK_IGNORE_SIGNALS=-1 +export DR_HOOK_NOT_MPI=1 +export DR_HOOK_SILENT=1 +export DR_HOOK_OPT= + +export EC_PROFILE_HEAP=0 +export EC_PROFILE_MEM=0 +export EC_MPI_ATEXIT=0 +export DR_HOOK_SHOW_PROCESS_OPTIONS=0 +export EC_MEMINFO=0 +export TVSEARCHPATH=$SOURCE + +HOMEPACK=${HOMEPACK:=$HOME/pack} +SOURCE=$HOMEPACK/$MYLIB/src/local +LOADIR=$HOMEPACK/$MYLIB/bin + +TMPDIR=${TMPDIR:=$HOME/tmp} +TMPLOC=$TMPDIR/rundir.$$ +TMPWAIT=$TMPDIR/wait_queue.$$ +mkdir $TMPWAIT +mkdir $TMPLOC +cd $TMPLOC + +export RTTOV_COEFDIR=$PWD + +# ************************** +# * Saisie des NAMELISTS * +# ************************** + +CNMEXP='FPOS' + +echo +/bin/cat <<FIN > fort.4 + &NACIETEO + / + &NACOBS + / + &NACTAN + / + &NACTEX + / + &NACVEG + / + &NADOCK + / + &NAEAEM7 + / + &NAEAER + / + &NAECOAPHY + / + &NAEPHLI + / + &NAEPHY + / + &NAERAD + LRRTM=.TRUE., + LSRTM=.FALSE., + NAER=1, + NICEOPT=3, + NLIQOPT=3, + NOVLP=6, + NOZOCL=2, + NRADFR=18, + NRADIP=3, + NRADLP=2, + NSW=6, + RLWINHF=1, + RRE2DE=0.64952, + RSWINHF=1, + / + &NAERCLI + / + &NAEVOL + / + &NAIMPO + / + &NALORI + / + &NAMAFN + GFP_CLSG%CLNAME='SURFACCGRAUPEL', + GFP_CLSP%CLNAME='SURFACCPLUIE', + GFP_CLSS%CLNAME='SURFACCNEIGE', + GFP_SFIS%IBITS=16, + GFP_ST%CLNAME='SURFTEMPERATURE', + GFP_ST%IANO=0, + GFP_ST%IBITS=12, + GFP_X10U%CLNAME='CLSVENT.ZONAL', + GFP_X10U%IANO=0, + GFP_X10U%IBITS=12, + GFP_X10V%CLNAME='CLSVENT.MERIDIEN', + GFP_X10V%IANO=0, + GFP_X10V%IBITS=12, + GFP_X2RH%CLNAME='CLSHUMI.RELATIVE', + GFP_X2RH%IANO=0, + GFP_X2RH%IBITS=12, + GFP_X2T%CLNAME='CLSTEMPERATURE', + GFP_X2T%IANO=1, + GFP_XCCC%IBITS=8, + GFP_XHCC%IBITS=8, + GFP_XLCC%IBITS=8, + GFP_XLSG%CLNAME='SURFINSGRAUPEL', + GFP_XLSP%CLNAME='SURFINSPLUIE', + GFP_XLSS%CLNAME='SURFINSNEIGE', + GFP_XMCC%IBITS=8, + GFP_XN2T%IBITS=12, + GFP_XTCC%IBITS=8, + GFP_XUGST%CLNAME='CLSU.RAF60M.XFU', + GFP_XUGST%IANO=0, + GFP_XUGST%IBITS=12, + GFP_XVGST%CLNAME='CLSV.RAF60M.XFU', + GFP_XVGST%IANO=0, + GFP_XVGST%IBITS=12, + GFP_XX2T%IBITS=12, + GFP_XXDIAGH%IBITS=12, + TFP_ABS%ZFK=32., + TFP_CLF%IBITS=6, + TFP_EDR%CLNAME='EDR', + TFP_EDR%IBITS=16, + TFP_EDR%IGRIB=136, + TFP_GR%IBITS=12, + TFP_HL%IBITS=12, + TFP_HTB%IBITS=16, + TFP_HTB%LLGP=.TRUE., + TFP_HU%IBITS=12, + TFP_MSAT9C2%IBITS=12, + TFP_MSAT9C6%IBITS=12, + TFP_MSLNH%IBITS=12, + TFP_PV%ZFK=64., + TFP_RCLS%IBITS=12, + TFP_RR%IBITS=12, + TFP_SN%IBITS=12, + TFP_T%IBITS=12, + TFP_TCLS%IBITS=12, + TFP_TH%IBITS=12, + TFP_THPW%IBITS=12, + TFP_THV%IBITS=12, + TFP_TN%IBITS=12, + TFP_TWV%IBITS=12, + TFP_TX%IBITS=12, + TFP_U%IBITS=12, + TFP_V%IBITS=12, + TFP_VOR%ZFK=32., + TFP_VV%ZFK=32., + / + &NAMARG + CNMEXP='${CNMEXP}', + LECMWF=.FALSE., + LELAM=.TRUE., + LSLAG=.TRUE., + NCONF=1, + NSUPERSEDE=1, + / + &NAMARPHY + LKFBCONV=.FALSE., + LKFBD=.FALSE., + LKFBS=.FALSE., + LMFSHAL=.TRUE., + LMICRO=.TRUE., + LMPA=.TRUE., + LMSE=.TRUE., + LTURB=.TRUE., + / + &NAMCA + / + &NAMCAPE + / + &NAMCFU + LCUMFU=.TRUE., + LFPLS=.TRUE., + LFPLSG=.TRUE., + LFR=.TRUE., + LFRRC=.TRUE., + LFSF=.TRUE., + LNEBPAR=.TRUE., + LNEBTT=.TRUE., + LRAYD=.TRUE., + LRAYS=.TRUE., + / + &NAMCHEM + / + &NAMCHET + / + &NAMCHK + / + &NAMCLA + / + &NAMCLDP + / + &NAMCLI + / + &NAMCLOP15 + / + &NAMCLTC + / + &NAMCOK + / + &NAMCOM + / + &NAMCOSJO + / + &NAMCOUPLO4 + / + &NAMCT0 + CFPNCF='ECHFP', + CNPPATH=' ', + LAROME=.TRUE., + LNHEE=.TRUE., + LSCREEN_OPENMP=.FALSE., + LSPRT=.TRUE., + LTWOTL=.TRUE., + NFPOS=1, + NFRSDI=18, + NSDITS(0)=0, + NFRHIS=72, + NHISTS(0)=0, + NFRPOS=72, + NPOSTS(0)=0, + NFRSFXHIS=72, + NSFXHISTS(0)=0, + NFRDHFD=72, + NDHFDTS(0)=0, + / + &NAMCT1 + LRFILAF=.FALSE., + N1HIS=1, + N1POS=1, + N1RES=0, + N1SDI=1, + N1SFXHIS=1, + N1GDI=0, + / + &NAMCUMF + / + &NAMCUMFS + / + &NAMCVER + / + &NAMCVMNH + / + &NAMDDH + LDDH_OMP=.TRUE., + LHDDOP=.TRUE., + LHDHKS=.TRUE., + LHDEFD=.TRUE., + LFLEXDIA=.TRUE., + BDEDDH(1,1)=3, + BDEDDH(2,1)=1, + BDEDDH(3,1)=358.8 + BDEDDH(4,1)=45.1 + BDEDDH(5,1)=360.3 + BDEDDH(6,1)=44.5 + / + &NAMDFI + / + &NAMDIM + NPROMA=-50, + / + &NAMDIMO + / + &NAMDIM_TRAJ + / + &NAMDPHY + / + &NAMDPRECIPS + / + &NAMDYN + LADVF=.TRUE., + LQMPD=.FALSE., + LQMT=.FALSE., + LQMVD=.FALSE., + LRHDI_LASTITERPC=.TRUE., + NITMP=4, + NSITER=1, + NSPDLAG=3, + NSVDLAG=3, + NTLAG=3, + NVLAG=3, + NWLAG=3, + RDAMPDIV=20., + RDAMPPD=20., + RDAMPQ=0., + RDAMPT=0., + RDAMPVD=20., + RDAMPVOR=20., + REPS1=0., + REPS2=0., + REPSM1=0., + REPSM2=0., + REPSP1=0., + SDRED=1., + SIPR=90000., + SITR=350., + SITRA=100., + SLHDA0=0.25, + SLHDD00=0.000065, + VESL=0.05, + XIDT=0., + ZSLHDP1=1.7, + ZSLHDP3=0.6, + / + &NAMDYNA + LCOMADH=.TRUE., + LCOMADV=.FALSE., + LCOMAD_GFL=.TRUE., + LCOMAD_SP=.TRUE., + LCOMAD_SPD=.TRUE., + LCOMAD_SVD=.TRUE., + LCOMAD_T=.TRUE., + LCOMAD_W=.TRUE., + LGWADV=.TRUE., + LNESC=.TRUE., + LPC_CHEAP=.TRUE., + LPC_FULL=.TRUE., + LRDBBC=.FALSE., + LSETTLS=.FALSE., + LSETTLST=.TRUE., + LSLHD_GFL=.TRUE., + LSLHD_OLD=.FALSE., + LSLHD_SPD=.FALSE., + LSLHD_SVD=.FALSE., + LSLHD_T=.FALSE., + LSLHD_W=.FALSE., + ND4SYS=2, + NDLNPR=1, + NPDVAR=2, + NVDVAR=4, + SLHDEPSH=0.08, + SLHDKMAX=6, + / + &NAMDYNCORE + / + &NAMEMIS_CONF + / + &NAMENKF + / + &NAMFA + CMODEL='OUTPUTID', + LEXTERN=.TRUE., + LSUPPDATE=.FALSE., + NBITCS=-1, + NBITPG=-1, + NSTRON=-1, + / + &NAMFAINIT + JPXTRO=2000, + / + &NAMFPC + CFP2DF(1)='SURFPRESSION', + CFP2DF(2)='MSL_NHPRESSURE', + CFP2DF(3)='SURFTOT.WAT.VAPO', + CFP2DF(4)='SURFISOTPW0.MALT', + CFP2DF(5)='SURFCAPE.POS.F00', + CFP2DF(6)='C002_METEOSAT_09_SEVIRI.POS', + CFP2DF(7)='C006_METEOSAT_09_SEVIRI.POS', + CFP2DF(8)='SURFREFLECT.MAX', + CFP2DF(9)='SURFISOTPW1.MALT', + CFP2DF(10)='SURFISOTPW2.MALT', + CFP3DF(1)='GEOPOTENTIEL', + CFP3DF(2)='TEMPERATURE', + CFP3DF(3)='VENT_ZONAL', + CFP3DF(4)='VENT_MERIDIEN', + CFP3DF(5)='HUMI_RELATIVE', + CFP3DF(6)='THETA_PRIM_W', + CFP3DF(7)='PRESSURE', + CFP3DF(8)='ABS_VORTICITY', + CFP3DF(9)='VITESSE_VERTICALE', + CFP3DF(10)='TEMPE_POTENT', + CFP3DF(11)='POT_VORTICIT', + CFP3DF(12)='SIM_REFLECTI', + CFP3DF(13)='RAIN', + CFP3DF(14)='SNOW', + CFP3DF(15)='GRAUPEL', + CFP3DF(16)='ICE_CRYSTAL', + CFP3DF(17)='CLOUD_WATER', + CFP3DF(18)='VERT.VELOCIT', + CFP3DF(19)='DIVERGENCE', + CFP3DF(20)='THETA_VIRTUA', + CFP3DF(21)='TKE', + CFP3DF(22)='CLOUD_FRACTI', + CFP3DF(23)='ISOT_ALTIT', + CFP3DF(24)='EDR', + CFPCFU(1)='SURFTENS.TOTA.ZO', + CFPCFU(2)='SURFTENS.TOTA.ME', + CFPCFU(3)='SURFACCPLUIE', + CFPCFU(4)='SURFACCNEIGE', + CFPCFU(5)='SURFACCGRAUPEL', + CFPCFU(6)='SOMMFLU.RAY.SOLA', + CFPCFU(7)='SURFFLU.RAY.SOLA', + CFPCFU(8)='SOMMFLU.RAY.THER', + CFPCFU(9)='SURFFLU.RAY.THER', + CFPCFU(10)='SURFFLU.LAT.MTOT', + CFPCFU(11)='SURFFLU.MTOTA.NE', + CFPCFU(12)='SURFFLU.CHA.SENS', + CFPCFU(13)='SURFRAYT SOLA DE', + CFPCFU(14)='SURFRAYT THER DE', + CFPCFU(15)='SURFRAYT SOL CL', + CFPCFU(16)='SURFRAYT THER CL', + CFPCFU(17)='SURFRAYT DIR SUR', + CFPDOM(1)='FRANGP0025', + CFPFMT='LALON', + CFPPHY(1)='SURFTEMPERATURE', + CFPPHY(2)='INTSURFGEOPOTENT', + CFPPHY(3)='SURFRESERV.NEIGE', + CFPXFU(1)='CLSTEMPERATURE', + CFPXFU(2)='CLSHUMI.RELATIVE', + CFPXFU(3)='CLSVENT.ZONAL', + CFPXFU(4)='CLSVENT.MERIDIEN', + CFPXFU(5)='SURFNEBUL.TOTALE', + CFPXFU(6)='SURFNEBUL.HAUTE', + CFPXFU(7)='SURFNEBUL.MOYENN', + CFPXFU(8)='SURFNEBUL.BASSE', + CFPXFU(9)='CLSMAXI.TEMPERAT', + CFPXFU(10)='CLSMINI.TEMPERAT', + CFPXFU(11)='CLPMHAUT.MOD.XFU', + CFPXFU(12)='SURFDIAGHAIL', + LCRITSNOWTEMP=.FALSE., + LFPCAPEX=.TRUE., + LFPMOIS=.TRUE., + LFPPACKING=.FALSE., + LWIDER_DOM=.TRUE., + L_READ_MODEL_DATE=.TRUE., + NFITI=1, + NFITV=1, + NFPCAPE=5, + NFPCLI=1, + NFPGRIB=1, + NFPINPHY=4, + NITERPV=8, + RENTRA=0.0001, + RFP3H(1)=10., + RFP3H(2)=20., + RFP3H(3)=35., + RFP3H(4)=50., + RFP3H(5)=75., + RFP3H(6)=100., + RFP3H(7)=150., + RFP3H(8)=200., + RFP3H(9)=250., + RFP3H(10)=375., + RFP3H(11)=500., + RFP3H(12)=625., + RFP3H(13)=750., + RFP3H(14)=875., + RFP3H(15)=1000., + RFP3H(16)=1125., + RFP3H(17)=1250., + RFP3H(18)=1375., + RFP3H(19)=1500., + RFP3H(20)=1750., + RFP3H(21)=2000., + RFP3H(22)=2250., + RFP3H(23)=2500., + RFP3H(24)=2750., + RFP3H(25)=3000., + RFP3I(1)=-273.15, + RFP3I(2)=-263.15, + RFP3I(3)=-261.15, + RFP3I(4)=-253.15, + RFP3P(1)=10000., + RFP3P(2)=12500., + RFP3P(3)=15000., + RFP3P(4)=17500., + RFP3P(5)=20000., + RFP3P(6)=22500., + RFP3P(7)=25000., + RFP3P(8)=27500., + RFP3P(9)=30000., + RFP3P(10)=35000., + RFP3P(11)=40000., + RFP3P(12)=45000., + RFP3P(13)=50000., + RFP3P(14)=55000., + RFP3P(15)=60000., + RFP3P(16)=65000., + RFP3P(17)=70000., + RFP3P(18)=75000., + RFP3P(19)=80000., + RFP3P(20)=85000., + RFP3P(21)=90000., + RFP3P(22)=92500., + RFP3P(23)=95000., + RFP3P(24)=100000., + RFP3PV(1)=0.0000015, + RFP3PV(2)=0.000002, + RFPCD2=5., + RFPCSAB=50., + RFPVCAP=7000., + / + &NAMFPD + NLAT(1)=41, + NLON(1)=41, + RLONC(1)=-0.71, + RLATC(1)=44.8, + RDELX(1)=0.025, + RDELY(1)=0.025, + / + &NAMFPDY2 + / + &NAMFPDYF + / + &NAMFPDYH + / + &NAMFPDYI + / + &NAMFPDYP + / + &NAMFPDYS + / + &NAMFPDYT + / + &NAMFPDYV + / + &NAMFPF + NFMAX(1)=60, + NFMAX(2)=80, + / + &NAMFPG + NFPDISTRIB=1, + / + &NAMFPIOS + / + &NAMFPMOVE + / + &NAMFPPHY + / + &NAMFPSC2 + NFPROMA=-50, + / + &NAMFPSC2_DEP + NFPROMA_DEP=-50, + / + &NAMGEM + / + &NAMGFL + NGFL_EZDIAG=4, + YEZDIAG_NL(1)%CNAME='EZDIAG01', + YEZDIAG_NL(1)%LREQOUT=.FALSE., + YEZDIAG_NL(2)%CNAME='EZDIAG02', + YEZDIAG_NL(2)%LREQOUT=.FALSE., + YEZDIAG_NL(3)%CNAME='EZDIAG03', + YEZDIAG_NL(3)%LREQOUT=.FALSE., + YEZDIAG_NL(4)%CNAME='INPRRTOT3D', + YEZDIAG_NL(4)%LREQOUT=.TRUE., + YG_NL%LQM=.TRUE., + YG_NL%LSLHD=.TRUE., + YG_NL%NCOUPLING=-1, + YG_NL%NREQIN=1, + YG_NL%REFVALC=0., + YIRAD_NL%LGP=.TRUE., + YI_NL%LQM=.TRUE., + YI_NL%LSLHD=.TRUE., + YI_NL%NCOUPLING=-1, + YI_NL%NREQIN=1, + YI_NL%REFVALC=0., + YLRAD_NL%LGP=.TRUE., + YL_NL%LQM=.TRUE., + YL_NL%LSLHD=.TRUE., + YL_NL%NCOUPLING=-1, + YL_NL%NREQIN=1, + YL_NL%REFVALC=0., + YQ_NL%LCOMAD=.TRUE., + YQ_NL%LQM=.TRUE., + YQ_NL%LSLHD=.FALSE., + YQ_NL%NREQIN=1, + YR_NL%LQM=.TRUE., + YR_NL%LSLHD=.TRUE., + YR_NL%NCOUPLING=-1, + YR_NL%NREQIN=1, + YR_NL%REFVALC=0., + YS_NL%LQM=.TRUE., + YS_NL%LSLHD=.TRUE., + YS_NL%NCOUPLING=-1, + YS_NL%NREQIN=1, + YS_NL%REFVALC=0., + YTKE_NL%NCOUPLING=0, + YTKE_NL%NREQIN=1, + / + &NAMGRIB + / + &NAMGWD + / + &NAMGWDIAG + / + &NAMGWWMS + / + &NAMIAU + ALPHAIAU=0.5, + LIAU=.FALSE., + TSTARTIAU=1800, + TSTOPIAU=5340, + / + &NAMICE + / + &NAMINI + LDFI=.FALSE., + / + &NAMINTFLEX + / + &NAMIOMI + / + &NAMIOS + / + &NAMIO_SERV + NIO_SERV_BUF_MAXSIZE=20, + NIO_SERV_METHOD=2, + NMSG_LEVEL_CLIENT=0, + NMSG_LEVEL_SERVER=0, + NPROCESS_LEVEL=5, + NPROC_IO=0, + / + &NAMJBCODES + / + &NAMJFH + / + &NAMJG + / + &NAMLCZ + / + &NAMLSFORC + / + &NAMMARS + / + &NAMMCC + / + &NAMMCUF + / + &NAMMKODB + / + &NAMMODERR + / + &NAMMTS + / + &NAMMWAVE + / + &NAMNPROF + / + &NAMNUD + / + &NAMOBS + / + &NAMONEDVAR + / + &NAMOOPS + / + &NAMOPH + CFNHWF='ECHIS', + LINC=.TRUE., + NTIMEFMT=1, + / + &NAMOPTCMEM + / + &NAMPAR0 + LOPT_SCALAR=.TRUE., + NPRINTLEV=1, + LMPOFF=.FALSE., + MBX_SIZE=2048000000, + MP_TYPE=2, + NOUTPUT=1, + NPROC=$NPROC, +$NPRTRW_NPRTRV + / + &NAMPAR1 + LEQ_REGIONS=.FALSE., + LSLONDEM=.TRUE., + LSPLIT=.TRUE., + LSYNC_SLCOM=.FALSE., + LSYNC_TRANS=.FALSE., + L_GATHERV_WRGP=.FALSE., + NCOMBFLEN=1800000, + NSTRIN=$NSTRIN, + NSTROUT=$NSTROUT, + / + &NAM_NEBN + CFRAC_ICE_ADJUST='S', + CFRAC_ICE_SHALLOW_MF='S', + LSIGMAS=.TRUE. + LSUBG_COND=.TRUE., + VSIGQSAT=0.02, + / + &NAM_PARAM_ICEN + CSEDIM='STAT', + CSNOWRIMING='M90', + LCONVHG=.TRUE., + LCRFLIMIT=.TRUE., + LEVLIMIT=.TRUE., + LFEEDBACKT=.TRUE., + LNULLWETG=.TRUE., + LNULLWETH=.TRUE., + LSEDIM_AFTER=.FALSE., + LWETGPOST=.TRUE., + LWETHPOST=.TRUE., + NMAXITER_MICRO=1, + XFRACM90=0.1, + XMRSTEP=0.00005, + XSPLIT_MAXCFL=0.8, + XTSTEP_TS=0., + LSEDIC=.TRUE., + LCRIAUTI=.TRUE., + XCRIAUTC_NAM=0.001, + XCRIAUTI_NAM=0.0002, + XT0CRIAUTI_NAM=-5., + LRED=.TRUE., + / + &NAM_PARAM_MFSHALLN + / + &NAM_TURBN + / + &NAMPARAR + CMICRO='ICE3', + LFPREC3D=.TRUE., + LOLSMC=.TRUE., + NPRINTFR=10000, + NPTP=1, + / + &NAMPHMSE + LPGDFWR=.FALSE., + / + &NAMPHY + LAERODES=.TRUE., + LAEROLAN=.TRUE., + LAEROSEA=.TRUE., + LAEROSOO=.TRUE., + LEDR=.TRUE., + LMPHYS=.TRUE., + LO3ABC=.TRUE., + LRAYFM=.TRUE., + / + &NAMPHY0 + ALMAV=300., + BEDIFV=0.05, + ECMNP=3000., + GCCSV=0., + GCVADS=0.8, + GCVALFA=0.000045, + GCVBETA=0.2, + GCVMLT=0.00016, + GCVNU=0.000025, + GCVPSI=1., + GCVPSIE=1., + GDDEVA=0.25, + GDDSDE=0.5, + GWDCD=6., + HUCOE=0.5, + HUTIL=1.8, + QSSC=400., + QSSUSC=0.75, + QSSUSS=0.4, + QSSUSV=250., + QSUSXC=0.0002, + QSUSXS=0.0003, + QXRAL=130., + QXRDEL=0.49, + QXRHX=0.99, + QXRR=0.25, + RCVEVAP=0.25, + REFLKUO=5000., + REVGSL=15., + SCO=-20., + TDDGP=0.8, + TENTR=0.0000025, + TENTRX=0.00008, + TUDGP=0.8, + UHDIFV=0.0008, + USURIC=0.175, + USURICE=0.5, + USURICL=1., + USURID=0.1, + USURIDE=0.25, + VZ0CM=0.00015, + XMAXLM=5000., + XMINLM=10., + / + &NAMPHY1 + ALBMIN=0.65, + ALCRIN=0.75, + GCGEL=0.00003, + GCGELS=0.00005, + GNEIMX=1.8, + GNEIMXS=1.8, + RCTVEG(3)=0.000012, + RCTVEG(4)=0.00001, + / + &NAMPHY2 + FACRAF=3.8, + HTKERAF=20., + LMULAF=.TRUE., + LRAFTKE=.TRUE., + LRAFTUR=.TRUE., + XDAMP=1., + XMULAF=-1.85, + / + &NAMPHY3 + / + &NAMPHYDS + / + &NAMPONG + / + &NAMPPC + / + &NAMPPVI + / + &NAMPRE + / + &NAMRAD15 + / + &NAMRADCMEM + / + &NAMRCF + / + &NAMRCOEF + / + &NAMRES + / + &NAMRGRI + / + &NAMRINC + / + &NAMRIP + TSTEP=50., + CSTOP='h2', + / + &NAMRIP0 + / + &NAMRLX + / + &NAMSATS + LPARTIAL_COEF_FILES=.TRUE., + / + &NAMSCC + / + &NAMSCEN + / + &NAMSCM + / + &NAMSEKF + / + &NAMSENS + / + &NAMSFXCMP + CFLDNAME(1)='????????????????', + NBBITS(1)=24, + / + &NAMSIMPHL + / + &NAMSPNG + / + &NAMSPSDT + / + &NAMSTA + / + &NAMSTOPH + / + &NAMSWE + / + &NAMTESTVAR + / + &NAMTHLIM + / + &NAMTOPH + ETCVIM=5000., + ETNEBU=5000., + ETPLUI=5000., + XDRMTK=6.0D-7, + XDRMTP=800., + XDRMUK=3.0D-7, + XDRMUP=800., + / + &NAMTRAJP + / + &NAMTRANS + / + &NAMTRANS0 + / + &NAMTS + / + &NAMVAR + / + &NAMVARBC + / + &NAMVARBC_AIREP + / + &NAMVARBC_ALLSKY + / + &NAMVARBC_GBRAD + / + &NAMVARBC_RAD + / + &NAMVARBC_SFCOBS + / + &NAMVARBC_TCWV + / + &NAMVARBC_TO3 + / + &NAMVAREPS + / + &NAMVDF + / + &NAMVDOZ + / + &NAMVOLCANO + / + &NAMVRTL + / + &NAMVV0 + / + &NAMVV1 + / + &NAMVWRK + / + &NAMWAVELETJB + / + &NAMXFU + LXCLP=.TRUE., + LXCLS=.TRUE., + LXFU=.TRUE., + LXNEBPA=.TRUE., + LXNEBTT=.TRUE., + LXNUVCLS=.TRUE., + LXPLS=.TRUE., + LXPLSG=.TRUE., + LXQCLS=.TRUE., + LXR=.TRUE., + LXSOIL=.FALSE., + LXTHW=.TRUE., + LXTRT=.TRUE., + LXTTCLS=.TRUE., + LXXDIAGH=.TRUE., + LXXGST=.TRUE., + NFRRAZ=72, + NRAZTS(0)=0, + / + &NAM_CANAPE + / + &NAM_DISTRIBUTED_VECTORS + / + &NAPHLC + / + &NEMCT0 + / + &NEMDIM + / + &NEMDYN + / + &NEMELBC0A + LESPCPL=.TRUE., + NBICNHX=2, + NBICOP=2, + NBICOT=2, + NBICOU=2, + NBICPD=2, + NBICVD=2, + NECRIPL=1, + / + &NEMELBC0B + NEFRSPCPL=1, + NEK0=20, + NEK1=30, + NEN1=4, + NEN2=8, + SPNUDDIV=0.01, + SPNUDQ=0., + SPNUDT=0.01, + SPNUDVOR=0.01, + TEFRCL=3600., + / + &NEMFPEZO + / + &NEMGEO + / + &NEMJK + / + &NEMVAR + / + &NEMWAVELET + / + &NAETLDIAG + / + &NAMMETHOX + / + &NAMSPP + / + &NAMACV + / + &NAMFPOBJ + / + &NAMNORGWD + / + &NAMTRAJ + / + &NAMSATSIM + / + &NAMDVISI + / + &NAMNUDGLH + / + &NAMPERTPAR + / +FIN +/bin/cat fort.4 + +/bin/cat <<FIN > EXSEG1.nam + &NAM_DIAG_ISBAN + LPGD=.TRUE., + LSURF_MISC_BUDGET=.TRUE., + / + &NAM_DIAG_SURFN + LCOEF=.TRUE., + LSURF_BUDGET=.TRUE., + N2M=2, + / + &NAM_ISBAN + CSCOND='NP89', + / + &NAM_REPROD_OPER + LREPROD_OPER=.TRUE., + / + &NAM_SEAFLUXN + CSEA_FLUX='ECUME', + LPWG=.FALSE., + LPRECIP=.FALSE., + LPWEBB=.FALSE., + / + &NAM_SSON + CROUGH='Z01D', + XFRACZ0=5., + LDSV=.FALSE., + / + &NAM_SURF_ATM + XRIMAX=0.2, + LNOSOF=.TRUE., + / + &NAM_SURF_CSTS + XZ0SN=0.01, + XZ0HSN=0.001, + XEMISSN=0.99, + / + &NAM_WRITE_DIAG_SURFN + LPROVAR_TO_DIAG=.FALSE., + LSELECT=.TRUE., +CSELECT(1)='T2M','HU2M','XX','YY','DX','DY','SST','Z0SEA','TS_WATER','Z0WATER','TG1','TG2','TG3','WG1','WG2','WG3','WGI1','WGI2','WGI3','WR','WSN_VEG1','RSN_VEG1','ASN_VEG','TSRAD_NAT','RESA','TROOF1','TROOF2','TROOF3','TROOF4','TROOF5','WS_ROOF','TROAD1','TROAD2','TROAD3','TROAD4','TROAD5','WS_ROAD','TWALL1','TWALL2','TWALL3','TWALL4','TWALL5','TI_BLD','T_WIN1','TI_ROAD','WSN_RF1','RSN_RF1','TSN_RF1','ASN_RF','WSN_RD1','RSN_RD1','TSN_RD1','ASN_RD','TCANYON','QCANYON','STORAGE_TYPE','MASDEV','VERSION','BUG','DIM_FULL','DTCUR','LAT0','LON0','RPK','BETA','LATORI','LONORI','IMAX','JMAX','RW_PRECIP','BUDC','SEA_OCEAN','SEA_SBL','WAT_SBL','SN_VEG_N','SN_VEG','LSNOW_FRAC_T','GLACIER','TEMPARP','NLITTER','NLITTLEVS','NSOILCARB','ISBA_CANOPY','SN_RF_N','SN_RF','SN_RD_N','SN_RD','SN_RD_TYP','SN_RF_TYP','TEB_CANOPY','STORAGETYPE','CARTESIAN','GRID_TYPE','SN_VEG_TYP','RESPSL','ROAD_DIR','WALL_OPT','LAI','VEG','RSMIN','DG2','_FBUF_SIZE','_FBUF_DIM1','_FBUF_DIM2','_FBUF_NAME','_FBUF_TYPE','_FBUF_MASK','LCPL_GCM','HANDLE_SIC','SSS', + / + &NAM_WRITE_SURF_ATM + LNOWRITE_TEXFILE=.TRUE., + / +FIN +/bin/cat EXSEG1.nam + +# ***************************************** +# * Acquisition du fichier de demarrage * +# ***************************************** + +echo +for hh in 0 1 2 3 4 5 6 ; do + N=`expr $hh / 1 ` + set -x + ln -s $rekchemin/data/aro/$case/ELSCFFCSTALBC000${N}_l15 ELSCF${CNMEXP}ALBC00${N} + set +x +done +set -x +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT_l15 ICMSH${CNMEXP}INIT +ln -s $rekchemin/data/aro/$case/ICMSHFCSTINIT.sfx ICMSH${CNMEXP}INIT.sfx +ln -s $rekchemin/data/surfex/v8/ecoclimapI_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_eu_covers_param.bin . +ln -s $rekchemin/data/surfex/v8/ecoclimapII_af_covers_param.bin . +ln -s $rekchemin/data/aro/$case/Const.Clim Const.Clim +ln -s $rekchemin/data/aro/$case/Const.Clim.sfx Const.Clim.sfx +ln -s $rekchemin/data/aro/$case/const.clim.FRANGP0025 const.clim.FRANGP0025 +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_9_seviri.dat . +ln -s $rekchemin/data/rttov12/rtcoef_meteosat_10_seviri.dat . +ln -s $rekchemin/data/rttov12/sccldcoef_meteosat_9_seviri.dat . +set +x +tar xfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz + +# *************** +# * Chargement * +# *************** + +echo +set -x +\ln -s $LOADIR/MASTERODB MASTER +set +x +if ldd MASTER | grep openmpi > /dev/null; then + #On est sur PC + MPILIB=$(ldd MASTER | grep openmpi | tail -1 | awk '{print $3}' | awk -F "/" '{print $(NF-2)}') + MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep openmpi| tail -1 | awk '{print $3}'))))/bin/orterun --oversubscribe -np $NPROC" + GRIB_API=$(dirname $(dirname $(ldd MASTER | grep grib_api | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + ECCODES=$(dirname $(dirname $(ldd MASTER | grep eccodes | head -1 | awk '{print $3}') 2>/dev/null) 2>/dev/null) + export GRIB_SAMPLES_PATH=$GRIB_API/share/grib_api/ifs_samples/grib1 + export GRIB_DEFINITION_PATH=$GRIB_API/share/grib_api/definitions + export ECCODES_SAMPLES_PATH=$ECCODES/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=$rekchemin/data/eccodes_extras_definitions:$ECCODES/share/eccodes/definitions +else + #On est sur HPC + #MPIRUN="$(echo $(dirname $(dirname $(ldd MASTER | grep libmpi| tail -1 | awk '{print $3}'))))/bin/mpirun -wdir $PWD" + NNODES=$SLURM_JOB_NUM_NODES + MPITASKS_PER_NODE=$((SLURM_NTASKS/SLURM_JOB_NUM_NODES)) + MPI_TASKS=$SLURM_NTASKS + MPIRUN="/opt/softs/mpiauto/mpiauto -np $MPI_TASKS -nnp $MPITASKS_PER_NODE --" + export OMP_STACKSIZE=4G + export KMP_STACKSIZE=4G + export KMP_MONITOR_STACKSIZE=4G + export DR_HOOK=1 + export DR_HOOK_IGNORE_SIGNALS=-1 + export DR_HOOK_SILENT=1 + export DR_HOOK_SHOW_PROCESS_OPTIONS=0 + export MPL_MBX_SIZE=2048000000 + export EC_PROFILE_HEAP=0 + export EC_PROFILE_MEM=0 + export EC_MPI_ATEXIT=0 + export EC_MEMINFO=0 + export OPENBLAS_NUM_THREADS=1 + export MKL_CBWR="AUTO,STRICT" + export MKL_NUM_THREADS=1 + export MKL_DEBUG_CPU_TYPE=5 + export ECCODES_SAMPLES_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/ifs_samples/grib1 + export ECCODES_DEFINITION_PATH=/opt/softs/libraries/ICC_2018.5.274/eccodes-2.17.0/share/eccodes/definitions +fi +echo $MPIRUN +set +x +if [ ! -f MASTER ] ; then echo No executable MASTER;exit 1;fi + +# *************** +# * Execution * +# *************** + +echo +echo OMP_NUM_THREADS=$OMP_NUM_THREADS +set -x +ulimit -s unlimited +$MPIRUN $PWD/MASTER >lola +set +x +echo +##if [ -f lola ] ; then +## echo;echo Standard output :;echo;cat lola +##fi +##if [ -f stderr.* ] ; then +## for file in stderr.* ; do +## echo;echo $file :;cat $file +## done +##fi +##if [ -f stdout.* ] ; then +##echo;echo stdout :;echo;cat stdout.* +##fi +##if [ -a NODE.001_01 ] ; then +## for file in NODE* ; do +## echo;echo Listing $file;echo +## cat $file +## done +##fi +##if [ $(find . -name "drhook.prof.*" | wc -l) -ne 0 ] ; then +### Top 25 for each MPI task : +## for file in drhook.prof.* ; do +## echo;echo $file :;head -38 $file +## done +##fi +#cat drhook.prof.* | perl -w $HOME/bin/drhook_merge_walltime_max.pl + +# ******************* +# * Sauvegardes * +# ******************* + +ls +#if [ -f PFFPOS000+0000 ] ; then +# cp PFFPOS000+0000 $WAIT_QUEUE/PFFPOS000+0000.$PBS_JOBID +#fi +cp lola NODE.001_01 ICMSHFPOS+00* DHFDLFPOS+00* $OUTPUTDIR/ +/bin/rm fort.4 EXSEG1.nam lola ICMSHFPOS+0000* PFFPOSFRANGP0025+0000* ICMSHFPOS+0001* +/bin/rm PFFPOSFRANGP0025+0001* ICMSHFPOS+0002* ECHIS PFFPOSFRANGP0025+0002* DHFDLFPOS+00* +/bin/rm ECHFP NODE.001_01 ifs.stat $(tar tfz $rekchemin/data/rtm/radiation_params.47r1_light.tgz) + +# **************** +# * Epilogue * +# **************** + +ls -ltr | grep -v "\->" +echo Wait_queue : +ls -ltr $TMPWAIT +cd $TMPDIR +\rm -rf rundir.$$ +\rm -rf wait_queue.$$ +date +set +x