At 01:24 PM 3/6/99 -0600, Jaehoon Seol wrote:
>
>I have the following problem.
>
> real,dimension(:),pointer :: myarray
> ===================
> write ( unit=10,fmt=* ) myarray.
>
>I like to print the content of each element of myarray whose size is run
>time dependent. I like to use some other format besides the default *. Is
>there any simple way of handling this? Thanks for any information.
>
>
Sure, you can use any format you want. You need to know what you want to do
about coming to the end of the line, etc. For example:
real,dimension(:),pointer :: myarray
! something that either allocates myarray or pointer assigns it to
! point to a target array. Maybe
! read *, n
! allocate (myarray(n))
! or
! myarray => something_declared_as_a_target(1:n)
!
! write ( unit=10,fmt=* ) myarray.
write (unit=10, fmt="(f10.0,2f20.5,e15.3)") myarray
will write 4 values per line in 3 different styles. If the length of
myarray isn't divisible by 4 the last line will have less than 4
values. I think you can help answer your question by looking up
formats in a text book.
I hope this answers your question.
Dick Hendrickson
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|