source: LMDZ6/trunk/libf/phylmd/cv3_crit.F90 @ 5054

Last change on this file since 5054 was 3319, checked in by jyg, 7 years ago

Adding missing IMPLICIT NONE

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.6 KB
Line 
1SUBROUTINE cv3_crit(nloc, ncum, nd, icb, inb, p, ph, pzero, v, threshold, &
2    kcrit, pcrit)
3  ! **************************************************************
4  ! *
5  ! CV3_CRIT   Find pressure level where vertical profile of    *
6  ! variable 'v' intersects 'threshold'              *
7  ! *
8  ! written by   : FROHWIRTH Julie, 13/08/2003, 21.55.12        *
9  ! modified by :                                               *
10  ! **************************************************************
11
12  IMPLICIT NONE
13
14  include "cv3param.h"
15
16  ! input:
17  INTEGER ncum, nd, nloc
18  INTEGER icb(nloc), inb(nloc)
19  REAL p(nloc, nd), ph(nloc, nd+1)
20  REAL pzero(nloc)
21  REAL v(nloc, nd), threshold
22
23  ! output:
24  INTEGER kcrit(nloc)
25  REAL pcrit(nloc)
26
27  ! local variables
28  INTEGER i, j, k, il
29  LOGICAL ok(nloc)
30
31  DO il = 1, ncum
32    ok(il) = .TRUE.
33    pcrit(il) = -1.
34    kcrit(il) = 0
35  END DO
36
37  DO i = 1, nl
38    DO il = 1, ncum
39      IF (i>icb(il) .AND. i<=inb(il)) THEN
40        IF (p(il,i)<=pzero(il) .AND. ok(il)) THEN
41          IF ((v(il,i)-threshold)*(v(il,i-1)-threshold)<0.) THEN
42            pcrit(il) = ((threshold-v(il,i))*p(il,i-1)-(threshold-v(il, &
43              i-1))*p(il,i))/(v(il,i-1)-v(il,i))
44            IF (pcrit(il)>pzero(il)) THEN
45              pcrit(il) = -1.
46            ELSE
47              ok(il) = .FALSE.
48              kcrit(il) = i
49              IF (pcrit(il)<ph(il,i)) kcrit(il) = kcrit(il) + 1
50            END IF
51          END IF ! end IF (v(i) ...
52        END IF ! end IF (P(i) ...
53      END IF ! end IF (icb+1 le i le inb)
54    END DO
55  END DO
56
57
58  RETURN
59END SUBROUTINE cv3_crit
Note: See TracBrowser for help on using the repository browser.