begin ; This is to add the file into NCL dir = "/home/atmosfera2/data/SST/" fname = "T2017304.L3m_DAY_SST_sst_4km" data = addfile(dir + fname + ".nc", "r") ; Read the variable sst = data->sst ; Define the latitude and longitude ranges lat_min = -20 ;-20 lat_max = 20 ;20 lon_min = 80 ;80 lon_max = 120 ;120 ; Extract the data sst_extract = sst({lat_min:lat_max},{lon_min:lon_max}) ; To summarize the metadata of the NC file ;printVarSummary(sst_extract) ;printMinMax(sst_extract,0) ; "Unpack" the values sst_float = short2flt(sst_extract) ; To plot the SST wks = gsn_open_wks("png", "/home/atmosfera2/plots/ncl_plots/sst_2") ; To increase maximum workstation memory setvalues NhlGetWorkspaceObjectId() "wsMaximumSize" : 300000000 end setvalues ; Plot resources res = True res@gsnLeftString = "Temperature" ;res@mpDataBaseVersion = "HighRes" res@mpLimitMode = "LatLon" res@mpMinLatF = lat_min res@mpMaxLatF = lat_max res@mpMinLonF = lon_min res@mpMaxLonF = lon_max res@gsnAddCyclic = False ; Plotting the subset res@cnFillOn = True ;res@cnFillPalette = "BlWhRe" res@cnLinesOn = False ;res@cnLevelSelectionMode = "ManualLevels"; set manual contour levels ;res@cnMinLevelValF = 20.0 ; set min contour level ;res@cnMaxLevelValF = 40.0 ; set max contour level ;res@cnLevelSpacingF = 1 ; set contour spacing res@cnLevelSelectionMode = "ExplicitLevels" res@cnLevels = (/30,35,40,45/) plot = gsn_csm_contour_map(wks,sst_float,res) print("Total CPU time: " + get_cpu_time()) end