我正在编辑提供给我的代码。编辑的一部分是重命名变量。大多数重命名都运行良好,但有一些重命名会在运行时导致错误。例如:
我打算将变量从fdat1
重命名为latestDate
,并且编译正常。在运行时,我从Windows得到一个错误,说程序停止工作。我决定以小步骤更改变量名称,以尝试找出错误产生的位置。
我从fdat1
- > fdate1
- > fdate2
- > ldate2
。在将名称更改为ldate2
时,错误再次出现。我决定将变量名称更改为fLatestDate
,程序按预期运行。
我的程序中有implicit none
,因此第一个字母不应该导致任何问题。我想知道,是否有一些关于命名规则的细微内容我尚未遇到过?我已经重命名了其他几个变量来开始latest
- ,并且每个其他名称更改都没有引起任何问题。
编辑:fdat1
几乎出现在与程序相关的每个文件中,因此我将使用变量idmul
的其他示例。 idmul
仅在thresh
中使用,当我将名称更改为powerCoeff
时,程序会自行退出。我可以将名称更改为*powerCoeff
,其中*
是从d到i的任何字母。
program thresh
implicit none
integer,parameter:: double=kind(1d0)
integer:: numStations,maxLines,nlo20
integer:: i,j,ctr,sysMonth,sysDay,sysHour
integer:: imid,ssumTrecent,ssumTantecedent,st
integer:: tptr,xptr,k,flag,timezoneOffset,sysYear
integer:: sysMinute,sysSeconds,lastDayOfMonth(12)
integer:: lineCtr,f24,sumTintensity,sumTavgIntensity
integer:: sumPrecip,maxDataGap,year
integer:: stationCtr,unitNumber(10),Tintensity,Trecent
integer:: Tantecedent,rph,numNewLines,fmins
integer:: ev315,evid,evia,evi3,m
integer:: numContRowsExceed,evawid,resetAntMo,antda
integer,allocatable:: timestampMonth(:),da(:)
integer,allocatable:: hr(:),precip(:),ctrHolder(:)
integer,allocatable:: stationPtr(:),latestDay(:)
integer,allocatable:: latestMonth(:),latestHour(:)
integer,allocatable:: timestampYear(:),latestYear(:)
integer,allocatable:: mins(:),latestMinute(:) ! ,ifmt(:)
integer,allocatable:: pt315(:),ptid(:),ptia(:),pti3(:),ptawid(:)
integer,allocatable:: tlenx(:),numTimestampsHolder(:)
integer :: tRainfallBegan,tRainfallEnd
integer :: TstormGap,minTStormGap
integer :: TavgIntensity,numPlotPoints,numPlotPoints2
integer :: AWICompOffset,numTimestamps
integer :: ctr315,ctrid,ctria,cum15dRainfallCtr,ctra
integer :: ctri,diffSysMinTimestampMinute,AWIExceedCtr,AWIIntensCtr
integer :: ctri3
character (len=255),allocatable:: dataLocation(:)
character (len=255):: outputFile,pathThlast
character (len=224):: outputFolder
character (len=80):: header
character (len=50), allocatable:: stationLocation(:)
character (len=31):: junk
character (len=31):: archiveFile='ThArchive'
character (len=31):: defaultOutputFile='threshout.txt'
character (len=31):: dgOutputfile='dgthresh.txt'
character (len=31):: updateFile='ThUpdate.txt'
character (len=20), allocatable:: datimb(:)
character (len=17), allocatable:: datim(:)
character (len=11):: fLatestDate,revdate
character (len=10):: fdat,sysTime
character (len=8):: timeSeriesPlotFile='ThTSplot'
character (len=8):: sysDate,ThlastStationNo,vrsn
character (len=8), allocatable:: stationNumber(:)
character (len=6):: psn(2) !,snum
character (len=6):: timeSeriesExceedFile='ThTime'
character (len=5):: fLatestTime
character (len=4):: plotFormat
character (len=3)::month(12)
character (len=2)::unt,powerUnit
character (len=1):: tb,pd,cm
logical ::lgyr,match,stats,lsfil,powerSwitch,flagRealtime
real:: slope3day15day,intercept3day15day,in2mm
real:: idmul,idexp,inia,slia,kd,fieldCap,decayFactor
real:: aw,AWIconversion,evp(12),floatPrecip,AWIThresh
real:: awimx,sum3mx,rntsymx
real:: x,polynomArr(6)
real,allocatable:: threshIntensityDuration(:),threshAvgExceed(:)
real,allocatable:: AWI(:),AWI_0(:)
real,allocatable:: sumTrecent(:),sumTantecedent(:)
real,allocatable:: intensity(:),dur(:)
real,allocatable:: runIntensity(:),deficitSurplus3d15d(:)!,antst(:)
real,allocatable:: sum3s(:),sum15s(:),intsys(:),durs(:)
real,allocatable:: srunIntensity(:),def315s(:)
real,allocatable:: sthreshIntensityDuration(:)
real,allocatable:: sthreshAvgIntensity(:)!,antsts(:)
real (double):: dlast,trfbeg,trfend,dgap
real (double),allocatable:: dtdate1904eachLine(:),tdate1904last(:)
real (double),allocatable:: tdate1904newest(:)
real (double),allocatable:: tdate1904stormBeg(:),tdate1904stormEnd(:)