Giter VIP home page Giter VIP logo

lgar-py's People

Contributors

taddyb avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lgar-py's Issues

Fix GIUH Routing to be similar to LGAR-C

What is the problem:

  • This code was built using the LGAR-C code published in May of 2023, the code has since been updated to fix a GIUH bug
  • dpLGAR needs to update the GIUH routing scheme to be up to date

Reproducibility:

  • None needed

Screenshots:

  • None needed

Validate dpLGAR using Streamflow

We have to do the following to tune parameters

  • Check the gradient chain
  • Toy with max ponded depth
  • Get streamflow data
  • Test percolation
  • See if params update
  • Train model

NoneType Blow up after 8000 timesteps

What is going on:

It looks like the layer homogeneity is causing a problem when inserting water. When trying this code with another basin, it was found that this bug occurs when the wetting_front_free_drainage, or the deepest front effected by wetting, is the last layer.

When this happens, the code dies since you can't calculate a d_theta. This code wasn't built for a homogeneous soil column.

The fix is super sneaky...
This implies there is some model blow up at this timestep

Error Traceback:

(hydroRouting) tkb5476@e5-ce-csr-s2002:/mnt/sdb1/tkb5476/dpLGAR$ python -m dpLGAR ++save_name=small_top
[2023-07-13 22:40:13,793][models.dpLGAR][INFO] - Top Soil_depth = 15.0
[2023-07-13 22:40:13,811][agents.DifferentiableLGAR][INFO] - Running epoch: 0
[2023-07-13 22:40:13,811][agents.DifferentiableLGAR][INFO] - -----Current Params-----
[2023-07-13 22:40:13,811][models.dpLGAR][INFO] - Alpha for soil 1: 0.0100
[2023-07-13 22:40:13,811][models.dpLGAR][INFO] - Alpha for soil 2: 0.0100
[2023-07-13 22:40:13,811][models.dpLGAR][INFO] - n for soil 1: 1.6600
[2023-07-13 22:40:13,811][models.dpLGAR][INFO] - n for soil 2: 1.6600
[2023-07-13 22:40:13,811][models.dpLGAR][INFO] - Ksat for soil 1: 0.7560
[2023-07-13 22:40:13,811][models.dpLGAR][INFO] - Ksat for soil 2: 0.7560
[2023-07-13 22:40:13,811][models.dpLGAR][INFO] - Max Ponded Depth: 0.0000
Epoch 1 Training:  96%|████████████████████████████████████████████████████████████████▏  | 8393/8760 [22:36<00:59,  6.19it/s]
Error executing job with overrides: ['++save_name=small_top']
Traceback (most recent call last):
  File "/mnt/sdb1/tkb5476/dpLGAR/dpLGAR/__main__.py", line 15, in main
    agent.run()
  File "/mnt/sdb1/tkb5476/dpLGAR/dpLGAR/agents/DifferentiableLGAR.py", line 90, in run
    self.train()
  File "/mnt/sdb1/tkb5476/dpLGAR/dpLGAR/agents/DifferentiableLGAR.py", line 106, in train
    self.train_one_epoch()
  File "/mnt/sdb1/tkb5476/dpLGAR/dpLGAR/agents/DifferentiableLGAR.py", line 125, in train_one_epoch
    runoff, percolation = self.model(i, x.squeeze())
  File "/home/tkb5476/anaconda3/envs/hydroRouting/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/mnt/sdb1/tkb5476/dpLGAR/dpLGAR/models/dpLGAR.py", line 266, in forward
    infiltration_sub, AET_sub = self.move_wetting_front(
  File "/mnt/sdb1/tkb5476/dpLGAR/dpLGAR/models/dpLGAR.py", line 380, in move_wetting_front
    self.top_layer.wetting_fronts_cross_layer_boundary()
  File "/mnt/sdb1/tkb5476/dpLGAR/dpLGAR/models/physics/layers/Layer.py", line 934, in wetting_fronts_cross_layer_boundary
    self.next_layer.wetting_fronts_cross_layer_boundary()
  File "/mnt/sdb1/tkb5476/dpLGAR/dpLGAR/models/physics/layers/Layer.py", line 927, in wetting_fronts_cross_layer_boundary
    ) = self.recalibrate(
  File "/mnt/sdb1/tkb5476/dpLGAR/dpLGAR/models/physics/layers/Layer.py", line 980, in recalibrate
    next_theta_r = self.next_layer.attributes[
AttributeError: 'NoneType' object has no attribute 'attributes'

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

Steps to reproduce:

  • Run dpLGAR from 01-01-23 to 12-31-23
  • error occurs on 12-17-01
  • for basin 01031500

Create dpLGAR from LGAR-py

TODO 6/23/23:

verify wetting_fronts_cross_layer_boundary() works
Make sure that the for loop in line 328 of Wetting front is correct
test lgar_fix_dry_over_wet_fronts()

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.