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 NEMO/branches/UKMO/dev_r9950_GO8_package/src/OCE/OBS – NEMO

source: NEMO/branches/UKMO/dev_r9950_GO8_package/src/OCE/OBS/obs_level_search.h90 @ 10322

Last change on this file since 10322 was 10322, checked in by davestorkey, 5 years ago

UKMO/dev_r9950_GO8_package: Update to be relative to rev 10321 of NEMO4_beta_mirror branch.

  • 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.