我有一个程序,需要从constant 文件里边读取数据,问题是现在黑色的运行框提示我 “Your constant file "CONSTANT" not found!” 我想这是由于我设置了下边的内容,
CONSTANT='CONSTANT'
INQUIRE (FILE=CONSTANT,EXIST=EX)
IF (EX) GOTO 10
WRITE (*,*)' Your constant file "CONSTANT" not found!'
STOP
但是constant文件就在程序路径下啊,他们在同一个文件夹下的!
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
CHARACTER *20 WETDATA,RESFILE,CONSTANT,DATADATE
COMMON /FILES/WETDATA,RESFILE,CONSTANT,DATADATE
CALL DATAINPUT
c 打开气象文件WETDATA
OPEN(2,FILE=WETDATA,STATUS='OLD')
CALL CALCULAT
CLOSE(2)
STOP
END
C ==================================================================
SUBROUTINE DATAINPUT
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
CHARACTER *20 WETDATA,RESFILE,CONSTANT,DATADATE
LOGICAL EX
COMMON
c 文件变量
* /FILES/WETDATA,RESFILE,CONSTANT,DATADATE
c 常数和角度
* /CONST1/PI,GRAVITY,DT,DY,GAMA,FI,PSETA
。。。省略
* /OUTDATA0/EX,TAIR,TGOUT,TGWATER,TGIN,TINDOOR,TGOUTLET,
* TININ,TINOUT,TGINLET,TOUTIN,TOUTOUT,T45,NY45,NY12,I,J,TAIRM
c 各分段温度
* /OUTDATA1/TGOUTS(200),TGINS(200),TGWATERS(200),T45S(200)
。。。省略
CONSTANT='CONSTANT'
INQUIRE (FILE=CONSTANT,EXIST=EX)
IF (EX) GOTO 10
WRITE (*,*)' Your constant file "CONSTANT" not found!'
STOP
C ------------------------------------------------------------------------
C There are 8 groups of file names and data to be read into memory
C from the CONSTANTS
C 1. Read the file names into memory:
10 OPEN (1,FILE=CONSTANT,STATUS='OLD')
READ (1,'(A)')
READ (1,'(A)')
这个问题我自己解决好了 。
潇湘沐
相关分类