<div dir="ltr">Hi Beata,<div>I think you have found a bug in crop.ncl. I would suggest copying crop.ncl to your local directory, modifying line 779 from this:</div><div>daylightmax(:,nl) = con*ws ; eq 34<br></div><div>to this:</div><div>daylightmax(:,nl,ml) = con*ws ; eq 34<br></div><div><br></div><div>and then loading your version of crop.ncl at the top of your script. If that does not work let ncl-talk know. I will file a JIRA ticket for this. </div><div>Adam</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 4, 2017 at 4:28 AM, Beáta Szabó-Takács <span dir="ltr"><<a href="mailto:szabo.b@czechglobe.cz" target="_blank">szabo.b@czechglobe.cz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="HU" link="#0563C1" vlink="#954F72">
<div class="m_2935617508547806091WordSection1">
<p class="MsoNormal">Dear NCL Users,<u></u><u></u></p>
<p class="MsoNormal">I have a matter with daylight_fao56 function. I have a lat(nlat,mlon) and doy(ntime) variables what I used in daylight_fao56 function but I got an error message:
<u></u><u></u></p>
<p class="MsoNormal">fatal:Number of subscripts (2) and number of dimensions (3) do not match for variable (daylightmax)<u></u><u></u></p>
<p class="MsoNormal">fatal:["Execute.c":8640]:<wbr>Execute: Error occurred at or near line 779 in file $NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/crop.ncl<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">fatal:["Execute.c":8640]:<wbr>Execute: Error occurred at or near line 48 in file ex_regrid_ETo_turc.ncl<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">My script:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="m_2935617508547806091MsoNoSpacing">load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl"<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing">load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl"<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing">load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl"<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing">load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/contrib/calendar_<wbr>decode2.ncl"<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing">load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/crop.ncl"<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"><u></u> <u></u></p>
<p class="m_2935617508547806091MsoNoSpacing">begin<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing">;-- open file<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing">a = addfile("<a href="http://CNRM-CM5-CLM4.8.171971.nc" target="_blank">CNRM-CM5-CLM4.8.<wbr>171971.nc</a>","r") ;read the nc file<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing">b = addfile("sund_CNRM-CM5-<wbr>CLM1971.nc","r")<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"><u></u> <u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> tas = a->tas <wbr> ; read daily tasmax values<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> sund = b->sund <wbr> ; read daily sund values<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"><u></u> <u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> time = a->time <wbr> ; read time values<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> time_bnds = a->time_bnds<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> lat = a->lat<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> lon = a->lon<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> lon_bnds = a->lon_bnds<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> lat_bnds = a->lat_bnds<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> rlon = a->rlon<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> rlat = a->rlat<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> rotated = a->rotated_latitude_longitude<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"><u></u> <u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> print(lat)<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> tmean = tas + 273.15 <wbr> ; convert K to Celsius degree<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> nsun = sund/3600 <wbr> ; convert second to hour<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> time2 = calendar_decode2(time,-5) <wbr> ; convert the time codes (days since 1949,12,1) to yyyy,mm,dd in integer<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"><u></u> <u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> doy = day_of_year(time2(:,0),time2(:<wbr>,1),time2(:,2)) ; calculate day of year<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> print (doy)<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"><u></u> <u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> ra_0 = radext_fao56(doy, lat, 0) ; Compute extraterrestrial radiation for daily periods<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> ra_0 = where(ismissing(ra_0), 0, ra_0) ; convert the missing value due to limited validity at high latitudes to 0<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> print(ra_0)<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"><u></u> <u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> sunhrx = daylight_fao56(doy, lat) ; max daylight/sun; hr per day<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> print(sunhrx)<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"><u></u> <u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> rs_0 = radsol_fao56(ra_0, sunhrx, nsun, (/0,0/), False) ; 'radsol' (total solar radiation)<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> evturc_0 = refevt_turc( tmean, rs_0, (/0,0,0/) ) ; Turc ETo formulation in mm/day<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> <u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> out1 = addfile("CNRM-CM5_CLM_evturc_<wbr><a href="http://01.nc">01.nc</a>","c") <wbr> ; write ETo to netCDF file<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> out1->evturc = evturc_0<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> out1->evturc!0 = "time"<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> out1->evturc!1 = "rlat"<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> out1->evturc!2 = "rlon"<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> out1->lat = lat<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> out1->lat_bnds = lat_bnds<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> out1->lon = lon<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> out1->lon_bnds = lon_bnds<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> out1->rlon = rlon<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> out1->rlat = rlat<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> out1->rotated_pole = rotated<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> out1->time = time<u></u><u></u></p>
<p class="m_2935617508547806091MsoNoSpacing"> out1->time_bnds = time_bnds<u></u><u></u></p>
<p class="MsoNormal">end<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">According to my best knowledge radext_fao56 and daylight_fao56 functions use same variables (jday and lat). The radext function works correctly but daylight function does not. Could someone write me what I did wrong and how I can fix this
error? Thank you very much for your help in advance!<u></u><u></u></p>
<p class="MsoNormal">Beata<u></u><u></u></p>
</div>
</div>
<br>______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist, </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>
</div>