- 积分
- 54
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-2-2
- 最后登录
- 1970-1-1
|
发表于 2012-2-4 12:28:03
|
显示全部楼层
完全不懂GrADS和Fortran(应该是不懂任何程序语言)的新人看得头大啊。按照LZ说的在4.0里边输入了
Program sta2grd
Implicit none
!这里是程序的变量声明
Character*8 stid haracter*8 stid
Real lon,lat,var, rain
integer nlev ,flag
!变量声明结束
!程序开始
Open(1,file='raindata.txt',status='old')
Read(1,*)
Read(1,*)
10Read(1,end=100)stid,lon,lat,var,rain
Print*,stid,lon,lat,var,rain
pause
goto 10
100 contine
close(1)
!程序结束
End
然后点build,恩提示如下
--------------------Configuration: Text1 - Win32 Debug--------------------
Compiling Fortran...
C:\MSDEV\Projects\Text1.f90
C:\MSDEV\Projects\Text1.f90(4): error FOR3852: syntax error detected between STID and HARACTER
C:\MSDEV\Projects\Text1.f90(12): error FOR2934: lexical error: Improperly terminated label or number
C:\MSDEV\Projects\Text1.f90(12): error FOR3852: syntax error detected at <beginning of file>
C:\MSDEV\Projects\Text1.f90(13): error FOR2290: implicit type for STID detected between STID and ,
C:\MSDEV\Projects\Text1.f90(16): error FOR2934: lexical error: Unrecognized statement
C:\MSDEV\Projects\Text1.f90(16): error FOR3852: syntax error
C:\MSDEV\Projects\Text1.f90(19): warning FOR4265: symbol LON referenced but not set
C:\MSDEV\Projects\Text1.f90(19): warning FOR4265: symbol STID referenced but not set
C:\MSDEV\Projects\Text1.f90(19): error FOR3309: undefined label 10
C:\MSDEV\Projects\Text1.f90(19): warning FOR4270: unused symbol FLAG
C:\MSDEV\Projects\Text1.f90(19): warning FOR4270: unused symbol NLEV
C:\MSDEV\Projects\Text1.f90(19): warning FOR4265: symbol RAIN referenced but not set
C:\MSDEV\Projects\Text1.f90(19): warning FOR4265: symbol VAR referenced but not set
C:\MSDEV\Projects\Text1.f90(19): warning FOR4265: symbol LAT referenced but not set
Error executing fl32.exe.
Text1.exe - 7 error(s), 7 warning(s)
|
|