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

Ignore:
Timestamp:
2018-12-18T12:53:24+01:00 (5 years ago)
Author:
smasson
Message:

dev_r10164_HPC09_ESIWACE_PREP_MERGE: action 6 add print when using non-optimal domain decomposition, see #2133

File:
1 edited

Legend:

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

    r10397 r10409  
    149149      INTEGER ::   iarea0                     !   -       - 
    150150      INTEGER ::   ierr, ios                  !  
     151      INTEGER ::   inbi, inbj, iimax,  ijmax  !  
    151152      INTEGER, ALLOCATABLE, DIMENSION(:)     ::   iin, ii_nono, ii_noea          ! 1D workspace 
    152153      INTEGER, ALLOCATABLE, DIMENSION(:)     ::   ijn, ii_noso, ii_nowe          !  -     - 
     
    181182      ! If dimensions of processor grid weren't specified in the namelist file 
    182183      ! then we calculate them here now that we have our communicator size 
    183       IF( jpni < 1 .OR. jpnj < 1 )   CALL mpp_init_bestpartition( mppsize, jpni, jpnj ) 
    184 !!$      IF( jpni < 1 .OR. jpnj < 1 ) THEN 
    185 !!$         CALL mpp_init_bestpartition( mppsize, jpni, jpnj ) 
    186 !!$      ELSE 
    187 !!$         CALL mpp_init_bestpartition( mppsize, inbi, inbj ) 
    188 !!$         CALL mpp_basic_decomposition( jpni, jpnj, jpimax, jpjmax ) 
    189 !!$         CALL mpp_basic_decomposition( inbi, inbj,  iimax,  ijmax ) 
    190 !!$         IF( iimax*ijmax < jpimax*jpjmax ) THEN 
    191 !!$            WRITE(ctmp1,*) '   The chossen domain decomposition ', jpni, jpnj 
    192 !!$            WRITE(ctmp2,*) '   exceeds the maximum number of ocean subdomains = ', inijmin 
    193 !!$            WRITE(ctmp3,*) '   we suppressed ', jpni*jpnj - mppsize, ' land subdomains ' 
    194 !!$            WRITE(ctmp4,*) '   BUT we had to keep ', mppsize - inijmin, ' land subdomains that are useless...' 
    195 !!$            CALL ctl_warn( 'mpp_init:', '~~~~~~~~ ', ctmp1, ctmp2, ctmp3, ctmp4 ) 
    196 !!$         ENDIF 
    197 !!$      ENDIF 
     184      IF( jpni < 1 .OR. jpnj < 1 ) THEN 
     185         CALL mpp_init_bestpartition( mppsize, jpni, jpnj ) 
     186      ELSE 
     187         CALL mpp_init_bestpartition( mppsize, inbi, inbj ) 
     188         CALL mpp_basic_decomposition( jpni, jpnj, jpimax, jpjmax ) 
     189         CALL mpp_basic_decomposition( inbi, inbj,  iimax,  ijmax ) 
     190         IF( iimax*ijmax < jpimax*jpjmax ) THEN 
     191            WRITE(ctmp1,*) '   The chosen domain decomposition ', jpni, jpnj 
     192            WRITE(ctmp2,*) '   has larger MPI subdomains ', jpimax, jpjmax, jpimax*jpjmax 
     193            WRITE(ctmp3,*) '   than the following domain decompostion ', inbi, inbj 
     194            WRITE(ctmp4,*) '   which MPI subdomains size is ', iimax, ijmax, iimax*ijmax 
     195            CALL ctl_warn( 'mpp_init:', '~~~~~~~~ ', ctmp1, ctmp2, ctmp3, ctmp4, '    --- YOU ARE WASTING CPU... ---' ) 
     196         ENDIF 
     197      ENDIF 
    198198       
    199199      ! look for land mpi subdomains... 
     
    653653      !!                    klcj       : second dimension 
    654654      !!---------------------------------------------------------------------- 
    655       INTEGER,                       INTENT(in   ) ::   knbi, knbj 
    656       INTEGER,                       INTENT(  out) ::   kimax, kjmax 
    657       INTEGER, DIMENSION(knbi,knbj), INTENT(  out) ::   kimppt, kjmppt 
    658       INTEGER, DIMENSION(knbi,knbj), INTENT(  out) ::   klci, klcj 
     655      INTEGER,                                 INTENT(in   ) ::   knbi, knbj 
     656      INTEGER,                                 INTENT(  out) ::   kimax, kjmax 
     657      INTEGER, DIMENSION(knbi,knbj), OPTIONAL, INTENT(  out) ::   kimppt, kjmppt 
     658      INTEGER, DIMENSION(knbi,knbj), OPTIONAL, INTENT(  out) ::   klci, klcj 
    659659      ! 
    660660      INTEGER ::   ji, jj 
     
    664664      ! 
    665665#if defined key_nemocice_decomp 
    666       jpimax = ( nx_global+2-2*nn_hls + (knbi-1) ) / knbi + 2*nn_hls    ! first  dim. 
    667       jpjmax = ( ny_global+2-2*nn_hls + (knbj-1) ) / knbj + 2*nn_hls    ! second dim.  
     666      kimax = ( nx_global+2-2*nn_hls + (knbi-1) ) / knbi + 2*nn_hls    ! first  dim. 
     667      kjmax = ( ny_global+2-2*nn_hls + (knbj-1) ) / knbj + 2*nn_hls    ! second dim.  
    668668#else 
    669669      kimax = ( jpiglo - 2*nn_hls + (knbi-1) ) / knbi + 2*nn_hls    ! first  dim. 
    670670      kjmax = ( jpjglo - 2*nn_hls + (knbj-1) ) / knbj + 2*nn_hls    ! second dim. 
    671671#endif 
     672      IF( .NOT. PRESENT(kimppt) ) RETURN 
    672673      ! 
    673674      !  1. Dimension arrays for subdomains 
Note: See TracChangeset for help on using the changeset viewer.