100% found this document useful (1 vote)
68 views14 pages

SWAT Weather Database Guide

This document provides a quick guide to using the SWAT Weather Database software. It allows users to store daily weather data, create input files for ArcSWAT projects, and calculate weather statistics. The database contains tables for weather stations and 5 variables: relative humidity, precipitation, solar radiation, temperature, and wind speed. It can be installed by extracting the compressed file and has system requirements of Windows and Microsoft Access.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
68 views14 pages

SWAT Weather Database Guide

This document provides a quick guide to using the SWAT Weather Database software. It allows users to store daily weather data, create input files for ArcSWAT projects, and calculate weather statistics. The database contains tables for weather stations and 5 variables: relative humidity, precipitation, solar radiation, temperature, and wind speed. It can be installed by extracting the compressed file and has system requirements of Windows and Microsoft Access.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SWAT

Weather Database
A Quick Guide

Arthur Hrast Essenfelder

March 2018
v. 0.18.03
Contents
1. Introduction ..................................................................................................................................... 3
2. Installing and Opening the Database ............................................................................................... 4
i. System Requirements .................................................................................................................. 4
ii. Installation Steps.......................................................................................................................... 4
iii. Opening the Database ................................................................................................................. 4
3. Database Structure .......................................................................................................................... 6
i. The Weather Stations Table ........................................................................................................ 6
ii. The Weather Variables Tables ..................................................................................................... 6
a. The Relative Humidity Table (HMD) ........................................................................................ 7
b. The Precipitation Table (PCP) .................................................................................................. 7
c. The Solar Radiation Table (SLR) ............................................................................................... 7
d. The Temperature Table (TMP) ................................................................................................ 8
e. The Wind Speed Table (WND) ................................................................................................. 8
4. The Graphical User Interface ........................................................................................................... 9
i. The Home window ....................................................................................................................... 9
ii. The Manage Stations Database window ..................................................................................... 9
iii. The Manage Weather Database window .................................................................................. 11
iv. The Write Data to ArcSWAT Input Files window ....................................................................... 12
v. The SWAT WGEN Statistics window .......................................................................................... 12
vi. The Help window ....................................................................................................................... 14

2
1. Introduction
SWAT Weather Database is designed to be a friendly tool to store and process daily weather data to
be used with SWAT projects. It is capable of:

 Storing relevant daily weather information;


 Easily creating .txt files to be used as input information during an ArcSWAT project setup;
 Efficiently calculating the WGEN statistics of several weather stations in one-step run.

For comments, suggestions and bug reports, please contact:

Arthur Hrast Essenfelder

E-mail: [Link]@[Link]

 For citation, plain text:

Essenfelder, A. H. (2016). SWAT Weather Database: A Quick Guide. Version: v.0.16.07. doi:
10.13140/RG.2.1.4329.1927.

 or Bibtex entry:

@manual{SWAT-WeatherDatabase,
author = {Arthur H. Essenfelder},
title = {{SWAT Weather Database: A Quick Guide}},
date = {July, 2016},
language = {English},
version = {v. 0.16.07},
pagetotal = {14},
pubstate = {July, 2016},
doi = {10.13140/RG.2.1.4329.1927}
}

3
2. Installing and Opening the Database
i. System Requirements
In order to run SWAT Weather Database, the following should be met:

 32-bit or 64-bit Windows operating system;


 A recent Microsoft Access version installed (2010-onwards should be fine), and;
 A .pdf reader (e.g. Adobe Acrobat Reader).

ii. Installation Steps


To install the Metadata Database, just extract the contents of the compressed file
SWATWeatherDatabase.7z file anywhere in your computer (e.g. C:\SWAT\SWATWeatherDatabase). Inside
the installation directory, you should be able to find the file named [Link] and two folders,
namely Documentation and Tables.

Obs: Do not change the structure of the folder (e.g. rename the folders or files, move files outside
the main folder, etc.) as, by doing so, the [Link] will not be able to correctly find the
required references.

The folder documentation stores relevant .pdf documents to be consulted during the use of the
Weather Database. The folder Tables stores the WeatherDatabase_be.accdb database, which actually stores
the weather data to be used by the application.

Obs: Users more experienced in using Microsoft Access can fill the WeatherDatabase_be.accdb
directly, without using the developed GUI to do so. However, in order to create the input .txt ArcSWAT
weather files and to calculate the WGEN statistics, it is recommended to use the GUI interface.

iii. Opening the Database


In order to start the SWAT Weather Database GUI, just double-click on the [Link]
file on the main installation folder. You should be greeted with a screen similar to Figure 1.

4
Figure 1 - The Home window.

Obs: If you get a security warning asking you if you would like to enable the use of macros and vba
codes, please do so, otherwise some parts of the application will not work. By doing so, the
[Link] will close itself. Just reopen it to use it again with all the functionalities enabled. If
the message “Table links successfully updated.” appears on the bottom of the screen, then everything is
correctly enabled.

5
3. Database Structure
This section describes the structure of the SWAT Weather Database. In general terms, the database
is composed of one table to store the weather stations data and other five tables to store the weather
variables data, such as temperature and precipitations.

i. The Weather Stations Table


The following table summarises the structure of the weather stations table:

Table 1 - The Weather Stations table structure.

MAX CHARACTER DUPLICATES


FIELD NAME DATA TYPE REQUIRED
FIELD LENGTH ALLOWED
Station Code Text 255 Yes No
Station Name Text 255 Yes Yes
Latitude Double 28 Yes Yes
Longitude Double 28 Yes Yes
Elevation Double 28 Yes Yes
Station Description Text 255 No Yes
Other Information Text 255 No Yes

The field “Station Code” must not contain any duplicate values, otherwise it will not be imported to
the database. The field “Station Name” is the one used by the SWAT Weather Database on the output files. If
the user prefer, both the fields “Station Code” and “Station Name” can have the same values. When
importing data to the weather stations table the column headers should be the same as the field names
shown on Table 1. An example file can be found in:

(installation folder)\ExInputs\[Link]

ii. The Weather Variables Tables


The SWAT Weather Database stores daily weather data for five different weather variables:

 Relative Humidity (HMD);


 Precipitation (PCP);
 Solar Radiation (SLR);
 Maximum and Minimum Temperature (TMP);
 Wind Speed (WND).

All the weather variables tables have the fields “Date” and “Station”. The field “Date” is defined as
the U.S. date format (i.e. 1st March 1990 = 03/01/1990). The field “Station” must have the same value as the
field “Station Code” previously stored in the weather stations table (see The Weather Stations Table).

Obs: If a record being inputted in the weather database does not have a Station-StationCode match,
the database will refuse to import it. The weather stations database must be filled before importing the
actual weather information.

Although the structure of the weather variable table allows duplicate values for the fields “Date” and
“Station” alone, it will not accept duplicate values for a combination of both. In other words, the
combination Date-Station must be unique.

6
As for any SWAT project, missing values must be entered as -99.0. Such values will not be used
during the calculation of the WGEN statistics. They will, however, be written to the ArcSWAT input .txt files.

a. The Relative Humidity Table (HMD)


The following table summarises the structure of the HMD table:

Table 2 - The HMD table structure.

MAX CHARACTER DUPLICATES


FIELD NAME DATA TYPE REQUIRED
FIELD LENGTH ALLOWED
Date
Date 10 Yes Yes
mm/dd/yyyy
Station Text 255 Yes Yes
HMD Double 28 Yes Yes

When importing data to the HMD table, if the source file has a first row header, the column names
should be the same as the field names shown on Table 2. An example file can be found in:

(installation folder)\ExInputs\[Link]

b. The Precipitation Table (PCP)


The following table summarises the structure of the PCP table:

Table 3 - The PCP table structure.

MAX CHARACTER DUPLICATES


FIELD NAME DATA TYPE REQUIRED
FIELD LENGTH ALLOWED
Date
Date 10 Yes Yes
mm/dd/yyyy
Station Text 255 Yes Yes
PCP Double 28 Yes Yes

When importing data to the PCP table, if the source file has a first row header, the column names
should be the same as the field names shown on Table 3. An example file can be found in:

(installation folder)\ExInputs\[Link]

c. The Solar Radiation Table (SLR)


The following table summarises the structure of the SLR table:

Table 4 - The SLR table structure.

MAX CHARACTER DUPLICATES


FIELD NAME DATA TYPE REQUIRED
FIELD LENGTH ALLOWED
Date
Date 10 Yes Yes
mm/dd/yyyy
Station Text 255 Yes Yes
SLR Double 28 Yes Yes

7
When importing data to the SLR table, if the source file has a first row header, the column names
should be the same as the field names shown on Table 4. An example file can be found in:

(installation folder)\ExInputs\[Link]

d. The Temperature Table (TMP)


The following table summarises the structure of the TMP table:

Table 5 - The TMP table structure.

MAX CHARACTER DUPLICATES


FIELD NAME DATA TYPE REQUIRED
FIELD LENGTH ALLOWED
Date
Date 10 Yes Yes
mm/dd/yyyy
Station Text 255 Yes Yes
TMPmax Double 28 Yes Yes
TMPmin Double 28 Yes Yes

When importing data to the TMP table, if the source file has a first row header, the column names
should be the same as the field names shown on Table 5. An example file can be found in:

(installation folder)\ExInputs\[Link]

e. The Wind Speed Table (WND)


The following table summarises the structure of the WND table:

Table 6 - The WND table structure.

MAX CHARACTER DUPLICATES


FIELD NAME DATA TYPE REQUIRED
FIELD LENGTH ALLOWED
Date
Date 10 Yes Yes
mm/dd/yyyy
Station Text 255 Yes Yes
WND Double 28 Yes Yes

When importing data to the WND table, if the source file has a first row header, the column names
should be the same as the field names shown on Table 6. An example file can be found in:

(installation folder)\ExInputs\[Link]

8
4. The Graphical User Interface
The GUI was developed to help users during the process of managing data stored by the SWAT
Weather Database and during the generation of the output files. It has a clear look and is the easiest way to
import, edit or remove data stored in the database.

All the windows in this application are divided into three parts: the header, which contains quick-
access buttons related to the current opened window; the body, contains some navigation options, and; the
footer, which displays messages and warnings.

Basically, all the windows have the following navigation buttons on the header section:

 The button displays information about the application, as its version and contacts;
 The button return the application focus to the Home window;
 The button closes the current window.

i. The Home window


The Home window is the main window of the SWAT Weather Database. Think of it as the main menu
of the application, which guides the user to access all the functionalities of the database. It should look
similar to Figure 1.

The Home window body has five buttons:

 The button “Manage Stations Database” calls a window which helps the user to import,
edit, export and delete weather stations data;
 The button “Manage Weather Database” calls a window which helps the user to import,
edit, export and delete weather variables data;
 The button “ArcSWAT Input .txt Weather Files” calls a window which helps the user to
export stored weather data as .txt files ready to be used as input for your ArcSWAT project;
 The button “SWAT WGEN Statistics” calls a window which helps the user to calculate the
WGEN statistics based on the stored weather data and export it as an output file;
 The button “Help” calls a window which display relevant documentation, such as this guide;
 The button “Exit” closes the application.

ii. The Manage Stations Database window


The Manage Stations Database window allows the user to import, edit, export and delete weather
stations data. On the body section, it displays a table with all the stations data, while the header section
display different possible actions, such as import, export and delete data. It looks like Figure 2.

9
Figure 2 - The Manage Stations Database window.

Obs: Please remember that in order to maintain the data integrity, it is recommended to store the
weather stations data prior to storing other related weather data.

The Manage Stations Database window header has six buttons:

 The button exports the stored stations data as .xls file;


 The button exports the stored stations data as .xlsx file;
 The button exports the stored stations data as .csv file;
 The button imports external stations data from a .csv or .txt file;
 The button updates the stored stations data from an external .csv or .txt file;
 The button deletes all the stations data stored in the database.

Obs: Please note that by pressing the button “Import stations data” only new information will be
imported to the database. Previous stored unique Station Code will not be updated. To do so, please use the
update button (see The Weather Stations Table for more details on how the stations data table is defined).

10
iii. The Manage Weather Database window
The Manage Weather Database window allows the user to import, edit, export and delete weather
variables data (e.g. humidity, precipitation, etc.). On the body section, it displays a field called “Weather
Data”, which must be filled before performing any management actions. The window looks like Figure 3.

Figure 3 - The Manage Weather Database window.

Obs: Please remember that in order to maintain the data integrity, it is recommended to store the
weather stations data prior to storing other related weather data.

The Manage Weather Database window header has eight buttons:

 The button displays the selected weather data (view/edit);


 The button displays the selected weather data by station (view only). When pressed, a
new window will ask the user to inform the Station Name as a filter. If left blank, all stations
will be shown.
 The button exports the selected weather data as .xls file;
 The button exports the selected weather data as .xlsx file;
 The button exports the selected weather data as .csv file;
 The button imports external weather data from a .csv or .txt file;
 The button updates the stored weather data from an external .csv or .txt file;
 The button deletes all the selected weather data stored in the database.

Obs: Please note that by pressing the button “Import weather data” only new information will be
imported to the database. Previous stored unique combinations of Date and Station Code will not be
updated. To do so, please use the update button (see The Weather Variables Tables for more details on how
the weather data tables are defined).

11
iv. The Write Data to ArcSWAT Input Files window
The Write Data to ArcSWAT Input Files window allows the user to export stored weather data as .txt
files ready to be used as input for ArcSWAT projects. It looks like Figure 4.

Figure 4 - The Write Weather Data to ArccSWAT Input Files window.

The Write Data to ArcSWAT Input Files window body has the following information:

 A field called “SWAT Version”, which must be filled before proceeding (i.e. 2009 or 2012).
 A field called “Weather Data”, which must be filled before proceeding.
 A button called “Generate ArcSWAT .txt Files”.

When the button “Generate ArcSWAT .txt Files” is pressed, it will access all the selected weather
data and write it to .txt files which will be stored in a folder named after the selected weather data variable.
If this folder already exists, a message will be shown to the user asking whether to proceed or not.

v. The SWAT WGEN Statistics window


The SWAT WGEN Statistics window allows the user to calculate the WGEN statistics based on the
stored weather data and export it as an output file. The output format of such calculations is compatible with
the SWAT WGEN database format. It looks like Figure 5.

12
Figure 5 - The SWAT WGEN Statistics window.

The SWAT WGEN Statistics window body has the following information:

 A field called “WGEN File Name”, which stores the name of the output file to be created
after the calculation of the WGEN statistics. If left blank, the name “WGEN” will be used.
 A field called “Output File Type”, which stores the extension of the output file to be created
after the calculation of WGEN statistics. If left blank, the extension “.xls” will be used.
 A button called “Calculate WGEN Data”.

When the button “Calculate WGEN Data” is pressed, it will access all the selected weather data,
calculate the WGEN statistics for the available stations at once and write them to the selected WGEN file
name and extension. If the file already exists, a message will be shown to the user asking whether to proceed
or not.

Some considerations regarding the WGEN statistics calculation:

1. The RAIN_YRS (number of years of maximum monthly half-hour rainfall) is currently not
calculated by the application. A default value of RAIN_YRS = 10 is assumed for all weather
stations;
2. The RAINHHMX (maximum half-hour hour rainfall in entire period of record for month) is
estimated as being the average of 1/3 of the maximum recorded daily rainfall for that
month.
3. The DEWPT (Average daily dew point temperature for each month) is actually the relative
humidity (fraction). This is done as the SWAT model understands the DEWPT variable as the
average daily dew point temperature for each month (°C) or the relative humidity (fraction)
can be input. See the SWAT Input/Output Documentation for further details.

If any of the above mentioned considerations constrains your WGEN statistics, please consider
updating these values yourself before uploading these data to your SWAT project.

13
vi. The Help window
The Help windows brings the possibility of accessing some documents that may be helpful during the
use of the Weather Database. It looks similar to Figure 6.

Figure 6 - The Help window.

The Help window brings access to the following documentation:

 The SWAT Weather Database Manual (i.e. this document);


 The 2012 SWAT Input/Output Documentation;
 The 2009 SWAT Theoretical Documentation, and;
 The 2012 ArcSWAT User’s Guide.

14

Common questions

Powered by AI

The SWAT Weather Database requires that the weather stations database be filled before importing weather information. The weather variables tables must have column headers matching the field names specified, and the entries must not have duplicate Date-Station combinations, which must be unique . Imported data must also correctly associate with existing Station Codes from the weather stations table, as a mismatched Station-StationCode will prevent import . Furthermore, missing values should be entered as -99.0, which will not be used in WGEN statistics but written to ArcSWAT input files .

WGEN statistics are crucial for generating weather scenarios in SWAT simulations. In the SWAT Weather Database, the 'SWAT WGEN Statistics' window facilitates these calculations based on stored data. The user specifies output file preferences, then calculates WGEN statistics by pressing 'Calculate WGEN Data'. This calculates data for available stations and writes to specified file names and extensions. Important considerations include assuming default RAIN_YRS at 10 years and estimating RAINHHMX as the average of 1/3 of the maximum recorded monthly rainfall. DEWPT is input as relative humidity, not temperature, reflecting SWAT model needs .

The SWAT Weather Database refuses to import if data entries don't meet certain conditions. Specifically, each weather data entry must match an existing Station Code in the weather stations table; otherwise, it gets rejected. Additionally, Date-Station combinations must be unique within the weather data tables, as duplicate entries of these combinations are not allowed. Data headers must align with predefined field names, and data integrity must be maintained by importing station details prior to weather data, to support relational links .

The GUI plays a pivotal role in managing data by providing an intuitive interface for importing, editing, exporting, and removing weather data, streamlining complex tasks in the SWAT Weather Database. It supports data integrity by ensuring required connections between tables are maintained before operations proceed. Benefits over direct manipulation include preventing user errors, particularly with complex CSV and relational data tasks, and simplifying access to database functionalities like WGEN statistics and ArcSWAT file exports. The GUI's error warnings and structured navigation prevent loss of data integrity, offering a more user-friendly experience than editing raw Access files directly .

Data integrity is maintained through specific protocols in the Manage Stations Database and Manage Weather Database windows. It is recommended to store the weather stations data before storing other related weather data to ensure relational integrity . When importing data, only new information is added, and duplicate entries for unique field combinations are prevented. For station data, the unique Station Code must not change during import, and updates should be managed through a dedicated update function. Similarly, for weather data, unique combinations of Date and Station Code will not be updated by newly imported files unless managed through the update function .

Within the SWAT Weather Database GUI, users can view and edit specific weather data in several ways. Through the 'Manage Weather Database' window, users can display data either generally or filtered by station using the view and view/edit buttons. These functions present weather data in a tabular form for easy modification. Users can also specify station names as filters for more targeted data analysis and management, and they can export edited data into different file formats .

To export weather data as ArcSWAT input files, the user needs to fill the 'SWAT Version' and 'Weather Data' fields in the GUI's 'Write Data to ArcSWAT Input Files' window. Then, by pressing 'Generate ArcSWAT .txt Files', it accesses the selected weather data and writes it to .txt files stored in a folder named after the selected weather variable. If the folder exists, a prompt asks whether to proceed . It is crucial to ensure the weather stations data has been stored prior to managing weather data to avoid relational issues. Keep in mind that the integrity of the data might affect how ArcSWAT processes the data .

To update existing Station Code entries, a user should employ the update function rather than simply importing new data. The 'Import stations data' function only adds new information and does not update existing codes. Therefore, to change existing Station Code data, the 'update stored stations data' button should be used, which allows for correctly updating database entries without creating duplicates or conflicting with existing codes .

The 'Help' window significantly aids user understanding by providing access to crucial documentation, such as the SWAT Weather Database Manual, SWAT Input/Output Documentation, SWAT Theoretical Documentation, and ArcSWAT User’s Guide. This equips users with comprehensive guides for effective database management. It allows users to navigate complex data management tasks, understand functional processes within the application, and troubleshoot independently, enhancing user confidence and reducing dependency on external support .

The SWAT Weather Database handles missing values by requiring them to be entered as -99.0. These are not used in WGEN statistics calculations, ensuring that statistical outputs remain robust and reflective of the actual available data. However, such missing data values are still included in outputs to ArcSWAT input files, preserving data consistency across projects. The database ensures that missing data does not compromise major statistical calculations or data exports but informs users of gaps .

You might also like