Commit 17f32270 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Replace x.data() of vector by &x[0].

parent d8dc421b
...@@ -591,7 +591,7 @@ void *Samplegridicon(void *argument) ...@@ -591,7 +591,7 @@ void *Samplegridicon(void *argument)
double missval = vlistInqVarMissval(vlistID1, varID); double missval = vlistInqVarMissval(vlistID1, varID);
samplegrid(missval, nsamplegrids, cellindex.data(), array1, array2, array3); samplegrid(missval, nsamplegrids, &cellindex[0], array1, array2, array3);
nmiss = 0; nmiss = 0;
for ( long i = 0; i < gridsize2; ++i ) for ( long i = 0; i < gridsize2; ++i )
......
...@@ -231,7 +231,7 @@ void *Vertintap(void *argument) ...@@ -231,7 +231,7 @@ void *Vertintap(void *argument)
int nlev = zaxisInqSize(zaxisIDh); int nlev = zaxisInqSize(zaxisIDh);
if ( nlev != nhlev ) cdoAbort("Internal error, wrong number of height level!"); if ( nlev != nhlev ) cdoAbort("Internal error, wrong number of height level!");
std::vector<double> levels(nlev); std::vector<double> levels(nlev);
cdoZaxisInqLevels(zaxisIDh, levels.data()); cdoZaxisInqLevels(zaxisIDh, &levels[0]);
for ( int ilev = 0; ilev < nlev; ++ilev ) for ( int ilev = 0; ilev < nlev; ++ilev )
{ {
...@@ -258,13 +258,13 @@ void *Vertintap(void *argument) ...@@ -258,13 +258,13 @@ void *Vertintap(void *argument)
if ( operfunc == func_hl ) if ( operfunc == func_hl )
{ {
std::vector<double> phlev(nplev); std::vector<double> phlev(nplev);
height2pressure(phlev.data(), plev, nplev); height2pressure(&phlev[0], plev, nplev);
if ( cdoVerbose ) if ( cdoVerbose )
for ( int i = 0; i < nplev; ++i ) for ( int i = 0; i < nplev; ++i )
cdoPrint("level = %d height = %g pressure = %g", i+1, plev[i], phlev[i]); cdoPrint("level = %d height = %g pressure = %g", i+1, plev[i], phlev[i]);
memcpy(plev, phlev.data(), nplev*sizeof(double)); memcpy(plev, &phlev[0], nplev*sizeof(double));
} }
if ( opertype == type_log ) if ( opertype == type_log )
......
...@@ -201,7 +201,7 @@ void *Vertintml(void *argument) ...@@ -201,7 +201,7 @@ void *Vertintml(void *argument)
int nlev = zaxisInqSize(zaxisIDh); int nlev = zaxisInqSize(zaxisIDh);
if ( nlev != nhlev ) cdoAbort("Internal error, wrong number of hybrid level!"); if ( nlev != nhlev ) cdoAbort("Internal error, wrong number of hybrid level!");
std::vector<double> levels(nlev); std::vector<double> levels(nlev);
cdoZaxisInqLevels(zaxisIDh, levels.data()); cdoZaxisInqLevels(zaxisIDh, &levels[0]);
for ( int ilev = 0; ilev < nlev; ++ilev ) for ( int ilev = 0; ilev < nlev; ++ilev )
{ {
...@@ -228,13 +228,13 @@ void *Vertintml(void *argument) ...@@ -228,13 +228,13 @@ void *Vertintml(void *argument)
if ( operfunc == func_hl ) if ( operfunc == func_hl )
{ {
std::vector<double> phlev(nplev); std::vector<double> phlev(nplev);
height2pressure(phlev.data(), plev, nplev); height2pressure(&phlev[0], plev, nplev);
if ( cdoVerbose ) if ( cdoVerbose )
for ( int i = 0; i < nplev; ++i ) for ( int i = 0; i < nplev; ++i )
cdoPrint("level = %d height = %g pressure = %g", i+1, plev[i], phlev[i]); cdoPrint("level = %d height = %g pressure = %g", i+1, plev[i], phlev[i]);
memcpy(plev, phlev.data(), nplev*sizeof(double)); memcpy(plev, &phlev[0], nplev*sizeof(double));
} }
if ( opertype == type_log ) if ( opertype == type_log )
......
...@@ -326,7 +326,7 @@ bool cdiInqAttConvertedToFloat(int gridID, int atttype, const char *attname, int ...@@ -326,7 +326,7 @@ bool cdiInqAttConvertedToFloat(int gridID, int atttype, const char *attname, int
if ( atttype == CDI_DATATYPE_INT32 ) if ( atttype == CDI_DATATYPE_INT32 )
{ {
std::vector<int> attint(attlen); std::vector<int> attint(attlen);
cdiInqAttInt(gridID, CDI_GLOBAL, attname, attlen, attint.data()); cdiInqAttInt(gridID, CDI_GLOBAL, attname, attlen, &attint[0]);
for ( int i = 0; i < attlen; ++i ) attflt[i] = (double)attint[i]; for ( int i = 0; i < attlen; ++i ) attflt[i] = (double)attint[i];
} }
else if ( atttype == CDI_DATATYPE_FLT32 || atttype == CDI_DATATYPE_FLT64 ) else if ( atttype == CDI_DATATYPE_FLT32 || atttype == CDI_DATATYPE_FLT64 )
......
...@@ -725,8 +725,8 @@ void remap_conserv_weights(remapgrid_t *src_grid, remapgrid_t *tgt_grid, remapva ...@@ -725,8 +725,8 @@ void remap_conserv_weights(remapgrid_t *src_grid, remapgrid_t *tgt_grid, remapva
enum yac_edge_type lonlat_circle_type[] = {LON_CIRCLE, LAT_CIRCLE, LON_CIRCLE, LAT_CIRCLE, LON_CIRCLE}; enum yac_edge_type lonlat_circle_type[] = {LON_CIRCLE, LAT_CIRCLE, LON_CIRCLE, LAT_CIRCLE, LON_CIRCLE};
enum yac_edge_type *src_edge_type = great_circle_type.data(); enum yac_edge_type *src_edge_type = &great_circle_type[0];
enum yac_edge_type *tgt_edge_type = great_circle_type.data(); enum yac_edge_type *tgt_edge_type = &great_circle_type[0];
enum cell_type target_cell_type = UNDEF_CELL; enum cell_type target_cell_type = UNDEF_CELL;
......
...@@ -72,7 +72,7 @@ void sort_add_and_wgts(size_t num_weights, size_t *src_add, double *wgts) ...@@ -72,7 +72,7 @@ void sort_add_and_wgts(size_t num_weights, size_t *src_add, double *wgts)
addweights[n].weight = wgts[n]; addweights[n].weight = wgts[n];
} }
qsort(addweights.data(), num_weights, sizeof(addweight_t), cmp_adds); qsort(&addweights[0], num_weights, sizeof(addweight_t), cmp_adds);
for ( n = 0; n < num_weights; ++n ) for ( n = 0; n < num_weights; ++n )
{ {
...@@ -102,7 +102,7 @@ void sort_add_and_wgts4(size_t num_weights, size_t *src_add, double wgts[4][4]) ...@@ -102,7 +102,7 @@ void sort_add_and_wgts4(size_t num_weights, size_t *src_add, double wgts[4][4])
addweights[n].weight[k] = wgts[n][k]; addweights[n].weight[k] = wgts[n][k];
} }
qsort(addweights.data(), num_weights, sizeof(addweight4_t), cmp_adds4); qsort(&addweights[0], num_weights, sizeof(addweight4_t), cmp_adds4);
for ( n = 0; n < num_weights; ++n ) for ( n = 0; n < num_weights; ++n )
{ {
......
#ifndef REMAP_STORE_LINK_H #ifndef REMAP_STORE_LINK_H
#define REMAP_STORE_LINK_H #define REMAP_STORE_LINK_H
typedef struct typedef struct
{ {
size_t add; size_t add;
...@@ -34,5 +33,4 @@ void weightlinks2remaplinks4(size_t tgt_grid_size, weightlinks4_t *weightlinks, ...@@ -34,5 +33,4 @@ void weightlinks2remaplinks4(size_t tgt_grid_size, weightlinks4_t *weightlinks,
void sort_add_and_wgts(size_t num_weights, size_t *src_add, double *wgts); void sort_add_and_wgts(size_t num_weights, size_t *src_add, double *wgts);
void sort_add_and_wgts4(size_t num_weights, size_t *src_add, double wgts[4][4]); void sort_add_and_wgts4(size_t num_weights, size_t *src_add, double wgts[4][4]);
#endif /* REMAP_STORE_LINK */ #endif /* REMAP_STORE_LINK */
#ifndef _REMAP_STORE_LINK_CNSRV_H #ifndef REMAP_STORE_LINK_CNSRV_H
#define _REMAP_STORE_LINK_CNSRV_H #define REMAP_STORE_LINK_CNSRV_H
extern int remap_store_link_fast; extern int remap_store_link_fast;
/* used for store_link_fast */ // used for store_link_fast
#define BLK_SIZE 4096 #define BLK_SIZE 4096
#define BLK_NUM(x) (x/grid_store->blk_size) #define BLK_NUM(x) (x/grid_store->blk_size)
...@@ -32,4 +32,4 @@ void grid_store_delete(grid_store_t *grid_store); ...@@ -32,4 +32,4 @@ void grid_store_delete(grid_store_t *grid_store);
void store_link_cnsrv_fast(remapvars_t *rv, long add1, long add2, long num_wts, double *weights, grid_store_t *grid_store); void store_link_cnsrv_fast(remapvars_t *rv, long add1, long add2, long num_wts, double *weights, grid_store_t *grid_store);
void store_link_cnsrv(remapvars_t *rv, long add1, long add2, double *restrict weights, long *link_add1[2], long *link_add2[2]); void store_link_cnsrv(remapvars_t *rv, long add1, long add2, double *restrict weights, long *link_add1[2], long *link_add2[2]);
#endif /* _REMAP_STORE_LINK_CNSRV */ #endif /* REMAP_STORE_LINK_CNSRV */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment