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 10542 for NEMO/trunk/src/OCE/LBC/mppini.F90 – NEMO

Ignore:
Timestamp:
2019-01-17T16:57:40+01:00 (5 years ago)
Author:
smasson
Message:

trunk: improve NP folding balance, see #2214

File:
1 edited

Legend:

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

    r10436 r10542  
    670670      ! 
    671671      INTEGER ::   ji, jj 
    672       INTEGER ::   iresti, irestj 
     672      INTEGER ::   iresti, irestj, irm, ijpjmin 
    673673      INTEGER ::   ireci, irecj 
    674674      !!---------------------------------------------------------------------- 
     
    705705      klci(1:iresti      ,:) = kimax 
    706706      klci(iresti+1:knbi ,:) = kimax-1 
    707       klcj(:,      1:irestj) = kjmax 
    708       klcj(:, irestj+1:knbj) = kjmax-1 
     707      IF( MINVAL(klci) < 3 ) THEN 
     708         WRITE(ctmp1,*) '   mpp_basic_decomposition: minimum value of jpi must be >= 3' 
     709         WRITE(ctmp2,*) '   We have ', MINVAL(klci) 
     710        CALL ctl_stop( 'STOP', ctmp1, ctmp2 ) 
     711      ENDIF 
     712      IF( jperio == 3 .OR. jperio == 4 .OR. jperio == 5 .OR. jperio == 6 ) THEN 
     713         ! minimize the size of the last row to compensate for the north pole folding coast 
     714         IF( jperio == 3 .OR. jperio == 4 )   ijpjmin = 5   ! V and F folding involves line jpj-3 that must not be south boundary 
     715         IF( jperio == 5 .OR. jperio == 6 )   ijpjmin = 4   ! V and F folding involves line jpj-2 that must not be south boundary 
     716         irm = knbj - irestj                                    ! total number of lines to be removed 
     717         klcj(:,            knbj) = MAX( ijpjmin, kjmax-irm )   ! we must have jpj >= ijpjmin in the last row 
     718         irm = irm - ( kjmax - klcj(1,knbj) )                   ! remaining number of lines to remove  
     719         irestj = knbj - 1 - irm                         
     720         klcj(:,        1:irestj) = kjmax 
     721         klcj(:, irestj+1:knbj-1) = kjmax-1 
     722      ELSE 
     723         ijpjmin = 3 
     724         klcj(:,      1:irestj) = kjmax 
     725         klcj(:, irestj+1:knbj) = kjmax-1 
     726      ENDIF 
     727      IF( MINVAL(klcj) < ijpjmin ) THEN 
     728         WRITE(ctmp1,*) '   mpp_basic_decomposition: minimum value of jpj must be >= ', ijpjmin 
     729         WRITE(ctmp2,*) '   We have ', MINVAL(klcj) 
     730         CALL ctl_stop( 'STOP', ctmp1, ctmp2 ) 
     731      ENDIF 
    709732#endif 
    710733 
Note: See TracChangeset for help on using the changeset viewer.