我正在编辑给我的代码。部分编辑是重命名变量。大多数重命名运行良好,但有一些在运行时会导致错误。例如:
我打算将变量从 to 重命名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(:)