WIND_GEN

Wind Generator

The WIND_GEN programs are a collection of standalone routines designed to perform individual primary tasks with respect to the WIND_GEN statistical wind database. The development and technical description of the WIND_GEN database is documented in (Skidmore and Tatarko, 1990)1.

Version 4 of WIND_GEN currently consists of the following utility routines:

1.	wind_chk4	Simply displays specified records from wind database.

2.	wind_wdb4	Extracts selected stations to create secondary wind database.

3.	wind_idx	Generates a listing of stations in wind database with byte record offsets.

4.	wind_gen4	Generates daily simulated wind data from specified station database parameters.

5.	wind_mdb	Generates a wind_gen wind database record using historical wind data.

The WIND_GEN database consists primarily of monthly statistical wind speed and direction parameters computed from the Wind Energy Resource Information System (WERIS) database from the National Climatic Data Center in Ashville, NC. NOTE: The wind_gen database has been updated using a quality reviewed data set from NCDC. The specific (master) database information consists of the following:

1.	Line 1: A unique station code or identification number (6 digits) preceded by a # character. Prior to the update of the wind_gen database, this was typically the Weather Bureau, Army, Navy (Station code) station number, if it existed for the site. We do not know the source of the unique identification numbers contained in the new NCDC U.S. wind data set.

2.	Line 1: The station site follows the station code. This usually consists of a country, state/province, and city designation.

3.	Line 2: The station location. This consist of the site's latitude, longitude, and elevation. The latitude and longitude are given in degrees, minutes, and hemisphere. The elevation is specified in meters above mean sea level.

4.	Line 2: The beginning and ending dates of data used to derive the statistical parameters for a single database record (yyyymmdd format).

5.	Line 2: A code specifying the number of observations taken per day, the anemometer height, and the agency or entity responsible for the station.

6.	Lines 3-18,19: The monthly wind direction distributions for the 16 cardinal directions and calm (< 0.5 m/s wind speed).

7.	Lines 20-211: The monthly wind speed distribution (cumulative) for each of the 16 cardinal directions represented as a histogram of wind speed classes.

8.	Line 212: The average ratio of maximum to minimum mean hourly observed wind speeds for each month.

9.	Line 213: The hour of maximum mean wind speed for each month.

The format of a typical database header is illustrated here:

# 724550 US KS FT RILEY/MARSHALL A

39 3 N 96 46 W 325 19470101 20001231 AUU

The purpose and usage of each of the WIND_GEN utilities follow.

SYNOPSIS

wind_chk4 [-h] [-f wdb_file] [-o out_file] -s station_code [-x index_no] [-\?]

DEFINITION

wind_chk merely searches for the specified wind database record and outputs the record contents. By default, header information is supplied to present the record contents in a more "human readable" form. Only the -s option with a valid station code number is required on the command line. A default wind database input file (wind_gen.wdb) is used if one is not specified and the output generally goes to the display device (screen display) if an output file is not specified.

COMMAND LINE ARGUMENTS

-h	If this option is specified an output file header is not generated. The default is to generate an output file header if this option is not supplied.

-f wdb_file	If this option is specified, the required option argument is considered the input wind database file. The default input wind database file (wind_gen.wdb) is used if this option is not specified.

-o out_file	If this option is specified, the required option argument is considered the output filename for wind_chk. The default output (screen display) is used if this option is not specified.

-s station_code	This required option, specified with its argument (a valid station code), provides wind_chk with the required station code number required to obtain that database record.

-x index_no	If this option is specified with the required option argument (an index number for the station code number specified with the -s option) you will obtain faster access to the desired database record. The correct index numbers for a given wind database file can be obtained from the wind_idx program. If the index value specified is incorrect or invalid, wind_chk will linearly search the wind database for the specified record in an attempt to locate the desired record anyway.

-\?	If this option is specified, a listing of the command line parameters are printed to the screen and the program aborted. In some situations, certain shell programs under both DOS and UNIX, consider the ? a special character and require it to be escaped. For example:	wind_chk -\?

EXAMPLES

The following example directs wind_chk to search for the wind database record specified by the station code number provided from the default wind database file (wind.wdb) and displays the record to standard output (usually the display).

wind_chk -s 724550

The following example directs wind_chk to search for the wind database record specified by the station code number provided from a wind database file (ks.wdb) and redirects stdout to a file (riley.out).

wind_chk -s724550 -f ks.wdb > riley.out

SYNOPSIS

wind_wdb4 [-v] [-f wdb_file] [-o out_file] [-i lst_file] [-s site_list] [-?h]

DEFINITION

wind_wdb4 produces a new wind database file that is a subset of another (master) wind database file. Typically, this program will be used to develop smaller working wind database files from the master wind database file distributed with the wind_gen utilities. For example, a useful subset wind database file consisting of all stations within a selected state or group of states could be combined into a single file. Also, specialized wind database files could be created from a list of Station code numbers.

wind_wdb4 reads an input list file (default is wind.st) that can consist of the official US Postal Service two letter state designations, and/or individual station code numbers. All database records meeting these criteria are obtained from the master wind database file (default is wind_gen.wdb) and output (screen by default) to create a new subset wind database.

The input list file can consist of any of the following two letter state codes (not necessarily corresponding to the official US Postal Service designations) and/or individual station code numbers. These may be separated by whitespace (any number of spaces, tabs, newlines, or combinations thereof). Commas and other punctuation as well as any special comment lines are not allowed.

Valid state codes (case-insensitive):

AK, AL, AR, AZ, CA, CO, CT, DE, FL, GA, HI, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, MT, NC, ND, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, SD, TN, TX, UT, VA, VT, WA, WI, WV, WY

An example of a valid input list file could be:

----------------------------------------------------

994120 94130 994140 MO KS

TX 254020

NY

722020

ne CO

724320

----------------------------------------------------

COMMAND LINE ARGUMENTS

-v	If this option is specified, processing information is sent to stderr (usually the display) while wind_wdb is working. The default is for the "verbose" mode to be activated if this option is not supplied.

-f wdb_file	If this option is specified, the required option argument is considered the master wind database file. The default input wind database file (wind_gen.wdb) is used if this option is not specified.

-o out_file	If this option is specified, the required option argument is considered the output filename for wind_wdb. The default output file (screen display) is used if this option is not specified.

-i lst_file	If this option is specified, the required option argument is considered to be the station list input file for wind_wdb. The default input list file (wind.st) is used if this option is not specified. The list file must exist for wind_wdb to work.

-s site_lst	If this option is specified, the required option argument in quotation marks, is considered to be the station list for wind_wdb. The default input list (wind.st) is used if this option is not specified. This is an alternative to using the -i option. The list must exist for wind_wdb to work.

-h -\?	If either of these options are specified, a listing of the command line parameters are printed to stderr (usually the screen) and the program aborted. In some situations, certain shell programs under both DOS and UNIX, consider the ? a special character and require it to be escaped. For example:	wind_wdb -\?

EXAMPLES

The following example directs wind_wdb to develop a wind database file from the default master wind database file (wind_all.wdb) from the list of Station code station numbers and/or state abbreviations listed in the default input list file (wind.st). The output goes to stdout which has been redirected to a file (ks.wdb).

wind_wdb4 > ks.wdb

The following example directs wind_wdb to develop a database file from the wind database file specified by the -f option (ks.wdb) from the list of Station code station numbers and/or state abbreviations listed in the input list file specified with the -i option (county.st). The output goes to the file specified with the -o option (county.wdb).

wind_wdb4 -i county.st -f ks.wdb -o county.wdb

The following example directs wind_wdb to develop a database file from the wind database file specified by the -f option (us.wdb) from the list of Station code station numbers and/or state abbreviations listed in quotation marks. The output goes to the file specified with the -o option (county.wdb).

wind_wdb4 -s "724640 ks 994020" -f us.wdb -o county.wdb

SYNOPSIS

wind_idx [-h] [-e] [-f wdb_file] [-o out_file] [-\?]

DEFINITION

wind_idx produces an index file for the specified wind database file. The index file consists of the Station code numbers for each record along with the byte offset into the wind database file (index number), latitude, longitude, and altitude site location statistics, and the site location for each record. This program is typically used to obtain the index numbers for a given wind database that will allow other wind_gen utility programs (like wind_ch4k and wind_gen4) faster access to database records if specified. It may also be used to give a summary listing of all the Station code stations within a given wind database file.

wind_idx reads from a wind database file (default is wind_gen.wdb unless overrode with the - f option) and the output is sent to the file specified by the -o option or the screen by default.

COMMAND LINE ARGUMENTS

-h	If this option is specified, no output header is generated identifying the columns of output in the index file being created. The wind_gen utility requires no output to the index file. The default is for the header information to be output unless this option is supplied.

-e	If this option is specified, the output will be in an extended format that includes all header information available. The extended format is not in the proper form to be used as an index file for database access through wind_chk4 or wind_gen4.

-f wdb_file	If this option is specified, the required option argument is considered the wind database file from which an index file will be created. The default input wind database file (wind_gen.wdb) is used if this option is not specified.

-o out_file	If this option is specified, the required option argument is considered the output filename for wind_idx. The default output (screen display) is used if this option is not specified.

-?	If this option is specified, a listing of the command line parameters are printed to stderr (usually the screen) and the program aborted. In some situations, certain shell programs under both DOS and UNIX, consider the ? a special character and require it to be escaped. For example:	wind_idx -\?

EXAMPLES

The following example directs wind_idx to create an index file for the default wind database file (wind_gen.wdb). The output goes to stdout which has been redirected to a file (wind.idx).

wind_idx > wind.idx

The following example directs wind_idx to create an index file for the specified wind database file (ks.wdb). The output goes to the file specified with the -o option (ks.idx) with no header information.

wind_idx -f ks.wdb -o ks.idx -h

SYNOPSIS

wind_gen4	[-D] [-Vhvl] [-f wdb_file] [-o out_file] -s Station code_no [-x idx_no] [-r seed_no] [-b s_yr] [-y yrs] [-\?]

DEFINITION

wind_gen4 generates a daily wind data file based on the statistical parameters for a given wind database record. Day, month, year with wind speed and direction, as well as maximum and minimum wind speeds, and the monthly average hour of day the maximum wind speed occurred are output. Daily wind simulation is always initiated on the first of a year and produced in multiples of one full calendar year. Leap years are accounted for, so the starting date is important with respect to the resulting daily wind data file. By default, header information is supplied to label the output data columns. Only the -s option with a valid Station code number is required on the command line. A default wind database input file (wind_gen.wdb) is used if one is not specified and the output generally goes to the display device (screen) if an output file is not specified. wind_gen4 may also be brought up in interactive mode through the cli_wind program.

COMMAND LINE ARGUMENTS

-D If this option is specified an additional output is generated for debugging

-V	If this option is specified the wind_gen4 version is displayed and the program exited.

-h	If this option is specified an output file title is not generated. The default is to generate an output file header if this option is not supplied.

-v	If this option is specified additional information is sent to stderr (usually the display). This option would usually be used in situations where a corrupted wind database was suspected because of possibly erroneous output data being observed. The default is to not output the "verbose" messages unless this option is specified.

-l	If this option is specified, additional columns of information is output. This option displays the "representative" wind speed value, the random numbers generated, etc. for each day of the simulation.

-f wdb_file	If this option is specified, the required option argument is considered the input wind database file. The default input wind database file (wind_gen.wdb) is used if this option is not specified.

-o out_file	If this option is specified, the required option argument is considered the output filename for wind_gen4. The default output (screen display) is used if this option is not specified.

-s station_code	This required option, specified with its argument (a valid Station code no.), provides wind_gen4 with the required Station code number required to obtain that database information necessary to compute the daily wind data file.

-x index_no	If this option is specified with the required option argument (an index number for the Station code number specified with the -s option) you will obtain faster access to the desired database record information. The correct index numbers for a given wind database file can be obtained from the wind_idx program. If the index value specified is incorrect or invalid, wind_chk will linearly search the wind database for the specified record in an attempt to locate the desired record anyway.

-r seed_no	If this option is specified with the required option argument, this integer value will be used in place of the default random number seed value (54321). If a negative integer value is specified, the seed value will be obtained from the computer system's internal clock, thereby providing a pseudo-random seed value.

-b s_yr	If this option is specified with the required option argument, this integer value will be used in place of the default starting daily wind simulation calendar year (1).

-y yr	If this option is specified with the required option argument, this positive integer value will be used in place of the default number of simulation years (1) to create.

-\?	If this option is specified, a listing of the command line parameters are printed to the screen and the program aborted. In some situations, certain shell programs under both DOS and UNIX, consider the ? a special character and require it to be escaped. For example:	wind_gen4 -\?

EXAMPLES

The following example directs wind_gen4 to search for the wind database record specified by the Station code station number provided from the default wind database file (wind.wdb) and sends 1 year of daily wind data with a starting year of 1900 to stdout which has been redirected to 1900_1.day.

wind_gen4 -s 742550 > 1900_1.day

The following example directs wind_gen4 to search for the wind database record specified by the Station code station and index number provided from the wind database file (ks.wdb) and sends the 30 year daily output file with a starting year of 1980 to the file dodge.day.

wind_gen4 -s742550 -x 8874 -f ks.wdb -b 1980 -y 30 -o dodge.day

SYNOPSIS

wind_mdb	[-OIh?] [-i in_file] [-o out_file] [-H anem_ht] [-A anem_loc] [-F num_obs] [-a agency]

[-w station_code] [-s state] [-n station] [-c country] [-l lat] [-L lon] [-e elev] [-S st_date]

[-E end_date] [-D debug_num]

DEFINITION

wind_mdb generates statistical parameters of the combined wind speed and directions contained in a historical wind speed data file.

The historical data input must follow the format:

Year Month Day Time Direction Speed

where 'Month' is the month in which the data were taken; 'Time' is the period in the day which the observation represents; 'Direction' is the wind direction in degrees with 0.0 and 360.0 representing North, 90.0 for East, etc.; 'Speed' is the wind speed in meters per second.

The six numbers can be separated by any number of tabs or spaces, each line must contain at least one record. Records that contain:

1 ≤ Month ≤ 12

0.0 ≤ Direction ≤ 360.0

0.0 ≤ Speed ≤ 500.0

will be considered. Values outside these ranges are invalid and will be ignored.

The output will be compatible with that of the wind_gen4 database as described on page 1.

COMMAND LINE ARGUMENTS

-x	Write histogram data rather than Weibull parameters.

-C cutoff-flag	Specify how to put wind speed (u) into a wind speed class. The argument should be one of the following:

0	u < calm and u >= limit (default)

1	u <= calm and u >= limit

2	u < calm and u > limit

3	u <= calm and u > limit

-O	Overwrite the output data file. Without this option the output data file will be appended (default action).

-I	Bring up the program in an interactive mode. This is provided as an alternative to the large number of command line arguments necessary to specify header information. Any arguments relating to header information will then be used as default values in the interactive mode.

-h and -?	Display program usage message and exit.

-i in_file	Specify the input file name. The argument should be a string representing a valid file name. The default is standard input (keyboard).

-o out_file	Specify the output file name. The argument should be a string representing a valid file name. The default value is standard output (screen dispaly).

-H anem_ht	Specify the anemometer height. The argument should be a positive real number representing the anemometer height in meters. The standard value used is '10.0' meters and is the default. Wind speeds are adjusted for nonstandard anemometer heights using the equation:

adjusted_wind_speed = wind_speed * (10 / anem_ht) 0.142857

-A anem_loc	Specify the anemometer location. The argument should be one of the following characters:

R	Roof-top

G	Ground mast

B	Beacon tower

E	Estimated Wind, no anemometer

O	Other

U	Unknown

The default is 'U'.

-F num_obs	Specify the number of observations per day (frequency of readings in the input data file). The argument should be one of the following characters:

A	24

B	19-23

C	12-18

D	5-11

E	4

F	Less than 3

G	Greater than 24

U	Unknown

The default is 'U'.

-a agency	Specify the type of agency which collected the data. The argument should be one of the following characters:

A	Air Force

D	US Department of Agriculture

E	State Experiment Station

N	Navy

W	Weather Service

F	FAA

O	Other

U	Unknown

The default is 'U'.

-w station_code	Specify a unique number. The argument should be a unique positive integer. A list of used Station code numbers can be obtained using wind_idx on the database. The default is '0'.

-s state	Specify the state. The argument should conform to the two letter postal abbreviations listed under the wind_wdb documentation. The default is 'XX'.

-n station	Specify the name of the station. The argument is a string and should have quotes around it if it contains spaces. Strings with lengths above 30 will be truncated to 30 characters. The default is 'XXX'.

-c country	Specify the name of the country. The argument is a string identifying the name of the country, preferably that of the US Postal Service international country codes (eg. CA - Canada, GB - Great Britain). The default is 'US'.

-l lat	Specify the latitude. The argument must be given in degrees, minutes, and hemisphere. The hemisphere must be 'N' or 'S'. Spaces should be used to separate the components of latitude, and thus the entire value should be quoted. The default value is '0 0 N'.

-L lon	Specify the longitude. The argument follows the format for latitude described above with the exception that the hemisphere must be 'W' or 'E'. The default value is '0 0 W'.

-e elev	Specify the elevation. The argument should be a real number representing the elevation above mean sea level in meters. The default is '0'.

-S st_date	Specify the starting date. The argument should be a positive integer representing the starting date in the format YYYYMMDD (eg. 19680917 is read as September 17th, 1968). The default is '00000101'.

-E end_date	Specify the ending date. The argument follows the format for the starting date described above. The default is '99991231'.

-D debug_num	Activate debugging information. The argument should be a positive integer representing which levels of debugging information are displayed. A bit mask is used to indicate the various levels. This option is useful only if you are trying to read the source code for the program. The default is '0' -- no debugging information.

GUIDELINES FOR DATA SET SUITABILITY

Not all historical data sets are suitable for parameterization. We suggest the following guidelines for suitability of a data set to be analyzed using wind_mdb. Historical wind data should not be analyzed using wind_mdb if: 1) they represent less than 5 years of data, 2) the anemometer height is unknown, 3) anemometer location was not constant during the period of record, or 4) fewer than 8 observations per day were taken or part of the 24 hour period is missing (e.g. nighttime observations missing).

EXAMPLES

The following example reads the input file 'tucson.dat' and appends (or creates) an output file called 'tucson.wdb' with the default header information:

wind_mdb -i tucson.dat -o tucson.wdb

The above may also be accomplished by any one of the following:

wind_mdb -i tucson.dat > tucson.wdb

wind_mdb -o tucson.wdb < tucson.dat

wind_mdb < tucson.dat > tucson.wdb

The following example runs the program interactively. The -i -o -O and -S options will replace the normal default values contained in the user selection screen:

wind_mdb -I -i tucson2.dat -o tucson.wdb -O -S 19571014