fortran90

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)

How to wrap the fortran write-statement

帅比萌擦擦* 提交于 2020-02-28 08:05:28
问题 I want to wrap the fortran write-statement in a custom subroutine or function which includes some additional debug-logic. But I'm currently stuck with defining the prototype of the function/subroutine. Is this possible? If yes, how? 回答1: The title of your question exhibits a misunderstanding, though the text suggests you know better. Nevertheless, for the record, write is a Fortran statement, it is neither a subroutine nor a function. I think you have a number of options. One, which I have

How to wrap the fortran write-statement

自闭症网瘾萝莉.ら 提交于 2020-02-28 08:03:19
问题 I want to wrap the fortran write-statement in a custom subroutine or function which includes some additional debug-logic. But I'm currently stuck with defining the prototype of the function/subroutine. Is this possible? If yes, how? 回答1: The title of your question exhibits a misunderstanding, though the text suggests you know better. Nevertheless, for the record, write is a Fortran statement, it is neither a subroutine nor a function. I think you have a number of options. One, which I have

Read a file with an unknown number rows in Fortran

不问归期 提交于 2020-02-14 02:33:07
问题 Heroes the new code I used. I have tried this, and it works if I have n declared first, which is not what I want. I need to know the total number of rows (n) and use that number afterward in my simulation. However, in variable declaration I need to have the diminution of my xy(n) before reading the data and if I do that, the code does not run. the data file is two column of randomly simulated normal data lets say something like this 1 3 2 4 3 6 4 8 5 9 6 8 7 1 8 9 99 88 I tried the following

Is passing the same entity to arguments with different intent undefined behavior?

你。 提交于 2020-01-25 06:11:50
问题 module foo contains subroutine bar() integer :: i(3) i(1) = 1 i(2) = 2 i(3) = 3 call baz(i, i) end subroutine subroutine baz(a,b) integer, intent(in) :: a(:) integer, intent(inout) :: b(:) b(2) = 5 print *, a print *, b end subroutine end module program xx use foo call bar() end program In this code, I am passing the same array i to baz, binding it to arguments having different intent. Of course, when I print a , it changes. Is this undefined behavior, or it is according to specification ?

Is passing the same entity to arguments with different intent undefined behavior?

為{幸葍}努か 提交于 2020-01-25 06:10:24
问题 module foo contains subroutine bar() integer :: i(3) i(1) = 1 i(2) = 2 i(3) = 3 call baz(i, i) end subroutine subroutine baz(a,b) integer, intent(in) :: a(:) integer, intent(inout) :: b(:) b(2) = 5 print *, a print *, b end subroutine end module program xx use foo call bar() end program In this code, I am passing the same array i to baz, binding it to arguments having different intent. Of course, when I print a , it changes. Is this undefined behavior, or it is according to specification ?

Professional Fortran code development: Log file creation

陌路散爱 提交于 2020-01-24 03:53:53
问题 I have developed a Fortran code which has the following characteristics: Global variables 13 Modules with multiple subroutines Independent subroutines Using Intel MKL library for LAPACK libraries (Linear Algebra) Reading and writing text files The code has become quite big. Even though at this stage I am trying to get the correct answer, speed of execution of the code is desired. I was writing a text log file with tags such as ERROR: message or INFO: message so far. But writing too much

Professional Fortran code development: Log file creation

纵然是瞬间 提交于 2020-01-24 03:52:45
问题 I have developed a Fortran code which has the following characteristics: Global variables 13 Modules with multiple subroutines Independent subroutines Using Intel MKL library for LAPACK libraries (Linear Algebra) Reading and writing text files The code has become quite big. Even though at this stage I am trying to get the correct answer, speed of execution of the code is desired. I was writing a text log file with tags such as ERROR: message or INFO: message so far. But writing too much