intel-fortran

Fortran Functions with a pointer result in a normal assignment

大憨熊 提交于 2019-12-11 01:23:26
问题 After some discussion on the question found here Correct execution of Final routine in Fortran I thought it will be useful to know when a function with a pointer result is appropriate to use with a normal or a pointer assignment. For example, given this simple function function pointer_result(this) implicit none type(test_type),intent(in) pointer :: this type(test_type), pointer :: pointer_result allocate(pointer_result) end function I would normally do test=>pointer_result(test) , where test

NaN issue in fortran 90

大憨熊 提交于 2019-12-10 20:45:15
问题 I realize that if you write Real (Kind(0.d0))::x,y x = sqrt(-1.d0) y = sqrt(-1.d0) if (x == y) then write(*,*)'yep, they are equals', x endif It compiles ok using ifort. But nothing is written, the conditional is always false , did you notice that? why is this so? 回答1: NaN signifies not a number, and since there are many, different, reasons a calculation could give that result, they generally do not compare as equal against themselves. If you want to do nan-testing, fortran compilers that

Does the Intel Fortran 95 compiler allow module arrays to be of non-constant size?

六眼飞鱼酱① 提交于 2019-12-10 20:18:45
问题 I have downloaded a Fortran 90/95 adaptive mesh refinment library (Paramesh), and now I'm trying to compile an example program that came with it. In the process I modified the Makefile to use gfortran instead of the Intel Fortran compiler. In the library code, there is a module containing this snippet: module physicaldata ! Many many lines of variable definitions here !.... Public :: nfluxvar Integer,Save :: nfluxvar ! Many many lines of variable definitions here !.... end module physicaldata

Default Status of “Unknown” in Open

断了今生、忘了曾经 提交于 2019-12-10 20:04:35
问题 I often see people using the OPEN statement without explicitly specifying a STATUS . In the Fortran 90 and 2008 standards, this is said regarding STATUS : If UNKNOWN is specified, the status is processor dependent. If this specifier is omitted, the default value is UNKNOWN. I interpret this to mean, if STATUS is omitted, anything can happen, depending what machine you're using. Yet, from doing some tests, it seems the default behavior (when STATUS is omitted), is REPLACE . But I cannot find

Random number generator (RNG/PRNG) that returns updated value of seed

本秂侑毒 提交于 2019-12-10 19:48:15
问题 I'm trying to write an RNG that also returns the value of the updated seed. The perhaps obvious reason for this is so that new random variables can be added to the program later, without changing the values of the existing RNGs. For a python/numpy version of this issue see for example: Difference between RandomState and seed in numpy Here's a example of usage with a (tentative) proposed solution: program main ! note that I am assuming size=12 for the random ! seed but this is implementation

How to use Intel fortran compiler with MKL on command line

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 19:37:06
问题 I've freshly installed the Intel® Parallel Studio XE Composer Edition for Fortran OS X* (student version). It comes with the Math Kernel Library, which is why I bought it. I'm having a hard time getting started with MKL. Here's what I've done step-by-step. 1) Installed Intel® Parallel Studio XE Composer Edition for Fortran OS X* (no problem). I can run a 'hello world' script using ifort and throw the -mkl link command on at the end with no problem (not calling any mkl commands just yet). 2)

“d” label in the first column, Fortran 77

余生颓废 提交于 2019-12-10 17:13:44
问题 I am modifying a code from a model written in Fortran 77, but I have come across an odd thing to me. In some files, there is a label "d" in the first column of a line, like the example below: d real*8 co2rootfix,co2rootloss,co2shootfix d character komma*1 d open(unit=87,file='crop_CO2.csv',status='unknown') d write(87,*) 'date,co2rootfix,co2rootloss,co2shootfix' d open(unit=88,file='crop_dm.csv',status='unknown') d write(88,*) 'date,wrtpot,wrt,wstpot,wst,rdpot,rd,laipot,lai, d &gwrt,gwst,drrt

How to set openmp thread stack to unlimited?

寵の児 提交于 2019-12-10 12:19:38
问题 Can someone tell me how to set OpenMP stack size to unlimited? Like this link: Why Segmentation fault is happening in this openmp code? I also have a project written by Fortran (customer‘s complex code), if I set OMP_STACKSIZE , the project is running normally. If I unset it, the project fails. But, different input data have different OMP_STACKSIZE , so I must try it for each inputdata, (because I must save memory). Can I set the OpenMP stack like pthread ( ulimit -s unlimited )? Or have some

The mysterious nature of Fortran 90 modules

与世无争的帅哥 提交于 2019-12-09 10:02:01
问题 Fortran 90 modules are evanescent creatures. I was using a (singular) module for a while with some success (compiling using Intel Visual Fortran and Visual Studio 2010). Then I wrote another module and tried to USE it in another function, before receiving this error: error #7002: Error in opening the compiled module file. Check INCLUDE paths. So I deleted the offending module. But now I receive the same error after when trying to access my original module! How can I locate these mysterious

F2PY cannot find intel fortran compiler on windows 7

一笑奈何 提交于 2019-12-09 02:53:34
I am struggling to get F2PY working with Intel Fortran on Windows 7. This appears to be a common issue and I have attempted a number of suggestions found in other posts (described below). A bit of information about my system: Windows 7 64-bit Python 2.7.11 via Enthought Canopy 32-bit (up to date as of June 12, 2016) Intel Fortran 14 (Intel\Composer XE 2013 SP1) (32 and 64-bit) After doing a bit of research see here I found that the issue may be related to the c++ runtime so I installed Microsoft Visual C++ for Python. Still, when I attempt to build a simple test case, I receive the following