Problems With CDF on a Cray at ucar

I am experiencing the following problem when running a cdf program
on a cray  Any help that can be given is greatly appreciated...

Thanks in advance.

----------
debug:[main]    about to call intonet() after 1010
debug:[intonet] ncid=0  chi=1
Operand range error

 Beginning of Traceback:
  Started from address 30626a in routine 'NC_hlookupvar'.
  Called from line 717 (address 24310d) in routine 'NCvario'.
  Called from line 896 (address 25143a) in routine 'ncvarput'.
Operand range error (core dumped)
---------

The routine runs fine on an IBM RS-6000, but has nightmares on the cray.
Although I didnt write the routine being used, I cannot find any serious
errors in the source.  The strangest part is that when I went to attempt
to clean up the routine,  I changed the subroutine to make use of the same
temp variable (instead of having 2 duplicate variables (one for each case)).
I converted it to use the same temp variable and removed the declaration of the
extra variable.  When these LOCAL variable changes where made, the program
still compiles properly yet it dumps a 33M core file before it ever gets
past variable declarations in the main program.  This really has me stumped,
so any ideas, suggestions, or comments are appreciated.  The main program
is a FORTRAN program that calls a couple of C functions for dealing with
the cdf files.

The "intonet" function is as follows: 
IX=73 JX=61 KX=30
*chi = 1, *ncid = 0, *id = 0

------------------------- 
int INTONET(int *ncid,int *id,float dat1[ix][jx],float dat2[kx][ix][jx],
            float dat3[kx][ix][jx],int *chi,int *jtme)
{
int i,k,j,l;
float value,temp[itime][ix][jx],temp2[itime][kx][ix][jx];
float temp3[itime][kx][ix][jx];
FILE *f;
char ncfil[51];
long corner[]={0,0,0,0},edges[]={itime-1,kx-1,ix-1,jx-1};
f=fopen(".filename","r");
fread(&ncfil,1,50,f);
fclose(f);
ncid[0]=ncopen(ncfil,NC_WRITE);
printf(" %d\n",id[0]);
if (chi[0]==1){
  ncvarget(ncid[0],id[0],corner,edges,(void *) temp2);
  for(k=0;k<kx;k++){
   for(i=0;i<ix;i++){
    for(j=0;j<jx;j++){
     temp2[jtme[0]-1][k][i][j]=dat2[k][i][j];
    }
   }
  }
  ncvarput(ncid[0],id[0],corner,edges,(void *) temp2);
}
if (chi[0]==2){
  edges[1]=ix;
  edges[2]=jx;
  ncvarget(ncid[0],id[0],corner,edges,(void *) temp);
  for(i=0;i<ix;i++){
   for(j=0;j<jx;j++){
    temp[jtme[0]-1][i][j]=dat1[i][j];
   }
  }
  ncvarput(ncid[0],id[0],corner,edges,(void *) temp);
}
if (chi[0]==3){
  ncvarget(ncid[0],id[0],corner,edges,(void *) temp3);
  for(k=0;k<kx;k++){
   for(i=0;i<ix;i++){
    for(j=0;j<jx;j++){
     temp3[jtme[0]-1][k][i][j]=dat3[k][i][j];
    }
   }
  }
  ncvarput(ncid[0],id[0],corner,edges,(void *) temp3);
}
edges[0]=ix-1;
edges[1]=jx-1;
if (chi[0]==4){
ncvarput(ncid[0],id[0],corner,edges,(void *) dat1);
}
ncclose(ncid[0]);
return 1;
}
---------------------------------


Thanks again,
        DannyM

-- 
_______________________________________________________________________________

                DannyM  -- National Severe Storms Laboratory.
_______________________________________________________________________________
Everything that I post is of my personal opinion, and not that of my employer!



  • 1995 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: