;
; Open NetCDF file containing temperature forecast information.
;
a = addfile("data/94062112_nT.cdf","r")

;
; Open NCGM workstation and name the metafile "contour00.ncgm".
;
wks = create "wks" ncgmWorkstationLayerClass noparent 
	"wkMetaName" : "contour00.ncgm"
end create

;
; Create a scalar field data object and configure its extents' missing
; values; at the same time convert it from Degrees K to Degrees F.
;
field1 = create "field1" scalarFieldLayerClass noparent
	"sfDataArray" : (a->T(0,0,:,:) - 273.15) * 9 / 5 + 32.0
	"sfMissingValueV":  a->T@_FillValue
	"sfXCStartV" : a->lon(0)
	"sfXCEndV": a->lon(dimsizes(a->lon) - 1)
	"sfYCStartV" : a->lat(0)
	"sfYCEndV": a->lat(dimsizes(a->lat) - 1)
end create

;
; Create a contour object and assign scalar field data to it.
;
con1 = create "con1" contourLayerClass wks 
	"vpXF": .2
	"vpYF": .8
	"vpWidthF" : .6
	"vpHeightF" : .6
	"cnScalarFieldData" : field1
	"cnLevelSelectionMode" : 1
	"cnMinLevelValF" : 20.0
	"cnMaxLevelValF" : 110.0
	"cnLevelSpacingF" : 10.0
	"cnFillOn" : "True"
	"cnMonoFillPattern" : "True"
	"cnFillPatterns" : 0
	"trXMinF" : -140.0
	"trXMaxF" : -52.5
	"trYMinF" : 20.0
	"trYMaxF" : 60.0
	"tiMainFuncCode": "#"
	"tiMainString" : a@title + "#C#" + a@history
	"tiXAxisString" : a->lon@long_name
	"tiYAxisString" : a->lat@long_name
	"tmXBMode" : "EXPLICIT"
	"tmXBValues" : (/-60, -75, -90, -105, -120, -135 /)
	"tmXBLabels" : (/"60W", "75W", "90W", "105W", "120W", "135W"/)
	"tmYLMode" : "EXPLICIT"
	"tmYLValues" : (/60, 50, 40 , 30, 20/)
	"tmYLLabels" : (/"60N", "50N", "40N", "30N", "20N"/)
	"tmXMajorGrid" : "True"
	"tmYMajorGrid" : "True"
	"tmXBMinorOn" : "False"
	"tmYLMinorOn" : "False"
end create
draw(con1)
frame(wks)

;
; Loop on remaining fields of data and draw contour.
;
do i = 1, dimsizes(a->frtime) - 1
	setvalues field1
		"sfDataArray" : (a->T(i,0,:,:) - 273.15) * 9 / 5 + 32.0
	end setvalues
	draw(con1)
	frame(wks)
end do