	program magics

	call popen

	call pset1c("output_formats", (/"png"/), 1)
	call psetc("output_name", "contour15")
	call psetc("output_name_first_page_number", "off")

	call pseti("subpage_lower_left_longitude", -180)
	call pseti("subpage_upper_right_longitude", 180)
	call pseti("subpage_upper_right_latitude", 90)
	call psetc("subpage_map_projection", "cylindrical")
	call pseti("subpage_lower_left_latitude", -90)

	call pseti("grib_field_position", 1)
	call psetc("grib_input_file_name", "CAPE.grib")
	call pgrib

	call preset('grib_field_position')
	call preset('grib_input_file_name')

	call psetc("map_coastline_land_shade_colour", "cream")
	call psetc("map_coastline_land_shade", "on")
	call pcoast

	call preset('map_coastline_land_shade_colour')
	call preset('map_coastline_land_shade')

	call psetc("contour_shade_label_blanking", "on")
	call psetc("contour_level_selection_type", "level_list")
	call psetc("contour_shade_colour_method", "calculate")
	call psetc("contour_shade_method", "area_fill")
	call psetc("contour_shade", "on")
	call pset1r("contour_level_list", (/100.00, 200.00, 300.00, 500.00, 750.00, 1000.00, 1250.00, 1500.00, 1750.00, 2000.00, 2250.00, 2500.00, 2750.00, 3000.00, 3500.00, 4000.00, 4500.00/), 17)
	call psetr("contour_shade_max_level", 4200.00)
	call psetc("contour_hilo", "off")
	call psetc("contour", "off")
	call psetc("contour_label", "off")
	call psetr("contour_shade_min_level", 100.00)
	call psetc("legend", "on")
	call psetr("contour_interval", 200.00)
	call pset1c("contour_shade_colour_list", (/"rgb(1.00,0.35,0.00),rgb(1.00,  0.55,  0.00)", "rgb(1.00,  0.67,  0.00)                    ",&
		"rgb(1.00,  0.78,  0.00)                    ",&
		"rgb(1.00,  0.89,  0.00)                    ", "rgb(1.00,  1.00,  0.00)                    ",&
		"rgb(0.75,  0.98,  0.00)                    ",&
		"rgb(0.60,  0.86,  0.10)                    ", "rgb(0.43,  0.77,  0.20)                    ",&
		"rgb(0.30,  0.68,  0.40)                    ",&
		"rgb(0.50,  0.90,  1.00)                    ", "rgb(0.50,  0.70,  1.00)                    ",&
		"rgb(0.37,  0.50,  1.00)                    ",&
		"rgb(0.20,  0.30,  0.90)                    ",&
		"rgb(0.10,  0.15,  0.75)                    ", "rgb(0.00,  0.05,  0.55)                    ",&
		"rgb(0.00,  0.00,  0.35)                    ",&
		"rgb(0.00,  0.00,  0.20)                    "/), 17)
	call pcont

	call preset('contour_shade_label_blanking')
	call preset('contour_level_selection_type')
	call preset('contour_shade_colour_method')
	call preset('contour_shade_method')
	call preset('contour_shade')
	call preset('contour_level_list')
	call preset('contour_shade_max_level')
	call preset('contour_hilo')
	call preset('contour')
	call preset('contour_label')
	call preset('contour_shade_min_level')
	call preset('legend')
	call preset('contour_interval')
	call preset('contour_shade_colour_list')

	call psetc("map_label", "on")
	call psetc("map_grid_line_style", "dash")
	call psetc("map_grid_colour", "grey")
	call psetc("map_coastline_colour", "black")
	call psetc("map_coastline_land_shade", "off")
	call pcoast

	call preset('map_label')
	call preset('map_grid_line_style')
	call preset('map_grid_colour')
	call preset('map_coastline_colour')
	call preset('map_coastline_land_shade')

	call pset1c("text_lines", (/"<font size="1">CAPE - Shade from 100 to 4500 (orange-blue)</font>", "<magics_title/>                                                  "/), 2)
	call psetr("text_font_size", 0.60)
	call psetc("text_justification", "left")
	call psetc("text_colour", "charcoal")
	call ptext

	call preset('text_lines')
	call preset('text_font_size')
	call preset('text_justification')
	call preset('text_colour')

	call pclose

	end
