[ncl-talk] Algebraic operations query

Adam Phillips asphilli at ucar.edu
Wed Sep 9 13:45:05 MDT 2015


Hi Kunal,
I think ncl-talk needs you to be more specific. I'm not sure what you mean
by this:

I also tried
var1= cloud_water_layer / 1000
but did not happen anything

Your syntax is correct (a = b/1000), so if you could tell the group what
exactly is wrong that would help.

As always, please respond to the ncl-talk email list.
Adam

On Wed, Sep 9, 2015 at 3:46 AM, Kunal Bali <kunal.bali9 at gmail.com> wrote:

> 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
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>


-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150909/e0a46bab/attachment.html 


More information about the ncl-talk mailing list