GLEON / glmtools

Tools for interacting with the General Lake Model (GLM) in R
Other
22 stars 31 forks source link

Issue modeling the maximum lake depth #241

Closed AnaAlicia closed 6 years ago

AnaAlicia commented 6 years ago

Good evening,

I'm having issue modeling the maximum lake depth. GLM is showing it as 19m, is it a default value or is it something in my database? I would like to know how can I change it to 30m.

Thank you,

Ana image

jordansread commented 6 years ago

@AnaAlicia it is something specified in your .nml file. Change the "H" values in &morphometry to specify the morphometry of your lake.

AnaAlicia commented 6 years ago

Hey @jread-usgs

I've already changed the 'H' and 'A' values. But nothing changed.

Take a look, please.

H A
1013 101900
1014 220200
1015 466400
1016 1022800
1017 1591800
1018 2195200
1019 2736800
1020 3364000
1021 4129400
1022 4942100
1023 5841000
1024 6708000
1025 7403300
1026 8253400
1027 9171100
1028 10234900
1029 11412300
1030 12553400
1031 13746000
1032 14781000
1033 16126141
1034 17427068
1035 18774455
1036 20168302
1037 21608609
1038 23095376
1039 24628603
1040 26208290
jordansread commented 6 years ago

adjust lake_depth in &init_profiles

AnaAlicia commented 6 years ago

I've already changed lake_depth values. But nothing changed.

&init_profiles lake_depth = 30.0

jordansread commented 6 years ago

and the_depths?

AnaAlicia commented 6 years ago

&init_profiles lake_depth = 30.0 num_depths = 6 the_depths = 0,1,5,10,15,29 ! GLM the_temps = 24.00,23.90,23.50,23.40,22.80,22.50 the_sals = 0.01, 0.01, 0.01, 0.01, 0.01, 0.01

jordansread commented 6 years ago

and your model output is identical before the change?

AnaAlicia commented 6 years ago

image Yes

jordansread commented 6 years ago

can you paste the image of plot_temp() before you make the changes and then another image from plot_temp() after you make the changes?

AnaAlicia commented 6 years ago

Yes, hold on, please.

AnaAlicia commented 6 years ago

before (using default values) image

after image

jordansread commented 6 years ago

in both screenshots, the modified date and time for the glm2.nml file is today at 5:50. did you make the change to that file? Also, the "before" shot's clock appears to be later than the after one.

Try to do this w/ only altering the depth-related variables and re-send if you can.

AnaAlicia commented 6 years ago

Yes! Take a look again, please.

before image after image

jordansread commented 6 years ago

Ok. Please email your glm2.nml file to me

jordansread commented 6 years ago

At jread@usgs.gov

jordansread commented 6 years ago

@AnaAlicia

Note this is a GLM question, and glmtools is really just a package that helps you change parameters and evaluate the model. It doesn't tell you what those parameters mean and assumes you have that understanding from the GLM manual or elsewhere.

Here is the solution - and it requires only modifying the lake_depth and the H values, as mentioned above:

load the packages that help you run GLM

library(glmtools)
## Loading required package: GLMr
## This information is preliminary or provisional and is subject to revision...
## Loading required package: rLakeAnalyzer
## This information is preliminary or provisional and is subject to revision...

run example simulation

run_example_sim(sim_folder = '.')
## driver data file copied to  ./nldas_driver.csv 
## writing nml file to  ./glm2.nml 
## simulation complete. 
## *.nc output located in  ./output.nc
## [1] "."
plot_temp()

image

read the glm2.nml file from the directory

nml <- read_nml('glm2.nml')
# current depth starting condition:
get_nml_value(nml, 'lake_depth')
## [1] 18.288
# current "heights" for cross-section areas:
get_nml_value(nml, 'H')
##  [1] 301.7120 303.0183 304.3246 305.6309 306.9371 308.2434 309.5497
##  [8] 310.8560 312.1623 313.4686 314.7749 316.0811 317.3874 318.6937
## [15] 320.0000

want to change depth, try altering lake_depth:

nml <- set_nml(nml, arg_list = list('lake_depth' = 30))#, "H" = old_h))
write_nml(nml, file = 'glm2.nml')
run_glm()
## [1] 0
plot_temp()

image

Note that the initial depth is 30, but all of that water immediately spills out because the lake's morphometry isn't deep enough to handle it.

make the lake deeper:

old_h <- get_nml_value(nml, 'H')
old_h
##  [1] 301.7120 303.0183 304.3246 305.6309 306.9371 308.2434 309.5497
##  [8] 310.8560 312.1623 313.4686 314.7749 316.0811 317.3874 318.6937
## [15] 320.0000

modify the bottom "height" (elevation)

new_h <- old_h
new_h[1] <- 280

nml <- set_nml(nml, arg_list = list("H" = new_h))

write_nml(nml, 'glm2.nml')

run_glm()
## [1] 0
plot_temp()

image

now the lake is deeper

AnaAlicia commented 6 years ago

I'm having issue modeling the maximum lake depth again.

Take a look, please.

nDays 20060060 timestep 3600.000000 Maximum lake depth is 752.000000

Reading config from glm2.nml No WQ config Configuration Error. MaxLayers * max_layer_height < depth of the lake [1] 1

jordansread commented 6 years ago

@AnaAlicia please ask the GLM help. This doesn't seem to be a glmtools issue. But I would suggest increasing the value in MaxLayers param, or the max_layer_height.

AnaAlicia commented 6 years ago

thanks