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

No data on zero meridian when resolution ratio > 2 #243

Conversation

SanderHulst
Copy link
Contributor

Please see #242 for a full description.

Oh, and release/zero_windspeed_on_zero_meridian should have been called feature/zero_windspeed_on_zero_meridian.

@SanderHulst SanderHulst changed the title ECMWF total weight <0.7 on zero meridian No data on zero meridian when resolution ratio > 2 Aug 13, 2020
@aliabdolali
Copy link
Contributor

I checked the regression on NOAA HPC, with the diff in known non b4b cases.
MatrixDiffNCEP.zip

@JessicaMeixner-NOAA
Copy link
Collaborator

@SanderHulst thanks for your patience with my slow review. I've been looking at this off and on for the past few days and I'm still stuck on the following:

Why do we not also want to apply the same theory on https://github.com/NOAA-EMC/WW3/blob/develop/model/ftn/wmupdtmd.ftn#L1369-L1372
so that we would then have:

              IF ( FLAGLL .AND. ICLOSE.NE.ICLOSE_NONE ) THEN
                J1 = 1 + MOD(J1-1+NXI,NXI)
                J2 = 1 + MOD(J2-1+NXI,NXI)
              END IF

?

Is it just that your case you had the >2, so you focused on that, or is it that the ratio of difference is smaller so even without the wrapped interpolation of the points you don't see the line like you do in the case you showed in the issue.

@SanderHulst
Copy link
Contributor Author

I did not consider the equal resolution case, but I don't think it will show the same behavior. The root cause is a negative index that is not folded. The code for MXA .NE 2 is:

            IF ( FLAGLL ) THEN
              IXC    = 1 + NINT ( MOD (                             &
                          1080.+X0+REAL(IX-1)*SX-X0I , 360. ) / SXI )
              IXS0   = IXC - 1 - MXA/2
              IXSN   = IXC + 1 + MXA/2
            ELSE
              IXC    = NINT ( 1. + ( X0+REAL(IX-1)*SX - X0I ) / SXI )
              IXS0   = MAX (  1  , IXC - 1 - MXA/2 )
              IXSN   = MIN ( NXI , IXC + 1 + MXA/2 )
            END IF
            DO J=IXS0, IXSN
              JJ=J
              IF ( FLAGLL ) THEN
                IF ( ICLOSE.NE.ICLOSE_NONE ) JJ = 1 + MOD(J-1+NXI,NXI)
                IF ( JJ.LT.1 .OR. JJ.GT. NXI ) CYCLE

The actual problem is in the do J=IXSO, IXSN loop that looks left and right of the cell center and causes J to be negative .

In the equal resolution case, J1 can not be negative because XR always lies between 1 and NX. Right?

@JessicaMeixner-NOAA
Copy link
Collaborator

@SanderHulst apologies on the super slow response. I just took a look at this again, and you are correct we don't need anything for the other case. I think this is good as is. Thanks again for this update!

@aliabdolali aliabdolali merged commit 2646f8c into NOAA-EMC:develop Apr 20, 2021
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

Successfully merging this pull request may close these issues.

3 participants