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 3375 for branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90 – NEMO

Ignore:
Timestamp:
2012-04-30T14:06:55+02:00 (12 years ago)
Author:
sga
Message:

NEMO branch dev_r3337_NOCS10_ICB: some simplifications of inherited code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90

    r3373 r3375  
    6464      REAL(wp), DIMENSION(1)       ::   zdata                                         ! need 1d array to read in with 
    6565                                                                                            ! start and count arrays 
    66       LOGICAL                      ::   ll_found_restart, ll_multiPErestart=.FALSE. 
     66      LOGICAL                      ::   ll_found_restart 
    6767      CHARACTER(len=80)            ::   cl_filename 
    6868      CHARACTER(len=NF90_MAX_NAME) ::   cl_dname 
     
    7474 
    7575      ! Find a restart file 
    76       ll_multiPErestart=.FALSE. 
    77       DO 
    78          cl_filename = ' ' 
    79          cl_filename = 'restart_icebergs.nc' 
    80          INQUIRE( file=TRIM(cl_filename), exist=ll_found_restart ) 
    81          IF ( ll_found_restart ) EXIT 
     76      cl_filename = ' ' 
     77      IF ( lk_mpp ) THEN 
    8278         cl_filename = ' ' 
    8379         WRITE( cl_filename, '("restart_icebergs_",I4.4,".nc")' ) narea-1 
    8480         INQUIRE( file=TRIM(cl_filename), exist=ll_found_restart ) 
    85          IF ( ll_found_restart ) THEN 
    86             ll_multiPErestart = .TRUE. 
    87             EXIT 
    88          ENDIF 
    89          IF (nn_verbose_level >= 0 .AND. lwp) & 
    90             WRITE( numout, '(a)' ) 'read_restart_bergs: no restart file found' 
    91          ll_multiPErestart = .TRUE.                         ! force checking in a MPP if no file found on this PE 
    92          EXIT 
    93       ENDDO 
     81      ELSE 
     82         cl_filename = 'restart_icebergs.nc' 
     83         INQUIRE( file=TRIM(cl_filename), exist=ll_found_restart ) 
     84      ENDIF 
    9485 
    9586      IF ( .NOT. ll_found_restart) THEN                     ! only do the following if a file was found 
     
    220211         WRITE(numout,'(2(a,i5))') 'icebergs, read_restart_bergs: # bergs =',jn,' on PE',narea-1 
    221212      IF( lk_mpp ) THEN 
    222          IF (ll_multiPErestart) CALL mpp_sum(ibergs_in_file) ! In case PE 0 didn't open a file 
     213         CALL mpp_sum(ibergs_in_file) 
    223214         CALL mpp_sum(jn) 
    224215      ENDIF 
     
    247238      IF( .NOT. ASSOCIATED(griddata) ) ALLOCATE( griddata(jpi,jpj,1) ) 
    248239 
    249       WRITE(cl_filename,'("icebergs_",I8.8,"_restart_",I4.4,".nc")') kt, narea-1 
     240      IF( lk_mpp ) THEN 
     241         WRITE(cl_filename,'("icebergs_",I8.8,"_restart_",I4.4,".nc")') kt, narea-1 
     242      ELSE 
     243         WRITE(cl_filename,'("icebergs_",I8.8,"_restart.nc")') kt 
     244      ENDIF 
    250245      IF (nn_verbose_level >= 0) WRITE(numout,'(2a)') 'icebergs, write_restart: creating ',TRIM(cl_filename) 
    251246 
Note: See TracChangeset for help on using the changeset viewer.