gfortran

FORTRAN compiler warning: obsolete arithmetic IF statement

試著忘記壹切 提交于 2020-01-30 13:01:34
问题 I have a gfortran error: Warning: Obsolete: arithmetic IF statement at (1) What does this mean? In the source (old source): 66 s12 = max(epsilon, s1 + s2) c Then execution will go to label 13. Will this stop any further problems? if (s12 - 1.0) 13, 13, 12 13 z = s1 / s12 回答1: Arithmetic if is a peculiar feature of FORTRAN it works as follows. IF (expr) label1, label2, label3 If the value of the expression is less than 0, jump to label1 equal to 0, jump to label2 greater than 0, jump to label3

FORTRAN compiler warning: obsolete arithmetic IF statement

眉间皱痕 提交于 2020-01-30 13:00:09
问题 I have a gfortran error: Warning: Obsolete: arithmetic IF statement at (1) What does this mean? In the source (old source): 66 s12 = max(epsilon, s1 + s2) c Then execution will go to label 13. Will this stop any further problems? if (s12 - 1.0) 13, 13, 12 13 z = s1 / s12 回答1: Arithmetic if is a peculiar feature of FORTRAN it works as follows. IF (expr) label1, label2, label3 If the value of the expression is less than 0, jump to label1 equal to 0, jump to label2 greater than 0, jump to label3

f2py linking quadmath libraries? Use ctypes for fortran wrapper instead?

十年热恋 提交于 2020-01-25 08:00:09
问题 Update 11/23/2019: This started out as a question about why I could not get f2py to work for a simple fortran wrapper. My "answer" (below) is to use ctypes instead. Original post: I have spent the last three days trying to use f2py to interface fortran to python. I am working on windows using both cygwin and mingw. This post is about using cygwin, but I'm concerned about conflicts between the two. Here is the source multxy.f90: subroutine multxy(x,y,z) integer, parameter :: flt = selected

Declaring variables in function (Fortran)

独自空忆成欢 提交于 2020-01-24 20:08:06
问题 I am trying to write a very simple function in Fortran (first-time user): program Main implicit none integer function k(n) integer, intent(in) :: n k=n end function k end program Main I get a bunch of errors: integer function k(n) 1 Error: Syntax error in data declaration at (1) integer, intent(in) :: n 1 Error: Unexpected data declaration statement at (1) end function k 1 Error: Expecting END PROGRAM statement at (1) k=n 1 Error: Symbol ‘k’ at (1) has no IMPLICIT type k=n 1 Error: Symbol ‘n’

Preprocessor Macro not working on Windows in Fortran Code

北战南征 提交于 2020-01-20 08:50:09
问题 Dear All I have a small Fortran program containing preprocessor macro. Below is a minimal example. On mac os x, it works well but when I compile it on windows 7 (64-bit) it always prints unknown operating system . I am using gfortran-4.8.0 (mingw32) on windows 7. program foo implicit integer(i-n), double precision (a-h,o-p), + character*8(x-z) * #ifdef _WIN64 zterm = 'wxt' #elif _WIN32 zterm = 'wxt' #elif __APPLE__ zterm = 'aqua' #elif __linux zterm = 'x11' #elif __unix zterm = 'x11' #elif _

Installing gfortran in Linux as a user

六月ゝ 毕业季﹏ 提交于 2020-01-20 07:34:40
问题 I am a non-administrator user of a Linux (CentOS 6.6) server at work. I log in through a terminal program on a windows computer. My problem is that the IT does not feel comfortable upgrading GCC/gfortran for me so I want to just run it from my personal folders. They claim the latest yum (devtoolset-3 for this OS version) will downgrade some other feature they have. It's not the latest version of GCC anyway. I have downloaded the latest GCC 5.3 binaries and prerequisites from gfortran.com and

R Packages Fail to Compile with gcc

本小妞迷上赌 提交于 2020-01-19 17:39:35
问题 I downloaded bioconductor and attempted to install a package ("limma") which installed successfully, however when I tried to update bioconductor I keep getting errors relating to invalid compiler options. It seems to be specific to gcc, the gfortran packages install without issue. Here is the output: [xxx]$ su -c 'R' Password: R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-redhat-linux-gnu (64

Fortran double precision converted to Python float

余生颓废 提交于 2020-01-16 05:04:44
问题 I have the following subroutine in generation.f90 SUBROUTINE generation(t, prob) IMPLICIT NONE INTEGER, INTENT(IN) :: t REAL(8), INTENT(OUT) :: prob INTEGER :: nT2, c Do some stuff with t, nT2 and c prob = nT2/(DBLE(1.0)*c) END SUBROUTINE generation I want to use it in Python, so I wrap it with f2py f2py -c -m generation generation.f90 --fcompiler=gnu95 Then in ipython I do from generation import * a = generation(10000); type(a) and I get float . I checked the C file testmodule.c generated

Fortran; looping over file names with common attributes

不羁的心 提交于 2020-01-15 10:37:21
问题 I'm fairly new to Fortran and I am having trouble with my file names, I have a bunch of data in simuln#.res (where 1<#<20), I have multiple different directories with all the same simuln#.res names but they had different input parameters. The code looks like this: character(len=11) :: theFileA character(len=12) :: theFileB character(len=:), allocatable :: fileplace write(*,*) "the directory with the data sets, use quotations" read(*,*) fileplace fileLoop : do j=1,20 if (j .lt. 10) then write

Fortran; looping over file names with common attributes

烈酒焚心 提交于 2020-01-15 10:37:08
问题 I'm fairly new to Fortran and I am having trouble with my file names, I have a bunch of data in simuln#.res (where 1<#<20), I have multiple different directories with all the same simuln#.res names but they had different input parameters. The code looks like this: character(len=11) :: theFileA character(len=12) :: theFileB character(len=:), allocatable :: fileplace write(*,*) "the directory with the data sets, use quotations" read(*,*) fileplace fileLoop : do j=1,20 if (j .lt. 10) then write