The R script LapseRateCalculator.R in folder inst provide an example of usage of lapse rate calculator using as test variable Dew point temperature (Tdew). Tdew is calculated from Air Temperature and Relative Humidity using GEOtop formulas(1) [Link].
After a selection of variable to examine the script apply a linear model to extract lapse rate. The output is a file csv containing,for each timestamp, the time series of number of station available , the lapse rate and the r-squared of linear fitting model.
Note: Thi script work for data having column structure and format as LTER standard, not for GEOtop (possible update!)
In Section 1 import functions used in script, files available in folder /data/Input after the selection of git folder (INPUT 1), and the file of elevation (INPUT 2) of stations in folder /data/Support files. This file has 2 columns: the first, called name should cointain the file name of station without .csv. The second, called elevation should cointain the elevation of the station in m a.s.l.
In Section 2 the script calculate dew point temperature from Air temperature and Relative Humidity. In this section you have to fill the following inputs:
In Section 3 the lapse rate is calculated using a linear fitting models.For example the linear fit is between Dew point Temperature (y axis) and Elevation (x axis). You shuould select (INPUT 5) which dataset use for lapse rate calculator (in the example Dew_point, but it could be another, for example only Air Temperature imported with function fun_read_all_stations. This function read all files in folder data/Input/ and read the variable select from every file), and an elevation vector (INPUT 6) that cointain the only the elevation of station in the same order that they appear in the dataset.
In Section 4 the script save output in folder /data/Output/, as a file VARIABLE_FOR_LAPSERATE.csv (where VARIABLE_FOR_LAPSERATE is the string of name of variable analyzed with lapse rate calculator), containing 4 column:
INPUT:
OUTPUT:
Outptuts are in K/1000 m - negative values mean a decrease with elevation
(1) https://github.com/geotopmodel/geotop/blob/master/src/geotop/meteo.cc
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.