So the assignment is here.
Problem 1. Time series of annual mean precipitation (pr) and temperature (tas) over your area compared with the global average for the historic period. (I am going to abbreviate this as historic: ts of annual mean pr and tas for area and globe).
 download the nc files and then cut the south hemisphere (our region) out using
cdo sellonlatbox
orcdo elindexbox
cdo selindexbox,1,192,1,48 tas_Amon_MPIESMLR_rcp85_r1i1p1_200601210012.nc temp_rcp85_SH.nc
 find the global and area annual mean using
cdo fldmean
andcdo yearmean
, then convert the prec unit from kg/m^2s (mm/s) to mm/yr by multiply 31536000 and the temp unit from K to Ccdo fldmean prec_SH.nc prec_SH.mean.nc cdo yearmean prec_SH.mean.nc prec_SH.annual.mean.nc cdo mulc,31536000 prec_SH.annual.mean.nc prec_SH.annual.mean.mm_yr.nc cdo addc,273.15 temp_SH.annual.mean.nc temp_SH.annual.mean.C.nc
 output the data to ascii using cdo output and then plot them in Excel or whatever
cdo output prec_SH.annual.mean.mm_yr.nc > prec_SH.annual.mean.mm_yr.txt
Problem 2. historic: ts of annual anomaly of pr and tas for area and globe. The anomaly should be calculated relative to the period 19701999.
 find the mean values for 19701999 using
cdo seldate
andcdo timmean
cdo seldate,19700101,19991231 prec_global.annual.mean.mm_yr.nc prec_global.annual.mean.7099.nc cdo timmean prec_global.annual.mean.7099.nc out.nc
 then I can find the mean prec and temp for 7099:
South Hemisphere mean prec 7099: 1052.65 mm/yr South Hemisphere mean temp 7099: 13.53 C Global mean prec 7099: 1068.36 mm/yr Global mean temp 7099: 14.08 C
 subtract the mean value to get the anomaly time series
cdo addc,1052.65 prec_SH.annual.mean.mm_yr.nc prec_SH.anom.nc
Problem 3. climate change: ts of annual anomaly of pr and tas for area and globe for RCP4.5 and RCP8.5. The anomaly should be calculate relative to the period 19701999.
see problem 2
Problem 4. Historic: seasonal mean 2D map of pr and tas for your area for DJF, MAM, JJA, SON for the period 19701999. This should be 4 panels on one slide.
cdo yseasmean $infile $outfile
Problem 5. Climate change: seasonal mean 2D map of pr and tas for your area for DJF, MAM, JJA, SON for the periods 20202049 and 20702099 for RCP4.5 and RCP8.5. This should be 4 panels on one slide for each period and each RCP.
Problem 6. Climate change: repeat 5. as an anomaly to the period 19701999.
Problem 7. Climate change: 2D plots for RCP4.5 and RCP8.5 for your area with a mask that shows the areas in which mean annual temperature change and precipitation change are both in the upper 10% (basically show areas that are expected to experience both extreme temperature and precipitation change).

calculate the annual mean for periods 19701999 (historical) and 20702099 (RCP 4.5 and RCP8.5)

find the temp and prec relative differences between two time periods using
cdo sub
andcdo div

find the 90 percentile thresholds for both temp and prec using
cdo fldpctl
then find the grid cells larger than the thresholds usingcdo gtc
. Then find the intersection. ```bash cdo sub mean.seasonal.SH.prec_rcp85_global.7099.nc mean.seasonal.SH.prec_global.7099.nc out1.nc cdo div out1.nc mean.seasonal.SH.prec_global.7099.nc out2.nc cdo fldpctl,90 out2.nc out3.nc value=cdo output out3.nc  less
vv=echo $value
cdo gtc,$vv out2.nc outprec.nc
cdo sub mean.seasonal.SH.temp_rcp85_global.7099.nc mean.seasonal.SH.temp_global.7099.nc out1.nc
cdo div out1.nc mean.seasonal.SH.prec_global.7099.nc out2.nc
cdo fldpctl,90 out2.nc out3.nc
value=cdo output out3.nc  less
vv=echo $value
cdo gtc,$vv out2.nc outtemp.nc
cdo add outprec.nc outtemp.nc out.nc cdo eqc,2 out.nc export.nc ```