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

WRF.md added conditional compilation

parent 2f027761
Branches
Tags
No related merge requests found
...@@ -325,6 +325,18 @@ However, we describe the typical workflow of the compilation, for anyone that wi ...@@ -325,6 +325,18 @@ However, we describe the typical workflow of the compilation, for anyone that wi
## Conditional compilation ## Conditional compilation
Most Fortran compilers allow passing the source code through a C preprocessor (CPP; sometimes also called the Fortran preprocessor, FPP) to allow for conditional compilation. In the C programming language, there are some directives that make it possible to compile selectively portions of the source code.
In the WRF source code, Fortran files have an .F extension. cpp will parse these files and create corresponding .f90 files. The .f90 files will then be compiled by the Fortran compiler.
This means:
1. When editing the source code, always work on the .F files, otherwise changes will be lost on the next compilation.
2. In the .F files, it is possible to include `#ifdef` and `#ifndef` directives for conditional compilation.
To control conditional compilation:
1. Search for the variable `ARCHFLAGS` in `configure.wrf`
2. Add the desired define statement at the bottom
## Customizing model output ## Customizing model output
## Adding namelist variables ## Adding namelist variables
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment