FORCHEK(1L) FORCHEK(1L) NAME forchek−Fortranprogramchecker SYNOPSIS forchek[−[no]declare][−[no]division][−[no]extern][−[no]f77] [−[no]library][−[no]linebreak][−[no]list][−[no]portability] [−[no]project][−[no]sixchar][−[no]symtab][−[no]usage][−[no]verbose] [−columns=num][−common=num][−novice=num][−output=str] INTRODUCTION Forchek(shortforFortranchecker)isdesignedtodetectcertainerrorsinaFortranprogramthat acompilerusuallydoesnot.Forchekisnotprimarilyintendedtodetectsyntaxerrors.Itspurposeistoassisttheuserinfindingsemanticerrors.SemanticerrorsarelegalintheFortranlanguagebutarewastefulormaycauseincorrectoperation.Forexample,variableswhicharenever usedmayindicatesomeomissionintheprogram;uninitializedvariablescontaingarbagewhich maycauseincorrectresultstobecalculated;andvariableswhicharenotdeclaredmaynothave theintendedtype.ForchekisintendedtoassistusersinthedebuggingoftheirFortranprogram. Itisnotintendedtocatchallsyntaxerrors.Thisisthefunctionofthecompiler.Priortousing Forchek,theusershouldverifythattheprogramcompilescorrectly. ThisdocumentfirstsummarizeshowtoinvokeForchek.Thatsectionshouldbereadbefore beginningtouseForchek.LatersectionsdescribeForchek’soptionsinmoredetail,givean exampleofitsuse,andexplainhowtointerprettheoutput.ThefinalsectionsmentionthelimitationsandknownbugsinForchek. INVOKINGFORCHEK Forchekisinvokedthroughacommandoftheform:

$forchek[-option-option...]filename[filename...]

(Thebracketsindicatesomethingwhichisoptional.Thebracketsthemselvesarenotactually typed.)Hereoptionsarecommand-lineswitchesorsettings,whichcontroltheoperationofthe programandtheamountofinformationthatwillbeprintedout.Ifnooptionisspecified,the defaultactionistoprinterrormessages,warnings,andinformationalmessages,butnottheprogramlistingorsymboltables. Eachoptionbeginswiththe’−’character.(OnVAX/VMSsystemsyoumayuseeither’/’or ’−’.)Theoptionsaredescribedatgreaterlengthinthenextsection. Forchekoptionsfallintotwocategories:switches,whichareeithertrueorfalse,andsettings, whichhaveanumericorstringvalue.Thenameofaswitchcanbeprecededby’no’toturnit off:e.g.−nousagewouldturnoffthewarningsaboutvariableusage.Onlythefirst3characters ofanoptionname(notcountingthe’−’)needbeprovided.TheswitcheswhichForchekcurrentlyrecognizesare: −declare Printalistofallidentifierswhosedatatypeisnotexplicitlydeclared.Default=no. −division Warnwhereverdivisionisdone(exceptdivisionbyaconstant).Default=no. −extern Warnifexternalsubprogramswhichareinvokedareneverdefined.Default=yes. −f77WarnaboutviolationsoftheFortran77standard.Default=no. −library Beginlibrarymode:donotwarnifsubprogramsinfilearedefinedbutneverused. Default=no. −linebreak Treatlinebreaksincontinuedstatementsasspace.Default=yes. 21August1991 -1-FORCHEK(1L) FORCHEK(1L) −listPrintsourcelistingofprogram.Default=no. −portability Warnaboutnon-portableusages.Default=no. −project Createprojectfile(seeexplanationbelow).Default=no. −sixchar Listanyvariablenameswhichclashat6characterslength.Default=no. −symtab Printoutsymboltable.Default=no. −usage Warnifvariablesnotused,etc.Default=yes. −verbose Producefullamountofoutput.Default=yes. Therearefoursettings: −columns=n Setmaximumlinelengthtoncolumns.(Beyondthisisignored.)Maxis132.Default= 72. −common=n LevelofstrictnessincheckingCOMMONblocks.Minis0(nochecking).Maxis3(must beidentical).Default=3. −novice=n Setnovicelevel,whichcontrolscertaintypesofwarnings.Minis1(tyro).Maxis5 (wizard).Default=1. −output=filename Sendoutputtothegivenfile.Defaultistosendoutputtothescreen.(Defaultfilename extensionis.lis). Whenmorethanoneoptionisused,theyshouldbeseparatedbyablankspace.Noblankspaces maybeplacedaroundtheequals(=)inasetting.Forchek"?"willproducealistofalloptions andsettings. Whengivinganameofaninputfile,theextensionisoptional.Ifnoextensionisgiven,Forchek willfirstlookforaprojectfilewithextension.prjandwillusethatifitexists.Ifnot,then ForchekwilllookforaFortransourcefilewiththeextension.forforVMSsystems,.fforUnix systems.MorethanonefilenamecanbegiventoForchek,anditwillprocessthemodulesinall filesasiftheywereinasinglefile. Ifnofilenameisgiven,Forchekwillreadinputfromthestandardinput. FORCHEKOPTIONS ThissectionprovidesamoredetaileddiscussionofForchekcommand-lineoptions.Optionsand filenamesmaybeinterspersedonacommandline.Eachoptionremainsineffectfromthepointit isencountereduntilitisoverriddenbyalateroption.Thusforexample,thelistingmaybesuppressedforsomefilesandnotforothers. Theoptionnamesinthefollowinglistareinalphabeticalorder. −columns=n Setmaximumlinelengthtoncolumns.(Beyondthisisignored.)Thissettingisprovided toallowcheckingofprogramswhichmayviolatetheFortranstandardlimitof72columns forthelengthofaline.Accordingtothestandard,allcharacterspastcolumn72are ignored.Thissettingdoesnotaffectthereportingofoverlengthlinesunderthe−f77 option.Maxis132.Default=72. 21August1991 -2-FORCHEK(1L) FORCHEK(1L) −common=n ThissettingvariesthestrictnessofcheckingofCOMMONblocks.Level3isthestrictest: itrequiresthatineachdeclarationofagivenCOMMONblock,correspondingvariables agreeindatatypeand(ifarrays)sizeandnumberofdimensions.Levels1and2require onlythatcorrespondingmemorylocationsagreeindatatype.Thedifferencebetween Levels1and2isthatLevel2warnsiftheblocksarenotequalintotallength,whileLevel 1doesnot.Level0suppressesallchecking.Default=3. −declare Ifthisflagisset,allidentifierswhosedatatypeisnotdeclaredineachmodulewillbe listed.Thisflagisusefulforhelpingtofindmisspelledvariablenames,etc.Thesame listingwillbegivenifthemodulecontainsanIMPLICITNONEstatement.Default= no. −division Thisswitchisprovidedtohelpusersspotpotentialdivisionbyzeroproblems.Ifthis switchisselected,everydivisionexceptbyaconstantwillbeflagged.(Itisassumedthat theuserisintelligentenoughnottodividebyaconstantwhichisequaltozero!)Default =no. −extern CausesForchektoreportwhetheranysubprogramsinvokedbytheprogramarenever defined,oraremultiplydefined.Ordinarily,ifForchekisbeingrunonacompleteprogram,eachsubprogramotherthantheintrinsicfunctionsshouldbedefinedonceandonly oncesomewhere.Turnoffthisswitchifyoujustwanttocheckasubsetoffileswhich formpartofalargercompleteprogram,ortocheckallatonceanumberofunrelatedfiles whichmighteachcontainanunnamedmainprogram.Subprogramargumentswillstillbe checkedforcorrectness.Default=yes. −f77UsethisflagtocatchlanguageextensionswhichviolatetheFortran77standard.Such extensionsmaycauseyourprogramnottobeportable.Examplesincludetheuseof underscoresinvariablenames;variablenameslongerthansixcharacters;statementlines longerthan72characters;andnonstandardstatementssuchastheDO...ENDDO structure.Forchekdoesnotreportontheuseoflowercaseletters.Default=no. −library Thisswitchisusedwhenanumberofsubprogramsarecontainedinafile,butnotallof themareusedbytheapplication.Normally,Forchekwarnsyouifanysubprogramsare definedbutneverused.Thisswitchwillsuppressthesewarnings.Default=no. −linebreak Normally,whenscanningastatementwhichiscontinuedontothenextline,Forchek treatstheendofthelineasaspace.ThisbehavioristhesameasforPascalandC,and alsocorrespondstohowhumansnormallywouldreadandwriteprograms.However, occasionallyonewouldliketouseForchektocheckaprograminwhichidentifiersand keywordsaresplitacrosslines,forinstanceprogramswhichareproducedusingapreprocessor.Choosingtheoption−nolinebreakwillcauseForchektoskipovertheendof lineandalsoanyleadingspaceonthecontinuationline(fromthecontinuationmarkup tothefirstnonspacecharacter).Default=yes,i.e.treatlinebreaksasspace. Notethatinnolinebreakmode,iftokenpairsrequiringinterveningspace(forinstance, GOTO100)areseparatedonlybyalinebreak,theywillberejoined. Also,tokensrequiringmorethanonecharacteroflookaheadfortheresolutionofambiguitiesmustnotbesplitacrosslines.Inparticular,acomplexconstantmaynotbesplit acrossaline. −listSpecifiesthatalistingoftheFortranprogramistobeprintedoutwithlinenumbers.If Forchekdetectsanerror,theerrormessagefollowstheprogramlinewithacaret(ˆ ) specifyingthelocationoftheerror.Ifnosourcelistingwasrequested,Forchekwillstill 21August1991 -3-FORCHEK(1L) FORCHEK(1L) printoutanylinecontaininganerror,toaidtheuserindeterminingwheretheerror occurred.Default=no. −novice=n Thissettingcontrolscertainmessagesaboutconditionswhicharelikelytobeerrorsfor noviceprogrammers,butwhichareoftenintentionalbymoresophisticatedprogrammers. SomeofthesewarningsdealwithcasesinwhichForcheksuspectsthatwhatappearsto beafunctionisintendedtobeanarray,whichtheuserforgottodeclareinaDIMEN-SIONstatement.Sinceafunctioninvocationandanarrayreferenceareidenticalinsyn-tax,undeclaredarraysareinterpretedbytheFortrancompilerandbyForchekasfunc-tions.Noviceusersareoftenconfusedbythemessageswhichresult.Forchekattempts toremedythisconfusion.Defaultlevel=1. Thenovicelevelsaregivenbelow.Thewarningcorrespondingtoeachnumberwillbe suppressedifthenovicelevelissettogreaterthanthatvalue. 1.Warnifarrayspassedasargumentstoasubprogramdonotmatchthecorresponding dummyargumentsinbothnumberofdimensionsandsize.Exception:ifthedeclared sizeofthedummyarrayis1orifitisdimensionedwithadummyvariable,onlythe numberofdimensionswillbechecked. 2.Warntheuserifanyargumentofasubprogramappearstobeafunction.ThiswarningissuppressedifthedummyargumentisdeclaredinanEXTERNALstatement. Noviceprogrammersseldompassfunctionsasargumentsofasubprogram,soitis morelikelythatsuchanargumentwasintendedtobeanarray,butwasnotdimensioned. 3.Ifafunctionwasinvokedbutneverdefined,advisetheuserthatitmaybeanarray whichwasnotdimensioned.Thiswarningissuppressedifthefunctionisdeclaredin anEXTERNALorINTRINSICstatementinanymoduleoftheprogram.Thiswarningiscompletelysuppressedbythe−noexternoption. 4.Warnifafunctionhassideeffects:i.e.ifitmodifiesanyofitsarguments,ormodifiesavariableinCOMMON.Ideally,afunctionhasnosideeffects,andactsonlyby computingavaluebasedonitsarguments,whereasasubroutinenormallyacts throughsideeffects.Advancedprogrammerssometimeswishtocombinethefeatures ofasubroutineandafunctioninasinglemodule. −output=filename Thissettingisprovidedforconvenienceonsystemswhichdonotalloweasyredirectionof outputfromprograms.Whenthissettingisgiven,theoutputwhichnormallyappearson thescreenwillbesentinsteadtothenamedfile.Note,however,thatoperationalerrors ofForchekitself(e.g.outofspaceorcannotopenfile)willstillbesenttothescreen. Theextensionforthefilenameisoptional,andifnoextensionisgiven,theextension.lis willbeused. −portability Forchekwillgivewarningsforavarietyofnon-portableusages.Theseincludetheuseof tabsexceptincommentsorinsidestrings,theuseofhollerithconstants,andtheequivalencingofvariablesofdifferentdatatypes.Thisoptiondoesnotproducewarningsfor violationsoftheFortran77standard,whichmayalsocauseportabilityproblems.To catchthose,usethe−f77option.Default=no. −project Forchekwillcreateaprojectfilefromeachsourcefilethatisinputwhilethisflagisin effect.Theprojectfilewillbegiventhesamenameastheinputfile,butwiththeextension.for.forreplacedby.prj.(Ifinputisfromstandardinput,theprojectfileis namedforchek.prj.)Default=no. Aprojectfilecontainsasummaryofinformationfromthesourcefile,foruseinchecking agreementamongFUNCTION,SUBROUTINE,andCOMMONblockusagesinother 21August1991 -4-FORCHEK(1L) FORCHEK(1L) files. Itallowsincrementalchecking,whichsavestimewheneveryouhavealargesetoffiles containingsharedsubroutines,mostofwhichseldomchange.YoucanrunForchekonce oneachfilewiththe−projectflagset,creatingtheprojectfiles.Usuallyyouwouldalso setthe−libraryand−noexternflagsatthistime,tosuppressmessagesrelatingtoconsistencywithotherfiles.Onlyerrormessagespertainingtoeachfilebyitselfwillbe printedatthistime.Thereafter,runForchekwithouttheseflagsonalltheprojectfiles together,tocheckconsistencyamongthedifferentfiles.Allmessagesinternaltotheindividualfileswillnowbeomitted.Onlywhenafileisalteredwillanewprojectfileneedto bemadeforit. Theinformationsavedintheprojectfileconsistsofallsubprogramdeclarations,allsubprograminvocationsnotresolvedbydeclarationsinthesamefile,andoneinstanceof eachCOMMONblockdeclaration.Thusprojectfilescontainonlyinformationforcheckingagreementbetweenfiles.Thismeansthataprojectfileisofnouseifallmodulesof thecompleteprogramarecontainedinasinglefile. Naturally,whenthe−projectflagisset,Forchekwillnotreadprojectfilesasinput. HereisanexampleofhowtousetheUnixmakeutilitytoautomaticallycreateanew projectfileeachtimethecorrespondingsourcefileisaltered,andtocheckthesetoffiles forconsistency.TheexampleassumesthatamacroOBJShasbeendefinedwhichlistsall thenamesofobjectfilestobelinkedtogethertoformthecompleteexecutableprogram.

#tellmakewhataprojectfilesuffixis
.SUFFIXES:.prj
#tellmakehowtocreatea.prjfilefroma.ffile
.f.prj:
forchek-project-noextern-library$<
#setupmacroPRJScontainingprojectfilenames
PRJS=$(OBJS:.o=.prj)
#"makecheck"willcheckeverythingthathasbeenchanged.
check:$(PRJS)
forchek$(PRJS)

−sixchar OneofthegoalsoftheForchekprogramistohelpuserstowriteportableFortranprograms.Onepotentialsourceofnonportabilityistheuseofvariablenamesthatarelonger thansixcharacters.Somecompilersjustignoretheextracharacters.Thisbehaviorcould potentiallyleadtotwodifferentvariablesbeingconsideredasthesame.Forinstance, variablesnamedAVERAGECOSTandAVERAGEPRICEarethesameinthefirstsix characters.Ifyouwishtocatchsuchpossibleconflicts,usethisflag.Default=no. −symtab Asymboltablewillbeprintedoutforeachmodule,listingallidentifiersmentionedinthe module.Thistablegivesthenameofeachvariable,itsdatatype,andthenumberof dimensionsforarrays.Anasterisk(*)indicatesthatthevariablehasbeenimplicitly typed,ratherthanbeingnamedinanexplicittypedeclarationstatement.Thetablealso listsallsubprogramsinvokedbythemodule,allCOMMONblocksdeclared,etc.Default =no. −usage Thisswitchisonbydefault.ItcausesForchektolistallvariableswhichmaybeused beforetheyareinitialized,orwhicharegivenavaluebutneversubsequentlyused,or whicharedeclaredbutneverused.SometimesForchekmakesamistakeaboutthis. Usuallyiterrsonthesideofgivingawarningwherenoproblemexists,butinrarecases 21August1991 -5-FORCHEK(1L) FORCHEK(1L) itwillfailtowarnwheretheproblemdoesexist.Seethesectiononbugsforexamples.If variablesareequivalenced,theruleusedbyForchekisthatareferencetoanyvariable impliesthesamereferencetoallvariablesitisequivalencedto.Default=yes. −verbose Thisoptionisonbydefault.Turningitoffreducestheamountofoutputrelatingtonormaloperation,sothaterrormessagesaremoreapparent.Thisoptionisprovidedforthe convenienceofuserswhoarecheckinglargesuitesoffiles.Theeliminatedoutputincludes thenamesofprojectfiles,andthemessagereportingthatnosyntaxerrorswerefound. (Someofthisoutputisturnedbackonbythe−listand−symtaboptions.)Default= yes. CHANGINGTHEDEFAULTS Forchekincludesamechanismforchangingthedefaultvaluesofalloptionsbydefiningenvironmentvariables.WhenForchekstartsup,itlooksinitsenvironmentforanyvariableswhose namesarecomposedbyprefixingthestring"FORCHEK"ontotheuppercasedversionofthe optionname(thequotemarksarenotpartofthename.)Ifsuchavariableisfound,itsvalueis usedtospecifythedefaultforthecorrespondingswitchorsetting.Inthecaseofsettings(for example,thenovicelevel)thevalueoftheenvironmentvariableisreadasthedefaultsetting value.Inthecaseofswitches,thedefaultswitchwillbetakenastrueor"YES"unlesstheenvironmentvariablehasthevalue"0"or"NO"(again,thequotesarenotpartofthevalue).Of course,command-lineoptionswilloverridethesedefaultsthesamewayastheyoverridethebuilt-indefaults. Notethattheenvironmentvariablenamemustbeconstructedwiththefull-lengthoptionname, whichmustbeinuppercase.Forexample,tomakeForchekprintasourcelistingbydefault,set theenvironmentvariable"FORCHEKLIST"to"1"or"YES"oranythingotherthan"0"or "NO".Thenames"FORCHEKLIS"(notthefulloptionname)or"forcheklist"(lowercase) wouldnotberecognized. Herearesomeexamplesofhowtosetenvironmentvariablesonvarioussystems.Forsimplicity, alltheexamplessetthedefault−listswitchto"yes."

1.Unix,Bourneshell:$FORCHEKLIST=YES$exportFORCHEKLIST
2.Unix,Cshell:%setenvFORCHEKLISTYES
3.VAX/VMS:$DEFINEFORCHEKLISTYES
4.MSDOS:$SETFORCHEKLIST=YES

ANEXAMPLE ThefollowingsimpleFortranprogramillustratesthemessagesgivenbyForchek.Theprogramis intendedtoacceptanarrayoftestscoresandthencomputetheaveragefortheseries.

CAUTHORS:MIKEMYERSANDLUCIASPAGNUOLO
CDATE:MAY8,1989
CVariables:
CSCORE->anarrayoftestscores
CSUM->sumofthetestscores
CCOUNT->counterofscoresreadin
CI->loopcounter
REALFUNCTIONCOMPAV(SCORE,COUNT)
INTEGERSUM,COUNT,J,SCORE(5)
DO30I=1,COUNT
SUM=SUM+SCORE(I)
30CONTINUE
COMPAV=SUM/COUNT
END

21August1991 -6-FORCHEK(1L) FORCHEK(1L)

PROGRAMAVENUM
C
CMAINPROGRAM
C
CAUTHOR:LOISBIGBIE
CDATE:MAY15,1990
C
CVariables:
CMAXNOS->maximumnumberofinputvalues
CNUMS->anarrayofnumbers
CCOUNT->exactnumberofinputvalues
CAVG->averagereturnedbyCOMPAV
CI->loopcounter
C
PARAMETER(MAXNOS=5)
INTEGERI,COUNT
REALNUMS(MAXNOS),AVG
COUNT=0
DO80I=1,MAXNOS
READ(5,*,END=100)NUMS(I)
COUNT=COUNT+1
80CONTINUE
100AVG=COMPAV(NUMS,COUNT)
END

Thecompilergivesnoerrormessageswhenthisprogramiscompiled.Yethereiswhathappens whenitisrun:

$runaverage
70
90
85
<EOF>
$

Whathappened?Whydidn’ttheprogramdoanything?Thefollowingistheoutputfrom Forchekwhenitisusedtodebugtheaboveprogram:

$forchek-list-symtabaverage
FORCHEKVersion2.4August1991
Fileaverage.f:
1CAUTHORS:MIKEMYERSANDLUCIASPAGNUOLO
2CDATE:MAY8,1989
3
4CVariables:
5CSCORE->anarrayoftestscores
6CSUM->sumofthetestscores
7CCOUNT->counterofscoresreadin
8CI->loopcounter
9
10REALFUNCTIONCOMPAV(SCORE,COUNT)
11INTEGERSUM,COUNT,J,SCORE(5)
12

21August1991 -7-FORCHEK(1L) FORCHEK(1L)

13DO30I=1,COUNT
14SUM=SUM+SCORE(I)
1530CONTINUE
16COMPAV=SUM/COUNT
^
Warningnearline16col20:integerquotientexprconvertedtoreal
17END
18
ModuleCOMPAV:func:real
Variables:
NameTypeDimsNameTypeDimsNameTypeDimsNameTypeDims
COMPAVrealCOUNTintgIintg*Jintg
SCOREintg1SUMintg
*Variablenotdeclared.Typehasbeenimplicitlydefined.
VariablesdeclaredbutneverreferencedinmoduleCOMPAV:
J
VariablesmaybeusedbeforesetinmoduleCOMPAV:
SUM
19
20PROGRAMAVENUM
21C
22CMAINPROGRAM
23C
24CAUTHOR:LOISBIGBIE
25CDATE:MAY15,1990
26C
27CVariables:
28CMAXNOS->maximumnumberofinputvalues
29CNUMS->anarrayofnumbers
30CCOUNT->exactnumberofinputvalues
31CAVG->averagereturnedbyCOMPAV
32CI->loopcounter
33C
34
35PARAMETER(MAXNOS=5)
36INTEGERI,COUNT
37REALNUMS(MAXNOS),AVG
38COUNT=0
39DO80I=1,MAXNOS
40READ(5,*,END=100)NUMS(I)
41COUNT=COUNT+1
4280CONTINUE
43100AVG=COMPAV(NUMS,COUNT)
44END

21August1991 -8-FORCHEK(1L) FORCHEK(1L)

ModuleAVENUM:prog
Externalsubprogramsreferenced:
COMPAV:real*
Variables:
NameTypeDimsNameTypeDimsNameTypeDimsNameTypeDims
AVGrealCOUNTintgIintgMAXNOSintg*
NUMSreal1
*Variablenotdeclared.Typehasbeenimplicitlydefined.
VariablessetbutneverusedinmoduleAVENUM:
AVG
0syntaxerrorsdetectedinfileaverage.f
1warningissuedinfileaverage.f
SubprogramCOMPAV:argumentdatatypemismatch
atposition1:
DummytypeintginmoduleCOMPAVline10fileaverage.f
ActualtyperealinmoduleAVENUMline43fileaverage.f

AccordingtoForchek,theprogramcontainsvariableswhichmaybeusedbeforetheyare assignedaninitialvalue,andvariableswhicharenotneeded.Forchekalsowarnstheuserthat anintegerquotienthasbeenconvertedtoareal.Thismayassisttheuserincatchinganunintendedroundofferror.Sincethe−symtabflagwasgiven,Forchekprintsoutatablecontaining identifiersfromthelocalmoduleandtheircorrespondingdatatypeandnumberofdimensions. Finally,Forchekwarnsthatthefunctionisnotusedwiththepropertypeofarguments. WithForchek’shelp,wecandebugtheprogram.Wecanseethattherewerethefollowing errors: 1.SUMandCOUNTshouldhavebeenconvertedtorealbeforedoingthedivision. 2.SUMshouldhavebeeninitializedto0beforeenteringtheloop. 3.AVGwasneverprintedoutafterbeingcalculated. 4.NUMSshouldhavebeendeclaredINTEGERinsteadofREAL. WealsoseethatI,notJ,shouldhavebeendeclaredINTEGERinfunctionCOMPAV.Also, MAXNOSwasnotdeclaredasINTEGER,andCOMPAVasREAL,inprogramAVENUM. Thesearenoterrors,buttheymayindicatecarelessness.Asithappened,thedefaulttypeof thesevariablescoincidedwiththeintendedtype. Hereisthecorrectedprogram,anditsoutputwhenrun:

CAUTHORS:MIKEMYERSANDLUCIASPAGNUOLO
CDATE:MAY8,1989
C
CVariables:
CSCORE->anarrayoftestscores
CSUM->sumofthetestscores
CCOUNT->counterofscoresreadin

21August1991 -9-FORCHEK(1L) FORCHEK(1L)

CI->loopcounter
C
REALFUNCTIONCOMPAV(SCORE,COUNT)
INTEGERSUM,COUNT,I,SCORE(5)
C
SUM=0
DO30I=1,COUNT
SUM=SUM+SCORE(I)
30CONTINUE
COMPAV=FLOAT(SUM)/FLOAT(COUNT)
END
C
C
PROGRAMAVENUM
C
CMAINPROGRAM
C
CAUTHOR:LOISBIGBIE
CDATE:MAY15,1990
C
CVariables:
CMAXNOS->maximumnumberofinputvalues
CNUMS->anarrayofnumbers
CCOUNT->exactnumberofinputvalues
CAVG->averagereturnedbyCOMPAV
CI->loopcounter
C
C
INTEGERMAXNOS
PARAMETER(MAXNOS=5)
INTEGERI,NUMS(MAXNOS),COUNT
REALAVG,COMPAV
COUNT=0
DO80I=1,MAXNOS
READ(5,*,END=100)NUMS(I)
COUNT=COUNT+1
80CONTINUE
100AVG=COMPAV(NUMS,COUNT)
WRITE(6,*)'AVERAGE=',AVG
END
$runaverage
70
90
85
<EOF>
AVERAGE=81.66666
$

WithForchek’shelp,ourprogramisasuccess! INTERPRETINGTHEOUTPUT Forchekwillprintoutfourmaintypesofmessages.Theyareportabilitywarnings,otherwarnings,informationalmessages,andsyntaxerrors.Portabilitywarningsspecifynonstandardusages thatmaynotbeacceptedbyothercompilers.Otherwarningmessagesreportpotentialerrors 21August1991 -10-FORCHEK(1L) FORCHEK(1L) thatarenotnormallyflaggedbyacompiler.Informationalmessagesconsistofwarningswhich mayassisttheuserinthedebuggingoftheirFortranprogram. SyntaxerrorsareviolationsoftheFortranlanguage.Theusershouldhavealreadyeliminated thesebyusingtheFortrancompiler.Forchekdoesnotdetectallsyntaxerrors.Generally, Forchekonlydoesasmuchsyntacticerrorcheckingasisnecessaryinorderforittoworkproperly. IfForchekgivesyouasyntaxerrormessagewhenthecompilerdoesnot,itisprobablybecause yourprogramcontainsanextensiontostandardFortranwhichisacceptedbythecompilerbut notbyForchek.OnaVAX/VMSsystem,youcanusethecompileroption/STANDARDtocause thecompilertoacceptonlystandardFortran.OnmostUnixsystems,thiscanbeaccomplished bysettingtheflag−ansi. Mosterrormessagesareself-explanatory.Thosewhichneedabriefexplanationarelistedbelow. PleasenotethatanyerrormessageswhichbeginwithoopsrefertotechnicalconditionsandindicatebugsinForchekorthatitsresourceshavebeenexceeded. Thefollowingmessageswarnaboutportabilityornonstandardusages: Nonstandardformatitem ForchekwillflagnonstandarditemsinaFORMATstatementwhichmaynotbecompatiblewithothersystems. characterspast72columns Astatementhasbeenreadwhichhasnonblankcharacterspastcolumn72.StandardFortranignoresalltextinthosecolumns,butmanycompilersdonot.Thustheprogram maybetreateddifferentlybydifferentcompilers. Warning:filecontainstabs.Maynotbeportable. Forchekexpandstabstobeequivalenttospacesuptothenextcolumnwhichisamultipleof8.Somecompilerstreattabsdifferently,andalsoitispossiblethatfilessentby electronicmailwillhavethetabsconvertedtoblanksinsomeway.Thereforefilescontainingtabsmaynotbecompiledcorrectlyafterbeingtransferred.Forchekdoesnot givethismessageiftabsonlyoccurwithincommentsorstrings. nonstandardtypeusageinexpression Theprogramcontainsanoperationsuchasalogicaloperationbetweenintegers,whichis notstandard,andmaynotbeacceptabletosomecompilers. Commonblockhasmixedcharacterandnon-charactervariables Commonblockhaslongdatatypefollowingshortdatatype TheANSIstandardrequiresthatifanyvariableinaCOMMONblockisoftypeCHAR-ACTER,thenallothervariablesinthesameCOMMONblockmustalsobeoftype CHARACTER.SomecompilersadditionallyrequirethatifaCOMMONblockcontains mixeddatatypes,alllongtypes(namelyDOUBLEPRECISIONandCOMPLEX)must precedeallshorttypes(namelyINTEGER,REAL,etc.). Thefollowingmessagesarewarningmessages: Integerquotientexprconvertedtoreal integerquotientexprusedinexponent Thequotientoftwointegersresultsinanintegertyperesult,inwhichthefractionalpart isdropped.Ifsuchanintegerexpressioninvolvingdivisionislaterconvertedtoareal datatype,itmaybethatarealtypedivisionhadbeenintended.Likewise,ifitisusedas anexponent,itislikelythatarealtypedivisionwasintended. realtruncatedtointg Forchekhasdetectedanassignmentstatementwhichhasarealexpressionontheright, butanintegervariableontheleft.Thefractionalpartoftherealvaluewillbelost.If youexplicitlyconverttherealexpressiontointegerusingtheINTorNINTintrinsic 21August1991 -11-FORCHEK(1L) FORCHEK(1L) function,nowarningwillbeprinted.Asimilarmessageisprintedifadoubleprecision expressionisassignedtoarealvariable,etc. Continuationfollowscommentorblankline Forchekissuesthiswarningmessagetoalerttheuserthatacontinuationofastatement isinterspersedwithcomments,makingiteasytooverlook. Possibledivisionbyzero Thismessageisprintedoutwhereverdivisionisdone(exceptdivisionbyaconstant),if the−divisionoptionwasselected. NAMEnotsetwhenRETURNencountered ThewaythatfunctionsinFortranreturnavalueisbyassigningthevaluetothenameof thefunction.Thismessageindicatesthatthefunctionwasnotassignedavaluebefore thepointwhereaRETURNstatementwasfound.Thereforeitispossiblethatthefunctioncouldreturnanundefinedvalue. Unknownintrinsicfunction ThismessagewarnstheuserthatanamedeclaredinanINTRINSICstatementis unknowntoForchek.Probablyitisanonstandardintrinsicfunction,andsotheprogramwillnotbeportable.ThefunctionwillbetreatedbyForchekasauser-defined function. Thefollowingmessagesaresyntaxerrors: syntaxerror Theparser,whichanalyzestheFortranprogramintoexpressions,statements,etc.,has beenunabletofindavalidinterpretationforsomeportionofastatementintheprogram. Ifthecompilerdoesnotreportasyntaxerroratthesameplace,themostcommonexplanationsare:(1)useofareservedwordasanarrayorcharactervariable(seeTable2in thesectionentitled"LimitationsandExtensions"),or(2)useofanextensiontoANSI standardFortranthatisnotrecognizedbyForchek. Nopathtothisstatement Forchekwilldetectstatementswhichareignoredorby-passedbecausethereisnofore-seeableroutetothestatement.Forexample,anunnumberedstatement(astatement withoutastatementlabel),occurringimmediatelyafteraGOTOstatement,cannotpossiblybeexecuted. Statementoutoforder. ForchekwilldetectstatementsthatareoutofthesequencespecifiedforANSIstandard Fortran-77.Table1illustratestheallowedsequenceofstatementsintheFortranlan-guage.StatementswhichareoutoforderarenonethelessinterpretedbyForchek,topre-vent"cascades"oferrormessages. --------------------------------------------------------

||implicit

|parameter|---------------------

||otherspecification

format|---------------|---------------------

and||statement-function

entry|data|---------------------

||executable

-------------------------------------------------------- Table1 Thefollowingmessagesareinformationalmessages: Declaredbutneverreferenced Detectsanyidentifiersthatweredeclaredinyourprogrambutwereneverused,eitherto beassignedavalueortohavetheirvalueaccessed.VariablesinCOMMONareexcluded. 21August1991 -12-FORCHEK(1L) FORCHEK(1L) Variablesusedbeforeset Thismessageindicatesthatanidentifierisusedtocomputeavaluepriortoitsinitialization.Suchusagemayleadtoanincorrectvaluebeingcomputed. Variablesmaybeusedbeforeset SimilartousedbeforesetexceptthatForchekisnotabletodetermineitsstatuswith certainty.Forchekassumesavariablemaybeusedbeforesetifthefirstusageofthe variableoccurspriorintheprogramtexttoitsassignment. Variablessetbutneverused Forchekwillnotifytheuserwhenavariablehasbeenassignedavalue,butthevariable isnototherwiseusedintheprogram.Usuallythisresultsfromanoversight. Typehasbeenimplicitlydefined Forchekwillflagallidentifiersthatarenotexplicitlytypedandwillshowthedatatype thatwasassignedthroughimplicittyping.Thisprovidessupportforuserswhowishto declareallvariablesasisrequiredinPascalorsomeotherlanguages.Thismessageis printedonlywhenthe−symtaboptionisineffect. Identifierswhicharenotuniqueinfirstsixchars Warnsthattwoidentifierswhicharelongerthan6charactersdonotdifferinfirst6characters.Thisisforportability:theymaynotbeconsidereddistinctbysomecompilers. Thismessageisprintedonlyifthe−sixcharoptionwasselected. SubprogramNAME:varyinglengthargumentlists: Aninconsistencyhasbeenfoundbetweenthenumberofdummyarguments(parameters) asubprogramhasandthenumberofactualargumentsgivenitinaninvocation. Forchekkeepstrackofallinvocationsofsubprograms(CALLstatementsandexpressions usingfunctions)andcomparesthemwiththedefinitionsofthesubprogramselsewherein thesourcecode.TheFortrancompilernormallydoesnotcatchthistypeoferror. SubprogramNAME:argumentdatatypemismatchatpositionn Thesubprogram’sn-thactualargument(intheCALLortheusageofafunction)differs indatatypefromthen-thdummyargument(intheSUBROUTINEorFUNCTIONdec-laration).Forinstance,iftheuserdefinesasubprogramby

SUBROUTINESUBA(X)
REALX

andelsewhereinvokesSUBAby

CALLSUBA(2)

Forchekwilldetecttheerror.Thereasonhereisthatthenumber2isinteger,notreal. Theusershouldhavesaid

CALLSUBA(2.0)

Whencheckinganargumentwhichisasubprogram,Forchekmustbeabletodetermine whetheritisafunctionorasubroutine.TherulesusedbyForchektodothisareasfollows:Ifthesubprogram,besidesbeingpassedasanactualargument,isalsoinvoked directlyelsewhereinthesamemodule,thenitstypeisdeterminedbythatusage.Ifnot, thenifthenameofthesubprogramdoesnotappearinanexplicittypedeclaration,itis assumedtobeasubroutine;ifitisexplicitlytypeditistakenasafunction.Therefore, subroutinespassedasactualargumentsneedonlybedeclaredbyanEXTERNALstatementinthecallingmodule,whereasfunctionsmustalsobeexplicitlytypedinorderto avoidgeneratingthiserrormessage. Subprograminvokedinconsistently Herethemismatchisbetweenthedatatypeofthesubprogramitselfasusedandas defined.Forinstance,iftheuserdeclares

INTEGERFUNCTIONCOUNT(A)

21August1991 -13-FORCHEK(1L) FORCHEK(1L) andinvokesCOUNTinanothermoduleas

N=COUNT(A)

withoutdeclaringitsdatatype,itwilldefaulttorealtype,basedonthefirstletterofits name.Thecallingmoduleshouldhaveincludedthedeclaration

INTEGERCOUNT

possiblyitisanarraywhichwasnotdeclared Thismessagereferstoafunctioninvocationortoanargumenttypemismatch,forwhich thepossibilityexiststhatwhatappearstobeafunctionisactuallymeanttobeanarray. Iftheprogrammerforgottodimensionanarray,referencestothearraywillbeinterpreted asfunctioninvocations.Thismessagewillbesuppressedifthenameinquestionappears inanEXTERNALorINTRINSICstatement. SubprogramNAME:argumentusagemismatch Forchekdetectsapossibleconflictbetweenthewayasubprogramusesanargumentand thewayinwhichtheargumentissuppliedtothesubprogram.Theconflictcanbeoneof twotypes,asoutlinedbelow. Dummyargismodified,Actualargisconstorexpr AdummyargumentisanargumentasnamedinaSUBROUTINEorFUNCTIONstatementandusedwithinthesubprogram.Anactualargumentisanargumentaspassedto asubroutineorfunctionbythecaller.Forchekissayingthatadummyargumentis modifiedbythesubprogram,i.e.itsvaluewillbechangedinthecallingmodule.The correspondingactualargumentshouldnotbeaconstantorexpression,butratheravariableorarrayelementwhichcanbelegitimatelyassignedto. Dummyargusedbeforeset,Actualargnotset Hereadummyargumentmaybeusedinthesubprogrambeforehavingavalueassigned toitbythesubprogram.Thecorrespondingactualargumentshouldhaveavalue assignedtoitbythecallerpriortoinvokingthesubprogram. CommonblockNAME:varyinglength ACOMMONblockdeclaredindifferentsubprogramshasdifferentnumbersofvariablesin itindifferentdeclarations.Thisisnotnecessarilyanerror,butitmayindicatethata variableismissingfromthelist. CommonblockNAME:datatypemismatchatpositionn Then-thvariableintheCOMMONblockdiffersindatatypeintwodifferentdeclarations oftheCOMMONblock.Bydefault(commonstrictnesslevel3),Forchekisverypicky aboutCOMMONblocks:thevariableslistedinthemmustmatchexactlybydatatype andarraydimensions.Thatis,thelegalpairofdeclarationsindifferentmodules:

COMMON/COM1/A,B

and

COMMON/COM1/A(2)

willcauseForchektogivewarningsatstrictnesslevel3.Thesetwodeclarationsarelegal inFortransincetheybothdeclaretworealvariables.Atstrictnesslevel1or2,nowarningwouldbegiveninthisexample. LIMITATIONSANDEXTENSIONS ForchekacceptsANSIstandardFortran-77programswiththefollowingexceptions: Restrictions: Forchekissensitivetoblankspaces.Thisencouragestheusertousegoodprogramming style.TherulesaresimilartoPascalorCwhereablankspaceisrequiredbetween 21August1991 -14-FORCHEK(1L) FORCHEK(1L) identifiersorkeywordsandnotallowedinsideidentifiersorkeywords.Thefollowingkeywordswhichoccurinpairsmaybewrittenaseitheroneortwowords:DOWHILEor DOWHILE,ELSEIForELSEIF,ENDDOorENDDO,ENDIForENDIF,GOTOor GOTO.UnlikePascalandC,Forchekallowsblanksinsidenumericconstants,except withintheexponentpartofEandDformnumbers.Also,ifthe−nolinebreakoptionis selected,theendoflineincontinuedstatementsisignored. Complexconstantsaresubjecttoaspecialrestriction:theymaynotbesplitacrosslines, evenin−nolinebreakmode. Thedummyargumentsinstatementfunctionsaretreatedlikeordinaryvariablesofthe program.Thatis,theirscopeistheentiremodule,notjustthestatementfunctiondefinition. Somekeywordsandidentifiersarepartiallyreserved.SeeTable2fordetails. Thefollowingkeywordsmaybefreelyusedasvariables:

ASSIGNBLOCKCALLCHARACTER
COMMONCOMPLEXCONTINUEDIMENSION
DODOUBLEELSEEND
ENDDOENDIFENTRYEXTERNAL
FUNCTIONGOIMPLICITINCLUDE
INTEGERINTRINSICLOGICALPAUSE
PRECISIONPROGRAMREALSAVE
STOPSUBROUTINETHENTO

Thefollowingkeywordsmaybeusedinscalarcontextsonly,forexample,notasarraysorascharactervariablesusedinsubstringexpressions.

ACCEPTBACKSPACECLOSEDATA
DOWHILEELSEIFENDFILEEQUIVALENCE
FORMATGOTOIFINQUIRE
OPENPARAMETERPRINTREAD
RETURNREWINDTYPEWRITE
WHILE

Table2 Extensions: Tabsarepermitted,andtranslatedintoequivalentblankswhichcorrespondtotabstops every8columns.Thestandarddoesnotrecognizetabs.Notethatsomecompilersallow tabs,buttreatthemdifferently. Lowercasecharactersarepermitted,andareconvertedinternallytouppercaseexceptin strings.Thestandardspecifiesuppercaseonly,exceptincommentsandstrings. Hollerithconstantsarepermitted,inaccordancewiththeANSIManual,appendixC. Theyshouldnotbeusedinexpressions,orconfusedwithdatatypeCHARACTER. Statementsmaybelongerthan72columnsprovidedthatthesetting−columnwasused toincreasethelimit.Accordingtothestandard,alltextfromcolumns73through80is ignored,andnolinemaybelongerthan80columns. Variablenamesmaybelongerthansixcharacters.Thestandardspecifiessixasthemaximum. Variablenamesmaycontainunderscores,whicharetreatedthesameasalphabeticletters. TheVAXversionofForchekalsoallowsdollarsignsinvariablenames,butnotasthe initialcharacter. TheDO...ENDDOcontrolstructureispermitted.Thesyntaxwhichisrecognizedis accordingtoeitherofthefollowingtwoforms: DO[label[,]]var=expr,expr[,expr] 21August1991 -15-FORCHEK(1L) FORCHEK(1L) ...

ENDDO

or DO[label[,]]WHILE(expr) ...

ENDDO

wheresquarebracketsindicateoptionalelements. TheACCEPTandTYPEstatementsarepermitted,withthesamesyntaxasPRINT. Statementsmayhaveanynumberofcontinuationlines.Thestandardallowsamaximum of19. Inlinecomments,beginningwithanexclamationmark,arepermitted. TheIMPLICITNONEstatementissupported.Themeaningofthisstatementisthatall variablesmusthavetheirdatatypesexplicitlydeclared.Ratherthanflagtheoccurrences ofsuchvariableswithsyntaxerrormessages,Forchekwaitstilltheendofthemodule, andthenprintsoutalistofallundeclaredvariables. DatatypesINTEGER,REAL,COMPLEX,andLOGICALareallowedtohavean optionallengthspecificationintypedeclarations.Forinstance,REAL*8meansan8-byte floatingpointdatatype.TheREAL*8datatypeisinterpretedbyForchekasequivalent toDOUBLEPRECISION.Forchekignoreslengthspecificationsonallothertypes. ThestandardallowsalengthspecificationonlyforCHARACTERdata. ForchekpermitstheINCLUDEstatement,whichcausesinclusionofthetextofthe givenfile.Thesyntaxis

INCLUDE'filename'

WhencompiledforVMS,Forchekwillassumeadefaultextensionof.forifnofilename extensionisgiven.AlsoforcompatibilitywithVMS,theVMSversionallowsthequalifier /[NO]LISTfollowingthefilename,tocontrolthelistingoftheincludedfile.Thereisno supportforincludingVMStextmodules. Atthistime,diagnosticoutputrelatingtoitemscontainedinincludefilesisminimal. Onlyinformationaboutthelocationintheincludefileisgiven.Thereisnotraceback givingtheparentfile(s),althoughusuallythiscanbeinferredfromthecontext. NEWFEATURES HerearethechangesfromVersion2.3toVersion2.4: 1.Fixedbugs:theSAVEstatementwasincorrectlyparsed,aCALLofauserfunctionwiththe samenameasanintrinsicfunctionassumedbydefaulttorefertotheintrinsicfunction,and adjustable-sizearrayspassedasargumentswerenotcorrectlychecked.Also,theusageof variablesinsomeI/Ocontrol-listspecifierswashandledincorrectly. 2.Newoptions−declare,−f77,−linebreakand−verbose. 3.Allowembeddedspaceinnumericconstants. 4.SupportACCEPT,IMPLICITNONEandINCLUDEstatements. 5.AnalyzeEQUIVALENCEstatements. 6.Commonblockcheckinglevels1and2. 7.Important:theproject-fileformathasbeenchanged.ProjectfilescreatedbyVersion2.3are notcompatiblewithVersion2.4,andwillneedtoberemade. HerearethechangesfromVersion2.2toVersion2.3: 1.Threebugswerefixed:Version2.2crashedifarealconstantexceedingthemagnitudelimit wasencountered;thecomputationofhashcodeswasnotportableto64-bitmachines;and spuriousused-before-setmessagesweregeneratedbystatementfunctions.WethankGreg 21August1991 -16-FORCHEK(1L) FORCHEK(1L) FlintofPurdueUniversityandWarrenJ.WiscombeofNASAGoddardforpointingsomeof theseout. 2.Allowcomplexconstantsinexpressions. 3.AllowDO...ENDDOstructure 4.AllowTYPEstatement. 5.Allowunderscoresinvariablenames. 6.Allowinlinecomments. 7.Provideproject-filecapability. 8.Suppressused-before-setmessagesforimplied-doindex(seeBugssection). BUGS Forchekstillhasmuchroomforimprovement.Yourfeedbackisappreciated.Wewanttoknow aboutanybugsyounotice.BugsincludenotonlycasesinwhichForchekissuesanerrormessagewherenoerrorexists,butalsoifForchekfailstoissueawarningwhenitoughtto.Note, however,thatForchekisnotintendedtocatchallsyntaxerrors.Also,itisnotconsideredabug foravariabletobereportedasusedbeforeset,ifthereasonisthattheusageofthevariable occurspriorinthetexttowherethevariableisset.Forinstance,thiscouldoccurwhenaGOTO causesexecutiontoloopbackwardtosomepreviouslyskippedstatements.Forchekdoesnot analyzetheprogramflow,butassumesthatstatementsoccurringearlierinthetextareexecuted beforethefollowingones. WeespeciallywanttoknowifForchekcrashesforanyreason.Itisnotsupposedtocrash,even onprogramswithsyntaxerrors.Suggestionsarewelcomedforadditionalfeatureswhichyou wouldfinduseful.TellusifanyofForchek’smessagesareincomprehensible.Commentsonthe readabilityandaccuracyofthisdocumentarealsowelcome. YoumayalsosuggestsupportforadditionalextensionstotheFortranlanguage.Thesewillbe includedonlyifitisfeltthattheextensionsaresufficientlywidelyacceptedbycompilers. IfyoufindabuginForchek,firstconsultthelistofknownbugsbelowtoseeifithasalready beenreported.Alsocheckthesectionentitled"LimitationsandExtensions"aboveforrestrictions thatcouldbecausingtheproblem.Ifyoudonotfindtheproblemdocumentedineitherplace, thensendareportincluding 1.TheoperatingsystemandCPUtypeonwhichForchekisrunning. 2.TheversionofForchek. 3.Abriefdescriptionofthebug. 4.Ifpossible,asmallsampleprogramshowingthebug. Thereportshouldbesenttoeitherofthefollowingaddresses: MONIOT@FORDMULC.BITNET moniot@mary.fordham.edu HighestprioritywillbegiventobugswhichcauseForchektocrash.Bugsinvolvingincorrect warningsorerrormessagesmaytakelongertofix. Thefollowingisalistofknownbugs. 1.Bug:Functionswhichmodifytheirargumentsmaycauseused-before-setwarning.Forexam-ple,Ainthestatement

X=FUN(A)

ifAisnotpreviouslyset.IfFUNhasthepurposeofsettingA,thissituationwillnotbea bug.Generally,however,itisnotconsideredgoodstyleforfunctionstomodifytheirarguments,andsothewarningmaybetogoodpurpose. 21August1991 -17-FORCHEK(1L) FORCHEK(1L) Prognosis:Probablywillnotbefixedanytimesoon. 2.Bug:Used-before-setmessageissuppressedforanyvariablewhichisusedastheloopindex inanimplied-doloop,evenifitwasinfactusedbeforebeingsetinsomeearlierstatement. Forexample,considerJinthestatement

WRITE(5,*)(A(J),J=1,10)

HereForchekparsestheI/Oexpression,A(J),whereJisused,beforeitparsestheimplied loopwhereJisset.NormallythiswouldcauseForchektoreportaspuriousused-before-set warningforJ.Sincethisreportisusuallyinerrorandoccursfairlycommonly,ForcheksuppressesthewarningforJaltogether. Prognosis:AfutureversionofForchekisplannedwhichwillhandleimplied-doloopscor-rectly. 3.Bug:Variablesused(notasarguments)instatement-functionsubprogramsdonothavetheir usagestatusupdatedwhenthestatementfunctionisinvoked. Prognosis:TobefixedinafutureversionofForchek. CONCLUSION ForchekwasdesignedbyDr.RobertMoniot,professoratFordhamUniversity,CollegeatLincolnCenter.Duringtheacademicyearof1988-1989,MichaelMyersandLuciaSpagnuolodevel-opedtheprogramtoperformthevariableusagechecks.Duringthefollowingyearitwasaug-mentedbyLoisBigbietochecksubprogramargumentsandCOMMONblockdeclarations.Brian DowningassistedwiththeimplementationoftheINCLUDEstatement.Additionalfeatureswill beaddedastimepermits. WewouldliketothankMarkusDraxleroftheUniversityofStuttgart,GregFlintofPurdueUniversity,PhilSterneofLawrenceLivermoreNationalLaboratory,andWarrenJ.Wiscombeof NASAGoddardforreportingsomebugsinVersions2.1and2.2.WealsothankJohnAmorof theUniversityofBritishColumbia,DanielP.GiesyofNASALangleyResearchCenter,Hugh NicholasofthePittsburghSupercomputingCenter,DanSeveranceofYaleUniversity,andLarry WeissmanoftheUniversityofWashingtonforsuggestingsomeimprovements.NelsonH.F. BeebeoftheUniversityofUtahkindlyhelpedwiththedocumentation,andpointedoutseveral bugsinVersion2.3.RegClemensoftheAirForcePhillipsLabinAlbuquerqueandFritzKeinert ofIowaStateUniversityhelpeddebugVersion2.4.WealsothankJackDongarraforputting ForchekintotheNetliblibraryofpubliclyavailablesoftware. Forfurtherinformation,youmaycontactDr.RobertMoniotateitherofthefollowingnetwork addresses: MONIOT@FORDMULC.BITNET moniot@mary.fordham.edu Thisdocumentisnamedforchek.man.TheForchekprogramcanbeobtainedbysendingthe messagesendforchekfromfortrantotheInternetaddress:netlib@ornl.gov.Installation requiresaCcompilerforyourcomputer. 21August1991 -18-