source: trunk/LMDZ.MARS/libf/phymars/gwstress.F @ 1747

Last change on this file since 1747 was 1268, checked in by aslmd, 11 years ago

LMDZ.MARS. related to r1266. forgot to remove a few now-obsolete dimensions.h includes in Mars physics.

File size: 3.0 KB
Line 
1      SUBROUTINE GWSTRESS
2     *         (  klon  , klev
3     *         , KKCRIT, KSECT, KKHLIM, KTEST, KKCRITH, KCRIT, kkenvh
4     *         , kknu
5     *         , PRHO  , PSTAB, PVPH  , PVAR ,PVARor, psig 
6     *         , PTFR  , PTAU 
7     *         ,pgeom1 , pgamma, pd1  , pd2   ,pdmod ,pnu )
8C
9C**** *GWSTRESS*
10C
11C     PURPOSE.
12C     --------
13C
14C**   INTERFACE.
15C     ----------
16C     CALL *GWSTRESS*  FROM *GWDRAG*
17C
18C        EXPLICIT ARGUMENTS :
19C        --------------------
20C     ==== INPUTS ===
21C     ==== OUTPUTS ===
22C
23C        IMPLICIT ARGUMENTS :   NONE
24C        --------------------
25C
26C     METHOD.
27C     -------
28C
29C
30C     EXTERNALS.
31C     ----------
32C
33C
34C     REFERENCE.
35C     ----------
36C
37C        SEE ECMWF RESEARCH DEPARTMENT DOCUMENTATION OF THE "I.F.S."
38C
39C     AUTHOR.
40C     -------
41C
42C     MODIFICATIONS.
43C     --------------
44C     F. LOTT PUT THE NEW GWD ON IFS      22/11/93
45C
46C-----------------------------------------------------------------------
47      use dimradmars_mod, only: ndlo2
48      implicit none
49      integer klon,klev,kidia,kfdia
50
51#include "yoegwd.h"
52
53C-----------------------------------------------------------------------
54C
55C*       0.1   ARGUMENTS
56C              ---------
57C
58      INTEGER KKCRIT(NDLO2),KKCRITH(NDLO2),KCRIT(NDLO2),KSECT(NDLO2),
59     *        KKHLIM(NDLO2),KTEST(NDLO2),KKENVH(NDLO2),KKNU(NDLO2)
60C
61      REAL PRHO(NDLO2,klev+1),PSTAB(NDLO2,klev+1),PTAU(NDLO2,klev+1),
62     *     PVPH(NDLO2,klev+1),PVAR(NDLO2,4),PTFR(NDLO2),
63     *     pgeom1(NDLO2,klev),PVARor(NDLO2)
64C
65      real pd1(NDLO2),pd2(NDLO2),pnu(NDLO2),psig(NDLO2),pgamma(NDLO2)
66      real pdmod(NDLO2)
67C
68C-----------------------------------------------------------------------
69C
70C*       0.2   LOCAL ARRAYS
71C              ------------
72      integer jl
73      real zblock,zvar,zeff
74      logical lo
75
76C
77C-----------------------------------------------------------------------
78C
79C*       0.3   FUNCTIONS
80C              ---------
81C     ------------------------------------------------------------------
82C
83C*         1.    INITIALIZATION
84C                --------------
85
86
87      kidia=1
88      kfdia=klon
89
90
91C
92 100  CONTINUE
93C
94C*         3.1     GRAVITY WAVE STRESS.
95C
96  300 CONTINUE
97C
98C
99      DO 301 JL=kidia,kfdia
100      IF(KTEST(JL).EQ.1) THEN
101     
102C  EFFECTIVE MOUNTAIN HEIGHT ABOVE THE BLOCKED FLOW
103 
104c        IF(KKENVH(JL).EQ.KLEV)THEN
105         ZBLOCK=0.0
106c        ELSE
107c         ZBLOCK=(PGEOM1(JL,KKENVH(JL))+PGEOM1(JL,KKENVH(JL)+1))/2./RG         
108c        ENDIF
109     
110        ZVAR=PVAROR(JL)
111        ZEFF=AMAX1(0.,2.*ZVAR-ZBLOCK)
112
113        PTAU(JL,KLEV+1)=PRHO(JL,KLEV+1)*GKDRAG*psig(jl)*ZEFF**2
114     *    /4./ZVAR*PVPH(JL,KLEV+1)*pdmod(jl)*sqrt(pstab(jl,klev+1))
115
116C  TOO SMALL VALUE OF STRESS OR  LOW LEVEL FLOW INCLUDE CRITICAL LEVEL
117C  OR LOW LEVEL FLOW:  GRAVITY WAVE STRESS NUL.
118               
119        LO=(PTAU(JL,KLEV+1).LT.GTSEC).OR.(KCRIT(JL).GE.KKNU(JL))
120     *      .OR.(PVPH(JL,KLEV+1).LT.GVCRIT)
121c       IF(LO) PTAU(JL,KLEV+1)=0.0
122     
123      ELSE
124     
125          PTAU(JL,KLEV+1)=0.0
126         
127      ENDIF
128     
129  301 CONTINUE
130C
131      RETURN
132      END
Note: See TracBrowser for help on using the repository browser.