<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="">Hi. Perhaps the listed examples for the center_finite_difference function will help?</div><div class=""><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/center_finite_diff.shtml" class="">http://www.ncl.ucar.edu/Document/Functions/Built-in/center_finite_diff.shtml</a> </div>This, combined with Dennis’s code will help with determining MFC. <div class="">-Erik Noble</div><div class=""><br class=""><div class=""><div><blockquote type="cite" class=""><div class="">Date: Mon, 29 Dec 2014 15:46:47 +1100<br class="">From: tms_l <<a href="mailto:littithomas@gmail.com" class="">littithomas@gmail.com</a>><br class="">Subject: Re: [ncl-talk] vertically integrated moisture flux<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>convergence in<span class="Apple-tab-span" style="white-space:pre">        </span>nil<br class="">To: Kyle Griffin <<a href="mailto:ksgriffin2@wisc.edu" class="">ksgriffin2@wisc.edu</a>>, "<a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a>"<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><<a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a>><br class="">Message-ID:<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><<a href="mailto:CA+MEkzs-hk-043YDxHLW+fOgPn4iGRR01Lg=Smzej8M6Opc=bg@mail.gmail.com" class="">CA+MEkzs-hk-043YDxHLW+fOgPn4iGRR01Lg=Smzej8M6Opc=bg@mail.gmail.com</a>><br class="">Content-Type: text/plain; charset="iso-8859-1"<br class=""><br class="">hi,<br class=""><br class=""><br class="">thank you Kyle<br class=""><br class=""><br class=""><br class=""><br class="">I have calculated the divergence of wind at 850 hPa level and multiplied<br class="">by specific humidity (q) at 850 hPa level.<br class=""><br class="">Moisture flux= q* wind(u,v)<br class=""><br class=""><br class=""><br class="">div=uv2dvG_Wrap(u_850_clim,v_850_clim); divergence at pressure level 850<br class=""><br class="">moisture flux= div*psl_clim ;psl_clim ->specific humidity<br class=""><br class=""><br class=""><br class="">Then I tried to use the function dpres_plevel_Wrap to find out the pressure<br class="">level thickness and will be planning to integrate the moisture flux as<br class="">explained in the example number 2 (<br class=""><a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/dpres_plevel_Wrap.shtml" class="">http://www.ncl.ucar.edu/Document/Functions/Contributed/dpres_plevel_Wrap.shtml</a><br class="">)below<br class="">the explanation for the function dpres_plevel_Wrap.<br class=""><br class=""><br class=""><br class="">When I try to find out dp = *dpres_plevel*<br class=""><http://www.ncl.ucar.edu/Document/Functions/Built-in/dpres_plevel.shtml>(lev,<br class="">psfc, ptop, 0), I am getting the error as follows:<br class=""><br class=""><br class=""><br class="">warning:dpres_plevel: At one or more grid points the sum of the layer<br class="">thicknesses is not equal to (psfc-ptop). Are units of plev, psfc and ptop<br class="">matching?<br class=""><br class="">fatal:Mul: Number of dimensions do not match, can't continue<br class=""><br class=""><br class=""><br class="">however, the units of all lev,psfc,ptop are all similar in the ncl script.<br class=""><br class=""><br class=""><br class="">;==============================<br class=""><br class="">lev = u_ctl ->z11_p_level ;17 pressure levels from u compont of wind data<br class=""><br class=""><br class=""><br class="">ps_ctl= addfile("ps_197001_200112.nc","r") ;surface pressure data<br class=""><br class="">psf = ps_ctl->ps<br class=""><br class="">psfc =psf(:,0:143,:) ; in order to get 144 lat points<br class=""><br class="">ptop = lev(14) ; pressure level 850hPa<br class=""><br class="">dsize=dimsizes(psfc)<br class=""><br class="">lonn=dsize(2)<br class=""><br class="">latn=dsize(1)<br class=""><br class="">n2=30<br class=""><br class=""><br class=""><br class="">ps_jjas=new((/n2,latn,lonn/),float)<br class=""><br class=""><br class=""><br class="">do y=0,n2-1<br class=""><br class="">ps_jjas(y,:,:)=dim_avg_n_Wrap((psfc((4+(y*12)):(7+(y*12)),:,:)),0) ;<br class="">seasonal mean of 30 years<br class=""><br class="">end do<br class=""><br class=""><br class=""><br class="">printVarSummary(psfc)<br class=""><br class="">printVarSummary(ptop)<br class=""><br class="">printVarSummary(lev)<br class=""><br class=""><br class=""><br class="">dp = dpres_plevel(lev, ps_jjas, ptop, 0)<br class=""><br class=""><br class=""><br class=""><br class=""><br class=""><br class=""><br class=""><br class=""><br class="">After calculating dp, I would like to use the function *dim_sum_n_Wrap*<br class=""><http://www.ncl.ucar.edu/Document/Functions/Contributed/dim_sum_n_Wrap.shtml><br class="">to integrate vertically.<br class=""><br class=""><br class=""><br class="">But, I am not sure whether I am moving in a correct way to find out<br class="">vertically integrated moisture flux convergence between two pressure<br class="">levels.<br class=""><br class=""><br class=""><br class="">I am very new to ncl, so I hope some one will help me to sort out the<br class="">problem.<br class=""><br class=""><br class="">any help will be highly appreciated<br class=""><br class=""><br class="">thanks<br class=""><br class=""><br class="">thomas<br class=""><br class="">On Sat, Dec 27, 2014 at 1:02 PM, Kyle Griffin <ksgriffin2@wisc.edu> wrote:<br class=""><br class=""><blockquote type="cite" class="">Thomas,<br class=""><br class="">This is not an NCL issue, this is a science issue. The functions are<br class="">well-documented, as you most definitely seem to understand what each<br class="">function is calculating.<br class=""><br class="">Only YOU can say whether your calculation should include or exclude the<br class="">boundary levels - generally I would include them, but it depends on the<br class="">science you want to do.<br class=""><br class="">If you can calculate the moisture flux itself (a simple calculation), I<br class="">would vertically integrate that and then calculate the divergence of the<br class="">resulting field as this will be more efficient. However, I'm not sure if it<br class="">would yield the same result as calculating the moisture flux divergence and<br class="">then doing the vertical integral - you can certainly try both methods and<br class="">be aware the second method will take longer to calculate.<br class=""><br class="">Don't forget to look at the code that Dennis sent you in a previous email<br class="">as well - some or all of it might help outline what you want to do.<br class=""><br class="">Hope this helps. If not, consult the mathematical equations for this field<br class="">and respond back to ncl-talk if you have issues implementing the<br class="">calculations within your NCL scripts.<br class=""><br class=""><br class="">Kyle<br class=""><br class="">----------------------------------------<br class="">Kyle S. Griffin<br class="">Department of Atmospheric and Oceanic Sciences<br class="">University of Wisconsin - Madison<br class="">Room 1421<br class="">1225 W Dayton St, Madison, WI 53706<br class="">Email: ksgriffin2@wisc.edu<br class=""><br class="">On Thu, Dec 25, 2014 at 9:57 PM, tms_l <littithomas@gmail.com> wrote:<br class=""><br class=""><blockquote type="cite" class="">hi ncl users<br class=""><br class="">I have to calculate the moisture flux convergence between pressure levels<br class="">850hpa AND 200hpa pressure levels..and I THINK i need to consider the<br class="">specific humidity at 850 & 200 hpa pressure levels too ...finally<br class="">integrating between the two pressure levels to get the moisture flux<br class="">convergence...<br class=""><br class="">I already calculated the wind divergence at two pressure levels using the<br class="">function, uv2dvG_Wrap..I am not clear about the next step..<br class=""><br class="">can anyone describe it little more..which functions i need to select for<br class="">calculating the moisture flux convergence..<br class=""><br class=""> thanks in advance<br class=""><br class="">thomas<br class=""><br class="">_______________________________________________<br class="">ncl-talk mailing list<br class="">List instructions, subscriber options, unsubscribe:<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br class=""><br class=""><br class=""></blockquote><br class=""></blockquote>-------------- next part --------------<br class="">An HTML attachment was scrubbed...<br class="">URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141229/92df468a/attachment-0001.html <br class=""><br class="">------------------------------<br class=""><br class="">_______________________________________________<br class="">ncl-talk mailing list<br class="">ncl-talk@ucar.edu<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br class=""><br class=""><br class="">End of ncl-talk Digest, Vol 133, Issue 33<br class="">*****************************************<br class=""></div></blockquote></div><br class=""></div></div></body></html>