|
以下是部分代码,红色部分提示错误:error #7938: Character length argument mismatch. [DATAFL]
请问各位前辈哪里出现问题了呢?
还有一个疑惑:read(lin,'(a40)',err=98) datafl 这个read语句中各部分代表什么含义,这个代码在书上没找到类似的写法。。。。
如果有明白的,望不吝赐教。谢谢了。 问题如果有不清楚的地方,也请指出。。
include 'sgsim.inc'
real var(50)
real*8 p,acorni,cp,oldcp,w
character(len=40) transfl,smthfl,tmpfl,datafl,outfl,
+ dbgfl,lvmfl,str
logical testfl
c
c Note VERSION number:
c
c write(*,9999) VERSION
c 9999 format(/' SGSIM Version: ',f5.3/)
c
c Get the name of the parameter file - try the default name if no input:
c
c write(*,*) 'Which parameter file do you want to use?'
c read (*,'(a40)') str
c if(str(1:1).eq.' ')str='pp-co2.par '
str='pp-co2.par'
c inquire(file=str,exist=testfl)
c if(.not.testfl) then
c write(*,*) 'ERROR - the parameter file does not exist,'
c write(*,*) ' check for the file and try again '
c write(*,*)
c if(str(1:20).eq.'pp-co2.par ') then
c write(*,*) ' creating a blank parameter file'
c call makepar
c write(*,*)
c end if
c stop
c endif
open(lin,file=str,status='OLD')
c
c Find Start of Parameters:
c
1 read(lin,'(a4)',end=98) str(1:4)
if(str(1:4).ne.'STAR') go to 1
c
c Read Input Parameters:
c
read(lin,'(a40)',err=98) datafl
call chknam(datafl,40)
c write(*,*) ' data file = ',datafl
|
|