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

source: branches/UKMO/dev_r5518_obs_oper_update_sit/NEMOGCM/NEMO/OPA_SRC/OBS/obs_level_search.h90 @ 12557

Last change on this file since 12557 was 12557, checked in by dcarneir, 4 years ago

Branch in sync with obs_oper_update

File size: 2.3 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  : Will return level associated with T-point below the obs
16      !!              depth, except when observation is in the top box will
17      !!              return level 2. Also, if obs depth greater than depth
18      !!              of last wet T-point (kpk-1) will return level kpk.
19      !!
20      !! History :
21      !!        !  2001-11  (N. Daget, A. Weaver)
22      !!        !  2006-03  (A. Weaver) NEMOVAR migration.
23      !!        !  2006-05  (K. Mogensen) Moved to to separate routine.
24      !!        !  2006-10  (A. Weaver) Cleanup
25      !!        !  2008-10  (K. Mogensen) Remove assumptions on grid.
26      !!----------------------------------------------------------------------
27
28      !! * Arguments
29      INTEGER, INTENT(IN) :: kgrd     ! Number of gridpoints
30      REAL(KIND=wp), DIMENSION(kgrd), INTENT(INOUT) :: &
31         &   pgrddep  ! Depths of gridpoints
32      INTEGER, INTENT(IN) :: &
33         &   kobs     ! Number of observations
34      REAL(KIND=wp), DIMENSION(kobs), INTENT(INOUT) :: &
35         &   pobsdep  ! Depths of observations
36      INTEGER ,DIMENSION(kobs), INTENT(OUT) :: &
37         &   kobsk    ! Level indices of observations
38 
39      !! * Local declarations
40      INTEGER :: ji
41      INTEGER :: jk
42
43      !------------------------------------------------------------------------
44      ! Search levels for each observations to find matching level
45      !------------------------------------------------------------------------
46      DO ji = 1, kobs
47         kobsk(ji) = 1
48         depk: DO jk = 2, kgrd-1
49            IF ( pgrddep(jk) >= pobsdep(ji) ) EXIT depk
50         END DO depk
51         kobsk(ji) = jk
52      END DO
53
54   END SUBROUTINE obs_level_search
Note: See TracBrowser for help on using the repository browser.