intel-fortran

Fortran 'parameter' type not included in compiled object

放肆的年华 提交于 2019-12-31 00:43:25
问题 I have a Fortran module that contains some variables that have the attribute parameter and some have the attribute save . The parameter ones are not included in the compiled object, which becomes a problem when trying to assemble a library. For example, consider a file testModule.f90 : module testMOD integer, save :: thisIsSaved = 1 integer, parameter :: thisIsParametered = 2 end module testMOD I compile this with: ifort -c testModule.f90 . When I check what's inside it: >$ nm testModule.o

Fortran - Return an anonymous function from subroutine

房东的猫 提交于 2019-12-30 09:55:43
问题 I am trying to generalize a function call from a subroutine. So my idea is something like this if (case1) then call MainSubroutine1(myFun) elseif (case2) call MainSubroutine2(myFun) end if do i = 1,4 data = myFun(i) end do I realize this is kind of vague but I am not sure if this is possible. Thank you, John edit 1/31/14 7:57 AM I am sorry for the vague way I phrased this. I was thinking something similar to what @haraldki did but I was hoping that I could define an anonymous function within

Return an array from a function and store it in the main program

血红的双手。 提交于 2019-12-29 09:41:47
问题 Here is the Main Program: PROGRAM integration EXTERNAL funct DOUBLE PRECISION funct, a , b, sum, h INTEGER n, i REAL s PARAMETER (a = 0, b = 10, n = 200) h = (b-a)/n sum = 0.0 DO i = 1, n sum = sum+funct(i*h+a) END DO sum = h*(sum-0.5*(funct(a)+funct(b))) PRINT *,sum CONTAINS END And below is the Function funct(x) DOUBLE PRECISION FUNCTION funct(x) IMPLICIT NONE DOUBLE PRECISION x INTEGER K Do k = 1,10 funct = x ** 2 * k End Do PRINT *, 'Value of funct is', funct RETURN END I would like the

Fortran subroutine returning wrong values

此生再无相见时 提交于 2019-12-28 03:12:15
问题 Hey I'm working on a fortran program and have ran across an odd problem. When I try to output some values of an array directly before calling a specific subroutine I get the correct values. I then try to output some values of the same array right as I start the subroutine, and they are 0. I finally output the values of the array after the subroutine and the values are back to the expected values. Could anyone help me understand why? My code is below: First, the calling of the subroutine in

Intel Fortran vectorisation: vector loop cost higher than scalar

烈酒焚心 提交于 2019-12-25 16:24:33
问题 I'm testing and optimising a legacy code with Intel Fortran 15, and I have this simple loop: do ir=1,N(lev) G1(lev)%D(ir) = 0.d0 G2(lev)%D(ir) = 0.d0 enddo where lev is equal to some integer. Structures and indexes are quite complex for the compiler, but it can succeed in the task, as I can see on other lines. Now, on the above loop, I get this from the compilation report: LOOP BEGIN at MLFMATranslationProd.f90(38,2) remark #15399: vectorization support: unroll factor set to 4 remark #15300:

undefined reference to 'SolveBIE_' when binding C++ and Fortran

人走茶凉 提交于 2019-12-24 18:43:05
问题 My Fortran code needs to call C++ function named SolveBIE_(), and this function is written in one file, e.g. test.c. SolveBIE_() needs to call some other C++ functions written in other files, e.g. part01.c, part02.c. I also claim those functions in part01.h and part02.h. Then I use $ gcc -c part01.c $ gcc -c part02.c $ ar cr kf.a part01.o part02.o part01.h part02.h to get my kf.a. I link the kf.a as a object file in my fortran compiling. I am using intel fortran ifort and a makefile. I got an

Comparing $ edit descriptor and advance=“no” in Fortran output

霸气de小男生 提交于 2019-12-24 15:58:50
问题 I know that the $ edit descriptor is not in the standard and that using advance="no" is recommended, but this little example shows that they have a different behaviour (with ifort but not with gfortran) and I don't understand why (it doesn't bother me more than that, but if anyone have an explanation I'm interested!). program p use sleep_mod implicit none integer :: i character(len=80) :: mymsg mymsg = 'H e l l o w o r l d ! W e l c o m e - B i e n v e n u e - W i l l k o m m e n' ! !- Write

Call Matlab from Intel Fortran (Linux)

霸气de小男生 提交于 2019-12-24 12:45:21
问题 I am trying to integrate a Matlab program I wrote into some Fortran code. I tried to follow the example Mathworks provides. But I can't get it to compile because I can't find the header files it requests. Does anyone know of an example of someone getting it to work on Linux using an Intel compiler. I think that might be part of the problem because Matlab only supports GNU Fortran on Linux. And I realize this is a simple question, I just don't understand how to do anything in compiling more

Differential code coverage for a simple example in ifort

烈酒焚心 提交于 2019-12-24 07:53:10
问题 I am interested in using the differential code coverage functionality in ifort. The documentation appears to address this thoroughly but I have failed to apply it to my reduced example. Heres what I have: program test integer :: userinput print *, 'enter 1 or 0' read *, userinput if (userinput.eq.1) then print *, 'You have entered ONE' else print *, 'You have not entered ONE' end if end program test A simple program that can take one of two paths. If the user enters 1 then it goes into the if

Makefile: Intel fortran, source files in a folder, and Intel Math Kernel Library

南楼画角 提交于 2019-12-24 06:58:16
问题 I have a main.f90 in the folder /ex. And the f77 subroutine files are in /ex/src. And the subroutine files again use BLAS and LAPACK libraries. For the BLAS and LAPACK, I have to use Intel Math Kernel Library. The Intel fortran and the mkl folders look like: /opt/intel$ ActivationTool composer_xe_2011_sp1 intel_sdp_products.db man bin composer_xe_2011_sp1.11.339 lib mkl composerxe include licenses /opt/intel/mkl$ benchmarks bin examples include interfaces lib tests tools /opt/intel/mkl/lib