fortran90 Questions

6

Solved

I have the following code: program main character (len=15) :: abc = "te st tex t" print *, trim(abc) end program main Which outputs: te st tex t I excepted all the whitespace to be remo...
Sideways asked 27/11, 2014 at 22:37

3

Solved

I am trying to define a array of arrays. I have defined: integer,dimension(2,2):: & x=reshape(source= (/0,1,1,0/), shape=(/2,2/)), & y=reshape(source= (/1,0,0,1/), shape=(/2,2/)), &...
Exorbitant asked 29/10, 2013 at 21:23

4

Solved

My program is running though 3D array, labelling 'clusters' that it finds and then doing some checks to see if any neighbouring clusters have a label higher than the current cluster. There's a seco...
Windbound asked 5/12, 2011 at 11:11

5

Solved

I am writing some simple output in fortran, but I want whitespace delimiters. If use the following statement, however: format(A20,ES18.8,A12,ES18.8) I get output like this: p001t0000 3.49141273...
Presnell asked 28/12, 2010 at 21:49

4

Solved

I am wanting to mask a Fortran array. Here's the way I am currently doing it... where (my_array <=15.0) mask_array = 1 elsewhere mask_array = 0 end where So then I get my masked array with:...
Gentlemanatarms asked 20/2, 2015 at 19:51

7

I have seen /* block comment */ for block commenting in C++. I know I can do line commenting by using ! or c, but is there any option for block commenting in Fortran?
Guilford asked 26/2, 2014 at 18:24

2

Solved

In Fortran, is it possible to define a function which returns multiple values like below? [a, b] = myfunc(x, y)
Brackish asked 9/5, 2016 at 15:56

4

Solved

Good practice dictates that subroutine arguments in Fortran should each have a specified intent (i.e. intent(in), intent(out) or intent(inout) as described this question): subroutine bar (a, b) r...
Leanora asked 21/5, 2010 at 8:26

2

Solved

Define an array in Fortran: real, dimension(a,b) :: matrix How do I obtain a and b given matrix?
Offutt asked 4/3, 2014 at 17:31

3

Solved

I would like to program some procedure that will work with different types. I am planning to use the "include" method used in flibs described here and here. I give here a simple exemple. ! ------...
Kincardine asked 5/6, 2014 at 15:46

3

Is there an intrinsic in Fortran that generates an array containing a sequence of numbers from a to b, similar to python's range() >>> range(1,5) [1, 2, 3, 4] >>> range(6,10) [6...
Rebeckarebeka asked 14/1, 2011 at 14:0

2

Solved

I need to use dynamical arrays in Fortran 90 for cases when I can't predict exact size of array initially. So I wrote a code, which should expand allocatable array each time new element is added to...
Doralia asked 20/1, 2015 at 14:59

2

Solved

I do not understand the behavior of the present() intrinsic function with pgf90 7.2. I wrote a 20 line sample program to test this, but the results still make no sense to me. Observe: subroutine ...
Shabby asked 25/6, 2010 at 22:56

3

Solved

Is there possibility to use indexing directly on a function's return value? Something like this: readStr()(2:5) where readStr() is a function which returns a character string or an array. In many ...
Dominican asked 27/2, 2015 at 10:28

1

Solved

I understand that some languages combine elements for many different paradigms in programming. I'm told that Fortran is an example of a Functional language, however I'm just a little confused as to...

2

Solved

I am trying to use trim/adjustl for the following code. It seems that I'm getting either X_eq_ 10.0.dat or X_eq_10.0 .dat as the output file's name where I'm expecting it to be X_eq_10.0.dat (no bl...
Peter asked 14/9, 2019 at 19:24

5

Solved

How do you format a string to have constant width and be left-justified? There is the Aw formatter, where w denotes desired width of character output, but it prepends the spaces if w > len(chara...
Wellmeaning asked 11/12, 2017 at 21:41

4

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...
Dutra asked 22/10, 2013 at 16:43

2

Solved

I can call compile this fortran code 'test.f90' subroutine test(g,o) double precision, intent(in):: g double precision, intent(out):: o o=g*g end subroutine with gfortran -shared -fPIC test.f90...
Rosalynrosalynd asked 3/10, 2016 at 22:23

2

I know that IACHAR(s) returns the code for the ASCII character in the first character position of the string s, but I need to convert the entire string to an integer. I also have a few number of st...
Smoodge asked 5/6, 2014 at 23:14

3

Solved

Experience: fortran for about 3 months python - intermediate : never used the ctypes module in python before this I was looking for a way to use the fortran code for my doctoral work in python - s...
Moraceous asked 8/4, 2013 at 9:20

1

Solved

Compiling with gfortran --version == GNU Fortran (Homebrew GCC 8.2.0) 8.2.0 When I write the following test code I get the functions MOD and MODULO giving the same results. However, as I understan...
Diagnostician asked 28/11, 2018 at 21:37

2

Solved

I'm trying to get a fortran 90 application to open a fifo and write formatted data to it. I've stripped this down to a minimal example. Let foo.f90 be the following program: program foo open(1,fi...
Novation asked 2/8, 2012 at 15:11

2

Solved

Believe it or not, that title is about as short as I could make it and still describe the problem I'm having! So here's the scenario: I'm calling a Fortran DLL from VBA, and the DLL uses user-defin...
Kendry asked 22/9, 2018 at 0:36

2

Solved

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 setti...
Estep asked 17/8, 2018 at 10:46

© 2022 - 2025 — McMap. All rights reserved.