Re: uv2dvF and uv2vrF NaN values

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Feb 20 2014 - 08:53:37 MST

Hi Jon,

If *any* NCL function is returning NaN, this is a problem. They should be returning missing values or else issuing some kind of error.

Can you provide the two NetCDF files online? You can use our ftp:

http://www.ncl.ucar.edu/report_bug.shtml#HowToFTP

--Mary

On Feb 19, 2014, at 3:50 PM, jonathan meyer <tallj03@hotmail.com> wrote:

> Good afternoon NCL-ers,
>
> I am computing ageostrophic winds using actual winds and geostrophic winds. In order to convince myself the ageostrophic wind fields satisfy the mathematics of the atmosphere I am computing the divergence and vorticity of the ageostrophic winds which should equal zero everywhere.
>
> Using the uv2dvF and uv2vrF functions to compute these two fields returns NaN values for the entire array. I've confirmed there are no missing data, and the dataset is on a global fixed grid with the latitude monotonically increasing (-90 to 90).
>
>
>
> My question:
>
> Is the return of NaN an artifact of the functions where divergence/vorticity is actually zero?
>
> I've tested these functions using actual U and V winds and they return appropriate ranges of values, so something is unique to the ageostrophic winds.
>
> Thanks in advance,
> Jon
>
>
> My Code Snippet
>
> begin
> ;==================================================================
> print("ESTABLISH CCSM FILES AND RETRIEVE DIMENSION INFO")
> ; =================================================================
>
> f1_in = addfile(dir1 + "CCSM_REG_U_test1979.nc", "r")
> f2_in = addfile(dir2 + "CCSM_REG_V_test1979.nc", "r")
>
> lev = f1_in->lev
> lat = f1_in->lat2(::-1)
> lon = f1_in->lon2
>
> n_lev = dimsizes(lev)
>
> ; =================================================================
> print("READ IN CCSM DATA")
> ; =================================================================
>
> Ug = f1_in->Ug(:,:,::-1,:)
> U = f1_in->U( :,:,::-1,:)
>
> Vg = f2_in->Vg(:,:,::-1,:)
> V = f2_in->V( :,:,::-1,:)
>
> ; =================================================================
> print("COMPUTE AGEOSTROPHIC WINDS")
> ; =================================================================
>
> Ua = U-Ug
> Va = V-Vg
>
> ; =================================================================
> print("COMPUTE DIVERGENCE AND VORTICITY OF AGEOSTROPHIC WINDS")
> ; =================================================================
>
> print(num(ismissing(Ua)))
> print(num(ismissing(Va)))
>
> div = uv2dvF(Ua,Va)
> vor = uv2vrF(Ua,Va)
>
> ****RESOURCE SETTING BLAH BLAH*******
>
> do z = 0, n_lev-1
> print("Plotting level " + lev(z))
>
> resdiv@gsnCenterString = "Divergence"
> plot(0) = gsn_csm_contour_map_ce(wks, div(0,z,:,:), resdiv)
>
> resvor@gsnCenterString = "Vorticity"
> plot(1) = gsn_csm_contour_map_ce(wks, vor(0,z,:,:), resvor)
>
> resP@txString = "00Z 1 July 1979 "+ lev(z) + "-mb"
> gsn_panel(wks,plot, (/2,1/), resP)
>
> end do
>
>
> end
>
>
>
> When Running the code:
>
> See http://www.ncl.ucar.edu/ for more details.
> (0) ESTABLISH CCSM FILES AND RETRIEVE DIMENSION INFO
> (0) READ IN CCSM DATA
> (0) COMPUTE AGEOSTROPHIC WINDS
> (0) COMPUTE DIVERGENCE AND VORTICITY OF AGEOSTROPHIC WINDS
> (0) 0
> (0) 0
> (0) Plotting level 30
> warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible:[errno=1101]
> warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible:[errno=1101]
> (0) Plotting level 50
> warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible:[errno=1101]
> warning:ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible:[errno=1101]
>
>
>
>
>
>
> _______________________________________________
> 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 Thu Feb 20 08:53:49 2014

This archive was generated by hypermail 2.1.8 : Mon Mar 03 2014 - 14:26:18 MST