=========================================== Compile WRF & WPS for Real-data Simulations =========================================== | Obtain the Source Code ====================== #. Move to your "scratch" space and create a new directory called *compiling*, then move to that directory. .. code-block:: :class: copyable cd /glade/derecho/scratch/$USER mkdir compiling |vspace| #. Issue the following commands to obtain the WRF and WPS source code from WRF's `GitHub `_ code repository: .. code-block:: :class: copyable git clone --recurse-submodule https://github.com/wrf-model/WRF.git git clone https://github.com/wrf-model/WPS.git |vspace| You should now have a *WRF* and a *WPS* directory in your */glade/derecho/scratch/$USER/compile* directory. Each of these directories contains the source code for its programs. | | Configure WRF ============= .. important:: Although WPS programs are run first in the modeling process, compilation of WPS depends on the successful compilation of the WRF code; therefore WRF must be compiled prior to compiling WPS. |vspace| #. Go into the *WRF* directory and issue the command to configure the compile: .. code-block:: :class: copyable cd WRF ./configure |vspace| #. Choose the machine and its configuration from the list. The recommended option to compile WRF on Derecho is: .. code-block:: WRF (dmpar): INTEL (ifx/icx) : oneAPI LLVM; option 78 |vspace| #. Choose a nesting option. The most commonly-used option is *1=basic*. .. code-block:: Compile for nesting? (0=no nesting, 1=basic, 2=preset moves, 3=vortex following) [default 0]: | | Compile WRF =========== .. note:: When compiling on Derecho specifically, to avoid saturating the login nodes with compilation processes and negatively impacting other users, the compilation command must run in an interactive session, which launches the specified command on a batch node and returns when the command has finished. |vspace| #. Issue the following command to enter an interactive session (where *UMMM0017* is the project code for this tutorial class). This may take a minute or two to complete. .. code-block:: :class: copyable qinteractive -A UMMM0017 |vspace| #. To set the interactive environment correctly source the *.bashrc* script that resides in your home directory: .. code-block:: :class: copyable source /glade/u/home/$user/.bashrc |vspace| #. Issue the following command to compile WRF. This can take 30-60 minutes to complete. .. code-block:: :class: copyable ./compile em_real -j 6 >& compile.log |vspace| #. Once it is finished, check to see if the executables are present in the *WRF/main/* directory by issuing: .. code-block:: :class: copyable ls -l main/*.exe The following executables should be present: .. container:: row m-0 p-0 .. container:: col-md-6 pl-0 pr-3 py-3 m-0 .. container:: card-blockquote wrf.exe |br| real.exe |br| ndown.exe If not, check the *compile.log* to look for compile errors (search for the string "Error", with a capital "E"). |vspace| .. important:: Stay in the interactive mode through the process of compiling WPS. After that, you may return back to your regular session on Derecho. | | Configure WPS ============= .. note:: WRF must be successfully compiled prior to building WPS, as WPS relies on the I/O from WRF. |vspace| #. Move into the *WPS/* directory and define the *WRF_DIR* environment variable, which instructs the WPS program where to find the WRF I/O necessary for compiling the geogrid and metgrid executables. .. code-block:: :class: copyable export WRF_DIR=../WRF |vspace| #. Configure WPS. .. code-block:: :class: copyable ./configure Choose the machine and its configuration from the list. The recommended option to compile WPS on Derecho is .. code-block:: WPS: Linux x86_64, Intel compiler (serial); option 17 | | Compile WPS =========== #. Issue the compile command: .. code-block:: :class: copyable qcmd -A UMMM0017 -- ./compile >& compile.log This process should not take very long to compile - just a few minutes. |vspace| #. Once it's finished, check to see if these executables are present in the *WPS/* directory: .. container:: row m-0 p-0 .. container:: col-md-6 pl-0 pr-3 py-3 m-0 .. container:: card-blockquote geogrid.exe |br| ungrib.exe |br| metgrid.exe If not, check *compile.log* to look for compile errors (search for the string "Error" with a capital "E"). | | Return to the Practice Exercise home to page to run another exercise. .. rst-class:: horizbuttons-primary-m * `Return to Practice Exercises <./practices.html>`_ .. toctree:: :maxdepth: 4 :hidden: | | | |