Install your own WRFDA
Updated: 12 January 2024
1. Load required modules and set environment variables
Paste the whole recipe into your terminal.
module purge
module load cpeIntel/23.09
module load cray-hdf5-parallel/1.12.2.7
module load cray-netcdf-hdf5parallel/4.9.0.7
module load cray-parallel-netcdf/1.12.3.7
module load libpng/1.6.39-cpeIntel-23.09
module load JasPer/1.900.1-cpeIntel-23.09
export WRF_EM_CORE=1 # Explicitly select ARW core developed by NCAR
export WRF_NMM_CORE=0 # Not NMM core
export WRF_CHEM=0 # Select WRF-Chem
export NETCDF=${CRAY_NETCDF_HDF5PARALLEL_PREFIX}
export NETCDFPAR=${CRAY_NETCDF_HDF5PARALLEL_PREFIX}
export PNETCDF=${CRAY_PARALLEL_NETCDF_PREFIX}
export HDF5=${CRAY_HDF5_PARALLEL_PREFIX}
unset ADIOS2 # ADIOS2 have not yet been integrated well into WRFDA 4dvar.
export JASPERINC=${EBROOTJASPER}/include # (Optional)
export JASPERLIB=${EBROOTJASPER}/lib # (Optional)
export WRFIO_NCD_LARGE_FILE_SUPPORT=1 # (Optional)
export PNETCDF_QUILT=1 # (Optional)
### Common mistake :: insert spaces before or after =
2. Set install location directory (DIR)
Let set an install path, DIR.
# While being in your desired install location directory, execute
export DIR=$(pwd)
3. Download WRF source code
An example for WRF 4.5.1 is as shown below.
cd $DIR
wget https://github.com/wrf-model/WRF/releases/download/v4.5.1/v4.5.1.tar.gz
tar xzf v4.5.1.tar.gz
mv WRFV4.5.1 WRF
For other version, check the WRF stable branches on the GitHub repository and its official website. For WRF 3.X, users have to add ./WRFV3/chem folder with these.
4. Enable GRIB2 IO (Optional)
Must set JASPERINC and JASPERLIB in Step 1
Open ${DIR}/WRF/arch/Config.pl (or Config_new.pl) using a text editor such as vi
Change the parameter
$I_really_want_to_output_grib2_from_WRF
from"FALSE"
to"TRUE"
5. Install RTTOV (Optional)
WRFDA 4d-var version 4.5.1 supports up to RTTOV 12.1
Download the source code from https://nwp-saf.eumetsat.int/site/software/rttov/ (registration required)
Make a directory RTTOV, extract the source code and go inside its build directory.
Edit the below lines in the Makefile.local.
Create ./arch/cray-ifort-lanta file that contains the following recipe
(vi ${DIR}/RTTOV/build/arch/cray-ifort-lanta
)
Run the
./rttov_compile.sh
scriptType ‘cray-ifort-lanta' → Press ‘Enter'
(Leave blank) → Press ‘Enter'
Type ‘y’ → Press ‘Enter’
Type '-j 2' → Press 'Enter’
Type 'y' → Press 'Enter’
(This step will take around 10-15 minutes.)
Set the RTTOV environment variable
6. Compile WRFPLUS (Optional, only for 4dvar)
Copy the source code and go inside the directory
Run
./confiugre wrfplus
→ Type ‘26' + Press 'Enter’Open
./configure.wrf
Change
icc
tocc -Wno-implicit-function-declaration -Wno-implicit-int
Append
-Wno-implicit-function-declaration -Wno-implicit-int
to existingcc
Prepend
-fp-model precise -fp-speculation=safe
toFCBASEOPTS_NO_G
.
Compile the program
Run
ls ./main/*.exe
to check ifwrfplus.exe
exists.Set the WRFPLUS_DIR environment variable
7. Compile WRFDA 4dvar
Copy the source code and go inside the directory
Run
./confiugre 4dvar
→ Type ‘26' + Press ‘Enter’
(Note: for 3dvar, run./configure wrfda
-> Type '50' + Press 'Enter')Open
./configure.wrf
Change
icc
tocc -Wno-implicit-function-declaration -Wno-implicit-int
Append
-Wno-implicit-function-declaration -Wno-implicit-int
to existingcc
Prepend
-fp-model precise -fp-speculation=safe
toFCBASEOPTS_NO_G
.
Run
Run
ls ./var/build/*.exe | wc -l
to check if 43 executables were successfully compiled.Run
ls ./var/obsproc/src/*.exe
to check ifobsproc.exe
exists.
8. Example: Job submission script
Contact Us
ThaiSC support service : thaisc-support@nstda.or.th