-
Notifications
You must be signed in to change notification settings - Fork 622
Fix zero boundary and orbital velocity issue in the cap #1402
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
base: dev/ufs-weather-model
Are you sure you want to change the base?
Fix zero boundary and orbital velocity issue in the cap #1402
Conversation
model/src/wav_import_export.F90
Outdated
ix = mapsf(isea,1) | ||
iy = mapsf(isea,2) | ||
if (mapsta(iy,ix) == 1) then | ||
if (mapsta(iy,ix) /= 0) then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't change anything w/in the CESMCOUPLED ifdefs unless you're testing in CESM and know that the change is acceptable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it! Thanks for the notice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danishyo can you make sure that this requested change is reflected in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbanihash I didn't intend to change CESM part,
only like to change exchange fields to SCHISM, like Hs, orbital, stoke's drift.... ,
please follow @DeniseWorthen suggestion, skip change within CESMCOUPLED .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danishyo since this is your PR, what you will need to do is make these changes, commit and push them to your PR branch (which seems to be the dev/ufs-weather-model-branch in your fork) and then I will move forward with the review and testing for the PR. Thank you in advance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbanihash Thanks for the explanation, I already revert the change within CESM block and push.
@danishyo The fact that you see the decomposition reflected on the boundary gives me pause. I would expect if it were a simple issue of mapsta being incorrect, you might see garbage (or zero), but you're seeing something that looks like a decomposition. I don't know how much debugging you've done for this issue in WW3 itself, but I reminded of this issue I found when adding the unstructured mesh to the cap ufs-community/ufs-weather-model#1556 (comment) In that case, the exported field was corrupted on the last PE, but only on the restart frequency. I suspect that something more fundamental may be occurring inside of WW3 it it is manifesting itself in your case. |
Hi @DeniseWorthen Anyway, I will revert change within CESM block then push. |
@danishyo For the current UFS cases using the unstructured mesh, we do not export some of the fields which you are using in the coastal app. So I never did any debugging of possible issues inside of WW3 w/ those fields. I don't doubt that you see that your fix resolves the issue---but I'm not 100% sure that the issue you are seeing isn't from something being done incorrectly inside of WW3. How else to explain that what you see is evidence of the decomposition of WW3 in the exported fields? |
@DeniseWorthen I checked all exchange fields between SCHISM & WW3, orbital velocity is the only one showing this, others like Hs, Tm01... are not. So I just guessing this may not related. |
model/src/wav_import_export.F90
Outdated
if ( firstCall ) then | ||
if(( runtype == 'initial' .and. mapsta(iy,ix) == 1 ) .or. & | ||
( runtype == 'continue' .and. abs(mapsta(iy,ix)) == 1 )) then | ||
if(( runtype == 'initial' .and. mapsta(iy,ix) /= 0 ) .or. & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danishyo Did you intend to change this block? I don't remember that coastal app exports Z0 and this is w/in code that UFS global mode uses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I didn't, I will revert this one as well.
I've had enough experience adding features and debugging in WW3 that when I see something like a decomposition field being expressed in the output field, it is difficult for me not be suspicious. The fact that you're seeing it in some things and not others doesn't really convince me. However, UFS is not making use of these fields that coastal is using currently, so if you restrict your changes to only coastal-app exported fields, I'm ok with your changes. I just would not be at all surprised to find something deeper in WW3 is actually causing a decomposition to appear in an exported field. |
Thanks for the explanation, I just revert the changes and keep changes with necessary fields. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if these should be if mapsta(iy,ix) > 0 as negative values indicate that a point is currently taken out of computation. https://github.com/NOAA-EMC/WW3/blob/develop/model/src/w3gridmd.F90#L219-L247
Also I'm not sure what prompted the changes in the calcstokes computations?
end do | ||
kd = max ( 0.001 , wn(ik,isea) * dw(isea) ) | ||
if (kd .lt. 6.0) then | ||
kd = max ( 1.0e-7 , wn(ik,isea) * dw(isea) ) !0.001 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are there changes to this calculation? This appears different than the mapsta issue updated elsewhere but I don't see anything about it in the PR description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I borrow routine coefficients from https://github.com/NOAA-EMC/WW3/blob/develop/model/src/wmesmfmd.F90#L7315
For mapsta, I am OK to change ">0" if this includes ocean and boundary points.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code for the ussco matches (or should) what is currently in w3iogomd.F90
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danishyo - Can you let us know how your testing goes for ">0" this should be sufficient.
I would think this calculation should match what is in w3iogo. I'd have to look at the differences between that and wmesmf as to why that would have been diverged. Let me know if you need help investigating this further @danishyo or if you will take the lead on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danishyo were you ever able to run those tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danishyo were you ever able to run those tests?
I didn't do "mapsta>0" test, but base on info from manual, I believe this should fix the issue as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let us know when you've been able to run those tests and confirm if that works or not.
We also have outstanding issues about this part of the code change and why it's diverged, etc.
This PR is waiting on those updates to move forward.
Original issue can be found at oceanmodeling/ufs-weather-model#145 (comment)

It cause zero values along the boundary for exchange variables (like SXX) from cap.
Also, original code will derive weird orbital velocity (looks like domain-decomposition map, like the following figure)
@uturuncoglu , and @janahaddad are aware of these issues.
@DeniseWorthen , could you have a look on this fix? Thx!