Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The spaceparams.tmpl file is replaced by the src/xbeachlibrary/variables.F90 file. The main reason is that the Python script that parses the variables.F90 and params.F90 file only needs to parse Fortran code and not also a custom template format as used in the original spaceparams.tmpl file. Each variable is defined on a separate line and all variables are defined as "target". A comment at the end of the line contains meta-data related to the variable and adheres to a specific format. An example variable definition is as follows:

Code Block
languagetext
titlevariables.F90
 double precision, allocatable, target :: x(:,:)           !< [m] x-coord. original cmp. grid {"shape": ["s%nx+1", "s%ny+1"], "standard_name": "projection_x_coordinate", "broadcast": "d"}

...

Compiling XBeach now depends on Python to generate the include files. Python is shipped with all popular Unix distributions, therefore this is no problem for Unix users. For Windows users Python is not always available. Therefore the scripts/generate.py is compiled as Windows executable so Windows users do not need Python to compile XBeach. Only when the scripts/generate.py script is modified the executable needs to be recompiled on a Windows machine with Python and the "distutils", "mako" and "py2exe" packages installed. Compiling the executable is done from the command-line as follows:

Code Block
languagebashtext
>> cd scripts/
>> python setup.py py2exe

...