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

Arguments in update_state need if present. #923

Closed
dabail10 opened this issue Dec 21, 2023 · 2 comments
Closed

Arguments in update_state need if present. #923

dabail10 opened this issue Dec 21, 2023 · 2 comments

Comments

@dabail10
Copy link
Contributor

I was adding a dvsdtd variable to the update_state call and found this code:

     daidt(i,j,iblk) = (aice(i,j,iblk) - daidt(i,j,iblk)) / dt
     dvidt(i,j,iblk) = (vice(i,j,iblk) - dvidt(i,j,iblk)) / dt
     dvsdt(i,j,iblk) = (vsno(i,j,iblk) - dvsdt(i,j,iblk)) / dt

These are wrapped in an if present(offset), but in my case I only want dvsdtd (dynamic) I don't want the dvsdtt (thermodynamic). It still seems dangerous to rely on offset only here. I would recommend an if present in front of these three.

@apcraig
Copy link
Contributor

apcraig commented Feb 26, 2024

I assume, based on the current implementation, that either all the optional arguments are passed or none are. It would be good to have a check at the top of the subroutine to ensure that.

But it sounds like what you're proposing is that the code works with any number of the optional arguments present? offset seems to affect only dagedt, so if dagedt is present, does offset have to be present too?

@apcraig
Copy link
Contributor

apcraig commented Mar 22, 2024

#940 addressed this issue. Will close.

@apcraig apcraig closed this as completed Mar 22, 2024
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