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 3 of WIND_GEN currently consists of the following utility routines:

1.	wind_chk	Simply displays specified records from wind database.

2.	wind_wdb	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_gen	Generates daily simulated wind data from specified station database parameters.

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

6.	wind_sbd	Simulates sub-daily wind speed data using a sine wave daily distribution.

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. The specific (master) database information consists of the following:

1.	A unique station code or identification number (6 digits or less). This is typically the Weather Bureau, Army, Navy (WBAN) station number, if it exists for the site.

2.	The station site. This usually consists of a country, state/province, and city designation.

3.	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.	The beginning and ending dates of data used to derive the statistical parameters for a single database record (yyyymmdd format).

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

6.	The monthly wind direction distributions for the 16 cardinal directions and calm (< 0.5 m/s wind speed).

7.	The monthly Weibull scale and shape parameter pairs that specify the wind speed distribution for each of the 16 cardinal directions.

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

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

The format of a typical database header is illustrated to the right. Bracket numbers refer to item numbers listed above.

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

SYNOPSIS

wind_chk [-h] [-f wdb_file] [-o out_file] -s WBAN_no [-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 WBAN 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 WBAN_no	This required option, specified with its argument (a valid WBAN no.), provides wind_chk with the required WBAN 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 WBAN 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 WBAN station number provided from the default wind database file (wind.wdb) and displays the record to standard output (usually the display).

wind_chk -s 13947

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

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

SYNOPSIS

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

DEFINITION

wind_wdb 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 WBAN numbers.

wind_wdb 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 WBAN 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 WBAN 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:

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

14850 94014 24137 MO KS

TX 1367923

NY

1524275

ne CO

13994

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

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 WBAN 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_wdb > 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 WBAN 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_wdb -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 (ks.wdb) from the list of WBAN station numbers and/or state abbreviations listed in quotation marks. The output goes to the file specified with the -o option (county.wdb).

wind_wdb -s "24607 ks 93045" -f ks.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 WBAN 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_chk and wind_gen) faster access to database records if specified. It may also be used to give a summary listing of all the WBAN 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_chk or wind_gen.

-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_gen	[-D] [-Vhvl] [-f wdb_file] [-o out_file] -s WBAN_no [-x idx_no] [-r seed_no] [-b s_yr] [-y yrs] [-\?]

DEFINITION

wind_gen 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 WBAN 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_gen 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_gen 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_gen. The default output (screen display) is used if this option is not specified.

-s WBAN_no	This required option, specified with its argument (a valid WBAN no.), provides wind_gen with the required WBAN 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 WBAN 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_gen -\?

EXAMPLES

The following example directs wind_gen to search for the wind database record specified by the WBAN 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_gen -s 13985 > 1900_1.day

The following example directs wind_gen to search for the wind database record specified by the WBAN 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_gen -s13985 -x 8874 -f ks.wdb -b 1980 -y 30 -o dodge.day

The following example (with no option) allows the user to run wind_gen in interactive mode (i.e. user interface). It is recommended that the user obtain the cli_wind user documentation before running this program.

cli_wind

SYNOPSIS

wind_ mdb	[- OIh ?] [- i in_file] [-o out_file] [-H anem _ ht ] [-A anem _ loc ] [-F num _ obs ] [-a agency]

[-w wban _ num ] [-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 parameterization of the combined wind speed and directions contained in a historical wind speed data file.

The historical data input must follow the format:

Month 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 four parameters 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_gen database as described on page 1.

COMMAND LINE ARGUMENTS

-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 * ( anem _ ht / 10.0 ) 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 wban _ num	Specify a unique number. The argument should be a unique positive integer. A list of used WBAN 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' for latitude. 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 '00000000'.

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

-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

SYNOPSIS

wind_ sbd	[- LHh ?] [- i in_file] [-o out_file] [-n ntstep ] [-t threshold] [-s skip_lines]

DEFINITION

wind_ sbd simulates sub-daily wind speeds when the maximum wind speed for the day exceeds a specified threshold wind speed.

wind_ sbd expects each line of input to follow the format:

Day Month Year Direction Umax Umin Hrmax

Where 'Day' 'Month' and 'Year' represent the date in which the data were collected; 'Direction' is a value from 0 to 360 representing the wind direction; ' Umax ' and ' Umin ' represent the maximum and minimum wind speeds for that day; and ' Hrmax ' is when the maximum wind speed occurred for that day.

If the input line does not contain exactly 3 integers and 4 real numbers (separated by any number of spaces), then that line of input will be ignored (treated as a comment). This allows for flexible formats of comments throughout the input file.

If the maximum wind speed ( umax ) is less than the threshold wind speed, no output is generated for that day. Otherwise, the following is sent to the output file:

Day Month Year Direction Wind_ speed1 Wind_ speed2 Wind_ speed3 ...

Where 'Day' 'Month' 'Year' and 'Direction' are what was read from the input info for that day; and the wind speeds that follow have the following characteristics:

-	There are as many as specified by ntstep (24 by default)

-	Each output line has up to 10 wind speeds (unless the -L option is used)

-	The nth wind speed value represents the wind speed for the nth 24/ ntstep hour. ( i .e. If ntstep is 48, the 4th wind speed represents the average wind speed for the 4th half hour of that day.)

-	The max wind speed ( Umax ) will occur at the hour of max ( Hrmax ) for that day.

-	The min wind speed will occur 12 hours after the max wind speed.

COMMAND LINE ARGUMENTS

-L	Put wind speeds all on one line.

-H	Suppress printing of the header.

-h or -\?	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 is standard output (screen dispaly ).

-n ntstep	Specify the number of time stamps per day. The argument should be an integer from 24 to 1440. The default is 24 time stamps per day.

-t threshold	Specify the wind speed threshold. The argument should be a positive real number representing the threshold speed in meters per second. The default is 8 meters per second.

-s lines	Specify the number lines to skip. The argument should be an positive integer representing the number of lines to skip at the start of the input file. The default is 0.

EXAMPLES

The following example reads the input file 'tucson.wdb', ignoring the first 5 lines, generates output to stdout without a header.

wind_sbd -s 5 -H -i tucson.wdb

The following example reads the input file 'tucson.wdb', and generates an output file 'tucson.sbd' with 48 time stamps per day.

wind_sbd -n 48 < tucson.wdb > tucson.sbd