Index: CONFIG/UNIFORM/v7/ICOLMDZOR_v7/GENERAL/DRIVER/lmdz.driver
===================================================================
--- CONFIG/UNIFORM/v7/ICOLMDZOR_v7/GENERAL/DRIVER/lmdz.driver	(revision 4323)
+++ CONFIG/UNIFORM/v7/ICOLMDZOR_v7/GENERAL/DRIVER/lmdz.driver	(revision 4336)
@@ -44,98 +44,4 @@
     ConfType=${lmdz_UserChoices_ConfType}
 
-    ##- LMDZ output level, to be set in lmdz.card
-    if [ X${lmdz_UserChoices_OutLevel} = X ] ; then
-	# OutLevel is not set. Take default value low.
-	OutLevel=low
-    else
-	OutLevel=${lmdz_UserChoices_OutLevel}
-    fi
-
-    ##-- Output frequency purpose ....
-    ##--  Initialisation  ....
-    ok_mensuel=.FALSE.
-    ok_journe=.FALSE.
-    ok_hf=.FALSE.
-    ok_hf3h=.FALSE.
-    ok_hf3hm=.FALSE.
-    ok_stn=.FALSE.
-
-
-    case ${config_UserChoices_PeriodLength} in
-	1Y|1y|1M|1m) ok_mensuel=.TRUE. ;;
-	5D|5d|1D|1d) ok_journe=.TRUE. ;;
-    esac
-
-    for frequency in ${config_ATM_WriteFrequency} ; do
-	case ${frequency} in
-	    1M|1m) ok_mensuel=.TRUE. ;;
-	esac
-	case ${frequency} in
-	    5D|5d|1D|1d) ok_journe=.TRUE. ;;
-	esac
-	case ${frequency} in
-	    HF|hf) ok_hf=.TRUE. ;;
-	esac
-	case ${frequency} in 
-	    HF3h|hf3h) ok_hf3h=.TRUE. ;;
-	esac
-	case ${frequency} in 
-	    HF3hm|hf3hm) ok_hf3hm=.TRUE. ;;
-	esac
-	case ${frequency} in
-	    STN|stn) ok_stn=.TRUE. ;;
-	esac
-    done
-
-
-##  Read LMDZ_COSP_OK in lmdz.card
-    if [ X${lmdz_UserChoices_LMDZ_COSP_OK} = Xy ] ; then
-	##  LMDZ_COSP_OK=y, now read all other COSP variables
-	##  Read LMDZ_COSP_monthly in lmdz.card
-	if [ X${lmdz_UserChoices_LMDZ_COSP_monthly} = Xy ] ; then
-	    LMDZ_COSP_monthly=.TRUE.
-	else
-	    LMDZ_COSP_monthly=.FALSE.
-	fi
-        ##  Read LMDZ_COSP_daily in lmdz.card
-	if [ X${lmdz_UserChoices_LMDZ_COSP_daily} = Xy ] ; then
-	    LMDZ_COSP_daily=.TRUE.
-	else
-	    LMDZ_COSP_daily=.FALSE.
-	fi
-        ##  Read LMDZ_COSP_hf in lmdz.card
-	if [ X${lmdz_UserChoices_LMDZ_COSP_hf} = Xy ] ; then
-	    LMDZ_COSP_hf=.TRUE.
-	else
-	    LMDZ_COSP_hf=.FALSE.
-	fi
-    else
-	# LMDZ_COSP_OK=n : All cosp output are deactivated
-	LMDZ_COSP_monthly=.FALSE.
-	LMDZ_COSP_daily=.FALSE.
-	LMDZ_COSP_hf=.FALSE.
-    fi	
-
-    ##  Read LMDZ_NMC_monthly in lmdz.card
-    if [ X${lmdz_UserChoices_LMDZ_NMC_monthly} = Xy ] ; then
-	LMDZ_NMC_monthly=.TRUE.
-    else
-	LMDZ_NMC_monthly=.FALSE.
-    fi
-    
-    ## Read LMDZ_NMC_daily in lmdz.card
-    if [ X${lmdz_UserChoices_LMDZ_NMC_daily} = Xy ] ; then
-	LMDZ_NMC_daily=.TRUE.
-    else
-	LMDZ_NMC_daily=.FALSE.
-    fi
-    
-    ## Read LMDZ_NMC_hf in lmdz.card
-    if [ X${lmdz_UserChoices_LMDZ_NMC_hf} = Xy ] ; then
-	LMDZ_NMC_hf=.TRUE.
-    else
-	LMDZ_NMC_hf=.FALSE.
-    fi
-    
 
     IGCM_debug_PopStack "ATM_Initialize"
@@ -296,43 +202,105 @@
 
     ## Modifiy 
-    IGCM_comp_modifyXmlFile nonblocker file_def_histmth_lmdz.xml histmth enabled ${ok_mensuel}
-    
-    IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday enabled ${ok_journe}
-    
-    if [ X${OutLevel} = Xlow ] || [ X${OutLevel} = Xmedium ] ; then
-	IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday output_level 2
-    else
-	IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday output_level 5
-    fi
-    
-    IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf enabled ${ok_hf}
-    
-    if [ X${OutLevel} = Xlow ] ; then
-	IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf output_level 5
-    elif [ X${OutLevel} = Xmedium ] ; then
-	IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf output_level 6
-    elif [ X${OutLevel} = Xhigh ] ; then
-	IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf output_level 7
-    fi
-    	
-    IGCM_comp_modifyXmlFile nonblocker file_def_histhf3h_lmdz.xml histhf3h enabled ${ok_hf3h}
-    IGCM_comp_modifyXmlFile nonblocker file_def_histhf3hm_lmdz.xml histhf3hm enabled ${ok_hf3hm}
-
-    IGCM_comp_modifyXmlFile nonblocker file_def_histstn_lmdz.xml histstn enabled ${ok_stn}
-
-    IGCM_comp_modifyXmlFile nonblocker file_def_histmthNMC_lmdz.xml histmthNMC enabled ${LMDZ_NMC_monthly}
-    IGCM_comp_modifyXmlFile nonblocker file_def_histdayNMC_lmdz.xml histdayNMC enabled ${LMDZ_NMC_daily}
-    IGCM_comp_modifyXmlFile nonblocker file_def_histhfNMC_lmdz.xml histhfNMC enabled ${LMDZ_NMC_hf}
-    
-    IGCM_comp_modifyXmlFile nonblocker file_def_histmthCOSP_lmdz.xml histmthCOSP enabled ${LMDZ_COSP_monthly}
-    IGCM_comp_modifyXmlFile nonblocker file_def_histdayCOSP_lmdz.xml histdayCOSP enabled ${LMDZ_COSP_daily}
-    IGCM_comp_modifyXmlFile nonblocker file_def_histhfCOSP_lmdz.xml histhfCOSP enabled ${LMDZ_COSP_hf}
-
-    # Activate the histstrataer output file only for configuration with interactive stratospheric aersols 
-    # done by setting the key word LMDZ_strataero=y in lmdz.card
-    if [ X${lmdz_UserChoices_LMDZ_strataero} = Xy ] ; then
-	IGCM_comp_modifyXmlFile nonblocker file_def_histstrataer_lmdz.xml histstrataer enabled .TRUE.
-    else
-	IGCM_comp_modifyXmlFile nonblocker file_def_histstrataer_lmdz.xml histstrataer enabled .FALSE.
+
+    # histmth
+    if [ X${lmdz_UserChoices_output_level_histmth} = X ] || [ X${lmdz_UserChoices_output_level_histmth} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmth_lmdz.xml histmth enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmth_lmdz.xml histmth output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmth_lmdz.xml histmth enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmth_lmdz.xml histmth output_level ${lmdz_UserChoices_output_level_histmth} 
+    fi
+
+    # histday
+    if [ X${lmdz_UserChoices_output_level_histday} = X ] || [ X${lmdz_UserChoices_output_level_histday} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday output_level ${lmdz_UserChoices_output_level_histday} 
+    fi
+
+    # histhf
+    if [ X${lmdz_UserChoices_output_level_histhf} = X ] || [ X${lmdz_UserChoices_output_level_histhf} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf output_level ${lmdz_UserChoices_output_level_histhf} 
+    fi
+
+    # histmthNMC
+    if [ X${lmdz_UserChoices_output_level_histmthNMC} = X ] || [ X${lmdz_UserChoices_output_level_histmthNMC} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmthNMC_lmdz.xml histmthNMC enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmthNMC_lmdz.xml histmthNMC output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmthNMC_lmdz.xml histmthNMC enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmthNMC_lmdz.xml histmthNMC output_level ${lmdz_UserChoices_output_level_histmthNMC} 
+    fi
+
+    # histdayNMC
+    if [ X${lmdz_UserChoices_output_level_histdayNMC} = X ] || [ X${lmdz_UserChoices_output_level_histdayNMC} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdayNMC_lmdz.xml histdayNMC enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdayNMC_lmdz.xml histdayNMC output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdayNMC_lmdz.xml histdayNMC enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdayNMC_lmdz.xml histdayNMC output_level ${lmdz_UserChoices_output_level_histdayNMC} 
+    fi
+
+    # histhfNMC
+    if [ X${lmdz_UserChoices_output_level_histhfNMC} = X ] || [ X${lmdz_UserChoices_output_level_histhfNMC} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhfNMC_lmdz.xml histhfNMC enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhfNMC_lmdz.xml histhfNMC output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhfNMC_lmdz.xml histhfNMC enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhfNMC_lmdz.xml histhfNMC output_level ${lmdz_UserChoices_output_level_histhfNMC} 
+    fi
+
+    # histstrataer
+    if [ X${lmdz_UserChoices_output_level_histstrataer} = X ] || [ X${lmdz_UserChoices_output_level_histstrataer} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histstrataer_lmdz.xml histstrataer enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histstrataer_lmdz.xml histstrataer output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histstrataer_lmdz.xml histstrataer enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histstrataer_lmdz.xml histstrataer output_level ${lmdz_UserChoices_output_level_histstrataer} 
+    fi
+
+    # histstn
+    if [ X${lmdz_UserChoices_output_level_histstn} = X ] || [ X${lmdz_UserChoices_output_level_histstn} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histstn_lmdz.xml histstn enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histstn_lmdz.xml histstn output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histstn_lmdz.xml histstn enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histstn_lmdz.xml histstn output_level ${lmdz_UserChoices_output_level_histstn} 
+    fi
+
+
+    # histmthCOSP
+    if [ X${lmdz_UserChoices_output_level_histmthCOSP} = X ] || [ X${lmdz_UserChoices_output_level_histmthCOSP} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmthCOSP_lmdz.xml histmthCOSP enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmthCOSP_lmdz.xml histmthCOSP output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmthCOSP_lmdz.xml histmthCOSP enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmthCOSP_lmdz.xml histmthCOSP output_level ${lmdz_UserChoices_output_level_histmthCOSP} 
+    fi
+
+
+    # histdayCOSP
+    if [ X${lmdz_UserChoices_output_level_histdayCOSP} = X ] || [ X${lmdz_UserChoices_output_level_histdayCOSP} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdayCOSP_lmdz.xml histdayCOSP enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdayCOSP_lmdz.xml histdayCOSP output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdayCOSP_lmdz.xml histdayCOSP enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdayCOSP_lmdz.xml histdayCOSP output_level ${lmdz_UserChoices_output_level_histdayCOSP} 
+    fi
+
+
+    # histhfCOSP
+    if [ X${lmdz_UserChoices_output_level_histhfCOSP} = X ] || [ X${lmdz_UserChoices_output_level_histhfCOSP} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhfCOSP_lmdz.xml histhfCOSP enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhfCOSP_lmdz.xml histhfCOSP output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhfCOSP_lmdz.xml histhfCOSP enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhfCOSP_lmdz.xml histhfCOSP output_level ${lmdz_UserChoices_output_level_histhfCOSP} 
     fi
 
