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

Annotation of /trunk/dyn3d/exner_hyb.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 91 - (hide annotations)
Wed Mar 26 17:18:58 2014 UTC (10 years, 2 months 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 guez 3 module exner_hyb_m
2    
3     IMPLICIT NONE
4    
5     contains
6    
7     SUBROUTINE exner_hyb(ps, p, pks, pk, pkf)
8    
9 guez 88 ! From dyn3d/exner_hyb.F, version 1.1.1.1, 2004/05/19 12:53:07
10 guez 40 ! Authors: P. Le Van, F. Hourdin
11 guez 3
12     ! Calcule la fonction d'Exner :
13     ! pk = Cp * p ** kappa
14 guez 10 ! 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 guez 3
18     ! Au sommet de l'atmosphère :
19 guez 48 ! p(llm+1) = 0
20 guez 10 ! "ps" et "pks" sont la pression et la fonction d'Exner au sol.
21 guez 3
22     ! À partir des relations :
23 guez 40 !(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 guez 48 ! le bas des couches, les coefficients : beta(llm), ..., beta(l), ...,
27 guez 40 ! 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 guez 3
31 guez 91 use dimens_m, only: llm
32 guez 3 use comconst, only: kappa, cpp
33 guez 66 use disvert_m, only: preff
34 guez 27 use filtreg_m, only: filtreg
35 guez 3
36 guez 91 REAL, intent(in):: ps(:, :) ! (longitude, latitude)
37     REAL, intent(in):: p(:, :, :) ! (longitude, latitude, llm + 1)
38 guez 3
39 guez 91 real, intent(out):: pks(:, :) ! (longitude, latitude)
40     real, intent(out):: pk(:, :, :) ! (longitude, latitude, llm)
41     real, intent(out), optional:: pkf(:, :, :) ! (longitude, latitude, llm)
42 guez 3
43 guez 48 ! Variables locales :
44 guez 91 real beta(size(ps, 1), size(ps, 2), 2:llm)
45 guez 10 INTEGER l
46 guez 40 REAL unpl2k
47 guez 3
48     !-------------------------------------
49    
50 guez 10 pks = cpp * (ps / preff)**kappa
51 guez 3 unpl2k = 1. + 2 * kappa
52    
53 guez 40 beta(:, :, llm) = 1. / unpl2k
54 guez 10 DO l = llm - 1, 2, -1
55 guez 40 beta(:, :, l) = p(:, :, l) &
56     / (p(:, :, l) * unpl2k + p(:, :, l+1) * (beta(:, :, l+1) - unpl2k))
57 guez 3 ENDDO
58    
59 guez 83 pk(:, :, 1) = ps * pks &
60     / (ps * (1. + kappa) + 0.5 * (beta(:, :, 2) - unpl2k) * p(:, :, 2))
61 guez 3 DO l = 2, llm
62 guez 83 pk(:, :, l) = beta(:, :, l) * pk(:, :, l - 1)
63 guez 3 ENDDO
64    
65     if (present(pkf)) then
66 guez 10 pkf = pk
67 guez 91 CALL filtreg(pkf, size(pkf, 2), llm, 2, 1, .TRUE.)
68 guez 3 end if
69    
70     END SUBROUTINE exner_hyb
71    
72     end module exner_hyb_m

  ViewVC Help
Powered by ViewVC 1.1.21