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

remove the exact integration in cube_to_target to avoid negative weights #6854

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions components/eam/tools/topo_tool/cube_to_target/remap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,8 @@ subroutine side_integral(&

if (xseg(1).EQ.xseg(2))then
slope = bignum
else if (abs(yseg(1) -yseg(2))<fuzzy_width) then
!else if (abs(yseg(1) -yseg(2))<fuzzy_width) then !remove the exact integration
Copy link
Contributor

Choose a reason for hiding this comment

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

@jsbamboo let's change the wording on the comment on both of the commented lines to something more verbose and clear, I'm thinking:
"this will enable exact integration, which was found to create problematic negative weights"

A better solution would be to just add a logical switch controlled by a flag, but I'm fine with this solution as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks! will push a commit with the first solution

else if (.false.) then
slope = 0.0
else
slope = (yseg(2)-yseg(1))/(xseg(2)-xseg(1))
Expand Down Expand Up @@ -955,7 +956,8 @@ subroutine get_weights_gauss(weights,xseg,yseg,nreconstruction,ngauss,gauss_weig
! if (fuzzy(abs(xseg(1) -xseg(2)),fuzzy_width)==0)then
if (xseg(1).EQ.xseg(2))then
weights = 0.0D0
else if (abs(yseg(1) -yseg(2))<fuzzy_width) then
!else if (abs(yseg(1) -yseg(2))<fuzzy_width) then !remove the exact integration
else if (.false.) then
!
! line segment parallel to latitude - compute weights exactly
!
Expand Down
Loading