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 15810 for NEMO – NEMO

Changeset 15810 for NEMO


Ignore:
Timestamp:
2022-05-04T16:48:12+02:00 (2 months ago)
Author:
smasson
Message:

replace findloc by a do loop, see #2735

Location:
NEMO/releases/r4.0/r4.0-HEAD/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/releases/r4.0/r4.0-HEAD/src/OCE/IOM/restart.F90

    r15596 r15810  
    5959      INTEGER, INTENT(in) ::   kt     ! ocean time-step 
    6060      !! 
     61      INTEGER             ::   ji 
    6162      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step deine as a character 
    6263      CHARACTER(LEN=50)   ::   clname   ! ocean output restart file name 
     
    7071         IF( ln_rst_list ) THEN 
    7172            ! Protect against user requests outside of simulation period (#2735) 
    72             nitrst   = MIN( nitend, MINVAL( nn_stocklist, MASK=nn_stocklist.ge.nit000) )   
    73             nrst_lst = MAX( 1, FINDLOC( nn_stocklist, nitrst, DIM=1 ) ) 
     73            nitrst   = MIN( nitend, MINVAL( nn_stocklist, MASK=nn_stocklist.GE.nit000) )   
     74            ! Fortran 2008 coding style:   nrst_lst = MAX( 1, FINDLOC( nn_stocklist, nitrst, DIM=1 ) ) 
     75            nrst_lst = 1 
     76            DO ji = 1, SIZE(nn_stocklist) 
     77               IF( nn_stocklist(ji) == nitrst )   nrst_lst = ji 
     78            END DO 
    7479         ELSE 
    7580            nitrst = nitend 
  • NEMO/releases/r4.0/r4.0-HEAD/src/TOP/trcrst.F90

    r15596 r15810  
    4848      INTEGER, INTENT(in) ::   kt       ! number of iteration 
    4949      ! 
     50      INTEGER             ::   ji 
    5051      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step define as a character 
    5152      CHARACTER(LEN=50)   ::   clname   ! trc output restart file name 
     
    5960               ! Protect against user requests outside of simulation period (#2735) 
    6061               nitrst   = MIN( nitend, MINVAL( nn_stocklist, MASK=nn_stocklist.ge.nit000) ) 
    61                nrst_lst = MAX( 1, FINDLOC( nn_stocklist, nitrst, DIM=1 ) ) 
     62               ! Fortran 2008 coding style:   nrst_lst = MAX( 1, FINDLOC( nn_stocklist, nitrst, DIM=1 ) ) 
     63               nrst_lst = 1 
     64               DO ji = 1, SIZE(nn_stocklist) 
     65                  IF( nn_stocklist(ji) == nitrst )   nrst_lst = ji 
     66               END DO 
    6267            ELSE 
    6368               nitrst = nitend 
Note: See TracChangeset for help on using the changeset viewer.