Print

Print


Aleksandar Donev wrote:

>Richard E Maine wrote:
>
>
>>Fortunately for me, I've never
>>used namelist internal output, and my uses of list-directed internal
>>output are pretty simple.
>>
>>
>I did not use to use much list-direction internal output, but then I
>implemented a comprehensive and OOP event logging system, which is
>supposed to work even on a parallel machine where non-internal IO is
>not possible. The idea is that the client writes whatever it needs to
>write to an internal buffer
>
>WRITE(log%buffer,...) ...
>
>and then calls
>
>CALL log%Write() ! Type-bound procedure
>
>Since we do not have variable-IO lists or anything like the C-printf, it
>is not possible for me to replace the WRITE statement with my own
>provided subroutine. Rather, I let the user use internal IO, and then I
>take care of actually writing that to a file, the screen, sending it
>via MPI, or whatever.
>
>Best,
>Aleks
>
>

    A couple of thoughts on how you may overcome this problem.  I don't
know how useful any of them may be in your situation.

    1.  Bounds checking?  Have you turned this on?  Most compilers have
this option.  It's usually spelled something like /CHECK=ALL on CVF and
HP Fortran for OpenVMS, -CHK on Lahey LF95, or something similar.  I use
it all of the time, and it usually catches problems like this.

    2.  User-Defined Derived-Type I/O Procedures (UDDTIOP)?  Would you
be able to write a UDDTIOP that would be able to overcome the silent
overflow of your buffer?

    3.  Large buffer with LEN_TRIM?  How about defining a ridiculously
large sized character string and then using LEN_TRIM to find out what
the significant length of the data is?

--
----------
Sincerely,
Craig T. Dedo
17130 W. Burleigh Place             Internet:     [log in to unmask]
Brookfield, WI   53005-2759         Voice Phone:  (262) 783-5869
USA                                 Fax Phone:    (262) 783-5928

"They that can give up essential liberty to obtain a little temporary
    safety deserve neither liberty nor safety."  -- Benjamin Franklin
    (1759)