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

Possible typo in grid interpolation #44

Open
bendudson opened this issue Jul 19, 2023 · 1 comment
Open

Possible typo in grid interpolation #44

bendudson opened this issue Jul 19, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@bendudson
Copy link
Collaborator

bendudson commented Jul 19, 2023

There is a suspicious line in this polintp poloidal interpolation function:
https://github.com/LLNL/UEDGE/blob/master/bbb/griddubl.m#L1169

        do 30 ixo = ixos, ixof
            if(xo(ixo,iy).gt.xn(ix,iy) .or. ixo.eq.ixof) goto 25
            ixl = ixo
  20    continue
  25    continue

The 30 label is shared with an outer loop, and the 20 label is not used in this function.

The corresponding lines in the radintp radial interpolation function
https://github.com/LLNL/UEDGE/blob/master/bbb/griddubl.m#L1108
are:

            do 20 iyo = iyos, iyof
               if(yo(ix,iyo).gt.yn(ix,iy) .or. iyo.eq.iyof) goto 25
               iyl = iyo
  20        continue
  25        continue

I suspect that the radintp version is correct, and the polintp do loop should use 20 rather than 30 or be rewritten as

do ixo = ixos, ixof
   if(xo(ixo,iy).gt.xn(ix,iy) .or. ixo.eq.ixof) exit
   ixl = ixo
end do

Note: I think this bug, if it is a bug, causes extra work to be done but doesn't affect the result: The interpolation is performed for every value of ixo (rather than just one), but the last result computed has the correct value of ixl.

@holm10 holm10 added the bug Something isn't working label Jul 25, 2023
@trognlien
Copy link
Contributor

trognlien commented Jul 26, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants