Instructions on how to setup the CAF2014-Rhaobi model
-----------------------------------------------------

1. Download the original CAF2014 model archive CAF2014-1.0.zip from https://zenodo.org/records/3608877

2. Unzip the archive to e.g. ~/tmp/ so that it will contain the folder MarcelVanOijen-CAF2014-f82510e

3. Unzip also the contents of this archive to ~/tmp/ so that it will contain the folder CAF2014-Rhaobi

4. Copy the required CAF2014 files to CAF2014-Rhaobi:

cd ~/tmp
cp MarcelVanOijen-CAF2014-f82510e/initialisation/initialise_CAF2014_general.R CAF2014-Rhaobi/initialisation/
cp MarcelVanOijen-CAF2014-f82510e/parameters/parameters_default.txt CAF2014-Rhaobi/parameters/
cp -r MarcelVanOijen-CAF2014-f82510e/model CAF2014-Rhaobi/model

5. Apply patch to Fortran source code of the CAF2014 model to derive the source code of the CAF2014-Rhaobi model:

cd ~/tmp/CAF2014-Rhaobi
patch -p0 < caf2014-to-rhaobi.patch

6. Compile the Fortran source code:
chmod a+x compile.sh
./compile.sh

7. Run the file CAF2014-rhaobi.r in your R environment.

8. Sample gfdl-esm4_r1i1p1f1_w5e5_ssp585 binary weather files can be found at the same location as this archive.
