blob: 3d01926679aa78f7ead584af931d902c7da1ca6d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
subroutine writenumber (xnum)
c******************************************************************************
c This subroutine decides on the order-of-magnitude of a number and
c writes it to a character string in a reasonable format
c******************************************************************************
include 'Pstuff.com'
real*8 xnum, lognum
integer numdec
lognum = alog10(abs(xnum))
if (lognum >= 6.) then
write (errmess,1002)
elseif (lognum >= 0.) then
numdec = 5 - nint(lognum)
write (errmess,1001) numdec
else
write (errmess,1003)
endif
write (array,errmess) xnum
return
c*****format statements
1001 format ('(f8.',i1,'$)')
1002 format ('(1pe8.1$)')
1003 format ('(f8.5$)')
end
|