Index: LMDZ5/branches/testing/libf/phylmd/conf_phys_m.F90
===================================================================
--- LMDZ5/branches/testing/libf/phylmd/conf_phys_m.F90	(revision 2669)
+++ LMDZ5/branches/testing/libf/phylmd/conf_phys_m.F90	(revision 2720)
@@ -4,11 +4,11 @@
 !
 !
-module conf_phys_m
-
-  implicit none
-
-contains
-
-  subroutine conf_phys(ok_journe, ok_mensuel, ok_instan, ok_hf, &
+MODULE conf_phys_m
+
+  IMPLICIT NONE
+
+CONTAINS
+
+  SUBROUTINE conf_phys(ok_journe, ok_mensuel, ok_instan, ok_hf, &
        ok_LES,&
        callstats,&
@@ -23,11 +23,10 @@
        alp_offset)
 
-    use IOIPSL
+    USE IOIPSL
     USE surface_data
     USE phys_cal_mod
-    USE carbon_cycle_mod, ONLY : carbon_cycle_tr, carbon_cycle_cpl
-    USE mod_grid_phy_lmdz, only: klon_glo
+    USE carbon_cycle_mod,  ONLY: carbon_cycle_tr, carbon_cycle_cpl
+    USE mod_grid_phy_lmdz, ONLY: klon_glo
     USE print_control_mod, ONLY: lunout
-
 
     include "conema3.h"
@@ -70,8 +69,8 @@
 
     ! Sortie:
-    logical              :: ok_newmicro
-    integer              :: iflag_radia
-    logical              :: ok_journe, ok_mensuel, ok_instan, ok_hf
-    logical              :: ok_LES
+    LOGICAL              :: ok_newmicro
+    INTEGER              :: iflag_radia
+    LOGICAL              :: ok_journe, ok_mensuel, ok_instan, ok_hf
+    LOGICAL              :: ok_LES
     LOGICAL              :: callstats
     LOGICAL              :: ok_ade, ok_aie, ok_cdnc, aerosol_couple
@@ -81,18 +80,18 @@
     LOGICAL              :: new_aod
     REAL                 :: bl95_b0, bl95_b1
-    real                 :: fact_cldcon, facttemps,ratqsbas,ratqshaut,tau_ratqs
-    integer              :: iflag_cld_th
-    integer              :: iflag_ratqs
-
-    character (len = 6),SAVE  :: type_ocean_omp, version_ocean_omp, ocean_omp
-    character (len = 10),SAVE  :: type_veget_omp
-    CHARACTER(len = 8),SAVE   :: aer_type_omp
-    logical,SAVE              :: ok_snow_omp
-    logical,SAVE              :: ok_newmicro_omp
-    logical,SAVE              :: ok_all_xml_omp
-    logical,SAVE        :: ok_journe_omp, ok_mensuel_omp, ok_instan_omp, ok_hf_omp        
-    logical,SAVE        :: ok_LES_omp   
-    LOGICAL,SAVE        :: callstats_omp
-    LOGICAL,SAVE        :: ok_ade_omp, ok_aie_omp, ok_cdnc_omp, aerosol_couple_omp
+    REAL                 :: fact_cldcon, facttemps,ratqsbas,ratqshaut,tau_ratqs
+    INTEGER              :: iflag_cld_th
+    INTEGER              :: iflag_ratqs
+
+    CHARACTER (len = 6), SAVE  :: type_ocean_omp, version_ocean_omp, ocean_omp
+    CHARACTER (len = 10),SAVE  :: type_veget_omp
+    CHARACTER (len = 8), SAVE  :: aer_type_omp
+    LOGICAL, SAVE       :: ok_snow_omp
+    LOGICAL, SAVE       :: ok_newmicro_omp
+    LOGICAL, SAVE       :: ok_all_xml_omp
+    LOGICAL, SAVE       :: ok_journe_omp, ok_mensuel_omp, ok_instan_omp, ok_hf_omp        
+    LOGICAL, SAVE       :: ok_LES_omp   
+    LOGICAL, SAVE       :: callstats_omp
+    LOGICAL, SAVE       :: ok_ade_omp, ok_aie_omp, ok_cdnc_omp, aerosol_couple_omp
     INTEGER, SAVE       :: flag_aerosol_omp
     INTEGER, SAVE       :: flag_aerosol_strat_omp
@@ -102,50 +101,50 @@
     REAL,SAVE           :: freq_ISCCP_omp, ecrit_ISCCP_omp
     REAL,SAVE           :: freq_COSP_omp, freq_AIRS_omp 
-    real,SAVE           :: fact_cldcon_omp, facttemps_omp,ratqsbas_omp
-    real,SAVE           :: tau_cld_cv_omp, coefw_cld_cv_omp
-    integer,SAVE        :: iflag_cld_cv_omp
-
-
-    real,SAVE           :: ratqshaut_omp
-    real,SAVE           :: tau_ratqs_omp
+    REAL,SAVE           :: fact_cldcon_omp, facttemps_omp,ratqsbas_omp
+    REAL,SAVE           :: tau_cld_cv_omp, coefw_cld_cv_omp
+    INTEGER, SAVE       :: iflag_cld_cv_omp
+
+
+    REAL, SAVE          :: ratqshaut_omp
+    REAL, SAVE          :: tau_ratqs_omp
     REAL, SAVE          :: t_coupl_omp
-    integer,SAVE        :: iflag_radia_omp
-    integer,SAVE        :: iflag_rrtm_omp
-    integer,SAVE        :: iflag_albedo_omp !albedo SB
-    logical,save        :: ok_chlorophyll_omp ! albedo SB  
-    integer,SAVE        :: NSW_omp
-    integer,SAVE        :: iflag_cld_th_omp, ip_ebil_phy_omp
-    integer,SAVE        :: iflag_ratqs_omp
-
-    Real,SAVE           :: f_cdrag_ter_omp,f_cdrag_oce_omp
-    Real,SAVE           :: f_rugoro_omp   , z0min_omp
-    Real,SAVE           :: z0m_seaice_omp,z0h_seaice_omp
-    REAL,SAVE           :: min_wind_speed_omp,f_gust_wk_omp,f_gust_bl_omp,f_qsat_oce_omp, f_z0qh_oce_omp
-    INTEGER,SAVE        :: iflag_gusts_omp,iflag_z0_oce_omp
+    INTEGER, SAVE       :: iflag_radia_omp
+    INTEGER, SAVE       :: iflag_rrtm_omp
+    INTEGER, SAVE       :: iflag_albedo_omp !albedo SB
+    LOGICAL, SAVE       :: ok_chlorophyll_omp ! albedo SB  
+    INTEGER, SAVE       :: NSW_omp
+    INTEGER, SAVE       :: iflag_cld_th_omp, ip_ebil_phy_omp
+    INTEGER, SAVE       :: iflag_ratqs_omp
+
+    REAL, SAVE          :: f_cdrag_ter_omp,f_cdrag_oce_omp
+    REAL, SAVE          :: f_rugoro_omp   , z0min_omp
+    REAL, SAVE          :: z0m_seaice_omp,z0h_seaice_omp
+    REAL, SAVE          :: min_wind_speed_omp,f_gust_wk_omp,f_gust_bl_omp,f_qsat_oce_omp, f_z0qh_oce_omp
+    INTEGER, SAVE       :: iflag_gusts_omp,iflag_z0_oce_omp
 
     ! Local
-    real                 :: zzz
-
-    real :: seuil_inversion
-    real,save :: seuil_inversion_omp
-
-    integer,SAVE :: iflag_thermals_ed_omp,iflag_thermals_optflux_omp,iflag_thermals_closure_omp
-    real, SAVE :: fact_thermals_ed_dz_omp
-    integer,SAVE :: iflag_thermals_omp,nsplit_thermals_omp
-    real,save :: tau_thermals_omp,alp_bl_k_omp
+    REAL                 :: zzz
+
+    REAL :: seuil_inversion
+    REAL,SAVE :: seuil_inversion_omp
+
+    INTEGER,SAVE :: iflag_thermals_ed_omp,iflag_thermals_optflux_omp,iflag_thermals_closure_omp
+    REAL, SAVE :: fact_thermals_ed_dz_omp
+    INTEGER,SAVE :: iflag_thermals_omp,nsplit_thermals_omp
+    REAL,SAVE :: tau_thermals_omp,alp_bl_k_omp
     ! nrlmd le 10/04/2012
-    integer,SAVE :: iflag_trig_bl_omp,iflag_clos_bl_omp
-    integer,SAVE :: tau_trig_shallow_omp,tau_trig_deep_omp
-    real,SAVE    :: s_trig_omp
+    INTEGER,SAVE :: iflag_trig_bl_omp,iflag_clos_bl_omp
+    INTEGER,SAVE :: tau_trig_shallow_omp,tau_trig_deep_omp
+    REAL,SAVE    :: s_trig_omp
     ! fin nrlmd le 10/04/2012
-    real :: alp_offset
+    REAL :: alp_offset
     REAL, SAVE :: alp_offset_omp
-    integer,SAVE :: iflag_coupl_omp,iflag_clos_omp,iflag_wake_omp
-    integer,SAVE :: iflag_cvl_sigd_omp
+    INTEGER,SAVE :: iflag_coupl_omp,iflag_clos_omp,iflag_wake_omp
+    INTEGER,SAVE :: iflag_cvl_sigd_omp
     REAL, SAVE :: coef_clos_ls_omp
     REAL, SAVE :: supcrit1_omp, supcrit2_omp
     INTEGER, SAVE :: iflag_mix_omp
     INTEGER, SAVE :: iflag_mix_adiab_omp
-    real, save :: scut_omp, qqa1_omp, qqa2_omp, gammas_omp, Fmax_omp, alphas_omp
+    REAL, SAVE :: scut_omp, qqa1_omp, qqa2_omp, gammas_omp, Fmax_omp, alphas_omp
     REAL, SAVE :: tmax_fonte_cv_omp
 
@@ -187,5 +186,5 @@
     INTEGER,SAVE :: iflag_pbl_split_omp
     INTEGER,SAVE :: iflag_order2_sollw_omp
-    Integer, save :: lev_histins_omp, lev_histLES_omp 
+    INTEGER, SAVE :: lev_histins_omp, lev_histLES_omp 
     INTEGER, SAVE :: lev_histdayNMC_omp
     INTEGER, SAVE :: levout_histNMC_omp(3)
@@ -205,22 +204,23 @@
     LOGICAL,SAVE :: ok_lic_melt_omp
     !
-    LOGICAL,SAVE :: cycle_diurne_omp,soil_model_omp,new_oliq_omp
-    LOGICAL,SAVE :: ok_orodr_omp, ok_orolf_omp, ok_limitvrai_omp
+    LOGICAL,SAVE  :: cycle_diurne_omp,soil_model_omp,new_oliq_omp
+    LOGICAL,SAVE  :: ok_orodr_omp, ok_orolf_omp, ok_limitvrai_omp
     INTEGER, SAVE :: nbapp_rad_omp, iflag_con_omp
+    INTEGER, SAVE :: nbapp_cv_omp
     INTEGER, SAVE :: iflag_ener_conserv_omp
     LOGICAL, SAVE :: ok_conserv_q_omp
     INTEGER, SAVE :: iflag_fisrtilp_qsat_omp
     INTEGER, SAVE :: iflag_bergeron_omp
-    LOGICAL,SAVE :: ok_strato_omp
-    LOGICAL,SAVE :: ok_hines_omp, ok_gwd_rando_omp
-    real, SAVE:: gwd_rando_ruwmax_omp, gwd_rando_sat_omp
-    real, SAVE:: gwd_front_ruwmax_omp, gwd_front_sat_omp
-    real, save:: sso_gkdrag_omp,sso_grahil_omp,sso_grcrit_omp
-    real, save:: sso_gfrcri_omp,sso_gkwake_omp,sso_gklift_omp
-    LOGICAL,SAVE :: ok_qch4_omp
-    LOGICAL,SAVE      :: carbon_cycle_tr_omp
-    LOGICAL,SAVE      :: carbon_cycle_cpl_omp
-
-    integer, intent(out):: read_climoz ! read ozone climatology, OpenMP shared
+    LOGICAL,SAVE  :: ok_strato_omp
+    LOGICAL,SAVE  :: ok_hines_omp, ok_gwd_rando_omp
+    REAL, SAVE    :: gwd_rando_ruwmax_omp, gwd_rando_sat_omp
+    REAL, SAVE    :: gwd_front_ruwmax_omp, gwd_front_sat_omp
+    REAL, SAVE    :: sso_gkdrag_omp,sso_grahil_omp,sso_grcrit_omp
+    REAL, SAVE    :: sso_gfrcri_omp,sso_gkwake_omp,sso_gklift_omp
+    LOGICAL,SAVE  :: ok_qch4_omp
+    LOGICAL,SAVE  :: carbon_cycle_tr_omp
+    LOGICAL,SAVE  :: carbon_cycle_cpl_omp
+
+    INTEGER, INTENT(OUT):: read_climoz ! read ozone climatology, OpenMP shared
     ! Allowed values are 0, 1 and 2
     ! 0: do not read an ozone climatology
@@ -239,5 +239,5 @@
     !
     type_ocean_omp = 'force '
-    call getin('type_ocean', type_ocean_omp)
+    CALL getin('type_ocean', type_ocean_omp)
     !
     !Config Key  = version_ocean 
@@ -247,5 +247,5 @@
     !
     version_ocean_omp = 'xxxxxx'
-    call getin('version_ocean', version_ocean_omp)
+    CALL getin('version_ocean', version_ocean_omp)
 
     !Config Key  = OCEAN
@@ -255,5 +255,5 @@
     !
     ocean_omp = 'yyyyyy'
-    call getin('OCEAN', ocean_omp)
+    CALL getin('OCEAN', ocean_omp)
     IF (ocean_omp /= 'yyyyyy') THEN
        WRITE(lunout,*)'ERROR! Old variable name OCEAN used in parmeter file.'
@@ -261,5 +261,5 @@
        WRITE(lunout,*)'You have to update your parameter file physiq.def to succed running'
        CALL abort_physic('conf_phys','Variable OCEAN no longer existing, use variable name type_ocean',1)
-    END IF
+    ENDIF
 
     !Config Key  = t_coupl
@@ -269,19 +269,19 @@
     !
     t_coupl_omp = 86400.
-    call getin('t_coupl', t_coupl_omp)
+    CALL getin('t_coupl', t_coupl_omp)
     IF (t_coupl_omp == 0) THEN
        WRITE(lunout,*)'ERROR! Timestep of coupling between atmosphere and ocean'
        WRITE(lunout,*)'cannot be zero.'
        CALL abort_physic('conf_phys','t_coupl = 0.',1)
-    END IF
+    ENDIF
 
     !
     !Config Key  = ok_all_xml 
     !Config Desc = utiliser les xml pourles définitions des champs pour xios
-    !Config Def  = .false.
-    !Config Help = 
-    !
-    ok_all_xml_omp = .false.
-    call getin('ok_all_xml', ok_all_xml_omp)
+    !Config Def  = .FALSE.
+    !Config Help = 
+    !
+    ok_all_xml_omp = .FALSE.
+    CALL getin('ok_all_xml', ok_all_xml_omp)
     !
 
@@ -289,9 +289,9 @@
     !Config Key  = VEGET 
     !Config Desc = Type de modele de vegetation
-    !Config Def  = .false.
+    !Config Def  = .FALSE.
     !Config Help = Type de modele de vegetation utilise
     !
     type_veget_omp ='orchidee'
-    call getin('VEGET', type_veget_omp)
+    CALL getin('VEGET', type_veget_omp)
     !
 
@@ -299,77 +299,77 @@
     !Config Key  = ok_snow
     !Config Desc = Flag to activate snow model SISVAT
-    !Config Def  = .false.
-    ok_snow_omp = .false.
-    call getin('ok_snow', ok_snow_omp)
+    !Config Def  = .FALSE.
+    ok_snow_omp = .FALSE.
+    CALL getin('ok_snow', ok_snow_omp)
     ! Martin
 
     !Config Key  = OK_journe
     !Config Desc = Pour des sorties journalieres 
-    !Config Def  = .false.
+    !Config Def  = .FALSE.
     !Config Help = Pour creer le fichier histday contenant les sorties
     !              journalieres 
     !
-    ok_journe_omp = .false.
-    call getin('OK_journe', ok_journe_omp)
+    ok_journe_omp = .FALSE.
+    CALL getin('OK_journe', ok_journe_omp)
     !
     !Config Key  = ok_hf
     !Config Desc = Pour des sorties haute frequence
-    !Config Def  = .false.
+    !Config Def  = .FALSE.
     !Config Help = Pour creer le fichier histhf contenant les sorties
     !              haute frequence ( 3h ou 6h)
     !
-    ok_hf_omp = .false.
-    call getin('ok_hf', ok_hf_omp)
+    ok_hf_omp = .FALSE.
+    CALL getin('ok_hf', ok_hf_omp)
     !
     !Config Key  = OK_mensuel
     !Config Desc = Pour des sorties mensuelles 
-    !Config Def  = .true.
+    !Config Def  = .TRUE.
     !Config Help = Pour creer le fichier histmth contenant les sorties
     !              mensuelles 
     !
-    ok_mensuel_omp = .true.
-    call getin('OK_mensuel', ok_mensuel_omp)
+    ok_mensuel_omp = .TRUE.
+    CALL getin('OK_mensuel', ok_mensuel_omp)
     !
     !Config Key  = OK_instan
     !Config Desc = Pour des sorties instantanees 
-    !Config Def  = .false.
+    !Config Def  = .FALSE.
     !Config Help = Pour creer le fichier histins contenant les sorties
     !              instantanees 
     !
-    ok_instan_omp = .false.
-    call getin('OK_instan', ok_instan_omp)
+    ok_instan_omp = .FALSE.
+    CALL getin('OK_instan', ok_instan_omp)
     !
     !Config Key  = ok_ade
     !Config Desc = Aerosol direct effect or not?
-    !Config Def  = .false.
+    !Config Def  = .FALSE.
     !Config Help = Used in radlwsw.F
     !
-    ok_ade_omp = .false.
-    call getin('ok_ade', ok_ade_omp)
+    ok_ade_omp = .FALSE.
+    CALL getin('ok_ade', ok_ade_omp)
 
     !
     !Config Key  = ok_aie
     !Config Desc = Aerosol indirect effect or not?
-    !Config Def  = .false.
+    !Config Def  = .FALSE.
     !Config Help = Used in nuage.F and radlwsw.F
     !
-    ok_aie_omp = .false.
-    call getin('ok_aie', ok_aie_omp)
+    ok_aie_omp = .FALSE.
+    CALL getin('ok_aie', ok_aie_omp)
 
     !
     !Config Key  = ok_cdnc
     !Config Desc = ok cloud droplet number concentration
-    !Config Def  = .false.
+    !Config Def  = .FALSE.
     !Config Help = Used in newmicro.F
     !
-    ok_cdnc_omp = .false.
-    call getin('ok_cdnc', ok_cdnc_omp)
+    ok_cdnc_omp = .FALSE.
+    CALL getin('ok_cdnc', ok_cdnc_omp)
     !
     !Config Key  = aerosol_couple
     !Config Desc = read aerosol in file or calcul by inca
-    !Config Def  = .false.
+    !Config Def  = .FALSE.
     !Config Help = Used in physiq.F
     !
-    aerosol_couple_omp = .false.
+    aerosol_couple_omp = .FALSE.
     CALL getin('aerosol_couple',aerosol_couple_omp)
     !
@@ -410,5 +410,5 @@
     !Config Help = Used in physiq.F / aeropt
     !
-    flag_bc_internal_mixture_omp = .false.
+    flag_bc_internal_mixture_omp = .FALSE.
     CALL getin('flag_bc_internal_mixture',flag_bc_internal_mixture_omp)
 
@@ -416,8 +416,8 @@
     !Config Key  = new_aod
     !Config Desc = which calcul of aeropt
-    !Config Def  = false
+    !Config Def  = FALSE
     !Config Help = Used in physiq.F
     !
-    new_aod_omp = .true.
+    new_aod_omp = .TRUE.
     CALL getin('new_aod',new_aod_omp)
 
@@ -429,22 +429,22 @@
     ! 
     aer_type_omp = 'scenario' 
-    call getin('aer_type', aer_type_omp) 
+    CALL getin('aer_type', aer_type_omp) 
 
     !
     !Config Key  = bl95_b0
     !Config Desc = Parameter in CDNC-maer link (Boucher&Lohmann 1995)
-    !Config Def  = .false.
+    !Config Def  = .FALSE.
     !Config Help = Used in nuage.F
     !
     bl95_b0_omp = 2.
-    call getin('bl95_b0', bl95_b0_omp)
+    CALL getin('bl95_b0', bl95_b0_omp)
 
     !Config Key  = bl95_b1
     !Config Desc = Parameter in CDNC-maer link (Boucher&Lohmann 1995)
-    !Config Def  = .false.
+    !Config Def  = .FALSE.
     !Config Help = Used in nuage.F
     !
     bl95_b1_omp = 0.2
-    call getin('bl95_b1', bl95_b1_omp)
+    CALL getin('bl95_b1', bl95_b1_omp)
 
     !Config Key  = freq_ISCCP
@@ -455,5 +455,5 @@
     !
     freq_ISCCP_omp = 10800.
-    call getin('freq_ISCCP', freq_ISCCP_omp)
+    CALL getin('freq_ISCCP', freq_ISCCP_omp)
     !
     !Config Key  = ecrit_ISCCP
@@ -465,5 +465,5 @@
     !
     ecrit_ISCCP_omp = 1.
-    call getin('ecrit_ISCCP', ecrit_ISCCP_omp)
+    CALL getin('ecrit_ISCCP', ecrit_ISCCP_omp)
 
     !Config Key  = freq_COSP
@@ -474,5 +474,5 @@
     !
     freq_COSP_omp = 10800.
-    call getin('freq_COSP', freq_COSP_omp)
+    CALL getin('freq_COSP', freq_COSP_omp)
 
     !Config Key  = freq_AIRS
@@ -483,5 +483,5 @@
     !
     freq_AIRS_omp = 10800.
-    call getin('freq_AIRS', freq_AIRS_omp)
+    CALL getin('freq_AIRS', freq_AIRS_omp)
 
     !
@@ -492,5 +492,9 @@
     !               
     ip_ebil_phy_omp = 0
-    call getin('ip_ebil_phy', ip_ebil_phy_omp)
+    CALL getin('ip_ebil_phy', ip_ebil_phy_omp)
+    IF (ip_ebil_phy_omp/=0) THEN
+       CALL abort_physic('conf_phys','ip_ebil_phy_omp doit etre 0 sur cette version',1)
+    ENDIF
+
     !
     !Config Key  = seuil_inversion
@@ -500,5 +504,5 @@
     !               
     seuil_inversion_omp = -0.1
-    call getin('seuil_inversion', seuil_inversion_omp)
+    CALL getin('seuil_inversion', seuil_inversion_omp)
 
     !
@@ -512,5 +516,5 @@
     !valeur AMIP II
     R_ecc_omp = 0.016715
-    call getin('R_ecc', R_ecc_omp)
+    CALL getin('R_ecc', R_ecc_omp)
     !
     !Config Key  = R_peri
@@ -522,5 +526,5 @@
     !valeur AMIP II
     R_peri_omp = 102.7
-    call getin('R_peri', R_peri_omp)
+    CALL getin('R_peri', R_peri_omp)
     !
     !Config Key  = R_incl
@@ -532,5 +536,5 @@
     !valeur AMIP II
     R_incl_omp = 23.441
-    call getin('R_incl', R_incl_omp)
+    CALL getin('R_incl', R_incl_omp)
     !
     !Config Key  = solaire
@@ -542,15 +546,15 @@
     !valeur AMIP II
     solaire_omp = 1365.
-    call getin('solaire', solaire_omp)
+    CALL getin('solaire', solaire_omp)
     !
     !Config Key  = ok_sun_time
     !Config Desc = oui ou non variabilite solaire
-    !Config Def  = .false.
+    !Config Def  = .FALSE.
     !Config Help =
     !
     !
     !valeur AMIP II
-    ok_suntime_rrtm_omp = .false.
-    call getin('ok_suntime_rrtm',ok_suntime_rrtm_omp)
+    ok_suntime_rrtm_omp = .FALSE.
+    CALL getin('ok_suntime_rrtm',ok_suntime_rrtm_omp)
     !
     !Config Key  = co2_ppm
@@ -562,5 +566,5 @@
     !valeur AMIP II
     co2_ppm_omp = 348.
-    call getin('co2_ppm', co2_ppm_omp)
+    CALL getin('co2_ppm', co2_ppm_omp)
     !
     !Config Key  = RCO2
@@ -574,5 +578,5 @@
     RCO2_omp = co2_ppm_omp * 1.0e-06  * 44.011/28.97 ! pour co2_ppm=348.
 
-    !  call getin('RCO2', RCO2)
+    !  CALL getin('RCO2', RCO2)
     !
     !Config Key  = RCH4
@@ -588,7 +592,7 @@
     !ancienne valeur
     ! RCH4 = 1.72E-06* 16.043/28.97
-    !OK call getin('RCH4', RCH4)
+    !OK CALL getin('RCH4', RCH4)
     zzz = 1650.
-    call getin('CH4_ppb', zzz)
+    CALL getin('CH4_ppb', zzz)
     CH4_ppb_omp = zzz
     RCH4_omp = CH4_ppb_omp * 1.0E-09 * 16.043/28.97
@@ -606,7 +610,7 @@
     !ancienne valeur
     ! RN2O = 310.E-09* 44.013/28.97
-    !OK  call getin('RN2O', RN2O)
+    !OK  CALL getin('RN2O', RN2O)
     zzz=306.
-    call getin('N2O_ppb', zzz)
+    CALL getin('N2O_ppb', zzz)
     N2O_ppb_omp = zzz
     RN2O_omp = N2O_ppb_omp * 1.0E-09 * 44.013/28.97
@@ -620,9 +624,9 @@
     !OK RCFC11 = 280.E-12* 137.3686/28.97
     zzz = 280.
-    call getin('CFC11_ppt',zzz)
+    CALL getin('CFC11_ppt',zzz)
     CFC11_ppt_omp = zzz
     RCFC11_omp=CFC11_ppt_omp* 1.0E-12 * 137.3686/28.97
     ! RCFC11 = 1.327690990680013E-09
-    !OK call getin('RCFC11', RCFC11)
+    !OK CALL getin('RCFC11', RCFC11)
     !
     !Config Key  = RCFC12
@@ -634,9 +638,9 @@
     !OK RCFC12 = 484.E-12* 120.9140/28.97
     zzz = 484.
-    call getin('CFC12_ppt',zzz)
+    CALL getin('CFC12_ppt',zzz)
     CFC12_ppt_omp = zzz
     RCFC12_omp = CFC12_ppt_omp * 1.0E-12 * 120.9140/28.97
     ! RCFC12 = 2.020102726958923E-09
-    !OK call getin('RCFC12', RCFC12)
+    !OK CALL getin('RCFC12', RCFC12)
 
     !ajout CFMIP begin
@@ -648,5 +652,5 @@
     !               
     co2_ppm_per_omp = co2_ppm_omp
-    call getin('co2_ppm_per', co2_ppm_per_omp)
+    CALL getin('co2_ppm_per', co2_ppm_per_omp)
     !
     !Config Key  = RCO2_per
@@ -660,9 +664,9 @@
     !Config Key  = ok_4xCO2atm
     !Config Desc = Calcul ou non effet radiatif 4xco2
-    !Config Def  = .false.
-    !Config Help = 
-
-    ok_4xCO2atm_omp = .false.
-    call getin('ok_4xCO2atm',ok_4xCO2atm_omp)
+    !Config Def  = .FALSE.
+    !Config Help = 
+
+    ok_4xCO2atm_omp = .FALSE.
+    CALL getin('ok_4xCO2atm',ok_4xCO2atm_omp)
 
     !Config Key  = RCH4_per
@@ -672,5 +676,5 @@
     !               
     zzz = CH4_ppb_omp
-    call getin('CH4_ppb_per', zzz)
+    CALL getin('CH4_ppb_per', zzz)
     CH4_ppb_per_omp = zzz
     RCH4_per_omp = CH4_ppb_per_omp * 1.0E-09 * 16.043/28.97
@@ -682,5 +686,5 @@
     !               
     zzz = N2O_ppb_omp
-    call getin('N2O_ppb_per', zzz)
+    CALL getin('N2O_ppb_per', zzz)
     N2O_ppb_per_omp = zzz
     RN2O_per_omp = N2O_ppb_per_omp * 1.0E-09 * 44.013/28.97
@@ -692,5 +696,5 @@
     !               
     zzz = CFC11_ppt_omp
-    call getin('CFC11_ppt_per',zzz)
+    CALL getin('CFC11_ppt_per',zzz)
     CFC11_ppt_per_omp = zzz
     RCFC11_per_omp=CFC11_ppt_per_omp* 1.0E-12 * 137.3686/28.97
@@ -702,5 +706,5 @@
     !               
     zzz = CFC12_ppt_omp
-    call getin('CFC12_ppt_per',zzz)
+    CALL getin('CFC12_ppt_per',zzz)
     CFC12_ppt_per_omp = zzz
     RCFC12_per_omp = CFC12_ppt_per_omp * 1.0E-12 * 120.9140/28.97
@@ -778,4 +782,12 @@
     CALL getin('iflag_con',iflag_con_omp)
 
+    !Config  Key  = nbapp_cv
+    !Config  Desc = Frequence d'appel a la convection
+    !Config  Def  = 0
+    !Config  Help = Nombre  d'appels des routines de convection
+    !Config         par jour. Si =0, appel a chaque pas de temps physique.
+    nbapp_cv_omp = 0
+    CALL getin('nbapp_cv',nbapp_cv_omp)
+
     !Config  Key  = iflag_ener_conserv
     !Config  Desc = Flag de convection
@@ -851,16 +863,16 @@
     !
     epmax_omp = .993
-    call getin('epmax', epmax_omp)
+    CALL getin('epmax', epmax_omp)
 
     coef_epmax_cape_omp = 0.0   
-    call getin('coef_epmax_cape', coef_epmax_cape_omp)        
+    CALL getin('coef_epmax_cape', coef_epmax_cape_omp)        
     !
     !Config Key  = ok_adj_ema
     !Config Desc =  
-    !Config Def  = false
-    !Config Help = 
-    !
-    ok_adj_ema_omp = .false.
-    call getin('ok_adj_ema',ok_adj_ema_omp)
+    !Config Def  = FALSE
+    !Config Help = 
+    !
+    ok_adj_ema_omp = .FALSE.
+    CALL getin('ok_adj_ema',ok_adj_ema_omp)
     !
     !Config Key  = iflag_clw
@@ -870,5 +882,5 @@
     !
     iflag_clw_omp = 0
-    call getin('iflag_clw',iflag_clw_omp)
+    CALL getin('iflag_clw',iflag_clw_omp)
     !
     !Config Key  = cld_lc_lsc 
@@ -878,5 +890,5 @@
     !
     cld_lc_lsc_omp = 2.6e-4
-    call getin('cld_lc_lsc',cld_lc_lsc_omp)
+    CALL getin('cld_lc_lsc',cld_lc_lsc_omp)
     !
     !Config Key  = cld_lc_con
@@ -886,5 +898,5 @@
     !
     cld_lc_con_omp = 2.6e-4
-    call getin('cld_lc_con',cld_lc_con_omp)
+    CALL getin('cld_lc_con',cld_lc_con_omp)
     !
     !Config Key  = cld_tau_lsc
@@ -894,5 +906,5 @@
     !
     cld_tau_lsc_omp = 3600.
-    call getin('cld_tau_lsc',cld_tau_lsc_omp)
+    CALL getin('cld_tau_lsc',cld_tau_lsc_omp)
     !
     !Config Key  = cld_tau_con
@@ -902,5 +914,5 @@
     !
     cld_tau_con_omp = 3600.
-    call getin('cld_tau_con',cld_tau_con_omp)
+    CALL getin('cld_tau_con',cld_tau_con_omp)
     !
     !Config Key  = ffallv_lsc
@@ -910,5 +922,5 @@
     !
     ffallv_lsc_omp = 1.
-    call getin('ffallv_lsc',ffallv_lsc_omp)
+    CALL getin('ffallv_lsc',ffallv_lsc_omp)
     !
     !Config Key  = ffallv_con
@@ -918,5 +930,5 @@
     !
     ffallv_con_omp = 1.
-    call getin('ffallv_con',ffallv_con_omp)
+    CALL getin('ffallv_con',ffallv_con_omp)
     !
     !Config Key  = coef_eva
@@ -926,13 +938,13 @@
     !
     coef_eva_omp = 2.e-5
-    call getin('coef_eva',coef_eva_omp)
+    CALL getin('coef_eva',coef_eva_omp)
     !
     !Config Key  = reevap_ice
     !Config Desc =  
-    !Config Def  = .false.
-    !Config Help = 
-    !
-    reevap_ice_omp = .false.
-    call getin('reevap_ice',reevap_ice_omp)
+    !Config Def  = .FALSE.
+    !Config Help = 
+    !
+    reevap_ice_omp = .FALSE.
+    CALL getin('reevap_ice',reevap_ice_omp)
 
     !Config Key  = iflag_ratqs
@@ -942,5 +954,5 @@
     !
     iflag_ratqs_omp = 1
-    call getin('iflag_ratqs',iflag_ratqs_omp)
+    CALL getin('iflag_ratqs',iflag_ratqs_omp)
 
     !
@@ -951,5 +963,5 @@
     !
     iflag_radia_omp = 1
-    call getin('iflag_radia',iflag_radia_omp)
+    CALL getin('iflag_radia',iflag_radia_omp)
 
     !
@@ -960,5 +972,5 @@
     !
     iflag_rrtm_omp = 0
-    call getin('iflag_rrtm',iflag_rrtm_omp)
+    CALL getin('iflag_rrtm',iflag_rrtm_omp)
 
     !
@@ -969,11 +981,11 @@
     !
     NSW_omp = 2
-    call getin('NSW',NSW_omp)
+    CALL getin('NSW',NSW_omp)
     !albedo SB >>>
     iflag_albedo_omp = 0
-    call getin('iflag_albedo',iflag_albedo_omp)
-
-    ok_chlorophyll_omp=.false.
-    call getin('ok_chlorophyll',ok_chlorophyll_omp)
+    CALL getin('iflag_albedo',iflag_albedo_omp)
+
+    ok_chlorophyll_omp=.FALSE.
+    CALL getin('ok_chlorophyll',ok_chlorophyll_omp)
     !albedo SB <<<
 
@@ -988,8 +1000,8 @@
     ! pour assurer une retrocompatiblite.
     ! A abandonner un jour
-    call getin('iflag_cldcon',iflag_cld_th_omp)
-    call getin('iflag_cld_th',iflag_cld_th_omp)
+    CALL getin('iflag_cldcon',iflag_cld_th_omp)
+    CALL getin('iflag_cld_th',iflag_cld_th_omp)
     iflag_cld_cv_omp = 0 
-    call getin('iflag_cld_cv',iflag_cld_cv_omp)
+    CALL getin('iflag_cld_cv',iflag_cld_cv_omp)
 
     !
@@ -1000,5 +1012,5 @@
     !
     tau_cld_cv_omp = 10.
-    call getin('tau_cld_cv',tau_cld_cv_omp)
+    CALL getin('tau_cld_cv',tau_cld_cv_omp)
 
     !
@@ -1009,5 +1021,5 @@
     !
     coefw_cld_cv_omp = 0.1
-    call getin('coefw_cld_cv',coefw_cld_cv_omp)
+    CALL getin('coefw_cld_cv',coefw_cld_cv_omp)
 
 
@@ -1021,5 +1033,5 @@
     !
     iflag_pdf_omp = 0
-    call getin('iflag_pdf',iflag_pdf_omp)
+    CALL getin('iflag_pdf',iflag_pdf_omp)
     !
     !Config Key  = fact_cldcon
@@ -1029,5 +1041,5 @@
     !
     fact_cldcon_omp = 0.375
-    call getin('fact_cldcon',fact_cldcon_omp)
+    CALL getin('fact_cldcon',fact_cldcon_omp)
 
     !
@@ -1038,14 +1050,14 @@
     !
     facttemps_omp = 1.e-4
-    call getin('facttemps',facttemps_omp)
+    CALL getin('facttemps',facttemps_omp)
 
     !
     !Config Key  = ok_newmicro
     !Config Desc =  
-    !Config Def  = .true.
-    !Config Help = 
-    !
-    ok_newmicro_omp = .true.
-    call getin('ok_newmicro',ok_newmicro_omp)
+    !Config Def  = .TRUE.
+    !Config Help = 
+    !
+    ok_newmicro_omp = .TRUE.
+    CALL getin('ok_newmicro',ok_newmicro_omp)
     !
     !Config Key  = ratqsbas
@@ -1055,5 +1067,5 @@
     !
     ratqsbas_omp = 0.01
-    call getin('ratqsbas',ratqsbas_omp)
+    CALL getin('ratqsbas',ratqsbas_omp)
     !
     !Config Key  = ratqshaut
@@ -1063,5 +1075,5 @@
     !
     ratqshaut_omp = 0.3
-    call getin('ratqshaut',ratqshaut_omp)
+    CALL getin('ratqshaut',ratqshaut_omp)
 
     !Config Key  = tau_ratqs
@@ -1071,5 +1083,5 @@
     !
     tau_ratqs_omp = 1800.
-    call getin('tau_ratqs',tau_ratqs_omp)
+    CALL getin('tau_ratqs',tau_ratqs_omp)
 
     !
@@ -1083,5 +1095,5 @@
     !
     solarlong0_omp = -999.999
-    call getin('solarlong0',solarlong0_omp)
+    CALL getin('solarlong0',solarlong0_omp)
     !
     !-----------------------------------------------------------------------
@@ -1090,9 +1102,9 @@
     ! Default value -1 to activate the full computation
     qsol0_omp = -1.
-    call getin('qsol0',qsol0_omp)
+    CALL getin('qsol0',qsol0_omp)
     evap0_omp = -1.
-    call getin('evap0',evap0_omp)
+    CALL getin('evap0',evap0_omp)
     albsno0_omp = -1.
-    call getin('albsno0',albsno0_omp)
+    CALL getin('albsno0',albsno0_omp)
     !
     !-----------------------------------------------------------------------
@@ -1104,5 +1116,5 @@
     !
     inertie_ice_omp = 2000.
-    call getin('inertie_ice',inertie_ice_omp)
+    CALL getin('inertie_ice',inertie_ice_omp)
     !
     !Config Key  = inertie_sno
@@ -1112,5 +1124,5 @@
     !
     inertie_sno_omp = 2000.
-    call getin('inertie_sno',inertie_sno_omp)
+    CALL getin('inertie_sno',inertie_sno_omp)
     !
     !Config Key  = inertie_sol
@@ -1120,5 +1132,5 @@
     !
     inertie_sol_omp = 2000.
-    call getin('inertie_sol',inertie_sol_omp)
+    CALL getin('inertie_sol',inertie_sol_omp)
 
     !
@@ -1129,5 +1141,5 @@
     !
     rad_froid_omp = 35.0
-    call getin('rad_froid',rad_froid_omp)
+    CALL getin('rad_froid',rad_froid_omp)
 
     !
@@ -1138,5 +1150,5 @@
     !
     rad_chau1_omp = 13.0
-    call getin('rad_chau1',rad_chau1_omp)
+    CALL getin('rad_chau1',rad_chau1_omp)
 
     !
@@ -1147,5 +1159,5 @@
     !
     rad_chau2_omp = 9.0
-    call getin('rad_chau2',rad_chau2_omp)
+    CALL getin('rad_chau2',rad_chau2_omp)
 
     !
@@ -1156,5 +1168,5 @@
     !
     t_glace_min_omp = 258.
-    call getin('t_glace_min',t_glace_min_omp)
+    CALL getin('t_glace_min',t_glace_min_omp)
 
     !
@@ -1165,5 +1177,5 @@
     !
     t_glace_max_omp = 273.13
-    call getin('t_glace_max',t_glace_max_omp)
+    CALL getin('t_glace_max',t_glace_max_omp)
 
     !
@@ -1174,5 +1186,5 @@
     !
     exposant_glace_omp = 1.
-    call getin('exposant_glace',exposant_glace_omp)
+    CALL getin('exposant_glace',exposant_glace_omp)
 
     !
@@ -1183,5 +1195,5 @@
     !
     iflag_t_glace_omp = 0
-    call getin('iflag_t_glace',iflag_t_glace_omp)
+    CALL getin('iflag_t_glace',iflag_t_glace_omp)
 
     !
@@ -1192,5 +1204,5 @@
     !
     iflag_cloudth_vert_omp = 0
-    call getin('iflag_cloudth_vert',iflag_cloudth_vert_omp)
+    CALL getin('iflag_cloudth_vert',iflag_cloudth_vert_omp)
 
     !
@@ -1201,5 +1213,5 @@
     !
     iflag_ice_thermo_omp = 0
-    call getin('iflag_ice_thermo',iflag_ice_thermo_omp)
+    CALL getin('iflag_ice_thermo',iflag_ice_thermo_omp)
 
     !Config Key  = rei_min
@@ -1209,5 +1221,5 @@
     !
     rei_min_omp = 3.5
-    call getin('rei_min',rei_min_omp)
+    CALL getin('rei_min',rei_min_omp)
 
     !
@@ -1218,5 +1230,5 @@
     !
     rei_max_omp = 61.29
-    call getin('rei_max',rei_max_omp)
+    CALL getin('rei_max',rei_max_omp)
 
     !
@@ -1227,5 +1239,5 @@
     !
     top_height_omp = 3
-    call getin('top_height',top_height_omp)
+    CALL getin('top_height',top_height_omp)
 
     !
@@ -1236,8 +1248,6 @@
     !
     overlap_omp = 3
-    call getin('overlap',overlap_omp)
-
-
-    !
+    CALL getin('overlap',overlap_omp)
+
     !
     !Config Key  = cdmmax
@@ -1247,5 +1257,5 @@
     !
     cdmmax_omp = 1.3E-3
-    call getin('cdmmax',cdmmax_omp)
+    CALL getin('cdmmax',cdmmax_omp)
 
     !
@@ -1256,5 +1266,5 @@
     !
     cdhmax_omp = 1.1E-3
-    call getin('cdhmax',cdhmax_omp)
+    CALL getin('cdhmax',cdhmax_omp)
 
     !261103
@@ -1266,5 +1276,5 @@
     !
     ksta_omp = 1.0e-10
-    call getin('ksta',ksta_omp)
+    CALL getin('ksta',ksta_omp)
 
     !
@@ -1275,5 +1285,5 @@
     !
     ksta_ter_omp = 1.0e-10
-    call getin('ksta_ter',ksta_ter_omp)
+    CALL getin('ksta_ter',ksta_ter_omp)
 
     !Config Key  = f_ri_cd_min
@@ -1283,18 +1293,17 @@
     !
     f_ri_cd_min_omp = 0.1
-    call getin('f_ri_cd_min',f_ri_cd_min_omp)
+    CALL getin('f_ri_cd_min',f_ri_cd_min_omp)
 
     !
     !Config Key  = ok_kzmin
     !Config Desc =
-    !Config Def  = .true.
-    !Config Help =
-    !
-    ok_kzmin_omp = .true.
-    call getin('ok_kzmin',ok_kzmin_omp)
+    !Config Def  = .TRUE.
+    !Config Help =
+    !
+    ok_kzmin_omp = .TRUE.
+    CALL getin('ok_kzmin',ok_kzmin_omp)
 
     pbl_lmixmin_alpha_omp=0.0
-    call getin('pbl_lmixmin_alpha',pbl_lmixmin_alpha_omp)
-
+    CALL getin('pbl_lmixmin_alpha',pbl_lmixmin_alpha_omp)
 
     !
@@ -1305,5 +1314,5 @@
     !
     fmagic_omp = 1.
-    call getin('fmagic',fmagic_omp)
+    CALL getin('fmagic',fmagic_omp)
 
     !
@@ -1314,13 +1323,13 @@
     !
     pmagic_omp = 0.
-    call getin('pmagic',pmagic_omp)
+    CALL getin('pmagic',pmagic_omp)
 
 
     !Config Key = ok_lic_melt
     !Config Desc = Prise en compte de la fonte de la calotte dans le bilan d'eau
-    !Config Def  = .false.
-    !Config Help = mettre a .false. pour assurer la conservation en eau
-    ok_lic_melt_omp = .false.
-    call getin('ok_lic_melt', ok_lic_melt_omp)
+    !Config Def  = .FALSE.
+    !Config Help = mettre a .FALSE. pour assurer la conservation en eau
+    ok_lic_melt_omp = .FALSE.
+    CALL getin('ok_lic_melt', ok_lic_melt_omp)
 
     !
@@ -1334,5 +1343,5 @@
     !
     iflag_pbl_omp = 1
-    call getin('iflag_pbl',iflag_pbl_omp)
+    CALL getin('iflag_pbl',iflag_pbl_omp)
     !
     !Config Key  = iflag_pbl_split
@@ -1342,5 +1351,5 @@
     !
     iflag_pbl_split_omp = 0
-    call getin('iflag_pbl_split',iflag_pbl_split_omp)
+    CALL getin('iflag_pbl_split',iflag_pbl_split_omp)
     !
     !Config Key  = iflag_order2_sollw
@@ -1350,5 +1359,5 @@
     !
     iflag_order2_sollw_omp = 0
-    call getin('iflag_order2_sollw',iflag_order2_sollw_omp)
+    CALL getin('iflag_order2_sollw',iflag_order2_sollw_omp)
     !
     !Config Key  = iflag_thermals
@@ -1358,5 +1367,5 @@
     !
     iflag_thermals_omp = 0
-    call getin('iflag_thermals',iflag_thermals_omp)
+    CALL getin('iflag_thermals',iflag_thermals_omp)
     !
     !Config Key  = iflag_thermals_ed
@@ -1367,5 +1376,5 @@
     fact_thermals_ed_dz_omp = 0.1
 
-    call getin('fact_thermals_ed_dz',fact_thermals_ed_dz_omp)
+    CALL getin('fact_thermals_ed_dz',fact_thermals_ed_dz_omp)
     !
     !
@@ -1376,5 +1385,5 @@
     !
     iflag_thermals_ed_omp = 0
-    call getin('iflag_thermals_ed',iflag_thermals_ed_omp)
+    CALL getin('iflag_thermals_ed',iflag_thermals_ed_omp)
     !
     !
@@ -1385,5 +1394,5 @@
     !
     iflag_thermals_optflux_omp = 0
-    call getin('iflag_thermals_optflux',iflag_thermals_optflux_omp)
+    CALL getin('iflag_thermals_optflux',iflag_thermals_optflux_omp)
     !
     !Config Key  = iflag_thermals_closure
@@ -1393,8 +1402,5 @@
     !
     iflag_thermals_closure_omp = 1
-    call getin('iflag_thermals_closure',iflag_thermals_closure_omp)
-    !
-    !
-    !
+    CALL getin('iflag_thermals_closure',iflag_thermals_closure_omp)
     !
     !Config Key  = nsplit_thermals
@@ -1404,5 +1410,5 @@
     !
     nsplit_thermals_omp = 1
-    call getin('nsplit_thermals',nsplit_thermals_omp)
+    CALL getin('nsplit_thermals',nsplit_thermals_omp)
 
     !Config Key  = alp_bl_k
@@ -1412,5 +1418,5 @@
     !
     alp_bl_k_omp = 1.
-    call getin('alp_bl_k',alp_bl_k_omp)
+    CALL getin('alp_bl_k',alp_bl_k_omp)
 
     ! nrlmd le 10/04/2012
@@ -1422,5 +1428,5 @@
     !
     iflag_trig_bl_omp = 0
-    call getin('iflag_trig_bl',iflag_trig_bl_omp)
+    CALL getin('iflag_trig_bl',iflag_trig_bl_omp)
 
     !Config Key  = s_trig_bl
@@ -1430,5 +1436,5 @@
     !
     s_trig_omp = 2e7
-    call getin('s_trig',s_trig_omp)
+    CALL getin('s_trig',s_trig_omp)
 
     !Config Key  = tau_trig_shallow
@@ -1438,5 +1444,5 @@
     !
     tau_trig_shallow_omp = 600
-    call getin('tau_trig_shallow',tau_trig_shallow_omp)
+    CALL getin('tau_trig_shallow',tau_trig_shallow_omp)
 
     !Config Key  = tau_trig_deep
@@ -1446,5 +1452,5 @@
     !
     tau_trig_deep_omp = 1800
-    call getin('tau_trig_deep',tau_trig_deep_omp)
+    CALL getin('tau_trig_deep',tau_trig_deep_omp)
 
     !Config Key  = iflag_clos_bl
@@ -1454,5 +1460,5 @@
     !
     iflag_clos_bl_omp = 0
-    call getin('iflag_clos_bl',iflag_clos_bl_omp)
+    CALL getin('iflag_clos_bl',iflag_clos_bl_omp)
 
     ! fin nrlmd le 10/04/2012
@@ -1465,5 +1471,5 @@
     !
     tau_thermals_omp = 0.
-    call getin('tau_thermals',tau_thermals_omp)
+    CALL getin('tau_thermals',tau_thermals_omp)
 
     !
@@ -1474,5 +1480,5 @@
     !
     iflag_coupl_omp = 0
-    call getin('iflag_coupl',iflag_coupl_omp)
+    CALL getin('iflag_coupl',iflag_coupl_omp)
 
     !
@@ -1483,5 +1489,5 @@
     !
     iflag_clos_omp = 1
-    call getin('iflag_clos',iflag_clos_omp)
+    CALL getin('iflag_clos',iflag_clos_omp)
     !
     !Config Key  = coef_clos_ls
@@ -1491,5 +1497,5 @@
     !
     coef_clos_ls_omp = 0.
-    call getin('coef_clos_ls',coef_clos_ls_omp)
+    CALL getin('coef_clos_ls',coef_clos_ls_omp)
 
     !
@@ -1500,5 +1506,5 @@
     !
     iflag_cvl_sigd_omp = 0
-    call getin('iflag_cvl_sigd',iflag_cvl_sigd_omp)
+    CALL getin('iflag_cvl_sigd',iflag_cvl_sigd_omp)
 
     !Config Key  = iflag_wake
@@ -1508,5 +1514,5 @@
     !
     iflag_wake_omp = 0
-    call getin('iflag_wake',iflag_wake_omp)
+    CALL getin('iflag_wake',iflag_wake_omp)
 
     !Config Key  = alp_offset
@@ -1516,5 +1522,5 @@
     !
     alp_offset_omp = 0.
-    call getin('alp_offset',alp_offset_omp)
+    CALL getin('alp_offset',alp_offset_omp)
 
     !
@@ -1525,5 +1531,5 @@
     !
     lev_histhf_omp = 1
-    call getin('lev_histhf',lev_histhf_omp)
+    CALL getin('lev_histhf',lev_histhf_omp)
 
     !
@@ -1534,5 +1540,5 @@
     !
     lev_histday_omp = 1
-    call getin('lev_histday',lev_histday_omp)
+    CALL getin('lev_histday',lev_histday_omp)
 
     !
@@ -1543,5 +1549,5 @@
     !
     lev_histmth_omp = 2
-    call getin('lev_histmth',lev_histmth_omp)
+    CALL getin('lev_histmth',lev_histmth_omp)
     !
     !Config Key  = lev_histins
@@ -1551,5 +1557,5 @@
     !
     lev_histins_omp = 1
-    call getin('lev_histins',lev_histins_omp)
+    CALL getin('lev_histins',lev_histins_omp)
     !
     !Config Key  = lev_histLES
@@ -1559,5 +1565,5 @@
     !
     lev_histLES_omp = 1
-    call getin('lev_histLES',lev_histLES_omp)
+    CALL getin('lev_histLES',lev_histLES_omp)
     ! 
     !Config Key  = lev_histdayNMC
@@ -1567,5 +1573,5 @@
     !
     lev_histdayNMC_omp = 8
-    call getin('lev_histdayNMC',lev_histdayNMC_omp)
+    CALL getin('lev_histdayNMC',lev_histdayNMC_omp)
     !
     !Config Key  = levout_histNMC
@@ -1577,5 +1583,5 @@
     levout_histNMC_omp(2) = 5
     levout_histNMC_omp(3) = 5
-    call getin('levout_histNMC',levout_histNMC_omp)
+    CALL getin('levout_histNMC',levout_histNMC_omp)
     !
     !histNMC BEG
@@ -1587,8 +1593,8 @@
     !Config Help =
     !
-    ok_histNMC_omp(1) = .false.
-    ok_histNMC_omp(2) = .false.
-    ok_histNMC_omp(3) = .false.
-    call getin('ok_histNMC',ok_histNMC_omp)
+    ok_histNMC_omp(1) = .FALSE.
+    ok_histNMC_omp(2) = .FALSE.
+    ok_histNMC_omp(3) = .FALSE.
+    CALL getin('ok_histNMC',ok_histNMC_omp)
     !
     !Config Key  = freq_outNMC
@@ -1602,5 +1608,5 @@
     freq_outNMC_omp(2) = 1.
     freq_outNMC_omp(3) = 1./4.
-    call getin('freq_outNMC',freq_outNMC_omp)
+    CALL getin('freq_outNMC',freq_outNMC_omp)
     !
     !Config Key  = freq_calNMC
@@ -1614,5 +1620,5 @@
     freq_calNMC_omp(2) = pasphys
     freq_calNMC_omp(3) = pasphys
-    call getin('freq_calNMC',freq_calNMC_omp)
+    CALL getin('freq_calNMC',freq_calNMC_omp)
     !
     !Config Key  = type_run
@@ -1622,50 +1628,50 @@
     !
     type_run_omp = 'AMIP'
-    call getin('type_run',type_run_omp)
+    CALL getin('type_run',type_run_omp)
 
     !
     !Config Key  = ok_cosp
     !Config Desc =
-    !Config Def  = .false.
-    !Config Help =
-    !
-    ok_cosp_omp = .false.
-    call getin('ok_cosp',ok_cosp_omp)
+    !Config Def  = .FALSE.
+    !Config Help =
+    !
+    ok_cosp_omp = .FALSE.
+    CALL getin('ok_cosp',ok_cosp_omp)
 
     !
     !Config Key  = ok_airs
     !Config Desc =
-    !Config Def  = .false.
-    !Config Help =
-    !
-    ok_airs_omp = .false.
-    call getin('ok_airs',ok_airs_omp)
+    !Config Def  = .FALSE.
+    !Config Help =
+    !
+    ok_airs_omp = .FALSE.
+    CALL getin('ok_airs',ok_airs_omp)
 
     !
     !Config Key  = ok_mensuelCOSP
     !Config Desc =
-    !Config Def  = .true.
-    !Config Help =
-    !
-    ok_mensuelCOSP_omp = .true.
-    call getin('ok_mensuelCOSP',ok_mensuelCOSP_omp)
+    !Config Def  = .TRUE.
+    !Config Help =
+    !
+    ok_mensuelCOSP_omp = .TRUE.
+    CALL getin('ok_mensuelCOSP',ok_mensuelCOSP_omp)
 
     !
     !Config Key  = ok_journeCOSP
     !Config Desc =
-    !Config Def  = .true.
-    !Config Help = 
-    !
-    ok_journeCOSP_omp = .true.
-    call getin('ok_journeCOSP',ok_journeCOSP_omp)
+    !Config Def  = .TRUE.
+    !Config Help = 
+    !
+    ok_journeCOSP_omp = .TRUE.
+    CALL getin('ok_journeCOSP',ok_journeCOSP_omp)
 
     !
     !Config Key  = ok_hfCOSP
     !Config Desc =
-    !Config Def  = .false.
-    !Config Help =
-    !
-    ok_hfCOSP_omp = .false.
-    call getin('ok_hfCOSP',ok_hfCOSP_omp)
+    !Config Def  = .FALSE.
+    !Config Help =
+    !
+    ok_hfCOSP_omp = .FALSE.
+    CALL getin('ok_hfCOSP',ok_hfCOSP_omp)
 
     !
@@ -1679,5 +1685,5 @@
     !
     lonmin_ins_omp = 100.
-    call getin('lonmin_ins',lonmin_ins_omp)
+    CALL getin('lonmin_ins',lonmin_ins_omp)
     !
     !Config Key  = lonmax_ins
@@ -1687,5 +1693,5 @@
     !
     lonmax_ins_omp = 130.
-    call getin('lonmax_ins',lonmax_ins_omp)
+    CALL getin('lonmax_ins',lonmax_ins_omp)
     !
     !Config Key  = latmin_ins
@@ -1695,5 +1701,5 @@
     !
     latmin_ins_omp = -20.
-    call getin('latmin_ins',latmin_ins_omp)
+    CALL getin('latmin_ins',latmin_ins_omp)
     !
     !Config Key  = latmax_ins
@@ -1703,5 +1709,5 @@
     !
     latmax_ins_omp = 20.
-    call getin('latmax_ins',latmax_ins_omp)
+    CALL getin('latmax_ins',latmax_ins_omp)
     !
     !Config Key  = ecrit_hf
@@ -1711,5 +1717,5 @@
     !
     ecrit_hf_omp = 1./8.
-    call getin('ecrit_hf',ecrit_hf_omp)
+    CALL getin('ecrit_hf',ecrit_hf_omp)
     !
     !Config Key  = ecrit_ins
@@ -1719,5 +1725,5 @@
     !
     ecrit_ins_omp = 1./48.
-    call getin('ecrit_ins',ecrit_ins_omp)
+    CALL getin('ecrit_ins',ecrit_ins_omp)
     !
     !Config Key  = ecrit_day
@@ -1727,5 +1733,5 @@
     !
     ecrit_day_omp = 1.0
-    call getin('ecrit_day',ecrit_day_omp)
+    CALL getin('ecrit_day',ecrit_day_omp)
     !
     !Config Key  = ecrit_mth
@@ -1735,5 +1741,5 @@
     !
     ecrit_mth_omp = 30.
-    call getin('ecrit_mth',ecrit_mth_omp)
+    CALL getin('ecrit_mth',ecrit_mth_omp)
     !
     !Config Key  = ecrit_tra
@@ -1743,5 +1749,5 @@
     !
     ecrit_tra_omp = 0.
-    call getin('ecrit_tra',ecrit_tra_omp)
+    CALL getin('ecrit_tra',ecrit_tra_omp)
     !
     !Config Key  = ecrit_reg
@@ -1751,5 +1757,5 @@
     !
     ecrit_reg_omp = 0.25   !4 fois par jour
-    call getin('ecrit_reg',ecrit_reg_omp)
+    CALL getin('ecrit_reg',ecrit_reg_omp)
     !
     !
@@ -1759,22 +1765,22 @@
     !
     f_cdrag_ter_omp = 0.8
-    call getin('f_cdrag_ter',f_cdrag_ter_omp)
+    CALL getin('f_cdrag_ter',f_cdrag_ter_omp)
     !
     f_cdrag_oce_omp = 0.8
-    call getin('f_cdrag_oce',f_cdrag_oce_omp)
+    CALL getin('f_cdrag_oce',f_cdrag_oce_omp)
     !
 
     ! Gustiness flags
     f_z0qh_oce_omp = 1.
-    call getin('f_z0qh_oce',f_z0qh_oce_omp)
+    CALL getin('f_z0qh_oce',f_z0qh_oce_omp)
     !
     f_qsat_oce_omp = 1.
-    call getin('f_qsat_oce',f_qsat_oce_omp)
+    CALL getin('f_qsat_oce',f_qsat_oce_omp)
     !
     f_gust_bl_omp = 0.
-    call getin('f_gust_bl',f_gust_bl_omp)
+    CALL getin('f_gust_bl',f_gust_bl_omp)
     !
     f_gust_wk_omp = 0.
-    call getin('f_gust_wk',f_gust_wk_omp)
+    CALL getin('f_gust_wk',f_gust_wk_omp)
     !
     !Config Key  = iflag_z0_oce
@@ -1784,20 +1790,20 @@
     !
     iflag_z0_oce_omp=0
-    call getin('iflag_z0_oce',iflag_z0_oce_omp)
+    CALL getin('iflag_z0_oce',iflag_z0_oce_omp)
     !
     iflag_gusts_omp=0
-    call getin('iflag_gusts',iflag_gusts_omp)
+    CALL getin('iflag_gusts',iflag_gusts_omp)
     !
     min_wind_speed_omp = 1.
-    call getin('min_wind_speed',min_wind_speed_omp)
-
-    z0m_seaice_omp = 0.002 ; call getin('z0m_seaice',z0m_seaice_omp)
-    z0h_seaice_omp = 0.002 ; call getin('z0h_seaice',z0h_seaice_omp)
+    CALL getin('min_wind_speed',min_wind_speed_omp)
+
+    z0m_seaice_omp = 0.002 ; CALL getin('z0m_seaice',z0m_seaice_omp)
+    z0h_seaice_omp = 0.002 ; CALL getin('z0h_seaice',z0h_seaice_omp)
 
     f_rugoro_omp = 0.
-    call getin('f_rugoro',f_rugoro_omp)
+    CALL getin('f_rugoro',f_rugoro_omp)
 
     z0min_omp = 0.000015
-    call getin('z0min',z0min_omp)
+    CALL getin('z0min',z0min_omp)
 
 
@@ -1810,5 +1816,5 @@
     !
     supcrit1_omp = .540
-    call getin('supcrit1',supcrit1_omp)
+    CALL getin('supcrit1',supcrit1_omp)
 
     !
@@ -1819,5 +1825,5 @@
     !
     supcrit2_omp = .600
-    call getin('supcrit2',supcrit2_omp)
+    CALL getin('supcrit2',supcrit2_omp)
 
     !
@@ -1834,5 +1840,5 @@
     !
     iflag_mix_omp = 1
-    call getin('iflag_mix',iflag_mix_omp)
+    CALL getin('iflag_mix',iflag_mix_omp)
 
 !
@@ -1848,5 +1854,5 @@
     !
     iflag_mix_adiab_omp = 0
-    call getin('iflag_mix_adiab',iflag_mix_adiab_omp)
+    CALL getin('iflag_mix_adiab',iflag_mix_adiab_omp)
 
     !
@@ -1857,5 +1863,5 @@
     !
     scut_omp = 0.95
-    call getin('scut',scut_omp)
+    CALL getin('scut',scut_omp)
 
     !
@@ -1866,5 +1872,5 @@
     !
     qqa1_omp = 1.0
-    call getin('qqa1',qqa1_omp)
+    CALL getin('qqa1',qqa1_omp)
 
     !
@@ -1875,5 +1881,5 @@
     !
     qqa2_omp = 0.0
-    call getin('qqa2',qqa2_omp)
+    CALL getin('qqa2',qqa2_omp)
 
     !
@@ -1884,5 +1890,5 @@
     !
     gammas_omp = 0.05
-    call getin('gammas',gammas_omp)
+    CALL getin('gammas',gammas_omp)
 
     !
@@ -1893,5 +1899,5 @@
     !
     Fmax_omp = 0.65
-    call getin('Fmax',Fmax_omp)
+    CALL getin('Fmax',Fmax_omp)
 
     !
@@ -1902,5 +1908,5 @@
     !
     tmax_fonte_cv_omp = 275.15
-    call getin('tmax_fonte_cv',tmax_fonte_cv_omp)
+    CALL getin('tmax_fonte_cv',tmax_fonte_cv_omp)
 
     !
@@ -1911,5 +1917,5 @@
     !
     alphas_omp = -5.
-    call getin('alphas',alphas_omp)
+    CALL getin('alphas',alphas_omp)
 
     !Config key = ok_strato
@@ -1986,19 +1992,19 @@
     !Config Key  = OK_LES                                               
     !Config Desc = Pour des sorties LES                                 
-    !Config Def  = .false.                                              
+    !Config Def  = .FALSE.                                              
     !Config Help = Pour creer le fichier histLES contenant les sorties  
     !              LES                                                  
     !                                                                   
-    ok_LES_omp = .false.                                              
-    call getin('OK_LES', ok_LES_omp)                                  
+    ok_LES_omp = .FALSE.                                              
+    CALL getin('OK_LES', ok_LES_omp)                                  
 
     !Config Key  = callstats                                               
     !Config Desc = Pour des sorties callstats                                 
-    !Config Def  = .false.                                              
+    !Config Def  = .FALSE.                                              
     !Config Help = Pour creer le fichier stats contenant les sorties  
     !              stats                                                  
     !                                                                   
-    callstats_omp = .false.                                              
-    call getin('callstats', callstats_omp)                                  
+    callstats_omp = .FALSE.                                              
+    CALL getin('callstats', callstats_omp)                                  
     !
     !Config Key  = ecrit_LES
@@ -2010,8 +2016,8 @@
     !
     ecrit_LES_omp = 1./8.
-    call getin('ecrit_LES', ecrit_LES_omp)
+    CALL getin('ecrit_LES', ecrit_LES_omp)
     !
     read_climoz = 0 ! default value
-    call getin('read_climoz', read_climoz)
+    CALL getin('read_climoz', read_climoz)
 
     carbon_cycle_tr_omp=.FALSE.
@@ -2059,4 +2065,5 @@
     nbapp_rad = nbapp_rad_omp
     iflag_con = iflag_con_omp
+    nbapp_cv = nbapp_cv_omp
     iflag_ener_conserv = iflag_ener_conserv_omp
     ok_conserv_q = ok_conserv_q_omp
@@ -2124,10 +2131,9 @@
     t_coupl = t_coupl_omp
 
-    ok_veget=.true.
+    ok_veget=.TRUE.
     type_veget=type_veget_omp
-    if (type_veget=='n' .or. type_veget=='bucket' .or. type_veget=='betaclim') &
-         then
-       ok_veget=.false.
-    endif
+    IF (type_veget=='n' .or. type_veget=='bucket' .or. type_veget=='betaclim') THEN
+       ok_veget=.FALSE.
+    ENDIF
     ! Martin
     ok_snow = ok_snow_omp
@@ -2226,5 +2232,4 @@
     iflag_z0_oce=iflag_z0_oce_omp
 
-
     z0m_seaice=z0m_seaice_omp
     z0h_seaice=z0h_seaice_omp
@@ -2270,5 +2275,5 @@
        WRITE(lunout,*)' ERROR version_ocean=',version_ocean,' not valid in coupled configuration'
        CALL abort_physic('conf_phys','version_ocean not valid',1)
-    END IF
+    ENDIF
 
     IF (type_ocean=='slab' .AND. version_ocean=='xxxxxx') THEN
@@ -2278,5 +2283,5 @@
        WRITE(lunout,*)' ERROR version_ocean=',version_ocean,' not valid with slab ocean'
        CALL abort_physic('conf_phys','version_ocean not valid',1)
-    END IF
+    ENDIF
 
     !--test on radiative scheme 
@@ -2295,4 +2300,14 @@
        CALL abort_physic('conf_phys','choice iflag_rrtm not valid',1)
     ENDIF
+#ifdef CPP_StratAer
+    IF (iflag_rrtm .NE. 1) THEN 
+       WRITE(lunout,*) ' ERROR iflag_rrtm<>1 but StratAer activated'
+       CALL abort_physic('conf_phys','iflag_rrtm not valid for StratAer',1)
+    ENDIF
+    IF (NSW .NE. 6) THEN 
+       WRITE(lunout,*) ' ERROR NSW<>6 but StratAer activated'
+       CALL abort_physic('conf_phys','NSW not valid for StratAer',1)
+    ENDIF
+#endif
 
     !--test on ocean surface albedo
@@ -2307,9 +2322,9 @@
        IF ( flag_aerosol .EQ. 0 ) THEN
           CALL abort_physic('conf_phys','flag_aerosol=0 not compatible avec ok_ade ou ok_aie=.TRUE.',1)
-       END IF
+       ENDIF
        IF ( .NOT. new_aod .AND.  flag_aerosol .NE. 1) THEN
           CALL abort_physic('conf_phys','new_aod=.FALSE. not compatible avec flag_aerosol=1',1)
-       END IF
-    END IF
+       ENDIF
+    ENDIF
 
     ! Flag_aerosol cannot be to zero if we are in coupled mode for aerosol
@@ -2384,4 +2399,5 @@
     write(lunout,*)'nbapp_rad=',nbapp_rad
     write(lunout,*)'iflag_con=',iflag_con
+    write(lunout,*)'nbapp_cv=',nbapp_cv
     write(lunout,*)'iflag_ener_conserv=',iflag_ener_conserv
     write(lunout,*)'ok_conserv_q=',ok_conserv_q
@@ -2533,18 +2549,18 @@
     !$OMP END MASTER
 
-    return
-
-  end subroutine conf_phys
-
-end module conf_phys_m
+    RETURN
+
+  END SUBROUTINE conf_phys
+
+END MODULE conf_phys_m
 !
 !#################################################################
 !
 
-subroutine conf_interface(tau_calv)
-
-  use IOIPSL
+SUBROUTINE conf_interface(tau_calv)
+
+  USE IOIPSL
   USE print_control_mod, ONLY: lunout
-  implicit none
+  IMPLICIT NONE
   ! Configuration de l'interace atm/surf
   !
@@ -2562,5 +2578,5 @@
   tau_calv_omp = 360.*10.
   !$OMP MASTER
-  call getin('tau_calv',tau_calv_omp)
+  CALL getin('tau_calv',tau_calv_omp)
   !$OMP END MASTER
   !$OMP BARRIER
@@ -2574,5 +2590,5 @@
   !$OMP END MASTER
 
-  return
-
-end subroutine conf_interface
+  RETURN
+
+END SUBROUTINE conf_interface
