/[lmdze]/trunk/libf/dyn3d/exner_hyb.f90
ViewVC logotype

Contents of /trunk/libf/dyn3d/exner_hyb.f90

Parent Directory Parent Directory | Revision Log Revision Log


Revision 64 - (show annotations)
Wed Aug 29 14:47:17 2012 UTC (11 years, 8 months ago) by guez
File size: 2335 byte(s)
Removed variable lstardis in module comdissnew and procedures gradiv
and nxgrarot. lstardir had to be true. gradiv and nxgrarot were called
if lstardis was false. Removed argument iter of procedure
filtreg. iter had to be 1. gradiv and nxgrarot called filtreg with
iter == 2.

Moved procedure flxsetup into module yoecumf. Module yoecumf is only
used in program units of directory Conflx, moved it there.

1 module exner_hyb_m
2
3 IMPLICIT NONE
4
5 contains
6
7 SUBROUTINE exner_hyb(ps, p, pks, pk, pkf)
8
9 ! From dyn3d/exner_hyb.F, version 1.1.1.1 2004/05/19 12:53:07
10 ! Authors: P. Le Van, F. Hourdin
11
12 ! Calcule la fonction d'Exner :
13 ! pk = Cp * p ** kappa
14 ! aux milieux des "llm" couches.
15 ! "Pk(l)" est calculé au milieu de la couche "l", entre les pressions
16 ! "p(l)" et "p(l+1)", définies aux interfaces des couches.
17
18 ! Au sommet de l'atmosphère :
19 ! p(llm+1) = 0
20 ! "ps" et "pks" sont la pression et la fonction d'Exner au sol.
21
22 ! À partir des relations :
23 !(1) \overline{p * \delta_z pk}^z = kappa * pk * \delta_z p
24 !(2) pk(l) = beta(l) * pk(l-1)
25 ! (cf. documentation), on détermine successivement, du haut vers
26 ! le bas des couches, les coefficients : beta(llm), ..., beta(l), ...,
27 ! beta(2) puis "pk(:, :, 1)". Ensuite, on calcule, du bas vers le
28 ! haut des couches, "pk(:, :, l)" donné par la relation (2), pour
29 ! l = 2 à l = llm.
30
31 use dimens_m, only: iim, jjm, llm
32 use comconst, only: kappa, cpp
33 use comvert, only: preff
34 use comgeom, only: aire_2d, apoln, apols
35 use filtreg_m, only: filtreg
36
37 REAL, intent(in):: ps(iim + 1, jjm + 1)
38 REAL, intent(in):: p(iim + 1, jjm + 1, llm + 1)
39
40 real, intent(out):: pks(iim + 1, jjm + 1)
41 real, intent(out):: pk(iim + 1, jjm + 1, llm)
42 real, intent(out), optional:: pkf(iim + 1, jjm + 1, llm)
43
44 ! Variables locales :
45 real beta(iim + 1, jjm + 1, 2:llm)
46 INTEGER l
47 REAL unpl2k
48
49 !-------------------------------------
50
51 pks = cpp * (ps / preff)**kappa
52 pks(:, 1) = SUM(aire_2d(:iim, 1) * pks(:iim, 1)) / apoln
53 pks(:, jjm + 1) = SUM(aire_2d(:iim, jjm + 1) * pks(:iim, jjm + 1)) / apols
54 unpl2k = 1. + 2 * kappa
55
56 beta(:, :, llm) = 1. / unpl2k
57 DO l = llm - 1, 2, -1
58 beta(:, :, l) = p(:, :, l) &
59 / (p(:, :, l) * unpl2k + p(:, :, l+1) * (beta(:, :, l+1) - unpl2k))
60 ENDDO
61
62 pk(:, :, 1) = p(:, :, 1) * pks &
63 / (p(:, :, 1) * (1. + kappa) &
64 + 0.5 * (beta(:, :, 2) - unpl2k) * p(:, :, 2))
65 DO l = 2, llm
66 pk(:, :, l) = beta(:, :, l) * pk(:, :, l-1)
67 ENDDO
68
69 if (present(pkf)) then
70 pkf = pk
71 CALL filtreg(pkf, jjm + 1, llm, 2, 1, .TRUE.)
72 end if
73
74 END SUBROUTINE exner_hyb
75
76 end module exner_hyb_m

  ViewVC Help
Powered by ViewVC 1.1.21