fbinrecwrite problem

From: James Done (done AT sago2.mmm.ucar.edu)
Date: Fri Sep 09 2005 - 09:54:39 MDT


I'm having a problem writing binary files using fbinrecwrite

I would like to write 4 records. The first three contain metadata and the
last one is a 2d array. I would like each of the first three records to
contain multiple variables of different type (ie float, string etc). I
can't seem to be able to write different types to the same record. I see
in one of the examples that if my variables were of the same type then I
could put them in an array and write the array in one fbinrecwrite
statement, but this isn't possible for variables of different types.

So far I have:

  fbinrecwrite ("ozone01", 0, version )
  fbinrecwrite ("ozone01", 1, hdate )
  fbinrecwrite ("ozone01", 1, xfcst )
  fbinrecwrite ("ozone01", 1, source )
  fbinrecwrite ("ozone01", 1, field )
  fbinrecwrite ("ozone01", 1, units )
  fbinrecwrite ("ozone01", 1, description )
  fbinrecwrite ("ozone01", 1, level )
  fbinrecwrite ("ozone01", 1, nx )
  fbinrecwrite ("ozone01", 1, ny )
  fbinrecwrite ("ozone01", 1, proj_flag )
  fbinrecwrite ("ozone01", 2, startloc )
  fbinrecwrite ("ozone01", 2, startlat )
  fbinrecwrite ("ozone01", 2, startlon )
  fbinrecwrite ("ozone01", 2, deltalat )
  fbinrecwrite ("ozone01", 2, deltalon )
  fbinrecwrite ("ozone01", 3, oz_ip2(0,35,:,:) )

I get an error when I try to write to the same record twice. The error is:

warning:fbinrecwrite: end of file reached before record number, writing
record as last record in file
fatal:Execute: Error occurred at or near line 172 in file ozone.ncl

I have also tried the -1 option for each fbinrecwrite statement but I end
up with 17 records instead of 4.

Hope you can help,

Thanks,
James Done

_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk



This archive was generated by hypermail 2b29 : Mon Sep 12 2005 - 13:57:00 MDT