Skip to content

Question: Restart file interpretation? #30

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

Open
micahjohnson150 opened this issue Mar 17, 2025 · 2 comments
Open

Question: Restart file interpretation? #30

micahjohnson150 opened this issue Mar 17, 2025 · 2 comments
Assignees

Comments

@micahjohnson150
Copy link

Hi, I am curious if there are plans to add a restart file reader into pyPRMS? If not, do you all know of any resources to parse those files?

@pnorton-usgs
Copy link
Collaborator

At this time there are no plans to add a restart file reader into pyPRMS. There are a few challenges when working with the PRMS restart files:

  1. The files are written in a Fortran binary stream format; to read the files you have to know the datatypes of the variables/arrays that are contained in the file and the order they were written in.
  2. The content of the restart file depends on the version of PRMS that was used, the modules that were selected, and the setting of additional flags in the control file (along with additional logic in the PRMS code).

I have an example notebook that can read restart files where a particular set of modules were used (see below). This can give you an idea of how these files can be read. If you have restart files that are produced using different modules this code will either crash or produce garbled results. The notebook does require the control file and parameter file in addition to the restart file(s).

    et_module: potet_jh
    precip_module: climate_hru
    solrad_module: ddsolrad
    srunoff_module: srunoff_smidx
    strmflow_module: muskingum_mann
    temp_module: climate_hru
    transp_module: transp_tindex
    snow_module: snowcomp
    gw_module: gwflow

You can find this notebook at: https://gist.github.com/pnorton-usgs/e4ae95c78880dd438864efc890309416

@micahjohnson150
Copy link
Author

Whoa, that's an awesome resource! That is super helpful! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants