[Thread Prev][Thread Next][Index]

external functions



Hi all;

I'm working on a 4th order Runge-Kutta based float tracking algorythm for
our ocean model output, and will probably use a ferret external function
to do it.  I've got a question I think I know the answer to, but I don't
like the answer, so I thought I'd try to get a better one.

I'm imagining repeated calls like:
float_tracker(X_pos, Y_pos, Z_pos, U_vel, V_vel, Z_vel, dt)
where X_pos, Y_pos, and Z_pos are scalar positions that would be updated
according to U_vel, V_vel, and Z_vel, which are all 3-D fields.  In the
future, I plan tracking multiple floats by making X_pos[i], etc., where
each i is a separate float.

However, my reading of the external function documentation indicates that
only 1 result value can be returned, and that there is no ability to
return all 3 updated X_pos, Y_pos, and Z_pos values back to the calling
ferret script for plotting, etc.  Is that correct?

I have to work with all 3 at the some time due to the details of the
Runge-Kutta method - i.e. I can't make 3 calls, one for each dimension.
I could combine the 3 positions into a single position vector which I 
think could be updated and returned like this:
let new_position =float_tracker(position[x=X_pos,y=Y_pos,z=Z_pos],U_vel...)
let position = `new_position`
But how could I then track multiple floats?

I imagine I can work around this by writing the positions out to a file,
then reading that file into ferret for plotting.  Can anyone with more
experience in external functions think of a better way?

Thanks,
Liz

*********************
Elizabeth L. Dobbins
Research Scientist
JISAO/PMEL
phone: (206) 526-4581

Fine words butter no parsnips.



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement