Just a general query for clarity, since this appears to be a warning and not an error. Every time I run the script below I receive the following message: "ncap2: WARNING size(): Function has been called with more than one argument"
// Preparing/initializing some variables:
// Convert num_events to an integer or inherited dimensionality causes trouble for idx_cutoff: https://sourceforge.net/projects/nco/forums/forum/9831/topic/4972956?message=11224913
num_events=prcp_events(0,0,0).int();
// Remove the _FillValue attribute or idx_cutoff in the if-statement causes error: https://sourceforge.net/projects/nco/forums/forum/9831/topic/4972956?message=11228844
num_events.delete_miss();
prcp_norm=prcp; // Initialize the dimensions of prcp_norm here or cannot call it in the bottom for-loop below.
prcp_temp=prcp; // ditto
prcp_template=prcp; // ditto
// a) Sort prcp in ascending order:
prcp_sort=sort(prcp,&sort_map);
// b) Revise prcp values to reflect the average number of precip events per month (other values set to zero):
// Use RAM variables (indicated by initializing with "*") for computational efficiency:
*idx_end=prcp_sort.size($time);
*idx_cutoff=idx_end-num_events;
for(*idx=0;idx<idx_end;idx++){
if(idx<idx_cutoff) prcp_sort(idx)=0.0;
prcp(idx)=prcp_sort(sort_map(idx));
}
// c) Convert prcp values to normalized (relative) prcp: prcp_norm=prcp/sum(prcp):
// Require prcp_sum for normalizing prcp into prcp_norm:
prcp_sum=prcp.ttl($time);
for(*idx=0;idx<idx_end;idx++){
// normalize the volume of rain
prcp_norm(idx)=prcp(idx)/prcp_sum;
// create prcp temp file by multiplying the filtered and normalized rain volumes (kg/m2/3hr)/(kg/m2/mth) by the average monthly volume (kg/m2/mth)
prcp_temp(idx)=prcp_norm(idx)*prcp_mth_vol;
// convert rain volume temp into rain rate template (kg/m2/sec)
prcp_template(idx)=prcp_temp(idx)/10800;
}
// Check to ensure the sum of prcp ratios equals one:
check=prcp_norm.ttl($time);
if(check != 1) print(check);
As you can see, at no point do I use .size(), which means that I guess it is being called as a part of something else (perhaps .ttl()?). Either way, I would be interested to know why this warning is thrown and what the implications are.
Thanks, as always,
Stu
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Folks,
Just a general query for clarity, since this appears to be a warning and not an error. Every time I run the script below I receive the following message: "ncap2: WARNING size(): Function has been called with more than one argument"
As you can see, at no point do I use .size(), which means that I guess it is being called as a part of something else (perhaps .ttl()?). Either way, I would be interested to know why this warning is thrown and what the implications are.
Thanks, as always,
Stu