
%if GRID_DEFINITION_MODE <> template %then
	%unset TEMPLATE_SOURCE
	%unset TEMPLATE_DATA

%if GRID_DEFINITION_MODE <> grid %then
	%unset GRID

%if GRID_DEFINITION_MODE <> lambert_conformal %and GRID_DEFINITION_MODE <> lambert_azimuthal_equal_area %then
	%unset FIRST_POINT
	%unset DX_IN_METRES
	%unset DY_IN_METRES
	%unset NX
	%unset NY
	%unset SHAPE_OF_THE_EARTH
	%unset RADIUS
	%unset EARTH_MAJOR_AXIS
	%unset EARTH_MINOR_AXIS

%if GRID_DEFINITION_MODE <> lambert_conformal %then
	%unset LAD_IN_DEGREES
	%unset LOV_IN_DEGREES
	%unset LATIN_1_IN_DEGREES
	%unset LATIN_2_IN_DEGREES
	%unset WRITE_LAD_IN_DEGREES
	%unset WRITE_LON_POSITIVE

%if GRID_DEFINITION_MODE <> lambert_azimuthal_equal_area %then
	%unset STANDARD_PARALLEL_IN_DEGREES
	%unset CENTRAL_LONGITUDE_IN_DEGREES

%if GRID_DEFINITION_MODE = lambert_conformal %or GRID_DEFINITION_MODE = lambert_azimuthal_equal_area %then
	%unset AREA
	%unset ROTATION

%if GRID_DEFINITION_MODE = template %or GRID_DEFINITION_MODE = filter %then
	%unset AREA
	%unset ROTATION
	%unset PL
	%unset FRAME
	%unset EDITION

%if INTERPOLATION <> nearest_lsm %and LSM = off %then
	%unset LSM_INTERPOLATION_INPUT
	%unset LSM_SELECTION_INPUT
	%unset LSM_NAMED_INPUT
	%unset LSM_FILE_INPUT
	%unset LSM_VALUE_THRESHOLD_INPUT
	%unset LSM_INTERPOLATION_OUTPUT
	%unset LSM_SELECTION_OUTPUT
	%unset LSM_NAMED_OUTPUT
	%unset LSM_FILE_OUTPUT
	%unset LSM_VALUE_THRESHOLD_OUTPUT

%if LSM = off %then
	%unset LSM_WEIGHT_ADJUSTMENT

%if LSM_SELECTION_INPUT <> file %then
	%unset LSM_FILE_INPUT

%if LSM_SELECTION_INPUT <> named %then
	%unset LSM_NAMED_INPUT

%if LSM_SELECTION_OUTPUT <> file %then
	%unset LSM_FILE_OUTPUT

%if LSM_SELECTION_OUTPUT <> named %then
	%unset LSM_NAMED_OUTPUT

%if NABLA = off %then
	%unset NABLA_POLES_MISSING_VALUES

%if INTERPOLATION <> k_nearest_neighbours %then
	%unset DISTANCE_WEIGHTING

%if INTERPOLATION <> nearest_lsm %then
	%unset DISTANCE_WEIGHTING_WITH_LSM

%if INTERPOLATION <> k_nearest_neighbours %and INTERPOLATION <> k_nearest_neighbours_statistics %and INTERPOLATION <> nearest_lsm %then
	%unset DISTANCE
	%unset DISTANCE_TOLERANCE
	%unset NCLOSEST
	%unset NEAREST_METHOD

%if (INTERPOLATION = k_nearest_neighbours %or INTERPOLATION = k_nearest_neighbours_statistics %or INTERPOLATION = nearest_lsm) %and NEAREST_METHOD = distance %then
	%unset NCLOSEST

%if (INTERPOLATION = k_nearest_neighbours %or INTERPOLATION = k_nearest_neighbours_statistics %or INTERPOLATION = nearest_lsm) %and NEAREST_METHOD <> nclosest_or_nearest %then
	%unset DISTANCE_TOLERANCE

%if INTERPOLATION <> k_nearest_neighbours %or DISTANCE_WEIGHTING <> gaussian %then
	%unset DISTANCE_WEIGHTING_GAUSSIAN_STDDEV

%if INTERPOLATION <> k_nearest_neighbours %or DISTANCE_WEIGHTING <> shepard %then
	%unset DISTANCE_WEIGHTING_SHEPARD_POWER

%if INTERPOLATION <> k_nearest_neighbours %or DISTANCE_WEIGHTING <> climate_filter %then
	%unset CLIMATE_FILTER_DELTA

%if NON_LINEAR <> simulated_missing_value %then
	%unset SIMULATED_MISSING_VALUE
	%unset SIMULATED_MISSING_VALUE_EPSILON

%if TRUNCATION <> OFF %then
	%unset SPECTRAL_ORDER

%if PACKING = ieee %and (ACCURACY <> 32 %and ACCURACY <> 64) %then
	%warning "PACKING=ieee allows only ACCURACY=32 or 64"
	%error "PACKING=ieee allows only ACCURACY=32 or 64"

%if GRID_DEFINITION_MODE = filter %then
	%unset TRUNCATION
	%unset INTGRID
	%unset SPECTRAL_ORDER
	%unset NABLA
	%set INTERPOLATION = k_nearest_neighbours

