Index: LMDZ6/branches/Ocean_skin/libf/phylmd/conf_phys_m.F90
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/phylmd/conf_phys_m.F90	(revision 3432)
+++ LMDZ6/branches/Ocean_skin/libf/phylmd/conf_phys_m.F90	(revision 3605)
@@ -17,5 +17,5 @@
        iflag_cld_th, &
        iflag_ratqs,ratqsbas,ratqshaut,tau_ratqs, &
-       ok_ade, ok_aie, ok_alw, ok_cdnc, aerosol_couple, chemistry_couple, &
+       ok_ade, ok_aie, ok_alw, ok_cdnc, ok_volcan, aerosol_couple, chemistry_couple, &
        flag_aerosol, flag_aerosol_strat, flag_aer_feedback, new_aod, &
        flag_bc_internal_mixture, bl95_b0, bl95_b1,&
@@ -26,8 +26,9 @@
     USE surface_data
     USE phys_cal_mod
-    USE carbon_cycle_mod,  ONLY: carbon_cycle_tr, carbon_cycle_cpl, level_coupling_esm
+    USE carbon_cycle_mod,  ONLY: carbon_cycle_tr, carbon_cycle_cpl, carbon_cycle_rad, level_coupling_esm
     USE mod_grid_phy_lmdz, ONLY: klon_glo
     USE print_control_mod, ONLY: lunout
     use config_ocean_skin_m, only: config_ocean_skin
+    USE phys_state_var_mod, ONLY: phys_tstep
 
     INCLUDE "conema3.h"
@@ -63,4 +64,5 @@
     ! flag_bc_internal_mixture : use BC internal mixture if true
     ! bl95_b*: parameters in the formula to link CDNC to aerosol mass conc 
+    ! ok_volcan: activate volcanic diags (SW heat & LW cool rate, SW & LW flux)
     !
 
@@ -71,5 +73,5 @@
     LOGICAL              :: ok_LES
     LOGICAL              :: callstats
-    LOGICAL              :: ok_ade, ok_aie, ok_alw, ok_cdnc
+    LOGICAL              :: ok_ade, ok_aie, ok_alw, ok_cdnc, ok_volcan
     LOGICAL              :: aerosol_couple, chemistry_couple
     INTEGER              :: flag_aerosol
@@ -93,5 +95,5 @@
     LOGICAL, SAVE       :: ok_LES_omp   
     LOGICAL, SAVE       :: callstats_omp
-    LOGICAL, SAVE       :: ok_ade_omp, ok_aie_omp, ok_alw_omp, ok_cdnc_omp
+    LOGICAL, SAVE       :: ok_ade_omp, ok_aie_omp, ok_alw_omp, ok_cdnc_omp, ok_volcan_omp
     LOGICAL, SAVE       :: aerosol_couple_omp, chemistry_couple_omp
     INTEGER, SAVE       :: flag_aerosol_omp
@@ -151,5 +153,5 @@
 
     REAL,SAVE :: R_ecc_omp,R_peri_omp,R_incl_omp,solaire_omp
-    REAL      :: solaire_omp_init
+    REAL,SAVE      :: solaire_omp_init
     LOGICAL,SAVE :: ok_suntime_rrtm_omp
     REAL,SAVE :: co2_ppm_omp, RCO2_omp, co2_ppm_per_omp, RCO2_per_omp
@@ -231,4 +233,5 @@
     LOGICAL, SAVE :: carbon_cycle_tr_omp
     LOGICAL, SAVE :: carbon_cycle_cpl_omp
+    LOGICAL, SAVE :: carbon_cycle_rad_omp
     INTEGER, SAVE :: level_coupling_esm_omp
     LOGICAL, SAVE :: adjust_tropopause_omp
@@ -395,4 +398,14 @@
     ok_cdnc_omp = .FALSE.
     CALL getin('ok_cdnc', ok_cdnc_omp)
+
+    !
+    !Config Key  = ok_volcan
+    !Config Desc = ok to generate volcanic diags
+    !Config Def  = .FALSE.
+    !Config Help = Used in radlwsw_m.F
+    !
+    ok_volcan_omp = .FALSE.
+    CALL getin('ok_volcan', ok_volcan_omp)
+
     !
     !Config Key  = aerosol_couple
@@ -595,5 +608,5 @@
     ! RCO2 = 5.286789092164308E-04
     !ancienne valeur
-    RCO2_omp = co2_ppm_omp * 1.0e-06  * 44.011/28.97 ! pour co2_ppm=348.
+    RCO2_omp = co2_ppm_omp * 1.0e-06 * RMCO2 / RMD ! pour co2_ppm=348.
 
     !  CALL getin('RCO2', RCO2)
@@ -615,5 +628,5 @@
     CALL getin('CH4_ppb', zzz)
     CH4_ppb_omp = zzz
-    RCH4_omp = CH4_ppb_omp * 1.0E-09 * 16.043/28.97
+    RCH4_omp = CH4_ppb_omp * 1.0E-09 * RMCH4 / RMD
     !
     !Config Key  = RN2O
@@ -633,5 +646,5 @@
     CALL getin('N2O_ppb', zzz)
     N2O_ppb_omp = zzz
-    RN2O_omp = N2O_ppb_omp * 1.0E-09 * 44.013/28.97
+    RN2O_omp = N2O_ppb_omp * 1.0E-09 * RMN2O / RMD
     !
     !Config Key  = RCFC11
@@ -645,5 +658,5 @@
     CALL getin('CFC11_ppt',zzz)
     CFC11_ppt_omp = zzz
-    RCFC11_omp=CFC11_ppt_omp* 1.0E-12 * 137.3686/28.97
+    RCFC11_omp=CFC11_ppt_omp* 1.0E-12 * RMCFC11 / RMD
     ! RCFC11 = 1.327690990680013E-09
     !OK CALL getin('RCFC11', RCFC11)
@@ -659,5 +672,5 @@
     CALL getin('CFC12_ppt',zzz)
     CFC12_ppt_omp = zzz
-    RCFC12_omp = CFC12_ppt_omp * 1.0E-12 * 120.9140/28.97
+    RCFC12_omp = CFC12_ppt_omp * 1.0E-12 * RMCFC12 / RMD
     ! RCFC12 = 2.020102726958923E-09
     !OK CALL getin('RCFC12', RCFC12)
@@ -679,5 +692,5 @@
     !Config Help = 
     !               
-    RCO2_per_omp = co2_ppm_per_omp * 1.0e-06  * 44.011/28.97
+    RCO2_per_omp = co2_ppm_per_omp * 1.0e-06 * RMCO2 / RMD
 
     !Config Key  = ok_4xCO2atm
@@ -694,5 +707,5 @@
     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
+    RCH4_per_omp = CH4_ppb_per_omp * 1.0E-09 * RMCH4 / RMD
     !
     !Config Key  = RN2O_per
@@ -704,5 +717,5 @@
     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
+    RN2O_per_omp = N2O_ppb_per_omp * 1.0E-09 * RMN2O / RMD
     !
     !Config Key  = RCFC11_per
@@ -714,5 +727,5 @@
     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
+    RCFC11_per_omp=CFC11_ppt_per_omp* 1.0E-12 * RMCFC11 / RMD
     !
     !Config Key  = RCFC12_per
@@ -724,5 +737,5 @@
     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
+    RCFC12_per_omp = CFC12_ppt_per_omp * 1.0E-12 * RMCFC12 / RMD
     !ajout CFMIP end
 
@@ -1031,5 +1044,5 @@
     ! - 1 = stratospheric aerosols scaled from 550 nm AOD 
     ! - 2 = stratospheric aerosol properties from CMIP6
-    !Option 2 is only available with RRTM, this is tested later on
+    !Option 2 is only available with RRTM, this is tested later on 
     !Config Def  = 0
     !Config Help = Used in physiq.F
@@ -1724,10 +1737,10 @@
     !Config Desc = freq_calNMC(2) = frequence de calcul fichiers histdayNMC
     !Config Desc = freq_calNMC(3) = frequence de calcul fichiers histhfNMC
-    !Config Def  = pasphys
-    !Config Help =
-    !
-    freq_calNMC_omp(1) = pasphys
-    freq_calNMC_omp(2) = pasphys
-    freq_calNMC_omp(3) = pasphys
+    !Config Def  = phys_tstep
+    !Config Help =
+    !
+    freq_calNMC_omp(1) = phys_tstep
+    freq_calNMC_omp(2) = phys_tstep
+    freq_calNMC_omp(3) = phys_tstep
     CALL getin('freq_calNMC',freq_calNMC_omp)
     !
@@ -2156,4 +2169,7 @@
     carbon_cycle_cpl_omp=.FALSE.
     CALL getin('carbon_cycle_cpl',carbon_cycle_cpl_omp)
+
+    carbon_cycle_rad_omp=.FALSE.
+    CALL getin('carbon_cycle_rad',carbon_cycle_rad_omp)
 
     ! >> PC
@@ -2306,4 +2322,5 @@
     ok_alw = ok_alw_omp
     ok_cdnc = ok_cdnc_omp
+    ok_volcan = ok_volcan_omp
     aerosol_couple = aerosol_couple_omp
     chemistry_couple = chemistry_couple_omp
@@ -2428,4 +2445,5 @@
     carbon_cycle_tr = carbon_cycle_tr_omp
     carbon_cycle_cpl = carbon_cycle_cpl_omp
+    carbon_cycle_rad = carbon_cycle_rad_omp
     level_coupling_esm = level_coupling_esm_omp
 
@@ -2529,4 +2547,12 @@
     IF (flag_bc_internal_mixture .AND. flag_aerosol.NE.6) THEN 
        CALL abort_physic('conf_phys', 'flag_bc_internal_mixture can only be activated with flag_aerosol=6',1)
+    ENDIF
+
+    ! Test on carbon cycle
+    IF (carbon_cycle_tr .AND. .NOT. carbon_cycle_cpl) THEN
+       CALL abort_physic('conf_phys', 'carbon_cycle_cpl has to be TRUE if carbon_cycle_tr is on',1)
+    ENDIF
+    IF (carbon_cycle_rad .AND. .NOT. carbon_cycle_cpl) THEN
+       CALL abort_physic('conf_phys', 'carbon_cycle_cpl has to be TRUE if carbon_cycle_rad is on',1)
     ENDIF
 
@@ -2643,4 +2669,5 @@
     WRITE(lunout,*) ' pmagic = ',pmagic
     WRITE(lunout,*) ' ok_ade = ',ok_ade
+    WRITE(lunout,*) ' ok_volcan = ',ok_volcan
     WRITE(lunout,*) ' ok_aie = ',ok_aie
     WRITE(lunout,*) ' ok_alw = ',ok_alw
@@ -2742,4 +2769,5 @@
     WRITE(lunout,*) ' carbon_cycle_tr = ', carbon_cycle_tr
     WRITE(lunout,*) ' carbon_cycle_cpl = ', carbon_cycle_cpl
+    WRITE(lunout,*) ' carbon_cycle_rad = ', carbon_cycle_rad
     WRITE(lunout,*) ' level_coupling_esm = ', level_coupling_esm
 
