fortran90

Issue with OpenMP thread execution and threadprivate variable

女生的网名这么多〃 提交于 2019-12-13 08:46:10
问题 I have used 8 threads for 8 loops. I have used 'print' to see how the parallel code works. The 0 thread creates problems!I have showed in the attached diagram (please check the attached link below) how the parallel works. I have used threadprivate but it turned out that thread 0 can not get any private threadsafe variables. I have tried with modules as well and got same results! Any idea why the code acts this way? I would appreciate any help or suggestion. Thanks! !$OMP PARALLEL DO do nb=m3

Unclassifiable Statement at SUBROUTINE declaration inside a PROGRAM

心已入冬 提交于 2019-12-13 06:54:30
问题 So I've written a basic Vigenere Cypher in Fortran 90, however when I try to compile it, I am hammered with Unclassifiable Statement Errors due to my internal SUBROUTINES. I have listed the variables used in each SUBROUTINE in '(' ')', but I am still getting back errors. I think it's a really simple fix, but I can't seem to find a solution to it. Here is my code: PROGRAM Assign_8 IMPLICIT NONE CHARACTER*750 :: Input CHARACTER*10 :: Key CHARACTER*750 :: RepeatedKey CHARACTER*750 :: Encrypted,

FORTRAN: Best way to store large amount of data which is readable in MATLAB

拥有回忆 提交于 2019-12-13 05:13:22
问题 I am working on developing an application in Fortran where I have points defining quadrilateral panels on the surface of an object. I am calculating various parameters on these quadrilateral panels for a number of frequencies. The output file should look like: FREQUENCY,PANEL_NUMBER,X1,Y1,Z1,X2,Y2,Z2,X3,Y3,Z3,X4,Y4,Z4,AREA,PRESSURE,.... 0.01,1,.... 0.01,2,.... 0.01,3,.... . . . . 0.01,2000,.... 0.02,1,.... 0.02,2,.... . . . 0.02,2000,... . . I am expecting a maximum of 300,000 rows with 30

Can't compile Fortran modules: Undefined symbol _main

旧时模样 提交于 2019-12-13 04:35:26
问题 I've been trying lately to use libraries in Fotran, but I kept on getting this error message Undefined symbols for architecture x86_64: "_main", referenced from: implicit entry/start for main executable ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status which I cound't find any specific solution to it. In this case, I was working with some libraries that I built myself (this problem happened with static and shared libraries) from simples modules I wrote

How to create custom arrays in fortran?

邮差的信 提交于 2019-12-13 02:22:26
问题 I have been looking at porting a cuda library to fortran. PGI and EM Photonics seem to be two libraries that exist right now. However I have only found what I am looking for over here real, device, allocatable :: adev(:), bdev(:) ! device declaration So my question is, is there a way to create custom arrays like the code sample mentioned above ? Or is it part of the propreitary compiler from PGI ? Edited for further clarity In other words can I do this mycustomtype, allocatable :: tmp(:) 回答1:

Compiling Multiple Files with modules

孤街醉人 提交于 2019-12-12 20:32:41
问题 I am programming in Fortran 90 using GFortran and I'm having troubles with Modules. When I compile the code below, I get the following error: Derivatives.f90:7.16: Included at C:\Users\dchalhub\Dropbox\Doutorado\#Tese\New folder\main.f90:1: Use Mesh 1 Fatal Error: Can't open module file 'mesh.mod' for reading at (1): No such file or directory gfortran.exe: Internal error: Aborted (program f951) Please submit a full bug report. See <http://gcc.gnu.org/bugs.html> for instructions. So, the 'mesh

Identify operating system

£可爱£侵袭症+ 提交于 2019-12-12 17:38:33
问题 My Fortran 90 code on Intel compiler depends on the operating system it is running on, e.g. if (OS=="win7") then do X else if (OS=="linux") then do y end if How do I do this programmatically? 回答1: You can use pre-processor directives for this task, see here and here for details: _WIN32 for Windows __linux for Linux __APPLE__ for Mac OSX Here is an example: program test #ifdef _WIN32 print *,'Windows' #endif #ifdef __linux print *,'Linux' #endif end program Make sure you enable the pre

what is the biggest array size for double precision in Fortran 90?

跟風遠走 提交于 2019-12-12 15:33:47
问题 Sorry if this is not the correct place to do this question, this is not about programation instead is a technical question. I need to work with enormous size arrays of 2D vectors in double precision, 10 million of them aproximately. But, in other programs I had memory problem in deal with this kind of arrays. My question is if there is some kind of limit for the array size in double precision. I work in Linux, Intel two core, 32-bits. thanks 回答1: Ok, I will explain by why the number of bytes

Correctly setting random seeds for repeatability

让人想犯罪 __ 提交于 2019-12-12 13:23:10
问题 The method for setting random seeds using the Fortran 90 subroutine random_seed is quite straightforward. call random_seed( put=seed ) But I can't find any information about guidelines for setting the seed (which is absolutely necessary when you want repeatability). Folklore I've heard in the past suggested that scalar seeds should be large. E.g. 123456789 is a better seed than 123. The only support for this I can find on the web is that it is suggested for the ifort extension function ran()

Can I have a pointer to an item in an allocatable array component?

梦想与她 提交于 2019-12-12 11:26:38
问题 I have a user-defined type vector . In another type, I have an allocatable array of vectors. I want to have a pointer to a single vector from this allocatable array. So I thought I would do this: type another_type type(vector),allocatable,target::my_vectors(:) end type and type(vector),pointer::pointed_vec But when I compile, the compiler complains that: This attribute specification is not valid for a component definition statement. Can I have a pointer to a single item from an allocatable