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 10436 – NEMO

Changeset 10436


Ignore:
Timestamp:
2018-12-21T09:21:40+01:00 (5 years ago)
Author:
smasson
Message:

trunk: bugfix in land-processor detection and minor cleanning

Location:
NEMO/trunk/src/OCE
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/LBC/mpp_nfd_generic.h90

    r10425 r10436  
    9090         !  to correct possible incoherent values on North fold lines from restart  
    9191 
    92          !!!!!!!!! temporary switch off this optimisation ==> force TRUE !!!!!!!! 
     92#if defined key_agrif 
     93         !!!!!!!!!           temporary switch off this optimisation ==> force TRUE           !!!!!!!! 
     94         !!!!!!!!!  needed to get the same results without agrif and with agrif and no zoom  !!!!!!!! 
     95         !!!!!!!!!                    I don't know why we must do that...                    !!!!!!!! 
    9396         l_full_nf_update = .TRUE. 
     97#endif 
    9498 
    9599         ! Two lines update (slower but necessary to avoid different values ion identical grid points 
  • NEMO/trunk/src/OCE/LBC/mppini.F90

    r10425 r10436  
    924924      !! ** Method  : read iproc strips (of length jpiglo) of the land-sea mask 
    925925      !!---------------------------------------------------------------------- 
    926       REAL(wp), INTENT(  out) :: propland    ! proportion of land points (between 0 and 1) 
     926      REAL(wp), INTENT(  out) :: propland    ! proportion of land points in the global domain (between 0 and 1) 
    927927      ! 
    928928      INTEGER, DIMENSION(jpni*jpnj) ::   kusedom_1d 
    929       INTEGER :: inboce  
     929      INTEGER :: inboce, iarea 
    930930      INTEGER :: iproc, idiv, ijsz 
    931       INTEGER :: ijstr, ijend, ijcnt 
     931      INTEGER :: ijstr 
    932932      LOGICAL, ALLOCATABLE, DIMENSION(:,:) ::   lloce 
    933933      !!---------------------------------------------------------------------- 
     
    941941      iproc = MINVAL( (/mppsize, jpjglo/2, 100/) )  ! read a least 2 lines, no more that 100 processes reading at the same time 
    942942       
    943       ! we want to read iproc strips of the land-sea mask. -> pick up iproc processes among mppsize processes 
     943      ! we want to read iproc strips of the land-sea mask. -> pick up iproc processes every idiv processes starting at 1 
    944944      IF( iproc == 1 ) THEN   ;   idiv = mppsize 
    945945      ELSE                    ;   idiv = ( mppsize - 1 ) / ( iproc - 1 ) 
    946946      ENDIF 
    947       ijsz = jpjglo / iproc 
    948       IF( narea <= MOD(jpjglo,iproc) ) ijsz = ijsz + 1 
    949        
    950       IF( MOD( narea-1, idiv ) == 0 .AND. (idiv /= 1 .OR. narea <= iproc ) ) THEN 
    951          ! 
    952          ijstr = (narea-1)*(jpjglo/iproc) + MIN(narea-1, MOD(jpjglo,iproc)) + 1 
    953          ijend = ijstr + ijsz - 1 
    954          ijcnt = ijend - ijstr + 1 
    955          ! 
    956          ALLOCATE( lloce(jpiglo, ijcnt) )   ! allocate the strip 
    957          CALL mpp_init_readbot_strip( ijstr, ijcnt, lloce ) 
    958          inboce = COUNT(lloce) 
     947 
     948      iarea = (narea-1)/idiv   ! involed process number (starting counting at 0) 
     949      IF( MOD( narea-1, idiv ) == 0 .AND. iarea < iproc ) THEN   ! beware idiv can be = to 1 
     950         ! 
     951         ijsz = jpjglo / iproc                                               ! width of the stripe to read 
     952         IF( iarea < MOD(jpjglo,iproc) ) ijsz = ijsz + 1 
     953         ijstr = iarea*(jpjglo/iproc) + MIN(iarea, MOD(jpjglo,iproc)) + 1    ! starting j position of the reading 
     954         ! 
     955         ALLOCATE( lloce(jpiglo, ijsz) )                                     ! allocate the strip 
     956         CALL mpp_init_readbot_strip( ijstr, ijsz, lloce ) 
     957         inboce = COUNT(lloce)                                               ! number of ocean point in the stripe 
    959958         DEALLOCATE(lloce) 
    960959         ! 
     
    962961         inboce = 0 
    963962      ENDIF 
    964       CALL mpp_sum( 'mppini', inboce ) 
     963      CALL mpp_sum( 'mppini', inboce )   ! total number of ocean points over the global domain 
    965964      ! 
    966965      propland = REAL( jpiglo*jpjglo - inboce, wp ) / REAL( jpiglo*jpjglo, wp )  
     
    978977      !! ** Method  : read knbj strips (of length jpiglo) of the land-sea mask 
    979978      !!---------------------------------------------------------------------- 
    980       INTEGER,                       INTENT(in   ) ::   knbi, knbj 
    981       LOGICAL, DIMENSION(knbi,knbj), INTENT(  out) ::   ldisoce   !  
    982       ! 
    983       INTEGER, DIMENSION(knbi,knbj) ::   inboce 
     979      INTEGER,                       INTENT(in   ) ::   knbi, knbj     ! domain decomposition 
     980      LOGICAL, DIMENSION(knbi,knbj), INTENT(  out) ::   ldisoce        ! .true. if a sub domain constains 1 ocean point  
     981      ! 
     982      INTEGER, DIMENSION(knbi,knbj) ::   inboce                        ! number oce oce pint in each mpi subdomain 
    984983      INTEGER, DIMENSION(knbi*knbj) ::   inboce_1d 
    985       INTEGER :: idiv, i2read, inj 
    986       INTEGER :: iimax, ijmax 
    987       INTEGER :: ji,jj 
    988       LOGICAL, ALLOCATABLE, DIMENSION(:,:) ::   lloce 
     984      INTEGER :: idiv, iimax, ijmax, iarea 
     985      INTEGER :: ji 
     986      LOGICAL, ALLOCATABLE, DIMENSION(:,:) ::   lloce                  ! lloce(i,j) = .true. if the point (i,j) is ocean  
    989987      INTEGER, ALLOCATABLE, DIMENSION(:,:) ::   iimppt, ilci 
    990988      INTEGER, ALLOCATABLE, DIMENSION(:,:) ::   ijmppt, ilcj 
     
    996994      ENDIF 
    997995 
    998       ! we want to read knbj strips of the land-sea mask. -> pick up knbj processes among mppsize processes 
     996      ! we want to read knbj strips of the land-sea mask. -> pick up knbj processes every idiv processes starting at 1 
    999997      IF( knbj == 1 ) THEN   ;   idiv = mppsize 
    1000998      ELSE                   ;   idiv = ( mppsize - 1 ) / ( knbj - 1 ) 
    1001999      ENDIF 
    1002       inboce(:,:) = 0 
    1003       IF( MOD( narea-1, idiv ) == 0 .AND. (idiv /= 1 .OR. narea <= knbj ) ) THEN 
     1000      inboce(:,:) = 0          ! default no ocean point found 
     1001      iarea = (narea-1)/idiv   ! involed process number (starting counting at 0) 
     1002      IF( MOD( narea-1, idiv ) == 0 .AND. iarea < knbj ) THEN   ! beware idiv can be = to 1 
    10041003         ! 
    10051004         ALLOCATE( iimppt(knbi,knbj), ijmppt(knbi,knbj), ilci(knbi,knbj), ilcj(knbi,knbj) ) 
    10061005         CALL mpp_basic_decomposition( knbi, knbj, iimax, ijmax, iimppt, ijmppt, ilci, ilcj ) 
    10071006         ! 
    1008          i2read = knbj / mppsize    ! strip number to be read by this process 
    1009          IF( ( narea - 1 ) / idiv < MOD(knbj,mppsize) ) i2read = i2read + 1 
    1010          DO jj = 1, i2read 
    1011             ! strip number to be read (from 1 to knbj) 
    1012             inj = ( narea - 1 ) * ( knbj / mppsize ) + MIN( MOD(knbj,mppsize), ( narea - 1 ) / idiv ) + jj 
    1013             ALLOCATE( lloce(jpiglo, ilcj(1,inj)) )                              ! allocate the strip 
    1014             CALL mpp_init_readbot_strip( ijmppt(1,inj), ilcj(1,inj), lloce )   ! read the strip 
    1015             DO  ji = 1, knbi 
    1016                inboce(ji,inj) = COUNT( lloce(iimppt(ji,1):iimppt(ji,1)+ilci(ji,1)-1,:) ) 
    1017             END DO 
    1018             DEALLOCATE(lloce) 
     1007         ALLOCATE( lloce(jpiglo, ilcj(1,iarea+1)) )                                         ! allocate the strip 
     1008         CALL mpp_init_readbot_strip( ijmppt(1,iarea+1), ilcj(1,iarea+1), lloce )           ! read the strip 
     1009         DO  ji = 1, knbi 
     1010            inboce(ji,iarea+1) = COUNT( lloce(iimppt(ji,1):iimppt(ji,1)+ilci(ji,1)-1,:) )   ! number of ocean point in a subdomain 
    10191011         END DO 
    10201012         ! 
     1013         DEALLOCATE(lloce) 
    10211014         DEALLOCATE(iimppt, ijmppt, ilci, ilcj) 
    10221015         ! 
     
    10261019      CALL mpp_sum( 'mppini', inboce_1d ) 
    10271020      inboce = RESHAPE(inboce_1d, (/knbi, knbj/)) 
    1028       ldisoce = inboce /= 0 
     1021      ldisoce(:,:) = inboce(:,:) /= 0 
    10291022      ! 
    10301023   END SUBROUTINE mpp_init_isoce 
     
    10411034      !! ** Method  : read stipe of size (jpiglo,...) 
    10421035      !!---------------------------------------------------------------------- 
    1043       INTEGER                         , INTENT(in   ) :: kjstr       !  
    1044       INTEGER                         , INTENT(in   ) :: kjcnt       !  
    1045       LOGICAL, DIMENSION(jpiglo,kjcnt), INTENT(  out) :: ldoce       !  
    1046       ! 
    1047       INTEGER                           ::   inumsave                     ! local logical unit 
     1036      INTEGER                         , INTENT(in   ) :: kjstr       ! starting j position of the reading 
     1037      INTEGER                         , INTENT(in   ) :: kjcnt       ! number of lines to read 
     1038      LOGICAL, DIMENSION(jpiglo,kjcnt), INTENT(  out) :: ldoce       ! ldoce(i,j) = .true. if the point (i,j) is ocean  
     1039      ! 
     1040      INTEGER                           ::   inumsave                ! local logical unit 
    10481041      REAL(wp), DIMENSION(jpiglo,kjcnt) ::   zbot, zbdy  
    10491042      !!---------------------------------------------------------------------- 
     
    10541047         CALL iom_get( numbot, jpdom_unknown, 'bottom_level', zbot, kstart = (/1,kjstr/), kcount = (/jpiglo, kjcnt/) ) 
    10551048      ELSE 
    1056          zbot(:,:) = 1.   ! put a non-null value 
    1057       ENDIF 
    1058  
    1059        IF( numbdy /= -1 ) THEN   ! Adjust with bdy_msk if it exists     
     1049         zbot(:,:) = 1.                         ! put a non-null value 
     1050      ENDIF 
     1051 
     1052       IF( numbdy /= -1 ) THEN                  ! Adjust with bdy_msk if it exists     
    10601053         CALL iom_get ( numbdy, jpdom_unknown, 'bdy_msk', zbdy, kstart = (/1,kjstr/), kcount = (/jpiglo, kjcnt/) ) 
    10611054         zbot(:,:) = zbot(:,:) * zbdy(:,:) 
    10621055      ENDIF 
    10631056      ! 
    1064       ldoce = zbot > 0. 
     1057      ldoce(:,:) = zbot(:,:) > 0. 
    10651058      numout = inumsave 
    10661059      ! 
  • NEMO/trunk/src/OCE/nemogcm.F90

    r10425 r10436  
    238238#endif 
    239239      ! 
    240       IF( nstop == 0 ) THEN   ;   STOP 0 
    241       ELSE                    ;   STOP 999 
     240      IF(lwm) THEN 
     241         IF( nstop == 0 ) THEN   ;   STOP 0 
     242         ELSE                    ;   STOP 999 
     243         ENDIF 
    242244      ENDIF 
    243245      ! 
Note: See TracChangeset for help on using the changeset viewer.