[Thread Prev][Thread Next][Index]
Re: [ferret_users] Embed Ferret in Fortran program
- To: Haoguo Hu <haoguo.hu@xxxxxxxx>
- Subject: Re: [ferret_users] Embed Ferret in Fortran program
- From: Paulo Santiago <paulohsm@xxxxxxxxx>
- Date: Wed, 19 Nov 2008 14:46:08 -0300
- Cc: ferret_users@xxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=k6P+/cIJYd7a8CX42YIBe9Rncn1H7isqgIxuyB1qbLU=; b=IBs6/1wWjjpL8izrrNouZWyDqP7+EXHrTDnhwG9ZCKh2UXUmZjEKWHEZFcC1r+4R// so9yhwOYz4NnR5xpovO3hrIdpSyo6OZ38oEJ1lzzjgaZtDZHqi/mV9IN/KFUMzKWKDPd ipipmBdw+SzARU0ohAT3Ak7j30xfS6iWKRu/U=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=AlISeNWp9YEclIB7/lvJ3u4kqIjnwrUcO7M7RCE5Uxb2Th1eLxTowybeIYwmbnbFn0 XrJZbIb7lPqrYwPkS3INbLJvlFhS4vjldWJBJNGuUehRy8SBdx6NJYIk9yfQejKTAEWO IX2+rUde0tx7E464w9LK51BMiOdUXVbcqXAWE=
- In-reply-to: <492441CD.3020607@xxxxxxxx>
- References: <492441CD.3020607@xxxxxxxx>
- Sender: owner-ferret_users@xxxxxxxx
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