gfortran

Error in linking gfortran to LAPACK and BLAS

a 夏天 提交于 2020-05-26 06:29:25
问题 I have installed LAPACK and BLAS from Synaptic package manager in Ubuntu. whereis libblas libblas: /usr/lib/libblas.so /usr/lib/libblas.a /usr/lib/libblas whereis liblapack liblapack: /usr/lib/liblapack.a /usr/lib/liblapack.so When I try to compile the randomsys1 example with gfortran I get the following error messages. gfortran randomsys1.f90 -L/usr/lib/lapack -llapack -L/usr/lib/libblas -lblas /tmp/cclwtifh.o: In function `MAIN__': randomsys1.f90:(.text+0x12): undefined reference to `init

How to optimize this Fortran subroutine with many loops?

拥有回忆 提交于 2020-05-13 20:11:19
问题 I am dealing with subroutine that is very inefficient when the array size becomes large, for example, NN=1000, KK=200, MM = 200. But, I can not come up with ideas to optimize it. program main implicit none integer :: NN, KK, MM integer, allocatable, dimension(:,:) :: id complex*16, allocatable, dimension(:) :: phase complex*16 :: phase_base(3) real*8, allocatable, dimension(:,:) :: wave_base complex*16, allocatable, dimension(:,:) :: wave integer :: i, j, k, n NN = 1000 KK = 200 MM = 200

Length-parameterized passed object to type-bound procedure has gfortran complain

心不动则不痛 提交于 2020-05-09 03:18:28
问题 I'm learning Fortran and I'd like to encapsulate an array and a subroutine in a type. The problem appears to be in the type definition of the self-object. This is the minimal test case I came up with: module testing implicit none type test(para) integer, len :: para real, dimension(para) :: weights contains procedure :: testing => testing_test end type contains subroutine testing_test(self) class(test(*)) :: self end subroutine end module Compiling this with gfortran raises this error: module

Length-parameterized passed object to type-bound procedure has gfortran complain

风流意气都作罢 提交于 2020-05-09 03:17:26
问题 I'm learning Fortran and I'd like to encapsulate an array and a subroutine in a type. The problem appears to be in the type definition of the self-object. This is the minimal test case I came up with: module testing implicit none type test(para) integer, len :: para real, dimension(para) :: weights contains procedure :: testing => testing_test end type contains subroutine testing_test(self) class(test(*)) :: self end subroutine end module Compiling this with gfortran raises this error: module

Length-parameterized passed object to type-bound procedure has gfortran complain

。_饼干妹妹 提交于 2020-05-09 03:16:28
问题 I'm learning Fortran and I'd like to encapsulate an array and a subroutine in a type. The problem appears to be in the type definition of the self-object. This is the minimal test case I came up with: module testing implicit none type test(para) integer, len :: para real, dimension(para) :: weights contains procedure :: testing => testing_test end type contains subroutine testing_test(self) class(test(*)) :: self end subroutine end module Compiling this with gfortran raises this error: module

gfortran: error: libgfortran.spec: No such file or directory

会有一股神秘感。 提交于 2020-04-18 06:12:10
问题 I am attempting to install and run gfortran-8 on macOS with the following makefile. I installed it from http://hpc.sourceforge.net/ (8.3 version). I keep getting this error: gfortran: error: libgfortran.spec: No such file or directory I know libhfortran.spec is located in /usr/local/Cellar/gcc@8/8.4.0/lib/gcc/8/libgfortran.spec. I have added it to my etc/paths and my .bash_profile. I have also uninstalled gfortran and reinstalled it. Anyone have a clue on what I might be missing? I am

Ambiguous reference to variable

旧城冷巷雨未停 提交于 2020-04-03 09:46:51
问题 So I am doing 2 modules which are linking to the main program. The first one has all the variables defined in it and the second one is with the functions. Module1: module zmienne implicit none integer, parameter :: ngauss = 8 integer, parameter :: out_unit=1000 integer, parameter :: out_unit1=1001 integer, parameter :: out_unit2=1002, out_unit3=1003 real(10), parameter :: error=0.000001 real(10):: total_calka, division,tot_old,blad real(10),parameter:: intrange=7.0 real(10),dimension(ngauss)

Ambiguous reference to variable

浪尽此生 提交于 2020-04-03 09:46:20
问题 So I am doing 2 modules which are linking to the main program. The first one has all the variables defined in it and the second one is with the functions. Module1: module zmienne implicit none integer, parameter :: ngauss = 8 integer, parameter :: out_unit=1000 integer, parameter :: out_unit1=1001 integer, parameter :: out_unit2=1002, out_unit3=1003 real(10), parameter :: error=0.000001 real(10):: total_calka, division,tot_old,blad real(10),parameter:: intrange=7.0 real(10),dimension(ngauss)

Ambiguous reference to variable

天涯浪子 提交于 2020-04-03 09:39:25
问题 So I am doing 2 modules which are linking to the main program. The first one has all the variables defined in it and the second one is with the functions. Module1: module zmienne implicit none integer, parameter :: ngauss = 8 integer, parameter :: out_unit=1000 integer, parameter :: out_unit1=1001 integer, parameter :: out_unit2=1002, out_unit3=1003 real(10), parameter :: error=0.000001 real(10):: total_calka, division,tot_old,blad real(10),parameter:: intrange=7.0 real(10),dimension(ngauss)

expm1 for GNU gfortran [closed]

折月煮酒 提交于 2020-03-26 04:50:31
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Is there any way to call a fast implementation of expm1 from GNU Fortran? Ideally, it would be great to have a function to calculate (exp(x)-1)/x directly to avoid extra check for zero argument. Elemental version of expm1 would be especially helpful. 回答1: This is how it's called from libm: use, intrinsic :: iso