fortran

Fortran array input

三世轮回 提交于 2021-02-11 05:13:42
问题 I haven't done any Fortran programming for year and it seems I'm rather rusty now. So, I won't provide you with all my failed attempts but will humbly ask you to help me with the following. I've got the following "input" file 1 5 e 4 A b & 1 c Z ; b y } " N t r ' + It can have more columns and/or rows. I would now like to assign each of these ASCII characters to arrays x(i,j) so that I can process them further after ICHAR conversions. In this example i=1,4, j=1,5, but it can be any No

Fortran array input

↘锁芯ラ 提交于 2021-02-11 05:11:34
问题 I haven't done any Fortran programming for year and it seems I'm rather rusty now. So, I won't provide you with all my failed attempts but will humbly ask you to help me with the following. I've got the following "input" file 1 5 e 4 A b & 1 c Z ; b y } " N t r ' + It can have more columns and/or rows. I would now like to assign each of these ASCII characters to arrays x(i,j) so that I can process them further after ICHAR conversions. In this example i=1,4, j=1,5, but it can be any No

Fortran array input

瘦欲@ 提交于 2021-02-11 05:08:27
问题 I haven't done any Fortran programming for year and it seems I'm rather rusty now. So, I won't provide you with all my failed attempts but will humbly ask you to help me with the following. I've got the following "input" file 1 5 e 4 A b & 1 c Z ; b y } " N t r ' + It can have more columns and/or rows. I would now like to assign each of these ASCII characters to arrays x(i,j) so that I can process them further after ICHAR conversions. In this example i=1,4, j=1,5, but it can be any No

Parallel program giving error “Undefined reference to _Kmpc_ok_to_fork”

一世执手 提交于 2021-02-10 22:42:19
问题 I am trying to compile the OPENMP fortran code on linux. I have around 230 subroutines. The code I used to compile the code is as follows: 1) At first I compiled each subroutine with the following command ifort -c -override-limits -openmp *.for Then all the subroutines have now a separate object file. 2) Then I tried to compile the object files to the executable by the following command ifort *.o -o myprogram I got the following error : WINDWAVE.F90:(.text+0x1c9d): undefined reference to `_

using allocatable arrays from modules in f2py

纵然是瞬间 提交于 2021-02-10 20:47:57
问题 I'm having issues with allocatable arrays in f2py . In the code below (stored in mymod.f90 ), I created two modules, vars and worker : vars stores and allocates the array b worker contains subroutines to work with this array from vars . The first worker -subroutine adds a scalar to b . This works as expected. The problem is with the next routine that should add a vector of matching first dimension to the array b . The implemented subroutine add_vector2 works, but needs the dimension of the

using allocatable arrays from modules in f2py

感情迁移 提交于 2021-02-10 20:43:36
问题 I'm having issues with allocatable arrays in f2py . In the code below (stored in mymod.f90 ), I created two modules, vars and worker : vars stores and allocates the array b worker contains subroutines to work with this array from vars . The first worker -subroutine adds a scalar to b . This works as expected. The problem is with the next routine that should add a vector of matching first dimension to the array b . The implemented subroutine add_vector2 works, but needs the dimension of the

How to get command line arguments in OpenVMS Fortran?

送分小仙女□ 提交于 2021-02-10 18:23:12
问题 I need to realize c-code in fortran 90 standard and stopped on next problem. How get and use command line arguments. I found GET_COMMAND_ARGUMENT getarg But it doesn't work in the openvms system with fortran 90 compiler. There is another way to get command line arguments in Fortran? Example in C int main(int argc, char **argv) { if (argc > 1) .... } Example (which doesn't work " ILINK-W-NUDFSYMS, 2 undefined symbols: %ILINK-I-UDFSYM, GETARG %ILINK-I-UDFSYM, IARGC %ILINK-W-USEUNDEF, undefined

How to get command line arguments in OpenVMS Fortran?

狂风中的少年 提交于 2021-02-10 18:19:53
问题 I need to realize c-code in fortran 90 standard and stopped on next problem. How get and use command line arguments. I found GET_COMMAND_ARGUMENT getarg But it doesn't work in the openvms system with fortran 90 compiler. There is another way to get command line arguments in Fortran? Example in C int main(int argc, char **argv) { if (argc > 1) .... } Example (which doesn't work " ILINK-W-NUDFSYMS, 2 undefined symbols: %ILINK-I-UDFSYM, GETARG %ILINK-I-UDFSYM, IARGC %ILINK-W-USEUNDEF, undefined

Why my parallel code using openMP atomic takes a longer time than serial code?

时光毁灭记忆、已成空白 提交于 2021-02-10 15:51:01
问题 The snippet of my serial code is shown below. Program main use omp_lib Implicit None Integer :: i, my_id Real(8) :: t0, t1, t2, t3, a = 0.0d0 !$ t0 = omp_get_wtime() Call CPU_time(t2) ! ------------------------------------------ ! Do i = 1, 100000000 a = a + Real(i) End Do ! ------------------------------------------ ! Call CPU_time(t3) !$ t1 = omp_get_wtime() ! ------------------------------------------ ! Write (*,*) "a = ", a Write (*,*) "The wall time is ", t1-t0, "s" Write (*,*) "The CPU

show fortran function names in svn diff

夙愿已清 提交于 2021-02-10 13:15:42
问题 I've learned that if I place *.f90 diff=fortran in ~/.config/git/attributes, then git diff shows fortran subroutine/function names in the hunk headers. Do you know how to achieve this for svn diff? There is a svn option -x -p for C functions, but I haven't figured out a corresponding option for fortran. Thanks 来源: https://stackoverflow.com/questions/37062339/show-fortran-function-names-in-svn-diff