intel-fortran

OOP Fortran, Type and Procedures in different files

隐身守侯 提交于 2021-02-11 05:52:35
问题 I was wondering whether it is possible to place the actual subroutines behind type bound procedures and the type definition in different files. EG: File A: Module TypeDef Type :: Test Integer :: a,b,c contains Procedure, Pass, Public :: add => SubAdd End Type Type(Test) :: Test Interface Subroutine SubAdd(this) Import TypeDef Class(TypeDef), Intent(InOut) :: this End Subroutine End Interface End Module File B: Module TypeRoutines use TypeDef Private :: SubAdd contains Subroutine SubAdd(this)

OOP Fortran, Type and Procedures in different files

▼魔方 西西 提交于 2021-02-11 05:52:19
问题 I was wondering whether it is possible to place the actual subroutines behind type bound procedures and the type definition in different files. EG: File A: Module TypeDef Type :: Test Integer :: a,b,c contains Procedure, Pass, Public :: add => SubAdd End Type Type(Test) :: Test Interface Subroutine SubAdd(this) Import TypeDef Class(TypeDef), Intent(InOut) :: this End Subroutine End Interface End Module File B: Module TypeRoutines use TypeDef Private :: SubAdd contains Subroutine SubAdd(this)

OOP Fortran, Type and Procedures in different files

风流意气都作罢 提交于 2021-02-11 05:52:07
问题 I was wondering whether it is possible to place the actual subroutines behind type bound procedures and the type definition in different files. EG: File A: Module TypeDef Type :: Test Integer :: a,b,c contains Procedure, Pass, Public :: add => SubAdd End Type Type(Test) :: Test Interface Subroutine SubAdd(this) Import TypeDef Class(TypeDef), Intent(InOut) :: this End Subroutine End Interface End Module File B: Module TypeRoutines use TypeDef Private :: SubAdd contains Subroutine SubAdd(this)

Intel Fortran to GNU Fortran Conversion [closed]

走远了吗. 提交于 2021-02-08 10:35:56
问题 Closed. This question needs debugging details. 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 . Improve this question I am working on a custom CFD Solver written in Fortran 90 and MPI. The code contain 15+ Modules and was initially designed to work with the Intel Fortran compiler. Now since i do not have access to the Intel compiler I need to make it work using the GNU Fortran Compiler. I made

Intel Fortran to GNU Fortran Conversion [closed]

╄→гoц情女王★ 提交于 2021-02-08 10:33:26
问题 Closed. This question needs debugging details. 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 . Improve this question I am working on a custom CFD Solver written in Fortran 90 and MPI. The code contain 15+ Modules and was initially designed to work with the Intel Fortran compiler. Now since i do not have access to the Intel compiler I need to make it work using the GNU Fortran Compiler. I made

Numerical equivalent of TRUE is -1?

一曲冷凌霜 提交于 2021-02-08 03:41:37
问题 I am using Intel Fortran in Visual Studio 2012 to compile a Fortran code. When I try to use logical operators I have noticed that a standalone logical expression results in T or F as expected. However, if I need the numerical T or F (0 or 1), I get a -1 when logical result is T. For example: integer*4 a a = 1 logicval = (node(5,L).gt.0) numval = 1*(node(5,L).gt.0) write(*,*) logicval, numval would output T, -1 Is there a way in which I can redefine numerical values assigned to T & F? 回答1: Yes

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,

Finalisation in FORTRAN 2003

岁酱吖の 提交于 2021-01-27 11:55:51
问题 According to Fortran Wiki the intel fortran compiler version 14 should support finalisation defined in FORTRAN 2003 standard. I tried to use this feature with ifort 14 , but observed strange behaviour. Following example should show this: module mtypes implicit none type mytype integer, private :: nr contains final :: delete_mytype procedure :: print_mytype end type contains !> \brief Constructs a new mytype !! \return The created mytype !> function init_mytype(number) type(mytype) :: init

Sign of infinity on division by zero

家住魔仙堡 提交于 2021-01-27 10:52:24
问题 I've implemented code to find the polar coordinates of a point in 2D space. if the point lies in the 1st or 2nd Quadrant, 0<=theta<=pi and if it lies in the 3rd or 4th Quadrant, -pi <= theta <= 0 . module thetalib contains real function comp_theta( x1, x2) implicit none real , intent(in) :: x1, x2 real :: x1p, x2p real :: x1_c=0.0, x2_c=0.0 real :: pi=4*atan(1.0) x1p = x1 - x1_c x2p = x2 - x2_c ! - Patch !if ( x1p == 0 .and. x2p /= 0 ) then ! comp_theta = sign(pi/2.0, x2p) !else ! comp_theta

Sign of infinity on division by zero

 ̄綄美尐妖づ 提交于 2021-01-27 10:52:02
问题 I've implemented code to find the polar coordinates of a point in 2D space. if the point lies in the 1st or 2nd Quadrant, 0<=theta<=pi and if it lies in the 3rd or 4th Quadrant, -pi <= theta <= 0 . module thetalib contains real function comp_theta( x1, x2) implicit none real , intent(in) :: x1, x2 real :: x1p, x2p real :: x1_c=0.0, x2_c=0.0 real :: pi=4*atan(1.0) x1p = x1 - x1_c x2p = x2 - x2_c ! - Patch !if ( x1p == 0 .and. x2p /= 0 ) then ! comp_theta = sign(pi/2.0, x2p) !else ! comp_theta