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 8196 for branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/LBC/mpp_nfd_generic.h90 – NEMO

Ignore:
Timestamp:
2017-06-20T17:01:49+02:00 (7 years ago)
Author:
acc
Message:

Branch 2017/dev_r8126_ROBUST08_no_ghost. Add generic routine for the north fold operation without global width arrays or MPI_ALLGATHER operations (lbc_nfd_nogather_generic.h90). Actually the generic form is not strictly neccessary since only the 4d array version is used. Other possibilities are currently commented out. This commit includes fixes to mpp_nfd_generic.h90 which ensure only necessary arrays are allocated depending on ln_nnogather setting. Tested with ORCA2LIMPIS_LONG SETTE test and produces identical results with ln_nnogather true or false.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OPA_SRC/LBC/mpp_nfd_generic.h90

    r8186 r8196  
    7373      ipj   = 4            ! 2nd dimension of message transfers (last j-lines) 
    7474      ! 
    75       ALLOCATE( ztab   (jpiglo,4,ipk,ipl,ipf) , znorthloc  (jpi         ,4,ipk,ipl,ipf)      ) 
    76       ALLOCATE( zfoldwk(jpi   ,4,ipk,ipl,ipf) , znorthgloio(jpi         ,4,ipk,ipl,ipf,jpni) ) 
    77       ALLOCATE( ztabl  (jpi   ,4,ipk,ipl,ipf) , ztabr      (jpi*jpmaxngh,4,ipk,ipl,ipf)      )  
     75      ALLOCATE( znorthloc(jpi,4,ipk,ipl,ipf) ) 
    7876      ! 
    7977      znorthloc(:,:,:,:,:) = 0._wp 
    8078      ! 
    81       DO jf = 1, ipf                ! put in xnorthloc the last ipj j-lines of ptab 
     79      DO jf = 1, ipf                ! put in znorthloc the last ipj j-lines of ptab 
    8280         DO jl = 1, ipl 
    8381            DO jk = 1, ipk 
     
    9088      END DO 
    9189      ! 
    92       !                             ! Build in procs of ncomm_north the znorthgloio 
    9390      ! 
    9491      itaille = jpi * ipj * ipk * ipl * ipf 
    9592      ! 
    9693      IF( l_north_nogather ) THEN      !==  ????  ==! 
     94         ALLOCATE( zfoldwk(jpi,4,ipk,ipl,ipf) ) 
     95         ALLOCATE( ztabl(jpi   ,4,ipk,ipl,ipf) , ztabr(jpi*jpmaxngh,4,ipk,ipl,ipf) )  
    9796         ! 
    9897         ztabr(:,:,:,:,:) = 0._wp 
     
    158157            END DO 
    159158         ENDIF 
    160 !!gm ERROR         CALL mpp_lbc_nfd( ztabl, ztabr, cd_nat, psgn )   ! North fold boundary condition 
     159         DO jf = 1, ipf 
     160            CALL lbc_nfd_nogather( ztabl(:,:,:,:,jf), ztabr(:,:,:,:,jf), cd_nat LBC_ARG, psgn LBC_ARG )   ! North fold boundary condition 
     161         END DO 
    161162         DO jf = 1, ipf 
    162163            DO jl = 1, ipl 
     
    172173         END DO 
    173174         ! 
     175         DEALLOCATE( zfoldwk ) 
     176         DEALLOCATE( ztabl, ztabr )  
    174177      ELSE                             !==  ????  ==! 
     178         ALLOCATE( ztab       (jpiglo,4,ipk,ipl,ipf     ) ) 
     179         ALLOCATE( znorthgloio(jpi   ,4,ipk,ipl,ipf,jpni) ) 
    175180         ! 
    176181         CALL MPI_ALLGATHER( znorthloc  , itaille, MPI_DOUBLE_PRECISION,                & 
     
    212217         END DO 
    213218         ! 
     219      ! 
     220         DEALLOCATE( ztab ) 
     221         DEALLOCATE( znorthgloio ) 
    214222      ENDIF 
    215223      ! 
     
    221229      ! this domain will be identical. 
    222230      ! 
    223       DEALLOCATE( ztab, znorthloc, zfoldwk, znorthgloio ) 
    224       DEALLOCATE( ztabl, ztabr )  
     231      DEALLOCATE( znorthloc ) 
    225232      ! 
    226233   END SUBROUTINE ROUTINE_NFD 
Note: See TracChangeset for help on using the changeset viewer.