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.
obs_level_search.h90 in branches/devukmo2010/NEMO/OPA_SRC/OBS – NEMO

source: branches/devukmo2010/NEMO/OPA_SRC/OBS/obs_level_search.h90 @ 2128

Last change on this file since 2128 was 2128, checked in by rfurner, 14 years ago

merged branches OBS, ASM, Rivers, BDY & mixed_dynldf ready for vn3.3 merge

File size: 1.7 KB
Line 
1   SUBROUTINE obs_level_search( kgrd, pgrddep, kobs, pobsdep, kobsk )
2      !!----------------------------------------------------------------------
3      !!                    ***  ROUTINE obs_level_search ***
4      !!
5      !! ** Purpose : Search levels to find matching level to observed depth
6      !!
7      !! ** Method  : Straightforward search
8      !!
9      !! ** Action  :
10      !!
11      !! History :
12      !!        !  2001-11  (N. Daget, A. Weaver)
13      !!        !  2006-03  (A. Weaver) NEMOVAR migration.
14      !!        !  2006-05  (K. Mogensen) Moved to to separate routine.
15      !!        !  2006-10  (A. Weaver) Cleanup
16      !!        !  2008-10  (K. Mogensen) Remove assumptions on grid.
17      !!----------------------------------------------------------------------
18
19      !! * Arguments
20      INTEGER, INTENT(IN) :: kgrd     ! Number of gridpoints
21      REAL(KIND=wp), DIMENSION(kgrd), INTENT(INOUT) :: &
22         &   pgrddep  ! Depths of gridpoints
23      INTEGER, INTENT(IN) :: &
24         &   kobs     ! Number of observations
25      REAL(KIND=wp), DIMENSION(kobs), INTENT(INOUT) :: &
26         &   pobsdep  ! Depths of observations
27      INTEGER ,DIMENSION(kobs), INTENT(OUT) :: &
28         &   kobsk    ! Level indices of observations
29 
30      !! * Local declarations
31      INTEGER :: ji
32      INTEGER :: jk
33
34      !------------------------------------------------------------------------
35      ! Search levels for each observations to find matching level
36      !------------------------------------------------------------------------
37      DO ji = 1, kobs
38         kobsk(ji) = 1
39         depk: DO jk = 2, kgrd
40            IF ( pgrddep(jk) >= pobsdep(ji) ) EXIT depk
41         END DO depk
42         kobsk(ji) = jk
43      END DO
44
45   END SUBROUTINE obs_level_search
Note: See TracBrowser for help on using the repository browser.