fortran - Error on line 50: attempt to give DATA in type-declaration -
i try compile fortran 77 code , have problems this.
integer row(nnzmax+nszero),column(nnzmax+nszero), + ireg(nximax),florsm(nzimax)/nzimax*2/ real lambda,imodel(nximax,nzimax),dm(nmmax), + dum1(nmmax),dum2(nmmax),data(ndmax+nsconst), + anz(nnzmax+nszero),ibmodel(nximax,nzimax), + smwz(nzimax)/nzimax*-1./,spwz(nzimax)/nzimax*-1./ error on line 50: attempt give data in type-declaration error on line 52: attempt give data in type-declaration
i used work code,but has been compiled intel fotran compiler. have moved other country not have ifort installed here. using fort77 now. should try compilation options or?i have used script compile app .f folder.
#! /bin/csh -f set list=`ls *.f` set flag="-o" echo $list foreach file (${list}) echo $file f77 ${file} ${flag} ${file:r} mv ${file:r} ../bin/. end
i have changed declarations this:
integer row(nnzmax+nszero),column(nnzmax+nszero), + ireg(nximax),florsm(nzimax), + data florsm /nzimax*2/ real lambda,imodel(nximax,nzimax),dm(nmmax), + dum1(nmmax),dum2(nmmax),data(ndmax+nsconst), + anz(nnzmax+nszero),ibmodel(nximax,nzimax), + data smwz /nzimax*-1./, + data spwz /nzimax*-1./
but still got
error on line 50: attempt give data in type-declaration error on line 53: attempt give data in type-declaration error on line 385: declaration error smwz: used variable error on line 385: declaration error smwz: may not appear in namelist error on line 385: declaration error spwz: used variable error on line 385: declaration error spwz: may not appear in namelist
this fragment, , later similar ones
florsm(nzimax)/nzimax*2/
looks non-standard way of initialising variable sort-of data
statement merged declaration. more standard approach separate two,
florsm(nzimax) ... data florsm /nzimax*2/
one of beauties of working intel fortran compiler long history; along way has picked up, , continues accept, sorts of non-standard features. i'm guessing 1 of , not acceptable other compiler mention.
of course, seems error statement seems telling us.
a standard replacement might be
florsm(nzimax) = 2
but takes advantage of fortran 90 feature called fort77
might not understand either.
Comments
Post a Comment