source: TOOLS/CREATE_INTERP_AEROSOLS/prepare_aerosol_climato_annuel.job @ 2141

Last change on this file since 2141 was 2141, checked in by acosce, 8 years ago

Add job to create aerosol file use by lmdz from inca output

  • Property svn:executable set to *
File size: 3.7 KB
Line 
1#!/bin/ksh
2
3## Script permettant d'extraire depuis les moyennes mensuelles de inca (96x95x39)
4#les donnees necessaires a lmdz pour les concentrations d'aerosols
5
6##Attention les fichiers concdust_aero_IPSL-CM5A-LR_amip_r1i1p1_197901-200912.nc et climato_1944_LOI_IPCC_HISTOR.nc sont disponibles sous svn
7# au meme emplacement que ce script.
8# les variables issues de  concdust_aero_IPSL-CM5A-LR_amip_r1i1p1_197901-200912.nc ne sont valables que pour la grille 96x95x39
9
10set -ex
11
12DIRWORK=$SCRATCHDIR/tmp
13mkdir -p ${DIRWORK}
14
15cd ${DIRWORK}
16\rm -f *
17cp /..../concdust_aero_IPSL-CM5A-LR_amip_r1i1p1_197901-200912.nc exemple.nc
18cp  /.../climato_1944_LOI_IPCC_HISTOR.nc exemple2.nc
19
20for ANNEE in 1999 2000 2001 2002 2003 2004 2005
21do
22
23##############################################
24## repertoire de travail sur le scratchdir
25##############################################
26
27
28## config nom, path de l'experience
29##############################################
30EXPER=ESM1989.4
31DIREXP=$STOREDIR/IGCM_OUT/IPSLCM5CHT/PROD/historical/ESM1989.4/CHM/Analyse/MM
32
33
34
35
36    FICHIER=$DIREXP/${EXPER}_${ANNEE}_allMM_inca_avgr.nc
37
38
39## extraction des especes
40#############################################
41    ccc_hsm get $FICHIER
42    cp $FICHIER tmp.nc
43    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
44
45
46    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
47
48    ncpdq -a -presnivs tmp1.nc tmp1bis.nc
49    ncpdq -O -a -lat tmp1bis.nc tmp2.nc
50
51    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
52
53    ncatted -O -a units,AIBCM,o,c,"ug/m3" tmp3.nc tmp3.nc
54    ncatted -O -a units,AIPOMM,o,c,"ug/m3" tmp3.nc tmp3.nc
55    ncatted -O -a units,ASBCM,o,c,"ug/m3" tmp3.nc tmp3.nc
56    ncatted -O -a units,CSSSM,o,c,"ug/m3" tmp3.nc tmp3.nc
57    ncatted -O -a units,ASPOMM,o,c,"ug/m3" tmp3.nc tmp3.nc
58    ncatted -O -a units,CIDUSTM,o,c,"ug/m3" tmp3.nc tmp3.nc
59    ncatted -O -a units,ASSSM,o,c,"ug/m3" tmp3.nc tmp3.nc
60    ncatted -O -a units,SSSSM,o,c,"ug/m3" tmp3.nc tmp3.nc
61
62    ncatted -O -a units,CSSO4M,o,c,"ug/m3" tmp3.nc tmp3.nc
63    ncatted -O -a units,ASSO4M,o,c,"ug/m3" tmp3.nc tmp3.nc
64    ncrename -O -v LOAD_ASSO4M,load_SO4  tmp3.nc tmp3.nc
65    ncrename -O -v ASSO4M,SO4  tmp3.nc tmp3.nc
66    ncrename -O -v LOAD_CSSO4M,load_CSSO4M  tmp3.nc tmp3.nc 
67    ncrename -O -v LOAD_SSSSM,load_SSSSM  tmp3.nc tmp3.nc   
68    ncrename -O -v LOAD_AIPOMM,load_AIPOMM  tmp3.nc tmp3.nc 
69    ncrename -O -v LOAD_ASBCM,load_ASBCM  tmp3.nc tmp3.nc   
70    ncrename -O -v LOAD_AIBCM,load_AIBCM  tmp3.nc tmp3.nc   
71    ncrename -O -v LOAD_ASPOMM,load_ASPOMM  tmp3.nc tmp3.nc 
72    ncrename -O -v LOAD_CSSSM,load_CSSSM  tmp3.nc tmp3.nc   
73    ncrename -O -v LOAD_ASSSM,load_ASSSM  tmp3.nc tmp3.nc   
74    ncrename -O -v LOAD_CIDUSTM,load_CIDUSTM  tmp3.nc tmp3.nc
75    ncrename -O -d time_counter,TIME  tmp3.nc tmp3.nc
76    ncrename -O -d presnivs,lev  tmp3.nc tmp3.nc
77    ncks -A -v b,ap exemple.nc tmp3.nc
78    ncks -A -v lev,lev_bnds exemple.nc tmp3.nc
79    ncks -A -v p0 exemple2.nc tmp3.nc
80
81    mv tmp3.nc $STOREDIR/IGCM_OUT/IPSLCM5CHT/PROD/historical/${EXPER}/CHM/Analyse/CLIMATO/climato_${ANNEE}_${EXPER}.nc
82
83    \rm  tmp*.nc
84
85
86done
Note: See TracBrowser for help on using the repository browser.