Commit 3c16d90e authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

remaplib: Changed remap weights from 2D to 1D array

parent 2adea761
2011-01-07 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* remaplib: Changed remap weights from 2D to 1D array
2011-01-06 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de> 2011-01-06 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* using CDI library version 1.4.6 * using CDI library version 1.4.6
......
...@@ -331,7 +331,7 @@ void *Remap(void *argument) ...@@ -331,7 +331,7 @@ void *Remap(void *argument)
{ {
int ival; int ival;
ival = atoi(envstr); ival = atoi(envstr);
if ( ival > 0 ) if ( ival >= 0 )
{ {
remap_non_global = ival; remap_non_global = ival;
if ( cdoVerbose ) if ( cdoVerbose )
...@@ -344,7 +344,7 @@ void *Remap(void *argument) ...@@ -344,7 +344,7 @@ void *Remap(void *argument)
{ {
int ival; int ival;
ival = atoi(envstr); ival = atoi(envstr);
if ( ival > 0 ) if ( ival >= 0 )
{ {
remap_store_link_fast = ival; remap_store_link_fast = ival;
if ( cdoVerbose ) if ( cdoVerbose )
...@@ -845,10 +845,10 @@ void *Remap(void *argument) ...@@ -845,10 +845,10 @@ void *Remap(void *argument)
if ( operfunc == REMAPLAF ) if ( operfunc == REMAPLAF )
remap_laf(array2, missval, gridInqSize(gridID2), remaps[r].vars.num_links, remaps[r].vars.wts, remap_laf(array2, missval, gridInqSize(gridID2), remaps[r].vars.num_links, remaps[r].vars.wts,
remaps[r].vars.grid2_add, remaps[r].vars.grid1_add, array1); remaps[r].vars.num_wts, remaps[r].vars.grid2_add, remaps[r].vars.grid1_add, array1);
else if ( operfunc == REMAPSUM ) else if ( operfunc == REMAPSUM )
remap_sum(array2, missval, gridInqSize(gridID2), remaps[r].vars.num_links, remaps[r].vars.wts, remap_sum(array2, missval, gridInqSize(gridID2), remaps[r].vars.num_links, remaps[r].vars.wts,
remaps[r].vars.grid2_add, remaps[r].vars.grid1_add, array1); remaps[r].vars.num_wts, remaps[r].vars.grid2_add, remaps[r].vars.grid1_add, array1);
else else
remap(array2, missval, gridInqSize(gridID2), remaps[r].vars.num_links, remaps[r].vars.wts, remap(array2, missval, gridInqSize(gridID2), remaps[r].vars.num_links, remaps[r].vars.wts,
remaps[r].vars.num_wts, remaps[r].vars.grid2_add, remaps[r].vars.grid1_add, remaps[r].vars.num_wts, remaps[r].vars.grid2_add, remaps[r].vars.grid1_add,
......
...@@ -127,7 +127,7 @@ typedef struct { ...@@ -127,7 +127,7 @@ typedef struct {
int *grid1_add; /* grid1 address for each link */ int *grid1_add; /* grid1 address for each link */
int *grid2_add; /* grid2 address for each link */ int *grid2_add; /* grid2 address for each link */
double *wts[4]; /* map weights for each link [max_links][num_wts] */ double *wts; /* map weights for each link [max_links*num_wts] */
remaplink_t links; remaplink_t links;
} }
...@@ -150,16 +150,16 @@ void remapVarsInit(int map_type, remapgrid_t *rg, remapvars_t *rv); ...@@ -150,16 +150,16 @@ void remapVarsInit(int map_type, remapgrid_t *rg, remapvars_t *rv);
void remapVarsFree(remapvars_t *rv); void remapVarsFree(remapvars_t *rv);
void remapGridFree(remapgrid_t *rg); void remapGridFree(remapgrid_t *rg);
void remap(double *restrict dst_array, double missval, long dst_size, long num_links, double *restrict *restrict map_wts, void remap(double *restrict dst_array, double missval, long dst_size, long num_links, double *restrict map_wts,
long num_wts, const int *restrict dst_add, const int *restrict src_add, const double *restrict src_array, long num_wts, const int *restrict dst_add, const int *restrict src_add, const double *restrict src_array,
const double *restrict src_grad1, const double *restrict src_grad2, const double *restrict src_grad3, const double *restrict src_grad1, const double *restrict src_grad2, const double *restrict src_grad3,
remaplink_t links); remaplink_t links);
void remap_laf(double *restrict dst_array, double missval, long dst_size, long num_links, double *restrict *restrict map_wts, void remap_laf(double *restrict dst_array, double missval, long dst_size, long num_links, double *restrict map_wts,
const int *restrict dst_add, const int *restrict src_add, const double *restrict src_array); long num_wts, const int *restrict dst_add, const int *restrict src_add, const double *restrict src_array);
void remap_sum(double *restrict dst_array, double missval, long dst_size, long num_links, double *restrict *restrict map_wts, void remap_sum(double *restrict dst_array, double missval, long dst_size, long num_links, double *restrict map_wts,
const int *restrict dst_add, const int *restrict src_add, const double *restrict src_array); long num_wts, const int *restrict dst_add, const int *restrict src_add, const double *restrict src_array);
void remap_bilin(remapgrid_t *rg, remapvars_t *rv); void remap_bilin(remapgrid_t *rg, remapvars_t *rv);
void remap_bicub(remapgrid_t *rg, remapvars_t *rv); void remap_bicub(remapgrid_t *rg, remapvars_t *rv);
...@@ -176,9 +176,8 @@ void remap_gradients(remapgrid_t rg, const double *restrict array, double *restr ...@@ -176,9 +176,8 @@ void remap_gradients(remapgrid_t rg, const double *restrict array, double *restr
void reorder_links(remapvars_t *rv); void reorder_links(remapvars_t *rv);
void sort_add(long num_links, long num_wts, int *restrict add1, int *restrict add2, double *restrict *restrict weights); void sort_add(long num_links, long num_wts, int *restrict add1, int *restrict add2, double *restrict weights);
void sort_add_test(long num_links, long num_wts, int *restrict add1, int *restrict add2, double *restrict *restrict weights); void sort_iter(long num_links, long num_wts, int *restrict add1, int *restrict add2, double *restrict weights, int parent);
void sort_iter(long num_links, long num_wts, int *restrict add1, int *restrict add2, double *restrict *restrict weights, int parent);
void write_remap_scrip(const char *interp_file, int map_type, int submap_type, void write_remap_scrip(const char *interp_file, int map_type, int submap_type,
int remap_order, remapgrid_t rg, remapvars_t rv); int remap_order, remapgrid_t rg, remapvars_t rv);
......
This diff is collapsed.
Supports Markdown
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