gfortran

gfortran compiler cannot find misspelled full directory

眉间皱痕 提交于 2019-12-25 05:22:17
问题 I was able to make a much simpler example than the one in my original post. I'm trying to compile a fortran code using gcc version 4.9.2 (x86_64-posix-seh-rev4, Built by MinGW-W64 project) on windows. Below is a batch script that I used to successfully compile the code: SET SRC_DIR=code gfortran -fopenmp -g -fimplicit-none -cpp ^ %SRC_DIR%/globals/current_precision.f90^ %SRC_DIR%/string/string.f90^ ... %SRC_DIR%/user/MOONS.f90^ parametricStudy.f90^ -o main.exe del *.mod The output looks like

gfortran compiler cannot find misspelled full directory

青春壹個敷衍的年華 提交于 2019-12-25 05:22:16
问题 I was able to make a much simpler example than the one in my original post. I'm trying to compile a fortran code using gcc version 4.9.2 (x86_64-posix-seh-rev4, Built by MinGW-W64 project) on windows. Below is a batch script that I used to successfully compile the code: SET SRC_DIR=code gfortran -fopenmp -g -fimplicit-none -cpp ^ %SRC_DIR%/globals/current_precision.f90^ %SRC_DIR%/string/string.f90^ ... %SRC_DIR%/user/MOONS.f90^ parametricStudy.f90^ -o main.exe del *.mod The output looks like

Output from fortran application not showing up in Matlab

☆樱花仙子☆ 提交于 2019-12-25 05:18:28
问题 I'm having some issues with output from a fortran application being executed from within Matlab. We use Matlab to call a number of fortran applications and to display output and results. I'm using gfortran on OSX to build one of these programs, which does a large amount of file output and a little output to stdout to track progress. stdout output is accomplished mainly through print * statements, but I've tried write( * , * ) as well. The program uses OpenMP, but none of the print * or write(

Incompatible ranks 0 and 2 in assignment [duplicate]

别来无恙 提交于 2019-12-25 04:33:00
问题 This question already has answers here : Line truncated, Syntax error in argument list (2 answers) Closed 2 years ago . I have tried to write a code in fortran to calculate the coordination number. But a got these errors coord.f:43.72: read(13,*) ri(i), g(2,2,i), g(1,2,i), g(1,2,i), g(1, 1 Error: Expected array subscript at (1) coord.f:78.38: call integrate(npts-1,ri,gt,ans) 1 Warning: Rank mismatch in argument 'ans' at (1) (scalar and rank-2) coord.f:79.8: t1(ia,ib)=ans 1 Error: Incompatible

get n dimensional Fortran array from subroutine output into R?

烈酒焚心 提交于 2019-12-25 01:33:53
问题 I have the following Fortran subroutine: subroutine test(d, i, nMCd, DF, X) integer, intent(in) :: d, i, nMCd double precision, intent(in), dimension(i,nMCd) :: DF double precision, intent(out), dimension(i) :: X X = DF(:,d)+DF(:,d) end subroutine test I am able to compile it for R load it and run it. But instead of getting an array I'm getting a single number. system("R CMD SHLIB ./Fortran/mytest.f90") dyn.load("./Fortran/mytest.so") input <- data.frame(A=c(11,12), B=c(21, 22)) .Fortran(

MATLAB gives “undefined reference” errors trying to use gfortran on Windows

南楼画角 提交于 2019-12-25 01:15:15
问题 I'm trying to use MinGW gfortran with MATLAB R2019a on Windows 10 by writing a mexopts XML file based on existing XML files. I have cygwin installed with MinGW gcc, and I've been able to run mex -setup referencing the XML file successfully. When I try to compile the timestwo.F file to test the setup (using mex -R2018a timestwo.F90 ), I get a bunch of errors: Building with 'cygwin MinGW64 Compiler (Fortran)'. C:\cygwin64\bin\x86_64-w64-mingw32-gfortran -c -DMX_COMPAT_64 -DMATLAB_MEXCMD_RELEASE

Fortran pointer functions: why does this code's behavior depend on the order of function calls?

陌路散爱 提交于 2019-12-24 17:17:08
问题 Context The toy Fortran code posted below calls two pointer functions. That is, both functions return a pointer. In fact, they're both array pointers. They both attempt to do the same thing, which is to return an integer array pointer referencing an integer array having three elements, 1, 2, and 3. The first function uses the pointer assignment operator (=>) to point the function pointer to an allocatable array that holds the data. The second function allocates a block of dynamic memory

Fortran - recompile program from 32bit to 64bit machine

烂漫一生 提交于 2019-12-24 16:41:08
问题 I've got really old program which I want to run on my 64bit computer. There are a lot of depreciated statements. During debugging I found that a lot of variables become NaN or Infinity... Hence, I changed variables from 4-bytes to 8-bytes long (i.e. REAL to REAL*8) but now caluclations and results are considerably different on both computers. Could somebody explain me if it really does matter if I use longer types and why on a 32-bit computer everything was OK but on a 64-bit one I get

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

Can a stack overflow be sometimes misinterpreted by the compiler as an Access violation?

耗尽温柔 提交于 2019-12-24 15:22:20
问题 I have a fortran code compiled with Intel fortran compiler 2013 and VS2010 under windows 7 that started to give me unhandled exceptions without showing the line in which the code was crashing. Usually an error like this was showing up: Unhandled exception at 0x73e1d3d2 in GRIB2METEOriparto.exe: 0xC0000005: Access violation writing location 0x00240ef4.... and the call stack had only dbghelp.dll or verifies.dll and no source available. I moved my source files under Cygwin, I compiled with