gfortran

Fortran array input

本小妞迷上赌 提交于 2021-02-11 05:15:59
问题 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: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

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

Fortran: passing arbitrary “structures” to a module subroutine

﹥>﹥吖頭↗ 提交于 2021-02-08 04:41:40
问题 I'm trying to write a general use subroutine for minimization. As I want to have a general purpose subroutine, the objective functions can have different parameters, not just in names, but in dimensions too. So I need a way to pass that parameter structure (I'm using the word structure because my idea is to use something like a structure type variable in Matlab). I managed to use the derived data type, which worked just fine, but the problem arises when I have two different objective

Fortran: passing arbitrary “structures” to a module subroutine

眉间皱痕 提交于 2021-02-08 04:41:05
问题 I'm trying to write a general use subroutine for minimization. As I want to have a general purpose subroutine, the objective functions can have different parameters, not just in names, but in dimensions too. So I need a way to pass that parameter structure (I'm using the word structure because my idea is to use something like a structure type variable in Matlab). I managed to use the derived data type, which worked just fine, but the problem arises when I have two different objective

Passing both scalars and arrays (of any dimensions) from Fortran to C

别说谁变了你拦得住时间么 提交于 2021-02-07 19:14:27
问题 I have the following Fortran subroutine named show_value that calls a C function named show_value : INTERFACE SUBROUTINE show_value(variable) BIND(C, name = "show_value") USE, INTRINSIC :: iso_c_binding TYPE(*) :: variable END SUBROUTINE END INTERFACE The C function show_value : void show_value(const void *variable) { printf("%d\n", *(int *) variable); } The Fortran subroutine works well when passing scalars to it. Example: INTEGER :: x x = 12 call show_value(x) This will call the C function

Passing both scalars and arrays (of any dimensions) from Fortran to C

丶灬走出姿态 提交于 2021-02-07 19:12:59
问题 I have the following Fortran subroutine named show_value that calls a C function named show_value : INTERFACE SUBROUTINE show_value(variable) BIND(C, name = "show_value") USE, INTRINSIC :: iso_c_binding TYPE(*) :: variable END SUBROUTINE END INTERFACE The C function show_value : void show_value(const void *variable) { printf("%d\n", *(int *) variable); } The Fortran subroutine works well when passing scalars to it. Example: INTEGER :: x x = 12 call show_value(x) This will call the C function