Index: CONFIG/UNIFORM/v7/IPSLCM7ISO/EXPERIMENTS/LMDZISO/amip/COMP/lmdz.card
===================================================================
--- CONFIG/UNIFORM/v7/IPSLCM7ISO/EXPERIMENTS/LMDZISO/amip/COMP/lmdz.card	(revision 6746)
+++ CONFIG/UNIFORM/v7/IPSLCM7ISO/EXPERIMENTS/LMDZISO/amip/COMP/lmdz.card	(revision 6746)
@@ -0,0 +1,250 @@
+[Compatibility]
+libIGCM=1.0
+
+[UserChoices]
+# Physics package to use :
+# LMDZ_Physics=AP for standard/old physics(defalut), can be used with LMDZ4_AR5 or LMDZ5/trunk sources
+# LMDZ_Physics=NPv3.2 for an early version of the new physics, to be used with LMDZ5/trunk revision 1554 or later
+# LMDZ_Physics=NPv5.70 for new physics to be used with LMDZ5/testing revision 2595 or later
+# LMDZ_Physics=NPv5.80bz0 for new physics to be used with LMDZ5/trunk revision 2699 or later
+# LMDZ_Physics=NPv6.0.7 for new physics to be used with LMDZ5/trunk revision 2720 or later
+# LMDZ_Physics=NPv6.0.8 for new physics to be used with LMDZ5/trunk revision 2739 or later
+# LMDZ_Physics=NPv6.0.15_T or NPv6.0.15_S to be used with LMDZ6/branches/IPSLCM6.0.15 rev 3224
+# LMDZ_Physics=NPv6.1 to be used with LMDZ6/branches/IPSLCM6.0.15 rev 3301
+# LMDZ_Physics=NPv6.1.3 as NPv6.1 but allows tau_gl to be modified
+# LMDZ_Physics=NPv6.2 as used in QUEST CMIP6 simulations
+LMDZ_Physics=NPv6.3
+
+# Set ConfType to choose parameters for aerosols, solar and green house gazes.
+# The parameter file PARAM/config.def_$ConfType will be used.
+# ConfType=preind/actuel/annuel
+ConfType=actuel
+
+# Manage radiative aerosol effect and ozone
+flag_aerosol=6
+flag_aerosol_strat=0
+ok_ade=y
+ok_aie=y
+aerosol_couple=n
+read_climoz=0
+ok_cdnc=y
+
+##  Facteur additif pour l albedo
+pmagic=0.008
+
+# Set tau_gl depending on the forcing file for the sea-ice (use 2. for amip and 1. for hadisst)
+tau_gl=2.
+
+# ByPass_hgardfou_teta=y : modify teta_ parameters for following CumulPeriod only
+ByPass_hgardfou_teta=n
+
+# ByPass_hgardfou_mats=y : set parameter purmats=y for following CumulPeriod only
+ByPass_hgardfou_mats=n
+
+# Nugding : ok_guide=y/n
+# If ok_guide=y, add nudging files(u.nc, v.nc, hur.nc,...) in BoundaryFiles section below.
+ok_guide=n
+
+# Specify which output file to activate and at which output_level
+# Use an integer to specify the output level or NONE if to deactivate the file
+# output_level_filename=1     : activate the corresponding file with low output level
+# output_level_filename=10    : activate the corresponding file with high output level
+# output_level_filename=NONE  : the file will not be written
+output_level_histmth = 1
+output_level_histday = 1
+output_level_histhf  = NONE
+output_level_histmthNMC = NONE
+output_level_histdayNMC = NONE
+output_level_histhfNMC  = NONE
+output_level_histstrataer = NONE
+output_level_histdaystrataer = NONE
+output_level_histstn      = NONE
+
+# Activate COSP in config.def and set corresponding output files
+LMDZ_COSP_OK=n
+output_level_histmthCOSP = NONE
+output_level_histdayCOSP = NONE
+output_level_histhfCOSP  = NONE
+
+[InitialStateFiles]
+List=   ($R_IN/RESTART/LMDZISO/TEST/amip2015/RT_ISO/ATM/Restart/start.201501.nc,   start.nc),\
+        ($R_IN/RESTART/LMDZISO/TEST/amip2015/RT_ISO/ATM/Restart/startphy.201501.nc, startphy.nc)
+
+#List=	(${R_IN}/ATM/START/eORCA1.2xLMD${RESOL_ATM_XY}/start_eORCA1.2xLMD${RESOL_ATM_3D}_o2a_v3.nc, start.nc),\
+#       (${R_IN}/ATM/START/eORCA1.2xLMD${RESOL_ATM_XY}/startphy_eORCA1.2xLMD${RESOL_ATM_3D}_o2a_v3.nc, startphy.nc) 
+
+[BoundaryFiles]
+# With CMIP6 aerosols version 1
+List=   (${R_IN}/ATM/LIMIT/LMDZISO/RT_ISO/limit.${year}.nc, limit.nc)
+
+#List=   (${R_IN}/ATM/LIMIT/AMIP.v20180427/interpol/${RESOL_ATM_XY}_eORCA1.2_gregorian/limit_${year}.nc, limit.nc),\
+#        (${R_IN}/ATM/AEROSOLS/CMIP6/v1/${RESOL_ATM_XY}/L${RESOL_ATM_Z}/aerosols${year}_from_inca.nc,              aerosols${year}.nc),\
+#        (${R_IN}/ATM/OZONE/UReading/historical.v20160711.v2/interpol/${RESOL_ATM_XY}/climoz_LMDZ_${year}.nc, climoz_LMDZ.nc),\
+#        (${R_IN}/ATM/SOLAR/CMIP6/v3.1corr/Historical/solarforcing_v3.1_daily_6bands_${year}.nc,        solarforcing.nc),\
+#        (${R_IN}/ATM/STRATAERO/CMIP6/v3/${RESOL_ATM_XY}/L${RESOL_ATM_Z}/taulwstrat.2D.${year}.nc, taulwstrat.2D.nc),\
+#        (${R_IN}/ATM/STRATAERO/CMIP6/v3/${RESOL_ATM_XY}/L${RESOL_ATM_Z}/tauswstrat.2D.${year}.nc, tauswstrat.2D.nc)
+
+# Note: the SOLARANDVOLCANOES.txt is only used for LMDZ_Physics=AP and NPv3.2 (if ok_suntime_rrtm=n)
+# Add the following file for LMDZ_Physics=AP (${R_IN}/ATM/IPCC_AR5/HISTORIQUE/SOLARANDVOLCANOES_1610_2008.txt, SOLARANDVOLCANOES.txt)
+ListNonDel= ($R_IN/ATM/LIMIT/LMDZISO/RT_ISO/aerosols.clim.nc, aerosols1980.nc) , \
+            ($R_IN/ATM/LIMIT/LMDZISO/RT_ISO/aerosols.clim.nc, aerosols2015.nc) , \
+            ($R_IN/ATM/LIMIT/LMDZISO/RT_ISO/aerosols.nat.nc, aerosols.nat.nc)
+
+#ListNonDel= (${R_IN}/ATM/GHG/CMIP6/historical/CO2_CMIP6_0000_2014.txt, CO2.txt),\
+#            (${R_IN}/ATM/GHG/CMIP6/historical/CH4_CMIP6_0000_2014.txt, CH4.txt),\
+#            (${R_IN}/ATM/GHG/CMIP6/historical/N2O_CMIP6_0000_2014.txt, N2O.txt),\
+#            (${R_IN}/ATM/GHG/CMIP6/historical/CFC11eq_CMIP6_0000_2014.txt, CFC11.txt),\
+#            (${R_IN}/ATM/GHG/CMIP6/historical/CFC12eq_CMIP6_0000_2014.txt, CFC12.txt),\
+#            (${R_IN}/ATM/AEROSOLS/CMIP6/v1/${RESOL_ATM_XY}/L${RESOL_ATM_Z}/aerosols1850_from_inca.nc, aerosols.nat.nc)
+
+[SmoothFiles]
+List=   ()
+
+[ParametersFiles]
+List=   (${SUBMIT_DIR}/PARAM/LMDZ/physiq.def_${LMDZ_Physics}_iso, physiq.def),      \
+        (${SUBMIT_DIR}/PARAM/LMDZ/gcm.def_${RESOL_ATM_XY}_${LMDZ_Physics}, gcm.def),\
+        (${SUBMIT_DIR}/PARAM/LMDZ/vert.def_L${RESOL_ATM_Z},   vert.def),            \
+        (${MODIPSL}/modeles/LMDZ/DefLists/cosp_input_nl.txt, .),                    \
+        (${MODIPSL}/modeles/LMDZ/DefLists/cosp_output_nl.txt, .),                   \
+        (${SUBMIT_DIR}/PARAM/LMDZ/config.def_${ConfType}_iso,  config.def),         \
+        (${SUBMIT_DIR}/PARAM/LMDZ/guide.def, .),                                    \
+        (${SUBMIT_DIR}/PARAM/LMDZ/run.def_iso, run.def),                            \
+        (${SUBMIT_DIR}/PARAM/LMDZ/iso.def, .),                                      \
+        (${SUBMIT_DIR}/PARAM/LMDZ/isotopes_params.def, .),                          \
+        (${SUBMIT_DIR}/PARAM/LMDZ/tracer.def_iso, tracer.def),                      \
+        (${MODIPSL}/modeles/LMDZ/DefLists/context_lmdz.xml, . ),                    \
+        (${SUBMIT_DIR}/PARAM/LMDZ/field_def_lmdz_iso.xml, field_def_lmdz.xml),      \
+	    (${MODIPSL}/modeles/LMDZ/DefLists/field_def_cosp1.xml, . ),                 \
+        (${SUBMIT_DIR}/PARAM/LMDZ/file_def_histmth_lmdz_iso.xml, file_def_histmth_lmdz.xml), \
+        (${MODIPSL}/modeles/LMDZ/DefLists/file_def_histmthCOSP_lmdz.xml, .),\
+        (${MODIPSL}/modeles/LMDZ/DefLists/file_def_histmthNMC_lmdz.xml, . ),\
+        (${SUBMIT_DIR}/PARAM/LMDZ/file_def_histday_lmdz_iso.xml, file_def_histday_lmdz.xml), \
+        (${MODIPSL}/modeles/LMDZ/DefLists/file_def_histdayCOSP_lmdz.xml, .),\
+        (${MODIPSL}/modeles/LMDZ/DefLists/file_def_histdayNMC_lmdz.xml, . ),\
+        (${MODIPSL}/modeles/LMDZ/DefLists/file_def_histhf_lmdz.xml, . ),    \
+        (${MODIPSL}/modeles/LMDZ/DefLists/file_def_histhfCOSP_lmdz.xml, .), \
+        (${MODIPSL}/modeles/LMDZ/DefLists/file_def_histhfNMC_lmdz.xml, . ), \
+        (${MODIPSL}/modeles/LMDZ/DefLists/file_def_histstn_lmdz.xml, . ),   \
+        (${MODIPSL}/modeles/LMDZ/DefLists/file_def_histins_lmdz.xml, . ),   \
+        (${MODIPSL}/modeles/LMDZ/DefLists/file_def_histstrataer_lmdz.xml, . ),\
+        (${MODIPSL}/modeles/LMDZ/DefLists/file_def_histdaystrataer_lmdz.xml, . ),\
+        (${MODIPSL}/modeles/LMDZ/DefLists/file_def_histLES_lmdz.xml, . )
+
+[RestartFiles]
+List=   (restart.nc, restart.nc, start.nc), \
+        (restartphy.nc, restartphy.nc,  startphy.nc)
+
+[OutputText]
+List=   (physiq.def, gcm.def, run.def, traceur.def, guide.def, config.def, vert.def, used_run.def, iodef.xml, context_lmdz.xml, field_def_lmdz.xml, file_def_*lmdz.xml, debug.01, lmdz.prt, out_lmdz.x.err, out_lmdz.x.out)
+
+[OutputFiles]
+List=   (histmth.nc,       ${R_OUT_ATM_O_M}/${PREFIX}_1M_histmth.nc,       Post_1M_histmth),       \
+        (histmthCOSP.nc,   ${R_OUT_ATM_O_M}/${PREFIX}_1M_histmthCOSP.nc,   NONE),                  \
+        (histmthNMC.nc,    ${R_OUT_ATM_O_M}/${PREFIX}_1M_histmthNMC.nc,    NONE),                  \
+        (histday.nc,       ${R_OUT_ATM_O_D}/${PREFIX}_1D_histday.nc,       NONE),                  \
+        (histdayCOSP.nc,   ${R_OUT_ATM_O_D}/${PREFIX}_1D_histdayCOSP.nc,   NONE),                  \
+        (histdayNMC.nc,    ${R_OUT_ATM_O_D}/${PREFIX}_1D_histdayNMC.nc,    NONE),                  \
+        (histhf.nc,        ${R_OUT_ATM_O_H}/${PREFIX}_HF_histhf.nc,        NONE),                  \
+        (histhfCOSP.nc,    ${R_OUT_ATM_O_H}/${PREFIX}_HF_histhfCOSP.nc,    NONE),                  \
+        (histhfNMC.nc,     ${R_OUT_ATM_O_H}/${PREFIX}_HF_histhfNMC.nc,     NONE),                  \
+        (histhf3h.nc,      ${R_OUT_ATM_O_H}/${PREFIX}_3H_histhf3h.nc,      NONE),                  \
+        (histhf3hm.nc,     ${R_OUT_ATM_O_H}/${PREFIX}_3H_histhf3hm.nc,     NONE)
+
+[Post_1M_histmth]
+Patches= ()
+GatherWithInternal = (lon, lat, presnivs, time_counter, time_centered, time_centered_bounds, aire)
+TimeSeriesVars2D = (bils, cldh, cldl, cldm, cldq, cldt, evap, flat, ftime_con, iwp, lwp, LWdnSFC, LWdnSFCclr, LWupSFC, LWupSFCclr, LWdn200, LWdn200clr, LWup200, LWup200clr, precip, prw, pluc, psol, q2m, rh2m, sens, sicf, slp, snow, soll0, soll, sols0, sols, SWdnSFC, SWupSFC, SWup200, SWdnTOA, SWupTOA, SWdn200, SWdnSFCclr, SWupSFCclr, SWupTOAclr, t2m, ave_t2m_daily_max, ave_t2m_daily_min, taux, taux_ter, taux_sic, taux_lic, taux_oce, tauy, tauy_ter, tauy_sic, tauy_lic, tauy_oce, lat_ter, lat_sic, lat_lic, lat_oce, nettop, pbase, ptop, topl0, topl, tops0, tops, topswad, topswai, tsol, tsol_ter, tsol_lic, tsol_oce, tsol_sic , u10m, u500, v10m, v500, w500, pourc_ter, pourc_oce, pourc_sic, pourc_lic, wind10m, od550aer, od550lt1aer, od550_STRAT, loadoa, loadbc, loadso4, loaddust, loadss, sconcoa, sconcbc, sconcso4, sconcdust, sconcss, reffclwtop, cldncl, swtoaas_ant, swtoacs_ant, swtoacf_ant, swsrfas_ant, swsrfcs_ant, swsrfcf_ant, swtoaas_nat, swtoacs_nat, swtoacf_nat, swsrfas_nat, swsrfcs_nat, swsrfcf_nat, solswai, solswad, swtoacf_zero, swsrfcf_zero, R_ecc, R_peri, R_incl, solaire, rsun1, co2_ppm, CH4_ppb, N2O_ppb, CFC11_ppt, CFC12_ppt, colO3_strat, colO3_trop)
+ChunckJob2D = 100Y 
+TimeSeriesVars3D = (upwd, lwcon, iwcon, lcc3dcon, lcc3dstra, temp, theta, ovap, ovapinit, geop, vitu, vitv, vitw, pres, rneb, rnebcon, rhum, mc, paprs, scdnc, ec550aer, concoa, concbc, concso4, concss, concdust, reffclws, reffclwc, tnt, dtdyn, dtphy, dtlschr, tntr, tntscpbl, tnhus, dqdyn, dqvdf, tnhusscpbl, dqphy, evu, mcd)
+ChunckJob3D = 100Y
+Seasonal=ON
+
+[Post_1M_histmthCOSP]
+Patches = ()
+GatherWithInternal = (lon, lat, pressure2, height, sza, time_counter, time_centered, time_centered_bounds, aire)
+TimeSeriesVars2D = (cllcalipso, clmcalipso, clhcalipso, cltcalipso, tclisccp, albisccp, ctpisccp)
+ChunckJob2D = OFF
+TimeSeriesVars3D = (clcalipso, clisccp2_c01, clisccp2_c02, clisccp2_c03, clisccp2_c04, clisccp2_c05, clisccp2_c06, clisccp2_c07, parasol_refl)
+ChunckJob3D = OFF
+Seasonal=OFF
+
+[Post_1M_histmthNMC]
+Patches = ()
+GatherWithInternal = (lon, lat, plev, time_counter, time_centered, time_centered_bounds)
+TimeSeriesVars2D = ()
+ChunckJob2D = NONE
+TimeSeriesVars3D = (ta, tro3, zg, hus, hur, ua, va, wap)
+ChunckJob3D = NONE
+Seasonal=ON
+
+[Post_1D_histday]
+Patches= ()
+GatherWithInternal = (lon, lat, presnivs, time_counter, time_centered, time_centered_bounds)
+TimeSeriesVars2D = (bils, cldh, cldl, cldm, cldq, cldt, evap, flat, precip, pluc, plul, prw, psol, q2m, sens, sicf, slp, soll, sols, snow, SWdnSFC, t2m, t2m_max, t2m_min, topl, tops, tsol, u10m, v10m, wind10m, wind10max)
+ChunckJob2D = 50Y
+TimeSeriesVars3D = (lwcon, iwcon, mc, rhum, rneb, temp, theta, ovap, geop, vitu, vitv, vitw, pres, paprs)
+ChunckJob3D = OFF
+Seasonal=OFF
+
+[Post_1D_histdayCOSP]
+Patches = ()
+GatherWithInternal = (lon, lat, pressure2, height, sza, time_counter, time_centered, time_centered_bounds)
+TimeSeriesVars2D = (cllcalipso, clmcalipso, clhcalipso, cltcalipso, tclisccp, albisccp, ctpisccp)
+ChunckJob2D = OFF
+TimeSeriesVars3D = (clcalipso, clisccp2_c01, clisccp2_c02, clisccp2_c03, clisccp2_c04, clisccp2_c05, clisccp2_c06, clisccp2_c07, parasol_refl)
+ChunckJob3D = OFF
+Seasonal=OFF
+
+[Post_1D_histdayNMC]
+Patches = ()
+GatherWithInternal = (lon, lat, plev, time_counter, time_centered, time_centered_bounds)
+TimeSeriesVars2D = ()
+ChunckJob2D = NONE
+TimeSeriesVars3D = (ta, zg, hus, hur, ua, va, wap)
+ChunckJob3D = 10Y
+Seasonal=OFF
+
+[Post_HF_histhf]
+Patches= ()
+GatherWithInternal = (lon, lat, presnivs, time_counter, time_centered, time_centered_bounds)
+TimeSeriesVars2D = (cldt, psol, q2m, slp, precip, pluc, plul, t2m, tsol, u10m, v10m)
+ChunckJob2D = 50Y
+TimeSeriesVars3D = (temp, theta, ovap, vitu, vitv)
+ChunckJob3D = OFF
+Seasonal=OFF
+
+[Post_HF_histhfCOSP]
+Patches = ()
+GatherWithInternal = (lon, lat, height, sza, time_counter, time_centered, time_centered_bounds)
+TimeSeriesVars2D = (cllcalipso, clmcalipso, clhcalipso, cltcalipso)
+ChunckJob2D = OFF
+TimeSeriesVars3D = (clcalipso, parasol_refl, cfad_lidarsr532_c01, cfad_lidarsr532_c02, cfad_lidarsr532_c03, cfad_lidarsr532_c04, cfad_lidarsr532_c05, cfad_lidarsr532_c06, cfad_lidarsr532_c07, cfad_lidarsr532_c08, cfad_lidarsr532_c09, cfad_lidarsr532_c10, cfad_lidarsr532_c11, cfad_lidarsr532_c12, cfad_lidarsr532_c13, cfad_lidarsr532_c14, cfad_lidarsr532_c15)
+ChunckJob3D = OFF
+Seasonal=OFF
+
+[Post_HF_histhfNMC]
+Patches = ()
+GatherWithInternal = (lon, lat, plev, time_counter, time_centered, time_centered_bounds)
+TimeSeriesVars2D = ()
+ChunckJob2D = NONE
+TimeSeriesVars3D = (ta, zg, hus, hur, ua, va, wap)
+ChunckJob3D = 10Y
+Seasonal=OFF
+
+[Post_3H_histhf3hm]
+Patches= ()
+GatherWithInternal = (lon, lat, presnivs, time_counter, time_centered, time_centered_bounds)
+TimeSeriesVars2D = (flat, precip, pluc, snow, topl, topl0, SWupTOA, SWupTOAclr, SWdnTOA, SWupSFC, SWupSFCclr, SWdnSFC, SWdnSFCclr, LWupSFC, LWupSFCclr, LWdnSFC, LWdnSFCclr, bils, bils_tke, bils_diss, bils_ec, bils_kinetic, bils_enthalp, bils_latent, sens, cldt, zmax_th)
+ChunckJob2D = OFF
+TimeSeriesVars3D = ()
+ChunckJob3D = OFF
+Seasonal=OFF
+
+[Post_3H_histhf3h]
+Patches= ()
+GatherWithInternal = (lon, lat, presnivs, time_counter, time_centered, time_centered_bounds)
+TimeSeriesVars2D = (phis, tsol, t2m, q2m, ustar, u10m, v10m, psol)
+ChunckJob2D = OFF
+TimeSeriesVars3D = ()
+ChunckJob3D = OFF
+Seasonal=OFF
Index: CONFIG/UNIFORM/v7/IPSLCM7ISO/EXPERIMENTS/LMDZISO/amip/COMP/xios.card
===================================================================
--- CONFIG/UNIFORM/v7/IPSLCM7ISO/EXPERIMENTS/LMDZISO/amip/COMP/xios.card	(revision 6746)
+++ CONFIG/UNIFORM/v7/IPSLCM7ISO/EXPERIMENTS/LMDZISO/amip/COMP/xios.card	(revision 6746)
@@ -0,0 +1,29 @@
+[Compatibility]
+libIGCM=1.0
+
+[UserChoices]
+
+[InitialStateFiles]
+List=	()
+
+[BoundaryFiles]
+List=	()
+ListNonDel= ()
+
+[SmoothFiles]
+List=	()
+
+[ParametersFiles]
+List=  (${SUBMIT_DIR}/PARAM/XIOS/iodef.xml, . )
+
+[RestartFiles]
+List=  (NONE)
+
+[OutputText]
+List=  (xios_client_*,out_xios.x.err, out_xios.x.out) 
+
+[OutputFiles]
+List=   ()
+
+
+
Index: CONFIG/UNIFORM/v7/IPSLCM7ISO/EXPERIMENTS/LMDZISO/amip/config.card
===================================================================
--- CONFIG/UNIFORM/v7/IPSLCM7ISO/EXPERIMENTS/LMDZISO/amip/config.card	(revision 6746)
+++ CONFIG/UNIFORM/v7/IPSLCM7ISO/EXPERIMENTS/LMDZISO/amip/config.card	(revision 6746)
@@ -0,0 +1,118 @@
+# $Id$
+#========================================================================
+#D-- Compatibility -
+[Compatibility]
+libIGCM=1.0
+#D-- UserChoices -
+[UserChoices]
+#============================
+JobName=LMDZISO01
+#----- Short Name of Experiment
+ExperimentName=amip
+#----- TEST DEVT PROD
+SpaceName=TEST
+LongName="LMDZISO configuration"
+TagName=LMDZISO
+#D- Choice of experiment in EXPERIEMENTS directory
+ExpType=LMDZISO/amip
+#============================
+#-- leap, noleap, 360d
+CalendarType=leap
+#-- Begin and end of job 
+#-- "YYYY-MM-DD"
+DateBegin=2015-01-01
+DateEnd=2016-12-31
+#============================
+#-- 1Y, 1M, 5D, 1D Period Length for one execution
+PeriodLength=1Y
+#============================
+#-- Compression level for netcdf output files
+CompressionLevel=2
+#============================
+#-- Source following file with module settings, only if it exists
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
+#============================
+#-- ResolAtm indicates the atmospheric resolution
+#   This variable is used in the executable name 
+ResolAtm=144x142x79
+#============================
+# OptMode indicates the optimization mode choosen during compilation
+# This variable is used in the executable name
+OptMode=prod
+
+#========================================================================
+#D-- ListOfComponents -
+[ListOfComponents]
+#D- For each component, Name of component, Tag of component
+ATM= (lmdz, LMDZ)
+IOS= (xios, XIOS)
+
+#========================================================================
+#D-- Executable -
+[Executable]
+#D- For each component: First argument is the executable name as in bin folder.
+#D  ResolAtm and OptMode are set in UserChoices section.
+#D- Here is set 71MPI*8OMP which is suitable for resolution 144x142x79
+#D- Change to 31MPI*4OMP for resolution 96x95x39
+ATM= (gcm_${ResolAtm}_iso_${OptMode}.e, lmdz.x, 71MPI, 8OMP)
+IOS= (xios_server_${OptMode}.exe, xios.x, 1MPI)
+
+#========================================================================
+#D-- Restarts -
+[Restarts]
+#D- by default: config.card describes no restart for all components 
+#D-             ie start from Levitus or limit files
+#D- If you want to restart all components from the same simulation,
+#D-      put OveRule flag to 'y' and set the next 3 parameters
+OverRule=n
+#D- Last day of the experience used as restart for all components
+RestartDate=2319-12-31
+#D- Define restart simulation name for all components
+RestartJobName=CM607-LR-pdCtrl-01
+#D- Path Server Group Login
+RestartPath=${R_IN}/RESTART/IPSLCM6/DEVT/pdControl
+
+#========================================================================
+#D-- ATM -
+[ATM]
+# If config_Restarts_OverRule == 'n' next 4 params are read
+Restart= n
+# Last day of the experience used as restart for this component if Restart=y
+RestartDate=2319-12-31
+#D- Define restart simulation name for this component
+RestartJobName=CM607-LR-pdCtrl-01
+#D- Path Server Group Login
+RestartPath=${R_IN}/RESTART/IPSLCM6/DEVT/pdControl
+
+#========================================================================
+#D-- IOS -
+[IOS]
+# If config_Restarts_OverRule == 'n' next 4 params are read
+Restart= n
+##-- Last day of the experience used as restart for this component if Restart=y
+RestartDate=
+# Define restart simulation name for this component
+RestartJobName=
+RestartPath=
+
+#========================================================================
+#D-- Post -
+[Post]
+#D- Activate Cesmep Atlas Comparison
+Cesmep=FALSE
+#D- PackFrequency determines the frequency of pack submission
+PackFrequency=1Y
+#D- TimeSeriesFreqency determines the frequency of post-processing submission
+#D- Set NONE to deactivate the creation of all time series 
+TimeSeriesFrequency=NONE
+#D- SeasonalFrequency determines the length for each seasonal average
+#D- Set NONE to deactivate the creation of all seasonal avereage
+SeasonalFrequency=NONE
+#D- Offset for seasonal average first start dates ; same unit as SeasonalFrequency
+#D- Usefull if you do not want to consider the first X simulation's years
+SeasonalFrequencyOffset=0
+#D- If you want to produce compute PCMDI metrics from seasonal average
+#D- Set TRUE or FALSE to activate/deactivate the metrics computation.
+MetricsPCMDI=FALSE
+
+#========================================================================
Index: CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/config.def_actuel_iso
===================================================================
--- CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/config.def_actuel_iso	(revision 6746)
+++ CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/config.def_actuel_iso	(revision 6746)
@@ -0,0 +1,101 @@
+## level_coupling_esm : 0(pas d'echange de carbone), 2 (change entre LMDZ/CPL/NEMO et LMDZ/ORCHIDEE)
+level_coupling_esm=  _AUTO_: DEFAULT = 0
+## carbon_cycle_cpl: couplage des flux de carbone ATM/OCE, ATM/SRF
+carbon_cycle_cpl=_AUTO_ : DEFAULT=n
+## carbon_cycle_tr: transport atmospherique de CO2 dans LMDZ
+carbon_cycle_tr=_AUTO_ : DEFAULT=n
+## carbon_cycle_rad: utilisation de traceur CO2 dans le code radiatif
+carbon_cycle_rad=_AUTO_ : DEFAULT=n
+
+## read_fco2_ocean_cor : y/n flag d'activation de la correction du flux net de carbone (ocean) 
+read_fco2_ocean_cor=_AUTO_ : DEFAULT=n
+## var_fco2_ocean_cor : valeur de la correction du flux net de carbone (ocean) 
+var_fco2_ocean_cor=_AUTO_: DEFAULT = 0.2576
+## read_fco2_land_cor : y/n flag d'activation de la correction du flux net de carbone (land) 
+read_fco2_land_cor=_AUTO_ : DEFAULT=n
+## var_fco2_land_cor : valeur de la correction du flux net de carbone (land) 
+var_fco2_land_cor=_AUTO_: DEFAULT =-0.2036
+
+##  Cycle diurne  ou non                 
+iflag_cycle_diurne=1
+
+## Soil Model ou non
+soil_model=y
+
+## Pas de temps de couplage (s)
+t_coupl=_AUTO_
+
+## Nombre  d'appels des routines de rayonnements ( par jour)                 
+nbapp_rad=16
+
+##  Facteur additif pour l'albedo
+pmagic =  _AUTO_: DEFAULT = 0.0
+
+#
+# Parametres "orbitaux/ ere geologique"
+#
+### R_ecc =      Excentricite (lue dans Eccentricity.txt)
+R_ecc = _AUTO_: DEFAULT = 0.016715
+### R_peri =     Equinoxe (lue dans Perihelie.txt)
+R_peri = _AUTO_: DEFAULT = 102.7
+### R_incl =     Inclinaison (lue dans Obliquity.txt)
+R_incl = _AUTO_: DEFAULT = 23.441
+### solaire =    Constante solaire
+#solaire = _AUTO_ : DEFAULT = 1366.0896
+solaire = _AUTO_ : DEFAULT = 1361.20 
+# solaire est modifie avec les valeurs du fichier SOLARANDVOLCANOES.txt
+### constante solaire lue dans un fichier par defaut
+ok_suntime_rrtm=n
+#
+# Taux gaz a effet de serre
+#
+### co2_ppm =    taux CO2 en ppm, l'annÃ©e 2000 forcage CMIP6
+co2_ppm = _AUTO_: DEFAULT = 0.36886500E+03
+# co2_ppm0 = taux initial du CO2 en ppm, l'annÃ©e 1850 forcage CMIP6 (transport)
+co2_ppm0 = _AUTO_: DEFAULT  = 2.8432e+02
+### co2_ppm_per =    taux 4xCO2 en ppm (uniqument pour calcul des diags)
+co2_ppm_per = _AUTO_: DEFAULT = 14.7648e+02
+### CH4_ppb =    taux CH4 en ppb, l'annÃ©e 2000 forcage CMIP6
+CH4_ppb = _AUTO_ : DEFAULT = 0.17510225E+04
+### N2O_ppb =    taux N2O en ppb, l'annÃ©e 2000 forcage CMIP6
+N2O_ppb = _AUTO_ : DEFAULT = 0.31585000E+03
+### CFC11_ppt = taux en ppt, l'annÃ©e 2000 forcage CFC11eq_CMIP6
+CFC11_ppt = _AUTO_ : DEFAULT = 6.3990e+01
+### CFC12_ppt =  taux en ppt, l'annÃ©e 2000 forcage CFC12eq_CMIP6
+CFC12_ppt = _AUTO_ : DEFAULT = 1.0511e+03
+#
+# Parametres effets directs/indirects des "aerosols"
+#
+### ok_ade=y/n   flag Aerosol direct effect
+ok_ade=_AUTO_
+### ok_aie=y/n   flag Aerosol indirect effect
+ok_aie=_AUTO_
+### aer_type =   Aerosol variation type : actuel / preind / scenario / annuel
+aer_type=actuel
+### aerosol coupling = online (y) or offline (n)
+aerosol_couple=_AUTO_
+### Ozone chemistry coupling = online (y) or offline (n)
+chemistry_couple=_AUTO_
+###  flag_aerosol = type of coupled aerosol, if aerosol offline 
+###  0 => no aerosol, 1 => sulfate only, 2 => bc only, 3 => pom only, 4 => seasalt only, 5 => dust only, 6 => all aerosol
+flag_aerosol=_AUTO_
+### ok_cdnc=y/n   Cloud droplet number concentration
+ok_cdnc=_AUTO_
+# ok_alw=y flag pour activer l effet LW des poussieres
+ok_alw=y
+#
+# Parametre de lecture de l'ozone
+#
+# Allowed values are 0, 1 and 2
+# 0: do not read an ozone climatology
+# 1: read a single ozone climatology that will be used day and night
+# 2: read two ozone climatologies, the average day and night climatology and the daylight climatology
+read_climoz=_AUTO_
+#
+# Aerosols stratospheriques utilises par defaut 
+flag_aerosol_strat=_AUTO_ : DEFAULT=2
+# Diag VolMIP to get volcanic aerosols effects instead of tropospheric ones
+ok_volcan=n
+#
+# COSP
+ok_cosp=_AUTO_
Index: CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/config.def_iso
===================================================================
--- CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/config.def_iso	(revision 6746)
+++ CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/config.def_iso	(revision 6746)
@@ -0,0 +1,226 @@
+##############################################################################
+# PARAMETRES ET CLES DE CONFIGURATION LMDZ
+##############################################################################
+# D: Valeur par default
+#
+# Controle des sorties
+#*********************
+OK_journe=y
+OK_mensuel=y
+ok_hf=n
+OK_instan=n
+#ok_regdyn : y/n calcul/non des regymes dynamiques sur regions pre-definies
+ok_regdyn=n
+# - ok_histNMC = y/n, y/n, y/n pour avoir les sorties NMC mensuelles, journalieres et haute frequence
+ok_histNMC = n, n, n
+#lev_histdayNMC: nombre de niveaux sur la verticale dans le fichier
+#                histdayNMC: 8 ou 17
+lev_histdayNMC=17
+# A transformer en la ligne ci-dessous quand ce sera compatible avec libIGCM
+phys_out_regfkey=        n       n       n       n        n       n
+phys_out_filekeys=       y       y       n       n        n       n
+phys_out_filenames=      histmth histday histhf  histhf2h histLES histstn
+phys_out_filelevels=     10      10      0       0        0       0
+phys_out_filetypes=      ave(X)  ave(X)  ave(X) ave(X) ave(X) inst(X)
+phys_out_filetimesteps=  30day   1day    6hr    2hr    6hr    6hr
+
+flag_flat = 1, 1, 0, 0, 0
+#
+#Couplage avec autres modules
+#******************************
+#option de couplage pour ocean (D:force)
+type_ocean=force
+version_ocean=nemo
+#avec ou sans orchidee (D:n)
+VEGET=n
+#type_run=AMIP, ENSP, clim (D:AMIP)
+type_run=CLIM
+##  Soil Model  ou non               
+soil_model=y
+
+#Code de transfert radiatif
+#**************************
+# ajout de ce flag pour activer/desactiver le rayonnement (MPL)
+# 0 : pas de rayonnement. 1: on active le rayonnement (D=1)
+iflag_radia=1
+## Nombre appels des routines de rayonnements ( par jour)                 
+nbapp_rad=16
+
+# Parametres "orbitaux/ ere geologique"
+#######################################
+#Parametres orbitaux
+#excentricite
+### R_ecc =      Excentricite
+R_ecc = 0.016715
+### R_peri =     Equinoxe
+R_peri = 102.7
+### R_incl =     Inclinaison
+R_incl = 23.441
+### solaire =    Constante solaire
+solaire = 1361.20
+### constante solaire lue dans un fichier par defaut
+ok_suntime_rrtm=n
+
+
+
+
+
+##  Facteur additif pour l albedo
+pmagic=0.008
+#
+# Taux gaz a effet de serre
+#######################################
+#concentration des gaz (co2 ch4   n2o  cfc11 cfc12)
+#                  (D: 348. 1650. 306.  280.  484.)
+### co2_ppm =    taux CO2 en ppm
+co2_ppm = 0.36886500E+03
+### CH4_ppb =    taux CH4 en ppb
+CH4_ppb = 0.17510225E+04
+### N2O_ppb =    taux N2O en ppb
+N2O_ppb = 0.31585000E+03
+### CFC11_ppt =  taux CFC11eq CMIP6 en ppt
+CFC11_ppt = 6.3990e+01
+### CFC12_ppt =  taux CFC12eq CMIP6  en ppt
+CFC12_ppt = 1.0511e+03
+
+#
+# Parametres effets directs/indirects des "aerosols"
+#######################################
+### ok_alw 	flag for aerosol LW effect
+ok_alw=y
+ok_cdnc=y
+### ok_ade=y/n   flag Aerosol direct effect
+ok_ade=y
+### ok_aie=y/n   flag Aerosol indirect effect
+ok_aie=y
+### aer_type =   Aerosol variation type : actuel / preind / scenario / annuel
+aer_type=actuel
+###  type of coupled aerosol =1 (default) =2 => bc  only =3 => pom only =4 => seasalt only =5 => dust only =6 => all aerosol
+flag_aerosol=6
+flag_aerosol_strat=0
+#
+# Parametre de lecture de l'ozone
+#######################################
+# Allowed values are 0, 1 and 2
+# 0: do not read an ozone climatology
+# 1: read a single ozone climatology that will be used day and night
+# 2: read two ozone climatologies, the average day and night climatology and the daylight climatology
+read_climoz=0
+#
+# Parametres simulateur COSP (CFMIP Observational Simulator Package)
+#######################################
+### ok_cosp=n
+ok_cosp=n
+### freq_COSP = frequence d'appel de COSP en secondes
+freq_COSP=10800.
+cles_dbze94=n n n
+### ok_mensuelCOSP=y/n sortir fichier mensuel COSP histmthCOSP.nc, =n pas de fichier histmthCOSP.nc
+ok_mensuelCOSP=y
+### ok_journeCOSP=y/n sortir fichier journalier histdayCOSP.nc, =n pas de fichier histdayCOSP.nc
+ok_journeCOSP=n
+### ok_hfCOSP=y/n, ecrire sorties  haute frequence histhfCOSP.nc, =n pas de fichier histhfCOSP.nc
+ok_hfCOSP=n
+#
+# Parametres simulateur ISCCP
+#######################################
+### ok_isccp=y/n flag simulateur ISCCP
+ok_isccp=n
+### top_height = flag choix calcul nuages par le simulateur en utilisant 
+# -              les donnees IR et/ou VIS et l algorithme ISCCP-D1
+# - top_height = 1 -> algo IR-VIS
+# - top_height = 2 -> identique a 1, mais "ptop(ibox)=pfull(ilev)"
+# - top_height = 3 -> algo IR
+top_height = 1
+### overlap =    Hypothese de Recouvrement (HR) utilisee pour le simulateur ISCCP
+# - overlap=1    Max overlap
+# - overlap=2    Random overlap
+# - overlap=3    Max/Random overlap
+overlap = 3
+#
+
+# Specifique aquaplanete
+########################
+
+#qsol0=100.
+flag_bils=-1 -1 12 13 14
+flag_cldh=-1 -1 12 13 14
+flag_cldl=-1 -1 12 13 14
+flag_cldm=-1 -1 12 13 14
+flag_cldq=10 -1 12 13 14
+flag_cldt=-1 -1 12 13 14
+flag_evap=10 -1 12 13 14
+flag_flat=-1 -1 12 13 14
+flag_geop=-1 11 12 13 14
+flag_LWdnSFC=-1 11 12 13 14
+flag_LWdnSFCclr=-1 11 12 13 14
+flag_LWupSFC=-1 11 12 13 14
+flag_max=10 -1 12 13 14
+flag_min=10 -1 12 13 14
+flag_ovap=-1 11 12 13 14
+flag_phis=-1 11 12 13 14
+flag_pluc=10 -1 -1 13 14
+flag_plul=10 -1 -1 13 14
+flag_pourc_lic=-1 11 12 13 14
+flag_pourc_oce=-1 11 12 13 14
+flag_pourc_sic=-1 11 12 13 14
+flag_pourc_ter=-1 11 12 13 14
+flag_precip=-1 -1 12 13 14
+flag_pr_lsc_i=-1 11 12 13 14
+flag_pr_lsc_l=-1 11 12 13 14
+flag_prw=-1 -1 12 13 14
+flag_psol=10 -1 12 13 14
+flag_q2m=-1 -1 12 13 14
+flag_q700=10 -1 12 13 14
+flag_rh2m=-1 11 12 13 14
+flag_rhum=-1 11 12 13 14
+flag_sens=-1 -1 12 13 14
+flag_sicf=10 -1 12 13 14
+flag_slp=-1 -1 12 13 14
+flag_snow=-1 11 12 13 14
+flag_soll=-1 -1 12 13 14
+flag_soll0=-1 -1 12 13 14
+flag_sols=-1 -1 12 13 14
+flag_sols0=-1 -1 12 13 14
+flag_SWdnSFC=-1 -1 12 13 14
+flag_SWdnSFCclr=-1 -1 12 13 14
+flag_SWdnTOA=-1 11 12 13 14
+flag_SWupSFC=-1 11 12 13 14
+flag_SWupSFCclr=-1 11 12 13 14
+flag_SWupTOA=-1 11 12 13 14
+flag_SWupTOAclr=-1 11 12 13 14
+flag_t2m=-1 -1 -1 13 14
+flag_t700=10 -1 12 13 14
+flag_taux_oce=-1 11 12 13 14
+flag_tauy_oce=-1 11 12 13 14
+flag_temp=-1 11 12 13 14
+flag_topl=-1 -1 -1 13 14
+flag_topl0=-1 -1 -1 13 14
+flag_tops=-1 -1 12 13 14
+flag_tops0=-1 -1 12 13 14
+flag_tsol=-1 -1 12 13 14
+flag_tsol_oce=-1 -1 12 13 14
+flag_u10m=10 -1 12 13 14
+flag_u700=10 -1 12 13 14
+flag_u850=10 -1 12 13 14
+flag_v10m=10 -1 12 13 14
+flag_v700=10 -1 12 13 14
+flag_vitu=-1 11 12 13 14
+flag_vitv=-1 11 12 13 14
+flag_vitw=-1 11 12 13 14
+flag_w500=-1 11 12 13 14
+flag_w700=10 -1 12 13 14
+flag_wind10m=-1 11 12 13 14
+flag_wind10max=-1 11 12 13 14
+flag_z500=-1 11 12 13 14
+flag_wake_dens=-1 -1 12 13 14
+flag_wake_deltat=-1 -1 12 13 14
+flag_wake_deltaq=-1 -1 12 13 14
+flag_cv_gen=-1 -1 12 13 14
+flag_ale_bl_stat=-1 -1 12 13 14
+flag_ale_wk=-1 -1 12 13 14
+flag_ale=-1 -1 12 13 14
+flag_alp_bl=-1 -1 12 13 14
+flag_alp_wk=-1 -1 12 13 14
+flag_alp=-1 -1 12 13 14
+### XIOS outputs
+ok_all_xml=n
Index: CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/field_def_lmdz_iso.xml
===================================================================
--- CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/field_def_lmdz_iso.xml	(revision 6746)
+++ CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/field_def_lmdz_iso.xml	(revision 6746)
@@ -0,0 +1,1158 @@
+<!-- $Id: field_def_lmdz.xml 4756 2023-11-30 14:54:13Z lebasn $ -->
+<field_definition level="1" prec="4" operation="average" freq_op="1ts" enabled=".true." default_value="9.96921e+36">
+    
+<!--    <field_group id="fields_1D" grid_ref="vertical">  -->
+<!--        <field id="Ap"   long_name="Hybrid coordinate: pressure part"    unit="Pa" />  -->
+<!--        <field id="Bp"   long_name="Hybrid coordinate: sigma part"    unit="-" />  -->
+<!--        <field id="Alt"  long_name="Pseudo-altitude (for an 8km scale height)"    unit="km" />  -->
+<!--    </field_group>  -->
+
+    <field_group id="remap_expr" level="_reset_" prec="_reset_" operation="_reset_" freq_op="_reset_" enabled="_reset_" default_value="_reset_">
+      <field_group id="remap_1ts" />
+      <field_group id="remap_1800s" />
+      <field_group id="remap_1h" />
+      <field_group id="remap_3h" />
+      <field_group id="remap_6h" />
+      <field_group id="remap_1d" />
+      <field_group id="remap_1mo" />
+    </field_group>
+    
+    <field_group id="coordinates" grid_ref="grid_glo">
+        <field id="io_lon"  />
+        <field id="io_lat"  />
+    </field_group>
+
+    <field_group id="coord_hyb">
+        <field id="Ahyb" long_name="Ahyb at level interface"     axis_ref="klevp1" />
+        <field id="Ahyb_bounds" long_name="" grid_ref="klevp1_bnds" />
+        <field id="Bhyb" long_name="Bhyb at level interface"       axis_ref="klevp1"  />
+        <field id="Bhyb_bounds" long_name=""  grid_ref="klevp1_bnds" />
+        <field id="Ahyb_mid" long_name="Ahyb at the middle of the level"      axis_ref="klev" />
+        <field id="Ahyb_mid_bounds" long_name="" grid_ref="klev_bnds" />
+        <field id="Bhyb_mid" long_name="Bhyb at the middle of the level"       axis_ref="klev"  />
+        <field id="Bhyb_mid_bounds" long_name=""  grid_ref="klev_bnds" />
+    </field_group>
+    
+    <field_group id="fields_2D" grid_ref="grid_glo">
+        <field id="phis"    long_name="Surface geop.height"     unit="m2/s2" />
+        <field id="aire"    long_name="Grid area"               unit="m2"    />
+        <field id="contfracATM"     long_name="% sfce ter+lic"  unit="-"   /> 
+        <field id="contfracOR"      long_name="% sfce terre OR" unit="-" />
+        <field id="sza"     long_name="Solar zenithal angle "   unit="deg" />
+        <field id="flat"    long_name="Latent heat flux"        unit="W/m2" />
+        <field id="slp"     long_name="Sea Level Pressure"      unit="Pa" />
+        <field id="ptstar"  long_name="Air Surface Temperature" unit="K" />
+        <field id="pt0"     long_name="Standard Air Surface Temperature"      unit="K" />
+        <field id="tsol"    long_name="Surface Temperature"     unit="K" />
+        <field id="t2m"        long_name="Temperature 2m" unit="K" />
+        <field id="tasmax"  field_ref="t2m"  operation="maximum" />
+        <field id="tasmin"  field_ref="t2m"  operation="minimum" />
+        <field id="t2m_min"    long_name="Temp 2m min"    unit="K" operation="minimum" />
+        <field id="t2m_max"    long_name="Temp 2m max"    unit="K" operation="maximum" />
+        <field id="t2m_ter"    long_name="Temp 2m ter"    unit="K" />
+        <field id="t2m_max_mon"   long_name="Monthly average max 2m temperature" unit="K" />
+        <field id="t2m_min_mon"   long_name="Monthly average min 2m temperature" unit="K" />
+        <field id="t2m_lic"    long_name="Temp 2m lic"    unit="K" />
+        <field id="t2m_oce"    long_name="Temp 2m oce"    unit="K" />
+        <field id="t2m_sic"    long_name="Temp 2m sic"    unit="K" />
+        <field id="nt2mout"    long_name="nt2m hors intervalle, calc.complet" unit="-" />
+        <field id="nq2mout"    long_name="nq2m hors intervalle, calc. complet" unit="-" />
+        <field id="nu2mout"    long_name="nu2m hors intervalle, calc. complet" unit="-" />
+        <field id="nt2moutfg"  long_name="nt2m hors intervalle, calc. complet/fg" unit="-" />
+        <field id="nq2moutfg"  long_name="nq2m hors intervalle, calc. complet/fg" unit="-" />
+        <field id="nu2moutfg"  long_name="nu2m hors intervalle, calc. complet/fg" unit="-" />
+        <field id="t2m_probsup25"   field_ref="t2m" long_name="Prob. t2m exceeds 25 degC" unit="-"> t2m &gt; 298.15 </field>
+        <field id="t2m_probsup28"   field_ref="t2m" long_name="Prob. t2m exceeds 28 degC" unit="-"> t2m &gt; 301.15 </field>
+        <field id="t2m_probsup30"   field_ref="t2m" long_name="Prob. t2m exceeds 30 degC" unit="-"> t2m &gt; 303.15 </field>
+        <field id="gusts"    long_name="surface gustiness"    unit="m2/s2" />
+        <field id="wind10m"    long_name="10-m wind speed"      unit="m/s" />
+        <field id="wind10max"  long_name="10m wind speed max"   unit="m/s" operation="maximum"/>
+        <field id="wind100m"   long_name="100-m wind speed"      unit="m/s" />
+        <field id="woncfr"   long_name="Onshore Wind Capacity factor"      unit="kW/kW_installed" />
+        <field id="wofcfr"   long_name="Offshore Wind Capacity factor"     unit="kW/kW_installed" />
+        <field id="sfcWindmax" field_ref="wind10m" operation="maximum" />
+        <field id="sicf"    long_name="Sea-ice fraction"        unit="-" />
+        <field id="q2m"     long_name="Specific humidity 2m"    unit="kg/kg" />
+        <field id="ustar"   long_name="Friction velocity"       unit="m/s" />
+        <field id="u10m"    long_name="Vent zonal 10m"          unit="m/s" />
+        <field id="v10m"    long_name="Vent meridien 10m"       unit="m/s" />
+        <field id="psol"    long_name="Surface Pressure"        unit="Pa" />
+        <field id="qsurf"   long_name="Surface Air humidity"    unit="kg/kg" />
+        <field id="ustar_ter"    long_name="Friction velocity ter"    unit="m/s" />
+        <field id="ustar_lic"    long_name="Friction velocity lic"    unit="m/s" />
+        <field id="ustar_oce"    long_name="Friction velocity oce"    unit="m/s" />
+        <field id="ustar_sic"    long_name="Friction velocity sic"    unit="m/s" />
+        <field id="wstar_ter"    long_name="Friction velocity ter"    unit="m/s" />
+        <field id="wstar_lic"    long_name="Friction velocity lic"    unit="m/s" />
+        <field id="wstar_oce"    long_name="Friction velocity oce"    unit="m/s" />
+        <field id="wstar_sic"    long_name="Friction velocity sic"    unit="m/s" />
+        <field id="wstar"       long_name="w* convective velocity "    unit="m/s" />
+        <field id="u10m_ter"    long_name="Vent Zonal 10m ter"    unit="m/s" />
+        <field id="u10m_lic"    long_name="Vent Zonal 10m lic"    unit="m/s" />
+        <field id="u10m_oce"    long_name="Vent Zonal 10m oce"    unit="m/s" />
+        <field id="u10m_sic"    long_name="Vent Zonal 10m sic"    unit="m/s" />
+        <field id="v10m_ter"    long_name="Vent meredien 10m ter"    unit="m/s" />
+        <field id="v10m_lic"    long_name="Vent meredien 10m lic"    unit="m/s" />
+        <field id="v10m_oce"    long_name="Vent meredien 10m oce"    unit="m/s" />
+        <field id="v10m_sic"    long_name="Vent meredien 10m sic"    unit="m/s" />
+        <field id="qsol"        long_name="Soil watter content"         unit="mm" />
+        <field id="JrNt"        long_name="1 if Day 0 if Night"         unit="-" />
+        <field id="cldhjn"      long_name="High-level cloudiness Day"         unit="-" />
+        <field id="cldmjn"      long_name="Mid-level cloudiness Day"         unit="-" />
+        <field id="cldljn"      long_name="Low-level cloudiness Day"         unit="-" />
+        <field id="cldtjn"      long_name="Total cloudiness Day"         unit="-" />
+        <field id="rnebjn"      long_name="Cloud fraction in day"         unit="-" />
+        <field id="ndayrain"    long_name="Number of dayrain(liq+sol)"  unit="-" operation="instant"/>
+        <field id="precip"      long_name="Precip Totale liq+sol"       unit="kg/(s*m2)" />
+        <field id="prhmax"      field_ref="precip" operation="maximum"           />
+        <field id="rain_fall"   long_name="Precip Totale liq"   unit="kg/(s*m2)" />
+        <field id="rain_con"    long_name="Precip convective liq"   unit="kg/(s*m2)" />
+        <field id="plul"    long_name="Large-scale Precip."     unit="kg/(s*m2)" />
+        <field id="plun"    long_name="Numerical Precip."       unit="kg/(s*m2)" />
+        <field id="pluc"    long_name="Convective Precip."      unit="kg/(s*m2)" />
+        <field id="snow"    long_name="Snow fall"               unit="kg/(s*m2)" />
+	<field id="evap"    long_name="Evaporat"                unit="kg/(s*m2)" />
+        <field id="snowerosion"    long_name="blowing snow erosion"                unit="kg/(s*m2)" />
+	<field id="bsfall"    long_name="blowing snow precipitation"                unit="kg/(s*m2)" />
+	<field id="rhosnow_lic"    long_name="snow density lic"                unit="kg/m3" />
+        <field id="ustart_lic"    long_name="ustar threshold for snow erosion"                unit="m/s" />
+	<field id="evap_ter"    long_name="evaporation at surface ter"    unit="kg/(s*m2)" />
+        <field id="evap_lic"    long_name="evaporation at surface lic"    unit="kg/(s*m2)" />
+        <field id="evap_oce"    long_name="evaporation at surface oce"    unit="kg/(s*m2)" />
+        <field id="evap_sic"    long_name="evaporation at surface sic"    unit="kg/(s*m2)" />
+        <field id="msnow"    long_name="Surface snow amount"    unit="kg/m2" />
+        <field id="fsnow"    long_name="Surface snow area fraction"    unit="-" />
+        <field id="tops"    long_name="Solar rad. at TOA"    unit="W/m2" />
+        <field id="tops0"    long_name="CS Solar rad. at TOA"    unit="W/m2" />
+        <field id="topl"    long_name="IR rad. at TOA"    unit="W/m2" />
+        <field id="topl0"    long_name="IR rad. at TOA"    unit="W/m2" />
+        <field id="SWupTOA"    long_name="SWup at TOA"    unit="W/m2" />
+        <field id="SWupTOAclr"    long_name="SWup clear sky at TOA"    unit="W/m2" />
+        <field id="SWupTOAcleanclr"    long_name="SWup clean (no aerosol) clear sky at TOA"    unit="W/m2" />
+        <field id="SWdnTOA"    long_name="SWdn at TOA"    unit="W/m2" />
+        <field id="SWdnTOAclr"    long_name="SWdn clear sky at TOA"    unit="W/m2" />
+        <field id="nettop"    long_name="Net dn radiatif flux at TOA"    unit="W/m2" />
+        <field id="SWup200"    long_name="SWup at 200mb"    unit="W/m2" />
+        <field id="SWup200clr"    long_name="SWup clear sky at 200mb"    unit="W/m2" />
+        <field id="SWdn200"    long_name="SWdn at 200mb"    unit="W/m2" />
+        <field id="SWdn200clr"    long_name="SWdn clear sky at 200mb"    unit="W/m2" />
+        <field id="LWup200"    long_name="LWup at 200mb"    unit="W/m2" />
+        <field id="LWup200clr"    long_name="LWup clear sky at 200mb"    unit="W/m2" />
+        <field id="LWdn200"    long_name="LWdn at 200mb"    unit="W/m2" />
+        <field id="LWdn200clr"    long_name="LWdn clear sky at 200mb"    unit="W/m2" />
+        <field id="sols"    long_name="Solar rad. at surf."    unit="W/m2" />
+        <field id="sols0"    long_name="Solar rad. at surf."    unit="W/m2" />
+        <field id="soll"    long_name="IR rad. at surface"    unit="W/m2" />
+        <field id="soll0"    long_name="IR rad. at surface"    unit="W/m2" />
+        <field id="radsol"    long_name="Rayonnement au sol"    unit="W/m2" />
+        <field id="SWupSFC"    long_name="SWup at surface"    unit="W/m2" />
+        <field id="SWupSFCclr"    long_name="SWup clear sky at surface"    unit="W/m2" />
+        <field id="SWupSFCcleanclr"    long_name="SWup clean (no aerosol) clear sky at surface"    unit="W/m2" />
+        <field id="SWdnSFC"    long_name="SWdn at surface"    unit="W/m2" />
+        <field id="SWdnSFCclr"    long_name="SWdn clear sky at surface"    unit="W/m2" />
+        <field id="SWdnSFCcleanclr"    long_name="SWdn clean (no aerosol) clear sky at surface"    unit="W/m2" />
+        <field id="fdiffSWdnSFC"    long_name="Fraction of diffuse SWdn at surface"    unit="-" />
+        <field id="LWupSFC"    long_name="Upwd. IR rad. at surface"    unit="W/m2" />
+        <field id="LWupSFCclr"    long_name="CS Upwd. IR rad. at surface"    unit="W/m2" />
+        <field id="LWupTOAcleanclr"    long_name="CS clean (no aerosol) Upwd. IR rad. at TOA"    unit="W/m2" />
+        <field id="LWdnSFC"    long_name="Down. IR rad. at surface"    unit="W/m2" />
+        <field id="LWdnSFCclr"    long_name="Down. CS IR rad. at surface"    unit="W/m2" />
+        <field id="LWdnSFCcleanclr"    long_name="Down. CS clean (no aerosol) IR rad. at surface"    unit="W/m2" />
+        <field id="bils"    long_name="Surf. total heat flux"    unit="W/m2" />
+        <field id="bils_tke"    long_name="Surf. total heat flux"    unit="W/m2" />
+        <field id="bils_diss"    long_name="Surf. total heat flux"    unit="W/m2" />
+        <field id="bils_ec"    long_name="Surf. total heat flux"    unit="W/m2" />
+        <field id="bils_kinetic"    long_name="Surf. total heat flux"    unit="W/m2" />
+        <field id="bils_enthalp"    long_name="Surf. total heat flux"    unit="W/m2" />
+        <field id="bils_latent"    long_name="Surf. total heat flux"    unit="W/m2" />
+        <field id="bils_ech"    long_name="peu importe"    unit="W/m2" />
+        <field id="ustr_gwd_hines"    long_name="zonal wind stress Hines gravity waves"    unit="Pa" />
+        <field id="vstr_gwd_hines"    long_name="meridional wind stress Hines gravity waves"    unit="Pa" />
+        <field id="ustr_gwd_front"    long_name="zonal wind stress fronts gravity waves"    unit="Pa" />
+        <field id="vstr_gwd_front"    long_name="meridional wind stress fronts gravity waves"    unit="Pa" />
+        <field id="ustr_gwd_rando"    long_name="zonal wind stress random gravity waves"    unit="Pa" />
+        <field id="vstr_gwd_rando"    long_name="meridinal wind stress random gravity waves"    unit="Pa" />
+        <field id="sens"    long_name="Sensible heat flux"    unit="W/m2" />
+        <field id="sens_x"    long_name="sens off-wake"    unit="W/m2" />
+        <field id="sens_w"    long_name="sens within-wake"    unit="W/m2" />
+        <field id="flat_x"    long_name="flat off-wake"    unit="W/m2" />
+        <field id="flat_w"    long_name="flat within-wake"    unit="W/m2" />
+        <field id="delta_tsurf"    long_name="Temperature difference (w-x)"    unit="K" enabled="false" /> <!-- ym --field disabled-- delta_tsurf is not conform to the associated grid (the is an arry containing all sub_surface) --> 
+        <field id="cdragh_x"    long_name="cdragh off-wake"    unit="-" />
+        <field id="cdragh_w"    long_name="cdragh within-wake"    unit="-" />
+        <field id="cdragm_x"    long_name="cdragm off-wake"    unit="-" />
+        <field id="cdragm_w"    long_name="cdragm within-wake"    unit="-" />
+        <field id="kh"    long_name="Kh"    unit="kg/s/m2" />
+        <field id="kh_x"    long_name="cdragm off-wake"    unit="kg/s/m2" />
+        <field id="kh_w"    long_name="cdragm within-wake"    unit="kg/s/m2" />
+        <field id="fder"    long_name="Heat flux derivation"    unit="W/m2" />
+        <field id="ffonte"    long_name="Thermal flux for snow melting"    unit="W/m2" />
+        <field id="fqcalving"    long_name="Ice Calving"    unit="kg/m2/s" />
+        <field id="fqfonte"    long_name="Land ice melt"    unit="kg/m2/s" />
+        <field id="runofflic"  long_name="Land ice melt to ocean" unit="kg/m2/s" />
+        <field id="mrroli"  long_name="Runoff flux over land ice" unit="kg/m2/s" />
+        <field id="taux"    long_name="Zonal wind stress"    unit="Pa" />
+        <field id="tauy"    long_name="Meridional wind stress"    unit="Pa" />
+        <field id="taux_ter"    long_name="Zonal wind stress ter"    unit="Pa" />
+        <field id="taux_lic"    long_name="Zonal wind stress lic"    unit="Pa" />
+        <field id="taux_oce"    long_name="Zonal wind stress oce"    unit="Pa" />
+        <field id="taux_sic"    long_name="Zonal wind stress sic"    unit="Pa" />
+        <field id="tauy_ter"    long_name="Meridional wind stress ter"    unit="Pa" />
+        <field id="tauy_lic"    long_name="Meridional wind stress lic"    unit="Pa" />
+        <field id="tauy_oce"    long_name="Meridional wind stress oce"    unit="Pa" />
+        <field id="tauy_sic"    long_name="Meridional wind stress sic"    unit="Pa" />
+        <field id="pourc_ter"    long_name="% ter"    unit="%" />
+        <field id="pourc_lic"    long_name="% lic"    unit="%" />
+        <field id="pourc_oce"    long_name="% oce"    unit="%" />
+        <field id="pourc_sic"    long_name="% sic"    unit="%" />
+        <field id="fract_ter"    long_name="Fraction ter"    unit="1" />
+        <field id="fract_lic"    long_name="Fraction lic"    unit="1" />
+        <field id="fract_oce"    long_name="Fraction oce"    unit="1" />
+        <field id="fract_sic"    long_name="Fraction sic"    unit="1" />
+        <field id="tsol_ter"    long_name="Temperature ter"    unit="K" />
+        <field id="tsol_lic"    long_name="Temperature lic"    unit="K" />
+        <field id="tsol_oce"    long_name="Temperature oce"    unit="K" />
+        <field id="tsol_sic"    long_name="Temperature sic"    unit="K" />
+        <field id="evappot_ter"    long_name="Potential evaporation ter"    unit="kg/(m2*s)" />
+        <field id="evappot_lic"    long_name="Potential evaporation lic"    unit="kg/(m2*s)" />
+        <field id="evappot_oce"    long_name="Potential evaporation oce"    unit="kg/(m2*s)" />
+        <field id="evappot_sic"    long_name="Potential evaporation sic"    unit="kg/(m2*s)" />
+        <field id="sens_ter"    long_name="Sensible heat flux ter"    unit="W/m2" />
+        <field id="sens_lic"    long_name="Sensible heat flux lic"    unit="W/m2" />
+        <field id="sens_oce"    long_name="Sensible heat flux oce"    unit="W/m2" />
+        <field id="sens_sic"    long_name="Sensible heat flux sic"    unit="W/m2" />
+        <field id="lat_ter"    long_name="Latent heat flux ter"    unit="W/m2" />
+        <field id="lat_lic"    long_name="Latent heat flux lic"    unit="W/m2" />
+        <field id="lat_oce"    long_name="Latent heat flux oce"    unit="W/m2" />
+        <field id="lat_sic"    long_name="Latent heat flux sic"    unit="W/m2" />
+        <field id="flw_ter"    long_name="LW ter"    unit="W/m2" />
+        <field id="flw_lic"    long_name="LW lic"    unit="W/m2" />
+        <field id="flw_oce"    long_name="LW oce"    unit="W/m2" />
+        <field id="flw_sic"    long_name="LW sic"    unit="W/m2" />
+        <field id="fsw_ter"    long_name="SW ter"    unit="W/m2" />
+        <field id="fsw_lic"    long_name="SW lic"    unit="W/m2" />
+        <field id="fsw_oce"    long_name="SW oce"    unit="W/m2" />
+        <field id="fsw_sic"    long_name="SW sic"    unit="W/m2" />
+        <field id="wbils_ter"    long_name="Bilan sol ter"    unit="W/m2" />
+        <field id="wbils_lic"    long_name="Bilan sol lic"    unit="W/m2" />
+        <field id="wbils_oce"    long_name="Bilan sol oce"    unit="W/m2" />
+        <field id="wbils_sic"    long_name="Bilan sol sic"    unit="W/m2" />
+        <field id="wbilo_ter"    long_name="Bilan eau ter"    unit="kg/(m2*s)" />
+        <field id="wbilo_lic"    long_name="Bilan eau lic"    unit="kg/(m2*s)" />
+        <field id="wbilo_oce"    long_name="Bilan eau oce"    unit="kg/(m2*s)" />
+        <field id="wbilo_sic"    long_name="Bilan eau sic"    unit="kg/(m2*s)" />
+        <field id="wevap_ter"    long_name="Evap eau ter"    unit="kg/(m2*s)" />
+        <field id="wevap_lic"    long_name="Evap eau lic"    unit="kg/(m2*s)" />
+        <field id="wevap_oce"    long_name="Evap eau oce"    unit="kg/(m2*s)" />
+        <field id="wevap_sic"    long_name="Evap eau sic"    unit="kg/(m2*s)" />
+        <field id="wrain_ter"    long_name="Pluie eau ter"    unit="kg/(m2*s)" />
+        <field id="wrain_lic"    long_name="Pluie eau lic"    unit="kg/(m2*s)" />
+        <field id="wrain_oce"    long_name="Pluie eau oce"    unit="kg/(m2*s)" />
+        <field id="wrain_sic"    long_name="Pluie eau sic"    unit="kg/(m2*s)" />
+        <field id="wsnow_ter"    long_name="Neige eau ter"    unit="kg/(m2*s)" />
+        <field id="wsnow_lic"    long_name="Neige eau lic"    unit="kg/(m2*s)" />
+        <field id="wsnow_oce"    long_name="Neige eau oce"    unit="kg/(m2*s)" />
+        <field id="wsnow_sic"    long_name="Neige eau sic"    unit="kg/(m2*s)" />
+        <field id="cdrm"    long_name="Momentum drag coef."    unit="-" />
+        <field id="cdrh"    long_name="Heat drag coef."    unit="-" />
+        <field id="cldl"    long_name="Low-level cloudiness"    unit="-" />
+        <field id="cldm"    long_name="Mid-level cloudiness"    unit="-" />
+        <field id="cldh"    long_name="High-level cloudiness"    unit="-" />
+        <field id="cldt"    long_name="Total cloudiness"    unit="-" />
+        <field id="cldq"    long_name="Cloud liquid water path"    unit="kg/m2" />
+        <field id="lwp"    long_name="Cloud water path"    unit="kg/m2" />
+        <field id="iwp"    long_name="Cloud ice water path"    unit="kg/m2" />
+        <field id="ue"    long_name="Zonal energy transport"    unit="-" />
+        <field id="ve"    long_name="Merid energy transport"    unit="-" />
+        <field id="uq"    long_name="Zonal humidity transport"    unit="-" />
+        <field id="vq"    long_name="Merid humidity transport"    unit="-" />
+        <field id="uwat"    long_name="Zonal total water transport"    unit="-" />
+        <field id="vwat"    long_name="Merid total water transport"    unit="-" />
+        <field id="cape"    long_name="Conv avlbl pot ener"    unit="J/kg" />
+        <field id="pbase"    long_name="Cld base pressure"    unit="Pa" />
+        <field id="ptop"    long_name="Cld top pressure"    unit="Pa" />
+        <field id="fbase"    long_name="Cld base mass flux"    unit="kg/m2/s" />
+        <field id="plcl"    long_name="Lifting Condensation Level"    unit="hPa" enabled=".false." />
+        <field id="plfc"    long_name="Level of Free Convection"    unit="hPa" />
+        <field id="wbeff"    long_name="Conv. updraft velocity at LFC (inf100)"    unit="m/s" />
+        <field id="convoccur"    long_name="Convective occurence"    unit="-" />
+        <field id="prw"    long_name="Precipitable water"    unit="kg/m2" />
+        <field id="prlw"   long_name="Precipitable liquid water"  unit="kg/m2" />
+	<field id="prsw"   long_name="Precipitable solid water"  unit="kg/m2" />
+	<field id="prbsw"   long_name="Precipitable blowing snow"  unit="kg/m2" />
+        <field id="s_pblh"    long_name="Boundary Layer Height"    unit="m" />
+        <field id="s_pblt"    long_name="t at Boundary Layer Height"    unit="K" />
+        <field id="s_lcl"    long_name="Condensation level"    unit="m" />
+        <field id="s_therm"    long_name="Exces du thermique"    unit="K" />
+        <field id="slab_bils_oce"    long_name="Bilan au sol sur ocean slab"    unit="W/m2" />
+        <field id="ale_bl"    long_name="ALE BL"    unit="m2/s2" />
+        <field id="alp_bl"    long_name="ALP BL"    unit="m2/s2" />
+        <field id="ale_wk"    long_name="ALE WK"    unit="m2/s2" />
+        <field id="alp_wk"    long_name="ALP WK"    unit="m2/s2" />
+        <field id="ale"    long_name="ALE"    unit="m2/s2" />
+        <field id="alp"    long_name="ALP"    unit="W/m2" />
+        <field id="cin"    long_name="Convective INhibition"    unit="m2/s2" />
+        <field id="wape"    long_name="-"    unit="-" />
+        <field id="n2"    long_name="Nombre de panaches de type 2"    unit="-" />
+        <field id="s2"    long_name="Surface moyenne des panaches de type 2"    unit="m2" />
+        <field id="proba_notrig"    long_name="Probabilite de non-declenchement"    unit="-" />
+        <field id="random_notrig"    long_name="Tirage aleatoire de non-declenchement"    unit="-" />
+        <field id="cv_gen"    long_name="Cumulonimbus genesis"    unit="1/(m2 s)" />
+        <field id="ale_bl_stat"    long_name="ALE_BL_STAT"    unit="m2/s2" />
+        <field id="ale_bl_trig"    long_name="ALE_BL_STAT + Condition P>Pseuil"    unit="m2/s2" />
+        <field id="alp_bl_det"    long_name="ALP_BL_DET"    unit="W/m2" />
+        <field id="alp_bl_fluct_m"    long_name="ALP_BL_FLUCT_M"    unit="W/m2" />
+        <field id="alp_bl_fluct_tke"    long_name="ALP_BL_FLUCT_TKE"    unit="W/m2" />
+        <field id="alp_bl_conv"    long_name="ALP_BL_CONV"    unit="W/m2" />
+        <field id="alp_bl_stat"    long_name="ALP_BL_STAT"    unit="W/m2" />
+        <field id="u850"    long_name="Zonal wind 850hPa"    unit="m/s" detect_missing_value=".true." />
+        <field id="u700"    long_name="Zonal wind 700hPa"    unit="m/s" detect_missing_value=".true." />
+        <field id="u500"    long_name="Zonal wind 500hPa"    unit="m/s" detect_missing_value=".true." />
+        <field id="u200"    long_name="Zonal wind 200hPa"    unit="m/s" detect_missing_value=".true." />
+        <field id="u100"    long_name="Zonal wind 100hPa"    unit="m/s" detect_missing_value=".true." />
+        <field id="u50"     long_name="Zonal wind 50hPa"    unit="m/s" detect_missing_value=".true." />
+        <field id="u10"     long_name="Zonal wind 10hPa"    unit="m/s" detect_missing_value=".true." />
+        <field id="v850"    long_name="Meridional wind 850hPa"    unit="m/s" detect_missing_value=".true." />
+        <field id="v700"    long_name="Meridional wind 700hPa"    unit="m/s" detect_missing_value=".true." />
+        <field id="v500"    long_name="Meridional wind 500hPa"    unit="m/s" detect_missing_value=".true." />
+        <field id="v200"    long_name="Meridional wind 200hPa"    unit="m/s" detect_missing_value=".true." />
+        <field id="v100"    long_name="Meridional wind 100hPa"    unit="m/s" detect_missing_value=".true." />
+        <field id="v50"     long_name="Meridional wind 50hPa"    unit="m/s" detect_missing_value=".true." />
+        <field id="v10"    long_name="Meridional wind 10hPa"    unit="m/s" detect_missing_value=".true." />
+        <field id="w850"    long_name="Vertical wind 850hPa"    unit="Pa/s" detect_missing_value=".true." />
+        <field id="w700"    long_name="Vertical wind 700hPa"    unit="Pa/s" detect_missing_value=".true." />
+        <field id="w500"    long_name="Vertical wind 500hPa"    unit="Pa/s" detect_missing_value=".true." />
+        <field id="w200"    long_name="Vertical wind 200hPa"    unit="Pa/s" detect_missing_value=".true." />
+        <field id="w100"    long_name="Vertical wind 100hPa"    unit="Pa/s" detect_missing_value=".true." />
+        <field id="w50"    long_name="Vertical wind 50hPa"    unit="Pa/s" detect_missing_value=".true." />
+        <field id="w10"    long_name="Vertical wind 10hPa"    unit="Pa/s" detect_missing_value=".true." />
+        <field id="t850"    long_name="Temperature 850hPa"    unit="K" detect_missing_value=".true." />
+        <field id="t700"    long_name="Temperature 700hPa"    unit="K" detect_missing_value=".true." />
+        <field id="t500"    long_name="Temperature 500hPa"    unit="K" detect_missing_value=".true." />
+        <field id="t200"    long_name="Temperature 200hPa"    unit="K" detect_missing_value=".true." />
+        <field id="t100"    long_name="Temperature 100hPa"    unit="K" detect_missing_value=".true." />
+        <field id="t50"    long_name="Temperature 50hPa"    unit="K" detect_missing_value=".true." />
+        <field id="t10"    long_name="Temperature 10hPa"    unit="K" detect_missing_value=".true." />
+        <field id="q850"    long_name="Specific humidity 850hPa"    unit="kg/kg" detect_missing_value=".true." />
+        <field id="q700"    long_name="Specific humidity 700hPa"    unit="kg/kg" detect_missing_value=".true." />
+        <field id="q500"    long_name="Specific humidity 500hPa"    unit="kg/kg" detect_missing_value=".true." />
+        <field id="q200"    long_name="Specific humidity 200hPa"    unit="kg/kg" detect_missing_value=".true." />
+        <field id="q100"    long_name="Specific humidity 100hPa"    unit="kg/kg" detect_missing_value=".true." />
+        <field id="q50"    long_name="Specific humidity 50hPa"    unit="kg/kg" detect_missing_value=".true." />
+        <field id="q10"    long_name="Specific humidity 10hPa"    unit="kg/kg" detect_missing_value=".true." />
+        <field id="z850"    long_name="Geopotential height 850hPa"    unit="m" detect_missing_value=".true." />
+        <field id="z700"    long_name="Geopotential height 700hPa"    unit="m" detect_missing_value=".true." />
+        <field id="z500"    long_name="Geopotential height 500hPa"    unit="m" detect_missing_value=".true." />
+        <field id="z200"    long_name="Geopotential height 200hPa"    unit="m" detect_missing_value=".true." />
+        <field id="z100"    long_name="Geopotential height 100hPa"    unit="m" detect_missing_value=".true." />
+        <field id="z50"    long_name="Geopotential height 50hPa"    unit="m" detect_missing_value=".true." />
+        <field id="z10"    long_name="Geopotential height 10hPa"    unit="m" detect_missing_value=".true." />
+        <field id="t_oce_sic"    long_name="Temp mixte oce-sic"    unit="K" />
+        <field id="weakinv"    long_name="Weak inversion"    unit="-" />
+        <field id="dthmin"    long_name="dTheta mini"    unit="K/m" />
+        <field id="u10_ter"    long_name="-"    unit="-" />
+        <field id="u10_lic"    long_name="-"    unit="-" />
+        <field id="u10_oce"    long_name="-"    unit="-" />
+        <field id="u10_sic"    long_name="-"    unit="-" />
+        <field id="v10_ter"    long_name="-"    unit="-" />
+        <field id="v10_lic"    long_name="-"    unit="-" />
+        <field id="v10_oce"    long_name="-"    unit="-" />
+        <field id="v10_sic"    long_name="-"    unit="-" />
+        <field id="rh2m"    long_name="Relative humidity at 2m"    unit="%" />
+        <field id="rh2m_max"    field_ref="rh2m" operation="maximum" enabled="false"/> <!-- ym Problem : field is disabled check rh2m_min has a reference (field_ref) to rh2 but is also sent by model which is not compatible-->
+        <field id="rh2m_min"    field_ref="rh2m" operation="minimum" enabled="false"/> <!-- ym Problem : field is disabled check rh2m_max has a reference (field_ref) to rh2 but is also sent by model which is not compatible-->
+<!--        <field id="rh2m_min"    long_name="Min Relative humidity at 2m"    unit="%" /> -->
+<!--        <field id="rh2m_max"    long_name="Max Relative humidity at 2m"    unit="%" /> -->
+        <field id="qsat2m"    long_name="Saturant humidity at 2m"    unit="%" />
+        <field id="tpot"    long_name="Surface air potential temperature"    unit="K" />
+        <field id="tpote"    long_name="Surface air equivalent potential temperature"    unit="K" />
+        <field id="SWnetOR"    long_name="Sfce net SW radiation OR"    unit="W/m2" />
+        <field id="SWdownOR"    long_name="Sfce incident SW radiation OR"    unit="W/m2" />
+        <field id="LWdownOR"    long_name="Sfce incident LW radiation OR"    unit="W/m2" />
+        <field id="snowl"    long_name="Solid Large-scale Precip."    unit="kg/(m2*s)" />
+        <field id="cape_max"    long_name="CAPE max."    unit="J/kg" operation="maximum"/>
+        <field id="solldown"    long_name="Down. IR rad. at surface"    unit="W/m2" />
+        <field id="dtsvdfo"    long_name="Boundary-layer dTs(o)"    unit="K/s" />
+        <field id="dtsvdft"    long_name="Boundary-layer dTs(t)"    unit="K/s" />
+        <field id="dtsvdfg"    long_name="Boundary-layer dTs(g)"    unit="K/s" />
+        <field id="dtsvdfi"    long_name="Boundary-layer dTs(g)"    unit="K/s" />
+        <field id="rugs"    long_name="rugosity"    unit="-" />
+        <field id="z0m"    long_name="roughness length, momentum"    unit="-" />
+        <field id="z0h"    long_name="roughness length, enthalpy"    unit="-" />
+        <field id="topswad"    long_name="ADE at TOA"    unit="W/m2" />
+        <field id="topswad0"    long_name="ADE clear-sky at TOA"    unit="W/m2" />
+        <field id="topswai"    long_name="AIE at TOA"    unit="W/m2" />
+        <field id="solswad"    long_name="ADE at SRF"    unit="W/m2" />
+        <field id="solswad0"    long_name="ADE clear-sky at SRF"    unit="W/m2" />
+        <field id="solswai"    long_name="AIE at SFR"    unit="W/m2" />
+        <field id="toplwad"    long_name="LW-ADE at TOA" unit="W/m2" />
+        <field id="toplwad0"    long_name="LW-ADE clear-sky at TOA"    unit="W/m2" />
+        <field id="toplwai"    long_name="LW-AIE clear-sky at TOA"    unit="W/m2" />
+        <field id="sollwad"    long_name="LW-ADE at SRF" unit="W/m2" />
+        <field id="sollwad0"    long_name="LW-ADE clear-sky at SRF"    unit="W/m2" />
+        <field id="sollwai"    long_name="LW-AIE at SRF" unit="W/m2" />
+        <field id="od550_ASBCM"    long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="od550_ASPOMM"   long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="od550_ASSO4M"   long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="od550_CSSO4M"   long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="od550_SSSSM"    long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="od550_ASSSM"    long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="od550_CSSSM"    long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="od550_CIDUSTM"  long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="od550_AIBCM"    long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="od550_AIPOMM"   long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="od550_ASNO3M"   long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="od550_CSNO3M"   long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="od550_CINO3M"   long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="od550_STRAT"    long_name="Aerosol Optical depth at 550 nm "    unit="1"  />
+        <field id="dryod550_ASBCM"    long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="dryod550_ASPOMM"   long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="dryod550_ASSO4M"   long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="dryod550_CSSO4M"   long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="dryod550_SSSSM"    long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="dryod550_ASSSM"    long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="dryod550_CSSSM"    long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="dryod550_CIDUSTM"  long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="dryod550_AIBCM"    long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="dryod550_AIPOMM"   long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="dryod550_ASNO3M"   long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="dryod550_CSNO3M"   long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="dryod550_CINO3M"   long_name="Aerosol Optical depth at 550 nm "    unit="1" />
+        <field id="od_10um_STRAT"  long_name="Stratospheric Aerosol Optical depth at 10 um" unit="-" />
+        <field id="od443aer"    long_name="Total aerosol optical depth at 440nm" unit="-" />
+        <field id="od550aer"    long_name="Total aerosol optical depth at 550nm" unit="-" />
+        <field id="dryod550aer" long_name="Total dry aerosol optical depth at 550nm"    unit="-" />
+        <field id="od865aer"    long_name="Total aerosol optical depth at 870nm"    unit="-" />
+        <field id="abs550aer"   long_name="Absorption aerosol optical depth at 550nm"    unit="-" />
+        <field id="od550lt1aer" long_name="Fine mode optical depth"    unit="-" />
+        <field id="sconcso4"    long_name="Surface Concentration of Sulfate "    unit="kg/m3" />
+        <field id="sconcno3"    long_name="Surface Concentration of Nitrate "    unit="kg/m3" />
+        <field id="sconcoa"     long_name="Surface Concentration of Organic Aerosol "    unit="kg/m3" />
+        <field id="sconcbc"     long_name="Surface Concentration of Black Carbon "    unit="kg/m3" />
+        <field id="sconcss"     long_name="Surface Concentration of Sea Salt "    unit="kg/m3" />
+        <field id="sconcdust"   long_name="Surface Concentration of Dust "    unit="kg/m3" />
+        <field id="loadso4"   long_name="Column Load of Sulfate "    unit="kg/m2" />
+        <field id="loadoa"    long_name="Column Load of Organic Aerosol "    unit="kg/m2" />
+        <field id="loadbc"    long_name="Column Load of Black Carbon "    unit="kg/m2" />
+        <field id="loadss"    long_name="Column Load of Sea Salt "    unit="kg/m2" />
+        <field id="loaddust"  long_name="Column Load of Dust "    unit="kg/m2" />
+        <field id="loadno3"   long_name="Column Load of Nitrate " unit="kg/m2" />
+        <field id="swtoaas_nat"    long_name="Natural aerosol radiative forcing all-sky at TOA"    unit="W/m2" />
+        <field id="swsrfas_nat"    long_name="Natural aerosol radiative forcing all-sky at SRF"    unit="W/m2" />
+        <field id="swtoacs_nat"    long_name="Natural aerosol radiative forcing clear-sky at TOA"    unit="W/m2" />
+        <field id="swsrfcs_nat"    long_name="Natural aerosol radiative forcing clear-sky at SRF"    unit="W/m2" />
+        <field id="swtoaas_ant"    long_name="Anthropogenic aerosol radiative forcing all-sky at TOA"    unit="W/m2" />
+        <field id="swsrfas_ant"    long_name="Anthropogenic aerosol radiative forcing all-sky at SRF"    unit="W/m2" />
+        <field id="swtoacs_ant"    long_name="Anthropogenic aerosol radiative forcing clear-sky at TOA"    unit="W/m2" />
+        <field id="swsrfcs_ant"    long_name="Anthropogenic aerosol radiative forcing clear-sky at SRF"    unit="W/m2" />
+        <field id="swtoacf_nat"    long_name="Natural aerosol impact on cloud radiative forcing at TOA"    unit="W/m2" />
+        <field id="swsrfcf_nat"    long_name="Natural aerosol impact on cloud radiative forcing  at SRF"    unit="W/m2" />
+        <field id="swtoacf_ant"    long_name="Anthropogenic aerosol impact on cloud radiative forcing at TOA"    unit="W/m2" />
+        <field id="swsrfcf_ant"    long_name="Anthropogenic aerosol impact on cloud radiative forcing at SRF"    unit="W/m2" />
+        <field id="swtoacf_zero"    long_name="Cloud radiative forcing (allsky-clearsky fluxes) at TOA"    unit="W/m2" />
+        <field id="swsrfcf_zero"    long_name="Cloud radiative forcing (allsky-clearsky fluxes) at SRF"    unit="W/m2" />
+        <field id="cldncl"    long_name="CDNC at top of liquid water cloud"    unit="m-3" />
+        <field id="reffclwtop"    long_name="Droplet effective radius at top of liquid water cloud"    unit="m" />
+        <field id="cldnvi"    long_name="Column Integrated Cloud Droplet Number"    unit="m-2" />
+        <field id="lcc"    long_name="Cloud liquid fraction at top of cloud"    unit="1" />
+        <field id="lcc_limit"          field_ref="lcc" > lcc /= 0 ? lcc : 1e-15  </field>
+        <field id="wvapp"    long_name="-"    unit="-" />
+        <field id="albe_ter"    long_name="Albedo VIS surf. ter"    unit="-" />
+        <field id="albe_lic"    long_name="Albedo VIS surf. lic"    unit="-" />
+        <field id="albe_oce"    long_name="Albedo VIS surf. oce"    unit="-" />
+        <field id="albe_sic"    long_name="Albedo VIS surf. sic"    unit="-" />
+        <field id="ages_ter"    long_name="Snow age ter"    unit="day" />
+        <field id="ages_lic"    long_name="Snow age lic"    unit="day" />
+        <field id="ages_oce"    long_name="Snow age oce"    unit="day" />
+        <field id="ages_sic"    long_name="Snow age sic"    unit="day" />
+        <field id="snow_ter"    long_name="Snow"    unit="kg/m2" />
+        <field id="snow_lic"    long_name="Snow"    unit="kg/m2" />
+        <field id="snow_oce"    long_name="Snow"    unit="kg/m2" />
+        <field id="snow_sic"    long_name="Snow"    unit="kg/m2" />
+        <field id="rugs_ter"    long_name="Surface roughness ter"    unit="m" />
+        <field id="rugs_lic"    long_name="Surface roughness lic"    unit="m" />
+        <field id="rugs_oce"    long_name="Surface roughness oce"    unit="m" />
+        <field id="rugs_sic"    long_name="Surface roughness sic"    unit="m" />
+        <field id="z0m_ter"    long_name="roughness length, momentum ter"    unit="m" />
+        <field id="z0m_lic"    long_name="roughness length, momentum lic"    unit="m" />
+        <field id="z0m_oce"    long_name="roughness length, momentum oce"    unit="m" />
+        <field id="z0m_sic"    long_name="roughness length, momentum sic"    unit="m" />
+        <field id="z0h_ter"    long_name="roughness length, enthalpy ter"    unit="m" />
+        <field id="z0h_lic"    long_name="roughness length, enthalpy lic"    unit="m" />
+        <field id="z0h_oce"    long_name="roughness length, enthalpy oce"    unit="m" />
+        <field id="z0h_sic"    long_name="roughness length, enthalpy sic"    unit="m" />
+        <field id="sens_rain_oce"  long_name="Sensible heat flux associated withliquid prec. over ocean"    unit="W/m2" />
+        <field id="sens_rain_sic"  long_name="Sensible heat flux associated with liquid prec. over seaice"    unit="W/m2" />
+        <field id="sens_snow_oce"  long_name="Sensible heat flux associated with solid prec. over ocean"    unit="W/m2" />
+        <field id="sens_snow_sic"  long_name="Sensible heat flux associated with solid prec. over seaice"    unit="W/m2" />
+        <field id="lat_rain_oce"  long_name="Latent heat flux associated with liquid prec. over ocean"    unit="W/m2" />
+        <field id="lat_rain_sic"  long_name="Latent heat flux associated with liquid prec. over seaice"    unit="W/m2" />
+        <field id="lat_snow_oce"  long_name="Latent heat flux associated with solid prec. over ocean"    unit="W/m2" />
+        <field id="lat_snow_sic"  long_name="Latent heat flux associated with solid prec. over seaice"    unit="W/m2" />
+        <field id="alb1"    long_name="Surface VIS albedo"    unit="-" />
+        <field id="alb2"    long_name="Surface Near IR albedo"    unit="-" />
+        <field id="ftime_con"    long_name="Fraction of time convection Occurs"    unit="-" operation="instant" />
+        <field id="ftime_deepcv"    long_name="Fraction of time deep convection Occurs"    unit="-" />
+        <field id="wake_h"    long_name="wake height"    unit="m" />
+        <field id="wake_dens"    long_name="number of wakes per m2"    unit="1/m2" />
+        <field id="wake_s"    long_name="wake_s"    unit="-" />
+        <field id="epmax"    long_name="epmax en fn cape"    unit="su" />
+        <field id="plulth"    long_name="Rainfall therm."    unit="K/s" />
+        <field id="plulst"    long_name="Rainfall strat."    unit="K/s" />
+        <field id="lmaxth"    long_name="Upper level thermals"    unit="-" />
+        <field id="ftime_th"    long_name="Fraction of time Shallow convection occurs"    unit="-" />
+        <field id="f0_th"    long_name="Thermal closure mass flux"    unit="K/s" />
+        <field id="zmax_th"    long_name="Thermal plume height"    unit="K/s" />
+        <field id="rsut4co2"    long_name="TOA Out SW in 4xCO2 atmosphere"    unit="W/m2" />
+        <field id="rlut4co2"    long_name="TOA Out LW in 4xCO2 atmosphere"    unit="W/m2" />
+        <field id="rsutcs4co2"    long_name="TOA Out CS SW in 4xCO2 atmosphere"    unit="W/m2" />
+        <field id="rlutcs4co2"    long_name="TOA Out CS LW in 4xCO2 atmosphere"    unit="W/m2" />
+        <field id="dqphy2d"    long_name="Physics dQ"    unit="(kg/m2)/s" />
+        <field id="dqlphy2d"    long_name="Physics dQL"    unit="(kg/m2)/s" />
+	<field id="dqsphy2d"    long_name="Physics dQS"    unit="(kg/m2)/s" />
+	<field id="dqbsphy2d"    long_name="Physics dQBS"    unit="(kg/m2)/s" />
+        <field id="dqdyn2d"    long_name="Dynamics dQ"    unit="(kg/m2)/s" />
+        <field id="dqldyn2d"   long_name="Dynamics dQL"    unit="(kg/m2)/s" />
+        <field id="dqsdyn2d"   long_name="Dynamics dQS"    unit="(kg/m2)/s" />
+        <field id="dqbsdyn2d"   long_name="Dynamics dQBS"    unit="(kg/m2)/s" />
+	<field id="dqcon2d"    long_name="Convection dQ"    unit="(kg/m2)/s" />
+        <field id="dqwak2d"    long_name="Wake dQ"    unit="(kg/m2)/s" />
+        <field id="dqlsc2d"    long_name="Condensation dQ"    unit="(kg/m2)/s" />
+        <field id="dqvdf2d"    long_name="Boundary-layer dQ"    unit="(kg/m2)/s" />
+        <field id="dqeva2d"    long_name="Reevaporation dQ"    unit="(kg/m2)/s" />
+        <field id="dqlscth2d"    long_name="dQ therm."    unit="(kg/m2)/s" />
+        <field id="dqlscst2d"    long_name="dQ strat."    unit="(kg/m2)/s" />
+        <field id="dqthe2d"    long_name="Thermal dQ"    unit="(kg/m2)/s" />
+        <field id="dqajs2d"    long_name="Dry ajdust dQ"    unit="(kg/m2)/s" />
+        <field id="tatp"    long_name="Dry ajdust dQ"    unit="(kg/m2)/s" />
+        <field id="p_tropopause"  long_name="Tropopause pressure" unit="Pa"   detect_missing_value=".true."  />
+        <field id="z_tropopause"  long_name="Tropopause height" unit="m"      detect_missing_value=".true."  />
+        <field id="t_tropopause"  long_name="Tropopause temperature" unit="K" detect_missing_value=".true."  />
+        <field id="colO3_strat"    long_name="Ozone stratospheric column"     unit="DU" />             <!-- Added ThL -->
+        <field id="colO3_trop"     long_name="Ozone tropospheric column"      unit="DU" />             <!-- Added ThL -->
+        <field id="flx_co2_land"   long_name="CO2 flux from land"             unit="kg CO2/m2/s" />    <!-- Added OB -->
+        <field id="flx_co2_ocean"  long_name="CO2 flux from ocean"            unit="kg CO2/m2/s" />    <!-- Added OB -->
+        <field id="flx_co2_ocean_cor"  long_name="correction of the CO2 flux from ocean"          unit="kg CO2/m2/s" />    <!-- Added PC -->
+        <field id="flx_co2_land_cor"   long_name="correction of the CO2 flux from land"           unit="kg CO2/m2/s" />    <!-- Added PC -->
+        <field id="flx_co2_ff"     long_name="CO2 flux from ff"               unit="kg CO2/m2/s" />    <!-- Added OB -->
+        <field id="flx_co2_bb"     long_name="CO2 flux from bb"               unit="kg CO2/m2/s" />    <!-- Added OB -->
+        <field id="delta_SST" long_name="ocean-air interface temperature minus bulk SST" unit="K" detect_missing_value=".true." />
+        <field id="delta_sal"
+	       long_name="ocean-air interface salinity minus bulk salinity"
+	       unit="ppt" detect_missing_value=".true." />
+        <field id="dS_ns" long_name="delta salinity near surface" unit="ppt" detect_missing_value=".true." />
+        <field id="dT_ns" long_name="sub-skin temperature minus foundation temperature" unit="K" detect_missing_value=".true." />
+        <field id="dTer" 	       long_name="interface temperature minus sub-skin temperature" 	       unit="K" detect_missing_value=".true." />
+        <field id="dSer"
+	       long_name="salinity variation in the diffusive microlayer"
+ 	       unit="ppt" detect_missing_value=".true." />
+        <field id="tkt" long_name="thickness of thermal microlayer" 	       unit="m" 	       detect_missing_value=".true." />
+        <field id="tks" long_name="thickness of salinity microlayer" 	       unit="m" 	       detect_missing_value=".true." />
+        <field id="taur" long_name="momentum flux due to rain" 	       unit="Pa" 	       detect_missing_value=".true." />
+        <field id="SSS" long_name="bulk sea-surface salinity" unit="ppt" detect_missing_value=".true." />
+            <!-- Begin Added SN isotopes 2D fields 07 2023 -->
+            <!-- water oxygen H216O H217O H218O -->
+        <field id="precipH216O" long_name="Precip Totale liq+sol" unit="kg/(s*m2)" />
+        <field id="plulH216O"   long_name="Large-scale Precip."   unit="kg/(s*m2)" />
+        <field id="plucH216O"   long_name="Convective Precip."    unit="kg/(s*m2)" />
+        <field id="evapH216O"   long_name="Evaporat."             unit="kg/(s*m2)" />
+        <field id="evap_terH216O"  long_name="evaporation at surface ter"    unit="kg/(s*m2)" />
+        <field id="evap_licH216O"  long_name="evaporation at surface lic"    unit="kg/(s*m2)" />
+        <field id="evap_oceH216O"  long_name="evaporation at surface oce"    unit="kg/(s*m2)" />
+        <field id="evap_sicH216O"  long_name="evaporation at surface sic"    unit="kg/(s*m2)" />
+        <field id="precipH217O" long_name="Precip Totale liq+sol" unit="kg/(s*m2)" />
+        <field id="plulH217O"   long_name="Large-scale Precip."   unit="kg/(s*m2)" />
+        <field id="plucH217O"   long_name="Convective Precip."    unit="kg/(s*m2)" />
+        <field id="evapH217O"   long_name="Evaporat."             unit="kg/(s*m2)" />
+        <field id="evap_terH217O"  long_name="evaporation at surface ter"    unit="kg/(s*m2)" />
+        <field id="evap_licH217O"  long_name="evaporation at surface lic"    unit="kg/(s*m2)" />
+        <field id="evap_oceH217O"  long_name="evaporation at surface oce"    unit="kg/(s*m2)" />
+        <field id="evap_sicH217O"  long_name="evaporation at surface sic"    unit="kg/(s*m2)" />
+        <field id="precipH218O" long_name="Precip Totale liq+sol" unit="kg/(s*m2)" />
+        <field id="plulH218O"   long_name="Large-scale Precip."   unit="kg/(s*m2)" />
+        <field id="plucH218O"   long_name="Convective Precip."    unit="kg/(s*m2)" />
+        <field id="evapH218O"   long_name="Evaporat."             unit="kg/(s*m2)" />
+        <field id="evap_terH218O"  long_name="evaporation at surface ter"    unit="kg/(s*m2)" />
+        <field id="evap_licH218O"  long_name="evaporation at surface lic"    unit="kg/(s*m2)" />
+        <field id="evap_oceH218O"  long_name="evaporation at surface oce"    unit="kg/(s*m2)" />
+        <field id="evap_sicH218O"  long_name="evaporation at surface sic"    unit="kg/(s*m2)" />
+            <!-- water hydrogen HDO HTO -->
+        <field id="precipHDO" long_name="Precip Totale liq+sol" unit="kg/(s*m2)" />
+        <field id="plulHDO"   long_name="Large-scale Precip."   unit="kg/(s*m2)" />
+        <field id="plucHDO"   long_name="Convective Precip."    unit="kg/(s*m2)" />
+        <field id="evapHDO"   long_name="Evaporat."             unit="kg/(s*m2)" />
+        <field id="evap_terHDO"  long_name="evaporation at surface ter"    unit="kg/(s*m2)" />
+        <field id="evap_licHDO"  long_name="evaporation at surface lic"    unit="kg/(s*m2)" />
+        <field id="evap_oceHDO"  long_name="evaporation at surface oce"    unit="kg/(s*m2)" />
+        <field id="evap_sicHDO"  long_name="evaporation at surface sic"    unit="kg/(s*m2)" />
+        <field id="precipHTO" long_name="Precip Totale liq+sol" unit="kg/(s*m2)" />
+        <field id="plulHTO"   long_name="Large-scale Precip."   unit="kg/(s*m2)" />
+        <field id="plucHTO"   long_name="Convective Precip."    unit="kg/(s*m2)" />
+        <field id="evapHTO"   long_name="Evaporat."             unit="kg/(s*m2)" />
+        <field id="evap_terHTO"  long_name="evaporation at surface ter"    unit="kg/(s*m2)" />
+        <field id="evap_licHTO"  long_name="evaporation at surface lic"    unit="kg/(s*m2)" />
+        <field id="evap_oceHTO"  long_name="evaporation at surface oce"    unit="kg/(s*m2)" />
+        <field id="evap_sicHTO"  long_name="evaporation at surface sic"    unit="kg/(s*m2)" />
+          <!-- end Added SN isotopes 2D fields 07 2023 -->
+    </field_group>
+
+    <field_group id="fields_3D" grid_ref="grid_glo_presnivs" >
+        <field id="tke"    long_name="TKE"    unit="m2/s2" />
+	<field id="tke_dissip" long_name="TKE DISSIPATION" unit="m2/s3" />
+        <field id="tke_ter"    long_name="Max Turb. Kinetic Energy ter"    unit="m2/s2" />
+        <field id="tke_lic"    long_name="Max Turb. Kinetic Energy lic"    unit="m2/s2" />
+        <field id="tke_oce"    long_name="Max Turb. Kinetic Energy oce"    unit="m2/s2" />
+        <field id="tke_sic"    long_name="Max Turb. Kinetic Energy sic"    unit="m2/s2" />
+        <field id="tke_max_ter"    long_name="Max Turb. Kinetic Energy ter"    unit="m2/s2" operation="maximum"/>
+        <field id="tke_max_lic"    long_name="Max Turb. Kinetic Energy lic"    unit="m2/s2" operation="maximum"/>
+        <field id="tke_max_oce"    long_name="Max Turb. Kinetic Energy oce"    unit="m2/s2" operation="maximum"/>
+        <field id="tke_max_sic"    long_name="Max Turb. Kinetic Energy sic"    unit="m2/s2" operation="maximum"/>
+        <field id="l_mix_ter"    long_name="PBL mixing length ter"    unit="m" />
+        <field id="l_mix_lic"    long_name="PBL mixing length lic"    unit="m" />
+        <field id="l_mix_oce"    long_name="PBL mixing length oce"    unit="m" />
+        <field id="l_mix_sic"    long_name="PBL mixing length sic"    unit="m" />
+        <field id="treedrg_ter"    long_name="tree drag profile ter "    unit="-" />
+        <field id="treedrg_lic"    long_name="tree drag profile ter "    unit="-" />
+        <field id="treedrg_oce"    long_name="tree drag profile ter "    unit="-" />
+        <field id="treedrg_sic"    long_name="tree drag profile ter "    unit="-" />
+        <field id="l_mixmin_ter"    long_name="min PBL mixing length ter"    unit="m" />
+        <field id="l_mixmin_lic"    long_name="min PBL mixing length lic"    unit="m" />
+        <field id="l_mixmin_oce"    long_name="min PBL mixing length oce"    unit="m" />
+        <field id="l_mixmin_sic"    long_name="min PBL mixing length sic"    unit="m" />
+        <field id="dltpbltke_ter"    long_name="TKE difference (w - x)"    unit="m2/s2" />
+        <field id="dltpbltke_lic"    long_name="TKE difference (w - x)"    unit="m2/s2" />
+        <field id="dltpbltke_oce"    long_name="TKE difference (w - x)"    unit="m2/s2" />
+        <field id="dltpbltke_sic"    long_name="TKE difference (w - x)"    unit="m2/s2" />
+        <field id="cldtau"    long_name="Cloud optical thickness"    unit="1" />
+        <field id="cldemi"    long_name="Cloud optical emissivity"    unit="1" />
+        <field id="tke_max"    long_name="TKE max"    unit="m2/s2" operation="maximum"/>
+        <field id="concso4"    long_name="Concentration of Sulfate "    unit="kg/m3" />
+        <field id="concno3"    long_name="Concentration of Nitrate "    unit="kg/m3" /> 
+        <field id="concoa"    long_name="Concentration of Organic Aerosol "    unit="kg/m3" />
+        <field id="concbc"    long_name="Concentration of Black Carbon "    unit="kg/m3" />
+        <field id="concss"    long_name="Concentration of Sea Salt "    unit="kg/m3" />
+        <field id="concdust"    long_name="Concentration of Dust "    unit="kg/m3" />
+        <field id="ec550aer"    long_name="Extinction at 550nm"    unit="m^-1" />
+        <field id="lwcon"    long_name="Cloud liquid water content seen by radiation"    unit="kg/kg" />
+        <field id="iwcon"    long_name="Cloud ice water content seen by radiation"    unit="kg/kg" />
+        <field id="temp"    long_name="Air temperature"    unit="K" />
+        <field id="theta"    long_name="Potential air temperature"    unit="K" />
+        <field id="ovap"    long_name="Specific humidity"    unit="kg/kg" />
+        <field id="ovapinit"    long_name="Specific humidity (begin of timestep)"    unit="kg/kg" />
+        <field id="oliq"    long_name="Liquid water"    unit="kg/kg" />
+	<field id="ocond"    long_name="Condensed water"    unit="kg/kg" />
+	<field id="qbs"    long_name="specific content of blowing snow"    unit="kg/kg" />
+        <field id="geop"    long_name="Geopotential height"    unit="m2/s2" />
+        <field id="geoph" field_ref="geop" long_name="Geopotential height" unit="m" > geop/9.80665 </field>
+        <field id="vitu"    long_name="Zonal wind"    unit="m/s" />
+        <field id="vitv"    long_name="Meridional wind"    unit="m/s" />
+        <field id="vitw"    long_name="Vertical wind"    unit="Pa/s" />
+        <field id="pres"    long_name="Air pressure"    unit="Pa" />
+        <field id="paprs"    long_name="Air pressure Inter-Couches"    unit="Pa" />
+        <field id="mass"    long_name="Masse Couches"    unit="kg/m2" />
+        <field id="zfull"    long_name="Altitude of full pressure levels"    unit="m" />
+        <field id="zhalf"    long_name="Altitude of half pressure levels"    unit="m" />
+        <field id="rneb"    long_name="Cloud fraction"    unit="-" />
+        <field id="rnebcon"    long_name="Convective Cloud Fraction"    unit="-" />
+        <field id="rnebls"    long_name="LS Cloud fraction"    unit="-" />
+	<field id="rneblsvol" long_name="LS Cloud fraction by volume"    unit="-" />
+        <field id="pfraclr" long_name="LS precip fraction clear-sky part"    unit="-" />		
+        <field id="pfracld" long_name="LS precip fraction cloudy part"    unit="-" />   
+        <field id="rhum"    long_name="Relative humidity"    unit="-" />
+	<field id="rhl" long_name="Relative humidity wrt liquid" unit="%" />
+	<field id="rhi" long_name="Relative humidity wrt ice" unit="%" />
+        <field id="ozone"    long_name="Ozone mole fraction"    unit="-" />
+        <field id="ozone_daylight"    long_name="Daylight ozone mole fraction"    unit="-" />
+        <field id="upwd"    long_name="saturated updraft"    unit="kg/m2/s" />
+        <field id="ep"    long_name="ep"    unit="su" />
+        <field id="duphy"    long_name="Physics du"    unit="K/s" />
+        <field id="dtphy"    long_name="Physics dT"    unit="K/s" />
+        <field id="dqphy"    long_name="Physics dQ"    unit="(kg/kg)/s" />
+        <field id="dqlphy"   long_name="Physics dQL"    unit="(kg/kg)/s" />
+	<field id="dqsphy"   long_name="Physics dQS"    unit="(kg/kg)/s" />
+	<field id="dqbsphy"   long_name="Physics dQBS"    unit="(kg/kg)/s" />
+        <field id="pr_con_l"    long_name="Convective precipitation lic"    unit="-" />
+        <field id="pr_con_i"    long_name="Convective precipitation ice"    unit="-" />
+        <field id="pr_lsc_l"    long_name="Large scale precipitation lic"    unit="-" />
+	<field id="pr_lsc_i"    long_name="Large scale precipitation ice"    unit="-" />
+	<field id="pr_bs"    long_name="precipitation blowing snow"    unit="-" />
+        <field id="re"    long_name="Cloud droplet effective radius"    unit="um" />
+        <field id="fl"    long_name="Denominator of Cloud droplet effective radius"    unit="-" />
+        <field id="scdnc"    long_name="Cloud droplet number concentration"    unit="m-3" />
+        <field id="reffclws"    long_name="Stratiform Cloud Droplet Effective Radius (aerosol diags.)"    unit="m" />
+        <field id="reffclwc"    long_name="Convective Cloud Droplet Effective Radius (aerosol diags.)"    unit="m" />
+        <field id="lcc3d"    long_name="Cloud liquid fraction"    unit="1" />
+        <field id="lcc3dcon"    long_name="Convective cloud liquid fraction"    unit="1" />
+        <field id="lcc3dstra"    long_name="Stratiform cloud liquid fraction"    unit="1" />
+        <field id="cldwatmxrat"    long_name="Cloud Water Mixing Ratio"    unit="1" />
+        <field id="icc3dcon"    long_name="Mass Fraction of Convective Cloud Ice"    unit="kg/kg" />
+        <field id="icc3dstra"    long_name="Mass Fraction of Stratiform Cloud Ice "    unit="kg/kg" />
+        <field id="cldicemxrat"    long_name="Cloud Ice Mixing Ratio"    unit="1" />
+        <field id="clwcon"    long_name="Convective Cloud Liquid water content"    unit="kg/kg" />
+        <field id="Mipsh"    long_name="mass flux shed from adiab. ascents"    unit="kg/m2/s" />
+        <field id="Ma"    long_name="undilute adiab updraft"    unit="kg/m2/s" />
+        <field id="dnwd"    long_name="saturated downdraft"    unit="kg/m2/s" />
+        <field id="dnwd0"    long_name="unsat. downdraft"    unit="kg/m2/s" />
+        <field id="mc"    long_name="Convective mass flux"    unit="kg/m2/s" />
+        <field id="dtdyn"    long_name="Dynamics dT"    unit="K/s" />
+        <field id="dqdyn"    long_name="Dynamics dQ"    unit="(kg/kg)/s" />
+        <field id="dqldyn"    long_name="Dynamics dQL"    unit="(kg/kg)/s" />
+        <field id="dqsdyn"    long_name="Dynamics dQS"    unit="(kg/kg)/s" />
+        <field id="dqbsdyn"    long_name="Dynamics dQBS"    unit="(kg/kg)/s" />       
+	<field id="dudyn"    long_name="Dynamics dU"    unit="m/s2" />
+        <field id="dvdyn"    long_name="Dynamics dV"    unit="m/s2" />
+        <field id="dtcon"    long_name="Convection dT"    unit="K/s" />
+        <field id="ducon"    long_name="Convection du"    unit="m/s2" />
+        <field id="dvcon"    long_name="Convection dv"    unit="m/s2" />
+        <field id="dqcon"    long_name="Convection dQ"    unit="(kg/kg)/s" />
+        <field id="dtwak"    long_name="Wake dT"    unit="K/s" />
+        <field id="dqwak"    long_name="Wake dQ"    unit="(kg/kg)/s" />
+        <field id="wake_deltat"    long_name="wake_deltat"    unit="-" />
+        <field id="wake_deltaq"    long_name="wake_deltaq"    unit="-" />
+        <field id="wake_omg"    long_name="wake_omg"    unit="-" />
+        <field id="wdtrainA"    long_name="precipitation from AA"    unit="-" />
+        <field id="wdtrainS"    long_name="precipitation from shedding of AA"    unit="-" />
+        <field id="wdtrainM"    long_name="precipitation from mixture"    unit="-" />
+        <field id="qtaa"    long_name="specific total water in adiabatic ascents"    unit="kg/kg" /> 
+        <field id="Clwaa"   long_name="specific condensed water in adiabatic ascents"    unit="kg/kg" />
+        <field id="ftd"    long_name="tend temp due aux descentes precip"    unit="-" />
+        <field id="fqd"    long_name="tend vap eau due aux descentes precip"    unit="-" />
+        <field id="dtlsc"    long_name="Condensation dT"    unit="K/s" />
+        <field id="dtlschr"    long_name="Large-scale condensational heating rate"    unit="K/s" />
+        <field id="dqlsc"    long_name="Condensation dQ"    unit="(kg/kg)/s" />
+        <field id="beta_prec"    long_name="LS Conversion rate to prec"    unit="(kg/kg)/s" />
+        <field id="dtvdf"    long_name="Boundary-layer dT"    unit="K/s" />
+        <field id="dtvdf_x"  long_name="dtvdf off_wake"    unit="K/s" />
+        <field id="dtvdf_w"  long_name="dtvdf within_wake"    unit="K/s" />
+        <field id="dtdis"    long_name="TKE dissipation dT"    unit="K/s" />
+        <field id="dqvdf"    long_name="Boundary-layer dQ"    unit="(kg/kg)/s" />
+        <field id="dqvdf_x" long_name="dqvdf off_wake" unit="(kg/kg)/s" />
+        <field id="dqvdf_w" long_name="dqvdf within_wake" unit="(kg/kg)/s" />
+        <field id="dteva"    long_name="Reevaporation dT"    unit="K/s" />
+	<field id="dqeva"    long_name="Reevaporation dQ"    unit="(kg/kg)/s" />
+        <field id="dqbsvdf"    long_name="Boundary-layer dQBS"    unit="(kg/kg)/s" />
+        <field id="dqbsbs"    long_name="Blowing snow dQBS"    unit="(kg/kg)/s" />
+        <field id="dqbs"    long_name="Blowing snow dQ"    unit="(kg/kg)/s" />
+        <field id="dtbs"    long_name="Blowing snow dT"    unit="(K)/s" />
+        <field id="dqlscth"    long_name="dQ therm."    unit="(kg/kg)/s" />
+        <field id="dqlscst"    long_name="dQ strat."    unit="(kg/kg)/s" />
+        <field id="dtlscth"    long_name="dQ therm."    unit="K/s" />
+        <field id="dtlscst"    long_name="dQ strat."    unit="K/s" />
+        <field id="ptconvth"    long_name="POINTS CONVECTIFS therm."    unit="-" />
+        <field id="ptconv"    long_name="POINTS CONVECTIFS"    unit="-" />
+        <field id="ratqs"    long_name="RATQS"    unit="-" />
+        <field id="dtthe"    long_name="Thermal dT"    unit="K/s" />
+        <field id="duthe"    long_name="Thermal du"    unit="m/s2" />
+        <field id="dvthe"    long_name="Thermal dv"    unit="m/s2" />
+        <field id="e_th"    long_name="Thermal plume entrainment"    unit="K/s" />
+        <field id="lambda_th"    long_name="Thermal plume vertical velocity"    unit="m/s" />
+        <field id="q_th"    long_name="Thermal plume total humidity"    unit="kg/kg" />
+        <field id="s_th"    long_name="Thermal plume saturation deficit"    unit="kg/kg" />
+        <field id="s_env"    long_name="Environment saturation deficit"    unit="kg/kg" />
+        <field id="sigma_th"    long_name="Thermal plume gauss variance"    unit="kg/kg" />
+        <field id="sigma_env"    long_name="Environment gauss variance"    unit="kg/kg" />
+        <field id="d_th"    long_name="Thermal plume detrainment"    unit="K/s" />
+        <field id="dqthe"    long_name="Thermal dQ"    unit="(kg/kg)/s" />
+        <field id="dtajs"    long_name="Dry adjust. dT"    unit="K/s" />
+        <field id="dqajs"    long_name="Dry adjust. dQ"    unit="(kg/kg)/s" />
+        <field id="dtswr"    long_name="SW radiation dT"    unit="K/s" />
+        <field id="dtsw0"    long_name="CS SW radiation dT"    unit="K/s" />
+        <field id="dtlwr"    long_name="LW radiation dT"    unit="K/s" />
+        <field id="dtlw0"    long_name="CS LW radiation dT"    unit="K/s" />
+        <field id="dtec"    long_name="Cinetic dissip dT"    unit="K/s" />
+        <field id="duvdf"    long_name="Boundary-layer dU"    unit="m/s2" />
+        <field id="dvvdf"    long_name="Boundary-layer dV"    unit="m/s2" />
+        <field id="duoro"    long_name="Orography dU"    unit="m/s2" />
+        <field id="dvoro"    long_name="Orography dV"    unit="m/s2" />
+        <field id="dulif"    long_name="Orography dU"    unit="m/s2" />
+        <field id="dvlif"    long_name="Orography dV"    unit="m/s2" />
+        <field id="du_gwd_rando"    long_name="peu importe"    unit="W/m2" />
+        <field id="dv_gwd_rando"    long_name="peu importe"    unit="W/m2" />
+        <field id="du_gwd_hines" long_name="Hines GWD dU" unit="m/s2" />
+        <field id="dv_gwd_hines" long_name="Hines GWD dV" unit="m/s2" />
+        <field id="du_gwd_front" long_name="Fronts GWD dU" unit="m/s2" />
+        <field id="dv_gwd_front" long_name="Fronts GWD dV" unit="m/s2" />
+        <field id="east_gwstress" long_name="Eastward GW Stress" unit="Pa" />
+        <field id="west_gwstress" long_name="Westward GW Stress" unit="Pa" />
+        <field id="dtoro"    long_name="Orography dT"    unit="K/s" />
+        <field id="dtlif"    long_name="Orography dT"    unit="K/s" />
+        <field id="dthin"    long_name="Hines GWD dT"    unit="K/s" />
+        <field id="tnt"    long_name="Tendency of air temperature"    unit="K s-1" />
+        <field id="tntc"    long_name="Tendency of air temperature due to Moist Convection"    unit="K s-1" />
+        <field id="tntr"    long_name="Air temperature tendency due to Radiative heating"    unit="K s-1" />
+        <field id="tntscpbl"    long_name="Air temperature tendency due to St cloud and precipitation and BL mixing"    unit="K s-1" />
+        <field id="tnhus"    long_name="Tendency of specific humidity"    unit="s-1" />
+        <field id="tnhusc"    long_name="Tendency of specific humidity due to convection"    unit="s-1" />
+        <field id="tnhusscpbl"    long_name="Tendency of Specific humidity due to ST cl, precip and BL mixing"    unit="s-1" />
+        <field id="h2o"    long_name="Mass Fraction of Water"    unit="1" />
+        <field id="mcd"    long_name="Downdraft COnvective Mass Flux"    unit="kg/(m2*s)" />
+        <field id="dmc"    long_name="Deep COnvective Mass Flux"    unit="kg/(m2*s)" />
+        <field id="ref_liq"    long_name="Effective radius of convective cloud liquid water particle"    unit="m" />
+        <field id="ref_ice"    long_name="Effective radius of startiform cloud ice particle"    unit="m" />
+        <field id="stratomask"    long_name="Stratospheric fraction"    unit="-" />
+        <field id="heat_volc"    long_name="SW heating rate from volcano"    unit="K/s" />
+        <field id="cool_volc"    long_name="LW cooling rate from volcano"    unit="K/s" />
+	    <field id="dqch4"        long_name="H2O due to CH4 oxidation and photolysis" unit="(kg/kg)/s" />
+        <field id="pvap"    long_name="pvap intermediary variable" unit="-">pres*ovap*461.5 / (287.04*(1.+ (10.9491/18.0153)*ovap)) </field>
+        <field id="oclr"    long_name="Clear sky total water"    unit="kg/kg" />
+        <field id="ocld"    long_name="Cloudy sky total water"   unit="kg/kg" />
+        <field id="oss"     long_name="ISSR total water"    unit="kg/kg" />
+        <field id="ovc"     long_name="In-cloud vapor"    unit="kg/kg" />
+        <field id="rnebclr"    long_name="Clear sky fraction"    unit="-" />
+        <field id="rnebss"     long_name="ISSR fraction"     unit="-" />
+        <field id="rnebseri"   long_name="Cloud fraction"    unit="-" />
+        <field id="gammass"    long_name="Supersaturation ratio"    unit="-" />
+        <field id="N1ss"       long_name="N1ss"    unit="-" />
+        <field id="N2ss"       long_name="N2ss"    unit="-" />
+        <field id="drnebsub"   long_name="Cloud fraction change because of sublimation"    unit="s-1" />
+        <field id="drnebcon"   long_name="Cloud fraction change because of condensation"   unit="s-1" />
+        <field id="drnebtur"   long_name="Cloud fraction change because of turbulence"     unit="s-1" />
+        <field id="drnebavi"   long_name="Cloud fraction change because of aviation"       unit="s-1" />
+        <field id="qsatl"      long_name="Saturation with respect to liquid water"    unit="-" />
+        <field id="qsats"      long_name="Saturation with respect to liquid ice"      unit="-" />
+        <field id="flightm"    long_name="Aviation meters flown"      unit="m/s" />
+        <field id="flighth2o"  long_name="Aviation H2O emitted"       unit="kg H2O/s" />
+        <field id="fcontrP"    long_name="Gridbox fraction with potential persistent contrails"     unit="-" />
+        <field id="fcontrN"    long_name="Gridbox fraction with potential non-persistent contrails"     unit="-" />
+        <field id="qcontr"     long_name="Contrail qcontr"     unit="Pa" />
+        <field id="qcontr2"     long_name="Contrail qcontr2"     unit="kg/kg" />
+        <field id="Tcontr"     long_name="Contrail Tcontr"     unit="K" />
+	    <field id="fluxt"     long_name="flux h"     unit="W/m2" />
+        <field id="fluxq"     long_name="flux q"     unit="-" />
+             <!-- Begin Added SN isotopes 3D fields 07 2023 -->
+             <!-- water oxygen H216O H217O H218O -->
+        <field id="ovapH216O"   long_name="Specific humidity" unit="kg/kg" />
+        <field id="oliqH216O"   long_name="Liquid water"      unit="kg/kg" />
+        <field id="ocondH216O"  long_name="Condensed water"   unit="kg/kg" />
+        <field id="dqdynH216O"  long_name="Dynamics dQ"       unit="(kg/kg)/s" />
+        <field id="dqldynH216O" long_name="Dynamics dQL"      unit="(kg/kg)/s" />
+        <field id="dqconH216O"  long_name="Convection dQ"     unit="(kg/kg)/s" />
+        <field id="dqlscH216O"  long_name="Condensation dQ"   unit="(kg/kg)/s" />
+        <field id="dqevaH216O"  long_name="Reevaporation dQ"  unit="(kg/kg)/s" />
+        <field id="dqvdfH216O"  long_name="Boundary-layer dQ" unit="(kg/kg)/s" />
+        <field id="dqajsH216O"  long_name="Dry adjust. dQ"    unit="(kg/kg)/s" />
+        <field id="dqtheH216O"  long_name="Thermal dQ"        unit="(kg/kg)/s" />
+        <field id="ovapH217O"   long_name="Specific humidity" unit="kg/kg" />
+        <field id="oliqH217O"   long_name="Liquid water"      unit="kg/kg" />
+        <field id="ocondH217O"  long_name="Condensed water"   unit="kg/kg" />
+        <field id="dqdynH217O"  long_name="Dynamics dQ"       unit="(kg/kg)/s" />
+        <field id="dqldynH217O" long_name="Dynamics dQL"      unit="(kg/kg)/s" />
+        <field id="dqconH217O"  long_name="Convection dQ"     unit="(kg/kg)/s" />
+        <field id="dqlscH217O"  long_name="Condensation dQ"   unit="(kg/kg)/s" />
+        <field id="dqevaH217O"  long_name="Reevaporation dQ"  unit="(kg/kg)/s" />
+        <field id="dqvdfH217O"  long_name="Boundary-layer dQ" unit="(kg/kg)/s" />
+        <field id="dqajsH217O"  long_name="Dry adjust. dQ"    unit="(kg/kg)/s" />
+        <field id="dqtheH217O"  long_name="Thermal dQ"        unit="(kg/kg)/s" />
+        <field id="ovapH218O"   long_name="Specific humidity" unit="kg/kg" />
+        <field id="oliqH218O"   long_name="Liquid water"      unit="kg/kg" />
+        <field id="ocondH218O"  long_name="Condensed water"   unit="kg/kg" />
+        <field id="dqdynH218O"  long_name="Dynamics dQ"       unit="(kg/kg)/s" />
+        <field id="dqldynH218O" long_name="Dynamics dQL"      unit="(kg/kg)/s" />
+        <field id="dqconH218O"  long_name="Convection dQ"     unit="(kg/kg)/s" />
+        <field id="dqlscH218O"  long_name="Condensation dQ"   unit="(kg/kg)/s" />
+        <field id="dqevaH218O"  long_name="Reevaporation dQ"  unit="(kg/kg)/s" />
+        <field id="dqvdfH218O"  long_name="Boundary-layer dQ" unit="(kg/kg)/s" />
+        <field id="dqajsH218O"  long_name="Dry adjust. dQ"    unit="(kg/kg)/s" />
+        <field id="dqtheH218O"  long_name="Thermal dQ"        unit="(kg/kg)/s" />
+            <!-- water hydrogen HDO HTO -->
+        <field id="ovapHDO"   long_name="Specific humidity" unit="kg/kg" />
+        <field id="oliqHDO"   long_name="Liquid water"      unit="kg/kg" />
+        <field id="ocondHDO"  long_name="Condensed water"   unit="kg/kg" />
+        <field id="dqdynHDO"  long_name="Dynamics dQ"       unit="(kg/kg)/s" />
+        <field id="dqldynHDO" long_name="Dynamics dQL"      unit="(kg/kg)/s" />
+        <field id="dqconHDO"  long_name="Convection dQ"     unit="(kg/kg)/s" />
+        <field id="dqlscHDO"  long_name="Condensation dQ"   unit="(kg/kg)/s" />
+        <field id="dqevaHDO"  long_name="Reevaporation dQ"  unit="(kg/kg)/s" />
+        <field id="dqvdfHDO"  long_name="Boundary-layer dQ" unit="(kg/kg)/s" />
+        <field id="dqajsHDO"  long_name="Dry adjust. dQ"    unit="(kg/kg)/s" />
+        <field id="dqtheHDO"  long_name="Thermal dQ"        unit="(kg/kg)/s" />
+        <field id="ovapHTO"   long_name="Specific humidity" unit="kg/kg" />
+        <field id="oliqHTO"   long_name="Liquid water"      unit="kg/kg" />
+        <field id="ocondHTO"  long_name="Condensed water"   unit="kg/kg" />
+        <field id="dqdynHTO"  long_name="Dynamics dQ"       unit="(kg/kg)/s" />
+        <field id="dqldynHTO" long_name="Dynamics dQL"      unit="(kg/kg)/s" />
+        <field id="dqconHTO"  long_name="Convection dQ"     unit="(kg/kg)/s" />
+        <field id="dqlscHTO"  long_name="Condensation dQ"   unit="(kg/kg)/s" />
+        <field id="dqevaHTO"  long_name="Reevaporation dQ"  unit="(kg/kg)/s" />
+        <field id="dqvdfHTO"  long_name="Boundary-layer dQ" unit="(kg/kg)/s" />
+        <field id="dqajsHTO"  long_name="Dry adjust. dQ"    unit="(kg/kg)/s" />
+        <field id="dqtheHTO"  long_name="Thermal dQ"        unit="(kg/kg)/s" />
+             <!-- End Added SN isotopes 3D fields 07 2023 -->
+    </field_group>
+
+    <field_group id="fields_3Dkp1" grid_ref="grid_glo_presinter" >
+        <field id="a_th"    long_name="Thermal plume fraction"    unit="-" />
+        <field id="f_th"    long_name="Thermal plume mass flux"    unit="kg/(m2*s)" />
+        <field id="w_th"    long_name="Thermal plume vertical velocity"    unit="m/s" />
+        <field id="rsucs"    long_name="SW CS upward radiation"    unit="W m-2" />
+        <field id="rsdcs"    long_name="SW CS downward radiation"    unit="W m-2" />
+        <field id="rlucs"    long_name="LW CS upward radiation"    unit="W m-2" />
+        <field id="rldcs4co2"    long_name="Downwelling CS LW 4xCO2 atmosphere"    unit="W/m2" />
+        <field id="rlucs4co2"    long_name="Upwelling CS LW 4xCO2 atmosphere"    unit="W/m2" />
+        <field id="rsdcs4co2"    long_name="Downwelling CS SW 4xCO2 atmosphere"    unit="W/m2" />
+        <field id="rsucs4co2"    long_name="Upwelling CS SW 4xCO2 atmosphere"    unit="W/m2" />
+        <field id="rld4co2"    long_name="Downwelling LW 4xCO2 atmosphere"    unit="W/m2" />
+        <field id="rsd4co2"    long_name="Downwelling SW 4xCO2 atmosphere"    unit="W/m2" />
+        <field id="rlu4co2"    long_name="Upwelling LW 4xCO2 atmosphere"    unit="W/m2" />
+        <field id="rsu4co2"    long_name="Upwelling SW 4xCO2 atmosphere"    unit="W/m2" />
+        <field id="rsdcsaf"  long_name="SW clean (no aerosol) CS downward radiation"    unit="W m-2" />
+        <field id="rsucsaf"  long_name="SW clean (no aerosol) CS upward radiation"    unit="W m-2" />
+        <field id="Vprecip"    long_name="precipitation vertical profile"    unit="-" />
+        <field id="kz_max"    long_name="Kz melange max"    unit="m2/s" enabled="FALSE" operation="maximum" />
+        <field id="rldcs"    long_name="LW CS downward radiation"    unit="W m-2" />
+        <field id="rsu"    long_name="SW upward radiation"    unit="W m-2" />
+        <field id="rsd"    long_name="SW downward radiation"    unit="W m-2" />
+        <field id="rlu"    long_name="LW upward radiation"    unit="W m-2" />
+        <field id="rld"    long_name="LW downward radiation"    unit="W m-2" />
+        <field id="kz"    long_name="Kz melange"    unit="m2/s" enabled="FALSE" />
+        <field id="evu"    long_name="Eddy viscosity coefficient for Momentum Variables"    unit="m2 s-1" />
+    </field_group>
+    
+    <field_group id="fields_strataer_trac_3D" grid_ref="grid_glo_presnivs" operation="average"/>
+    <field_group id="fields_strataer_trac_2D" grid_ref="grid_glo" operation="average"/>
+
+    <field_group id="fields_strataer_3D" grid_ref="grid_glo_presnivs" operation="average" >
+        <field id="ext_strat_550"        long_name="Strat. aerosol extinction coefficient at 550 nm"       unit="1/m" />
+        <field id="ext_strat_1020"       long_name="Strat. aerosol extinction coefficient at 1020 nm"      unit="1/m" />
+        <field id="budg_3D_nucl"         long_name="H2SO4 nucleation mass flux"                            unit="kg(S)/m2/layer/s" />
+        <field id="budg_3D_cond_evap"    long_name="H2SO4 net condensation/evaporation mass flux"          unit="kg(S)/m2/layer/s" />
+        <field id="budg_3D_ocs_to_so2"   long_name="OCS mass flux converted to SO2"                        unit="kg(S)/m2/layer/s" />
+        <field id="budg_3D_so2_to_h2so4" long_name="SO2 mass flux converted to H2SO4"                      unit="kg(S)/m2/layer/s" />
+        <field id="budg_3D_backgr_ocs"   long_name="OCS background tendency"                               unit="kg(S)/m2/layer/s" />
+        <field id="budg_3D_backgr_so2"   long_name="SO2 background tendency"                               unit="kg(S)/m2/layer/s" />
+        <field id="R2SO4"                long_name="H2SO4 mass fraction in aerosol"                        unit="%" />
+        <field id="OCS_lifetime"         long_name="OCS lifetime"                                          unit="s" />
+        <field id="SO2_lifetime"         long_name="SO2 lifetime"                                          unit="s" />
+        <field id="vsed_aer"             long_name="Strat. aerosol sedimentation velocity (mass-weighted)" unit="m/s" />
+        <field id="f_r_wet"              long_name="Conversion factor dry to wet aerosol radius"           unit="-" />
+	
+	<field id="BIN01" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN02" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN03" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN04" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN05" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN06" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN07" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN08" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN09" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN10" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN11" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN12" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN13" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN14" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN15" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN16" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN17" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN18" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN19" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN20" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN21" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN22" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN23" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN24" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN25" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN26" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN27" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN28" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN29" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN30" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN31" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN32" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN33" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN34" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN35" long_name="Sulfur aersol bin" unit="kg kg-1" />
+        <field id="BIN36" long_name="Sulfur aersol bin" unit="kg kg-1" />
+	<field id="GASOCS"  long_name="Carbonyl sulfide gas" unit="kg kg-1" />
+	<field id="GASSO2"  long_name="Sulfur dioxide gas" unit="kg kg-1" />
+	<field id="GASH2SO4"  long_name="Sulfuric acid gas" unit="kg kg-1" />
+    </field_group>
+
+    <field_group id="fields_strataer_2D" grid_ref="grid_glo" operation="average">
+        <field id="OD550_strat_only"   long_name="Stratospheric Aerosol Optical depth at 550 nm "        unit="1" />
+        <field id="OD1020_strat_only"  long_name="Stratospheric Aerosol Optical depth at 1020 nm "       unit="1" />
+        <field id="surf_PM25_sulf"     long_name="Sulfate PM2.5 concentration at the surface"            unit="ug/m3" />
+        <field id="budg_dep_dry_ocs"   long_name="OCS dry deposition flux"                               unit="kg(S)/m2/s" />
+        <field id="budg_dep_wet_ocs"   long_name="OCS wet deposition flux"                               unit="kg(S)/m2/s" />
+        <field id="budg_dep_dry_so2"   long_name="SO2 dry deposition flux"                               unit="kg(S)/m2/s" />
+        <field id="budg_dep_wet_so2"   long_name="SO2 wet deposition flux"                               unit="kg(S)/m2/s" />
+        <field id="budg_dep_dry_h2so4" long_name="H2SO4 dry deposition flux"                             unit="kg(S)/m2/s" />
+        <field id="budg_dep_wet_h2so4" long_name="H2SO4 wet deposition flux"                             unit="kg(S)/m2/s" />
+        <field id="budg_dep_dry_part"  long_name="Particle S dry deposition flux"                        unit="kg(S)/m2/s" />
+        <field id="budg_dep_wet_part"  long_name="Particle S wet deposition flux"                        unit="kg(S)/m2/s" />
+        <field id="budg_emi_ocs"       long_name="OCS emission flux"                                     unit="kg(S)/m2/s" />
+        <field id="budg_emi_so2"       long_name="SO2 emission flux"                                     unit="kg(S)/m2/s" />
+        <field id="budg_emi_h2so4"     long_name="H2SO4 emission flux"                                   unit="kg(S)/m2/s" />
+        <field id="budg_emi_part"      long_name="Particle S emission flux"                              unit="kg(S)/m2/s" />
+        <field id="budg_ocs_to_so2"    long_name="OCS to SO2 conversion flux"                            unit="kg(S)/m2/s" />
+        <field id="budg_so2_to_h2so4"  long_name="SO2 to H2SO4 conversion flux"                          unit="kg(S)/m2/s" />
+        <field id="budg_h2so4_to_part" long_name="H2SO4 to particle conversion flux"                     unit="kg(S)/m2/s" />
+        <field id="budg_sed_part"      long_name="Ground sedimentation flux of strat. particles"         unit="kg(S)/m2/s" />
+    </field_group>
+    
+    <field_group  id="fields_NMC" grid_ref="grid_glo_plev" >
+<!--  <field id="tnondef" long_name="Undefined value of T" unit="K" detect_missing_value=".true." /> -->
+      <field id="ta" long_name="Air temperature" unit="K" detect_missing_value=".true." />
+      <field id="zg" long_name="Geopotential height" unit="m" detect_missing_value=".true." />
+      <field id="hus" long_name="Specific humidity" unit="1" detect_missing_value=".true." />
+      <field id="hur" long_name="Relative humidity" unit="%" detect_missing_value=".true." />
+      <field id="ua" long_name="Eastward wind" unit="m s-1" detect_missing_value=".true." />
+      <field id="va" long_name="Northward wind" unit="m s-1" detect_missing_value=".true." />
+      <field id="wap" long_name="Lagrangian tendency of air pressure" unit="Pa s-1" detect_missing_value=".true." />
+<!--  <field id="psbg" long_name="Pressure sfce below ground" unit="%" detect_missing_value=".true." /> -->
+      <field id="tro3" long_name="Ozone mole fraction" unit="1e-9" detect_missing_value=".true." />
+      <field id="tro3_daylight" long_name="Daylight ozone mole fraction" unit="1e-9" detect_missing_value=".true." />
+      <field id="uv" long_name="uv" unit="m2/s2" detect_missing_value=".true." />
+      <field id="vxq" long_name="vxq" unit="m/s * (kg/kg)" detect_missing_value=".true." />
+      <field id="vT" long_name="vT" unit="mK/s" detect_missing_value=".true." />
+      <field id="wq" long_name="wq" unit="(Pa/s)*(kg/kg)" detect_missing_value=".true." />
+      <field id="vphi" long_name="vphi" unit="m2/s" detect_missing_value=".true." />
+      <field id="wT" long_name="wT" unit="K*Pa/s" detect_missing_value=".true." />
+      <field id="u2" long_name="u2" unit="m2/s2" detect_missing_value=".true." />
+      <field id="v2" long_name="v2" unit="m2/s2" detect_missing_value=".true." />
+      <field id="T2" long_name="T2" unit="K2" detect_missing_value=".true." />
+    </field_group>
+
+
+
+    <field_group id="fields_phystokenc_3D" domain_ref="dom_glo" axis_ref="klev"   >
+      <field id="t_stok"         long_name="Temperature" unit="K" />
+      <field id="coefh_stok"     long_name="coeff de melange dans la couche limite" unit="-" />
+      <field id="fm_th_stok"     long_name="Mass flux thermals" unit="kg m-2.s-1" />
+      <field id="en_th_stok"     long_name="Thermal plume entrainment" unit="kg m-1.s-1" />
+      <field id="da_stok"        long_name="adiabatic ascen" unit="kg m-2.s-1" />
+      <field id="mp_stok"        long_name="precipitating downdraft mass flux under hydrostatic approximation" unit="kg m-2.s-1" />
+      <field id="wght_stok"      long_name="weights of the layers feeding convection" unit="-" />
+      <field id="upwd_stok"      long_name="saturated updraft mass flux" unit="kg m-2.s-1" />
+      <field id="dnwd_stok"      long_name="saturated downdraft mass flux" unit="kg m-2.s-1" />
+    </field_group>
+    
+    <field_group id="philev_grp" long_name="mass flow environmental mixing" unit="kg m-2 s-1" domain_ref="dom_glo" axis_ref="klev" operation="average"/>
+
+    <field_group id="fields_phystokenc_2D" grid_ref="grid_glo" >
+      <field id="yu1_stok"       long_name="zonal surface wind" unit="m.s-1" />
+      <field id="yv1_stok"       long_name="wind meridian surface" unit="m.s-1" />
+    </field_group>
+
+
+    
+    <field_group id="fields_trac_2D" grid_ref="grid_glo" >
+          <field id="cumRN"    long_name="Cumulated tracer  RNVL1"    unit="-" />
+          <field id="cumPB"    long_name="Cumulated tracer  PBVL1"    unit="-" />
+          <field id="cumAga"   long_name="Cumulated tracer  Aga"    unit="-" />
+          <field id="cumCO2"   long_name="Cumulated tracer  CO2"    unit="-" />
+          <field id="cumdRN_dry"  long_name="Surface dry deposition tracer  RNVL1"  unit="- s-1" />
+          <field id="cumdPB_dry"  long_name="Surface dry deposition tracer  PBVL1"  unit="- s-1" />
+          <field id="cumdAga_dry" long_name="Surface dry deposition tracer  Aga"    unit="- s-1" />
+          <field id="cumdCO2_dry" long_name="Surface dry deposition tracer  CO2"    unit="- s-1" />
+    </field_group>
+
+    <field_group id="fields_trac_3D" grid_ref="grid_glo_presnivs" >
+      <field id="RN"    long_name="Tracer RNVL1"    unit="-" />
+      <field id="dRN_vdf"    long_name="Tendance tracer RNVL1"    unit="-" />
+      <field id="dRN_the"    long_name="Tendance tracer  RNVL1"    unit="-" />
+      <field id="dRN_con"    long_name="Tendance tracer  RNVL1"    unit="-" />
+      <field id="dRN_lessi_impa"    long_name="Tendance tracer  RNVL1"    unit="-" />
+      <field id="dRN_lessi_nucl"    long_name="Tendance tracer  RNVL1"    unit="-" />
+      <field id="dRN_insc"    long_name="Tendance tracer  RNVL1"    unit="-" />
+      <field id="dRN_bcscav"    long_name="Tendance tracer  RNVL1"    unit="-" />
+      <field id="dRN_evapls"    long_name="Tendance tracer  RNVL1"    unit="-" />
+      <field id="dRN_ls"    long_name="Tendance tracer  RNVL1"    unit="-" />
+      <field id="dRN_trsp"    long_name="Tendance tracer  RNVL1"    unit="-" />
+      <field id="dRN_sscav"    long_name="Tendance tracer  RNVL1"    unit="-" />
+      <field id="dRN_sat"    long_name="Tendance tracer  RNVL1"    unit="-" />
+      <field id="dRN_uscav"    long_name="Tendance tracer  RNVL1"    unit="-" />
+      <field id="PB"    long_name="Tracer PBVL1"    unit="-" />
+      <field id="dPB_vdf"    long_name="Tendance tracer PBVL1"    unit="-" />
+      <field id="dPB_the"    long_name="Tendance tracer  PBVL1"    unit="-" />
+      <field id="dPB_con"    long_name="Tendance tracer  PBVL1"    unit="-" />
+      <field id="dPB_lessi_impa"    long_name="Tendance tracer  PBVL1"    unit="-" />
+      <field id="dPB_lessi_nucl"    long_name="Tendance tracer  PBVL1"    unit="-" />
+      <field id="dPB_insc"    long_name="Tendance tracer  PBVL1"    unit="-" />
+      <field id="dPB_bcscav"    long_name="Tendance tracer  PBVL1"    unit="-" />
+      <field id="dPB_evapls"    long_name="Tendance tracer  PBVL1"    unit="-" />
+      <field id="dPB_ls"    long_name="Tendance tracer  PBVL1"    unit="-" />
+      <field id="dPB_trsp"    long_name="Tendance tracer  PBVL1"    unit="-" />
+      <field id="dPB_sscav"    long_name="Tendance tracer  PBVL1"    unit="-" />
+      <field id="dPB_sat"    long_name="Tendance tracer  PBVL1"    unit="-" />
+      <field id="dPB_uscav"    long_name="Tendance tracer  PBVL1"    unit="-" />
+      <field id="Aga"    long_name="Tracer AgaVL1"    unit="-" />
+      <field id="dAga_vdf"    long_name="Tendance tracer Aga"    unit="-" />
+      <field id="dAga_the"    long_name="Tendance tracer  Aga"    unit="-" />
+      <field id="dAga_con"    long_name="Tendance tracer  Aga"    unit="-" />
+      <field id="dAga_lessi_impa"    long_name="Tendance tracer  Aga"    unit="-" />
+      <field id="dAga_lessi_nucl"    long_name="Tendance tracer  Aga"    unit="-" />
+      <field id="dAga_insc"    long_name="Tendance tracer  Aga"    unit="-" />
+      <field id="dAga_bcscav"    long_name="Tendance tracer  Aga"    unit="-" />
+      <field id="dAga_evapls"    long_name="Tendance tracer  Aga"    unit="-" />
+      <field id="dAga_ls"    long_name="Tendance tracer  Aga"    unit="-" />
+      <field id="dAga_trsp"    long_name="Tendance tracer  Aga"    unit="-" />
+      <field id="dAga_sscav"    long_name="Tendance tracer  Aga"    unit="-" />
+      <field id="dAga_sat"    long_name="Tendance tracer  Aga"    unit="-" />
+      <field id="dAga_uscav"    long_name="Tendance tracer  Aga"    unit="-" />
+      <field id="CO2"    long_name="Tracer CO2VL1"    unit="-" />
+      <field id="dCO2_vdf"    long_name="Tendance tracer CO2"    unit="-" />
+      <field id="dCO2_the"    long_name="Tendance tracer  CO2"    unit="-" />
+      <field id="dCO2_con"    long_name="Tendance tracer  CO2"    unit="-" />
+    </field_group>
+
+    <field_group id="fields_solbnd_3D" grid_ref="grid_glo_spectband" >
+      <field id="solbnd"    long_name="Top-of-Atmosphere Solar Insolation for each band"    unit="W m-2"  enabled="false" /> <!-- this field is not sent by LMDZ, vertical axis "spectband" is not properly defined -->
+    </field_group>
+
+<!-- ----------------------------COSP------------------------ -->
+    <field_group src="./field_def_cosp1.xml"/>
+    <!-- <field_group src="./field_def_cospv2.xml"/> -->
+
+
+    <field_group id="fields_AIRS" grid_ref="grid_glo" operation="instant" freq_op="3h">
+      <field id="alt_tropo" long_name="Tropopause pressure" unit="hPa" />
+      <field id="map_prop_hc" long_name="Proportion of high clouds" unit=" "/>
+      <field id="map_prop_hist" long_name="Proportion of high ice semi-transp clouds" unit=" "/>
+      <field id="map_emis_hc" long_name="Emissivity of high clouds" unit=" "/>
+      <field id="map_iwp_hc" long_name="Ice water path of high clouds" unit="g/m2"/>
+      <field id="map_deltaz_hc" long_name="geom thickness of high clouds" unit="m"/>
+      <field id="map_pcld_hc" long_name="cloud pressure of high clouds" unit="hPa"/>
+      <field id="map_tcld_hc" long_name="cloud temperature of high clouds" unit="K"/>
+      <field id="map_emis_hist" long_name="Emissivity of high ice st clouds" unit=" "/>
+      <field id="map_iwp_hist" long_name="Ice water path of high ice st clouds" unit="g/m2"/>
+      <field id="map_deltaz_hist" long_name="geom thickness of high ice st clouds" unit="m"/>
+      <field id="map_rad_hist" long_name="ice crystals radius in high ice st clouds" unit="m"/>
+      <field id="map_emis_Cb" long_name="Emissivity of high Cb clouds" unit=" "/>
+      <field id="map_pcld_Cb" long_name="cloud pressure of high Cb clouds" unit="hPa"/>
+      <field id="map_tcld_Cb" long_name="cloud temperature of high Cb clouds" unit="K"/>
+      <field id="map_emis_Anv" long_name="Emissivity of high Anv clouds" unit=" "/>
+      <field id="map_pcld_Anv" long_name="cloud pressure of high Anv clouds" unit="hPa"/>
+      <field id="map_tcld_Anv" long_name="cloud temperature of high Anv clouds" unit="K"/>
+      <field id="map_emis_ThCi" long_name="Emissivity of high ThCi clouds" unit=" "/>
+      <field id="map_pcld_ThCi" long_name="cloud pressure of high ThCi clouds" unit="hPa"/>
+      <field id="map_tcld_ThCi" long_name="cloud temperature of high ThCi clouds" unit="K"/>
+      <field id="map_ntot" long_name="total AIRS cloud fraction" unit=" "/>
+      <field id="map_hc" long_name="high clouds AIRS cloud fraction" unit=" "/>
+      <field id="map_hist" long_name="high clouds ice st AIRS cloud fraction" unit=" "/>
+      <field id="map_Cb" long_name="high clouds Cb AIRS cloud fraction" unit=" "/>
+      <field id="map_ThCi" long_name="high clouds ThCi AIRS cloud fraction" unit=" "/>
+      <field id="map_Anv" long_name="high clouds Anv AIRS cloud fraction" unit=" "/>
+    </field_group>
+
+   <field_group id="field_scalar" operation="instant" grid_ref="grid_scalar">
+      <field id="R_ecc" long_name="R_ecc" unit="-" />
+      <field id="R_peri" long_name="R_peri" unit="-" />
+      <field id="R_incl" long_name="R_incl" unit="deg" />
+      <field id="solaire" long_name="solaire" unit="W/m2" />
+      <field id="rsun1" long_name="Fraction constante solaire bande 1" unit="W/m2" />
+      <field id="rsun2" long_name="Fraction constante solaire bande 2" unit="W/m2" />
+      <field id="rsun3" long_name="Fraction constante solaire bande 3" unit="W/m2" />
+      <field id="rsun4" long_name="Fraction constante solaire bande 4" unit="W/m2" />
+      <field id="rsun5" long_name="Fraction constante solaire bande 5" unit="W/m2" />
+      <field id="rsun6" long_name="Fraction constante solaire bande 6" unit="W/m2" />
+      <field id="co2_ppm" long_name="co2_ppm" unit="ppm" />
+      <field id="CH4_ppb" long_name="CH4_ppb" unit="ppb" />
+      <field id="N2O_ppb" long_name="N2O_ppb" unit="ppb" />
+      <field id="CFC11_ppt" long_name="CFC11_ppt" unit="ppt" />
+      <field id="CFC12_ppt" long_name="CFC12_ppt" unit="ppt" />
+<!-- reducing mass 3D variable to atmosphere total mass scalar -->
+      <field id="mass_sum_axis"    field_ref="mass" grid_ref="grid_sum_axis" freq_op="1mo" > @mass  </field>
+      <field id="mass_sum" field_ref="mass_sum_axis" grid_ref="grid_sum" freq_op="1mo" > @mass_sum_axis*aire  </field>
+   </field_group>
+
+</field_definition>
Index: CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/file_def_histday_lmdz_iso.xml
===================================================================
--- CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/file_def_histday_lmdz_iso.xml	(revision 6746)
+++ CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/file_def_histday_lmdz_iso.xml	(revision 6746)
@@ -0,0 +1,757 @@
+<!-- $Id: file_def_histday_lmdz.xml 4298 2022-10-17 08:15:06Z pcadule $ -->
+<file_definition type="one_file">
+    <file_group id="defile">
+        <file id="histday" name="histday" output_freq="1d" output_level="_AUTO_" enabled="_AUTO_" compression_level="0" sync_freq="1d">
+            
+            <!-- VARS 1D -->
+<!--            <field_group operation="once">  -->
+<!--              <field field_ref="Ap" level="1" />  -->
+<!--              <field field_ref="Bp" level="1" /> -->
+<!--              <field field_ref="Alt" level="1" /> -->
+<!--            </field_group> -->
+        
+            <!-- VARS 2D -->
+           <field_group group_ref="remap_1d">
+           
+              <field_group operation="average" grid_ref="grid_out" >
+                <field field_ref="phis" level="1" />
+                <field field_ref="aire" level="1" operation="once" />
+                <field field_ref="contfracATM" level="1" operation="once" />
+                <field field_ref="contfracOR" level="1" />
+                <field field_ref="flat" level="1" />
+                <field field_ref="slp" level="1" />
+                <field field_ref="sza" level="1" />
+                <field field_ref="ptstar" level="1" />
+                <field field_ref="pt0" level="1" />
+                <field field_ref="tsol" level="1" />
+                <field field_ref="t2m" level="1" />
+                <field field_ref="t2m_min" level="1" operation="minimum" />
+                <field field_ref="t2m_max" level="1" operation="maximum" />
+                <field field_ref="t2m_ter" level="6" />
+                <field field_ref="t2m_lic" level="6" />
+                <field field_ref="t2m_oce" level="6" />
+                <field field_ref="t2m_sic" level="6" />
+                <field field_ref="gusts" level="1" />
+                <field field_ref="wind10m" level="1" />
+                <field field_ref="wind10max" level="1" operation="maximum" />
+                <field field_ref="sicf" level="1" />
+                <field field_ref="q2m" level="1" />
+                <field field_ref="ustar" level="1" />
+                <field field_ref="u10m" level="1" />
+                <field field_ref="v10m" level="1" />
+                <field field_ref="psol" level="1" />
+                <field field_ref="qsurf" level="10" />
+                <field field_ref="ustar_ter" level="6" />
+                <field field_ref="ustar_lic" level="6" />
+                <field field_ref="ustar_oce" level="6" />
+                <field field_ref="ustar_sic" level="6" />
+                <field field_ref="wstar_ter" level="6" />
+                <field field_ref="wstar_lic" level="6" />
+                <field field_ref="wstar_oce" level="6" />
+                <field field_ref="wstar_sic" level="6" />
+                <field field_ref="wstar" level="5" />
+                <field field_ref="u10m_ter" level="6" />
+                <field field_ref="u10m_lic" level="6" />
+                <field field_ref="u10m_oce" level="6" />
+                <field field_ref="u10m_sic" level="6" />
+                <field field_ref="v10m_ter" level="6" />
+                <field field_ref="v10m_lic" level="6" />
+                <field field_ref="v10m_oce" level="6" />
+                <field field_ref="v10m_sic" level="6" />
+                <field field_ref="qsol" level="10" />
+                <field field_ref="ndayrain" level="10" operation="instant" />
+                <field field_ref="precip" level="1" />
+                <field field_ref="rain_fall" level="1" />
+                <field field_ref="rain_con" level="1" />
+                <field field_ref="plul" level="1" />
+                <field field_ref="plun" level="1" />
+                <field field_ref="pluc" level="1" />
+                <field field_ref="snow" level="1" />
+                <field field_ref="evap" level="1" />
+                <field field_ref="evap_ter" level="6" />
+                <field field_ref="evap_lic" level="6" />
+                <field field_ref="evap_oce" level="6" />
+                <field field_ref="evap_sic" level="6" />
+                <field field_ref="msnow" level="10" />
+                <field field_ref="fsnow" level="10" />
+                <field field_ref="tops" level="1" />
+                <field field_ref="tops0" level="5" />
+                <field field_ref="topl" level="1" />
+                <field field_ref="topl0" level="5" />
+                <field field_ref="SWupTOA" level="4" />
+                <field field_ref="SWupTOAclr" level="4" />
+                <field field_ref="SWdnTOA" level="4" />
+                <field field_ref="SWdnTOAclr" level="4" />
+                <field field_ref="nettop" level="4" />
+                <field field_ref="SWup200" level="15" />
+                <field field_ref="SWup200clr" level="15" />
+                <field field_ref="SWdn200" level="15" />
+                <field field_ref="SWdn200clr" level="15" />
+                <field field_ref="LWup200" level="15" />
+                <field field_ref="LWup200clr" level="15" />
+                <field field_ref="LWdn200" level="15" />
+                <field field_ref="LWdn200clr" level="15" />
+                <field field_ref="sols" level="1" />
+                <field field_ref="sols0" level="5" />
+                <field field_ref="soll" level="1" />
+                <field field_ref="soll0" level="5" />
+                <field field_ref="radsol" level="7" />
+                <field field_ref="SWupSFC" level="4" />
+                <field field_ref="SWupSFCclr" level="4" />
+                <field field_ref="SWdnSFC" level="1" />
+                <field field_ref="SWdnSFCclr" level="4" />
+                <field field_ref="LWupSFC" level="4" />
+                <field field_ref="LWupSFCclr" level="4" />
+                <field field_ref="LWdnSFC" level="4" />
+                <field field_ref="LWdnSFCclr" level="4" />
+                <field field_ref="bils" level="2" />
+                <field field_ref="bils_tke" level="2" />
+                <field field_ref="bils_diss" level="2" />
+                <field field_ref="bils_ec" level="2" />
+                <field field_ref="bils_kinetic" level="2" />
+                <field field_ref="bils_enthalp" level="2" />
+                <field field_ref="bils_latent" level="2" />
+                <field field_ref="sens" level="1" />
+                <field field_ref="sens_x" level="11" />
+                <field field_ref="sens_w" level="11" />
+                <field field_ref="flat_x" level="11" />
+                <field field_ref="flat_w" level="11" />
+                <field field_ref="delta_tsurf" level="11" />
+                <field field_ref="cdragh_x" level="11" />
+                <field field_ref="cdragh_w" level="11" />
+                <field field_ref="cdragm_x" level="11" />
+                <field field_ref="cdragm_w" level="11" />
+                <field field_ref="kh" level="11" />
+                <field field_ref="kh_x" level="11" />
+                <field field_ref="kh_w" level="11" />
+                <field field_ref="fder" level="2" />
+                <field field_ref="ffonte" level="10" />
+                <field field_ref="fqcalving" level="10" />
+                <field field_ref="fqfonte" level="10" />
+                <field field_ref="mrroli" level="10" />
+                <field field_ref="runofflic" level="10" />
+                <field field_ref="taux" level="10" />
+                <field field_ref="tauy" level="10" />
+                <field field_ref="taux_ter" level="6" />
+                <field field_ref="taux_lic" level="6" />
+                <field field_ref="taux_oce" level="6" />
+                <field field_ref="taux_sic" level="6" />
+                <field field_ref="tauy_ter" level="6" />
+                <field field_ref="tauy_lic" level="6" />
+                <field field_ref="tauy_oce" level="6" />
+                <field field_ref="tauy_sic" level="6" />
+                <field field_ref="pourc_ter" level="7" />
+                <field field_ref="pourc_lic" level="7" />
+                <field field_ref="pourc_oce" level="7" />
+                <field field_ref="pourc_sic" level="7" />
+                <field field_ref="fract_ter" level="6" />
+                <field field_ref="fract_lic" level="6" />
+                <field field_ref="fract_oce" level="6" />
+                <field field_ref="fract_sic" level="6" />
+                <field field_ref="tsol_ter" level="6" />
+                <field field_ref="tsol_lic" level="6" />
+                <field field_ref="tsol_oce" level="6" />
+                <field field_ref="tsol_sic" level="6" />
+                <field field_ref="evappot_ter" level="6" />
+                <field field_ref="evappot_lic" level="6" />
+                <field field_ref="evappot_oce" level="6" />
+                <field field_ref="evappot_sic" level="6" />
+                <field field_ref="sens_ter" level="6" />
+                <field field_ref="sens_lic" level="6" />
+                <field field_ref="sens_oce" level="6" />
+                <field field_ref="sens_sic" level="6" />
+                <field field_ref="lat_ter" level="6" />
+                <field field_ref="lat_lic" level="6" />
+                <field field_ref="lat_oce" level="6" />
+                <field field_ref="lat_sic" level="6" />
+                <field field_ref="flw_ter" level="10" />
+                <field field_ref="flw_lic" level="10" />
+                <field field_ref="flw_oce" level="10" />
+                <field field_ref="flw_sic" level="10" />
+                <field field_ref="fsw_ter" level="10" />
+                <field field_ref="fsw_lic" level="10" />
+                <field field_ref="fsw_oce" level="10" />
+                <field field_ref="fsw_sic" level="10" />
+                <field field_ref="wbils_ter" level="10" />
+                <field field_ref="wbils_lic" level="10" />
+                <field field_ref="wbils_oce" level="10" />
+                <field field_ref="wbils_sic" level="10" />
+                <field field_ref="wbilo_ter" level="10" />
+                <field field_ref="wbilo_lic" level="10" />
+                <field field_ref="wbilo_oce" level="10" />
+                <field field_ref="wbilo_sic" level="10" />
+                <field field_ref="wevap_ter" level="10" />
+                <field field_ref="wevap_lic" level="10" />
+                <field field_ref="wevap_oce" level="10" />
+                <field field_ref="wevap_sic" level="10" />
+                <field field_ref="wrain_ter" level="10" />
+                <field field_ref="wrain_lic" level="10" />
+                <field field_ref="wrain_oce" level="10" />
+                <field field_ref="wrain_sic" level="10" />
+                <field field_ref="wsnow_ter" level="10" />
+                <field field_ref="wsnow_lic" level="10" />
+                <field field_ref="wsnow_oce" level="10" />
+                <field field_ref="wsnow_sic" level="10" />
+                <field field_ref="cdrm" level="10" />
+                <field field_ref="cdrh" level="10" />
+                <field field_ref="cldl" level="1" />
+                <field field_ref="cumCO2" level="5" />  <!-- Added PC -->
+                <field field_ref="cldm" level="1" />
+                <field field_ref="cldh" level="1" />
+                <field field_ref="cldt" level="1" />
+                <field field_ref="cldq" level="1" />
+                <field field_ref="lwp" level="5" />
+                <field field_ref="iwp" level="5" />
+                <field field_ref="ue" level="10" />
+                <field field_ref="ve" level="10" />
+                <field field_ref="uq" level="10" />
+                <field field_ref="vq" level="10" />
+                <field field_ref="cape" level="10" />
+                <field field_ref="pbase" level="5" />
+                <field field_ref="ptop" level="5" />
+                <field field_ref="fbase" level="10" />
+                <field field_ref="plcl" level="10" />
+                <field field_ref="plfc" level="10" />
+                <field field_ref="wbeff" level="10" />
+                <field field_ref="convoccur" level="10" />
+                <field field_ref="prw" level="1" />
+                <field field_ref="prlw" level="1" />
+                <field field_ref="prsw" level="1" />
+                <field field_ref="s_pblh" level="10" />
+                <field field_ref="s_pblt" level="10" />
+                <field field_ref="s_lcl" level="10" />
+                <field field_ref="s_therm" level="10" />
+                <field field_ref="slab_bils_oce" level="1" />
+                <field field_ref="ale_bl" level="1" />
+                <field field_ref="alp_bl" level="1" />
+                <field field_ref="ale_wk" level="1" />
+                <field field_ref="alp_wk" level="1" />
+                <field field_ref="ale" level="1" />
+                <field field_ref="alp" level="1" />
+                <field field_ref="cin" level="1" />
+                <field field_ref="wape" level="1" />
+                <field field_ref="n2" level="1" />
+                <field field_ref="s2" level="1" />
+                <field field_ref="proba_notrig" level="1" />
+                <field field_ref="random_notrig" level="1" />
+                <field field_ref="cv_gen" level="1" />
+                <field field_ref="ale_bl_stat" level="1" />
+                <field field_ref="ale_bl_trig" level="1" />
+                <field field_ref="alp_bl_det" level="1" />
+                <field field_ref="alp_bl_fluct_m" level="1" />
+                <field field_ref="alp_bl_fluct_tke" level="1" />
+                <field field_ref="alp_bl_conv" level="1" />
+                <field field_ref="alp_bl_stat" level="1" />
+                <field field_ref="colO3_strat" level="6" />     <!-- Added ThL -->
+                <field field_ref="colO3_trop"  level="6" />     <!-- Added ThL -->
+                <field field_ref="flx_co2_ocean"  level="5" /> <!-- Added PC -->
+                <field field_ref="flx_co2_land"   level="5" /> <!-- Added PC -->
+                <field field_ref="flx_co2_ocean_cor" level="5" /> <!-- Added PC -->
+                <field field_ref="flx_co2_land_cor"  level="5" /> <!-- Added PC -->
+                <field field_ref="flx_co2_ff"  level="5" /> <!-- Added PC -->
+                <field field_ref="flx_co2_bb"  level="5" /> <!-- Added PC -->
+
+
+                <field_group operation="average" detect_missing_value=".true.">
+                    <field field_ref="u850" level="10" />
+                    <field field_ref="u700" level="10" />
+                    <field field_ref="u500" level="10" />
+                    <field field_ref="u200" level="10" />
+                    <field field_ref="u100" level="10" />
+                    <field field_ref="u50" level="10" />
+                    <field field_ref="u10" level="10" />
+                    <field field_ref="v850" level="10" />
+                    <field field_ref="v700" level="10" />
+                    <field field_ref="v500" level="10" />
+                    <field field_ref="v200" level="10" />
+                    <field field_ref="v100" level="10" />
+                    <field field_ref="v50" level="10" />
+                    <field field_ref="v10" level="10" />
+                    <field field_ref="w850" level="10" />
+                    <field field_ref="w700" level="10" />
+                    <field field_ref="w500" level="10" />
+                    <field field_ref="w200" level="10" />
+                    <field field_ref="w100" level="10" />
+                    <field field_ref="w50" level="10" />
+                    <field field_ref="w10" level="10" />
+                    <field field_ref="t850" level="10" />
+                    <field field_ref="t700" level="10" />
+                    <field field_ref="t500" level="10" />
+                    <field field_ref="t200" level="10" />
+                    <field field_ref="t100" level="10" />
+                    <field field_ref="t50" level="10" />
+                    <field field_ref="t10" level="10" />
+                    <field field_ref="q850" level="10" />
+                    <field field_ref="q700" level="10" />
+                    <field field_ref="q500" level="10" />
+                    <field field_ref="q200" level="10" />
+                    <field field_ref="q100" level="10" />
+                    <field field_ref="q50" level="10" />
+                    <field field_ref="q10" level="10" />
+                    <field field_ref="z850" level="10" />
+                    <field field_ref="z700" level="10" />
+                    <field field_ref="z500" level="10" />
+                    <field field_ref="z200" level="10" />
+                    <field field_ref="z100" level="10" />
+                    <field field_ref="z50" level="10" />
+                    <field field_ref="z10" level="10" />
+                </field_group>
+
+                <field field_ref="t_oce_sic" level="10" />
+                <field field_ref="weakinv" level="1" />
+                <field field_ref="dthmin" level="1" />
+                <field field_ref="u10_ter" level="4" />
+                <field field_ref="u10_lic" level="4" />
+                <field field_ref="u10_oce" level="4" />
+                <field field_ref="u10_sic" level="4" />
+                <field field_ref="v10_ter" level="4" />
+                <field field_ref="v10_lic" level="4" />
+                <field field_ref="v10_oce" level="4" />
+                <field field_ref="v10_sic" level="4" />
+                <field field_ref="rh2m" level="5" />
+                <field field_ref="rh2m_min" level="5" operation="minimum" />
+                <field field_ref="rh2m_max" level="5" operation="maximum" />
+                <field field_ref="qsat2m" level="5" />
+                <field field_ref="tpot" level="5" />
+                <field field_ref="tpote" level="5" />
+                <field field_ref="SWnetOR" level="10" />
+                <field field_ref="SWdownOR" level="10" />
+                <field field_ref="LWdownOR" level="10" />
+                <field field_ref="snowl" level="1" />
+                <field field_ref="cape_max" level="1" operation="maximum" />
+                <field field_ref="solldown" level="1" />
+                <field field_ref="dtsvdfo" level="10" />
+                <field field_ref="dtsvdft" level="10" />
+                <field field_ref="dtsvdfg" level="10" />
+                <field field_ref="dtsvdfi" level="10" />
+                <field field_ref="rugs" level="10" />
+                <field field_ref="z0m" level="10" />
+                <field field_ref="z0h" level="10" />
+                <field field_ref="topswad" level="1" />
+                <field field_ref="topswad0" level="1" />
+                <field field_ref="topswai" level="10" />
+                <field field_ref="solswad" level="10" />
+                <field field_ref="solswad0" level="10" />
+                <field field_ref="solswai" level="10" />
+                <field field_ref="toplwad" level="1" />
+                <field field_ref="toplwad0" level="1" />
+                <field field_ref="toplwai" level="10" />
+                <field field_ref="sollwad" level="10" />
+                <field field_ref="sollwad0" level="10" />
+                <field field_ref="sollwai" level="10" />
+                <field field_ref="od550_ASBCM" level="6" />
+                <field field_ref="od550_ASPOMM" level="6" />
+                <field field_ref="od550_ASSO4M" level="6" />
+                <field field_ref="od550_CSSO4M" level="6" />
+                <field field_ref="od550_SSSSM" level="6" />
+                <field field_ref="od550_ASSSM" level="6" />
+                <field field_ref="od550_CSSSM" level="6" />
+                <field field_ref="od550_CIDUSTM" level="6" />
+                <field field_ref="od550_AIBCM" level="6" />
+                <field field_ref="od550_AIPOMM" level="6" />
+                <field field_ref="od550_ASNO3M" level="6" />
+                <field field_ref="od550_CSNO3M" level="6" />
+                <field field_ref="od550_CINO3M" level="6" />
+                <field field_ref="od550_STRAT" level="2" />
+                <field field_ref="od550aer" level="6" />
+                <field field_ref="dryod550aer" level="6" />
+                <field field_ref="od865aer" level="6" />
+                <field field_ref="abs550aer" level="6" />
+                <field field_ref="od550lt1aer" level="6" />
+                <field field_ref="sconcso4" level="6" />
+                <field field_ref="sconcoa" level="6" />
+                <field field_ref="sconcbc" level="6" />
+                <field field_ref="sconcss" level="6" />
+                <field field_ref="sconcdust" level="6" />
+                <field field_ref="sconcno3" level="6" />
+                <field field_ref="loadso4" level="6" />
+                <field field_ref="loadoa" level="6" />
+                <field field_ref="loadbc" level="6" />
+                <field field_ref="loadss" level="6" />
+                <field field_ref="loaddust" level="6" />
+                <field field_ref="loadno3" level="6" />
+                <field field_ref="swtoaas_nat" level="6" />
+                <field field_ref="swsrfas_nat" level="6" />
+                <field field_ref="swtoacs_nat" level="6" />
+                <field field_ref="swsrfcs_nat" level="6" />
+                <field field_ref="swtoaas_ant" level="6" />
+                <field field_ref="swsrfas_ant" level="6" />
+                <field field_ref="swtoacs_ant" level="6" />
+                <field field_ref="swsrfcs_ant" level="6" />
+                <field field_ref="swtoacf_nat" level="6" />
+                <field field_ref="swsrfcf_nat" level="6" />
+                <field field_ref="swtoacf_ant" level="6" />
+                <field field_ref="swsrfcf_ant" level="6" />
+                <field field_ref="swtoacf_zero" level="6" />
+                <field field_ref="swsrfcf_zero" level="6" />
+                <field field_ref="cldncl" level="6" />
+                <field field_ref="reffclwtop" level="6" />
+                <field field_ref="cldnvi" level="6" />
+                <field field_ref="lcc" level="6" />
+                <field field_ref="wvapp" level="10" />
+                <field field_ref="albe_ter" level="7" />
+                <field field_ref="albe_lic" level="7" />
+                <field field_ref="albe_oce" level="7" />
+                <field field_ref="albe_sic" level="7" />
+                <field field_ref="ages_ter" level="10" />
+                <field field_ref="ages_lic" level="10" />
+                <field field_ref="ages_oce" level="10" />
+                <field field_ref="ages_sic" level="10" />
+                <field field_ref="snow_ter" level="10" />
+                <field field_ref="snow_lic" level="10" />
+                <field field_ref="snow_oce" level="10" />
+                <field field_ref="snow_sic" level="10" />
+                <field field_ref="rugs_ter" level="6" />
+                <field field_ref="rugs_lic" level="6" />
+                <field field_ref="rugs_oce" level="6" />
+                <field field_ref="rugs_sic" level="6" />
+                <field field_ref="z0m_ter" level="6" />
+                <field field_ref="z0m_lic" level="6" />
+                <field field_ref="z0m_oce" level="6" />
+                <field field_ref="z0m_sic" level="6" />
+                <field field_ref="z0h_ter" level="6" />
+                <field field_ref="z0h_lic" level="6" />
+                <field field_ref="z0h_oce" level="6" />
+                <field field_ref="z0h_sic" level="6" />
+                <field field_ref="alb1" level="10" />
+                <field field_ref="alb2" level="10" />
+                <field field_ref="ftime_con" level="10" operation="instant" />
+                <field field_ref="wake_h" level="5" />
+                <field field_ref="wake_dens" level="5" />
+                <field field_ref="wake_s" level="5" />
+                <field field_ref="epmax" level="10" />
+                <field field_ref="plulth" level="10" />
+                <field field_ref="plulst" level="10" />
+                <field field_ref="lmaxth" level="10" />
+                <field field_ref="ftime_th" level="10" />
+                <field field_ref="ftime_deepcv" level="10" />
+                <field field_ref="f0_th" level="10" />
+                <field field_ref="zmax_th" level="4" />
+                <field field_ref="rsut4co2" level="10" />
+                <field field_ref="rlut4co2" level="10" />
+                <field field_ref="rsutcs4co2" level="10" />
+                <field field_ref="rlutcs4co2" level="10" />
+                <field field_ref="dqphy2d" level="10" />
+                <field field_ref="dqlphy2d" level="10" />
+                <field field_ref="dqsphy2d" level="10" />
+                <field field_ref="dqdyn2d" level="10" />
+                <field field_ref="dqldyn2d" level="10" />
+                <field field_ref="dqsdyn2d" level="10" />
+                <field field_ref="dqcon2d" level="10" />
+                <field field_ref="dqwak2d" level="10" />
+                <field field_ref="dqlsc2d" level="10" />
+                <field field_ref="dqvdf2d" level="10" />
+                <field field_ref="dqeva2d" level="10" />
+                <field field_ref="dqlscth2d" level="10" />
+                <field field_ref="dqlscst2d" level="10" />
+                <field field_ref="dqthe2d" level="10" />
+                <field field_ref="dqajs2d" level="10" />
+            <!-- Begin Added SN isotopes 2D fields 07 2023 -->
+            <!-- water oxygen H216O H217O H218O -->
+                <field field_ref="precipH216O"     level="1" />
+                <field field_ref="plulH216O"       level="1" />
+                <field field_ref="plucH216O"       level="1" />
+                <field field_ref="evapH216O"       level="1" />
+                <field field_ref="evap_terH216O"   level="1" />
+                <field field_ref="evap_licH216O"   level="1" />
+                <field field_ref="evap_oceH216O"   level="1" />
+                <field field_ref="evap_sicH216O"   level="1" />
+                <field field_ref="precipH217O"     level="1" />
+                <field field_ref="plulH217O"       level="1" />
+                <field field_ref="plucH217O"       level="1" />
+                <field field_ref="evapH217O"       level="1" />
+                <field field_ref="evap_terH217O"   level="1" />
+                <field field_ref="evap_licH217O"   level="1" />
+                <field field_ref="evap_oceH217O"   level="1" />
+                <field field_ref="evap_sicH217O"   level="1" />
+                <field field_ref="precipH218O"     level="1" />
+                <field field_ref="plulH218O"       level="1" />
+                <field field_ref="plucH218O"       level="1" />
+                <field field_ref="evapH218O"       level="1" />
+                <field field_ref="evap_terH218O"   level="1" />
+                <field field_ref="evap_licH218O"   level="1" />
+                <field field_ref="evap_oceH218O"   level="1" />
+                <field field_ref="evap_sicH218O"   level="1" />
+            <!-- water hydrogen HDO HTO -->
+                <field field_ref="precipHDO"    level="1" />
+                <field field_ref="plulHDO"      level="1" />
+                <field field_ref="plucHDO"      level="1" />
+                <field field_ref="evapHDO"      level="1" />
+                <field field_ref="evap_terHDO"  level="1" />
+                <field field_ref="evap_licHDO"  level="1" />
+                <field field_ref="evap_oceHDO"  level="1" />
+                <field field_ref="evap_sicHDO"  level="1" />
+                <field field_ref="precipHTO"    level="1" />
+                <field field_ref="plulHTO"      level="1" />
+                <field field_ref="plucHTO"      level="1" />
+                <field field_ref="evapHTO"      level="1" />
+                <field field_ref="evap_terHTO"  level="1" />
+                <field field_ref="evap_licHTO"  level="1" />
+                <field field_ref="evap_oceHTO"  level="1" />
+                <field field_ref="evap_sicHTO"  level="1" />
+           <!-- end Added SN isotopes 2D fields 07 2023 -->
+           </field_group>
+
+            <!-- VARS 3D -->
+            <field_group operation="average" grid_ref="grid_out_presnivs">
+                <field field_ref="CO2" level="5" /> <!-- Added PC -->
+                <field field_ref="dCO2_vdf" level="5" />
+                <field field_ref="dCO2_the" level="5" />
+                <field field_ref="dCO2_con" level="5" />
+                <field field_ref="cldtau" level="5" />
+                <field field_ref="cldemi" level="5" />
+                <field field_ref="tke_max" level="10" operation="maximum" />
+                <field field_ref="concso4" level="6" />
+                <field field_ref="concoa" level="6" />
+                <field field_ref="concbc" level="6" />
+                <field field_ref="concss" level="6" />
+                <field field_ref="concdust" level="6" />
+                <field field_ref="concno3" level="6" />
+                <field field_ref="ec550aer" level="6" />
+                <field field_ref="lwcon" level="5" />
+                <field field_ref="iwcon" level="5" />
+                <field field_ref="temp" level="3" />
+                <field field_ref="theta" level="3" />
+                <field field_ref="ovap" level="3" />
+                <field field_ref="ovapinit" level="10" />
+                <field field_ref="oliq" level="3" />
+                <field field_ref="ocond" level="3" />
+                <field field_ref="geop" level="3" />
+                <field field_ref="geoph" level="3" />
+                <field field_ref="vitu" level="3" />
+                <field field_ref="vitv" level="3" />
+                <field field_ref="vitw" level="3" />
+                <field field_ref="pres" level="3" />
+                <field field_ref="paprs" level="3" />
+                <field field_ref="mass" level="3" />
+                <field field_ref="zfull" level="3" />
+                <field field_ref="zhalf" level="3" />
+                <field field_ref="rneb" level="5" />
+                <field field_ref="rnebcon" level="5" />
+                <field field_ref="rnebls" level="5" />
+                <field field_ref="rneblsvol" level="5" />
+                <field field_ref="rhum" level="5" />
+                <field field_ref="ozone" level="10" />
+                <field field_ref="upwd" level="10" />
+                <field field_ref="ep" level="10" />
+                <field field_ref="duphy" level="10" />
+                <field field_ref="dtphy" level="10" />
+                <field field_ref="dqphy" level="10" />
+                <field field_ref="dqlphy" level="10" />
+                <field field_ref="dqsphy" level="10" />
+                <field field_ref="pr_con_l" level="10" />
+                <field field_ref="pr_con_i" level="10" />
+                <field field_ref="pr_lsc_l" level="10" />
+                <field field_ref="pr_lsc_i" level="10" />
+                <field field_ref="re" level="10" />
+                <field field_ref="fl" level="10" />
+                <field field_ref="scdnc" level="6" />
+                <field field_ref="reffclws" level="6" />
+                <field field_ref="reffclwc" level="6" />
+                <field field_ref="lcc3d" level="6" />
+                <field field_ref="lcc3dcon" level="6" />
+                <field field_ref="lcc3dstra" level="6" />
+                <field field_ref="cldwatmxrat" level="6" />
+                <field field_ref="icc3dcon" level="6" />
+                <field field_ref="icc3dstra" level="6" />
+                <field field_ref="cldicemxrat" level="6" />
+                <field field_ref="clwcon" level="10" />
+                <field field_ref="Ma" level="10" />
+                <field field_ref="dnwd" level="10" />
+                <field field_ref="dnwd0" level="10" />
+                <field field_ref="mc" level="5" />
+                <field field_ref="dtdyn" level="10" />
+                <field field_ref="dqdyn" level="10" />
+                <field field_ref="dqldyn" level="10" />
+                <field field_ref="dqsdyn" level="10" />
+                <field field_ref="dudyn" level="10" />
+                <field field_ref="dvdyn" level="10" />
+                <field field_ref="dtcon" level="10" />
+                <field field_ref="ducon" level="10" />
+                <field field_ref="dvcon" level="10" />
+                <field field_ref="dqcon" level="10" />
+                <field field_ref="dtwak" level="5" />
+                <field field_ref="dqwak" level="5" />
+                <field field_ref="wake_deltat" level="5" />
+                <field field_ref="wake_deltaq" level="5" />
+                <field field_ref="wake_omg" level="5" />
+                <field field_ref="wdtrainA" level="1" />
+                <field field_ref="wdtrainM" level="1" />
+                <field field_ref="ftd" level="5" />
+                <field field_ref="fqd" level="5" />
+                <field field_ref="dtlsc" level="10" />
+                <field field_ref="dtlschr" level="10" />
+                <field field_ref="dqlsc" level="10" />
+                <field field_ref="beta_prec" level="10" />
+                <field field_ref="dtvdf" level="10" />
+                <field field_ref="dtvdf_x" level="11" />
+                <field field_ref="dtvdf_w" level="11" />
+                <field field_ref="dtdis" level="10" />
+                <field field_ref="dqvdf" level="10" />
+                <field field_ref="dqvdf_x" level="11" />
+                <field field_ref="dqvdf_w" level="11" />
+                <field field_ref="dteva" level="10" />
+                <field field_ref="dqeva" level="10" />
+                <field field_ref="dqlscth" level="10" />
+                <field field_ref="dqlscst" level="10" />
+                <field field_ref="dtlscth" level="10" />
+                <field field_ref="dtlscst" level="10" />
+                <field field_ref="ptconvth" level="10" />
+                <field field_ref="ptconv" level="10" />
+                <field field_ref="ratqs" level="10" />
+                <field field_ref="dtthe" level="10" />
+                <field field_ref="e_th" level="10" />
+                <field field_ref="lambda_th" level="10" />
+                <field field_ref="q_th" level="10" />
+                <field field_ref="s_th" level="10" />
+                <field field_ref="s_env" level="10" />
+                <field field_ref="sigma_th" level="10" />
+                <field field_ref="sigma_env" level="10" />
+                <field field_ref="d_th" level="10" />
+                <field field_ref="dqthe" level="10" />
+                <field field_ref="dtajs" level="10" />
+                <field field_ref="dqajs" level="10" />
+                <field field_ref="dtswr" level="10" />
+                <field field_ref="dtsw0" level="10" />
+                <field field_ref="dtlwr" level="10" />
+                <field field_ref="dtlw0" level="10" />
+                <field field_ref="dtec" level="10" />
+                <field field_ref="duvdf" level="10" />
+                <field field_ref="dvvdf" level="10" />
+                <field field_ref="duoro" level="10" />
+                <field field_ref="dvoro" level="10" />
+                <field field_ref="dulif" level="10" />
+                <field field_ref="dvlif" level="10" />
+                <field field_ref="du_gwd_hines" level="10" />
+                <field field_ref="dv_gwd_hines" level="10" />
+                <field field_ref="du_gwd_front" level="10" />
+                <field field_ref="dv_gwd_front" level="10" />
+                <field field_ref="east_gwstress" level="10" />
+                <field field_ref="west_gwstress" level="10" />
+                <field field_ref="dtoro" level="10" />
+                <field field_ref="dtlif" level="10" />
+                <field field_ref="dthin" level="10" />
+                <field field_ref="tnt" level="10" />
+                <field field_ref="tntc" level="10" />
+                <field field_ref="tntr" level="10" />
+                <field field_ref="tntscpbl" level="10" />
+                <field field_ref="tnhus" level="10" />
+                <field field_ref="tnhusc" level="10" />
+                <field field_ref="tnhusscpbl" level="10" />
+                <field field_ref="h2o" level="10" />
+                <field field_ref="mcd" level="10" />
+                <field field_ref="dmc" level="10" />
+                <field field_ref="ref_liq" level="10" />
+                <field field_ref="ref_ice" level="10" />
+                <field field_ref="treedrg_ter" level="6" />
+                <field field_ref="treedrg_lic" level="6" />
+                <field field_ref="treedrg_oce" level="6" />
+                <field field_ref="treedrg_sic" level="6" />
+                <field field_ref="tke" level="10" />
+                <field field_ref="tke_ter" level="4" />
+                <field field_ref="tke_lic" level="4" />
+                <field field_ref="tke_oce" level="4" />
+                <field field_ref="tke_sic" level="4" />
+                <field field_ref="tke_max_ter" level="4" operation="maximum" />
+                <field field_ref="tke_max_lic" level="4" operation="maximum" />
+                <field field_ref="tke_max_oce" level="4" operation="maximum" />
+                <field field_ref="tke_max_sic" level="4" operation="maximum" />
+                <field field_ref="l_mix_ter" level="10" />
+                <field field_ref="l_mix_lic" level="10" />
+                <field field_ref="l_mix_oce" level="10" />
+                <field field_ref="l_mix_sic" level="10" />
+                <field field_ref="l_mixmin_ter" level="10" />
+                <field field_ref="l_mixmin_lic" level="10" />
+                <field field_ref="l_mixmin_oce" level="10" />
+                <field field_ref="l_mixmin_sic" level="10" />
+                <field field_ref="ozone_daylight" level="10" />
+             <!-- Begin Added SN isotopes 3D fields 07 2023 -->
+             <!-- water oxygen H216O H217O H218O -->
+                <field field_ref="ovapH216O"   level="1" />
+                <field field_ref="oliqH216O"   level="1" />
+                <field field_ref="ocondH216O"  level="1" />
+                <field field_ref="dqdynH216O"  level="1" />
+                <field field_ref="dqldynH216O" level="1" />
+                <field field_ref="dqconH216O"  level="1" />
+                <field field_ref="dqlscH216O"  level="1" />
+                <field field_ref="dqevaH216O"  level="1" />
+                <field field_ref="dqvdfH216O"  level="1" />
+                <field field_ref="dqajsH216O"  level="1" />
+                <field field_ref="dqtheH216O"  level="1" />
+                <field field_ref="ovapH217O"   level="1" />
+                <field field_ref="oliqH217O"   level="1" />
+                <field field_ref="ocondH217O"  level="1" />
+                <field field_ref="dqdynH217O"  level="1" />
+                <field field_ref="dqldynH217O" level="1" />
+                <field field_ref="dqconH217O"  level="1" />
+                <field field_ref="dqlscH217O"  level="1" />
+                <field field_ref="dqevaH217O"  level="1" />
+                <field field_ref="dqvdfH217O"  level="1" />
+                <field field_ref="dqajsH217O"  level="1" />
+                <field field_ref="dqtheH217O"  level="1" />
+                <field field_ref="ovapH218O"   level="1" />
+                <field field_ref="oliqH218O"   level="1" />
+                <field field_ref="ocondH218O"  level="1" />
+                <field field_ref="dqdynH218O"  level="1" />
+                <field field_ref="dqldynH218O" level="1" />
+                <field field_ref="dqconH218O"  level="1" />
+                <field field_ref="dqlscH218O"  level="1" />
+                <field field_ref="dqevaH218O"  level="1" />
+                <field field_ref="dqvdfH218O"  level="1" />
+                <field field_ref="dqajsH218O"  level="1" />
+                <field field_ref="dqtheH218O"  level="1" />
+            <!-- water hydrogen HDO HTO -->
+                <field field_ref="ovapHDO"   level="1" />
+                <field field_ref="oliqHDO"   level="1" />
+                <field field_ref="ocondHDO"  level="1" />
+                <field field_ref="dqdynHDO"  level="1" />
+                <field field_ref="dqldynHDO" level="1" />
+                <field field_ref="dqconHDO"  level="1" />
+                <field field_ref="dqlscHDO"  level="1" />
+                <field field_ref="dqevaHDO"  level="1" />
+                <field field_ref="dqvdfHDO"  level="1" />
+                <field field_ref="dqajsHDO"  level="1" />
+                <field field_ref="dqtheHDO"  level="1" />
+                <field field_ref="ovapHTO"   level="1" />
+                <field field_ref="oliqHTO"   level="1" />
+                <field field_ref="ocondHTO"  level="1" />
+                <field field_ref="dqdynHTO"  level="1" />
+                <field field_ref="dqldynHTO" level="1" />
+                <field field_ref="dqconHTO"  level="1" />
+                <field field_ref="dqlscHTO"  level="1" />
+                <field field_ref="dqevaHTO"  level="1" />
+                <field field_ref="dqvdfHTO"  level="1" />
+                <field field_ref="dqajsHTO"  level="1" />
+                <field field_ref="dqtheHTO"  level="1" />
+             <!-- End Added SN isotopes 3D fields 07 2023 -->
+            </field_group>
+            <field_group operation="average" grid_ref="grid_out_presinter">
+                <field field_ref="a_th" level="9" />
+                <field field_ref="f_th" level="7" />
+                <field field_ref="w_th" level="7" />
+                <field field_ref="rsucs" level="10" />
+                <field field_ref="rsdcs" level="10" />
+                <field field_ref="rlucs" level="10" />
+                <field field_ref="rldcs" level="10" />
+                <field field_ref="rldcs4co2" level="10" />
+                <field field_ref="rlucs4co2" level="10" />
+                <field field_ref="rsdcs4co2" level="10" />
+                <field field_ref="rsucs4co2" level="10" />
+                <field field_ref="rsu4co2" level="10" />
+                <field field_ref="rlu4co2" level="10" />
+                <field field_ref="rsd4co2" level="10" />
+                <field field_ref="rld4co2" level="10" />
+                <field field_ref="Vprecip" level="11" />
+                <field field_ref="rsu" level="5" />
+                <field field_ref="rsd" level="5" />
+                <field field_ref="rlu" level="5" />
+                <field field_ref="rld" level="5" />
+                <field field_ref="kz" level="4" />
+                <field field_ref="kz_max" level="4" operation="maximum" />
+                <field field_ref="evu" level="10" />
+           </field_group>
+            
+          </field_group>
+        </file>
+    </file_group>
+</file_definition>
Index: CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/file_def_histmth_lmdz_iso.xml
===================================================================
--- CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/file_def_histmth_lmdz_iso.xml	(revision 6746)
+++ CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/file_def_histmth_lmdz_iso.xml	(revision 6746)
@@ -0,0 +1,851 @@
+<!-- $Id: file_def_histmth_lmdz.xml 4601 2023-06-30 22:07:30Z dcugnet $ --> 
+<file_definition>
+        <file_group id="defile">
+        <file id="histmth" name="histmth" output_freq="1mo" output_level="_AUTO_"  enabled="_AUTO_" compression_level="0">
+
+            <!-- VARS 1D -->
+<!--            <field_group operation="once">  -->
+<!--              <field field_ref="Ap" level="1" />  -->
+<!--              <field field_ref="Bp" level="1" />  -->
+<!--              <field field_ref="Alt" level="1" />  -->
+<!--            </field_group>  -->
+
+            <field_group operation="once">
+              <field field_ref="Ahyb" level="1" />
+              <field field_ref="Ahyb_bounds" level="1" />
+              <field field_ref="Bhyb" level="1" />
+              <field field_ref="Bhyb_bounds" level="1" />
+              <field field_ref="Ahyb_mid" level="1" />
+              <field field_ref="Ahyb_mid_bounds" level="1" />
+              <field field_ref="Bhyb_mid" level="1" />
+              <field field_ref="Bhyb_mid_bounds" level="1" />
+            </field_group>
+
+            <field_group operation="instant">
+                <field field_ref="R_ecc" level="1" name="R_ecc" />
+                <field field_ref="R_peri" level="1" name="R_peri" />
+                <field field_ref="R_incl" level="1" name="R_incl" />
+                <field field_ref="solaire" level="1" name="solaire" />
+
+                <field field_ref="rsun1" level="1" name="rsun1" />
+                <field field_ref="rsun2" level="1" name="rsun2" />
+                <field field_ref="rsun3" level="1" name="rsun3" />
+                <field field_ref="rsun4" level="1" name="rsun4" />
+                <field field_ref="rsun5" level="1" name="rsun5" />
+                <field field_ref="rsun6" level="1" name="rsun6" />
+
+                <field field_ref="co2_ppm" level="1" name="co2_ppm" />
+                <field field_ref="CH4_ppb" level="1" name="CH4_ppb" />
+                <field field_ref="N2O_ppb" level="1" name="N2O_ppb" />
+                <field field_ref="CFC11_ppt" level="1" name="CFC11_ppt" />
+                <field field_ref="CFC12_ppt" level="1" name="CFC12_ppt" />
+            </field_group>
+            
+
+           <field_group group_ref="remap_1mo">
+             <!-- VARS 2D -->
+             <field_group operation="average" grid_ref="grid_out">
+                <field field_ref="io_lon" level="1" operation="once"/>
+                <field field_ref="io_lat" level="1" operation="once"/>
+    
+                <field field_ref="phis"         level="1"  />
+                <field field_ref="aire"         level="1"  />
+                <field field_ref="contfracATM"  level="10" />
+                <field field_ref="contfracOR"   level="10" />
+                <field field_ref="flat"         level="5" />
+                <field field_ref="slp"          level="1" />
+                <field field_ref="sza"          level="1" />
+                <field field_ref="ptstar"       level="1" />
+                <field field_ref="pt0"          level="1" />
+                <field field_ref="tsol"         level="1" />
+                <field field_ref="t2m"          level="1" />
+                <field id="ave_t2m_daily_min" field_ref="t2m_min" name="ave_t2m_daily_min" level="1" operation="average" freq_op="1d" expr="@t2m_min" />
+                <field id="ave_t2m_daily_max" field_ref="t2m_max" name="ave_t2m_daily_max" level="1" operation="average" freq_op="1d" expr="@t2m_max" />
+                <field field_ref="t2m_ter" level="10" />
+                <field field_ref="t2m_lic" level="10" />
+                <field field_ref="t2m_oce" level="10" />
+                <field field_ref="t2m_sic" level="10" />
+                <field field_ref="gusts" level="1" />
+                <field field_ref="wind10m" level="1" />
+                <field field_ref="wind10max" level="10" operation="maximum" />
+                <field field_ref="sicf"      level="1" />
+                <field field_ref="q2m"       level="1" />
+                <field field_ref="ustar"     level="1" />
+                <field field_ref="u10m"      level="1" />
+                <field field_ref="v10m"      level="1" />
+                <field field_ref="psol"      level="1" />
+                <field field_ref="qsurf"     level="1" />
+                <field field_ref="ustar_ter" level="10" />
+                <field field_ref="ustar_lic" level="10" />
+                <field field_ref="ustar_oce" level="10" />
+                <field field_ref="ustar_sic" level="10" />
+                <field field_ref="wstar_ter" level="10" />
+                <field field_ref="wstar_lic" level="10" />
+                <field field_ref="wstar_oce" level="10" />
+                <field field_ref="wstar_sic" level="10" />
+                <field field_ref="wstar"    level="5" />
+                <field field_ref="u10m_ter" level="10" />
+                <field field_ref="u10m_lic" level="10" />
+                <field field_ref="u10m_oce" level="10" />
+                <field field_ref="u10m_sic" level="10" />
+                <field field_ref="v10m_ter" level="10" />
+                <field field_ref="v10m_lic" level="10" />
+                <field field_ref="v10m_oce" level="10" />
+                <field field_ref="v10m_sic" level="10" />
+                <field field_ref="qsol"     level="1" />
+                <field field_ref="ndayrain" level="1" operation="instant" />
+                <field field_ref="precip"   level="1" />
+                <field field_ref="rain_fall"   level="1" />
+                <field field_ref="rain_con"   level="1" />
+                <field field_ref="plul"     level="1" />
+                <field field_ref="plun"     level="1" />
+                <field field_ref="pluc"     level="1" />
+                <field field_ref="snow"     level="1" />
+                <field field_ref="evap"     level="1" />
+                <field field_ref="evap_ter" level="1" />
+                <field field_ref="evap_lic" level="1" />
+                <field field_ref="evap_oce" level="1" />
+                <field field_ref="evap_sic" level="1" />
+                <field field_ref="msnow"    level="1" />
+                <field field_ref="fsnow"    level="1" />
+                <field field_ref="tops"     level="1" />
+                <field field_ref="tops0"    level="1" />
+                <field field_ref="topl"     level="1" />
+                <field field_ref="topl0"    level="1" />
+                <field field_ref="SWupTOA"  level="1" />
+                <field field_ref="SWupTOAclr"   level="1" />
+                <field field_ref="SWdnTOA"      level="1" />
+                <field field_ref="SWdnTOAclr"   level="1" />
+                <field field_ref="nettop"       level="1" />
+                <field field_ref="SWup200"      level="15" />
+                <field field_ref="SWup200clr"   level="15" />
+                <field field_ref="SWdn200"      level="15" />
+                <field field_ref="SWdn200clr"   level="15" />
+                <field field_ref="LWup200"      level="15" />
+                <field field_ref="LWup200clr"   level="15" />
+                <field field_ref="LWdn200"      level="15" />
+                <field field_ref="LWdn200clr"   level="15" />
+                <field field_ref="sols"  level="1" />
+                <field field_ref="sols0" level="1" />
+                <field field_ref="soll" level="1" />
+                <field field_ref="soll0" level="1" />
+                <field field_ref="radsol" level="1" />
+                <field field_ref="SWupSFC" level="1" />
+                <field field_ref="SWupSFCclr" level="1" />
+                <field field_ref="SWdnSFC" level="1" />
+                <field field_ref="SWdnSFCclr" level="1" />
+                <field field_ref="LWupSFC" level="1" />
+                <field field_ref="LWupSFCclr" level="1" />
+                <field field_ref="LWdnSFC" level="1" />
+                <field field_ref="LWdnSFCclr" level="1" />
+                <field field_ref="bils" level="1" />
+                <field field_ref="bils_tke" level="1" />
+                <field field_ref="bils_diss" level="1" />
+                <field field_ref="bils_ec" level="1" />
+                <field field_ref="bils_kinetic" level="1" />
+                <field field_ref="bils_enthalp" level="1" />
+                <field field_ref="bils_latent" level="1" />
+                <field field_ref="sens" level="1" />
+                <field field_ref="sens_x" level="11" />
+                <field field_ref="sens_w" level="11" />
+                <field field_ref="flat_x" level="11" />
+                <field field_ref="flat_w" level="11" />
+                <field field_ref="delta_tsurf" level="11" />
+                <field field_ref="cdragh_x" level="11" />
+                <field field_ref="cdragh_w" level="11" />
+                <field field_ref="cdragm_x" level="11" />
+                <field field_ref="cdragm_w" level="11" />
+                <field field_ref="kh" level="11" />
+                <field field_ref="kh_x" level="11" />
+                <field field_ref="kh_w" level="11" />
+                <field field_ref="fder" level="1" />
+                <field field_ref="ffonte" level="1" />
+                <field field_ref="fqcalving" level="1" />
+                <field field_ref="fqfonte" level="1" />
+                <field field_ref="mrroli" level="1" />
+                <field field_ref="runofflic" level="5" />
+                <field field_ref="taux" level="1" />
+                <field field_ref="tauy" level="1" />
+                <field field_ref="taux_ter" level="1" />
+                <field field_ref="taux_lic" level="1" />
+                <field field_ref="taux_oce" level="1" />
+                <field field_ref="taux_sic" level="1" />
+                <field field_ref="tauy_ter" level="1" />
+                <field field_ref="tauy_lic" level="1" />
+                <field field_ref="tauy_oce" level="1" />
+                <field field_ref="tauy_sic" level="1" />
+                <field field_ref="pourc_ter" level="1" />
+                <field field_ref="pourc_lic" level="1" />
+                <field field_ref="pourc_oce" level="1" />
+                <field field_ref="pourc_sic" level="1" />
+                <field field_ref="fract_ter" level="1" />
+                <field field_ref="fract_lic" level="1" />
+                <field field_ref="fract_oce" level="1" />
+                <field field_ref="fract_sic" level="1" />
+                <field field_ref="tsol_ter" level="1" />
+                <field field_ref="tsol_lic" level="1" />
+                <field field_ref="tsol_oce" level="1" />
+                <field field_ref="tsol_sic" level="1" />
+                <field field_ref="evappot_ter" level="1" />
+                <field field_ref="evappot_lic" level="4" />
+                <field field_ref="evappot_oce" level="4" />
+                <field field_ref="evappot_sic" level="4" />
+                <field field_ref="sens_ter" level="1" />
+                <field field_ref="sens_lic" level="1" />
+                <field field_ref="sens_oce" level="1" />
+                <field field_ref="sens_sic" level="1" />
+                <field field_ref="lat_ter" level="1" />
+                <field field_ref="lat_lic" level="1" />
+                <field field_ref="lat_oce" level="1" />
+                <field field_ref="lat_sic" level="1" />
+                <field field_ref="flw_ter" level="1" />
+                <field field_ref="flw_lic" level="1" />
+                <field field_ref="flw_oce" level="1" />
+                <field field_ref="flw_sic" level="1" />
+                <field field_ref="fsw_ter" level="1" />
+                <field field_ref="fsw_lic" level="1" />
+                <field field_ref="fsw_oce" level="1" />
+                <field field_ref="fsw_sic" level="1" />
+                <field field_ref="wbils_ter" level="1" />
+                <field field_ref="wbils_lic" level="1" />
+                <field field_ref="wbils_oce" level="1" />
+                <field field_ref="wbils_sic" level="1" />
+                <field field_ref="wbilo_ter" level="1" />
+                <field field_ref="wbilo_lic" level="1" />
+                <field field_ref="wbilo_oce" level="1" />
+                <field field_ref="wbilo_sic" level="1" />
+                <field field_ref="wevap_ter" level="1" />
+                <field field_ref="wevap_lic" level="1" />
+                <field field_ref="wevap_oce" level="1" />
+                <field field_ref="wevap_sic" level="1" />
+                <field field_ref="wrain_ter" level="1" />
+                <field field_ref="wrain_lic" level="1" />
+                <field field_ref="wrain_oce" level="1" />
+                <field field_ref="wrain_sic" level="1" />
+                <field field_ref="wsnow_ter" level="1" />
+                <field field_ref="wsnow_lic" level="1" />
+                <field field_ref="wsnow_oce" level="1" />
+                <field field_ref="wsnow_sic" level="1" />
+                <field field_ref="cdrm" level="1" />
+                <field field_ref="cdrh" level="1" />
+                <field field_ref="cldl" level="1" />
+                <field field_ref="cldm" level="1" />
+                <field field_ref="cldh" level="1" />
+                <field field_ref="cldt" level="1" />
+                <field field_ref="cldq" level="1" />
+                <field field_ref="cumCO2" level="5" />  <!-- Added PC -->
+                <field field_ref="lwp" level="1" />
+                <field field_ref="iwp" level="1" />
+                <field field_ref="ue" level="1" />
+                <field field_ref="ve" level="1" />
+                <field field_ref="uq" level="1" />
+                <field field_ref="vq" level="1" />
+                <field field_ref="uwat" level="1" />
+                <field field_ref="vwat" level="1" />
+                <field field_ref="cape" level="1" />
+                <field field_ref="pbase" level="1" />
+                <field field_ref="ptop" level="1" />
+                <field field_ref="fbase" level="1" />
+                <field field_ref="plcl" level="1" />
+                <field field_ref="plfc" level="1" />
+                <field field_ref="wbeff" level="1" />
+                <field field_ref="convoccur" level="10" />
+                <field field_ref="prw" level="1" />
+                <field field_ref="prlw" level="1" />
+                <field field_ref="prsw" level="1" />
+                <field field_ref="s_pblh" level="1" />
+                <field field_ref="s_pblt" level="1" />
+                <field field_ref="s_lcl" level="1" />
+                <field field_ref="s_therm" level="1" />
+                <field field_ref="slab_bils_oce" level="1" />
+                <field field_ref="ale_bl" level="1" />
+                <field field_ref="alp_bl" level="1" />
+                <field field_ref="ale_wk" level="1" />
+                <field field_ref="alp_wk" level="1" />
+                <field field_ref="ale" level="1" />
+                <field field_ref="alp" level="1" />
+                <field field_ref="cin" level="1" />
+                <field field_ref="wape" level="1" />
+                <field field_ref="n2" level="1" />
+                <field field_ref="s2" level="1" />
+                <field field_ref="proba_notrig" level="1" />
+                <field field_ref="random_notrig" level="1" />
+                <field field_ref="cv_gen" level="1" />
+                <field field_ref="ale_bl_stat" level="1" />
+                <field field_ref="ale_bl_trig" level="1" />
+                <field field_ref="alp_bl_det" level="1" />
+                <field field_ref="alp_bl_fluct_m" level="1" />
+                <field field_ref="alp_bl_fluct_tke" level="1" />
+                <field field_ref="alp_bl_conv" level="1" />
+                <field field_ref="alp_bl_stat" level="1" />
+                <field field_ref="colO3_strat" level="2" />     <!-- Added ThL -->
+                <field field_ref="colO3_trop"  level="2" />     <!-- Added ThL -->
+                <field field_ref="flx_co2_ocean"  level="1" />
+                <field field_ref="flx_co2_land"   level="1" />
+                <field field_ref="flx_co2_ocean_cor" level="1" /> <!-- Added PC -->
+                <field field_ref="flx_co2_land_cor"  level="1" /> <!-- Added PC -->
+                <field field_ref="flx_co2_ff"  level="1" />
+                <field field_ref="flx_co2_bb"  level="1" />
+
+                <field_group operation="average" detect_missing_value=".true.">
+                    <field field_ref="u850" level="10" />
+                    <field field_ref="u700" level="10" />
+                    <field field_ref="u500" level="10" />
+                    <field field_ref="u200" level="10" />
+                    <field field_ref="u100" level="10" />
+                    <field field_ref="u50" level="10" />
+                    <field field_ref="u10" level="10" />
+                    <field field_ref="v850" level="10" />
+                    <field field_ref="v700" level="10" />
+                    <field field_ref="v500" level="10" />
+                    <field field_ref="v200" level="10" />
+                    <field field_ref="v100" level="10" />
+                    <field field_ref="v50" level="10" />
+                    <field field_ref="v10" level="10" />
+                    <field field_ref="w850" level="10" />
+                    <field field_ref="w700" level="10" />
+                    <field field_ref="w500" level="10" />
+                    <field field_ref="w200" level="10" />
+                    <field field_ref="w100" level="10" />
+                    <field field_ref="w50" level="10" />
+                    <field field_ref="w10" level="10" />
+                    <field field_ref="t850" level="10" />
+                    <field field_ref="t700" level="10" />
+                    <field field_ref="t500" level="10" />
+                    <field field_ref="t200" level="10" />
+                    <field field_ref="t100" level="10" />
+                    <field field_ref="t50" level="10" />
+                    <field field_ref="t10" level="10" />
+                    <field field_ref="q850" level="10" />
+                    <field field_ref="q700" level="10" />
+                    <field field_ref="q500" level="10" />
+                    <field field_ref="q200" level="10" />
+                    <field field_ref="q100" level="10" />
+                    <field field_ref="q50" level="10" />
+                    <field field_ref="q10" level="10" />
+                    <field field_ref="z850" level="10" />
+                    <field field_ref="z700" level="10" />
+                    <field field_ref="z500" level="10" />
+                    <field field_ref="z200" level="10" />
+                    <field field_ref="z100" level="10" />
+                    <field field_ref="z50" level="10" />
+                    <field field_ref="z10" level="10" />
+                </field_group>
+
+                <field field_ref="t_oce_sic" level="1" />
+                <field field_ref="weakinv" level="10" />
+                <field field_ref="dthmin" level="10" />
+                <field field_ref="u10_ter" level="10" />
+                <field field_ref="u10_lic" level="10" />
+                <field field_ref="u10_oce" level="10" />
+                <field field_ref="u10_sic" level="10" />
+                <field field_ref="v10_ter" level="10" />
+                <field field_ref="v10_lic" level="10" />
+                <field field_ref="v10_oce" level="10" />
+                <field field_ref="v10_sic" level="10" />
+                <field field_ref="rh2m" level="5" />
+                <field field_ref="rh2m_min" level="10" operation="minimum" />
+                <field field_ref="rh2m_max" level="10" operation="maximum" />
+                <field field_ref="qsat2m" level="10" />
+                <field field_ref="tpot" level="10" />
+                <field field_ref="tpote" level="10" />
+                <field field_ref="SWnetOR" level="10" />
+                <field field_ref="SWdownOR" level="10" />
+                <field field_ref="LWdownOR" level="10" />
+                <field field_ref="snowl" level="10" />
+                <field field_ref="cape_max" level="10" operation="maximum" />
+                <field field_ref="solldown" level="10" />
+                <field field_ref="dtsvdfo" level="10" />
+                <field field_ref="dtsvdft" level="10" />
+                <field field_ref="dtsvdfg" level="10" />
+                <field field_ref="dtsvdfi" level="10" />
+                <field field_ref="rugs" level="10" />
+                <field field_ref="z0m" level="10" />
+                <field field_ref="z0h" level="10" />
+                <field field_ref="topswad" level="1" />
+                <field field_ref="topswad0" level="1" />
+                <field field_ref="topswai" level="10" />
+                <field field_ref="solswad" level="10" />
+                <field field_ref="solswad0" level="10" />
+                <field field_ref="solswai" level="10" />
+                <field field_ref="toplwad" level="1" />
+                <field field_ref="toplwad0" level="1" />
+                <field field_ref="toplwai" level="10" />
+                <field field_ref="sollwad" level="10" />
+                <field field_ref="sollwad0" level="10" />
+                <field field_ref="sollwai" level="10" />
+                <field field_ref="od550_ASBCM" level="7" />
+                <field field_ref="od550_ASPOMM" level="7" />
+                <field field_ref="od550_ASSO4M" level="7" />
+                <field field_ref="od550_CSSO4M" level="7" />
+                <field field_ref="od550_SSSSM" level="7" />
+                <field field_ref="od550_ASSSM" level="7" />
+                <field field_ref="od550_CSSSM" level="7" />
+                <field field_ref="od550_CIDUSTM" level="7" />
+                <field field_ref="od550_AIBCM" level="7" />
+                <field field_ref="od550_AIPOMM" level="7" />
+                <field field_ref="od550_ASNO3M" level="7" />
+                <field field_ref="od550_CSNO3M" level="7" />
+                <field field_ref="od550_CINO3M" level="7" />
+                <field field_ref="od550_STRAT" level="2" />
+                <field field_ref="dryod550_ASBCM" level="7" />
+                <field field_ref="dryod550_ASPOMM" level="7" />
+                <field field_ref="dryod550_ASSO4M" level="7" />
+                <field field_ref="dryod550_CSSO4M" level="7" />
+                <field field_ref="dryod550_SSSSM" level="7" />
+                <field field_ref="dryod550_ASSSM" level="7" />
+                <field field_ref="dryod550_CSSSM" level="7" />
+                <field field_ref="dryod550_CIDUSTM" level="7" />
+                <field field_ref="dryod550_AIBCM" level="7" />
+                <field field_ref="dryod550_AIPOMM" level="7" />
+                <field field_ref="dryod550_ASNO3M" level="7" />
+                <field field_ref="dryod550_CSNO3M" level="7" />
+                <field field_ref="dryod550_CINO3M" level="7" />
+                <field field_ref="od550aer" level="2" />
+                <field field_ref="dryod550aer" level="2" />
+                <field field_ref="od865aer" level="2" />
+                <field field_ref="abs550aer" level="2" />
+                <field field_ref="od550lt1aer" level="2" />
+                <field field_ref="sconcso4" level="2" />
+                <field field_ref="sconcoa" level="2" />
+                <field field_ref="sconcbc" level="2" />
+                <field field_ref="sconcss" level="11" />
+                <field field_ref="sconcdust" level="11" />
+                <field field_ref="sconcno3" level="11" />
+                <field field_ref="loadso4" level="11" />
+                <field field_ref="loadoa" level="11" />
+                <field field_ref="loadbc" level="11" />
+                <field field_ref="loadss" level="11" />
+                <field field_ref="loaddust" level="11" />
+                <field field_ref="loadno3" level="11" />
+                <field field_ref="swtoaas_nat" level="11" />
+                <field field_ref="swsrfas_nat" level="11" />
+                <field field_ref="swtoacs_nat" level="11" />
+                <field field_ref="swsrfcs_nat" level="11" />
+                <field field_ref="swtoaas_ant" level="11" />
+                <field field_ref="swsrfas_ant" level="11" />
+                <field field_ref="swtoacs_ant" level="11" />
+                <field field_ref="swsrfcs_ant" level="11" />
+                <field field_ref="swtoacf_nat" level="11" />
+                <field field_ref="swsrfcf_nat" level="11" />
+                <field field_ref="swtoacf_ant" level="11" />
+                <field field_ref="swsrfcf_ant" level="11" />
+                <field field_ref="swtoacf_zero" level="11" />
+                <field field_ref="swsrfcf_zero" level="11" />
+                <field field_ref="cldncl" level="11" />
+                <field field_ref="reffclwtop" level="11" />
+                <field field_ref="cldnvi" level="11" />
+                <field field_ref="lcc" level="11" />
+                <field field_ref="wvapp" level="2" />
+                <field field_ref="albe_ter" level="3" />
+                <field field_ref="albe_lic" level="3" />
+                <field field_ref="albe_oce" level="3" />
+                <field field_ref="albe_sic" level="3" />
+                <field field_ref="ages_ter" level="10" />
+                <field field_ref="ages_lic" level="3" />
+                <field field_ref="ages_oce" level="10" />
+                <field field_ref="ages_sic" level="3" />
+                <field field_ref="snow_ter" level="10" />
+                <field field_ref="snow_lic" level="3" />
+                <field field_ref="snow_oce" level="10" />
+                <field field_ref="snow_sic" level="3" />
+                <field field_ref="rugs_ter" level="3" />
+                <field field_ref="rugs_lic" level="3" />
+                <field field_ref="rugs_oce" level="3" />
+                <field field_ref="rugs_sic" level="3" />
+                <field field_ref="z0m_ter" level="3" />
+                <field field_ref="z0m_lic" level="3" />
+                <field field_ref="z0m_oce" level="3" />
+                <field field_ref="z0m_sic" level="3" />
+                <field field_ref="z0h_ter" level="3" />
+                <field field_ref="z0h_lic" level="3" />
+                <field field_ref="z0h_oce" level="3" />
+                <field field_ref="z0h_sic" level="3" />
+                <field field_ref="alb1" level="3" />
+                <field field_ref="alb2" level="3" />
+                <field field_ref="ftime_con" level="4" operation="instant" />
+                <field field_ref="wake_h" level="4" />
+                <field field_ref="wake_dens" level="4" />
+                <field field_ref="wake_s" level="4" />
+                <field field_ref="epmax" level="2" />
+                <field field_ref="plulth" level="10" />
+                <field field_ref="plulst" level="10" />
+                <field field_ref="lmaxth" level="10" />
+                <field field_ref="ftime_th" level="4" />
+                <field field_ref="ftime_deepcv" level="4" />
+                <field field_ref="f0_th" level="4" />
+                <field field_ref="zmax_th" level="4" />
+                <field field_ref="rsut4co2" level="10" />
+                <field field_ref="rlut4co2" level="10" />
+                <field field_ref="rsutcs4co2" level="10" />
+                <field field_ref="rlutcs4co2" level="10" />
+                <field field_ref="dqphy2d" level="2" />
+                <field field_ref="dqlphy2d" level="2" />
+                <field field_ref="dqsphy2d" level="2" />
+                <field field_ref="dqdyn2d" level="4" />
+                <field field_ref="dqldyn2d" level="4" />
+                <field field_ref="dqsdyn2d" level="4" />
+                <field field_ref="dqcon2d" level="4" />
+                <field field_ref="dqwak2d" level="4" />
+                <field field_ref="dqlsc2d" level="4" />
+                <field field_ref="dqvdf2d" level="4" />
+                <field field_ref="dqeva2d" level="4" />
+                <field field_ref="dqlscth2d" level="10" />
+                <field field_ref="dqlscst2d" level="10" />
+                <field field_ref="dqthe2d" level="4" />
+                <field field_ref="dqajs2d" level="4" />
+            <!-- Begin Added SN isotopes 2D fields 07 2023 -->
+            <!-- water oxygen H216O H217O H218O -->
+                <field field_ref="precipH216O"     level="1" />
+                <field field_ref="plulH216O"       level="1" />
+                <field field_ref="plucH216O"       level="1" />
+                <field field_ref="evapH216O"       level="1" />
+                <field field_ref="evap_terH216O"   level="1" />
+                <field field_ref="evap_licH216O"   level="1" />
+                <field field_ref="evap_oceH216O"   level="1" />
+                <field field_ref="evap_sicH216O"   level="1" />
+                <field field_ref="precipH217O"     level="1" enabled="False"/>
+                <field field_ref="plulH217O"       level="1" />
+                <field field_ref="plucH217O"       level="1" />
+                <field field_ref="evapH217O"       level="1" />
+                <field field_ref="evap_terH217O"   level="1" />
+                <field field_ref="evap_licH217O"   level="1" />
+                <field field_ref="evap_oceH217O"   level="1" />
+                <field field_ref="evap_sicH217O"   level="1" />
+                <field field_ref="precipH218O"     level="1" />
+                <field field_ref="plulH218O"       level="1" />
+                <field field_ref="plucH218O"       level="1" />
+                <field field_ref="evapH218O"       level="1" />
+                <field field_ref="evap_terH218O"   level="1" />
+                <field field_ref="evap_licH218O"   level="1" />
+                <field field_ref="evap_oceH218O"   level="1" />
+                <field field_ref="evap_sicH218O"   level="1" />
+            <!-- water hydrogen HDO HTO -->
+                <field field_ref="precipHDO"    level="1" />
+                <field field_ref="plulHDO"      level="1" />
+                <field field_ref="plucHDO"      level="1" />
+                <field field_ref="evapHDO"      level="1" />
+                <field field_ref="evap_terHDO"  level="1" />
+                <field field_ref="evap_licHDO"  level="1" />
+                <field field_ref="evap_oceHDO"  level="1" />
+                <field field_ref="evap_sicHDO"  level="1" />
+                <field field_ref="precipHTO"    level="1" />
+                <field field_ref="plulHTO"      level="1" />
+                <field field_ref="plucHTO"      level="1" />
+                <field field_ref="evapHTO"      level="1" />
+                <field field_ref="evap_terHTO"  level="1" />
+                <field field_ref="evap_licHTO"  level="1" />
+                <field field_ref="evap_oceHTO"  level="1" />
+                <field field_ref="evap_sicHTO"  level="1" />
+         <!-- end Added SN isotopes 2D fields 07 2023 -->
+ 
+            </field_group>
+
+            <!-- VARS 3D -->
+            <field_group operation="average" grid_ref="grid_out_presnivs">
+                <field field_ref="CO2" level="5" />  <!-- Added PC -->
+                <field field_ref="dCO2_vdf" level="5" />  <!-- Added PC -->
+                <field field_ref="dCO2_the" level="5" />  <!-- Added PC -->
+                <field field_ref="dCO2_con" level="5" />  <!-- Added PC -->
+                <field field_ref="tke" level="7" />
+                <field field_ref="tke_ter" level="10" />
+                <field field_ref="tke_lic" level="10" />
+                <field field_ref="tke_oce" level="10" />
+                <field field_ref="tke_sic" level="10" />
+                <field field_ref="tke_max_ter" level="10" operation="maximum" />
+                <field field_ref="tke_max_lic" level="10" operation="maximum" />
+                <field field_ref="tke_max_oce" level="10" operation="maximum" />
+                <field field_ref="tke_max_sic" level="10" operation="maximum" />
+                <field field_ref="l_mix_ter" level="10" />
+                <field field_ref="l_mix_lic" level="10" />
+                <field field_ref="l_mix_oce" level="10" />
+                <field field_ref="l_mix_sic" level="10" />
+                <field field_ref="l_mixmin_ter" level="10" />
+                <field field_ref="l_mixmin_lic" level="10" />
+                <field field_ref="l_mixmin_oce" level="10" />
+                <field field_ref="l_mixmin_sic" level="10" />
+                <field field_ref="treedrg_ter" level="10" />
+                <field field_ref="treedrg_lic" level="10" />
+                <field field_ref="treedrg_oce" level="10" />
+                <field field_ref="treedrg_sic" level="10" />
+                
+                
+                <field field_ref="cldtau" level="10" />
+                <field field_ref="cldemi" level="10" />
+                <field field_ref="tke_max" level="4" operation="maximum" />
+                <field field_ref="concso4" level="2" />
+                <field field_ref="concoa" level="2" />
+                <field field_ref="concbc" level="2" />
+                <field field_ref="concss" level="2" />
+                <field field_ref="concdust" level="2" />
+                <field field_ref="concno3" level="2" />
+                <field field_ref="ec550aer" level="2" />
+                <field field_ref="lwcon" level="7" />
+                <field field_ref="iwcon" level="7" />
+                <field field_ref="temp" level="1" />
+                <field field_ref="theta" level="3" />
+                <field field_ref="ovap" level="1" />
+                <field field_ref="ovapinit" level="10" />
+                <field field_ref="oliq" level="1" />
+                <field field_ref="ocond" level="1" />
+                <field field_ref="geop" level="3" />
+                <field field_ref="geoph" level="3" />
+                <field field_ref="vitu" level="1" />
+                <field field_ref="vitv" level="1" />
+                <field field_ref="vitw" level="1" />
+                <field field_ref="pres" level="1" />
+                <field field_ref="paprs" level="3" />
+                <field field_ref="mass" level="3" />
+                <field field_ref="zfull" level="1" />
+                <field field_ref="zhalf" level="7" />
+                <field field_ref="rneb" level="1" />
+                <field field_ref="rnebcon" level="7" />
+                <field field_ref="rnebls" level="7" />
+                <field field_ref="rneblsvol" level="7" />
+                <field field_ref="rhum" level="1" />
+                <field field_ref="ozone" level="3" />
+                <field field_ref="ozone_daylight" level="2" />
+                <field field_ref="upwd" level="7" />
+                <field field_ref="ep" level="7" />
+                <field field_ref="duphy" level="7" />
+                <field field_ref="dtphy" level="7" />
+                <field field_ref="dqphy" level="7" />
+                <field field_ref="dqlphy" level="7" />
+                <field field_ref="dqsphy" level="7" />
+                <field field_ref="pr_con_l" level="3" />
+                <field field_ref="pr_con_i" level="3" />
+                <field field_ref="pr_lsc_l" level="3" />
+                <field field_ref="pr_lsc_i" level="3" />
+                <field field_ref="re" level="5" />
+                <field field_ref="fl" level="5" />
+                <field field_ref="scdnc" level="11" />
+                <field field_ref="reffclws" level="11" />
+                <field field_ref="reffclwc" level="11" />
+                <field field_ref="lcc3d" level="11" />
+                <field field_ref="lcc3dcon" level="11" />
+                <field field_ref="lcc3dstra" level="11" />
+                <field field_ref="cldwatmxrat" level="5" />
+                <field field_ref="icc3dcon" level="11" />
+                <field field_ref="icc3dstra" level="11" />
+                <field field_ref="cldicemxrat" level="5" />
+                <field field_ref="clwcon" level="7" />
+                <field field_ref="Ma" level="7" />
+                <field field_ref="dnwd" level="7" />
+                <field field_ref="dnwd0" level="7" />
+                <field field_ref="mc" level="7" />
+                <field field_ref="dtdyn" level="7" />
+                <field field_ref="dqdyn" level="7" />
+                <field field_ref="dqldyn" level="7" />
+                <field field_ref="dqsdyn" level="7" />
+                <field field_ref="dudyn" level="7" />
+                <field field_ref="dvdyn" level="7" />
+                <field field_ref="dtcon" level="7" />
+                <field field_ref="ducon" level="7" />
+                <field field_ref="dvcon" level="7" />
+                <field field_ref="dqcon" level="7" />
+                <field field_ref="dtwak" level="7" />
+                <field field_ref="dqwak" level="7" />
+                <field field_ref="wake_deltat" level="7" />
+                <field field_ref="wake_deltaq" level="7" />
+                <field field_ref="wake_omg" level="7" />
+                <field field_ref="wdtrainA" level="9" />
+                <field field_ref="wdtrainM" level="9" />
+                <field field_ref="ftd" level="7" />
+                <field field_ref="fqd" level="7" />
+                <field field_ref="dtlsc" level="7" />
+                <field field_ref="dtlschr" level="7" />
+                <field field_ref="dqlsc" level="7" />
+                <field field_ref="beta_prec" level="9" />
+                <field field_ref="dtvdf" level="7" />
+                <field field_ref="dtvdf_x" level="11" />
+                <field field_ref="dtvdf_w" level="11" />
+                <field field_ref="dtdis" level="7" />
+                <field field_ref="dqvdf" level="7" />
+                <field field_ref="dqvdf_x" level="11" />
+                <field field_ref="dqvdf_w" level="11" />
+                <field field_ref="dteva" level="7" />
+                <field field_ref="dqeva" level="7" />
+                <field field_ref="dqlscth" level="10" />
+                <field field_ref="dqlscst" level="10" />
+                <field field_ref="dtlscth" level="10" />
+                <field field_ref="dtlscst" level="10" />
+                <field field_ref="ptconvth" level="7" />
+                <field field_ref="ptconv" level="7" />
+                <field field_ref="ratqs" level="7" />
+                <field field_ref="dtthe" level="7" />
+                <field field_ref="e_th" level="9" />
+                <field field_ref="lambda_th" level="10" />
+                <field field_ref="q_th" level="9" />
+                <field field_ref="s_th" level="9" />
+                <field field_ref="s_env" level="9" />
+                <field field_ref="sigma_th" level="9" />
+                <field field_ref="sigma_env" level="9" />
+                <field field_ref="d_th" level="9" />
+                <field field_ref="dqthe" level="7" />
+                <field field_ref="dtajs" level="7" />
+                <field field_ref="dqajs" level="7" />
+                <field field_ref="dtswr" level="7" />
+                <field field_ref="dtsw0" level="7" />
+                <field field_ref="dtlwr" level="7" />
+                <field field_ref="dtlw0" level="7" />
+                <field field_ref="dtec"  level="7" />
+                <field field_ref="duvdf" level="7" />
+                <field field_ref="dvvdf" level="7" />
+                <field field_ref="duoro" level="7" />
+                <field field_ref="dvoro" level="7" />
+                <field field_ref="dulif" level="7" />
+                <field field_ref="dvlif" level="7" />
+                <field field_ref="du_gwd_hines" level="7" />
+                <field field_ref="dv_gwd_hines" level="7" />
+                <field field_ref="du_gwd_front" level="7" />
+                <field field_ref="dv_gwd_front" level="7" />
+                <field field_ref="east_gwstress" level="10" />
+                <field field_ref="west_gwstress" level="10" />
+                <field field_ref="dtoro" level="10" />
+                <field field_ref="dtlif" level="7" />
+                <field field_ref="dthin" level="7" />
+                <field field_ref="tnt"  level="10" />
+                <field field_ref="tntc" level="10" />
+                <field field_ref="tntr" level="10" />
+                <field field_ref="tntscpbl" level="10" />
+                <field field_ref="tnhus"    level="10" />
+                <field field_ref="tnhusc"   level="10" />
+                <field field_ref="tnhusscpbl" level="10" />
+                <field field_ref="h2o" level="10" />
+                <field field_ref="mcd" level="10" />
+                <field field_ref="dmc" level="10" />
+                <field field_ref="ref_liq" level="5" />
+                <field field_ref="ref_ice" level="10" />
+                <field field_ref="stratomask" level="1" />
+                <field field_ref="cool_volc" level="1" />
+                <field field_ref="heat_volc" level="1" />
+		<field field_ref="dqch4"     level="10" />
+             <!-- Begin Added SN isotopes 3D fields 07 2023 -->
+             <!-- water oxygen H216O H217O H218O -->
+                <field field_ref="ovapH216O"   level="1" />
+                <field field_ref="oliqH216O"   level="1" />
+                <field field_ref="ocondH216O"  level="1" />
+                <field field_ref="dqdynH216O"  level="1" />
+                <field field_ref="dqldynH216O" level="1" />
+                <field field_ref="dqconH216O"  level="1" />
+                <field field_ref="dqlscH216O"  level="1" />
+                <field field_ref="dqevaH216O"  level="1" />
+                <field field_ref="dqvdfH216O"  level="1" />
+                <field field_ref="dqajsH216O"  level="1" />
+                <field field_ref="dqtheH216O"  level="1" />
+                <field field_ref="ovapH217O"   level="1" />
+                <field field_ref="oliqH217O"   level="1" />
+                <field field_ref="ocondH217O"  level="1" />
+                <field field_ref="dqdynH217O"  level="1" />
+                <field field_ref="dqldynH217O" level="1" />
+                <field field_ref="dqconH217O"  level="1" />
+                <field field_ref="dqlscH217O"  level="1" />
+                <field field_ref="dqevaH217O"  level="1" />
+                <field field_ref="dqvdfH217O"  level="1" />
+                <field field_ref="dqajsH217O"  level="1" />
+                <field field_ref="dqtheH217O"  level="1" />
+                <field field_ref="ovapH218O"   level="1" />
+                <field field_ref="oliqH218O"   level="1" />
+                <field field_ref="ocondH218O"  level="1" />
+                <field field_ref="dqdynH218O"  level="1" />
+                <field field_ref="dqldynH218O" level="1" />
+                <field field_ref="dqconH218O"  level="1" />
+                <field field_ref="dqlscH218O"  level="1" />
+                <field field_ref="dqevaH218O"  level="1" />
+                <field field_ref="dqvdfH218O"  level="1" />
+                <field field_ref="dqajsH218O"  level="1" />
+                <field field_ref="dqtheH218O"  level="1" />
+            <!-- water hydrogen HDO HTO -->
+                <field field_ref="ovapHDO"   level="1" />
+                <field field_ref="oliqHDO"   level="1" />
+                <field field_ref="ocondHDO"  level="1" />
+                <field field_ref="dqdynHDO"  level="1" />
+                <field field_ref="dqldynHDO" level="1" />
+                <field field_ref="dqconHDO"  level="1" />
+                <field field_ref="dqlscHDO"  level="1" />
+                <field field_ref="dqevaHDO"  level="1" />
+                <field field_ref="dqvdfHDO"  level="1" />
+                <field field_ref="dqajsHDO"  level="1" />
+                <field field_ref="dqtheHDO"  level="1" />
+                <field field_ref="ovapHTO"   level="1" />
+                <field field_ref="oliqHTO"   level="1" />
+                <field field_ref="ocondHTO"  level="1" />
+                <field field_ref="dqdynHTO"  level="1" />
+                <field field_ref="dqldynHTO" level="1" />
+                <field field_ref="dqconHTO"  level="1" />
+                <field field_ref="dqlscHTO"  level="1" />
+                <field field_ref="dqevaHTO"  level="1" />
+                <field field_ref="dqvdfHTO"  level="1" />
+                <field field_ref="dqajsHTO"  level="1" />
+                <field field_ref="dqtheHTO"  level="1" />
+             <!-- End Added SN isotopes 3D fields 07 2023 -->
+            </field_group>
+
+            <field_group operation="average" grid_ref="grid_out_presinter">
+                <field field_ref="a_th" level="9" />
+                <field field_ref="f_th" level="7" />
+                <field field_ref="w_th" level="7" />
+                <field field_ref="rsucs" level="10" />
+                <field field_ref="rsdcs" level="10" />
+                <field field_ref="rlucs" level="10" />
+                <field field_ref="rldcs" level="10" />
+                <field field_ref="rldcs4co2" level="10" />
+                <field field_ref="rlucs4co2" level="10" />
+                <field field_ref="rsdcs4co2" level="10" />
+                <field field_ref="rsucs4co2" level="10" />
+                <field field_ref="rsu4co2" level="10" />
+                <field field_ref="rlu4co2" level="10" />
+                <field field_ref="rsd4co2" level="10" />
+                <field field_ref="rld4co2" level="10" />
+                <field field_ref="Vprecip" level="11" />
+                <field field_ref="rsu" level="5" />
+                <field field_ref="rsd" level="5" />
+                <field field_ref="rlu" level="5" />
+                <field field_ref="rld" level="5" />
+                <field field_ref="kz" level="4" />
+                <field field_ref="kz_max" level="4" operation="maximum" />
+                <field field_ref="evu" level="10" />
+           </field_group>
+
+<!--
+                <field field_ref="psbg" level="5" />
+                <field field_ref="tro3" level="5" />
+                <field field_ref="tro3_daylight" level="5" />
+-->
+
+            <!-- VARS 3D -->
+            <field_group operation="average" grid_ref="grid_out_plev17">
+                <field field_ref="temp" name="ta" grid_ref="grid_out_plev17" level="4" />
+                <field field_ref="geop" name="zg" grid_ref="grid_out_plev17" level="4" />
+                <field field_ref="ovap" name="hus" grid_ref="grid_out_plev17" level="4" />
+                <field field_ref="rhum" name="hur" grid_ref="grid_out_plev17" level="4" />
+                <field field_ref="vitu" name="ua" grid_ref="grid_out_plev17" level="4" />
+                <field field_ref="vitv" name="va" grid_ref="grid_out_plev17" level="4" />
+                <field field_ref="vitw" name="wap" grid_ref="grid_out_plev17" level="4" />
+<!--
+                <field field_ref="tro3" name="tro3" grid_ref="grid_out_plev17" level="4" />
+                <field field_ref="tro3_daylight" name="tro3_daylight" grid_ref="grid_out_plev17" level="4" />
+                <field field_ref="tnondef" name="psbg" grid_ref="grid_out_plev17" level="4" />
+                <field field_ref="vitu_vitv" name="uv" grid_ref="grid_out_plev17" level="4" />
+                <field field_ref="vitv_ovap" name="vq" grid_ref="grid_out_plev17" level="4" />
+                <field field_ref="vitv_temp" name="vT" grid_ref="grid_out_plev17" level="4" />
+                <field field_ref="vitw_ovap" name="wq" grid_ref="grid_out_plev17" level="4" />
+                <field field_ref="vitv_geop" name="vphi" grid_ref="grid_out_plev17" level="4" />
+                <field field_ref="vitw_temp" name="wT" grid_ref="grid_out_plev17" level="4" />
+                <field field_ref="vtiu_vitu" name="u2" grid_ref="grid_out_plev17" level="4" />
+                <field field_ref="vitv_vitv" name="v2" grid_ref="grid_out_plev17" level="4" />
+                <field field_ref="temp_temp" name="T2" grid_ref="grid_out_plev17" level="4" />
+-->
+            </field_group>
+
+            <!-- VARS 3D -->
+            <field_group operation="average" grid_ref="grid_out_spectband">
+                <field field_ref="solbnd" level="10" />
+            </field_group>
+         
+          </field_group>
+
+        </file>
+
+        </file_group>
+    </file_definition>
Index: CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/iso.def
===================================================================
--- CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/iso.def	(revision 6746)
+++ CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/iso.def	(revision 6746)
@@ -0,0 +1,154 @@
+# paramÃštres isotopiques principaux
+
+ok_iso_verif=n
+
+# lambda: supersaturation: valeurs typiques: 0.002. Range possible: 0 (pas de sursat) Ã  0.004 (forte sursat)
+lambda=0.002
+
+# thumxt1: gÃšre le fractionnement cinÃ©tique lors de la rÃ©Ã©vaporation des gouttes. Valeur typique: 0.9. Range possible: 0 (rh au contact des gouttes = rh autour des gouttes, fort fractionnement cinÃ©tique) Ã  1 (rh=1 au contact des gouttes, pas de fractionnement cinÃ©tique)
+thumxt1=0.9
+
+# h_land_ice: hauteur caractÃ©ristique de la glace de terre: la glace de terre Ã  t+1 est Ã©gale Ã  h_land_ice de glace de terre Ã  t + la precip neigeuse en t.
+#Valeur typique: 20m. Range possible: proche de 0 (-> la glace de terre prend la composition de la derniÃšre prÃ©cip neigeuse) Ã  trÃšs grand (-> la compo de la glace de terre est constante)
+h_land_ice=20.
+
+# P_veg: fraction de l evaporation continentale provenant de la transpiration sans fractionnement de la vÃ©gÃ©tation, au lieu de l Ã©vaporation avec fractionnement de sol nu ou d eau libre. Valeur standard: 1 (comme autres GCMs). Range possible: 0 Ã  1.
+P_veg=1.0
+
+# bidouille_anti_divergence: si T: on rappel rÃ©guliÃšrement l isotope H2O16 vers l eau normale. Si F: pas de rappel. En gÃ©nÃ©ral, on met T pour Ãªtre sur, mais on a verifie que Ã§a a peut d importance
+bidouille_anti_divergence=y
+
+# essai_convergence: si T, on fait tout exactement comme pour l eau normale, pour que les 2 versions convergent. Si F, on modifie un peu: ex: initialisations supplÃ©mentaires de variables, on zappe l homogÃ©nÃ©isation sous le nuage dans cv3_yield...
+essai_convergence=n
+
+# initialisation_iso: la faÃ§on dont les isos sont initialisÃ©s.
+#   - Lors du lancement de gcm:
+#	Pour la physique:
+#	0: lecture d un fichier, souvent de start (phyiso_etat0_fichier.F)
+#	>0: initialisation des isotopes acadÃ©mique, donnÃ©e dans phyiso_etat0_dur.F
+#	Pour la dynamique:
+#	0: lecture d un fichier (dyniso_etat0_fichier.F)
+#	>0: initialisation acadÃ©mique:
+#		1: isos Ã  0 sauf H2016=eau normale
+#		2: distill de Rayleigh
+#		3: tout est uniforme au SMOW
+#	En gÃ©nÃ©ral, on met initialisation_iso=0
+#   - Lors du lancement de create_etat0_limit:
+#	Pour la physique: initialisation en dure, toujours
+#	Pour la dynamique: initialisation acadÃ©mique toujours:
+#		1: isos Ã  0 sauf H2016=eau normale
+#		2 ou 0: distill de Rayleigh
+#		3: tout est uniforme au SMOW
+#	En gÃ©nÃ©ral, on laisse Ã  initialisation_iso=0
+initialisation_iso=2
+
+# initialisation_isotrac: comment initialiser les traceurs d'eau?
+# 1: idÃ©alisÃ©: on met toute l'eau dans le tag izone_init, 0 ailleurs
+# 0: en lisant dans un fichier. Possible seulement si initialisation_iso=0
+initialisation_isotrac=1
+
+# modif_sst: 0 par defaut, 1 si on veut modifier la sst de maniÃšre uniforme
+# si 2, on impose un profil de changement de SST, avec 0 entre sstlatcrit et - sstlatcrit en latitude. Ailleurs: +deltaTtestpoles (rlat(ii)**2-sstlatcrit**2) /(90.0**2-sstlatcrit**2)
+# si 2, on impose changement de SST linÃ©aire par morceau: 0 entre sstlatcrit et - sstlatcrit, deltaTtestpoles poleward of sstlatcrit+dsstlatcrit, et linÃ©aire entre les 2.
+modif_sst=0
+
+# deltaTtest: sensibilitÃ© Ã  une variation uniforme de la SST. Utilise seulement si modif_sst=1
+deltaTtest=0.0
+
+deltaTtestpoles=-15.0
+sstlatcrit=30.0
+dsstlatcrit=20.0
+
+# deltaO18_oce: deltaO18 de l'ocÃ©an: ex: +1.1 au LGM, 0 actuellement. On suppose que le dexcess et O17excess ocÃ©an sont nuls.
+deltaO18_oce=0.0
+
+# deltaP_BL:  epaisseur de la couche limite avec laquelle l'eau du sol tend Ã  se rÃ©Ã©quilibrer. Par dÃ©faut: 10mb (optim dans ORCHIDEE_LMDZ)
+deltaP_BL=10.0 
+
+# ruissellement_pluie: qu'est-ce qui ruisselle? si 1: c'est la pluie qui ruisselle. elle ne s'infiltre. elle ne s'infiltre donc jamais dans un sol saturÃ©. si 0: c'est le sol qui ruisselle. La pluie s'inglitre donc dans le sol saturÃ©.
+ruissellement_pluie=1
+
+# alphak_stewart: si 1: alphak=(D/Diso)^nsol. si 0: alphak=1/(1-kcin(vsurf))
+alphak_stewart=1
+
+# tdifexp_sol: tdifexp_sol est l'exposant de D/Diso. Il paramÃ©trise la turbulence. D'abitude, il est de 0.58. Mais d'aprÃšs Mathieu et Bariac, il est entre 0.67 et 1: 0.67 pour les sols secs et 1 pour les sols saturÃ©s.
+tdifexp_sol=0.67
+
+# calendrier_guide: si 1, on fait en sorte que l'annÃ©e puisse avoir 365 ou 366 jours. Si 0, l'annÃ©e Ã  360 jours (c'est LMDZ par dÃ©faut).
+# mettre 1 quand on guide, 0 sinon.
+calendrier_guide=1
+
+# cste_surf_cond: si 2, la tÃ©mprature et la rh de surface sont constantes: rhs=0.7 et Ts=15Â°=288K. si 1: la rh de surface est conste Ã©gale Ã  0.7. Par dÃ©faut, cste_surf_cond=0: tout est explicit.
+cste_surf_cond=0
+
+# lev_histiso
+# niveaux de sorties pour les isotopes et aussi sans les isotopes.
+# Pas encore utilisÃ©
+lev_histiso=1
+
+# lev_histiso_diag
+# ne s applique que si DIAGISO. 1 par defaut. si 0, seul xtvp est outputÃ©
+lev_histiso_diag=1
+
+# deltaD aberrant: si on le dÃ©passe, on plante
+deltalim=1000000.0
+
+# deltaD aberrant pour les traceurs
+deltalimtrac=1000000.0
+dexcess_max=2000
+dexcess_min=-1000
+
+# est-ce qu'on verifie l'O17? 
+O17_verif=y
+o17excess_bas=-1000.0
+o17excess_haut=900.0
+nlevmaxO17=18
+
+# pour que les continents Ã©vaporent une compositon constante, pour voir si les cycles de dexcess en Amazonie sont liÃ©s Ã  la compo de l''Ã©vap sur continent
+# par dÃ©faut: evap_cont_cste=0
+# si evap_cont_cste=1, prÃ©ciser deltaO18 et dexcess de l''Ã©vap
+evap_cont_cste=0
+deltaO18_evap_cont=-5.0
+d_evap_cont=14.0
+
+# quand on utilise tag 17, on taggue la vapeur rÃ©siduelle quand la fraction condensÃ©e est supÃ©rieure Ã  seuil_tag_tmin, c'est Ã  dire quand l'Ã©vÃšnement de condensation affecte suffisemment la compo de la vapeur rÃ©siduelle. Si seuil_tag_tmin=0, le moindre Ã©vÃšnement de condensation mÃªme trÃšs faibel agit sur les tags, et les proportions de sfc, condensat et rev sont presques nulles.
+# par defaut: seuil_tag_tmin=0.01: 1% de condensation <-> 0.1 permil d'effet sur la vapeur rÃ©siduelle.
+seuil_tag_tmin=0.01
+
+# idem pour condensation dans LS: par defaut Ã©gal Ã  seuil_tag_tmin
+seuil_tag_tmin_ls=0.01
+
+# option_seuil_tag_tmin: si 1, on recolorise la vapeur rÃ©siduelle dÃšs que cond/qt>seuil_tag_tmin. Ca taggue bien la vap rÃ©siduelle mais le problÃšme est que plus on humidifie par la microphysique, plus le seuil est facilement attent -> plus on retaggue -> au final, on n'a pas plus de tag mcrophysique alors que c'est la sourec d'humdification.
+# dans l'option 2: on taggue si (cond-qmicro)/((qt-qmicro)>seuil
+option_seuil_tag_tmin=2
+
+# desactivier post-condensational exchanges comme dans Field, Jones et Brown Ã  rÃ©viewer
+no_pce=0
+
+# latitude de taggage des extra-tropiques quand option de taggage nÂ° 20
+# 35.0 par dÃ©faut
+lim_tag20=35.0
+
+# quand tag9, recolorise t'on que le condensat convectif (option 2) ou aussi le condensat starti (otion 1)
+option_cond=2
+
+# quand tag 22, on recolorise la vapeur dans les zones ou precip>lim_precip_tag22
+# 10.0 par dÃ©faut
+lim_precip_tag22=10.0
+
+# quand adv 14, saturation limiter tel que on advec min (q,A_satlim*qs)
+# par defaut, A_satlim=1: c'est le code original de Francis Codron
+# ce param n'a d'effet que quand adv 14.
+A_satlim=0.8
+
+# si ok_restrict_A_satlim=1, alors on n'active adv 14 que dans les extra-tropiques
+# si ok_restrict_A_satlim=2, alors on n'active adv 14 que dans les tropiques
+# si ok_restrict_A_satlim=3, alors on n'active adv 14 nulle part
+ok_restrict_A_satlim=0
+
+slope_limiter=2.0
+# defaut: 2; pour adv 10: 0
+
+#on multiplie par 3 ratqs aux extraropiques si modif_ratqs=1.
+modif_ratqs=0
+
Index: CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/isotopes_params.def
===================================================================
--- CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/isotopes_params.def	(revision 6746)
+++ CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/isotopes_params.def	(revision 6746)
@@ -0,0 +1,49 @@
+&H2O
+
+  params deltaO18_oce=0.0        fac_coeff_eq17_liq=0.529                    \
+         fac_enrichoce18=0.0005  fac_coeff_eq17_ice=0.529                    \
+         talph1_O18=1137.        talps1_O18=11.839       tkcin0_O18=0.006    \
+         talph2_O18=-0.4156      talps2_O18=-0.028244    tkcin1_O18=0.000285 \
+         talph3_O18=-2.0667E-3   tdifrel_O18=1./0.9723   tkcin2_O18=0.00082  \
+         alpha_liq_sol_O18=1.00291
+
+  H216O  alpha=1.000            toce=tnat                            \
+         tnat=1.0000            tcorr=1.0                            \
+         talph1=0.0             talps1=0.0               tkcin0=0.0  \
+         talph2=0.0             talps2=0.0               tkcin1=0.0  \
+         talph3=0.0             tdifrel=1.0              tkcin2=0.0  \
+         alpha_liq_sol=1.0      Rdefault=tnat*1.0        Rmethox=1.0
+
+  H217O  alpha=1.003            toce=tnat*(1.0+deltaO18_oce/1000.0)^pente_MWL          \
+         tnat=40.000e-6         tcorr=1.0+fac_enrichoce18*pente_MWL                    \
+         talph1=talph1_O18      talps1=talps1_O18        tkcin0=tkcin0_O18*fac_kcin    \
+         talph2=talph2_O18      talps2=talps2_O18        tkcin1=tkcin1_O18*fac_kcin    \
+         talph3=talph3_O18      tdifrel=1./0.98555       tkcin2=tkcin2_O18*fac_kcin    \
+         alpha_liq_sol=alpha_liq_sol_O18^fac_coeff_eq17_liq                            \
+         Rdefault=tnat*(1.0-3.15/1000.)                  Rmethox=tnat*(1.0+230./1000.) \              
+         fac_kcin=(tdifrel-1.0)/(tdifrel_O18-1.0)        pente_MWL=0.528
+
+  H218O  alpha=1.006            toce=tnat*(1.0+deltaO18_oce/1000.0)         \
+         tnat=2005.2e-6         tcorr=1.0+fac_enrichoce18                   \
+         talph1=talph1_O18      talps1=talps1_O18        tkcin0=tkcin0_O18  \
+         talph2=talph2_O18      talps2=talps2_O18        tkcin1=tkcin1_O18  \
+         talph3=talph3_O18      tdifrel=tdifrel_O18      tkcin2=tkcin2_O18  \
+         alpha_liq_sol=alpha_liq_sol_O18                                    \
+         Rdefault=tnat*(1.0-6.00/1000.)                  Rmethox=tnat*(1.0+130./1000.)  
+
+  HDO    alpha=1.010            toce=tnat*(1.0+deltaO18_oce/1000.0*pente_MWL)          \
+         tnat=155.76e-6         tcorr=1.0+fac_enrichoce18*pente_MWL                    \
+         talph1=24844.          talps1=16288.            tkcin0=tkcin0_O18*fac_kcin    \
+         talph2=-76.248         talps2=-0.0934           tkcin1=tkcin1_O18*fac_kcin    \
+         talph3=52.612E-3       tdifrel=1./0.9755        tkcin2=tkcin2_O18*fac_kcin    \
+         alpha_liq_sol=1.0212                                                          \
+         Rdefault=tnat*(1.0+(10.0-6.0*pente_MWL)/1000.)  Rmethox=tnat*(1.0-25.0/1000.) \
+         fac_kcin=(tdifrel-1.0)/(tdifrel_O18-1.0)        pente_MWL=8.0
+
+  HTO    alpha=1.000            toce=4.0E-19                               \
+         tnat=0.0000            tcorr=1.0                                  \
+         talph1=46480.          talps1=46480.            tkcin0=0.01056    \
+         talph2=-103.87         talps2=-103.87           tkcin1=0.0005016  \
+         talph3=0.0             tdifrel=1./0.968         tkcin2=0.0014432  \
+         alpha_liq_sol=1.0      Rdefault=0.0             Rmethox=0.0
+
Index: CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/physiq.def_NPv6.2_iso
===================================================================
--- CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/physiq.def_NPv6.2_iso	(revision 6746)
+++ CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/physiq.def_NPv6.2_iso	(revision 6746)
@@ -0,0 +1,538 @@
+#
+# $Id: physiq.def_NPv6.1 3964 2018-07-06 11:44:14Z acosce $
+#
+
+##############################################################
+# PARAMETRES ET CLES DE LA PHYSIQUE LMDZ
+##############################################################
+# D: Valeur par default
+#
+
+###########################################################
+# divers. Devrait aller dans config.def ?
+###########################################################
+##   Si=.T. ,  lecture du fichier limit avec la bonne annee 
+ok_limitvrai=n
+
+###########################################################
+# Parametres couche limite de surface
+###########################################################
+
+          #  ...
+f_cdrag_stable=1
+
+          # Facteur sur les coefficients de trainee terrestres
+f_cdrag_ter=1
+
+          # Vitesse minimum dans les calculs de trainee Cd ( || V || + Vmin )
+min_wind_speed=0.1
+
+          #  Modelisation des bosquets
+ifl_pbltree=1
+Cd_frein=0.016
+
+###########################################################
+# parameter des flux air-mer
+###########################################################
+
+          # Facteur sur les flux sensibles et latent
+          # Introduit pour reduire l evaporation quand on avait z0h=z0m
+          # CONSEILLE : 1
+f_cdrag_oce=1
+
+          # Flag controlant le calcul des z0
+iflag_z0_oce=1
+
+          # Rapport entre les Z0 latent et sensible
+f_z0qh_oce=1.55
+
+          # Activation des rafales : Oui 1 ou non 0
+iflag_gusts=2
+
+          # facteur pour les rafales des thermiques (bounary layer)
+f_gust_bl=0.845
+
+          # facteur pour les poches (wake)
+f_gust_wk=0.2
+
+          # facteur sur qsat pour tenir compte de la salinite
+f_qsat_oce=0.98
+
+          #cdmmax : valeur max de Cd moment. Sur ocean seulement
+cdmmax=0.2
+
+          #cdhmax : valeur max de Cd evap/sensible. Sur ocean seulement
+cdhmax=0.2
+
+####################################################################
+# Couche limite turbulente
+####################################################################
+
+          # Nouvelle version de Mellor et Yamada
+new_yamada4=y
+
+          # Choix du schema numerique pour new_yamada4=y
+          #  1 schema de MAR. Bien pour CL stables mais detruit les stratocu
+          #  5 schema de MAR modifie. Precaunise.
+yamada4_num=5
+
+          # Flag de controle de la couche limite stable
+iflag_corr_sta=4
+
+          # min sur les fonction de stabilite a la surface
+f_ri_cd_min=0.01
+
+          # max du Ric pour Kz. Decouplage plus grand pour Ric plus grand.
+yamada4_ric=0.18
+
+          # Longueur de melange minimum pour Kz
+lmixmin=0
+
+          #shema de la couche de surface (D:1, 1:LMD, 8:Mellor-Yamada) 
+iflag_pbl=12
+
+          # Seuils pour la diffusion turbulente
+ksta_ter=1e-07
+ksta=1e-10
+
+          #ok_kzmin : calcul Kzmin dans la CL de surface (D: y)
+ok_kzmin=n
+
+          # Creation de TKE par orographie sous-maille
+addtkeoro=2
+alphatkeoro=1
+smallscales_tkeoro=y
+
+
+####################################################################
+# Ondes de gravite / Orographie sous maille
+####################################################################
+
+          #  Orodr  ou  non   pour l orographie
+ok_orodr=y
+
+          #  Orolf  ou  non   pour l orographie              
+ok_orolf=y
+
+          #Rugoro : inclusion de l orographie sous maille dans le Cd de surface
+          # Obsolete avec l activation des ondes de gravite
+f_rugoro=0
+
+          # Parametres controlant l effet de l orographie sous maille
+sso_gfrcri=0.7
+sso_gkdrag=0.6
+sso_gkwake=0.4
+sso_gklift=0.1
+
+          # Random gravity waves
+          #Activitate the stochastic parameterization of convective GWs
+          # (should be equal to ok_strato)
+ok_gwd_rando=y
+
+          # Scale the momentum fluxes due to convective GWs
+gwd_rando_ruwmax=0.5
+
+          #Scale the saturated momentum flux of  convective GWs 
+gwd_rando_sat=0.6
+
+          # Important pour controler la periode de la QBO
+gwd_front_ruwmax=3
+
+
+###############################################################
+# Rayonnement
+###############################################################
+          # activation du nouveau code de rayonnement RRTM
+          # 0 : Ancien code et 1 : RRTM (D=0)
+iflag_rrtm=1
+
+          # Nombre de bandes pour le SW. Mettre 2 si iflag_rrtm=0
+NSW=6
+
+    # Albedo et inertie des calottes
+alb_vis_sno_lic=0.96
+alb_nir_sno_lic=0.68
+    # Controle de l'inertie des glaciers et banquises
+    # inertie_sno : pour la neige (y compris sur les points "ter"
+    #      quand orchidee n'est pas actif utilisÃ©)
+    # inertie_lic/sic : pour les "land ice" et "sea ice"
+inertie_sno=350
+    # iflag_sic=1 pour forcer Ã  garder l'inertie des "sea ice"
+    # a inertie_sic meme si la surface est couverte de neige
+iflag_sic=1
+inertie_lic=2000
+inertie_sic=2000
+    # tau_gl = constante de rappel de la temperature a la surface de la glace (en nombre de jours)
+    #     # Utilise celon le forcage : tau_gl=2 pour Amip et tau_gl=1 pour Hadisst2
+tau_gl= _AUTO_ : DEFAULT = 5.
+
+          # ???
+iflag_albedo=1
+
+          # Frequence appel rayonnement. Nombre appels par jour
+nbapp_cv=48
+
+          # Pour pouvoir revenir a un bug purement informatique de duplication
+          # des constantes thermodynamiques entre LMDZ et RRTM
+          # n : FORTEMENT CONSEILLE
+ok_bad_ecmwf_thermo=n
+
+###############################################################
+# Parametres nuages
+###############################################################
+
+          #seuils de la precipitation des nuages strateformes (D: 2.6e-4 2.6e-4)
+cld_lc_lsc=0.00065
+cld_lc_con=0.00065
+
+          #constante de temps pour eleminer eau lsc et convective
+          # (D: 3600. 3600.)
+cld_tau_lsc=900
+cld_tau_con=900
+
+          #facteurs correctifs sur la vitesse de chute des cristaux de glace (D: 1 1)
+ffallv_lsc=0.8
+ffallv_con=0.8
+
+          # coefficient sur la reevaporation de la pluie (D: 2.e-5 n)
+          # regle a 3.e-5 sur des cas de cumulus en 1D
+coef_eva=0.0001
+
+          # flag pour la reevaporation de la pluie
+          # 0: rien
+          # 1: a l ancienne
+          # 2: prend en compte la surface nuageuse max au dessus pour calculer
+          #    le max de reevaporation, comme ecart a la saturation. CONSEILLE
+iflag_evap_prec=2
+
+          # Modification de la plage de temperature pour la phase mixte
+          # liquide/glace des nuages
+          # Controle par les t_glace_min/max, exposant_glace,
+          # iflag_t_glace (D=0)
+t_glace_min=243.15
+t_glace_max=273.15
+exposant_glace=0.5
+iflag_t_glace=3
+
+          # Activation de la thermodynamique de la glace
+iflag_ice_thermo=0
+
+          # normalement elle ne sert plus a rien dans fisrtilp
+          # sinon elle est un peu toxique:
+          # IF (zt(i) .LT. t_coup.and.reevap_ice) zrfln(i)=0. (Jean-Baptiste)
+reevap_ice=n
+
+          #Bergeron
+iflag_bergeron=2
+
+          # temperature dependency of qsat for iterative procedure
+          # temporary flag to switch between the old (CMIP5, D=0)
+          # and new versions (=1) versions 
+iflag_fisrtilp_qsat=4
+
+          #calcul des proprietes des nuages convectifs (D:1 0.375 1.e-4) 
+iflag_cld_th=6
+fact_cldcon=1
+
+          # ?????
+facttemps=0
+
+          #calcul eau condensee et fraction nuageuse a partir des PDF
+          # (D:0, 0:version avec ratqs sinon nouvelles PDFs)  
+iflag_pdf=1
+
+          #calcul epaisseur optique et emmissivite des nuages (D: y 1 0.01 0.3)
+ok_newmicro=y
+
+          # Controle des ratqs grande echelle
+iflag_ratqs=4
+ratqsp0=45000
+ratqsdp=10000
+ratqsbas=0.002
+ratqshaut=0.4
+
+          #rayon effectif pour les nuages de glace (D:35)
+rad_froid=35
+
+          # Rayons effectif des gouttes nuageuses
+          # ACTIF SI ok_cdnc=0 dans config.def. (D~9 a 12 microns)
+rad_chau1=12
+rad_chau2=11
+
+	  # Rayon effectif des gouttes si ok_cdnc=0
+          # Parameters in CDNC-maer link (Boucher&Lohmann 1995)
+bl95_b0=1.3
+bl95_b1=0.2
+
+          #  Choix ou non  de  New oliq               
+new_oliq=y
+
+          # Seuils oliqmax, oicemax (en g/kg).
+          # Au dela on precipite directement au sol
+oliqmax=0.0015
+oicemax=0.0015
+
+          #Rayons min et max effectifs des particules des nuages
+rei_min=16
+rei_max=61.29
+
+          # Distribution vetricale sous maille pour le schema de de nuages.
+          # 0: rien
+          # 1: Premiere version A. Jam,
+          # 2 : J. Jouhaud, parametre cloudth_vert_alpha D=0.5
+          # 3 : J. Jouhaud, parametre cloudth_vert_alpha D=0.5/C= 1.32
+          #                           cloudth_vert_alpha_th C=2:91
+iflag_cloudth_vert=3
+cloudth_vert_alpha=0.5
+cloudth_vert_alpha_th=0.5
+
+
+######################################################################
+# Convection 
+######################################################################
+
+          #Convection scheme switch
+          # (D:2, 1:LMD, 2:Tiedtke, 3:KE New Physics, 30:KE AR4)
+iflag_con=3
+
+          #output level of energy conservation diagnostics
+if_ebil=0
+
+          #maximum efficiency of cld water->precipitation conversion (D: 0.993)
+epmax=0.999
+
+          #dry convective adjustment at beginning of Emanuel convective scheme (D: n 0)
+ok_adj_ema=n
+iflag_clw=0
+
+          #Convective closure (D:1, 0:AR4, 2:ALE and ALP)
+iflag_clos=2
+
+          #Convective entrainment mixing law (D:1, 0:AR4=flat PDF, 1=PDF)
+iflag_mix=1
+
+          #weights of the bell shaped and flat PDF (used only if iflag_mix=1) (D: 1 0)
+qqa1=1
+qqa2=0
+
+          #Parameters of the bell shaped PDF; Fmax=center (D= 0.65), Gammas=width (D=0.05)
+cvl_corr=1
+
+          #Multiplicative factor of Emanuel convective scheme precipitation (D: 1.)
+Fmax=0.65
+
+          #altitude, in hPa, above LCL at which buoybase is computed,
+          # def = original: -40
+dpbase=-40
+
+          #reference fractional area of precipitating downdraughts,
+          # def = original: 0.01
+sigdz=0.003
+
+          #unsaturated fraction of precipitating downdraughts, def = original: 0.15
+spfac=0.15
+
+          #relaxation time of cloud base mass flux, def = original: 8000
+tau=8000
+
+          #flag for wb (= vert velocity at LFC);
+          # 0->wb=wbmax, 1->wb=f(plfc) bounded, 2->wb=f(plfc) linear, D=1
+          # Si iflag_wb>=10 : wbeff_min=iflag_wb*0.1
+          # wbmax : assymptotic value 
+flag_wb=50
+wbmax=2.8
+
+          # Divers tests
+ok_convstop=n
+tau_stop=15000
+ok_intermittent=n
+
+          # nouvel epluchage de C.Rio
+          #shedding coefficient (used when iflag_mix_adiab=1)
+iflag_mix_adiab=0
+coef_peel=0.25
+
+          #Conversion cld water->precip: Ep=f(pressure) if 0; Ep=f(temperature)
+          #if 1, def=1
+flag_epKEorig=1
+
+          # Case : flag_epKEorig=1
+          # elcrit : max condensed water concentration in kg/kg, D=0.0003,
+          # tlcrit : temperature in degre Celsius, at which Ep=Epmax, D=-55. (original)
+          # original: 0.0011, used only if flag_epKEorig=1
+elcrit=0.0003
+tlcrit=-55
+
+          # Case : flag_epKEorig=0
+          # pbcrit : pressure (hPa), above LCL below which Ep=0, D=150 (original)
+          # ptcrit : pressure (hPa), above LCL above which Ep=Epmax, D=500 (original)
+pbcrit=150
+ptcrit=500
+
+          # Prevent some crashes
+          # Filter out bad wakes
+flag_wk_check_trgl=n
+iflag_wk_check_trgl=2
+iflag_alp_wk_cond=1
+
+
+          # Check whether parcel level temperature and specific humidity
+          # are reasonable and demand that LCL be high enough
+cv_flag_feed=2
+
+          # save 20% CPU 
+ok_optim_yield=y
+
+          # Convective clouds
+iflag_cld_cv=0
+
+          # To get back to bug where convective output variables
+          # were set to 0 at the start of the physics
+ok_bug_cv_trac=_AUTO_: DEFAULT = n
+
+##########################################################
+# Fermeture convective et couplages
+##########################################################
+
+          # Appel separe des thermiques 
+iflag_pbl_split=10
+
+          #rendement sur la puissance fournie par les thermiques a la convection
+alp_bl_k=0.5
+
+          #Constant value to be added to Alp (D: 0.)
+alp_offset=0
+
+          #Convection must reach a level at which T<t_top_max to be active
+t_top_max=1000
+
+          ### nrlmd le 10/04/2012: Declenchement ###
+          #Declenchement par couche-limite (0: deterministe, 1: stochastique)
+iflag_trig_bl=1
+
+          #Surface critique au LCL
+s_trig=12000000
+
+          #Temps de decorrelation entre scenes de cumulus
+tau_trig_shallow=1200
+
+          #Temps de decorrelation entre scenes de cumulonimbus
+tau_trig_deep=1200
+
+          # Pour la stabilisation
+random_notrig_max=0.99
+
+          # Temperature a la quelle on fond les descentes glacees
+tmax_fonte_cv=278.15
+
+          #Fermeture par couche-limite (Nicolas Rochetin)
+          #(0: deterministe, 1: statistique, 2: statistique+convergence
+          # grande echelle)
+iflag_clos_bl=1
+
+          #coefficient in Wape->C_star formula: C_star=stark*sqrt(2*Wape),
+          # def: 0.33
+stark=0.33
+
+          #lifting efficiency of wakes; Alp=Alpk*Fip, Fip=power provided
+          # by wakes, def: 0.25
+alpk=0.25
+
+#
+##########################################################
+# Couche limite convective / modele du thermique
+##########################################################
+
+          # Convection seche (D:0, 0:ajustement sec,=>1:modele du thermique) 
+iflag_thermals=18
+
+          # pas de temps du spliting pour les thermiques
+          # TOURNE MAIS POSE PLUS DE PROBLEME QU ELLE N EN RESOUD
+nsplit_thermals=1
+
+          # tau_thermals pour avoir une constante de temps sur les thermiques.
+          # Non valide
+tau_thermals=0
+
+          # Flag controlant le detrainement et l entrainement
+iflag_thermals_ed=8
+
+          # On va chercher l air a z * ( 1+fact_thermals_ed_dz) pour calculer
+          # le detrainement (A. Jam)
+fact_thermals_ed_dz=0.07
+
+          # Une option de plus sur les thermiques.
+iflag_thermals_optflux=0
+
+          #couplage ou non avec la convection
+iflag_coupl=5
+
+          # Seuil pour desactiver les thermiques en cas de forte inversion
+          # en sommet de couche limite. Actif si iflag_thermals impair.
+seuil_inversion=-0.08
+
+          # Reactivation du calcul d un zmax continu pour les thermiques
+          # reactivation d une fermeture humide des thermiques
+          # iflag_thermals_closure=2 (D=1)
+iflag_thermals_closure=2
+
+
+##########################################################
+# Flags wakes
+##########################################################
+
+          #Wake scheme switch (D:0, 0:AR4, 1:New Physics)
+iflag_wake=1
+
+          #multiplicative factor of the damping by gravity waves, def: 4.
+coefgw=4
+
+          #wake density = number of wake centers per m2, def: 8.E-12
+          #wdens_ref=8.E-12
+wdens_ref_o=1e-09
+wdens_ref_l=8e-12
+
+          # Ajustement convectif prealable au calcul des poches
+ok_adjwk=y
+
+
+####################################################################
+#  Conservation 
+####################################################################
+          # The source terms of the TKE prognostic equation are diagnosed
+# from tendencies (du, dv, dT) 
+          # associated with subrgrid scaleamotions and treated as an 
+          # additional heat source.
+          # Controled by a key, iflag_ener_conserv (D=-1):
+          # 0 : no conservation, -1 : old adhoc correction for kinetic E only
+          # (used for CMIP5) 
+          # 1 : conservation, 101 : conversion from kinetic to heat only,
+          # 110 conversion from potential to heat only
+iflag_ener_conserv=10
+
+          #Activation of corrections for water conservation (D: n). 
+          ##The default is n for compatibility with earlier versions.
+          ##generally it should be y.
+ok_conserv_q=y
+
+fl_cor_ebil=1
+
+####################################################################
+# Ozone
+####################################################################
+          # new treatment for ozone into the tropopause
+adjust_tropopause=y
+
+####################################################################
+#  Conservation de l'eau
+#####################################################################
+          # conservation de l eau sur les calottes
+ok_lic_cond=y
+####################################################################
+
+cdnc_min=10.
+          #min cloud droplet number concentration 
+ok_bug_split_th=n
+          # correct a bug in thermal splitting
+keepbug_ice_frac=n
+          # correct convection bug
Index: CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/physiq.def_NPv6.3_iso
===================================================================
--- CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/physiq.def_NPv6.3_iso	(revision 6746)
+++ CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/physiq.def_NPv6.3_iso	(revision 6746)
@@ -0,0 +1,597 @@
+#
+# $Id: physiq.def_NPv6.1 3964 2018-07-06 11:44:14Z acosce $
+#
+
+##############################################################
+# PARAMETRES ET CLES DE LA PHYSIQUE LMDZ
+##############################################################
+# D: Valeur par default
+#
+
+###########################################################
+# divers. Devrait aller dans config.def ?
+###########################################################
+##   Si=.T. ,  lecture du fichier limit avec la bonne annee 
+ok_limitvrai=n
+
+###########################################################
+# Parametres couche limite de surface
+###########################################################
+
+          #  ...
+f_cdrag_stable=1
+
+          # Facteur sur les coefficients de trainee terrestres
+f_cdrag_ter=1
+
+          # Vitesse minimum dans les calculs de trainee Cd ( || V || + Vmin )
+min_wind_speed=0.1
+
+          #  Modelisation des bosquets
+ifl_pbltree=1
+Cd_frein=0.016
+
+###########################################################
+# parameter des flux air-mer
+###########################################################
+
+          # Facteur sur les flux sensibles et latent
+          # Introduit pour reduire l evaporation quand on avait z0h=z0m
+          # CONSEILLE : 1
+f_cdrag_oce=1
+
+          # Flag controlant le calcul des z0
+iflag_z0_oce=1
+
+          # Rapport entre les Z0 latent et sensible
+f_z0qh_oce=1.55
+
+          # Activation des rafales : Oui 1 ou non 0
+iflag_gusts=2
+
+          # facteur pour les rafales des thermiques (bounary layer)
+f_gust_bl=0.845
+
+          # facteur pour les poches (wake)
+f_gust_wk=0.2
+
+          # facteur sur qsat pour tenir compte de la salinite
+f_qsat_oce=0.98
+
+          #cdmmax : valeur max de Cd moment. Sur ocean seulement
+cdmmax=0.2
+
+          #cdhmax : valeur max de Cd evap/sensible. Sur ocean seulement
+cdhmax=0.2
+
+####################################################################
+# Couche limite turbulente
+####################################################################
+
+          # Nouvelle version de Mellor et Yamada
+new_yamada4=y
+
+          # Choix du schema numerique pour new_yamada4=y
+          #  1 schema de MAR. Bien pour CL stables mais detruit les stratocu
+          #  5 schema de MAR modifie. Precaunise.
+yamada4_num=5
+
+          # Flag de controle de la couche limite stable
+iflag_corr_sta=4
+
+          # min sur les fonction de stabilite a la surface
+f_ri_cd_min=0.01
+
+          # max du Ric pour Kz. Decouplage plus grand pour Ric plus grand.
+yamada4_ric=0.18
+
+          # Longueur de melange minimum pour Kz
+lmixmin=0
+
+          #shema de la couche de surface (D:1, 1:LMD, 8:Mellor-Yamada) 
+iflag_pbl=12
+
+          # Seuils pour la diffusion turbulente
+ksta_ter=1e-07
+ksta=1e-10
+
+          #ok_kzmin : calcul Kzmin dans la CL de surface (D: y)
+ok_kzmin=n
+
+          # Creation de TKE par orographie sous-maille
+addtkeoro=2
+alphatkeoro=1
+smallscales_tkeoro=y
+
+
+####################################################################
+# Ondes de gravite / Orographie sous maille
+####################################################################
+
+          #  Orodr  ou  non   pour l orographie
+ok_orodr=y
+
+          #  Orolf  ou  non   pour l orographie              
+ok_orolf=y
+
+          #Rugoro : inclusion de l orographie sous maille dans le Cd de surface
+          # Obsolete avec l activation des ondes de gravite
+f_rugoro=0
+
+          # Parametres controlant l effet de l orographie sous maille
+sso_gfrcri=0.7
+sso_gkdrag=0.6
+sso_gkwake=0.4
+sso_gklift=0.1
+
+          # Random gravity waves
+          #Activitate the stochastic parameterization of convective GWs
+          # (should be equal to ok_strato)
+ok_gwd_rando=y
+
+          # Scale the momentum fluxes due to convective GWs
+gwd_rando_ruwmax=0.5
+
+          #Scale the saturated momentum flux of  convective GWs 
+gwd_rando_sat=0.6
+
+          # Important pour controler la periode de la QBO
+gwd_front_ruwmax=3
+
+
+###############################################################
+# Rayonnement
+###############################################################
+          # activation du nouveau code de rayonnement RRTM
+          # 0 : Ancien code et 1 : RRTM (D=0)
+iflag_rrtm=1
+
+          # Nombre de bandes pour le SW. Mettre 2 si iflag_rrtm=0
+NSW=6
+
+    # Albedo et inertie des calottes
+alb_vis_sno_lic=0.96
+alb_nir_sno_lic=0.68
+    # Controle de l'inertie des glaciers et banquises
+    # inertie_sno : pour la neige (y compris sur les points "ter"
+    #      quand orchidee n'est pas actif)
+    # inertie_lic/sic : pour les "land ice" et "sea ice"
+inertie_sno=350
+    # iflag_sic=1 pour forcer a garder l'inertie des "sea ice"
+    # a inertie_sic meme si la surface est couverte de neige
+iflag_sic=1
+inertie_lic=2000
+inertie_sic=2000
+    # tau_gl = constante de rappel de la temperature a la surface de la glace (en nombre de jours)
+    # Utilise selon le forcage : tau_gl=5 pour Clim, tau_gl=2 pour Amip et tau_gl=1 pour Hadisst2
+tau_gl=2
+
+          # ???
+iflag_albedo=1
+
+          # Frequence appel convection. Nombre appels par jour
+          # (nbapp_cv=0 ==> appel tous les pas de temps)
+nbapp_cv=48
+
+          # Pour pouvoir revenir a un bug purement informatique de duplication
+          # des constantes thermodynamiques entre LMDZ et RRTM
+          # n : FORTEMENT CONSEILLE
+ok_bad_ecmwf_thermo=n
+
+###############################################################
+# Parametres nuages
+###############################################################
+
+          #seuils de la precipitation des nuages stratiformes (D: 2.6e-4 2.6e-4)
+cld_lc_lsc=0.00065
+cld_lc_con=0.00065
+
+          #constante de temps pour eliminer eau lsc et convective
+          # (D: 3600. 3600.)
+cld_tau_lsc=900
+cld_tau_con=900
+
+          #facteurs correctifs sur la vitesse de chute des cristaux de glace (D: 1 1)
+ffallv_lsc=0.8
+ffallv_con=0.8
+
+          # coefficient sur la reevaporation de la pluie (D: 2.e-5 n)
+          # regle a 3.e-5 sur des cas de cumulus en 1D
+coef_eva=0.0001
+
+          # flag pour la reevaporation de la pluie
+          # 0: rien
+          # 1: a l ancienne
+          # 2: prend en compte la surface nuageuse max au dessus pour calculer
+          #    le max de reevaporation, comme ecart a la saturation. CONSEILLE
+iflag_evap_prec=2
+
+          # Modification de la plage de temperature pour la phase mixte
+          # liquide/glace des nuages
+          # Controle par les t_glace_min/max, exposant_glace,
+          # iflag_t_glace (D=0)
+t_glace_min=243.15
+t_glace_max=273.15
+exposant_glace=0.5
+iflag_t_glace=3
+
+          # Activation de la thermodynamique de la glace
+iflag_ice_thermo=0
+
+          # normalement elle ne sert plus a rien dans fisrtilp
+          # sinon elle est un peu toxique:
+          # IF (zt(i) .LT. t_coup.and.reevap_ice) zrfln(i)=0. (Jean-Baptiste)
+reevap_ice=n
+
+          #Bergeron
+iflag_bergeron=2
+
+          # temperature dependency of qsat for iterative procedure
+          # temporary flag to switch between the old (CMIP5, D=0)
+          # and new versions (=1) versions 
+iflag_fisrtilp_qsat=4
+
+          #calcul des proprietes des nuages convectifs (D:1 0.375 1.e-4) 
+iflag_cld_th=6
+fact_cldcon=1
+
+          # ?????
+facttemps=0
+
+          #calcul eau condensee et fraction nuageuse a partir des PDF
+          # (D:0, 0:version avec ratqs sinon nouvelles PDFs)  
+iflag_pdf=1
+
+          #calcul epaisseur optique et emmissivite des nuages (D: y 1 0.01 0.3)
+ok_newmicro=y
+
+          # Controle des ratqs grande echelle
+iflag_ratqs=4
+ratqsp0=45000
+ratqsdp=10000
+ratqsbas=0.002
+ratqshaut=0.4
+
+          #rayon effectif pour les nuages de glace (D:35)
+rad_froid=35
+
+          # Rayons effectif des gouttes nuageuses
+          # ACTIF SI ok_cdnc=0 dans config.def. (D~9 a 12 microns)
+rad_chau1=12
+rad_chau2=11
+
+	  # Rayon effectif des gouttes si ok_cdnc=0
+          # Parameters in CDNC-maer link (Boucher&Lohmann 1995)
+bl95_b0=1.3
+bl95_b1=0.2
+
+          #  Choix ou non  de  New oliq               
+new_oliq=y
+
+          # Seuils oliqmax, oicemax (en g/kg).
+          # Au dela on precipite directement au sol
+oliqmax=0.0015
+oicemax=0.0015
+
+          #Rayons min et max effectifs des particules des nuages
+rei_min=16
+rei_max=61.29
+
+          # Distribution vetricale sous maille pour le schema de de nuages.
+          # 0: rien
+          # 1: Premiere version A. Jam,
+          # 2 : J. Jouhaud, parametre cloudth_vert_alpha D=0.5
+          # 3 : J. Jouhaud, parametre cloudth_vert_alpha D=0.5/C= 1.32
+          #                           cloudth_vert_alpha_th C=2:91
+iflag_cloudth_vert=3
+cloudth_vert_alpha=0.5
+cloudth_vert_alpha_th=0.5
+
+
+######################################################################
+# Convection 
+######################################################################
+
+          #Convection scheme switch
+          # (D:2, 1:LMD, 2:Tiedtke, 3:KE New Physics, 30:KE AR4)
+iflag_con=3
+
+          # correct convection bug
+          #(default = y)
+keepbug_ice_frac=n
+
+          #output level of energy conservation diagnostics
+if_ebil=0
+
+          #maximum efficiency of cld water->precipitation conversion (D: 0.993)
+epmax=0.999
+
+          #dry convective adjustment at beginning of Emanuel convective scheme (D: n 0)
+ok_adj_ema=n
+iflag_clw=0
+
+          #Convective closure (D:1, 0:AR4, 2:ALE and ALP)
+iflag_clos=2
+
+          #Convective entrainment mixing law (D:1, 0:AR4=flat PDF, 1=PDF)
+iflag_mix=1
+
+          #weights of the bell shaped and flat PDF (used only if iflag_mix=1) (D: 1 0)
+qqa1=1
+qqa2=0
+
+          #Parameters of the bell shaped PDF; Fmax=center (D= 0.65), Gammas=width (D=0.05)
+cvl_corr=1
+
+          #Multiplicative factor of Emanuel convective scheme precipitation (D: 1.)
+Fmax=0.65
+
+          #altitude, in hPa, above LCL at which buoybase is computed,
+          # def = original: -40
+dpbase=-40
+
+          #reference fractional area of precipitating downdraughts,
+          # def = original: 0.01
+sigdz=0.003
+
+          #unsaturated fraction of precipitating downdraughts, def = original: 0.15
+spfac=0.15
+
+          #relaxation time of cloud base mass flux, def = original: 8000
+tau=8000
+
+          #flag for wb (= vert velocity at LFC);
+          # 0->wb=wbmax, 1->wb=f(plfc) bounded, 2->wb=f(plfc) linear, D=1
+          # Si iflag_wb>=10 : wbeff_min=iflag_wb*0.1
+          # wbmax : assymptotic value 
+flag_wb=50
+wbmax=2.8
+
+          # Divers tests
+ok_convstop=n
+tau_stop=15000
+ok_intermittent=n
+
+          # nouvel epluchage de C.Rio
+          #shedding coefficient (used when iflag_mix_adiab=1)
+iflag_mix_adiab=0
+coef_peel=0.25
+
+          #Conversion cld water->precip: Ep=f(pressure) if 0; Ep=f(temperature)
+          #if 1, def=1
+flag_epKEorig=1
+
+          # Case : flag_epKEorig=1
+          # elcrit : max condensed water concentration in kg/kg, D=0.0003,
+          # tlcrit : temperature in degre Celsius, at which Ep=Epmax, D=-55. (original)
+          # original: 0.0011, used only if flag_epKEorig=1
+elcrit=0.0003
+tlcrit=-55
+
+          # Case : flag_epKEorig=0
+          # pbcrit : pressure (hPa), above LCL below which Ep=0, D=150 (original)
+          # ptcrit : pressure (hPa), above LCL above which Ep=Epmax, D=500 (original)
+pbcrit=150
+ptcrit=500
+
+          # Precipitation ejection from adiabatic ascents
+          # cvflag_prec_eject: when TRUE ejection is activated. Default: False
+          # WARNING ! : cvflag_prec_eject=y is effective only if icvflag_Tpa=1
+          # ejectliq : 0. =>liquid precipitation is carried up in the adiab updraughts
+          #            1. =>liquid precipitation is ejected from adiab updraughts
+          # ejectice   0. =>solid precipitation is carried up in the adiab updraughts
+          #            1. =>solid precipitation is ejected from adiab updraughts
+          # ejectliq may take only 0. and 1. values
+          # ejectice may take any value between 0. and 1.
+          #   Default : cvflag_prec_eject=n, ejectliq=0., ejectice=0.
+cvflag_prec_eject=n
+ejectliq=0.
+ejectice=0.
+
+          # Check whether parcel level temperature and specific humidity
+          # are reasonable and demand that LCL be high enough
+cv_flag_feed=2
+
+          # save 20% CPU 
+ok_optim_yield=y
+
+          # Convective clouds
+iflag_cld_cv=0
+
+          # To get back to bug where convective output variables
+          # were set to 0 at the start of the physics
+ok_bug_cv_trac=n
+
+           # solving of the temperature equation for the adiabatic ascent
+           # 0 -> AJ scheme in two loops ; ice fraction given by envt. temp.
+           # 1 -> JYG scheme in one loop ; ice fraction given by envt. temp.
+           # 2 -> JYG scheme in one loop ; ice fraction given by adiab. asc. temp.
+           # Default: 0
+           # 2 is costly and ill tested; experts only.
+icvflag_Tpa=0
+
+           # taking into account the dependence of qv on qt at saturation
+           # Default: n
+qsat_depends_on_qt=n
+
+##########################################################
+# Fermeture convective et couplages
+##########################################################
+
+          # Decimal code:  + first digit drives the splitting of thermals: 
+          #                                0 = thermals see the average profiles of T and q
+          #                                1 = thermals are only outside wakes
+          #                + second digit drives the splitting of diffuse PBL:
+          #                                0 = The diffuse PBL sees the average profiles of T and q
+          #                                1 = Two BLs, one in (w) and one in (x), with the same
+          #                                    surface temperature and humidity.
+          #                                2 = Two BLs, one in (w) and one in (x), with separate
+          #                                    surface temperature and humidity.
+          #                                3 = same as 1 over ocean; same as 0 everywhere else.
+          # Example: iflag_pbl_split=12 => thermals outside wakes, split BL with Tsurf and qsurf difference
+          # iflag_pbl_split=10 => thermals outside wakes
+iflag_pbl_split=10
+
+          #rendement sur la puissance fournie par les thermiques a la convection
+alp_bl_k=0.5
+
+          #Constant value to be added to Alp (D: 0.)
+alp_offset=0
+
+          #Convection must reach a level at which T<t_top_max to be active
+t_top_max=1000
+
+          ### nrlmd le 10/04/2012: Declenchement ###
+          #Declenchement par couche-limite (0: deterministe, 1: stochastique)
+iflag_trig_bl=1
+
+          #Surface critique au LCL
+s_trig=12000000
+
+          #Temps de decorrelation entre scenes de cumulus
+tau_trig_shallow=1200
+
+          #Temps de decorrelation entre scenes de cumulonimbus
+tau_trig_deep=1200
+
+          # Pour la stabilisation
+random_notrig_max=0.99
+
+          # Temperature a la quelle on fond les descentes glacees
+tmax_fonte_cv=278.15
+
+          #Fermeture par couche-limite (Nicolas Rochetin)
+          #(0: deterministe, 1: statistique, 2: statistique+convergence
+          # grande echelle)
+iflag_clos_bl=1
+
+          #coefficient in Wape->C_star formula: C_star=stark*sqrt(2*Wape),
+          # def: 0.33
+stark=0.33
+
+          #lifting efficiency of wakes; Alp=Alpk*Fip, Fip=power provided
+          # by wakes, def: 0.25
+alpk=0.25
+
+#
+##########################################################
+# Couche limite convective / modele du thermique
+##########################################################
+
+          # Convection seche (D:0, 0:ajustement sec,=>1:modele du thermique) 
+iflag_thermals=18
+
+          # pas de temps du spliting pour les thermiques
+          # TOURNE MAIS POSE PLUS DE PROBLEME QU ELLE N EN RESOUD
+nsplit_thermals=1
+
+          # tau_thermals pour avoir une constante de temps sur les thermiques.
+          # Non valide
+tau_thermals=0
+
+          # Flag controlant le detrainement et l entrainement
+iflag_thermals_ed=8
+
+          # On va chercher l air a z * ( 1+fact_thermals_ed_dz) pour calculer
+          # le detrainement (A. Jam)
+fact_thermals_ed_dz=0.07
+
+          # Une option de plus sur les thermiques.
+iflag_thermals_optflux=0
+
+          #couplage ou non avec la convection
+iflag_coupl=5
+
+          # Seuil pour desactiver les thermiques en cas de forte inversion
+          # en sommet de couche limite. Actif si iflag_thermals impair.
+seuil_inversion=-0.08
+
+          # Reactivation du calcul d un zmax continu pour les thermiques
+          # reactivation d une fermeture humide des thermiques
+          # iflag_thermals_closure=2 (D=1)
+iflag_thermals_closure=2
+
+          # Flag permettant de garder le bug induisant des wake_deltaT non nuls
+          # a partir des tendances des thermiques, meme en l'absence de poches.
+          # Default : ok_bug_split_th=y ==> le bug est maintenu
+ok_bug_split_th=n
+
+          # contribution of buoyancy to the plume acceleration
+thermals_afact=.66666666666666666666
+
+          # drag term in the plume acceleration
+thermals_fact_epsilon=0.002
+
+          # scaling factor for entrainment and detrainment
+thermals_betalpha=0.9
+
+          # width of the environment subgrid scale water distribution
+cloudth_sigma1s_factor=1.1
+
+##########################################################
+# Flags wakes
+##########################################################
+
+          #Wake scheme switch (D:0, 0:AR4, 1:New Physics)
+iflag_wake=1
+
+          #multiplicative factor of the damping by gravity waves, def: 4.
+coefgw=4
+
+          #wake density = number of wake centers per m2, def: 8.E-12
+          #wdens_ref=8.E-12
+wdens_ref_o=1e-09
+wdens_ref_l=8e-12
+
+          # Ajustement convectif prealable au calcul des poches
+ok_adjwk=y
+
+          # Prevent some crashes
+          # Filter out bad wakes
+flag_wk_check_trgl=n
+iflag_wk_check_trgl=2
+iflag_alp_wk_cond=1
+
+          #Wake population dynamic switch (D:0):
+          # iflag_wk_pop_dyn=0 ==> wake_dens is set to wdens_ref
+          # iflag_wk_pop_dyn=1 ==> wake_dens is a prognostic variable
+iflag_wk_pop_dyn=0
+
+####################################################################
+#  Conservation 
+####################################################################
+          # The source terms of the TKE prognostic equation are diagnosed
+          # from tendencies (du, dv, dT) 
+          # associated with subrgrid scaleamotions and treated as an 
+          # additional heat source.
+          # Controled by a key, iflag_ener_conserv (D=-1):
+          # 0 : no conservation, -1 : old adhoc correction for kinetic E only
+          # (used for CMIP5) 
+          # 1 : conservation, 101 : conversion from kinetic to heat only,
+          # 110 conversion from potential to heat only
+iflag_ener_conserv=10
+
+          #Activation of corrections for water conservation (D: n). 
+          ##The default is n for compatibility with earlier versions.
+          ##generally it should be y.
+ok_conserv_q=y
+
+fl_cor_ebil=1
+
+####################################################################
+# Ozone
+####################################################################
+          # new treatment for ozone into the tropopause
+adjust_tropopause=y
+
+####################################################################
+#  Conservation de l'eau
+#####################################################################
+          # conservation de l eau sur les calottes
+ok_lic_cond=y
+####################################################################
+          #min cloud droplet number concentration
+cdnc_min=10.
+          # Activation condensation de grande echelle epuree par E.Vignon : ok_new_lscp=y + ok_icefra_lscp=y
+ok_new_lscp=n
+ok_icefra_lscp=n
Index: CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/run.def_iso
===================================================================
--- CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/run.def_iso	(revision 6746)
+++ CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/run.def_iso	(revision 6746)
@@ -0,0 +1,64 @@
+# $Id$
+#
+#INCLUDEDEF=run_dynamico.def
+#INCLUDEDEF=earth_const.def
+INCLUDEDEF=physiq.def
+INCLUDEDEF=gcm.def
+INCLUDEDEF=vert.def
+#INCLUDEDEF=orchidee.def
+#INCLUDEDEF=orchidee_pft.def
+INCLUDEDEF=config.def
+#INCLUDEDEF=reprobus.def
+INCLUDEDEF=guide.def
+#INCLUDEDEF=inca.def
+INCLUDEDEF=iso.def
+## Type de calendrier utilise
+## valeur possible: earth_360d (defaut), earth_365d, earth_366d
+calend= _AUTOBLOCKER_
+## Jour de l etat initial ( = 350  si 20 Decembre ,par expl. ,comme ici )
+dayref= _AUTOBLOCKER_
+##  Annee de l etat  initial (   avec  4  chiffres   )
+anneeref= _AUTOBLOCKER_
+## Nombre de jours d integration
+nday= _AUTOBLOCKER_
+## Remise a zero de la date initiale
+raz_date= _AUTOBLOCKER_
+## periode de sortie des variables de controle (en pas)
+iconser=240
+## periode d ecriture du fichier histoire (en jour)
+iecri=1
+## flag de sortie dynzon
+ok_dynzon=n
+## activation du calcul d equilibrage de charge
+adjust= n
+## activation du filtre fft
+use_filtre_fft=y
+## niveau d impression de controle
+prt_level=0
+###
+### Informations sur la configuration utilisee
+###
+### type_ocean = force / slab  /couple
+### type_ocean is modified automatically by the lmdz.driver 
+type_ocean=_AUTOBLOCKER_
+### version_ocean = nemo / opa8
+version_ocean=nemo
+### activation passage courants surface ocean-glace
+cpl_current=y
+### VEGET= y si ORCHIDEE, =n si bucket
+### VEGET is modified automatically by the lmdz.driver 
+VEGET=_AUTOBLOCKER_
+### Choice of tracers type_trac=lmdz/inca/repr
+### type_trac is set automatically by the lmdz.driver
+type_trac=_AUTOBLOCKER_
+### config_inca=aero/chem needed only if type_trac=inca
+config_inca=_AUTOBLOCKER_ 
+### To activate XIOS ouputs only, set n to use IOIPSL
+ok_all_xml= y
+### Only read by ce0l : Do not set land points on Antartic
+no_ter_antartique=y
+### Do not call phytrac to speed things up
+iflag_phytrac=_AUTOBLOCKER_: DEFAULT = 0
+### cpl_old_calving : use n for DYNAMICO and new coupling weight(MR025)
+cpl_old_calving = _AUTO_
+
Index: CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/tracer.def_iso
===================================================================
--- CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/tracer.def_iso	(revision 6746)
+++ CONFIG/UNIFORM/v7/IPSLCM7ISO/GENERAL/PARAM/LMDZ/tracer.def_iso	(revision 6746)
@@ -0,0 +1,6 @@
+&version=1.0
+&lmdz
+default  type=tracer  phases=g    hadv=10   vadv=10   parent=air
+H2O                               hadv=14   vadv=14
+H2O                   phases=ls
+H218O,HDO,H216O       phases=gls                      parent=H2O
Index: CONFIG/UNIFORM/v7/IPSLCM7ISO/SOURCES/LMDZ/phylmd/oasis.F90
===================================================================
--- CONFIG/UNIFORM/v7/IPSLCM7ISO/SOURCES/LMDZ/phylmd/oasis.F90	(revision 6745)
+++ 	(revision )
@@ -1,573 +1,0 @@
-!
-MODULE oasis
-!
-! This module contains subroutines for initialization, sending and receiving 
-! towards the coupler OASIS3. It also contains some parameters for the coupling.
-!
-! This module should always be compiled. With the coupler OASIS3 available the cpp key
-! CPP_COUPLE should be set and the entier of this file will then be compiled. 
-! In a forced mode CPP_COUPLE should not be defined and the compilation ends before 
-! the CONTAINS, without compiling the subroutines.
-!
-  USE dimphy 
-  USE mod_phys_lmdz_para
-  USE write_field_phy
-
-#ifdef CPP_COUPLE
-! Use of Oasis-MCT coupler 
-#if defined CPP_OMCT
-  USE mod_prism
-! Use of Oasis3 coupler 
-#else 
-  USE mod_prism_proto
-  USE mod_prism_def_partition_proto
-  USE mod_prism_get_proto
-  USE mod_prism_put_proto
-#endif
-#ifdef CPP_CPLOCNINCA
-  USE incaoasis, ONLY : inforcv
-#endif
-#endif
-  
-  IMPLICIT NONE
-  
-  ! Id for fields sent to ocean
-  INTEGER, PARAMETER :: ids_tauxxu = 1
-  INTEGER, PARAMETER :: ids_tauyyu = 2
-  INTEGER, PARAMETER :: ids_tauzzu = 3
-  INTEGER, PARAMETER :: ids_tauxxv = 4
-  INTEGER, PARAMETER :: ids_tauyyv = 5
-  INTEGER, PARAMETER :: ids_tauzzv = 6
-  INTEGER, PARAMETER :: ids_windsp = 7
-  INTEGER, PARAMETER :: ids_shfice = 8
-  INTEGER, PARAMETER :: ids_shfoce = 9
-  INTEGER, PARAMETER :: ids_shftot = 10
-  INTEGER, PARAMETER :: ids_nsfice = 11
-  INTEGER, PARAMETER :: ids_nsfoce = 12
-  INTEGER, PARAMETER :: ids_nsftot = 13
-  INTEGER, PARAMETER :: ids_dflxdt = 14
-  INTEGER, PARAMETER :: ids_totrai = 15
-  INTEGER, PARAMETER :: ids_totsno = 16
-  INTEGER, PARAMETER :: ids_toteva = 17
-  INTEGER, PARAMETER :: ids_icevap = 18
-  INTEGER, PARAMETER :: ids_ocevap = 19
-  INTEGER, PARAMETER :: ids_calvin = 20
-  INTEGER, PARAMETER :: ids_liqrun = 21
-  INTEGER, PARAMETER :: ids_runcoa = 22
-  INTEGER, PARAMETER :: ids_rivflu = 23
-  INTEGER, PARAMETER :: ids_atmco2 = 24
-  INTEGER, PARAMETER :: ids_taumod = 25
-  INTEGER, PARAMETER :: ids_qraioc = 26
-  INTEGER, PARAMETER :: ids_qsnooc = 27
-  INTEGER, PARAMETER :: ids_qraiic = 28
-  INTEGER, PARAMETER :: ids_qsnoic = 29
-  INTEGER, PARAMETER :: ids_delta_sst = 30, ids_delta_sal = 31, ids_dter = 32, &
-       ids_dser = 33, ids_dt_ds = 34
-  
-  INTEGER, PARAMETER :: maxsend    = 34  ! Maximum number of fields to send
-  
-  ! Id for fields received from ocean
-
-  INTEGER, PARAMETER :: idr_sisutw = 1
-  INTEGER, PARAMETER :: idr_icecov = 2
-  INTEGER, PARAMETER :: idr_icealw = 3
-  INTEGER, PARAMETER :: idr_icetem = 4
-  INTEGER, PARAMETER :: idr_curenx = 5
-  INTEGER, PARAMETER :: idr_cureny = 6
-  INTEGER, PARAMETER :: idr_curenz = 7
-  INTEGER, PARAMETER :: idr_oceco2 = 8
-
-  INTEGER, PARAMETER :: idr_sss = 9
-  ! bulk salinity of the surface layer of the ocean, in ppt
-
-  INTEGER, PARAMETER :: maxrecv    = 9  ! Maximum number of fields to receive
-  
-#ifdef CPP_CPLOCNINCA
-  INTEGER, PARAMETER :: idr_ocedms = 1
-  INTEGER, PARAMETER :: maxrcv = 1
-#endif
-
-  TYPE, PUBLIC ::   FLD_CPL            ! Type for coupling field information
-     CHARACTER(len = 8) ::   name      ! Name of the coupling field   
-     LOGICAL            ::   action    ! To be exchanged or not
-     INTEGER            ::   nid       ! Id of the field
-  END TYPE FLD_CPL
-
-  TYPE(FLD_CPL), DIMENSION(maxsend), SAVE, PUBLIC :: infosend   ! Information for sending coupling fields
-!$OMP THREADPRIVATE(infosend)
-  TYPE(FLD_CPL), DIMENSION(maxrecv), SAVE, PUBLIC :: inforecv   ! Information for receiving coupling fields
-!$OMP THREADPRIVATE(inforecv)
-  
-  LOGICAL,SAVE :: cpl_current
-!$OMP THREADPRIVATE(cpl_current)
-
-#ifdef CPP_COUPLE
-
-CONTAINS
-
-  SUBROUTINE inicma
-!************************************************************************************
-!**** *INICMA*  - Initialize coupled mode communication for atmosphere
-!                 and exchange some initial information with Oasis
-!
-!     Rewrite to take the PRISM/psmile library into account
-!     LF 09/2003
-!
-    USE IOIPSL
-    USE surface_data, ONLY : version_ocean
-    USE carbon_cycle_mod, ONLY : carbon_cycle_cpl
-#ifdef CPP_XIOS
-    USE wxios, ONLY : wxios_context_init 
-    USE xios  
-#endif
-    USE print_control_mod, ONLY: lunout
-    USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, grid_type, unstructured, regular_lonlat
-    USE geometry_mod, ONLY: ind_cell_glo                    
-    USE mod_phys_lmdz_mpi_data, ONLY: klon_mpi_para_nb
-    use config_ocean_skin_m, only: activate_ocean_skin
-
-! Local variables
-!************************************************************************************
-    INTEGER                            :: comp_id
-    INTEGER                            :: ierror, il_commlocal
-    INTEGER                            :: il_part_id
-    INTEGER, ALLOCATABLE               :: ig_paral(:)
-    INTEGER, DIMENSION(2)              :: il_var_nodims
-    INTEGER, DIMENSION(4)              :: il_var_actual_shape
-    INTEGER                            :: il_var_type
-    INTEGER                            :: jf
-    CHARACTER (len = 6)                :: clmodnam
-    CHARACTER (len = 20)               :: modname = 'inicma'
-    CHARACTER (len = 80)               :: abort_message 
-    LOGICAL, SAVE                      :: cpl_current_omp
-    INTEGER, DIMENSION(klon_mpi)       :: ind_cell_glo_mpi
-
-!*    1. Initializations
-!        ---------------
-!************************************************************************************
-    WRITE(lunout,*) ' '
-    WRITE(lunout,*) ' '
-    WRITE(lunout,*) ' ROUTINE INICMA'
-    WRITE(lunout,*) ' **************'
-    WRITE(lunout,*) ' '
-    WRITE(lunout,*) ' '
-
-!
-! Define the model name
-!
-    IF (grid_type==unstructured) THEN
-        clmodnam = 'icosa'                 ! as in $NBMODEL in Cpl/Nam/namcouple.tmp
-    ELSE IF (grid_type==regular_lonlat) THEN
-        clmodnam = 'LMDZ'                  ! as in $NBMODEL in Cpl/Nam/namcouple.tmp
-    ELSE
-	abort_message='Pb : type of grid unknown'
-	CALL abort_physic(modname,abort_message,1)
-    ENDIF
-
-
-!************************************************************************************
-! Define if coupling ocean currents or not
-!************************************************************************************
-!$OMP MASTER
-    cpl_current_omp = .FALSE.
-    CALL getin('cpl_current', cpl_current_omp)
-!$OMP END MASTER
-!$OMP BARRIER
-    cpl_current = cpl_current_omp
-    WRITE(lunout,*) 'Couple ocean currents, cpl_current = ',cpl_current 
-
-!************************************************************************************
-! Gather global index to be used for oasis decomposition
-!************************************************************************************
-    CALL gather_omp(ind_cell_glo,ind_cell_glo_mpi)
-
-!************************************************************************************
-! Define coupling variables
-!************************************************************************************
-
-! Atmospheric variables to send
-
-!$OMP MASTER
-    infosend(:)%action = .FALSE.
-
-    infosend(ids_tauxxu)%action = .TRUE. ; infosend(ids_tauxxu)%name = 'COTAUXXU'
-    infosend(ids_tauyyu)%action = .TRUE. ; infosend(ids_tauyyu)%name = 'COTAUYYU'
-    infosend(ids_tauzzu)%action = .TRUE. ; infosend(ids_tauzzu)%name = 'COTAUZZU'
-    infosend(ids_tauxxv)%action = .TRUE. ; infosend(ids_tauxxv)%name = 'COTAUXXV'
-    infosend(ids_tauyyv)%action = .TRUE. ; infosend(ids_tauyyv)%name = 'COTAUYYV'
-    infosend(ids_tauzzv)%action = .TRUE. ; infosend(ids_tauzzv)%name = 'COTAUZZV'
-    infosend(ids_windsp)%action = .TRUE. ; infosend(ids_windsp)%name = 'COWINDSP'
-    infosend(ids_shfice)%action = .TRUE. ; infosend(ids_shfice)%name = 'COSHFICE'
-    infosend(ids_nsfice)%action = .TRUE. ; infosend(ids_nsfice)%name = 'CONSFICE'
-    infosend(ids_dflxdt)%action = .TRUE. ; infosend(ids_dflxdt)%name = 'CODFLXDT'
-    infosend(ids_calvin)%action = .TRUE. ; infosend(ids_calvin)%name = 'COCALVIN'
-    
-    if (activate_ocean_skin == 2) then
-       infosend(ids_delta_sst)%action = .TRUE.
-       infosend(ids_delta_sst)%name = 'CODELSST'
-       infosend(ids_delta_sal)%action = .TRUE.
-       infosend(ids_delta_sal)%name = 'CODELSSS'
-       infosend(ids_dter)%action = .TRUE.
-       infosend(ids_dter)%name = 'CODELTER'
-       infosend(ids_dser)%action = .TRUE.
-       infosend(ids_dser)%name = 'CODELSER'
-       infosend(ids_dt_ds)%action = .TRUE.
-       infosend(ids_dt_ds)%name = 'CODTDS'
-    end if
-           
-    IF (version_ocean=='nemo') THEN
-        infosend(ids_shftot)%action = .TRUE. ; infosend(ids_shftot)%name = 'COQSRMIX'
-        infosend(ids_nsftot)%action = .TRUE. ; infosend(ids_nsftot)%name = 'COQNSMIX'
-        infosend(ids_totrai)%action = .TRUE. ; infosend(ids_totrai)%name = 'COTOTRAI'
-        infosend(ids_totsno)%action = .TRUE. ; infosend(ids_totsno)%name = 'COTOTSNO'
-        infosend(ids_toteva)%action = .TRUE. ; infosend(ids_toteva)%name = 'COTOTEVA'
-        infosend(ids_icevap)%action = .TRUE. ; infosend(ids_icevap)%name = 'COICEVAP'
-        infosend(ids_liqrun)%action = .TRUE. ; infosend(ids_liqrun)%name = 'COLIQRUN'
-        infosend(ids_taumod)%action = .TRUE. ; infosend(ids_taumod)%name = 'COTAUMOD'
-        IF (carbon_cycle_cpl) THEN
-            infosend(ids_atmco2)%action = .TRUE. ; infosend(ids_atmco2)%name = 'COATMCO2'
-        ENDIF
-        infosend(ids_qraioc)%action = .TRUE. ; infosend(ids_qraioc)%name = 'COQRAIOC'
-        infosend(ids_qsnooc)%action = .TRUE. ; infosend(ids_qsnooc)%name = 'COQSNOOC'
-        infosend(ids_qraiic)%action = .TRUE. ; infosend(ids_qraiic)%name = 'COQRAIIC'
-        infosend(ids_qsnoic)%action = .TRUE. ; infosend(ids_qsnoic)%name = 'COQSNOIC'
-        
-    ELSE IF (version_ocean=='opa8') THEN
-        infosend(ids_shfoce)%action = .TRUE. ; infosend(ids_shfoce)%name = 'COSHFOCE'
-        infosend(ids_nsfoce)%action = .TRUE. ; infosend(ids_nsfoce)%name = 'CONSFOCE'
-        infosend(ids_icevap)%action = .TRUE. ; infosend(ids_icevap)%name = 'COTFSICE'
-        infosend(ids_ocevap)%action = .TRUE. ; infosend(ids_ocevap)%name = 'COTFSOCE'
-        infosend(ids_totrai)%action = .TRUE. ; infosend(ids_totrai)%name = 'COTOLPSU'
-        infosend(ids_totsno)%action = .TRUE. ; infosend(ids_totsno)%name = 'COTOSPSU'
-        infosend(ids_runcoa)%action = .TRUE. ; infosend(ids_runcoa)%name = 'CORUNCOA'
-        infosend(ids_rivflu)%action = .TRUE. ; infosend(ids_rivflu)%name = 'CORIVFLU'
-   ENDIF
-        
-! Oceanic variables to receive
-
-   inforecv(:)%action = .FALSE.
-
-   inforecv(idr_sisutw)%action = .TRUE. ; inforecv(idr_sisutw)%name = 'SISUTESW'
-   inforecv(idr_icecov)%action = .TRUE. ; inforecv(idr_icecov)%name = 'SIICECOV'
-   inforecv(idr_icealw)%action = .TRUE. ; inforecv(idr_icealw)%name = 'SIICEALW'
-   inforecv(idr_icetem)%action = .TRUE. ; inforecv(idr_icetem)%name = 'SIICTEMW'
-
-   if (activate_ocean_skin >= 1) then
-      inforecv(idr_sss)%action = .TRUE.
-      inforecv(idr_sss)%name = 'SISUSALW'
-   end if
-   
-   IF (cpl_current ) THEN
-       inforecv(idr_curenx)%action = .TRUE. ; inforecv(idr_curenx)%name = 'CURRENTX'
-       inforecv(idr_cureny)%action = .TRUE. ; inforecv(idr_cureny)%name = 'CURRENTY'
-       inforecv(idr_curenz)%action = .TRUE. ; inforecv(idr_curenz)%name = 'CURRENTZ'
-   ENDIF
-
-   IF (carbon_cycle_cpl ) THEN
-       inforecv(idr_oceco2)%action = .TRUE. ; inforecv(idr_oceco2)%name = 'SICO2FLX'
-   ENDIF
-#ifdef CPP_CPLOCNINCA
-       inforcv(idr_ocedms)%action = .TRUE. ; inforcv(idr_ocedms)%name = 'SIDMSFLX'
-#endif
-
-!************************************************************************************
-! Here we go: psmile initialisation
-!************************************************************************************
-    IF (is_sequential) THEN
-       CALL prism_init_comp_proto (comp_id, clmodnam, ierror)
-       
-       IF (ierror .NE. PRISM_Ok) THEN
-          abort_message=' Probleme init dans prism_init_comp '
-          CALL abort_physic(modname,abort_message,1)
-       ELSE
-          WRITE(lunout,*) 'inicma : init psmile ok '
-       ENDIF
-    ENDIF
-
-    CALL prism_get_localcomm_proto (il_commlocal, ierror)
-!************************************************************************************
-! Domain decomposition
-!************************************************************************************
-    IF (grid_type==unstructured) THEN
-
-      ALLOCATE( ig_paral(klon_mpi_para_nb(mpi_rank) + 2) ) 
-
-      ig_paral(1) = 4                                      ! points partition for //
-      ig_paral(2) = klon_mpi_para_nb(mpi_rank)             ! nb of local cells
-
-      DO jf=1, klon_mpi_para_nb(mpi_rank)
-        ig_paral(2+jf) = ind_cell_glo_mpi(jf)
-      ENDDO
-
-    ELSE IF (grid_type==regular_lonlat) THEN
-
-      ALLOCATE( ig_paral(3) )
-
-      ig_paral(1) = 1                            ! apple partition for //
-      ig_paral(2) = (jj_begin-1)*nbp_lon+ii_begin-1  ! offset
-      ig_paral(3) = (jj_end*nbp_lon+ii_end) - (jj_begin*nbp_lon+ii_begin) + 1
-
-      IF (mpi_rank==mpi_size-1) ig_paral(3)=ig_paral(3)+nbp_lon-1
-    ELSE
-      abort_message='Pb : type of grid unknown'
-      CALL abort_physic(modname,abort_message,1)
-    ENDIF
-
-
-    WRITE(lunout,*) mpi_rank,'ig_paral--->',ig_paral(2),ig_paral(3)
-    
-    ierror=PRISM_Ok
-    CALL prism_def_partition_proto (il_part_id, ig_paral, ierror)
-
-    IF (ierror .NE. PRISM_Ok) THEN
-       abort_message=' Probleme dans prism_def_partition '
-       CALL abort_physic(modname,abort_message,1)
-    ELSE
-       WRITE(lunout,*) 'inicma : decomposition domaine psmile ok '
-    ENDIF
-
-    il_var_nodims(1) = 2                        ! rank of field array (1d or 2d)
-    il_var_nodims(2) = 1                        ! always 1 in current oasis version" doc oasis3mct p18
-
-    il_var_actual_shape(1) = 1                  ! min of 1st dimension (always 1)
-    il_var_actual_shape(2) = nbp_lon            ! max of 1st dimension
-    il_var_actual_shape(3) = 1                  ! min of 2nd dimension (always 1)
-    il_var_actual_shape(4) = nbp_lat            ! max of 2nd dimension
-   
-    il_var_type = PRISM_Real
-
-!************************************************************************************
-! Oceanic Fields to receive
-! Loop over all possible variables
-!************************************************************************************
-    DO jf=1, maxrecv
-       IF (inforecv(jf)%action) THEN
-          CALL prism_def_var_proto(inforecv(jf)%nid, inforecv(jf)%name, il_part_id, &
-               il_var_nodims, PRISM_In, il_var_actual_shape, il_var_type, &
-               ierror)
-          IF (ierror .NE. PRISM_Ok) THEN
-             WRITE(lunout,*) 'inicma : Problem with prism_def_var_proto for field : ',&
-                  inforecv(jf)%name
-             abort_message=' Problem in call to prism_def_var_proto for fields to receive'
-             CALL abort_physic(modname,abort_message,1)
-          ENDIF
-       ENDIF
-    END DO
-
-! Now, if also coupling CPL with INCA, initialize here fields to be exchanged.
-#ifdef CPP_CPLOCNINCA
-    DO jf=1,maxrcv 
-       IF (inforcv(jf)%action) THEN
-          CALL prism_def_var_proto(inforcv(jf)%nid, inforcv(jf)%name, il_part_id, &
-               il_var_nodims, PRISM_In, il_var_actual_shape, il_var_type, &
-               ierror)
-          IF (ierror .NE. PRISM_Ok) THEN
-             WRITE(lunout,*) 'inicma : Problem with prism_def_var_proto for field : ',&
-                  inforcv(jf)%name
-             abort_message=' Problem in call to prism_def_var_proto for fields to receive'
-             CALL abort_physic(modname,abort_message,1)
-          ENDIF
-       ENDIF
-    END DO
-#endif
- 
-!************************************************************************************
-! Atmospheric Fields to send
-! Loop over all possible variables
-!************************************************************************************
-    DO jf=1,maxsend
-       IF (infosend(jf)%action) THEN
-          CALL prism_def_var_proto(infosend(jf)%nid, infosend(jf)%name, il_part_id, &
-               il_var_nodims, PRISM_Out, il_var_actual_shape, il_var_type, &
-               ierror)
-          IF (ierror .NE. PRISM_Ok) THEN
-             WRITE(lunout,*) 'inicma : Problem with prism_def_var_proto for field : ',&
-                  infosend(jf)%name
-             abort_message=' Problem in call to prism_def_var_proto for fields to send'
-             CALL abort_physic(modname,abort_message,1)
-          ENDIF
-       ENDIF
-    END DO
-    
-!************************************************************************************
-! End definition
-!************************************************************************************
-#ifdef CPP_XIOS
-    CALL xios_oasis_enddef()
-#endif
-    CALL prism_enddef_proto(ierror)
-    IF (ierror .NE. PRISM_Ok) THEN
-       abort_message=' Problem in call to prism_endef_proto'
-       CALL abort_physic(modname,abort_message,1)
-    ELSE
-       WRITE(lunout,*) 'inicma : endef psmile ok '
-    ENDIF
-
-#ifdef CPP_XIOS
-!    CALL wxios_context_init()
-#endif
-
-!$OMP END MASTER
-    
-  END SUBROUTINE inicma
-
-!
-!************************************************************************************
-!
-
-  SUBROUTINE fromcpl(ktime, tab_get)
-! ======================================================================
-! L. Fairhead (09/2003) adapted From L.Z.X Li: this subroutine reads the SST 
-! and Sea-Ice provided by the coupler. Adaptation to psmile library
-!======================================================================
-!
-    USE print_control_mod, ONLY: lunout
-    USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
-! Input arguments
-!************************************************************************************
-    INTEGER, INTENT(IN)                               ::  ktime
-
-! Output arguments
-!************************************************************************************
-    REAL, DIMENSION(nbp_lon, jj_nb,maxrecv), INTENT(OUT) :: tab_get
-
-! Local variables
-!************************************************************************************
-    INTEGER                       :: ierror, i
-    INTEGER                       :: istart,iend
-    CHARACTER (len = 20)          :: modname = 'fromcpl'
-    CHARACTER (len = 80)          :: abort_message 
-    REAL, DIMENSION(nbp_lon*jj_nb)    :: field
-
-!************************************************************************************
-    WRITE (lunout,*) ' '
-    WRITE (lunout,*) 'Fromcpl: Reading fields from CPL, ktime=',ktime
-    WRITE (lunout,*) ' '
-    
-    istart=ii_begin
-    IF (is_south_pole_dyn) THEN
-       iend=(jj_end-jj_begin)*nbp_lon+nbp_lon
-    ELSE
-       iend=(jj_end-jj_begin)*nbp_lon+ii_end
-    ENDIF
-    
-    DO i = 1, maxrecv
-      IF (inforecv(i)%action .AND. inforecv(i)%nid .NE. -1) THEN
-          field(:) = -99999.
-          CALL prism_get_proto(inforecv(i)%nid, ktime, field(istart:iend), ierror)
-          tab_get(:,:,i) = RESHAPE(field(:),(/nbp_lon,jj_nb/))
-       
-          IF (ierror .NE. PRISM_Ok .AND. ierror.NE.PRISM_Recvd .AND. &
-             ierror.NE.PRISM_FromRest &
-             .AND. ierror.NE.PRISM_Input .AND. ierror.NE.PRISM_RecvOut &
-             .AND. ierror.NE.PRISM_FromRestOut) THEN
-              WRITE (lunout,*)  'Error with receiving filed : ', inforecv(i)%name, ktime   
-              abort_message=' Problem in prism_get_proto '
-              CALL abort_physic(modname,abort_message,1)
-          ENDIF
-      ENDIF
-    END DO
-    
-    
-  END SUBROUTINE fromcpl
-
-!
-!************************************************************************************
-! 
-
-  SUBROUTINE intocpl(ktime, last, tab_put) 
-! ======================================================================
-! L. Fairhead (09/2003) adapted From L.Z.X Li: this subroutine provides the 
-! atmospheric coupling fields to the coupler with the psmile library.
-! IF last time step, writes output fields to binary files.
-! ======================================================================
-!
-! 
-    USE print_control_mod, ONLY: lunout
-    USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
-! Input arguments
-!************************************************************************************
-    INTEGER, INTENT(IN)                              :: ktime
-    LOGICAL, INTENT(IN)                              :: last
-    REAL, DIMENSION(nbp_lon, jj_nb, maxsend), INTENT(IN) :: tab_put
-
-! Local variables
-!************************************************************************************
-    LOGICAL                          :: checkout
-    INTEGER                          :: istart,iend
-    INTEGER                          :: wstart,wend
-    INTEGER                          :: ierror, i
-    REAL, DIMENSION(nbp_lon*jj_nb)       :: field
-    CHARACTER (len = 20),PARAMETER   :: modname = 'intocpl'
-    CHARACTER (len = 80)             :: abort_message 
-
-!************************************************************************************
-    checkout=.FALSE.
-
-    WRITE(lunout,*) ' '
-    WRITE(lunout,*) 'Intocpl: sending fields to CPL, ktime= ', ktime
-    WRITE(lunout,*) 'last = ', last
-    WRITE(lunout,*)
-
-
-    istart=ii_begin
-    IF (is_south_pole_dyn) THEN
-       iend=(jj_end-jj_begin)*nbp_lon+nbp_lon
-    ELSE
-       iend=(jj_end-jj_begin)*nbp_lon+ii_end
-    ENDIF
-    
-    IF (checkout) THEN   
-       wstart=istart
-       wend=iend
-       IF (is_north_pole_dyn) wstart=istart+nbp_lon-1
-       IF (is_south_pole_dyn) wend=iend-nbp_lon+1
-       
-       DO i = 1, maxsend
-          IF (infosend(i)%action) THEN
-             field = RESHAPE(tab_put(:,:,i),(/nbp_lon*jj_nb/))
-             CALL writefield_phy(infosend(i)%name,field(wstart:wend),1)
-          END IF
-       END DO
-    END IF
-
-!************************************************************************************
-! PRISM_PUT
-!************************************************************************************
-
-    DO i = 1, maxsend
-      IF (infosend(i)%action .AND. infosend(i)%nid .NE. -1 ) THEN
-          field = RESHAPE(tab_put(:,:,i),(/nbp_lon*jj_nb/))
-          CALL prism_put_proto(infosend(i)%nid, ktime, field(istart:iend), ierror)
-          
-          IF (ierror .NE. PRISM_Ok .AND. ierror.NE.PRISM_Sent .AND. ierror.NE.PRISM_ToRest &
-             .AND. ierror.NE.PRISM_LocTrans .AND. ierror.NE.PRISM_Output .AND. &
-             ierror.NE.PRISM_SentOut .AND. ierror.NE.PRISM_ToRestOut) THEN
-              WRITE (lunout,*) 'Error with sending field :', infosend(i)%name, ktime   
-              abort_message=' Problem in prism_put_proto '
-              CALL abort_physic(modname,abort_message,1)
-          ENDIF
-      ENDIF
-    END DO
-   
-!************************************************************************************
-! Finalize PSMILE for the case is_sequential, if parallel finalization is done 
-! from Finalize_parallel in dyn3dpar/parallel.F90
-!************************************************************************************
-
-    IF (last) THEN
-       IF (is_sequential) THEN 
-          CALL prism_terminate_proto(ierror)
-          IF (ierror .NE. PRISM_Ok) THEN
-             abort_message=' Problem in prism_terminate_proto '
-             CALL abort_physic(modname,abort_message,1)
-          ENDIF
-       ENDIF
-    ENDIF
-    
-    
-  END SUBROUTINE intocpl
-
-#endif
-  
-END MODULE oasis
Index: CONFIG/UNIFORM/v7/IPSLCM7ISO/SOURCES/LMDZ/phylmd/physiq_mod.F90
===================================================================
--- CONFIG/UNIFORM/v7/IPSLCM7ISO/SOURCES/LMDZ/phylmd/physiq_mod.F90	(revision 6745)
+++ 	(revision )
@@ -1,5431 +1,0 @@
-!
-! $Id: physiq_mod.F90 4298 2022-10-17 08:15:06Z pcadule $
-!
-!#define IO_DEBUG
-MODULE physiq_mod
-
-  IMPLICIT NONE
-
-CONTAINS
-
-  SUBROUTINE physiq (nlon,nlev, &
-       debut,lafin,pdtphys_, &
-       paprs,pplay,pphi,pphis,presnivs, &
-       u,v,rot,t,qx, &
-       flxmass_w, &
-       d_u, d_v, d_t, d_qx, d_ps)
-
-! For clarity, the "USE" section is now arranged in alphabetical order,
-! with a separate section for CPP keys
-! PLEASE try to follow this rule 
-
-    USE ACAMA_GWD_rando_m, only: ACAMA_GWD_rando
-    USE aero_mod
-    USE add_phys_tend_mod, only : add_pbl_tend, add_phys_tend, diag_phys_tend, prt_enerbil, &
-  &      fl_ebil, fl_cor_ebil
-    USE assert_m, only: assert
-    USE change_srf_frac_mod
-    USE conf_phys_m, only: conf_phys
-    USE carbon_cycle_mod, ONLY : infocfields_init, RCO2_glo, carbon_cycle_rad
-    USE CFMIP_point_locations   ! IM stations CFMIP
-    USE cmp_seri_mod
-    USE dimphy
-    USE etat0_limit_unstruct_mod
-    USE FLOTT_GWD_rando_m, only: FLOTT_GWD_rando
-    USE fonte_neige_mod, ONLY  : fonte_neige_get_vars
-    USE geometry_mod, ONLY: cell_area, latitude_deg, longitude_deg
-    USE ioipsl, only: histbeg, histvert, histdef, histend, histsync, &
-         histwrite, ju2ymds, ymds2ju, getin
-    USE ioipsl_getin_p_mod, ONLY : getin_p
-    USE indice_sol_mod
-    USE infotrac_phy, ONLY: nqtot, nbtr, nqo, tracers, type_trac
-    USE readTracFiles_mod, ONLY: addPhase
-    USE strings_mod,  ONLY: strIdx
-    USE iophy
-    USE limit_read_mod, ONLY : init_limit_read
-    USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev, klon_glo, grid1dTo2d_glo, grid_type, unstructured
-    USE mod_phys_lmdz_mpi_data, only: is_mpi_root
-    USE mod_phys_lmdz_para
-    USE netcdf95, only: nf95_close
-    USE netcdf, only: nf90_fill_real     ! IM for NMC files
-    USE open_climoz_m, only: open_climoz ! ozone climatology from a file
-    USE ozonecm_m, only: ozonecm ! ozone of J.-F. Royer
-    USE pbl_surface_mod, ONLY : pbl_surface
-    USE phyaqua_mod, only: zenang_an
-    USE phyetat0_mod, only: phyetat0
-    USE phystokenc_mod, ONLY: offline, phystokenc
-    USE phys_cal_mod, only: year_len, mth_len, days_elapsed, jh_1jan, &
-         year_cur, mth_cur,jD_cur, jH_cur, jD_ref, day_cur, hour, calend
-!!  USE phys_local_var_mod, ONLY : a long list of variables
-!!              ==> see below, after "CPP Keys" section
-    USE phys_state_var_mod ! Variables sauvegardees de la physique
-    USE phys_output_mod
-    USE phys_output_ctrlout_mod
-    USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level, &
-         alert_first_call, call_alert, prt_alerte
-    USE readaerosol_mod, ONLY : init_aero_fromfile
-    USE readaerosolstrato_m, ONLY : init_readaerosolstrato
-    USE radlwsw_m, only: radlwsw
-    USE regr_horiz_time_climoz_m, ONLY: regr_horiz_time_climoz
-    USE regr_pr_time_av_m, only: regr_pr_time_av
-    USE surface_data,     ONLY : type_ocean, ok_veget
-    USE time_phylmdz_mod, only: current_time, itau_phy, pdtphys, raz_date, update_time
-    USE tracinca_mod, ONLY: config_inca
-    USE tropopause_m,     ONLY: dyn_tropopause
-    USE ice_sursat_mod,  ONLY: flight_init, airplane
-    USE vampir
-    USE write_field_phy
-#ifdef CPP_XIOS
-    USE wxios, ONLY: g_ctx, wxios_set_context
-#endif
-    USE lscp_mod, ONLY : lscp
-    USE wake_ini_mod, ONLY : wake_ini
-    USE yamada_ini_mod, ONLY : yamada_ini
-    USE atke_turbulence_ini_mod, ONLY : atke_ini
-    USE thermcell_ini_mod, ONLY : thermcell_ini
-    USE lscp_ini_mod, ONLY : lscp_ini
-
-    !USE cmp_seri_mod
-!    USE add_phys_tend_mod, only : add_pbl_tend, add_phys_tend, diag_phys_tend, prt_enerbil, &
-!  &      fl_ebil, fl_cor_ebil
-
-!!!!!!!!!!!!!!!!!! "USE" section for CPP keys !!!!!!!!!!!!!!!!!!!!!!!!
-!
-!
-#ifdef CPP_Dust
-    USE phytracr_spl_mod, ONLY: phytracr_spl, phytracr_spl_out_init
-    USE phys_output_write_spl_mod
-#else
-    USE phytrac_mod, ONLY : phytrac_init, phytrac
-    USE phys_output_write_mod
-#endif
-
-
-#ifdef INCA
-    USE geometry_mod,      ONLY: longitude, latitude, boundslon, boundslat, ind_cell_glo
-    USE time_phylmdz_mod,  ONLY: ndays
-    USE infotrac_phy,      ONLY: nqCO2
-#endif
-#ifdef REPROBUS
-    USE chem_rep, ONLY: Init_chem_rep_xjour, d_q_rep, d_ql_rep, d_qi_rep, &
-                        ptrop, ttrop, ztrop, gravit, itroprep, Z1, Z2, fac, B
-#endif
-#if defined INCA || defined REPROBUS
-    USE time_phylmdz_mod,    ONLY: annee_ref, day_ini, day_ref, start_time
-    USE vertical_layers_mod, ONLY: aps, bps, ap, bp
-#endif
-
-
-#ifdef CPP_RRTM
-    USE YOERAD, ONLY : NRADLP
-!    USE YOESW, ONLY : RSUN
-#endif
-
-
-#ifdef CPP_StratAer
-    USE strataer_mod, ONLY: strataer_init
-#endif
-
-
-#ifdef CPP_XIOS
-    USE xios, ONLY: xios_update_calendar, xios_context_finalize
-    USE xios, ONLY: xios_get_field_attr, xios_field_is_active, xios_context
-    USE xios, ONLY: xios_set_current_context
-    USE wxios, ONLY: missing_val, missing_val_omp
-#endif
-#ifndef CPP_XIOS
-    USE paramLMDZ_phy_mod
-#endif
-!
-!
-!!!!!!!!!!!!!!!!!!  END "USE" for CPP keys !!!!!!!!!!!!!!!!!!!!!!
-
-USE phys_local_var_mod, ONLY: phys_local_var_init, phys_local_var_end, &
-       ! [Variables internes non sauvegardees de la physique]
-       ! Variables locales pour effectuer les appels en serie
-       t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,tr_seri,rneb_seri, &
-       rhcl, &        
-       ! Dynamic tendencies (diagnostics)
-       d_t_dyn,d_q_dyn,d_ql_dyn,d_qs_dyn,d_u_dyn,d_v_dyn,d_tr_dyn,d_rneb_dyn, &
-       d_q_dyn2d,d_ql_dyn2d,d_qs_dyn2d, &
-       ! Physic tendencies
-       d_t_con,d_q_con,d_u_con,d_v_con, &
-       d_tr, &                              !! to be removed?? (jyg)
-       d_t_wake,d_q_wake, &
-       d_t_lwr,d_t_lw0,d_t_swr,d_t_sw0, &
-       d_t_ajsb,d_q_ajsb, &
-       d_t_ajs,d_q_ajs,d_u_ajs,d_v_ajs, &
-!       d_t_ajs_w,d_q_ajs_w, &
-!       d_t_ajs_x,d_q_ajs_x, &
-       !
-       d_t_eva,d_q_eva,d_ql_eva,d_qi_eva, &
-       d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc, &
-       d_t_lscst,d_q_lscst, &
-       d_t_lscth,d_q_lscth, &
-       plul_st,plul_th, &
-       !
-       d_t_vdf,d_q_vdf,d_u_vdf,d_v_vdf,d_t_diss, &
-       d_t_vdf_x, d_t_vdf_w, &
-       d_q_vdf_x, d_q_vdf_w, &
-       d_ts, &
-       !
-!       d_t_oli,d_u_oli,d_v_oli, &
-       d_t_oro,d_u_oro,d_v_oro, &
-       d_t_oro_gw,d_u_oro_gw,d_v_oro_gw, &
-       d_t_lif,d_u_lif,d_v_lif, &
-       d_t_ec, &
-       !
-       du_gwd_hines,dv_gwd_hines,d_t_hin, &
-       dv_gwd_rando,dv_gwd_front, &
-       east_gwstress,west_gwstress, &
-       d_q_ch4, &
-       !  Special RRTM
-       ZLWFT0_i,ZSWFT0_i,ZFLDN0,  &
-       ZFLUP0,ZFSDN0,ZFSUP0,      &
-       !
-       topswad_aero,solswad_aero,   &
-       topswai_aero,solswai_aero,   &
-       topswad0_aero,solswad0_aero, &
-       !LW additional
-       toplwad_aero,sollwad_aero,   &
-       toplwai_aero,sollwai_aero,   &
-       toplwad0_aero,sollwad0_aero, &
-       !
-       topsw_aero,solsw_aero,       &
-       topsw0_aero,solsw0_aero,     &
-       topswcf_aero,solswcf_aero,   &
-       tausum_aero,tau3d_aero,      &
-       drytausum_aero,              &
-       !
-       !variables CFMIP2/CMIP5
-       topswad_aerop, solswad_aerop,   &
-       topswai_aerop, solswai_aerop,   &
-       topswad0_aerop, solswad0_aerop, &
-       topsw_aerop, topsw0_aerop,      & 
-       solsw_aerop, solsw0_aerop,      &
-       topswcf_aerop, solswcf_aerop,   &
-       !LW diagnostics
-       toplwad_aerop, sollwad_aerop,   &
-       toplwai_aerop, sollwai_aerop,   &
-       toplwad0_aerop, sollwad0_aerop, &
-       !
-       ptstar, pt0, slp, &
-       !
-       bils, &
-       !
-       cldh, cldl,cldm, cldq, cldt,      &
-       JrNt,                             &
-       dthmin, evap, fder, plcl, plfc,   &
-       prw, prlw, prsw,                  &
-       s_lcl, s_pblh, s_pblt, s_therm,   &
-       cdragm, cdragh,                   &
-       zustar, zu10m, zv10m, rh2m, qsat2m, &
-       zq2m, zt2m, zn2mout, weak_inversion, &
-       zt2m_min_mon, zt2m_max_mon,   &         ! pour calcul_divers.h
-       t2m_min_mon, t2m_max_mon,  &            ! pour calcul_divers.h
-       !
-       s_pblh_x, s_pblh_w, &
-       s_lcl_x, s_lcl_w,   &
-       !
-       slab_wfbils, tpot, tpote,               &
-       ue, uq, ve, vq, zxffonte,               &
-       uwat, vwat,                             &
-       zxfqcalving, zxfluxlat,                 &
-       zxrunofflic,                            &
-       zxtsol, snow_lsc, zxfqfonte, zxqsurf,   &
-       delta_qsurf,                            &
-       rain_lsc, rain_num,                     &
-       !
-       sens_x, sens_w, &
-       zxfluxlat_x, zxfluxlat_w, &
-       !
-       pbl_tke_input, tke_dissip, l_mix, wprime,&
-       t_therm, q_therm, u_therm, v_therm, &
-       cdragh_x, cdragh_w, &
-       cdragm_x, cdragm_w, &
-       kh, kh_x, kh_w, &
-       !
-       wake_k, &
-       alp_wake, & 
-       wake_h, wake_omg, &
-                       ! tendencies of delta T and delta q:
-       d_deltat_wk, d_deltaq_wk, &         ! due to wakes
-       d_deltat_wk_gw, d_deltaq_wk_gw, &   ! due to wake induced gravity waves
-       d_deltat_vdf, d_deltaq_vdf, &       ! due to vertical diffusion
-       d_deltat_the, d_deltaq_the, &       ! due to thermals
-       d_deltat_ajs_cv, d_deltaq_ajs_cv, & ! due to dry adjustment of (w) before convection
-                       ! tendencies of wake fractional area and wake number per unit area:
-       d_s_wk,  d_dens_a_wk,  d_dens_wk, &  ! due to wakes
-!!!       d_s_vdf, d_dens_a_vdf, d_dens_vdf, & ! due to vertical diffusion
-!!!       d_s_the, d_dens_a_the, d_dens_the, & ! due to thermals
-       !                                  
-       ptconv, ratqsc, &
-       wbeff, convoccur, zmax_th, &
-       sens, flwp, fiwp,  &
-       alp_bl_conv,alp_bl_det,  &
-       alp_bl_fluct_m,alp_bl_fluct_tke,  &
-       alp_bl_stat, n2, s2,  &
-       proba_notrig, random_notrig,  &
-!!       cv_gen,  &  !moved to phys_state_var_mod
-       !
-       dnwd0,  &
-       omega,  &
-       epmax_diag,  &
-       !    Deep convective variables used in phytrac
-       pmflxr, pmflxs,  &
-       wdtrainA, wdtrainS, wdtrainM,  &
-       upwd, dnwd, &
-       ep,  &
-       da, mp, &
-       phi, &
-       wght_cvfd, &
-       phi2, &
-       d1a, dam, &
-       ev, &
-       elij, &
-       qtaa, &
-       clw, &
-       epmlmMm, eplaMm, &
-       sij, &
-       !
-       rneblsvol, &
-       zqsatl, zqsats, &
-       qclr, qcld, qss, qvc, rnebclr, rnebss, gamma_ss, &
-       Tcontr, qcontr, qcontr2, fcontrN, fcontrP, &
-       cldemi,  &
-       cldfra, cldtau, fiwc,  &
-       fl, re, flwc,  &
-       ref_liq, ref_ice, theta,  &
-       ref_liq_pi, ref_ice_pi,  &
-       zphi, zx_rh, zx_rhl, zx_rhi,  &
-       pmfd, pmfu,  &
-       !
-       t2m, fluxlat,  &
-       fsollw, evap_pot,  &
-       fsolsw, wfbils, wfbilo,  &
-       wfevap, wfrain, wfsnow,  &  
-       prfl, psfl, fraca, Vprecip,  &
-       zw2,  &
-       !
-       fluxu, fluxv,  &
-       fluxt,  &
-       !
-       uwriteSTD, vwriteSTD, &                !pour calcul_STDlev.h
-       wwriteSTD, phiwriteSTD, &              !pour calcul_STDlev.h
-       qwriteSTD, twriteSTD, rhwriteSTD, &    !pour calcul_STDlev.h
-       ! 
-       beta_prec,  &
-       rneb,  &
-       zxsnow,snowhgt,qsnow,to_ice,sissnow,runoff,albsol3_lic
-       !
-
-    IMPLICIT NONE
-    !>======================================================================
-    !!
-    !! Auteur(s) Z.X. Li (LMD/CNRS) date: 19930818
-    !!
-    !! Objet: Moniteur general de la physique du modele
-    !!AA      Modifications quant aux traceurs :
-    !!AA                  -  uniformisation des parametrisations ds phytrac
-    !!AA                  -  stockage des moyennes des champs necessaires
-    !!AA                     en mode traceur off-line 
-    !!======================================================================
-    !!   CLEFS CPP POUR LES IO
-    !!   =====================
-#define histNMC
-    !!======================================================================
-    !!    modif   ( P. Le Van ,  12/10/98 )
-    !!
-    !!  Arguments:
-    !!
-    !! nlon----input-I-nombre de points horizontaux
-    !! nlev----input-I-nombre de couches verticales, doit etre egale a klev
-    !! debut---input-L-variable logique indiquant le premier passage
-    !! lafin---input-L-variable logique indiquant le dernier passage
-    !! jD_cur       -R-jour courant a l'appel de la physique (jour julien)
-    !! jH_cur       -R-heure courante a l'appel de la physique (jour julien)
-    !! pdtphys-input-R-pas d'integration pour la physique (seconde)
-    !! paprs---input-R-pression pour chaque inter-couche (en Pa)
-    !! pplay---input-R-pression pour le mileu de chaque couche (en Pa)
-    !! pphi----input-R-geopotentiel de chaque couche (g z) (reference sol)
-    !! pphis---input-R-geopotentiel du sol
-    !! presnivs-input_R_pressions approximat. des milieux couches ( en PA)
-    !! u-------input-R-vitesse dans la direction X (de O a E) en m/s
-    !! v-------input-R-vitesse Y (de S a N) en m/s
-    !! t-------input-R-temperature (K)
-    !! qx------input-R-humidite specifique (kg/kg) et d'autres traceurs
-    !! d_t_dyn-input-R-tendance dynamique pour "t" (K/s)
-    !! d_q_dyn-input-R-tendance dynamique pour "q" (kg/kg/s)
-    !! d_ql_dyn-input-R-tendance dynamique pour "ql" (kg/kg/s)
-    !! d_qs_dyn-input-R-tendance dynamique pour "qs" (kg/kg/s)
-    !! flxmass_w -input-R- flux de masse verticale
-    !! d_u-----output-R-tendance physique de "u" (m/s/s)
-    !! d_v-----output-R-tendance physique de "v" (m/s/s)
-    !! d_t-----output-R-tendance physique de "t" (K/s)
-    !! d_qx----output-R-tendance physique de "qx" (kg/kg/s)
-    !! d_ps----output-R-tendance physique de la pression au sol
-    !!======================================================================
-    integer jjmp1
-    !  parameter (jjmp1=jjm+1-1/jjm) ! => (jjmp1=nbp_lat-1/(nbp_lat-1))
-    !  integer iip1
-    !  parameter (iip1=iim+1)
-
-    include "regdim.h"
-    include "dimsoil.h"
-    include "clesphys.h"
-    include "alpale.h"
-    include "dimpft.h"
-    !======================================================================
-    LOGICAL, SAVE :: ok_volcan ! pour activer les diagnostics volcaniques
-    !$OMP THREADPRIVATE(ok_volcan)
-    INTEGER, SAVE :: flag_volc_surfstrat ! pour imposer le cool/heat rate Ã  la surf/strato
-    !$OMP THREADPRIVATE(flag_volc_surfstrat)
-    LOGICAL ok_cvl  ! pour activer le nouveau driver pour convection KE
-    PARAMETER (ok_cvl=.TRUE.)
-    LOGICAL ok_gust ! pour activer l'effet des gust sur flux surface
-    PARAMETER (ok_gust=.FALSE.)
-    INTEGER, SAVE :: iflag_radia     ! active ou non le rayonnement (MPL)
-    !$OMP THREADPRIVATE(iflag_radia)
-    !======================================================================
-    LOGICAL check ! Verifier la conservation du modele en eau
-    PARAMETER (check=.FALSE.)
-    LOGICAL ok_stratus ! Ajouter artificiellement les stratus
-    PARAMETER (ok_stratus=.FALSE.)
-    !======================================================================
-    REAL amn, amx
-    INTEGER igout
-    !======================================================================
-    ! Clef iflag_cycle_diurne controlant l'activation du cycle diurne:
-    ! en attente du codage des cles par Fred
-    ! iflag_cycle_diurne est initialise par conf_phys et se trouve 
-    ! dans clesphys.h (IM)
-    !======================================================================
-    ! Modele thermique du sol, a activer pour le cycle diurne:
-    !cc      LOGICAL soil_model
-    !cc      PARAMETER (soil_model=.FALSE.)
-    !======================================================================
-    ! Dans les versions precedentes, l'eau liquide nuageuse utilisee dans
-    ! le calcul du rayonnement est celle apres la precipitation des nuages.
-    ! Si cette cle new_oliq est activee, ce sera une valeur moyenne entre
-    ! la condensation et la precipitation. Cette cle augmente les impacts
-    ! radiatifs des nuages.
-    !cc      LOGICAL new_oliq
-    !cc      PARAMETER (new_oliq=.FALSE.)
-    !======================================================================
-    ! Clefs controlant deux parametrisations de l'orographie:
-    !c      LOGICAL ok_orodr
-    !cc      PARAMETER (ok_orodr=.FALSE.)
-    !cc      LOGICAL ok_orolf
-    !cc      PARAMETER (ok_orolf=.FALSE.)
-    !======================================================================
-    LOGICAL ok_journe ! sortir le fichier journalier
-    SAVE ok_journe
-    !$OMP THREADPRIVATE(ok_journe)
-    !
-    LOGICAL ok_mensuel ! sortir le fichier mensuel
-    SAVE ok_mensuel
-    !$OMP THREADPRIVATE(ok_mensuel)
-    !
-    LOGICAL ok_instan ! sortir le fichier instantane
-    SAVE ok_instan
-    !$OMP THREADPRIVATE(ok_instan)
-    !
-    LOGICAL ok_LES ! sortir le fichier LES 
-    SAVE ok_LES                            
-    !$OMP THREADPRIVATE(ok_LES)                  
-    !
-    LOGICAL callstats ! sortir le fichier stats 
-    SAVE callstats                            
-    !$OMP THREADPRIVATE(callstats)                  
-    !
-    LOGICAL ok_region ! sortir le fichier regional
-    PARAMETER (ok_region=.FALSE.)
-    !======================================================================
-    REAL seuil_inversion
-    SAVE seuil_inversion
-    !$OMP THREADPRIVATE(seuil_inversion)
-    INTEGER iflag_ratqs
-    SAVE iflag_ratqs
-    !$OMP THREADPRIVATE(iflag_ratqs)
-    real facteur
-
-    REAL wmax_th(klon)
-    REAL tau_overturning_th(klon)
-
-    INTEGER lmax_th(klon)
-    INTEGER limbas(klon)
-    REAL ratqscth(klon,klev)
-    REAL ratqsdiff(klon,klev)
-    REAL zqsatth(klon,klev)
-
-    !======================================================================
-    !
-    ! indices de traceurs eau vapeur, liquide, glace, fraction nuageuse LS (optional)
-    INTEGER,SAVE :: ivap, iliq, isol, irneb
-!$OMP THREADPRIVATE(ivap, iliq, isol, irneb)
-    !
-    !
-    ! Variables argument:
-    !
-    INTEGER nlon
-    INTEGER nlev
-    REAL,INTENT(IN) :: pdtphys_
-    ! NB: pdtphys to be used in physics is in time_phylmdz_mod
-    LOGICAL debut, lafin
-    REAL paprs(klon,klev+1)
-    REAL pplay(klon,klev)
-    REAL pphi(klon,klev)
-    REAL pphis(klon)
-    REAL presnivs(klev)
-!JLD    REAL znivsig(klev)
-!JLD    real pir
-
-    REAL u(klon,klev)
-    REAL v(klon,klev)
-
-    REAL, intent(in):: rot(klon, klev)
-    ! relative vorticity, in s-1, needed for frontal waves
-
-    REAL t(klon,klev),thetal(klon,klev)
-    ! thetal: ligne suivante a decommenter si vous avez les fichiers
-    !     MPL 20130625
-    ! fth_fonctions.F90 et parkind1.F90
-    ! sinon thetal=theta
-    !     REAL fth_thetae,fth_thetav,fth_thetal
-    REAL qx(klon,klev,nqtot)
-    REAL flxmass_w(klon,klev)
-    REAL d_u(klon,klev)
-    REAL d_v(klon,klev)
-    REAL d_t(klon,klev)
-    REAL d_qx(klon,klev,nqtot)
-    REAL d_ps(klon)
-  ! variables pour tend_to_tke
-    REAL duadd(klon,klev)
-    REAL dvadd(klon,klev)
-    REAL dtadd(klon,klev)
-
-#ifndef CPP_XIOS
-    REAL, SAVE :: missing_val=nf90_fill_real
-#endif
-!!   Variables moved to phys_local_var_mod
-!!    ! Variables pour le transport convectif
-!!    real da(klon,klev),phi(klon,klev,klev),mp(klon,klev)
-!!    real wght_cvfd(klon,klev)
-!!    ! Variables pour le lessivage convectif
-!!    ! RomP >>> 
-!!    real phi2(klon,klev,klev)
-!!    real d1a(klon,klev),dam(klon,klev)
-!!    real ev(klon,klev)
-!!    real clw(klon,klev),elij(klon,klev,klev)
-!!    real epmlmMm(klon,klev,klev),eplaMm(klon,klev)
-!!    ! RomP <<<
-    !IM definition dynamique o_trac dans phys_output_open
-    !      type(ctrl_out) :: o_trac(nqtot)
-
-    ! variables a une pression donnee
-    !
-    include "declare_STDlev.h"
-    !
-    !
-    include "radopt.h"
-    !
-    !
-    INTEGER n
-    !ym      INTEGER npoints
-    !ym      PARAMETER(npoints=klon) 
-    !
-    INTEGER nregISCtot
-    PARAMETER(nregISCtot=1) 
-    !
-    ! imin_debut, nbpti, jmin_debut, nbptj : parametres pour sorties
-    ! sur 1 region rectangulaire y compris pour 1 point
-    ! imin_debut : indice minimum de i; nbpti : nombre de points en
-    ! direction i (longitude)
-    ! jmin_debut : indice minimum de j; nbptj : nombre de points en
-    ! direction j (latitude)
-!JLD    INTEGER imin_debut, nbpti
-!JLD    INTEGER jmin_debut, nbptj 
-    !IM: region='3d' <==> sorties en global
-    CHARACTER*3 region
-    PARAMETER(region='3d')
-    LOGICAL ok_hf
-    !
-    SAVE ok_hf
-    !$OMP THREADPRIVATE(ok_hf)
-
-    INTEGER, PARAMETER :: longcles=20
-    REAL, SAVE :: clesphy0(longcles)
-    !$OMP THREADPRIVATE(clesphy0)
-    !
-    ! Variables propres a la physique
-    INTEGER, SAVE :: itap         ! compteur pour la physique
-    !$OMP THREADPRIVATE(itap)
-
-    INTEGER, SAVE :: abortphy=0   ! Reprere si on doit arreter en fin de phys
-    !$OMP THREADPRIVATE(abortphy)
-    !
-    REAL,SAVE ::  solarlong0
-    !$OMP THREADPRIVATE(solarlong0)
-
-    !
-    !  Parametres de l'Orographie a l'Echelle Sous-Maille (OESM):
-    !
-    !IM 141004     REAL zulow(klon),zvlow(klon),zustr(klon), zvstr(klon)
-    REAL zulow(klon),zvlow(klon)
-    !
-    INTEGER igwd,idx(klon),itest(klon)
-    !
-    !      REAL,allocatable,save :: run_off_lic_0(:)
-    ! !$OMP THREADPRIVATE(run_off_lic_0)
-    !ym      SAVE run_off_lic_0
-    !KE43
-    ! Variables liees a la convection de K. Emanuel (sb):
-    !
-    REAL, SAVE :: bas, top             ! cloud base and top levels
-    !$OMP THREADPRIVATE(bas, top)
-    !------------------------------------------------------------------
-    ! Upmost level reached by deep convection and related variable (jyg)
-    !
-!    INTEGER izero
-    INTEGER k_upper_cv
-    !------------------------------------------------------------------
-    ! Compteur de l'occurence de cvpas=1
-    INTEGER Ncvpaseq1
-    SAVE Ncvpaseq1
-    !$OMP THREADPRIVATE(Ncvpaseq1)
-    !
-    !==========================================================================
-    !CR04.12.07: on ajoute les nouvelles variables du nouveau schema
-    !de convection avec poches froides
-    ! Variables li\'ees \`a la poche froide (jyg)
-
-!!    REAL mipsh(klon,klev)  ! mass flux shed by the adiab ascent at each level
-!!      Moved to phys_state_var_mod
-    !
-    REAL wape_prescr, fip_prescr
-    INTEGER it_wape_prescr
-    SAVE wape_prescr, fip_prescr, it_wape_prescr
-    !$OMP THREADPRIVATE(wape_prescr, fip_prescr, it_wape_prescr)
-    !
-    ! variables supplementaires de concvl
-    REAL Tconv(klon,klev)
-!!    variable moved to phys_local_var_mod
-!!    REAL sij(klon,klev,klev)
-!!    !
-!!    ! variables pour tester la conservation de l'energie dans concvl
-!!    REAL, DIMENSION(klon,klev)     :: d_t_con_sat
-!!    REAL, DIMENSION(klon,klev)     :: d_q_con_sat
-!!    REAL, DIMENSION(klon,klev)     :: dql_sat
-
-    REAL, SAVE :: alp_bl_prescr=0.
-    REAL, SAVE :: ale_bl_prescr=0.
-    REAL, SAVE :: wake_s_min_lsp=0.1
-    !$OMP THREADPRIVATE(alp_bl_prescr,ale_bl_prescr)
-    !$OMP THREADPRIVATE(wake_s_min_lsp)
-
-    REAL ok_wk_lsp(klon)
-
-    !RC
-    ! Variables li\'ees \`a la poche froide (jyg et rr)
-
-    INTEGER,  SAVE               :: iflag_wake_tend  ! wake: if =0, then wake state variables are
-                                                     ! updated within calwake
-    !$OMP THREADPRIVATE(iflag_wake_tend)
-    INTEGER,  SAVE               :: iflag_alp_wk_cond=0 ! wake: if =0, then Alp_wk is the average lifting
-                                                        ! power provided by the wakes; else, Alp_wk is the
-                                                        ! lifting power conditionned on the presence of a 
-                                                        ! gust-front in the grid cell.
-    !$OMP THREADPRIVATE(iflag_alp_wk_cond)
-
-    REAL t_w(klon,klev),q_w(klon,klev) ! temperature and moisture profiles in the wake region
-    REAL t_x(klon,klev),q_x(klon,klev) ! temperature and moisture profiles in the off-wake region
-
-    REAL wake_dth(klon,klev)        ! wake : temp pot difference
-
-    REAL wake_omgbdth(klon,klev)    ! Wake : flux of Delta_Theta
-    ! transported by LS omega
-    REAL wake_dp_omgb(klon,klev)    ! Wake : vertical gradient of
-    ! large scale omega
-    REAL wake_dtKE(klon,klev)       ! Wake : differential heating
-    ! (wake - unpertubed) CONV
-    REAL wake_dqKE(klon,klev)       ! Wake : differential moistening
-    ! (wake - unpertubed) CONV
-    REAL wake_dp_deltomg(klon,klev) ! Wake : gradient vertical de wake_omg
-    REAL wake_spread(klon,klev)     ! spreading term in wake_delt
-    !
-    !pourquoi y'a pas de save??
-    !
-!!!    INTEGER, SAVE, DIMENSION(klon)   :: wake_k
-!!!    !$OMP THREADPRIVATE(wake_k) 
-    !
-    !jyg<
-    !cc      REAL wake_pe(klon)              ! Wake potential energy - WAPE 
-    !>jyg
-
-    REAL wake_fip_0(klon)           ! Average Front Incoming Power (unconditionned)
-    REAL wake_gfl(klon)             ! Gust Front Length
-!!!    REAL wake_dens(klon)         ! moved to phys_state_var_mod
-    !
-    !
-    REAL dt_dwn(klon,klev)
-    REAL dq_dwn(klon,klev)
-    REAL M_dwn(klon,klev)
-    REAL M_up(klon,klev)
-    REAL dt_a(klon,klev)
-    REAL dq_a(klon,klev)
-    REAL d_t_adjwk(klon,klev)                !jyg
-    REAL d_q_adjwk(klon,klev)                !jyg
-    LOGICAL,SAVE :: ok_adjwk=.FALSE.
-    !$OMP THREADPRIVATE(ok_adjwk) 
-    INTEGER,SAVE :: iflag_adjwk=0            !jyg
-    !$OMP THREADPRIVATE(iflag_adjwk)         !jyg
-    REAL,SAVE :: oliqmax=999.,oicemax=999.
-    !$OMP THREADPRIVATE(oliqmax,oicemax) 
-    REAL, SAVE :: alp_offset
-    !$OMP THREADPRIVATE(alp_offset)
-    REAL, SAVE :: dtcon_multistep_max=1.e6
-    !$OMP THREADPRIVATE(dtcon_multistep_max)
-    REAL, SAVE :: dqcon_multistep_max=1.e6
-    !$OMP THREADPRIVATE(dqcon_multistep_max)
-
-  
-    !
-    !RR:fin declarations poches froides
-    !==========================================================================
-
-    REAL ztv(klon,klev),ztva(klon,klev)
-    REAL zpspsk(klon,klev)
-    REAL ztla(klon,klev),zqla(klon,klev) 
-    REAL zthl(klon,klev)
-
-    !cc nrlmd le 10/04/2012
-
-    !--------Stochastic Boundary Layer Triggering: ALE_BL--------
-    !---Propri\'et\'es du thermiques au LCL 
-    real zlcl_th(klon)          ! Altitude du LCL calcul\'e
-    ! continument (pcon dans
-    ! thermcell_main.F90)
-    real fraca0(klon)           ! Fraction des thermiques au LCL
-    real w0(klon)               ! Vitesse des thermiques au LCL
-    real w_conv(klon)           ! Vitesse verticale de grande \'echelle au LCL
-    real tke0(klon,klev+1)      ! TKE au d\'ebut du pas de temps
-    real therm_tke_max0(klon)   ! TKE dans les thermiques au LCL 
-    real env_tke_max0(klon)     ! TKE dans l'environnement au LCL 
-
-!JLD    !---D\'eclenchement stochastique
-!JLD    integer :: tau_trig(klon)
-
-    REAL,SAVE :: random_notrig_max=1.
-    !$OMP THREADPRIVATE(random_notrig_max) 
-
-    !--------Statistical Boundary Layer Closure: ALP_BL--------
-    !---Profils de TKE dans et hors du thermique
-    real therm_tke_max(klon,klev)   ! Profil de TKE dans les thermiques
-    real env_tke_max(klon,klev)     ! Profil de TKE dans l'environnement
-
-    !-------Activer les tendances de TKE due a l'orograp??ie---------
-     INTEGER, SAVE :: addtkeoro
-    !$OMP THREADPRIVATE(addtkeoro) 
-     REAL, SAVE :: alphatkeoro
-    !$OMP THREADPRIVATE(alphatkeoro) 
-     LOGICAL, SAVE :: smallscales_tkeoro
-    !$OMP THREADPRIVATE(smallscales_tkeoro) 
-
-
-
-    !cc fin nrlmd le 10/04/2012
-
-    ! Variables locales pour la couche limite (al1):
-    !
-    !Al1      REAL pblh(klon)           ! Hauteur de couche limite
-    !Al1      SAVE pblh
-    !34EK
-    !
-    ! Variables locales:
-    !
-    !AA
-    !AA  Pour phytrac 
-    REAL u1(klon)             ! vents dans la premiere couche U
-    REAL v1(klon)             ! vents dans la premiere couche V
-
-    !@$$      LOGICAL offline           ! Controle du stockage ds "physique"
-    !@$$      PARAMETER (offline=.false.)
-    !@$$      INTEGER physid
-    REAL frac_impa(klon,klev) ! fractions d'aerosols lessivees (impaction)
-    REAL frac_nucl(klon,klev) ! idem (nucleation)
-    ! RomP >>> 
-    REAL beta_prec_fisrt(klon,klev) ! taux de conv de l'eau cond (fisrt)
-    ! RomP <<<
-
-    !IM cf FH pour Tiedtke 080604
-    REAL rain_tiedtke(klon),snow_tiedtke(klon)
-    !
-    !IM 050204 END
-    REAL devap(klon) ! evaporation et sa derivee
-    REAL dsens(klon) ! chaleur sensible et sa derivee
-
-    !
-    ! Conditions aux limites
-    !
-    !
-    REAL :: day_since_equinox
-    ! Date de l'equinoxe de printemps
-    INTEGER, parameter :: mth_eq=3, day_eq=21
-    REAL :: jD_eq
-
-    LOGICAL, parameter :: new_orbit = .TRUE.
-
-    !
-    INTEGER lmt_pas
-    SAVE lmt_pas                ! frequence de mise a jour
-    !$OMP THREADPRIVATE(lmt_pas) 
-    real zmasse(klon, nbp_lev),exner(klon, nbp_lev) 
-    !     (column-density of mass of air in a cell, in kg m-2)
-    real, parameter:: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2
-
-    !IM sorties
-    REAL un_jour
-    PARAMETER(un_jour=86400.)
-    INTEGER itapm1 !pas de temps de la physique du(es) mois precedents
-    SAVE itapm1    !mis a jour le dernier pas de temps du mois en cours
-    !$OMP THREADPRIVATE(itapm1)
-    !======================================================================
-    !
-    ! Declaration des procedures appelees
-    !
-    EXTERNAL angle     ! calculer angle zenithal du soleil
-    EXTERNAL alboc     ! calculer l'albedo sur ocean
-    EXTERNAL ajsec     ! ajustement sec
-    EXTERNAL conlmd    ! convection (schema LMD)
-    !KE43
-    EXTERNAL conema3  ! convect4.3
-    EXTERNAL fisrtilp  ! schema de condensation a grande echelle (pluie)
-    !AA 
-    ! JBM (3/14) fisrtilp_tr not loaded
-    ! EXTERNAL fisrtilp_tr ! schema de condensation a grande echelle (pluie)
-    !                          ! stockage des coefficients necessaires au
-    !                          ! lessivage OFF-LINE et ON-LINE
-    EXTERNAL hgardfou  ! verifier les temperatures
-    EXTERNAL nuage     ! calculer les proprietes radiatives
-    !C      EXTERNAL o3cm      ! initialiser l'ozone
-    EXTERNAL orbite    ! calculer l'orbite terrestre
-    EXTERNAL phyredem  ! ecrire l'etat de redemarrage de la physique
-    EXTERNAL suphel    ! initialiser certaines constantes
-    EXTERNAL transp    ! transport total de l'eau et de l'energie
-    !IM
-    EXTERNAL haut2bas  !variables de haut en bas
-    EXTERNAL ini_undefSTD  !initialise a 0 une variable a 1 niveau de pression
-    EXTERNAL undefSTD !somme les valeurs definies d'1 var a 1 niveau de pression
-    !     EXTERNAL moy_undefSTD  !moyenne d'1 var a 1 niveau de pression
-    ! EXTERNAL moyglo_aire
-    ! moyenne globale d'1 var ponderee par l'aire de la maille (moyglo_pondaire)
-    ! par la masse/airetot (moyglo_pondaima) et la vraie masse (moyglo_pondmass)
-    !
-    !
-    ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    ! Local variables
-    ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    !
-!    REAL rhcl(klon,klev)    ! humiditi relative ciel clair
-    REAL dialiq(klon,klev)  ! eau liquide nuageuse
-    REAL diafra(klon,klev)  ! fraction nuageuse
-    REAL radocond(klon,klev)  ! eau condensee nuageuse
-    !
-    !XXX PB 
-    REAL fluxq(klon,klev, nbsrf)   ! flux turbulent d'humidite
-    !
-    REAL zxfluxt(klon, klev)
-    REAL zxfluxq(klon, klev)
-    REAL zxfluxu(klon, klev)
-    REAL zxfluxv(klon, klev)
-
-    ! Le rayonnement n'est pas calcule tous les pas, il faut donc
-    !                      sauvegarder les sorties du rayonnement
-    !ym      SAVE  heat,cool,albpla,topsw,toplw,solsw,sollw,sollwdown
-    !ym      SAVE  sollwdownclr, toplwdown, toplwdownclr
-    !ym      SAVE  topsw0,toplw0,solsw0,sollw0, heat0, cool0
-    !
-    INTEGER itaprad
-    SAVE itaprad
-    !$OMP THREADPRIVATE(itaprad)
-    !
-    REAL conv_q(klon,klev) ! convergence de l'humidite (kg/kg/s)
-    REAL conv_t(klon,klev) ! convergence de la temperature(K/s)
-    !
-    REAL zsav_tsol(klon)
-    !
-    REAL dist, rmu0(klon), fract(klon)
-    REAL zrmu0(klon), zfract(klon)
-    REAL zdtime, zdtime1, zdtime2, zlongi
-    !
-    REAL qcheck
-    REAL z_avant(klon), z_apres(klon), z_factor(klon)
-    LOGICAL zx_ajustq
-    !
-    REAL za
-    REAL zx_t, zx_qs, zdelta, zcor
-    real zqsat(klon,klev)
-    !
-    INTEGER i, k, iq, nsrf, l, itr
-    !
-    REAL t_coup
-    PARAMETER (t_coup=234.0)
-
-    !ym A voir plus tard !!
-    !ym      REAL zx_relief(iim,jjmp1)
-    !ym      REAL zx_aire(iim,jjmp1)
-    !
-    ! Grandeurs de sorties
-    REAL s_capCL(klon)
-    REAL s_oliqCL(klon), s_cteiCL(klon)
-    REAL s_trmb1(klon), s_trmb2(klon)
-    REAL s_trmb3(klon)
-
-    ! La convection n'est pas calculee tous les pas, il faut donc
-    !                      sauvegarder les sorties de la convection
-    !ym      SAVE  
-    !ym      SAVE  
-    !ym      SAVE  
-    !
-    INTEGER itapcv, itapwk
-    SAVE itapcv, itapwk
-    !$OMP THREADPRIVATE(itapcv, itapwk)
-
-    !KE43
-    ! Variables locales pour la convection de K. Emanuel (sb):
-
-    REAL tvp(klon,klev)       ! virtual temp of lifted parcel
-    CHARACTER*40 capemaxcels  !max(CAPE)
-
-    REAL rflag(klon)          ! flag fonctionnement de convect
-    INTEGER iflagctrl(klon)          ! flag fonctionnement de convect
-
-    ! -- convect43:
-    INTEGER ntra              ! nb traceurs pour convect4.3
-    REAL dtvpdt1(klon,klev), dtvpdq1(klon,klev)
-    REAL dplcldt(klon), dplcldr(klon)
-    !?     .     condm_con(klon,klev),conda_con(klon,klev),
-    !?     .     mr_con(klon,klev),ep_con(klon,klev)
-    !?     .    ,sadiab(klon,klev),wadiab(klon,klev)
-    ! --
-    !34EK
-    !
-    ! Variables du changement
-    !
-    ! con: convection
-    ! lsc: condensation a grande echelle (Large-Scale-Condensation)
-    ! ajs: ajustement sec
-    ! eva: evaporation de l'eau liquide nuageuse
-    ! vdf: couche limite (Vertical DiFfusion)
-    !
-    ! tendance nulles
-    REAL, dimension(klon,klev):: du0, dv0, dt0, dq0, dql0, dqi0
-    REAL, dimension(klon)     :: dsig0, ddens0
-    INTEGER, dimension(klon)  :: wkoccur1
-    ! tendance buffer pour appel de add_phys_tend
-    REAL, DIMENSION(klon,klev)  :: d_q_ch4_dtime
-    !
-    ! Flag pour pouvoir ne pas ajouter les tendances. 
-    ! Par defaut, les tendances doivente etre ajoutees et
-    ! flag_inhib_tend = 0
-    ! flag_inhib_tend > 0 : tendances non ajoutees, avec un nombre 
-    ! croissant de print quand la valeur du flag augmente
-    !!! attention, ce flag doit etre change avec prudence !!!
-    INTEGER :: flag_inhib_tend = 0 !  0 is the default value
-!!    INTEGER :: flag_inhib_tend = 2
-    !
-    ! Logical switch to a bug : reseting to 0 convective variables at the 
-    ! begining of physiq.
-    LOGICAL, SAVE :: ok_bug_cv_trac = .TRUE.
-    !$OMP THREADPRIVATE(ok_bug_cv_trac)
-    !
-    ! Logical switch to a bug : changing wake_deltat when thermals are active
-    ! even when there are no wakes.
-    LOGICAL, SAVE :: ok_bug_split_th = .TRUE.
-    !$OMP THREADPRIVATE(ok_bug_split_th)
-
-    !
-    !********************************************************
-    !     declarations
-
-    !********************************************************
-    !IM 081204 END
-    !
-    REAL pen_u(klon,klev), pen_d(klon,klev)
-    REAL pde_u(klon,klev), pde_d(klon,klev)
-    INTEGER kcbot(klon), kctop(klon), kdtop(klon)
-    !
-    REAL ratqsbas,ratqshaut,tau_ratqs
-    SAVE ratqsbas,ratqshaut,tau_ratqs
-    !$OMP THREADPRIVATE(ratqsbas,ratqshaut,tau_ratqs)
-    REAL, SAVE :: ratqsp0=50000., ratqsdp=20000.
-    !$OMP THREADPRIVATE(ratqsp0, ratqsdp)
-
-    ! Parametres lies au nouveau schema de nuages (SB, PDF)
-    REAL, SAVE :: fact_cldcon
-    REAL, SAVE :: facttemps
-    !$OMP THREADPRIVATE(fact_cldcon,facttemps)
-    LOGICAL, SAVE :: ok_newmicro
-    !$OMP THREADPRIVATE(ok_newmicro)
-
-    INTEGER, SAVE :: iflag_cld_th
-    !$OMP THREADPRIVATE(iflag_cld_th)
-!IM logical ptconv(klon,klev)  !passe dans phys_local_var_mod
-    !IM cf. AM 081204 BEG
-    LOGICAL ptconvth(klon,klev)
-
-    REAL picefra(klon,klev)
-    REAL zrel_oro(klon)
-    !IM cf. AM 081204 END
-    !
-    ! Variables liees a l'ecriture de la bande histoire physique
-    !
-    !======================================================================
-    !
-    !
-!JLD    integer itau_w   ! pas de temps ecriture = itap + itau_phy
-    !
-    !
-    ! Variables locales pour effectuer les appels en serie
-    !
-    !IM RH a 2m (la surface)
-    REAL Lheat
-
-    INTEGER        length
-    PARAMETER    ( length = 100 )
-    REAL tabcntr0( length       )
-    !
-!JLD    INTEGER ndex2d(nbp_lon*nbp_lat)
-    !IM
-    !
-    !IM AMIP2 BEG
-!JLD    REAL moyglo, mountor
-    !IM 141004 BEG
-    REAL zustrdr(klon), zvstrdr(klon)
-    REAL zustrli(klon), zvstrli(klon)
-    REAL zustrph(klon), zvstrph(klon)
-    REAL aam, torsfc
-    !IM 141004 END
-    !IM 190504 BEG
-    !  INTEGER imp1jmp1
-    !  PARAMETER(imp1jmp1=(iim+1)*jjmp1)
-    !ym A voir plus tard
-    !  REAL zx_tmp((nbp_lon+1)*nbp_lat)
-    !  REAL airedyn(nbp_lon+1,nbp_lat)
-    !IM 190504 END
-!JLD    LOGICAL ok_msk
-!JLD    REAL msk(klon)
-    !ym A voir plus tard
-    !ym      REAL zm_wo(jjmp1, klev)
-    !IM AMIP2 END
-    !
-    REAL zx_tmp_fi2d(klon)      ! variable temporaire grille physique
-    REAL zx_tmp_fi3d(klon,klev) ! variable temporaire pour champs 3D 
-!JLD    REAL zx_tmp_2d(nbp_lon,nbp_lat)
-!JLD    REAL zx_lon(nbp_lon,nbp_lat)
-!JLD    REAL zx_lat(nbp_lon,nbp_lat)
-    !
-    INTEGER nid_ctesGCM
-    SAVE nid_ctesGCM
-    !$OMP THREADPRIVATE(nid_ctesGCM)
-    !
-    !IM 280405 BEG
-    !  INTEGER nid_bilKPins, nid_bilKPave
-    !  SAVE nid_bilKPins, nid_bilKPave
-    !  !$OMP THREADPRIVATE(nid_bilKPins, nid_bilKPave)
-    !
-    REAL ve_lay(klon,klev) ! transport meri. de l'energie a chaque niveau vert.
-    REAL vq_lay(klon,klev) ! transport meri. de l'eau a chaque niveau vert.
-    REAL ue_lay(klon,klev) ! transport zonal de l'energie a chaque niveau vert.
-    REAL uq_lay(klon,klev) ! transport zonal de l'eau a chaque niveau vert.
-    !
-!JLD    REAL zjulian
-!JLD    SAVE zjulian
-!JLD!$OMP THREADPRIVATE(zjulian)
-
-!JLD    INTEGER nhori, nvert
-!JLD    REAL zsto
-!JLD    REAL zstophy, zout
-
-    CHARACTER (LEN=20) :: modname='physiq_mod'
-    CHARACTER*80 abort_message
-    LOGICAL, SAVE ::  ok_sync, ok_sync_omp
-    !$OMP THREADPRIVATE(ok_sync)
-    REAL date0
-
-    ! essai writephys
-    INTEGER fid_day, fid_mth, fid_ins
-    PARAMETER (fid_ins = 1, fid_day = 2, fid_mth = 3) 
-    INTEGER prof2d_on, prof3d_on, prof2d_av, prof3d_av
-    PARAMETER (prof2d_on = 1, prof3d_on = 2, prof2d_av = 3, prof3d_av = 4)
-    REAL ztsol(klon)
-    REAL q2m(klon,nbsrf)  ! humidite a 2m
-
-    !IM: t2m, q2m, ustar, u10m, v10m et t2mincels, t2maxcels
-    CHARACTER*40 t2mincels, t2maxcels       !t2m min., t2m max
-    CHARACTER*40 tinst, tave
-    REAL cldtaupi(klon,klev) ! Cloud optical thickness for
-    ! pre-industrial (pi) aerosols
-
-    INTEGER :: naero
-    ! Aerosol optical properties
-    CHARACTER*4, DIMENSION(naero_grp) :: rfname 
-    REAL, DIMENSION(klon,klev)     :: mass_solu_aero ! total mass
-    ! concentration
-    ! for all soluble
-    ! aerosols[ug/m3]
-    REAL, DIMENSION(klon,klev)     :: mass_solu_aero_pi
-    ! - " - (pre-industrial value)
-
-    ! Parameters
-    LOGICAL ok_ade, ok_aie    ! Apply aerosol (in)direct effects or not
-    LOGICAL ok_alw            ! Apply aerosol LW effect or not
-    LOGICAL ok_cdnc ! ok cloud droplet number concentration (O. Boucher 01-2013)
-    REAL bl95_b0, bl95_b1   ! Parameter in Boucher and Lohmann (1995)
-    SAVE ok_ade, ok_aie, ok_alw, ok_cdnc, bl95_b0, bl95_b1
-    !$OMP THREADPRIVATE(ok_ade, ok_aie, ok_alw, ok_cdnc, bl95_b0, bl95_b1)
-    LOGICAL, SAVE :: aerosol_couple ! true  : calcul des aerosols dans INCA
-    ! false : lecture des aerosol dans un fichier
-    !$OMP THREADPRIVATE(aerosol_couple)    
-    LOGICAL, SAVE :: chemistry_couple ! true  : use INCA chemistry O3 
-    ! false : use offline chemistry O3
-    !$OMP THREADPRIVATE(chemistry_couple)    
-    INTEGER, SAVE :: flag_aerosol 
-    !$OMP THREADPRIVATE(flag_aerosol) 
-    LOGICAL, SAVE :: flag_bc_internal_mixture
-    !$OMP THREADPRIVATE(flag_bc_internal_mixture)
-    !
-    !--STRAT AEROSOL
-    INTEGER, SAVE :: flag_aerosol_strat
-    !$OMP THREADPRIVATE(flag_aerosol_strat)
-    !
-    !--INTERACTIVE AEROSOL FEEDBACK ON RADIATION
-    LOGICAL, SAVE :: flag_aer_feedback
-    !$OMP THREADPRIVATE(flag_aer_feedback)
-
-    !c-fin STRAT AEROSOL
-    !
-    ! Declaration des constantes et des fonctions thermodynamiques
-    !
-    LOGICAL,SAVE :: first=.TRUE.
-    !$OMP THREADPRIVATE(first)
-
-    ! VARIABLES RELATED TO OZONE CLIMATOLOGIES ; all are OpenMP shared
-    ! Note that pressure vectors are in Pa and in stricly ascending order
-    INTEGER,SAVE :: read_climoz                ! Read ozone climatology
-    !     (let it keep the default OpenMP shared attribute)
-    !     Allowed values are 0, 1 and 2
-    !     0: do not read an ozone climatology
-    !     1: read a single ozone climatology that will be used day and night
-    !     2: read two ozone climatologies, the average day and night
-    !     climatology and the daylight climatology
-    INTEGER,SAVE :: ncid_climoz                ! NetCDF file identifier
-    REAL, allocatable, SAVE :: press_cen_climoz(:) ! Pressure levels
-    REAL, allocatable, SAVE :: press_edg_climoz(:) ! Edges of pressure intervals
-    REAL, allocatable, SAVE :: time_climoz(:)      ! Time vector
-    CHARACTER(LEN=13), PARAMETER :: vars_climoz(2) &
-                                  = ["tro3         ","tro3_daylight"]
-    ! vars_climoz(1:read_climoz): variables names in climoz file.
-    ! vars_climoz(1:read_climoz-2) if read_climoz>2 (temporary)
-    REAL :: ro3i ! 0<=ro3i<=360 ; required time index in NetCDF file for
-                 ! the ozone fields, old method.
-
-    include "YOMCST.h"
-    include "YOETHF.h"
-    include "FCTTRE.h"
-    !IM 100106 BEG : pouvoir sortir les ctes de la physique
-    include "conema3.h"
-    include "fisrtilp.h"
-    include "nuage.h"
-    include "compbl.h"
-    !IM 100106 END : pouvoir sortir les ctes de la physique
-    !
-    ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    ! Declarations pour Simulateur COSP
-    !============================================================
-    real :: mr_ozone(klon,klev), phicosp(klon,klev)
-
-    !IM stations CFMIP
-    INTEGER, SAVE :: nCFMIP
-    !$OMP THREADPRIVATE(nCFMIP)
-    INTEGER, PARAMETER :: npCFMIP=120
-    INTEGER, ALLOCATABLE, SAVE :: tabCFMIP(:)
-    REAL, ALLOCATABLE, SAVE :: lonCFMIP(:), latCFMIP(:)
-    !$OMP THREADPRIVATE(tabCFMIP, lonCFMIP, latCFMIP) 
-    INTEGER, ALLOCATABLE, SAVE :: tabijGCM(:)
-    REAL, ALLOCATABLE, SAVE :: lonGCM(:), latGCM(:)
-    !$OMP THREADPRIVATE(tabijGCM, lonGCM, latGCM)
-    INTEGER, ALLOCATABLE, SAVE :: iGCM(:), jGCM(:)
-    !$OMP THREADPRIVATE(iGCM, jGCM)
-    logical, dimension(nfiles)            :: phys_out_filestations
-    logical, parameter :: lNMC=.FALSE.
-
-    !IM betaCRF
-    REAL, SAVE :: pfree, beta_pbl, beta_free
-    !$OMP THREADPRIVATE(pfree, beta_pbl, beta_free)
-    REAL, SAVE :: lon1_beta,  lon2_beta, lat1_beta, lat2_beta
-    !$OMP THREADPRIVATE(lon1_beta,  lon2_beta, lat1_beta, lat2_beta)
-    LOGICAL, SAVE :: mskocean_beta
-    !$OMP THREADPRIVATE(mskocean_beta)
-    REAL, dimension(klon, klev) :: beta ! facteur sur cldtaurad et
-    ! cldemirad pour evaluer les
-    ! retros liees aux CRF
-    REAL, dimension(klon, klev) :: cldtaurad   ! epaisseur optique
-    ! pour radlwsw pour
-    ! tester "CRF off"
-    REAL, dimension(klon, klev) :: cldtaupirad ! epaisseur optique
-    ! pour radlwsw pour
-    ! tester "CRF off"
-    REAL, dimension(klon, klev) :: cldemirad   ! emissivite pour
-    ! radlwsw pour tester
-    ! "CRF off"
-    REAL, dimension(klon, klev) :: cldfrarad   ! fraction nuageuse
-
-#ifdef INCA
-    REAL :: calday, zxsnow_dummy(klon)
-    ! set de variables utilisees pour l'initialisation des valeurs provenant de INCA
-    REAL, DIMENSION(klon,klev,naero_grp,nbands) :: init_tauinca
-    REAL, DIMENSION(klon,klev,naero_grp,nbands) :: init_pizinca
-    REAL, DIMENSION(klon,klev,naero_grp,nbands) :: init_cginca
-    REAL, DIMENSION(klon,klev,nbands) :: init_ccminca
-#endif
-    REAL, DIMENSION(klon,nbtr) :: init_source
-
-    !lwoff=y : offset LW CRE for radiation code and other schemes
-    REAL, SAVE :: betalwoff 
-    !OMP THREADPRIVATE(betalwoff)
-!
-    INTEGER :: nbtr_tmp ! Number of tracer inside concvl
-    REAL, dimension(klon,klev) :: sh_in ! Specific humidity entering in phytrac
-    REAL, dimension(klon,klev) :: ch_in ! Condensed humidity entering in phytrac (eau liquide)
-    integer iostat
-
-    REAL, dimension(klon,klev+1) :: tke_dissip_ave, l_mix_ave, wprime_ave
-    REAL zzz
-    !albedo SB >>>
-    REAL,DIMENSION(6), SAVE :: SFRWL
-!$OMP THREADPRIVATE(SFRWL)
-    !albedo SB <<<
-
-    !--OB variables for mass fixer (hard coded for now)
-    LOGICAL, PARAMETER :: mass_fixer=.FALSE.
-    REAL qql1(klon),qql2(klon),corrqql
-
-    REAL pi
-
-    pi = 4. * ATAN(1.)
-
-    ! set-up call to alerte function
-    call_alert = (alert_first_call .AND. is_master)
-    
-    ! Ehouarn: set value of jjmp1 since it is no longer a "fixed parameter"
-    jjmp1=nbp_lat
-
-    !======================================================================
-    ! Gestion calendrier : mise a jour du module phys_cal_mod
-    !
-    pdtphys=pdtphys_
-    CALL update_time(pdtphys)
-    phys_tstep=NINT(pdtphys)
-#ifdef CPP_XIOS
-! switch to XIOS LMDZ physics context 
-    IF (.NOT. debut .AND. is_omp_master) THEN
-       CALL wxios_set_context()
-       CALL xios_update_calendar(itap+1)
-    ENDIF
-#endif
-
-    !======================================================================
-    ! Ecriture eventuelle d'un profil verticale en entree de la physique.
-    ! Utilise notamment en 1D mais peut etre active egalement en 3D
-    ! en imposant la valeur de igout.
-    !======================================================================d
-    IF (prt_level.ge.1) THEN
-       igout=klon/2+1/klon
-       write(lunout,*) 'DEBUT DE PHYSIQ !!!!!!!!!!!!!!!!!!!!'
-       write(lunout,*) 'igout, lat, lon ',igout, latitude_deg(igout), &
-            longitude_deg(igout)
-       write(lunout,*) &
-            'nlon,klev,nqtot,debut,lafin, jD_cur, jH_cur,pdtphys'
-       write(lunout,*) &
-            nlon,klev,nqtot,debut,lafin, jD_cur, jH_cur,pdtphys 
-
-       write(lunout,*) 'paprs, play, phi, u, v, t'
-       DO k=1,klev
-          write(lunout,*) paprs(igout,k),pplay(igout,k),pphi(igout,k), &
-               u(igout,k),v(igout,k),t(igout,k)
-       ENDDO
-       write(lunout,*) 'ovap (g/kg),  oliq (g/kg)'
-       DO k=1,klev
-          write(lunout,*) qx(igout,k,1)*1000,qx(igout,k,2)*1000.
-       ENDDO
-    ENDIF
-
-    ! Quick check on pressure levels:
-    CALL assert(paprs(:, nbp_lev + 1) < paprs(:, nbp_lev), &
-            "physiq_mod paprs bad order")
-
-    IF (first) THEN 
-       ivap = strIdx(tracers(:)%name, addPhase('H2O', 'g'))
-       iliq = strIdx(tracers(:)%name, addPhase('H2O', 'l'))
-       isol = strIdx(tracers(:)%name, addPhase('H2O', 's'))
-       irneb= strIdx(tracers(:)%name, addPhase('H2O', 'r'))
-!       CALL init_etat0_limit_unstruct
-!       IF (.NOT. create_etat0_limit) CALL init_limit_read(days_elapsed)
-       !CR:nvelles variables convection/poches froides
-
-       WRITE(lunout,*) '================================================='
-       WRITE(lunout,*) 'Allocation des variables locales et sauvegardees'
-       WRITE(lunout,*) '================================================='
-       CALL phys_local_var_init
-       !
-       !     appel a la lecture du run.def physique
-       CALL conf_phys(ok_journe, ok_mensuel, &
-            ok_instan, ok_hf, &
-            ok_LES, &
-            callstats, &
-            solarlong0,seuil_inversion, &
-            fact_cldcon, facttemps,ok_newmicro,iflag_radia, &
-            iflag_cld_th,iflag_ratqs,ratqsbas,ratqshaut,tau_ratqs, &
-            ok_ade, ok_aie, ok_alw, ok_cdnc, ok_volcan, flag_volc_surfstrat, aerosol_couple, &
-            chemistry_couple, flag_aerosol, flag_aerosol_strat, flag_aer_feedback, &
-            flag_bc_internal_mixture, bl95_b0, bl95_b1, &
-                                ! nv flags pour la convection et les
-                                ! poches froides
-            read_climoz, &
-            alp_offset)
-       CALL init_etat0_limit_unstruct
-       IF (.NOT. create_etat0_limit) CALL init_limit_read(days_elapsed)
-       CALL phys_state_var_init(read_climoz)
-       CALL phys_output_var_init
-       IF (read_climoz>=1 .AND. create_etat0_limit .AND. grid_type==unstructured) & 
-          CALL regr_horiz_time_climoz(read_climoz,ok_daily_climoz)
-
-#ifdef CPP_StratAer
-       CALL strataer_init
-#endif
-
-       print*, '================================================='
-       !
-       !CR: check sur le nb de traceurs de l eau
-       IF ((iflag_ice_thermo.gt.0).and.(nqo==2)) THEN
-          WRITE (lunout, *) ' iflag_ice_thermo==1 requires 3 H2O tracers ', &
-               '(H2O_g, H2O_l, H2O_s) but nqo=', nqo, '. Might as well stop here.'
-          abort_message='see above'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-
-       IF (ok_ice_sursat.AND.(iflag_ice_thermo.EQ.0)) THEN
-          WRITE (lunout, *) ' ok_ice_sursat=y requires iflag_ice_thermo=1 as well'
-          abort_message='see above'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-
-       IF (ok_ice_sursat.AND.(nqo.NE.4)) THEN
-          WRITE (lunout, *) ' ok_ice_sursat=y requires 4 H2O tracers ', &
-               '(H2O_g, H2O_l, H2O_s, H2O_r) but nqo=', nqo, '. Might as well stop here.'
-          abort_message='see above'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-
-       IF (ok_plane_h2o.AND..NOT.ok_ice_sursat) THEN
-          WRITE (lunout, *) ' ok_plane_h2o=y requires ok_ice_sursat=y '
-          abort_message='see above'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-
-       IF (ok_plane_contrail.AND..NOT.ok_ice_sursat) THEN
-          WRITE (lunout, *) ' ok_plane_contrail=y requires ok_ice_sursat=y '
-          abort_message='see above'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-
-       Ncvpaseq1 = 0
-       dnwd0=0.0
-       ftd=0.0
-       fqd=0.0
-       cin=0.
-       !ym Attention pbase pas initialise dans concvl !!!!
-       pbase=0
-       !IM 180608
-
-       itau_con=0
-       first=.FALSE.
-
-    ENDIF  ! first
-
-    !ym => necessaire pour iflag_con != 2    
-    pmfd(:,:) = 0.
-    pen_u(:,:) = 0.
-    pen_d(:,:) = 0.
-    pde_d(:,:) = 0.
-    pde_u(:,:) = 0.
-    aam=0.
-    d_t_adjwk(:,:)=0
-    d_q_adjwk(:,:)=0
-
-    alp_bl_conv(:)=0.
-
-    torsfc=0.
-    forall (k=1: nbp_lev) zmasse(:, k) = (paprs(:, k)-paprs(:, k+1)) / rg
-
-
-    IF (debut) THEN
-       CALL suphel ! initialiser constantes et parametres phys.
-! tau_gl : constante de rappel de la temperature a la surface de la glace - en
-       tau_gl=5.
-       CALL getin_p('tau_gl', tau_gl)
-! tau_gl : constante de rappel de la temperature a la surface de la glace - en
-! secondes
-       tau_gl=86400.*tau_gl
-       WRITE(lunout,*) 'debut physiq_mod tau_gl=',tau_gl
-
-       CALL getin_p('iflag_alp_wk_cond', iflag_alp_wk_cond) 
-       CALL getin_p('random_notrig_max',random_notrig_max)
-       CALL getin_p('ok_adjwk',ok_adjwk) 
-       IF (ok_adjwk) iflag_adjwk=2  ! for compatibility with older versions
-       ! iflag_adjwk: ! 0 = Default: no convective adjustment of w-region
-                      ! 1 => convective adjustment but state variables are unchanged
-                      ! 2 => convective adjustment and state variables are changed
-       CALL getin_p('iflag_adjwk',iflag_adjwk)
-       CALL getin_p('dtcon_multistep_max',dtcon_multistep_max)
-       CALL getin_p('dqcon_multistep_max',dqcon_multistep_max)
-       CALL getin_p('oliqmax',oliqmax)
-       CALL getin_p('oicemax',oicemax)
-       CALL getin_p('ratqsp0',ratqsp0)
-       CALL getin_p('ratqsdp',ratqsdp)
-       iflag_wake_tend = 0
-       CALL getin_p('iflag_wake_tend',iflag_wake_tend)
-       ok_bad_ecmwf_thermo=.TRUE. ! By default thermodynamical constants are set 
-                                  ! in rrtm/suphec.F90 (and rvtmp2 is set to 0).
-       CALL getin_p('ok_bad_ecmwf_thermo',ok_bad_ecmwf_thermo)
-       CALL getin_p('ok_bug_cv_trac',ok_bug_cv_trac)
-       CALL getin_p('ok_bug_split_th',ok_bug_split_th)
-       fl_ebil = 0 ! by default, conservation diagnostics are desactivated
-       CALL getin_p('fl_ebil',fl_ebil)
-       fl_cor_ebil = 0 ! by default, no correction to ensure energy conservation
-       CALL getin_p('fl_cor_ebil',fl_cor_ebil)
-       iflag_phytrac = 1 ! by default we do want to call phytrac
-       CALL getin_p('iflag_phytrac',iflag_phytrac)
-#ifdef CPP_Dust
-       IF (iflag_phytrac.EQ.0) THEN 
-         WRITE(lunout,*) 'In order to run with SPLA, iflag_phytrac will be forced to 1'
-         iflag_phytrac = 1
-       ENDIF
-#endif
-       nvm_lmdz = 13
-       CALL getin_p('NVM',nvm_lmdz)
-
-       WRITE(lunout,*) 'iflag_alp_wk_cond=',  iflag_alp_wk_cond
-       WRITE(lunout,*) 'random_ntrig_max=',   random_notrig_max
-       WRITE(lunout,*) 'ok_adjwk=',           ok_adjwk
-       WRITE(lunout,*) 'iflag_adjwk=',        iflag_adjwk
-       WRITE(lunout,*) 'qtcon_multistep_max=',dtcon_multistep_max 
-       WRITE(lunout,*) 'qdcon_multistep_max=',dqcon_multistep_max 
-       WRITE(lunout,*) 'ratqsp0=',            ratqsp0
-       WRITE(lunout,*) 'ratqsdp=',            ratqsdp 
-       WRITE(lunout,*) 'iflag_wake_tend=',    iflag_wake_tend
-       WRITE(lunout,*) 'ok_bad_ecmwf_thermo=',ok_bad_ecmwf_thermo 
-       WRITE(lunout,*) 'ok_bug_cv_trac=',     ok_bug_cv_trac 
-       WRITE(lunout,*) 'ok_bug_split_th=',    ok_bug_split_th
-       WRITE(lunout,*) 'fl_ebil=',            fl_ebil
-       WRITE(lunout,*) 'fl_cor_ebil=',        fl_cor_ebil
-       WRITE(lunout,*) 'iflag_phytrac=',      iflag_phytrac
-       WRITE(lunout,*) 'NVM=',                nvm_lmdz
-
-       !--PC: defining fields to be exchanged between LMDz, ORCHIDEE and NEMO
-       WRITE(lunout,*) 'Call to infocfields from physiq'
-       CALL infocfields_init
-
-    ENDIF
-
-    IF (prt_level.ge.1) print *,'CONVERGENCE PHYSIQUE THERM 1 '
-
-    !======================================================================
-    ! Gestion calendrier : mise a jour du module phys_cal_mod
-    !
-    !     CALL phys_cal_update(jD_cur,jH_cur)
-
-    !
-    ! Si c'est le debut, il faut initialiser plusieurs choses
-    !          ********
-    !
-    IF (debut) THEN
-       !rv CRinitialisation de wght_th et lalim_conv pour la
-       !definition de la couche alimentation de la convection a partir
-       !des caracteristiques du thermique
-       wght_th(:,:)=1.
-       lalim_conv(:)=1 
-       !RC
-       ustar(:,:)=0.
-!       u10m(:,:)=0.
-!       v10m(:,:)=0.
-       rain_con(:)=0.
-       snow_con(:)=0.
-       topswai(:)=0.
-       topswad(:)=0.
-       solswai(:)=0.
-       solswad(:)=0.
-
-       wmax_th(:)=0.
-       tau_overturning_th(:)=0.
-
-       IF (ANY(type_trac == ['inca','inco'])) THEN
-          ! jg : initialisation jusqu'au ces variables sont dans restart
-          ccm(:,:,:) = 0.
-          tau_aero(:,:,:,:) = 0.
-          piz_aero(:,:,:,:) = 0.
-          cg_aero(:,:,:,:) = 0.
-
-          config_inca='none' ! default
-          CALL getin_p('config_inca',config_inca)
-
-       ELSE 
-          config_inca='none' ! default
-       ENDIF
-
-       tau_aero(:,:,:,:) = 1.e-15
-       piz_aero(:,:,:,:) = 1.
-       cg_aero(:,:,:,:)  = 0.
-
-       IF (aerosol_couple .AND. (config_inca /= "aero" &
-            .AND. config_inca /= "aeNP ")) THEN
-          abort_message &
-               = 'if aerosol_couple is activated, config_inca need to be ' &
-               // 'aero or aeNP'
-          CALL abort_physic (modname,abort_message,1)
-       ENDIF
-
-       rnebcon0(:,:) = 0.0
-       clwcon0(:,:) = 0.0
-       rnebcon(:,:) = 0.0
-       clwcon(:,:) = 0.0
-
-       !
-       print*,'iflag_coupl,iflag_clos,iflag_wake', &
-            iflag_coupl,iflag_clos,iflag_wake
-       print*,'iflag_cycle_diurne', iflag_cycle_diurne
-       !
-       IF (iflag_con.EQ.2.AND.iflag_cld_th.GT.-1) THEN
-          abort_message = 'Tiedtke needs iflag_cld_th=-2 or -1'
-          CALL abort_physic (modname,abort_message,1)
-       ENDIF
-       !
-       !
-       ! Initialiser les compteurs:
-       !
-       itap    = 0
-       itaprad = 0
-       itapcv = 0
-       itapwk = 0
-
-       ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       !! Un petit travail \`a faire ici.
-       ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-       IF (iflag_pbl>1) THEN
-          PRINT*, "Using method MELLOR&YAMADA" 
-       ENDIF
-
-       ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       ! FH 2008/05/02 changement lie a la lecture de nbapp_rad dans
-       ! phylmd plutot que dyn3d
-       ! Attention : la version precedente n'etait pas tres propre.
-       ! Il se peut qu'il faille prendre une valeur differente de nbapp_rad
-       ! pour obtenir le meme resultat.
-!jyg for fh<
-       WRITE(lunout,*) 'Pas de temps phys_tstep pdtphys ',phys_tstep,pdtphys
-       IF (abs(phys_tstep-pdtphys)>1.e-10) THEN
-          abort_message='pas de temps doit etre entier en seconde pour orchidee et XIOS'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-!>jyg
-       IF (MOD(NINT(86400./phys_tstep),nbapp_rad).EQ.0) THEN
-          radpas = NINT( 86400./phys_tstep)/nbapp_rad
-       ELSE 
-          WRITE(lunout,*) 'le nombre de pas de temps physique doit etre un ', &
-               'multiple de nbapp_rad'
-          WRITE(lunout,*) 'changer nbapp_rad ou alors commenter ce test ', &
-               'mais 1+1<>2'
-          abort_message='nbre de pas de temps physique n est pas multiple ' &
-               // 'de nbapp_rad'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-       IF (nbapp_cv .EQ. 0) nbapp_cv=86400./phys_tstep
-       IF (nbapp_wk .EQ. 0) nbapp_wk=86400./phys_tstep
-       print *,'physiq, nbapp_cv, nbapp_wk ',nbapp_cv,nbapp_wk
-       IF (MOD(NINT(86400./phys_tstep),nbapp_cv).EQ.0) THEN
-          cvpas_0 = NINT( 86400./phys_tstep)/nbapp_cv
-          cvpas = cvpas_0
-       print *,'physiq, cvpas ',cvpas
-       ELSE 
-          WRITE(lunout,*) 'le nombre de pas de temps physique doit etre un ', &
-               'multiple de nbapp_cv'
-          WRITE(lunout,*) 'changer nbapp_cv ou alors commenter ce test ', &
-               'mais 1+1<>2'
-          abort_message='nbre de pas de temps physique n est pas multiple ' &
-               // 'de nbapp_cv'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-       IF (MOD(NINT(86400./phys_tstep),nbapp_wk).EQ.0) THEN
-          wkpas = NINT( 86400./phys_tstep)/nbapp_wk
-!       print *,'physiq, wkpas ',wkpas
-       ELSE 
-          WRITE(lunout,*) 'le nombre de pas de temps physique doit etre un ', &
-               'multiple de nbapp_wk'
-          WRITE(lunout,*) 'changer nbapp_wk ou alors commenter ce test ', &
-               'mais 1+1<>2'
-          abort_message='nbre de pas de temps physique n est pas multiple ' &
-               // 'de nbapp_wk'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-       ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       CALL init_iophy_new(latitude_deg,longitude_deg)
-
-          !===================================================================
-          !IM stations CFMIP
-          nCFMIP=npCFMIP
-          OPEN(98,file='npCFMIP_param.data',status='old', &
-               form='formatted',iostat=iostat)
-          IF (iostat == 0) THEN
-             READ(98,*,end=998) nCFMIP
-998          CONTINUE
-             CLOSE(98)
-             CONTINUE
-             IF(nCFMIP.GT.npCFMIP) THEN
-                print*,'nCFMIP > npCFMIP : augmenter npCFMIP et recompiler'
-                CALL abort_physic("physiq", "", 1)
-             ELSE
-                print*,'physiq npCFMIP=',npCFMIP,'nCFMIP=',nCFMIP
-             ENDIF
-
-             !
-             ALLOCATE(tabCFMIP(nCFMIP))
-             ALLOCATE(lonCFMIP(nCFMIP), latCFMIP(nCFMIP))
-             ALLOCATE(tabijGCM(nCFMIP))
-             ALLOCATE(lonGCM(nCFMIP), latGCM(nCFMIP))
-             ALLOCATE(iGCM(nCFMIP), jGCM(nCFMIP))
-             !
-             ! lecture des nCFMIP stations CFMIP, de leur numero 
-             ! et des coordonnees geographiques lonCFMIP, latCFMIP
-             !
-             CALL read_CFMIP_point_locations(nCFMIP, tabCFMIP,  &
-                  lonCFMIP, latCFMIP)
-             !
-             ! identification des
-             ! 1) coordonnees lonGCM, latGCM des points CFMIP dans la
-             ! grille de LMDZ
-             ! 2) indices points tabijGCM de la grille physique 1d sur
-             ! klon points
-             ! 3) indices iGCM, jGCM de la grille physique 2d
-             !
-             CALL LMDZ_CFMIP_point_locations(nCFMIP, lonCFMIP, latCFMIP, &
-                  tabijGCM, lonGCM, latGCM, iGCM, jGCM)
-             !
-          ELSE
-             ALLOCATE(tabijGCM(0))
-             ALLOCATE(lonGCM(0), latGCM(0))
-             ALLOCATE(iGCM(0), jGCM(0))
-          ENDIF
-
-#ifdef CPP_IOIPSL
-
-       !$OMP MASTER
-       ! FH : if ok_sync=.true. , the time axis is written at each time step
-       ! in the output files. Only at the end in the opposite case
-       ok_sync_omp=.FALSE.
-       CALL getin('ok_sync',ok_sync_omp)
-       CALL phys_output_open(longitude_deg,latitude_deg,nCFMIP,tabijGCM, &
-            iGCM,jGCM,lonGCM,latGCM, &
-            jjmp1,nlevSTD,clevSTD,rlevSTD, phys_tstep,ok_veget, &
-            type_ocean,iflag_pbl,iflag_pbl_split,ok_mensuel,ok_journe, &
-            ok_hf,ok_instan,ok_LES,ok_ade,ok_aie, &
-            read_climoz, phys_out_filestations, &
-            aerosol_couple, &
-            flag_aerosol_strat, pdtphys, paprs, pphis,  &
-            pplay, lmax_th, ptconv, ptconvth, ivap,  &
-            d_u, d_t, qx, d_qx, zmasse, ok_sync_omp)
-       !$OMP END MASTER
-       !$OMP BARRIER
-       ok_sync=ok_sync_omp
-
-       freq_outNMC(1) = ecrit_files(7)
-       freq_outNMC(2) = ecrit_files(8)
-       freq_outNMC(3) = ecrit_files(9)
-       WRITE(lunout,*)'OK freq_outNMC(1)=',freq_outNMC(1)
-       WRITE(lunout,*)'OK freq_outNMC(2)=',freq_outNMC(2)
-       WRITE(lunout,*)'OK freq_outNMC(3)=',freq_outNMC(3)
-
-#ifndef CPP_XIOS
-       CALL ini_paramLMDZ_phy(phys_tstep,nid_ctesGCM)
-#endif
-
-#endif
-       ecrit_reg = ecrit_reg * un_jour
-       ecrit_tra = ecrit_tra * un_jour
-
-       !XXXPB Positionner date0 pour initialisation de ORCHIDEE
-       date0 = jD_ref 
-       WRITE(*,*) 'physiq date0 : ',date0
-       !
-
-!       CALL create_climoz(read_climoz)
-      IF (.NOT. create_etat0_limit) CALL init_aero_fromfile(flag_aerosol, aerosol_couple)  !! initialise aero from file for XIOS interpolation (unstructured_grid)
-      IF (.NOT. create_etat0_limit) CALL init_readaerosolstrato(flag_aerosol_strat)  !! initialise aero strato from file for XIOS interpolation (unstructured_grid)
-
-#ifdef CPP_COSP
-      IF (ok_cosp) THEN
-!           DO k = 1, klev
-!             DO i = 1, klon
-!               phicosp(i,k) = pphi(i,k) + pphis(i)
-!             ENDDO
-!           ENDDO
-        CALL phys_cosp(itap,phys_tstep,freq_cosp, &
-               ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, &
-               ecrit_mth,ecrit_day,ecrit_hf, ok_all_xml, missing_val, &
-               klon,klev,longitude_deg,latitude_deg,presnivs,overlap, &
-               JrNt,ref_liq,ref_ice, &
-               pctsrf(:,is_ter)+pctsrf(:,is_lic), &
-               zu10m,zv10m,pphis, &
-               zphi,paprs(:,1:klev),pplay,zxtsol,t_seri, &
-               qx(:,:,ivap),zx_rh,cldfra,rnebcon,flwc,fiwc, &
-               prfl(:,1:klev),psfl(:,1:klev), &
-               pmflxr(:,1:klev),pmflxs(:,1:klev), &
-               mr_ozone,cldtau, cldemi)
-      ENDIF
-#endif
-
-#ifdef CPP_COSP2
-        IF (ok_cosp) THEN
-!           DO k = 1, klev
-!             DO i = 1, klon
-!               phicosp(i,k) = pphi(i,k) + pphis(i)
-!             ENDDO
-!           ENDDO
-          CALL phys_cosp2(itap,phys_tstep,freq_cosp, &
-               ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, &
-               ecrit_mth,ecrit_day,ecrit_hf, ok_all_xml, missing_val, &
-               klon,klev,longitude_deg,latitude_deg,presnivs,overlap, &
-               JrNt,ref_liq,ref_ice, &
-               pctsrf(:,is_ter)+pctsrf(:,is_lic), &
-               zu10m,zv10m,pphis, &
-               zphi,paprs(:,1:klev),pplay,zxtsol,t_seri, &
-               qx(:,:,ivap),zx_rh,cldfra,rnebcon,flwc,fiwc, &
-               prfl(:,1:klev),psfl(:,1:klev), &
-               pmflxr(:,1:klev),pmflxs(:,1:klev), &
-               mr_ozone,cldtau, cldemi)
-       ENDIF
-#endif
-
-#ifdef CPP_COSPV2
-        IF (ok_cosp) THEN
-           DO k = 1, klev
-             DO i = 1, klon
-               phicosp(i,k) = pphi(i,k) + pphis(i)
-             ENDDO
-           ENDDO
-          CALL lmdz_cosp_interface(itap,phys_tstep,freq_cosp, &
-               ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, &
-               ecrit_mth,ecrit_day,ecrit_hf, ok_all_xml, missing_val, &
-               klon,klev,longitude_deg,latitude_deg,presnivs,overlap, &
-               JrNt,ref_liq,ref_ice, &
-               pctsrf(:,is_ter)+pctsrf(:,is_lic), &
-               zu10m,zv10m,pphis, &
-               phicosp,paprs(:,1:klev),pplay,zxtsol,t_seri, &
-               qx(:,:,ivap),zx_rh,cldfra,rnebcon,flwc,fiwc, &
-               prfl(:,1:klev),psfl(:,1:klev), &
-               pmflxr(:,1:klev),pmflxs(:,1:klev), &
-               mr_ozone,cldtau, cldemi)
-       ENDIF
-#endif
-
-       !
-       !
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       ! Nouvelle initialisation pour le rayonnement RRTM
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-       CALL iniradia(klon,klev,paprs(1,1:klev+1))
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       CALL wake_ini(rg,rd,rv,prt_level)
-       CALL yamada_ini(klon,lunout,prt_level)
-       CALL atke_ini(prt_level, lunout, RG, RD, RPI, RCPD)
-       CALL thermcell_ini(iflag_thermals,prt_level,tau_thermals,lunout, &
-   &    RG,RD,RCPD,RKAPPA,RLVTT,RETV)
-       IF (ok_new_lscp) then
-           CALL lscp_ini(pdtphys,ok_ice_sursat)
-       endif
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-       !
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       ! Initialisation des champs dans phytrac* qui sont utilises par phys_output_write*
-       !
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-#ifdef CPP_Dust
-       ! Quand on utilise SPLA, on force iflag_phytrac=1
-       CALL phytracr_spl_out_init()
-       CALL phys_output_write_spl(itap, pdtphys, paprs, pphis,                  &
-                                pplay, lmax_th, aerosol_couple,                 &
-                                ok_ade, ok_aie, ivap, ok_sync,                  &
-                                ptconv, read_climoz, clevSTD,                   &
-                                ptconvth, d_t, qx, d_qx, d_tr_dyn, zmasse,      &
-                                flag_aerosol, flag_aerosol_strat, ok_cdnc)
-#else
-       ! phys_output_write Ã©crit des variables traceurs seulement si iflag_phytrac == 1 
-       ! donc seulement dans ce cas on doit appeler phytrac_init()
-       IF (iflag_phytrac == 1 ) THEN
-          CALL phytrac_init()
-       ENDIF
-       CALL phys_output_write(itap, pdtphys, paprs, pphis,                    &
-                              pplay, lmax_th, aerosol_couple,                 &
-                              ok_ade, ok_aie, ok_volcan, ivap, iliq, isol, ok_sync,&
-                              ptconv, read_climoz, clevSTD,                   &
-                              ptconvth, d_u, d_t, qx, d_qx, zmasse,           &
-                              flag_aerosol, flag_aerosol_strat, ok_cdnc)
-#endif
-
-
-#ifdef CPP_XIOS
-       IF (is_omp_master) CALL xios_update_calendar(1)
-#endif
-       IF(read_climoz>=1 .AND. create_etat0_limit) CALL regr_horiz_time_climoz(read_climoz,ok_daily_climoz)
-       CALL create_etat0_limit_unstruct
-       CALL phyetat0 ("startphy.nc",clesphy0,tabcntr0)
-
-!jyg<
-       IF (iflag_pbl<=1) THEN
-          ! No TKE for Standard Physics
-          pbl_tke(:,:,:)=0.
-
-       ELSE IF (klon_glo==1) THEN
-          pbl_tke(:,:,is_ave) = 0.
-          DO nsrf=1,nbsrf
-            DO k = 1,klev+1
-                 pbl_tke(:,k,is_ave) = pbl_tke(:,k,is_ave) &
-                     +pctsrf(:,nsrf)*pbl_tke(:,k,nsrf)
-            ENDDO
-          ENDDO
-       ELSE
-          pbl_tke(:,:,is_ave) = 0. !ym missing init : maybe must be initialized in the same way that for klon_glo==1 ??
-!>jyg
-       ENDIF
-       !IM begin
-       print*,'physiq: clwcon rnebcon ratqs',clwcon(1,1),rnebcon(1,1) &
-            ,ratqs(1,1)
-       !IM end
-
-
-       ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       !
-       ! on remet le calendrier a zero
-       !
-       IF (raz_date .eq. 1) THEN
-          itau_phy = 0
-       ENDIF
-
-!       IF (ABS(phys_tstep-pdtphys).GT.0.001) THEN
-!          WRITE(lunout,*) 'Pas physique n est pas correct',phys_tstep, &
-!               pdtphys
-!          abort_message='Pas physique n est pas correct '
-!          !           call abort_physic(modname,abort_message,1)
-!          phys_tstep=pdtphys
-!       ENDIF
-       IF (nlon .NE. klon) THEN
-          WRITE(lunout,*)'nlon et klon ne sont pas coherents', nlon,  &
-               klon
-          abort_message='nlon et klon ne sont pas coherents'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-       IF (nlev .NE. klev) THEN
-          WRITE(lunout,*)'nlev et klev ne sont pas coherents', nlev, &
-               klev
-          abort_message='nlev et klev ne sont pas coherents'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-       !
-       IF (phys_tstep*REAL(radpas).GT.21600..AND.iflag_cycle_diurne.GE.1) THEN 
-          WRITE(lunout,*)'Nbre d appels au rayonnement insuffisant'
-          WRITE(lunout,*)"Au minimum 4 appels par jour si cycle diurne"
-          abort_message='Nbre d appels au rayonnement insuffisant'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       ! Initialisation pour la convection de K.E. et pour les poches froides
-       !
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-       WRITE(lunout,*)"Clef pour la convection, iflag_con=", iflag_con
-       WRITE(lunout,*)"Clef pour le driver de la convection, ok_cvl=", ok_cvl
-       !
-       !KE43
-       ! Initialisation pour la convection de K.E. (sb):
-       IF (iflag_con.GE.3) THEN
-
-          WRITE(lunout,*)"*** Convection de Kerry Emanuel 4.3  "
-          WRITE(lunout,*) &
-               "On va utiliser le melange convectif des traceurs qui"
-          WRITE(lunout,*)"est calcule dans convect4.3"
-          WRITE(lunout,*)" !!! penser aux logical flags de phytrac"
-
-          DO i = 1, klon
-             ema_cbmf(i) = 0.
-             ema_pcb(i)  = 0.
-             ema_pct(i)  = 0.
-             !          ema_workcbmf(i) = 0.
-          ENDDO
-          !IM15/11/02 rajout initialisation ibas_con,itop_con cf. SB =>BEG
-          DO i = 1, klon
-             ibas_con(i) = 1
-             itop_con(i) = 1
-          ENDDO
-          !IM15/11/02 rajout initialisation ibas_con,itop_con cf. SB =>END
-          !================================================================
-          !CR:04.12.07: initialisations poches froides
-          ! Controle de ALE et ALP pour la fermeture convective (jyg)
-          IF (iflag_wake>=1) THEN
-             CALL ini_wake(0.,0.,it_wape_prescr,wape_prescr,fip_prescr &
-                  ,alp_bl_prescr, ale_bl_prescr)
-             ! 11/09/06 rajout initialisation ALE et ALP du wake et PBL(YU)
-             !        print*,'apres ini_wake iflag_cld_th=', iflag_cld_th
-             !
-             ! Initialize tendencies of wake state variables (for some flag values
-             ! they are not computed).
-             d_deltat_wk(:,:) = 0.
-             d_deltaq_wk(:,:) = 0.
-             d_deltat_wk_gw(:,:) = 0.
-             d_deltaq_wk_gw(:,:) = 0.
-             d_deltat_vdf(:,:) = 0.
-             d_deltaq_vdf(:,:) = 0.
-             d_deltat_the(:,:) = 0.
-             d_deltaq_the(:,:) = 0.
-             d_deltat_ajs_cv(:,:) = 0.
-             d_deltaq_ajs_cv(:,:) = 0.
-             d_s_wk(:) = 0.
-             d_dens_wk(:) = 0.
-          ENDIF  !  (iflag_wake>=1)
-
-          !        do i = 1,klon
-          !           Ale_bl(i)=0.
-          !           Alp_bl(i)=0.
-          !        enddo
-
-       !ELSE
-       !   ALLOCATE(tabijGCM(0))
-       !   ALLOCATE(lonGCM(0), latGCM(0))
-       !   ALLOCATE(iGCM(0), jGCM(0))
-       ENDIF  !  (iflag_con.GE.3)
-       !
-       DO i=1,klon
-          rugoro(i) = f_rugoro * MAX(1.0e-05, zstd(i)*zsig(i)/2.0)
-       ENDDO
-
-       !34EK
-       IF (ok_orodr) THEN
-
-          ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-          ! FH sans doute a enlever de finitivement ou, si on le
-          ! garde, l'activer justement quand ok_orodr = false.
-          ! ce rugoro est utilise par la couche limite et fait double emploi
-          ! avec les param\'etrisations sp\'ecifiques de Francois Lott.
-          !           DO i=1,klon
-          !             rugoro(i) = MAX(1.0e-05, zstd(i)*zsig(i)/2.0)
-          !           ENDDO
-          ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-          IF (ok_strato) THEN
-             CALL SUGWD_strato(klon,klev,paprs,pplay)
-          ELSE
-             CALL SUGWD(klon,klev,paprs,pplay)
-          ENDIF
-
-          DO i=1,klon
-             zuthe(i)=0.
-             zvthe(i)=0.
-             IF (zstd(i).gt.10.) THEN
-                zuthe(i)=(1.-zgam(i))*cos(zthe(i))
-                zvthe(i)=(1.-zgam(i))*sin(zthe(i))
-             ENDIF
-          ENDDO
-       ENDIF
-       !
-       !
-       lmt_pas = NINT(86400./phys_tstep * 1.0)   ! tous les jours
-       WRITE(lunout,*)'La frequence de lecture surface est de ',  &
-            lmt_pas
-       !
-       capemaxcels = 't_max(X)'
-       t2mincels = 't_min(X)'
-       t2maxcels = 't_max(X)'
-       tinst = 'inst(X)'
-       tave = 'ave(X)'
-       !IM cf. AM 081204 BEG
-       write(lunout,*)'AVANT HIST IFLAG_CON=',iflag_con
-       !IM cf. AM 081204 END
-       !
-       !=============================================================
-       !   Initialisation des sorties
-       !=============================================================
-
-#ifdef CPP_XIOS
-       ! Get "missing_val" value from XML files (from temperature variable)
-       !$OMP MASTER
-       CALL xios_get_field_attr("temp",default_value=missing_val_omp)
-       !$OMP END MASTER
-       !$OMP BARRIER
-       missing_val=missing_val_omp
-#endif
-
-#ifdef CPP_XIOS 
-! Need to put this initialisation after phyetat0 as in the coupled model the XIOS context is only
-! initialised at that moment
-       ! Get "missing_val" value from XML files (from temperature variable)
-       !$OMP MASTER
-       CALL xios_get_field_attr("temp",default_value=missing_val_omp)
-       !$OMP END MASTER
-       !$OMP BARRIER
-       missing_val=missing_val_omp
-       ! 
-       ! Now we activate some double radiation call flags only if some
-       ! diagnostics are requested, otherwise there is no point in doing this
-       IF (is_master) THEN
-         !--setting up swaero_diag to TRUE in XIOS case 
-         IF (xios_field_is_active("topswad").OR.xios_field_is_active("topswad0").OR. & 
-            xios_field_is_active("solswad").OR.xios_field_is_active("solswad0").OR. & 
-            xios_field_is_active("topswai").OR.xios_field_is_active("solswai").OR.  & 
-              (iflag_rrtm==1.AND.(xios_field_is_active("toplwad").OR.xios_field_is_active("toplwad0").OR. & 
-                                  xios_field_is_active("sollwad").OR.xios_field_is_active("sollwad0"))))  & 
-            !!!--for now these fields are not in the XML files so they are omitted 
-            !!!  xios_field_is_active("toplwai").OR.xios_field_is_active("sollwai") !))) & 
-            swaero_diag=.TRUE. 
- 
-         !--setting up swaerofree_diag to TRUE in XIOS case 
-         IF (xios_field_is_active("SWdnSFCcleanclr").OR.xios_field_is_active("SWupSFCcleanclr").OR. &
-            xios_field_is_active("SWupTOAcleanclr").OR.xios_field_is_active("rsucsaf").OR.   &
-            xios_field_is_active("rsdcsaf") .OR. xios_field_is_active("LWdnSFCcleanclr").OR. &
-            xios_field_is_active("LWupTOAcleanclr")) &
-            swaerofree_diag=.TRUE. 
- 
-         !--setting up dryaod_diag to TRUE in XIOS case 
-         DO naero = 1, naero_tot-1
-          IF (xios_field_is_active("dryod550_"//name_aero_tau(naero))) dryaod_diag=.TRUE. 
-         ENDDO
-         !
-         !--setting up ok_4xCO2atm to TRUE in XIOS case 
-         IF (xios_field_is_active("rsut4co2").OR.xios_field_is_active("rlut4co2").OR. & 
-            xios_field_is_active("rsutcs4co2").OR.xios_field_is_active("rlutcs4co2").OR. &
-            xios_field_is_active("rsu4co2").OR.xios_field_is_active("rsucs4co2").OR. &
-            xios_field_is_active("rsd4co2").OR.xios_field_is_active("rsdcs4co2").OR. &
-            xios_field_is_active("rlu4co2").OR.xios_field_is_active("rlucs4co2").OR. &
-            xios_field_is_active("rld4co2").OR.xios_field_is_active("rldcs4co2")) &
-            ok_4xCO2atm=.TRUE. 
-       ENDIF
-       !$OMP BARRIER
-       CALL bcast(swaero_diag)
-       CALL bcast(swaerofree_diag)
-       CALL bcast(dryaod_diag)
-       CALL bcast(ok_4xCO2atm)
-#endif 
-       !
-       CALL printflag( tabcntr0,radpas,ok_journe, &
-            ok_instan, ok_region )
-       !
-       !
-       ! Prescrire l'ozone dans l'atmosphere
-       !
-       !c         DO i = 1, klon
-       !c         DO k = 1, klev
-       !c            CALL o3cm (paprs(i,k)/100.,paprs(i,k+1)/100., wo(i,k),20)
-       !c         ENDDO
-       !c         ENDDO
-       !
-       IF (ANY(type_trac == ['inca','inco'])) THEN ! ModThL
-#ifdef INCA
-          CALL VTe(VTphysiq)
-          CALL VTb(VTinca)
-          calday = REAL(days_elapsed) + jH_cur
-          WRITE(lunout,*) 'initial time chemini', days_elapsed, calday
-
-          call init_const_lmdz( &
-          ndays, nbsrf, is_oce,is_sic, is_ter,is_lic, calend, &
-          config_inca)
-
-          CALL init_inca_geometry( & 
-               longitude, latitude, &
-               boundslon, boundslat, &
-               cell_area, ind_cell_glo) 
-
-          if (grid_type==unstructured) THEN 
-             CALL chemini(  pplay, &
-                  nbp_lon, nbp_lat, &
-                  latitude_deg, &
-                  longitude_deg, &
-                  presnivs, &
-                  calday, &
-                  klon, &
-                  nqtot, &
-                  nqo+nqCO2, &
-                  pdtphys, &
-                  annee_ref, &
-                  year_cur, &
-                  day_ref,  &
-                  day_ini, &
-                  start_time, &
-                  itau_phy, &
-                  date0, &
-                  chemistry_couple, &
-                  init_source, &
-                  init_tauinca, &
-                  init_pizinca, &
-                  init_cginca, &
-                  init_ccminca)
-          ELSE
-             CALL chemini(  pplay, &
-                  nbp_lon, nbp_lat, &
-                  latitude_deg, &
-                  longitude_deg, &
-                  presnivs, &
-                  calday, &
-                  klon, &
-                  nqtot, &
-                  nqo+nqCO2, &
-                  pdtphys, &
-                  annee_ref, &
-                  year_cur, &
-                  day_ref,  &
-                  day_ini, &
-                  start_time, &
-                  itau_phy, &
-                  date0, &
-                  chemistry_couple, &
-                  init_source, &
-                  init_tauinca, &
-                  init_pizinca, &
-                  init_cginca, &
-                  init_ccminca, &
-                  io_lon, &
-                  io_lat)
-          ENDIF
-
-
-          ! initialisation des variables depuis le restart de inca
-          ccm(:,:,:) = init_ccminca
-          tau_aero(:,:,:,:) = init_tauinca
-          piz_aero(:,:,:,:) = init_pizinca
-          cg_aero(:,:,:,:) = init_cginca
-!          
-
-
-          CALL VTe(VTinca)
-          CALL VTb(VTphysiq)
-#endif
-       ENDIF
-       !
-       IF (type_trac == 'repr') THEN
-#ifdef REPROBUS
-          CALL chemini_rep(  &
-               presnivs, &
-               pdtphys, &
-               annee_ref, &
-               day_ref,  &
-               day_ini, &
-               start_time, &
-               itau_phy, &
-               io_lon, &
-               io_lat)
-#endif
-       ENDIF
-
-       !$omp single
-       IF (read_climoz >= 1) CALL open_climoz(ncid_climoz, press_cen_climoz,   &
-           press_edg_climoz, time_climoz, ok_daily_climoz, adjust_tropopause)
-       !$omp end single
-       !
-       !IM betaCRF
-       pfree=70000. !Pa
-       beta_pbl=1.
-       beta_free=1.
-       lon1_beta=-180.
-       lon2_beta=+180.
-       lat1_beta=90.
-       lat2_beta=-90.
-       mskocean_beta=.FALSE.
-
-       !albedo SB >>>
-       SELECT CASE(nsw)
-       CASE(2)
-          SFRWL(1)=0.45538747
-          SFRWL(2)=0.54461211
-       CASE(4)
-          SFRWL(1)=0.45538747
-          SFRWL(2)=0.32870591
-          SFRWL(3)=0.18568763
-          SFRWL(4)=3.02191470E-02
-       CASE(6)
-          SFRWL(1)=1.28432794E-03
-          SFRWL(2)=0.12304168
-          SFRWL(3)=0.33106142
-          SFRWL(4)=0.32870591
-          SFRWL(5)=0.18568763
-          SFRWL(6)=3.02191470E-02
-       END SELECT
-       !albedo SB <<<
-
-       OPEN(99,file='beta_crf.data',status='old', &
-            form='formatted',err=9999)
-       READ(99,*,end=9998) pfree
-       READ(99,*,end=9998) beta_pbl
-       READ(99,*,end=9998) beta_free
-       READ(99,*,end=9998) lon1_beta
-       READ(99,*,end=9998) lon2_beta
-       READ(99,*,end=9998) lat1_beta
-       READ(99,*,end=9998) lat2_beta
-       READ(99,*,end=9998) mskocean_beta
-9998   Continue
-       CLOSE(99)
-9999   Continue
-       WRITE(*,*)'pfree=',pfree
-       WRITE(*,*)'beta_pbl=',beta_pbl
-       WRITE(*,*)'beta_free=',beta_free
-       WRITE(*,*)'lon1_beta=',lon1_beta
-       WRITE(*,*)'lon2_beta=',lon2_beta
-       WRITE(*,*)'lat1_beta=',lat1_beta
-       WRITE(*,*)'lat2_beta=',lat2_beta
-       WRITE(*,*)'mskocean_beta=',mskocean_beta
-
-      !lwoff=y : offset LW CRE for radiation code and other schemes
-      !lwoff=y : betalwoff=1.
-      betalwoff=0.
-      IF (ok_lwoff) THEN
-         betalwoff=1.
-      ENDIF
-      WRITE(*,*)'ok_lwoff=',ok_lwoff
-      ! 
-      !lwoff=y to begin only sollw and sollwdown are set up to CS values
-      sollw = sollw + betalwoff * (sollw0 - sollw)
-      sollwdown(:)= sollwdown(:) + betalwoff *(-1.*ZFLDN0(:,1) - &
-                    sollwdown(:))
-
-
-
-    ENDIF
-    !
-    !   ****************     Fin  de   IF ( debut  )   ***************
-    !
-    !
-    ! Incrementer le compteur de la physique
-    !
-    itap   = itap + 1
-    IF (is_master .OR. prt_level > 9) THEN
-      IF (prt_level > 5 .or. MOD(itap,5) == 0) THEN
-         WRITE(LUNOUT,*)'Entering physics elapsed seconds since start ', current_time
-         WRITE(LUNOUT,100)year_cur,mth_cur,day_cur,hour/3600.
- 100     FORMAT('Date = ',i4.4,' / ',i2.2, ' / ',i2.2,' : ',f20.17)
-      ENDIF
-    ENDIF
-    !
-    !
-    ! Update fraction of the sub-surfaces (pctsrf) and 
-    ! initialize, where a new fraction has appeared, all variables depending 
-    ! on the surface fraction.
-    !
-    CALL change_srf_frac(itap, phys_tstep, days_elapsed+1,  &
-         pctsrf, fevap, z0m, z0h, agesno,              &
-         falb_dir, falb_dif, ftsol, ustar, u10m, v10m, pbl_tke)
-
-    ! Update time and other variables in Reprobus
-    IF (type_trac == 'repr') THEN
-#ifdef REPROBUS
-       CALL Init_chem_rep_xjour(jD_cur-jD_ref+day_ref)
-       print*,'xjour equivalent rjourvrai',jD_cur-jD_ref+day_ref
-       CALL Rtime(debut)
-#endif
-    ENDIF
-
-    ! Tendances bidons pour les processus qui n'affectent pas certaines
-    ! variables.
-    du0(:,:)=0.
-    dv0(:,:)=0.
-    dt0 = 0.
-    dq0(:,:)=0.
-    dql0(:,:)=0.
-    dqi0(:,:)=0.
-    dsig0(:) = 0.
-    ddens0(:) = 0.
-    wkoccur1(:)=1
-    !
-    ! Mettre a zero des variables de sortie (pour securite)
-    !
-    DO i = 1, klon
-       d_ps(i) = 0.0
-    ENDDO
-    DO k = 1, klev
-       DO i = 1, klon
-          d_t(i,k) = 0.0
-          d_u(i,k) = 0.0
-          d_v(i,k) = 0.0
-       ENDDO
-    ENDDO
-    DO iq = 1, nqtot
-       DO k = 1, klev
-          DO i = 1, klon
-             d_qx(i,k,iq) = 0.0
-          ENDDO
-       ENDDO
-    ENDDO
-    beta_prec_fisrt(:,:)=0.
-    beta_prec(:,:)=0.
-    !
-    !   Output variables from the convective scheme should not be set to 0 
-    !   since convection is not always called at every time step.
-    IF (ok_bug_cv_trac) THEN
-      da(:,:)=0.
-      mp(:,:)=0.
-      phi(:,:,:)=0.
-      ! RomP >>>
-      phi2(:,:,:)=0.
-      epmlmMm(:,:,:)=0.
-      eplaMm(:,:)=0.
-      d1a(:,:)=0.
-      dam(:,:)=0.
-      pmflxr(:,:)=0.
-      pmflxs(:,:)=0.
-      ! RomP <<<
-    ENDIF
-    !
-    ! Ne pas affecter les valeurs entrees de u, v, h, et q
-    !
-    DO k = 1, klev
-       DO i = 1, klon
-          t_seri(i,k)  = t(i,k)
-          u_seri(i,k)  = u(i,k)
-          v_seri(i,k)  = v(i,k)
-          q_seri(i,k)  = qx(i,k,ivap)
-          ql_seri(i,k) = qx(i,k,iliq)
-          !CR: ATTENTION, on rajoute la variable glace
-          IF (nqo.EQ.2) THEN             !--vapour and liquid only
-             qs_seri(i,k) = 0.
-             rneb_seri(i,k) = 0.
-          ELSE IF (nqo.EQ.3) THEN        !--vapour, liquid and ice
-             qs_seri(i,k) = qx(i,k,isol)
-             rneb_seri(i,k) = 0.
-          ELSE IF (nqo.EQ.4) THEN        !--vapour, liquid, ice and rneb
-             qs_seri(i,k) = qx(i,k,isol)
-             rneb_seri(i,k) = qx(i,k,irneb)
-          ENDIF
-       ENDDO
-    ENDDO
-    !
-    !--OB mass fixer 
-    IF (mass_fixer) THEN
-    !--store initial water burden
-    qql1(:)=0.0
-    DO k = 1, klev
-      qql1(:)=qql1(:)+(q_seri(:,k)+ql_seri(:,k)+qs_seri(:,k))*zmasse(:,k)
-    ENDDO
-    ENDIF
-    !--fin mass fixer
-
-    tke0(:,:)=pbl_tke(:,:,is_ave)
-    IF (nqtot > nqo) THEN
-       ! water isotopes are not included in tr_seri
-       itr = 0
-       DO iq = 1, nqtot
-         IF(.NOT.tracers(iq)%isInPhysics) CYCLE
-         itr = itr+1
-          DO  k = 1, klev
-             DO  i = 1, klon
-                tr_seri(i,k,itr) = qx(i,k,iq)
-             ENDDO
-          ENDDO
-       ENDDO
-    ELSE
-! DC: make sure the final "1" index was meant for 1st H2O phase (vapor) !!!
-       tr_seri(:,:,strIdx(tracers(:)%name,addPhase('H2O','g'))) = 0.0
-    ENDIF
-!
-! Temporary solutions adressing ticket #104 and the non initialisation of tr_ancien
-! LF
-    IF (debut) THEN
-      WRITE(lunout,*)' WARNING: tr_ancien initialised to tr_seri'
-       itr = 0
-       do iq = 1, nqtot
-         IF(.NOT.tracers(iq)%isInPhysics) CYCLE
-         itr = itr+1
-         tr_ancien(:,:,itr)=tr_seri(:,:,itr)       
-       enddo
-    ENDIF
-    !
-    DO i = 1, klon
-       ztsol(i) = 0.
-    ENDDO
-    DO nsrf = 1, nbsrf
-       DO i = 1, klon
-          ztsol(i) = ztsol(i) + ftsol(i,nsrf)*pctsrf(i,nsrf)
-       ENDDO
-    ENDDO
-    ! Initialize variables used for diagnostic purpose
-    IF (flag_inhib_tend .ne. 0) CALL init_cmp_seri
-
-    ! Diagnostiquer la tendance dynamique
-    !
-    IF (ancien_ok) THEN
-    !
-       d_u_dyn(:,:)  = (u_seri(:,:)-u_ancien(:,:))/phys_tstep
-       d_v_dyn(:,:)  = (v_seri(:,:)-v_ancien(:,:))/phys_tstep
-       d_t_dyn(:,:)  = (t_seri(:,:)-t_ancien(:,:))/phys_tstep
-       d_q_dyn(:,:)  = (q_seri(:,:)-q_ancien(:,:))/phys_tstep
-       d_ql_dyn(:,:) = (ql_seri(:,:)-ql_ancien(:,:))/phys_tstep
-       d_qs_dyn(:,:) = (qs_seri(:,:)-qs_ancien(:,:))/phys_tstep
-       CALL water_int(klon,klev,q_seri,zmasse,zx_tmp_fi2d)
-       d_q_dyn2d(:)=(zx_tmp_fi2d(:)-prw_ancien(:))/phys_tstep
-       CALL water_int(klon,klev,ql_seri,zmasse,zx_tmp_fi2d)
-       d_ql_dyn2d(:)=(zx_tmp_fi2d(:)-prlw_ancien(:))/phys_tstep
-       CALL water_int(klon,klev,qs_seri,zmasse,zx_tmp_fi2d)
-       d_qs_dyn2d(:)=(zx_tmp_fi2d(:)-prsw_ancien(:))/phys_tstep
-       ! !! RomP >>>   td dyn traceur
-       IF (nqtot > nqo) d_tr_dyn(:,:,:)=(tr_seri(:,:,:)-tr_ancien(:,:,:))/phys_tstep
-       ! !! RomP <<<
-       !!d_rneb_dyn(:,:)=(rneb_seri(:,:)-rneb_ancien(:,:))/phys_tstep
-       d_rneb_dyn(:,:)=0.0
-    ELSE
-       d_u_dyn(:,:)  = 0.0
-       d_v_dyn(:,:)  = 0.0
-       d_t_dyn(:,:)  = 0.0
-       d_q_dyn(:,:)  = 0.0
-       d_ql_dyn(:,:) = 0.0
-       d_qs_dyn(:,:) = 0.0
-       d_q_dyn2d(:)  = 0.0
-       d_ql_dyn2d(:) = 0.0
-       d_qs_dyn2d(:) = 0.0
-       ! !! RomP >>>   td dyn traceur
-       IF (nqtot > nqo) d_tr_dyn(:,:,:)= 0.0
-       ! !! RomP <<<
-       d_rneb_dyn(:,:)=0.0
-       ancien_ok = .TRUE.
-    ENDIF
-    !
-    ! Ajouter le geopotentiel du sol:
-    !
-    DO k = 1, klev
-       DO i = 1, klon
-          zphi(i,k) = pphi(i,k) + pphis(i)
-       ENDDO
-    ENDDO
-    !
-    ! Verifier les temperatures
-    !
-    !IM BEG
-    IF (check) THEN
-       amn=MIN(ftsol(1,is_ter),1000.)
-       amx=MAX(ftsol(1,is_ter),-1000.)
-       DO i=2, klon
-          amn=MIN(ftsol(i,is_ter),amn)
-          amx=MAX(ftsol(i,is_ter),amx)
-       ENDDO
-       !
-       PRINT*,' debut avant hgardfou min max ftsol',itap,amn,amx
-    ENDIF !(check) THEN
-    !IM END
-    !
-    CALL hgardfou(t_seri,ftsol,'debutphy',abortphy)
-    IF (abortphy==1) Print*,'ERROR ABORT hgardfou debutphy'
-
-    !
-    !IM BEG
-    IF (check) THEN
-       amn=MIN(ftsol(1,is_ter),1000.)
-       amx=MAX(ftsol(1,is_ter),-1000.)
-       DO i=2, klon
-          amn=MIN(ftsol(i,is_ter),amn)
-          amx=MAX(ftsol(i,is_ter),amx)
-       ENDDO
-       !
-       PRINT*,' debut apres hgardfou min max ftsol',itap,amn,amx
-    ENDIF !(check) THEN
-    !IM END
-    !
-    ! Mettre en action les conditions aux limites (albedo, sst, etc.).
-    ! Prescrire l'ozone et calculer l'albedo sur l'ocean.
-    !
-    ! Update ozone if day change
-    IF (MOD(itap-1,lmt_pas) == 0) THEN
-       IF (read_climoz <= 0) THEN
-          ! Once per day, update ozone from Royer:
-          IF (solarlong0<-999.) then
-             ! Generic case with evolvoing season
-             zzz=real(days_elapsed+1)
-          ELSE IF (abs(solarlong0-1000.)<1.e-4) then
-             ! Particular case with annual mean insolation
-             zzz=real(90) ! could be revisited
-             IF (read_climoz/=-1) THEN
-                abort_message ='read_climoz=-1 is recommended when ' &
-                     // 'solarlong0=1000.'
-                CALL abort_physic (modname,abort_message,1)
-             ENDIF
-          ELSE
-             ! Case where the season is imposed with solarlong0
-             zzz=real(90) ! could be revisited
-          ENDIF
-
-          wo(:,:,1)=ozonecm(latitude_deg, paprs,read_climoz,rjour=zzz)
-#ifdef REPROBUS
-          ptrop=dyn_tropopause(t_seri, ztsol, paprs, pplay, rot)/100.
-          DO i = 1, klon
-             Z1=t_seri(i,itroprep(i)+1)
-             Z2=t_seri(i,itroprep(i))
-             fac=(Z1-Z2)/alog(pplay(i,itroprep(i)+1)/pplay(i,itroprep(i)))
-             B=Z2-fac*alog(pplay(i,itroprep(i)))
-             ttrop(i)= fac*alog(ptrop(i))+B
-!        
-             Z1= 1.e-3 * ( pphi(i,itroprep(i)+1)+pphis(i) ) / gravit
-             Z2= 1.e-3 * ( pphi(i,itroprep(i))  +pphis(i) ) / gravit
-             fac=(Z1-Z2)/alog(pplay(i,itroprep(i)+1)/pplay(i,itroprep(i)))
-             B=Z2-fac*alog(pplay(i,itroprep(i)))
-             ztrop(i)=fac*alog(ptrop(i))+B
-          ENDDO
-#endif
-       ELSE
-          !--- ro3i = elapsed days number since current year 1st january, 0h
-          ro3i=days_elapsed+jh_cur-jh_1jan
-          !--- scaling for old style files (360 records)
-          IF(SIZE(time_climoz)==360.AND..NOT.ok_daily_climoz) ro3i=ro3i*360./year_len
-          IF(adjust_tropopause) THEN
-             CALL regr_pr_time_av(ncid_climoz, vars_climoz(1:read_climoz),   &
-                      ro3i, 'C', press_cen_climoz, pplay, wo, paprs(:,1),    &
-                      time_climoz ,  longitude_deg,   latitude_deg,          &
-                      dyn_tropopause(t_seri, ztsol, paprs, pplay, rot))
-          ELSE
-             CALL regr_pr_time_av(ncid_climoz,  vars_climoz(1:read_climoz),  &
-                      ro3i, 'C', press_cen_climoz, pplay, wo, paprs(:,1),    &
-                      time_climoz )
-          ENDIF
-          ! Convert from mole fraction of ozone to column density of ozone in a
-          ! cell, in kDU:
-          FORALL (l = 1: read_climoz) wo(:, :, l) = wo(:, :, l) * rmo3 / rmd &
-               * zmasse / dobson_u / 1e3
-          ! (By regridding ozone values for LMDZ only once a day, we
-          ! have already neglected the variation of pressure in one
-          ! day. So do not recompute "wo" at each time step even if
-          ! "zmasse" changes a little.)
-       ENDIF
-    ENDIF
-    !
-    ! Re-evaporer l'eau liquide nuageuse
-    !
-     CALL reevap (klon,klev,iflag_ice_thermo,t_seri,q_seri,ql_seri,qs_seri, &
-   &         d_t_eva,d_q_eva,d_ql_eva,d_qi_eva)
-
-     CALL add_phys_tend &
-            (du0,dv0,d_t_eva,d_q_eva,d_ql_eva,d_qi_eva,paprs,&
-               'eva',abortphy,flag_inhib_tend,itap,0)
-    CALL prt_enerbil('eva',itap)
-
-    !=========================================================================
-    ! Calculs de l'orbite.
-    ! Necessaires pour le rayonnement et la surface (calcul de l'albedo).
-    ! doit donc etre plac\'e avant radlwsw et pbl_surface
-
-    ! !!   jyg 17 Sep 2010 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    CALL ymds2ju(year_cur, mth_eq, day_eq,0., jD_eq)
-    day_since_equinox = (jD_cur + jH_cur) - jD_eq
-    !
-    !   choix entre calcul de la longitude solaire vraie ou valeur fixee a 
-    !   solarlong0
-    IF (solarlong0<-999.) THEN
-       IF (new_orbit) THEN
-          ! calcul selon la routine utilisee pour les planetes
-          CALL solarlong(day_since_equinox, zlongi, dist)
-       ELSE
-          ! calcul selon la routine utilisee pour l'AR4
-          CALL orbite(REAL(days_elapsed+1),zlongi,dist)
-       ENDIF
-    ELSE
-       zlongi=solarlong0  ! longitude solaire vraie
-       dist=1.            ! distance au soleil / moyenne 
-    ENDIF
-
-    IF (prt_level.ge.1) write(lunout,*)'Longitude solaire ',zlongi,solarlong0,dist
-
-
-    ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    ! Calcul de l'ensoleillement :
-    ! ============================
-    ! Pour une solarlong0=1000., on calcule un ensoleillement moyen sur
-    ! l'annee a partir d'une formule analytique.
-    ! Cet ensoleillement est sym\'etrique autour de l'\'equateur et
-    ! non nul aux poles.
-    IF (abs(solarlong0-1000.)<1.e-4) THEN
-       CALL zenang_an(iflag_cycle_diurne.GE.1,jH_cur, &
-            latitude_deg,longitude_deg,rmu0,fract)
-       swradcorr(:) = 1.0
-       JrNt(:) = 1.0
-       zrmu0(:) = rmu0(:)
-    ELSE
-       ! recode par Olivier Boucher en sept 2015
-       SELECT CASE (iflag_cycle_diurne)
-       CASE(0)  
-          !  Sans cycle diurne
-          CALL angle(zlongi, latitude_deg, fract, rmu0)
-          swradcorr = 1.0
-          JrNt = 1.0
-          zrmu0 = rmu0
-       CASE(1)  
-          !  Avec cycle diurne sans application des poids
-          !  bit comparable a l ancienne formulation cycle_diurne=true
-          !  on integre entre gmtime et gmtime+radpas
-          zdtime=phys_tstep*REAL(radpas) ! pas de temps du rayonnement (s)
-          CALL zenang(zlongi,jH_cur,0.0,zdtime, &
-               latitude_deg,longitude_deg,rmu0,fract)
-          zrmu0 = rmu0
-          swradcorr = 1.0
-          ! Calcul du flag jour-nuit
-          JrNt = 0.0
-          WHERE (fract.GT.0.0) JrNt = 1.0
-       CASE(2)  
-          !  Avec cycle diurne sans application des poids
-          !  On integre entre gmtime-pdtphys et gmtime+pdtphys*(radpas-1)
-          !  Comme cette routine est appele a tous les pas de temps de
-          !  la physique meme si le rayonnement n'est pas appele je
-          !  remonte en arriere les radpas-1 pas de temps
-          !  suivant. Petite ruse avec MOD pour prendre en compte le
-          !  premier pas de temps de la physique pendant lequel
-          !  itaprad=0
-          zdtime1=phys_tstep*REAL(-MOD(itaprad,radpas)-1)      
-          zdtime2=phys_tstep*REAL(radpas-MOD(itaprad,radpas)-1) 
-          CALL zenang(zlongi,jH_cur,zdtime1,zdtime2, &
-               latitude_deg,longitude_deg,rmu0,fract)
-          !
-          ! Calcul des poids
-          !
-          zdtime1=-phys_tstep !--on corrige le rayonnement pour representer le
-          zdtime2=0.0    !--pas de temps de la physique qui se termine
-          CALL zenang(zlongi,jH_cur,zdtime1,zdtime2, &
-               latitude_deg,longitude_deg,zrmu0,zfract)
-          swradcorr = 0.0
-          WHERE (rmu0.GE.1.e-10 .OR. fract.GE.1.e-10) &
-               swradcorr=zfract/fract*zrmu0/rmu0
-          ! Calcul du flag jour-nuit
-          JrNt = 0.0
-          WHERE (zfract.GT.0.0) JrNt = 1.0 
-       END SELECT
-    ENDIF
-    sza_o = ACOS (rmu0) *180./pi
-
-    IF (mydebug) THEN
-       CALL writefield_phy('u_seri',u_seri,nbp_lev)
-       CALL writefield_phy('v_seri',v_seri,nbp_lev)
-       CALL writefield_phy('t_seri',t_seri,nbp_lev)
-       CALL writefield_phy('q_seri',q_seri,nbp_lev)
-    ENDIF
-
-    !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-    ! Appel au pbl_surface : Planetary Boudary Layer et Surface
-    ! Cela implique tous les interactions des sous-surfaces et la
-    ! partie diffusion turbulent du couche limit.
-    ! 
-    ! Certains varibales de sorties de pbl_surface sont utiliser que pour 
-    ! ecriture des fihiers hist_XXXX.nc, ces sont :
-    !   qsol,      zq2m,      s_pblh,  s_lcl,
-    !   s_capCL,   s_oliqCL,  s_cteiCL,s_pblT,
-    !   s_therm,   s_trmb1,   s_trmb2, s_trmb3,
-    !   zu10m,     zv10m,   fder,
-    !   zxqsurf,   delta_qsurf,
-    !   rh2m,      zxfluxu, zxfluxv,
-    !   frugs,     agesno,    fsollw,  fsolsw,
-    !   d_ts,      fevap,     fluxlat, t2m,
-    !   wfbils,    wfbilo,    fluxt,   fluxu, fluxv,
-    !
-    ! Certains ne sont pas utiliser du tout : 
-    !   dsens, devap, zxsnow, zxfluxt, zxfluxq, q2m, fluxq
-    !
-
-    ! Calcul de l'humidite de saturation au niveau du sol
-
-
-
-    IF (iflag_pbl/=0) THEN
-
-       !jyg+nrlmd<
-!!jyg       IF (prt_level .ge. 2 .and. mod(iflag_pbl_split,2) .eq. 1) THEN
-       IF (prt_level .ge. 2 .and. mod(iflag_pbl_split,10) .ge. 1) THEN
-          print *,'debut du splitting de la PBL, wake_s = ', wake_s(:)
-          print *,'debut du splitting de la PBL, wake_deltat = ', wake_deltat(:,1)
-          print *,'debut du splitting de la PBL, wake_deltaq = ', wake_deltaq(:,1)
-       ENDIF
-       ! !!
-       !>jyg+nrlmd
-       !
-       !-------gustiness calculation-------!
-       !ym : Warning gustiness non inialized for iflag_gusts=2 & iflag_gusts=3
-       gustiness=0  !ym missing init
-       
-       IF (iflag_gusts==0) THEN
-          gustiness(1:klon)=0
-       ELSE IF (iflag_gusts==1) THEN
-          gustiness(1:klon)=f_gust_bl*ale_bl(1:klon)+f_gust_wk*ale_wake(1:klon)
-       ELSE IF (iflag_gusts==2) THEN
-          gustiness(1:klon)=f_gust_bl*ale_bl_stat(1:klon)+f_gust_wk*ale_wake(1:klon)
-          ! ELSE IF (iflag_gusts==2) THEN
-          !    do i = 1, klon
-          !       gustiness(i)=f_gust_bl*ale_bl(i)+sigma_wk(i)*f_gust_wk&
-          !           *ale_wake(i) !! need to make sigma_wk accessible here
-          !    enddo
-          ! ELSE IF (iflag_gusts==3) THEN
-          !    do i = 1, klon
-          !       gustiness(i)=f_gust_bl*alp_bl(i)+f_gust_wk*alp_wake(i)
-          !    enddo
-       ENDIF
-
-       CALL pbl_surface(  &
-            phys_tstep,     date0,     itap,    days_elapsed+1, &
-            debut,     lafin, &
-            longitude_deg, latitude_deg, rugoro,  zrmu0,      &
-            sollwdown,    cldt,      &
-            rain_fall, snow_fall, solsw,   solswfdiff, sollw,     &
-            gustiness,                                &
-            t_seri,    q_seri,    u_seri,  v_seri,    &
-                                !nrlmd+jyg<
-            wake_deltat, wake_deltaq, wake_cstar, wake_s, &
-                                !>nrlmd+jyg
-            pplay,     paprs,     pctsrf,             &
-            ftsol,SFRWL,falb_dir,falb_dif,ustar,u10m,v10m,wstar, &
-                                !albedo SB <<<
-            cdragh,    cdragm,  u1,    v1,            &
-            beta_aridity, &
-                                !albedo SB >>>
-                                ! albsol1,   albsol2,   sens,    evap,      &
-            albsol_dir,   albsol_dif,   sens,    evap,   &  
-                                !albedo SB <<<
-            albsol3_lic,runoff,   snowhgt,   qsnow, to_ice, sissnow, &
-            zxtsol,    zxfluxlat, zt2m,    qsat2m,  zn2mout, &
-            d_t_vdf,   d_q_vdf,   d_u_vdf, d_v_vdf, d_t_diss, &
-                                !nrlmd<
-                                !jyg<
-            d_t_vdf_w, d_q_vdf_w, &
-            d_t_vdf_x, d_q_vdf_x, &
-            sens_x, zxfluxlat_x, sens_w, zxfluxlat_w, &
-                                !>jyg
-            delta_tsurf,wake_dens, &
-            cdragh_x,cdragh_w,cdragm_x,cdragm_w, &
-            kh,kh_x,kh_w, &
-                                !>nrlmd
-            coefh(1:klon,1:klev,1:nbsrf+1), coefm(1:klon,1:klev,1:nbsrf+1), &
-            slab_wfbils,                 &
-            qsol,      zq2m,      s_pblh,  s_lcl, &
-                                !jyg<
-            s_pblh_x, s_lcl_x, s_pblh_w, s_lcl_w, &
-                                !>jyg
-            s_capCL,   s_oliqCL,  s_cteiCL,s_pblT, &
-            s_therm,   s_trmb1,   s_trmb2, s_trmb3, &
-            zustar, zu10m,     zv10m,   fder, &
-            zxqsurf, delta_qsurf,   rh2m,      zxfluxu, zxfluxv, &
-            z0m, z0h,     agesno,    fsollw,  fsolsw, &
-            d_ts,      fevap,     fluxlat, t2m, &
-            wfbils, wfbilo, wfevap, wfrain, wfsnow, & 
-            fluxt,   fluxu,  fluxv, &
-            dsens,     devap,     zxsnow, &
-            zxfluxt,   zxfluxq,   q2m,     fluxq, pbl_tke, &
-                                !nrlmd+jyg<
-            wake_delta_pbl_TKE, &
-                                !>nrlmd+jyg
-             treedrg )
-!FC
-       !
-       !  Add turbulent diffusion tendency to the wake difference variables
-!!jyg       IF (mod(iflag_pbl_split,2) .NE. 0) THEN
-       IF (mod(iflag_pbl_split,10) .NE. 0) THEN
-!jyg<
-          d_deltat_vdf(:,:) = d_t_vdf_w(:,:)-d_t_vdf_x(:,:)
-          d_deltaq_vdf(:,:) = d_q_vdf_w(:,:)-d_q_vdf_x(:,:)
-          CALL add_wake_tend &
-             (d_deltat_vdf, d_deltaq_vdf, dsig0, ddens0, ddens0, wkoccur1, 'vdf', abortphy) 
-       ELSE
-          d_deltat_vdf(:,:) = 0.
-          d_deltaq_vdf(:,:) = 0.
-!>jyg
-       ENDIF
-
-       !---------------------------------------------------------------------
-       ! ajout des tendances de la diffusion turbulente
-       IF (klon_glo==1) THEN
-          CALL add_pbl_tend &
-               (d_u_vdf,d_v_vdf,d_t_vdf+d_t_diss,d_q_vdf,dql0,dqi0,paprs,&
-               'vdf',abortphy,flag_inhib_tend,itap)
-       ELSE
-          CALL add_phys_tend &
-               (d_u_vdf,d_v_vdf,d_t_vdf+d_t_diss,d_q_vdf,dql0,dqi0,paprs,&
-               'vdf',abortphy,flag_inhib_tend,itap,0)
-       ENDIF
-       CALL prt_enerbil('vdf',itap)
-       !--------------------------------------------------------------------
-
-       IF (mydebug) THEN
-          CALL writefield_phy('u_seri',u_seri,nbp_lev)
-          CALL writefield_phy('v_seri',v_seri,nbp_lev)
-          CALL writefield_phy('t_seri',t_seri,nbp_lev)
-          CALL writefield_phy('q_seri',q_seri,nbp_lev)
-       ENDIF
-
-       !albedo SB >>>
-       albsol1=0.
-       albsol2=0.
-       falb1=0.
-       falb2=0.
-       SELECT CASE(nsw)
-       CASE(2)
-          albsol1=albsol_dir(:,1)
-          albsol2=albsol_dir(:,2)
-          falb1=falb_dir(:,1,:)
-          falb2=falb_dir(:,2,:)
-       CASE(4)
-          albsol1=albsol_dir(:,1)
-          albsol2=albsol_dir(:,2)*SFRWL(2)+albsol_dir(:,3)*SFRWL(3) &
-               +albsol_dir(:,4)*SFRWL(4)
-          albsol2=albsol2/(SFRWL(2)+SFRWL(3)+SFRWL(4))
-          falb1=falb_dir(:,1,:)
-          falb2=falb_dir(:,2,:)*SFRWL(2)+falb_dir(:,3,:)*SFRWL(3) &
-               +falb_dir(:,4,:)*SFRWL(4)
-          falb2=falb2/(SFRWL(2)+SFRWL(3)+SFRWL(4))
-       CASE(6)
-          albsol1=albsol_dir(:,1)*SFRWL(1)+albsol_dir(:,2)*SFRWL(2) &
-               +albsol_dir(:,3)*SFRWL(3)
-          albsol1=albsol1/(SFRWL(1)+SFRWL(2)+SFRWL(3))
-          albsol2=albsol_dir(:,4)*SFRWL(4)+albsol_dir(:,5)*SFRWL(5) &
-               +albsol_dir(:,6)*SFRWL(6)
-          albsol2=albsol2/(SFRWL(4)+SFRWL(5)+SFRWL(6))
-          falb1=falb_dir(:,1,:)*SFRWL(1)+falb_dir(:,2,:)*SFRWL(2) &
-               +falb_dir(:,3,:)*SFRWL(3)
-          falb1=falb1/(SFRWL(1)+SFRWL(2)+SFRWL(3))
-          falb2=falb_dir(:,4,:)*SFRWL(4)+falb_dir(:,5,:)*SFRWL(5) &
-               +falb_dir(:,6,:)*SFRWL(6)
-          falb2=falb2/(SFRWL(4)+SFRWL(5)+SFRWL(6))
-       END SELECt
-       !albedo SB <<<
-
-
-       CALL evappot(klon,nbsrf,ftsol,pplay(:,1),cdragh, &
-            t_seri(:,1),q_seri(:,1),u_seri(:,1),v_seri(:,1),evap_pot)
-
-    ENDIF
-    ! =================================================================== c
-    !   Calcul de Qsat
-
-    DO k = 1, klev
-       DO i = 1, klon
-          zx_t = t_seri(i,k)
-          IF (thermcep) THEN
-             zdelta = MAX(0.,SIGN(1.,rtt-zx_t))
-             zx_qs  = r2es * FOEEW(zx_t,zdelta)/pplay(i,k)
-             zx_qs  = MIN(0.5,zx_qs)
-             zcor   = 1./(1.-retv*zx_qs)
-             zx_qs  = zx_qs*zcor
-          ELSE
-             !!           IF (zx_t.LT.t_coup) THEN             !jyg
-             IF (zx_t.LT.rtt) THEN                  !jyg
-                zx_qs = qsats(zx_t)/pplay(i,k)
-             ELSE
-                zx_qs = qsatl(zx_t)/pplay(i,k)
-             ENDIF
-          ENDIF
-          zqsat(i,k)=zx_qs
-       ENDDO
-    ENDDO
-
-    IF (prt_level.ge.1) THEN
-       write(lunout,*) 'L   qsat (g/kg) avant clouds_gno'
-       write(lunout,'(i4,f15.4)') (k,1000.*zqsat(igout,k),k=1,klev)
-    ENDIF
-    !
-    ! Appeler la convection (au choix)
-    !
-    DO k = 1, klev
-       DO i = 1, klon
-          conv_q(i,k) = d_q_dyn(i,k)  &
-               + d_q_vdf(i,k)/phys_tstep
-          conv_t(i,k) = d_t_dyn(i,k)  &
-               + d_t_vdf(i,k)/phys_tstep
-       ENDDO
-    ENDDO
-    IF (check) THEN
-       za = qcheck(klon,klev,paprs,q_seri,ql_seri,cell_area)
-       WRITE(lunout,*) "avantcon=", za
-    ENDIF
-    zx_ajustq = .FALSE.
-    IF (iflag_con.EQ.2) zx_ajustq=.TRUE.
-    IF (zx_ajustq) THEN
-       DO i = 1, klon
-          z_avant(i) = 0.0
-       ENDDO
-       DO k = 1, klev
-          DO i = 1, klon
-             z_avant(i) = z_avant(i) + (q_seri(i,k)+ql_seri(i,k)) &
-                  *(paprs(i,k)-paprs(i,k+1))/RG
-          ENDDO
-       ENDDO
-    ENDIF
-
-    ! Calcule de vitesse verticale a partir de flux de masse verticale
-    DO k = 1, klev
-       DO i = 1, klon
-          omega(i,k) = RG*flxmass_w(i,k) / cell_area(i)
-       ENDDO
-    ENDDO
-
-    IF (prt_level.ge.1) write(lunout,*) 'omega(igout, :) = ', &
-         omega(igout, :)
-    !
-    ! Appel de la convection tous les "cvpas"
-    !
-!!jyg    IF (MOD(itapcv,cvpas).EQ.0) THEN
-!!    print *,' physiq : itapcv, cvpas, itap-1, cvpas_0 ', &
-!!                       itapcv, cvpas, itap-1, cvpas_0
-    IF (MOD(itapcv,cvpas).EQ.0 .OR. MOD(itap-1,cvpas_0).EQ.0) THEN
-
-    !
-    ! Mettre a zero des variables de sortie (pour securite)
-    !
-    pmflxr(:,:) = 0.
-    pmflxs(:,:) = 0.
-    wdtrainA(:,:) = 0.
-    wdtrainS(:,:) = 0.
-    wdtrainM(:,:) = 0.
-    upwd(:,:) = 0.
-    dnwd(:,:) = 0.
-    ep(:,:) = 0.
-    da(:,:)=0.
-    mp(:,:)=0.
-    wght_cvfd(:,:)=0.
-    phi(:,:,:)=0.
-    phi2(:,:,:)=0.
-    epmlmMm(:,:,:)=0.
-    eplaMm(:,:)=0.
-    d1a(:,:)=0.
-    dam(:,:)=0.
-    elij(:,:,:)=0.
-    ev(:,:)=0.
-    qtaa(:,:)=0.
-    clw(:,:)=0.
-    sij(:,:,:)=0.
-    !
-    IF (iflag_con.EQ.1) THEN
-       abort_message ='reactiver le call conlmd dans physiq.F'
-       CALL abort_physic (modname,abort_message,1)
-       !     CALL conlmd (phys_tstep, paprs, pplay, t_seri, q_seri, conv_q,
-       !    .             d_t_con, d_q_con,
-       !    .             rain_con, snow_con, ibas_con, itop_con)
-    ELSE IF (iflag_con.EQ.2) THEN
-       CALL conflx(phys_tstep, paprs, pplay, t_seri, q_seri, &
-            conv_t, conv_q, -evap, omega, &
-            d_t_con, d_q_con, rain_con, snow_con, &
-            pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, &
-            kcbot, kctop, kdtop, pmflxr, pmflxs)
-       d_u_con = 0.
-       d_v_con = 0.
-
-       WHERE (rain_con < 0.) rain_con = 0.
-       WHERE (snow_con < 0.) snow_con = 0.
-       DO i = 1, klon
-          ibas_con(i) = klev+1 - kcbot(i)
-          itop_con(i) = klev+1 - kctop(i)
-       ENDDO
-    ELSE IF (iflag_con.GE.3) THEN
-       ! nb of tracers for the KE convection:
-       ! MAF la partie traceurs est faite dans phytrac
-       ! on met ntra=1 pour limiter les appels mais on peut
-       ! supprimer les calculs / ftra.
-       ntra = 1
-
-       !=======================================================================
-       !ajout pour la parametrisation des poches froides: calcul de
-       !t_w et t_x: si pas de poches froides, t_w=t_x=t_seri
-       IF (iflag_wake>=1) THEN
-         DO k=1,klev
-            DO i=1,klon
-                t_w(i,k) = t_seri(i,k) + (1-wake_s(i))*wake_deltat(i,k)
-                q_w(i,k) = q_seri(i,k) + (1-wake_s(i))*wake_deltaq(i,k)
-                t_x(i,k) = t_seri(i,k) - wake_s(i)*wake_deltat(i,k)
-                q_x(i,k) = q_seri(i,k) - wake_s(i)*wake_deltaq(i,k)
-            ENDDO
-         ENDDO
-       ELSE
-                t_w(:,:) = t_seri(:,:)
-                q_w(:,:) = q_seri(:,:)
-                t_x(:,:) = t_seri(:,:)
-                q_x(:,:) = q_seri(:,:)
-       ENDIF
-       !
-       !jyg<
-       ! Perform dry adiabatic adjustment on wake profile
-       ! The corresponding tendencies are added to the convective tendencies
-       ! after the call to the convective scheme.
-       IF (iflag_wake>=1) then
-          IF (iflag_adjwk >= 1) THEN
-             limbas(:) = 1
-             CALL ajsec(paprs, pplay, t_w, q_w, limbas, &
-                  d_t_adjwk, d_q_adjwk)
-             !
-             DO k=1,klev
-                DO i=1,klon
-                   IF (wake_s(i) .GT. 1.e-3) THEN
-                      t_w(i,k) = t_w(i,k) + d_t_adjwk(i,k)
-                      q_w(i,k) = q_w(i,k) + d_q_adjwk(i,k)
-                      d_deltat_ajs_cv(i,k) = d_t_adjwk(i,k)
-                      d_deltaq_ajs_cv(i,k) = d_q_adjwk(i,k)
-                   ELSE
-                      d_deltat_ajs_cv(i,k) = 0.
-                      d_deltaq_ajs_cv(i,k) = 0.
-                   ENDIF
-                ENDDO
-             ENDDO
-             IF (iflag_adjwk == 2) THEN
-               CALL add_wake_tend &
-                 (d_deltat_ajs_cv, d_deltaq_ajs_cv, dsig0, ddens0, ddens0, wkoccur1, 'ajs_cv', abortphy) 
-             ENDIF  ! (iflag_adjwk == 2)
-          ENDIF  ! (iflag_adjwk >= 1)
-       ENDIF ! (iflag_wake>=1)
-       !>jyg
-       !
-        
-!!      print *,'physiq. q_w(1,k), q_x(1,k) ', &
-!!             (k, q_w(1,k), q_x(1,k),k=1,25)
-
-!jyg<
-       CALL alpale( debut, itap, phys_tstep, paprs, omega, t_seri,   &
-                    alp_offset, it_wape_prescr,  wape_prescr, fip_prescr, &
-                    ale_bl_prescr, alp_bl_prescr, &
-                    wake_pe, wake_fip,  &
-                    Ale_bl, Ale_bl_trig, Alp_bl, &
-                    Ale, Alp , Ale_wake, Alp_wake)
-!>jyg
-!
-       ! sb, oct02:
-       ! Schema de convection modularise et vectorise:
-       ! (driver commun aux versions 3 et 4)
-       !
-       IF (ok_cvl) THEN ! new driver for convectL
-          !
-          !jyg<
-          ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-          ! Calculate the upmost level of deep convection loops: k_upper_cv
-          !  (near 22 km)
-          k_upper_cv = klev
-          !izero = klon/2+1/klon
-          !DO k = klev,1,-1
-          !   IF (pphi(izero,k) > 22.e4) k_upper_cv = k
-          !ENDDO
-          ! FH : nouveau calcul base sur un profil global sans quoi
-          ! le modele etait sensible au decoupage de domaines
-          DO k = klev,1,-1
-             IF (-7*log(presnivs(k)/presnivs(1)) > 25.) k_upper_cv = k
-          ENDDO
-          IF (prt_level .ge. 5) THEN
-             Print *, 'upmost level of deep convection loops: k_upper_cv = ', &
-                  k_upper_cv
-          ENDIF
-          !
-          !>jyg
-          IF (type_trac == 'repr') THEN
-             nbtr_tmp=ntra
-          ELSE
-             nbtr_tmp=nbtr
-          ENDIF
-          !jyg   iflag_con est dans clesphys
-          !c          CALL concvl (iflag_con,iflag_clos,
-          CALL concvl (iflag_clos, &
-               phys_tstep, paprs, pplay, k_upper_cv, t_x,q_x, &
-               t_w,q_w,wake_s, &
-               u_seri,v_seri,tr_seri,nbtr_tmp, &
-               ALE,ALP, &
-               sig1,w01, &
-               d_t_con,d_q_con,d_u_con,d_v_con,d_tr, &
-               rain_con, snow_con, ibas_con, itop_con, sigd, &
-               ema_cbmf,plcl,plfc,wbeff,convoccur,upwd,dnwd,dnwd0, &
-               Ma,mipsh,Vprecip,cape,cin,tvp,Tconv,iflagctrl, &
-               pbase,bbase,dtvpdt1,dtvpdq1,dplcldt,dplcldr,qcondc,wd, &
-                                ! RomP >>>
-                                !!     .        pmflxr,pmflxs,da,phi,mp,
-                                !!     .        ftd,fqd,lalim_conv,wght_th)
-               pmflxr,pmflxs,da,phi,mp,phi2,d1a,dam,sij,qtaa,clw,elij, &
-               ftd,fqd,lalim_conv,wght_th, &
-               ev, ep,epmlmMm,eplaMm, &
-               wdtrainA, wdtrainS, wdtrainM,wght_cvfd,qtc_cv,sigt_cv, &
-               tau_cld_cv,coefw_cld_cv,epmax_diag)
-
-          ! RomP <<<
-
-          !IM begin
-          !       print*,'physiq: cin pbase dnwd0 ftd fqd ',cin(1),pbase(1),
-          !    .dnwd0(1,1),ftd(1,1),fqd(1,1)
-          !IM end
-          !IM cf. FH
-          clwcon0=qcondc
-          pmfu(:,:)=upwd(:,:)+dnwd(:,:)
-          !
-          !jyg<
-          ! If convective tendencies are too large, then call convection 
-          !  every time step
-          cvpas = cvpas_0
-          DO k=1,k_upper_cv
-             DO i=1,klon
-               IF (d_t_con(i,k) > 6.721 .AND. d_t_con(i,k) < 6.722 .AND.&
-                   d_q_con(i,k) > -.0002171 .AND. d_q_con(i,k) < -.0002170) THEN
-                     dtcon_multistep_max = 3.
-                     dqcon_multistep_max = 0.02
-               ENDIF
-             ENDDO
-          ENDDO
-!
-          DO k=1,k_upper_cv
-             DO i=1,klon
-!!               IF (abs(d_t_con(i,k)) > 0.24 .OR. &
-!!                   abs(d_q_con(i,k)) > 2.e-2) THEN
-               IF (abs(d_t_con(i,k)) > dtcon_multistep_max .OR. &
-                   abs(d_q_con(i,k)) > dqcon_multistep_max) THEN
-                 cvpas = 1
-!!                 print *,'physiq1, i,k,d_t_con(i,k),d_q_con(i,k) ', &
-!!                                   i,k,d_t_con(i,k),d_q_con(i,k)
-               ENDIF
-             ENDDO
-          ENDDO
-!!!   Ligne a ne surtout pas remettre sans avoir murement reflechi (jyg)
-!!!          call bcast(cvpas)
-!!!   ------------------------------------------------------------
-          !>jyg
-          !
-          DO i = 1, klon
-             IF (iflagctrl(i).le.1) itau_con(i)=itau_con(i)+cvpas
-          ENDDO
-          !
-          !jyg<
-          !    Add the tendency due to the dry adjustment of the wake profile
-          IF (iflag_wake>=1) THEN
-            IF (iflag_adjwk == 2) THEN
-              DO k=1,klev
-                 DO i=1,klon
-                    ftd(i,k) = ftd(i,k) + wake_s(i)*d_t_adjwk(i,k)/phys_tstep
-                    fqd(i,k) = fqd(i,k) + wake_s(i)*d_q_adjwk(i,k)/phys_tstep
-                    d_t_con(i,k) = d_t_con(i,k) + wake_s(i)*d_t_adjwk(i,k)
-                    d_q_con(i,k) = d_q_con(i,k) + wake_s(i)*d_q_adjwk(i,k)
-                 ENDDO
-              ENDDO
-            ENDIF  ! (iflag_adjwk = 2)
-          ENDIF   ! (iflag_wake>=1)
-          !>jyg
-          !
-       ELSE ! ok_cvl
-
-          ! MAF conema3 ne contient pas les traceurs
-          CALL conema3 (phys_tstep, &
-               paprs,pplay,t_seri,q_seri, &
-               u_seri,v_seri,tr_seri,ntra, &
-               sig1,w01, &
-               d_t_con,d_q_con,d_u_con,d_v_con,d_tr, &
-               rain_con, snow_con, ibas_con, itop_con, &
-               upwd,dnwd,dnwd0,bas,top, &
-               Ma,cape,tvp,rflag, &
-               pbase &
-               ,bbase,dtvpdt1,dtvpdq1,dplcldt,dplcldr &
-               ,clwcon0)
-
-       ENDIF ! ok_cvl
-
-       !
-       ! Correction precip
-       rain_con = rain_con * cvl_corr
-       snow_con = snow_con * cvl_corr
-       !
-
-       IF (.NOT. ok_gust) THEN
-          do i = 1, klon
-             wd(i)=0.0
-          enddo
-       ENDIF
-
-       ! =================================================================== c
-       ! Calcul des proprietes des nuages convectifs
-       !
-
-       !   calcul des proprietes des nuages convectifs
-       clwcon0(:,:)=fact_cldcon*clwcon0(:,:)
-       IF (iflag_cld_cv == 0) THEN
-          CALL clouds_gno &
-               (klon,klev,q_seri,zqsat,clwcon0,ptconv,ratqsc,rnebcon0)
-       ELSE
-          CALL clouds_bigauss &
-               (klon,klev,q_seri,zqsat,qtc_cv,sigt_cv,ptconv,ratqsc,rnebcon0)
-       ENDIF
-
-
-       ! =================================================================== c
-
-       DO i = 1, klon
-          itop_con(i) = min(max(itop_con(i),1),klev)
-          ibas_con(i) = min(max(ibas_con(i),1),itop_con(i))
-       ENDDO
-
-       DO i = 1, klon
-          ! C Risi modif: pour Ã©viter pb de dÃ©passement d'indice dans les cas
-          ! oÃ¹ i n'est pas un point convectif et donc ibas_con(i)=0
-          ! c'est un pb indÃ©pendant des isotopes
-          if (ibas_con(i) > 0) then
-             ema_pcb(i)  = paprs(i,ibas_con(i))
-          else
-             ema_pcb(i)  = 0.0
-          endif
-       ENDDO
-       DO i = 1, klon
-          ! L'idicage de itop_con peut cacher un pb potentiel
-          ! FH sous la dictee de JYG, CR
-          ema_pct(i)  = paprs(i,itop_con(i)+1)
-
-          IF (itop_con(i).gt.klev-3) THEN
-             IF (prt_level >= 9) THEN
-                write(lunout,*)'La convection monte trop haut '
-                write(lunout,*)'itop_con(,',i,',)=',itop_con(i)
-             ENDIF
-          ENDIF
-       ENDDO
-    ELSE IF (iflag_con.eq.0) THEN
-       write(lunout,*) 'On n appelle pas la convection'
-       clwcon0=0.
-       rnebcon0=0.
-       d_t_con=0.
-       d_q_con=0.
-       d_u_con=0.
-       d_v_con=0.
-       rain_con=0.
-       snow_con=0.
-       bas=1
-       top=1
-    ELSE
-       WRITE(lunout,*) "iflag_con non-prevu", iflag_con
-       CALL abort_physic("physiq", "", 1)
-    ENDIF
-
-    !     CALL homogene(paprs, q_seri, d_q_con, u_seri,v_seri,
-    !    .              d_u_con, d_v_con)
-
-!jyg    Reinitialize proba_notrig and itapcv when convection has been called
-    proba_notrig(:) = 1.
-    itapcv = 0
-    ENDIF !  (MOD(itapcv,cvpas).EQ.0 .OR. MOD(itapcv,cvpas_0).EQ.0)
-!
-    itapcv = itapcv+1
-    !
-    ! Compter les steps ou cvpas=1
-    IF (cvpas == 1) THEN
-      Ncvpaseq1 = Ncvpaseq1+1
-    ENDIF
-    IF (mod(itap,1000) == 0) THEN
-      print *,' physiq, nombre de steps ou cvpas = 1 : ', Ncvpaseq1
-    ENDIF
-
-!!!jyg  Appel diagnostique a add_phys_tend pour tester la conservation de 
-!!!     l'energie dans les courants satures.
-!!    d_t_con_sat(:,:) = d_t_con(:,:) - ftd(:,:)*dtime
-!!    d_q_con_sat(:,:) = d_q_con(:,:) - fqd(:,:)*dtime
-!!    dql_sat(:,:) = (wdtrainA(:,:)+wdtrainM(:,:))*dtime/zmasse(:,:)
-!!    CALL add_phys_tend(d_u_con, d_v_con, d_t_con_sat, d_q_con_sat, dql_sat,   &
-!!                     dqi0, paprs, 'convection_sat', abortphy, flag_inhib_tend,&  
-!!                     itap, 1)
-!!    call prt_enerbil('convection_sat',itap)
-!!
-!!
-    CALL add_phys_tend(d_u_con, d_v_con, d_t_con, d_q_con, dql0, dqi0, paprs, &
-         'convection',abortphy,flag_inhib_tend,itap,0)
-    CALL prt_enerbil('convection',itap)
-
-    !-------------------------------------------------------------------------
-
-    IF (mydebug) THEN
-       CALL writefield_phy('u_seri',u_seri,nbp_lev)
-       CALL writefield_phy('v_seri',v_seri,nbp_lev)
-       CALL writefield_phy('t_seri',t_seri,nbp_lev)
-       CALL writefield_phy('q_seri',q_seri,nbp_lev)
-    ENDIF
-
-    IF (check) THEN
-       za = qcheck(klon,klev,paprs,q_seri,ql_seri,cell_area)
-       WRITE(lunout,*)"aprescon=", za
-       zx_t = 0.0
-       za = 0.0
-       DO i = 1, klon
-          za = za + cell_area(i)/REAL(klon)
-          zx_t = zx_t + (rain_con(i)+ &
-               snow_con(i))*cell_area(i)/REAL(klon)
-       ENDDO
-       zx_t = zx_t/za*phys_tstep
-       WRITE(lunout,*)"Precip=", zx_t
-    ENDIF
-    IF (zx_ajustq) THEN
-       DO i = 1, klon
-          z_apres(i) = 0.0
-       ENDDO
-       DO k = 1, klev
-          DO i = 1, klon
-             z_apres(i) = z_apres(i) + (q_seri(i,k)+ql_seri(i,k)) &
-                  *(paprs(i,k)-paprs(i,k+1))/RG
-          ENDDO
-       ENDDO
-       DO i = 1, klon
-          z_factor(i) = (z_avant(i)-(rain_con(i)+snow_con(i))*phys_tstep) &
-               /z_apres(i)
-       ENDDO
-       DO k = 1, klev
-          DO i = 1, klon
-             IF (z_factor(i).GT.(1.0+1.0E-08) .OR. &
-                  z_factor(i).LT.(1.0-1.0E-08)) THEN
-                q_seri(i,k) = q_seri(i,k) * z_factor(i)
-             ENDIF
-          ENDDO
-       ENDDO
-    ENDIF
-    zx_ajustq=.FALSE.
-
-    !
-    !==========================================================================
-    !RR:Evolution de la poche froide: on ne fait pas de separation wake/env 
-    !pour la couche limite diffuse pour l instant
-    !
-    !
-    ! nrlmd le 22/03/2011---Si on met les poches hors des thermiques
-    ! il faut rajouter cette tendance calcul\'ee hors des poches
-    ! froides
-    !
-    IF (iflag_wake>=1) THEN
-       !
-       !
-       ! Call wakes every "wkpas" step
-       !
-       IF (MOD(itapwk,wkpas).EQ.0) THEN
-          !
-          DO k=1,klev
-             DO i=1,klon
-                dt_dwn(i,k)  = ftd(i,k) 
-                dq_dwn(i,k)  = fqd(i,k) 
-                M_dwn(i,k)   = dnwd0(i,k)
-                M_up(i,k)    = upwd(i,k)
-                dt_a(i,k)    = d_t_con(i,k)/phys_tstep - ftd(i,k) 
-                dq_a(i,k)    = d_q_con(i,k)/phys_tstep - fqd(i,k)
-             ENDDO
-          ENDDO
-         
-          IF (iflag_wake==2) THEN
-             ok_wk_lsp(:)=max(sign(1.,wake_s(:)-wake_s_min_lsp),0.)
-             DO k = 1,klev
-                dt_dwn(:,k)= dt_dwn(:,k)+ &
-                     ok_wk_lsp(:)*(d_t_eva(:,k)+d_t_lsc(:,k))/phys_tstep
-                dq_dwn(:,k)= dq_dwn(:,k)+ &
-                     ok_wk_lsp(:)*(d_q_eva(:,k)+d_q_lsc(:,k))/phys_tstep
-             ENDDO
-          ELSEIF (iflag_wake==3) THEN
-             ok_wk_lsp(:)=max(sign(1.,wake_s(:)-wake_s_min_lsp),0.)
-             DO k = 1,klev
-                DO i=1,klon
-                   IF (rneb(i,k)==0.) THEN
-                      ! On ne tient compte des tendances qu'en dehors des
-                      ! nuages (c'est-\`a-dire a priri dans une region ou
-                      ! l'eau se reevapore).
-                      dt_dwn(i,k)= dt_dwn(i,k)+ &
-                           ok_wk_lsp(i)*d_t_lsc(i,k)/phys_tstep
-                      dq_dwn(i,k)= dq_dwn(i,k)+ &
-                           ok_wk_lsp(i)*d_q_lsc(i,k)/phys_tstep
-                   ENDIF
-                ENDDO
-             ENDDO
-          ENDIF
-         
-          !
-          !calcul caracteristiques de la poche froide
-          CALL calWAKE (iflag_wake_tend, paprs, pplay, phys_tstep, &
-               t_seri, q_seri, omega,  &
-               dt_dwn, dq_dwn, M_dwn, M_up,  &
-               dt_a, dq_a, cv_gen,  &
-               sigd, cin,  &
-               wake_deltat, wake_deltaq, wake_s, awake_dens, wake_dens,  &
-               wake_dth, wake_h,  &
-!!               wake_pe, wake_fip, wake_gfl,  &
-               wake_pe, wake_fip_0, wake_gfl,  &   !! jyg
-               d_t_wake, d_q_wake,  &
-               wake_k, t_x, q_x,  &
-               wake_omgbdth, wake_dp_omgb,  &
-               wake_dtKE, wake_dqKE,  &
-               wake_omg, wake_dp_deltomg,  &
-               wake_spread, wake_Cstar, d_deltat_wk_gw,  &
-               d_deltat_wk, d_deltaq_wk, d_s_wk, d_dens_a_wk, d_dens_wk)
-          !
-          !jyg    Reinitialize itapwk when wakes have been called
-          itapwk = 0
-       ENDIF !  (MOD(itapwk,wkpas).EQ.0)
-       !
-       itapwk = itapwk+1
-       !
-       !-----------------------------------------------------------------------
-       ! ajout des tendances des poches froides
-       CALL add_phys_tend(du0,dv0,d_t_wake,d_q_wake,dql0,dqi0,paprs,'wake', &
-            abortphy,flag_inhib_tend,itap,0)
-       CALL prt_enerbil('wake',itap)
-       !------------------------------------------------------------------------
-
-       ! Increment Wake state variables
-       IF (iflag_wake_tend .GT. 0.) THEN
-
-         CALL add_wake_tend &
-            (d_deltat_wk, d_deltaq_wk, d_s_wk, d_dens_a_wk, d_dens_wk, wake_k, &
-             'wake', abortphy) 
-          CALL prt_enerbil('wake',itap)
-       ENDIF   ! (iflag_wake_tend .GT. 0.)
-       !
-       IF (prt_level .GE. 10) THEN
-         print *,' physiq, after calwake, wake_s: ',wake_s(:)
-         print *,' physiq, after calwake, wake_deltat: ',wake_deltat(:,1)
-         print *,' physiq, after calwake, wake_deltaq: ',wake_deltaq(:,1)
-       ENDIF
-
-       IF (iflag_alp_wk_cond .GT. 0.) THEN
-
-         CALL alpale_wk(phys_tstep, cell_area, wake_k, wake_s, wake_dens, wake_fip_0, &
-                        wake_fip)
-       ELSE
-         wake_fip(:) = wake_fip_0(:)
-       ENDIF   ! (iflag_alp_wk_cond .GT. 0.)
-
-    ENDIF  ! (iflag_wake>=1)
-    !
-    !===================================================================
-    ! Convection seche (thermiques ou ajustement)
-    !===================================================================
-    !
-    CALL stratocu_if(klon,klev,pctsrf,paprs, pplay,t_seri &
-         ,seuil_inversion,weak_inversion,dthmin)
-
-
-
-    d_t_ajsb(:,:)=0.
-    d_q_ajsb(:,:)=0.
-    d_t_ajs(:,:)=0.
-    d_u_ajs(:,:)=0.
-    d_v_ajs(:,:)=0.
-    d_q_ajs(:,:)=0.
-    clwcon0th(:,:)=0.
-    !
-    !      fm_therm(:,:)=0.
-    !      entr_therm(:,:)=0.
-    !      detr_therm(:,:)=0.
-    !
-    IF (prt_level>9) WRITE(lunout,*) &
-         'AVANT LA CONVECTION SECHE , iflag_thermals=' &
-         ,iflag_thermals,'   nsplit_thermals=',nsplit_thermals
-    IF (iflag_thermals<0) THEN
-       !  Rien
-       !  ====
-       IF (prt_level>9) WRITE(lunout,*)'pas de convection seche'
-
-
-    ELSE
-
-       !  Thermiques
-       !  ==========
-       IF (prt_level>9) WRITE(lunout,*)'JUSTE AVANT , iflag_thermals=' &
-            ,iflag_thermals,'   nsplit_thermals=',nsplit_thermals
-
-
-       !cc nrlmd le 10/04/2012
-       DO k=1,klev+1
-          DO i=1,klon
-             pbl_tke_input(i,k,is_oce)=pbl_tke(i,k,is_oce)
-             pbl_tke_input(i,k,is_ter)=pbl_tke(i,k,is_ter)
-             pbl_tke_input(i,k,is_lic)=pbl_tke(i,k,is_lic)
-             pbl_tke_input(i,k,is_sic)=pbl_tke(i,k,is_sic)
-          ENDDO
-       ENDDO
-       !cc fin nrlmd le 10/04/2012
-
-       IF (iflag_thermals>=1) THEN
-          !jyg<
-!!       IF (mod(iflag_pbl_split/2,2) .EQ. 1) THEN
-       IF (mod(iflag_pbl_split/10,10) .GE. 1) THEN
-             !  Appel des thermiques avec les profils exterieurs aux poches
-             DO k=1,klev
-                DO i=1,klon
-                   t_therm(i,k) = t_seri(i,k) - wake_s(i)*wake_deltat(i,k)
-                   q_therm(i,k) = q_seri(i,k) - wake_s(i)*wake_deltaq(i,k)
-                   u_therm(i,k) = u_seri(i,k)
-                   v_therm(i,k) = v_seri(i,k)
-                ENDDO
-             ENDDO
-          ELSE
-             !  Appel des thermiques avec les profils moyens
-             DO k=1,klev
-                DO i=1,klon
-                   t_therm(i,k) = t_seri(i,k)
-                   q_therm(i,k) = q_seri(i,k)
-                   u_therm(i,k) = u_seri(i,k)
-                   v_therm(i,k) = v_seri(i,k)
-                ENDDO
-             ENDDO
-          ENDIF
-          !>jyg
-          CALL calltherm(pdtphys &
-               ,pplay,paprs,pphi,weak_inversion &
-                        ! ,u_seri,v_seri,t_seri,q_seri,zqsat,debut & !jyg
-               ,u_therm,v_therm,t_therm,q_therm,zqsat,debut &  !jyg
-               ,d_u_ajs,d_v_ajs,d_t_ajs,d_q_ajs &
-               ,fm_therm,entr_therm,detr_therm &
-               ,zqasc,clwcon0th,lmax_th,ratqscth &
-               ,ratqsdiff,zqsatth &
-                                !on rajoute ale et alp, et les
-                                !caracteristiques de la couche alim
-               ,Ale_bl,Alp_bl,lalim_conv,wght_th, zmax0, f0, zw2,fraca &
-               ,ztv,zpspsk,ztla,zthl &
-                                !cc nrlmd le 10/04/2012
-               ,pbl_tke_input,pctsrf,omega,cell_area &
-               ,zlcl_th,fraca0,w0,w_conv,therm_tke_max0,env_tke_max0 &
-               ,n2,s2,ale_bl_stat &
-               ,therm_tke_max,env_tke_max &
-               ,alp_bl_det,alp_bl_fluct_m,alp_bl_fluct_tke &
-               ,alp_bl_conv,alp_bl_stat &
-                                !cc fin nrlmd le 10/04/2012
-               ,zqla,ztva )
-          !
-          !jyg<
-!!jyg          IF (mod(iflag_pbl_split/2,2) .EQ. 1) THEN
-          IF (mod(iflag_pbl_split/10,10) .GE. 1) THEN
-             !  Si les thermiques ne sont presents que hors des
-             !  poches, la tendance moyenne associ\'ee doit etre
-             !  multipliee par la fraction surfacique qu'ils couvrent.
-             DO k=1,klev
-                DO i=1,klon
-                   !
-                   d_deltat_the(i,k) = - d_t_ajs(i,k) 
-                   d_deltaq_the(i,k) = - d_q_ajs(i,k) 
-                   !
-                   d_u_ajs(i,k) = d_u_ajs(i,k)*(1.-wake_s(i)) 
-                   d_v_ajs(i,k) = d_v_ajs(i,k)*(1.-wake_s(i)) 
-                   d_t_ajs(i,k) = d_t_ajs(i,k)*(1.-wake_s(i)) 
-                   d_q_ajs(i,k) = d_q_ajs(i,k)*(1.-wake_s(i)) 
-                   !
-                ENDDO
-             ENDDO
-          !
-             IF (ok_bug_split_th) THEN
-               CALL add_wake_tend &
-                   (d_deltat_the, d_deltaq_the, dsig0, ddens0, ddens0, wkoccur1, 'the', abortphy) 
-             ELSE
-               CALL add_wake_tend &
-                   (d_deltat_the, d_deltaq_the, dsig0, ddens0, ddens0, wake_k, 'the', abortphy) 
-             ENDIF
-             CALL prt_enerbil('the',itap)
-          !
-          ENDIF  ! (mod(iflag_pbl_split/10,10) .GE. 1)
-          !
-          CALL add_phys_tend(d_u_ajs,d_v_ajs,d_t_ajs,d_q_ajs,  &
-                             dql0,dqi0,paprs,'thermals', abortphy,flag_inhib_tend,itap,0)
-          CALL prt_enerbil('thermals',itap)
-          !
-!
-          CALL alpale_th( phys_tstep, lmax_th, t_seri, cell_area,  &
-                          cin, s2, n2,  &
-                          ale_bl_trig, ale_bl_stat, ale_bl,  &
-                          alp_bl, alp_bl_stat, &
-                          proba_notrig, random_notrig, cv_gen)
-          !>jyg
-
-          ! ------------------------------------------------------------------
-          ! Transport de la TKE par les panaches thermiques.
-          ! FH : 2010/02/01
-          !     if (iflag_pbl.eq.10) then
-          !     call thermcell_dtke(klon,klev,nbsrf,pdtphys,fm_therm,entr_therm,
-          !    s           rg,paprs,pbl_tke)
-          !     endif
-          ! -------------------------------------------------------------------
-
-          DO i=1,klon
-             !           zmax_th(i)=pphi(i,lmax_th(i))/rg
-             !CR:04/05/12:correction calcul zmax
-             zmax_th(i)=zmax0(i) 
-          ENDDO
-
-       ENDIF
-
-       !  Ajustement sec
-       !  ==============
-
-       ! Dans le cas o\`u on active les thermiques, on fait partir l'ajustement
-       ! a partir du sommet des thermiques.
-       ! Dans le cas contraire, on demarre au niveau 1.
-
-       IF (iflag_thermals>=13.or.iflag_thermals<=0) THEN
-
-          IF (iflag_thermals.eq.0) THEN
-             IF (prt_level>9) WRITE(lunout,*)'ajsec'
-             limbas(:)=1
-          ELSE
-             limbas(:)=lmax_th(:)
-          ENDIF
-
-          ! Attention : le call ajsec_convV2 n'est maintenu que momentanneement
-          ! pour des test de convergence numerique.
-          ! Le nouveau ajsec est a priori mieux, meme pour le cas 
-          ! iflag_thermals = 0 (l'ancienne version peut faire des tendances
-          ! non nulles numeriquement pour des mailles non concernees.
-
-          IF (iflag_thermals==0) THEN
-             ! Calling adjustment alone (but not the thermal plume model)
-             CALL ajsec_convV2(paprs, pplay, t_seri,q_seri &
-                  , d_t_ajsb, d_q_ajsb)
-          ELSE IF (iflag_thermals>0) THEN
-             ! Calling adjustment above the top of thermal plumes
-             CALL ajsec(paprs, pplay, t_seri,q_seri,limbas &
-                  , d_t_ajsb, d_q_ajsb)
-          ENDIF
-
-          !--------------------------------------------------------------------
-          ! ajout des tendances de l'ajustement sec ou des thermiques
-          CALL add_phys_tend(du0,dv0,d_t_ajsb,d_q_ajsb,dql0,dqi0,paprs, &
-               'ajsb',abortphy,flag_inhib_tend,itap,0)
-          CALL prt_enerbil('ajsb',itap)
-          d_t_ajs(:,:)=d_t_ajs(:,:)+d_t_ajsb(:,:)
-          d_q_ajs(:,:)=d_q_ajs(:,:)+d_q_ajsb(:,:)
-
-          !---------------------------------------------------------------------
-
-       ENDIF
-
-    ENDIF
-    !
-    !===================================================================
-    ! Computation of ratqs, the width (normalized) of the subrid scale 
-    ! water distribution
-
-    tke_dissip_ave(:,:)=0.
-    l_mix_ave(:,:)=0.
-    wprime_ave(:,:)=0.
-
-    DO nsrf = 1, nbsrf
-       DO i = 1, klon
-          tke_dissip_ave(i,:) = tke_dissip_ave(i,:) + tke_dissip(i,:,nsrf)*pctsrf(i,nsrf)
-          l_mix_ave(i,:) = l_mix_ave(i,:) + l_mix(i,:,nsrf)*pctsrf(i,nsrf)
-          wprime_ave(i,:) = wprime_ave(i,:) + wprime(i,:,nsrf)*pctsrf(i,nsrf)
-       ENDDO
-    ENDDO
-
-    CALL  calcratqs(klon,klev,prt_level,lunout,        &
-         iflag_ratqs,iflag_con,iflag_cld_th,pdtphys,  &
-         ratqsbas,ratqshaut,ratqsp0, ratqsdp, &
-         tau_ratqs,fact_cldcon,wake_s, wake_deltaq,   &
-         ptconv,ptconvth,clwcon0th, rnebcon0th,     &
-         paprs,pplay,t_seri,q_seri, qtc_cv, sigt_cv, zqsat, &
-         pbl_tke(:,:,is_ave),tke_dissip_ave,l_mix_ave,wprime_ave,t2m,q2m,fm_therm, &
-         ratqs,ratqsc,ratqs_inter)
-
-    !
-    ! Appeler le processus de condensation a grande echelle
-    ! et le processus de precipitation
-    !-------------------------------------------------------------------------
-    IF (prt_level .GE.10) THEN
-       print *,'itap, ->fisrtilp ',itap
-    ENDIF
-    !
-
-    picefra(:,:)=0.
-
-    IF (ok_new_lscp) THEN
-
-    !--mise Ã  jour de flight_m et flight_h2o dans leur module
-    IF (ok_plane_h2o .OR. ok_plane_contrail) THEN
-      CALL airplane(debut,pphis,pplay,paprs,t_seri)
-    ENDIF
-
-    CALL lscp(klon,klev,phys_tstep,missing_val,paprs,pplay, &
-         t_seri, q_seri,ptconv,ratqs, &
-         d_t_lsc, d_q_lsc, d_ql_lsc, d_qi_lsc, rneb, rneblsvol, rneb_seri, & 
-         radocond, picefra, rain_lsc, snow_lsc, &
-         frac_impa, frac_nucl, beta_prec_fisrt, &
-         prfl, psfl, rhcl,  &
-         zqasc, fraca,ztv,zpspsk,ztla,zthl,iflag_cld_th, &
-         iflag_ice_thermo, ok_ice_sursat, zqsatl, zqsats, &
-         qclr, qcld, qss, qvc, rnebclr, rnebss, gamma_ss, &
-         Tcontr, qcontr, qcontr2, fcontrN, fcontrP )
-
-    ELSE
-
-    CALL fisrtilp(phys_tstep,paprs,pplay, &
-         t_seri, q_seri,ptconv,ratqs, &
-         d_t_lsc, d_q_lsc, d_ql_lsc, d_qi_lsc, rneb, radocond, &
-         rain_lsc, snow_lsc, &
-         pfrac_impa, pfrac_nucl, pfrac_1nucl, &
-         frac_impa, frac_nucl, beta_prec_fisrt, &
-         prfl, psfl, rhcl,  &
-         zqasc, fraca,ztv,zpspsk,ztla,zthl,iflag_cld_th, &
-         iflag_ice_thermo)
-
-    ENDIF
-    !
-    WHERE (rain_lsc < 0) rain_lsc = 0.
-    WHERE (snow_lsc < 0) snow_lsc = 0.
-
-!+JLD
-!    write(*,9000) 'phys lsc',"enerbil: bil_q, bil_e,",rain_lsc+snow_lsc &
-!        & ,((rcw-rcpd)*rain_lsc + (rcs-rcpd)*snow_lsc)*t_seri(1,1)-rlvtt*rain_lsc+rlstt*snow_lsc &
-!        & ,rain_lsc,snow_lsc
-!    write(*,9000) "rcpv","rcw",rcpv,rcw,rcs,t_seri(1,1)
-!-JLD 
-    CALL add_phys_tend(du0,dv0,d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc,paprs, &
-         'lsc',abortphy,flag_inhib_tend,itap,0)
-    CALL prt_enerbil('lsc',itap)
-    rain_num(:)=0.
-    DO k = 1, klev
-       DO i = 1, klon
-          IF (ql_seri(i,k)>oliqmax) THEN
-             rain_num(i)=rain_num(i)+(ql_seri(i,k)-oliqmax)*zmasse(i,k)/pdtphys
-             ql_seri(i,k)=oliqmax
-          ENDIF
-       ENDDO
-    ENDDO
-    IF (nqo >= 3) THEN
-    DO k = 1, klev
-       DO i = 1, klon
-          IF (qs_seri(i,k)>oicemax) THEN
-             rain_num(i)=rain_num(i)+(qs_seri(i,k)-oicemax)*zmasse(i,k)/pdtphys
-             qs_seri(i,k)=oicemax
-          ENDIF
-       ENDDO
-    ENDDO
-    ENDIF
-
-    !---------------------------------------------------------------------------
-    DO k = 1, klev
-       DO i = 1, klon
-          cldfra(i,k) = rneb(i,k)
-          !CR: a quoi ca sert? Faut-il ajouter qs_seri?
-          IF (.NOT.new_oliq) radocond(i,k) = ql_seri(i,k)
-       ENDDO
-    ENDDO
-    IF (check) THEN
-       za = qcheck(klon,klev,paprs,q_seri,ql_seri,cell_area)
-       WRITE(lunout,*)"apresilp=", za
-       zx_t = 0.0
-       za = 0.0
-       DO i = 1, klon
-          za = za + cell_area(i)/REAL(klon)
-          zx_t = zx_t + (rain_lsc(i) &
-               + snow_lsc(i))*cell_area(i)/REAL(klon)
-       ENDDO
-       zx_t = zx_t/za*phys_tstep
-       WRITE(lunout,*)"Precip=", zx_t
-    ENDIF
-
-    IF (mydebug) THEN
-       CALL writefield_phy('u_seri',u_seri,nbp_lev)
-       CALL writefield_phy('v_seri',v_seri,nbp_lev)
-       CALL writefield_phy('t_seri',t_seri,nbp_lev)
-       CALL writefield_phy('q_seri',q_seri,nbp_lev)
-    ENDIF
-
-    !
-    !-------------------------------------------------------------------
-    !  PRESCRIPTION DES NUAGES POUR LE RAYONNEMENT
-    !-------------------------------------------------------------------
-
-    ! 1. NUAGES CONVECTIFS
-    !
-    !IM cf FH
-    !     IF (iflag_cld_th.eq.-1) THEN ! seulement pour Tiedtke
-    IF (iflag_cld_th.le.-1) THEN ! seulement pour Tiedtke
-       snow_tiedtke=0.
-       !     print*,'avant calcul de la pseudo precip '
-       !     print*,'iflag_cld_th',iflag_cld_th
-       IF (iflag_cld_th.eq.-1) THEN
-          rain_tiedtke=rain_con
-       ELSE
-          !       print*,'calcul de la pseudo precip '
-          rain_tiedtke=0.
-          !         print*,'calcul de la pseudo precip 0'
-          DO k=1,klev
-             DO i=1,klon
-                IF (d_q_con(i,k).lt.0.) THEN
-                   rain_tiedtke(i)=rain_tiedtke(i)-d_q_con(i,k)/pdtphys &
-                        *(paprs(i,k)-paprs(i,k+1))/rg
-                ENDIF
-             ENDDO
-          ENDDO
-       ENDIF
-       !
-       !     call dump2d(iim,jjm,rain_tiedtke(2:klon-1),'PSEUDO PRECIP ')
-       !
-
-       ! Nuages diagnostiques pour Tiedtke
-       CALL diagcld1(paprs,pplay, &
-                                !IM cf FH. rain_con,snow_con,ibas_con,itop_con,
-            rain_tiedtke,snow_tiedtke,ibas_con,itop_con, &
-            diafra,dialiq)
-       DO k = 1, klev
-          DO i = 1, klon
-             IF (diafra(i,k).GT.cldfra(i,k)) THEN
-                radocond(i,k) = dialiq(i,k)
-                cldfra(i,k) = diafra(i,k)
-             ENDIF
-          ENDDO
-       ENDDO
-
-    ELSE IF (iflag_cld_th.ge.3) THEN
-       !  On prend pour les nuages convectifs le max du calcul de la
-       !  convection et du calcul du pas de temps precedent diminue d'un facteur
-       !  facttemps
-       facteur = pdtphys *facttemps
-       DO k=1,klev
-          DO i=1,klon
-             rnebcon(i,k)=rnebcon(i,k)*facteur
-             IF (rnebcon0(i,k)*clwcon0(i,k).GT.rnebcon(i,k)*clwcon(i,k)) THEN
-                rnebcon(i,k)=rnebcon0(i,k)
-                clwcon(i,k)=clwcon0(i,k)
-             ENDIF
-          ENDDO
-       ENDDO
-
-       !   On prend la somme des fractions nuageuses et des contenus en eau
-
-       IF (iflag_cld_th>=5) THEN
-
-          DO k=1,klev
-             ptconvth(:,k)=fm_therm(:,k+1)>0.
-          ENDDO
-
-          IF (iflag_coupl==4) THEN
-
-             ! Dans le cas iflag_coupl==4, on prend la somme des convertures
-             ! convectives et lsc dans la partie des thermiques
-             ! Le controle par iflag_coupl est peut etre provisoire.
-             DO k=1,klev
-                DO i=1,klon
-                   IF (ptconv(i,k).AND.ptconvth(i,k)) THEN
-                      radocond(i,k)=radocond(i,k)+rnebcon(i,k)*clwcon(i,k)
-                      cldfra(i,k)=min(cldfra(i,k)+rnebcon(i,k),1.)
-                   ELSE IF (ptconv(i,k)) THEN
-                      cldfra(i,k)=rnebcon(i,k)
-                      radocond(i,k)=rnebcon(i,k)*clwcon(i,k)
-                   ENDIF
-                ENDDO
-             ENDDO
-
-          ELSE IF (iflag_coupl==5) THEN
-             DO k=1,klev
-                DO i=1,klon
-                   cldfra(i,k)=min(cldfra(i,k)+rnebcon(i,k),1.)
-                   radocond(i,k)=radocond(i,k)+rnebcon(i,k)*clwcon(i,k)
-                ENDDO
-             ENDDO
-
-          ELSE
-
-             ! Si on est sur un point touche par la convection
-             ! profonde et pas par les thermiques, on prend la
-             ! couverture nuageuse et l'eau nuageuse de la convection
-             ! profonde.
-
-             !IM/FH: 2011/02/23 
-             ! definition des points sur lesquels ls thermiques sont actifs
-
-             DO k=1,klev
-                DO i=1,klon
-                   IF (ptconv(i,k).AND. .NOT.ptconvth(i,k)) THEN
-                      cldfra(i,k)=rnebcon(i,k)
-                      radocond(i,k)=rnebcon(i,k)*clwcon(i,k)
-                   ENDIF
-                ENDDO
-             ENDDO
-
-          ENDIF
-
-       ELSE
-
-          ! Ancienne version
-          cldfra(:,:)=min(max(cldfra(:,:),rnebcon(:,:)),1.)
-          radocond(:,:)=radocond(:,:)+rnebcon(:,:)*clwcon(:,:)
-       ENDIF
-
-    ENDIF
-
-    !     plulsc(:)=0.
-    !     do k=1,klev,-1
-    !        do i=1,klon
-    !              zzz=prfl(:,k)+psfl(:,k)
-    !           if (.not.ptconvth.zzz.gt.0.)
-    !        enddo prfl, psfl,
-    !     enddo
-    !
-    ! 2. NUAGES STARTIFORMES
-    !
-    IF (ok_stratus) THEN
-       CALL diagcld2(paprs,pplay,t_seri,q_seri, diafra,dialiq)
-       DO k = 1, klev
-          DO i = 1, klon
-             IF (diafra(i,k).GT.cldfra(i,k)) THEN
-                radocond(i,k) = dialiq(i,k)
-                cldfra(i,k) = diafra(i,k)
-             ENDIF
-          ENDDO
-       ENDDO
-    ENDIF
-    !
-    ! Precipitation totale
-    !
-    DO i = 1, klon
-       rain_fall(i) = rain_con(i) + rain_lsc(i)
-       snow_fall(i) = snow_con(i) + snow_lsc(i)
-    ENDDO
-    !
-    ! Calculer l'humidite relative pour diagnostique
-    !
-    DO k = 1, klev
-       DO i = 1, klon
-          zx_t = t_seri(i,k)
-          IF (thermcep) THEN
-             !!           if (iflag_ice_thermo.eq.0) then                 !jyg
-             zdelta = MAX(0.,SIGN(1.,rtt-zx_t))
-             !!           else                                            !jyg
-             !!           zdelta = MAX(0.,SIGN(1.,t_glace_min-zx_t))      !jyg
-             !!           endif                                           !jyg
-             zx_qs  = r2es * FOEEW(zx_t,zdelta)/pplay(i,k)
-             zx_qs  = MIN(0.5,zx_qs)
-             zcor   = 1./(1.-retv*zx_qs)
-             zx_qs  = zx_qs*zcor
-          ELSE
-             !!           IF (zx_t.LT.t_coup) THEN             !jyg
-             IF (zx_t.LT.rtt) THEN                  !jyg
-                zx_qs = qsats(zx_t)/pplay(i,k)
-             ELSE
-                zx_qs = qsatl(zx_t)/pplay(i,k)
-             ENDIF
-          ENDIF
-          zx_rh(i,k) = q_seri(i,k)/zx_qs
-            IF (iflag_ice_thermo .GT. 0) THEN
-          zx_rhl(i,k) = q_seri(i,k)/(qsatl(zx_t)/pplay(i,k))
-          zx_rhi(i,k) = q_seri(i,k)/(qsats(zx_t)/pplay(i,k))
-            ENDIF
-          zqsat(i,k)=zx_qs
-       ENDDO
-    ENDDO
-
-    !IM Calcul temp.potentielle a 2m (tpot) et temp. potentielle 
-    !   equivalente a 2m (tpote) pour diagnostique
-    !
-    DO i = 1, klon
-       tpot(i)=zt2m(i)*(100000./paprs(i,1))**RKAPPA
-       IF (thermcep) THEN
-          IF(zt2m(i).LT.RTT) then
-             Lheat=RLSTT
-          ELSE
-             Lheat=RLVTT
-          ENDIF
-       ELSE
-          IF (zt2m(i).LT.RTT) THEN
-             Lheat=RLSTT
-          ELSE
-             Lheat=RLVTT
-          ENDIF
-       ENDIF
-       tpote(i) = tpot(i)*      &
-            EXP((Lheat *qsat2m(i))/(RCPD*zt2m(i)))
-    ENDDO
-
-    IF (ANY(type_trac == ['inca','inco'])) THEN ! ModThL
-#ifdef INCA
-       CALL VTe(VTphysiq)
-       CALL VTb(VTinca)
-       calday = REAL(days_elapsed + 1) + jH_cur
-
-       CALL chemtime(itap+itau_phy-1, date0, phys_tstep, itap)
-       CALL AEROSOL_METEO_CALC( &
-            calday,pdtphys,pplay,paprs,t,pmflxr,pmflxs, &
-            prfl,psfl,pctsrf,cell_area, &
-            latitude_deg,longitude_deg,u10m,v10m)
-
-       zxsnow_dummy(:) = 0.0
-
-       CALL chemhook_begin (calday, &
-            days_elapsed+1, &
-            jH_cur, &
-            pctsrf(1,1), &
-            latitude_deg, &
-            longitude_deg, &
-            cell_area, &
-            paprs, &
-            pplay, &
-            coefh(1:klon,1:klev,is_ave), &
-            pphi, &
-            t_seri, &
-            u, &
-            v, &
-            rot, &
-            wo(:, :, 1), &
-            q_seri, &
-            zxtsol, &
-            zt2m, &
-            zxsnow_dummy, &
-            solsw, &
-            albsol1, &
-            rain_fall, &
-            snow_fall, &
-            itop_con, &
-            ibas_con, &
-            cldfra, &
-            nbp_lon, &
-            nbp_lat-1, &
-            tr_seri(:,:,1+nqCO2:nbtr), &
-            ftsol, &
-            paprs, &
-            cdragh, &
-            cdragm, &
-            pctsrf, &
-            pdtphys, &
-            itap)
-
-       CALL VTe(VTinca)
-       CALL VTb(VTphysiq)
-#endif
-    ENDIF !type_trac = inca or inco
-    IF (type_trac == 'repr') THEN
-#ifdef REPROBUS
-    !CALL chemtime_rep(itap+itau_phy-1, date0, dtime, itap)
-    CALL chemtime_rep(itap+itau_phy-1, date0, phys_tstep, itap) 
-#endif
-    ENDIF
-
-    !
-    ! Appeler le rayonnement mais calculer tout d'abord l'albedo du sol.
-    !
-    IF (MOD(itaprad,radpas).EQ.0) THEN
-
-       !
-       !jq - introduce the aerosol direct and first indirect radiative forcings
-       !jq - Johannes Quaas, 27/11/2003 (quaas@lmd.jussieu.fr)
-       IF (flag_aerosol .GT. 0) THEN
-          IF (iflag_rrtm .EQ. 0) THEN !--old radiation
-             IF (.NOT. aerosol_couple) THEN
-                !
-                CALL readaerosol_optic( &
-                     debut, flag_aerosol, itap, jD_cur-jD_ref, &
-                     pdtphys, pplay, paprs, t_seri, rhcl, presnivs,  &
-                     mass_solu_aero, mass_solu_aero_pi,  &
-                     tau_aero, piz_aero, cg_aero,  &
-                     tausum_aero, tau3d_aero)
-             ENDIF
-          ELSE IF (iflag_rrtm .EQ.1) THEN  ! RRTM radiation
-             IF (aerosol_couple .AND. config_inca == 'aero' ) THEN
-                abort_message='config_inca=aero et rrtm=1 impossible'
-                CALL abort_physic(modname,abort_message,1)
-             ELSE
-                !
-#ifdef CPP_RRTM
-                IF (NSW.EQ.6) THEN
-                   !--new aerosol properties SW and LW
-                   !
-#ifdef CPP_Dust
-                   !--SPL aerosol model
-                   CALL splaerosol_optic_rrtm( ok_alw, pplay, paprs, t_seri, rhcl, &
-                        tr_seri, mass_solu_aero, mass_solu_aero_pi,  &
-                        tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm,  &
-                        tausum_aero, tau3d_aero)
-#else
-                   !--climatologies or INCA aerosols
-                   CALL readaerosol_optic_rrtm( debut, aerosol_couple, ok_alw, ok_volcan, &
-                        flag_aerosol, flag_bc_internal_mixture, itap, jD_cur-jD_ref, &
-                        pdtphys, pplay, paprs, t_seri, rhcl, presnivs,  &
-                        tr_seri, mass_solu_aero, mass_solu_aero_pi,  &
-                        tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm,  &
-                        tausum_aero, drytausum_aero, tau3d_aero)
-#endif
-
-                   IF (flag_aerosol .EQ. 7) THEN
-                      CALL MACv2SP(pphis,pplay,paprs,longitude_deg,latitude_deg,  &
-                                   tau_aero_sw_rrtm,piz_aero_sw_rrtm,cg_aero_sw_rrtm)
-                   ENDIF
-
-                   !
-                ELSE IF (NSW.EQ.2) THEN 
-                   !--for now we use the old aerosol properties
-                   !
-                   CALL readaerosol_optic( &
-                        debut, flag_aerosol, itap, jD_cur-jD_ref, &
-                        pdtphys, pplay, paprs, t_seri, rhcl, presnivs,  &
-                        mass_solu_aero, mass_solu_aero_pi,  &
-                        tau_aero, piz_aero, cg_aero,  &
-                        tausum_aero, tau3d_aero)
-                   !
-                   !--natural aerosols
-                   tau_aero_sw_rrtm(:,:,1,:)=tau_aero(:,:,3,:)
-                   piz_aero_sw_rrtm(:,:,1,:)=piz_aero(:,:,3,:)
-                   cg_aero_sw_rrtm (:,:,1,:)=cg_aero (:,:,3,:)
-                   !--all aerosols
-                   tau_aero_sw_rrtm(:,:,2,:)=tau_aero(:,:,2,:)
-                   piz_aero_sw_rrtm(:,:,2,:)=piz_aero(:,:,2,:)
-                   cg_aero_sw_rrtm (:,:,2,:)=cg_aero (:,:,2,:)
-                   !
-                   !--no LW optics
-                   tau_aero_lw_rrtm(:,:,:,:) = 1.e-15
-                   !
-                ELSE
-                   abort_message='Only NSW=2 or 6 are possible with ' &
-                        // 'aerosols and iflag_rrtm=1'
-                   CALL abort_physic(modname,abort_message,1)
-                ENDIF
-#else
-                abort_message='You should compile with -rrtm if running ' &
-                     // 'with iflag_rrtm=1'
-                CALL abort_physic(modname,abort_message,1)
-#endif
-                !
-             ENDIF
-          ELSE IF (iflag_rrtm .EQ.2) THEN    ! ecrad RADIATION
-#ifdef CPP_ECRAD
-             !--climatologies or INCA aerosols
-             CALL readaerosol_optic_ecrad( debut, aerosol_couple, ok_alw, ok_volcan, &
-                  flag_aerosol, flag_bc_internal_mixture, itap, jD_cur-jD_ref, &
-                  pdtphys, pplay, paprs, t_seri, rhcl, presnivs,  &
-                  tr_seri, mass_solu_aero, mass_solu_aero_pi,  &
-                  tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm,  &
-                  tausum_aero, drytausum_aero, tau3d_aero)
-#else
-                abort_message='You should compile with -rad ecrad if running with iflag_rrtm=2'
-                CALL abort_physic(modname,abort_message,1)
-#endif
-          ENDIF
-
-       ELSE   !--flag_aerosol = 0 
-          tausum_aero(:,:,:) = 0.
-          drytausum_aero(:,:) = 0.
-          mass_solu_aero(:,:) = 0.
-          mass_solu_aero_pi(:,:) = 0.
-          IF (iflag_rrtm .EQ. 0) THEN !--old radiation
-             tau_aero(:,:,:,:) = 1.e-15
-             piz_aero(:,:,:,:) = 1.
-             cg_aero(:,:,:,:)  = 0.
-          ELSE
-             tau_aero_sw_rrtm(:,:,:,:) = 1.e-15
-             tau_aero_lw_rrtm(:,:,:,:) = 1.e-15
-             piz_aero_sw_rrtm(:,:,:,:) = 1.0
-             cg_aero_sw_rrtm(:,:,:,:)  = 0.0
-          ENDIF
-       ENDIF
-       !
-       !--WMO criterion to determine tropopause
-       CALL stratosphere_mask(missing_val, pphis, t_seri, pplay, latitude_deg)
-       !
-       !--STRAT AEROSOL
-       !--updates tausum_aero,tau_aero,piz_aero,cg_aero
-       IF (flag_aerosol_strat.GT.0) THEN
-          IF (prt_level .GE.10) THEN
-             PRINT *,'appel a readaerosolstrat', mth_cur
-          ENDIF
-          IF (iflag_rrtm.EQ.0) THEN
-           IF (flag_aerosol_strat.EQ.1) THEN
-             CALL readaerosolstrato(debut)
-           ELSE
-             abort_message='flag_aerosol_strat must equal 1 for rrtm=0'
-             CALL abort_physic(modname,abort_message,1)
-           ENDIF
-          ELSE
-#ifdef CPP_RRTM
-#ifndef CPP_StratAer
-          !--prescribed strat aerosols 
-          !--only in the case of non-interactive strat aerosols
-            IF (flag_aerosol_strat.EQ.1) THEN
-             CALL readaerosolstrato1_rrtm(debut)
-            ELSEIF (flag_aerosol_strat.EQ.2) THEN
-             CALL readaerosolstrato2_rrtm(debut, ok_volcan)
-            ELSE
-             abort_message='flag_aerosol_strat must equal 1 or 2 for rrtm=1'
-             CALL abort_physic(modname,abort_message,1)
-            ENDIF
-#endif
-#else
-             abort_message='You should compile with -rrtm if running ' &
-                  // 'with iflag_rrtm=1'
-             CALL abort_physic(modname,abort_message,1)
-#endif
-          ENDIF
-       ELSE
-          tausum_aero(:,:,id_STRAT_phy) = 0. 
-       ENDIF
-!
-#ifdef CPP_RRTM
-#ifdef CPP_StratAer
-       !--compute stratospheric mask
-       CALL stratosphere_mask(missing_val, pphis, t_seri, pplay, latitude_deg)
-       !--interactive strat aerosols
-       CALL calcaerosolstrato_rrtm(pplay,t_seri,paprs,debut)
-#endif
-#endif
-       !--fin STRAT AEROSOL
-       !     
-
-       ! Calculer les parametres optiques des nuages et quelques
-       ! parametres pour diagnostiques:
-       !
-       IF (aerosol_couple.AND.config_inca=='aero') THEN 
-          mass_solu_aero(:,:)    = ccm(:,:,1) 
-          mass_solu_aero_pi(:,:) = ccm(:,:,2) 
-       ENDIF
-
-       IF (ok_newmicro) then
-! AI          IF (iflag_rrtm.NE.0) THEN 
-          IF (iflag_rrtm.EQ.1) THEN
-#ifdef CPP_RRTM
-             IF (ok_cdnc.AND.NRADLP.NE.3) THEN
-             abort_message='RRTM choix incoherent NRADLP doit etre egal a 3 ' &
-                  // 'pour ok_cdnc' 
-             CALL abort_physic(modname,abort_message,1)
-             ENDIF
-#else
-
-             abort_message='You should compile with -rrtm if running with '//'iflag_rrtm=1'
-             CALL abort_physic(modname,abort_message,1)
-#endif
-          ENDIF
-          CALL newmicro (flag_aerosol, ok_cdnc, bl95_b0, bl95_b1, &
-               paprs, pplay, t_seri, radocond, picefra, cldfra, &
-               cldtau, cldemi, cldh, cldl, cldm, cldt, cldq, &
-               flwp, fiwp, flwc, fiwc, &
-               mass_solu_aero, mass_solu_aero_pi, &
-               cldtaupi, latitude_deg, re, fl, ref_liq, ref_ice, &
-               ref_liq_pi, ref_ice_pi)
-       ELSE
-          CALL nuage (paprs, pplay, &
-               t_seri, radocond, picefra, cldfra, cldtau, cldemi, &
-               cldh, cldl, cldm, cldt, cldq, &
-               ok_aie, &
-               mass_solu_aero, mass_solu_aero_pi, &
-               bl95_b0, bl95_b1, &
-               cldtaupi, re, fl)
-       ENDIF
-       !
-       !IM betaCRF
-       !
-       cldtaurad   = cldtau
-       cldtaupirad = cldtaupi
-       cldemirad   = cldemi
-       cldfrarad   = cldfra
-
-       !
-       IF (lon1_beta.EQ.-180..AND.lon2_beta.EQ.180..AND. &
-           lat1_beta.EQ.90..AND.lat2_beta.EQ.-90.) THEN
-          !
-          ! global
-          !
-!IM 251017 begin
-!               print*,'physiq betaCRF global zdtime=',zdtime
-!IM 251017 end
-          DO k=1, klev
-             DO i=1, klon
-                IF (pplay(i,k).GE.pfree) THEN
-                   beta(i,k) = beta_pbl
-                ELSE
-                   beta(i,k) = beta_free
-                ENDIF
-                IF (mskocean_beta) THEN
-                   beta(i,k) = beta(i,k) * pctsrf(i,is_oce)
-                ENDIF
-                cldtaurad(i,k)   = cldtau(i,k) * beta(i,k)
-                cldtaupirad(i,k) = cldtaupi(i,k) * beta(i,k)
-                cldemirad(i,k)   = cldemi(i,k) * beta(i,k)
-                cldfrarad(i,k)   = cldfra(i,k) * beta(i,k)
-             ENDDO
-          ENDDO
-          !
-       ELSE
-          !
-          ! regional
-          !
-          DO k=1, klev
-             DO i=1,klon
-                !
-                IF (longitude_deg(i).ge.lon1_beta.AND. &
-                    longitude_deg(i).le.lon2_beta.AND. &
-                    latitude_deg(i).le.lat1_beta.AND.  &
-                    latitude_deg(i).ge.lat2_beta) THEN
-                   IF (pplay(i,k).GE.pfree) THEN
-                      beta(i,k) = beta_pbl
-                   ELSE
-                      beta(i,k) = beta_free
-                   ENDIF
-                   IF (mskocean_beta) THEN
-                      beta(i,k) = beta(i,k) * pctsrf(i,is_oce)
-                   ENDIF
-                   cldtaurad(i,k)   = cldtau(i,k) * beta(i,k)
-                   cldtaupirad(i,k) = cldtaupi(i,k) * beta(i,k)
-                   cldemirad(i,k)   = cldemi(i,k) * beta(i,k)
-                   cldfrarad(i,k)   = cldfra(i,k) * beta(i,k)
-                ENDIF
-             !
-             ENDDO
-          ENDDO
-       !
-       ENDIF
-
-       !lecture de la chlorophylle pour le nouvel albedo de Sunghye Baek 
-       IF (ok_chlorophyll) THEN
-          print*,"-- reading chlorophyll"
-          CALL readchlorophyll(debut)
-       ENDIF
-
-!--if ok_suntime_rrtm we use ancillay data for RSUN 
-!--previous values are therefore overwritten
-!--this is needed for CMIP6 runs
-!--and only possible for new radiation scheme
-       IF (iflag_rrtm.EQ.1.AND.ok_suntime_rrtm) THEN 
-#ifdef CPP_RRTM
-         CALL read_rsun_rrtm(debut)
-#endif
-       ENDIF
-
-       IF (mydebug) THEN
-          CALL writefield_phy('u_seri',u_seri,nbp_lev)
-          CALL writefield_phy('v_seri',v_seri,nbp_lev)
-          CALL writefield_phy('t_seri',t_seri,nbp_lev)
-          CALL writefield_phy('q_seri',q_seri,nbp_lev)
-       ENDIF
-
-       !
-       !sonia : If Iflag_radia >=2, pertubation of some variables
-       !input to radiation (DICE)
-       !
-       IF (iflag_radia .ge. 2) THEN
-          zsav_tsol (:) = zxtsol(:)
-          CALL perturb_radlwsw(zxtsol,iflag_radia)
-       ENDIF
-
-       IF (aerosol_couple.AND.config_inca=='aero') THEN 
-#ifdef INCA
-          CALL radlwsw_inca  &
-               (chemistry_couple, kdlon,kflev,dist, rmu0, fract, solaire, &
-               paprs, pplay,zxtsol,albsol1, albsol2, t_seri,q_seri, &
-               size(wo,3), wo, &
-               cldfrarad, cldemirad, cldtaurad, &
-               heat,heat0,cool,cool0,albpla, &
-               topsw,toplw,solsw,sollw, &
-               sollwdown, &
-               topsw0,toplw0,solsw0,sollw0, &
-               lwdn0, lwdn, lwup0, lwup,  &
-               swdn0, swdn, swup0, swup, &
-               ok_ade, ok_aie, &
-               tau_aero, piz_aero, cg_aero, &
-               topswad_aero, solswad_aero, &
-               topswad0_aero, solswad0_aero, &
-               topsw_aero, topsw0_aero, &
-               solsw_aero, solsw0_aero, &
-               cldtaupirad, &
-               topswai_aero, solswai_aero)
-#endif
-       ELSE
-          !
-          !IM calcul radiatif pour le cas actuel
-          !
-          RCO2 = RCO2_act
-          RCH4 = RCH4_act
-          RN2O = RN2O_act
-          RCFC11 = RCFC11_act
-          RCFC12 = RCFC12_act
-          ! 
-          !--interactive CO2 in ppm from carbon cycle
-          IF (carbon_cycle_rad) RCO2=RCO2_glo
-          !
-          IF (prt_level .GE.10) THEN
-             print *,' ->radlwsw, number 1 '
-          ENDIF
-          !
-          CALL radlwsw &
-               (dist, rmu0, fract,  &
-                                !albedo SB >>>
-                                !      paprs, pplay,zxtsol,albsol1, albsol2,  &
-               paprs, pplay,zxtsol,SFRWL,albsol_dir, albsol_dif,  &
-                                !albedo SB <<<
-               t_seri,q_seri,wo, &
-               cldfrarad, cldemirad, cldtaurad, &
-               ok_ade.OR.flag_aerosol_strat.GT.0, ok_aie,  ok_volcan, flag_volc_surfstrat, &
-               flag_aerosol, flag_aerosol_strat, flag_aer_feedback, &
-               tau_aero, piz_aero, cg_aero, &
-               tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm, & 
-               ! Rajoute par OB pour RRTM
-               tau_aero_lw_rrtm, & 
-               cldtaupirad, &
-!              zqsat, flwcrad, fiwcrad, &
-               zqsat, flwc, fiwc, &
-               ref_liq, ref_ice, ref_liq_pi, ref_ice_pi, &
-               heat,heat0,cool,cool0,albpla, &
-               heat_volc,cool_volc, &
-               topsw,toplw,solsw,solswfdiff,sollw, &
-               sollwdown, &
-               topsw0,toplw0,solsw0,sollw0, &
-               lwdnc0, lwdn0, lwdn, lwupc0, lwup0, lwup,  &
-               swdnc0, swdn0, swdn, swupc0, swup0, swup, &
-               topswad_aero, solswad_aero, &
-               topswai_aero, solswai_aero, &
-               topswad0_aero, solswad0_aero, &
-               topsw_aero, topsw0_aero, &
-               solsw_aero, solsw0_aero, &
-               topswcf_aero, solswcf_aero, &
-                                !-C. Kleinschmitt for LW diagnostics
-               toplwad_aero, sollwad_aero,&
-               toplwai_aero, sollwai_aero, &
-               toplwad0_aero, sollwad0_aero,&
-                                !-end
-               ZLWFT0_i, ZFLDN0, ZFLUP0, &
-               ZSWFT0_i, ZFSDN0, ZFSUP0)
-
-          !lwoff=y, betalwoff=1. : offset LW CRE for radiation code and other
-          !schemes
-          toplw = toplw + betalwoff * (toplw0 - toplw)
-          sollw = sollw + betalwoff * (sollw0 - sollw)
-          lwdn = lwdn + betalwoff * (lwdn0 - lwdn)
-          lwup = lwup + betalwoff * (lwup0 - lwup)
-          sollwdown(:)= sollwdown(:) + betalwoff *(-1.*ZFLDN0(:,1) - &
-                        sollwdown(:))
-          cool = cool + betalwoff * (cool0 - cool)
- 
-#ifndef CPP_XIOS
-          !
-          !IM 2eme calcul radiatif pour le cas perturbe ou au moins un
-          !IM des taux doit etre different du taux actuel
-          !IM Par defaut on a les taux perturbes egaux aux taux actuels
-          !
-          IF (RCO2_per.NE.RCO2_act.OR. &
-              RCH4_per.NE.RCH4_act.OR. &
-              RN2O_per.NE.RN2O_act.OR. &
-              RCFC11_per.NE.RCFC11_act.OR. &
-              RCFC12_per.NE.RCFC12_act) ok_4xCO2atm =.TRUE. 
-#endif
-   ! 
-          IF (ok_4xCO2atm) THEN
-                !
-                RCO2 = RCO2_per
-                RCH4 = RCH4_per
-                RN2O = RN2O_per
-                RCFC11 = RCFC11_per
-                RCFC12 = RCFC12_per
-                !
-                IF (prt_level .GE.10) THEN
-                   print *,' ->radlwsw, number 2 '
-                ENDIF
-                !
-                CALL radlwsw &
-                     (dist, rmu0, fract,  &
-                                !albedo SB >>>
-                                !      paprs, pplay,zxtsol,albsol1, albsol2,  &
-                     paprs, pplay,zxtsol,SFRWL,albsol_dir, albsol_dif, & 
-                                !albedo SB <<<
-                     t_seri,q_seri,wo, &
-                     cldfrarad, cldemirad, cldtaurad, &
-                     ok_ade.OR.flag_aerosol_strat.GT.0, ok_aie,  ok_volcan, flag_volc_surfstrat, &
-                     flag_aerosol, flag_aerosol_strat, flag_aer_feedback, &
-                     tau_aero, piz_aero, cg_aero, &
-                     tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm, &
-                                ! Rajoute par OB pour RRTM
-                     tau_aero_lw_rrtm, &
-                     cldtaupi, &
-!                    zqsat, flwcrad, fiwcrad, &
-                     zqsat, flwc, fiwc, &
-                     ref_liq, ref_ice, ref_liq_pi, ref_ice_pi, &
-                     heatp,heat0p,coolp,cool0p,albplap, &
-                     heat_volc,cool_volc, &
-                     topswp,toplwp,solswp,solswfdiffp,sollwp, &
-                     sollwdownp, &
-                     topsw0p,toplw0p,solsw0p,sollw0p, &
-                     lwdnc0p, lwdn0p, lwdnp, lwupc0p, lwup0p, lwupp,  &
-                     swdnc0p, swdn0p, swdnp, swupc0p, swup0p, swupp, &
-                     topswad_aerop, solswad_aerop, &
-                     topswai_aerop, solswai_aerop, &
-                     topswad0_aerop, solswad0_aerop, &
-                     topsw_aerop, topsw0_aerop, &
-                     solsw_aerop, solsw0_aerop, &
-                     topswcf_aerop, solswcf_aerop, &
-                                !-C. Kleinschmitt for LW diagnostics
-                     toplwad_aerop, sollwad_aerop,&
-                     toplwai_aerop, sollwai_aerop, &
-                     toplwad0_aerop, sollwad0_aerop,&
-                                !-end
-                     ZLWFT0_i, ZFLDN0, ZFLUP0, &
-                     ZSWFT0_i, ZFSDN0, ZFSUP0)
-          ENDIF !ok_4xCO2atm
-       ENDIF ! aerosol_couple
-       itaprad = 0
-       !
-       !  If Iflag_radia >=2, reset pertubed variables
-       !
-       IF (iflag_radia .ge. 2) THEN
-          zxtsol(:) = zsav_tsol (:)
-       ENDIF
-    ENDIF ! MOD(itaprad,radpas)
-    itaprad = itaprad + 1
-
-    IF (iflag_radia.eq.0) THEN
-       IF (prt_level.ge.9) THEN
-          PRINT *,'--------------------------------------------------'
-          PRINT *,'>>>> ATTENTION rayonnement desactive pour ce cas'
-          PRINT *,'>>>>           heat et cool mis a zero '
-          PRINT *,'--------------------------------------------------'
-       ENDIF
-       heat=0.
-       cool=0.
-       sollw=0.   ! MPL 01032011
-       solsw=0.
-       radsol=0.
-       swup=0.    ! MPL 27102011 pour les fichiers AMMA_profiles et AMMA_scalars
-       swup0=0.
-       lwup=0.
-       lwup0=0.
-       lwdn=0.
-       lwdn0=0.
-    ENDIF
-
-    !
-    ! Calculer radsol a l'exterieur de radlwsw
-    ! pour prendre en compte le cycle diurne
-    ! recode par Olivier Boucher en sept 2015
-    !
-    radsol=solsw*swradcorr+sollw
-
-    IF (ok_4xCO2atm) THEN
-       radsolp=solswp*swradcorr+sollwp
-    ENDIF
-
-    !
-    ! Ajouter la tendance des rayonnements (tous les pas)
-    ! avec une correction pour le cycle diurne dans le SW
-    !
-
-    DO k=1, klev
-       d_t_swr(:,k)=swradcorr(:)*heat(:,k)*phys_tstep/RDAY
-       d_t_sw0(:,k)=swradcorr(:)*heat0(:,k)*phys_tstep/RDAY
-       d_t_lwr(:,k)=-cool(:,k)*phys_tstep/RDAY
-       d_t_lw0(:,k)=-cool0(:,k)*phys_tstep/RDAY
-    ENDDO
-
-    CALL add_phys_tend(du0,dv0,d_t_swr,dq0,dql0,dqi0,paprs,'SW',abortphy,flag_inhib_tend,itap,0)
-    CALL prt_enerbil('SW',itap)
-    CALL add_phys_tend(du0,dv0,d_t_lwr,dq0,dql0,dqi0,paprs,'LW',abortphy,flag_inhib_tend,itap,0)
-    CALL prt_enerbil('LW',itap)
-
-    !
-    IF (mydebug) THEN
-       CALL writefield_phy('u_seri',u_seri,nbp_lev)
-       CALL writefield_phy('v_seri',v_seri,nbp_lev)
-       CALL writefield_phy('t_seri',t_seri,nbp_lev)
-       CALL writefield_phy('q_seri',q_seri,nbp_lev)
-    ENDIF
-
-    ! Calculer l'hydrologie de la surface
-    !
-    !      CALL hydrol(dtime,pctsrf,rain_fall, snow_fall, zxevap,
-    !     .            agesno, ftsol,fqsurf,fsnow, ruis)
-    !
-
-    !
-    ! Calculer le bilan du sol et la derive de temperature (couplage)
-    !
-    DO i = 1, klon
-       !         bils(i) = radsol(i) - sens(i) - evap(i)*RLVTT
-       ! a la demande de JLD
-       bils(i) = radsol(i) - sens(i) + zxfluxlat(i)
-    ENDDO
-    !
-    !moddeblott(jan95)
-    ! Appeler le programme de parametrisation de l'orographie
-    ! a l'echelle sous-maille:
-    !
-    IF (prt_level .GE.10) THEN
-       print *,' call orography ? ', ok_orodr
-    ENDIF
-    !
-    IF (ok_orodr) THEN
-       !
-       !  selection des points pour lesquels le shema est actif:
-       igwd=0
-       DO i=1,klon
-          itest(i)=0
-          zrel_oro(i)=zstd(i)/(max(zsig(i),1.E-8)*sqrt(cell_area(i)))
-          !zrel_oro: relative mountain height wrt relief explained by mean slope
-          ! -> condition on zrel_oro can deactivate the drag on tilted planar terrains
-          !    such as ice sheets (work by V. Wiener)
-          ! zpmm_orodr_t and zstd_orodr_t are activation thresholds set by F. Lott to
-          ! earn computation time but they are not physical.
-          IF (((zpic(i)-zmea(i)).GT.zpmm_orodr_t).AND.(zstd(i).GT.zstd_orodr_t).AND.(zrel_oro(i).LE.zrel_oro_t)) THEN
-             itest(i)=1
-             igwd=igwd+1
-             idx(igwd)=i
-          ENDIF
-       ENDDO
-       !        igwdim=MAX(1,igwd)
-       !
-       IF (ok_strato) THEN
-
-          CALL drag_noro_strato(0,klon,klev,phys_tstep,paprs,pplay, &
-               zmea,zstd, zsig, zgam, zthe,zpic,zval, &
-               igwd,idx,itest, &
-               t_seri, u_seri, v_seri, &
-               zulow, zvlow, zustrdr, zvstrdr, &
-               d_t_oro, d_u_oro, d_v_oro)
-
-       ELSE
-          CALL drag_noro(klon,klev,phys_tstep,paprs,pplay, &
-               zmea,zstd, zsig, zgam, zthe,zpic,zval, &
-               igwd,idx,itest, &
-               t_seri, u_seri, v_seri, &
-               zulow, zvlow, zustrdr, zvstrdr, &
-               d_t_oro, d_u_oro, d_v_oro)
-       ENDIF
-       !
-       !  ajout des tendances
-       !-----------------------------------------------------------------------
-       ! ajout des tendances de la trainee de l'orographie
-       CALL add_phys_tend(d_u_oro,d_v_oro,d_t_oro,dq0,dql0,dqi0,paprs,'oro', &
-            abortphy,flag_inhib_tend,itap,0)
-       CALL prt_enerbil('oro',itap)
-       !----------------------------------------------------------------------
-       !
-    ENDIF ! fin de test sur ok_orodr
-    !
-    IF (mydebug) THEN
-       CALL writefield_phy('u_seri',u_seri,nbp_lev)
-       CALL writefield_phy('v_seri',v_seri,nbp_lev)
-       CALL writefield_phy('t_seri',t_seri,nbp_lev)
-       CALL writefield_phy('q_seri',q_seri,nbp_lev)
-    ENDIF
-
-    IF (ok_orolf) THEN
-       !
-       !  selection des points pour lesquels le shema est actif:
-       igwd=0
-       DO i=1,klon
-          itest(i)=0
-          !zrel_oro: relative mountain height wrt relief explained by mean slope
-          ! -> condition on zrel_oro can deactivate the lifting on tilted planar terrains
-          !    such as ice sheets (work by V. Wiener)
-          zrel_oro(i)=zstd(i)/(max(zsig(i),1.E-8)*sqrt(cell_area(i)))
-          IF (((zpic(i)-zmea(i)).GT.zpmm_orolf_t).AND.(zrel_oro(i).LE.zrel_oro_t)) THEN
-             itest(i)=1
-             igwd=igwd+1
-             idx(igwd)=i
-          ENDIF
-       ENDDO
-       !        igwdim=MAX(1,igwd)
-       !
-       IF (ok_strato) THEN
-
-          CALL lift_noro_strato(klon,klev,phys_tstep,paprs,pplay, &
-               latitude_deg,zmea,zstd,zpic,zgam,zthe,zpic,zval, &
-               igwd,idx,itest, &
-               t_seri, u_seri, v_seri, &
-               zulow, zvlow, zustrli, zvstrli, &
-               d_t_lif, d_u_lif, d_v_lif               )
-
-       ELSE
-          CALL lift_noro(klon,klev,phys_tstep,paprs,pplay, &
-               latitude_deg,zmea,zstd,zpic, &
-               itest, &
-               t_seri, u_seri, v_seri, &
-               zulow, zvlow, zustrli, zvstrli, &
-               d_t_lif, d_u_lif, d_v_lif)
-       ENDIF
-
-       ! ajout des tendances de la portance de l'orographie
-       CALL add_phys_tend(d_u_lif, d_v_lif, d_t_lif, dq0, dql0, dqi0, paprs, &
-            'lif', abortphy,flag_inhib_tend,itap,0)
-       CALL prt_enerbil('lif',itap)
-    ENDIF ! fin de test sur ok_orolf
-
-    IF (ok_hines) then
-       !  HINES GWD PARAMETRIZATION
-       east_gwstress=0.
-       west_gwstress=0.
-       du_gwd_hines=0.
-       dv_gwd_hines=0.
-       CALL hines_gwd(klon, klev, phys_tstep, paprs, pplay, latitude_deg, t_seri, &
-            u_seri, v_seri, zustr_gwd_hines, zvstr_gwd_hines, d_t_hin, &
-            du_gwd_hines, dv_gwd_hines)
-       zustr_gwd_hines=0.
-       zvstr_gwd_hines=0.
-       DO k = 1, klev
-          zustr_gwd_hines(:)=zustr_gwd_hines(:)+ du_gwd_hines(:, k)/phys_tstep &
-               * (paprs(:, k)-paprs(:, k+1))/rg
-          zvstr_gwd_hines(:)=zvstr_gwd_hines(:)+ dv_gwd_hines(:, k)/phys_tstep &
-               * (paprs(:, k)-paprs(:, k+1))/rg
-       ENDDO
-
-       d_t_hin(:, :)=0.
-       CALL add_phys_tend(du_gwd_hines, dv_gwd_hines, d_t_hin, dq0, dql0, &
-            dqi0, paprs, 'hin', abortphy,flag_inhib_tend,itap,0)
-       CALL prt_enerbil('hin',itap)
-    ENDIF
-
-    IF (.not. ok_hines .and. ok_gwd_rando) then
-       ! ym missing init for east_gwstress & west_gwstress -> added in phys_local_var_mod
-       CALL acama_GWD_rando(PHYS_TSTEP, pplay, latitude_deg, t_seri, u_seri, &
-            v_seri, rot, zustr_gwd_front, zvstr_gwd_front, du_gwd_front, &
-            dv_gwd_front, east_gwstress, west_gwstress)
-       zustr_gwd_front=0.
-       zvstr_gwd_front=0.
-       DO k = 1, klev
-          zustr_gwd_front(:)=zustr_gwd_front(:)+ du_gwd_front(:, k)/phys_tstep &
-               * (paprs(:, k)-paprs(:, k+1))/rg
-          zvstr_gwd_front(:)=zvstr_gwd_front(:)+ dv_gwd_front(:, k)/phys_tstep &
-               * (paprs(:, k)-paprs(:, k+1))/rg
-       ENDDO
-
-       CALL add_phys_tend(du_gwd_front, dv_gwd_front, dt0, dq0, dql0, dqi0, &
-            paprs, 'front_gwd_rando', abortphy,flag_inhib_tend,itap,0)
-       CALL prt_enerbil('front_gwd_rando',itap)
-    ENDIF
-
-    IF (ok_gwd_rando) THEN
-       CALL FLOTT_GWD_rando(PHYS_TSTEP, pplay, t_seri, u_seri, v_seri, &
-            rain_fall + snow_fall, zustr_gwd_rando, zvstr_gwd_rando, &
-            du_gwd_rando, dv_gwd_rando, east_gwstress, west_gwstress)
-       CALL add_phys_tend(du_gwd_rando, dv_gwd_rando, dt0, dq0, dql0, dqi0, &
-            paprs, 'flott_gwd_rando', abortphy,flag_inhib_tend,itap,0)
-       CALL prt_enerbil('flott_gwd_rando',itap)
-       zustr_gwd_rando=0.
-       zvstr_gwd_rando=0.
-       DO k = 1, klev
-          zustr_gwd_rando(:)=zustr_gwd_rando(:)+ du_gwd_rando(:, k)/phys_tstep &
-               * (paprs(:, k)-paprs(:, k+1))/rg
-          zvstr_gwd_rando(:)=zvstr_gwd_rando(:)+ dv_gwd_rando(:, k)/phys_tstep &
-               * (paprs(:, k)-paprs(:, k+1))/rg
-       ENDDO
-    ENDIF
-
-    ! STRESS NECESSAIRES: TOUTE LA PHYSIQUE
-
-    IF (mydebug) THEN
-       CALL writefield_phy('u_seri',u_seri,nbp_lev)
-       CALL writefield_phy('v_seri',v_seri,nbp_lev)
-       CALL writefield_phy('t_seri',t_seri,nbp_lev)
-       CALL writefield_phy('q_seri',q_seri,nbp_lev)
-    ENDIF
-
-    DO i = 1, klon
-       zustrph(i)=0.
-       zvstrph(i)=0.
-    ENDDO
-    DO k = 1, klev
-       DO i = 1, klon
-          zustrph(i)=zustrph(i)+(u_seri(i,k)-u(i,k))/phys_tstep* &
-               (paprs(i,k)-paprs(i,k+1))/rg
-          zvstrph(i)=zvstrph(i)+(v_seri(i,k)-v(i,k))/phys_tstep* &
-               (paprs(i,k)-paprs(i,k+1))/rg
-       ENDDO
-    ENDDO
-    !
-    !IM calcul composantes axiales du moment angulaire et couple des montagnes
-    !
-    IF (is_sequential .and. ok_orodr) THEN 
-       CALL aaam_bud (27,klon,klev,jD_cur-jD_ref,jH_cur, &
-            ra,rg,romega, &
-            latitude_deg,longitude_deg,pphis, &
-            zustrdr,zustrli,zustrph, &
-            zvstrdr,zvstrli,zvstrph, &
-            paprs,u,v, &
-            aam, torsfc)
-    ENDIF
-    !IM cf. FLott END
-    !DC Calcul de la tendance due au methane
-    IF (ok_qch4) THEN
-       CALL METHOX(1,klon,klon,klev,q_seri,d_q_ch4,pplay)
-       ! ajout de la tendance d'humidite due au methane
-       d_q_ch4_dtime(:,:) = d_q_ch4(:,:)*phys_tstep
-       CALL add_phys_tend(du0, dv0, dt0, d_q_ch4_dtime, dql0, dqi0, paprs, &
-            'q_ch4', abortphy,flag_inhib_tend,itap,0)
-       d_q_ch4(:,:) = d_q_ch4_dtime(:,:)/phys_tstep
-    ENDIF
-    !
-    !
-
-!===============================================================
-!            Additional tendency of TKE due to orography
-!===============================================================
-!
-! Inititialization
-!------------------
-
-       addtkeoro=0   
-       CALL getin_p('addtkeoro',addtkeoro) 
-      
-       IF (prt_level.ge.5) &
-            print*,'addtkeoro', addtkeoro
-            
-       alphatkeoro=1.   
-       CALL getin_p('alphatkeoro',alphatkeoro)
-       alphatkeoro=min(max(0.,alphatkeoro),1.)
-
-       smallscales_tkeoro=.FALSE.   
-       CALL getin_p('smallscales_tkeoro',smallscales_tkeoro) 
-
-
-       dtadd(:,:)=0.
-       duadd(:,:)=0.
-       dvadd(:,:)=0.
-
-! Choices for addtkeoro:
-!      ** 0 no TKE tendency from orography    
-!      ** 1 we include a fraction alphatkeoro of the whole tendency duoro
-!      ** 2 we include a fraction alphatkeoro of the gravity wave part of duoro
-!
-
-       IF (addtkeoro .GT. 0 .AND. ok_orodr ) THEN
-!      -------------------------------------------
-
-
-       !  selection des points pour lesquels le schema est actif:
-
-
-  IF (addtkeoro .EQ. 1 ) THEN
-
-            duadd(:,:)=alphatkeoro*d_u_oro(:,:)
-            dvadd(:,:)=alphatkeoro*d_v_oro(:,:)
-
-  ELSE IF (addtkeoro .EQ. 2) THEN
-
-     IF (smallscales_tkeoro) THEN
-       igwd=0
-       DO i=1,klon
-          itest(i)=0
-! Etienne: ici je prends en compte plus de relief que la routine drag_noro_strato
-! car on peut s'attendre a ce que les petites echelles produisent aussi de la TKE
-! Mais attention, cela ne va pas dans le sens de la conservation de l'energie! 
-          IF ((zstd(i).GT.1.0) .AND.(zrel_oro(i).LE.zrel_oro_t)) THEN
-             itest(i)=1
-             igwd=igwd+1
-             idx(igwd)=i
-          ENDIF
-       ENDDO
-
-     ELSE 
-
-       igwd=0
-       DO i=1,klon
-          itest(i)=0
-        IF (((zpic(i)-zmea(i)).GT.zpmm_orodr_t).AND.(zstd(i).GT.zstd_orodr_t).AND.(zrel_oro(i).LE.zrel_oro_t)) THEN
-             itest(i)=1
-             igwd=igwd+1
-             idx(igwd)=i
-        ENDIF
-       ENDDO
-
-     ENDIF
-
-     CALL drag_noro_strato(addtkeoro,klon,klev,phys_tstep,paprs,pplay, &
-               zmea,zstd, zsig, zgam, zthe,zpic,zval, &
-               igwd,idx,itest, &
-               t_seri, u_seri, v_seri, &
-               zulow, zvlow, zustrdr, zvstrdr, &
-               d_t_oro_gw, d_u_oro_gw, d_v_oro_gw)
-
-     zustrdr(:)=0.
-     zvstrdr(:)=0.
-     zulow(:)=0.
-     zvlow(:)=0.
-
-     duadd(:,:)=alphatkeoro*d_u_oro_gw(:,:)
-     dvadd(:,:)=alphatkeoro*d_v_oro_gw(:,:)
-  ENDIF
-
-
-   ! TKE update from subgrid temperature and wind tendencies
-   !----------------------------------------------------------
-    forall (k=1: nbp_lev) exner(:, k) = (pplay(:, k)/paprs(:,1))**RKAPPA
-
-
-    CALL tend_to_tke(pdtphys,paprs,exner,t_seri,u_seri,v_seri,dtadd,duadd,dvadd,pctsrf,pbl_tke)
-   !
-   ! Prevent pbl_tke_w from becoming negative
-    wake_delta_pbl_tke(:,:,:) = max(wake_delta_pbl_tke(:,:,:), -pbl_tke(:,:,:))
-   !
-
-       ENDIF
-!      -----
-!===============================================================
-
-
-    !====================================================================
-    ! Interface Simulateur COSP (Calipso, ISCCP, MISR, ..)
-    !====================================================================
-    ! Abderrahmane 24.08.09
-
-    IF (ok_cosp) THEN
-       ! adeclarer 
-#ifdef CPP_COSP
-       IF (itap.eq.1.or.MOD(itap,NINT(freq_cosp/phys_tstep)).EQ.0) THEN
-
-          IF (prt_level .GE.10) THEN
-             print*,'freq_cosp',freq_cosp
-          ENDIF
-          mr_ozone=wo(:, :, 1) * dobson_u * 1e3 / zmasse
-          !       print*,'Dans physiq.F avant appel cosp ref_liq,ref_ice=',
-          !     s        ref_liq,ref_ice
-          CALL phys_cosp(itap,phys_tstep,freq_cosp, &
-               ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, &
-               ecrit_mth,ecrit_day,ecrit_hf, ok_all_xml, missing_val, &
-               klon,klev,longitude_deg,latitude_deg,presnivs,overlap, &
-               JrNt,ref_liq,ref_ice, &
-               pctsrf(:,is_ter)+pctsrf(:,is_lic), &
-               zu10m,zv10m,pphis, &
-               zphi,paprs(:,1:klev),pplay,zxtsol,t_seri, &
-               qx(:,:,ivap),zx_rh,cldfra,rnebcon,flwc,fiwc, &
-               prfl(:,1:klev),psfl(:,1:klev), &
-               pmflxr(:,1:klev),pmflxs(:,1:klev), &
-               mr_ozone,cldtau, cldemi)
-
-          !     L         calipso2D,calipso3D,cfadlidar,parasolrefl,atb,betamol,
-          !     L          cfaddbze,clcalipso2,dbze,cltlidarradar,
-          !     M          clMISR,
-          !     R          clisccp2,boxtauisccp,boxptopisccp,tclisccp,ctpisccp,
-          !     I          tauisccp,albisccp,meantbisccp,meantbclrisccp)
-
-       ENDIF
-#endif
-
-#ifdef CPP_COSP2
-       IF (itap.eq.1.or.MOD(itap,NINT(freq_cosp/phys_tstep)).EQ.0) THEN
-
-          IF (prt_level .GE.10) THEN
-             print*,'freq_cosp',freq_cosp
-          ENDIF
-          mr_ozone=wo(:, :, 1) * dobson_u * 1e3 / zmasse
-                 print*,'Dans physiq.F avant appel '
-          !     s        ref_liq,ref_ice
-          CALL phys_cosp2(itap,phys_tstep,freq_cosp, &
-               ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, &
-               ecrit_mth,ecrit_day,ecrit_hf, ok_all_xml, missing_val, &
-               klon,klev,longitude_deg,latitude_deg,presnivs,overlap, &
-               JrNt,ref_liq,ref_ice, &
-               pctsrf(:,is_ter)+pctsrf(:,is_lic), &
-               zu10m,zv10m,pphis, &
-               zphi,paprs(:,1:klev),pplay,zxtsol,t_seri, &
-               qx(:,:,ivap),zx_rh,cldfra,rnebcon,flwc,fiwc, &
-               prfl(:,1:klev),psfl(:,1:klev), &
-               pmflxr(:,1:klev),pmflxs(:,1:klev), &
-               mr_ozone,cldtau, cldemi)
-       ENDIF
-#endif
-
-#ifdef CPP_COSPV2
-       IF (itap.eq.1.or.MOD(itap,NINT(freq_cosp/phys_tstep)).EQ.0) THEN
-!        IF (MOD(itap,NINT(freq_cosp/phys_tstep)).EQ.0) THEN
-
-          IF (prt_level .GE.10) THEN
-             print*,'freq_cosp',freq_cosp
-          ENDIF
-           DO k = 1, klev
-             DO i = 1, klon
-               phicosp(i,k) = pphi(i,k) + pphis(i)
-             ENDDO
-           ENDDO
-          mr_ozone=wo(:, :, 1) * dobson_u * 1e3 / zmasse
-                 print*,'Dans physiq.F avant appel '
-          !     s        ref_liq,ref_ice
-          CALL lmdz_cosp_interface(itap,phys_tstep,freq_cosp, &
-               ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, &
-               ecrit_mth,ecrit_day,ecrit_hf, ok_all_xml, missing_val, &
-               klon,klev,longitude_deg,latitude_deg,presnivs,overlap, &
-               JrNt,ref_liq,ref_ice, &
-               pctsrf(:,is_ter)+pctsrf(:,is_lic), &
-               zu10m,zv10m,pphis, &
-               zphi,paprs(:,1:klev),pplay,zxtsol,t_seri, &
-               qx(:,:,ivap),zx_rh,cldfra,rnebcon,flwc,fiwc, &
-               prfl(:,1:klev),psfl(:,1:klev), &
-               pmflxr(:,1:klev),pmflxs(:,1:klev), &
-               mr_ozone,cldtau, cldemi)
-       ENDIF
-#endif
-
-    ENDIF  !ok_cosp
-
-
-! Marine
-
-  IF (ok_airs) then
-
-  IF (itap.eq.1.or.MOD(itap,NINT(freq_airs/phys_tstep)).EQ.0) THEN
-     write(*,*) 'je vais appeler simu_airs, ok_airs, freq_airs=', ok_airs, freq_airs
-     CALL simu_airs(itap,rneb, t_seri, cldemi, fiwc, ref_ice, pphi, pplay, paprs,&
-        & map_prop_hc,map_prop_hist,&
-        & map_emis_hc,map_iwp_hc,map_deltaz_hc,map_pcld_hc,map_tcld_hc,&
-        & map_emis_Cb,map_pcld_Cb,map_tcld_Cb,&
-        & map_emis_ThCi,map_pcld_ThCi,map_tcld_ThCi,&
-        & map_emis_Anv,map_pcld_Anv,map_tcld_Anv,&
-        & map_emis_hist,map_iwp_hist,map_deltaz_hist,map_rad_hist,&
-        & map_ntot,map_hc,map_hist,&
-        & map_Cb,map_ThCi,map_Anv,&
-        & alt_tropo )
-  ENDIF
-
-  ENDIF  ! ok_airs
-
-
-    ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    !AA
-    !AA Installation de l'interface online-offline pour traceurs
-    !AA
-    !====================================================================
-    !   Calcul  des tendances traceurs
-    !====================================================================
-    !
-
-    IF (type_trac == 'repr') THEN
-!MM pas d'impact, car on recupere q_seri,tr_seri,t_seri via phys_local_var_mod
-!MM                               dans Reprobus
-       sh_in(:,:) = q_seri(:,:)
-#ifdef REPROBUS
-       d_q_rep(:,:) = 0.
-       d_ql_rep(:,:) = 0.
-       d_qi_rep(:,:) = 0.
-#endif
-    ELSE
-       sh_in(:,:) = qx(:,:,ivap)
-       IF (nqo >= 3) THEN 
-          ch_in(:,:) = qx(:,:,iliq) + qx(:,:,isol)
-       ELSE 
-          ch_in(:,:) = qx(:,:,iliq)
-       ENDIF
-    ENDIF
-
-#ifdef CPP_Dust
-    !  Avec SPLA, iflag_phytrac est forcÃ© =1 
-    CALL       phytracr_spl ( debut,lafin , jD_cur,jH_cur,iflag_con,       &  ! I
-                      pdtphys,ftsol,                                   &  ! I
-                      t,q_seri,paprs,pplay,RHcl,                  &  ! I
-                      pmfu, pmfd, pen_u, pde_u, pen_d, pde_d,          &  ! I
-                      coefh(1:klon,1:klev,is_ave), cdragh, cdragm, u1, v1,                 &  ! I
-                      u_seri, v_seri, latitude_deg, longitude_deg,  &
-                      pphis,pctsrf,pmflxr,pmflxs,prfl,psfl,            &  ! I
-                      da,phi,phi2,d1a,dam,mp,ep,sigd,sij,clw,elij,     &  ! I
-                      epmlmMm,eplaMm,upwd,dnwd,itop_con,ibas_con,      &  ! I
-                      ev,wdtrainA,  wdtrainM,wght_cvfd,              &  ! I
-                      fm_therm, entr_therm, rneb,                      &  ! I
-                      beta_prec_fisrt,beta_prec, & !I
-                      zu10m,zv10m,wstar,ale_bl,ale_wake,               &  ! I
-                      d_tr_dyn,tr_seri)
-
-#else
-    IF (iflag_phytrac == 1 ) THEN
-      CALL phytrac ( &
-         itap,     days_elapsed+1,    jH_cur,   debut, &
-         lafin,    phys_tstep,     u, v,     t, &
-         paprs,    pplay,     pmfu,     pmfd, &
-         pen_u,    pde_u,     pen_d,    pde_d, &
-         cdragh,   coefh(1:klon,1:klev,is_ave),   fm_therm, entr_therm, &
-         u1,       v1,        ftsol,    pctsrf, &
-         zustar,   zu10m,     zv10m, &
-         wstar(:,is_ave),    ale_bl,         ale_wake, &
-         latitude_deg, longitude_deg, &
-         frac_impa,frac_nucl, beta_prec_fisrt,beta_prec, &
-         presnivs, pphis,     pphi,     albsol1, &
-         sh_in,   ch_in,    rhcl,      cldfra,   rneb, &
-         diafra,   radocond,    itop_con, ibas_con, &
-         pmflxr,   pmflxs,    prfl,     psfl, &
-         da,       phi,       mp,       upwd, &
-         phi2,     d1a,       dam,      sij, wght_cvfd, &        !<<RomP+RL
-         wdtrainA, wdtrainM,  sigd,     clw,elij, &   !<<RomP
-         ev,       ep,        epmlmMm,  eplaMm, &     !<<RomP
-         dnwd,     aerosol_couple,      flxmass_w, &
-         tau_aero, piz_aero,  cg_aero,  ccm, &
-         rfname, &
-         d_tr_dyn, &                                 !<<RomP
-         tr_seri, init_source)
-#ifdef REPROBUS
-
-
-          print*,'avt add phys rep',abortphy
-
-     CALL add_phys_tend &
-            (du0,dv0,dt0,d_q_rep,d_ql_rep,d_qi_rep,paprs,&
-             'rep',abortphy,flag_inhib_tend,itap,0)
-        IF (abortphy==1) Print*,'ERROR ABORT REP'
-
-          print*,'apr add phys rep',abortphy
-
-#endif
-    ENDIF    ! (iflag_phytrac=1)
-
-#endif
-    !ENDIF    ! (iflag_phytrac=1)
-
-    IF (offline) THEN
-
-       IF (prt_level.ge.9) &
-            print*,'Attention on met a 0 les thermiques pour phystoke'
-       CALL phystokenc ( &
-            nlon,klev,pdtphys,longitude_deg,latitude_deg, &
-            t,pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, &
-            fm_therm,entr_therm, &
-            cdragh,coefh(1:klon,1:klev,is_ave),u1,v1,ftsol,pctsrf, &
-            frac_impa, frac_nucl, &
-            pphis,cell_area,phys_tstep,itap, &
-            qx(:,:,ivap),da,phi,mp,upwd,dnwd)
-
-
-    ENDIF
-
-    !
-    ! Calculer le transport de l'eau et de l'energie (diagnostique)
-    !
-    CALL transp (paprs,zxtsol, t_seri, q_seri, ql_seri, qs_seri, u_seri, v_seri, zphi, &
-                 ue, ve, uq, vq, uwat, vwat)
-    !
-    !IM global posePB BEG
-    IF(1.EQ.0) THEN
-       !
-       CALL transp_lay (paprs,zxtsol, t_seri, q_seri, u_seri, v_seri, zphi, &
-            ve_lay, vq_lay, ue_lay, uq_lay)
-       !
-    ENDIF !(1.EQ.0) THEN
-    !IM global posePB END
-    !
-    ! Accumuler les variables a stocker dans les fichiers histoire:
-    !
-
-    !================================================================
-    ! Conversion of kinetic and potential energy into heat, for
-    ! parameterisation of subgrid-scale motions
-    !================================================================
-
-    d_t_ec(:,:)=0.
-    forall (k=1: nbp_lev) exner(:, k) = (pplay(:, k)/paprs(:,1))**RKAPPA
-    CALL ener_conserv(klon,klev,pdtphys,u,v,t,qx,ivap,iliq,isol, &
-         u_seri,v_seri,t_seri,q_seri,ql_seri,qs_seri,pbl_tke(:,:,is_ave)-tke0(:,:), &
-         zmasse,exner,d_t_ec)
-    t_seri(:,:)=t_seri(:,:)+d_t_ec(:,:)
-
-    !=======================================================================
-    !   SORTIES
-    !=======================================================================
-    !
-    !IM initialisation + calculs divers diag AMIP2
-    !
-    include "calcul_divers.h"
-    !
-    !IM Interpolation sur les niveaux de pression du NMC
-    !   -------------------------------------------------
-    !
-    include "calcul_STDlev.h"
-    !
-    ! slp sea level pressure derived from Arpege-IFS : CALL ctstar + CALL pppmer
-    CALL diag_slp(klon,t_seri,paprs,pplay,pphis,ptstar,pt0,slp)
-    !
-    !cc prw  = eau precipitable
-    !   prlw = colonne eau liquide 
-    !   prlw = colonne eau solide
-    prw(:) = 0.
-    prlw(:) = 0.
-    prsw(:) = 0.
-    DO k = 1, klev
-       prw(:)  = prw(:)  + q_seri(:,k)*zmasse(:,k)
-       prlw(:) = prlw(:) + ql_seri(:,k)*zmasse(:,k)
-       prsw(:) = prsw(:) + qs_seri(:,k)*zmasse(:,k)
-    ENDDO
-    !
-    IF (ANY(type_trac == ['inca','inco'])) THEN
-#ifdef INCA
-       CALL VTe(VTphysiq)
-       CALL VTb(VTinca)
-
-       CALL chemhook_end ( &
-            phys_tstep, &
-            pplay, &
-            t_seri, &
-            tr_seri(:,:,1+nqCO2:nbtr), &
-            nbtr, &
-            paprs, &
-            q_seri, &
-            cell_area, &
-            pphi, &
-            pphis, &
-            zx_rh, &
-            aps, bps, ap, bp, lafin)
-
-       CALL VTe(VTinca)
-       CALL VTb(VTphysiq)
-#endif
-    ENDIF
-
-    IF (type_trac == 'repr') THEN
-#ifdef REPROBUS
-        CALL coord_hyb_rep(paprs, pplay, aps, bps, ap, bp, cell_area)
-#endif
-    ENDIF
-
-    !
-    ! Convertir les incrementations en tendances
-    !
-    IF (prt_level .GE.10) THEN
-       print *,'Convertir les incrementations en tendances '
-    ENDIF
-    !
-    IF (mydebug) THEN
-       CALL writefield_phy('u_seri',u_seri,nbp_lev)
-       CALL writefield_phy('v_seri',v_seri,nbp_lev)
-       CALL writefield_phy('t_seri',t_seri,nbp_lev)
-       CALL writefield_phy('q_seri',q_seri,nbp_lev)
-    ENDIF
-
-    DO k = 1, klev
-       DO i = 1, klon
-          d_u(i,k) = ( u_seri(i,k) - u(i,k) ) / phys_tstep
-          d_v(i,k) = ( v_seri(i,k) - v(i,k) ) / phys_tstep
-          d_t(i,k) = ( t_seri(i,k)-t(i,k) ) / phys_tstep
-          d_qx(i,k,ivap) = ( q_seri(i,k) - qx(i,k,ivap) ) / phys_tstep
-          d_qx(i,k,iliq) = ( ql_seri(i,k) - qx(i,k,iliq) ) / phys_tstep
-          !CR: on ajoute le contenu en glace
-          IF (nqo >= 3) THEN
-             d_qx(i,k,isol) = ( qs_seri(i,k) - qx(i,k,isol) ) / phys_tstep
-          ENDIF
-          !--ice_sursat: nqo=4, on ajoute rneb
-          IF (nqo == 4) THEN
-             d_qx(i,k,irneb) = ( rneb_seri(i,k) - qx(i,k,irneb) ) / phys_tstep
-          ENDIF
-       ENDDO
-    ENDDO
-    !
-    ! DC: All iterations are cycled if nqtot==nqo, so no nqtot>nqo condition required
-    itr = 0
-    DO iq = 1, nqtot
-       IF(.NOT.tracers(iq)%isInPhysics) CYCLE
-       itr = itr+1
-       DO  k = 1, klev
-          DO  i = 1, klon
-             d_qx(i,k,iq) = ( tr_seri(i,k,itr) - qx(i,k,iq) ) / phys_tstep
-          ENDDO
-       ENDDO
-    ENDDO
-    !
-    !IM rajout diagnostiques bilan KP pour analyse MJO par Jun-Ichi Yano
-    !IM global posePB      include "write_bilKP_ins.h"
-    !IM global posePB      include "write_bilKP_ave.h"
-    !
-
-    !--OB mass fixer 
-    !--profile is corrected to force mass conservation of water
-    IF (mass_fixer) THEN
-    qql2(:)=0.0
-    DO k = 1, klev
-      qql2(:)=qql2(:)+(q_seri(:,k)+ql_seri(:,k)+qs_seri(:,k))*zmasse(:,k)
-    ENDDO
-    DO i = 1, klon
-      !--compute ratio of what q+ql should be with conservation to what it is
-      corrqql=(qql1(i)+(evap(i)-rain_fall(i)-snow_fall(i))*pdtphys)/qql2(i)
-      DO k = 1, klev
-        q_seri(i,k) =q_seri(i,k)*corrqql
-        ql_seri(i,k)=ql_seri(i,k)*corrqql
-      ENDDO
-    ENDDO
-    ENDIF
-    !--fin mass fixer
-
-    ! Sauvegarder les valeurs de t et q a la fin de la physique:
-    !
-    u_ancien(:,:)  = u_seri(:,:)
-    v_ancien(:,:)  = v_seri(:,:)
-    t_ancien(:,:)  = t_seri(:,:)
-    q_ancien(:,:)  = q_seri(:,:)
-    ql_ancien(:,:) = ql_seri(:,:)
-    qs_ancien(:,:) = qs_seri(:,:)
-    rneb_ancien(:,:) = rneb_seri(:,:)
-    CALL water_int(klon,klev,q_ancien,zmasse,prw_ancien)
-    CALL water_int(klon,klev,ql_ancien,zmasse,prlw_ancien)
-    CALL water_int(klon,klev,qs_ancien,zmasse,prsw_ancien)
-    ! !! RomP >>>
-    IF (nqtot > nqo) tr_ancien(:,:,:) = tr_seri(:,:,:)
-    ! !! RomP <<<
-    !==========================================================================
-    ! Sorties des tendances pour un point particulier
-    ! a utiliser en 1D, avec igout=1 ou en 3D sur un point particulier
-    ! pour le debug
-    ! La valeur de igout est attribuee plus haut dans le programme
-    !==========================================================================
-
-    IF (prt_level.ge.1) THEN
-       write(lunout,*) 'FIN DE PHYSIQ !!!!!!!!!!!!!!!!!!!!'
-       write(lunout,*) &
-            'nlon,klev,nqtot,debut,lafin,jD_cur, jH_cur, pdtphys pct tlos'
-       write(lunout,*) &
-            nlon,klev,nqtot,debut,lafin, jD_cur, jH_cur ,pdtphys, &
-            pctsrf(igout,is_ter), pctsrf(igout,is_lic),pctsrf(igout,is_oce), &
-            pctsrf(igout,is_sic)
-       write(lunout,*) 'd_t_dyn,d_t_con,d_t_lsc,d_t_ajsb,d_t_ajs,d_t_eva'
-       DO k=1,klev
-          write(lunout,*) d_t_dyn(igout,k),d_t_con(igout,k), &
-               d_t_lsc(igout,k),d_t_ajsb(igout,k),d_t_ajs(igout,k), &
-               d_t_eva(igout,k)
-       ENDDO
-       write(lunout,*) 'cool,heat'
-       DO k=1,klev
-          write(lunout,*) cool(igout,k),heat(igout,k)
-       ENDDO
-
-       !jyg<     (En attendant de statuer sur le sort de d_t_oli)
-       !jyg!     write(lunout,*) 'd_t_oli,d_t_vdf,d_t_oro,d_t_lif,d_t_ec'
-       !jyg!     do k=1,klev
-       !jyg!        write(lunout,*) d_t_oli(igout,k),d_t_vdf(igout,k), &
-       !jyg!             d_t_oro(igout,k),d_t_lif(igout,k),d_t_ec(igout,k)
-       !jyg!     enddo
-       write(lunout,*) 'd_t_vdf,d_t_oro,d_t_lif,d_t_ec'
-       DO k=1,klev
-          write(lunout,*) d_t_vdf(igout,k), &
-               d_t_oro(igout,k),d_t_lif(igout,k),d_t_ec(igout,k)
-       ENDDO
-       !>jyg
-
-       write(lunout,*) 'd_ps ',d_ps(igout)
-       write(lunout,*) 'd_u, d_v, d_t, d_qx1, d_qx2 '
-       DO k=1,klev
-          write(lunout,*) d_u(igout,k),d_v(igout,k),d_t(igout,k), &
-               d_qx(igout,k,1),d_qx(igout,k,2)
-       ENDDO
-    ENDIF
-
-    !============================================================
-    !   Calcul de la temperature potentielle
-    !============================================================
-    DO k = 1, klev
-       DO i = 1, klon
-          !JYG/IM theta en debut du pas de temps
-          !JYG/IM       theta(i,k)=t(i,k)*(100000./pplay(i,k))**(RD/RCPD)
-          !JYG/IM theta en fin de pas de temps de physique
-          theta(i,k)=t_seri(i,k)*(100000./pplay(i,k))**(RD/RCPD)
-          ! thetal: 2 lignes suivantes a decommenter si vous avez les fichiers
-          !     MPL 20130625
-          ! fth_fonctions.F90 et parkind1.F90
-          ! sinon thetal=theta
-          !       thetal(i,k)=fth_thetal(pplay(i,k),t_seri(i,k),q_seri(i,k),
-          !    :         ql_seri(i,k))
-          thetal(i,k)=theta(i,k)
-       ENDDO
-    ENDDO
-    !
-
-    ! 22.03.04 BEG
-    !=============================================================
-    !   Ecriture des sorties
-    !=============================================================
-#ifdef CPP_IOIPSL
-
-    ! Recupere des varibles calcule dans differents modules
-    ! pour ecriture dans histxxx.nc 
-
-    ! Get some variables from module fonte_neige_mod
-    CALL fonte_neige_get_vars(pctsrf,  &
-         zxfqcalving, zxfqfonte, zxffonte, zxrunofflic)
-
-
-    !=============================================================
-    ! Separation entre thermiques et non thermiques dans les sorties
-    ! de fisrtilp
-    !=============================================================
-
-    IF (iflag_thermals>=1) THEN
-       d_t_lscth=0.
-       d_t_lscst=0.
-       d_q_lscth=0.
-       d_q_lscst=0.
-       DO k=1,klev
-          DO i=1,klon
-             IF (ptconvth(i,k)) THEN
-                d_t_lscth(i,k)=d_t_eva(i,k)+d_t_lsc(i,k)
-                d_q_lscth(i,k)=d_q_eva(i,k)+d_q_lsc(i,k)
-             ELSE
-                d_t_lscst(i,k)=d_t_eva(i,k)+d_t_lsc(i,k)
-                d_q_lscst(i,k)=d_q_eva(i,k)+d_q_lsc(i,k)
-             ENDIF
-          ENDDO
-       ENDDO
-
-       DO i=1,klon
-          plul_st(i)=prfl(i,lmax_th(i)+1)+psfl(i,lmax_th(i)+1)
-          plul_th(i)=prfl(i,1)+psfl(i,1)
-       ENDDO
-    ENDIF
-
-    !On effectue les sorties:
-
-#ifdef CPP_Dust
-  CALL phys_output_write_spl(itap, pdtphys, paprs, pphis,  &
-       pplay, lmax_th, aerosol_couple,                 &
-       ok_ade, ok_aie, ivap, ok_sync,                  &
-       ptconv, read_climoz, clevSTD,                   &
-       ptconvth, d_t, qx, d_qx, d_tr_dyn, zmasse,      &
-       flag_aerosol, flag_aerosol_strat, ok_cdnc)
-#else
-    CALL phys_output_write(itap, pdtphys, paprs, pphis,  &
-         pplay, lmax_th, aerosol_couple,                 &
-         ok_ade, ok_aie, ok_volcan, ivap, iliq, isol,    & 
-         ok_sync, ptconv, read_climoz, clevSTD,          &
-         ptconvth, d_u, d_t, qx, d_qx, zmasse,           &
-         flag_aerosol, flag_aerosol_strat, ok_cdnc)
-#endif
-
-#ifndef CPP_XIOS
-    CALL write_paramLMDZ_phy(itap,nid_ctesGCM,ok_sync)
-#endif
-
-#endif
-
-    !====================================================================
-    ! Arret du modele apres hgardfou en cas de detection d'un
-    ! plantage par hgardfou
-    !====================================================================
-
-    IF (abortphy==1) THEN
-       abort_message ='Plantage hgardfou'
-       CALL abort_physic (modname,abort_message,1)
-    ENDIF
-
-    ! 22.03.04 END
-    !
-    !====================================================================
-    ! Si c'est la fin, il faut conserver l'etat de redemarrage
-    !====================================================================
-    !
-
-    ! Disabling calls to the prt_alerte function
-    alert_first_call = .FALSE.
-    
-    IF (lafin) THEN
-       itau_phy = itau_phy + itap
-       CALL phyredem ("restartphy.nc")
-       !         open(97,form="unformatted",file="finbin")
-       !         write(97) u_seri,v_seri,t_seri,q_seri
-       !         close(97)
-      
-       IF (is_omp_master) THEN
-       
-         IF (read_climoz >= 1) THEN
-           IF (is_mpi_root) CALL nf95_close(ncid_climoz)
-            DEALLOCATE(press_edg_climoz)
-            DEALLOCATE(press_cen_climoz)
-         ENDIF
-       
-       ENDIF
-#ifdef CPP_XIOS
-       IF (is_omp_master) CALL xios_context_finalize
-
-#ifdef INCA
-       if (type_trac == 'inca') then 
-          IF (is_omp_master .and. grid_type==unstructured) THEN 
-             CALL finalize_inca
-          ENDIF
-       endif
-#endif
-
-#endif
-       WRITE(lunout,*) ' physiq fin, nombre de steps ou cvpas = 1 : ', Ncvpaseq1
-    ENDIF
-
-    !      first=.false.
-
-  END SUBROUTINE physiq
-
-END MODULE physiq_mod
Index: CONFIG/UNIFORM/v7/IPSLCM7ISO/SOURCES/LMDZ/phylmd/readaerosol_mod.F90
===================================================================
--- CONFIG/UNIFORM/v7/IPSLCM7ISO/SOURCES/LMDZ/phylmd/readaerosol_mod.F90	(revision 6745)
+++ 	(revision )
@@ -1,740 +1,0 @@
-! $Id: readaerosol.F90 3436 2019-01-22 16:26:21Z emillour $
-!
-MODULE readaerosol_mod
-
-  REAL, SAVE :: not_valid=-333.
-  
-  INTEGER, SAVE :: nbp_lon_src
-!$OMP THREADPRIVATE(nbp_lon_src)  
-  INTEGER, SAVE :: nbp_lat_src
-!$OMP THREADPRIVATE(nbp_lat_src)  
-  REAL, ALLOCATABLE, SAVE    :: psurf_interp(:,:)
-
-CONTAINS
-
-SUBROUTINE readaerosol(name_aero, type, filename, iyr_in, klev_src, pt_ap, pt_b, pt_out, psurf, load)
-
-!****************************************************************************************
-! This routine will read the aersosol from file. 
-!
-! Read a year data with get_aero_fromfile depending on aer_type : 
-! - actuel   : read year 1980
-! - preind   : read natural data
-! - scenario : read one or two years and do eventually linare time interpolation
-!
-! Return pointer, pt_out, to the year read or result from interpolation
-!****************************************************************************************
-  USE dimphy
-  USE print_control_mod, ONLY: lunout
-
-  IMPLICIT NONE
-
-  ! Input arguments
-  CHARACTER(len=7), INTENT(IN) :: name_aero
-  CHARACTER(len=*), INTENT(IN) :: type  ! actuel, annuel, scenario or preind
-  CHARACTER(len=8), INTENT(IN) :: filename
-  INTEGER, INTENT(IN)          :: iyr_in
-
-  ! Output
-  INTEGER, INTENT(OUT)            :: klev_src
-  REAL, POINTER, DIMENSION(:)     :: pt_ap        ! Pointer for describing the vertical levels      
-  REAL, POINTER, DIMENSION(:)     :: pt_b         ! Pointer for describing the vertical levels      
-  REAL, POINTER, DIMENSION(:,:,:) :: pt_out       ! The massvar distributions, DIMENSION(klon, klev_src, 12)
-  REAL, DIMENSION(klon,12), INTENT(OUT) :: psurf  ! Surface pression for 12 months
-  REAL, DIMENSION(klon,12), INTENT(OUT) :: load   ! Aerosol mass load in each column for 12 months
-
-  ! Local variables
-  CHARACTER(len=4)                :: cyear
-  REAL, POINTER, DIMENSION(:,:,:) :: pt_2
-  REAL, DIMENSION(klon,12)        :: psurf2, load2
-  INTEGER                         :: iyr1, iyr2, klev_src2
-  INTEGER                         :: it, k, i
-  LOGICAL, PARAMETER              :: lonlyone=.FALSE.
-
-!****************************************************************************************
-! Read data depending on aer_type
-!
-!****************************************************************************************
-
-  IF (type == 'actuel') THEN
-! Read and return data for year 1980
-!****************************************************************************************
-     cyear='1980'
-     ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month 
-     ! pt_out has dimensions (klon, klev_src, 12)
-     CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, pt_out, psurf, load)
-     
-
-  ELSE IF (type == 'preind') THEN
-! Read and return data from file with suffix .nat
-!****************************************************************************************     
-     cyear='.nat'
-     ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month 
-     ! pt_out has dimensions (klon, klev_src, 12)
-     CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, pt_out, psurf, load)
-     
-  ELSE IF (type == 'annuel') THEN
-! Read and return data from scenario annual files
-!****************************************************************************************     
-     WRITE(cyear,'(I4)') iyr_in
-     WRITE(lunout,*) 'get_aero 3 iyr_in=', iyr_in,'   ',cyear
-     ! get_aero_fromfile returns pt_out allocated and initialized with data for nbr_tsteps month 
-     ! pt_out has dimensions (klon, klev_src, 12)
-     CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, pt_out, psurf, load)
-     
-  ELSE IF (type == 'scenario') THEN
-! Read data depending on actual year and interpolate if necessary
-!****************************************************************************************
-     IF (iyr_in .LT. 1850) THEN
-        cyear='.nat'
-        WRITE(lunout,*) 'get_aero 1 iyr_in=', iyr_in,'   ',cyear
-        ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month 
-        ! pt_out has dimensions (klon, klev_src, 12)
-        CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, pt_out, psurf, load)
-        
-     ELSE IF (iyr_in .GE. 2100) THEN
-        cyear='2100'
-        WRITE(lunout,*) 'get_aero 2 iyr_in=', iyr_in,'   ',cyear
-        ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month 
-        ! pt_out has dimensions (klon, klev_src, 12)
-        CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, pt_out, psurf, load)
-        
-     ELSE
-        ! Read data from 2 decades and interpolate to actual year
-        ! a) from actual 10-yr-period
-        IF (iyr_in.LT.1900) THEN
-           iyr1 = 1850
-           iyr2 = 1900
-        ELSE IF (iyr_in.GE.1900.AND.iyr_in.LT.1920) THEN
-           iyr1 = 1900
-           iyr2 = 1920
-        ELSE 
-           iyr1 = INT(iyr_in/10)*10
-           iyr2 = INT(1+iyr_in/10)*10
-        ENDIF
-        
-        WRITE(cyear,'(I4)') iyr1
-        WRITE(lunout,*) 'get_aero 3 iyr_in=', iyr_in,'   ',cyear
-        ! get_aero_fromfile returns pt_out allocated and initialized with data for 12 month 
-        ! pt_out has dimensions (klon, klev_src, 12)
-        CALL get_aero_fromfile(name_aero, cyear, filename, klev_src, pt_ap, pt_b, pt_out, psurf, load)
-        
-        ! If to read two decades:
-        IF (.NOT.lonlyone) THEN 
-           
-           ! b) from the next following one
-           WRITE(cyear,'(I4)') iyr2
-           WRITE(lunout,*) 'get_aero 4 iyr_in=', iyr_in,'   ',cyear
-           
-           NULLIFY(pt_2)
-           ! get_aero_fromfile returns pt_2 allocated and initialized with data for 12 month 
-           ! pt_2 has dimensions (klon, klev_src, 12)
-           CALL get_aero_fromfile(name_aero, cyear, filename, klev_src2, pt_ap, pt_b, pt_2, psurf2, load2)
-           ! Test for same number of vertical levels
-           IF (klev_src /= klev_src2) THEN
-              WRITE(lunout,*) 'Two aerosols files with different number of vertical levels is not allowded'
-              CALL abort_physic('readaersosol','Error in number of vertical levels',1)
-           END IF
-           
-           ! Linare interpolate to the actual year:
-           DO it=1,12
-              DO k=1,klev_src
-                 DO i = 1, klon
-                    pt_out(i,k,it) = &
-                         pt_out(i,k,it) - REAL(iyr_in-iyr1)/REAL(iyr2-iyr1) * &
-                         (pt_out(i,k,it) - pt_2(i,k,it))
-                 END DO
-              END DO
-
-              DO i = 1, klon
-                 psurf(i,it) = &
-                      psurf(i,it) - REAL(iyr_in-iyr1)/REAL(iyr2-iyr1) * &
-                      (psurf(i,it) - psurf2(i,it))
-
-                 load(i,it) = &
-                      load(i,it) - REAL(iyr_in-iyr1)/REAL(iyr2-iyr1) * &
-                      (load(i,it) - load2(i,it))
-              END DO
-           END DO
-
-           ! Deallocate pt_2 no more needed
-           DEALLOCATE(pt_2)
-           
-        END IF ! lonlyone
-     END IF ! iyr_in .LT. 1850
-
-  ELSE
-     WRITE(lunout,*)'This option is not implemented : aer_type = ', type,' name_aero=',name_aero
-     CALL abort_physic('readaerosol','Error : aer_type parameter not accepted',1)
-  END IF ! type
-
-
-END SUBROUTINE readaerosol
-
-
-  SUBROUTINE init_aero_fromfile(flag_aerosol, aerosol_couple)
-  USE netcdf
-  USE mod_phys_lmdz_para
-  USE mod_grid_phy_lmdz, ONLY: grid_type, unstructured
-#ifdef CPP_XIOS
-  USE xios
-#endif
-  IMPLICIT NONE
-  INTEGER, INTENT(IN) :: flag_aerosol
-  LOGICAL, INTENT(IN) :: aerosol_couple
-#ifdef CPP_XIOS
-  REAL,ALLOCATABLE :: lat_src(:)
-  REAL,ALLOCATABLE :: lon_src(:)
-  CHARACTER(LEN=*),PARAMETER :: file_aerosol='aerosols.nat.nc'
-  CHARACTER(LEN=*),PARAMETER :: file_so4='so4.nat.nc'
-  INTEGER :: klev_src
-  INTEGER :: ierr ,ncid, dimID, varid
-  REAL :: null_array(0)
-
-  IF (flag_aerosol>0 .AND. grid_type==unstructured .AND. (.not.aerosol_couple) ) THEN
-  
-    IF (is_omp_root) THEN
-  
-      IF (is_mpi_root) THEN
-    
-        IF (nf90_open(TRIM(file_aerosol), NF90_NOWRITE, ncid) /= NF90_NOERR) THEN
-          CALL check_err( nf90_open(TRIM(file_so4), NF90_NOWRITE, ncid), "pb open "//trim(file_so4) )
-        ENDIF
-
-        ! Read and test longitudes
-        CALL check_err( nf90_inq_dimid(ncid, "lon", dimID),"pb inq dim lon") 
-        CALL check_err( nf90_inquire_dimension(ncid, dimID, len = nbp_lon_src),"pb inq dim lon")
-        CALL check_err( nf90_inq_varid(ncid, 'lon', varid),"pb inq lon" )
-        ALLOCATE(lon_src(nbp_lon_src))
-        CALL check_err( nf90_get_var(ncid, varid, lon_src(:)),"pb get lon" )
-
-        ! Read and test latitudes
-        CALL check_err( nf90_inq_dimid(ncid, "lat", dimID),"pb inq dim lat") 
-        CALL check_err( nf90_inquire_dimension(ncid, dimID, len = nbp_lat_src),"pb inq dim lat")
-        CALL check_err( nf90_inq_varid(ncid, 'lat', varid),"pb inq lat" )
-        ALLOCATE(lat_src(nbp_lat_src))
-        CALL check_err( nf90_get_var(ncid, varid, lat_src(:)),"pb get lat" )
-        IF (nf90_inq_dimid(ncid, 'lev', dimid) /= NF90_NOERR) THEN
-          IF (nf90_inq_dimid(ncid, 'presnivs', dimid)/= NF90_NOERR) THEN
-             CALL check_err(nf90_inq_dimid(ncid, 'PRESNIVS', dimid),'dimension lev,PRESNIVS or presnivs not in file')
-          ENDIF
-        ENDIF
-        CALL check_err( nf90_inquire_dimension(ncid, dimid, len = klev_src),"pb inq dim for PRESNIVS or lev" )
-        CALL check_err( nf90_close(ncid),"pb in close" )   
-      ENDIF
-
-      CALL bcast_mpi(nbp_lat_src)
-      CALL bcast_mpi(nbp_lon_src)
-      CALL bcast_mpi(klev_src)
-
-      IF (is_mpi_root ) THEN
-        CALL xios_set_domain_attr("domain_aerosol",nj_glo=nbp_lat_src, nj=nbp_lat_src, jbegin=0, latvalue_1d=lat_src)
-        CALL xios_set_domain_attr("domain_aerosol",ni_glo=nbp_lon_src, ni=nbp_lon_src, ibegin=0, lonvalue_1d=lon_src)
-      ELSE
-        CALL xios_set_domain_attr("domain_aerosol",nj_glo=nbp_lat_src, nj=0, jbegin=0, latvalue_1d=null_array )
-        CALL xios_set_domain_attr("domain_aerosol",ni_glo=nbp_lon_src, ni=0, ibegin=0, lonvalue_1d=null_array)
-      ENDIF
-      CALL xios_set_axis_attr("axis_aerosol",n_glo=klev_src)
-      CALL xios_set_fieldgroup_attr("aerosols", enabled=.TRUE.)
-  
-    ENDIF
-    
-  ENDIF    
-#endif 
-  END SUBROUTINE init_aero_fromfile
-
-
-    
-
-  SUBROUTINE get_aero_fromfile(varname, cyr, filename, klev_src, pt_ap, pt_b, pt_year, psurf_out, load_out)
-!****************************************************************************************
-! Read 12 month aerosol from file and distribute to local process on physical grid. 
-! Vertical levels, klev_src, may differ from model levels if new file format.
-!
-! For mpi_root and master thread :
-! 1) Open file 
-! 2) Find vertical dimension klev_src
-! 3) Read field month by month
-! 4) Close file  
-! 5) Transform the global field from 2D(nbp_lon,nbp_lat) to 1D(klon_glo)
-!     - Also the levels and the latitudes have to be inversed
-!
-! For all processes and threads :
-! 6) Scatter global field(klon_glo) to local process domain(klon)
-! 7) Test for negative values
-!****************************************************************************************
-
-    USE netcdf
-    USE dimphy
-    USE mod_grid_phy_lmdz, ONLY: nbp_lon_=>nbp_lon, nbp_lat_=>nbp_lat, klon_glo, &
-                                 grid2Dto1D_glo, grid_type, unstructured
-    USE mod_phys_lmdz_para
-    USE iophy, ONLY : io_lon, io_lat
-    USE print_control_mod, ONLY: lunout
-#ifdef CPP_XIOS
-    USE xios
-#endif
-    IMPLICIT NONE
-      
-! Input argumets
-    CHARACTER(len=7), INTENT(IN)          :: varname
-    CHARACTER(len=4), INTENT(IN)          :: cyr
-    CHARACTER(len=8), INTENT(IN)          :: filename
-
-! Output arguments
-    INTEGER, INTENT(OUT)                  :: klev_src     ! Number of vertical levels in file
-    REAL, POINTER, DIMENSION(:)           :: pt_ap        ! Pointer for describing the vertical levels      
-    REAL, POINTER, DIMENSION(:)           :: pt_b         ! Pointer for describing the vertical levels      
-    REAL, POINTER, DIMENSION(:,:,:)       :: pt_year      ! Pointer-variabale from file, 12 month, grid : klon,klev_src
-    REAL, POINTER, DIMENSION(:,:,:)       :: pt_year_mpi  ! Pointer-variabale from file, 12 month, grid : klon,klev_src
-    REAL, DIMENSION(klon,12), INTENT(OUT) :: psurf_out    ! Surface pression for 12 months
-    REAL, DIMENSION(klon_mpi,12)          :: psurf_out_mpi    ! Surface pression for 12 months
-    REAL, DIMENSION(klon,12), INTENT(OUT) :: load_out     ! Aerosol mass load in each column
-    REAL, DIMENSION(klon_mpi,12)          :: load_out_mpi     ! Aerosol mass load in each column
-    INTEGER                               :: nbr_tsteps   ! number of month in file read
-
-! Local variables
-    CHARACTER(len=30)     :: fname
-    CHARACTER(len=30)     :: cvar
-    INTEGER               :: ncid, dimid, varid
-    INTEGER               :: imth, i, j, k, ierr
-    REAL                  :: npole, spole
-    REAL, ALLOCATABLE, DIMENSION(:,:,:)   :: varmth
-    REAL, ALLOCATABLE, DIMENSION(:,:,:,:) :: varyear       ! Global variable read from file, 12 month
-    REAL, ALLOCATABLE, DIMENSION(:,:,:)   :: varyear_glo1D !(klon_glo, klev_src, 12)
-    REAL, ALLOCATABLE, DIMENSION(:)       :: varktmp
-
-    REAL,  ALLOCATABLE                    :: psurf_glo2D(:,:,:)   ! Surface pression for 12 months on dynamics global grid
-    REAL, DIMENSION(klon_glo,12)          :: psurf_glo1D   ! -"- on physical global grid
-    REAL,  ALLOCATABLE                    :: load_glo2D(:,:,:)    ! Load for 12 months on dynamics global grid
-    REAL, DIMENSION(klon_glo,12)          :: load_glo1D    ! -"- on physical global grid
-    REAL, ALLOCATABLE, DIMENSION(:,:)     :: vartmp
-    REAL, ALLOCATABLE,DIMENSION(:)        :: lon_src              ! longitudes in file
-    REAL, ALLOCATABLE,DIMENSION(:)        :: lat_src, lat_src_inv ! latitudes in file
-    LOGICAL                               :: new_file             ! true if new file format detected
-    LOGICAL                               :: invert_lat           ! true if the field has to be inverted for latitudes
-    INTEGER                               :: nbp_lon, nbp_lat
-    LOGICAL,SAVE                          :: first=.TRUE.
-!$OMP THREADPRIVATE(first)
-    
-    IF (grid_type==unstructured) THEN
-      nbp_lon=nbp_lon_src
-      nbp_lat=nbp_lat_src
-    ELSE
-      nbp_lon=nbp_lon_
-      nbp_lat=nbp_lat_
-    ENDIF
-    
-    IF (is_mpi_root) THEN
-    
-      ALLOCATE(psurf_glo2D(nbp_lon,nbp_lat,12))
-      ALLOCATE(load_glo2D(nbp_lon,nbp_lat,12))
-      ALLOCATE(vartmp(nbp_lon,nbp_lat))
-      ALLOCATE(lon_src(nbp_lon))
-      ALLOCATE(lat_src(nbp_lat))
-      ALLOCATE(lat_src_inv(nbp_lat))
-    ELSE
-      ALLOCATE(varyear(0,0,0,0))
-      ALLOCATE(psurf_glo2D(0,0,0))
-      ALLOCATE(load_glo2D(0,0,0))
-    ENDIF
-            
-    ! Deallocate pointers
-    IF (ASSOCIATED(pt_ap)) DEALLOCATE(pt_ap)
-    IF (ASSOCIATED(pt_b))  DEALLOCATE(pt_b)
-
-    IF (is_mpi_root .AND. is_omp_root) THEN
-
-! 1) Open file 
-!****************************************************************************************
-! Add suffix to filename
-       fname = trim(filename)//cyr//'.nc'
-  
-       WRITE(lunout,*) 'reading variable ',TRIM(varname),' in file ', TRIM(fname)
-       CALL check_err( nf90_open(TRIM(fname), NF90_NOWRITE, ncid), "pb open "//trim(fname) )
-
-
-       IF (grid_type/=unstructured) THEN
-
-! Test for equal longitudes and latitudes in file and model
-!****************************************************************************************
-       ! Read and test longitudes
-         CALL check_err( nf90_inq_varid(ncid, 'lon', varid),"pb inq lon" )
-         CALL check_err( nf90_get_var(ncid, varid, lon_src(:)),"pb get lon" )
-       
-         IF (maxval(ABS(lon_src - io_lon)) > 0.001) THEN
-            WRITE(lunout,*) 'Problem in longitudes read from file : ',TRIM(fname)
-            WRITE(lunout,*) 'longitudes in file ', TRIM(fname),' : ', lon_src
-            WRITE(lunout,*) 'longitudes in model :', io_lon
-          
-            CALL abort_physic('get_aero_fromfile', 'longitudes are not the same in file and model',1)
-         END IF
-
-         ! Read and test latitudes
-         CALL check_err( nf90_inq_varid(ncid, 'lat', varid),"pb inq lat" )
-         CALL check_err( nf90_get_var(ncid, varid, lat_src(:)),"pb get lat" )
-
-         ! Invert source latitudes
-         DO j = 1, nbp_lat
-            lat_src_inv(j) = lat_src(nbp_lat +1 -j)
-         END DO
-
-         IF (maxval(ABS(lat_src - io_lat)) < 0.001) THEN
-            ! Latitudes are the same
-            invert_lat=.FALSE.
-         ELSE IF (maxval(ABS(lat_src_inv - io_lat)) < 0.001) THEN
-            ! Inverted source latitudes correspond to model latitudes
-            WRITE(lunout,*) 'latitudes will be inverted for file : ',TRIM(fname)
-            invert_lat=.TRUE.
-         ELSE
-            WRITE(lunout,*) 'Problem in latitudes read from file : ',TRIM(fname)
-            WRITE(lunout,*) 'latitudes in file ', TRIM(fname),' : ', lat_src      
-            WRITE(lunout,*) 'latitudes in model :', io_lat
-            CALL abort_physic('get_aero_fromfile', 'latitudes do not correspond between file and model',1)
-         END IF
-       ENDIF
-
-! 2) Check if old or new file is avalabale.
-!    New type of file should contain the dimension 'lev'
-!    Old type of file should contain the dimension 'PRESNIVS'
-!****************************************************************************************
-       ierr = nf90_inq_dimid(ncid, 'lev', dimid) 
-       IF (ierr /= NF90_NOERR) THEN
-          ! Coordinate axe lev not found. Check for presnivs.
-          ierr = nf90_inq_dimid(ncid, 'presnivs', dimid) 
-          IF (ierr /= NF90_NOERR) THEN
-             ierr = nf90_inq_dimid(ncid, 'PRESNIVS', dimid)
-             IF (ierr /= NF90_NOERR) THEN
-                ! Dimension PRESNIVS not found either
-                CALL abort_physic('get_aero_fromfile', 'dimension lev,PRESNIVS or presnivs not in file',1)
-             ELSE 
-                ! Old file found
-                new_file=.FALSE.
-                WRITE(lunout,*) 'Vertical interpolation for ',TRIM(varname),' will not be done'
-             END IF
-          ELSE
-             ! New file found
-             new_file=.TRUE.
-             WRITE(lunout,*) 'Vertical interpolation for ',TRIM(varname),' will be done'
-          ENDIF
-       ELSE
-          ! New file found
-          new_file=.TRUE.
-          WRITE(lunout,*) 'Vertical interpolation for ',TRIM(varname),' will be done'
-       END IF
-       
-! 2) Find vertical dimension klev_src
-!****************************************************************************************
-       CALL check_err( nf90_inquire_dimension(ncid, dimid, len = klev_src),"pb inq dim for PRESNIVS or lev" )
-       
-     ! Allocate variables depending on the number of vertical levels
-       ALLOCATE(varmth(nbp_lon,nbp_lat, klev_src), varyear(nbp_lon,nbp_lat, klev_src, 12), stat=ierr)
-       IF (ierr /= 0) CALL abort_physic('get_aero_fromfile', 'pb in allocation 1',1)
-
-       ALLOCATE(pt_ap(klev_src), pt_b(klev_src), varktmp(klev_src), stat=ierr)
-       IF (ierr /= 0) CALL abort_physic('get_aero_fromfile', 'pb in allocation 2',1)
-
-! 3) Read all variables from file
-!    There is 2 options for the file structure :
-!    new_file=TRUE  : read varyear, ps, pt_ap and pt_b
-!    new_file=FALSE : read varyear month by month
-!****************************************************************************************
-
-       IF (new_file) THEN
-! ++) Check number of month in file opened
-!**************************************************************************************************
-       ierr = nf90_inq_dimid(ncid, 'TIME',dimid)
-       if (ierr /= NF90_NOERR) THEN
-          ierr = nf90_inq_dimid(ncid, 'time_counter', dimid)
-       ENDIF
-       CALL check_err( nf90_inquire_dimension(ncid, dimid, len = nbr_tsteps),"pb inq dim TIME or time_counter" )
-!       IF (nbr_tsteps /= 12 .AND. nbr_tsteps /= 14) THEN
-       IF (nbr_tsteps /= 12 ) THEN
-    CALL abort_physic('get_aero_fromfile', 'not the right number of months in aerosol file read (should be 12 for the moment)' &
-                     ,1)
-       ENDIF
-
-! ++) Read the aerosol concentration month by month and concatenate to total variable varyear
-!****************************************************************************************
-          ! Get variable id
-          !CALL check_err( nf90_inq_varid(ncid, TRIM(varname), varid),"pb inq var "//TRIM(varname) )
-          print *,'readaerosol ', TRIM(varname)
-          IF ( nf90_inq_varid(ncid, TRIM(varname), varid) /= NF90_NOERR ) THEN 
-            ! Variable is not there
-            WRITE(lunout,*) 'Attention '//TRIM(varname)//' is not in aerosol input file'
-            varyear(:,:,:,:)=0.0
-          ELSE 
-            ! Get the variable
-            CALL check_err( nf90_get_var(ncid, varid, varyear(:,:,:,:)),"pb get var "//TRIM(varname) )
-          ENDIF
-          
-! ++) Read surface pression, 12 month in one variable
-!****************************************************************************************
-          ! Get variable id
-          CALL check_err( nf90_inq_varid(ncid, "ps", varid),"pb inq var ps" )
-          ! Get the variable
-          CALL check_err( nf90_get_var(ncid, varid, psurf_glo2D),"pb get var ps" )
-          
-! ++) Read mass load, 12 month in one variable
-!****************************************************************************************
-          ! Get variable id
-          !CALL check_err( nf90_inq_varid(ncid, "load_"//TRIM(varname), varid) ,"pb inq var load_"//TRIM(varname))
-          IF ( nf90_inq_varid(ncid, "load_"//TRIM(varname), varid) /= NF90_NOERR ) THEN 
-            WRITE(lunout,*) 'Attention load_'//TRIM(varname)//' is not in aerosol input file'
-            load_glo2D(:,:,:)=0.0
-          ELSE
-            ! Get the variable
-            CALL check_err( nf90_get_var(ncid, varid, load_glo2D),"pb get var load_"//TRIM(varname) )
-          ENDIF
-          
-! ++) Read ap
-!****************************************************************************************
-          ! Get variable id
-          CALL check_err( nf90_inq_varid(ncid, "ap", varid),"pb inq var ap" )
-          ! Get the variable
-          CALL check_err( nf90_get_var(ncid, varid, pt_ap),"pb get var ap" )
-
-! ++) Read b
-!****************************************************************************************
-          ! Get variable id
-          CALL check_err( nf90_inq_varid(ncid, "b", varid),"pb inq var b" )
-          ! Get the variable
-          CALL check_err( nf90_get_var(ncid, varid, pt_b),"pb get var b" )
-
-          
-
-       ELSE  ! old file
-
-! ++) Read the aerosol concentration month by month and concatenate to total variable varyear
-!****************************************************************************************
-          DO imth=1, 12
-             IF (imth.EQ.1) THEN
-                cvar=TRIM(varname)//'JAN'
-             ELSE IF (imth.EQ.2) THEN
-                cvar=TRIM(varname)//'FEB'
-             ELSE IF (imth.EQ.3) THEN
-                cvar=TRIM(varname)//'MAR'
-             ELSE IF (imth.EQ.4) THEN
-                cvar=TRIM(varname)//'APR'
-             ELSE IF (imth.EQ.5) THEN
-                cvar=TRIM(varname)//'MAY'
-             ELSE IF (imth.EQ.6) THEN
-                cvar=TRIM(varname)//'JUN'
-             ELSE IF (imth.EQ.7) THEN
-                cvar=TRIM(varname)//'JUL'
-             ELSE IF (imth.EQ.8) THEN
-                cvar=TRIM(varname)//'AUG'
-             ELSE IF (imth.EQ.9) THEN
-                cvar=TRIM(varname)//'SEP'
-             ELSE IF (imth.EQ.10) THEN
-                cvar=TRIM(varname)//'OCT'
-             ELSE IF (imth.EQ.11) THEN
-                cvar=TRIM(varname)//'NOV'
-             ELSE IF (imth.EQ.12) THEN
-                cvar=TRIM(varname)//'DEC'
-             END IF
-             
-             ! Get variable id
-             CALL check_err( nf90_inq_varid(ncid, TRIM(cvar), varid),"pb inq var "//TRIM(cvar) )
-             
-             ! Get the variable
-             CALL check_err( nf90_get_var(ncid, varid, varmth),"pb get var "//TRIM(cvar) )
-             
-             ! Store in variable for the whole year
-             varyear(:,:,:,imth)=varmth(:,:,:)
-             
-          END DO
-          
-          ! Putting dummy 
-          psurf_glo2D(:,:,:) = not_valid
-          load_glo2D(:,:,:)  = not_valid
-          pt_ap(:) = not_valid
-          pt_b(:)  = not_valid
-
-       END IF
-
-! 4) Close file  
-!****************************************************************************************
-       CALL check_err( nf90_close(ncid),"pb in close" )
-     
-
-! 5) Transform the global field from 2D(nbp_lon,nbp_lat) to 1D(klon_glo)
-!****************************************************************************************
-! Test if vertical levels have to be inversed
-
-       IF ((pt_b(1) < pt_b(klev_src)) .OR. .NOT. new_file) THEN
-!          WRITE(lunout,*) 'Vertical axis in file ',TRIM(fname), ' needs to be inverted'
-!          WRITE(lunout,*) 'before pt_ap = ', pt_ap
-!          WRITE(lunout,*) 'before pt_b = ', pt_b
-          
-          ! Inverse vertical levels for varyear 
-          DO imth=1, 12
-             varmth(:,:,:) = varyear(:,:,:,imth) ! use varmth temporarly
-             DO k=1, klev_src
-                DO j=1, nbp_lat
-                   DO i=1, nbp_lon
-                      varyear(i,j,k,imth) = varmth(i,j,klev_src+1-k)
-                   END DO
-                END DO
-             END DO
-          END DO
-           
-          ! Inverte vertical axes for pt_ap and pt_b
-          varktmp(:) = pt_ap(:)
-          DO k=1, klev_src
-             pt_ap(k) = varktmp(klev_src+1-k)
-          END DO
-
-          varktmp(:) = pt_b(:)
-          DO k=1, klev_src
-             pt_b(k) = varktmp(klev_src+1-k)
-          END DO
-          WRITE(lunout,*) 'after pt_ap = ', pt_ap
-          WRITE(lunout,*) 'after pt_b = ', pt_b
-
-       ELSE 
-          WRITE(lunout,*) 'Vertical axis in file ',TRIM(fname), ' is ok, no vertical inversion is done'
-          WRITE(lunout,*) 'pt_ap = ', pt_ap
-          WRITE(lunout,*) 'pt_b = ', pt_b
-       END IF
-
-
-       IF (grid_type/=unstructured) THEN
-  !     - Invert latitudes if necessary
-         DO imth=1, 12
-            IF (invert_lat) THEN
-
-               ! Invert latitudes for the variable
-               varmth(:,:,:) = varyear(:,:,:,imth) ! use varmth temporarly
-               DO k=1,klev_src
-                  DO j=1,nbp_lat
-                     DO i=1,nbp_lon
-                        varyear(i,j,k,imth) = varmth(i,nbp_lat+1-j,k)
-                     END DO
-                  END DO
-               END DO
-             
-               ! Invert latitudes for surface pressure
-               vartmp(:,:) = psurf_glo2D(:,:,imth)
-               DO j=1,nbp_lat
-                  DO i=1,nbp_lon
-                     psurf_glo2D(i,j,imth)= vartmp(i,nbp_lat+1-j)
-                  END DO
-               END DO
-             
-               ! Invert latitudes for the load
-               vartmp(:,:) = load_glo2D(:,:,imth)
-               DO j=1,nbp_lat
-                  DO i=1,nbp_lon
-                     load_glo2D(i,j,imth)= vartmp(i,nbp_lat+1-j)
-                  END DO
-               END DO
-            END IF ! invert_lat
-             
-            ! Do zonal mead at poles and distribut at whole first and last latitude
-            DO k=1, klev_src
-               npole=0.  ! North pole, j=1
-               spole=0.  ! South pole, j=nbp_lat        
-               DO i=1,nbp_lon
-                  npole = npole + varyear(i,1,k,imth)
-                  spole = spole + varyear(i,nbp_lat,k,imth)
-               END DO
-               npole = npole/REAL(nbp_lon)
-               spole = spole/REAL(nbp_lon)
-               varyear(:,1,    k,imth) = npole
-               varyear(:,nbp_lat,k,imth) = spole
-            END DO
-         END DO ! imth
-       
-         ALLOCATE(varyear_glo1D(klon_glo, klev_src, 12), stat=ierr)
-         IF (ierr /= 0) CALL abort_physic('get_aero_fromfile', 'pb in allocation 3',1)
-       
-         ! Transform from 2D to 1D field
-         CALL grid2Dto1D_glo(varyear,varyear_glo1D)
-         CALL grid2Dto1D_glo(psurf_glo2D,psurf_glo1D)
-         CALL grid2Dto1D_glo(load_glo2D,load_glo1D)
-      
-      ENDIF
-      
-    ELSE
-        ALLOCATE(varyear_glo1D(0,0,0))        
-    END IF ! is_mpi_root .AND. is_omp_root
-
-!$OMP BARRIER
-  
-! 6) Distribute to all processes
-!    Scatter global field(klon_glo) to local process domain(klon)
-!    and distribute klev_src to all processes
-!****************************************************************************************
-
-    ! Distribute klev_src
-    CALL bcast(klev_src)
-
-    ! Allocate and distribute pt_ap and pt_b
-    IF (.NOT. ASSOCIATED(pt_ap)) THEN  ! if pt_ap is allocated also pt_b is allocated
-       ALLOCATE(pt_ap(klev_src), pt_b(klev_src), stat=ierr)
-       IF (ierr /= 0) CALL abort_physic('get_aero_fromfile', 'pb in allocation 4',1)
-    END IF
-    CALL bcast(pt_ap)
-    CALL bcast(pt_b)
-
-    ! Allocate space for output pointer variable at local process
-    IF (ASSOCIATED(pt_year)) DEALLOCATE(pt_year)
-    ALLOCATE(pt_year(klon, klev_src, 12), stat=ierr)
-    ALLOCATE(pt_year_mpi(klon_mpi, klev_src, 12), stat=ierr)
-    IF (ierr /= 0) CALL abort_physic('get_aero_fromfile', 'pb in allocation 5',1)
-
-    IF (grid_type==unstructured) THEN
-#ifdef CPP_XIOS
-      IF (is_omp_master) THEN
-        CALL xios_send_field(TRIM(varname)//"_in",varyear)
-        CALL xios_recv_field(TRIM(varname)//"_out",pt_year_mpi)
-        CALL xios_send_field("load_"//TRIM(varname)//"_in",load_glo2D)
-        CALL xios_recv_field("load_"//TRIM(varname)//"_out",load_out_mpi)
-        IF (.not. allocated(psurf_interp)) THEN
-         ! psurf_interp is a shared array
-          ALLOCATE(psurf_interp(klon_mpi,12))
-          CALL xios_send_field("psurf_aerosol_in",psurf_glo2D)
-          CALL xios_recv_field("psurf_aerosol_out",psurf_interp)
-        ENDIF
-      ENDIF
-      CALL scatter_omp(pt_year_mpi,pt_year)
-      CALL scatter_omp(load_out_mpi,load_out)
-      CALL scatter_omp(psurf_interp,psurf_out)
-      first=.FALSE.
-#endif
-    ELSE
-      ! Scatter global field to local domain at local process
-      CALL scatter(varyear_glo1D, pt_year)
-      CALL scatter(psurf_glo1D, psurf_out)
-      CALL scatter(load_glo1D,  load_out)
-    ENDIF
-! 7) Test for negative values
-!****************************************************************************************
-    IF (MINVAL(pt_year) < 0.) THEN
-       WRITE(lunout,*) 'Warning! Negative values read from file :', fname
-    END IF
-
-  END SUBROUTINE get_aero_fromfile
-
-
-  SUBROUTINE check_err(status,text)
-    USE netcdf
-    USE print_control_mod, ONLY: lunout
-    IMPLICIT NONE
-
-    INTEGER, INTENT (IN) :: status
-    CHARACTER(len=*), INTENT (IN), OPTIONAL :: text
-
-    IF (status /= NF90_NOERR) THEN
-       WRITE(lunout,*) 'Error in get_aero_fromfile, netcdf error code = ',status
-       IF (PRESENT(text)) THEN
-          WRITE(lunout,*) 'Error in get_aero_fromfile : ',text
-       END IF
-       CALL abort_physic('get_aero_fromfile',trim(nf90_strerror(status)),1)
-    END IF
-
-  END SUBROUTINE check_err
-
-
-END MODULE readaerosol_mod
Index: CONFIG/UNIFORM/v7/IPSLCM7ISO/compile_lmdziso.sh
===================================================================
--- CONFIG/UNIFORM/v7/IPSLCM7ISO/compile_lmdziso.sh	(revision 6746)
+++ CONFIG/UNIFORM/v7/IPSLCM7ISO/compile_lmdziso.sh	(revision 6746)
@@ -0,0 +1,741 @@
+#!/bin/bash
+# Default options
+#
+#
+#
+date
+#### 1  Set up the compiling options
+#### Define some directories
+submitdir=$( pwd )
+modipsl=$submitdir/../..
+arch_path=$submitdir/ARCH 
+mysrc_path=$submitdir/SOURCES
+export ROOT=$modipsl/modeles/IOIPSL
+#$modipsl/modeles/DYNAMICO
+#### Set default options
+# Activate compilation of LMDZ for regular latlon grid without DYNAMICO
+regular_latlon=y
+# Atmospheric resolution for regular grid for LMDZ/ORCHIDEE, if regular_latlon=y
+resol_atm=144x142x79
+# Coupled with ocean biogeochemistry (y/n)
+nemotop=y
+# Optimization mode
+# optmode=prod/dev/debug
+optmode=prod
+# fcm_arch
+fcm_arch=default
+# Default values to be overritten
+parallel=mpi_omp
+export fcm_arch parallel xios
+full_flag=""
+full_nemo=n
+full_inca=""
+full_xios=""
+full_lmdz=""
+full_orch=""
+full_dyna=""
+full_oasis=n
+# choose radiative code compilation option 
+rad=rrtm
+opt_rad=""
+#choose chemistry inca configuration 
+optchimie=GES
+
+# subconfig : which sub-configuration to compile. By default, the full extracted configuration is compiled.
+subconfig=LMDZISO
+
+# orchversion tells if ORCHIDEE_2_2 or ORCHIDEE_4 is compiled. This is used as argument and also in the suffix of the executables.
+orchversion=orch22
+# orchdriver : Permet to compile the ORCHIDEE offline drivers. This option is activated by setting -orchdriver as argument. 
+# Drivers are now compiled by default
+orchdriver="-driver -oasisdriver"
+
+# Default netcdf_lib is used for XIOS but can be change by argument
+netcdf_lib=""
+
+# Output text file for compilation of each component
+datestr=`LC_ALL=C date +"%Y%m%dT%H%M"`
+outfile=$submitdir/out_compile_lmdziso.$datestr
+echo > $outfile
+echo; echo "Text output from compilation will be stored in file out_compile_lmdziso.$datestr"; echo 
+
+
+rm -f out_compile_lmdziso
+ln -s ${outfile} out_compile_lmdziso
+
+
+#### Read arguments 
+# Loop over all arguments to modify default set up
+while (($# > 0)) ; do
+    case $1 in
+	"-h"|"-help") cat <<end_help
+########################################################################
+# Usage of the script compile_lmdziso.sh
+#
+########################################################################
+
+./compile_lmdziso.sh [Options] 
+
+Description of all options:
+
+[-full] Full recompilation of all components. This option can be added to all other options.
+[-cleannemo] Full recompilation of NEMO component only.
+[-regular_latlon yes/no] Activate or deactivate compilation of LMDZ dynamics for regular latlon grid. 
+                         Default resol_atm size is used. This option is set in addition to the compilation of the icosahedric grid. 
+[-resol_atm XXXxYYYxZZ] Define which regular grid to compile. A default grid is set if this option is not used.
+[-debug / -dev / -prod] Level of optimization. One of these can be added to all other compile options. Default: -prod.
+[-subconfig X] Set this option if you want to compile a sub-configuration. X can be one of following sub-configurations : 
+               ICOLMDZORINCA, ICOLMDZOR, LMDZORINCA, LMDZOR, LMDZISO, IPSLCM-reg or IPSLCM
+               By default, all available components are compiled. 
+[-orch4 / -orch22] Choice of ORCHIDEE version. The source code are found in modeles/ORCHIDEE_4 or modeles/ORCHIDEE_2_2 
+                   and a link will be set to the choosen model version. Default version is currently ORCHIDEE_2_2 (-orch22).
+[-orchdriver]   Activate compilation of orchidee offline drivers
+
+Example 1: Default compilation of LMDZISO
+./compile_lmdziso.sh
+
+Example 2: Default compilation in debug mode
+./compile_lmdziso.sh -debug
+
+Example 3: Default compilation with full recompilation of all components. No clean is needed.
+./compile_lmdziso.sh -full
+
+Example 4: Compilation in addition of LMDZ in regular lat-lon for a specific resolution : 
+./compile_lmdziso.sh -resol_atm 144x142x95
+
+Example 5: Compilation without regular grid (only icosaedric grid)
+./compile_lmdziso.sh -regular_latlon no
+
+Example 5: Compilation of ORCHIDEE_4 version
+./compile_lmdziso.sh -orch4
+
+Example 6: compilation of a specific chemistry for INCA (default is GES) 
+./compile_lmdziso.sh -chimie NMHC_AER_S 
+
+Example 7: Compilation of sub-configuration LMDZOR : 
+./compile_lmdziso.sh -subconfig LMDZOR
+
+end_help
+	    exit;;
+
+	"-parallel")   parallel=$2 ; shift ; shift ;; 
+	"-arch")       fcm_arch="$2" ; shift ; shift ;;
+	"-debug")      optmode=debug ; shift ;;
+	"-dev")	       optmode=dev ; shift ;;
+	"-prod")       optmode=prod ; shift ;;
+	"-regular_latlon")  regular_latlon=$2 ; shift ; shift ;;
+	"-resol_atm")  regular_latlon=y ; resol_atm=$2 ; shift ; shift ;;
+	"-subconfig")  subconfig=$2 ; shift ; shift ;;
+	"-full")       full_flag="-full"; full_nemo=y ; full_xios="--full" ; full_lmdz="-full" ; full_orch="-full" ; full_oasis=y ; full_inca="-clean" ; full_dyna="-full" ; shift ;;
+	"-full_xios")  full_xios="--full" ; shift ;;  # Note only full_xios is using double dash: --full
+	"-full_lmdz")  full_lmdz="-full"  ; shift ;;
+	"-full_orch")  full_orch="-full"  ; shift ;;
+	"-full_nemo")  full_nemo=y ; shift ;;
+	"-full_inca")  full_inca="-clean"; shift ;;
+	"-full_dyna")  full_dyna="-full" ; shift ;;
+ 	"-full_oasis") full_oasis=y ; shift ;;
+	"-cleannemo")  full_nemo=y ; shift ;;
+	"-rad")        rad=$2; shift ; shift ;;
+	"-orch22")     orchversion="orch22"; shift ;;
+	"-orch4")      orchversion="orch4";  shift ;;
+	"-orchdriver") orchdriver="-driver";  shift ;;
+	"-chimie")     optchimie=$2; shift ; shift;;
+	*)	       echo "unknown option "$1" , exiting..." ; exit
+    esac
+done
+
+
+# Define which sub-configuration to compile. By default all extracted source components are compiled.
+source define_config_iso.sh
+
+echo "Following options are set in current compiling:" >> $outfile
+echo "   regular_latlon=$regular_latlon (if yes, then resol_atm=${resol_atm})" >> $outfile 
+echo "   resol_atm=${resol_atm}, nemotop=${nemotop}" >> $outfile 
+echo "   optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch " >> $outfile 
+echo "   full_flag=$full_flag, full_xios=$full_xios, full_lmdz=$full_lmdz, full_orch=$full_orch, full_nemo=$full_nemo, full_dyna=$full_dyna, full_oasis=$full_oasis" >> $outfile 
+echo "   compinca=$compinca compnemo=$compnemo compoasis=$compoasis compdyna=$compdyna complmdz=y comporch=y compxios=y compiso=$compiso" >> $outfile
+echo >> $outfile
+### Verification of argument
+# Set argorch depending on the version of ORCHIDEE. This argument is needed for the compilation of LMDZ to consider coherent interface. 
+if [ $orchversion == orch22 ] ; then
+    argorch=orchidee2.1
+elif [ $orchversion == orch4 ] ; then
+    argorch=orchideetrunk
+else
+    echo "ERROR in version of ORCHIDEE. It is only possible to have orch22 or orch4 for now"
+fi
+
+### Read host dependent default values
+### These variables will not be changed if they were set as argument
+###./host.sh $host
+# Later : Following lines should be set in host.sh file
+# begin host.sh
+if [ $fcm_arch == default ] ; then
+    # Find out current host and source specific paths and commands for the host
+    case $( hostname -s ) in
+	jean-zay*)
+            if [[ $( hostname -s ) != *"pp"* ]] ; then
+                echo "Warning! You MUST compile on jean-zay-pp."
+                echo "EXIT"
+                exit
+            else
+                fcm_arch=X64_JEANZAY
+            fi ;;
+        irene170|irene171|irene190|irene191|irene192|irene193)
+            fcm_arch=X64_IRENE;;
+        irene172|irene173|irene194|irene195)
+            fcm_arch=X64_IRENE-AMD;;
+	asterix*|obelix*)
+	    fcm_arch=ifort_LSCE
+            if [ "${parallel}" == "mpi_omp" ] ; then 
+		echo "Warning!! Currently at Obelix hybrid mode is not possible."
+		echo "          Option -parallel mpi_omp is now changed to -parallel mpi"
+		echo ""
+		parallel=mpi
+            else
+		echo "You used -parallel" $parallel
+            fi ;;
+        spirit*)
+            fcm_arch=ifort_MESOIPSL;;
+	ciclad*|climserv*|loholt*|camelot*)
+	    fcm_arch=ifort_CICLAD;;
+	*)
+	    echo Current host is not known. You must use option -arch to specify which architecuture files to use.
+	    echo Exit now.
+	    exit
+    esac
+fi
+
+# Set a link to arch.env if arch-${fcm_arch}.env file exist for current fcm_arch.
+# The link arch.env is also set in config.card and will be used by libIGCM to ensure the same running environnement.
+if [ -f ARCH/arch-${fcm_arch}.env ] ; then
+    echo >> $outfile
+    echo "The file ARCH/arch-${fcm_arch}.env will now be sourced with modules needed for compilation for all components."
+    echo "Note that this new environement might be kept after compilation."
+    echo "If this is the case, source again your personal environment after compilation."
+    echo " Personal module list before sourcing of ARCH/arch.env file:"    >> $outfile 
+    module list   >> $outfile 2>&1
+    svn_version=$(module list -t | grep subversion)
+       
+    # Make a link to this file, to be used also in config.card
+    rm -f ARCH/arch.env
+    ln -s arch-${fcm_arch}.env ARCH/arch.env
+
+    # Source the file
+    source ARCH/arch.env   >> $outfile 2>&1
+    if [ X$svn_version != X ] ; then
+	module load ${svn_version}
+    fi
+    echo >> $outfile
+    echo " New module list after sourcing of ARCH/arch.env file:"    >> $outfile 
+    module list   >> $outfile 2>&1
+fi
+
+
+#### Clean if full_orch
+# If full recompilation of ORCHIDEE then first clean modipsl/lib folder
+if [ X${full_orch} == X"-full" ] ; then
+   rm -f $modipsl/lib/*
+fi
+
+#### 2 Do the compilation 
+## 2.1 Compile ioipsl
+cd $modipsl/modeles/IOIPSL
+echo; echo "NOW COMPILE IOIPSL"
+echo >> $outfile ; echo " NOW COMPILE IOIPSL"   >> $outfile 
+
+echo ./makeioipsl_fcm -$optmode -parallel -arch ${fcm_arch} -arch_path $arch_path -j 8 $full_flag   >> $outfile 
+     ./makeioipsl_fcm -$optmode -parallel -arch ${fcm_arch} -arch_path $arch_path -j 8 $full_flag   >> $outfile 2>&1
+# Test if compiling succeded 
+if [[ $? != 0 ]] ; then 
+    echo "THERE IS A PROBLEM IN IOIPSL COMPILATION - STOP"
+    exit
+fi
+
+if [ $compoasis == y ] ; then
+## 2.2 Compile oasis3-mct
+if [ $full_oasis == y ] ; then
+    rm -rf $modipsl/oasis3-mct/BLD
+fi
+cd $modipsl/oasis3-mct/util/make_dir
+echo; echo "NOW COMPILE OASIS3-MCT"
+echo >> $outfile ; echo " NOW COMPILE OASIS3-MCT"   >> $outfile
+cp $mysrc_path/OASIS3-MCT/make_${fcm_arch} make.inc
+
+echo make -f TopMakefileOasis3 >> $outfile
+     make -f TopMakefileOasis3 >> $outfile 2>&1
+if [[ $? != 0 ]] ; then
+    echo "THERE IS A PROBLEM IN OASIS COMPILATION - STOP"
+    exit
+fi
+ 
+
+else
+echo ; echo No compilation of OASIS
+fi
+
+## 2.3 Compile xios
+cd $modipsl/modeles/XIOS
+echo; echo "NOW COMPILE XIOS"
+echo >> $outfile ; echo " NOW COMPILE XIOS"   >> $outfile 
+if [ $compoasis == y ] ; then
+argoasis="--use_oasis oasis3_mct "
+else
+argoasis=" "
+fi
+echo ./make_xios $argoasis --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_xios   >> $outfile 
+     ./make_xios $argoasis --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_xios   >> $outfile 2>&1
+# Test if compiling succeded 
+if [[ $? != 0 ]] ; then 
+    echo "THERE IS A PROBLEM IN XIOS COMPILATION - STOP"
+    exit
+fi
+# Move executables to modipsl/bin
+if [ -f $modipsl/modeles/XIOS/bin/xios_server.exe ] ; then 
+    mv $modipsl/modeles/XIOS/bin/xios_server.exe $modipsl/bin/xios_server_${optmode}.exe
+else
+    echo "THERE IS A PROBLEM IN XIOS COMPILATION EXECUTABLE MISSING - STOP"
+    exit
+fi
+
+
+## 2.4 Compile ORCHIDEE
+# Choose ORCHIDEE version to compile and create a link to generic folder name ORCHIDEE.
+# This link is needed for the compilation of ICOSA_LMDZ for it to find the orchidee librarie. 
+cd $modipsl/modeles
+rm -f ORCHIDEE
+if [ $orchversion == orch22 ] ; then
+    ln -s ORCHIDEE_2_2 ORCHIDEE
+    cd $modipsl/modeles/ORCHIDEE_2_2
+    echo; echo "NOW COMPILE ORCHIDEE_2_2"
+    echo >> $outfile ; echo " NOW COMPILE ORCHIDEE_2_2"   >> $outfile 
+else
+    ln -s ORCHIDEE_4 ORCHIDEE
+    cd $modipsl/modeles/ORCHIDEE_4
+    echo; echo "NOW COMPILE ORCHIDEE_4 (trunk)"
+    echo >> $outfile ; echo " NOW COMPILE ORCHIDEE_4 (trunk)"   >> $outfile 
+fi
+
+# Check if the compilation of ORCHIDEE was previsouly interupted prematured. 
+# In that case, the files fcm.bld.lock exist. If the file exist, it is here removed to avoid makeorchidee_fcm 
+# to ask question and wait for interactivly answer from the user.
+if [ -f build/fcm.bld.lock ] ; then
+    echo >> $outfile
+    echo " WARNING!! The file ORCHIDEE/build/fcm.bld.lock exist. "   >> $outfile
+    echo "           This means that the compilation is either currently on going in another terminal was previous interupted before the end."   >> $outfile
+    echo "           The file will now be removed. "   >> $outfile
+    echo >> $outfile
+    rm -f build/fcm.bld.lock
+fi
+
+echo    ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch $orchdriver >> $outfile 
+        ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch $orchdriver >> $outfile 2>&1
+# Test if compiling finished
+if [[ $? != 0 ]] ; then
+    echo "THERE IS A PROBLEM IN ORCHIDEE COMPILATION - STOP"
+    exit
+fi
+
+# Rename exetubles for ORCHIDEE offline driver with suffix version
+cd $modipsl/bin
+if [ -f orchideedriver ] ; then 
+    mv orchideedriver orchideedriver.${orchversion}_$optmode
+    ln -sf orchideedriver.${orchversion}_$optmode orchideedriver_$optmode
+fi
+if [ -f orchidee_ol ] ; then 
+    mv orchidee_ol orchidee_ol.${orchversion}_$optmode
+    ln -sf orchidee_ol.${orchversion}_$optmode orchidee_ol_$optmode
+fi
+
+## 2.5 Compile NEMO
+if [ $compnemo == y ] ; then
+    nemo_root=$modipsl/modeles/NEMO
+    cfg_ref=ORCA2_ICE_PISCES
+    cfg_wrk=ORCA_ICE_TRC
+    addkeys="key_oasis3 key_top key_si3 key_isf"
+    delkeys=""
+    
+    if [ ${nemotop} == n ] ; then
+	cfg_wrk=ORCA_ICE
+	delkeys="key_top"
+    fi
+    
+    if [ ${nemotop} == n ] ; then
+	echo; echo "NOW COMPILE NEMO with ice model SI3 without passive tracer model TOP"
+	echo >> $outfile ; echo " NOW COMPILE NEMO with ice model SI3 without passive tracer model TOP"   >> $outfile
+    else
+	echo; echo "NOW COMPILE NEMO with ice model SI3 and passive tracer model TOP"
+	echo >> $outfile ; echo " NOW COMPILE NEMO with ice model SI3 and passive tracer model TOP"   >> $outfile
+    fi
+    
+    echo >> $outfile ; echo cd $nemo_root  >> $outfile
+    echo >> $outfile ; echo cp $mysrc_path/NEMO/arch-${fcm_arch}.fcm arch/CNRS/.   >> $outfile
+    echo >> $outfile
+    
+    cd $nemo_root ; cp $mysrc_path/NEMO/arch-${fcm_arch}.fcm arch/CNRS/.
+    
+    # creation of config
+    echo >> $outfile ; echo cd $nemo_root  >> $outfile
+    echo ./makenemo -m ${fcm_arch} -n $cfg_wrk -r $cfg_ref -j0 add_key "$addkeys"  del_key "$delkeys"   >> $outfile
+    echo >> $outfile
+    cd $nemo_root
+    ./makenemo -m ${fcm_arch} -n $cfg_wrk -r $cfg_ref -j0  add_key "$addkeys"  del_key "$delkeys"  >> $outfile 2>&1
+    
+    
+    # Copy of specfic source files
+    echo >> $outfile ; echo cp $mysrc_path/NEMO/*.*90  $nemo_root/cfgs/$cfg_wrk/MY_SRC/.   >> $outfile
+    echo >> $outfile
+    cp $mysrc_path/NEMO/*.*90  $nemo_root/cfgs/$cfg_wrk/MY_SRC/.
+    
+    
+    if [ $full_nemo == y ] ; then
+	# To make a full compilation, first make a clean to remove all files produced during previous compilation
+	echo ./makenemo -m ${fcm_arch} -n $cfg_wrk -r $cfg_ref clean   >> $outfile
+	echo >> $outfile
+	./makenemo -m ${fcm_arch} -n $cfg_wrk -r $cfg_ref clean  >> $outfile 2>&1
+    fi
+    echo ./makenemo -m ${fcm_arch} -n $cfg_wrk -r $cfg_ref -j8  >> $outfile
+    echo >> $outfile
+    ./makenemo -m ${fcm_arch} -n $cfg_wrk -r $cfg_ref -j8  >> $outfile 2>&1
+    
+    echo >> $outfile
+    echo "Move nemo executable to modipsl/bin" >> $outfile
+    echo ls -lrt $nemo_root/cfgs/$cfg_wrk/BLD/bin   >> $outfile
+    ls -lrt $nemo_root/cfgs/$cfg_wrk/BLD/bin  >> $outfile
+    echo >> $outfile
+    
+    if [ -f $nemo_root/cfgs/$cfg_wrk/BLD/bin/nemo.exe ] ; then
+	mv $nemo_root/cfgs/$cfg_wrk/BLD/bin/nemo.exe $modipsl/bin/opa_${optmode}.exe
+    else
+	echo "ERROR nemo.exe executable does not exist."
+	echo "THERE IS A PROBLEM IN NEMO COMPILATION - STOP"
+	exit
+    fi
+    
+else
+    echo ; echo No compilation of NEMO
+fi
+
+##2.6  Compile INCA 
+if [ $compinca == y ] ; then
+    cd $modipsl/modeles/INCA
+    
+    echo; echo "NOW COMPILE INCA ${optchimie}"
+    echo >> $outfile ; echo " NOW COMPILE INCA ${optchimie}"   >> $outfile 
+    
+    echo ./makeinca_fcm -chimie ${optchimie} -$optmode -xios -parallel mpi_omp -j 8 -arch ${fcm_arch}  -arch_path $arch_path $full_inca  >> $outfile
+    ./makeinca_fcm -chimie ${optchimie} -$optmode -xios -parallel mpi_omp  -j 8 -arch ${fcm_arch} -arch_path $arch_path $full_inca >> $outfile 2>&1
+    
+    # Test if compiling finished
+    if [[ $? != 0 ]] ; then
+	echo "THERE IS A PROBLEM IN INCA COMPILATION - STOP"
+	echo "ALL INFORMATION IN FILE $outfile"
+	exit
+    fi
+    
+    echo "Move inca.dat modipsl/bin"
+    if [[ -f $modipsl/modeles/INCA/SIMULATIONS/${optchimie}/inca.dat ]] ;  then  
+	mv $modipsl/modeles/INCA/SIMULATIONS/${optchimie}/inca.dat $modipsl/bin/inca_${optchimie}.dat ;
+    else
+	echo "THERE IS A PROBLEM IN INCA COMPILATION - STOP"
+	echo "ALL INFORMATION IN FILE $outfile"
+	exit	
+    fi
+    
+    echo "Move tracer.def to  modipsl/bin"
+    if [[ -f $modipsl/modeles/INCA/tracer.def ]] ;  then
+        mv $modipsl/modeles/INCA/tracer.def $modipsl/bin/tracer_${optchimie}.def ;
+    fi
+    
+else
+    echo ; echo No compilation of INCA
+fi
+
+## 2.7 Compile LMDZ 
+cd $modipsl/modeles/LMDZ
+
+
+# Temporary use of SOURCES/LMDZ to handle modifications needed by IPSLCM7 for LMDZ 4515
+# To be remove for newer versions of LMDZ 
+cp $mysrc_path/LMDZ/phylmd/*.*90  libf/phylmd/.
+cp $mysrc_path/LMDZ/dyn3d_common/*.*90  libf/dyn3d_common/.
+
+
+# Compile LMDZ as library to couple to DYNAMICO
+if [ $compdyna == y ] ; then
+    echo; echo "NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO"
+    echo >> $outfile ; echo " NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO"   >> $outfile 
+    
+    
+    # Check if the compilation of LMDZ was previsouly interupted prematured. 
+    # In that case, the files dimension.h and .lock exist. If the files exist, they are here removed to avoid makelmdz_fcm 
+    # to ask question and wait for interactivly answer from the user.
+    if [ -f libf/grid/dimensions.h ] || [ -f .lock ] ; then
+	echo >> $outfile
+	echo " WARNING!! The file LMDZ/libf/grid/dimension.h and/or the LMDZ/.lock exist. "   >> $outfile
+	echo "           This means that the compilation is either currently on going in another terminal was previous interupted before the end."   >> $outfile
+	echo "           The files dimension.h and .lock will now be removed. "   >> $outfile
+	echo >> $outfile
+	rm -f libf/grid/dimensions.h
+	rm -f .lock
+    fi
+    
+    # Need to define the proper option for radiative code compilation. By default, we use rrtm
+    case $rad in
+	oldrad) opt_rad="" ;;
+	rrtm)    opt_rad="-rad rrtm" ;;
+	ecrad)  opt_rad="-rad ecrad" ;;
+	*) echo Only oldrad rrtm ecrad for rad option ; exit
+    esac
+    
+    
+    if [ $compinca == y ] ; then
+	arginca="-chimie INCA "
+    else
+	arginca=" "
+    fi
+    
+    if [ $compoasis == y ] ; then
+	argoasis="-c OMCT "
+    else
+	argoasis=" "
+    fi
+
+    echo ./makelmdz_fcm -p lmd $argoasis $opt_rad -$optmode -mem -parallel $parallel -libphy -v $argorch $arginca  -io xios -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz    >> $outfile 
+    ./makelmdz_fcm -p lmd $argoasis $opt_rad -$optmode -mem -parallel $parallel -libphy -v $argorch $arginca  -io xios -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz    >> $outfile 2>&1
+    
+    
+    # Test if compiling finished
+    if [[ $? != 0 ]] ; then
+	echo "THERE IS A PROBLEM IN LMDZ PHYSICS COMPILATION - STOP"
+	exit
+    fi
+fi
+
+
+## 2.8 Compile DYNAMICO
+if [ $compdyna == y ] ; then
+    cd $modipsl/modeles/DYNAMICO
+    echo; echo "NOW COMPILE DYNAMICO "
+    echo >> $outfile ; echo " NOW COMPILE DYNAMICO"   >> $outfile 
+    
+    if [ $compoasis == y ] ; then
+	argoasis="-with_oasis "
+    else
+	argoasis=" "
+    fi
+    if [ $compinca == y ] ; then
+	arginca="-with_inca "
+    else
+	arginca=" "
+    fi
+    
+    
+    echo ./make_icosa -$optmode -with_fcm1 -parallel $parallel -external_ioipsl $argoasis -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile 
+    ./make_icosa -$optmode -with_fcm1 -parallel $parallel -external_ioipsl $argoasis -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_dyna    >> $outfile 2>&1
+    # Test if compiling finished
+    if [[ $? != 0 ]] ; then
+	echo "THERE IS A PROBLEM IN DYNAMICO COMPILATION - STOP"
+	exit
+    fi
+fi
+    
+## 2.9 Compile interface ICOSA_LMDZ
+if [ $compdyna == y ] ; then
+    cd $modipsl/modeles/ICOSA_LMDZ
+    echo; echo "NOW COMPILE ICOSA_LMDZ "
+    echo >> $outfile ; echo " NOW COMPILE ICOSA_LMDZ"   >> $outfile 
+    
+    echo ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel $argoasis -with_orchidee $arginca -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna    >> $outfile 
+    ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel $argoasis -with_orchidee $arginca -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_dyna    >> $outfile 2>&1
+    # Test if compiling finished
+    if [[ $? != 0 ]] ; then
+	echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION - STOP"
+	exit
+    fi
+    # Move executables to modipsl/bin
+    if [ -f $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe ] ; then 
+	if [ $compinca == y ] ; then
+	    mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/icosa_lmdz_${orchversion}_${optmode}_${optchimie}.exe
+	    # Create link to be use by IPSLCM and LMDZOR without any change in the executable name
+	    cd  $modipsl/bin
+            rm -f icosa_lmdz_${orchversion}_${optmode}.exe
+	    ln -s icosa_lmdz_${orchversion}_${optmode}_${optchimie}.exe icosa_lmdz_${orchversion}_${optmode}.exe
+	else
+	    mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/icosa_lmdz_${orchversion}_${optmode}.exe
+	fi
+    else
+	echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION EXECUTABLE MISSING - STOP"
+	exit
+    fi
+fi
+
+
+## 2.10 Compile LMDZ for regular latlon configuration
+if [ $regular_latlon = y ] ; then
+
+    cd $modipsl/modeles/LMDZ
+    # Compile LMDZ regular lat-lon exectuable
+    echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}"
+    echo >> $outfile ; echo " NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}"   >> $outfile 
+    # Check if the compilation of LMDZ was previsouly interupted prematured. 
+    # In that case, the files dimension.h and .lock exist. If the files exist, they are here removed to avoid makelmdz_fcm 
+    # to ask question and wait for interactivly answer from the user.
+    if [ -f libf/grid/dimensions.h ] || [ -f .lock ] ; then
+	echo >> $outfile
+	echo " WARNING!! The file LMDZ/libf/grid/dimension.h and/or the LMDZ/.lock exist. "   >> $outfile
+	echo "           This means that the compilation is either currently on going in another terminal was previous interupted before the end."   >> $outfile
+	echo "           The files dimension.h and .lock will now be removed. "   >> $outfile
+	echo >> $outfile
+	rm -f libf/grid/dimensions.h
+	rm -f .lock
+    fi
+
+    # Need to define the proper option for radiative code compilation. By default, we use rrtm
+    case $rad in
+	oldrad) opt_rad="" ;;
+	rrtm)    opt_rad="-rad rrtm" ;;
+	ecrad)  opt_rad="-rad ecrad" ;;
+	*) echo Only oldrad rrtm ecrad for rad option ; exit
+    esac
+    
+    if [ $compinca == y ] ; then
+	arginca="-chimie INCA"
+    else
+	arginca=""
+    fi
+    
+    if [ $compoasis == y ] ; then
+	argoasis="-c OMCT"
+    else
+	argoasis=""
+    fi
+
+    if [ $compiso == y ] ; then
+    arginca=""
+    compinca="n" 
+#    argoasis=""
+    argiso="-isotopes true"
+    argorch="false"
+    argphys="lmdiso"
+    else
+    argiso=""
+    argphys="lmd"
+    fi
+
+    echo ./makelmdz_fcm -d ${resol_atm} $argoasis -p $argphys $opt_rad -$optmode -mem -parallel $parallel $arginca -io xios -v $argorch $argiso -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 
+         ./makelmdz_fcm -d ${resol_atm} $argoasis -p $argphys $opt_rad -$optmode -mem -parallel $parallel $arginca -io xios -v $argorch $argiso -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 2>&1
+    # Test if compiling finished
+    if [[ $? != 0 ]] ; then
+	echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP"
+	exit
+    fi
+
+    # Find executable suffix
+    suffix=_${resol_atm}_phy${argphys}
+    suffix=${suffix}_${rad} 
+    if [ $parallel == seq ] || [ $parallel == none ] ; then
+	suffix=${suffix}_seq_orch_inca.e
+    else
+    if [ $argorch != false ] ; then
+        suffix=${suffix}_para_mem_orch
+    else
+        suffix=${suffix}_para_mem
+    fi
+	if [ $compoasis == y ] ; then
+	    suffix=${suffix}_couple
+	else
+	    suffix=${suffix}
+	fi
+	if [ $compinca == y ] ; then
+	    suffix=${suffix}_inca
+	else
+	    suffix=${suffix}
+	fi
+    if [ $compiso == y ] ; then
+        suffix=${suffix}_iso.e
+    else
+        suffix=${suffix}.e
+    fi
+    fi
+    echo gcm suffix = $suffix
+    
+    # Move executables to modipsl/bin folder
+    echo "Move gcm.e executable to modipsl/bin"
+    if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix} ] ;  then
+	if [ $compinca == y ] ; then
+	    mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${orchversion}_${optmode}_${optchimie}.e
+	    # Create link to be use by IPSLCM and LMDZOR without any change in the executable name
+	    cd $modipsl/bin
+            rm -f gcm_${resol_atm}_${orchversion}_${optmode}.e
+	    ln -s gcm_${resol_atm}_${orchversion}_${optmode}_${optchimie}.e gcm_${resol_atm}_${orchversion}_${optmode}.e
+	elif [ $compiso == y ] ; then
+        mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_iso_${optmode}.e
+ 	else
+	    mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${orchversion}_${optmode}.e
+	fi
+    else
+	echo "ERROR gcm${suffix} executable does not exist." 
+	echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP"
+	exit
+    fi    
+
+    # Find executable suffix
+    suffix=_${resol_atm}_phylmd
+    suffix=${suffix}_${rad} 
+    if [ $parallel == seq ] || [ $parallel == none ] ; then
+	suffix=${suffix}_seq_orch.e
+    else
+    if [ $argorch != false ] ; then
+        suffix=${suffix}_para_mem_orch
+    else
+        suffix=${suffix}_para_mem
+    fi
+	if [ $compoasis == y ] ; then
+	    suffix=${suffix}_couple.e
+	else
+	    suffix=${suffix}.e
+	fi
+    fi
+    echo ce0l suffix = $suffix
+
+    # Compile ce0l initialization program for LMDZ regular lat-lon exectuable
+    cd $modipsl/modeles/LMDZ
+    echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"
+    echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"   >> $outfile 
+
+    echo ./makelmdz_fcm -d ${resol_atm} $argoasis -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v $argorch -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile 
+         ./makelmdz_fcm -d ${resol_atm} $argoasis -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v $argorch -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile 2>&1
+    # Test if compiling finished
+    if [[ $? != 0 ]] ; then
+	echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP"
+	exit
+    fi
+   
+ 
+    # Move executable ce0l to modipsl/bin folder
+    echo "Move ce0l executable to modipsl/bin"
+    if [ -f $modipsl/modeles/LMDZ/bin/ce0l${suffix} ] ;  then
+	mv $modipsl/modeles/LMDZ/bin/ce0l${suffix} $modipsl/bin/ce0l_${resol_atm}_${optmode}.e
+    else
+	echo "ERROR ce0l${suffix} executable does not exist." 
+	echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP"
+	exit
+    fi
+fi
+
+echo >>$outfile ; echo "ALL COMPILING FINISHED" >> $outfile
+echo ls -lrt modipsl/bin >> $outfile
+ls -lrt $modipsl/bin >> $outfile
+
+echo; echo "ALL COMPILING FINISHED" ; echo
+echo "Executables are found in modipsl/bin"
+echo "Check that executable names correspond with the name set in config.card before launching the job"
+echo ls -lrt modipsl/bin
+ls -lrt $modipsl/bin
+
+date
+
+exit
+
+
Index: CONFIG/UNIFORM/v7/IPSLCM7ISO/define_config_iso.sh
===================================================================
--- CONFIG/UNIFORM/v7/IPSLCM7ISO/define_config_iso.sh	(revision 6746)
+++ CONFIG/UNIFORM/v7/IPSLCM7ISO/define_config_iso.sh	(revision 6746)
@@ -0,0 +1,125 @@
+#!/bin/bash
+#
+# define_config.sh is called from the main compilation script compile_ipslcm7.sh
+# The script will define which components to compile.
+# By default all availble components are compiled.
+#
+# Step 1: The avaible components are defined. 
+# Step 2: Define which components to compile. If argument [-subconfig subconfig] is set 
+#         to the main compilation script, a control if the components needed are avaiable. 
+#         If argument is subconfig is not set, the components defined in step 1 will be defined.
+
+
+### Step 1: Check available components possible to compile
+# LMDZ, ORCHIDEE and XIOS are considered mandatory and will not be checked.
+
+if [ -d ../../modeles/NEMO ] ; then
+    compnemo=y
+else
+    compnemo=n
+fi
+
+if [ -d ../../modeles/INCA ] ; then
+    compinca=y
+else
+    compinca=n
+fi
+
+if [ -d ../../modeles/DYNAMICO ] ; then
+    compdyna=y
+else
+    compdyna=n
+fi
+
+if [ -d ../../oasis3-mct ] ; then
+    compoasis=y
+else
+    compoasis=n
+fi
+
+
+
+### Step 2: Define which components to compile. Check if the configuration set as argument is possible
+if [ $subconfig == default ] ; then
+    echo ; echo Compilation of all availble components will be done:
+
+elif [ $subconfig == IPSLCM ] || [ $subconfig == IPSLCM-ico ] ; then
+    # Full coupled model currently without INCA
+    if [ $compdyna == n ] || [ $compoasis == n ] || [ $compnemo == n ] ; then
+        echo ; echo It is not possible to compile IPSLCM.
+        echo Source code is missing
+        exit
+    else
+        echo "Compilation of IPSLCM configuration (without INCA) will be done"
+        compnemo=y compoasis=y compdyna=y compinca=n complmdz=y comporch=y compxios=y
+    fi
+elif [ $subconfig == IPSLCM-reg ] ; then
+    # Coupled model without DYNAMICO and INCA
+    if [ $compoasis == n ] || [ $compnemo == n ] ; then
+        echo ; echo It is not possible to compile IPSLCM-reg.
+        echo Source code is missing
+        exit
+    else
+	echo "Compilation of IPSLCM-reg configuration (without INCA and DYNAMICO) will be done"
+        compnemo=y compoasis=y compdyna=n compinca=n complmdz=y comporch=y compxios=y
+        regular_latlon=y
+    fi
+elif [ $subconfig == ICOLMDZORINCA ] ; then
+    if [ $compinca == n ] || [ $compdyna == n ] ; then
+	echo ; echo It is not possible to compile ICOLMDZORINCA.
+	echo INCA or DYNAMICO source code is missing
+        exit
+    else
+	echo Compilation of ICOLMDZORINCA configuration will be done
+        compnemo=n compoasis=n compdyna=y compinca=y complmdz=y comporch=y compxios=y
+    fi	
+elif [ $subconfig == ICOLMDZOR ] ; then
+    if [ $compdyna == n ] ; then
+	echo ; echo It is not possible to compile ICOLMDZOR
+	echo DYNAMICO source code is missing
+        exit
+    else
+	echo Compilation of ICOLMDZOR configuration will be done
+        compnemo=n compoasis=n compdyna=y compinca=n complmdz=y comporch=y compxios=y
+    fi
+elif [ $subconfig == LMDZORINCA ] ; then
+    if [ $compinca == n ] ; then
+	echo ; 	echo It is not possible to compile LMDZORINCA.
+	echo INCA source code is missing
+        exit
+    else
+	regular_latlon=y
+	echo Compilation of regular LMDZORINCA configuration for grid $resol_atm will be done 
+        compnemo=n compoasis=n compdyna=n compinca=y complmdz=y comporch=y compxios=y
+    fi	
+elif [ $subconfig == LMDZOR ] ; then
+    # We always suppose that LMDZ and ORCHIDEE are extracted. No check needs to be done.
+    regular_latlon=y
+    echo Compilation of regular LMDZOR configuration for grid $resol_atm will be done
+    compnemo=n compoasis=n compdyna=n compinca=n complmdz=y comporch=y compxios=y
+elif [ $subconfig == LMDZISO ] ; then
+    regular_latlon=y
+    compiso=y
+    echo Compilation of regular LMDZISO configuration for grid $resol_atm will be done
+else
+    echo ; echo "The configuration $subconfig is not available"
+    echo "Choose between ICOLMDZORINCA, ICOLMDZOR, LMDZORINCA, LMDZOR"
+    echo "               IPSLCM or IPSLCM-reg" 
+    echo "Exit now"
+    exit
+fi
+echo compnemo=$compnemo compoasis=$compoasis compdyna=$compdyna compinca=$compinca complmdz=y comporch=y compxios=y
+echo ;
+
+
+# Coherence test for variable regular_latlon which can be set as input argument
+if [ $regular_latlon == yes ] || [ $regular_latlon == y ] ; then
+	regular_laton=y
+elif [ $regular_latlon == no ] || [ $regular_latlon == n ] ; then
+        regular_laton=n
+else
+	echo "regular_latlon=$regular_latlon : This option is not possible."
+	echo "Compile using argument '-regular_latlon' no or '-regular_latlon yes'" 
+	echo "Exit now"
+fi
+
