Skip to content
Snippets Groups Projects
Commit 6766415e authored by Stefano Serafin's avatar Stefano Serafin
Browse files

Update WRF.md

parent c7a34f1d
No related branches found
No related tags found
No related merge requests found
......@@ -112,7 +112,7 @@ WRF is written in compiled languages (mostly Fortran and C++), so it needs to be
In general, compiled WRF versions are already available on all of our servers (SRVX1, JET, VSC4, VSC5) from the expert users. So, the easiest way of getting started is to copy a compiled version of the code from them (see below).
However, we describe the typical workflow of the compilation, for anyone that wishes to try it out:
However, we describe the typical workflow of the compilation, for anyone that wishes to try it out. There are three steps: (i) make libraries available, (ii) configure, (iii) compile.
* *Make the prerequisite libraries available*. In most cases, precompiled libraries can be made available to the operating system using environment modules. Environment modules modify the Linux shell environment so that the operating system is aware of where to find specific executable files, include files, software libraries, documentation files. Each server has its own set of available modules. As of 1.3.2023, WRF is known to compile and run with the following module collections.
......@@ -152,72 +152,72 @@ However, we describe the typical workflow of the compilation, for anyone that wi
* *Configure WRF for compilation.* This will test the system to check that all libraries can be properly linked. Type `./configure`, pick a generic dmpar INTEL (ifort/icc) configuration (usually 15), answer 1 when asked if you want to compile for nesting, then hit enter. "dmpar" means "distributed memory parallelization" and enables running WRF in parallel computing mode. For test compilations or for a toy setup, you might also choose a "serial" configuration.
If all goes well, the configuration will end will a message like this:
```
*****************************************************************************
This build of WRF will use NETCDF4 with HDF5 compression
*****************************************************************************
```
If all goes well, the configuration will end will a message like this:
```
*****************************************************************************
This build of WRF will use NETCDF4 with HDF5 compression
*****************************************************************************
```
But the configuration could also end with a message like this:
```
************************** W A R N I N G ************************************
NETCDF4 IO features are requested, but this installation of NetCDF
/home/swd/spack/opt/spack/linux-rhel8-skylake_avx512/intel-20.0.4/netcdf-fortran-4.5.2-ktet7v73pc74qrx6yc3234zhfo573w23
DOES NOT support these IO features.
But the configuration could also end with a message like this:
```
************************** W A R N I N G ************************************
NETCDF4 IO features are requested, but this installation of NetCDF
/home/swd/spack/opt/spack/linux-rhel8-skylake_avx512/intel-20.0.4/netcdf-fortran-4.5.2-ktet7v73pc74qrx6yc3234zhfo573w23
DOES NOT support these IO features.
Please make sure NETCDF version is 4.1.3 or later and was built with
--enable-netcdf4
Please make sure NETCDF version is 4.1.3 or later and was built with
--enable-netcdf4
OR set NETCDF_classic variable
bash/ksh : export NETCDF_classic=1
csh : setenv NETCDF_classic 1
OR set NETCDF_classic variable
bash/ksh : export NETCDF_classic=1
csh : setenv NETCDF_classic 1
Then re-run this configure script
Then re-run this configure script
!!! configure.wrf has been REMOVED !!!
!!! configure.wrf has been REMOVED !!!
*****************************************************************************
```
This is actually a misleading error message. The problem has nothing to do with NETCDF4 not being available, but with the operating system not knowing where the NETCDF libraries are. **NOTE: explain solution.**
*****************************************************************************
```
This is actually a misleading error message. The problem has nothing to do with NETCDF4 not being available, but with the operating system not knowing where the NETCDF libraries are. **NOTE: explain solution.**
The configure script stores the model configuration to a file called `configure.wrf`. This is specific to the source code version, to the server where the source code is compiled, and to the software environment. If you a have a working `configure.wrf` file for a given source code/server/environment, back it up.
The configure script stores the model configuration to a file called `configure.wrf`. This is specific to the source code version, to the server where the source code is compiled, and to the software environment. If you a have a working `configure.wrf` file for a given source code/server/environment, back it up.
* *Compile WRF.* You always compile WRF for a specific model configuration. The ones we use most commonly are `em_les` (for large-eddy simulation), `em_quarter_ss` (for idealized mesoscale simulations), `em_real` (for real-case forecasts). So type either of the following, depending on what you want to get:
```
./compile em_les > compile.log 2>&1 &
./compile em_quarter_ss > compile.log 2>&1 &
./compile em_real > compile.log 2>&1 &
```
The `> compile.log` tells the operating system to redirect the output stream from the terminal to a file called `compile.log`. The `2>&1` tells the operating system to merge the standard and error output streams, so `compile.log` will contain both regular output and error messages. The final `&` tells the operating system to run the job in the background, and returns to the terminal prompt.
```
./compile em_les > compile.log 2>&1 &
./compile em_quarter_ss > compile.log 2>&1 &
./compile em_real > compile.log 2>&1 &
```
The `> compile.log` tells the operating system to redirect the output stream from the terminal to a file called `compile.log`. The `2>&1` tells the operating system to merge the standard and error output streams, so `compile.log` will contain both regular output and error messages. The final `&` tells the operating system to run the job in the background, and returns to the terminal prompt.
The compiled code will be created in the `run` directory, and some of the compiled programs will be linked in either of the `test/em_les`, `test/em_quarter_ss` or `test/em_real` directories. Executable WRF files typically have names ending with `.exe` (this just conventional; it is actually not necessary for them to run).
The compiled code will be created in the `run` directory, and some of the compiled programs will be linked in either of the `test/em_les`, `test/em_quarter_ss` or `test/em_real` directories. Executable WRF files typically have names ending with `.exe` (this just conventional; it is actually not necessary for them to run).
Compilation may take half an hour or so. A successful compilation ends with:
```
==========================================================================
build started: mer 19 ott 2022, 16.17.36, CEST
build completed: mer 19 ott 2022, 16.51.46, CEST
Compilation may take half an hour or so. A successful compilation ends with:
```
==========================================================================
build started: mer 19 ott 2022, 16.17.36, CEST
build completed: mer 19 ott 2022, 16.51.46, CEST
---> Executables successfully built <---
---> Executables successfully built <---
-rwxr-xr-x 1 serafin users 51042008 19 ott 16.51 main/ideal.exe
-rwxr-xr-x 1 serafin users 57078208 19 ott 16.51 main/wrf.exe
-rwxr-xr-x 1 serafin users 51042008 19 ott 16.51 main/ideal.exe
-rwxr-xr-x 1 serafin users 57078208 19 ott 16.51 main/wrf.exe
==========================================================================
```
==========================================================================
```
If instead you get this:
```
==========================================================================
build started: Thu Feb 2 16:30:55 CET 2023
build completed: Thu Feb 2 17:07:04 CET 2023
If instead you get this:
```
==========================================================================
build started: Thu Feb 2 16:30:55 CET 2023
build completed: Thu Feb 2 17:07:04 CET 2023
---> Problems building executables, look for errors in the build log <---
---> Problems building executables, look for errors in the build log <---
==========================================================================
```
then you have a problem, and there is no unique solution. Take a closer look at `compile.log` and you might be able to diagnose it.
==========================================================================
```
then you have a problem, and there is no unique solution. Take a closer look at `compile.log` and you might be able to diagnose it.
## Copying compiled WRF code
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment