/[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 10 - (show annotations)
Fri Apr 18 14:45:53 2008 UTC (16 years, 1 month ago) by guez
File size: 2863 byte(s)
Added NetCDF directory "/home/guez/include" in "g95.mk" and
"nag_tools.mk".

Added some "intent" attributes in "PVtheta", "advtrac", "caladvtrac",
"calfis", "diagedyn", "dissip", "vlspltqs", "aeropt", "ajsec",
"calltherm", "clmain", "cltrac", "cltracrn", "concvl", "conema3",
"conflx", "fisrtilp", "newmicro", "nuage", "diagcld1", "diagcld2",
"drag_noro", "lift_noro", "SUGWD", "physiq", "phytrac", "radlwsw", "thermcell".

Removed the case "ierr == 0" in "abort_gcm"; moved call to "histclo"
and messages for end of run from "abort_gcm" to "gcm"; replaced call
to "abort_gcm" in "leapfrog" by exit from outer loop.

In "calfis": removed argument "pp" and variable "unskap"; changed
"pksurcp" from scalar to rank 2; use "pressure_var"; rewrote
computation of "zplev", "zplay", "ztfi", "pcvgt" using "dyn_phy";
added computation of "pls".

Removed unused variable in "dynredem0".

In "exner_hyb": changed "dellta" from scalar to rank 1; replaced call
to "ssum" by call to "sum"; removed variables "xpn" and "xps";
replaced some loops by array expressions.

In "leapfrog": use "pressure_var"; deleted variables "p", "longcles".

Converted common blocks "YOECUMF", "YOEGWD" to modules.

Removed argument "pplay" in "cvltr", "diagetpq", "nflxtr".

Created module "raddimlw" from include file "raddimlw.h".

Corrected call to "new_unit" in "test_disvert".

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, v 1.1.1.1 2004/05/19 12:53:07
10
11 ! Authors : P. Le Van, F. Hourdin
12
13 ! Calcule la fonction d'Exner :
14 ! pk = Cp * p ** kappa
15 ! aux milieux des "llm" couches.
16 ! "Pk(l)" est calculé au milieu de la couche "l", entre les pressions
17 ! "p(l)" et "p(l+1)", définies aux interfaces des couches.
18
19 ! Au sommet de l'atmosphère :
20 ! p(llm+1) = 0.
21 ! "ps" et "pks" sont la pression et la fonction d'Exner au sol.
22
23 ! À partir des relations :
24
25 ! -------- z
26 !(1) p*dz(pk) = kappa * pk * dz(p)
27
28 !(2) pk(l) = alpha(l)+ beta(l) * pk(l-1)
29
30 ! (voir note de F. Hourdin), on détermine successivement, du haut
31 ! vers le bas des couches, les coefficients :
32 ! alpha(llm), beta(llm)..., alpha(l), beta(l)..., alpha(2), beta(2)
33 ! puis "pk(:, 1)".
34 ! Ensuite, on calcule, du bas vers le haut des couches, "pk(:, l)"
35 ! donné par la relation (2), pour l = 2 à l = llm.
36
37 use dimens_m, only: iim, jjm, llm
38 use comconst, only: kappa, cpp
39 use comvert, only: preff
40 use comgeom, only: aire_2d, apoln, apols
41
42 REAL, intent(in):: ps((iim + 1) * (jjm + 1))
43 REAL, intent(in):: p((iim + 1) * (jjm + 1), llm + 1)
44
45 real, intent(out):: pks((iim + 1) * (jjm + 1))
46 real, intent(out):: pk((iim + 1) * (jjm + 1), llm)
47 real, intent(out), optional:: pkf((iim + 1) * (jjm + 1), llm)
48
49 ! Variables locales
50
51 real alpha((iim + 1) * (jjm + 1), llm), beta((iim + 1) * (jjm + 1), llm)
52 INTEGER l
53 REAL unpl2k, dellta((iim + 1) * (jjm + 1))
54
55 REAL ppn(iim), pps(iim)
56
57 !-------------------------------------
58
59 pks = cpp * (ps / preff)**kappa
60 ppn = aire_2d(:iim, 1) * pks(:iim)
61 pps = aire_2d(:iim, jjm + 1) &
62 * pks(1 + (iim + 1) * jjm: iim + (iim + 1) * jjm)
63 pks(:iim + 1) = SUM(ppn) /apoln
64 pks(1+(iim + 1) * jjm:) = SUM(pps) /apols
65
66 unpl2k = 1. + 2 * kappa
67
68 ! Calcul des coefficients alpha et beta pour la couche l = llm :
69 alpha(:, llm) = 0.
70 beta(:, llm) = 1./ unpl2k
71
72 ! Calcul des coefficients alpha et beta pour l = llm-1 à l = 2 :
73 DO l = llm - 1, 2, -1
74 dellta = p(:, l) * unpl2k + p(:, l+1) * (beta(:, l+1) - unpl2k)
75 alpha(:, l) = - p(:, l+1) / dellta * alpha(:, l+1)
76 beta(:, l) = p(:, l) / dellta
77 ENDDO
78
79 ! Calcul de pk pour la couche 1, près du sol :
80 pk(:, 1) = (p(:, 1) * pks - 0.5 * alpha(:, 2) * p(:, 2)) &
81 / (p(:, 1) * (1. + kappa) + 0.5 * (beta(:, 2) - unpl2k) * p(:, 2))
82
83 ! Calcul de pk(:, l) pour l = 2 à l = llm :
84 DO l = 2, llm
85 pk(:, l) = alpha(:, l) + beta(:, l) * pk(:, l-1)
86 ENDDO
87
88 if (present(pkf)) then
89 pkf = pk
90 CALL filtreg(pkf, jjm + 1, llm, 2, 1, .TRUE., 1)
91 end if
92
93 END SUBROUTINE exner_hyb
94
95 end module exner_hyb_m

  ViewVC Help
Powered by ViewVC 1.1.21