Some compilers offer a compiler option to choose between printing the
leading 0 and not printing it.
Good luck, Wes
On Sat, 13 Jan 2001, mbai wrote:
> 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
>
> ----- Original Message -----
> From: "robin" <[log in to unmask]>
> To: <[log in to unmask]>
> Sent: Monday, January 15, 2001 2:53 AM
> Subject: Re: Generic interface with assumed-size arguments
>
>
> > > Date: Fri, 12 Jan 2001 12:58:49 -0500
> > > From: Aleksandar Donev <[log in to unmask]>
> >
> > > Hello,
> > >
> > > I am unable to get Lahey F95 to resolve a generic interface of the
> following
> > > form:
> > >
> > > program test
> > > interface
> > > subroutine dummy1(array)
> > > integer(kind=1), dimension(*) :: array
> > > end subroutine
> > > subroutine dummy2(array)
> > > integer(kind=2), dimension(*) :: array
> > > end subroutine
> > > end interface
> > >
> > > INTERFACE Generic
> > > module procedure dummy1
> > > module procedure dummy2
> > > END INTERFACE Generic
> > >
> > > integer(kind=1), dimension(10) :: array1D
> > > integer(kind=1), dimension(10,10) :: array2D
> > > call Generic(array1D) ! THIS WORKS
> > > call Generic(array2D) ! THIS DOES NOT WORK
> >
> > It won't, because there's no interface for a 2-d array.
> > You'll need to add one.
> >
> > > end program test
> > >
> > > Why doesn't the call with a rank-2 array not work, if this is one of the
> > > main purposes of assumed-size arrays? Is there any way for this kind of
> > > thing to work without wrapping the whole thing into another routine
> which
> > > uses assumed-shape array arguments or rank 1 and 2 respectively?
> > >
> > > Thanks a lot,
> > > Aleksandar
> >
>
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
|