Data analysis: Examples



The following examples represent just one way of answering the questions and should provide a starting point for more varied analyses.


Contents:

1.Comparing against observations
2.Creating climate change fields
3.Creating timeseries
4.Creating mean annual cycles
5.Calculation of 'P minus E';
6.Assessing the significance of climate change
7.Creating a future climate scenario

1. Comparing against observations


1. Compare simulated and observed June to August (JJA) 1.5m temperatures for the period 1961 to 1990 and find where the differences are greater than ±1 K.


Create the RCM multiannual mean for JJA 1961-1990

% stash 3236

% cd $ARCHIVEDIR

% ppstats -H "period=0,3 and mon=6" -o rcm_K.pp -t mean \
itkaa/03236/itkaaa.ps*.rr8.pp

Convert from Kelvin to Celsius

% ppexpr -o rcm.pp -x "x-273.15" x=rcm_K.pp

Regrid the CRU observed data to the grid of the model

% ppregrid -o cru.reg.pp -t rcm.pp \
$GLOBALDIR/cru20/03236/cru21a.muj0jja.03236.pp

Apply the RCM land-sea mask to the regridded CRU data to ensure that the missing data areas coincide

% ppwhere -o cru_land.pp -m -q itkaa/ancil/qrparm.mask.rr8.pp cru.reg.pp

Find the difference of the two fields

% ppexpr -o diff.pp -x "x-y" x=rcm.pp y=cru_land.pp

Find where differences are greater than 1K or less than -1K

% ppwhere -o diff_gt1.pp -w "x>1.0 or x<-1.0" diff.pp

% xconv -i diff_gt1.pp


2. Compare simulated and observed average pressure at mean sea level (PMSL) for December to February (DJF) on the grid of the observations.

Create the RCM multiannual mean for DJF 1961-1990

% stash 16222

% cd $ARCHIVEDIR

% ppstats -H "period=0,3 and mon=12" -o rcm.pp -t mean itkaa/16222/itkaaa.ps*.rr8.pp

Aggregate the RCM data to the grid of the ERA40 dataset

% ppaggregate -o rcm.agg.pp -t $GLOBALDIR/era40/16222/era40a.muj0djf.16222.pp \
rcm.pp

Difference with the ERA40 data and convert to hectopascals (hPa)

% ppexpr -o diff1.pp -x "0.01*(x-y)" x=rcm.agg.pp \
y=$GLOBALDIR/era40/16222/era40a.muj0djf.16222.pp

% xconv -i diff1.pp &

Reduce the size of the field to remove the missing data areas and centre the data.

% ppextract -r 68,6,98,36 diff1.pp

% xconv -i diff1.ext.pp


3. Repeat the comparison of question 2, but this time on the grid of the RCM (instead of the ERA40 grid). Compare the difference fields resulting from the two methods. Which is the most appropriate method to use?

Hint: The difference from question 2, diff1.pp, should be disaggregated back to the RCM grid for the comparison


Regrid the ERA40 data onto the RCM grid

% ppregrid -o era40.pp -t rcm.pp \
$GLOBALDIR/era40/16222/era40a.muj0djf.16222.pp

Difference the model and observed fields and convert to hectopascals (hPa)

% ppexpr -o diff2.pp -x "0.01*(x-y)" x=rcm.pp y=era40.pp

Broadcast (disaggregate) the difference field from question 2 back to the RCM grid by using the -x option to ppaggregate

% ppaggregate -o diff1.disagg.pp -t diff2.pp -x diff1.pp

% xconv -i diff1.disagg.pp &

Compare the two difference fields on the grid of the RCM

% ppexpr -o diff_reg-agg.pp -x "x-y" x=diff2.pp y=diff1.disagg.pp

% xconv -i diff_reg-agg.pp


4. Compare simulated and observed average geopotential height at 850 hPa for December to February (DJF).

Create the RCM multiannual mean for DJF 1961-1990

% stash "geopotential height"

% cd $ARCHIVEDIR

% ppstats -H "period=0,3 and mon=12 and lblev=850" -o rcm.pp -t mean \
itkaa/16202/itkaaa.ps*.rr8.pp

… or use ppfile to extract the 850 hPa fields

% ppfile -o rcm850.pp -H 'lblev=850' \
itkaa/16202/itkaaa.ps??djf.16202.rr8.pp

% ppstats -o rcm.pp -t mean rcm850.pp

Isolate the ERA40 data for 850 hPa

% ppfile -o era850.pp -H "lblev=850" \
$GLOBALDIR/era40/16202/era40a.muj0djf.16202.pp

Aggregate the RCM data to the resolution of the ERA40 dataset

% ppaggregate -o rcm.agg.pp -t era850.pp rcm.pp

Difference with the ERA40 data

% ppexpr -o diff.pp -x "x-y" x=rcm.agg.pp y=era850.pp

Shift the global difference field so that the data area is not split into two halves

% ppextract -r -180,-90,180,90 diff.pp

% xconv -i diff.ext.pp

Extract the data area

% ppextract -r 68,6,98,36 diff1.pp


2. Creating climate change fields


1. Find the future change in December to February (DJF) total precipitation in mm/day and also as a percentage of the present day values.

Create multiannual means for each period

% cd $ARCHIVEDIR

% ppstats -o base.pp -t mean itkaa/05216/itkaaa.ps??djf.*.rr8.pp

% ppstats -o fut.pp -t mean itlaa/05216/itlaaa.ps??djf.*.rr8.pp

Find the difference in mm/day

% ppexpr -o difference_mmday.pp -x "(x-y)*86400" x=fut.pp y=base.pp

% xconv -i difference_mmday.pp &

Find the difference as a percentage of the baseline (note that the -m option deals with, amongst other things, possible divisions by zero)

% ppexpr -m -o percentage_diff.pp -x "100*(x-y)/y" x=fut.pp y=base.pp

% xconv -i percentage_diff.pp


2. Find the future change in DJF total snowfall in mm/day and also as a percentage of the present day values.

Hint: The total snowfall rate is the sum of convective and large-scale snowfall rates, STASH codes 5206 and 4204 respectively

Check the STASH codes of the snow diagnostics

% stash 4204 5206

Create multiannual means for each period

% cd $ARCHIVEDIR

Large-scale snow

% ppstats -o base_ls.pp -t mean itkaa/04204/itkaaa.ps??djf.*.rr8.pp

% ppstats -o fut_ls.pp -t mean itlaa/04204/itlaaa.ps??djf.*.rr8.pp

Convective snow

% ppstats -o base_conv.pp -t mean itkaa/05206/itkaaa.ps??djf.*.rr8.pp

% ppstats -o fut_conv.pp -t mean itlaa/05206/itlaaa.ps??djf.*.rr8.pp

Total snow (in mm/day)

% ppexpr -o base.pp -x "(x+y)*86400" x=base_conv.pp y=base_ls.pp

% ppexpr -o fut.pp -x "(x+y)*86400" x=fut_conv.pp y=fut_ls.pp

Difference in total snow

% ppexpr -o difference.pp -x "x-y" x=fut.pp y=base.pp

% xconv -i difference.pp &

Difference in total snow (as a percentage of the baseline)

% ppexpr -m -o percentage_diff.pp -x "100*(x-y)/y" x=fut.pp y=base.pp

% xconv -i percentage_diff.pp &

Note the missing data areas. These are where there are values of 0.0 in base.pp. The -m option prevents these from causing an error.

Also note that the colours in the plot are skewed by the very large percentage differences over north Africa, which are not meaningful since the maximum percentage difference (37133.46%) represents a change from 0.000000070391 mm/day to 0.000026209 mm/day. So, limit the field of percentage differences to a maximum of, say, 200%

% ppwhere -o percentage_diff2.pp -w "x<=200" percentage_diff.pp

% xconv -i percentage_diff2.pp


3. Find the change (in hPa) in DJF pressure at mean sea level (PMSL).

Create multiannual means for each period

% cd $ARCHIVEDIR

% ppstats -o base.pp -t mean itkaa/16222/itkaaa.ps??djf.*.rr8.pp

% ppstats -o fut.pp -t mean itlaa/16222/itlaaa.ps??djf.*.rr8.pp

Find the difference in hectopascals (equivalent to millibars)

% ppexpr -o difference.pp -x "0.01*(x-y)" x=fut.pp y=base.pp

% xconv -i difference.pp


4. Find the future change in June to August (JJA) 1.5 metre temperature.

Create multiannual means for each period

% cd $ARCHIVEDIR

% ppstats -o base.pp -t mean itkaa/03236/itkaaa.ps??djf.*.rr8.pp

% ppstats -o fut.pp -t mean itlaa/03236/itlaaa.ps??djf.*.rr8.pp

Find difference

% ppexpr -o difference.pp -x "x-y" x=fut.pp y=base.pp

% xconv -i difference.pp


5. Find the ratio of the standard deviations of future and baseline DJF geopotential height at the 500hPa level.

Create the standard deviation for DJF 1961-1990 (since there are geopotential height fields for many vertical levels in each file, the -H option to ppstats is necessary to avoid creating a sample standard deviation over all vertical levels).

% cd $ARCHIVEDIR

% ppstats -H "lblev=500" -o base.pp -t sd \
itkaa/16202/itkaaa.ps??djf.*.rr8.pp

Create the standard deviation for DJF 2071-2100

% ppstats -H "lblev=500" -o fut.pp -t sd \
itlaa/16202/itlaaa.ps??djf.*.rr8.pp

Find the ratio

% ppexpr -m -o ratio.pp -x "x/y" x=fut.pp y=base.pp

% xconv -i ratio.pp


3. Creating timeseries


1. Create a timeseries of monthly mean 1.5 metre temperature averaged over all land points in the domain from December 1960 to November 1990.

Hint: Use -d f9.3 with ppdata to create easy-to-read numbers in the text file

% cd $ARCHIVEDIR

% ppdata -d f9.3 -f "-273.15" -m \
-q itkaa/ancil/qrparm.mask.rr8.pp -x itkaa/03236/itkaaa.pm*.03236.rr8.pp

% cat ppdata.data


2. Create a timeseries of daily mean total precipitation from the grid box containing Dhaka, Bangladesh from December 1960 to November 1990. What is the simulated mean annual rainfall total?

Hint: Dhaka's location is approximately 23.5N, 90.2 E and use the -L option to ppdata.

% cd $ARCHIVEDIR/itkaa

% ppdata -f "*86400" -L "23.5,90.2,T" -x \
-y "title=Rainy Dhaka" 05216/itkaaa.pa*.05216.rr8.pp

Find the mean annual average daily rainfall amount …

% cat ppdata.info

… find the mean annual total by multiplying by 360


3. Create a timeseries of seasonal mean pressure at mean sea level averaged over Bangladesh from December 1960 to November 1990. How many land points are there over Bangladesh? Check that all of the Bangladesh land points have been included.

Hint: Bangladesh is bounded by the area 87E to 94E, 20N to 27N.

% cd $ARCHIVEDIR/itkaa

% ppdata -f "/100" -m -q ancil/qrparm.mask.rr8.pp \
-r 97,20,94,27 -x -y "title=Bangladesh under pressure (hPa)" \
16222/itkaaa.ps*rr8.pp

Find the number of land points over Bangladesh

% ppfile -s $TMPDIR/ppdata.mask.pp

… or

% cat $TMPDIR/ppdata.out

Check the land points by plotting the mask field in ppdata.mask.pp


4. Creating mean annual cycles


1. Plot the mean monthly annual cycle for 1.5 metre temperature for the period 1961 to 1990 averaged over the whole domain.


Create the 1961 to 1990 multiannual mean for each month of the year. This is best done in a 'loop' (literally: 'for each month in the following list of months do the following commands')

% cd $ARCHIVEDIR/itkaa

% for month in 01 02 03 04 05 06 07 08 09 10 11 12

% do

% ppstats -H "mon=$month and period=0,1 and vtime>=1960,12,1 and vtime<=1990,11,1" \
-o 03236.$month.pp -t mean 03236/*a.pm*.03236.rr8.pp

% done

List the multiannual mean files

% ls -o 03236.??.pp

Create and plot the mean annual cycle in Celsius

% ppdata -f "-273.15" -x 03236.??.pp


2. Plot the mean monthly annual cycle for total precipitation rate for the period 2071 to 2100 averaged over land points of the whole domain and view the data file. Also find the mean of the annual cycle.


Create the 2071 to 2100 multiannual mean for January …

% stash "total precipitation rate"

% cd $ARCHIVEDIR/itlaa

% for month in 01 02 03 04 05 06 07 08 09 10 11 12

% do

% ppstats -H "mon=$month and period=0,1 and vtime>=2070,12,1 and vtime<=2100,11,1" \
-o 05216.$month.pp -t mean 05216/*a.pm*.05216.rr8.pp

% done

List the multiannual mean files

% ls -o 05216.??.pp

Create, and plot the mean annual cycle over land points in mm/day with a logarithmic scale

% ppdata -f "*86400.0" -m -q ancil/qrparm.mask.rr8.pp \
-x -y "ylogscale=2" 05216.??.pp

View the raw data

% cat ppdata.data

Find the mean of the annual cycle

% cat ppdata.info


5. Calculation of 'P minus E'


1. Create PP fields of the June to August (JJA) land-only P minus E (total precipitation minus total evaporation at the surface) for the periods 1961 to 1990 and 2071 to 2100 and find the field of change in P minus E.

Hint: The appropriate evaporation diagnostic is STASH code 3223 (total moisture flux) and only the surface level is required (level code 9999).


Find baseline 'P minus E'

% cd $ARCHIVEDIR/itkaa

Find baseline precipitation (in mm/s = kg/m2/s)

% ppstats -o 05216.pp -t mean 05216/itkaaa.ps??jja.05216.rr8.pp

Find baseline surface moisture flux (using the -H option to avoid creating the mean moisture flux over all the model levels in the files).

% ppstats -o 03223.pp -t mean -H "lblev=9999" \
03223/itkaaa.ps??jja.*.rr8.pp

Find the baseline P minus E

% ppexpr -o ../P-E.baseline.pp -x "86400*(x-y)" x=05216.pp y=03223.pp

% xconv -i ../P-E.baseline.pp &

Find the future P minus E

% cd $ARCHIVEDIR/itlaa

% ppstats -o 05216.pp -t mean 05216/*a.ps??jja.*.rr8.pp

% ppstats -o 03223.pp -t mean -H "lblev=9999" \
03223/*a.ps??jja.*.rr8.pp

% ppexpr -o ../P-E.future.pp -x "86400*(x-y)" x=05216.pp y=03223.pp

% xconv -i ../P-E.future.pp &

Remove sea points from the two P minus E fields (using the default output file names from ppwhere)

% cd .. # Move up one directory to $ARCHIVEDIR

% ppwhere -m -q itlaa/ancil/qrparm.mask.rr8.pp P-E.*.pp

Find the field of change in P minus E

% ppexpr -o P-E.change.pp -x "x-y" x=P-E.future.whe.pp \
y=P-E.baseline.whe.pp

% xconv -i P-E.change.pp &

List P minus E files

% ls -o P-E.baseline.pp P-E.change.pp P-E.future.pp


2. Find the average land-only change in P minus E over the whole RCM domain and also over land areas to the north and south of the line of 20 degrees latitude.

Hint: Parts of a region passed to ppdata with the -r option may lie outside of the RCM domain, and the numbers in the output text file may be made more readable with the -d option.


Find land-area average changes in P minus E

% cd $ARCHIVEDIR

% ppdata -d f9.3 -o whole.txt P-E.change.pp

% ppdata -d f9.3 -o Nof20.txt -r 60,20,100,90 P-E.change.pp

% ppdata -d f9.3 -o Sof20.txt -r 60,-90,100,20 P-E.change.pp

Print the results (first column of files)

% cat whole.txt # Whole domain

% cat Nof20.txt # North of 20 N

% cat Sof20.txt # South of 20 N


3. Plot the difference in the future and baseline monthly mean annual cycles of P minus E averaged over land points south of 20N.


Create the 1961 to 1990 multiannual means for January to December

% cd $ARCHIVEDIR/itkaa

% for month in 01 02 03 04 05 06 07 08 09 10 11 12

% do

% ppstats -o 05216.pp -t mean -H "mon=$month" 05216/*a.pm*.rr8.pp

% ppstats -o 03223.pp -t mean -H "mon=$month and lblev=9999" \
03223/*a.pm*.rr8.pp

% ppexpr -o ../P-E.baseline.$month.pp -x "x-y" x=05216.pp y=03223.pp

% done

Create the 2071 to 2100 multiannual means for January to December

% cd $ARCHIVEDIR/itlaa

% for month in 01 02 03 04 05 06 07 08 09 10 11 12

% do

% ppstats -o 05216.pp -t mean -H "mon=$month" 05216/*a.pm*.rr8.pp

% ppstats -o 03223.pp -t mean -H "mon=$month and lblev=9999" \
03223/*a.pm*.rr8.pp

% ppexpr -o ../P-E.future.$month.pp -x "x-y" x=05216.pp y=03223.pp

% done

Remove temporary files

% rm 05216.pp 03223.pp

Create the difference between the two annual cycles

% cd ..

% for month in 01 02 03 04 05 06 07 08 09 10 11 12

% do

% ppexpr -o P-E.diff.$month.pp -x "x-y" x=P-E.future.$month.pp \
y=P-E.baseline.$month.pp

% done

Plot the difference of the annual cycles averaged over land points south of 20N

% ppdata -f "*86400" -m -q itkaa/ancil/qrparm.mask.rr8.pp \
-r 60,0,100,20 -x \
-y "title=P-E difference (South Asia)" \
P-E.diff.??.pp


6. Assessing the significance of climate change


1. Find where in the domain the future mean of June to August (JJA) 1.5 metre temperature is statistically significantly warmer to that of the baseline experiment.

Note: Under the assumption that the multiannual seasonal means come from a normal distribution, this may be done by carrying out a t-test for two population means where the variances are unknown and assumed to be unequal. The test described here is relevant to this particular analysis of seasonal means of this particular variable, but is not necessarily generally applicable. For example, the statistical test described here would not be applicable to daily mean precipitation data since the normality assumption does not hold in this case. However, seasonal means of precipitation may be assumed to come from a normal distribution and so may be analysed with (a variant of) this test (see question 2).

Hint: Whilst the null hypothesis in this case is that the future mean is the same as the baseline mean, a one-tailed test may be used to only return evidence of statistically significant warming.


Define the sets of files containing the samples for the baseline period (sample1) and the future (sample2) and find the size of each sample (n1 and n2).

% cd $ARCHIVEDIR

% sample1="itkaa/03236/itkaaa.ps??jja.03236.rr8.pp"

% sample2="itlaa/03236/itlaaa.ps??jja.03236.rr8.pp"

% n1=`ls -1 $sample1 | wc -l`

% n2=`ls -1 $sample2 | wc -l`

% echo Sample sizes: n1=$n1, n2=$n2

Calculate the sample mean fields (x1.pp and x2.pp).

% ppstats -o x1.pp -t mean $sample1

% ppstats -o x2.pp -t mean $sample2

Calculate the sample standard deviation fields (s1.pp and s2.pp).

% ppstats -o s1.pp -t sd $sample1

% ppstats -o s2.pp -t sd $sample2

Calculate the t-statistic field (t.pp). At each point the t-statistic is . Note that in this case it is important to have x2 – x1 as the numerator (as opposed to x1 – x2) since we are testing for the mean of sample 2 being warmer (greater) than the mean of sample 1.

Hint: It is essential to use double as opposed to single quotes in this ppexpr command so that $n1 and $n2 are replaced with their numerical value.

% ppexpr -o t.pp -x "(x2-x1)/[(s1^2/$n1)+(s2^2/$n2)]^0.5" \
s1=s1.pp s2=s2.pp x1=x1.pp x2=x2.pp

Calculate the degrees of freedom field (df.pp). At each point the degrees of freedom is

% ppexpr -o df.pp -x "([(s1^2/$n1)+(s2^2/$n2)]^2)/ \
[(s1^2/$n1)^2/($n1-1)+(s2^2/$n2)^2/($n2-1)]" s1=s1.pp s2=s2.pp

Find the field of one-tailed critical values of the t-statistic for a significance level of 95% (tcrit.pp)

% ppdf2tcrit -o tcrit.pp -s 95 -t 1 df.pp

Find the where the future mean is statistically significantly warmer than the baseline at the 95% level (sig_diff.pp)

% ppexpr -o t-tcrit.pp -x "x-y" x=t.pp y=tcrit.pp

% ppwhere -o sig_diff.pp -w "x>0.0" t-tcrit.pp

% xconv -i sig_diff.pp



2. Find where in the domain the future mean of JJA total precipitation is statistically significantly different to that of the baseline experiment. What percentage of grid points are significantly different? What percentage of the domains area has significant differences?

Note: See the NOTE from question 1.

Hint: The null hypothesis in this case is that the future mean is not the same as the baseline mean, so a two-tailed test should be used. The particular formulation of this test will only give information on whether the future mean is statistically significantly different to that of the baseline experiment, but will not give information on whether or not is drier or wetter. A one-tailed test would be required to test for either of these two occurrences.


Remove existing files to avoid confusion

% cd $ARCHIVEDIR

% rm -f x[12].pp s[12].pp t.pp df.pp tcrit.pp sig_diff.pp

Define the sets of files containing the samples for the baseline period (sample1) and the future (sample2) and find the size of each sample (n1 and n2).

% sample1="itkaa/05216/itkaaa.ps??jja.05216.rr8.pp"

% sample2="itlaa/05216/itlaaa.ps??jja.05216.rr8.pp"

% n1=`ls -1 $sample1 | wc -l`

% n2=`ls -1 $sample2 | wc -l`

% echo Sample sizes: n1=$n1, n2=$n2

Calculate the sample mean fields (x1.pp and x2.pp).

% ppstats -o x1.pp -t mean $sample1

% ppstats -o x2.pp -t mean $sample2

Calculate the sample standard deviation fields (s1.pp and s2.pp).

% ppstats -o s1.pp -t sd $sample1

% ppstats -o s2.pp -t sd $sample2

Calculate the t-statistic field (t.pp). At each point the t-statistic is . Note that in this case does not matter whether we have x2 – x1 or x1 – x2 as the numerator since the sign of the numerator of t is not relevant when carrying out a two-tailed test.

% ppexpr -o t.pp -x "(x2-x1)/[(s1^2/$n1)+(s2^2/$n2)]^0.5" \
s1=s1.pp s2=s2.pp x1=x1.pp x2=x2.pp

Calculate the degrees of freedom field (df.pp). At each point the degrees of freedom is

Hint: It is essential to use double as opposed to single quotes in this ppexpr command so that $n1 and $n2 are replaced with their numerical value.

% ppexpr -o df.pp -x "([(s1^2/$n1)+(s2^2/$n2)]^2)/ \
[(s1^2/$n1)^2/($n1-1)+(s2^2/$n2)^2/($n2-1)]" s1=s1.pp s2=s2.pp


Find the field of two-tailed critical values of the t-statistic for a significance level of 90% (tcrit.pp)

% ppdf2tcrit -o tcrit.pp -s 90 -t 2 df.pp

Find the where the future mean is statistically significantly different (drier or wetter) than the baseline (sig_diff.pp)

% ppexpr -o abs_t-tcrit.pp -x "abs(t)-y" t=t.pp y=tcrit.pp

% ppwhere -o sig_diff.pp -w "x>0.0" abs_t-tcrit.pp

% xconv -i sig_diff.pp

Find the percentage of significantly different grid points

% ppfile -s sig_diff.pp

Find the land area which has significant differences, expressed as a percentage of total land area of the domain.

Find the area of each grid box
% ppdata -e . t.pp

Find the sum of the areas of land grid boxes
% ppdata -o total_land_area.txt -m \
-q $ARCHIVEDIR/itkaa/ancil/qrparm.mask.rr8.pp -t sum -w none \
ppdata.areas.pp

Find the interesection of land and significantly different grid boxes
% ppdata -e . -m -q $ARCHIVEDIR/itkaa/ancil/qrparm.mask.rr8.pp sig_diff.pp

Find the sum of the areas of significantly different land grid boxes
% ppdata -o sig_land_area.txt -m -q ppdata.mask.pp -t sum -w none ppdata.areas.pp

% cat sig_land_area.txt total_land_area.txt

Find the percentage
% ppexpr -x "(100*0.839706253184000*10^13)/(0.111954197793280*10^14)"


7. Creating a future climate scenario


1. Create a climate change scenario for 2071 to 2100 which comprises a timeseries of daily mean surface air temperature which has a mean derived from the observed mean plus the modelled change but has variability directly simulated by the model.

Note:This is not a recipe for creating any climate change scenario, rather a possible course of action which has resulted from a hypothetical evaluation of the model performance.

Create the monthly mean annual cycle from the model baseline.

% cd $ARCHIVEDIR

% for month in 01 02 03 04 05 06 07 08 09 10 11 12

% do

% ppstats -H"mon=$month" -o model.$month.pp -t mean itkaa/03236/*a.pm*.rr8.pp

% done

Create the monthly mean annual cycle from the observations

% for month in 01 02 03 04 05 06 07 08 09 10 11 12

% do

% ppregrid -H "mon=$month and period=29,1" -m -o obs.pp \
-t itkaa/ancil/qrparm.mask.rr8.pp \
$GLOBALDIR/cru20/03236/cru21a.muj0???.03236.pp

% ppexpr -o obs.$month.pp -x "a+273.15" a=obs.pp

% done

Subtract the observed and model baseline monthly mean annual cycles.

% for month in 01 02 03 04 05 06 07 08 09 10 11 12

% do

% ppexpr -o obs-model.$month.pp -x "o-m" o=obs.$month.pp m=model.$month.pp

% done

Add the observed minus model baseline monthly mean annual cycle to the modelled future daily timeseries

% cat itlaa/03236/itlaaa.pa*.rr8.pp >itlaa.daily.pp

% for month in 01 02 03 04 05 06 07 08 09 10 11 12

% do

% ppexpr -H "mon=$month" -o scenario.$month.pp -x "a+d" \
a=itlaa.daily.pp d=obs-model.$month.pp

% done

For the grid cell encompassing Dhaka (23.5N, 90.2E) compare the future time series simulated directly by the model with the future climate scenario

% ppdata -H'period=0,0,1' -L "23.5,90.2,T" -y title="model (future)" -x \
itlaa/03236

% ppdata -L "23.5,90.2,T" -y title="scenario" -x scenario.??.pp

% for month in 01 02 03 04 05 06 07 08 09 10 11 12

% do

% ppexpr -H"mon=$month" -o scenario-model.$month.pp -x "a-b" \
a=scenario.$month.pp b=itlaa.daily.pp

% done

% ppdata -L "23.5,90.2,T" -y title="scenario-model" -x \
scenario-model.??.pp