Changeset 10422
- Timestamp:
- 2018-12-19T22:34:53+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/LBC/mppini.F90
r10409 r10422 149 149 INTEGER :: iarea0 ! - - 150 150 INTEGER :: ierr, ios ! 151 INTEGER :: inbi, inbj, iimax, ijmax ! 151 INTEGER :: inbi, inbj, iimax, ijmax, icnt1, icnt2 152 LOGICAL :: llbest 152 153 INTEGER, ALLOCATABLE, DIMENSION(:) :: iin, ii_nono, ii_noea ! 1D workspace 153 154 INTEGER, ALLOCATABLE, DIMENSION(:) :: ijn, ii_noso, ii_nowe ! - - … … 184 185 IF( jpni < 1 .OR. jpnj < 1 ) THEN 185 186 CALL mpp_init_bestpartition( mppsize, jpni, jpnj ) 187 llbest = .TRUE. 186 188 ELSE 187 CALL mpp_init_bestpartition( mppsize, inbi, inbj )189 CALL mpp_init_bestpartition( mppsize, inbi, inbj, icnt2 ) 188 190 CALL mpp_basic_decomposition( jpni, jpnj, jpimax, jpjmax ) 189 191 CALL mpp_basic_decomposition( inbi, inbj, iimax, ijmax ) 190 192 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... ---' ) 193 llbest = .FALSE. 194 icnt1 = jpni*jpnj - mppsize 195 WRITE(ctmp1,9000) ' The chosen domain decomposition ', jpni, ' x ', jpnj, ' with ', icnt1, ' land sub-domains' 196 WRITE(ctmp2,9000) ' has larger MPI subdomains (jpi = ', jpimax, ', jpj = ', jpjmax, ', jpi*jpj = ', jpimax*jpjmax, ')' 197 WRITE(ctmp3,9000) ' than the following domain decompostion ', inbi, ' x ', inbj, ' with ', icnt2, ' land sub-domains' 198 WRITE(ctmp4,9000) ' which MPI subdomains size is jpi = ', iimax, ', jpj = ', ijmax, ', jpi*jpj = ', iimax*ijmax, ' ' 199 CALL ctl_warn( 'mpp_init:', '~~~~~~~~ ', ctmp1, ctmp2, ctmp3, ctmp4, ' ', ' --- YOU ARE WASTING CPU... ---', ' ' ) 200 ELSE 201 llbest = .TRUE. 196 202 ENDIF 197 203 ENDIF … … 203 209 204 210 IF( mppsize < inijmin ) THEN 205 WRITE(ctmp1, *) ' With this specified domain decomposition: jpni =', jpni, ' jpnj =', jpnj206 WRITE(ctmp2, *) ' we can eliminate only ', jpni*jpnj - inijmin, ' land mpi subdomains therefore '207 WRITE(ctmp3, *) ' the number of ocean mpi subdomains (', inijmin,') exceed the number of MPI processes:', mppsize211 WRITE(ctmp1,9001) ' With this specified domain decomposition: jpni = ', jpni, ' jpnj = ', jpnj 212 WRITE(ctmp2,9002) ' we can eliminate only ', jpni*jpnj - inijmin, ' land mpi subdomains therefore ' 213 WRITE(ctmp3,9001) ' the number of ocean mpi subdomains (', inijmin,') exceed the number of MPI processes:', mppsize 208 214 WRITE(ctmp4,*) ' ==>>> There is the list of best domain decompositions you should use: ' 209 215 CALL ctl_stop( 'mpp_init:', '~~~~~~~~ ', ctmp1, ctmp2, ctmp3, ctmp4 ) … … 213 219 214 220 IF( mppsize > jpni*jpnj ) THEN 215 WRITE(ctmp1, *) ' The number of mpi processes: ', mppsize216 WRITE(ctmp2, *) ' exceeds the maximum number of subdomains (ocean+land) = ', jpni*jpnj217 WRITE(ctmp3, *) ' defined by the following domain decomposition: jpni =', jpni, ' jpnj =', jpnj221 WRITE(ctmp1,9003) ' The number of mpi processes: ', mppsize 222 WRITE(ctmp2,9003) ' exceeds the maximum number of subdomains (ocean+land) = ', jpni*jpnj 223 WRITE(ctmp3,9001) ' defined by the following domain decomposition: jpni = ', jpni, ' jpnj = ', jpnj 218 224 WRITE(ctmp4,*) ' ==>>> There is the list of best domain decompositions you should use: ' 219 225 CALL ctl_stop( 'mpp_init:', '~~~~~~~~ ', ctmp1, ctmp2, ctmp3, ctmp4 ) … … 224 230 jpnij = mppsize ! force jpnij definition <-- remove as much land subdomains as needed to reach this condition 225 231 IF( mppsize > inijmin ) THEN 226 WRITE(ctmp1, *) ' The number of mpi processes: ', mppsize227 WRITE(ctmp2, *) ' exceeds the maximum number of ocean subdomains = ', inijmin228 WRITE(ctmp3, *) ' we suppressed ', jpni*jpnj - mppsize, ' land subdomains '229 WRITE(ctmp4, *) ' BUT we had to keep ', mppsize - inijmin, ' land subdomains that are useless...'230 CALL ctl_warn( 'mpp_init:', '~~~~~~~~ ', ctmp1, ctmp2, ctmp3, ctmp4 )232 WRITE(ctmp1,9003) ' The number of mpi processes: ', mppsize 233 WRITE(ctmp2,9003) ' exceeds the maximum number of ocean subdomains = ', inijmin 234 WRITE(ctmp3,9002) ' we suppressed ', jpni*jpnj - mppsize, ' land subdomains ' 235 WRITE(ctmp4,9002) ' BUT we had to keep ', mppsize - inijmin, ' land subdomains that are useless...' 236 CALL ctl_warn( 'mpp_init:', '~~~~~~~~ ', ctmp1, ctmp2, ctmp3, ctmp4, ' ', ' --- YOU ARE WASTING CPU... ---', ' ' ) 231 237 ELSE ! mppsize = inijmin 232 238 IF(lwp) THEN 233 WRITE(numout,*) 'mpp_init: You use an optimal domain decomposition'239 IF(llbest) WRITE(numout,*) 'mpp_init: You use an optimal domain decomposition' 234 240 WRITE(numout,*) '~~~~~~~~ ' 235 WRITE(numout,*) ' Number of mpi processes: ', mppsize 236 WRITE(numout,*) ' Number of ocean subdomains = ', inijmin 237 WRITE(numout,*) ' Number of suppressed land subdomains = ', jpni*jpnj - inijmin 238 ENDIF 239 ENDIF 241 WRITE(numout,9003) ' Number of mpi processes: ', mppsize 242 WRITE(numout,9003) ' Number of ocean subdomains = ', inijmin 243 WRITE(numout,9003) ' Number of suppressed land subdomains = ', jpni*jpnj - inijmin 244 WRITE(numout,*) 245 ENDIF 246 ENDIF 247 9000 FORMAT (a, i4, a, i4, a, i7, a) 248 9001 FORMAT (a, i4, a, i4) 249 9002 FORMAT (a, i4, a) 250 9003 FORMAT (a, i5) 240 251 241 252 IF( numbot /= -1 ) CALL iom_close( numbot ) … … 722 733 723 734 724 SUBROUTINE mpp_init_bestpartition( knbij, knbi, knbj, ldlist )735 SUBROUTINE mpp_init_bestpartition( knbij, knbi, knbj, knbcnt, ldlist ) 725 736 !!---------------------------------------------------------------------- 726 737 !! *** ROUTINE mpp_init_bestpartition *** … … 732 743 INTEGER, INTENT(in ) :: knbij ! total number if subdomains (knbi*knbj) 733 744 INTEGER, OPTIONAL, INTENT( out) :: knbi, knbj ! number if subdomains along i and j (knbi and knbj) 745 INTEGER, OPTIONAL, INTENT( out) :: knbcnt ! number of land subdomains 734 746 LOGICAL, OPTIONAL, INTENT(in ) :: ldlist ! .true.: print the list the best domain decompositions (with land) 735 747 ! … … 831 843 knbi = inbi1(ii) 832 844 knbj = inbj1(ii) 845 IF(PRESENT(knbcnt)) knbcnt = 0 833 846 DEALLOCATE( inbi1, inbj1, inbij1, iszi1, iszj1, iszij1 ) 834 847 RETURN … … 897 910 knbi = inbi0(ii) 898 911 knbj = inbj0(ii) 912 IF(PRESENT(knbcnt)) knbcnt = knbi * knbj - inbij 899 913 DEALLOCATE( inbi0, inbj0 ) 900 914 !
Note: See TracChangeset
for help on using the changeset viewer.