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/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/OPA_SRC/OBS – NEMO

source: branches/UKMO/dev_r5518_medusa_fix_restart/NEMOGCM/NEMO/OPA_SRC/OBS/obs_level_search.h90 @ 7850

Last change on this file since 7850 was 7850, checked in by marc, 7 years ago

Removing the SVN keywords

File size: 2.0 KB
Line 
1   !!----------------------------------------------------------------------
2   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
3   !! $Id$
4   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
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.