Sourin,
Your grib data and netcdf data have different map project
or even different location. They can not match each other
automatically.
Yongzuo
________________________________________
From: ncl-talk-bounces@ucar.edu [ncl-talk-bounces@ucar.edu] on behalf of ncl-talk-request@ucar.edu [ncl-talk-request@ucar.edu]
Sent: Tuesday, September 21, 2010 7:19 AM
To: ncl-talk@ucar.edu
Subject: ncl-talk Digest, Vol 82, Issue 33
Send ncl-talk mailing list submissions to
ncl-talk@ucar.edu
To subscribe or unsubscribe via the World Wide Web, visit
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
or, via email, send a message with subject or body 'help' to
ncl-talk-request@ucar.edu
You can reach the person managing the list at
ncl-talk-owner@ucar.edu
When replying, please edit your Subject line so it is more specific
than "Re: Contents of ncl-talk digest..."
Today's Topics:
1. Re: NARCCAP Resolution Problem (Jamie Scott)
2. Re: cannot convert hdf file (Dennis Shea)
3. Re: cannot convert hdf file (David Brown)
4. Re: NARCCAP Resolution Problem (Seth McGinnis)
5. month_to_annual without coordinate outputs
(Arnold.Sullivan@csiro.au)
6. grib data vs netcdf data (sourin saha)
7. spectral analysis (Sudheer Joseph)
----------------------------------------------------------------------
Message: 1
Date: Mon, 20 Sep 2010 14:03:45 -0600
From: Jamie Scott <James.D.Scott@noaa.gov>
Subject: Re: NARCCAP Resolution Problem
To: ncl-talk@ucar.edu
Message-ID: <7F1F59C3-00E8-4695-9FE4-9DE353D672B4@noaa.gov>
Content-Type: text/plain; charset=us-ascii
Check the lat / lon values of the new grid you are interpolating to. The values generated by the example you sent are outside of the NARCCAP domain.
On Sep 20, 2010, at 1:41 PM, ncl-talk-request@ucar.edu wrote:
>
> Message: 1
> Date: Mon, 20 Sep 2010 19:38:43 +0000
> From: "eric.holt@huskers.unl.edu" <eric.holt@huskers.unl.edu>
> Subject: FW: NARCCAP Resolution Problem
> To: "ncl-talk@ucar.edu" <ncl-talk@ucar.edu>
> Message-ID:
> <37DA92CD6F883B4FAC3AAC4CC1AAE569DD40@CH1PRD0104MB018.prod.exchangelabs.com>
>
> Content-Type: text/plain; charset="iso-8859-1"
>
> ________________________________
> From: eric.holt@huskers.unl.edu
> Sent: Saturday, September 18, 2010 1:24 PM
> To: ncl-users@ucar.edu
> Subject: NARCCAP Resolution Problem
>
> Hello,
>
> I am trying to simply plot winds from RCM3-cgcm3 and RCM3-gdfl solutions under NARCCAP. I can run my code at 2 degree resolution, and my image is fine (2reswind.pdf). However, when I run my code at 0.5 degrees, the plot displays choppy data, or none at all (pt5reswind.pdf). This has been bugging me for a while now, can anyone provide a tip on why this is, and what I can do? It would be much appreciated. Thank You!
>
> Here is the error when the 0.5 degree doesn't plot:
>
> warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible :[errno=1101]
>
>
>
> 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/wrf/WRFUserARW.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
>
>
> begin
>
> file1 = "vas_RCM3_cgcm3_2038010103.nc"
> file2 = "uas_RCM3_cgcm3_2038010103.nc"
> file3 = "vas_RCM3_cgcm3_2066010103.nc"
> file4 = "uas_RCM3_cgcm3_2066010103.nc"
>
>
> print("Starting file 1")
> f1 = addfile(file1,"r")
> print("Starting file 2")
> f2 = addfile(file2,"r")
> print("Starting file 3")
> f3 = addfile(file1,"r")
> print("Starting file 4")
> f4 = addfile(file2,"r")
>
> ;===============================
> ;2038-2041
> print("Starting U")
> U10_o = f2->uas(0:5,:,:)
>
>
> print("Starting V")
> V10_o = f1->vas(0:5,:,:)
>
>
> ;Total Wind Calculation
> tot10 = V10_o ; Transfering meta data
> tot10 = sqrt(U10_o^2+V10_o^2)
>
> delete(V10_o)
> delete(U10_o)
>
> ;;2D Arrays of Lat and Lon
> lat2d = f1->lat
> lon2d = f1->lon
>
>
>
> y1 = dim_avg_Wrap( tot10(yc|:,xc|:,time|:))
> printVarSummary(y1)
>
> delete(tot10)
>
> ;;2D Arrays of Lat and Lon
> lat2d = f1->lat
> lon2d = f1->lon
> print(" min="+min(lat2d)+" max="+max(lat2d))
> print(" min="+min(lon2d)+" max="+max(lon2d))
>
> dimlc = dimsizes(lat2d)
> nlat = dimlc(0)
> mlon = dimlc(1)
>
> ; NLAT = 180
> ; MLON = 360
> NLAT = 046
> MLON = 090
>
> dlat = 0.5 ; output lat, in this case dlat=2
> lat = ispan ( 0,NLAT-1,1 )*dlat ; 0-90N, by dlat=0.5, so 0, 0.5N 1N, 1.5N. 90N
> lat!0 = "lat"
> lat@units = "degrees_north"
> lat&lat = lat
>
> dlon = 0.5 ; output lon, in this case dlon=2
> lon = ispan ( 0,MLON-1,1 )*dlon + 180. ; -180W-180E by dlon=2, so -180, -178W... 180E
> lon!0 = "lon"
> lon@units = "degrees_east"
> lon&lon = lon
>
>
> ; ydiff = y2
> ; ydiff = y2 - y1
>
> X2D = triple2grid(ndtooned(lon2d),ndtooned(lat2d),ndtooned(y1(:,:)), lon,lat, False)
> ; X2D = triple2grid2d(ndtooned(lon2d),ndtooned(lat2d),ndtooned(y1(:,:)), lon,lat, False)
> X2D!0 = "lat" ; triple2grid regrids based on a nearest neighbor routine.
> X2D&lat = lat
> X2D!1 = "lon"
> X2D&lon = lon
> X2D@units = y1@units
> printVarSummary(X2D)
> print(" min="+min(X2D)+" max="+max(X2D))
>
> print(" min="+min(lat2d)+" max="+max(lat2d))
> print(" min="+min(lon2d)+" max="+max(lon2d))
>
> ; print (lat)
> ; print (lon)
>
> ;********************************************
> ; create plots
> ;********************************************
> wks = gsn_open_wks ("pdf", "pt5reswind") ; open workstation
> gsn_define_colormap (wks,"gui_default") ; choose color map
>
> sres = True ; plot mods desired for 2x2 array
> sres@gsnAddCyclic = False
> sres@cnFillOn = True ; color fill
> sres@cnLinesOn = False ; no contour lines
> sres@cnLineLabelsOn = False ; no contour labels
> sres@gsnSpreadColors = True ; use total colormap
> sres@gsnSpreadColorStart = 4
> sres@gsnSpreadColorEnd = -1
> sres@cnInfoLabelOn = False ; no contour info label
>
> sres@mpMinLatF = min(lat2d)+1
> sres@mpMaxLatF = max(lat2d)-1
> sres@mpMinLonF = min(lon2d)+1
> sres@mpMaxLonF = max(lon2d)-1
> ; sres@mpMinLonF = 220. ; min(lon2d) - 1
> ; sres@mpMaxLonF = 300. ; max(lon2d) - 1
> sres@mpCenterLonF = 270 ; Centers the plot at 180
>
> sres@gsnFrame = False
> sres@gsnDraw = False
> sres@lbLabelBarOn = False
>
> panres = True ; set up panel resources
> panres@gsnPaperOrientation = "portrait"
> panres@gsnMaximize = True
> panres@gsnPanelLabelBar = True
> ; panres@gsnPanelYWhiteSpacePercent= 3.0
> panres@gsnPanelYWhiteSpacePercent= 0.5
>
> plot = new(1,graphic)
>
> sres@gsnLeftString = "Regridded to 0.5x0.5"
> ; sres@gsnCenterString = "Gridded Precipitation "
> ; plot(1) = gsn_csm_contour_map_ce(wks,X2D,sres) ; Draw new 2x2 grid
> plot = gsn_csm_contour_map_ce(wks,X2D,sres) ; Draw new 2x2 grid
>
> gsn_panel(wks,plot,(/1,1/),panres)
>
> end
>
>
>
> Eric Holt
> Department Of Geosciences
> Graduate Student
> University of Nebraska
> 119 Bessey Hall
> eric.holt@huskers.unl.edu
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20100920/1c6d30ca/attachment.html
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: 2reswind.pdf
> Type: application/pdf
> Size: 165480 bytes
> Desc: 2reswind.pdf
> Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20100920/1c6d30ca/attachment.pdf
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: pt5reswind.pdf
> Type: application/pdf
> Size: 87407 bytes
> Desc: pt5reswind.pdf
> Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20100920/1c6d30ca/attachment-0001.pdf
>
> ------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk@ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> End of ncl-talk Digest, Vol 82, Issue 32
> ****************************************
------------------------------
Message: 2
Date: Mon, 20 Sep 2010 15:07:50 -0600
From: Dennis Shea <shea@ucar.edu>
Subject: Re: cannot convert hdf file
To: "SMITH, JONATHAN WYNN. (GSFC-6133)" <jonathan.smith@nasa.gov>
Cc: "ncl-talk@ucar.edu" <ncl-talk@ucar.edu>
Message-ID: <4C97CD26.2090500@ucar.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
The reason that NCL cannot read anything useful in this file is that it
contains no SDS (scientific datasets). All the data in this file is
stored in Vdata datasets. These are spreadsheet-like entities with
records consisting of multiple named fields where each field can have
its own type and number of elements. Without significant new development
of the NCL interface to HDF4, NCL has no capability to read files like
this one. In other words, this is not a bug.
On 9/14/10 7:23 AM, SMITH, JONATHAN WYNN. (GSFC-6133) wrote:
> Hello, thanks for your help
>
> I sent the file MOPCH-20060520-L1V3.34.2.hdf via ftp. I am trying to open it via ncl_convert2nc
>
> I am using NCL v5.1.0
>
> System: Linux 138.238.124.25 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
>
> Jonathan
>
> Jonathan Wynn Smith
> Student Trainee
> jonathan.smith@nasa.gov
> NASA/Goddard Space Flight Center
> Code 613.3 - Atmospheric Chemistry and Dynamics Branch
> Greenbelt, MD 20771
> 301-614-5956
>
> Doctoral Candidate
> jw_smith@howard.edu
> Howard University Program in Atmospheric Sciences
> Washington, DC 20059
>
> ________________________________________
> From: shea@ucar.edu [shea@ucar.edu]
> Sent: Monday, September 13, 2010 8:39 PM
> To: SMITH, JONATHAN WYNN. (GSFC-6133)
> Cc: ncl-talk@ucar.edu
> Subject: Re: cannot convert hdf file
>
> No file is needed.
>
> To me, it looks like a file name or path is not correct.
>
> If neither is true, you can send the file
>
> ftp ftp.cgd.ucar.edu
> anonymous
> Use your email address for the password
> cd incoming
> put ...
>
> quit
>
> Send us an email with the following information:
>
> * The names of the files after you have successfully completed the
> transfer.
> We cannot look at the ftp/incoming directory for security reasons.
> * The version of NCL you are running (ncl -V).
> * The type of system you are on (uname -a).
>
>> Hello
>> I get the following error when using ncl_convert2nc:
>> fatal:_NclIGetFileVarNames: file does not exist
>> fatal:Execute: Error occurred at or near line 200 in file
>> /tmp/tmp28869.ncl
>>
>> Is there a file that is needed in the netcdf directory?
>>
>> Jonathan
>> Jonathan Wynn Smith
>> Student Trainee, WRF-Chem Modeling and Long-range transport
>> jonathan.smith@nasa.gov
>> NASA/Goddard Space Flight Center
>> Code 613.3/Atmospheric Chemistry and Dynamics Branch
>> Greenbelt, MD
>> 301-614-5956
>>
>> Doctoral Candidate
>> jonathan.smith@bison.howard.edu
>> Howard University Program in Atmospheric Sciences
>> Washington, DC
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
------------------------------
Message: 3
Date: Mon, 20 Sep 2010 15:38:26 -0600
From: David Brown <dbrown@ucar.edu>
Subject: Re: cannot convert hdf file
To: "ncl-talk@ucar.edu NCL" <ncl-talk@ucar.edu>
Message-ID: <5D50C1B6-4B1B-4BED-B118-5E1402532575@ucar.edu>
Content-Type: text/plain; charset="us-ascii"
The reason that NCL cannot read anything useful in this file is that
it contains no SDS (scientific datasets). All the data in this file
is stored in Vdata datasets. These are spreadsheet-like entities with
records consisting of multiple named fields where each field can have
its own type and number of elements. Without significant new
development of the NCL interface to HDF4, NCL has no capability to
read files like this one. In other words, this is not a bug at least
with respect to NCL itself.
However, the error message emitted by ncl_convert2nc is confusing to
say the least. Since ncl_filedump is able to print out the global
attributes, it seems that ncl_convert2nc should at least put out a
file with the attributes, along with a message that no readable
variables could be found in the file. I will file a ticket for this
problem.
-dave
On Sep 13, 2010, at 2:49 PM, SMITH, JONATHAN WYNN. (GSFC-6133) wrote:
> Hello
> I get the following error when using ncl_convert2nc:
> fatal:_NclIGetFileVarNames: file does not exist
> fatal:Execute: Error occurred at or near line 200 in file /tmp/
> tmp28869.ncl
>
> Is there a file that is needed in the netcdf directory?
>
> Jonathan
> Jonathan Wynn Smith
> Student Trainee, WRF-Chem Modeling and Long-range transport
> jonathan.smith@nasa.gov
> NASA/Goddard Space Flight Center
> Code 613.3/Atmospheric Chemistry and Dynamics Branch
> Greenbelt, MD
> 301-614-5956
>
> Doctoral Candidate
> jonathan.smith@bison.howard.edu
> Howard University Program in Atmospheric Sciences
> Washington, DC
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20100920/f3032c03/attachment.html
------------------------------
Message: 4
Date: Mon, 20 Sep 2010 16:06:36 -0600
From: "Seth McGinnis" <mcginnis@ucar.edu>
Subject: Re: NARCCAP Resolution Problem
To: ncl-talk@ucar.edu
Message-ID: <web-32067924@mail.ucar.edu>
Content-Type: text/plain;charset=utf-8
Hi Eric,
If all you want to do is plot the data, you don't need to regrid it. If you
attach the lat & lon arrays to your y1 variable as @lat2d and @lon2d
attributes, you should be able to pass y1 to gsn_csm_contour_map_ce as-is.
For a more elaborate example, here's the general-purpose script that we use for
plotting NARCCAP data during the quality-checking process:
http://www.narccap.ucar.edu/contrib/tools/plot.ncl
The triple2grid function reassigns each of the input points to the nearest
output gridcell, which is almost certain to produce gaps unless the output
gridcells are bigger than the average spacing of the input data. If what you
want is to fill in a regular lat/lon grid at some arbitrary resolution using
values based on data from a curvilinear grid, then I would suggest using an
interpolation function like rcm2points instead.
Cheers,
--Seth
---- Seth McGinnis NARCCAP Data & User Community Manager Associate Scientist RISC / IMAGe / NCAR ---- >________________________________ >From: eric.holt@huskers.unl.edu >Sent: Saturday, September 18, 2010 1:24 PM >To: ncl-users@ucar.edu >Subject: NARCCAP Resolution Problem > >Hello, > >I am trying to simply plot winds from RCM3-cgcm3 and RCM3-gdfl solutions under >NARCCAP. I can run my code at 2 degree resolution, and my image is fine >(2reswind.pdf). However, when I run my code at 0.5 degrees, the plot displays >choppy data, or none at all (pt5reswind.pdf). This has been bugging me for a >while now, can anyone provide a tip on why this is, and what I can do? It >would be much appreciated. Thank You! > ------------------------------ Message: 5 Date: Tue, 21 Sep 2010 11:16:27 +1000 From: <Arnold.Sullivan@csiro.au> Subject: month_to_annual without coordinate outputs To: <ncl-talk@ucar.edu> Message-ID: <1F5B22034A0A5648AEA84495CD25D20401C97AF565@exvic-mbx05.nexus.csiro.au> Content-Type: text/plain; charset="us-ascii" I try to use month_to_annual, and find out that the "time" coordinate is not in the output. fatal:No coordinate variable exists for dimension "time" in variable "var" Cheers, Arnold -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20100921/4522e105/attachment.html ------------------------------ Message: 6 Date: 21 Sep 2010 05:38:47 -0000 From: "sourin saha" <sourin2k@rediffmail.com> Subject: grib data vs netcdf data To: <ncl-talk@ucar.edu> Message-ID: <20100921053847.23637.qmail@f4mail-235-237.rediffmail.com> Content-Type: text/plain; charset="utf-8" Respected Sir/Mam, I am sending you 2 scripts for plotting of temperature over part of south pole from grib data and again through netcdf data. My grib plot is coming right but the netcdf is not showing any contour. but if i comment the following 4 lines, it plots but then both plots doesn't match with each other. tc2!0 = "xlat" tc2!1 = "xlon" tc2&xlat = xlat tc2&xlon = xlon thanking you sir/mam Sourin Saha -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20100921/79a75fb6/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: maitri_temp_grib.ncl Type: application/octet-stream Size: 5622 bytes Desc: not available Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20100921/79a75fb6/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: maitri_temp_nc.ncl Type: application/octet-stream Size: 5472 bytes Desc: not available Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20100921/79a75fb6/attachment-0001.obj ------------------------------ Message: 7 Date: Tue, 21 Sep 2010 17:49:18 +0530 From: Sudheer Joseph <sjo.india@gmail.com> Subject: spectral analysis To: ncl-talk@ucar.edu Message-ID: <AANLkTimxPa+_pv9oTicKx4KzEpgjrMEfntiTCnN8QOz_@mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" Dear Users, I have modified the script spec_3.ncl which is from http://www.ncl.ucar.edu/Applications/Scripts/spec_3.ncl to suite the attached data bps_iso_box.nc and obtained the attached figure. But I have the below questions on this 1) the original script was for monthly data and the xaxis is coming as cycles/month can ncl take care of the time axis? ie my in put data is daily so does ncl recognise this and do the need full so that if I simply change the x axis title will the plot be correct? or do I need to change some where in library and make ncl know that I am imputing daily data? 2) The confidence level looks some thing odd (to me) do I need to modify some where so that the confidence level will be computed as per my input data? kindly answer the above 2 questions if any one used these excellent functions earlier. -- with best regards Sudheer ********************************************************************************** Sudheer Joseph Scientist Indian National Centre for Ocean Information Services (INCOIS) Ocean Valley, Post Box No# 21, IDA Jeedimetla P.O. Hyderabad, Ranga Reddy District - 500 055 Andhra Pradesh, India. TEl:+91-40-23044600(R),Tel:+91-9440832534(Mobile) Tel:+91-40-23886047(O),Fax:+91-40-23892910(O) E-mail:sjo@rediffmail.com; sudheer.joseph@yahoo.com;? sjo@incois.gov.in. Web- http://oppamthadathil.tripod.com ? ? ? ? ?? --------------* --------------- "The ultimate measure of a man is not where he stands in moments of comfort and convenience, but where he stands at times of challenge and controversy." ? ? ? ? ? ? ? ? ? ? ? ? Martin Luther King, Jr. "What we have done for ourselves alone dies with us. What we have done for others and the world remains and is immortal." - Albert Pines -------------- next part -------------- A non-text attachment was scrubbed... Name: sjo_spec_conf.ncl Type: application/octet-stream Size: 2139 bytes Desc: not available Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20100921/1e269cdc/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: bps_iso_box.nc Type: application/x-netcdf Size: 32948 bytes Desc: not available Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20100921/1e269cdc/attachment.nc -------------- next part -------------- A non-text attachment was scrubbed... Name: spec1.gif Type: image/gif Size: 7990 bytes Desc: not available Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20100921/1e269cdc/attachment.gif ------------------------------ _______________________________________________ ncl-talk mailing list ncl-talk@ucar.edu http://mailman.ucar.edu/mailman/listinfo/ncl-talk End of ncl-talk Digest, Vol 82, Issue 33 **************************************** _______________________________________________ ncl-talk mailing list List instructions, subscriber options, unsubscribe: http://mailman.ucar.edu/mailman/listinfo/ncl-talkReceived on Tue Sep 21 08:27:32 2010
This archive was generated by hypermail 2.1.8 : Mon Oct 04 2010 - 08:55:55 MDT