[ncl-talk] Algebraic operations query

Kunal Bali kunal.bali9 at gmail.com
Wed Sep 9 03:46:11 MDT 2015


Dear NCL

In the given script i need to divide the variable with 1000 . I know its
simple but i am getting stuck with this query in the given script

I also tried
var1= cloud_water_layer / 1000

but did not happen anything
please suggest me


;Reading HDF4-SDS files
;*********** Load Libraries ************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
;**************************************************************
begin
;***************************************************************
; User Input
;***************************************************************
                                             ; INPUT
   diri    = "./"                            ; input directory
   fili    = "2A12.090930.67647.6.HDF"       ;       file

                                             ; OUTPUT
;***************************************************************
; Read hdf
;***************************************************************

    f   =
addfile("/home/kunal/Pictures/NCL_Scripts/2A12.090930.67647.6.HDF","r")


   lat  = f->geolocation(:,:,0)            ; (scan, pixel)
   lon  = f->geolocation(:,:,1)

   lat at units = "degrees_north"             ; add units
   lon at units = "degrees_east"
   print(lat at hdf_name)

;-------------------------------
    var=f->cldWater(:,:,:)

    var at lon2d=lon
    var at lat2d=lat
    var_name=var at hdf_name
    var_unit="gm/m~S~3"
        printVarSummary(var)
        print(var_unit)
;       print(var)


        cloud_water=short2flt(var)
    asciiwrite("cloud_water.txt",cloud_water)
        printVarSummary(cloud_water)

    layer =2
    cloud_water_layer=cloud_water(:,:,layer)

;-------------------------------
  printMinMax(lat, True)
  printMinMax(lon, True)
  printMinMax (var, True)
;-------------------------------
  wks_type = "pdf"
  wks_type at wkPaperSize = "A4"
  wks = gsn_open_wks(wks_type,"2004")

  res                   = True
  res at tiMainOn          = True
  res at gsnMaximize       = True     ; maximize plot in frame
  res at cnFillOn          = True     ; turn on contour fill
  res at cnLinesOn         = False    ; turn off contour lines
  res at cnLineLabelsOn    = False    ; turn off line labels



res at mpMinLonF                   = 60
res at mpMaxLonF                   = 100
res at mpMinLatF                   = 0
res at mpMaxLatF                   = 30
res at mpFillOn                    = True
res at mpOutlineOn                 = True
res at mpOutlineBoundarySets       = "National"
res at mpGeophysicalLineColor      = "Blue"    ;Color of Conuntry Outline
res at mpNationalLineThicknessF    = 3.5       ;thickness of Country Outline
res at cnLevelSelectionMode = "ExplicitLevels"   ; set explicit contour levels
res at cnLevels             =
(/0,1e+04,2e+04,3e+04,4e+04,5e+04,6e+04,7e+04,8e+04,9e+04/)
;res at cnLevelSelectionMode="AutomaticLevels"
;res at cnFillPalette = "BlAqGrYeOrReVi200"
res at cnFillPalette = "precip3_16lev"

plot=gsn_csm_contour_map(wks,cloud_water_layer,res)

end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150909/e83f8f16/attachment.html 


More information about the ncl-talk mailing list