diff --git a/WRF.md b/WRF.md index 2e396dccaa0f4e597813fe9ec4877cef59b73e3b..7ed1bf4acc1a8b860c2acf03f514470e428f94a5 100644 --- a/WRF.md +++ b/WRF.md @@ -355,7 +355,7 @@ then you have a problem, and there is no unique solution. Take a closer look at ## 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. +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 portions of the source code selectively. 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. @@ -363,7 +363,7 @@ 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. -For instance, in `dyn_em/module_initialize_ideal.F`: +For instance, in `dyn_em/module_initialize_ideal.F`, the following bits of code define the model orography for idealized large-eddy simulation runs. Four possibilities are given: `MTN`, `EW_RIDGE`, `NS_RIDGE`, and `NS_VALLEY`. If none is selected at compile time, none of these code lines is compiled and `grid%ht(i,j)` (the model orography) is set to 0: ``` #ifdef MTN @@ -410,7 +410,7 @@ For instance, in `dyn_em/module_initialize_ideal.F`: To control conditional compilation: 1. Search for the variable `ARCHFLAGS` in `configure.wrf` -2. Add the desired define statement at the bottom +2. Add the desired define statement at the bottom. For instance, to selectively compile the `NS_VALLEY` block above, do the following: ``` ARCHFLAGS = $(COREDEFS) -DIWORDSIZE=$(IWORDSIZE) -DDWORDSIZE=$(DWORDSIZE) -DRWORDSIZE=$(RWORDSIZE) -DLWORDSIZE=$(LWORDSIZE) \ $(ARCH_LOCAL) \