求助read (rstplt) recordid
本帖最后由 kyra 于 2022-5-30 10:42 编辑subroutine cntrlread
!Reads module data from restart-plot file.
!
read (rstplt) recordid
inquire (iolength=lent)
& countn,cpurem(:),dt,dtht,dthy,dtn,emass,emasso,errhld,errmax,
& gravcn,stdtrn,testda(:),timeht,timehy,tmass,tmasso,
& cpurei(:),done,help,iextra,ihlppr(:),imdctl(:),iplotlen,
& iroute,nany,ncase,ncount,nrepet,nstsp,pageno,print,succes,
& aflag,chngno(:),fail,nmechk,skipt,uniti,unito
if (recordid%rectyp.ne.'contrl' .or. recordid%nn.ne.0 .or.
& recordid%noitm.ne.lent) call fabend
read (rstplt)
& countn,cpurem(:),dt,dtht,dthy,dtn,emass,emasso,errhld,errmax,
& gravcn,stdtrn,testda(:),timeht,timehy,tmass,tmasso,
& cpurei(:),done,help,iextra,ihlppr(:),imdctl(:),iplotlen,
& iroute,nany,ncase,ncount,nrepet,nstsp,pageno,print,succes,
& aflag,chngno(:),fail,nmechk,skipt,uniti,unito
end subroutine cntrlread
本人在做代码解读,上述代码中 read (rstplt) recordid 没太看懂,彭国伦老师书中关于读写部分没看到类似的写法,有大佬指点一下吗,感谢。
rstplt 是个变量(或常量),你替换成它的值,就明白了。比如 rstplt = 12
那么 read(12) recordid 你就明白了,是吧? kyra 发表于 2022-5-30 10:39
rstplt 是个变量(或常量),你替换成它的值,就明白了。比如 rstplt = 12
那么 read(12) recordid 你就明 ...
在这个模块里 没看到关于rstplt的变量定义,我以为是在路径查找文件名的文本,我再仔细检查下。 看看是否 use 了其他模块。rstplt 是否在其他模块定义
页:
[1]