Skip to content

Conversation

@nhartney
Copy link
Contributor

@nhartney nhartney commented Nov 6, 2025

This PR changes the set-up of characteristics of the I/O. It adds a first_run flag to the time stepper's run method, which is True until the components of the I/O have been set up, after which it becomes False. This is to facilitate solving a PDE in Gusto multiple times as part of a hybrid ML model.

Args:
t (float): the start time of the run
tmax (float): the end time of the run
pick_up: (bool): specify whether to pick_up from a previous run
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing from the docstring

logger.debug(f'{field_name}, min: {min_val}, max: {max_val}')

def run(self, t, tmax, pick_up=False):
def run(self, t, tmax, pick_up=False, first_run=True):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's not really my place to review Gusto code but I feel this might be more elegant if this were called init_io or similar. Or you could even set this attribute inside Timestepper.__init__.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this is a nice idea @connorjward - thanks! your comments are always appreciated!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Connor!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants