find_obs_proc.h90 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. !!----------------------------------------------------------------------
  2. !! NEMO/OPA 3.3 , NEMO Consortium (2010)
  3. !! $Id: find_obs_proc.h90 2287 2010-10-18 07:53:52Z smasson $
  4. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  5. !!----------------------------------------------------------------------
  6. SUBROUTINE find_obs_proc(kldi,klei,kldj,klej,kmyproc,kobsp,kobsi,kobsj,kno)
  7. !!----------------------------------------------------------------------
  8. !! *** ROUTINE find_obs_proc ***
  9. !!
  10. !! ** Purpose : From the array kobsp containing the results of the grid
  11. !! grid search on each processor the processor return a
  12. !! decision of which processors should hold the observation.
  13. !!
  14. !! ** Method : Use i and j and halo regions to decide which processor to
  15. !! put ob in. Intended to avoid the mpp calls required by
  16. !! obs_mpp_find_obs_proc
  17. !!
  18. !! History :
  19. !!! 03-08 (D. Lea) Original code
  20. !!-----------------------------------------------------------------------
  21. !! * Arguments
  22. INTEGER, INTENT(IN) :: kldi ! Start of inner domain in i
  23. INTEGER, INTENT(IN) :: klei ! End of inner domain in i
  24. INTEGER, INTENT(IN) :: kldj ! Start of inner domain in j
  25. INTEGER, INTENT(IN) :: klej ! End of inner domain in j
  26. INTEGER, INTENT(IN) :: kmyproc
  27. INTEGER, INTENT(IN) :: kno
  28. INTEGER, DIMENSION(kno), INTENT(IN) :: kobsi
  29. INTEGER, DIMENSION(kno), INTENT(IN) :: kobsj
  30. INTEGER, DIMENSION(kno), INTENT(INOUT) :: kobsp
  31. !! * local variables
  32. INTEGER :: &
  33. & ji
  34. ! first and last indoor i- and j-indexes kldi, klei, kldj, klej
  35. ! exclude any obs in the bottom-left overlap region
  36. ! also any obs outside to whole region (defined by nlci and nlcj)
  37. ! I am assuming that kobsp does not need to be the correct processor
  38. ! number
  39. DO ji = 1, kno
  40. IF (kobsi(ji) < kldi .OR. kobsj(ji) < kldj &
  41. .OR. kobsi(ji) > klei .OR. kobsj(ji) > klej) THEN
  42. IF (lwp .AND. kobsp(ji) /= -1) WRITE(numout,*) &
  43. & 'kobs: ',kobsi(ji), kobsj(ji), kobsp(ji)
  44. kobsp(ji)=1000000
  45. ENDIF
  46. END DO
  47. ! Ensure that observations not in processor are masked
  48. WHERE(kobsp(:) /= kmyproc) kobsp(:)=1000000
  49. END SUBROUTINE find_obs_proc