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

Contents of /trunk/bibio/Writefield/write_field3d.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: 2121 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_field3d_m
2
3 implicit none
4
5 contains
6
7
8 subroutine write_field3D(name,Field)
9
10 use int2str_m, only: int2str
11
12 integer, parameter :: MaxDim=3
13 character(len=*) :: name
14 real, dimension(:,:,:) :: Field
15 integer, dimension(MaxDim) :: Dim
16 integer :: i,j,k,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))))+len(trim(int2str(Dim(3))))+4
29 ColumnSize=22+6+3+offset
30
31 ! open(unit=id,file=name,form=formatted
32
33 spacing='(t2,"'//repeat('-',ColumnSize*NbCol)//'")'
34
35 do i=1,Dim(3)
36
37 do j=1,Dim(2)
38 nb=0
39 Pos=2
40
41 do k=1,Dim(1)
42 nb=nb+1
43
44 if (MOD(nb,NbCol)==0) then
45 form='(t'//trim(int2str(pos))// &
46 ',"('//trim(int2str(k))//',' &
47 //trim(int2str(j))//',' &
48 //trim(int2str(i))//')",t' &
49 //trim(int2str(pos+offset)) &
50 //'," ---> ",g22.16,/)'
51 Pos=2
52 else
53 form='(t'//trim(int2str(pos))// &
54 ',"('//trim(int2str(k))//',' &
55 //trim(int2str(j))//',' &
56 //trim(int2str(i))//')",t' &
57 //trim(int2str(pos+offset)) &
58 //'," ---> ",g22.16," | ")'
59 ! dépent de l'implémention, sur compaq, c'est necessaire
60 ! Pos=Pos+ColumnSize
61 endif
62 write (id,form,advance='no') Field(k,j,i)
63 enddo
64 if (MOD(nb,NbCol)==0) then
65 write (id,spacing)
66 else
67 write (id,'("")')
68 write (id,spacing)
69 endif
70 enddo
71 write (id,spacing)
72 enddo
73
74 close(id)
75
76 end subroutine write_field3D
77
78 end module write_field3d_m

  ViewVC Help
Powered by ViewVC 1.1.21