[Thread Prev][Thread Next][Index]

Re: [ferret_users] Embed Ferret in Fortran program



Dear Haoguo,

If you really need to do this with Fortran, I suggest you to use the full path of Ferret executable. If not, I can help you to write a simple shell script to run this loop. To get the full path for an executable in shell, try the command

which ferret

Usually you use script argument to pass a parameter to your Ferret script, e.g.:

ferret -nojnl -script my_go_file.jnl arg

Within the Ferret script you may refer to the 'arg' with

let my_arg = ($1)

This will give your variable 'my_arg' the value passed by the first argument. Within Fortran, you'll need to define a character variable composed by the command used to call the Ferret script and the loop count.

More about Ferret scripts and its arguments can be found at
http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/introduction/GO-FILES#_VPID_26

Your idea seems to be correct. Well, I didn't tested this, but I believe it should work.


Cheers,
Paulo Santiago


2008/11/19 Haoguo Hu <haoguo.hu@noaa.gov>
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



--
Paulo Henrique Santiago de Maria
Pesquisador, Grupo de Modelagem Atmosférica
Departamento de Meteorologia e Oceanografia
Fundação Cearense de Meteorologia e Recursos Hídricos

[Thread Prev][Thread Next][Index]

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

Privacy Policy | Disclaimer | Accessibility Statement