[ncl-talk] Problem in masking out the ocean

Priyanka Silva priyankakeraminiya6 at gmail.com
Fri Apr 7 07:34:41 MDT 2017


Hi,

I want to plot precipitation over land area. So I  tried to create an ocean
mask for global precipitation but my plot does not show precipitation over
land areas. When I plot I could see the following warning.



(0)     check_for_y_lat_coord: Warning: Data either does not contain a
valid latitude coordinate array or doesn't contain one at all.

(0)     A valid latitude coordinate array should have a 'units' attribute
equal to one of the following values:

(0)         'degrees_north' 'degrees-north' 'degree_north' 'degrees north'
'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'

(0)     check_for_lon_coord: Warning: Data either does not contain a valid
longitude coordinate array or doesn't contain one at all.

(0)     A valid longitude coordinate array should have a 'units' attribute
equal to one of the following values:

(0)         'degrees_east' 'degrees-east' 'degree_east' 'degrees east'
'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'



My script and plot are as follows.

Greatly appreciate your help.

Thank you.







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"

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/diagnostics_cam.ncl"

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"

;----------------------------------------------------------------------------

begin

f   =  addfile("mon.precip.nc","r")

precip = f->precip(0,:,:)



a = addfile("landsea.nc","r")

lsdata = a->LSMASK

lsm = landsea_mask(lsdata,precip&lat,precip&lon)

precip1 = mask(precip,lsm.eq.0,False)

printVarSummary(precip1)



wks1 =gsn_open_wks("X11","precip_mod1")

gsn_define_colormap(wks1,"BrownBlue12")



res1 = True

res1 at cnLinesOn = False

res1 at cnFillOn = True ; turn color on

res1 at gsnSpreadColors = True

res1 at tiMainString = " precipitation"



plot = gsn_csm_contour_map_ce(wks1,precip1,res1)

end





 [image: Inline image 1]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170407/ab3453b6/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 47191 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170407/ab3453b6/attachment.png 


More information about the ncl-talk mailing list