Physical model calibration at Langtjern

posted in: Lake model blog | 0

Setting up the GOTM/FABM framework,  from compilation from source to running a calibration requires a sequence of steps that can easily be mixed-up. To remind me of the actions that need to be taken, I setup a Jupyter notebook describing those steps.

Also, and perhaps more importantly for the people reading this, the notebook also contains routines for result visualization. This might be of interest for others: our lakes and setups might be different but all results are stored in an NetCDF database.

Some of the code snippets in the notebook allow to interact with the results database and automagically generate some plots, some of them interactive, using the plotly package.

In short the notebook contains code (python3) snippets to:

  • query output.nc
  • run GOTM with a user-defined parameter set, by automagically modifying various .nml files
  • generate (almost-) publication-ready figures of depth-dependent variables (temperature profiles are shown as an example)
  • compute some statistics on the goodness-of-fit
  • interactively explore the goodness of fit

Some to the python code in there might make B&B question my sanity but, hey, it seems to work. I am conscious that some of it is pretty horrible, but it’s a work of progress.

Actually running the notebook requires pip installing a variety of packages.

Otherwise, I have published the notebook online:

http://nbviewer.jupyter.org/github/Lecheps/gotm_fabm_langtjern/blob/master/Setup.ipynb

And the source is stored in github. I can invite you to the repo if you are interested.

Feel free to plagiarize.

 

/José-Luis

 

Please note that this is a work in progress, I am updating it rather often and it might be broken at times.