jason_paul <
j2p...@gmail.com> wrote:
> hi, i am an undergrad student workin on my thesis in CFD.
> i need some help in developing a fortran code similar to one
> posted for matching data for matching integer data
> i have one data set (X Y Z A)
(snip)
> and anothr data set (X Y Z B)
(snip)
> here i am working with real numbers so cant use "==" for
Well, you can but you might get the wrong answer.
> matching X Y Z in the two data sets... also the data in x Y Z
> are not exactly equal so have to set some tolerance...
> kindly help me in this matter the required output is
Not so long ago, someone else asked about a similar problem,
though the data was in the form
A X Y Z
and
X Y Z B
It is a pretty easy change to make.
(And that person didn't say it was for an UG project.)
My first suggestion was to do it in AWK, but that normally does
a string match, not a numerical match. You can convert it to do
a numerical match, though.
Later, I made a Fortran suggestion that finds the closest match.
There is a Fortran function to find a matching element in an
array, but not a matching row or column in a 2D matrix.
Finding the closest match was one way to get around that problem,
and also gets around the exact match floating point problem.
You should be sure to understand how it works before using it.
For undergrad programs especially, you need to have them well
commented. You can't do that if you don't understand how it
works.
Look back last week, it should be there.
-- glen