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

From openwfm
Jump to navigation Jump to search
 
(13 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 7: Line 8:
 
* [[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.  
 
**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.
 
**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 --disable-netcdf4 --disable-dap --prefix='''the contents of your NETCDF variable
+
** '''./configure --prefix='''the contents of your NETCDF variable
 
** '''make'''
 
** '''make'''
 
** '''make install'''  
 
** '''make install'''  
Line 14: Line 15:
 
==Step by step directions==
 
==Step by step directions==
  
* [[How to get WRF-Fire|Get WRF-Fire]] from the repository or a mirror.  
+
* [[How to get WRF-SFIRE|Get WRF-SFIRE]] from the repository or a mirror.  
* '''cd wrf-fire/WRFV3'''
+
* '''cd WRF-SFIRE'''
* '''./configure''', choose nesting 1=basic.
+
* '''./clean -a''' to delete the remains of any previous build and ensure start from a known state
* '''./compile em_fire >& compile.log'''
+
* '''./configure''', choose nesting 1=basic if building serial
* Search for '''Err''' in '''compile.log'''. If not found, all is well.
+
* '''./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'''.
 
** 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'''
 
* '''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'''
 
* '''./ideal.exe'''
 
* '''./wrf.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 [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==
Line 40: Line 63:
  
  
[[Category:Howtos|Run WRF-Fire]]
+
[[Category:Howtos|Run WRF-SFIRE]]
[[Category:WRF-Fire]]
+
[[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