File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ define(`CALC_VARA_ACCESS_INFO',
8787 if ( ndims > PNETCDF_VAR_MAX_NDIMS )
8888 start_ndx = ndims - PNETCDF_VAR_MAX_NDIMS;
8989 for ( i = start_ndx; i < ndims; i++ ) {
90- common_access_vals [ 1+i] = count [ i] ;
90+ common_access_vals [ 1+i-start_ndx ] = count [ i] ;
9191 }
9292 }
9393 else {
9898define ( `CALC_VARS_ACCESS_INFO' ,
9999 `int ndims = rec_ref->var_rec->counters [ PNETCDF_VAR_NDIMS] ;
100100 if ( ndims > 0 ) {
101- int i , start_ndx = 0;
101+ int i , j , start_ndx = 0;
102102 $3 = count [ 0] ;
103103 for ( i = 1; i < ndims; i++ )
104104 $3 * = count [ i] ;
105105 if ( ndims > PNETCDF_VAR_MAX_NDIMS )
106106 start_ndx = ndims - PNETCDF_VAR_MAX_NDIMS;
107107 for ( i = start_ndx; i < ndims; i++ ) {
108- common_access_vals [ 1+i] = count [ i] ;
108+ j = i - start_ndx;
109+ common_access_vals [ 1+j] = count [ i] ;
109110 if ( stride )
110- common_access_vals [ 1+i +PNETCDF_VAR_MAX_NDIMS] = stride [ i] ;
111+ common_access_vals [ 1+j +PNETCDF_VAR_MAX_NDIMS] = stride [ i] ;
111112 else
112- common_access_vals [ 1+i +PNETCDF_VAR_MAX_NDIMS] = 1;
113+ common_access_vals [ 1+j +PNETCDF_VAR_MAX_NDIMS] = 1;
113114 }
114115 }
115116 else {
You can’t perform that action at this time.
0 commit comments