Coder Social home page Coder Social logo

aquaticecodynamics / glm Goto Github PK

View Code? Open in Web Editor NEW
35.0 15.0 28.0 55.31 MB

Code for the General Lake Model

Home Page: http://aquatic.science.uwa.edu.au/research/models/GLM/

License: GNU General Public License v3.0

Makefile 1.18% Shell 1.63% C 73.52% Fortran 23.35% Batchfile 0.31%
lake model mixing hydrodynamics stratification water quality ecology glm biogeochemical

glm's Introduction

GLM : The General Lake Model

Project Status: Active – The project is being actively developed. GLM GPLv3 license


The General Lake Model (GLM) is a water balance and one-dimensional vertical stratification hydrodynamic model. It accounts for the effect of inflows/outflows, mixing and surface heating and cooling, including the effect of ice cover. It is suited to longer-term investigations ranging from seasons to decades, and for coupling with biogeochemical models to explore the role that stratification and vertical mixing has on biogeochemical and ecological dynamics of lakes, reservoirs, ponds and wetlands.

Accessing the model

This GLM repository is released coupled with the AED water quality model, via the GLM-AED release. Refer to the glm-aed repository for pre-compiled model executable files, example simulations, and information for how to get started with the model.

Reference

Refer to the following paper for a scientific description of the model:

Hipsey, M.R., Bruce, L.C., Boon, C., Busch, B., Carey, C.C., Hamilton, D.P., Hanson, P.C., Read, J.S., de Sousa, E., Weber, M. and Winslow, L.A., 2019. A General Lake Model (GLM 3.0) for linking with high-frequency sensor data from the Global Lake Ecological Observatory Network (GLEON). Geoscientific Model Development, 12(1), pp.473-523. https://doi.org/10.5194/gmd-12-473-2019

glm's People

Contributors

brendan-busch avatar casper-boon avatar jordi-prats avatar matthipsey avatar rqthomas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

glm's Issues

new &inflow options

need to add in

  • subm_elev (as submerged inflow entry elevation is currently still read in via strmbd_drag)
  • max_travel_time (since during hot-start and data-assimilation runs, we need to ensure no inflow parcels are "lost" during stop and restart. This option will force inflow parcels to be inserted once time is maxed out.

Different outputs with the same inputs

I thought that the way GLM-AED works (I am using the newest GLM3-AED2), that you would always get the same answer if you give it the same inputs....
But this does not seem to be the case. I was looking for the effects of changing a P variable (Fsed_frp). When I made the change the first simulation after the change I get one answer (at least one set of plots). Dissolved phosphorus gradually increases until overturn And then when I run it again with no changes, I get different answers. Very different dissolved oxygen and almost no dissolved phosphorus
Are there any random number generators in the code that could lead to this?

Lake[].Epsilon is zero on day 1

Viscos = Lake[Outflow_LayerNum].Epsilon * 20.0;

Lake[Outflow_LayerNum].Epsilon is initialized to 0 for use in the outflow calculations and then set within deep_mixing in the subdaily loop. The outflow calculations in all subsequent days use the value updated by the subdaily loop (so not an issue for a multi-day run?). However, this means that a daily "hot start" always has a value of 0 for Epsilon. We need to move the code that sets Epsilon into the model initialization step. I think we should create a function in deep_mix.c called set_epsilon that can be called within glm_init.c. Thoughts @matthipsey?

GLM 2.4 NS issue

Line 139-144

this was added to allow volume to get updated after the water level dropped below 10cm (MphInc); the height would keep dropping in glm_surface, but the one_layer routine wouldn’t be called to update the volume - therefore below 0.1m the volume held constant but height would go negative)

with this code NS (active layer number) hits only 1, even for 40m deep lake

Odd issue with coarse hyposography and the monotonicity test

I have a deep and large lake that have hypsographic values every 50cm. The area estimates are kind of coarse.

If I try to simulate this lake

   H = 251.3, 251.5, 252, 252.5, 253, 253.5, 254, 254.5, 255, 255.5, 256, 256.5, 257, 257.5, 258, 258.5, 259, 259.5, 260, 260.5, 261, 261.5, 262, 262.5, 263, 263.5, 264, 264.5, 265, 265.5, 266, 266.5, 267, 267.5, 268, 268.5, 269, 269.5, 270, 270.5, 271, 271.5, 272, 272.5, 273, 273.5, 274, 274.5, 275, 275.5, 276, 276.5, 277, 277.5, 278, 278.5, 279, 279.5, 280, 280.5, 281, 281.5, 282, 282.5, 283, 283.5, 284, 284.5, 285, 285.5, 286, 286.5, 287, 287.5, 288, 288.5, 289, 289.5, 290, 290.5, 291, 291.5, 292, 292.5, 293, 293.5, 294, 294.5, 295, 295.5, 296, 296.5, 297, 297.5, 298, 298.5, 299, 299.5, 300, 300.5, 301, 301.5, 302, 302.5, 303, 303.5, 304, 304.5, 305, 305.5, 306, 306.5, 307, 307.5, 308, 308.5, 309, 309.5, 310, 310.5, 311, 311.5, 312, 312.5, 313, 313.5, 314, 314.5, 315, 315.5, 316, 316.5, 317, 317.5, 318, 318.5, 319, 319.5, 320
   A = 4100, 14000, 37500, 61100, 83300, 105100, 127400, 149900, 171700, 194600, 217200, 240600, 267000, 294200, 322800, 351300, 381200, 412300, 446300, 480900, 516700, 552500, 590100, 629700, 671600, 715800, 766800, 824100, 889400, 961100, 1034200, 1111000, 1193100, 1269000, 1350800, 1431100, 1511800, 1593900, 1680100, 1773000, 1872300, 1973900, 2068400, 2164100, 2267200, 2375400, 2482900, 2598100, 2715400, 2847200, 2980300, 3141800, 3328400, 3554400, 3786900, 4024800, 4277100, 4538200, 4809200, 5098900, 5357400, 5614800, 5893400, 6188800, 6489400, 6818700, 7170900, 7491400, 7842600, 8222900, 8624900, 9055600, 9488400, 9928000, 10385200, 10869000, 11403200, 11985300, 12617200, 13274700, 13987400, 14742100, 15555900, 16405400, 17269800, 18181200, 19200100, 20288200, 21484600, 22798100, 24208200, 25853700, 27603600, 29474500, 31532100, 33948300, 36583500, 39635300, 43069200, 47034400, 51795000, 57303900, 63516900, 70308000, 77986700, 86774600, 96623200, 107321600, 118607200, 130883100, 144078900, 158401500, 173312000, 189301000, 208232000, 264787800, 431787600, 692638500, 872828600, 1016739100, 1172325700, 1291412100, 1399214700, 1506086100, 1615388200, 1730487000, 1834802200, 1942460100, 2062777400, 2205971600, 2345214000, 2475709200, 2605795600, 2738665600, 2868720400, 2995967100, 3130450900, 3283841600, 3598800100
/

I get H and A in morphometry must be monotonically increasing A[128] = 2062777400.000000; A[129] = -2088995696.000000; H[128] = 315.000000; H[129] = 315.500000
which is odd, because I definitely don't have any negative values in the areas (A)

This took some noodling, but if I add something that would cause these to not be ints, the model runs fine. So I replaced A[128] with 2062777400.01, and things work as usual. This was a strange one to run into.

Flexible time of day to initiate simulations

I see that there are modifications to the code to allow the user to specify the time of day that simulations are initialized. This is super helpful for data assimilation, especially when assimilating observations done in the middle of the day.

I have tried to use the latest version with start = 2018-07-12 12:00 and test by examining the output solar radiation values (with sub-daily output). My tests seem to suggest that the updates are not working because the solar radiation always starts with zero values before ramping up to mid-day values regardless of the hour specified in the start time. Is the starting hour capacity fully functional, is there a potential issue, or am I not implementing it correctly?

Thanks for any insight!

Getting more done in GitHub with ZenHub

Hola! @matthipsey has created a ZenHub account for the AquaticEcoDynamics organization. ZenHub is the only project management tool integrated natively in GitHub – created specifically for fast-moving, software-driven teams.


How do I use ZenHub?

To get set up with ZenHub, all you have to do is download the browser extension and log in with your GitHub account. Once you do, you’ll get access to ZenHub’s complete feature-set immediately.

What can ZenHub do?

ZenHub adds a series of enhancements directly inside the GitHub UI:

  • Real-time, customizable task boards for GitHub issues;
  • Multi-Repository burndown charts, estimates, and velocity tracking based on GitHub Milestones;
  • Personal to-do lists and task prioritization;
  • Time-saving shortcuts – like a quick repo switcher, a “Move issue” button, and much more.

Add ZenHub to GitHub

Still curious? See more ZenHub features or read user reviews. This issue was written by your friendly ZenHub bot, posted by request from @matthipsey.

ZenHub Board

Compiling GLM with GCC

Is it possible to compile GLM with gcc instead of gfortran-8? If so, do you have any documentation for that?

Thanks,
Vahid

inflow_varnum

From Peisheng: issue was that though we set inflow number to be 0, if the inflow_varnum and the inflow_vars do not match, the GLM would still stop without giving a warning.

New zone structure pointer problem

theZones(1)%zheight=14; theZones(2)%zheight=50; theZones(3)%zheight=80;

Casper - Been doing some tests with zones and benthic_mode=2 for current version. The new zone-specific sediment layers is giving me a problem with the pointer, referenced at the above line. It seems the first entry (i.e. the first zone) is referenced properly, but zones 2 and 3 have 0 and random, respectively. So in this check I have hard-coded a value to make it work, but can you check the pointer operation here?

Additional hot restart variables

There are a set of variables in the glm_mixer.c function that are initialized within the function but are variables that represent the past state of the system. For a hot restart these variables need to be provided by the user. Each of the variables needs to be added to the nml and the output.nc files. I have done this using the &init_profiles section in the nml and can submit a pull request, but before I do that I was wondering if it is worth discussing whether we want to add a new section to the nml for these sorts of variables that only someone doing a hot restart would use.

The variables that I have identified are: DepMX, PrevThick, gPrimeTwoLayer, Energy_AvailableMix, Mass_Epi, OldSlope, Time_end_shear, Time_start_shear, Time_count_end_shear, Time_count_sim, Half_Seiche_Period, Thermocline_Height, FO, FSUM, u_f, u0, u_avg

Some of these variable might not need to be initialized but I included all possible so that they can be removed as necessary.

Capacity to initialize ice and snow cover

For data assimilation in lakes that freeze, the ability to specify initial ice cover is required. Is this feature planned or has it been attempted in the past but issues were discovered? Is there any reason to think that this isn't as simple as adding the snow, white ice, and blue ice dz variables to the glm.nml, updating code glm_init.c function with the new inputs, and having that code also trigger the ice variable to equal TRUE?

Missing Dependencies for GLM 3.0 on Ubuntu

Hi.

I tried to install GLM 3.0 on Ubuntu 16.04 and 18.04 and the pre-built package has several missing dependencies. I couldn't find required Debian packages and had to fix that issue by copying the required static libraries from another machine. Also, it seems GLibC 2.27 is required which is not available on Ubuntu 16.04 at the moment. So I installed that from Ubuntu 18.04 repositories on Ubuntu 16.04.

Here is the list of missing static libraries in my case:

libgfortran.so.5.0.0
libhdf5_serial.so.100
libhdf5_serial_hl.so.100
libhdf5_serial_hl.so.100.0.0
libnetcdf.so.13```

Anyhow, the setup works fine now. :-)

Thanks,
Vahid

add dynamic soil/sediment temp

Casper - aed_util now has:

InitialTemp (spinup temp profiles)
SoilTemp (increment soil profile)

Can you call from glm_surface.c?

(we will need to make an option and then call from here somewhere:

} else if(benthic_mode == 2){

)

Changes in phytoplankton dynamics from v3.1.0a1 to v3.1.1?

I updated my lake models of Lake Mendota to the most recent GLM-AED GitHub versions, but I am getting now different results for water quality variables while running it on the exact same model setup.

I did compile all models using gfortran and Homebrew under macOS Catalna/Big Sur. For the recent versions, GLM was coupled with libaed-water.git instead of libaed2.git.

I extracted all results directly from the NCDF and averaged them over the first 10 m from the water surface (using the z variable and finding the closest value to 10 m).

I expected results to differ a bit (like for temperature), but especially cyanobacteria biomass is completely off between the versions. Were there some significant source code changes for aed_phytoplankton.F90, or changes in parameterizations?

cyanobiomass_differences
oxygen_differences
wtr_differences

Build for Ubuntu

Hi;

I was wondering if you have the instructions to build GLM for Ubuntu.

Thanks in advance. :-)

Bests,
Vahid

Different predictions between Mac and Unix

We have found that a simulation that works well on a Mac gives a completely different answer on Ubuntu (latest commit with gfortran compilers 8.3). The difference is large where the Ubuntu simulation completely mixes the lake within a day (a lake that is strongly stratified at initialization). I have attached the NML, driver, and outputs from the Mac and Unix simulation. @casper-boon would it be possible to check if you get the same issues on your Ubuntu machine? Maybe it is an issue with how the NML is set up but again it works fine on the Mac.
unix_mac_test.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.