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

Diff of /trunk/libf/test_disvert.f90

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 22 by guez, Fri Jul 31 15:18:47 2009 UTC revision 23 by guez, Mon Dec 14 15:25:16 2009 UTC
# Line 1  Line 1 
1  program test_disvert  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    use dimens_m, only: llm
7    use comvert, only: pa, disvert, ap, bp, preff    use comvert, only: pa, disvert, ap, bp, preff
8    use new_unit_m, only: new_unit    use new_unit_m, only: new_unit
# Line 7  program test_disvert Line 10  program test_disvert
10    implicit none    implicit none
11    
12    integer unit, l    integer unit, l
13    REAL sigma(llm+1) ! "sigma(l)" : à l'interface des couches "l" et "l-1"  
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    real p(llm + 1) ! pressure at level, in Pa
18    
19    !---------------------    !---------------------
# Line 15  program test_disvert Line 21  program test_disvert
21    print *, "llm = ", llm    print *, "llm = ", llm
22    pa = 5e4    pa = 5e4
23    call disvert    call disvert
24    sigma = ap / pa + bp    s = ap / pa + bp
25    p = ap + bp * preff    p = ap + bp * preff
26    
27    call new_unit(unit)    call new_unit(unit)
28    open(unit, file="test_disvert.csv", status="replace", action="write")    open(unit, file="test_disvert.csv", status="replace", action="write")
29    write(unit, fmt=*) '"ap (Pa)" "bp" "sigma" "p (Pa)"' ! title line    write(unit, fmt=*) '"ap (hPa)" "bp" "s" "p (hPa)"' ! title line
30    do l = 1, llm    do l = 1, llm
31       write(unit, fmt=*) ap(l), bp(l), sigma(l), p(l)       write(unit, fmt=*) ap(l) / 100., bp(l), s(l), p(l) / 100.
32    end do    end do
33    close(unit)    close(unit)
34    print *, 'The file "test_disvert.csv" has been created.'    print *, 'The file "test_disvert.csv" has been created.'

Legend:
Removed from v.22  
changed lines
  Added in v.23

  ViewVC Help
Powered by ViewVC 1.1.21