NOAA-OWP / LGAR-C

Lumped Arid/Semi-arid Model (LASAM) simulates infiltration and surface runoff (two important components of the hydrologic cycle) based on Layered Green-Ampt with redistribution (LGAR) model
Other
1 stars 4 forks source link

Ptl dev #1

Closed peterlafollette closed 1 year ago

peterlafollette commented 1 year ago

[Short description explaining the high-level reason for the pull request]

Additions

This is a pretty large PR. The text associated with the main commit is:

'large push. Updated lgar.cxx to have wetting front merging, layer boundary crossing, and lower boundary crossing to work the same way as in LGAR-Py. Slightly updated mass balance function in lgar.cxx to handle rare case that causes a crash. Updated soil functions to allow for a closed form calculation of G. Updated dZdt and f_p formulations such that they match those in the new version of LGAR-Py. Added option for closed form of G in config files. Fixed a typo in the unit test in the folder tests, the text test was corrected to tests. Added or updated results of the simulations: synth_1, synth_3, Phillipsburg, and Bushland. Updated readmes where appropriate.'

I also included the changes from the most recent push to master -- where an assertion was added to check if there is enough forcing data to reach the endtime.

-

Removals

I didn't remove anything. If it would help to clean up, I could remove old unit tests, config files, etc.

Changes

-

Testing

This version of LGAR has been thoroughly tested. I made sure that all 24 test cases pass in terms of their comparisons to LGAR-Py: synths 1, 2, and 3, and the USDA SCAN sites of Fort Assiniboine, Phillipsburg, and Bushland. That's 6, and the 24 total tests come from trying these with and without ponded head and with 3 layers or 1 layer. I also made sure the BMI unit test still passes, and I made sure that LGAR-C runs in ngen as well. The 'tests' folder now contains the results for synth_1, synth_3, Phillipsburg (with 2 cm of maximum ponded head), and Bushland. I made sure synth_1 and synth_3 run in the 'tests' folder in the same format that old tests were run in, and all of synth_1, synth_3, Bushland, and Phillipsburg run in the LGAR-C repo. Finally, I made sure that this branch's most recent commit works in these ways by doing a fresh clone of this branch into a different location in my machine, although making sure it runs on a different machine entirely is also probably desirable.

Screenshots

Notes

I notice that it says this PR can't automatically merge. Possibly that's because I was working on the commit to master before the most recent one; however I added the most recent changes from that push into the current code. The changes were small and basically included adding an assertion to check if the forcing data duration was long enough to cover the entire modeling period before the time indicated by endtime.

-

Todos

Checklist

Testing checklist

Target Environment support

Accessibility

Other

ajkhattak commented 1 year ago

@peterlafollette Update the description of the examples in the README.md file. You have three (real) examples, which example(s) do you want the user to try/run? I was trying to run config_lasam_Fort_Assiniboine.txt but got end_time is missing. Either update this example or delete the forcing and config files for this example.

ajkhattak commented 1 year ago

@peterlafollette I am getting different results for the Philipsburg site.

Standalone (no nextgen)


-------------------- Simulation Summary ---------------- ------------------------ Mass balance ------------------- Initial water in soil = 45.1158503564 cm Total precipitation = 99.0854000000 cm Total infiltration = 88.6235782151 cm Final water in soil = 45.8124751752 cm Surface ponded water = 0.0000000000 cm Surface runoff = 10.4618217849 cm GIUH runoff = 10.4618217849 cm Total percolation = 0.0000000000 cm Total AET = 87.9269533606 cm Total PET = 147.9532940266 cm Total discharge (Q) = 10.4618217849 cm Global balance = 3.569440e-08 cm Time = 5.646 sec

Standalone (in nextgen) using : ../cmake_build/ngen data/catchment_data.geojson cat-27 data/nexus_data.geojson nex-26 extern/LGAR-C/configs/realization_config_lasam.json


-------------------- Simulation Summary ---------------- ------------------------ Mass balance ------------------- Initial water in soil = 45.1158503564 cm Total precipitation = 99.0854000000 cm Total infiltration = 0.0000000000 cm Final water in soil = 38.1703943321 cm Surface ponded water = 2.0000000000 cm Surface runoff = 97.0854000000 cm GIUH runoff = 97.0854000000 cm Total percolation = 0.0000000000 cm Total AET = 6.9454560070 cm Total PET = 147.9532940266 cm Total discharge (Q) = 97.0854000000 cm Global balance = 1.726096e-08 cm

ajkhattak commented 1 year ago

the reason for inconsistent results was the use of different compilers and different versions. I tested the PR on UCS2 (with gcc8.5 compilers), and found pseudo and nextgen frameworks' results match. However, with gcc11 we still see some issues caused by uninitialized variables, which are identified and will be fixed in the post-PR work.