intel-fortran

Cannot detect file existing or not

怎甘沉沦 提交于 2019-11-29 16:49:43
In a program I am improving, I noticed that Fortran does not detect file existing or not. This led to a logic error which has not been fixed. I highly appreciate if you could point out the problems or errors and give me your corrections. open(unit=nhist,file=history,iostat=ierr)!This setting cannot exit program if file does not exist because ierr is always 0 if (ierr /=0) then write(*,*)'!!! error#',ierr,'- Dump file not found' stop endif !I used below statement, the program exits even though a file is existing open(unit=nhist,file=history,err=700) 700 ierr=-1 if (ierr /=0) then write(*,*)'!!!

Include both .f and .F90 file in Fortran main file header

旧时模样 提交于 2019-11-29 16:24:13
I am using some F77 fixed format code with my F90 program. I am trying to include both kinds of code in my main program. Here's how I have arranged my code: Header files: File Name:include.inc include 'module_variables.F90' include 'message.F90' include 'module_common_functions.f90' include 'module_input_gdf.F90' ... Relavant LAPACK files File Name: lapack.inc include 'xerbla.f' include 'strsm.f' include 'slaswp.f' include 'sgetrs.f' include 'sgetrf.f' ... Now my main program looks like: include 'lapack.inc' include 'include.inc' program MDL_HydroD use module_variables use module_write_files

how to write a huge matrix to file row by row (fortran 90)

安稳与你 提交于 2019-11-29 15:42:38
问题 I want to write a matrix with a lot of data to a file row by row. For example, I have a matrix 100*100 and I want to have it in form 100*100 in the file. However, it doesn't work.Following is my code and some description. N and M are integers around some hundreds. RECL is expected length I set the file but here it seems this command does not work. The output is with 198 lines when N is set 99 and M is set 200. Vec is a double precision complex matrix. How could I output the values of Vec

What is a good way to get file size in bytes using Fortran?

我与影子孤独终老i 提交于 2019-11-29 14:18:22
Is there a way to get the filesize in Fortran using Intel Fortran? I was using stat which works great in gfortran, but it is not available in ifort. INQUIRE(FILE=filename, SIZE=file_size) filename is a character scalar, file_size is an integer scalar that will be defined with the size of the file in file storage units ("in bytes" on ifort), or -1 if the size cannot be determined. 来源: https://stackoverflow.com/questions/17711835/what-is-a-good-way-to-get-file-size-in-bytes-using-fortran

f2py with Intel Fortran compiler

冷暖自知 提交于 2019-11-29 04:35:16
I am trying to use f2py to interface my python programs with my Fortran modules. I am on a Win7 platform. I use latest Anaconda 64 (1.7) as a Python+NumPy stack. My Fortran compiler is the latest Intel Fortran compiler 64 (version 14.0.0.103 Build 20130728). I have been experiencing a number of issues when executing f2py -c -m PyModule FortranModule.f90 --fcompiler=intelvem The last one, which I can't seem to sort out is that it looks like the sequence of flags f2py/distutils passes to the compiler does not match what ifort expects. I get a series of warning messages regarding unknown options

Run Fortran DLL with Visual Studio

蓝咒 提交于 2019-11-28 11:49:32
I develop a website with Visual Studio 2010. I want to run a Fortran DLL. I used Intel Visual Fortran to create a .dll and to test how to use it. My code is: SUBROUTINE SIMPSON (N,H,I) !DEC$ ATTRIBUTES DLLEXPORT, DECORATE, ALIAS : "SIMPSON" :: SIMPSON !DEC$ ATTRIBUTES REFERENCE::N !DEC$ ATTRIBUTES REFERENCE::H !DEC$ ATTRIBUTES REFERENCE::I INTEGER N,H,I I=N+H RETURN END which practically takes two integers, adds them and return the result. Now I have the .dll I don't know how to run it with Visual Studio. Can anyone who knows please give me steps to follow? ja72 I do this all the time. What I

Include both .f and .F90 file in Fortran main file header

梦想的初衷 提交于 2019-11-28 09:53:06
问题 I am using some F77 fixed format code with my F90 program. I am trying to include both kinds of code in my main program. Here's how I have arranged my code: Header files: File Name:include.inc include 'module_variables.F90' include 'message.F90' include 'module_common_functions.f90' include 'module_input_gdf.F90' ... Relavant LAPACK files File Name: lapack.inc include 'xerbla.f' include 'strsm.f' include 'slaswp.f' include 'sgetrs.f' include 'sgetrf.f' ... Now my main program looks like:

What is a good way to get file size in bytes using Fortran?

自作多情 提交于 2019-11-28 08:12:57
问题 Is there a way to get the filesize in Fortran using Intel Fortran? I was using stat which works great in gfortran, but it is not available in ifort. 回答1: INQUIRE(FILE=filename, SIZE=file_size) filename is a character scalar, file_size is an integer scalar that will be defined with the size of the file in file storage units ("in bytes" on ifort), or -1 if the size cannot be determined. 来源: https://stackoverflow.com/questions/17711835/what-is-a-good-way-to-get-file-size-in-bytes-using-fortran

Wrong inverse matrix using ZGETRI in Fortran

我与影子孤独终老i 提交于 2019-11-28 05:59:52
问题 I am trying to compute the inverse of a complex matrix with ZGETRI, but even if it executes without error (info = 0), it does not give me the correct inverse matrix and I have absolutely no idea where the error comes from. PROGRAM solvelinear implicit none INTEGER :: i,j,info,lwork INTEGER,dimension(3) :: ipiv COMPLEX(16), dimension(3,3) :: C,Cinv,M,LU COMPLEX(16),allocatable :: work(:) info=0 lwork=100 allocate(work(lwork)) ipiv=0 work=(0.d0,0.d0) C(1,1)=(0.d0,-1.d0) C(1,2)=(1.d0,5.d0) C(1,3

f2py with Intel Fortran compiler

那年仲夏 提交于 2019-11-27 18:30:16
问题 I am trying to use f2py to interface my python programs with my Fortran modules. I am on a Win7 platform. I use latest Anaconda 64 (1.7) as a Python+NumPy stack. My Fortran compiler is the latest Intel Fortran compiler 64 (version 14.0.0.103 Build 20130728). I have been experiencing a number of issues when executing f2py -c -m PyModule FortranModule.f90 --fcompiler=intelvem The last one, which I can't seem to sort out is that it looks like the sequence of flags f2py/distutils passes to the