<div dir="ltr"><div dir="ltr">I think it will work if you get z on the staggered vertical grid. Instead of using wrf_user_getvar to get 'z', just compute the staggered z yourself (it's easy).<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">ph = wrf_user_getvar(f, "PH", -1)<br>phb = wrf_user_getvar(f, "PHB", -1)<br>z_stag = (PH + PHB)/9.81</blockquote><div><br></div><div>You can then use this as your height variable for your TKE interpolation.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">tke_full = wrf_user_intrp3d(tke, z_stag, "h", height, 0., False)</blockquote><div><br></div><div>Alternatively, you could unstagger TKE to the mass grid using wrf_user_unstagger (see <a href="https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_unstagger.shtml">https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_unstagger.shtml</a>). Your choice.</div><div><br></div><div>Hope this helps,</div><div><br></div><div>Bill</div><div><div><br></div><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 6, 2018 at 10:33 AM Mary Haley <<a href="mailto:haley@ucar.edu">haley@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">Alina,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Sorry, I missed that this message was directed at me specifically.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The link you provided is bad. Did you ever get help from MMM on the issue? They are really the folks that should be answering this question. NCL doesn't currently have a WRF function to do an interpolation on a variable that has a different number of levels than the level array itself.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 27, 2018 at 10:20 AM, Schuster Alina <span dir="ltr"><<a href="mailto:436803016250@yandex.ru" target="_blank">436803016250@yandex.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Dear Mary,</div><div> </div><div>Thank you very much for the reply. I still need to solve this problem (was just distracted by other urgent matters). I have posted this question on <a href="http://forum.mmm.ucar.edu/phpBB3/viewtopic.php?f=49&t=330" target="_blank">http://forum.mmm.ucar.edu/phpBB3/viewtopic.php?f=49&t=330</a> . May be you or colleques could look into it?</div><div>Thank you very much for your help.</div><div> </div><div>Best regards,</div><div>Alina Schuster</div><div> </div><div> </div><div>19.10.2018, 17:22, "Mary Haley" <<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>>:</div><blockquote type="cite"><div><div class="m_6199453371221255457h5"><div>Ehsan,<br><br>The problem is that the tke variable has one more level than the z variable because it's on a staggered set of levels<span style="font-size:small"> and the "z" array you gave it is not</span>. The wrf_user_intrp3d routine only works on a z array with the same number of levels.<div> </div><div style="font-size:small">To be clear, the purpose of wrf_user_intrp3d is not to interpolate from one set of levels to another, but rather to interpolate a 3D grid onto a 2D plane. This requires that you do this using the same vertical levels that define the vertical dimension of your 3D grid. You should look on your WRF output file to find the 1D vertical levels of length bottom_top_stag (31) that represent the levels of TKE.</div><div style="font-size:small"> </div><div style="font-size:small">If you still need help with this, then I suggest writing to the new WRF help forum:</div><br><a rel="noopener noreferrer" href="http://forum.mmm.ucar.edu/phpBB3/" target="_blank">http://forum.mmm.ucar.edu/phpBB3/</a><br><br>You'll see a link to "Post-processing/Utilities" and you can post your question there.</div><div> </div><div><span style="font-size:small">Good luck,</span></div><div> </div><div><span style="font-size:small">--Mary</span></div><div> </div><div> <div>On Tue, Oct 16, 2018 at 12:22 PM, Ehsan Taghizadeh <span><<a rel="noopener noreferrer" href="mailto:ehsantaghizadeh@yahoo.com" target="_blank">ehsantaghizadeh@yahoo.com</a>></span> wrote:<blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="font-family:bookman old style,new york,times,serif;font-size:16px"><div> </div><div>Dear Mary,</div><div> </div><div>I have same problem as Alina. May I answer your question about printVarSummary(z,tke)?</div><div>Following are the answers:</div><div> </div><div> </div><div>Variable: tke</div><div>Type: float</div><div>Total Size: <span>1008886320</span> bytes</div><div> <span>252221580</span> values</div><div>Number of Dimensions: 4</div><div>Dimensions and sizes: [Time | 61] x [<span style="background-color:#fdf869">bottom_top_stag</span> | 31] x [south_north | 342] x [west_east | 390]</div><div>Coordinates:</div><div><span>Number Of Attributes: 6</span></div><div><span> FieldType : 104</span></div><div><span> MemoryOrder : XYZ</span></div><div><span> description : TKE from PBL</span></div><div> units : m2 s-2</div><div><span> stagger : Z</span></div><div><span> coordinates : XLONG XLAT XTIME</span></div><div> </div><div>Variable: z</div><div>Type: float</div><div>Total Size: <span>976341600</span> bytes</div><div> <span>244085400</span> values</div><div>Number of Dimensions: 4</div><div>Dimensions and sizes: [Time | 61] x [<span style="background-color:#fdf869">bottom_top</span> | 30] x [south_north | 342] x [west_east | 390]</div><div>Coordinates:</div><div>Number Of Attributes: 6</div><div> coordinates : XLONG XLAT</div><div> stagger :</div><div> units : m</div><div> description : Height</div><div> MemoryOrder : XYZ</div><div> FieldType : 104 </div></div><div>It seems the only difference is about (bottom_top) and (bottom_top_stag) dimension names.</div><div>I think "wrf_user_interp3d" doesn't work for TKE_PBL? I also used this script (<a rel="noopener noreferrer" href="http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/LEVELS_INTERP/wrf_Height2.ncl" target="_blank">http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/LEVELS_INTERP/wrf_Height2.ncl</a>) for "TKE_PBL" variable of WRF, but same error has occured:</div><div> </div><div><span>"<span>mension size mismatch, dimension (1) of left hand side reference does not have the same size as the right hand side reference after subscripting.</span>"</span></div><div> </div><div>Sincerely</div><div><span><font color="#888888">Ehsan</font></span></div></blockquote></div><div style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;color:#26282a"><div>On Tuesday, October 16, 2018, 9:31:43 PM GMT+3:30, Mary Haley <<a rel="noopener noreferrer" href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>> wrote:</div><div> </div><div> </div><div style="font-size:small">Hi Alina,</div><div style="font-size:small"> </div><div style="font-size:small">I'm guessing that the error is in how wrf_user_intrp3d is being called. If you look at the documentation:</div><div style="font-size:small"> </div><div><a rel="noopener noreferrer" href="http://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_intrp3d.shtml" target="_blank">http://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_intrp3d.shtml</a></div><div> </div><div>and read the section on input arguments, it takes that the first two input arrays must be the same size, which in your case is tke and z. Did you do a printVarSummary on z to see what size it is? </div><div> </div><div>--Mary</div><div> </div></div><div> <div>On Thu, Oct 11, 2018 at 9:41 AM, Schuster Alina <span><<a rel="noopener noreferrer" href="mailto:alina-galchenko@yandex.ru" target="_blank">alina-galchenko@yandex.ru</a>></span> wrote:<br> <blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex">Dear colleagues!<br><br>I am using a scm wrf model (an idealised case) and need to plot a variable TKE (turbulent kinetic energy) vs time and height. But I get an error<br><br>fatal:Dimension size mismatch, dimension (1) of left hand side reference does not have the same size as the right hand side reference after subscripting.<br>fatal:["Execute.c":8640]: Execute: Error occurred at or near line 246 in file /home/alina/NCL64/lib/ncarg/ nclscripts/wrf/WRFUserARW.ncl<br><br>fatal:["Execute.c":8640]: Execute: Error occurred at or near line 29 in file TKE.ncl<br><br>I don't know how to fix it.<br><br>Line 246 contains:<br> if ( nd .eq. 4 ) then<br> var3(0,:,:,:,:) = var3d(:,:,:,:)<br> z(0,:,:,:,:) = z_in(:,:,:,:)<br> end if<br><br>Don't know what's wrong. It can be the problem is with the variable TKE and its 4 dimensions:<br>Variable: tke<br>Type: float<br>Total Size: 57600 bytes<br> 14400 values<br>Number of Dimensions: 4<br>Dimensions and sizes: [Time | 60] x [bottom_top_stag | 60] x [south_north | 2] x [west_east | 2]<br>Coordinates:<br> Time: [ 0.. 59]<br>Number Of Attributes: 6<br> FieldType : 104<br> MemoryOrder : XYZ<br> description : TKE from PBL<br> units : J<br> stagger : Z<br> coordinates : XLONG XLAT XTIME<br><br>May be someone could advise me an alternative to the command wrf_user_intrp3d or may be someone has a ready script for TKE vs height and time (gsn_csm_contour).<br>Thanks in advance!<br><br>Best Regards,<br>Alina Schuster<br><br>______________________________ _________________<br>ncl-talk mailing list<br><a rel="noopener noreferrer" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>List instructions, subscriber options, unsubscribe:<br><a rel="noopener noreferrer" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/ mailman/listinfo/ncl-talk</a><br> </blockquote></div><div>_______________________________________________<br>ncl-talk mailing list<br><a rel="noopener noreferrer" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>List instructions, subscriber options, unsubscribe:<br><a rel="noopener noreferrer" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></div><br>_______________________________________________<br>ncl-talk mailing list<br><a rel="noopener noreferrer" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>List instructions, subscriber options, unsubscribe:<br><a rel="noopener noreferrer" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br> </div></div></div></div>,<span><p>_______________________________________________<br>ncl-talk mailing list<br><a rel="noopener noreferrer" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>List instructions, subscriber options, unsubscribe:<br><a rel="noopener noreferrer" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></p></span></blockquote><span class="m_6199453371221255457HOEnZb"><font color="#888888"><div> </div><div> </div><div>-- </div><div>Best Regards,</div><div>Alina Schuster</div><div> </div></font></span></blockquote></div><br></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>