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