Re: Fortran 77 alphabet character $
- From: Herman D. Knoble <SkipKnobleLESS@xxxxxxxxxxxxxxx>
- Date: Thu, 29 May 2008 13:15:00 -0400
On Thu, 29 May 2008 11:39:52 -0500, mecej4 <mecej4_spam_nyet@xxxxxxxxxxxxx> wrote:
-|Herman D. Knoble wrote:
-|> What does the F77 Standard say about using the character, $ for the beginning of a
-|> variable name? A professor here has a large code that does this throughout. (See
-|> the following Block Data).
-|>
-|> Note: tje variable names in this large code begin with every letter of the alplhabet;
-|> so a substitute for $ won't work.
-|>
-|> The prroblem is that G95 will flag thet such use of $ as an error.
-|> Lahey LF95 compiles the code with no warning about the $ variables.
-|> Silverfrost flags the $ varables as an error.
-|> Intel Ifort compiles the code with no warning about the $ variables.
-|>
-|> Thanks.
-|> Skip Knoble
-|>
-|> -------------------------------------Example of use of $ variables ------------
-|> BLOCKDATA
-|> IMPLICIT INTEGER ($)
-|> COMMON /BASIC/$PRTOP(15),TITLE(18),VERSIN,PAGE,NUMSTP,STEPS,IMAX,
-|> 1 JMAX,MMAX,NGEM,$STFLG,NSOR,IJMAX,$CNSIZ,
-|> 2 $BASCR,LO1,$INPCR,$MSMCR,$GTINP,
-|> 3 NLB,NTB,NRB,NBB,EPI1,ITMAX,FACTOR,$BORSH,
-|> 4 LIMI,LIMJ,NIT,TTLM,VMN,MTOX,MC1,MC2,MC3,MC4,I,J,K,TV1,
-|> 5 TV2,TV3,TV4,IS1,IS2,
-|> 6 GROUPS,IBORON,NOADD,$SGSUM,$SGPT,$MAP(20),$MXMP,LIN
-|> INTEGER STEPS,BESTIR
-|> INTEGER PAGE
-|> COMMON /XENON/ $XEOPT
-|> COMMON /BATCOS/ COSQNN(180)
-|> COMMON /COST/ COSTFL,NUMBAT,DOLLAR,IBAOUT(15,5),ILLREU(15),
-|> 1ILREPO(15,5)
-|> COMMON /RELOAD/MAXSH,NCODE(70),NEB(4,70),W(70),P(6),V(6),
-|> 1 MMA,MMI,IR(70),BESTIR(70),KC,KSUM,LA,INNEW(5),
-|> 2 NEBX(4,70),IV(6),RPLO(70),RPHI(70),
-|> 3 BESTID(70),BESTBA(70),OPTPPM
-|> COMMON /PASSCY/ CCULM(70),AASNAM(70),IIBATC(70), TRECUL(15,5),TREN
-|> 1AM(15,5),IREOPO(15,5)
-|> C
-|> DATA PAGE/0/
-|> DATA COSQNN/180*0./
-|> DATA DOLLAR/'$$'/
-|> DATA INNEW/11,12,13,19,24/
-|> DATA VERSIN /90.1/
-|> DATA TRECUL/75*0./,TRENAM/75*' '/,IREOPO/75*0/
-|> C DEFAULT MAX. NO. OF ITERATIONS
-|> DATA ITMAX/700/
-|> C DEFAULT OUTPUT OPTIONS
-|> CB DATA $PRTOP/1,10,0,-1,1,1,1,0,0,0,0,1,0,0,0/
-|> DATA $PRTOP/0, 0,0,-1,0,0,1,0,0,0,0,1,0,0,0/
-|> C DEFAULT BOUNDRY CONDITION ASSIGNMENTS
-|> DATA NLB/1/,NTB/1/,NRB/0/,NBB/0/
-|> C DEFAULT POWER MAP DATA
-|> DATA $MAP/8,7,6,4,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0/,$MXMP/6/
-|> END
-|>
-|>
-|>
-|This is not so simple, but may work if the existing source does not use
-|variables beginning with, say, "Z_" :
-|
-| (i) Run Fsplit on the sources;
-|
-| (ii) Run your fortran-77 compiler on each subroutine, collect a list of
-|variables starting with $. In each such, subroutine, replace $ by Z_;
-|add an integer type declaration for the variables tagged by the F-77
-|compiler.
-|
-|--mecej4
Mecej: Thanks. As it turns out there were only a handful of variables
beginning with Z. I used Kedit to view and change these to WZ...... .
Then, after double-checking witih Kedit subcommand; ALL /Z/,
I issued a global Kedit: CHANGE /$/Z/ * *
Moot point though since thte code violates the Standard in
many places by passing DP arrays to every type under the
sun (even Integer*2). G95 correctly rejects these illegal
but often prevelent parameter/argument mappings.
I don't have an F77 compiler; I use G95, Lahey LF95, and
Silverfrost under Windows and a plethora of comoilers under
Linux. I think my first post indicated that LF95 (no debugging
options) and Intel ifort compile the code witih no changes.
It runs the sample input and generates output that matches
the sampe output file. But I don't like working with such
messy code without first being able to use Lahey LF95
with debug options:
-chk(a,e,s,u,x) -chkglobal -g -pca -stchk -trace -nzero -o0 -trap diou
Thanks to all.
Skip
.
- Follow-Ups:
- Re: Fortran 77 alphabet character $
- From: user1
- Re: Fortran 77 alphabet character $
- From: Ian Gay
- Re: Fortran 77 alphabet character $
- References:
- Fortran 77 alphabet character $
- From: Herman D . Knoble
- Re: Fortran 77 alphabet character $
- From: mecej4
- Fortran 77 alphabet character $
- Prev by Date: Re: Fortran 77 alphabet character $
- Next by Date: Re: Fortran 77 alphabet character $
- Previous by thread: Re: Fortran 77 alphabet character $
- Next by thread: Re: Fortran 77 alphabet character $
- Index(es):