glmtools

June 21, 2021 · View on GitHub

status

Build
status Build
Status

Tools for interacting with the General Lake Model (GLM) in R. glmtools includes some basic functions for calculating physical derivatives and thermal properties of model output, and some plotting functionality (see example image below).

glmtools Functions (as of v0.2.5.2)

PackageTopicTitle
glmtoolscalibrate_simCalibrates GLM-AED2 variables to improve fit between observed and simulated data
glmtoolscompare_to_fieldcompare metric for GLM vs field observations
glmtoolsconvert_sim_varconvert an existing simulation variable into a different one
glmtoolsepi.temperatureGet volumetrically averaged epilimnion temp
glmtoolsget_calib_init_validationGet last values from a calibration period to be used for the validation
glmtoolsget_calib_periodsSplits time period into calibration and validation period
glmtoolsget_calib_setupCreates an example setup for a calibration run
glmtoolsget_evaporationget evaporation from GLM simulation
glmtoolsget_hypsographyretrieve hypsography information
glmtoolsget_iceget ice depth from GLM simulation
glmtoolsget_nml_valuegets a nml value according to an arg_name
glmtoolsget_rawget raw data from GLM simulation
glmtoolsget_surface_heightget surface height from GLM simulation
glmtoolsget_tempget water temperatures from a GLM simulation
glmtoolsget_varget variable from a GLM simulation
glmtoolsget_windget wind speed from GLM simulation
glmtoolshypo.temperatureGet volumetrically averaged hypolimnion temp
glmtoolsplot_compare_stagePlot simulated and observed stage data
glmtoolsplot_meteoPlot meterological drivers from a csv file
glmtoolsplot_tempDeprecated. Plot water temperatures from a GLM simulation
glmtoolsplot_temp_compareDeprecated. Plot matching heatmaps for modeled and observed temp
glmtoolsplot_validate_profilesPlot validation and model temperature profiles for all unique dates
glmtoolsplot_var_comparePlot matching heatmaps for modeled and observed temp
glmtoolsplot_var_dfPlot variables from a data frame
glmtoolsplot_var_ncPlot variables from a .nc file
glmtoolsread_field_obsRead in field data into a data.frame
glmtoolsread_field_stageRead in a field stage file
glmtoolsread_nmlread in a GLM simulation *.nml file
glmtoolsresample_simget subset of time from a generic timeseries data.frame
glmtoolsresample_to_fieldMatch GLM water temperatures with field observations
glmtoolsrun_example_simRun example simulation
glmtoolsset_nmlsets values in nml object
glmtoolssim_metricsget possible metrics for comparing GLM outputs to field
glmtoolssim_var_longnameGet long name of variable from a GLM simulation
glmtoolssim_var_unitsGet units of variable from a GLM simulation
glmtoolssim_varsGet list of variables from a GLM simulation
glmtoolssummarize_simCreates GLM simulation summary outputs
glmtoolsvalidate_simRun diagnostics on model results vs observations
glmtoolswater.temperatureMimic rLakeAnalyzer function
glmtoolswhole.lake.temperatureGet volumetrically averaged whole lake temperature
glmtoolswrite_nmlwrite GLM .nml for a GLM simulation

FAQ

How do I install glmtools? It isn’t on CRAN!

install.packages('remotes')
remotes::install_github('usgs-r/glmtools')

How do I contribute new code back to the glmtools project?

In order to contribute to this code, we recommend the following workflow:

  1. “fork” this repository to your own personal github account

  2. clone the github repository to your computer:

    $git clone https://github.com/{username}/glmtools.git

  3. modify code or add new functionality, save the code

  4. add the repository master to a remote master called “upstream”

    $cd glmtools

    $git remote add upstream https://github.com/USGS-R/glmtools.git

  5. before pushing your changes to your repository, pull in the current version of the GLEON master:

    $git fetch upstream

  6. merge these differences with your own “master” version:

    $git merge upstream/master

  7. push your changes to your github repository, in addition to changes made by pulling in the GLEON master:

    $git push

  8. submit a pull request to GLEON master using your account at github.com