source: NEMO/trunk/src/OCE/OBS/obs_level_search.h90 @ 10425

Last change on this file since 10425 was 10068, checked in by nicolasmartin, 3 years ago

First part of modifications to have a common default header : fix typos and SVN keywords properties

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