<div dir="ltr"><div>I am actually having problems with this as well:<br><br><br><br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl&quot;<br>;load &quot;./WRFUserARW.ncl&quot;<br><br>fa = addfile(&quot;d03_JUN_P_10_YSU.nc&quot;,&quot;r&quot;)<br>t2a = fa-&gt;T2<br>t2a_avg = dim_avg_n_Wrap(t2a, 0)<br>printVarSummary(t2a_avg)   ; south_north | ??] x [west_east | ??]<br><br>fb = addfile(&quot;d03_JUN_P_16.nc&quot;,&quot;r&quot;)<br>t2b = fb-&gt;T2<br>t2b_avg = dim_avg_n_Wrap(t2b, 0)<br>printVarSummary(t2b_avg)   ; south_north |??] x [west_east | ??]<br><br>t2_diff = t2a_avg-t2b_avg<br>copy_VarMeta(t2a_avg, t2_diff)<br>t2_diff@long_name = &quot;T2 Difference&quot;<br>t2_diff@units = t2a@units<br>printVarSummary(t2_diff)     ; south_north |??] x [west_east | ??]<br><br>; We generate plots, but what kind do we prefer?<br>  type = &quot;pdf&quot;<br>; type = &quot;pdf&quot;<br>; type = &quot;ps&quot;<br>; type = &quot;ncgm&quot;<br><br>wks = gsn_open_wks(type,&quot;plot_DIFF_d03_DEC&quot;)<br>  gsn_define_colormap(wks,&quot;nrl_sirkes_nowhite&quot;)<br><br><br><br>  pltres = True<br>  mpres = True<br>  res = True<br>  mpres@mpDataBaseVersion = &quot;HighRes&quot;<br>  res@MainTitle                   = &quot;2 meter temperature Difference&quot;<br>  mpres@mpGridAndLimbOn = False<br>  res@gsnMaximize = True<br>  res@cnFillOn = True<br>  res@gsnSpreadColors = True<br>  res@cnLinesOn = False<br>  res@cnLineLabelsOn = False<br>  mpres@mpGeophysicalLineColor = &quot;Black&quot;<br>  res@mpFillOn     = False<br>  res@mpMaxLatF    = 15.43                      ; specify the plot domain<br>  res@mpMinLatF    = 13.62                      ;                         <br>  res@mpMinLonF    = 120.02                    ;<br>  res@mpMaxLonF    = 121.85                   ;<br>  res@mpOutlineOn  = True                  ; turn the map outline on<br>  res@gsnDraw      =  False                   ; do not draw the plot<br>  res@gsnFrame     =  False  <br>  <br><br><br>  plot    = gsn_csm_contour_map(wks,t2_diff,res)<br><br>  draw(plot)                                  ;<br>  frame(wks)<br>   <br>     <br>    <br><br><br><br><br></div>I cannot plot t2_diff the error goes<br>fatal:ContourPlotInitialize: internal error creating levels, invalid max or min data value<br>fatal:ContourPlotInitialize: error getting contour level information<br>fatal:ContourPlotInitialize: error initializing dynamic arrays<br>fatal:Unable to initialize layer-Can&#39;t Create<br>fatal:Unable to access object with id:-4<br>fatal:PID #-4 can&#39;t be found in NhlSetValues<br>(0)     spread_colors: invalid plot: defaulting<br>fatal:PID #-4 can&#39;t be found in NhlSetValues<br>warning:overlay: bad HLU id passed in, ignoring<br>fatal:[&quot;Execute.c&quot;:8578]:Execute: Error occurred at or near line 7108 in file /usr/local/lib/ncarg/nclscripts/csm/gsn_csm.ncl<br><br>fatal:[&quot;Execute.c&quot;:8578]:Execute: Error occurred at or near line 10599 in file /usr/local/lib/ncarg/nclscripts/csm/gsn_csm.ncl<br><br>fatal:[&quot;Execute.c&quot;:8578]:Execute: Error occurred at or near line 57 in file Ave_Diff.ncl<br><br>fatal:Variable (plot) is undefined<br>fatal:[&quot;Execute.c&quot;:8578]:Execute: Error occurred at or near line 59 in file Ave_Diff.ncl<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 7, 2016 at 12:13 AM, Jacob Alberto Garcia <span dir="ltr">&lt;<a href="mailto:jacob_garcia@dlsu.edu.ph" target="_blank">jacob_garcia@dlsu.edu.ph</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hello,<br><br></div>I want to take the three files and find the time average of the 2 meter temperature. I have this script here that calculates the mean difference of T2 for the two files given below. What I want to do is instead of just one month, I&#39;d like to Average three months for the YSU and three months for the MYJ simulations. What do I change in this script?<br></div><br><br><div>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/wrf/WRFUserARW.ncl&quot;<br>;load &quot;./WRFUserARW.ncl&quot;<br><br>fa = addfile(&quot;d03_FEB_YSU_F.nc&quot;,&quot;r&quot;<wbr>)<br>t2a = fa-&gt;T2<br>t2a_avg = dim_avg_n_Wrap(t2a, 0)<br>printVarSummary(t2a_avg)   ; south_north | ??] x [west_east | ??]<br><br>fb = addfile(&quot;d03_Feb_MYJ_f.nc&quot;,&quot;r&quot;<wbr>)<br>t2b = fb-&gt;T2<br>t2b_avg = dim_avg_n_Wrap(t2b, 0)<br>printVarSummary(t2b_avg)   ; south_north |??] x [west_east | ??]<br><br>t2_diff = t2a_avg-t2b_avg<br>copy_VarMeta(t2a_avg, t2_diff)<br>t2_diff@long_name = &quot;T2 Difference&quot;<br>t2_diff@units = t2a@units<br>printVarSummary(t2_diff)     ; south_north |??] x [west_east | ??]<br><br>; We generate plots, but what kind do we prefer?<br>  type = &quot;pdf&quot;<br>; type = &quot;pdf&quot;<br>; type = &quot;ps&quot;<br>; type = &quot;ncgm&quot;<br><br>wks = gsn_open_wks(type,&quot;plot_DIFF_<wbr>d03_FEB&quot;)<br>  gsn_define_colormap(wks,&quot;<wbr>BlueDarkRed18&quot;)<br><br><br><br>  pltres = True<br>  mpres = True<br>  res = True<br>  mpres@mpDataBaseVersion = &quot;HighRes&quot;<br>  res@MainTitle                 <wbr>  = &quot;2 meter temperature Difference&quot;<br>  mpres@mpGridAndLimbOn = False<br>  res@gsnMaximize = True<br>  res@cnFillOn = True<br>  res@gsnSpreadColors = True<br>  res@cnLinesOn = False<br>  res@cnLineLabelsOn = False<br>  mpres@mpGeophysicalLineColor = &quot;Black&quot;<br>  <br> <br><br><br>  plot    = gsn_csm_contour_map(wks,t2_<wbr>diff,res)<br><br>     contour_DIFF = wrf_contour(fa,wks,t2_diff,<wbr>res)      <br><br>     plot = wrf_map_overlays(fa,wks,(/<wbr>contour_DIFF/),pltres,mpres)<br>     <br>==============================<wbr>=============================<br><br></div><div>Would something like this work?<br><br><br>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/wrf/WRFUserARW.ncl&quot;<br>;load &quot;./WRFUserARW.ncl&quot;<br><br>fa = addfile(&quot;d03_DEC_YSU_F.nc&quot;,&quot;r&quot;<wbr>)<br>faa=addfile(&quot;d03_JAN_YSU_F.nc&quot;<wbr>,r)<br>faaa=addfile(&#39;d03_FEB_YSU_F.<wbr>nc&quot;,r)<br>t2a = fa-&gt;T2<br>t2aa = faa-&gt;T2<br>t2aaa = faaa-&gt; T2<br>t2a_avg = dim_avg_n_Wrap(t2a, t2aa, t2aaa, 0)<br>printVarSummary(t2a_avg)   ; south_north | ??] x [west_east | ??]<br><br>fb = addfile(&quot;d03_Dec_MYJ_f.nc&quot;,&quot;r&quot;<wbr>)<br>fbb =  addfile(&quot;d03_Jan_MYJ_f.nc&quot;,&quot;r&quot;<wbr>)<br>fbbb =  addfile(&quot;d03_Feb_MYJ_f.nc&quot;,&quot;r&quot;<wbr>)<br>t2b = fb-&gt;T2<br>t2bb = fbb-&gt;T2<br>t2bbb = fbbb -&gt;T2<br>t2b_avg = dim_avg_n_Wrap(t2b, t2bb, t2bbb, 0)<br>printVarSummary(t2b_avg)   ; south_north |??] x [west_east | ??]<br><br>t2_diff = t2a_avg-t2b_avg<br>copy_VarMeta(t2a_avg, t2_diff)<br>t2_diff@long_name = &quot;T2 Difference&quot;<br>t2_diff@units = t2a@units<br>printVarSummary(t2_diff)     ; south_north |??] x [west_east | ??]<br><br>; We generate plots, but what kind do we prefer?<br>  type = &quot;pdf&quot;<br>; type = &quot;pdf&quot;<br>; type = &quot;ps&quot;<br>; type = &quot;ncgm&quot;<br><br>wks = gsn_open_wks(type,&quot;plot_DIFF_<wbr>d03_FEB&quot;)<br>  gsn_define_colormap(wks,&quot;<wbr>BlueDarkRed18&quot;)<br><br><br><br>  pltres = True<br>  mpres = True<br>  res = True<br>  mpres@mpDataBaseVersion = &quot;HighRes&quot;<br>  res@MainTitle                 <wbr>  = &quot;2 meter temperature Difference&quot;<br>  mpres@mpGridAndLimbOn = False<br>  res@gsnMaximize = True<br>  res@cnFillOn = True<br>  res@gsnSpreadColors = True<br>  res@cnLinesOn = False<br>  res@cnLineLabelsOn = False<br>  mpres@mpGeophysicalLineColor = &quot;Black&quot;<br>  <br> <br><br><br>  plot    = gsn_csm_contour_map(wks,t2_<wbr>diff,res)<br><br>     contour_DIFF = wrf_contour(fa,wks,t2_diff,<wbr>res)      <br><br>     plot = wrf_map_overlays(fa,wks,(/<wbr>contour_DIFF/),pltres,mpres)<br>     <br>    <br><br><br><br><br><br></div><div>    <br><br><br><br><br><br></div></div>
</blockquote></div><br></div>

<br>
<a href="http://www.dlsu.edu.ph" target="_blank"><img src="http://www.dlsu.edu.ph/offices/mco/images/email-disclaimer/dlsu-logo.jpg"></a><a href="https://www.facebook.com/DLSU.Manila.100" target="_blank"><img src="http://www.dlsu.edu.ph/offices/mco/images/email-disclaimer/dlsu-fb.jpg"></a><a href="http://instagram.com/dlsu" target="_blank"><img src="http://www.dlsu.edu.ph/offices/mco/images/email-disclaimer/dlsu-instagram.jpg"></a><a href="https://twitter.com/dlsumanila" target="_blank"><img src="http://www.dlsu.edu.ph/offices/mco/images/email-disclaimer/dlsu-twitter.jpg"></a><a href="http://dlsumanila.tumblr.com/" target="_blank"><img src="http://www.dlsu.edu.ph/offices/mco/images/email-disclaimer/dlsu-tumbler.jpg"></a><a href="http://iblog.lasalle.ph/" target="_blank"><img src="http://www.dlsu.edu.ph/offices/mco/images/email-disclaimer/dlsu-blog.jpg"></a><font color="green" face="Arial" size="2"><br><br>DISCLAIMER AND CONFIDENTIALITY NOTICE </font><div><font color="green" face="Arial" size="2">The information contained in this e-mail, including those in its attachments, is confidential and intended only for the person(s) or entity(ies) to which it is addressed. If you are not an intended recipient, you must not read, copy, store, disclose, distribute this message, or act in reliance upon the information contained in it. If you received this e-mail in error, please contact the sender and delete the material from any computer or system. Any views expressed in this message are those of the individual sender and may not necessarily reflect the views of De La Salle University. </font></div>