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 8979 for branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90 – NEMO

Ignore:
Timestamp:
2017-12-11T17:45:55+01:00 (6 years ago)
Author:
acc
Message:

Branch 2017/dev_r8126_ROBUST08_no_ghost. Merge in trunk changes up to rev 8864 in preparation for the merge. Sette tests OK except for AGRIF restartability but uncertain about the trunks status for this?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90

    r8758 r8979  
    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     ! 
     
    379380      IF( ln_ctl      )     CALL prt_ctl_init   ! Print control 
    380381                            CALL day_init   ! model calendar (using both namelist and restart infos) 
     382      IF( ln_rstart )       CALL rst_read_open 
    381383 
    382384                            CALL sbc_init   ! Forcings : surface module  
     
    611613      ! 
    612614      ! Find the factors of n. 
    613       IF( kn == 1 )   GOTO 20 
    614  
    615       ! nu holds the unfactorised part of the number. 
    616       ! knfax holds the number of factors found. 
    617       ! l points to the allowed factor list. 
    618       ! ifac holds the current factor. 
    619       ! 
    620       inu   = kn 
    621       knfax = 0 
    622       ! 
    623       DO jl = ntest, 1, -1 
    624          ! 
    625          ifac = ilfax(jl) 
    626          IF( ifac > inu )   CYCLE 
    627  
    628          ! Test whether the factor will divide. 
    629  
    630          IF( MOD(inu,ifac) == 0 ) THEN 
     615      IF( kn .NE. 1 ) THEN 
     616 
     617         ! nu holds the unfactorised part of the number. 
     618         ! knfax holds the number of factors found. 
     619         ! l points to the allowed factor list. 
     620         ! ifac holds the current factor. 
     621         ! 
     622         inu   = kn 
     623         knfax = 0 
     624         ! 
     625         DO jl = ntest, 1, -1 
    631626            ! 
    632             knfax = knfax + 1            ! Add the factor to the list 
    633             IF( knfax > kmaxfax ) THEN 
    634                kerr = 6 
    635                write (*,*) 'FACTOR: insufficient space in factor array ', knfax 
    636                return 
     627            ifac = ilfax(jl) 
     628            IF( ifac > inu )   CYCLE 
     629    
     630            ! Test whether the factor will divide. 
     631    
     632            IF( MOD(inu,ifac) == 0 ) THEN 
     633               ! 
     634               knfax = knfax + 1            ! Add the factor to the list 
     635               IF( knfax > kmaxfax ) THEN 
     636                  kerr = 6 
     637                  write (*,*) 'FACTOR: insufficient space in factor array ', knfax 
     638                  return 
     639               ENDIF 
     640               kfax(knfax) = ifac 
     641               ! Store the other factor that goes with this one 
     642               knfax = knfax + 1 
     643               kfax(knfax) = inu / ifac 
     644               !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 
    637645            ENDIF 
    638             kfax(knfax) = ifac 
    639             ! Store the other factor that goes with this one 
    640             knfax = knfax + 1 
    641             kfax(knfax) = inu / ifac 
    642             !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 
    643          ENDIF 
    644          ! 
    645       END DO 
    646       ! 
    647    20 CONTINUE      ! Label 20 is the exit point from the factor search loop. 
     646            ! 
     647         END DO 
     648         ! 
     649      ENDIF 
    648650      ! 
    649651   END SUBROUTINE factorise 
Note: See TracChangeset for help on using the changeset viewer.