Last change
on this file since 2158 was
32,
checked in by lmdz, 25 years ago
|
Initial import
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
1.1 KB
|
Line | |
---|
1 | subroutine formcoord(unit,n,x,a,rev,text) |
---|
2 | implicit none |
---|
3 | integer n,unit,ndec |
---|
4 | logical rev |
---|
5 | real x(n),a |
---|
6 | character*4 text |
---|
7 | |
---|
8 | integer i,id,i1,i2,in |
---|
9 | real dx,dxmin |
---|
10 | |
---|
11 | if(rev) then |
---|
12 | id=-1 |
---|
13 | i1=n |
---|
14 | i2=n-1 |
---|
15 | in=1 |
---|
16 | write(unit,3000) text(1:1) |
---|
17 | else |
---|
18 | id=1 |
---|
19 | i1=1 |
---|
20 | i2=2 |
---|
21 | in=n |
---|
22 | endif |
---|
23 | |
---|
24 | if (n.lt.2) then |
---|
25 | ndec=1 |
---|
26 | write(unit,1000) text,n,x(1)*a |
---|
27 | else |
---|
28 | dxmin=abs(x(2)-x(1)) |
---|
29 | do i=2,n-1 |
---|
30 | dx=abs(x(i+1)-x(i)) |
---|
31 | if (dx.lt.dxmin) dxmin=dx |
---|
32 | enddo |
---|
33 | |
---|
34 | ndec=-log10(dxmin)+2 |
---|
35 | if(mod(n,6).eq.1) then |
---|
36 | write(unit,1000) text,n,x(i1)*a |
---|
37 | write(unit,2000) (x(i)*a,i=i2,in,id) |
---|
38 | else |
---|
39 | write(unit,1000) text,n |
---|
40 | write(unit,2000) (x(i)*a,i=i1,in,id) |
---|
41 | endif |
---|
42 | endif |
---|
43 | |
---|
44 | 1000 format(a4,2x,i4,' LEVELS',43x,f12.2) |
---|
45 | 2000 format(6f12.2) |
---|
46 | c1000 format(a4,2x,i4,' LEVELS',43x,f12.<ndec>) |
---|
47 | c2000 format(6f12.<ndec>) |
---|
48 | 3000 format('FORMAT ',a1,'REV') |
---|
49 | return |
---|
50 | |
---|
51 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.