[Thread Prev][Thread Next][Index]
Re: [ferret_users] Embed Ferret in Fortran program
| I try to embed Ferret in Fortran program when debugging, here is an example:
|
| !----Begin Fortran program----------------------------
| program main !Fortran call Ferret
| integer istep
| do istep = 1,5
| !----------
| call system("ferret -nojnl -script plot.jnl")
| enddo
| end
| !----End Fortran program-------------------------------
|
|
| plot.jnl
| !----Begin plot.jnl------------------------------------
| use "coads_climatology"
| fill/k=1/l=1 sst
| spawn sleep 10s !pause for viewing and changing the L=2,3,..
| !----End plot.jnl--------------------------------------
|
| I can change the "L=1,2,3,.." in plot.jnl manually.
| The questions are:
| 1. How to make "L=istep" happen automatically?
You can do this following Paulo's idea: Make your Ferret script accept
an argument indicating the timestep.
| 2. How to let the Ferret window open only once and the plotting keep
| going with "istep"?
I don't think you can do this, in a simple way. (For the sake
of completeness, I'd like to mention that a named-pipe trick
may work.) Each time the "system" subroutine is called,
Ferret starts and ends.
But, I recommend you try to exploit Ferret's capability as much as
possible before resorting to scripting using other languages.
>From your description, I guess what you want is
use "coads_climatology"
repeat/l=1:5 (fill/k=1 sst; \
spawn sleep 10s \ !pause for viewing and changing the L=2,3,..
)
Ryo
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Privacy Policy | Disclaimer | Accessibility Statement