Running GLM using R at daily timesteps to connect with simple biogeochem model

78 views
Skip to first unread message

jayz...@gmail.com

unread,
Sep 28, 2017, 2:29:08 PM9/28/17
to Aquatic Ecosystem MOdelling Network (AEMON) discussion forum
Hi, 
I want to connect GLM with a very simple biogeochem model using R, ideally at the daily scale. 

I've been testing the sensitivity of GLM to running it at various start/stop intervals (2 to 100 days) using the example files in glmtools R package. I run GLM using the example's .nml for n days, take the temperature output of the last day from the .nc file and use that temperature output as the initialization for .nml file for next interval run, and keep repeating process until I've run the entire time series. I then stitch together individual .nc files to create full time series of water temperature (code is here). During the reintialization at a given time step, surface temperature drops and, thus, interval length (number of days over which to run simulation) has a big impact on temperature. plots of surface temperature using various start/stops intervals as well as a few full profiles are attached. 

A few questions: 
1) I can't seem to run GLM using glmtools at daily start/stop interval. Is the limit 2 days? or is there something else I'm missing? 
2) Why would water temperature drop at reinitialization even though the input for water temperature is based on the previous day's water temperature from GLM sim? 
3) In general, is there a way to connect GLM to a simple biogeochem model all in R, with feedbacks (e.g. light attenuation) on GLM sim? 

Thanks, 
Jake 
interval_sensativity.png
profile_2days.png
profile_5days.png
profile_10days.png

Luke Winslow

unread,
Sep 28, 2017, 3:35:20 PM9/28/17
to aquaticm...@googlegroups.com

Jake,

How important is the Kd feedback? One of the easiest ways to accomplish your goal here would be to run GLM with variable Kd (based on your expected values) and then use the temp out to drive your biogeochem model. You could even iterate and update Kd based on your biogeochemical model until you got to a point where they converged to a single expected Kd timeseries.


A few questions: 
1) I can't seem to run GLM using glmtools at daily start/stop interval. Is the limit 2 days? or is there something else I'm missing? 

There is a lot that goes into initializing GLM that doesn't normally happen between timesteps, so I am not surprised your results are not great. GLM is not coded with this as a first class approach to modeling.


2) Why would water temperature drop at reinitialization even though the input for water temperature is based on the previous day's water temperature from GLM sim?

Does it always drop? Or does it vary?There is a driver averaging that you might be running into within GLM that may be causing a non 1:1 matching of what you expect to see.


3) In general, is there a way to connect GLM to a simple biogeochem model all in R, with feedbacks (e.g. light attenuation) on GLM sim?

It is something I've thought about and investigated a little in code. It isn't easy though and would take some time and a major overhaul of how GLM internals work right now. I am unaware of anyone who's done it. You could just build a biogeochemical model in fortran and connecting it through AED/FABM though.

Hope this helps!

-Luke

--
You received this message because you are subscribed to the Google Groups "Aquatic Ecosystem MOdelling Network (AEMON) discussion forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aquaticmodelli...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jayz...@gmail.com

unread,
Sep 28, 2017, 4:42:31 PM9/28/17
to Aquatic Ecosystem MOdelling Network (AEMON) discussion forum
Thanks, Luke. 
 
How important is the Kd feedback? One of the easiest ways to accomplish your goal here would be to run GLM with variable Kd (based on your expected values) and then use the temp out to drive your biogeochem model. You could even iterate and update Kd based on your biogeochemical model until you got to a point where they converged to a single expected Kd timeseries.
I think it could be important, especially for some lakes with large and variable surface water inflows which would have impacts on euphotic depth / phytoplankton / mixed layer and feedbacks on temp. So GLM can be given a time series of Kd? or do you need AED/FABM for that? 

Does it always drop? Or does it vary?
I haven't looked at every stop/start interval, but from what I've seen surface temperature usually decreases from last time point of previous GLM sim to first time point of current GLM sim. 

It is something I've thought about and investigated a little in code. It isn't easy though and would take some time and a major overhaul of how GLM internals work right now. I am unaware of anyone who's done it. You could just build a biogeochemical model in fortran and connecting it through AED/FABM though. 
Do you think it's worth investing time into figuring this out? I guess this is weighing whether people would want to build a simple model in R to connect to GLM (with high upfront cost to GLM internals) vs. learning fortran and building model there (which could be high upfront costs for many people to learn fortran, selfishly including me). 

Jake 

Luke Winslow

unread,
Sep 28, 2017, 7:31:54 PM9/28/17
to aquaticm...@googlegroups.com

thoughts in-line.


On 9/28/2017 4:42 PM, jayz...@gmail.com wrote:
Thanks, Luke. 
 
How important is the Kd feedback? One of the easiest ways to accomplish your goal here would be to run GLM with variable Kd (based on your expected values) and then use the temp out to drive your biogeochem model. You could even iterate and update Kd based on your biogeochemical model until you got to a point where they converged to a single expected Kd timeseries.
I think it could be important, especially for some lakes with large and variable surface water inflows which would have impacts on euphotic depth / phytoplankton / mixed layer and feedbacks on temp. So GLM can be given a time series of Kd? or do you need AED/FABM for that?
Oh yeah, variability in Kd matters. I just mean, does variability based on the feedback between temperature, biology, and chemistry matter? Or could you leave the pattern of Kd fixed. It really depends on your situation so it was just a question to ponder, not saying it might not matter, just that it sure is a lot easier if it doesn't matter.

I have a personal branch that includes direct variable Kd input at the daily timestep.


Does it always drop? Or does it vary?
I haven't looked at every stop/start interval, but from what I've seen surface temperature usually decreases from last time point of previous GLM sim to first time point of current GLM sim.
Hmm, weird. I bet there's some bias that comes out of the initialization in GLM. Generally not an issue, unless you're trying to do something like this.


It is something I've thought about and investigated a little in code. It isn't easy though and would take some time and a major overhaul of how GLM internals work right now. I am unaware of anyone who's done it. You could just build a biogeochemical model in fortran and connecting it through AED/FABM though. 
Do you think it's worth investing time into figuring this out? I guess this is weighing whether people would want to build a simple model in R to connect to GLM (with high upfront cost to GLM internals) vs. learning fortran and building model there (which could be high upfront costs for many people to learn fortran, selfishly including me).
Depends on your goal. I suspect you'd get to your goal faster going the "learn fortran" route. Especially if your desired model is simple. But I *do* think an R linked GLM with the ability to write simplified models would be very useful and of high impact. But it is probably more work and would take some negotiation with the broader GLM community.
Reply all
Reply to author
Forward
0 new messages