if (yn=='y' .or. yn=='Y') exit yn_loop if (yn=='n' .or. yn=='N' .or. yn==' ') exit interactive_loop end do yn_loop!结束内嵌do循环 end do interactive_loop end program cylinder Fortran程序的主要结构就是这样了。一般还会有些module的部分在主函数前,函数在主函数后。 二、数据...
y[n]'read(*,'(a1)') ynif(yn=='y'.or. yn=='Y')exityn_loopif(yn=='n'.or. yn=='N'.or. yn==' ')exitinteractive_loopenddoyn_loop!结束内嵌do循环enddointeractive_loopendprogramcylinder Fortran程序的主要结构就是这样了。一般还会有些module的部分在主函数前,函数在主函数后。 二、数据类...
gfortran优化在运行时导致fortran do变量循环错误 、、、 我已经写了一个fortran例程,它使用了一些遗留的fortran 77代码来处理有限元。然而,对于特定的网格,当-O优化标志打开时,一个重要的do循环迭代器正在以某种方式被修改,尽管fortran理应禁止这样做。我使用gfortran4.5编译了这段代码,并启用了-fcheck=do运行时检查,...
By using carefully designed m4 macros, Do-loop unrolling becomes much simpler. More over, with this method, code can be written for general ullrolling parameters, allowing the program to be easily tuned bn different computers to reach optimal performance.doi:CNKI:SUN:SZJS.0.1998-01-006张林波奇瑞...
The rules for theinitial-value,final-valueandstep-sizeare exactly the same as for aDOloop. An impliedDOloop may contain other impliedDOloops nested within. INTEGER NMAX PARAMETER(NMAX=10) REAL TEMPC(NMAX) WRITE(*,*)'Enter ',NMAX,' temperatures in Celsius' READ(*,*)(TEMPC(I),I=1,NMA...
end do yn_loop !结束内嵌do循环 end do interactive_loop end program cylinder Fortran程序的主要结构就是这样了。一般还会有些module的部分在主函数前,函数在主函 数后。 三、数据类型及基本输入输出 1、数据类型,声明及赋初值 (1)integer: 短整型kind=2, 长整型kind=4 integer([kind=]2) :: a=3 如果...
FORTRAN 77 Language Reference DO TheDOstatement repeatedly executes a set of statements. DOs[,]loop-control or DOloop-control@ wheresis a statement number. The form ofloop-controlis variable=e1,e2[,e3] Parameter Description variable Variable of type integer, real, or double precision....
C MAIN LOOP - COMBINATION OF BISECTION AND FALSE AANX0668 C POSITION METHODS. A...
DO-loop code is now implemented differently to allow better optimization and loop parallelization. Legal DO-loops behave exactly the same as before; however, illegal DO-loops--zero-step, loop variable modified within the loop--may display different behavior....
An impliedDOloop is often used with arrays to write out data in a neat tabular form. INTEGER I,NMAX PARAMETER(NMAX=6) CHARACTER*30 LABEL(NMAX) DOUBLE PRECISION PHYSIX(NMAX) LABEL(1) = 'Avogadro constant' LABEL(2) = 'Boltzmann constant' LABEL(3) = 'Faraday constant' LABEL(4) = 'Jose...