Skip to content
Snippets Groups Projects
Commit 492c62d5 authored by Moritz Hanke's avatar Moritz Hanke
Browse files

adds ncc to config_yaml

parent 612ae842
No related branches found
No related tags found
No related merge requests found
......@@ -91,6 +91,9 @@ coupling:
- source_to_target_map:
spread_distance: 5.0
weighted: distance_weighted
- ncc:
weighted: distance_weighted
partial_coverage: TRUE
field: grid_eastward_wind
- <<: *ocn2atm
src_grid: grid2
......
......@@ -373,6 +373,21 @@ DEF_INTERP_METHOD(average,
DEF_BOOL_PARAM(
partial_coverage, YAC_INTERP_AVG_PARTIAL_COVERAGE_DEFAULT));
// interpolation method nearest corner cells
DEF_INTERP_METHOD(ncc,
DEF_INTERP_STACK_ADD(ncc,
parameters[0].enum_value, parameters[1].bool_value),
enum yac_interp_ncc_weight_type weight_type;
DEF_INTERP_STACK_GET(ncc,
&weight_type, &parameter_values[1].bool_value)
parameter_values[0].enum_value = (int)weight_type;,
DEF_ENUM_PARAM(
weighted, YAC_INTERP_NCC_WEIGHT_TYPE_DEFAULT,
DEF_NAME_TYPE_PAIR(arithmetic_average, YAC_INTERP_NCC_AVG),
DEF_NAME_TYPE_PAIR(distance_weighted, YAC_INTERP_NCC_DIST)),
DEF_BOOL_PARAM(
partial_coverage, YAC_INTERP_NCC_PARTIAL_COVERAGE_DEFAULT));
// interpolation method n-nearest neighbor
DEF_INTERP_METHOD(nnn,
DEF_INTERP_STACK_ADD(nnn,
......@@ -563,6 +578,7 @@ struct yac_interpolation_method {
size_t num_parameters;
} const interpolation_methods[] =
{ADD_INTERPOLATION(average, YAC_AVERAGE),
ADD_INTERPOLATION(ncc, YAC_NEAREST_CORNER_CELLS),
ADD_INTERPOLATION(nnn, YAC_N_NEAREST_NEIGHBOR),
ADD_INTERPOLATION(conservative, YAC_CONSERVATIVE),
ADD_INTERPOLATION(source_to_target_map, YAC_SOURCE_TO_TARGET_MAP),
......
......@@ -316,6 +316,8 @@ static void check_couple_config(struct yac_couple_config * couple_config) {
yac_interp_stack_config_add_spmap(
ref_interp_stack_config[0][3], 5.0 * YAC_RAD,
YAC_INTERP_SPMAP_MAX_SEARCH_DISTANCE_DEFAULT, YAC_INTERP_SPMAP_DIST);
yac_interp_stack_config_add_ncc(
ref_interp_stack_config[0][3], YAC_INTERP_NCC_DIST, 1);
ref_interp_stack_config[0][4] = yac_interp_stack_config_new();
yac_interp_stack_config_add_creep(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment