-
Notifications
You must be signed in to change notification settings - Fork 5
Description
I have noticed some issues regarding the 2 dimensional parameters displaying default values in the Shared when viewing it in Parameters GUI. There 2 dimensional parameters have one dimension for HRU and the other dimension for layer or fixed value of 2. These issues will be demonstrated below using prj files and screen shots.
- From the prj file Fortress Mountain Basin test_2013-21_modified_22Mar22a.prj, can be found here
Fortress Mountain Basin test_2013-21_modified_22Mar22a.zip
When opening this prj file in current CRHMcode GUI and opening the Parameters GUI, default values were displayed for both parameters obs_elev and soil_withdrawal in Shared in the Parameters GUI, ie. 0 is default for obs_elev and 3 is default for soil_withdrawal. See screen shot here:

However, when opening this prj file in TextPad or other text editor, both parameters obs_elev and soil_withdrawal have their correct values, see screen shots below in the highlighted:


I think the issue is in the CRHMmain.cpp file used by current CRHMcode: https://github.com/srlabUsask/crhmcode/blob/master/crhmcode/src/core/CRHMmain.cpp
On line 609, the code is still old code, roughly on 6 Feb 2019 (ie. source code CRHM_020619). I noticed this issue back in 2018 and worked on this with Tom in May 2019, and Tom put some change to fix this. From CRHMmain.cpp file in Borland source code: https://github.com/srlabUsask/crhmcode/blob/master/borland_source/CRHMmain.cpp
On line 2736 to 2738, the change Tom put on 15 May 2019 seemed to fix this. I will have the following screen shots to show that for Borland CRHM.
For the same prj file, I opened it in Borland CRHM and its Parameters GUI, both parameters obs_elev and soil_withdrawal were displayed correct values in Shared in Parameters GUI, see screen shots:


- On the other hand, current CRHMcode seems to display other 2 dimensional parameters. I used the prj file WCRB_currentClim_currentVeg_flow - Copy.prj for this demonstration.
WCRB_currentClim_currentVeg_flow - Copy.zip
Screen shots below show that when opening this prj file in CRHMcode, both depths and por parameters have 20 layers and 4 HRUs, and their values are correctly displayed in Shared in Parameters GUI compared to them in highlighted when opening this prj file in TextPad:



In contrast, when opening this prj file in Borland CRHM, default values were displayed for both depths and por parameters in Shared in Parameters GUI:


This suggests that the change Tom put in CRHMmain.cpp as mentioned above did not handle this case.
- To further examine this issue, I used the prj file ElbowAtYYC_test_mod22Jul2020_with_WRF4km_obs_with_sub_WBvar_estimate_macros.prj
ElbowAtYYC_test_mod22Jul2020_with_WRF4km_obs_with_sub_WBvar_estimate_macros.zip
This is the prj file that I set parameters values outside Borland CRHM GUI and saved outside Borland CRHM using other program, thus there is no parameter listed under Shared.
When opening ElbowAtYYC_test_mod22Jul2020_with_WRF4km_obs_with_sub_WBvar_estimate_macros.prj in Borland CRHM, the 2 dimensional parameters such as depths, por, soil_withdrawal displayed correct values in Shared:



Then, I saved ElbowAtYYC_test_mod22Jul2020_with_WRF4km_obs_with_sub_WBvar_estimate_macros.prj in Borland CRHM and saved as ElbowAtYYC_test_mod22Jul2020_with_WRF4km_obs_with_sub_WBvar_estimate_macros_BorlandCRHMSaved.prj
ElbowAtYYC_test_mod22Jul2020_with_WRF4km_obs_with_sub_WBvar_estimate_macros_BorlandCRHMSaved.zip
I opened ElbowAtYYC_test_mod22Jul2020_with_WRF4km_obs_with_sub_WBvar_estimate_macros_BorlandCRHMSaved.prj file in Borland CRHM and its Parameters GUI, then default values were displayed for these 2 dimensional parameters such as depths, por, soil_withdrawal:



However, when opening ElbowAtYYC_test_mod22Jul2020_with_WRF4km_obs_with_sub_WBvar_estimate_macros_BorlandCRHMSaved.prj file in TextPad, the correct values are shown for these 2 dimensional parameters such as depths, por, soil_withdrawal:



- I also did the same step 3 in CRHMcode, I used the prj file ElbowAtYYC_test_mod22Jul2020_with_WRF4km_obs_with_sub_WBvar_estimate_macros.prj, when it in CRHMcode Parameters GUI, the 2 dimensional parameters such as depths, por, soil_withdrawal displayed correct values in Shared:

Then, I saved ElbowAtYYC_test_mod22Jul2020_with_WRF4km_obs_with_sub_WBvar_estimate_macros.prj in CRHMcode and saved as ElbowAtYYC_test_mod22Jul2020_with_WRF4km_obs_with_sub_WBvar_estimate_macros_CRHMcodeSaved.prj
ElbowAtYYC_test_mod22Jul2020_with_WRF4km_obs_with_sub_WBvar_estimate_macros_CRHMcodeSaved.zip
I opened ElbowAtYYC_test_mod22Jul2020_with_WRF4km_obs_with_sub_WBvar_estimate_macros_CRHMcodeSaved.prj file in CRHMcode and its Parameters GUI, then default values were displayed for these 2 dimensional parameters such as depths, por, soil_withdrawal:

However, when opening ElbowAtYYC_test_mod22Jul2020_with_WRF4km_obs_with_sub_WBvar_estimate_macros_CRHMcodeSaved.prj file in TextPad, the correct values are shown for these 2 dimensional parameters such as depths, por, soil_withdrawal:



I think these issues are linked to code in CRHMmain.cpp file to handle displaying 2 dimensional parameters from Group prj file in the Shared in Parameters GUI, and additional issues are displaying 2 dimensional parameters from Group prj file in the Shared in Parameters GUI either with or without saving prj file.
There needs some additional code to handle above exceptions in current CRHMmain.cpp code for both Borland CRHM and CRHMcode.