Wind profile program

Running the wind profile program

A request was made to write the code in FORTRAN. Unlike say C++, FORTRAN does not have functions universal to all FORTRAN compilers for accepting command line arguments (at least, not that I'm aware of at the time of writing). So methods other than command line arguments are required to provide the input.

Entering an input file

When writing the code, it was envisaged that one executable might be responsible for running multiple jobs with differing input. Hence, the code needs to be able to select the input data it requires. The input file is a namelist (more on this below). One of the first things the code does it to ask the name of the namelist (input) file, e.g.

copperfield$ ./DetermineWind
Enter the name of input file
and it will wait for an namelist (input) file to be entered. This is the only question asked by the code.

To avoid the code stalling while it waits for this answer, you can run the code with a driver file (see test case for more information on this).

Namelist file

The namelist file should look something like

 &PLACE
        latitude=51.445,longitude=-0.9685,height=10.0
 &END
 &WINDDATA
        startDate=19790123,endDate=20111130,
        inputDir='/home/godiva/wind/data',
        outputDir='/home/godiva/wind/output'
 &END
where
  • latitude and longitude give the coordinates of your site (the town Reading can be found at 51.445 degrees North and -0.9685 degrees East)
  • height is the height you expect the wind turbine to be at
  • startDate and endDate give the first day and last day in the output. The format for startDate and endDate is YYYYMMDD, where YYYY is the year, MM the month and DD the day of month. They're all expressed as integers and the month and day of month must be two integers long - so the 5 June 1996 is expressed as 19960605.
  • inputDir should contain the parent directory for the MERRA netCDF data. For given year, the data is expected to be in the directory inputDir/year
  • outputDir is the directory where the output will be written

Further options

There are a few logical parameters found in the module InputVariables.f90. The code in question is

  !------------------------------------------------------
  ! Switches that may want changing
  !------------------------------------------------------
  ! If true, output lots of information to screen
  Logical, Parameter :: lVerbose = .True.
  ! If true, fit a log equation to the vertical speed
  Logical, Parameter :: lLogSpeed = .True.
  ! If true, output the data in CSV (Excel) format
  Logical, Parameter :: lCsv = .True.
  ! If true, output the data in netCDF format
  Logical, Parameter :: lNetcdf = .True.
where
  • lVerbose should be set to TRUE if you want lots of information displayed to screen. It's recommended that this is set to TRUE for the first use by an interested user, but should be set to FALSE once the user is familiar with using the code.
  • lLogSpeed should be set to TRUE if you want a log equation fitted to speed versus height. There's more information on the How the code works page and the logarithmic wind profile page.
  • lCsv should be set to true if you want a CSV (a file that be read into Microsoft Excel) output file to be produced.
  • lNetcdf should be set to true if you want a netCDF file to be produced (either lCsv or lNetcdf must be set to true).

These variable are kept in the code, and not in the namelist file, because it's anticipated that they're parameters that are unlikely to be changed often. And putting them in the code as parameters allows any decent compiler to remove any code which these flags indicate are unnecessary at compilation, thus making the code more efficient, provided some optimisation is applied.

Things to do now

Contact

Page navigation