setPrjDates: Sets the model run start and end dates in a CRHM model '.prj'...

View source: R/setPrjDates.R

setPrjDatesR Documentation

Sets the model run start and end dates in a CRHM model .prj file

Description

Sets the model run start and end dates in a CRHM model .prj file

Usage

setPrjDates(
  inputPrjFile = "",
  startDate = "",
  endDate = "",
  outputPrjFile = "",
  initialStateFile = "",
  finalStateFile = "",
  logfile = ""
)

Arguments

inputPrjFile

Required. Name of the .prj file.

startDate

Required. Model run starting date in format YYYY MM DD.

endDate

Required. Model run ending date in format YYYY MM DD.

outputPrjFile

Optional. If omitted, the input .prj file will be overwritten.

initialStateFile

Optional. If specified, the specified file will be set as the initial state file, i.e. the state variables to be read in at the beginning of the model run.

finalStateFile

Optional. If specified, the specified file will be set as the final state file, i.e. the state variables to be exported at the end of the model run.

logfile

Optional. Name of the file to be used for logging the action. Normally not used.

Value

If successful, returns TRUE. If unsuccessful, returns FALSE.

Note

If you are using Windows, the paths for the state files must use \\ instead of \ for the directory delimiter. The reason is that R, like many programming languages, interprets \ as an escape code. This is different from the file path set in inputPrjFile, which must be an R path using the / symbol. See the example below.

Author(s)

Kevin Shook

See Also

runCRHM setPrjObs setPrjParameters

Examples

## Not run: 
result <- setPrjDates('c:/CRHM/Bad Lake 1974-1975.prj',
'1974 10 1', '1975 10 1', initialStateFile='c:\\CRHM\\Model_Initial_State.int',
 finalStateFile='c:\\CRHM\\Model_Final_State.int')
## End(Not run)

CentreForHydrology/CRHMr documentation built on April 6, 2024, 5:27 p.m.