/[lmdze]/trunk/phylmd/Orography/gwstress.f
ViewVC logotype

Annotation of /trunk/phylmd/Orography/gwstress.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 38 - (hide annotations)
Thu Jan 6 17:52:19 2011 UTC (13 years, 5 months ago) by guez
Original Path: trunk/libf/phylmd/Orography/gwstress.f90
File size: 2748 byte(s)
Extracted ASCII art from "inigeom" into a separate text file in the
documentation.

"test_disvert" now creates a separate file for layer thicknesses.

Moved variables from module "yomcst" to module "suphec_m" because this
is where those variables are defined. Kept in "yomcst" only parameters
of Earth orbit. Gave the attribute "parameter" to some variables of
module "suphec_m".

Variables of module "yoethf" were defined in procedure "suphec". Moved
these definitions to a new procedure "yoethf" in module "yoethf_m".

1 guez 23 SUBROUTINE gwstress(nlon,nlev,ktest,kcrit,kkenvh,kknu,prho,pstab,pvph, &
2     pstd,psig,pmea,ppic,ptau,pgeom1,pdmod)
3    
4     !**** *gwstress*
5    
6     ! purpose.
7     ! --------
8    
9     !** interface.
10     ! ----------
11     ! call *gwstress* from *gwdrag*
12    
13     ! explicit arguments :
14     ! --------------------
15     ! ==== inputs ===
16     ! ==== outputs ===
17    
18     ! implicit arguments : none
19     ! --------------------
20    
21     ! method.
22     ! -------
23    
24    
25     ! externals.
26     ! ----------
27    
28    
29     ! reference.
30     ! ----------
31    
32     ! see ecmwf research department documentation of the "i.f.s."
33    
34     ! author.
35     ! -------
36    
37     ! modifications.
38     ! --------------
39     ! f. lott put the new gwd on ifs 22/11/93
40    
41     !-----------------------------------------------------------------------
42     USE dimens_m
43     USE dimphy
44 guez 38 USE suphec_m
45 guez 23 USE yoegwd
46     IMPLICIT NONE
47    
48     !-----------------------------------------------------------------------
49    
50     !* 0.1 arguments
51     ! ---------
52    
53     INTEGER nlon, nlev
54     INTEGER kcrit(nlon), ktest(nlon), kkenvh(nlon), kknu(nlon)
55    
56     REAL prho(nlon,nlev+1), pstab(nlon,nlev+1), ptau(nlon,nlev+1), &
57     pvph(nlon,nlev+1), pgeom1(nlon,nlev)
58     REAL, INTENT (IN) :: pstd(nlon)
59    
60     REAL, INTENT (IN) :: psig(nlon)
61     REAL pmea(nlon), ppic(nlon)
62     REAL pdmod(nlon)
63    
64     !-----------------------------------------------------------------------
65    
66     !* 0.2 local arrays
67     ! ------------
68     INTEGER jl
69     REAL zblock, zvar, zeff
70     LOGICAL lo
71    
72     !-----------------------------------------------------------------------
73    
74     !* 0.3 functions
75     ! ---------
76     ! ------------------------------------------------------------------
77    
78     !* 1. initialization
79     ! --------------
80    
81     100 CONTINUE
82    
83     !* 3.1 gravity wave stress.
84    
85     300 CONTINUE
86    
87    
88     DO 301 jl = 1, klon
89     IF (ktest(jl)==1) THEN
90    
91     ! effective mountain height above the blocked flow
92    
93     IF (kkenvh(jl)==klev) THEN
94     zblock = 0.0
95     ELSE
96     zblock = (pgeom1(jl,kkenvh(jl))+pgeom1(jl,kkenvh(jl)+1))/2./rg
97     END IF
98    
99     zvar = ppic(jl) - pmea(jl)
100     zeff = amax1(0.,zvar-zblock)
101    
102     ptau(jl,klev+1) = prho(jl,klev+1)*gkdrag*psig(jl)*zeff**2/4./ &
103     pstd(jl)*pvph(jl,klev+1)*pdmod(jl)*sqrt(pstab(jl,klev+1))
104    
105     ! too small value of stress or low level flow include critical level
106     ! or low level flow: gravity wave stress nul.
107    
108     lo = (ptau(jl,klev+1)<gtsec) .OR. (kcrit(jl)>=kknu(jl)) .OR. &
109     (pvph(jl,klev+1)<gvcrit)
110     ! if(lo) ptau(jl,klev+1)=0.0
111    
112     ELSE
113    
114     ptau(jl,klev+1) = 0.0
115    
116     END IF
117    
118     301 CONTINUE
119    
120     RETURN
121     END

  ViewVC Help
Powered by ViewVC 1.1.21