Wind profile program
Compile the wind profile program with Cygwin
Instructions for installing Cygwin
Running the code on Cygwin requires the basic Cygwin installation with the addition of all the extra
- netCDF components
- Fortran compontents
- Go to www.cgywin.com
- -> setup.exe
- -> Run
- -> Next
- -> Install from Internet (OK, if your internet connect is fine)
- -> Next (default option for Root Directory)
- -> Next (default option for Local Package Directory)
- -> Next (Direct connection)
- Select a site (Any should be fine, I used http://cygwin.mirrors.pair.com), -> Next
- -> OK
- Search for
- netcdf. Open up Archive, Libs and Utils by clicking on the little crosses, and select any components associated with netcdf.
- fortran. Open up Devel and Libs and select and components associated with fortran.
- -> Next (resolving dependencies), you'll now need to wait about 8 minutes
- -> Finish (default should be to place a Cygwin icon on your desktop)
Getting the code and data
It is sensible to store the code in a directory, so click on the Cygwin icon which will pop up a Cygwin window which you can write commands in. Most the commands that available in Unix are also available in Cygwin so you can create the directory wind with the command
mkdir windIf you think you should access to the code, contact Marc. Once you have the code, save it into a directory which will be something like
OS(C:) -> cygwin -> home -> <username> -> windFrom the cygwin window you should be able to move into the wind directory, uncompress and untar the code wih the following
cd wind gunzip wind_prog.tar.gz tar -xvf wind_prog.tarwhich should produce two directories: code which contains the code; and test_case wich contains some sample input.
I'd recommend creating a directory data within the wind directory called data for storing the MERRA data. The MERRA data from 1979 to 2011 can be downloaded from http://www.met.reading.ac.uk/~marc/it/wind/merra/1979to2011.tar.gz. However, if disk space is an issue you just want to test the code, you can get just 2010 from http://www.met.reading.ac.uk/~marc/it/wind/merra/2010.tar.gz. The data can be uncompressed and untarred with the same commands used on the code.
Compiling the code
The code can now be compiled by moving into the code directory (type `cd code') and applying the following command
gfortran InputVariables.F90 WindVariables.F90 ReadInput.F90 DetermineDates.F90 ReadWindData.F90 WriteCsv.F90 WriteNetcdf.F90 DetermineWind.F90 -o DetermineWind -I/usr/include -L/usr/lib -lnetcdffwhich should all be on one line. This should have produced the executable DetermineWind.exe in this directory (the contents of this directory can be seen by typing `ls').
Running a test case
The test case can be run by moving into the test_case directory and editing nmlReading, in which ever editor you prefer (maybe notepad), so that the files looks something like
&PLACE latitude=51.445,longitude=-0.9685,height=10.0 &END &WINDDATA startDate=20100101,endDate=20100131, inputDir='/home/<username>/wind/data', outputDir='/home/<usernaem>/wind/test_case' &ENDand run the code with
../code/DetermineWind < inputwhich should produce some output (which will be depend on the settings in code/InputVariables.F90).