Lecture 1: Getting started, compiling, gordon infrastructure

Logging into gordon
ssh username@gordon.sdsc.edu
How to get WRF
# Download the model from NCAR
wget http://www2.mmm.ucar.edu/wrf/src/WRFV3.7.1.TAR.gz
#Untar/uncompress the distribution
tar xvzf WRFV3.7.1.TAR.gz 

#change into the directory
cd WRFV3
What's in there?

[snesbitt@gordon-ln1 WRFV3]$ ls -1
arch
clean - clean up after compilation
compile - script to compile the model
configure - script to configure the model
dyn_em - dynamical core for WRF-ARW
dyn_exp
dyn_nmm - dynamical core for WRF-NMM
external
frame
hydro
inc
main - you can run the model here
Makefile
phys - model codes for parameterizations
README
README.DA
README.hydro
README.io_config
README.NMM
README.rsl_output
README.SSIB
README_test_cases
README.windturbine
Registry - you can configure the output
run - you can run the model here
share
test - test cases, you can run the model here for pre-configured cases
tools - tools
To configure WRF
#WRF requires NETCDF libraries, they are a module available on gordon
module load netcdf

#enable large output file support > 2GB
export WRFIO_NCD_LARGE_FILE_SUPPORT=1

#Tell WRF where the NETCDF libraries are
export NETCDF=$NETCDFHOME

#run configure script
./configure

The configure script will now ask you a few questions about the computer architecture and how you want to configure the model.

  • select option 18 on Gordon – INTEL (ifort/icc): Xeon (SNB with AVX mods) –
    for a serial run (1 processor, required for 1-D and 2-D domains), 20 for a distributed memory parallel run for 3-D domain.  For now, pick option 18.
  • for now, select no nesting (option 0), we’ll come back to this later

The script should finish.

To compile WRF

To see all the options, just type ./compile

[snesbitt@gordon-ln1 WRFV3]$ ./compile
Usage:
   compile [-j n] wrf   compile wrf in run dir (NOTE: no real.exe, ndown.exe, or ideal.exe generated)
   or choose a test case (see README_test_cases for details) :
      compile [-j n] em_b_wave
      compile [-j n] em_convrad
      compile [-j n] em_esmf_exp
      compile [-j n] em_fire
      compile [-j n] em_grav2d_x
      compile [-j n] em_heldsuarez
      compile [-j n] em_hill2d_x
      compile [-j n] em_les
      compile [-j n] em_quarter_ss
      compile [-j n] em_real
      compile [-j n] em_scm_xy
      compile [-j n] em_seabreeze2d_x
      compile [-j n] em_squall2d_x
      compile [-j n] em_squall2d_y
      compile [-j n] em_tropical_cyclone
      compile [-j n] exp_real
      compile [-j n] nmm_real
      compile [-j n] nmm_tropical_cyclone
  compile -j n               parallel make using n tasks if supported (default 2)
  compile -h                 help message

 

Let’s compile the 2-D squall line case

  • ./compile em_squall2d_x >& compile_log.txt

Did it work?  Do a listing in the run directory, and see if executables ideal.exe and wrf.exe were created (check the time)

If it didn’t work:

  • did you follow all of the steps in order?
  • check compile_log.txt, search for errors.  Google problems.

If you need to recompile, clean up what happened before.  In the WRFV3 directory, type

./clean -a

This will rename your configure.wrf in a backup file, copy it to configure.wrf to reuse.

gordon file system

You have a backed up home directory in /home/username
Keep compiled code here, and important files, but space is limited.  Model output won’t work here.

You have scratch space in /oasis/scratch/username/temp_project
Space is unlimited, but may become corrupt.

You can execute code in either place, but make sure large output goes to scratch.  This can be accomplished by copying code from your home directory, or using symbolic links from the home to the scratch directory.