x1d = ndtooned(tmpq(5,:,:)) ; convert 2D array to 1D for use in maxind
inds = ind_resolve(maxind (x1d),dimsizes(tmpq(5,:,:))) ; convert 1D array back to 2D
ilat = inds(0,0) ; select the latitude index where the X array is at its' maximum
ilon = inds(0,1) ; select the longitude index where the X array is at its' maximum
lat_max = tmpq&lat(ilat) ; insert the latitude index into the lat coordinate variable
lon_max = tmpq&lon(ilon) ; insert the longitude index into the lon coordinate variable
print("Maximum value located at june lat="+lat_max+", lon="+lon_max+",T="+max(tmpq(5,:,:)))
inds = ind_resolve(minind (x1d),dimsizes(tmpq(5,:,:))) ; convert 1D array back to 2D
ilat = inds(0,0) ; select the latitude index where the X array is at its' maximum
ilon = inds(0,1) ; select the longitude index where the X array is at its' maximum
lat_max = tmpq&lat(ilat) ; insert the latitude index into the lat coordinate variable
lon_max = tmpq&lon(ilon) ; insert the longitude index into the lon coordinate variable
print("Minimum value located at june="+lat_max+",lon= "+lon_max+",T="+min(tmpq(5,:,:)))