<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing
{mso-style-priority:1;
margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="HU" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Dear NCL Users,<o:p></o:p></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:
<o:p></o:p></p>
<p class="MsoNormal">fatal:Number of subscripts (2) and number of dimensions (3) do not match for variable (daylightmax)<o:p></o:p></p>
<p class="MsoNormal">fatal:["Execute.c":8640]:Execute: Error occurred at or near line 779 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/crop.ncl<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">fatal:["Execute.c":8640]:Execute: Error occurred at or near line 48 in file ex_regrid_ETo_turc.ncl<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">My script:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNoSpacing">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<o:p></o:p></p>
<p class="MsoNoSpacing">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<o:p></o:p></p>
<p class="MsoNoSpacing">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<o:p></o:p></p>
<p class="MsoNoSpacing">load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/calendar_decode2.ncl"<o:p></o:p></p>
<p class="MsoNoSpacing">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/crop.ncl"<o:p></o:p></p>
<p class="MsoNoSpacing"><o:p> </o:p></p>
<p class="MsoNoSpacing">begin<o:p></o:p></p>
<p class="MsoNoSpacing">;-- open file<o:p></o:p></p>
<p class="MsoNoSpacing">a = addfile("CNRM-CM5-CLM4.8.171971.nc","r") ;read the nc file<o:p></o:p></p>
<p class="MsoNoSpacing">b = addfile("sund_CNRM-CM5-CLM1971.nc","r")<o:p></o:p></p>
<p class="MsoNoSpacing"><o:p> </o:p></p>
<p class="MsoNoSpacing"> tas = a->tas ; read daily tasmax values<o:p></o:p></p>
<p class="MsoNoSpacing"> sund = b->sund ; read daily sund values<o:p></o:p></p>
<p class="MsoNoSpacing"><o:p> </o:p></p>
<p class="MsoNoSpacing"> time = a->time ; read time values<o:p></o:p></p>
<p class="MsoNoSpacing"> time_bnds = a->time_bnds<o:p></o:p></p>
<p class="MsoNoSpacing"> lat = a->lat<o:p></o:p></p>
<p class="MsoNoSpacing"> lon = a->lon<o:p></o:p></p>
<p class="MsoNoSpacing"> lon_bnds = a->lon_bnds<o:p></o:p></p>
<p class="MsoNoSpacing"> lat_bnds = a->lat_bnds<o:p></o:p></p>
<p class="MsoNoSpacing"> rlon = a->rlon<o:p></o:p></p>
<p class="MsoNoSpacing"> rlat = a->rlat<o:p></o:p></p>
<p class="MsoNoSpacing"> rotated = a->rotated_latitude_longitude<o:p></o:p></p>
<p class="MsoNoSpacing"><o:p> </o:p></p>
<p class="MsoNoSpacing"> print(lat)<o:p></o:p></p>
<p class="MsoNoSpacing"> tmean = tas + 273.15 ; convert K to Celsius degree<o:p></o:p></p>
<p class="MsoNoSpacing"> nsun = sund/3600 ; convert second to hour<o:p></o:p></p>
<p class="MsoNoSpacing"> time2 = calendar_decode2(time,-5) ; convert the time codes (days since 1949,12,1) to yyyy,mm,dd in integer<o:p></o:p></p>
<p class="MsoNoSpacing"><o:p> </o:p></p>
<p class="MsoNoSpacing"> doy = day_of_year(time2(:,0),time2(:,1),time2(:,2)) ; calculate day of year<o:p></o:p></p>
<p class="MsoNoSpacing"> print (doy)<o:p></o:p></p>
<p class="MsoNoSpacing"><o:p> </o:p></p>
<p class="MsoNoSpacing"> ra_0 = radext_fao56(doy, lat, 0) ; Compute extraterrestrial radiation for daily periods<o:p></o:p></p>
<p class="MsoNoSpacing"> ra_0 = where(ismissing(ra_0), 0, ra_0) ; convert the missing value due to limited validity at high latitudes to 0<o:p></o:p></p>
<p class="MsoNoSpacing"> print(ra_0)<o:p></o:p></p>
<p class="MsoNoSpacing"><o:p> </o:p></p>
<p class="MsoNoSpacing"> sunhrx = daylight_fao56(doy, lat) ; max daylight/sun; hr per day<o:p></o:p></p>
<p class="MsoNoSpacing"> print(sunhrx)<o:p></o:p></p>
<p class="MsoNoSpacing"><o:p> </o:p></p>
<p class="MsoNoSpacing"> rs_0 = radsol_fao56(ra_0, sunhrx, nsun, (/0,0/), False) ; 'radsol' (total solar radiation)<o:p></o:p></p>
<p class="MsoNoSpacing"> evturc_0 = refevt_turc( tmean, rs_0, (/0,0,0/) ) ; Turc ETo formulation in mm/day<o:p></o:p></p>
<p class="MsoNoSpacing"> <o:p></o:p></p>
<p class="MsoNoSpacing"> out1 = addfile("CNRM-CM5_CLM_evturc_01.nc","c") ; write ETo to netCDF file<o:p></o:p></p>
<p class="MsoNoSpacing"> out1->evturc = evturc_0<o:p></o:p></p>
<p class="MsoNoSpacing"> out1->evturc!0 = "time"<o:p></o:p></p>
<p class="MsoNoSpacing"> out1->evturc!1 = "rlat"<o:p></o:p></p>
<p class="MsoNoSpacing"> out1->evturc!2 = "rlon"<o:p></o:p></p>
<p class="MsoNoSpacing"> out1->lat = lat<o:p></o:p></p>
<p class="MsoNoSpacing"> out1->lat_bnds = lat_bnds<o:p></o:p></p>
<p class="MsoNoSpacing"> out1->lon = lon<o:p></o:p></p>
<p class="MsoNoSpacing"> out1->lon_bnds = lon_bnds<o:p></o:p></p>
<p class="MsoNoSpacing"> out1->rlon = rlon<o:p></o:p></p>
<p class="MsoNoSpacing"> out1->rlat = rlat<o:p></o:p></p>
<p class="MsoNoSpacing"> out1->rotated_pole = rotated<o:p></o:p></p>
<p class="MsoNoSpacing"> out1->time = time<o:p></o:p></p>
<p class="MsoNoSpacing"> out1->time_bnds = time_bnds<o:p></o:p></p>
<p class="MsoNormal">end<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></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!<o:p></o:p></p>
<p class="MsoNormal">Beata<o:p></o:p></p>
</div>
</body>
</html>