gfortran

Assignment of Allocatables of Different Shapes in Fortran [duplicate]

雨燕双飞 提交于 2020-01-15 08:08:06
问题 This question already has an answer here : Allocatable array valued function. gfortran vs ifort (1 answer) Closed 2 years ago . Please look at the following code: program test implicit none integer, allocatable :: v1(:, :) integer, allocatable :: v2(:, :) allocate(v1(2, 4)) allocate(v2(2, 3)) v1(:, :) = reshape([11, 12, 13, 14, 15, 16, 17, 18], [2, 4]) v2(:, :) = reshape([21, 22, 23, 24, 25, 26], [2, 3]) print *, v1 print *, 'shape(v1): ', shape(v1) print * print *, v2 print *, 'shape(v2): ',

Assignment of Allocatables of Different Shapes in Fortran [duplicate]

泄露秘密 提交于 2020-01-15 08:07:10
问题 This question already has an answer here : Allocatable array valued function. gfortran vs ifort (1 answer) Closed 2 years ago . Please look at the following code: program test implicit none integer, allocatable :: v1(:, :) integer, allocatable :: v2(:, :) allocate(v1(2, 4)) allocate(v2(2, 3)) v1(:, :) = reshape([11, 12, 13, 14, 15, 16, 17, 18], [2, 4]) v2(:, :) = reshape([21, 22, 23, 24, 25, 26], [2, 3]) print *, v1 print *, 'shape(v1): ', shape(v1) print * print *, v2 print *, 'shape(v2): ',

Ifort suppress unused variable warning, leave all others intact

两盒软妹~` 提交于 2020-01-14 12:58:08
问题 i use ifort and gfortran to compile my Fortran program. However i also use a coworkers source and he has got a lot of unused variables. How can i suppress these for the compile, seeing as they are not really an error? However i dont want to disable -pedantic and -stan in the compiler options and thus want all the other warnings. cheers and thanks for the help 回答1: With ifort try -warn [no]unused . And, while I'm here, I suggest you remove unused variables. The compiler may not regard them as

undefined reference to 'd1mach_'

荒凉一梦 提交于 2020-01-11 11:38:48
问题 I'm trying to link a fortran subroutine with c++, but can't quite figure out what exactly is wrong here: The fortran subroutine calls some functions eg. d1mach or xermsg, which aren't defined in the fortran subroutine but called externally. When compiling, the error is "undefined reference to d1mach_"(or xermsg). I tried linking a library I think might contain the said functions (There seems to be a file called d1mach.o and xermsg.o inside the library) but the same error still persists. What

How to supress warning for “Deleted feature: PAUSE statement” in gfortran?

浪子不回头ぞ 提交于 2020-01-11 11:06:14
问题 I googled it but i could not find the answer. How can I suppress this warning AND ONLY THIS: Warning: Deleted feature: PAUSE statement at (1) i know I can supress all the warning but I wanna suppress only this one. Or if not possible. suppress warning for delete features. thanks A. 回答1: Compile with -std=legacy or -w (lowercase). Note that -w will suppress all warnings. 来源: https://stackoverflow.com/questions/16350426/how-to-supress-warning-for-deleted-feature-pause-statement-in-gfortran

How to supress warning for “Deleted feature: PAUSE statement” in gfortran?

别来无恙 提交于 2020-01-11 11:05:13
问题 I googled it but i could not find the answer. How can I suppress this warning AND ONLY THIS: Warning: Deleted feature: PAUSE statement at (1) i know I can supress all the warning but I wanna suppress only this one. Or if not possible. suppress warning for delete features. thanks A. 回答1: Compile with -std=legacy or -w (lowercase). Note that -w will suppress all warnings. 来源: https://stackoverflow.com/questions/16350426/how-to-supress-warning-for-deleted-feature-pause-statement-in-gfortran

How to supress warning for “Deleted feature: PAUSE statement” in gfortran?

早过忘川 提交于 2020-01-11 11:05:11
问题 I googled it but i could not find the answer. How can I suppress this warning AND ONLY THIS: Warning: Deleted feature: PAUSE statement at (1) i know I can supress all the warning but I wanna suppress only this one. Or if not possible. suppress warning for delete features. thanks A. 回答1: Compile with -std=legacy or -w (lowercase). Note that -w will suppress all warnings. 来源: https://stackoverflow.com/questions/16350426/how-to-supress-warning-for-deleted-feature-pause-statement-in-gfortran

Convert FORTRAN DEC UNION/MAP extensions to anything else

陌路散爱 提交于 2020-01-05 05:28:07
问题 Edit: Gfortran 6 now supports these extensions :) I have some old f77 code that extensively uses UNIONs and MAPs. I need to compile this using gfortran, which does not support these extensions. I have figured out how to convert all non-supported extensions except for these and I am at a loss. I have had several thoughts on possible approaches, but haven't been able to successfully implement anything. I need for the existing UDTs to be accessed in the same way that they currently are; I can

Why do the names of overriding arguments have to match those of the abstract interface?

大兔子大兔子 提交于 2020-01-05 03:04:49
问题 Why do the names of arguments in overriding procedures need to match those of the abstract interface? I understand that clearly the TYPE , INTENT , etc of such arguments are required to match the interface, but why should the compiler care what I call my variables? In the following, I've defined a simple abstract utility class containing a single deferred procedure EVAL that takes a double precision argument. !------------------------------------- an abstract utility class ! type, abstract ::

Fortran runtime warning: Extension: $ descriptor

此生再无相见时 提交于 2020-01-04 14:01:43
问题 I am using a very old Fortran 77 code from third party (also very bugged). I have compiled with FFLAGS=-O0 -Wall -g -fbacktrace -pedantic -Wextra I am getting the warning in the title at runtime: At line <number> of file <namefile>.f (unit=6, file='stdout') Fortran runtime warning: Extension: $ descriptor I would like to figure out what that means. 回答1: You should always show the code line number in the error or warning message, to which the line points. The role of $ in write(*,'(a$)')