Skip to content

Reset time functionality added for state saving/restoring processes (NGWPC 9622)#6

Merged
idtodd merged 13 commits into
developmentfrom
ssn_9622_reset_time
Mar 13, 2026
Merged

Reset time functionality added for state saving/restoring processes (NGWPC 9622)#6
idtodd merged 13 commits into
developmentfrom
ssn_9622_reset_time

Conversation

@sivasankkar
Copy link
Copy Markdown

@sivasankkar sivasankkar commented Jan 30, 2026

BMI save state implementation currently includes saving and loading the current time of the BMI. This is needed for properly loading state during checkpointing, but that would cause hindcasting loading of states to continually increase, and some BMIs might start looking for data in indexes out of range from the configuration files. An additional SetValue message of "reset_time" is needed to allow the NOAH OWP BMI to reset its current time to 0 as well as update any other values that create a BMI state equivalent to starting at 0.

Additional changes made to facilitate messaging between NGEN and the Fortran BMI.

Changes:

  • bmi_noahowp.f90: Added a new case for reset_time in noahowp_set_int function that calls another subroutine to reset time variables.
  • RunModule.f90: Added a new function reset_model_time that resets time variables.
  • serialization_size is a valid input for allowing the get_var_nbytes to reflect an incoming size for serialized data. This works around the limitation of passing arbitrarily sized serialization data to the Fortran BMI to read.

@sivasankkar sivasankkar changed the title Reset time functionality added for state saving/restoring processes. Reset time functionality added for state saving/restoring processes (NGWPC 9622) Jan 30, 2026
@sivasankkar sivasankkar requested a review from idtodd January 30, 2026 14:09
Comment thread bmi/bmi_noahowp.f90 Outdated
call reset_model_time(this%model, exec_status)
if (exec_status == 0) then
bmi_status = BMI_SUCCESS
call write_log("Time variables reset successfully for state restoring", LOG_LEVEL_INFO)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe the log level for this should be debug?

Copy link
Copy Markdown

@cmaynard-ngwpc cmaynard-ngwpc left a comment

Choose a reason for hiding this comment

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

Successfully tested in AWS Workspace.

@idtodd idtodd merged commit 713244b into development Mar 13, 2026
@idtodd idtodd deleted the ssn_9622_reset_time branch March 13, 2026 13:55
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.

3 participants