-
Notifications
You must be signed in to change notification settings - Fork 6
Home
Welcome to GRAPLEr!
GRAPLEr brings the power of distributing computing to the fingertips of lake ecology modelers. It is a Web Service that allows you to submit batches of GLM (General Lake Model) simulations to a distributed computing system, directly from your R/Rstudio environment.
GRAPLEr has been developed as a collaboration between researchers in PRAGMA and GLEON, with support from a supplement the the PRAGMA award (NSF OCI-1234983). For additional information, contact Renato Figueiredo (renato at acis.ufl.edu), Cayelan Carey (cayelan at vt.edu) or Paul Hanson (pchanson at wisc.edu)
You can use the following commands to get started using GRAPLEr in your R environment (these are extracted from a project EDDIE module used in a workshop at GLEON17)
install.packages('glmtools', repos=c('http://cran.rstudio.com', 'http://owi.usgs.gov/R'))
library(glmtools)
library(GLMr)
install.packages("devtools")
library("devtools")
devtools::install_github("GRAPLE/GRAPLEr")
library("bitops")
library("RCurl")
library("GrapleR")
nml_template_path()
# this should give you a path that tells you where the example GLM nml file is. E.g.:
# "/Library/Frameworks/R.framework/Versions/3.1/Resources/library/GLMr/extdata/glm2.nml"
# copy glm2.nml, met_hourly.csv to another folder, e.g. "/Users/yourname/Desktop/GRAPLEr"
graplerURL<-"http://graple-service.cloudapp.net"
GrapleCheckService(graplerURL)
# this will print a string that includes “I am alive, and at your service.” if everything went well.
Configure a test batch of 100 simulations to send to GRAPLEr (replace the sim_folder path to your computer's path)
sim_folder<-'/Users/yourname/Desktop/GRAPLEr'
driverFileName="met_hourly.csv"
parameterName="AirTemp"
startValue=-2
endValue=2
numberOfIncrements=100
expId<-GrapleRunExperimentSweep(graplerURL, sim_folder, driverFileName, parameterName, startValue, endValue, numberOfIncrements)
GrapleCheckExperimentCompletion(graplerURL, expId)
GrapleGetExperimentResults(graplerURL, expId)
sim_folder_1<-paste(sim_folder,sep='/','Sims','Sim1','Results')
sim_folder_101<-paste(sim_folder,sep='/','Sims','Sim100','Results')
nc_file_1 <- file.path(sim_folder_1, 'output.nc')
nc_file_101 <- file.path(sim_folder_101, 'output.nc')
plot_temp(file=nc_file_1, fig_path=FALSE)
plot_temp(file=nc_file_101, fig_path=FALSE)