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

domain nowdate patch #84

Merged

Conversation

GreyREvenson
Copy link
Contributor

@GreyREvenson GreyREvenson commented Sep 14, 2023

PURPOSE

This PR adds the nowdate variable -- which is a member of domaingrid_type and domain_type -- to the DomainVarOutTransfer subroutine.

Because nowdate is calculated/updated within the scope of solve_noahowp (specifically within the UtilitiesMain subroutine), the updated value must be included within the DomainVarOutTransfer subroutine so that the updated nowdate is available to the subsequent time step call to read_forcing_text. If nowdate is not included, the forcing file is incorrectly read-in.

ADDITIONS

domaingrid%nowdate = domain%nowdate was added to the DomainVarOutTransfer subroutine.

CHANGES

TESTING

/test/analysis/compare_outputnc.py was executed and grid cell (1,1) passed all tests while other grid cells did not pass all tests.

NOTES

This was a difficult bug to find. I was working on a PR for the read NetCDF file functions and could not get /test/analysis/compare_outputnc.py to pass tests for gric cell (1,1). I assumed that my changes related to the new PR were causing the problem. However, I found that the problem was due to my removing nowdate from the DomainVarOutTransfer subroutine in PR #82.

I think the best solution would be to calculate/advance domaingrid_type%nowdate outside the scope of solve_noahowp, then transfer nowdate into domain_type prior to calling solve_noahowp, then don't worry about transferring nowdate back out to domaingrid_type because there is no need to do so.

@GreyREvenson GreyREvenson marked this pull request as draft September 14, 2023 15:37
@GreyREvenson GreyREvenson marked this pull request as ready for review September 14, 2023 15:40
Copy link
Contributor

@nmizukami nmizukami left a comment

Choose a reason for hiding this comment

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

This is small change and approve it (I understand this is a bugfix, and yes, agree that it is sometimes difficult to find a small bug that causes the error)

@GreyREvenson GreyREvenson merged commit 962c20d into NOAA-OWP:noah_om_grid Sep 19, 2023
@GreyREvenson GreyREvenson deleted the noah_om_grid_nowdate_patch branch September 19, 2023 20:01
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.

2 participants