<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Because you’re using ****_Wrap() the function tries to take information about the dimension it is operating on and attach that information to the new variable.&nbsp;</div><div class=""><br class=""></div><div class="">e.g. if you averaged over a dimension named time: the new variable will have the below attribute. &nbsp;</div><div class="">average_op_ncl :<span class="Apple-tab-span" style="white-space: pre;">        </span>dim_avg_n over dimension(s): time</div><div class=""><br class=""></div><div class="">You could define T_plane (and others) to have a coordinate name for the left most dimension but it doesn’t matter to the result.&nbsp;</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class=""><div class="">T_plane &nbsp; = new((/ens_size,dimy,dimx/),"float”)</div></div></blockquote>T_plane!0 = “ensembles”</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Alan</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">##############################<br class="">Alan Brammer,<div class="">Post-Doc Researcher</div><div class=""><br class=""></div><div class="">Department of Atmospheric and&nbsp;Environmental Sciences,<br class="">University at Albany,&nbsp;State University of New&nbsp;York,&nbsp;Albany, NY, 12222<div class=""><a href="mailto:abrammer@albany.edu" class="">abrammer@albany.edu</a><br class="">##############################</div></div></div></span></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 9 Feb 2017, at 21:56, qiuxiaobin.tj &lt;<a href="mailto:qiuxiaobin.tj@qq.com" class="">qiuxiaobin.tj@qq.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi All</div><div class=""><br class=""></div><div class="">I always met a warning:</div><div class="">Dimension (0) has not been defined&nbsp;</div><div class="">when use &nbsp;dim_stddev_n_Wrap or dim_variance_n_Wrap to compute ensemble std or var on given height. I'm not sure about the result calculate from dim_stddev_n_Wrap. Does anyone has met this warning and give me some advise? Thanks a lot.&nbsp;</div><div class=""><br class=""></div><div class="">-------------------------------------------------------------------------------</div><div class="">Here is the output</div><div class=""><br class=""></div><div class=""><div class="">&nbsp;Copyright (C) 1995-2015 - All Rights Reserved</div><div class="">&nbsp;University Corporation for Atmospheric Research</div><div class="">&nbsp;NCAR Command Language Version 6.3.0</div><div class="">&nbsp;The use of this software is governed by a License Agreement.</div><div class="">&nbsp;See <a href="http://www.ncl.ucar.edu/" class="">http://www.ncl.ucar.edu/</a> for more details.</div><div class="">(0)<span class="Apple-tab-span" style="white-space:pre">        </span>================================================================</div><div class="">(0)<span class="Apple-tab-span" style="white-space:pre">        </span>Time 2013-05-31_21:00:00 0</div><div class="">(0)<span class="Apple-tab-span" style="white-space:pre">        </span>Read in prior</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Variable: fils</div><div class="">Type: string</div><div class="">Total Size: 16 bytes</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2 values</div><div class="">Number of Dimensions: 1</div><div class="">Dimensions and sizes:<span class="Apple-tab-span" style="white-space:pre">        </span>[2]</div><div class="">Coordinates:&nbsp;</div><div class="">(0)<span class="Apple-tab-span" style="white-space:pre">        </span>/home/qiuxb/WRF_DART/Data/20130531/CONV_12/Plot/WRFOUT/wrffcst_d01_2013-05-31_21:00:00_1</div><div class="">(1)<span class="Apple-tab-span" style="white-space:pre">        </span>/home/qiuxb/WRF_DART/Data/20130531/CONV_12/Plot/WRFOUT/wrffcst_d01_2013-05-31_21:00:00_2</div><div class="">warning:Dimension (0) has not been defined</div><div class="">(0)<span class="Apple-tab-span" style="white-space:pre">        </span>Read in post</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Variable: fils</div><div class="">Type: string</div><div class="">Total Size: 16 bytes</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2 values</div><div class="">Number of Dimensions: 1</div><div class="">Dimensions and sizes:<span class="Apple-tab-span" style="white-space:pre">        </span>[2]</div><div class="">Coordinates:&nbsp;</div><div class="">(0)<span class="Apple-tab-span" style="white-space:pre">        </span>/home/qiuxb/WRF_DART/Data/20130531/CONV_12/Plot/WRFOUT/wrfout_d01_2013-05-31_21:00:00_1</div><div class="">(1)<span class="Apple-tab-span" style="white-space:pre">        </span>/home/qiuxb/WRF_DART/Data/20130531/CONV_12/Plot/WRFOUT/wrfout_d01_2013-05-31_21:00:00_2</div><div class="">warning:Dimension (0) has not been defined</div><div class="">(0)<span class="Apple-tab-span" style="white-space:pre">        </span>------------------temp------------------</div></div><div class=""><br class=""></div><div class="">-------------------------------------------------------------------------------</div><div class="">Here is the scripts</div><div class=""><br class=""></div><div class=""><div class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div><div class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"</div><div class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</div><div class=""><br class=""></div><div class="">;-----------------------------------------------------------------------------------------</div><div class=""><br class=""></div><div class="">begin</div><div class=""><br class=""></div><div class="">;-----------------------------------------------------------------------------------------</div><div class=""><br class=""></div><div class="">wrfout_dir = "/home/qiuxb/WRF_DART/Data/20130531/CONV_12/Plot/WRFOUT"</div><div class="">plot_dir &nbsp; = "/home/qiuxb/WRF_DART/Data/20130531/CONV_12/Plot/WRFOUT"</div><div class=""><br class=""></div><div class="">prior_post_name = (/ "fcst", "out" /)</div><div class=""><br class=""></div><div class="">dimx = 250</div><div class="">dimy = 200</div><div class="">dimz = 50</div><div class="">ens_size = 2</div><div class=""><br class=""></div><div class="">x_start = 80; 75</div><div class="">x_end &nbsp; = &nbsp;dimx - 75 ;dimx-60</div><div class="">y_start = 65 ;60</div><div class="">y_end &nbsp; = dimy-60 ;dimy-50</div><div class=""><br class=""></div><div class="">type = "png"</div><div class="">wks &nbsp;= gsn_open_wks(type, plot_dir + "/ens_spread" ) &nbsp; &nbsp; ; open a ps file</div><div class=""><br class=""></div><div class="">ntimes = 1</div><div class="">time_ini = "20130531210000"</div><div class="">time_intvl = 5 ; minute</div><div class=""><br class=""></div><div class="">z_intvl = (/ 1, 5, 10, 15, 20, 22, 24, 26, 30, 33 /)</div><div class="">height = 2000 ; msl &nbsp;</div><div class=""><br class=""></div><div class="">;gsn_define_colormap(wks,"BlGrYeOrReVi200")</div><div class="">gsn_define_colormap(wks,"WhBlGrYeRe")</div><div class=""><br class=""></div><div class="">z_mem &nbsp; &nbsp; = new((/dimz,dimy,dimx/),"float") ; grid point height</div><div class="">dbz_mem &nbsp; = new((/ens_size,dimz,dimy,dimx/),"float")</div><div class="">dbz_plane = new((/ens_size,dimy,dimx/),"float")</div><div class="">dbz_prior = new((/dimy,dimx/),"float")</div><div class="">dbz_post &nbsp;= new((/dimy,dimx/),"float")</div><div class="">T_mem &nbsp; &nbsp; = new((/ens_size,dimz,dimy,dimx/),"float")</div><div class="">T_plane &nbsp; = new((/ens_size,dimy,dimx/),"float")</div><div class="">T_prior &nbsp; = new((/dimy,dimx/),"float")</div><div class="">T_post &nbsp; &nbsp;= new((/dimy,dimx/),"float")</div><div class="">P_mem &nbsp; &nbsp; = new((/ens_size,dimz,dimy,dimx/),"float")</div><div class="">P_plane &nbsp; = new((/ens_size,dimy,dimx/),"float")</div><div class="">P_prior &nbsp; = new((/dimy,dimx/),"float")</div><div class="">P_post &nbsp; &nbsp;= new((/dimy,dimx/),"float")</div><div class="">Q_mem &nbsp; &nbsp; = new((/ens_size,dimz,dimy,dimx/),"float")</div><div class="">Q_plane &nbsp; = new((/ens_size,dimy,dimx/),"float")</div><div class="">Q_prior &nbsp; = new((/dimy,dimx/),"float")</div><div class="">Q_post &nbsp; &nbsp;= new((/dimy,dimx/),"float")</div><div class="">U_mem &nbsp; &nbsp; = new((/ens_size,dimz,dimy,dimx/),"float")</div><div class="">U_plane &nbsp; = new((/ens_size,dimy,dimx/),"float")</div><div class="">U_prior &nbsp; = new((/dimy,dimx/),"float")</div><div class="">U_post &nbsp; &nbsp;= new((/dimy,dimx/),"float")</div><div class="">V_mem &nbsp; &nbsp; = new((/ens_size,dimz,dimy,dimx/),"float")</div><div class="">V_plane &nbsp; = new((/ens_size,dimy,dimx/),"float")</div><div class="">V_prior &nbsp; = new((/dimy,dimx/),"float")</div><div class="">V_post &nbsp; &nbsp;= new((/dimy,dimx/),"float")</div><div class="">W_mem &nbsp; &nbsp; = new((/ens_size,dimz,dimy,dimx/),"float")</div><div class="">W_plane &nbsp; = new((/ens_size,dimy,dimx/),"float")</div><div class="">W_prior &nbsp; = new((/dimy,dimx/),"float")</div><div class="">W_post &nbsp; &nbsp;= new((/dimy,dimx/),"float")</div><div class="">;-----------------------------------------------------------------------------------------</div><div class="">time_wrf = systemfunc("da_advance_time.exe " + time_ini + " " + "0m -w")</div><div class="">fin = addfile(wrfout_dir + "/wrfout_d01_" + time_wrf + "_1" + ".nc","r")</div><div class="">z = wrf_user_getvar(fin, "z",0) &nbsp; &nbsp; &nbsp; &nbsp;; grid point height</div><div class="">XLAT &nbsp;= wrf_user_getvar(fin, "XLAT",0)</div><div class="">XLONG = wrf_user_getvar(fin, "XLONG",0)</div><div class=""><br class=""></div><div class="">do tm = 0,ntimes-1</div><div class="">&nbsp; &nbsp; time_wrf = systemfunc("da_advance_time.exe " + time_ini + " " + tostring(time_intvl * tm) + "m -w")</div><div class="">&nbsp; &nbsp; print( "================================================================" )</div><div class="">&nbsp; &nbsp; print( "Time " + time_wrf + " " + tm)&nbsp;</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; print( "Read in prior" )</div><div class="">&nbsp; &nbsp; fils = systemfunc("ls " + wrfout_dir + "/wrffcst_d01_" + time_wrf + "_*")</div><div class="">&nbsp; &nbsp; print(fils)</div><div class="">&nbsp; &nbsp; f = addfiles(fils + ".nc","r")</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; do j=0, ens_size - 1</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; z_mem(:,:,:) &nbsp; &nbsp; = wrf_user_getvar(f[j], "z",0)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; dbz_mem(j,:,:,:) = wrf_user_getvar(f[j],"REFL_10CM",0)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; T_mem(j,:,:,:) &nbsp; = wrf_user_getvar(f[j],"T",0)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; P_mem(j,:,:,:) &nbsp; = wrf_user_getvar(f[j],"P",0)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; Q_mem(j,:,:,:) &nbsp; = wrf_user_getvar(f[j],"QVAPOR",0)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; U_mem(j,:,:,:) &nbsp; = wrf_user_getvar(f[j],"ua",0)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; V_mem(j,:,:,:) &nbsp; = wrf_user_getvar(f[j],"va",0)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; W_mem(j,:,:,:) &nbsp; = wrf_user_getvar(f[j],"wa",0)</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; dbz_plane(j,:,:) = wrf_user_intrp3d(dbz_mem(j,:,:,:),z_mem(:,:,:),"h",height,0.,False)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; T_plane(j,:,:) &nbsp; = wrf_user_intrp3d(T_mem(j,:,:,:),z_mem(:,:,:),"h",height,0.,False)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; P_plane(j,:,:) &nbsp; = wrf_user_intrp3d(P_mem(j,:,:,:),z_mem(:,:,:),"h",height,0.,False)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; Q_plane(j,:,:) &nbsp; = wrf_user_intrp3d(Q_mem(j,:,:,:),z_mem(:,:,:),"h",height,0.,False)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; U_plane(j,:,:) &nbsp; = wrf_user_intrp3d(U_mem(j,:,:,:),z_mem(:,:,:),"h",height,0.,False)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; V_plane(j,:,:) &nbsp; = wrf_user_intrp3d(V_mem(j,:,:,:),z_mem(:,:,:),"h",height,0.,False)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; W_plane(j,:,:) &nbsp; = wrf_user_intrp3d(W_mem(j,:,:,:),z_mem(:,:,:),"h",height,0.,False)</div><div class="">&nbsp; &nbsp; end do</div><div class="">; &nbsp; &nbsp;dbz_prior(:,:) = dim_variance_n_Wrap(dbz_plane, 0)</div><div class="">&nbsp; &nbsp; T_prior &nbsp; = dim_stddev_n_Wrap(T_plane, 0)</div><div class="">; &nbsp; &nbsp;P_prior(:,:) &nbsp; = dim_variance_n_Wrap(P_plane, 0)</div><div class="">; &nbsp; &nbsp;Q_prior(:,:) &nbsp; = dim_variance_n_Wrap(Q_plane, 0)</div><div class="">; &nbsp; &nbsp;U_prior(:,:) &nbsp; = dim_variance_n_Wrap(U_plane, 0)</div><div class="">; &nbsp; &nbsp;V_prior(:,:) &nbsp; = dim_variance_n_Wrap(V_plane, 0)</div><div class="">; &nbsp; &nbsp;W_prior(:,:) &nbsp; = dim_variance_n_Wrap(W_plane, 0)</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; delete(fils)</div><div class="">&nbsp; &nbsp; delete(f)</div><div class="">&nbsp; &nbsp; z_mem = 0.0</div><div class="">&nbsp; &nbsp; dbz_mem = 0.0</div><div class="">&nbsp; &nbsp; T_mem = 0.0</div><div class="">&nbsp; &nbsp; P_mem = 0.0</div><div class="">&nbsp; &nbsp; Q_mem = 0.0</div><div class="">&nbsp; &nbsp; U_mem = 0.0</div><div class="">&nbsp; &nbsp; V_mem = 0.0</div><div class="">&nbsp; &nbsp; W_mem = 0.0</div><div class="">&nbsp; &nbsp; dbz_plane = 0.0</div><div class="">&nbsp; &nbsp; T_plane = 0.0</div><div class="">&nbsp; &nbsp; P_plane = 0.0</div><div class="">&nbsp; &nbsp; Q_plane = 0.0</div><div class="">&nbsp; &nbsp; U_plane = 0.0</div><div class="">&nbsp; &nbsp; V_plane = 0.0</div><div class="">&nbsp; &nbsp; W_plane = 0.0</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; print( "Read in post" )</div><div class="">&nbsp; &nbsp; fils = systemfunc("ls " + wrfout_dir + "/wrfout_d01_" + time_wrf + "_*")</div><div class="">&nbsp; &nbsp; print(fils)</div><div class="">&nbsp; &nbsp; f = addfiles(fils + ".nc","r")</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; do j=0, ens_size - 1</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; z_mem(:,:,:) &nbsp; &nbsp; = wrf_user_getvar(f[j], "z",0)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; dbz_mem(j,:,:,:) = wrf_user_getvar(f[j],"REFL_10CM",0)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; T_mem(j,:,:,:) &nbsp; = wrf_user_getvar(f[j],"T",0)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; P_mem(j,:,:,:) &nbsp; = wrf_user_getvar(f[j],"P",0)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; Q_mem(j,:,:,:) &nbsp; = wrf_user_getvar(f[j],"QVAPOR",0)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; U_mem(j,:,:,:) &nbsp; = wrf_user_getvar(f[j],"ua",0)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; V_mem(j,:,:,:) &nbsp; = wrf_user_getvar(f[j],"va",0)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; W_mem(j,:,:,:) &nbsp; = wrf_user_getvar(f[j],"wa",0)</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; dbz_plane(j,:,:) = wrf_user_intrp3d(dbz_mem(j,:,:,:),z_mem(:,:,:),"h",height,0.,False)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; T_plane(j,:,:) &nbsp; = wrf_user_intrp3d(T_mem(j,:,:,:),z_mem(:,:,:),"h",height,0.,False)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; P_plane(j,:,:) &nbsp; = wrf_user_intrp3d(P_mem(j,:,:,:),z_mem(:,:,:),"h",height,0.,False)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; Q_plane(j,:,:) &nbsp; = wrf_user_intrp3d(Q_mem(j,:,:,:),z_mem(:,:,:),"h",height,0.,False)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; U_plane(j,:,:) &nbsp; = wrf_user_intrp3d(U_mem(j,:,:,:),z_mem(:,:,:),"h",height,0.,False)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; V_plane(j,:,:) &nbsp; = wrf_user_intrp3d(V_mem(j,:,:,:),z_mem(:,:,:),"h",height,0.,False)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; W_plane(j,:,:) &nbsp; = wrf_user_intrp3d(W_mem(j,:,:,:),z_mem(:,:,:),"h",height,0.,False)</div><div class="">&nbsp; &nbsp; end do</div><div class="">; &nbsp; &nbsp;dbz_post (:,:) = dim_variance_n_Wrap(dbz_plane, 0)</div><div class="">&nbsp; &nbsp; T_post &nbsp; &nbsp;= dim_stddev_n_Wrap(T_plane, 0)</div><div class="">; &nbsp; &nbsp;P_post (:,:) &nbsp; = dim_variance_n_Wrap(P_plane, 0)</div><div class="">; &nbsp; &nbsp;Q_post (:,:) &nbsp; = dim_variance_n_Wrap(Q_plane, 0)</div><div class="">; &nbsp; &nbsp;U_post (:,:) &nbsp; = dim_variance_n_Wrap(U_plane, 0)</div><div class="">; &nbsp; &nbsp;V_post (:,:) &nbsp; = dim_variance_n_Wrap(V_plane, 0)</div><div class="">; &nbsp; &nbsp;W_post (:,:) &nbsp; = dim_variance_n_Wrap(W_plane, 0)</div></div><div class=""><br class=""></div><div class="">end do</div><div class="">end</div><div class=""><br class=""></div><div class="">Best,</div><div class="">Xiaobin</div>_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br class=""></div></blockquote></div><br class=""></body></html>