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

Does TAUNUX, TAUNUY need to be saved for FLD1/FLD2 #308

Closed
JessicaMeixner-NOAA opened this issue Feb 4, 2021 · 2 comments
Closed

Does TAUNUX, TAUNUY need to be saved for FLD1/FLD2 #308

JessicaMeixner-NOAA opened this issue Feb 4, 2021 · 2 comments

Comments

@JessicaMeixner-NOAA
Copy link
Collaborator

JessicaMeixner-NOAA commented Feb 4, 2021

In w3srcemd.ftn, TAUNUX and TAUNUY are saved as they are supposed to be first guesses of the interactive solve in FLD1 or FLD2; however, in both routines it looks like the first guess is actually:

      ! Guessed values of viscous stress
      TAUNUX = USTSM**2 * DAIR * wndx / wnd_in_mag
      TAUNUY = USTSM**2 * DAIR * wndy / wnd_in_mag

If this is the case, should TAUNUX, TAUNUY be saved? Is there ever a case where in w3fld2 where you would not go into the do while loop that calculates TAUNUX/TAUNUY as above? If these do not need to be saved, we could also change the declaration in w3fld1/2 of TAUNUX/TAUNUY as out only instead of in/out as well.

FYI: @breichl Thanks @SMoorthi-emc for bringing up this point

@breichl
Copy link

breichl commented Feb 4, 2021

In principle we should be able to get faster convergence of the iterator by saving TAUNUX and TAUNUY and using the previous step as the starting guess. But since I never fully vetted this (and thus used a bulk value) your proposed changes seem ok. I would leave a note in the code (it looks like there may already be some small note on L359) and perhaps if I (or anyone) ever have some time the convergence issue could be addressed. I'm not sure how these routines contribute to the overall CPU costs, but there are probably some other efficiency gains that could be made.

@JessicaMeixner-NOAA
Copy link
Collaborator Author

In terms of CPU costs, I know FLD1 is much slower than FLD2. @SMoorthi-emc brought up we could change some var**2 to var*var for efficiency improvements. FLD2 does add to the computational time, so speeding it up would not be a bad thing. To test this would we just essentially comment out the TAUNUX guesses or put them behind a "if first" call?

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

No branches or pull requests

3 participants