Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Subject -> OpenVMS: Error reading NAMELIST files created by AXP... on I64
Hi All,When dumping a namelist into a file, if one element of the namelist is a long string of 81 characters or more, the WRITE statement will dump this element into multiple lines of 80 characters each. But the WRITE statement of Fortran77 adds an extra blank character at position 1 of each line & the one of Fortran90 does not, as follows:
Create by AXP:
-> 'A29', 'A30', 'A31', 'A32', 'A33', 'A34', 'A35', 'A36', 'A37', 'A38', 'A39', 'A4
-> 0', 'A41', 'A42', 'A43', 'A44', 'A45', 'A05', 'A10', 'A46', 'A47', 'A48', 'A49',
Create by I64:
-> 'A29', 'A30', 'A31', 'A32', 'A33', 'A34', 'A35', 'A36', 'A37', 'A38', 'A39', 'A4
->', 'A41', 'A42', 'A43', 'A44', 'A45', 'A05', 'A10', 'A46', 'A47', 'A48', 'A49', 'A
And that is a big problem resulted by the extra blank when a F90 application tries to read a namlist file created by a F77 application. As you noticed in the previous example, the string "A40" is read as "A4" by the READ statement of Fortran90, because of the extra blank character added by the WRITE statement of Fortran77.Do you have any solution to fix that problem ???
Thank you..

Hello,
Some thoughts...
Assuming that the Fortran 77 program is creating the file, and that you can modify that program, you could specify a longer record length in the OPEN statement so that the WRITE will not insert the new line. If the record type is variable length, the RECL (or RECORDSIZE) keyword sets the maximum record length but allows shorter records.
If there are a limited number of these files to correct, you could fix them with a text editor. With EVE (TPU) this could be largely automated.
If the output is mangled consistently enough, you could modify the Fortran 90 problem to expect and discard the leading blank character.
Kelly
Kelly

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |