[Thread Prev][Thread Next][Index]

Re: Net CDF to ASCII or binary



Hi Grigory,

	Phew, interesting questions.

First, yes ferret can easily transform between NetCDF and ASCII or binary. Just
"USE" the NetCDF file, and then use the "LIST/FILE/FORMAT" command. See the
manual for exact details, but here is an example.

yes? use mydata		                              ! NetCDF file
yes? list/file=mydata.dat/format=(20F5.2) myvar       ! ASCII Output
	or
yes? list/file=mydata.unf/format=UNF myvar            ! Binary Output

The second question made me think. I don't know if this would work but you
could try something like:

<myprog.f>

  .
  .
  (bunch of ForTran commands)
  .
  .
  call system('ferret < FerretCommands > FerretOutput')
  .
  .
  (more ForTran commands)
  end

where FerretCommands is a file containing ferret commands and ending in quit,
and FerretOutput is a file that gets the ferret output. This sounds
interesting, and I might have to try it.

Of course, this might not work. I know that the Ferret Live Action Data Server
(see the ferret home page - it's way cool) uses pipes via a c program to do
this. The above way might work - slightly modified - since the ferret program
might not terminate and return control to the ForTran program. A possible
modification (with simplicity the chief modus):

    call system('ferret < FerretCommands > FerretOutput&')
! I think this backgrounds the command - I forget, but there is a way
! Now look for a file that FerretCommands tells ferret to write
100 inquire(file='ferret.done',exist=fdone)
    if (fdone) then
        call system('/etc/killall ferret')
    else
        goto 100
    endif

You could put a delay statement before the  goto 100 so that you aren't burning
up so much CPU time waiting.

I might try this, and if so will report to the Ferret group, maybe someone else
will (Grigory?), or maybe Steve Hankin has something better.

	Mark

-- 
-------------------------------------------------------------------------------

	      Mark Verschell (verschell@coaps.fsu.edu)
	      Center for Ocean and Atmospheric Prediction Studies
	      Florida State University
              2035 E. Paul Dirac Drive
              R.M. Johnson Bldg. - Suite 200
	      Tallahassee, FL  32306-3041
	      (904) 644-6532              (904) 644-4841 (fax)


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement