[Thread Prev][Thread Next][Index]

Re: [ferret_users] Embed Ferret in Fortran program



Hi -
You can pass arguments to Ferret when you're running it with -script, for instance,

   ferret -nojnl -script plot.jnl 5

Then plot.jnl needs to get that argument, and use it in the commands. In the script, argument 1 is $1, as follows,


   !----Begin plot.jnl------------------------------------
     use "coads_climatology"
     fill/k=1/l=$1 sst

When running Ferret from your fortran program, this might require writing the ferret call to a string variable, so that you can write the value of istep to that string. I have not tested this but there must be a way to send that string into the CALL SYSTEM command.


Ansley


Haoguo Hu wrote:
Dear Ferret-eers,

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?
2. How to let the Ferret window open only once and the plotting keep going with "istep"?


Thanks


HH


[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement