Changeset 8528

Ignore:
Timestamp:
2017-09-15T16:43:25+02:00 (3 years ago)
Message:

First set of fixes for #1860 (getting rid of GOTO statements)

Location:
trunk/NEMOGCM/NEMO
Files:
4 edited

Unmodified
Removed
• trunk/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90

 r7761 ! Find the factors of n. IF( kn == 1 )   GOTO 20 ! nu holds the unfactorised part of the number. ! knfax holds the number of factors found. ! l points to the allowed factor list. ! ifac holds the current factor. inu   = kn knfax = 0 DO jl = ntest, 1, -1 ! ifac = ilfax(jl) IF( ifac > inu )   CYCLE ! Test whether the factor will divide. IF( MOD(inu,ifac) == 0 ) THEN IF( kn .NE. 1 ) THEN ! nu holds the unfactorised part of the number. ! knfax holds the number of factors found. ! l points to the allowed factor list. ! ifac holds the current factor. inu   = kn knfax = 0 DO jl = ntest, 1, -1 ! knfax = knfax + 1            ! Add the factor to the list IF( knfax > kmaxfax ) THEN kerr = 6 write (*,*) 'FACTOR: insufficient space in factor array ', knfax return ifac = ilfax(jl) IF( ifac > inu )   CYCLE ! Test whether the factor will divide. IF( MOD(inu,ifac) == 0 ) THEN ! knfax = knfax + 1            ! Add the factor to the list IF( knfax > kmaxfax ) THEN kerr = 6 write (*,*) 'FACTOR: insufficient space in factor array ', knfax return ENDIF kfax(knfax) = ifac ! Store the other factor that goes with this one knfax = knfax + 1 kfax(knfax) = inu / ifac !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) ENDIF kfax(knfax) = ifac ! Store the other factor that goes with this one knfax = knfax + 1 kfax(knfax) = inu / ifac !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) ENDIF ! END DO 20 CONTINUE      ! Label 20 is the exit point from the factor search loop. ! END DO ENDIF ! END SUBROUTINE factorise
• trunk/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

 r8524 ! ! Find the factors of n. IF( kn == 1 )   GOTO 20 ! nu holds the unfactorised part of the number. ! knfax holds the number of factors found. ! l points to the allowed factor list. ! ifac holds the current factor. ! inu   = kn knfax = 0 ! DO jl = ntest, 1, -1 IF( kn .NE. 1 ) THEN ! nu holds the unfactorised part of the number. ! knfax holds the number of factors found. ! l points to the allowed factor list. ! ifac holds the current factor. ! ifac = ilfax(jl) IF( ifac > inu )   CYCLE ! Test whether the factor will divide. IF( MOD(inu,ifac) == 0 ) THEN inu   = kn knfax = 0 ! DO jl = ntest, 1, -1 ! knfax = knfax + 1            ! Add the factor to the list IF( knfax > kmaxfax ) THEN kerr = 6 write (*,*) 'FACTOR: insufficient space in factor array ', knfax return ifac = ilfax(jl) IF( ifac > inu )   CYCLE ! Test whether the factor will divide. IF( MOD(inu,ifac) == 0 ) THEN ! knfax = knfax + 1            ! Add the factor to the list IF( knfax > kmaxfax ) THEN kerr = 6 write (*,*) 'FACTOR: insufficient space in factor array ', knfax return ENDIF kfax(knfax) = ifac ! Store the other factor that goes with this one knfax = knfax + 1 kfax(knfax) = inu / ifac !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) ENDIF kfax(knfax) = ifac ! Store the other factor that goes with this one knfax = knfax + 1 kfax(knfax) = inu / ifac !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) ENDIF ! END DO ! END DO ! 20 CONTINUE      ! Label 20 is the exit point from the factor search loop. ENDIF ! END SUBROUTINE factorise
• trunk/NEMOGCM/NEMO/SAO_SRC/nemogcm.F90

 r7646 ! ! Find the factors of n. IF( kn == 1 )   GOTO 20 ! nu holds the unfactorised part of the number. ! knfax holds the number of factors found. ! l points to the allowed factor list. ! ifac holds the current factor. ! inu   = kn knfax = 0 ! DO jl = ntest, 1, -1 ! ifac = ilfax(jl) IF( ifac > inu )   CYCLE ! Test whether the factor will divide. IF( MOD(inu,ifac) == 0 ) THEN IF( kn .NE. 1 ) THEN ! nu holds the unfactorised part of the number. ! knfax holds the number of factors found. ! l points to the allowed factor list. ! ifac holds the current factor. ! inu   = kn knfax = 0 ! DO jl = ntest, 1, -1 ! knfax = knfax + 1            ! Add the factor to the list IF( knfax > kmaxfax ) THEN kerr = 6 write (*,*) 'FACTOR: insufficient space in factor array ', knfax return ifac = ilfax(jl) IF( ifac > inu )   CYCLE ! Test whether the factor will divide. IF( MOD(inu,ifac) == 0 ) THEN ! knfax = knfax + 1            ! Add the factor to the list IF( knfax > kmaxfax ) THEN kerr = 6 write (*,*) 'FACTOR: insufficient space in factor array ', knfax return ENDIF kfax(knfax) = ifac ! Store the other factor that goes with this one knfax = knfax + 1 kfax(knfax) = inu / ifac !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) ENDIF kfax(knfax) = ifac ! Store the other factor that goes with this one knfax = knfax + 1 kfax(knfax) = inu / ifac !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) ENDIF ! END DO ! 20 CONTINUE      ! Label 20 is the exit point from the factor search loop. ! END DO ! ENDIF ! END SUBROUTINE factorise
• trunk/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90

 r7761 ! ! Find the factors of n. IF( kn == 1 )   GOTO 20 ! nu holds the unfactorised part of the number. ! knfax holds the number of factors found. ! l points to the allowed factor list. ! ifac holds the current factor. ! inu   = kn knfax = 0 ! DO jl = ntest, 1, -1 ! ifac = ilfax(jl) IF( ifac > inu )   CYCLE ! Test whether the factor will divide. IF( MOD(inu,ifac) == 0 ) THEN IF( kn .NE. 1 ) THEN ! nu holds the unfactorised part of the number. ! knfax holds the number of factors found. ! l points to the allowed factor list. ! ifac holds the current factor. ! inu   = kn knfax = 0 ! DO jl = ntest, 1, -1 ! knfax = knfax + 1            ! Add the factor to the list IF( knfax > kmaxfax ) THEN kerr = 6 write (*,*) 'FACTOR: insufficient space in factor array ', knfax return ifac = ilfax(jl) IF( ifac > inu )   CYCLE ! Test whether the factor will divide. IF( MOD(inu,ifac) == 0 ) THEN ! knfax = knfax + 1            ! Add the factor to the list IF( knfax > kmaxfax ) THEN kerr = 6 write (*,*) 'FACTOR: insufficient space in factor array ', knfax return ENDIF kfax(knfax) = ifac ! Store the other factor that goes with this one knfax = knfax + 1 kfax(knfax) = inu / ifac !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) ENDIF kfax(knfax) = ifac ! Store the other factor that goes with this one knfax = knfax + 1 kfax(knfax) = inu / ifac !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) ENDIF ! END DO ! 20 CONTINUE      ! Label 20 is the exit point from the factor search loop. ! END DO ! ENDIF ! END SUBROUTINE factorise
Note: See TracChangeset for help on using the changeset viewer.