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

Ensuring nhot_write values are aligned with ihfskip values when configuring Schism hotstart writes with a validator #73

Open
benjaminleighton opened this issue Feb 25, 2024 · 0 comments
Labels
enhancement New feature or request schism
Milestone

Comments

@benjaminleighton
Copy link
Collaborator

benjaminleighton commented Feb 25, 2024

Add a pydantic validator to enforce the following rules for hotstarts

if nhot=1 indicating that a hotstart file is to be written, this could occur at multiple times during the simulation but typically occurs at the end. When the hotstart file is written is determined by nhot_write. nhot_write must be a multiple of ihfskip, for example if ihfskip is set to the end of the simulation then nhot_write would be equal to it because it doesn't make sense for it to be longer. If multiple hotfiles need to be written then ihfskip would also need to be a fraction of the total timestep to allow this.
notes:

ifhskip is the time when you'd like to write outputs, it must be a multiple of the time step aka dt and it is typically equal to the timestep * the number of timesteps in the simulation that is the final timestep of the simulation because normally only one output is written.

example

if the total length of a simulation is 31 days then the number of seconds is 2678400
and if dt (aka timestep) is 120 seconds then, if you want the simulation output and hotfile to be written at the simulation then the ihfskip and also the nhot_write value would be 22320 because 22320 timesteps of 120 seconds is 2678400 which is the end of the 31st day.

for ifhskip and nhot_write in the situation where you'd like an output and hotfile every n days then ihfskip and nhot_write can be calulated by (86400*write_every_n_days)/dt

@benjaminleighton benjaminleighton added enhancement New feature or request schism labels Feb 25, 2024
@tomdurrant tomdurrant added this to the wp3 milestone Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request schism
Projects
None yet
Development

No branches or pull requests

2 participants