/[lmdze]/trunk/libf/test_disvert.f90
ViewVC logotype

Contents of /trunk/libf/test_disvert.f90

Parent Directory Parent Directory | Revision Log Revision Log


Revision 38 - (show annotations)
Thu Jan 6 17:52:19 2011 UTC (13 years, 3 months ago) by guez
File size: 1287 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 program test_disvert
2
3 ! This is a program in Fortran 95.
4 ! This program writes the vertical coordinates at level interfaces.
5
6 use dimens_m, only: llm
7 use comvert, only: pa, disvert, ap, bp, preff
8 use new_unit_m, only: new_unit
9
10 implicit none
11
12 integer unit, l
13
14 REAL s(llm+1) ! hybrid sigma-pressure coordinate
15 ! "s(l)" : à l'interface des couches "l" et "l-1"
16
17 real p(llm + 1) ! pressure at level, in Pa
18 real z(llm) ! pressure-altitude (km)
19
20 !---------------------
21
22 print *, "llm = ", llm
23 pa = 5e4
24 call disvert
25 s = ap / pa + bp
26 p = ap + bp * preff
27 z = - 7. * log(ap(:llm) / preff + bp(:llm))
28
29 call new_unit(unit)
30 open(unit, file="test_disvert.csv", status="replace", action="write")
31 ! Title line:
32 write(unit, fmt=*) '"ap (hPa)" "bp" "s" "p (hPa)" "z (km)"'
33 do l = 1, llm
34 write(unit, fmt=*) ap(l) / 100., bp(l), s(l), p(l) / 100., z(l)
35 end do
36 close(unit)
37 print *, 'The file "test_disvert.csv" has been created.'
38
39 open(unit, file="delta_z.csv", status="replace", action="write")
40 ! Title line:
41 write(unit, fmt=*) '"z middle (km)" "delta z (km)"'
42 do l = 1, llm - 1
43 write(unit, fmt=*) (z(l) + z(l+1)) / 2, z(l+1) - z(l)
44 end do
45 close(unit)
46 print *, 'The file "delta_z.csv" has been created.'
47
48 end program test_disvert

  ViewVC Help
Powered by ViewVC 1.1.21