Dear all,
Thank you for your previous responses.
I wrote a perl script which clears comments (text following '#' in any line) and empty lines from a fortran input file.
Some of my inputs are very lengthy so I write comments followed by '#'. Before using the input as such, I use the script to...
@GerritGroot:
Yes. Assigning the whole 3-D arrays to zero and then reading the indices for non-zero values and then the values themselves solves the problem. Thanks to mikrom and GerritGroot.
Note: I did the same also for the case involving floating point values for x, y, z grid coordinates as...
@mikrom:
IMHO: What you posted could not work.
1)
In one loop you are using step_x:
do x = x_min, x_max, step_x
...
but in the other loop you are using stepx:
do ind_x = x_min, x_max, stepx
The first code was my guess, I think this how the program I had used gave me only non-zero data. This...
@GerritGroot:
Let me define the problem through the example which I had posted.
I have the grid data
# X Y Z data(X,Y,Z)
1 1 3 0.1
1 2 1 0.2
1 3 2 0.1
1 3 3 0.4
2 1 2 0.5
3 1 1 0.3
3 3 1 0.4
N_data = 7
For 3 grids along x, y, z there...
Here is an example
Actual data for
x_min = y_min = z_min = 1
x_max = y_max = z_max = 3
step_x = step_y = step_z = 1
This is what I want
# X Y Z data(X,Y,Z)
1 1 1 0
1 1 2 0
1 1 3 0.1
1 2 1 0.2
1 2 2 0
1 2 3 0
1 3 1 0
1 3 2 0.1...
Dear all,
I have a grid based data which is a 3-D array
data(N1,N2,N3)
where
N1 = (x_max - x_min + step_x) / step_x
N2 = (y_max - y_min + step_y) / step_y
N3 = (z_max - z_min + step_z) / step_z
x_min is the minimum value for the x-coordinate
x_max is the maximum value for the x-coordinate...
I think I used a legacy f77 compiler that came with a linux distribution. A friend of mine later told that he could he could run the code using g77 after 1 or 2 changes.
About this issue, the following link may have some useful info
http://www.eng-tips.com/viewthread.cfm?qid=192717
Dear all,
In a code which I have been trying to generalize,
I have an array of integers for ex.,
A = [1, 2, 3]
then I have multiple do loops as
do i1 = 1, A(1)
do i2 = 1, A(2)
do i3 = 1, A(3)
...
...
enddo
enddo
enddo
I want to generalize this code so that...
Hi ArkM,
Including error msgs in a Fortran code unnecessarily makes the code lengthy. I found the following cpp code on the net and like to know if it can be used in a Fortran code.
#if FPP_NODEBUG
# define ASSERT(expr) if(.not.(expr))call ASSERT_FAILED(__STRING(expr),__FILE__,__LINE__)
#...
Hi,
I am looking for a way to use the c++ ASSERT function in a fortran code like for ex.,
allocate (a(10,10), stat=memstat)
ASSERT(memstat==0)
I am looking for a way to define the 'ASSERT' function in a header file and include some error msg with line numbers etc. and use it. Can any body...
Hi,
I think this thread will help you.
http://www.tek-tips.com/viewthread.cfm?qid=1495743&page=1
You may try to compile and run the program as mentioned in the thread.
- raghu
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.