This work was done as part of the PEGASUS project but has wider applications for anyone wishing to run WRF from climate model output.
A pipeline to generate WRF intermediate files from Hadgemes2 output based off of NCARS cesm-to-wrf.ncl scripts provided on the WRF user site. Hadgemes2 outputs different variables and has a different vertical co-coordinate system therefore significant modifications are required to the ncl code to generate the WRF intermediate files.
Hopefully this will give a good starting point for those wishing to drive WRF with output from climate models similar to Hadgem_es2.
This pipeline fetches data from https://esgf-node.llnl.gov/projects/cmip5/.
- ncl
- cdo
- bash
- All scripts can be ran induvidually however
Hadgem2WRF.sh
will run the scripts in order. - All shell scripts have help funtions and designed to be ran in order:
wget_script.sh
will download hadgem filescdo_script.sh
will manipulate files by calander swapping, remapping and timeslicingfile_vars.sh
will create a filesytem for the files with the option storing elsewhere and creating symlinkshad2int.ncl
will create WRF intermediate files ready to be used by metgrid
A seperate set of job scripts (SGE / PBS (minor modifications) ) have been written in the run all folder. wget all scripts can be retrieved from. https://esgf-node.llnl.gov/projects/cmip5/
mv run_all/* .
# wget all var files into the staging area
# This creates a huge TBS amount of data, so recommended 1 var at a time
- `# Each script has a "var = " line adjust accordingly for each 6 day var'
- `# monthly vars can be retrieved via the normal method as this is done in 1 to 3 chunks only depending on variable'
qsub cdo_concat.sh
qsub cdo_var.sh
qsub cdo_split.sh
#REPEAT for each var
qsub ncl_all.sh #edit for years to loop over depending on your job schedular time limits
./linkfiles.sh' # will symlink 1st of each month in order for wrf to creating 1st month restart filesif running monthly sims
Contributions are welcome small or large if you would like to contribute e.g. fix spelling, submit code for other climate models or translate the ncl code into python please have a look a the contribution guidelines and submit a pull request.
- These scripts are based off of NCAR's cesm-to-wrf.ncl scripts
- Equations used in the main ncl code are cited in situ
- ncl is being phased out, a phython version of this would be desired but is not under current development