-
Notifications
You must be signed in to change notification settings - Fork 632
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?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -846,7 +846,7 @@ subroutine export_fields (gcomp, rc) | |
| call init_get_isea(isea, jsea) | ||
| ix = mapsf(isea,1) | ||
| iy = mapsf(isea,2) | ||
| if (mapsta(iy,ix) == 1) then | ||
| if (mapsta(iy,ix) /= 0) then | ||
| sw_tauox(jsea) = tauox(jsea) | ||
| sw_tauoy(jsea) = tauoy(jsea) | ||
| endif | ||
|
|
@@ -883,7 +883,7 @@ subroutine export_fields (gcomp, rc) | |
| call init_get_isea(isea, jsea) | ||
| ix = mapsf(isea,1) | ||
| iy = mapsf(isea,2) | ||
| if (mapsta(iy,ix) == 1) then | ||
| if (mapsta(iy,ix) /= 0) then | ||
| sw_wnmean(jsea) = wnmean(jsea) | ||
| endif | ||
| enddo | ||
|
|
@@ -902,7 +902,7 @@ subroutine export_fields (gcomp, rc) | |
| call init_get_isea(isea, jsea) | ||
| ix = mapsf(isea,1) | ||
| iy = mapsf(isea,2) | ||
| if (mapsta(iy,ix) == 1) then | ||
| if (mapsta(iy,ix) /= 0) then | ||
| sw_taubblx(jsea) = taubbl(jsea,1) | ||
| sw_taubbly(jsea) = taubbl(jsea,2) | ||
| endif | ||
|
|
@@ -1183,8 +1183,8 @@ subroutine CalcRoughl ( wrln) | |
| ix = mapsf(isea,1) | ||
| iy = mapsf(isea,2) | ||
| 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. & | ||
| ( runtype == 'continue' .and. abs(mapsta(iy,ix)) /= 0 )) then | ||
| charn(jsea) = zero | ||
| llws(:) = .true. | ||
| ustar = zero | ||
|
|
@@ -1243,7 +1243,7 @@ subroutine CalcRadstr2D ( a, sxxn, sxyn, syyn, fval) | |
| call init_get_isea(isea, jsea) | ||
| ix = mapsf(isea,1) ! global ix | ||
| iy = mapsf(isea,2) ! global iy | ||
| if (mapsta(iy,ix) == 1) then ! active sea point | ||
| if (mapsta(iy,ix) /= 0) then ! active sea point | ||
| sxx1 = 0.0 | ||
| syy1 = 0.0 | ||
| sxy1 = 0.0 | ||
|
|
@@ -1271,7 +1271,7 @@ subroutine CalcRadstr2D ( a, sxxn, sxyn, syyn, fval) | |
| syy1 = syy1 + fte * abyy/cg(nk,isea) | ||
| sxy1 = sxy1 + fte * abxy/cg(nk,isea) | ||
| end if | ||
| if (mapsta(iy,ix) == 1) then ! active sea point | ||
| if (mapsta(iy,ix) /= 0) then ! active sea point | ||
| sxxn(jsea) = sxx1*dwat*grav | ||
| syyn(jsea) = syy1*dwat*grav | ||
| sxyn(jsea) = sxy1*dwat*grav | ||
|
|
@@ -1323,7 +1323,7 @@ subroutine CalcEF (a, wave_elevation_spectrum) | |
| call init_get_isea(isea, jsea) | ||
| ix = mapsf(isea,1) ! global ix | ||
| iy = mapsf(isea,2) ! global iy | ||
| if (mapsta(iy,ix) == 1) then ! active sea point | ||
| if (mapsta(iy,ix) /= 0) then ! active sea point | ||
| factor = dden(ik) / cg(ik,isea) | ||
| ebd = ab(jsea) * factor | ||
| ebd = ebd / dsii(ik) | ||
|
|
@@ -1367,7 +1367,7 @@ subroutine CalcHS (a, hs, fval) | |
| call init_get_isea(isea, jsea) | ||
| ix = mapsf(isea,1) ! global ix | ||
| iy = mapsf(isea,2) ! global iy | ||
| if (mapsta(iy,ix) == 1) then ! active sea point | ||
| if (mapsta(iy,ix) /= 0) then ! active sea point | ||
| et = 0.0 | ||
| do ik = 1,nk | ||
| factor = dden(ik) / cg(ik,isea) | ||
|
|
@@ -1425,7 +1425,7 @@ subroutine CalcBHD (a, bhd, fval) | |
| call init_get_isea(isea, jsea) | ||
| ix = mapsf(isea,1) ! global ix | ||
| iy = mapsf(isea,2) ! global iy | ||
| if (mapsta(iy,ix) == 1) then ! active sea point | ||
| if (mapsta(iy,ix) /= 0) then ! active sea point | ||
| ebd = 0.0 | ||
| bhd1 = 0.0 | ||
| do ik = 1,nk | ||
|
|
@@ -1481,7 +1481,7 @@ subroutine CalcStokes(a, us, vs, fval) | |
| call init_get_isea(isea, jsea) | ||
| ix = mapsf(isea,1) ! global ix | ||
| iy = mapsf(isea,2) ! global iy | ||
| if (mapsta(iy,ix) == 1) then ! active sea point | ||
| if (mapsta(iy,ix) /= 0) then ! active sea point | ||
| us1 = 0.0 | ||
| vs1 = 0.0 | ||
| do ik = 1,nk | ||
|
|
@@ -1492,8 +1492,8 @@ subroutine CalcStokes(a, us, vs, fval) | |
| abx = abx + a(ith,ik,jsea)*ecos(ith) | ||
| aby = aby + a(ith,ik,jsea)*esin(ith) | ||
| 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 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @danishyo were you ever able to run those tests?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I didn't do "mapsta>0" test, but base on info from manual, I believe this should fix the issue as well.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| if (kd .lt. 18.0) then !6.0 | ||
| fkd = factor / sinh(kd)**2 | ||
| ussco = fkd*sig(ik)*wn(ik,isea)*cosh(2.0*kd) | ||
| else | ||
|
|
@@ -1545,7 +1545,7 @@ subroutine CalcUVBed(a, ubrx, ubry, fval) | |
| call init_get_isea(isea, jsea) | ||
| ix = mapsf(isea,1) ! global ix | ||
| iy = mapsf(isea,2) ! global iy | ||
| if (mapsta(iy,ix) == 1) then ! active sea point | ||
| if (mapsta(iy,ix) /= 0) then ! active sea point | ||
| uba1 = 0.0 | ||
| ubd1 = 0.0 | ||
| ubr1 = 0.0 | ||
|
|
@@ -1559,23 +1559,19 @@ subroutine CalcUVBed(a, ubrx, ubry, fval) | |
| abx = abx + a(ith,ik,jsea)*ecos(ith) | ||
| aby = aby + a(ith,ik,jsea)*esin(ith) | ||
| end do | ||
| kd = max ( 0.001 , wn(ik,isea) * dw(isea) ) | ||
| if (kd .lt. 6.0) then | ||
| !kd = max ( 0.001 , wn(ik,isea) * dw(isea) ) | ||
| kd = max ( 1.0e-7, min(18.,wn(ik,isea)) * dw(isea) ) | ||
| !if (kd .lt. 6.0) then | ||
| fkd = factor / sinh(kd)**2 | ||
| ubr1 = ubr1 + ab*sig(ik)**2 * fkd | ||
| uba1 = uba1 + abx*sig(ik)**2 * fkd | ||
| ubd1 = ubd1 + aby*sig(ik)**2 * fkd | ||
| end if | ||
| !end if | ||
| end do !ik | ||
| ubr1 = sqrt(2.0*max(0.0,ubr1)) | ||
| if (ubr1 .ge. 1.0e-7) then | ||
| ubd1 = atan2(ubd1,uba1) | ||
| else | ||
| ubd1 = 0.0 | ||
| end if | ||
| uba1 = ubr1 | ||
| ubrx(jsea) = uba1*cos(ubd1) | ||
| ubry(jsea) = uba1*sin(ubd1) | ||
| ubr1 = sqrt(2.0*max(0.0,ubr1)) !make ubr1 >=0 already | ||
| ubd1 = atan2(ubd1,uba1) | ||
| ubrx(jsea) = ubr1*cos(ubd1) | ||
| ubry(jsea) = ubr1*sin(ubd1) | ||
| else | ||
| ubrx(jsea) = fval | ||
| ubry(jsea) = fval | ||
|
|
@@ -1615,7 +1611,7 @@ subroutine CalcTHM (a, thm, fval) | |
| call init_get_isea(isea, jsea) | ||
| ix = mapsf(isea,1) ! global ix | ||
| iy = mapsf(isea,2) ! global iy | ||
| if (mapsta(iy,ix) == 1) then ! active sea point | ||
| if (mapsta(iy,ix) /= 0) then ! active sea point | ||
| etx = 0.0 | ||
| ety = 0.0 | ||
| do ik = 1,nk | ||
|
|
@@ -1676,7 +1672,7 @@ subroutine CalcT0M1 (a, t0m1, fval) | |
| call init_get_isea(isea, jsea) | ||
| ix = mapsf(isea,1) ! global ix | ||
| iy = mapsf(isea,2) ! global iy | ||
| if (mapsta(iy,ix) == 1) then ! active sea point | ||
| if (mapsta(iy,ix) /= 0) then ! active sea point | ||
| etr = 0.0 | ||
| et = 0.0 | ||
| do ik = 1,nk | ||
|
|
||
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.