On Tue, 16 Jan 2001, Kipp Graham wrote:
> Refer to the code fragment below.
> Use I0 for the integer justification, as
> indicated by Ralph Carmichaell and
> BZ before the F format to treat embedded
> (and trailing) blanks as zeros.
>
> program just
> Implicit none
> integer i
> Do i=1,110
> print '(I0,A1,BZF5.2)', i,',',float(i)/100
> enddo
> end
According to Metcalf & Reid, BN and BZ format descriptors have NO effect on
OUTPUT. So what you got below is compiler dependent and not part of the
standard.
> This produces the following output:
>
> 1, 0.01
> 2, 0.02
> 3, 0.03
> ...
> 97, 0.97
> 98, 0.98
> 99, 0.99
> 100, 1.00
> 101, 1.01
> 102, 1.02
> ...
>
> Regards,
>
> Graham Kipp
>
> Email: [log in to unmask]
> Phone: (613) 9481 9296
> Mobile: 0418 610 898
> Fax: (613) 9481 9123
>
>
> > -----Original Message-----
> > From: mbai [mailto:[log in to unmask]]
> > Sent: Sunday, January 14, 2001 3:52 PM
> > To: [log in to unmask]
> > Subject: align
> >
> >
> > Hello,
> >
> > How to write following format (Align left, zero not omitted
> > if exists):
> > 1, 0.01
> > 2, 0.02
> > 3, 0.03
> > ...
> > 11, 0.11
> > 12, 0.12
> > ...
> > 111, 1.11
> > ...
> >
> > other than following format (Align right, zero omitted):
> > 1, .01
> > 2, .02
> > 3,. 03
> > ...
> > 11,.11
> > 12, .12
> > ...
> > 111, 1.1
> > 112, 1.2
> >
> > I use write (2,'I5, 1X, F4.2) but it is not ALIGN LEFT, and
> > zero is omitted
> > if it <1.
> >
> > Thanks
> >
>
Dr. W. J. Metzger Experimental High Energy Physics Group
tel. +31-24-3653127 Faculty of Natural Sciences
+31-24-3652099 (secr.) University of Nijmegen
fax. +31-24-3652191 Toernooiveld 1
telex 48228 wina nl 6525 ED Nijmegen, The Netherlands
e-mail: [log in to unmask] or [log in to unmask]
http://home.cern.ch/metzger/ or http://www.hef.kun.nl/~wes
|