/[lmdze]/trunk/dyn3d/exner_hyb.f
ViewVC logotype

Contents of /trunk/dyn3d/exner_hyb.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 91 - (show annotations)
Wed Mar 26 17:18:58 2014 UTC (10 years, 1 month ago) by guez
File size: 2199 byte(s)
Removed unused variables lock_startdate and time_stamp of module
calendar.

Noticed that physiq does not change the surface pressure. So removed
arguments ps and dpfi of subroutine addfi. dpfi was always 0. The
computation of ps in addfi included some averaging at the poles. In
principle, this does not change ps but in practice it does because of
finite numerical precision. So the results of the simulation are
changed. Removed arguments ps and dpfi of calfis. Removed argument
d_ps of physiq.

du at the poles is not computed by dudv1, so declare only the
corresponding latitudes in dudv1. caldyn passes only a section of the
array dudyn as argument.

Removed variable niadv of module iniadvtrac_m.

Declared arguments of exner_hyb as assumed-shape arrays and made all
other horizontal sizes in exner_hyb dynamic. This allows the external
program test_disvert to use exner_hyb at a single horizontal position.

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: llm
32 use comconst, only: kappa, cpp
33 use disvert_m, only: preff
34 use filtreg_m, only: filtreg
35
36 REAL, intent(in):: ps(:, :) ! (longitude, latitude)
37 REAL, intent(in):: p(:, :, :) ! (longitude, latitude, llm + 1)
38
39 real, intent(out):: pks(:, :) ! (longitude, latitude)
40 real, intent(out):: pk(:, :, :) ! (longitude, latitude, llm)
41 real, intent(out), optional:: pkf(:, :, :) ! (longitude, latitude, llm)
42
43 ! Variables locales :
44 real beta(size(ps, 1), size(ps, 2), 2:llm)
45 INTEGER l
46 REAL unpl2k
47
48 !-------------------------------------
49
50 pks = cpp * (ps / preff)**kappa
51 unpl2k = 1. + 2 * kappa
52
53 beta(:, :, llm) = 1. / unpl2k
54 DO l = llm - 1, 2, -1
55 beta(:, :, l) = p(:, :, l) &
56 / (p(:, :, l) * unpl2k + p(:, :, l+1) * (beta(:, :, l+1) - unpl2k))
57 ENDDO
58
59 pk(:, :, 1) = ps * pks &
60 / (ps * (1. + kappa) + 0.5 * (beta(:, :, 2) - unpl2k) * p(:, :, 2))
61 DO l = 2, llm
62 pk(:, :, l) = beta(:, :, l) * pk(:, :, l - 1)
63 ENDDO
64
65 if (present(pkf)) then
66 pkf = pk
67 CALL filtreg(pkf, size(pkf, 2), llm, 2, 1, .TRUE.)
68 end if
69
70 END SUBROUTINE exner_hyb
71
72 end module exner_hyb_m

  ViewVC Help
Powered by ViewVC 1.1.21