
f1 = addfile("/home/anumol/Downloads/g4.timeAvgMap.MYD08_M3_6_1_AOD_550_Dark_Target_Deep_Blue_Combined_Mean_Mean.20191201-20200229.59E_1S_102E_41N.nc","r")
fsd=f1->MYD08_M3_6_1_AOD_550_Dark_Target_Deep_Blue_Combined_Mean_Mean;({5:38},{55:100})

 lat  = f1->lat;({5:38})
 lon  = f1->lon;({65:100})
 nlat = dimsizes(lat)
 nlon = dimsizes(lon)
 fsd!0 = "lat"
 fsd!1 = "lon"

;printVarSummary(fsd)
;printVarSummary(fsd&lat)
;printVarSummary(fsd&lon)

;fsd&lat@units = "degrees_north"
;fsd&lon@units = "degrees_east"
 
delete(fsd@long_name)
delete(fsd@standard_name)
delete(fsd@units)

temp2 = fsd(:,:)
;copy_VarCoords(fsd,temp2)

;printVarSummary(temp2)

;**************************************
;   Create plot
;***************************************
 
;wks  = gsn_open_wks("x11","coord_arrays_error")
wks  = gsn_open_wks("png", "modis_aod_2019-20-DJF") ; send graphics to PNG file

 res                             = True             ; plot mods desired

 res@cnFillOn                    = True             ; turn on color 
 res@cnLinesOn                   = False            ; no contour lines
 ;res@cnLineLabelsOn             = True
 res@gsnMaximize                 = False 

 res@cnFillPalette="precip3_16lev"
 cmap = read_colormap_file("precip3_16lev")
 gsn_define_colormap(wks,"precip3_16lev")


; res@cnLevelSelectionMode = "ExplicitLevels"
; res@cnLevels =(/0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1,1.5/)
; res@cnLevels =(/10,20,30,40,50,60,70,80,90,100/);
 

 res@mpDataBaseVersion           = "MediumRes"      ; use finer database
 res@pmTickMarkDisplayMode       = "Always"         ; turn on tickmarks
 res@tmYRLabelsOn         = True              ; no right labels
 res@tmYROn               = True              ; no right tickmarks
 res@tmXTLabelsOn         = False              ; no top labels
 res@tmXTOn               = False              ; no top tickmarks
 
 res@gsnAddCyclic                = False            ; regional data, don't add pt

 res@mpProjection                = "mercator"       ; projection
 res@mpLimitMode                 = "Corners"        ; method to zoom
 res@mpLeftCornerLatF            = min(lat)
 res@mpLeftCornerLonF            = min(lon)
 res@mpRightCornerLatF           = max(lat)       
 res@mpRightCornerLonF           = max(lon)
 res@mpCenterLonF = (res@mpLeftCornerLonF+res@mpRightCornerLonF)/2
 res@mpCenterLatF = (res@mpLeftCornerLatF+res@mpRightCornerLatF)/2
 res@mpGeophysicalLineThicknessF = 1.5
 res@mpGridLineDashPattern       = 2
 res@mpGridLineThicknessF        = 2
; res@tfDoNDCOverlay             = True             ; do not transform data
 res@mpGridAndLimbOn             =True
 res@tmXBMajorOutwardLengthF     = 0
 res@tiMainString                ="MODIS AOD"
 res@tiMainFontHeightF           =0.015
 plot1 = gsn_csm_contour_map (wks,temp2,res)    ; create plot

;;india map

fname = "indiamap.txt"
delim = " "
data = asciiread(fname, (/566,2/), "float")

lon1=data(:,0)
lat1=data(:,1)
resp  = True
  resp@gsLineColor="Black"
  resp@gsLineThicknessF=1.5
  plot2 = gsn_add_polyline(wks,plot1,lon1(0:212),lat1(0:212),resp)
  plot3 = gsn_add_polyline(wks,plot1,lon1(360:565),lat1(360:565),resp)

draw(plot1)
draw(plot2)
draw(plot3)
frame(wks)




 
