New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 8841 for branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90 – NEMO

Ignore:
Timestamp:
2017-11-29T05:08:05+01:00 (6 years ago)
Author:
deazer
Message:

Bring in Trunk Changes at version 8814
This revision wont run as is, requires next revision with merged changes
This revision serves as a reference point to what changes from the trunk at brought in by the merge
in the next revision

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/ROMS_WAD_7832/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90

    r7761 r8841  
    2525   USE usrdef_nam     ! user defined configuration 
    2626   USE daymod         ! calendar 
     27   USE restart        ! open  restart file 
    2728   USE step           ! NEMO time-stepping                 (stp     routine) 
    2829   USE cpl_oasis3     ! 
     
    364365      IF( ln_ctl      )     CALL prt_ctl_init   ! Print control 
    365366                            CALL day_init   ! model calendar (using both namelist and restart infos) 
     367      IF( ln_rstart )       CALL rst_read_open 
    366368 
    367369                            CALL sbc_init   ! Forcings : surface module  
     
    596598      ! 
    597599      ! Find the factors of n. 
    598       IF( kn == 1 )   GOTO 20 
    599  
    600       ! nu holds the unfactorised part of the number. 
    601       ! knfax holds the number of factors found. 
    602       ! l points to the allowed factor list. 
    603       ! ifac holds the current factor. 
    604       ! 
    605       inu   = kn 
    606       knfax = 0 
    607       ! 
    608       DO jl = ntest, 1, -1 
    609          ! 
    610          ifac = ilfax(jl) 
    611          IF( ifac > inu )   CYCLE 
    612  
    613          ! Test whether the factor will divide. 
    614  
    615          IF( MOD(inu,ifac) == 0 ) THEN 
     600      IF( kn .NE. 1 ) THEN 
     601 
     602         ! nu holds the unfactorised part of the number. 
     603         ! knfax holds the number of factors found. 
     604         ! l points to the allowed factor list. 
     605         ! ifac holds the current factor. 
     606         ! 
     607         inu   = kn 
     608         knfax = 0 
     609         ! 
     610         DO jl = ntest, 1, -1 
    616611            ! 
    617             knfax = knfax + 1            ! Add the factor to the list 
    618             IF( knfax > kmaxfax ) THEN 
    619                kerr = 6 
    620                write (*,*) 'FACTOR: insufficient space in factor array ', knfax 
    621                return 
     612            ifac = ilfax(jl) 
     613            IF( ifac > inu )   CYCLE 
     614    
     615            ! Test whether the factor will divide. 
     616    
     617            IF( MOD(inu,ifac) == 0 ) THEN 
     618               ! 
     619               knfax = knfax + 1            ! Add the factor to the list 
     620               IF( knfax > kmaxfax ) THEN 
     621                  kerr = 6 
     622                  write (*,*) 'FACTOR: insufficient space in factor array ', knfax 
     623                  return 
     624               ENDIF 
     625               kfax(knfax) = ifac 
     626               ! Store the other factor that goes with this one 
     627               knfax = knfax + 1 
     628               kfax(knfax) = inu / ifac 
     629               !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 
    622630            ENDIF 
    623             kfax(knfax) = ifac 
    624             ! Store the other factor that goes with this one 
    625             knfax = knfax + 1 
    626             kfax(knfax) = inu / ifac 
    627             !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 
    628          ENDIF 
    629          ! 
    630       END DO 
    631       ! 
    632    20 CONTINUE      ! Label 20 is the exit point from the factor search loop. 
     631            ! 
     632         END DO 
     633         ! 
     634      ENDIF 
    633635      ! 
    634636   END SUBROUTINE factorise 
Note: See TracChangeset for help on using the changeset viewer.