-
Notifications
You must be signed in to change notification settings - Fork 1
Fix LISFLOOD Errors when no lakes or reservoirs in the domain. #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: seedfd_develop
Are you sure you want to change the base?
Fix LISFLOOD Errors when no lakes or reservoirs in the domain. #3
Conversation
Adding @corentincarton as a reviewer since this change relates to: ec-jrc#163 |
MaskMap = loadsetclone('MaskMap') # need to define mask map to use loadmap | ||
LakeSitesC = loadmap(sites_dict[lake_type]) | ||
LakeSitesC[LakeSitesC < 1] = 0 | ||
LakeSitesCC = np.compress(LakeSitesC > 0, LakeSitesC) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually there is a missing step to really evaluate if the lake/reservoir should be simulated:
LakeSitesC[IsChannel == 0] = 0
The "IsChannel" array can be retrieved as follows:
IsChannelPcr = boolean(loadmap('Channels', pcr=True))
IsChannel = np.bool8(compressArray(IsChannelPcr))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the code for the missing step @doc78!
I have added this to the lakes_present()
function.
I tested to make sure the check still behaves as expected for domains without lakes/reservoirs. I also did a test using a Channels map file set to all zeros to make sure that lakes/reservoir simulation is switched off in this case. This worked as expected (though the model failed, which I think is because the file I modified did not match with the rest of the input map files).
…part of the channel network.
When running LISFLOOD over the SEED-FD domains there are errors for the domains that do not contain lakes/reservoirs due to missing expected input files. This is only a problem for warm starts.
This change adds a check to
checkers.py
so that if there are no lakes or reservoirs present then the input file check will not run for lakes/reservoirs.The lisflood code already handles domains without lakes or reservoirs within the
hydrological_modules/lakes.py
andhydrological_modules/reservoir.py
scripts so this deals with switching off the options in the model settings. This extra check just deals with the errors that happen before this stage when running checks on input files for model restarts.The same logic that is used in
hydrological_modules/lakes.py
andhydrological_modules/reservoir.py
, for determining where a lake/reservoir is present, is used in this new change tocheckers.py
.Tests carried out: