Difference between revisions of "How to run WRF-SFIRE"

From openwfm
Jump to navigation Jump to search
 
(24 intermediate revisions by 3 users not shown)
Line 1: Line 1:
This Howto shows how to build [[WRF-Fire]] and run an ideal test case.
+
{{users guide}}
 +
This Howto shows how to build [[WRF-SFIRE]] and run an ideal test case.
  
 
==Prerequisites==
 
==Prerequisites==
Line 5: Line 6:
 
The prerequisites are given by the needs of building [[WRF]].
 
The prerequisites are given by the needs of building [[WRF]].
  
* [[NetCDF]], must be built with the Fortran interface using the same compiler as used for WRF
+
* [[NetCDF]], must be built with the Fortran interface using the same compiler as used for WRF.
* [[MPI]] (for a distributed memory build only), must be built with the Fortran interface using the same compiler as used for WRF
+
**Set the environment variables '''FC''' and '''F90''' to your Fortran compiler, and '''NETCDF''' to where you want to install NETCDF. Best add to your startup files.
 +
** '''./configure --prefix='''the contents of your NETCDF variable
 +
** '''make'''
 +
** '''make install'''
 +
* [[MPI]] (for a distributed memory build only), must be built with the Fortran interface using the same compiler as used for WRF. Make sure '''mpicc''' and '''mpif90''' are on the search path.
  
 
==Step by step directions==
 
==Step by step directions==
  
''The following text is a placeholder only. The direction come here in near future.''
+
* [[How to get WRF-SFIRE|Get WRF-SFIRE]] from the repository or a mirror.
 +
* '''cd WRF-SFIRE'''
 +
* '''./clean -a'''  to delete the remains of any previous build and ensure start from a known state
 +
* '''./configure''', choose nesting 1=basic if building serial
 +
* '''./compile em_fire >& compile_fire.log'''
 +
* Search for '''Err''' in '''compile_fire.log'''. If not found, all is well.
 +
** If you see error like '''mpif90: -f90=something option not recognized''', run '''./clean -a'''; rerun '''./configure''', edit the file '''configure.wrf''' and change the line '''DM_FC          =      mpif90 -f90=$(SFC)''' to read just '''DM_FC          =      mpif90'''  Unfortunately, some versions of MPI crash with the '''-f90''' flag, and some crash without. You will need to repeat this every time after you run '''./configure'''.
 +
* Same process to compile real doing:
 +
* '''./compile em_real >& compile_real.log'''
 +
* '''cd test/em_fire/hill'''
 +
* if there is no '''namelist.input''' file, link an existing case, such as '''ln -s namelist.input.hill namelist.input'''
 +
* '''./ideal.exe'''
 +
* '''./wrf.exe'''
  
* [[How to get WRF-Fire|Get WRF-Fire]] from the repository or a mirror.  
+
==NetCDF large file support==
* Read the [http://github.com/jbeezley/wrf-fire/blob/master/README.txt README.txt] file in the root directory, and follow the step-by-step directions there.
+
 
 +
By default, WRF will write classic format NetCDF files that are limited to a total 2 GB in size.  Recent versions of NetCDF support much larger files using a 64 bit offset format [http://www.unidata.ucar.edu/software/netcdf/faq-lfs.html].  One can configure WRF at build time to write files using the 64 bit offset format by setting the environment variable <code>WRFIO_NCD_LARGE_FILE_SUPPORT</code> to 1 before compiling.  Older applications that are built against NetCDF libraries without large file support will not be able to read output files created using this option.  Even with large file support, there are constraints on the size of individual variables that can be created in an output file.  This effectively limits the maximum domain size of WRF-Fire to around a <code>10,000 x 10,000</code> fire grid. 
 +
 
 +
==NetCDF4/HDF5 output file support==
 +
 
 +
As of {{WRF-Fire-commit|06c276f324873bc4c6f82c27298430435989ab97|Oct 16, 2010}}, WRF-Fire supports compilation with NetCDF4 built with HDF5 support.  This allows the output of much larger domains than is possible even with large file support.  This feature is currently exclusive to WRF-Fire as the necessary changes in the code and build system have not yet been included in the standard WRF release.  We advise users to avoid using HDF output format unless absolutely necessary because many utilities and API's have not been updated to read these files.
 +
 
 +
To build WRF-Fire to output HDF formatted NetCDF files, you will need to build NetCDF with HDF support.  First, download and install [http://www.hdfgroup.org/downloads/index.html#hdf5 HDF5 1.8.x].  Extract the source package and install as described [[#Prerequisites|above]].
 +
Assuming you installed HDF to the path in the environment variable <code>NETCDF</code>, you can compile NetCDF as follows:
 +
<pre>
 +
./configure --enable-netcdf4 --with-hdf5=${NETCDF} --prefix=${NETCDF}
 +
make
 +
make install
 +
</pre>
 +
 
 +
By default, WRF-Fire will still create classic NetCDF files for output even when linking with an HDF5 capable library.  To override this, set the environment variable <code>WRFIO_NETCDF4_FILE_SUPPORT</code> to 1 and <code>WRFIO_NCD_LARGE_FILE_SUPPORT</code> unset or set to 0 before compiling. NetCDF version 4 files are capable of transparent compression of the output files using zlib for only a small performance hit. To enable compression of output files, set <code>WRFIO_NETCDF4_GZIP_LEVEL</code> to an integer between 1 and 9.  (The NetCDF developers [http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-f77.html#NF_005fDEF_005fVAR_005fDEFLATE recommend] only using a value of 2 or 3.)
  
 
==Works with==
 
==Works with==
 +
 +
===June 2010===
 +
*WRF-Fire {{WRF-Fire-commit|0c084a8e4efeda74c67f62e79393dcec3b21e2d5|Jun 12 2010}} based on WRF 3.2
 +
*NETCDF 4.1.1
 +
* Linux x64 gfortran/gcc 4.4
 +
* Mac OS X 10.6 gfortran/gcc 4.3 (from [http://www.macports.org Mac Ports])
  
 
===January 2010===
 
===January 2010===
Commit aa4ddf0997 Nov 15 2009 works with NetCDF 4, MPI 2, and
+
WRF-Fire {{WRF-Fire-commit|aa4ddf0997|Nov 15 2009}} works with NetCDF 4, MPI 2, and
 
* PGI Fortran 8.0 and gcc 4.3.4 on Linux Gentoo 5 64bit
 
* PGI Fortran 8.0 and gcc 4.3.4 on Linux Gentoo 5 64bit
 
* Intel Fortran 11 and gcc 4.4.1 on Fedora 11 64bit
 
* Intel Fortran 11 and gcc 4.4.1 on Fedora 11 64bit
Line 24: Line 62:
 
* gfortran/gcc 4.3.0 on Mac OS X Snow Leopard
 
* gfortran/gcc 4.3.0 on Mac OS X Snow Leopard
  
[[Category:Howtos|Run WRF-Fire]]
+
 
[[Category:WRF-Fire]]
+
[[Category:Howtos|Run WRF-SFIRE]]
 +
[[Category:WRF-SFIRE]]

Latest revision as of 17:19, 2 May 2024

Back to the WRF-SFIRE user guide.

This Howto shows how to build WRF-SFIRE and run an ideal test case.

Prerequisites

The prerequisites are given by the needs of building WRF.

  • NetCDF, must be built with the Fortran interface using the same compiler as used for WRF.
    • Set the environment variables FC and F90 to your Fortran compiler, and NETCDF to where you want to install NETCDF. Best add to your startup files.
    • ./configure --prefix=the contents of your NETCDF variable
    • make
    • make install
  • MPI (for a distributed memory build only), must be built with the Fortran interface using the same compiler as used for WRF. Make sure mpicc and mpif90 are on the search path.

Step by step directions

  • Get WRF-SFIRE from the repository or a mirror.
  • cd WRF-SFIRE
  • ./clean -a to delete the remains of any previous build and ensure start from a known state
  • ./configure, choose nesting 1=basic if building serial
  • ./compile em_fire >& compile_fire.log
  • Search for Err in compile_fire.log. If not found, all is well.
    • If you see error like mpif90: -f90=something option not recognized, run ./clean -a; rerun ./configure, edit the file configure.wrf and change the line DM_FC = mpif90 -f90=$(SFC) to read just DM_FC = mpif90 Unfortunately, some versions of MPI crash with the -f90 flag, and some crash without. You will need to repeat this every time after you run ./configure.
  • Same process to compile real doing:
  • ./compile em_real >& compile_real.log
  • cd test/em_fire/hill
  • if there is no namelist.input file, link an existing case, such as ln -s namelist.input.hill namelist.input
  • ./ideal.exe
  • ./wrf.exe

NetCDF large file support

By default, WRF will write classic format NetCDF files that are limited to a total 2 GB in size. Recent versions of NetCDF support much larger files using a 64 bit offset format [1]. One can configure WRF at build time to write files using the 64 bit offset format by setting the environment variable WRFIO_NCD_LARGE_FILE_SUPPORT to 1 before compiling. Older applications that are built against NetCDF libraries without large file support will not be able to read output files created using this option. Even with large file support, there are constraints on the size of individual variables that can be created in an output file. This effectively limits the maximum domain size of WRF-Fire to around a 10,000 x 10,000 fire grid.

NetCDF4/HDF5 output file support

As of Oct 16, 2010, WRF-Fire supports compilation with NetCDF4 built with HDF5 support. This allows the output of much larger domains than is possible even with large file support. This feature is currently exclusive to WRF-Fire as the necessary changes in the code and build system have not yet been included in the standard WRF release. We advise users to avoid using HDF output format unless absolutely necessary because many utilities and API's have not been updated to read these files.

To build WRF-Fire to output HDF formatted NetCDF files, you will need to build NetCDF with HDF support. First, download and install HDF5 1.8.x. Extract the source package and install as described above. Assuming you installed HDF to the path in the environment variable NETCDF, you can compile NetCDF as follows:

./configure --enable-netcdf4 --with-hdf5=${NETCDF} --prefix=${NETCDF}
make
make install

By default, WRF-Fire will still create classic NetCDF files for output even when linking with an HDF5 capable library. To override this, set the environment variable WRFIO_NETCDF4_FILE_SUPPORT to 1 and WRFIO_NCD_LARGE_FILE_SUPPORT unset or set to 0 before compiling. NetCDF version 4 files are capable of transparent compression of the output files using zlib for only a small performance hit. To enable compression of output files, set WRFIO_NETCDF4_GZIP_LEVEL to an integer between 1 and 9. (The NetCDF developers recommend only using a value of 2 or 3.)

Works with

June 2010

  • WRF-Fire Jun 12 2010 based on WRF 3.2
  • NETCDF 4.1.1
  • Linux x64 gfortran/gcc 4.4
  • Mac OS X 10.6 gfortran/gcc 4.3 (from Mac Ports)

January 2010

WRF-Fire Nov 15 2009 works with NetCDF 4, MPI 2, and

  • PGI Fortran 8.0 and gcc 4.3.4 on Linux Gentoo 5 64bit
  • Intel Fortran 11 and gcc 4.4.1 on Fedora 11 64bit
  • gfortran/gcc 4.3.4 on Linux Gentoo 5 64bit
  • gfortran/gcc 4.3.0 on Mac OS X Snow Leopard