REGRID; Regrid Application
{
	SOURCE
	{
		@
	}

	DATA
		[ interface       = icon,
		  class           = GRIB/NETCDF/GEOPOINTS,
		  exclusive       = false,
		  help            = help_data,
		  help_directory  = '/System/Defaults',
		  help_name       = Data,
		  help_class      = RETRIEVE,
		  help_definition = ( RETRIEVE, GRID = 1.5/1.5 ) ]
	{
		@
		/
	}

	GRID_DEFINITION_MODE
	{
		GRID
		LAMBERT_AZIMUTHAL_EQUAL_AREA
		LAMBERT_CONFORMAL
		TEMPLATE
		FILTER
	} = GRID

	TEMPLATE_SOURCE
	{
		@
	}

	TEMPLATE_DATA
		[ interface       = icon,
		  class           = GRIB,
		  exclusive       = false,
		  help            = help_data,
		  help_directory  = '/System/Defaults',
		  help_name       = Data,
		  help_class      = RETRIEVE,
		  help_definition = ( RETRIEVE, GRID = 2/2 ) ]
	{
		@
		/
	}

	# Interpolate to a regular latitude/longitude grid or to given grid name (following a recognizable regular expression)
	GRID
	{
		@
		/
	}

	FIRST_POINT
	[ help = help_input, help_icon = 'help_point', input_type = point ]
	{
		*
		/
	} = 0/0

	DX_IN_METRES
	{
		*
	}

	DY_IN_METRES
	{
		*
	}

	NX
	{
		*
	}

	NY
	{
		*
	}

	SHAPE_OF_THE_EARTH
	[ visible = false ]
	{
		*
	} = 6

	RADIUS
	[ visible = false ]
	{
		*
	} = 6371229.

	EARTH_MAJOR_AXIS
	[ visible = false ]
	{
		*
	} = 6371229.

	EARTH_MINOR_AXIS
	[ visible = false ]
	{
		*
	} = 6371229.

	# lambert-only
	LAD_IN_DEGREES
	{
		*
	}

	# lambert-only
	LOV_IN_DEGREES
	{
		*
	}

	# lambert-only
	LATIN_1_IN_DEGREES
	{
		*
	} = 0.

	# lambert-only
	LATIN_2_IN_DEGREES
	{
		*
	} = 0.

	# lambert-only
	WRITE_LAD_IN_DEGREES
	[ visible = false ]
	{
		ON
		OFF
	} = OFF

	# lambert-only
	WRITE_LON_POSITIVE
	[ visible = false ]
	{
		ON
		OFF
	} = OFF

	# lambert_azimuthal_equal_area-only
	STANDARD_PARALLEL_IN_DEGREES
	{
		*
	}

	# lambert_azimuthal_equal_area-only
	CENTRAL_LONGITUDE_IN_DEGREES
	{
		*
	}

	# VOD2UV:
	# Input is vorticity and divergence (spectral vo/d), convert to Cartesian components (gridded u/v or spectral U/V)
	# UV2UV:
	# Input is vector in Cartesian components (spectral U/V), convert to gridded u/v
	WIND_PROCESSING
	{
		OFF
		UV_TO_UV
		VOD_TO_UV
	} = OFF

	# Vector/scalar operator(s)
	NABLA
	{
		scalar_gradient
		scalar_laplacian
		uv_divergence
		uv_gradient
		uv_vorticity
		OFF
	} = OFF

	# Force missing values at the poles
	NABLA_POLES_MISSING_VALUES
	{
		ON
		OFF
	} = OFF

	# cropping area: north/west/south/east
	AREA
		[ help         = help_input,
		  help_icon    = 'help_map',
		  help_tooltip = 'Define area on a map',
		  input_type   = map,
		  input_window = '/Metview/System/Input Window' ]
	{
		*
		/
	} = -90./0./90./360.

	# Rotate the grid by moving the South pole to latitude/longitude
	ROTATION
	[ help = help_input, help_icon = 'help_point', input_type = point ]
	{
		*
		/
	} = -90/0

	# Spectral/gridded transform order of accuracy
	SPECTRAL_ORDER
	[ visible = false ]
	{
		linear
		quadratic
		cubic
		quartic
	} = linear

	# Describes the intermediate truncation which the transform is performed from
	TRUNCATION
	#[ help = help_script, help_script_command = 'echo "the intermediate truncation which the transform is performed from"' ]
	[ help = help_multiple_selection ]
	{
		none
		automatic
		*
	} = automatic

	# Describes the intermediate grid which the transform is performed to
	INTGRID
	#[ help = help_script, help_script_command = 'echo "the intermediate grid which the transform is performed to"' ]
	[ help = help_multiple_selection ]
	{
		automatic
		none
		source
		@
	} = automatic

	# Interpolate to the reduced Gaussian grid with specific pl array
	PL
	[ visible = false ]
	{
		*
		/
	}

	# Bitmap file to apply
	# hide because bitmapping is available elsewhere
	# in Metview, but keep for testing
	BITMAP
	[ visible = false ]
	{
		@
	}

	# Size of the frame
	FRAME
	{
		*
	}

	INTERPOLATION
	{
		linear
		bilinear
		grid_box_average
		grid_box_statistics
		voronoi_statistics
		k_nearest_neighbours
		k_nearest_neighbours_statistics
		nearest_lsm
		nearest_neighbour
		structured_bicubic
		structured_bilinear
		structured_biquasicubic
		automatic
	} = automatic

	INTERPOLATION_STATISTICS
	{
		count
		count_above_upper_limit
		count_below_lower_limit
		maximum
		minimum
		mode_real
		mode_integral
		mode_boolean
		median_integral
		median_boolean
		mean
		variance
		skewness
		kurtosis
		stddev
		automatic
	} = automatic

	NEAREST_METHOD # k_nearest_neighbours, k_nearest_neighbours_statistics, nearest_neighbour and nearest_lsm
	{
		distance
		distance_and_nclosest
		distance_or_nclosest
		nclosest
		nclosest_or_nearest
		nearest_neighbour_with_lowest_index
		sample
		sorted_sample
		automatic
	} = automatic

	DISTANCE_WEIGHTING # only with k_nearest_neighbours
	{
		climate_filter
		gaussian
		inverse_distance_weighting
		inverse_distance_weighting_squared
		nearest_neighbour
		no
		reciprocal
		shepard
	} = inverse_distance_weighting_squared

	NCLOSEST
	{
		*
	} = 4

	DISTANCE
	{
		*
	} = 1.

	CLIMATE_FILTER_DELTA
	{
		*
	} = 1000.

	DISTANCE_WEIGHTING_GAUSSIAN_STDDEV
	{
		*
	} = 1.

	DISTANCE_WEIGHTING_SHEPARD_POWER
	{
		*
	} = 2.

	DISTANCE_TOLERANCE
	{
		*
	} = 1.

	# L2 Projection (conservative) FEM input mesh
	L2_PROJECTION_INPUT_METHOD
	[ visible = false ]
	{
		linear
		bilinear
	} = linear

	# L2 Projection (conservative) FEM output mesh
	L2_PROJECTION_OUTPUT_METHOD
	[ visible = false ]
	{
		linear
		bilinear
	} = linear

	# Use land_sea mask (lsm) when interpolating grid to grid
	LSM
	[ visible = false ]
	{
		ON
		OFF
	} = OFF

	DISTANCE_WEIGHTING_WITH_LSM # nearest_lsm
	{
		nearest_lsm
		nearest_lsm_with_lowest_index
		OFF
	} = OFF

	# LSM interpolation weight adjustment factor
	LSM_WEIGHT_ADJUSTMENT
	{
		*
	} = 0.2

	# LSM interpolation method for input
	LSM_INTERPOLATION_INPUT
	{
		linear
		bilinear
		grid_box_average
		grid_box_maximum
		k_nearest_neighbours
		nearest_lsm
		nearest_neighbour
		structured_bicubic
		structured_bilinear
		structured_biquasicubic
	} = nearest_neighbour

	# LSM selection method for input
	LSM_SELECTION_INPUT
	{
		file
		named
	} = named

	# If __lsm_selection_input=named, LSM name to use for input
	LSM_NAMED_INPUT
	{
		1km
		10min
		O1280
		O640
		O320
		N320
		N256
		N128
	} = 1km

	# If __lsm_selection_input=file, LSM GRIB file path to use for input
	LSM_FILE_INPUT
	{
		@
	}

	# If __lsm_selection_input=file, LSM field greater_or_equal to value threshold, when converting to mask for input
	LSM_VALUE_THRESHOLD_INPUT
	{
		*
	} = 0.5

	# LSM interpolation method for output
	LSM_INTERPOLATION_OUTPUT
	{
		linear
		bilinear
		grid_box_average
		grid_box_maximum
		k_nearest_neighbours
		nearest_lsm
		nearest_neighbour
		structured_bicubic
		structured_bilinear
		structured_biquasicubic
	} = nearest_neighbour

	# LSM selection method for output
	LSM_SELECTION_OUTPUT
	{
		file
		named
	} = named

	# If __lsm_selection_output=named, LSM name to use for output
	LSM_NAMED_OUTPUT
	{
		1km
		10min
		O1280
		O640
		O320
		N320
		N256
		N128
	} = 1km

	# If __lsm_selection_output=file, LSM GRIB file path to use for output
	LSM_FILE_OUTPUT
	{
		@
	}

	# If __lsm_selection_output=file, LSM field greater_or_equal to value threshold, when converting to mask for output
	LSM_VALUE_THRESHOLD_OUTPUT
	{
		*
	} = 0.5

	NON_LINEAR
	{
		missing_if_all_missing
		missing_if_any_missing
		missing_if_heaviest_missing
		simulated_missing_value
		heaviest
		no
	} = missing_if_heaviest_missing

	SIMULATED_MISSING_VALUE
	{
		*
	} = 9999.

	SIMULATED_MISSING_VALUE_EPSILON
	{
		*
	} = 0.

	# GRIB output number of bits per value
	ACCURACY
	{
		*
	}

	# GRIB output packing method
	PACKING
	{
		archived_value ; av
		complex ; co
		jpeg ; grid_jpeg
		second_order ; so
		simple
		ieee
		AS_INPUT
	} = AS_INPUT

	# GRIB output edition number
	EDITION
	{
		1
		2
		AS_INPUT
	} = AS_INPUT

	# GRIB output remove local extension
	DELETE_LOCAL_DEFINITION
	[ visible = false ]
	{
		ON
		DEFAULT
	} = DEFAULT

	# Statistics methods for interpreting field values (pre_processed)
	INPUT_STATISTICS
	[ visible = false ]
	{
		angle_degree_asymmetric
		angle_degree_symmetric
		angle_radian_asymmetric
		angle_radian_symmetric
		central_moments
		grid_box_integral
		integral
		min_max
		p_norms
		scalar
		simple_packing_entropy
		spectral
		OFF
	} = OFF

	# Statistics methods for interpreting field values (post_processed)
	OUTPUT_STATISTICS
	[ visible = false ]
	{
		angle_degree_asymmetric
		angle_degree_symmetric
		angle_radian_asymmetric
		angle_radian_symmetric
		central_moments
		grid_box_integral
		integral
		min_max
		p_norms
		scalar
		simple_packing_entropy
		spectral
		OFF
	} = OFF

	# Statistics methods output precision
	PRECISION
	[ visible = false ]
	{
		*
	} = 18

	# Select vector space
	VECTOR_SPACE
	{
		1d_angle_degree_asymmetric
		1d_angle_degree_symmetric
		1d_angle_radian_asymmetric
		1d_angle_radian_symmetric
		1d_linear
		1d_logarithmic
		# 2d_vector_u  # hidden, requires more than one data entry
		# 2d_vector_v  # ...
		# 3d_cartesian_x  # ...
		# 3d_cartesian_y  # ...
		# 3d_cartesian_z  # ...
		# 3d_vector_u  # ...
		# 3d_vector_v  # ...
		# 3d_vector_w  # ...
		OFF
	} = OFF

	# Select how to load matrices in memory
	MATRIX_LOADER
	[ visible = false ]
	{
		file_io
		shared_memory ; shmem
		tmp_shared_memory ; tmp_shmem
		OFF
	} = OFF

	# Select how to load Legendre coefficients in memory
	LEGENDRE_LOADER
	[ visible = false ]
	{
		file_io
		mapped_memory ; mmap  DEFAULT
		shared_memory ; shmem
		tmp_shared_memory ; tmp_shmem
		none
		OFF
	} = OFF

	# k_d tree control
	POINT_SEARCH_TREES
	[ visible = false ]
	{
		mapped_anonymous_memory
		mapped_cache_file
		mapped_temporary_file
		memory
		OFF
	} = OFF

	MULTI_DIMENSIONAL
	[ visible = false ]
	{
		*
	} = 1

	# Atlas/Trans Fast Legendre Transform
	ATLAS_TRANS_FLT
	[ visible = false ]
	{
		ON
		OFF
	} = OFF

	# Atlas/Trans spectral transforms type
	ATLAS_TRANS_TYPE
	[ visible = false ]
	{
		@
	} = local

	# Linear algebra backend (mixed)
	BACKEND
	[ visible = false ]
	{
		armadillo
		cuda
		eigen
		generic
		lapack
		mkl
		openmp
		viennacl
		off
	} = OFF

	# Linear algebra backend (dense)
	DENSE_BACKEND
	[ visible = false ]
	{
		armadillo
		cuda
		eigen
		generic
		lapack
		mkl
		openmp
		viennacl
		off
	} = OFF

	# Linear algebra backend (sparse)
	SPARSE_BACKEND
	[ visible = false ]
	{
		cuda
		eigen
		generic
		mkl
		openmp
		viennacl
		off
	} = OFF

	# Globalise (before interpolation)
	PRE_GLOBALISE
	[ visible = false ]
	{
		ON
		OFF
	} = OFF

	# Globalise (after interpolation)
	GLOBALISE
	[ visible = false ]
	{
		ON
		OFF
	} = OFF

	DEBUG
	[ visible = false ]
	{
		ON
		OFF
	} = OFF

	TARGET
	{
		@
	}
}
