<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap:break-word;line-break:after-white-space"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">Hello Gus, NCLers,</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">Thanks for the earlier help. However, I still get this error;</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"> </div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><div id="bloop_customfont" style="margin:0px">fatal:_NclBuildArray: each element of a literal array must have the same dimension sizes, at least one item doesn't</div><div id="bloop_customfont" style="margin:0px">fatal:["Execute.c":8640]:Execute: Error occurred at or near line 22 in file change_360day-365day.ncl</div></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">after replacing with this; </div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">—> this is line 22</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">zg_new =  (/  linint1_n( (/ time_360, lat, lon /), rm_single_dims(var), False, (/ time_365, lat, lon/), 0, 0)  /)</div> <div><br></div><div><br></div>A snap of the code as it is now;<div><div>  zg_new<span class="Apple-tab-span" style="white-space:pre">                </span>     =  new( (/ time_steps, dimsizes(lat), dimsizes(lon) /), "float", 1.0e+20 )</div><div>  zg_new               =  (/  linint1_n( (/ time_360, lat, lon /), rm_single_dims(var), False, (/ time_365, lat, lon/), 0, 0)  /)</div><div>  ;zg_new               =  linint1_n(time_360,var,False,time_365,0,0)</div><div>  zg_new!0             = "time" </div><div>  zg_new&time          =  time_365</div><div>  zg_new!1             = "lat" </div><div>  zg_new&lat          =  lat</div><div>  zg_new!2             = "lon" </div><div>  zg_new&lon          =  lon</div><div><br></div><div>  zg_new@_FillValue    =  1.0e+20</div><div>  zg_new@missing_value =  1.0e+20</div><div>  zg_new@standard_name = "geopotential_height" </div><div>  zg_new@long_name     = "Geopotential Height" </div><div>  zg_new@units         = "m" </div><div>  zg_new@coordinates   = "lon lat time" </div><div>  zg_new@cell_methods  = "time: mean" </div><div>  printVarSummary(zg_new)</div><div>I’d be grateful for more help on this.</div><div><br></div><div>Thanks</div><div>Kwesi</div><div><p class="airmail_on">On 25 February 2019 at 01:44:57, Gus Correa (<a href="mailto:gus@ldeo.columbia.edu">gus@ldeo.columbia.edu</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>


<title></title>


<div dir="ltr">
<div>Have you tried to define zg_new dimensions and metadata before
you use it on the r.h.s. of linint1_n?</div>
<div>Something like this:</div>
<div>zg_new=new( (/ time_steps, dimsizes(lat), dimsizes(lon) /),
"float", 1.0e+20 )</div>
<div><br></div>
<div>Then the part of the code where you define zg_new
metadata:<br></div>
<div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new!0          
  = "time" </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new&time        
 =  time_365</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new!1          
  = "lat" </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new&lat        
 =  lat</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new!2          
  = "lon" </div>
<div style="margin:0px">  zg_new&lon      
   =  lon<br>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new@_FillValue    =
 1.0e+20</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new@missing_value =  1.0e+20</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new@standard_name =
"geopotential_height" </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new@long_name     = "Geopotential
Height" </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new@units         =
"m" </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new@coordinates   = "lon lat
plev"          
< Why time is not included? Why plev is included?<br></div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new@cell_methods  = "time:
maximum"  <- Why maximum if your original data says
mean?<br></div>
</div>
<div style="margin:0px"> <br></div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">And only then the interpolation. <br></div>
<div style="margin:0px">The extra (/ ... /) parenthesis on the
l.h.s. prevent inheriting the metadata from "var".</div>
<div style="margin:0px">The rm_single_dims is to remove the
degenerate (dimension=1) "plev" of "var", making it 3D (not 4D
anymore).<br></div>
<div style="margin:0px">Also, var is multidimensional, so I think
the arguments of linint1_n need to honor that:<br></div>
<div style="margin:0px"><br></div>
<div style="margin:0px">zg_new          
    =  (/  linint1_n( (/ time_360, lat, lon /),
rm_single_dims(var), False, (/ time_365, lat, lon/), 0, 0) 
/)<br></div>
<div style="margin:0px"><br></div>
<div style="margin:0px">I haven't tested it, so it goes with no
guarantees.<br></div>
<div style="margin:0px">I hope this helps.<br></div>
<div style="margin:0px"><br></div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Sun, Feb 24, 2019 at 5:31 PM
Kwesi A. Quagraine <<a href="mailto:starskykwesi@gmail.com">starskykwesi@gmail.com</a>>
wrote:<br></div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="overflow-wrap: break-word;">
<div id="gmail-m_188933905969601112bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
Hello NCLers</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<br></div>
<div id="gmail-m_188933905969601112bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
I am trying to convert a netcdf file with 360 day calendar to
standard, 365 day calendar with the script below; I am having
errors when I try. I will be grateful for any help. </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<br></div>
<div id="gmail-m_188933905969601112bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
For printVarSummary;</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<br></div>
<div id="gmail-m_188933905969601112bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgb(0,0,0);margin:0px">
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">Variable: var</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">Type: float</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">Total Size: 37013760 bytes</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">            9253440
values</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">Number of Dimensions: 4</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">Dimensions and sizes: [time | 12240] x [plev | 1] x
[lat | 36] x [lon | 21]</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">Coordinates:</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">            time:
[43590.5..55829.5]</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">            plev:
[70000..70000]</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">            lat:
[-44.375..-0.625]</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">            lon:
[6.5625..44.0625]</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">Number Of Attributes: 9</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  standard_name : geopotential_height</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  long_name : Geopotential Height</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  units : m</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  _FillValue : 1e+20</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  missing_value : 1e+20</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  original_name : mo: m01s30i207/m01s30i301</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  cell_methods : time: mean</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  history : 2012-06-26T08:31:01Z altered by CMOR:
replaced missing value flag (-1.07374e+09) with standard missing
value (1e+20).</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  associated_files : baseURL: <a href="http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation" target="_blank">http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation</a>
gridspecFile:
gridspec_atmos_fx_HadGEM2-ES_historical_r0i0p0.nc</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px"><br></div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">fatal:Coordinate variables must be the same dimension
as their dimension</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">fatal:No coordinate variable exists for dimension
(lat) in variable (zg_new)</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">fatal:["Execute.c":8640]:Execute: Error occurred at or
near line 25 in file</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px"><br></div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px"><br></div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">For Script:</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px"> f =
addfile("zg700_day_HadGEM2-ES_rcp85_r1i1p1_19800101-20131231.nc","r")</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  var          =
f->zg</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  time_360     = var&time</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  lat          =
f->lat</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  lon          =
f->lon</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  plev       = f->plev</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  printVarSummary(var)</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  time_steps          
    =  34*365 ;1980 to 2013</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  time_365          
      =  fspan(1,time_steps,time_steps)</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  time_365!0          
    = "time" </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  time_365&time        
   =  time_365</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  time_365@standard_name   =
"time" </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  time_365@units        
  = "days since 1980-01-01 12:00:00" </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  time_365@calendar        =
"365_day" </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  time_365@long_name       =
"time" </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  time_365@axis        
   = "T" </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px"><br></div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new          
    =
 linint1_n(time_360,var,False,time_365,0,0)</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new!0          
  = "time" </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new&time        
 =  time_365</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new!1          
  = "lat" </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new&lat        
 =  lat</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new!2          
  = "lon" </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new&lon        
 =  lon</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px"><br></div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new@_FillValue    =
 1.0e+20</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new@missing_value =  1.0e+20</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new@standard_name =
"geopotential_height" </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new@long_name     = "Geopotential
Height" </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new@units         =
"m" </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new@coordinates   = "lon lat
plev" </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  zg_new@cell_methods  = "time:
maximum" </div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  printVarSummary(zg_new)</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px"><br></div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  ;system("rm -rf
zg700_day_HadGEM2-ES_rcp85_r1i1p1_19800101-20131231_cal.nc")</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  outf =
addfile("zg700_day_HadGEM2-ES_rcp85_r1i1p1_19800101-20131231_cal.nc","c")</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  outf->lat        
 =  lat</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  outf->lon        
 =  lon</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  outf->plev       =
 plev</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px">  outf->zg       =
 zg_new</div>
</div>
</div>
<div id="gmail-m_188933905969601112bloop_customfont" style="margin:0px"><br></div>
</div>
I will be grateful for any help on this.
<div><br></div>
<div>Thanks </div>
<div>Kwesi<br>
<div id="gmail-m_188933905969601112bloop_sign_1551046309496932864" class="gmail-m_188933905969601112bloop_sign"><font face="helvetica, arial">------------ </font><br>
<div style="font-family:helvetica,arial;font-size:13px">Try not to
become a man of success but rather a man of value- Albert
Einstein</div>
<div style="font-family:helvetica,Arial;font-size:13px"><font face="Helvetica"><span style="font-size:12px"><br></span></font></div>
<div style="font-family:helvetica,Arial;font-size:13px"><font face="Helvetica"><span style="font-size:12px">Kwesi A.
Quagraine</span></font></div>
<div style="font-family:helvetica,Arial;font-size:13px"><font face="Helvetica"><span style="font-size:12px">Department of
Physics</span></font></div>
<div><font face="Helvetica"><span style="font-size:12px">School
of Physical Sciences</span></font></div>
<div><font face="Helvetica"><span style="font-size:12px">College
of Agriculture and Natural Sciences</span></font></div>
<div><font face="Helvetica"><span style="font-size:12px">University
of Cape Coast</span></font></div>
<div><font face="Helvetica"><span style="font-size:12px">Cape
Coast, Ghana</span></font></div>
<div style="font-family:helvetica,Arial;font-size:13px"><font face="Helvetica"><span style="font-size:12px"><br></span></font></div>
<div style="font-family:helvetica,Arial;font-size:13px"><font face="Helvetica"><span style="font-size:12px">Alt. Email: <a href="mailto:kwesi@csag.uct.ac.za" target="_blank">kwesi@csag.uct.ac.za</a> </span></font></div>
<div style="font-family:helvetica,Arial;font-size:13px"><font face="Helvetica"><span style="font-size:12px">Web: <a href="http://www.recycleupghana.org/" target="_blank">http://www.recycleupghana.org/</a> <br></span></font></div>
<div style="font-family:helvetica,Arial;font-size:13px"><font face="Helvetica"><span style="font-size:12px">Office: +27 21 650
3164</span></font></div>
<div><font face="Helvetica"><span style="font-size:12px">Skype:
quagraine_cwasi</span></font></div>
</div>
</div>
</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>


_______________________________________________
<br>ncl-talk mailing list
<br><a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>
<br>List instructions, subscriber options, unsubscribe:
<br><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
<br></div></div></span></blockquote> <div id="bloop_sign_1551125842776666112" class="bloop_sign"><font face="helvetica, arial">------------ </font><br><div style="font-family:helvetica,arial;font-size:13px">Try not to become a man of success but rather a man of value- Albert Einstein</div><div style="font-family:helvetica,Arial;font-size:13px"><font face="Helvetica"><span style="font-size:12px"><br></span></font></div><div style="font-family:helvetica,Arial;font-size:13px"><font face="Helvetica"><span style="font-size:12px">Kwesi A. Quagraine</span></font></div><div style="font-family:helvetica,Arial;font-size:13px"><font face="Helvetica"><span style="font-size:12px">Department of Physics</span></font></div><div><font face="Helvetica"><span style="font-size:12px">School of Physical Sciences</span></font></div><div><font face="Helvetica"><span style="font-size:12px">College of Agriculture and Natural Sciences</span></font></div><div><font face="Helvetica"><span style="font-size:12px">University of Cape Coast</span></font></div><div><font face="Helvetica"><span style="font-size:12px">Cape Coast, Ghana</span></font></div><div style="font-family:helvetica,Arial;font-size:13px"><font face="Helvetica"><span style="font-size:12px"><br></span></font></div><div style="font-family:helvetica,Arial;font-size:13px"><font face="Helvetica"><span style="font-size:12px">Alt. Email: <a href="mailto:kwesi@csag.uct.ac.za">kwesi@csag.uct.ac.za</a> </span></font></div><div style="font-family:helvetica,Arial;font-size:13px"><font face="Helvetica"><span style="font-size:12px">Web: <a href="http://www.recycleupghana.org/">http://www.recycleupghana.org/</a> <br></span></font></div><div style="font-family:helvetica,Arial;font-size:13px"><font face="Helvetica"><span style="font-size:12px">Office: +27 21 650 3164</span></font></div><div><font face="Helvetica"><span style="font-size:12px">Skype: quagraine_cwasi</span></font></div></div></div></div></body></html>