Program example_2 Implicit none Integer ::factor,s=0,I Do I=4,8 S=s+factor(i) End do Print*,s End program example_2 例3、输入一个数,判断他是否能被3整除,并输出相应的信息。 Program judge Implicit none Integer :: n,m Read*,n ...
programexampleimplicitnonerealcwrite(*,*)"input a number"read (*,*) cif(c)10,20,30!10,20和30为行代码,根据c小于/等于/大于0,执行10/20/30行的程序10write(*,*)"A"goto40!goto可实现跳到任意前面或后面的行代码处,但用多了破坏程序结20write(*,*)"B"goto4030write(*,*)"C"goto4040stopend...
CGNS file.!! Example compilation for this program is (change paths if needed!):! Note: when using the cgns module file, you must use the SAME fortran compiler! used to compile CGNS (see make.defs file)! ...or change, for example, via environment "setenv FC ifort"!! ifort -I ../...
(4) 算术判断:program exampleimplicit nonereal cwrite (*,*) "input a number"read (*,*) cif(c) 10,20,30!10,20和30为行代码,根据c小于/等于/大于0,执行10/20/30行的程10 write (*,*) "A"goto 40!goto可实现跳到任意前面或后面的行代码处,但用多了破坏程序结20 write (*,*) "B"goto ...
简单的FORTRAN90程序分析 PROGRAMEX1!主程序语句[例1]已知一个圆的半径R、高度H,写出计算圆周IMPLICITNONEREAL::R,H,C,S1,S2,S3,V,PI!说明语句长、圆面积、圆柱全面积、圆锥侧面积、圆锥体积PI=3.1415926;R=10.0;H=8.0!赋值语句的程序。!下列语句的作用是计算并赋值C=2*PI*R先给出数学...
山东科技大学《FORTRAN90程序设计》 2.6DeveloperStudio解题过程 u概述工作空间名指定为:example,在D盘上创建一个工作空 u 间:example。 u前期准备 u 创建步骤: u创建工作空间 u u创建项目l单击选择执行“File”/“New”菜单项,弹出“New”对话 u 框,选取“Workspaces”选项卡,如图2-22所示。 u创建源程序文件 ...
Fortran90编程
PROGRAM namelist_input implicit none integer :: a(3), b(2), c namelist /na/ a, b, c open (10, file="example.nml") read (10, nml=na) write (*, nml=na) END 读取的namelist文件为: &NA A = 1, 2, 3, B = 4, 5,
For example, the Autodice Sample shows how you can use Automation to export Fortran data to Excel. See Section 7.2, “Using the Sample Programs”. For more information, see: excel P r e r e q u i s i t e s f o r I n s t a l l i n g V i s u a l F o r t r ...
*_plotter.plt (sub the * with the program name) Gnuplot script for the plots required by the class assignments *_runner.sh (see above for the *) bash helper script to create data folders and run both the compiled example and gnuplot In addition, examples 3 and 4 include a parameters.tx...