Re: areal average for ocean or land or [fatal:syntax error: possibly an undefined procedure]

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Jan 02 2013 - 15:33:19 MST

Sorry about that. You need V6.1.0 of NCL in order to have access to the gsn_coordinates and gsn_add_shapefile_polylines functions.

I have attached a script that contains both.

You will need to add another load command:

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 "./gsn_coordinates.ncl"

Or, you can comment out the call to gsn_coordinates, since this is mostly for debug purposes.

If you need to propagate the 2D mask to a 2D array, then you can use "conform":

u_land_mask_3d = conform(u,u_land_mask,(/1,2/))

--Mary

On Dec 28, 2012, at 4:23 PM, rafael dido wrote:

> NCL users,
>
> Thanks Mary for the shpfile's link.
> I modified the attached script, executed it and found some errors:
>
>
> gsn_coordinates(wks,map_data,u,mkres)
> -----------------------------------------^
>
> fatal:syntax error: possibly an undefined procedure
> fatal:syntax error: line 219 before or near \n
> gsn_coordinates(wks,map_land_mask,u_land_mask,mkres)
> --------------------------------------------------------^
>
> fatal:syntax error: possibly an undefined procedure
> fatal:syntax error: line 220 before or near \n
> gsn_coordinates(wks,map_ocean_mask,u_ocean_mask,mkres)
> ----------------------------------------------------------^
>
> fatal:syntax error: possibly an undefined procedure
> fatal:Syntax Error in block, block not executed
> fatal:error at line 245
>
> =====
>
> ariable: u
> Type: float
> Total Size: 44640 bytes
> 11160 values
> Number of Dimensions: 2
> Dimensions and sizes: [lat | 31] x [lon | 360]
> Coordinates:
> lat: [ -15.. 15]
> lon: [ 0.. 359]
> Number Of Attributes: 5
> time : 2923.5
> missing_value : -1e+34
> _FillValue : -1e+34
>
> =====
>
> and one remaining query is how could I mask all the time dimension
> thus allow me to calculate easily the areal average at given range time period.
>
> Thank you.
> Raf
>
>
>
>
> On Fri, Dec 28, 2012 at 10:04 AM, Mary Haley <haley@ucar.edu> wrote:
> Hi Rafael,
>
> Did you make sure that you don't already have a landsea mask on your data file? Or perhaps you have one, but it's on a different file?
>
> If you don't have one, then you can create one from a shapefile. This is a one time thing, and then you can write this new mask array to a NetCDF file so you don't have to keep creating it from scratch.
>
> Please see example mask_12.ncl at:
>
> http://www.ncl.ucar.edu/Applications/mask.shtml#ex12
>
> I found the shapefile by googling "coastal shapefiles" or something like that. The shapefile came from NOAA:
>
> http://www.ngdc.noaa.gov/mgg/shorelines/data/gshhs/version2.2.0/
>
> --Mary
>
> On Dec 27, 2012, at 12:46 PM, rafael dido wrote:
>
> > Hallo NCL users,
> >
> > I have 5 years datasets [time x lat x lon] 1 deg resolutions and recently attempting to calculate areal average for
> > land or ocean only using masking function. I look into some documentations such as http://www.ncl.ucar.edu/Applications/Scripts/mask_1.ncl
> > and I just wonder how can i get the mask file for my purpose or is there any other simple way to mask the land or ocean, and afterwards calculate the areal avergae
> > for multiyear data ?
> >
> > Thanks for the hints and response.
> >
> > Raf.
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> <mask.ncl>_______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Wed Jan 2 15:34:10 2013

This archive was generated by hypermail 2.1.8 : Fri Jan 04 2013 - 15:34:10 MST