Xref: utzoo comp.sys.hp:2234 comp.lang.fortran:2110 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!ucdavis!iris!schell From: schell@iris.ucdavis.edu (Stephan Schell) Newsgroups: comp.sys.hp,comp.lang.fortran Subject: HP-UX f77 namelist problems Keywords: fortran, frustration Message-ID: <4654@ucdavis.ucdavis.edu> Date: 14 Jun 89 02:46:24 GMT Sender: uucp@ucdavis.ucdavis.edu Reply-To: schell@iris.ucdavis.edu (Stephan Schell) Distribution: usa Organization: U.C. Davis - Department of Electrical Engineering and Computer Science Lines: 56 I have a problem using namelists on Hewlett-Packard's 9000/825 under HP-UX 3.0 that I have not encountered on other machines (e.g., VAXen). HP-UX 3.0 (9000/825 machine) version of f77 does not seem to accept namelist input like (I think) it should. I have a real array in the namelist. If I do not specify each and every element's value in the namelist input file, then I get a nasty error message. If I do specify every element's value, then all is well. The HP-UX f77 manual seems to indicate that what I'm doing should be OK. I don't think the user of the program should be responsible for filling up array elements that he does not want to use. OS release and version info: HP-UX A.B3.10 B Here is file "test.f". Typing "f77 -a -K -o test test.f" produces no warnings. (check for anything that is non-ANSI according to HP). PROGRAM TEST CHARACTER*16 A(3) REAL B(3), C(3), D(3) NAMELIST /FOO/ A, B, C, D OPEN(UNIT=10,FILE='TEST.INP',ACCESS='SEQUENTIAL',STATUS='OLD', 1 FORM='FORMATTED') READ(UNIT=10,NML=FOO) CLOSE(UNIT=10) STOP END Here is file "TEST.INP". Notice that only the first element of each array is given a value. $FOO A = 'AZ', B = 0.0, C = 360.0, D = 0.1 $END Here is the result of typing "test". *** FORTRAN I/O ERROR 907: ERROR IN LIST-DIRECTED I/O READ OF CHARACTER DATA ( 0) 0x00007128 IO_DED + 0x250 ( 1) 0x00004d14 FTN_F_RSNE + 0x154 ( 2) 0x00002ed0 test + 0x128 So, what did I do wrong, or have I found a bug, or are the namelist standards too vague to make a determination here? Thanks for anything you have to say. Stephan V. Schell Dept. of Electrical Engineering University of California, Davis schell@iris.ucdavis.edu ...ucbvax!ucdavis!iris!schell