Index: /TOOLS/CREATE_INTERP_AEROSOLS/1FILEperYr_MM_allspecies.job
===================================================================
--- /TOOLS/CREATE_INTERP_AEROSOLS/1FILEperYr_MM_allspecies.job	(revision 2141)
+++ /TOOLS/CREATE_INTERP_AEROSOLS/1FILEperYr_MM_allspecies.job	(revision 2141)
@@ -0,0 +1,56 @@
+######################
+## CURIE   TGCC/CEA ##
+######################
+#MSUB -r create_MM             # Nom du job               
+#MSUB -eo
+#MSUB -n 1              # Reservation du processus
+#MSUB -T 86400          # Limite de temps elapsed du job
+#MSUB -q xlarge
+#MSUB -Q normal
+#MSUB -A gen2211
+set +x
+
+#### Script permettant d'extraire depuis les fichiers journaliers de inca pack en frequence 1Y les moyennes mensuelles
+
+EXPER=ESM1989.4
+EXPERIMENT=historical
+RUNDIR=$SCRATCHDIR/POST_climato
+mkdir -p $RUNDIR
+cd $RUNDIR
+
+STORESIMU=$STOREDIR/IGCM_OUT/IPSLCM5CHT/PROD/${EXPERIMENT}/${EXPER}
+
+mkdir -p ${STORESIMU}/CHM/Analyse/MM
+#
+for YEAR in   1999 2000
+do
+
+    if [[ ! -s ${EXPER}_${YEAR}0101_${YEAR}1231_1M_inca_avgr.nc ]]; then 
+	ccc_hsm get ${STORESIMU}/CHM/Output/MO/${EXPER}_${YEAR}0101_${YEAR}1231_1M_inca_avgr.nc
+	cp ${STORESIMU}/CHM/Output/MO/${EXPER}_${YEAR}0101_${YEAR}1231_1M_inca_avgr.nc .
+    fi
+
+    ncwa -O -a time_counter -d time_counter,0,30    ${EXPER}_${YEAR}0101_${YEAR}1231_1M_inca_avgr.nc ${EXPER}_${YEAR}_01_MM_inca_avgr.nc 
+    ncwa -O -a time_counter -d time_counter,31,58   ${EXPER}_${YEAR}0101_${YEAR}1231_1M_inca_avgr.nc ${EXPER}_${YEAR}_02_MM_inca_avgr.nc 
+    ncwa -O -a time_counter -d time_counter,59,89   ${EXPER}_${YEAR}0101_${YEAR}1231_1M_inca_avgr.nc ${EXPER}_${YEAR}_03_MM_inca_avgr.nc 
+    ncwa -O -a time_counter -d time_counter,90,119  ${EXPER}_${YEAR}0101_${YEAR}1231_1M_inca_avgr.nc ${EXPER}_${YEAR}_04_MM_inca_avgr.nc 
+    ncwa -O -a time_counter -d time_counter,120,150 ${EXPER}_${YEAR}0101_${YEAR}1231_1M_inca_avgr.nc ${EXPER}_${YEAR}_05_MM_inca_avgr.nc 
+    ncwa -O -a time_counter -d time_counter,151,180 ${EXPER}_${YEAR}0101_${YEAR}1231_1M_inca_avgr.nc ${EXPER}_${YEAR}_06_MM_inca_avgr.nc 
+    ncwa -O -a time_counter -d time_counter,181,211 ${EXPER}_${YEAR}0101_${YEAR}1231_1M_inca_avgr.nc ${EXPER}_${YEAR}_07_MM_inca_avgr.nc 
+    ncwa -O -a time_counter -d time_counter,212,242 ${EXPER}_${YEAR}0101_${YEAR}1231_1M_inca_avgr.nc ${EXPER}_${YEAR}_08_MM_inca_avgr.nc 
+    ncwa -O -a time_counter -d time_counter,243,272 ${EXPER}_${YEAR}0101_${YEAR}1231_1M_inca_avgr.nc ${EXPER}_${YEAR}_09_MM_inca_avgr.nc 
+    ncwa -O -a time_counter -d time_counter,273,303 ${EXPER}_${YEAR}0101_${YEAR}1231_1M_inca_avgr.nc ${EXPER}_${YEAR}_10_MM_inca_avgr.nc 
+    ncwa -O -a time_counter -d time_counter,304,333 ${EXPER}_${YEAR}0101_${YEAR}1231_1M_inca_avgr.nc ${EXPER}_${YEAR}_11_MM_inca_avgr.nc 
+    ncwa -O -a time_counter -d time_counter,334,364 ${EXPER}_${YEAR}0101_${YEAR}1231_1M_inca_avgr.nc ${EXPER}_${YEAR}_12_MM_inca_avgr.nc 
+    
+    ncecat -F -O  ${EXPER}_${YEAR}_01_MM_inca_avgr.nc   ${EXPER}_${YEAR}_02_MM_inca_avgr.nc  ${EXPER}_${YEAR}_03_MM_inca_avgr.nc  ${EXPER}_${YEAR}_04_MM_inca_avgr.nc  ${EXPER}_${YEAR}_05_MM_inca_avgr.nc  ${EXPER}_${YEAR}_06_MM_inca_avgr.nc  ${EXPER}_${YEAR}_07_MM_inca_avgr.nc  ${EXPER}_${YEAR}_08_MM_inca_avgr.nc  ${EXPER}_${YEAR}_09_MM_inca_avgr.nc  ${EXPER}_${YEAR}_10_MM_inca_avgr.nc ${EXPER}_${YEAR}_11_MM_inca_avgr.nc  ${EXPER}_${YEAR}_12_MM_inca_avgr.nc  ${EXPER}_${YEAR}_allMM_inca_avgr.nc
+#ncwa -O -a time_counter ${EXPER}_${YEAR}_allMM_inca_avgr.nc ${EXPER}_${YEAR}_allMM_inca_avgr.nc   #enleve dim degenerate
+
+    ncra -F -O ${EXPER}_${YEAR}_allMM_inca_avgr.nc ${EXPER}_${YEAR}_AM_inca_avgr.nc
+
+    ncrename -d record,time_counter ${EXPER}_${YEAR}_allMM_inca_avgr.nc
+    mv ${EXPER}_${YEAR}_allMM_inca_avgr.nc ${EXPER}_${YEAR}_AM_inca_avgr.nc ${EXPER}_${YEAR}_*_MM_inca_avgr.nc  ${STORESIMU}/CHM/Analyse/MM/.
+            
+done
+exit
+
Index: /TOOLS/CREATE_INTERP_AEROSOLS/prepare_aerosol_climato_annuel.job
===================================================================
--- /TOOLS/CREATE_INTERP_AEROSOLS/prepare_aerosol_climato_annuel.job	(revision 2141)
+++ /TOOLS/CREATE_INTERP_AEROSOLS/prepare_aerosol_climato_annuel.job	(revision 2141)
@@ -0,0 +1,86 @@
+#!/bin/ksh
+
+## Script permettant d'extraire depuis les moyennes mensuelles de inca (96x95x39)
+#les donnees necessaires a lmdz pour les concentrations d'aerosols
+
+##Attention les fichiers concdust_aero_IPSL-CM5A-LR_amip_r1i1p1_197901-200912.nc et climato_1944_LOI_IPCC_HISTOR.nc sont disponibles sous svn 
+# au meme emplacement que ce script. 
+# les variables issues de  concdust_aero_IPSL-CM5A-LR_amip_r1i1p1_197901-200912.nc ne sont valables que pour la grille 96x95x39
+
+set -ex
+
+DIRWORK=$SCRATCHDIR/tmp
+mkdir -p ${DIRWORK}
+
+cd ${DIRWORK}
+\rm -f *
+cp /..../concdust_aero_IPSL-CM5A-LR_amip_r1i1p1_197901-200912.nc exemple.nc
+cp  /.../climato_1944_LOI_IPCC_HISTOR.nc exemple2.nc
+
+for ANNEE in 1999 2000 2001 2002 2003 2004 2005
+do
+
+##############################################
+## repertoire de travail sur le scratchdir
+##############################################
+
+
+## config nom, path de l'experience
+##############################################
+EXPER=ESM1989.4
+DIREXP=$STOREDIR/IGCM_OUT/IPSLCM5CHT/PROD/historical/ESM1989.4/CHM/Analyse/MM
+
+
+
+
+    FICHIER=$DIREXP/${EXPER}_${ANNEE}_allMM_inca_avgr.nc
+
+
+## extraction des especes
+#############################################
+    ccc_hsm get $FICHIER
+    cp $FICHIER tmp.nc
+    ncks -v lat,lon,ps,pmid,temp,AIPOMM,ASBCM,AIBCM,ASPOMM,CSSSM,ASSSM,CIDUSTM,ASSO4M,LOAD_ASSO4M,CSSO4M,LOAD_CSSO4M,SSSSM,LOAD_SSSSM,LOAD_AIPOMM,LOAD_ASBCM,LOAD_AIBCM,LOAD_ASPOMM,LOAD_CSSSM,LOAD_ASSSM,LOAD_CIDUSTM tmp.nc tmp1.nc
+
+
+    ncap -O -s "zrho=pmid/(temp*287.04);AIPOMM=AIPOMM*zrho*1e9;ASBCM=ASBCM*zrho*1e9;AIBCM=AIBCM*zrho*1e9;ASPOMM=ASPOMM*zrho*1e9;CSSSM=CSSSM*zrho*1e9;ASSSM=ASSSM*zrho*1e9;CIDUSTM=CIDUSTM*zrho*1e9;ASSO4M=ASSO4M*zrho*1e9;SSSSM=SSSSM*zrho*1e9;CSSO4M=CSSO4M*zrho*1e9" tmp1.nc tmp1.nc
+
+    ncpdq -a -presnivs tmp1.nc tmp1bis.nc 
+    ncpdq -O -a -lat tmp1bis.nc tmp2.nc 
+
+    ncap -s "AIPOMM=float(AIPOMM*0.7913);ASBCM=float(ASBCM);AIBCM=float(AIBCM);ASPOMM=float(ASPOMM*0.7913);CSSSM=float(CSSSM);ASSSM=float(ASSSM);CIDUSTM=float(CIDUSTM);ASSO4M=float(ASSO4M);SSSSM=float(SSSSM);CSSO4M=float(CSSO4M);LOAD_AIPOMM=LOAD_AIPOMM*0.7913;LOAD_ASPOMM=LOAD_ASPOMM*0.7913;lat=double(lat);lon=double(lon)" tmp2.nc tmp3.nc 
+
+    ncatted -O -a units,AIBCM,o,c,"ug/m3" tmp3.nc tmp3.nc
+    ncatted -O -a units,AIPOMM,o,c,"ug/m3" tmp3.nc tmp3.nc
+    ncatted -O -a units,ASBCM,o,c,"ug/m3" tmp3.nc tmp3.nc
+    ncatted -O -a units,CSSSM,o,c,"ug/m3" tmp3.nc tmp3.nc
+    ncatted -O -a units,ASPOMM,o,c,"ug/m3" tmp3.nc tmp3.nc
+    ncatted -O -a units,CIDUSTM,o,c,"ug/m3" tmp3.nc tmp3.nc
+    ncatted -O -a units,ASSSM,o,c,"ug/m3" tmp3.nc tmp3.nc
+    ncatted -O -a units,SSSSM,o,c,"ug/m3" tmp3.nc tmp3.nc
+
+    ncatted -O -a units,CSSO4M,o,c,"ug/m3" tmp3.nc tmp3.nc
+    ncatted -O -a units,ASSO4M,o,c,"ug/m3" tmp3.nc tmp3.nc
+    ncrename -O -v LOAD_ASSO4M,load_SO4  tmp3.nc tmp3.nc
+    ncrename -O -v ASSO4M,SO4  tmp3.nc tmp3.nc
+    ncrename -O -v LOAD_CSSO4M,load_CSSO4M  tmp3.nc tmp3.nc  
+    ncrename -O -v LOAD_SSSSM,load_SSSSM  tmp3.nc tmp3.nc   
+    ncrename -O -v LOAD_AIPOMM,load_AIPOMM  tmp3.nc tmp3.nc  
+    ncrename -O -v LOAD_ASBCM,load_ASBCM  tmp3.nc tmp3.nc   
+    ncrename -O -v LOAD_AIBCM,load_AIBCM  tmp3.nc tmp3.nc   
+    ncrename -O -v LOAD_ASPOMM,load_ASPOMM  tmp3.nc tmp3.nc  
+    ncrename -O -v LOAD_CSSSM,load_CSSSM  tmp3.nc tmp3.nc   
+    ncrename -O -v LOAD_ASSSM,load_ASSSM  tmp3.nc tmp3.nc   
+    ncrename -O -v LOAD_CIDUSTM,load_CIDUSTM  tmp3.nc tmp3.nc
+    ncrename -O -d time_counter,TIME  tmp3.nc tmp3.nc
+    ncrename -O -d presnivs,lev  tmp3.nc tmp3.nc
+    ncks -A -v b,ap exemple.nc tmp3.nc
+    ncks -A -v lev,lev_bnds exemple.nc tmp3.nc
+    ncks -A -v p0 exemple2.nc tmp3.nc
+
+    mv tmp3.nc $STOREDIR/IGCM_OUT/IPSLCM5CHT/PROD/historical/${EXPER}/CHM/Analyse/CLIMATO/climato_${ANNEE}_${EXPER}.nc
+
+    \rm  tmp*.nc
+
+
+done
