<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="margin:0px"><div id="bloop_customfont" style="margin:0px">Dear NCLers, </div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">Apologies for revisiting this again. </div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">I am using the calendar_convert_360_to_365_date.ncl script provided earlier by Denis, to convert a 360 day calendar to 365 day standard calendar. However I get this error below;</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px"><div id="bloop_customfont" style="margin:0px">fatal:Subscript out of range, error in subscript #0</div><div id="bloop_customfont" style="margin:0px">fatal:An error occurred reading it360</div><div id="bloop_customfont" style="margin:0px">fatal:["Execute.c":8637]:Execute: Error occurred at or near line 161 in file ./calendar_convert_360_to_365_date.ncl</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">fatal:["Execute.c":8637]:Execute: Error occurred at or near line 27 in file hadgem_360_365.ncl</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">fatal:Variable (zg365) is undefined</div><div id="bloop_customfont" style="margin:0px">fatal:["Execute.c":8637]:Execute: Error occurred at or near line 29 in file hadgem_360_365.ncl</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">fatal:Variable (zg365) is undefined</div><div id="bloop_customfont" style="margin:0px">fatal:["Execute.c":8637]:Execute: Error occurred at or near line 30 in file hadgem_360_365.ncl</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">fatal:["Execute.c":8637]:Execute: Error occurred at or near line 31 in file hadgem_360_365.ncl</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">(0) ==================</div><div id="bloop_customfont" style="margin:0px">fatal:Variable (zg365) is undefined</div><div id="bloop_customfont" style="margin:0px">fatal:["Execute.c":8637]:Execute: Error occurred at or near line 65 in file hadgem_360_365.ncl</div></div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">I am not sure what is happening there since the loop that is being iterated through uses the correct loop structure in NCL;</div><div id="bloop_customfont" style="margin:0px"><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">======</div><div id="bloop_customfont" style="margin:0px">do nt=0,nitime-1</div><div id="bloop_customfont" style="margin:0px"> x365(it360(nt),:,:,:) = x360(it365(nt),:,:,:)</div><div id="bloop_customfont" style="margin:0px"> end do</div><div id="bloop_customfont" style="margin:0px"> end if</div></div><div id="bloop_customfont" style="margin:0px">======</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">I will be grateful for any help on this. I have attached my file and the calendar convert file I am using.</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">Warm regards</div><div id="bloop_customfont" style="margin:0px">Kwesi</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px"><div id="bloop_customfont" style="margin:0px">(ncl_notebook) kwesi@maggie:~/terra/cordex$ ncl -V</div><div id="bloop_customfont" style="margin:0px">6.6.2</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">(ncl_notebook) kwesi@maggie:~/terra/cordex$ conda --version</div><div id="bloop_customfont" style="margin:0px">conda 4.3.30</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">(ncl_notebook) kwesi@maggie:~/terra/cordex$ env | grep NCARG</div><div id="bloop_customfont" style="margin:0px">OLD_NCARG_ROOT=/share/apps/ncl-6.2.1</div><div id="bloop_customfont" style="margin:0px">NCARG_ROOT=/home/kwesi/miniconda3/envs/ncl_notebook</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">ncdump file gives;</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px"><div id="bloop_customfont" style="margin:0px">netcdf zg700_day_HadGEM2-ES_historical_rcp85_r1i1p1_SMHI-RCA4_19800101-20131231_norm {</div><div id="bloop_customfont" style="margin:0px">dimensions:</div><div id="bloop_customfont" style="margin:0px"> lon = 91 ;</div><div id="bloop_customfont" style="margin:0px"> lat = 103 ;</div><div id="bloop_customfont" style="margin:0px"> plev = 1 ;</div><div id="bloop_customfont" style="margin:0px"> time = UNLIMITED ; // (12240 currently)</div><div id="bloop_customfont" style="margin:0px"> bnds = 2 ;</div><div id="bloop_customfont" style="margin:0px">variables:</div><div id="bloop_customfont" style="margin:0px"> double lon(lon) ;</div><div id="bloop_customfont" style="margin:0px"> lon:standard_name = "longitude" ;</div><div id="bloop_customfont" style="margin:0px"> lon:long_name = "longitude" ;</div><div id="bloop_customfont" style="margin:0px"> lon:units = "degrees_east" ;</div><div id="bloop_customfont" style="margin:0px"> lon:axis = "X" ;</div><div id="bloop_customfont" style="margin:0px"> double lat(lat) ;</div><div id="bloop_customfont" style="margin:0px"> lat:standard_name = "latitude" ;</div><div id="bloop_customfont" style="margin:0px"> lat:long_name = "latitude" ;</div><div id="bloop_customfont" style="margin:0px"> lat:units = "degrees_north" ;</div><div id="bloop_customfont" style="margin:0px"> lat:axis = "Y" ;</div><div id="bloop_customfont" style="margin:0px"> double plev(plev) ;</div><div id="bloop_customfont" style="margin:0px"> plev:standard_name = "air_pressure" ;</div><div id="bloop_customfont" style="margin:0px"> plev:long_name = "pressure" ;</div><div id="bloop_customfont" style="margin:0px"> plev:units = "Pa" ;</div><div id="bloop_customfont" style="margin:0px"> plev:positive = "down" ;</div><div id="bloop_customfont" style="margin:0px"> plev:axis = "Z" ;</div><div id="bloop_customfont" style="margin:0px"> double time(time) ;</div><div id="bloop_customfont" style="margin:0px"> time:standard_name = "time" ;</div><div id="bloop_customfont" style="margin:0px"> time:long_name = "time" ;</div><div id="bloop_customfont" style="margin:0px"> time:bounds = "time_bnds" ;</div><div id="bloop_customfont" style="margin:0px"> time:units = "days since <a href="http://airmail.calendar/1949-12-01%2000:00:00%20GMT+2">1949-12-1 00:00:00</a>" ;</div><div id="bloop_customfont" style="margin:0px"> time:calendar = "360_day" ;</div><div id="bloop_customfont" style="margin:0px"> time:axis = "T" ;</div><div id="bloop_customfont" style="margin:0px"> double time_bnds(time, bnds) ;</div><div id="bloop_customfont" style="margin:0px"> float zg(time, plev, lat, lon) ;</div><div id="bloop_customfont" style="margin:0px"> zg:standard_name = "geopotential_height" ;</div><div id="bloop_customfont" style="margin:0px"> zg:long_name = "Geopotential Height" ;</div><div id="bloop_customfont" style="margin:0px"> zg:units = "m" ;</div><div id="bloop_customfont" style="margin:0px"> zg:_FillValue = 1.e+20f ;</div><div id="bloop_customfont" style="margin:0px"> zg:missing_value = 1.e+20f ;</div><div id="bloop_customfont" style="margin:0px"> zg:cell_methods = "time: mean" ;</div></div></div></div><br style="font-family:"helvetica Neue",helvetica;font-size:14px"><div id="bloop_sign_1569271952225879040" class="bloop_sign" style="font-family:"helvetica Neue",helvetica;font-size:14px"><div style="font-family:helvetica,arial;font-size:13px">----------- <br>Try not to become a man of success but rather a man of value- Albert Einstein</div><div><font face="Helvetica"><span style="font-size:12px"><br></span></font></div><div><font face="Helvetica"><span style="font-size:12px">Kwesi A. Quagraine</span></font></div><div><font face="Helvetica"><span style="font-size:12px">Climate System Analysis Group (CSAG)</span></font></div><div><font face="Helvetica"><span style="font-size:12px">Environmental and Geographical ScIence (EGS)</span></font></div><div><font face="Helvetica"><span style="font-size:12px">University of Cape Town</span></font></div><div><font face="Helvetica"><span style="font-size:12px">Private Bag, Rondebosch, 7701</span></font></div><div><font face="Helvetica"><span style="font-size:12px">South Africa</span></font></div><div><font face="Helvetica"><span style="font-size:12px"><br></span></font></div><div><font face="Helvetica"><span style="font-size:12px">Alt. Email: <a href="mailto:starskykwesi@gmail.com">starskykwesi@gmail.com</a> </span></font></div><div><font face="Helvetica"><span style="font-size:12px">Web: <a href="http://www.csag.uct.ac.za/">http://www.csag.uct.ac.za</a> <br></span></font><div><font face="Helvetica"><span style="font-size:12px">Office: <a href="tel://+27 21 650 3164">+27 21 650 3164</a></span></font></div><div><font face="Helvetica"><span style="font-size:12px">Skype: quagraine_cwasi</span></font></div></div></div></body></html>