/[lmdze]/trunk/bibio/Writefield/write_field2d.f
ViewVC logotype

Contents of /trunk/bibio/Writefield/write_field2d.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 108 - (show annotations)
Tue Sep 16 14:00:41 2014 UTC (9 years, 7 months ago) by guez
File size: 1746 byte(s)
Imported writefield from LMDZ. Close at the end of gcm the files which
were created by writefiled (not done in LMDZ).

Removed procedures for the output of Grads files. Removed calls to
dump2d. In guide, replaced calls to wrgrads by calls to writefield.

In vlspltqs, removed redundant programming of saturation
pressure. Call foeew from module FCTTRE instead.

Bug fix in interpre: size of w exceeding size of correponding actual
argument wg in advtrac.

In leapfrog, call guide until the end of the run, instead of six hours
before the end.

Bug fix in readsulfate_preind: type of arguments.

1 module write_field2d_m
2
3 implicit none
4
5 contains
6
7
8 subroutine write_field2D(name,Field)
9
10 use int2str_m, only: int2str
11
12 integer, parameter :: MaxDim=2
13 character(len=*) :: name
14 real, dimension(:,:) :: Field
15 integer, dimension(MaxDim) :: Dim
16 integer :: i,j,nb
17 integer, parameter :: id=10
18 integer, parameter :: NbCol=4
19 integer :: ColumnSize
20 integer :: pos,offset
21 character(len=255) :: form
22 character(len=255) :: spacing
23
24 open(unit=id,file=name//'.field',form='formatted',status='replace')
25 write (id,'("----- Field '//name//'",//)')
26
27 Dim=shape(Field)
28 offset=len(trim(int2str(Dim(1))))+len(trim(int2str(Dim(2))))+3
29 ColumnSize=20+6+3+offset
30
31 spacing='(t2,"'//repeat('-',ColumnSize*NbCol)//'")'
32
33 do i=1,Dim(2)
34 nb=0
35 Pos=2
36 do j=1,Dim(1)
37 nb=nb+1
38
39 if (MOD(nb,NbCol)==0) then
40 form='(t'//trim(int2str(pos))// &
41 ',"('//trim(int2str(j))//',' &
42 //trim(int2str(i))//')",t' &
43 //trim(int2str(pos+offset)) &
44 //'," ---> ",g22.16,/)'
45 Pos=2
46 else
47 form='(t'//trim(int2str(pos))// &
48 ',"('//trim(int2str(j))//',' &
49 //trim(int2str(i))//')",t' &
50 //trim(int2str(pos+offset)) &
51 //'," ---> ",g22.16," | ")'
52 Pos=Pos+ColumnSize
53 endif
54 write (id,form,advance='no') Field(j,i)
55 enddo
56 if (MOD(nb,NbCol)==0) then
57 write (id,spacing)
58 else
59 write (id,'("")')
60 write (id,spacing)
61 endif
62 enddo
63
64 end subroutine write_field2D
65
66 end module write_field2d_m

  ViewVC Help
Powered by ViewVC 1.1.21