GLEON / GLM3r

R package for basic GLM model running (version 3.0)
3 stars 15 forks source link

Possibility to add AED2 on this script ? #25

Open AlexisImbert opened 2 years ago

AlexisImbert commented 2 years ago

I would like to run my GLM/AED model on R, but i failed to do it with this script. I think it's only for running GLM ? Do you have any idea for running GLM/AED on R ?

robertladwig commented 2 years ago

The executable includes a compiled model of GLM and AED. Did you activate AED in the glm3.nml file, e.g.

&wq_setup
   wq_lib = 'aed2'
   wq_nml_file = 'aed2/aed2.nml'
   ode_method = 1
   split_factor = 1
   bioshade_feedback = .true.
   repair_state = .true.
   mobility_off = .false.
/
AlexisImbert commented 2 years ago

Yes i did that. I paste all my files in the package GLM3r (with my bcs) ... When i run the model in the basic application (outside R) all is working well so the problem are not my files

robertladwig commented 2 years ago

If you have a functioning glm3.nml and a aed2.nml file, run_glm() should simulate both together. Did you get any specific R terminal output?

AlexisImbert commented 2 years ago

In fact in my example is running, but it doesn't simulate AED variables. For example i'm creating a file in 4m depth but all AED variables have "-nan(ind)" as a value ...

AlexisImbert commented 2 years ago

Here the message when i want to visualize AED variables "Error in approx(x = elevs_re, y = temps_re, xout = elevs_out) : need at least two non-NA values to interpolate In addition: There were 12 warnings (use warnings() to see them)"

robertladwig commented 2 years ago

I am bit lost, sorry. Is your error related to GLM3r or to another package, e.g. glmtools? Because that error above should not happen when you only run run_glm(...)

jordansread commented 2 years ago

This is probably a glmtools error which appears when the simulation has only one layer. This can be due to the lake being really shallow, the lake drying up, ice-cover being significant, or errors in the simulation that cause layers to converge when they shouldn't (we've seen this with a jump in ice-cover that is unrealistic but results in this error).