PRECIS support forum

annual mean
Page 1 of 1

Author:  Khairul [ Tue Jul 05, 2016 6:27 am ]
Post subject:  annual mean


I am trying to find the yearly annual means of for 03236 (2015-2049) using cdo. I'm confuse, which output files do I have to compile from the 03236 file. RUNIDa.p?_____.pp which "?" should I compile into 1? (I have read the manual but still confuse). Thank you.


Author:  dmhg [ Tue Jul 05, 2016 9:11 pm ]
Post subject:  Re: annual mean

Hi Khairul,

Let's say your surface air temperature files are in $ARCHIVEDIR/khaab/03236
(I'm inventing khaab as your RUNID - it will be different for you).

You can create annual means using ppstats and the source daily mean output files (**).

Remember PRECIS output uses the UM date stamp (see Appendix D of the PRECIS technical manual )

Let's say your PRECIS run started in Dec 1969 and run until 2005, and you want annual mean files from 1971 to 2000.

1) Remove the spinup data
cd $ARCHIVEDIR/khaab/03236
mkdir SPINUP
mv khaaba.pag9*  SPINUP/
mv khaaba.pah0*  SPINUP/

(That removes g9 files [1969] and h0 [1970] from what you will analyse. Removing the spinup data is mandatory)

2) Remove the outer 8 point RIM
mkdir NORIM
pprr -r 8 -H "lbyr>1970 and lbyr<2001" -e NORIM*

3) Calculate the annual means


for udec in h ; do for uyr in 1 2 3 4 5 6 7 8 9 ; do ppstats -t mean -o${udec}${uyr}.ann.pp${udec}${uyr}*.rr8.pp ; done ;done

for udec in i j ; do for uyr in 0 1 2 3 4 5 6 7 8 9 ; do ppstats -t mean -o${udec}${uyr}.ann.pp${udec}${uyr}*.rr8.pp ; done ;done

for udec in k ; do for uyr in 0; do ppstats -t mean -o${udec}${uyr}.ann.pp${udec}${uyr}*.rr8.pp ; done ;done

4) View a list of the annual means
ls *ann.pp

Each *ann.pp file is a mean of all files from the year.

Your annual means files in pp format then would need to be converted to netcdf format for CDO to operate on them.


Author:  Khairul [ Thu Jul 21, 2016 6:54 am ]
Post subject:  Re: annual mean

Hi David,

Thank you for replying. I have tried all the commands and viewed the results. I don't know why but it somehow shifts my latitude coordinates.


Author:  dmhg [ Thu Jul 21, 2016 10:28 am ]
Post subject:  Re: annual mean

Hi Khairul.

PRECIS uses a rotated pole grid. Have you regridded your output data to the regular latitude longitude coordinate system? The tool ppregrid does that.

For a 25km*25km grid box experiment
ppregrid -d 0.22,0.22 -o khaaba.pyh0.ann.reg.pp khaaba.pyh0.ann.pp

Or if your experiment is 50km*50km
ppregrid -d 0.44,0.44 -o khaaba.pyh0.ann.reg.pp khaaba.pyh0.ann.pp

The files *.reg.pp would be annual means with the rim removed, regridded to regular latitude longitude, ready to be converted to netcdf for CDO.


Author:  pagona [ Wed Jun 07, 2017 11:14 am ]
Post subject:  Re: annual mean

Thanks for this post i have found useful information. David, would you explain more on how one can remove the outer rim for several files at once. like say you want to remove the outer rim for all files for a particular STASH code for daily/monthly files?
James pagona

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group