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).
Package | Topic | Title |
---|---|---|
glmtools | calibrate_sim | Calibrates GLM-AED2 variables to improve fit between observed and simulated data |
glmtools | compare_to_field | compare metric for GLM vs field observations |
glmtools | convert_sim_var | convert an existing simulation variable into a different one |
glmtools | epi.temperature | Get volumetrically averaged epilimnion temp |
glmtools | get_calib_init_validation | Get last values from a calibration period to be used for the validation |
glmtools | get_calib_periods | Splits time period into calibration and validation period |
glmtools | get_calib_setup | Creates an example setup for a calibration run |
glmtools | get_evaporation | get evaporation from GLM simulation |
glmtools | get_hypsography | retrieve hypsography information |
glmtools | get_ice | get ice depth from GLM simulation |
glmtools | get_nml_value | gets a nml value according to an arg_name |
glmtools | get_raw | get raw data from GLM simulation |
glmtools | get_surface_height | get surface height from GLM simulation |
glmtools | get_temp | get water temperatures from a GLM simulation |
glmtools | get_var | get variable from a GLM simulation |
glmtools | get_wind | get wind speed from GLM simulation |
glmtools | hypo.temperature | Get volumetrically averaged hypolimnion temp |
glmtools | plot_compare_stage | Plot simulated and observed stage data |
glmtools | plot_meteo | Plot meterological drivers from a csv file |
glmtools | plot_temp | Deprecated. Plot water temperatures from a GLM simulation |
glmtools | plot_temp_compare | Deprecated. Plot matching heatmaps for modeled and observed temp |
glmtools | plot_validate_profiles | Plot validation and model temperature profiles for all unique dates |
glmtools | plot_var_compare | Plot matching heatmaps for modeled and observed temp |
glmtools | plot_var_df | Plot variables from a data frame |
glmtools | plot_var_nc | Plot variables from a .nc file |
glmtools | read_field_obs | Read in field data into a data.frame |
glmtools | read_field_stage | Read in a field stage file |
glmtools | read_nml | read in a GLM simulation *.nml file |
glmtools | resample_sim | get subset of time from a generic timeseries data.frame |
glmtools | resample_to_field | Match GLM water temperatures with field observations |
glmtools | run_example_sim | Run example simulation |
glmtools | set_nml | sets values in nml object |
glmtools | sim_metrics | get possible metrics for comparing GLM outputs to field |
glmtools | sim_var_longname | Get long name of variable from a GLM simulation |
glmtools | sim_var_units | Get units of variable from a GLM simulation |
glmtools | sim_vars | Get list of variables from a GLM simulation |
glmtools | summarize_sim | Creates GLM simulation summary outputs |
glmtools | validate_sim | Run diagnostics on model results vs observations |
glmtools | water.temperature | Mimic rLakeAnalyzer function |
glmtools | whole.lake.temperature | Get volumetrically averaged whole lake temperature |
glmtools | write_nml | write GLM .nml for a GLM simulation |
glmtools
can be installed from the USGS
GRAN repository. To install glmtools
and all dependencies, follow the appropriate instructions below:
-
Setup R to add GRAN using the instructions on the USGS R page.
-
After GRAN is setup (usually requires a restart of R), then use the following command in R:
install.packages("glmtools")
This version requires the NetCDF version R library (called ncdf4
), and
rLakeAnalyzer
, and tools
if you would like to run all examples.
package | version |
---|---|
R | >= 3.0 |
GLM3r | * |
rLakeAnalyzer | * |
akima | * |
adagio | * |
dplyr | * |
ggplot2 | * |
lazyeval | * |
methods | * |
patchwork | * |
ncdf4 | * |
readr | * |
reshape2 | * |
tidyr | * |
tools | * |
In order to contribute to this code, we recommend the following workflow:
-
“fork” this repository to your own personal github account
-
clone the github repository to your computer:
$git clone https://github.com/{username}/glmtools.git
-
modify code or add new functionality, save the code
-
add the repository master to a remote master called “upstream”
$cd glmtools
$git remote add upstream https://github.com/USGS-R/glmtools.git
-
before pushing your changes to your repository, pull in the current version of the GLEON master:
$git fetch upstream
-
merge these differences with your own “master” version:
$git merge upstream/master
-
push your changes to your github repository, in addition to changes made by pulling in the GLEON master:
$git push
-
submit a pull request to GLEON master using your account at github.com