Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbjade.BERKELEY.EDU Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!ucbjade!jerry From: jerry@ucbopal.BERKELEY.EDU (Jerry Berkman) Newsgroups: net.wanted,net.lang.f77 Subject: Re: Namelist Interpreter Message-ID: <128@ucbjade.BERKELEY.EDU> Date: Thu, 24-Oct-85 18:55:34 EDT Article-I.D.: ucbjade.128 Posted: Thu Oct 24 18:55:34 1985 Date-Received: Sat, 26-Oct-85 03:45:42 EDT References: <269@ukc.UUCP> <256@uwstat.UUCP> <582@bonnie.UUCP> <1805@hao.UUCP> <2919@sun.uucp> Sender: network@ucbjade.BERKELEY.EDU Reply-To: jerry@ucbopal.UUCP (Jerry Berkman) Organization: University of California, Berkeley Lines: 47 Xref: watmath net.wanted:7452 net.lang.f77:395 In article <2919@sun.uucp> guy@sun.uucp (Guy Harris) writes: >> > Help! Does anyone have routines that mimic in any way >> > the namelist feature of VMS and IBM Fortran? >> >> We have implemented a limited NAMELIST capability here. ... >> Unfortunately, ours is implemented as a subroutine library, which means >> syntax changes in your FORTRAN program will be required in order to use it. >> (Any other method would require compiler hacking anyway, I suppose). > >Some compiler hacking, perhaps. Somebody (Stu Feldman?) stuck items in the >"f77" grammar and I/O statement handling code to support NAMELIST; however, >they never got around to writing (or, at least, releasing) the support >library routines. The people at AT&T-IS (formerly at the Bell Labs UNIX >System Development Laboratory, formerly at..., formerly at...) and the >people doing the 4.3BSD version of "f77" finally wrote, or at least released >(or will release, presumably, in the cae of 4.3BSD) the needed library >routines. I don't know how much in the way of fixes to the compiler, or >changes (as opposed to additions) to the "f77" I/O library were needed to >make it work. > > Guy Harris Back in June or July, I got namelist I/O to work with f77 for 4.3 BSD and added it to the 4.3 BSD version. I implemented it so that most VMS, CDC, and IBM programs using namelist I/O will work with no changes. Note I said most, not all. E.g. VMS allows substring notation in the data; I didn't bother to implement that. The f77 compiler has had code for namelist for a long time. It was disabled a few years ago because there were no library routines to implement namelist I/O. A few months ago, I wrote the necessary routines and added them to the library. I then enabled the code in the compiler by adding -DNAMELIST to the makefile. The code generated had two minor bugs (not differentiating between 2 and 4 byte logicals and forgetting to multiply an offset by 4) which I fixed. I added nmlio.h (49 lines), rsnmle.c (611 lines), and wsnmle.c (92 lines) to the library to implement namelist I/O. wsnmle.c is very short because namelist write is implemented by writing the namelist name and then using the list-directed routines to write the variables names and values. rsnmle.c similarly uses the routines for list-directed reads. The list-directed routines have been modified as appropriate so they can be called for list-directed or namelist I/O. - Jerry Berkman Computing Services, (415) 642-4804 jerry@opal.Berkeley.EDU