[Thread Prev][Thread Next][Index]
Re: [ferret_users] Embed Ferret in Fortran program : A Solution
Hi Haoguo,
| I do not like the Ferret window keep opening and closing, and it
| also waste 2 seconds on sleeping (without sleeping you can see
| nothing), but it is something better than nothing.
|
| I'm not sure whether or not there is some way Fortran and Ferret can
| know each other, interactive communicating will make the Ferret more
| powerful.
The named-pipe trick I mentioned would help here.
Basically, you run
$ mkfifo mypipe.jnl # creates a named pipe.
$ sleep 999999999 > mypipe.jnl & # keeps the pipe from closing.
$ ferret -script mypipe.jnl < /dev/null &
from somewhere. ( "$" is the shell prompt. )
Effectively, you have set up a Ferret "server".
Then, you can control the Ferret server
by sending messages to it, that is, by
writing to the named pipe. For example,
you can see what I mean by typing
$ echo "use levitus_climatology" > mypipe.jnl
$ echo "fill/k=1/l=1 temp" > mypipe.jnl
$ echo "quit" > mypipe.jnl
Don't forget to delete the pipe or to kill the sleep process
when you are done with the server. (You can write a simple
script which takes care of all that.)
Regards,
Ryo
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Privacy Policy | Disclaimer | Accessibility Statement