gfortran

gfortran error : Unexpected element '<' in format string

不打扰是莪最后的温柔 提交于 2021-02-04 21:38:54
问题 I suffer the pain to compile the old fortran source code using gfortran. I did not have many experience to do this, so please help me to correct the source code based on the error message. disturbance.f:1416.31: 1505 format ( I7, E12.3, < npftu>E10.3 ) Error: Unexpected element '<' in format string at (1) please note that there is no space between npftu and < >. Thanks a lot. 回答1: Variable FORMAT expressions are non-standard and are not supported by gfortran (link to the documentation). I

Array specification at (1) has more than 7 dimensions in mpif-sizeof.h

我的未来我决定 提交于 2021-01-29 15:38:09
问题 I have the following makelist file: BIN_SUFFIX = cpu OMP_FLAGS = -p OPT_FLAGS = -ofast compiler = mpifort compiler = mpif90 #used in gfortran MISC_FLAGS = -ffree-line-length-300 # CFLAGS += $(OPT_FLAGS) CFLAGS += $(OMP_FLAGS) CFLAGS += $(MISC_FLAGS) LFLAGS = $(CFLAGS) COMPILE = ${compiler} -c LINK = ${compiler} objects = Main_multiphase.o Main_singlephase.o Module.o Init_multiphase.o Init_singlephase.o Misc.o IO_multiphase.o IO_singlephase.o Kernel_multiphase.o Kernel_singlephase.o Mpi_misc.o

Error when compile umfpack after the update of Mac

安稳与你 提交于 2021-01-29 09:49:55
问题 I was able to use umfpack, but I just found that I cannot use it as before. I guess the reason is my recent update of Mac. I already installed SuiteSparse VERSION 4.5.4. I use the Fortran interface, umfpack.f90, from http://geo.mff.cuni.cz/~lh/Fortran/UMFPACK/. And use gfortran umfpack.f90 umfpack_simple_3subr.f90 -L/usr/local/lib -lumfpack to compile. But I got the following errors: Undefined symbols for architecture x86_64: "__gfortran_os_error_at", referenced from: ___mumfpack_MOD_umfpack

GFortran error: ld: library not found for -lSystem when trying to compile

做~自己de王妃 提交于 2021-01-29 07:16:49
问题 I am getting a strange error when trying to compile a simple fortran-90 file using gfortran. I am working on a macOS mojave system. I have gfortran 8.2.0 installed and I checked to be sure of this by doing the following: Input: gfortran --version Output: GNU Fortran (GCC) 8.2.0 Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Which indicates

MPI Fortran support through the mpi_f08 module with gfortran

拈花ヽ惹草 提交于 2021-01-29 06:09:00
问题 I have some Fortran code I would like to paralelize with MPI. Appereantly, recomended way to use MPI (MPICH, in my case) with Fortran is through mpi_f08 module (mpi-forum entry on the matter), but I have trouble making it work, since corresponding mod file is simply not created (unlike mpi.mod , which works fine, but it's not up to date with Fortran standart). This discussion left me under the impression it's because gfortran can't build the F08 bindings. Below you can see my configuration,

Exponentiation in Fortran/gfortran to high precision

时光总嘲笑我的痴心妄想 提交于 2021-01-28 04:45:34
问题 How does gfortran handle exponentiation with a integer vs a real? I always assumed it was the same, but consider the example: program main implicit none integer, parameter :: dp = selected_real_kind(33,4931) real(kind=dp) :: x = 82.4754500815524510_dp print *, x print *, x**4 print *, x**4.0_dp end program main Compiling with gfortran gives 82.4754500815524510000000000000000003 46269923.0191143410452125643548442147 46269923.0191143410452125643548442211 Now clearly these numbers almost agree -

How can I read a 2D file which content is not separated by spaces in Fortran

可紊 提交于 2021-01-27 23:13:33
问题 I have a matrix stored in a file (number.txt), like this: 12323456 54254311 76534522 How can I read such matrix in Fortran, so the result would be: 1 2 3 2 3 4 5 6 5 4 2 5 4 3 1 1 7 6 5 3 4 5 2 2 It is very easy to separate these columns using awk and read it in Fortran. But, I would like to know if I can do all this using only Fortran. After I am done with I will need to multiple this matrix by its transpose. 回答1: Fortran formatted input and output is based on fields . Fields are not

How can I read a 2D file which content is not separated by spaces in Fortran

十年热恋 提交于 2021-01-27 22:04:10
问题 I have a matrix stored in a file (number.txt), like this: 12323456 54254311 76534522 How can I read such matrix in Fortran, so the result would be: 1 2 3 2 3 4 5 6 5 4 2 5 4 3 1 1 7 6 5 3 4 5 2 2 It is very easy to separate these columns using awk and read it in Fortran. But, I would like to know if I can do all this using only Fortran. After I am done with I will need to multiple this matrix by its transpose. 回答1: Fortran formatted input and output is based on fields . Fields are not

Interpret strings as variable names in Fortran [duplicate]

淺唱寂寞╮ 提交于 2021-01-27 21:03:54
问题 This question already has answers here : Determine variable names dynamically according to a string in Fortran (4 answers) Closed 3 years ago . I'd like to access a real variable with a name equal to a string of characters that I have. Something like this (I'll make the example as clean as possible): character(len=5) :: some_string real :: value value = 100.0 some_string = 'value' At this point, how do I create an association between the character array value and the name of my real variable,

Call specific C++ DLL from Fortran

拈花ヽ惹草 提交于 2021-01-24 11:11:42
问题 I received a DLL made in C++, and I'm building a Fortran program to call the C++ DLL. My compiler (gfortran) shows no warnings, but it crashes during runtime with the following description: forrtl: severe (157): Program Exception - access violation Image PC Routine Line Source MainDLL_v10.dll 0B7A6B01 Unknown Unknown Unknown MainDLL_v10.dll 0B7A1BEF Unknown Unknown Unknown ... I guess something is wrong with my call arguments. The C++ DLL includes the following: #include <DllClasses.h> ...