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 9772 for NEMO/branches/2018/dev_r9759_HPC09_ESIWACE/src/OCE/LBC/mppini.F90 – NEMO

Ignore:
Timestamp:
2018-06-08T14:52:48+02:00 (6 years ago)
Author:
smasson
Message:

dev_r9759_HPC09_ESIWACE: add benchmark features

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2018/dev_r9759_HPC09_ESIWACE/src/OCE/LBC/mppini.F90

    r9667 r9772  
    151151      INTEGER, ALLOCATABLE, DIMENSION(:,:) ::   ilei, ildi, iono, ioea         !  -     - 
    152152      INTEGER, ALLOCATABLE, DIMENSION(:,:) ::   ilej, ildj, ioso, iowe         !  -     - 
    153       INTEGER, DIMENSION(jpiglo,jpjglo) ::   imask   ! 2D global domain workspace 
     153      INTEGER, ALLOCATABLE, DIMENSION(:,:) ::   imask   ! 2D global domain 
    154154      !!---------------------------------------------------------------------- 
    155155 
     
    196196 
    197197      ! 
    198       IF ( jpni * jpnj == jpnij ) THEN    ! regular domain lay out over processors 
    199          imask(:,:) = 1                
    200       ELSEIF ( jpni*jpnj > jpnij ) THEN   ! remove land-only processor (i.e. where imask(:,:)=0) 
     198      ALLOCATE ( imask(jpiglo,jpjglo), stat=ierr ) 
     199      ! 
     200      IF ( jpni*jpnj > jpnij ) THEN   ! remove land-only processor (i.e. where imask(:,:)=0) 
     201         IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'mpp_init: unable to allocate global ocean arrays' ) 
    201202         CALL mpp_init_mask( imask )    
    202       ELSE                                ! error 
     203      ELSEIF ( jpnij > jpni*jpnj ) THEN   ! error 
    203204         CALL ctl_stop( 'mpp_init: jpnij > jpni x jpnj. Check namelist setting!' ) 
    204205      ENDIF 
     
    335336         ! 
    336337         ! Check wet points over the entire domain to preserve the MPI communication stencil 
    337          isurf = 0 
    338          DO jj = 1, ilj 
    339             DO  ji = 1, ili 
    340                IF( imask(ji+iimppt(ii,ij)-1, jj+ijmppt(ii,ij)-1) == 1)   isurf = isurf+1 
    341             END DO 
    342          END DO 
     338        IF ( jpni * jpnj == jpnij ) THEN    ! regular domain lay out over processors 
     339           isurf = ili * ilj 
     340         ELSE 
     341           isurf = 0 
     342           DO jj = 1, ilj 
     343              DO  ji = 1, ili 
     344                 IF( imask(ji+iimppt(ii,ij)-1, jj+ijmppt(ii,ij)-1) == 1)   isurf = isurf+1 
     345              END DO 
     346           END DO 
     347         ENDIF 
    343348         ! 
    344349         IF( isurf /= 0 ) THEN 
     
    349354         ENDIF 
    350355      END DO 
     356      DEALLOCATE ( imask ) 
    351357      ! 
    352358      nfipproc(:,:) = ipproc(:,:) 
Note: See TracChangeset for help on using the changeset viewer.