read_cli: Read a WEPP climate file

View source: R/read_cli.R

read_cliR Documentation

Read a WEPP climate file

Description

Reads a Water Erosion Prediction Project (WEPP) climate (*.cli) file. This file contains climate information.

Reads climate file header information including version, settings, station, location, averages, and precipitation data that may or may not include breakpoints.

CLIGEN climate files either have breakpoints that indicate rainfall on sub-daily time frames or have daily summaries only. This function will read a climate file that has breakpoints and return a list containing climate file information including daily summaries as well as breakpoint information.

Usage

read_cli(file, breakpoints = NULL)

read_cli_raw(file)

extract_breakpoints(precip_with_breakpoints)

Arguments

file

A path to the file.

precip_with_breakpoints

data.frame containing precipitation data and breakpoints

Details

cligen_settings is a vector with the following named elements:

itemp

1 - continuous simulation, 2 - single storm

ibrkpt

0 - no breakpoints, 1 - breakpoints

iwind

0 - wind information exists, 1 - no wind information exists

location is a vector with the following named elements:

deglat

degrees latitude (+ is North, - is South)

deglon

degrees longitude (+ is East, - is West)

elev

station elevation (m)

obsyrs

weather station years of observation

ibyear

beginning year of CLIGEN simulation

numyr

number of climate years simulated and in file

averages is a data.frame with 12 rows and the following columns:

month

1 - January, 2 - February, etc

obmaxt

average maximum temperature (C) for the month

obmint

average minimum temperature (C) for the month

radave

average daily solar radiation (langleys)

obrain

average precipitation (mm)

These averages do not match the averages calculated from precip.

precip is a data.frame containing the following columns:

da

numeric, day of the month

mo

numeric, month

year

numeric, year

prcp

numeric, daily precipitation amount (mm)

dur

numeric, duration of precipitation (hr)

tp

numeric, ratio of time to rainfall peak/rainfall duration

ip

numeric, ratio of maximum rainfall intensity/average rainfall intensity

tmax

numeric, daily temperature maximum (degrees C)

tmin

numeric, daily temperature minimum (degrees C)

rad

numeric, daily solar radiation (landleys/day)

w-vl

numeric, wind velocity (m/sec)

w-dir

numeric, wind direction (degrees from North)

tdew

numeric, dew point temperature (degrees C)

breakpoints is a data.frame containing the following columns:

da

numeric, day of the month

mo

numeric, month

year

numeric, year

timem

time since midnight HH.MM

pptcum

cumulative precipitation (mm) since midnight

Value

A list containing the following elements:

cligen_version

numeric, CLIGEN version, e.g. 4.30

cligen_settings

numeric,

station

character, name of station

location

numeric

averages

numeric, monthly average

precip

numeric, daily precipitation

breakpoints

numeric, (optional) sub-daily precipitation

A list containing two elements: precip and breakpoints

Source

https://www.ars.usda.gov/ARSUserFiles/50201000/WEPP/usersum.pdf


jarad/WEPPR documentation built on Nov. 3, 2023, 5:42 a.m.