q dims problem

Jennifer Adams jma at COLA.IGES.ORG
Fri Feb 23 11:16:09 EST 2007


On Feb 23, 2007, at 10:06 AM, Hai-Ru Chang wrote:

> Hello everybody!
>                      I have a opteron workstation with the
> following architecture:
>
>
>                     Linux master 2.6.17-ck1-suse101-osmp #264 SMP
> Tue Oct 3 16:44:26 EDT 2006 x86_64 x86_64 x86_64 GNU/Linux.
>
>
> When I issued the 'q dims' command inside grads,   I saw the
> following output
>
> Default file number is: 1
> X is varying   Lon = 147.258 to 232.741   X = 1.00002 to 89
> Y is varying   Lat = -39.2537 to 39.2511   Y = 1 to 89
> Z is fixed     Lev = 1000  Z = 1
> T is fixed     Time = 12Z01JUL30064773072  T = 1
>
>
> There are two errors in the output.  First, the lower limit of x is
> 1.00002 instead of 1.
This is a precision issue because your lat/lon grid increment is
small. This is mostly harmless -- doesn't affect displays, is usually
only a problem when using set gxout fwrite.

> Second, the year on the time line is totally wrong.  I used
> Portland group compiler to build up the software from source.
> Does any one know how to fix the problem?
This is a bug that appears on 64-bit linux systems. It has been
fixed. Since you are building from source, you can edit the
subroutine gat2ch in gautil.c. There were substitution strings for
long integers ("%l") in the sprintf statements that should be regular
integers ("%i")

int gat2ch (struct dt *dtim, int tinc, char *ch) {
int mn1,mn2,hr1,hr2,dy1,dy2,len,mnth;

   mnth = dtim->mo - 1L;
   mn1 = dtim->mn/10L;
   mn2 = dtim->mn - (mn1*10);
   hr1 = dtim->hr/10L;
   hr2 = dtim->hr - (hr1*10);
   dy1 = dtim->dy/10L;
   dy2 = dtim->dy - (dy1*10);
   if (tinc==1) {
     sprintf(ch,"%04i",dtim->yr);
   }
   else if (tinc==2) {
     if (dtim->yr==9999L) {
       sprintf(ch,"%s",monc[mnth]);
     } else {
       sprintf(ch,"%s%04i",monc[mnth],dtim->yr);
     }
   }
   else if (tinc==3) {
     sprintf(ch,"%i%i%s%04i",dy1,dy2,monc[mnth],dtim->yr);
   }
   else if (tinc==4) {
     sprintf(ch,"%i%iZ%i%i%s%04i",hr1,hr2,dy1,dy2,
           monc[mnth],dtim->yr);
   }
   else if (tinc==5) {
     sprintf(ch,"%i%i:%i%iZ%i%i%s%04i",hr1,hr2,mn1,mn2,dy1,dy2,
           monc[mnth],dtim->yr);
   }
   else sprintf(ch,"???");
   len=0;
   while (ch[len]) len++;
   return (len);
}


--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20070223/53b9b412/attachment.html 


More information about the gradsusr mailing list