Skip to content
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

Add setup function for zsini file #65

Open
couasnonanais opened this issue Oct 28, 2022 · 6 comments
Open

Add setup function for zsini file #65

couasnonanais opened this issue Oct 28, 2022 · 6 comments
Labels
Enhancement New feature or request

Comments

@couasnonanais
Copy link
Contributor

It might be a good idea to add a setup_ function to also generate the zsini file in cases where a constant water level is not "appropriate".
I know a few users that have run into this request.

@couasnonanais couasnonanais added the Enhancement New feature or request label Oct 28, 2022
@DirkEilander
Copy link
Contributor

DirkEilander commented Oct 31, 2022

Thanks for this suggestion. Based on what data could we create this ini file? Note that we can already dynamically create such file by setting restartfile = sfincs.restart in the sfincs.inp file.

@couasnonanais
Copy link
Contributor Author

Indeed, that could be one argument of this function in case where a sfincs.restart file exist. Otherwise, it could be a combination of a mask (like a water mask or river mask or both) that indicates where the initial water elevation is higher and the additional water depth. This would be, for example, useful in very steep catchment so that the run doesn't start "dry".

@hcwinsemius
Copy link
Collaborator

Perhaps a scaled factor of the topographic index could work. Then you ensure that areas with large upstream areas and/or low slopes get a thicker layer of water than small upstream areas with large slopes.

@Leynse
Copy link
Collaborator

Leynse commented May 23, 2024

Could to something like this in a setup_ function:

AD365 = xr.open_dataarray(r'0365AD_Shaw_2008_initial_waterlevel.tif')
AD365 = AD365.raster.mask_nodata(fill_value=0)
AD365 = AD365.raster.reproject_like(sf.mask)

sname = "zsini"
AD365.attrs.update(**sf._ATTRS.get(sname, {}))

sf.set_states(AD365, name=sname)

And have some options like the ones you suggest in earlier comments

@nmertzanis
Copy link

@DirkEilander I believe the restartfile is not currently working. There is no code to actually parse the file even if it is set. Moreover, manually setting the zsini values to be variable over the map causes some bugs which I believe are urgent to address. After all, without the ability to restart from a previous state the possible uses are limited.

@couasnonanais
Copy link
Contributor Author

Hi @nmertzanis,

I am not sure whether your post applies to this issue. Are you using hydromt-sfincs to update a model? After reading your message, it seems more like a problem in SFINCS itself? In that case I would put an issue on the SFINCS repo.
You can find more information on how to use of a restart file here: https://sfincs.readthedocs.io/en/latest/input.html#restart-file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants