Date: Sat, 11 Sep 1999 19:04:21 -0700 (PDT) From: lou@man-97-187.reshall.berkeley.edu To: FreeBSD-gnats-submit@freebsd.org Subject: bin/13703: libf2c Message-ID: <199909120204.TAA10289@man-97-187.reshall.berkeley.edu>
next in thread | raw e-mail | index | archive | help
>Number: 13703 >Category: bin >Synopsis: MCNP compilation problem >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Sep 11 19:10:00 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Tak Pui Lou >Release: FreeBSD 3.2-RELEASE i386 >Organization: UCBNE >Environment: >Description: When I compiled MCNP, I can't get one of the subroutine working probably. This subroutine tries to read the input and write it to another file. When the input has a line begins with "like", it backspace and read the previous line again and write the previous line with some changes to the output file. But, it seems to be confuse about the file formats after that. The input is ascii. I don't know about the output but it seems to be binary but become ascii after "like" card or vice-versa. (I am not sure because it is a hugh program.) This happens to all FBSD versions I have used. There is no error message when you compile it, but the program won't run with "like" card. >How-To-Repeat: To show you what is wrong, I attach a small portion of the subroutine likebt.f. c if(mm.eq.2)go to 150 c c when "like" is seen, remove the card from iu1. if(nwc.eq.3)return if(nwc.ne.1)go to 10 likef=1 mxa=mxa-1 backspace iu1 call nxtsym(klin,' ',1,it,iu,1) if(klin(it:iu).eq.'like')backspace iu1 endfile iu1 return c c get the material and density and copy the geometry of cell "m". 10 if(nwc.ne.2)go to 120 do 20 nc=1,mxa 20 if(mod(ncl(lncl+nc),100000).eq.iitm)go to 30 go to 110 30 ncl(lncl+mxa+1)=ncl(lncl+mxa+1)+100000*(ncl(lncl+nc)/100000) rewind iu2 rewind iu1 do 50 i=1,nc 40 read(iu1,'(a5,a80)')ht1,hl1 50 if(ht1(1:1).eq.'&')go to 40 ipp=4 nw=0 hl2=' ' call nxtsym(hl1,' ',1,it,iu,1) go to 80 60 read(iu1,'(a5,a80)',end=110)ht1,hl1 if(ht1(1:1).ne.'&')go to 100 iu=0 80 call nxtsym(hl1,' ():#$&',iu+1,itl,iu,1) if(iu.eq.0)go to 60 if(hl1(itl:itl).eq.'$'.or.hl1(itl:itl).eq.'&')go to 60 nw=nw+1 hh=hl1(itl:iu) if(nw.eq.1)read(hh,'(bn,i30)')mats if(nw.eq.2.and.mats.ne.0)read(hh,'(bn,e30.0)')rhos if(nw.eq.1.or.nw.eq.2.and.mats.ne.0)go to 80 k=index('():#',hh(1:1)) ki=kdata(hh) if(k.eq.0.and.ki.eq.0)return if(k.eq.4)ncomp=ncomp+1 if(ipp+2+iu-itl.le.80)go to 90 write(iu2,'(a80)')hl2 ipp=4 hl2=' ' 90 hl2(ipp+2:ipp+2+iu-itl)=hh ipp=ipp+2+iu-itl go to 80 100 itl=-1 return 110 itl=-2 return c c copy the exceptions onto iu2. 120 if(hitm.eq.'=')return if(likef.ne.1)go to 140 if(hitm.eq.'mat')likef=2 if(hitm.eq.'rho')likef=3 if(likef.ne.1)return n=0 if(hitm.ne.':'.and.hl2(ipp:ipp).ne.':')n=1 if(ipp+3+nitm.le.60.or.n.eq.0)go to 130 write(iu2,'(a80)')hl2 ipp=4 hl2=' ' 130 hl2(ipp+n+1:ipp+n+nitm)=hitm ipp=ipp+n+nitm return c c save mat or rho values. 140 if(likef.eq.2)mats=iitm if(likef.eq.3)rhos=ritm likef=1 return c c when the "like" card is all read, finish the expanded card. 150 if(nwc.lt.2)go to 210 backspace iui c c copy any cell parameters of cell "m". if(itl.eq.-2)go to 200 if(itl.eq.-1)go to 190 iu=itl-1 go to 170 160 read(iu1,'(a5,a80)',end=200)ht1,hl1 if(ht1(1:1).ne.'&')go to 190 iu=0 170 call nxtsym(hl1,' ()#$&',iu+1,itl,iu,1) if(iu.eq.0)go to 160 if(hl1(itl:itl).eq.'$')go to 160 if(ipp+4+iu-itl.le.80)go to 180 write(iu2,'(a80)')hl2 ipp=4 hl2=' ' 180 hl2(ipp+2:ipp+2+iu-itl)=hl1(itl:iu) ipp=ipp+2+iu-itl go to 170 c c skip over the rest of iu1. 190 read(iu1,'(a5,a80)',end=200)ht1,hl1 go to 190 200 backspace iu1 c c get ready to read the expanded card from iu2. write(iu2,'(a80)')hl2 endfile iu2 rewind iu2 jui=iu2 write(hlin,'(i5,i6)')icn,mats if(mats.ne.0)write(hlin(13:33),'(e21.14)')rhos 210 likef=0 return end >Fix: Recompile libI77 under /usr/src/lib/libI77 with the Makefile in /usr/src/libf2c with the -DNON_ANSI_RW_MODES removed from the CFLAG. I believe the problem is wrong configuration of libI77. I would also like to ask you if you can put -DWANT_LEAD_0 in the CFLAG. The reason is a lot of FORTRAN compilers (e.g. from SUN, DEC, SGI, ...) have a leading zero for decimal number smaller than 1. I am pretty sure MCNP is working probably because it can be compiled under many machines. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199909120204.TAA10289>