===================================== Compile WRF for Idealized 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 cd compiling |vspace| #. Issue the following commands to obtain the WRF source code from WRF's `GitHub `_ code repository: .. code-block:: :class: copyable git clone --recurse-submodule https://github.com/wrf-model/WRF.git |vspace| You should now have a *WRF/* directory in your */glade/derecho/scratch/$USER/compile/* directory that contains the source code for its programs. | | Configure WRF ============= #. 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 options to compile WRF on Derecho are listed below. For simplicity, we recommend compiling any idealized case with the serial option during this class. .. code-block:: WRF (dmpar): INTEL (ifx/icx) : oneAPI LLVM; option 78 WRF (serial): INTEL (ifx/icx) : oneAPI LLVM; option 76 |vspace| .. important:: 2D and 1D idealized cases must be compiled with the serial option. The 2D cases include "2d" in their name, and there is one 1D case (*em_scm_xy*). All others are 3D cases. |vspace| #. Choose a nesting option. The most commonly-used option is *1=basic*, but for 1D/2D cases, option *0=no nesting* must be chosen). .. 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. .. code-block:: :class: copyable ./compile em_TESTCASE -j 6 >& compile.log where *TESTCASE* refers to the ideal test you'd like to compile. These are the options: .. code-block:: em_b_wave compile em_convrad compile em_fire compile em_grav2d_x compile em_heldsuarez compile em_hill2d_x compile em_les compile em_quarter_ss compile em_scm_xy compile em_seabreeze2d_x compile em_squall2d_x compile em_squall2d_y compile em_tropical_cyclone This can take 30-60 minutes to complete. |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| ideal.exe If not, check the *compile.log* to look for compile errors (search for the string "Error", with a capital "E"). |vspace| .. note:: If you later decide to compile another idealized case during the class, you will need to recompile the code, or complete all the above steps in a directory with a name other than "compile," so as to not overwrite this work. | | 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: | | | |