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

Last change on this file since 1242 was 1047, checked in by emillour, 11 years ago

Mars GCM:

  • IMPORTANT CHANGE: Removed all reference/use of ngridmx (dimphys.h) in routines (necessary prerequisite to using parallel dynamics); in most cases this just means adding 'ngrid' as routine argument, and making local saved variables allocatable (and allocated at first call). In the process, had to convert many *.h files to equivalent modules: yomaer.h => yomaer_h.F90 , surfdat.h => surfdat_h.F90 , comsaison.h => comsaison_h.F90 , yomlw.h => yomlw_h.F90 , comdiurn.h => comdiurn_h.F90 , dimradmars.h => dimradmars_mod.F90 , comgeomfi.h => comgeomfi_h.F90, comsoil.h => comsoil_h.F90 , slope.h => slope_mod.F90
  • Also updated EOF routines, everything is now in eofdump_mod.F90
  • Removed unused routine lectfux.F (in dyn3d)

EM

File size: 3.1 KB
RevLine 
[38]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-----------------------------------------------------------------------
[1047]47      use dimradmars_mod, only: ndlo2
[38]48      implicit none
49#include "dimensions.h"
50#include "dimphys.h"
[1047]51!#include "dimradmars.h"
[38]52      integer klon,klev,kidia,kfdia
53
54#include "yoegwd.h"
55
56C-----------------------------------------------------------------------
57C
58C*       0.1   ARGUMENTS
59C              ---------
60C
61      INTEGER KKCRIT(NDLO2),KKCRITH(NDLO2),KCRIT(NDLO2),KSECT(NDLO2),
62     *        KKHLIM(NDLO2),KTEST(NDLO2),KKENVH(NDLO2),KKNU(NDLO2)
63C
64      REAL PRHO(NDLO2,klev+1),PSTAB(NDLO2,klev+1),PTAU(NDLO2,klev+1),
65     *     PVPH(NDLO2,klev+1),PVAR(NDLO2,4),PTFR(NDLO2),
66     *     pgeom1(NDLO2,klev),PVARor(NDLO2)
67C
68      real pd1(NDLO2),pd2(NDLO2),pnu(NDLO2),psig(NDLO2),pgamma(NDLO2)
69      real pdmod(NDLO2)
70C
71C-----------------------------------------------------------------------
72C
73C*       0.2   LOCAL ARRAYS
74C              ------------
75      integer jl
76      real zblock,zvar,zeff
77      logical lo
78
79C
80C-----------------------------------------------------------------------
81C
82C*       0.3   FUNCTIONS
83C              ---------
84C     ------------------------------------------------------------------
85C
86C*         1.    INITIALIZATION
87C                --------------
88
89
90      kidia=1
91      kfdia=klon
92
93
94C
95 100  CONTINUE
96C
97C*         3.1     GRAVITY WAVE STRESS.
98C
99  300 CONTINUE
100C
101C
102      DO 301 JL=kidia,kfdia
103      IF(KTEST(JL).EQ.1) THEN
104     
105C  EFFECTIVE MOUNTAIN HEIGHT ABOVE THE BLOCKED FLOW
106 
107c        IF(KKENVH(JL).EQ.KLEV)THEN
108         ZBLOCK=0.0
109c        ELSE
110c         ZBLOCK=(PGEOM1(JL,KKENVH(JL))+PGEOM1(JL,KKENVH(JL)+1))/2./RG         
111c        ENDIF
112     
113        ZVAR=PVAROR(JL)
114        ZEFF=AMAX1(0.,2.*ZVAR-ZBLOCK)
115
116        PTAU(JL,KLEV+1)=PRHO(JL,KLEV+1)*GKDRAG*psig(jl)*ZEFF**2
117     *    /4./ZVAR*PVPH(JL,KLEV+1)*pdmod(jl)*sqrt(pstab(jl,klev+1))
118
119C  TOO SMALL VALUE OF STRESS OR  LOW LEVEL FLOW INCLUDE CRITICAL LEVEL
120C  OR LOW LEVEL FLOW:  GRAVITY WAVE STRESS NUL.
121               
122        LO=(PTAU(JL,KLEV+1).LT.GTSEC).OR.(KCRIT(JL).GE.KKNU(JL))
123     *      .OR.(PVPH(JL,KLEV+1).LT.GVCRIT)
124c       IF(LO) PTAU(JL,KLEV+1)=0.0
125     
126      ELSE
127     
128          PTAU(JL,KLEV+1)=0.0
129         
130      ENDIF
131     
132  301 CONTINUE
133C
134      RETURN
135      END
Note: See TracBrowser for help on using the repository browser.