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 5857 for branches/2015/dev_r5776_UKMO2_OBS_efficiency_improvs/NEMOGCM/NEMO/OPA_SRC/OBS/obs_mpp.F90 – NEMO

Ignore:
Timestamp:
2015-11-02T18:28:38+01:00 (8 years ago)
Author:
jenniewaters
Message:

Removing global arrays when ln_grid_global=.false.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5776_UKMO2_OBS_efficiency_improvs/NEMOGCM/NEMO/OPA_SRC/OBS/obs_mpp.F90

    r2513 r5857  
    1313   !! obs_mpp_max_integer   : Find maximum on all processors of each value in an integer on all processors 
    1414   !! obs_mpp_find_obs_proc : Find processors which should hold the observations 
     15   !! obs_mpp_find_obs_proc_local : Find processors which should hold the observations, avoiding global arrays 
    1516   !! obs_mpp_sum_integers  : Sum an integer array from all processors 
    1617   !! obs_mpp_sum_integer   : Sum an integer from all processors 
     
    2829      &   obs_mpp_max_integer,   & !: Find maximum across processors in an integer array 
    2930      &   obs_mpp_find_obs_proc, & !: Find processors which should hold the observations 
     31      &   obs_mpp_find_obs_proc_local, & !: Find processors which should hold the observations 
    3032      &   obs_mpp_sum_integers,  & !: Sum an integer array from all processors 
    3133      &   obs_mpp_sum_integer,   & !: Sum an integer from all processors 
     
    227229   END SUBROUTINE obs_mpp_find_obs_proc 
    228230 
     231   SUBROUTINE obs_mpp_find_obs_proc_local( kobsp,kno ) 
     232      !!---------------------------------------------------------------------- 
     233      !!               ***  ROUTINE obs_mpp_find_obs_proc_local *** 
     234      !!          
     235      !! ** Purpose : From the array kobsp containing the results of the grid 
     236      !!              grid search on each processor the processor return a 
     237      !!              decision of which processors should hold the observation. 
     238      !! 
     239      !! ** Method  : Synchronize the processor number for each obs using 
     240      !!              obs_mpp_max_integer. If an observation exists on two  
     241      !!              processors it will be allocated to the lower numbered 
     242      !!              processor. 
     243      !! 
     244      !! ** Action  : This does only work for MPI. 
     245      !!              It does not work for SHMEM. 
     246      !! 
     247      !! References : http://www.mpi-forum.org 
     248      !!---------------------------------------------------------------------- 
     249      INTEGER                , INTENT(in   ) ::   kno 
     250      INTEGER, DIMENSION(kno), INTENT(inout) ::   kobsp 
     251      ! 
     252#if defined key_mpp_mpi 
     253      ! 
     254      ! 
     255      INTEGER :: ji, isum 
     256      INTEGER, DIMENSION(kno) ::   iobsp 
     257INCLUDE 'mpif.h' 
     258      !! 
     259 
     260      iobsp=kobsp 
     261 
     262      WHERE( iobsp(:) == -1 ) 
     263         iobsp(:) = 9999999 
     264      END WHERE 
     265 
     266      iobsp=-1*iobsp 
     267 
     268      CALL obs_mpp_max_integer( iobsp, kno ) 
     269 
     270      kobsp=-1*iobsp 
     271 
     272      isum=0 
     273      DO ji = 1, kno 
     274         IF ( kobsp(ji) == 9999999 ) THEN 
     275            isum=isum+1 
     276            kobsp(ji)=-1 
     277         ENDIF 
     278      ENDDO 
     279 
     280 
     281      IF ( isum > 0 ) THEN 
     282         IF (lwp) WRITE(numout,*) isum, ' observations failed the grid search.' 
     283         IF (lwp) WRITE(numout,*)'If ln_grid_search_lookup=.TRUE., try reducing grid_search_res' 
     284      ENDIF 
     285 
     286#else 
     287      ! no MPI: empty routine 
     288#endif      
     289       
     290   END SUBROUTINE obs_mpp_find_obs_proc_local 
     291 
    229292 
    230293   SUBROUTINE obs_mpp_sum_integers( kvalsin, kvalsout, kno ) 
Note: See TracChangeset for help on using the changeset viewer.