<div dir="ltr"><div><div>The SPI code used by NCL is f77.<br><br></div>The fortran code has hard-coded as: NMOM=3<br><br>---<br> SUBROUTINE SAMLMR(X,N,XMOM,NMOM,A,B,ifail)<br>C***********************************************************************<br>C* *<br>C* FORTRAN CODE WRITTEN FOR INCLUSION IN IBM RESEARCH REPORT RC20525, *<br>C* 'FORTRAN ROUTINES FOR USE WITH THE METHOD OF L-MOMENTS, VERSION 3' *<br>C* *<br>C* J. R. M. HOSKING *<br>C* IBM RESEARCH DIVISION *<br>C* T. J. WATSON RESEARCH CENTER *<br>C* YORKTOWN HEIGHTS *<br>C* NEW YORK 10598, U.S.A. *<br>C* *<br>C* VERSION 3 AUGUST 1996 *<br>C* *<br>C***********************************************************************<br>C<br>C SAMPLE L-MOMENTS OF A DATA ARRAY<br>C<br>C PARAMETERS OF ROUTINE:<br>C X * INPUT* ARRAY OF LENGTH N. CONTAINS THE DATA, IN ASCENDING<br>C ORDER.<br>C N * INPUT* NUMBER OF DATA VALUES<br>C XMOM *OUTPUT* ARRAY OF LENGTH NMOM. ON EXIT, CONTAINS THE SAMPLE<br>C L-MOMENTS L-1, L-2, T-3, T-4, ... .<br>C NMOM * INPUT* NUMBER OF L-MOMENTS TO BE FOUND. AT MOST MAX(N,20).<br>C A * INPUT* ) PARAMETERS OF PLOTTING<br>C B * INPUT* ) POSITION (SEE BELOW)<br>C FOR UNBIASED ESTIMATES (OF THE LAMBDA'S) SET A=B=ZERO. OTHERWISE,<br>C PLOTTING-POSITION ESTIMATORS ARE USED, BASED ON THE PLOTTING POSITION<br>C (J+A)/(N+B) FOR THE J'TH SMALLEST OF N OBSERVATIONS. FOR EXAMPLE,<br>C A=-0.35D0 AND B=0.0D0 YIELDS THE ESTIMATORS RECOMMENDED BY<br>C HOSKING ET AL. (1985, TECHNOMETRICS) FOR THE GEV DISTRIBUTION.<br>C<br> IMPLICIT DOUBLE PRECISION (A-H,O-Z)<br> DOUBLE PRECISION X(N),XMOM(NMOM),SUM(20)<br> DATA ZERO/0D0/,ONE/1D0/<br> ifail=0<br> IF(NMOM.GT.20.OR.NMOM.GT.N)GOTO 1000 ! <==========<br> DO 10 J=1,NMOM<br> 10 SUM(J)=ZERO<br><br></div>[SNIP]<br><br> RETURN<br>C<br> 7000 FORMAT(' *** ERROR *** ROUTINE SAMLMR : PARAMETER NMOM INVALID')<br> 7010 FORMAT(' *** ERROR *** ROUTINE SAMLMR :',<br> * ' PLOTTING-POSITION PARAMETERS INVALID')<br> 7020 FORMAT(' *** ERROR *** ROUTINE SAMLMR : ALL DATA VALUES EQUAL')<br> END<br><br><div>===<br></div><div>It is my speculation that NMOM > N<br></div><div>where 'N" is the number of non-missing values.<br><br></div><div>So, likely, likely 8 series input to the function have this situation.<br><br></div><div>if nlat=30 and mlon-50<br></div><div> the nlat*mlon (=1500) series were input and 8 of them had the above condition.<br></div><div>At this point, since the error messages are from the underlying code, there is no way to stop these messages.<br><br></div><div>Good Luck<br></div><div><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 29, 2017 at 10:19 AM, Dawit Abebe <span dir="ltr"><<a href="mailto:dawit.kan@gmail.com" target="_blank">dawit.kan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><pre style="background-color:rgb(255,255,255)">Hi all,
I set the SPI function to Pearson Type III but I’m getting error below. I’m using the ncl 6.4.0.
part of my code:
*opt = True*
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">opt at spi_type</a> = 3 ; calculate using Pearson III distribution
do k=0,klen-1
print( "len: " + len(k) )
spi(:,k,:,:) = dim_spi_n(prc, len(k), opt, 0) ;=> (nlat,mlon,ntim)
printMinMax(spi(:,k,:,:),0)
end do
*error message:*
*** ERROR *** ROUTINE SAMLMR : PARAMETER NMOM INVALID
*** ERROR *** ROUTINE SAMLMR : PARAMETER NMOM INVALID
*** ERROR *** ROUTINE SAMLMR : PARAMETER NMOM INVALID
*** ERROR *** ROUTINE SAMLMR : PARAMETER NMOM INVALID
*** ERROR *** ROUTINE SAMLMR : PARAMETER NMOM INVALID
*** ERROR *** ROUTINE SAMLMR : PARAMETER NMOM INVALID
*** ERROR *** ROUTINE SAMLMR : PARAMETER NMOM INVALID
*** ERROR *** ROUTINE SAMLMR : PARAMETER NMOM INVALID
When I set the opt option to False (Gamma Type) the errors are not there.
I would very much appreciate if any one help me understand what this error means and how can I fix the problem. </pre><pre style="background-color:rgb(255,255,255)"><br></pre><pre style="background-color:rgb(255,255,255)">Thank you so much</pre><span class="HOEnZb"><font color="#888888"><pre style="background-color:rgb(255,255,255)">Dawit</pre><pre style="background-color:rgb(255,255,255)"><br></pre></font></span></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></div>