Changeset 6018
- Timestamp:
- 2015-12-08T11:39:37+01:00 (9 years ago)
- Location:
- branches/2015/dev_r5776_UKMO2_OBS_efficiency_improvs/NEMOGCM
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2015/dev_r5776_UKMO2_OBS_efficiency_improvs/NEMOGCM/CONFIG/SHARED/namelist_ref
r5857 r6018 1215 1215 ln_velhradcp = .false. ! Logical switch for velocity high freq. ADCP 1216 1216 ln_velfb = .false. ! Logical switch for feedback velocity data 1217 ln_grid_global = . false. ! Global distribtion of observations1217 ln_grid_global = .true. ! Global distribtion of observations 1218 1218 ln_grid_search_lookup = .false. ! Logical switch for obs grid search w/lookup table 1219 1219 grid_search_file = 'grid_search' ! Grid search lookup file header -
branches/2015/dev_r5776_UKMO2_OBS_efficiency_improvs/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90
r5857 r6018 463 463 RETURN 464 464 ENDIF 465 466 IF ( ln_grid_global ) THEN 467 CALL ctl_warn( 'ln_grid_global=T may cause memory issues when used with a large number of processors' ) 468 ENDIF 465 469 466 470 CALL obs_typ_init -
branches/2015/dev_r5776_UKMO2_OBS_efficiency_improvs/NEMOGCM/NEMO/OPA_SRC/OBS/obs_grd_bruteforce.h90
r5857 r6018 325 325 CALL obs_mpp_max_integer( kobsj, kobs ) 326 326 ELSE 327 CALL obs_mpp_find_obs_proc _local( kproc, kobs )327 CALL obs_mpp_find_obs_proc( kproc, kobs ) 328 328 ENDIF 329 329 -
branches/2015/dev_r5776_UKMO2_OBS_efficiency_improvs/NEMOGCM/NEMO/OPA_SRC/OBS/obs_grid.F90
r5857 r6018 21 21 USE dom_oce ! Ocean space and time domain variables 22 22 USE obs_mpp, ONLY : & ! MPP support routines for observation diagnostics 23 & obs_mpp_find_obs_proc _local, &23 & obs_mpp_find_obs_proc, & 24 24 & mpp_global_max, & 25 25 & obs_mpp_max_integer … … 613 613 CALL obs_mpp_max_integer( kobsj, kobs ) 614 614 ELSE 615 CALL obs_mpp_find_obs_proc _local( kproc, kobs )615 CALL obs_mpp_find_obs_proc( kproc, kobs ) 616 616 ENDIF 617 617 -
branches/2015/dev_r5776_UKMO2_OBS_efficiency_improvs/NEMOGCM/NEMO/OPA_SRC/OBS/obs_mpp.F90
r5943 r6018 7 7 !! - ! 2006-05 (K. Mogensen) Reformatted 8 8 !! - ! 2008-01 (K. Mogensen) add mpp_global_max 9 !! 3.6 ! 2015-01 (J. Waters) obs_mpp_find_obs_proc 10 !! rewritten to avoid global arrays 9 11 !!---------------------------------------------------------------------- 10 12 # define mpivar mpi_double_precision … … 12 14 !! obs_mpp_bcast_integer : Broadcast an integer array from a processor to all processors 13 15 !! obs_mpp_max_integer : Find maximum on all processors of each value in an integer on all processors 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 16 !! obs_mpp_find_obs_proc : Find processors which should hold the observations, avoiding global arrays 16 17 !! obs_mpp_sum_integers : Sum an integer array from all processors 17 18 !! obs_mpp_sum_integer : Sum an integer from all processors … … 29 30 & obs_mpp_max_integer, & !: Find maximum across processors in an integer array 30 31 & 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 observations32 32 & obs_mpp_sum_integers, & !: Sum an integer array from all processors 33 33 & obs_mpp_sum_integer, & !: Sum an integer from all processors … … 113 113 114 114 115 SUBROUTINE obs_mpp_find_obs_proc( kobsp, kobsi, kobsj, kno ) 116 !!---------------------------------------------------------------------- 117 !! *** ROUTINE obs_mpp_find_obs_proc *** 118 !! 119 !! ** Purpose : From the array kobsp containing the results of the grid 120 !! grid search on each processor the processor return a 121 !! decision of which processors should hold the observation. 122 !! 123 !! ** Method : A temporary 2D array holding all the decisions is 124 !! constructed using mpi_allgather on each processor. 125 !! If more than one processor has found the observation 126 !! with the observation in the inner domain gets it 127 !! 128 !! ** Action : This does only work for MPI. 129 !! It does not work for SHMEM. 130 !! 131 !! References : http://www.mpi-forum.org 132 !!---------------------------------------------------------------------- 133 INTEGER , INTENT(in ) :: kno 134 INTEGER, DIMENSION(kno), INTENT(in ) :: kobsi, kobsj 135 INTEGER, DIMENSION(kno), INTENT(inout) :: kobsp 136 ! 137 #if defined key_mpp_mpi 138 ! 139 INTEGER :: ji 140 INTEGER :: jj 141 INTEGER :: size 142 INTEGER :: ierr 143 INTEGER :: iobsip 144 INTEGER :: iobsjp 145 INTEGER :: num_sus_obs 146 INTEGER, DIMENSION(kno) :: iobsig, iobsjg 147 INTEGER, ALLOCATABLE, DIMENSION(:,:) :: iobsp, iobsi, iobsj 148 !! 149 INCLUDE 'mpif.h' 150 !!---------------------------------------------------------------------- 151 152 !----------------------------------------------------------------------- 153 ! Call the MPI library to find the maximum accross processors 154 !----------------------------------------------------------------------- 155 CALL mpi_comm_size( mpi_comm_opa, size, ierr ) 156 !----------------------------------------------------------------------- 157 ! Convert local grids points to global grid points 158 !----------------------------------------------------------------------- 159 DO ji = 1, kno 160 IF ( ( kobsi(ji) >= 1 ) .AND. ( kobsi(ji) <= jpi ) .AND. & 161 & ( kobsj(ji) >= 1 ) .AND. ( kobsj(ji) <= jpj ) ) THEN 162 iobsig(ji) = mig( kobsi(ji) ) 163 iobsjg(ji) = mjg( kobsj(ji) ) 164 ELSE 165 iobsig(ji) = -1 166 iobsjg(ji) = -1 167 ENDIF 168 END DO 169 !----------------------------------------------------------------------- 170 ! Get the decisions from all processors 171 !----------------------------------------------------------------------- 172 ALLOCATE( iobsp(kno,size) ) 173 ALLOCATE( iobsi(kno,size) ) 174 ALLOCATE( iobsj(kno,size) ) 175 CALL mpi_allgather( kobsp, kno, mpi_integer, & 176 & iobsp, kno, mpi_integer, & 177 & mpi_comm_opa, ierr ) 178 CALL mpi_allgather( iobsig, kno, mpi_integer, & 179 & iobsi, kno, mpi_integer, & 180 & mpi_comm_opa, ierr ) 181 CALL mpi_allgather( iobsjg, kno, mpi_integer, & 182 & iobsj, kno, mpi_integer, & 183 & mpi_comm_opa, ierr ) 184 185 !----------------------------------------------------------------------- 186 ! Find the processor with observations from the lowest processor 187 ! number among processors holding the observation. 188 !----------------------------------------------------------------------- 189 kobsp(:) = -1 190 num_sus_obs = 0 191 DO ji = 1, kno 192 DO jj = 1, size 193 IF ( ( kobsp(ji) == -1 ) .AND. ( iobsp(ji,jj) /= -1 ) ) THEN 194 kobsp(ji) = iobsp(ji,jj) 195 iobsip = iobsi(ji,jj) 196 iobsjp = iobsj(ji,jj) 197 ENDIF 198 IF ( ( kobsp(ji) /= -1 ) .AND. ( iobsp(ji,jj) /= -1 ) ) THEN 199 IF ( ( iobsip /= iobsi(ji,jj) ) .OR. & 200 & ( iobsjp /= iobsj(ji,jj) ) ) THEN 201 IF ( ( kobsp(ji) < 1000000 ) .AND. & 202 & ( iobsp(ji,jj) < 1000000 ) ) THEN 203 num_sus_obs=num_sus_obs+1 204 ENDIF 205 ENDIF 206 IF ( mppmap(iobsip,iobsjp) /= ( kobsp(ji)+1 ) ) THEN 207 IF ( ( iobsi(ji,jj) /= -1 ) .AND. & 208 & ( iobsj(ji,jj) /= -1 ) ) THEN 209 IF ((mppmap(iobsi(ji,jj),iobsj(ji,jj)) == (iobsp(ji,jj)+1))& 210 & .OR. ( iobsp(ji,jj) < kobsp(ji) ) ) THEN 211 kobsp(ji) = iobsp(ji,jj) 212 iobsip = iobsi(ji,jj) 213 iobsjp = iobsj(ji,jj) 214 ENDIF 215 ENDIF 216 ENDIF 217 ENDIF 218 END DO 219 END DO 220 IF (lwp) WRITE(numout,*) 'Number of suspicious observations: ',num_sus_obs 221 222 DEALLOCATE( iobsj ) 223 DEALLOCATE( iobsi ) 224 DEALLOCATE( iobsp ) 225 #else 226 ! no MPI: empty routine 227 #endif 228 ! 229 END SUBROUTINE obs_mpp_find_obs_proc 230 231 SUBROUTINE obs_mpp_find_obs_proc_local( kobsp,kno ) 232 !!---------------------------------------------------------------------- 233 !! *** ROUTINE obs_mpp_find_obs_proc_local *** 115 SUBROUTINE obs_mpp_find_obs_proc( kobsp,kno ) 116 !!---------------------------------------------------------------------- 117 !! *** ROUTINE obs_mpp_find_obs_proc *** 234 118 !! 235 119 !! ** Purpose : From the array kobsp containing the results of the grid … … 256 140 INTEGER, DIMENSION(kno) :: iobsp 257 141 !! 258 INCLUDE 'mpif.h'259 142 !! 260 143 … … 289 172 #endif 290 173 291 END SUBROUTINE obs_mpp_find_obs_proc _local174 END SUBROUTINE obs_mpp_find_obs_proc 292 175 293 176
Note: See TracChangeset
for help on using the changeset viewer.