# Changeset 13490

Ignore:
Timestamp:
2020-09-18T08:48:31+02:00 (4 months ago)
Message:

trunk: fix bestpartition in mppini, see #2526

File:
1 edited

Unmodified
Removed
• ## NEMO/trunk/src/OCE/LBC/mppini.F90

 r13438 !! ** Method  : !!---------------------------------------------------------------------- INTEGER,           INTENT(in   ) ::   knbij         ! total number if subdomains              (knbi*knbj) INTEGER,           INTENT(in   ) ::   knbij         ! total number of subdomains (knbi*knbj) INTEGER, OPTIONAL, INTENT(  out) ::   knbi, knbj    ! number if subdomains along i and j (knbi and knbj) INTEGER, OPTIONAL, INTENT(  out) ::   knbcnt        ! number of land subdomains INTEGER :: iszitst, iszjtst INTEGER :: isziref, iszjref INTEGER :: iszimin, iszjmin INTEGER :: inbij, iszij INTEGER :: inbimax, inbjmax, inbijmax, inbijold inbimax = 0 inbjmax = 0 isziref = Ni0glo*Nj0glo+1 iszjref = Ni0glo*Nj0glo+1 isziref = jpiglo*jpjglo+1   ! define a value that is larger than the largest possible iszjref = jpiglo*jpjglo+1 ! iszimin = 4*nn_hls          ! minimum size of the MPI subdomain so halos are always adressing neighbor inner domain iszjmin = 4*nn_hls IF( jperio == 3 .OR. jperio == 4 )   iszjmin = MAX(iszjmin, 2+3*nn_hls)   ! V and F folding must be outside of southern halos IF( jperio == 5 .OR. jperio == 6 )   iszjmin = MAX(iszjmin, 1+3*nn_hls)   ! V and F folding must be outside of southern halos ! ! get the list of knbi that gives a smaller jpimax than knbi-1 iszitst = ( nx_global+2-2*nn_hls + (ji-1) ) / ji + 2*nn_hls    ! first  dim. #else iszitst = ( Ni0glo + (ji-1) ) / ji iszitst = ( Ni0glo + (ji-1) ) / ji + 2*nn_hls   ! max subdomain i-size #endif IF( iszitst < isziref ) THEN IF( iszitst < isziref .AND. iszitst >= iszimin ) THEN isziref = iszitst inbimax = inbimax + 1 iszjtst = ( ny_global+2-2*nn_hls + (ji-1) ) / ji + 2*nn_hls    ! first  dim. #else iszjtst = ( Nj0glo + (ji-1) ) / ji iszjtst = ( Nj0glo + (ji-1) ) / ji + 2*nn_hls   ! max subdomain j-size #endif IF( iszjtst < iszjref ) THEN IF( iszjtst < iszjref .AND. iszjtst >= iszjmin ) THEN iszjref = iszjtst inbjmax = inbjmax + 1 isz0 = 0                                                  ! number of best partitions inbij = 1                                                 ! start with the min value of inbij1 => 1 iszij = Ni0glo*Nj0glo+1                                   ! default: larger than global domain iszij = jpiglo*jpjglo+1                                   ! default: larger than global domain DO WHILE( inbij <= inbijmax )                             ! if we did not reach the max of inbij1 ii = MINLOC(iszij1, mask = inbij1 == inbij, dim = 1)   ! warning: send back the first occurence if multiple results IF ( iszij1(ii) < iszij ) THEN ii = MINLOC( iszi1+iszj1, mask = iszij1 == iszij1(ii) .AND. inbij1 == inbij, dim = 1)  ! select the smaller perimeter if multiple min isz0 = isz0 + 1 indexok(isz0) = ii
Note: See TracChangeset for help on using the changeset viewer.