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
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.