Changeset 5857 for branches/2015/dev_r5776_UKMO2_OBS_efficiency_improvs/NEMOGCM/NEMO/OPA_SRC/OBS/obs_mpp.F90
- Timestamp:
- 2015-11-02T18:28:38+01:00 (8 years ago)
- 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 13 13 !! obs_mpp_max_integer : Find maximum on all processors of each value in an integer on all processors 14 14 !! 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 15 16 !! obs_mpp_sum_integers : Sum an integer array from all processors 16 17 !! obs_mpp_sum_integer : Sum an integer from all processors … … 28 29 & obs_mpp_max_integer, & !: Find maximum across processors in an integer array 29 30 & 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 30 32 & obs_mpp_sum_integers, & !: Sum an integer array from all processors 31 33 & obs_mpp_sum_integer, & !: Sum an integer from all processors … … 227 229 END SUBROUTINE obs_mpp_find_obs_proc 228 230 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 257 INCLUDE '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 229 292 230 293 SUBROUTINE obs_mpp_sum_integers( kvalsin, kvalsout, kno )
Note: See TracChangeset
for help on using the changeset viewer.