OpenCDSS / cdss-app-statedmi-main

StateDMI main application, tests, and documentation
GNU General Public License v3.0
1 stars 0 forks source link

Setting IPY from water rights has command editor problem #110

Closed smalers closed 2 years ago

smalers commented 2 years ago

From Brenna at WWG:

I have finished testing StateDMI version 5.1.3 . The updated version is working much better. I was able to do a 1 to 1 comparison between the WER I developed by hand and the WER that StateDMI created. I also re-ran the CDS and IPY to ensure that they were working fine.

Currently, we set the GW Max pumping to 9999 in the IPY:

image

Now that we have the WER working, I attempted set the GW Max pumping by reading it from the WER file.

I added the following language to the IPY:

image

I then attempted to add the SetIrrigationPracticeTSPumpingMaxUsingWellRights() command. However, I am not able to add this command and no matter what parameters I fill in or don't fill in, I get the below error box.

image

Other than this error, everything else seems to be working.

smalers commented 2 years ago

I fixed the command editor. The DataType parameter is no longer used. I also updated log4j to 2.17.1. I'll leave open until Brenna agrees that it is OK.

smalers commented 2 years ago

Brenna had he following to say:

Thanks for jumping on this issue. I reran the IPY and the IPY ran all the way through now, with no issues. I then did some spot checks in the IPY to make sure the correct GW pumping max was getting pulled in from the WER. I found an issue with the "I" structures, where the GW pumping max is being set to 0 when it shouldn't be.

For example, in the WER File Structure 1700554I is associated with 43 well rights:

image

However, in the IPY, it shows 0 for the GW pumping Max for all years for structure 1700554I:

image

Let me know if you have any questions about this issue.

smalers commented 2 years ago

The command that Brenna is using is specifying ID="*" so all identifiers should be getting processed. And, the well rights have years inside and outside the modeling period so something should be used other than zero. I need to get some sample IPY and WER files.

smalers commented 2 years ago

I recreated the problem.  The wer file that was sent has a problem on line 1056 for

6700614I.003LAMAR FARMS WELL NO  2

There is a big number on the right 128301.75 that causes an error in my simple test reading the file because the column width overflows.  Running the following command in TSTool or StateDMI you'll see the "yeild_apex" is that large number.

ReadTableFromDataStore(DataStore="HydroBase",Sql="select * from vw_CDSS_Wells where wdid = 6705349",TableID="permits")

I removed the line for now to read the file in my simple test. StateMod ignores the columns on the right.

smalers commented 2 years ago

This line is definitely the problem. The units for yield_apex are initially GPM and the large number is overflowing the column width. I'm looking at the formatting of these alternate columns.

smalers commented 2 years ago

I updated the code that writes well rights to write APEXGPM in 8.0 format, which will fix the overflow. I also updated the code that reads rights to better handle format problems and give a warning about the specific line. This is released as StateDMI 5.1.5. Wait for feedback to close this issue.

smalers commented 2 years ago

From Brenna:

Thanks Steve. I went through and re-ran the IPY and WER using the new StateDMI 5.1.5. I found a couple of issues relating to the GW Pumping Max being set in the IPY using the WER.

  1. In the IPY the GW pumping Max is not getting set for "I" structures. For instance, structure 6700607I has many wells tied to it in the WER: image

  2. However, no GW pumping max is reported in the IPY in any years: image

All the other "I" structures have the same issue.

  1. I am not sure what is going on here, but there is a large difference between the pumping max reported in the IPY and what I calculate the pumping max to be based on the decreed cfs in the WER for only two structures: 1700551 and 1700620. I compared the WER and IPY for 2018. I also verified that I used the same hydrobase for each file. image
smalers commented 2 years ago

Not sure what happened. I will rerun and track down.

smalers commented 2 years ago

Run the StateDMI 5.1.5 from the download page on simple test

I confirmed that the installer that I published is the one that I think it is. I downloaded StateDMI 5.1.5 from the OpenCDSS website and installed. I am running with HydroBase_CO_20200720, which is what I understand ArkDSS is using, although the test I am running is a simple command file to process files:

My simple command file is as follows and tests updating the existing IPY with WER.

# 04/17/2020 - bsm
#
# 10/21/2021 - updated to account for HI Model acreage changes
# StateDMI command file to develop an IPY File for ArkDSS
# Ark2020.ipy
#
# Step 1 - Set output period and read CU locations from structure file
SetOutputPeriod(OutputStart="1950",OutputEnd="2018")
#
# Step 6 - Read well rights file and Set Max pumping
# ReadWellRightsFromStateMod(InputFile="..\StateMod\Ark2020_StateMod.wer")
#
#
StartLog(LogFile="Ark2020_IPY_Steve.STATEDMI.log")
ReadCULocationsFromStateCU(InputFile="Ark2020_CROP.str")
ReadIrrigationPracticeTSFromStateCU(InputFile="Ark2020.ipy")
ReadWellRightsFromStateMod(InputFile="Ark2020_StateCU.wer")
SetDebugLevel(LogFileLevel=10)
SetIrrigationPracticeTSPumpingMaxUsingWellRights(ID="*")
SetDebugLevel(ScreenLevel=0,LogFileLevel=0)
WriteIrrigationPracticeTSToStateCU(OutputFile="Ark2020-updated.ipy")

When I run this and compare the original ipy output from Brenna with the new, I see differences like the following (old first with zero or lower pumping and new last with higher pumping). At least some of the I structures are having pumping filled.

> 2018 1700540I      0.75  0.65  0.85  2654.9     0.0   114.1     0.0        7235  2  2769.0  2654.9   114.1
83337,83341c83185,83189
< 2018 1700542I      0.71  0.65  0.85 13911.0   895.0  1562.6   227.7           0  2 16596.3 14806.0  1790.3
< 2018 1700551       0.80  0.65  0.85     0.0     0.0   104.0   448.2         600  2   552.3     0.0   552.3
< 2018 1700552I      1.00  0.65  0.97  6961.8  1829.3  2883.1  1186.8           0  2 12861.0  8791.2  4069.8
< 2018 1700553I      0.63  0.65  0.85 42236.9 16273.1  8055.2  2000.9           0  2 68566.1 58509.9 10056.1
< 2018 1700554I      0.76  0.65  0.87  8630.1   701.9   760.0   533.2           0  2 10625.2  9332.0  1293.2
---
> 2018 1700542I      0.71  0.65  0.85 13911.0   895.0  1562.6   227.7        4315  2 16596.3 14806.0  1790.3
> 2018 1700551       0.80  0.65  0.85     0.0     0.0   104.0   448.2        3053  2   552.2     0.0   552.2
> 2018 1700552I      1.00  0.65  0.97  6961.8  1829.3  2883.1  1186.8       10575  2 12861.0  8791.1  4069.9
> 2018 1700553I      0.63  0.65  0.85 42236.9 16273.1  8055.2  2000.9       32059  2 68566.1 58510.0 10056.1
> 2018 1700554I      0.76  0.65  0.87  8630.1   701.9   760.0   533.2        2979  2 10625.2  9332.0  1293.2
83343,83344c83191,83192
< 2018 1700557       0.82  0.65  0.85  1006.7   130.3   242.9     0.0         694  2  1380.0  1137.1   242.9
< 2018 1700558I      1.00  0.65  1.00   254.1    47.3     0.0     0.0           0  2   301.4   301.4     0.0

There are some warnings in the log file:

Warning[2]<19,1>(SetIrrigationPracticeTSPumpingMaxUsingWellRights_Command.runCommand): Could not find CU location matching "1000735D" to determine water supply type.  Not filling.
Warning[2]<19,2>(SetIrrigationPracticeTSPumpingMaxUsingWellRights_Command.runCommand): Could not find CU location matching "1300525D" to determine water supply type.  Not filling.
Warning[2]<19,3>(SetIrrigationPracticeTSPumpingMaxUsingWellRights_Command.runCommand): Could not find CU location matching "1300761D" to determine water supply type.  Not filling.
Warning[2]<19,4>(SetIrrigationPracticeTSPumpingMaxUsingWellRights_Command.runCommand): Could not find CU location matching "1400591" to determine water supply type.  Not filling.
Warning[2]<19,5>(SetIrrigationPracticeTSPumpingMaxUsingWellRights_Command.runCommand): Could not find CU location matching "1400654D" to determine water supply type.  Not filling.
Warning[2]<19,6>(SetIrrigationPracticeTSPumpingMaxUsingWellRights_Command.runCommand): Could not find CU location matching "1500522I" to determine water supply type.  Not filling.
Warning[2]<19,7>(SetIrrigationPracticeTSPumpingMaxUsingWellRights_Command.runCommand): Could not find CU location matching "1900516" to determine water supply type.  Not filling.
Warning[2]<19,8>(SetIrrigationPracticeTSPumpingMaxUsingWellRights_Command.runCommand): Could not find CU location matching "1900540" to determine water supply type.  Not filling.
Warning[2]<19,9>(SetIrrigationPracticeTSPumpingMaxUsingWellRights_Command.runCommand): Could not find CU location matching "6700607I" to determine water supply type.  Not filling.
Warning[2]<19,10>(SetIrrigationPracticeTSPumpingMaxUsingWellRights_Command.runCommand): Could not find CU location matching "6700616" to determine water supply type.  Not filling.
Warning[2]<19,11>(SetIrrigationPracticeTSPumpingMaxUsingWellRights_Command.runCommand): Could not find CU location matching "7900541D" to determine water supply type.  Not filling.

A check is made to only set the pumping for GW-only locations. Such checks were typically added because not doing so led to other problems. The Ark2020_CROP.str file that I have does not include 6700607I. Please advise on what the requirement is for software so I know whether to change.

Need to run complete test?

Maybe my simple test is not sufficient. I tried to run Brenna's recently provided command file, but I don't have all the files. I need at least the following based on StateDMI command file warnings:

Checking or other I structures with zero pumping

I looked at the IPY file 2018 for I structure and found the following with zero pumping: 7900752I. This has a message in the log file:

Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting irrigation practice pumping max time series for "7900752I" by using all well rights associated with location.^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): No time series of well water rights available for location "7900752I".  Setting pumping to zero for 1950 to 2018^

Indeed, when I look at the WER file there are no water rights.

Checking 1700551 and 1700620

When I look at the log file I see the following, and note that the second structure has zero water rights in the early years.

Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting irrigation practice pumping max time series for "1700551" by using all well rights associated with location.^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700551 1950 pumping max to 2270.16^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700551 1951 pumping max to 2270.16^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700551 1952 pumping max to 2270.16^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700551 1953 pumping max to 2636.63^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700551 1954 pumping max to 2636.63^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700551 1955 pumping max to 2636.63^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700551 1956 pumping max to 2636.63^M
...ommitted...

Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700620 1950 pumping max to 0.00^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700620 1951 pumping max to 0.00^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700620 1952 pumping max to 0.00^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700620 1953 pumping max to 0.00^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700620 1954 pumping max to 0.00^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700620 1955 pumping max to 0.00^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700620 1956 pumping max to 0.00^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700620 1957 pumping max to 0.00^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700620 1958 pumping max to 0.00^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700620 1959 pumping max to 0.00^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700620 1960 pumping max to 0.00^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700620 1961 pumping max to 0.00^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700620 1962 pumping max to 0.00^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700620 1963 pumping max to 0.00^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700620 1964 pumping max to 0.00^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700620 1965 pumping max to 68.25^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700620 1966 pumping max to 68.25^M
Status[2](SetIrrigationPracticeTSPumpingMaxUsingWellRights.setIrrigationPracticeTSUsingRights): Setting 1700620 1967 pumping max to 68.25^M

The WER file has the following for the first structure:

1700551.001 MOTHERSELL WELL 3859-F  1700551          23892.00000    2.50    1915 -999                                  Well     1706004              WDID     1706004  1915-06-01 23892.00000 IRR                            0003859  1958-09-20                                   0.00     0.00                    1122.08
1700551.002 KING WELL NO  8         1700551          20187.00000    1.33    1905 -999                                  Well     1705568              WDID     1705568  1905-04-09 20187.00000 IRRSTK                         0437083  1998-09-26                                   0.00     0.00                     596.95
1700551.003 MOTHERSELL WELL 1067-R  1700551          24258.00000    6.50    1916 -999                                  Well     1706002              WDID     1706002  1916-06-01 24258.00000 IRR                            0397330  1995-10-25                                   0.00     0.00                    2917.41
1700551.004 KING WELL NO  3         1700551          20187.00000    2.34    1905 -999                                  Well     1705562              WDID     1705562  1905-04-09 20187.00000 IRRSTK                         9076411  1954-04-01                                   0.00     0.00                    1050.27
1700551.005 KING WELL NO  2         1700551          24085.00000    2.23    1915 -999                                  Well     1705563              WDID     1705563  1915-12-11 24085.00000 IRRSTK                         0455986  2000-04-26                                   0.00     0.00                    1000.90
1700551.006 KING WELL NO  1         1700551          24085.00000    2.23    1915 -999                                  Well     1705564              WDID     1705564  1915-12-11 24085.00000 IRRSTK                         0441923  1999-04-15                                   0.00     0.00                    1000.90
1700551.007 KING WELL NO  5         1700551          20187.00000    2.99    1905 -999                                  Well     1705565              WDID     1705565  1905-04-09 20187.00000 IRRSTK                         9076504  1954-06-01                                   0.00     0.00                    1343.99
1700551.008 KING WELL NO  6         1700551          20187.00000    1.11    1905 -999                                  Well     1705566              WDID     1705566  1905-04-09 20187.00000 IRRSTK                                                                               0.00     0.00                     498.20
1700551.009 KING WELL NO  7         1700551          20187.00000    4.33    1905 -999                                  Well     1705567              WDID     1705567  1905-04-09 20187.00000 IRRSTK                         9076407  1965-02-02                                   0.00     0.00                    1943.45
1700551.010 KING WELL NO  9         1700551          20187.00000    2.01    1905 -999                                  Well     1705569              WDID     1705569  1905-04-09 20187.00000 IRRSTK                         9076502  1944-06-01                                   0.00     0.00                     902.15
1700551.011 KING WELL NO 11         1700551          37722.00000    1.78    1953 -999                                  Well     1705570              WDID     1705570  1953-04-12 37722.00000 IRRSTK                         9076330  1953-04-12                                   0.00     0.00                     798.92
1700551.012 KING WELL NO 10         1700551          20187.00000    0.73    1905 -999                                  Well     1705580              WDID     1705580  1905-04-09 20187.00000 IRRSTK                         9076503  1949-07-01                                   0.00     0.00                     327.65
1700551.013 KING WELL NO 15         1700551          37712.00000    1.23    1953 -999                                  Well     1705574              WDID     1705574  1953-04-02 37712.00000 IRRSTK                         9091014  1953-04-02                                   0.00     0.00                     552.06
1700551.014 KING WELL NO 16         1700551          26662.00000    1.17    1922 -999                                  Well     1705575              WDID     1705575  1922-12-31 26662.00000 IRRSTK                         9091015  1921-11-30                                   0.00     0.00                     525.13
1700551.015 KING WELL NO  4         1700551          20187.00000    0.76    1905 -999                                  Well     1705559              WDID     1705559  1905-04-09 20187.00000 IRRSTK                         0428961  1998-05-15                                   0.00     0.00                     341.11
1700551.016 KING WELL NO  4 (2)     1700551          20187.00000    2.23    1905 -999                                  Well     1705560              WDID     1705560  1905-04-09 20187.00000 IRRSTK                         9076409  1949-05-01                                   0.00     0.00                    1000.90
1700551.017 KING WELL NO  4 A       1700551          20187.00000    2.45    1905 -999                                  Well     1705561              WDID     1705561  1905-04-09 20187.00000 IRRSTK                         9076410  1952-06-01                                   0.00     0.00                    1099.64
1700551.018 KING WELL NO 17         1700551          41339.00000    1.05    1963 -999                                  Well     1705576              WDID     1705576  1963-03-08 41339.00000 IRRSTK                         0473230  2001-10-25                                   0.00     0.00                     471.27
1700551.019 KING WELL NO 18         1700551          39085.00000    2.38    1957 -999                                  Well     1705577              WDID     1705577  1957-01-04 39085.00000 IRRSTK                         9076356  1964-01-31                                   0.00     0.00                    1068.22
1700551.020 KING WELL NO 19         1700551          39085.00000    3.34    1957 -999                                  Well     1705578              WDID     1705578  1957-01-04 39085.00000 IRRSTK                         9076327  1957-01-04                                   0.00     0.00                    1499.10
1700551.021 KING WELL NO 13         1700551          28123.00000    2.01    1926 -999                                  Well     1705571              WDID     1705571  1926-12-31 28123.00000 IRRSTK                         9076328  1947-10-23                                   0.00     0.00                     902.15
1700551.022 KING WELL NO 12         1700551          37720.00000    1.66    1953 -999                                  Well     1705572              WDID     1705572  1953-04-10 37720.00000 IRRSTK                         9076329  1953-04-10                                   0.00     0.00                     745.06
1700551.023 KING WELL NO 14         1700551          37716.00000    1.29    1953 -999                                  Well     1705573              WDID     1705573  1953-04-06 37716.00000 IRRSTK                         9076331  1953-04-06                                   0.00     0.00                     578.99

If I add the decrees I get 49.65 cfs, which when multiplied by 86400/43560 * 31 = 3053.

The original IPY file from Brenna has the following (600 AF/Month)

2018 1700551       0.80  0.65  0.85     0.0     0.0   104.0   448.2         600  2   552.3     0.0   552.3

The updated IPY from my test using well rights has the following (3053 AF/Month), which makes me wonder if Brenna's setup is correct.

2018 1700551       0.80  0.65  0.85     0.0     0.0   104.0   448.2        3053  2   552.2     0.0   552.2

I did not check the other structure.

Sorry, I don't see that there is a software problem but I can try running the full command file with all the inputs to check if I am provided those files.

smalers commented 2 years ago

I am closing this issue based on the following feedback from Brenna.


Thanks for the comments on GitHUB. I am on GitHUB, just not sure how to become a contributor. I determined that my IPY was reading a preliminary StateMod version of the WER file that I have been working on developing and not the final StateCU version, which it needed to be reading. Thanks for helping me figure that out. Anyways, after re-running using the correct file, StateDMI 5.1.5 seems to be working fine. I re-ran the cds, ipy, ddh, dds, ddr, wer, and wes and they all look good to go. Note that we focused on the Arkansas for the testing and did not test this new version of StateDMI in the Rio Grande.