trimCCNFFiles: Trim Climate Change Natural Flow Files

Description Usage Arguments Details Value Note Examples

Description

trimCCNFFiles() trims the climate change natural flow input data to start and/or end in a different year.

Usage

1
trimCCNFFiles(startYear, endYear, iFolder, nTraces = 112, force = FALSE)

Arguments

startYear

The desired start year. Should be after 1950 and before 2099.

endYear

The desired end year. Should be after 1950 and before 2099.

iFolder

The path to the trace files, e.g., '/dmi/VIC/'.

nTraces

The number of traces to process. The default is 112, which is the number of traces in the CMIP3 climate change hydrology.

force

Boolean. If TRUE the function will trim the files as specified, but if it is FALSE, then the function stops without trimming any files.

Details

The climate change natural flows were developed to start in January 1950. Unlike the other natural flow files used in CRSS, the data are associated with specific years, i.e., the index sequential method is not used on the climate change hydrology. Sometimes it is necessary to trim the data to start, and end in a particular year. The function will return data starting in January of the startYear and ending in December of endYear.

While the function is typically used on climate change natural flow files, it will still work with other natural flow input files.

Value

The number of files that were processed

Note

Assumes folder numbers will always start at 1. Additionally, it only attempts to trim files that have expected natural flow or natural salt file names. These are the file names returned by nf_file_names() and natsalt_file_names().

Examples

1
2
3
4
5
6
# Trim all 112 traces found in 'CRSS/dmi/VIC' to start in Jan-2017 and 
# end in Dec-2019
## Not run: 
trimCCNFFiles(2017,2019,'CRSS/dmi/VIC/')

## End(Not run)

rabutler/CRSSIO documentation built on May 26, 2019, 8:51 p.m.