|
From: Marcus K. <mo...@ca...> - 2002-03-23 13:34:02
|
Dear Ryan,
I have solved the problem by adjusting the length of the variables
which contain the field names for the vis5d fields. The field
containing the name of the vis5d variable needs to be a string of
exactly 10 characters. This solved my initial problem.
I don't know how long the string for the unit needs to be (maybe
somebody else knows this?). However I found out that if you add the
string '\0' to the string containing the unit identifier, vis5d seems
to understand this as the end of the unit string (maybe as a carriage
return?). For example if your pressure field should have the unit
'Pa', you should set the unit rather as 'Pa\0'
I create my v5d files in Fortran and I am not sure if this is a
compiler specific solution. All you need to do in Fortran is:
DO Z=1,NUMFLD
V5DUNIT(Z) = TRIM(FLDUNIT(Z))//'\0'
END DO
before you call the subroutine setunit. Sorry, I can't help you with
C either.
I hope this helps
Regards
Marcus
"Ryan K. Decker" wrote:
>
> Marcus,
>
> I am having a simalar problem with the v5dsetunits function, and the strings
> being "gluded" together, that you found a solution to in the attached email.
> Since I am not an experienced c programmer, could you further explain to me
> what you did to correct the problem with v5dsetunits.
>
> Thank you,
>
> Ryan
>
> On Monday 19 November 2001 07:22 am, you wrote:
> > Dear group members,
> >
> > I attempt to create v5d files using Portland Group Fortran on a Linux
> > machine. I use v5dcreatesimple for a regular spaced grid.
> >
> > However, the variable names seem to be not properly identified. They
> > are given as a character field in a data statement. But instead of
> > recognising the variables, P, U, V, T, Theta, PV, and SpecH,
> > it appears that the strings are being "glued" together.
> >
> > See here the output from v5dinfo:
> >
> > File format: v5d version: 4.3
> > Compression: 1 byte per gridpoint.
> > header size=11804
> > sizeof(v5dstruct)=169068
> >
> > NumVars = 7
> > Var Name Units Rows Cols Levels LowLev MinVal
> > 1 P U Pa 36 72 30 0 1000
> > 2 V m/s 36 72 30 0 -40.8064
> > 3 T T m/s 36 72 30 0 -57.8602
> > 4 eta PV K 36 72 30 0 185.118
> > 5 SpecH K 36 72 30 0 239.123
> > 6 a PVU 36 72 30 0 -207.815
> > 7 m/s g/g 36 72 30 0 0.000458169
> >
> > etc...
> >
> >
> > I had a similar problem with v5dsetunits and adding a '\0' to each
> > unit string took care of it. However this doesn't work with the
> > variable names.
> >
> > I would be very grateful for suggestions on how to solve this problem.
> >
> > Best regards
> > Marcus
>
> *********************************************************************************
> Ryan K. Decker phone: (865)-576-2326
> Research Associate fax: (865)-567-1327
> UAH/ESSC email: de...@at...
> 456 S. Illinois Ave. home page: http://vortex.nsstc.uah.edu/~decker
> PO Box 2456
> Oak Ridge, TN 37831
> ********************************************************************************
|