1 | # Script préparant les aerosols pour DAMIP |
---|
2 | # a partir des sorties de AER-ssp245 |
---|
3 | # annees 2015 a 2020 |
---|
4 | # Th. Lurton IPSL juil. 2018 |
---|
5 | |
---|
6 | #!/bin/sh |
---|
7 | |
---|
8 | storechemin=/ccc/store/cont003/gencmip6/lurtont/IGCM_OUT/LMDZORINCA/PROD/scenarioAER/AER-ssp245/CHM/Output/MO/ |
---|
9 | workchemin=/ccc/work/cont003/gencmip6/lurtont/aerosols_from_inca/AER_for_DAMIP/ |
---|
10 | |
---|
11 | if [ ! -d ${workchemin} ] ; then mkdir -p ${workchemin} ; fi |
---|
12 | |
---|
13 | histchemin=/ccc/store/cont003/gencmip6/lurtont/IGCM_OUT/LMDZORINCA/PROD/historicalAER/LOI6012-histAER-partE/CHM/Output/MO/ |
---|
14 | |
---|
15 | for year in {2015..2020} |
---|
16 | do |
---|
17 | |
---|
18 | echo "Je traite l'année "${year}"..." |
---|
19 | |
---|
20 | # On effectue une moyenne glissante sur trois ans, centree en l'annee d'interet, et de poids [0.25 ; 0.5 ; 0.25]. |
---|
21 | # Pour 2015, on ira chercher le 2014 chez les AER-historicals. |
---|
22 | |
---|
23 | prec=$((${year}-1)) |
---|
24 | suiv=$((${year}+1)) |
---|
25 | |
---|
26 | # Adresses generiques des fichiers-sources |
---|
27 | fileprec=${storechemin}AER-ssp245_${prec}0101_${prec}1230_1M_aerosols_from_inca.nc |
---|
28 | fileyear=${storechemin}AER-ssp245_${year}0101_${year}1230_1M_aerosols_from_inca.nc |
---|
29 | filesuiv=${storechemin}AER-ssp245_${suiv}0101_${suiv}1230_1M_aerosols_from_inca.nc |
---|
30 | |
---|
31 | # Petit override pour le cas 2015, vers le chemin de la simulation historical. |
---|
32 | if [ ${year} = 2015 ] |
---|
33 | then |
---|
34 | echo "On est en 2015, je vais chercher 2014 chez les historiques." |
---|
35 | fileprec=/ccc/store/cont003/gencmip6/lurtont/IGCM_OUT/LMDZORINCA/PROD/historicalAER/LOI6012-histAER-partE/CHM/Output/MO/LOI6012-histAER-partE_20140101_20141230_1M_aerosols_from_inca.nc |
---|
36 | fi |
---|
37 | |
---|
38 | # Fichiers temporaires avec pondération (cas générique) |
---|
39 | pondprec=${workchemin}AER-ssp245_${prec}0101_${prec}1230_pond.nc |
---|
40 | pondyear=${workchemin}AER-ssp245_${year}0101_${year}1230_pond.nc |
---|
41 | pondsuiv=${workchemin}AER-ssp245_${suiv}0101_${suiv}1230_pond.nc |
---|
42 | |
---|
43 | # Pondération des trois années successives par 1/4 ; 1/2 ; 1/4 ] |
---|
44 | # et multiplication par un facteur 3 qui disparaitra lors de la moyenne |
---|
45 | cdo mulc,.75 ${fileprec} ${pondprec} |
---|
46 | cdo mulc,1.5 ${fileyear} ${pondyear} |
---|
47 | cdo mulc,.75 ${filesuiv} ${pondsuiv} |
---|
48 | |
---|
49 | # Fichier recevant trois ans consecutifs |
---|
50 | pondtroisans=${workchemin}aerosols_${prec}0101_${suiv}1230_pond.nc |
---|
51 | |
---|
52 | cdo mergetime ${pondprec} ${pondyear} ${pondsuiv} ${pondtroisans} |
---|
53 | rm -f ${pondprec} ${pondyear} ${pondsuiv} |
---|
54 | |
---|
55 | fileout=${workchemin}aerosols${year}_from_inca.nc |
---|
56 | |
---|
57 | # Moyenne sur les trois ans, par mois |
---|
58 | cdo ymonmean ${pondtroisans} ${fileout} |
---|
59 | rm -f ${pondtroisans} |
---|
60 | |
---|
61 | # Fix du vecteur-temps |
---|
62 | ncks -A -v time_counter,time_centered,time_counter_bounds,time_centered_bounds ${fileyear} ${fileout} |
---|
63 | |
---|
64 | # Fin de boucle sur les annees |
---|
65 | done |
---|