1 | ##--NOT YET FULLY TESTED |
---|
2 | ##--SCRIPT TO PREPARE TRANSITION FOR 2015-2024 PERIOD |
---|
3 | |
---|
4 | lmdz='LR' |
---|
5 | #lmdz='VLR' |
---|
6 | #lmdz='VVLR' |
---|
7 | |
---|
8 | output='/data/oboucher/CMIP6/VOLC/'${lmdz} |
---|
9 | cd ${output} |
---|
10 | |
---|
11 | #--LW properties |
---|
12 | |
---|
13 | file1=taulwstrat.2D.2014.nc |
---|
14 | file2=taulwstrat.2D.ave.nc |
---|
15 | |
---|
16 | #--10 year transition from 2015 to 2023 |
---|
17 | #--then from 2024 onwards use ave conditions |
---|
18 | |
---|
19 | for year in {2015..2023} |
---|
20 | do |
---|
21 | fileout=taulwstrat.2D.${year}.nc |
---|
22 | rm $fileout |
---|
23 | w1=`echo "scale=4;((${year}-2014)/10.)" | bc` |
---|
24 | w2=`echo "scale=4;(1.-${w1})" | bc` |
---|
25 | echo $year $w1 $w2 |
---|
26 | cdo add -mulc,${w1} $file1 -mulc,${w2} $file2 $fileout |
---|
27 | done |
---|
28 | |
---|
29 | #--SW properties |
---|
30 | |
---|
31 | file1=tauswstrat.2D.2014.nc |
---|
32 | file2=tauswstrat.2D.ave.nc |
---|
33 | |
---|
34 | #--10 year transition from 2015 to 2023 |
---|
35 | #--then from 2024 onwards use ave conditions |
---|
36 | |
---|
37 | for year in {2015..2023} |
---|
38 | do |
---|
39 | w1=`echo "scale=4;((${year}-2014)/10.)" | bc` |
---|
40 | w2=`echo "scale=4;(1.-${w1})" | bc` |
---|
41 | echo $year $w1 $w2 |
---|
42 | fileout=tauswstrat.2D.${year}.nc |
---|
43 | fileout_aod=aod.2D.${year}.nc |
---|
44 | fileout_ome=ome.2D.${year}.nc |
---|
45 | fileout_cgg=cgg.2D.${year}.nc |
---|
46 | fileout_m1=m1.2D.${year}.nc |
---|
47 | fileout_m2=m2.2D.${year}.nc |
---|
48 | fileout_aod_ome=aod_ome.2D.${year}.nc |
---|
49 | fileout_aod_ome_cgg=aod_ome_cgg.2D.${year}.nc |
---|
50 | rm -f $fileout $fileout_m1 $fileout_m2 $fileout_aod $fileout_ome $fileout_cgg $fileout_aod_ome $fileout_aod_ome_cgg |
---|
51 | cdo add -mulc,${w1} -selname,TAU_SUN $file1 -mulc,${w2} -selname,TAU_SUN $file2 $fileout_aod |
---|
52 | cdo add -mulc,${w1} -expr,'tau_ome=TAU_SUN*OME_SUN' $file1 -mulc,${w2} -expr,'tau_ome=TAU_SUN*OME_SUN' $file2 $fileout_aod_ome |
---|
53 | cdo add -mulc,${w1} -expr,'tau_ome_cgg=TAU_SUN*OME_SUN*GGG_SUN' $file1 -mulc,${w2} -expr,'tau_ome_cgg=TAU_SUN*OME_SUN*GGG_SUN' $file2 $fileout_aod_ome_cgg |
---|
54 | cdo merge $fileout_aod_ome $fileout_aod $fileout_m1 |
---|
55 | cdo expr,'OME_SUN=tau_ome/TAU_SUN' $fileout_m1 $fileout_ome |
---|
56 | cdo merge $fileout_aod_ome_cgg $fileout_aod_ome $fileout_m2 |
---|
57 | cdo expr,'GGG_SUN=tau_ome_cgg/tau_ome' $fileout_m2 $fileout_cgg |
---|
58 | cdo merge $fileout_aod $fileout_ome $fileout_cgg $fileout |
---|
59 | rm -f $fileout_m1 $fileout_m2 $fileout_aod $fileout_ome $fileout_cgg $fileout_aod_ome $fileout_aod_ome_cgg |
---|
60 | done |
---|