1 | #--Weights on RCPs to yield ssp limit files. |
---|
2 | #--This script requires output from script SST_SIC_anomaly.sh. |
---|
3 | #--Th. Lurton, IPSL, 07/2018. |
---|
4 | |
---|
5 | # ssp1-19 = 19/26*RCP26 |
---|
6 | # ssp1-26 = RCP26 |
---|
7 | # ssp2-45 = RCP45 |
---|
8 | # ssp3-70 = .4*RCP85 + .6*RCP60 |
---|
9 | # ssp4-34 = 8/19*RCP45 + 11/19*RCP26 |
---|
10 | # ssp4-60 = .6*RCP60 + .4*RCP45 |
---|
11 | # ssp5-34-over = 8/19*RCP45 + 11/19*RCP26 |
---|
12 | # ssp5-85 = RCP85 |
---|
13 | |
---|
14 | if [ ! -d ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp119 ] ; then mkdir -p ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp119 ; fi |
---|
15 | if [ ! -d ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp126 ] ; then mkdir -p ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp126 ; fi |
---|
16 | if [ ! -d ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp245 ] ; then mkdir -p ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp245 ; fi |
---|
17 | if [ ! -d ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp370 ] ; then mkdir -p ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp370 ; fi |
---|
18 | if [ ! -d ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp434 ] ; then mkdir -p ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp434 ; fi |
---|
19 | if [ ! -d ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp460 ] ; then mkdir -p ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp460 ; fi |
---|
20 | if [ ! -d ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp534-over ] ; then mkdir -p ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp534-over ; fi |
---|
21 | if [ ! -d ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp585 ] ; then mkdir -p ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp585 ; fi |
---|
22 | |
---|
23 | #--We need specific data for the ssp119 ponderation, which will be refered to as RCP0 |
---|
24 | fileSSTAMIP=/ccc/work/cont003/gencmip6/lurtont/CMIP6_LIMIT/AMIP/tos_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-4_gn_187001-201712.nc |
---|
25 | fileSICAMIP=/ccc/work/cont003/gencmip6/lurtont/CMIP6_LIMIT/AMIP/siconc_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-4_gn_187001-201712.nc |
---|
26 | gridfile=${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/GRID/grid_MR_CMIP5 |
---|
27 | #--For SST |
---|
28 | cdo ymonmean -seldate,2006-01-01,2017-12-31 ${fileSSTAMIP} ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp.nc |
---|
29 | cdo addc,273.15 -selvar,tos ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp.nc ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp1.nc |
---|
30 | cdo remapcon,${gridfile} ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp1.nc ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp2.nc |
---|
31 | ncrename -v tos,tsol_oce ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp2.nc ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/SST_RCP0.nc |
---|
32 | rm -f ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp.nc ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp1.nc ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp2.nc |
---|
33 | #--For SIC |
---|
34 | cdo ymonmean -seldate,2006-01-01,2017-12-31 ${fileSICAMIP} ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp.nc |
---|
35 | cdo remapcon,${gridfile} ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp.nc ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp1.nc |
---|
36 | ncrename -v siconc,pourc_sic ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp1.nc ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp2.nc |
---|
37 | cdo ymonmean -seldate,2006-01-01,2017-12-31 ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/rcp26/v5.rcp26MR1_20060101_21001231_1M_pourc_lic.nc ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp.nc |
---|
38 | ncrename -v pourc_lic,pourc_sic ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp.nc ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/lic_RCP0.nc |
---|
39 | cdo sub ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp2.nc ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/lic_RCP0.nc ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp3.nc |
---|
40 | ncap2 -s 'where(pourc_sic>100.) pourc_sic=100;' ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp3.nc -O ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp.nc |
---|
41 | ncap2 -s 'where(pourc_sic<0.) pourc_sic=0;' ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp.nc ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/SIC_RCP0.nc |
---|
42 | rm -f ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp.nc ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp1.nc ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp2.nc ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/tmp3.nc ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/lic_RCP0.nc ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/SSTAMIP.nc ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/SICAMIP.nc |
---|
43 | |
---|
44 | for year in {2015..2100} |
---|
45 | do |
---|
46 | |
---|
47 | fileSSTRCP26=/ccc/work/cont003/gencmip6/lurtont/CMIP6_LIMIT/Scenarios/rcp26/OUT_anocorr/v5.rcp26MR1_tsol_oce_${year}_anocorr.nc |
---|
48 | fileSSTRCP45=/ccc/work/cont003/gencmip6/lurtont/CMIP6_LIMIT/Scenarios/rcp45/OUT_anocorr/v5.rcp45MR1_tsol_oce_${year}_anocorr.nc |
---|
49 | fileSSTRCP60=/ccc/work/cont003/gencmip6/lurtont/CMIP6_LIMIT/Scenarios/rcp60/OUT_anocorr/v5.rcp60MR1_tsol_oce_${year}_anocorr.nc |
---|
50 | fileSSTRCP85=/ccc/work/cont003/gencmip6/lurtont/CMIP6_LIMIT/Scenarios/rcp85/OUT_anocorr/v5.rcp85MR1_tsol_oce_${year}_anocorr.nc |
---|
51 | |
---|
52 | fileSICRCP26=/ccc/work/cont003/gencmip6/lurtont/CMIP6_LIMIT/Scenarios/rcp26/OUT_anocorr/v5.rcp26MR1_pourc_sic_${year}_anocorr.nc |
---|
53 | fileSICRCP45=/ccc/work/cont003/gencmip6/lurtont/CMIP6_LIMIT/Scenarios/rcp45/OUT_anocorr/v5.rcp45MR1_pourc_sic_${year}_anocorr.nc |
---|
54 | fileSICRCP60=/ccc/work/cont003/gencmip6/lurtont/CMIP6_LIMIT/Scenarios/rcp60/OUT_anocorr/v5.rcp60MR1_pourc_sic_${year}_anocorr.nc |
---|
55 | fileSICRCP85=/ccc/work/cont003/gencmip6/lurtont/CMIP6_LIMIT/Scenarios/rcp85/OUT_anocorr/v5.rcp85MR1_pourc_sic_${year}_anocorr.nc |
---|
56 | |
---|
57 | outSSTssp119=${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp119/tsol_oce_ssp119_${year}.nc |
---|
58 | outSSTssp126=${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp126/tsol_oce_ssp126_${year}.nc |
---|
59 | outSSTssp245=${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp245/tsol_oce_ssp245_${year}.nc |
---|
60 | outSSTssp370=${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp370/tsol_oce_ssp370_${year}.nc |
---|
61 | outSSTssp434=${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp434/tsol_oce_ssp434_${year}.nc |
---|
62 | outSSTssp460=${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp460/tsol_oce_ssp460_${year}.nc |
---|
63 | outSSTssp534=${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp534-over/tsol_oce_ssp534-over_${year}.nc |
---|
64 | outSSTssp585=${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp585/tsol_oce_ssp585_${year}.nc |
---|
65 | |
---|
66 | outSICssp119=${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp119/pourc_sic_ssp119_${year}.nc |
---|
67 | outSICssp126=${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp126/pourc_sic_ssp126_${year}.nc |
---|
68 | outSICssp245=${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp245/pourc_sic_ssp245_${year}.nc |
---|
69 | outSICssp370=${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp370/pourc_sic_ssp370_${year}.nc |
---|
70 | outSICssp434=${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp434/pourc_sic_ssp434_${year}.nc |
---|
71 | outSICssp460=${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp460/pourc_sic_ssp460_${year}.nc |
---|
72 | outSICssp534=${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp534-over/pourc_sic_ssp534-over_${year}.nc |
---|
73 | outSICssp585=${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/Scenarios/ssp585/pourc_sic_ssp585_${year}.nc |
---|
74 | |
---|
75 | cdo -L add -mulc,19. -divc,26. -selname,tsol_oce ${fileSSTRCP26} -mulc,7. -divc,26. -selname,tsol_oce ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/SST_RCP0.nc ${outSSTssp119} |
---|
76 | cp ${fileSSTRCP26} ${outSSTssp126} |
---|
77 | cp ${fileSSTRCP45} ${outSSTssp245} |
---|
78 | cdo -L add -mulc,.4 -selname,tsol_oce ${fileSSTRCP85} -mulc,.6 -selname,tsol_oce ${fileSSTRCP60} ${outSSTssp370} |
---|
79 | cdo -L add -mulc,8. -divc,19. -selname,tsol_oce ${fileSSTRCP45} -mulc,11. -divc,19. -selname,tsol_oce ${fileSSTRCP26} ${outSSTssp434} |
---|
80 | cdo -L add -mulc,.6 -selname,tsol_oce ${fileSSTRCP60} -mulc,.4 -selname,tsol_oce ${fileSSTRCP45} ${outSSTssp460} |
---|
81 | cdo -L add -mulc,8. -divc,19. -selname,tsol_oce ${fileSSTRCP45} -mulc,11. -divc,19. -selname,tsol_oce ${fileSSTRCP26} ${outSSTssp534} |
---|
82 | cp ${fileSSTRCP85} ${outSSTssp585} |
---|
83 | |
---|
84 | cdo -L add -mulc,19. -divc,26. -selname,pourc_sic ${fileSICRCP26} -mulc,7. -divc,26. -selname,pourc_sic ${GENCMIP6_CCCWORKDIR}/CMIP6_LIMIT/SIC_RCP0.nc ${outSICssp119} |
---|
85 | cp ${fileSICRCP26} ${outSICssp126} |
---|
86 | cp ${fileSICRCP45} ${outSICssp245} |
---|
87 | cdo -L add -mulc,.4 -selname,pourc_sic ${fileSICRCP85} -mulc,.6 -selname,pourc_sic ${fileSICRCP60} ${outSICssp370} |
---|
88 | cdo -L add -mulc,8. -divc,19. -selname,pourc_sic ${fileSICRCP45} -mulc,11. -divc,19. -selname,pourc_sic ${fileSICRCP26} ${outSICssp434} |
---|
89 | cdo -L add -mulc,.6 -selname,pourc_sic ${fileSICRCP60} -mulc,.4 -selname,pourc_sic ${fileSICRCP45} ${outSICssp460} |
---|
90 | cdo -L add -mulc,8. -divc,19. -selname,pourc_sic ${fileSICRCP45} -mulc,11. -divc,19. -selname,pourc_sic ${fileSICRCP26} ${outSICssp534} |
---|
91 | cp ${fileSICRCP85} ${outSICssp585} |
---|
92 | |
---|
93 | #--end loop on years |
---|
94 | done |
---|