source: TOOLS/CREATE_INTERP_AEROSOLS/prepare_aerosol_climato_annuel.job @ 3049

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

make some corrections

  • 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 lev_file.nc et climato_1944_LOI_IPCC_HISTOR.nc sont disponibles sous svn
7# au meme emplacement que ce script.
8# les variables issues de  lev_file.nc  ne sont valables que pour la grille 96x95x39
9
10set -ex
11
12##############################################
13## repertoire de travail sur le scratchdir
14##############################################
15
16DIRWORK=$SCRATCHDIR/tmp
17mkdir -p ${DIRWORK}
18
19cd ${DIRWORK}
20\rm -f *
21cp /ccc/scratch/cont003/dsm/p86cozic/CLIMATO/FILES/lev_file.nc exemple.nc
22cp  /ccc/scratch/cont003/dsm/p86cozic/CLIMATO/climato_1944_LOI_IPCC_HISTOR.nc exemple2.nc
23
24
25## config nom, path de l'experience
26##############################################
27EXPER=ESM.2xCO2
28TYPE=2fCO2
29
30DIREXP=$STOREDIR/IGCM_OUT/IPSLCM5CHT/PROD/${TYPE}/${EXPER}/CHM/Analyse/MM
31
32mkdir -p  $STOREDIR/IGCM_OUT/IPSLCM5CHT/PROD/${TYPE}/${EXPER}/CHM/Analyse/CLIMATO
33
34for ANNEE in   1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005
35
36do
37
38    FICHIER=$DIREXP/${EXPER}_${ANNEE}_allMM_inca_avgr.nc
39
40## extraction des especes
41#############################################
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);ASBCM=float(ASBCM);AIBCM=float(AIBCM);ASPOMM=float(ASPOMM);CSSSM=float(CSSSM);ASSSM=float(ASSSM);CIDUSTM=float(CIDUSTM);ASSO4M=float(ASSO4M);SSSSM=float(SSSSM);CSSO4M=float(CSSO4M);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    ncatted -O -a units,CSSO4M,o,c,"ug/m3" tmp3.nc tmp3.nc
62    ncatted -O -a units,ASSO4M,o,c,"ug/m3" tmp3.nc tmp3.nc
63   
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   
78    ncks -A -v lev,b,ap,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/${TYPE}/${EXPER}/CHM/Analyse/CLIMATO/climato_${ANNEE}_${EXPER}.nc
82    \rm  tmp*.nc
83
84done
85
Note: See TracBrowser for help on using the repository browser.