[ncl-talk] Error message: SPI using Pearson Type III

Dennis Shea shea at ucar.edu
Tue May 30 05:34:28 MDT 2017


The SPI code used by NCL is f77.

The fortran code has hard-coded as: NMOM=3

---
      SUBROUTINE SAMLMR(X,N,XMOM,NMOM,A,B,ifail)
C***********************************************************************
C*                                                                     *
C*  FORTRAN CODE WRITTEN FOR INCLUSION IN IBM RESEARCH REPORT RC20525, *
C*  'FORTRAN ROUTINES FOR USE WITH THE METHOD OF L-MOMENTS, VERSION 3' *
C*                                                                     *
C*  J. R. M. HOSKING                                                   *
C*  IBM RESEARCH DIVISION                                              *
C*  T. J. WATSON RESEARCH CENTER                                       *
C*  YORKTOWN HEIGHTS                                                   *
C*  NEW YORK 10598, U.S.A.                                             *
C*                                                                     *
C*  VERSION 3     AUGUST 1996                                          *
C*                                                                     *
C***********************************************************************
C
C  SAMPLE L-MOMENTS OF A DATA ARRAY
C
C  PARAMETERS OF ROUTINE:
C  X      * INPUT* ARRAY OF LENGTH N. CONTAINS THE DATA, IN ASCENDING
C                  ORDER.
C  N      * INPUT* NUMBER OF DATA VALUES
C  XMOM   *OUTPUT* ARRAY OF LENGTH NMOM. ON EXIT, CONTAINS THE SAMPLE
C                  L-MOMENTS L-1, L-2, T-3, T-4, ... .
C  NMOM   * INPUT* NUMBER OF L-MOMENTS TO BE FOUND. AT MOST MAX(N,20).
C  A      * INPUT* ) PARAMETERS OF PLOTTING
C  B      * INPUT* ) POSITION (SEE BELOW)
C  FOR UNBIASED ESTIMATES (OF THE LAMBDA'S) SET A=B=ZERO. OTHERWISE,
C  PLOTTING-POSITION ESTIMATORS ARE USED, BASED ON THE PLOTTING POSITION
C  (J+A)/(N+B)  FOR THE J'TH SMALLEST OF N OBSERVATIONS. FOR EXAMPLE,
C  A=-0.35D0 AND B=0.0D0 YIELDS THE ESTIMATORS RECOMMENDED BY
C  HOSKING ET AL. (1985, TECHNOMETRICS) FOR THE GEV DISTRIBUTION.
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      DOUBLE PRECISION X(N),XMOM(NMOM),SUM(20)
      DATA ZERO/0D0/,ONE/1D0/
      ifail=0
      IF(NMOM.GT.20.OR.NMOM.GT.N)GOTO 1000      ! <==========
      DO 10 J=1,NMOM
   10 SUM(J)=ZERO

[SNIP]

      RETURN
C
 7000 FORMAT(' *** ERROR *** ROUTINE SAMLMR : PARAMETER NMOM INVALID')
 7010 FORMAT(' *** ERROR *** ROUTINE SAMLMR :',
     *  ' PLOTTING-POSITION PARAMETERS INVALID')
 7020 FORMAT(' *** ERROR *** ROUTINE SAMLMR : ALL DATA VALUES EQUAL')
      END

===
It is my speculation that NMOM > N
where 'N" is the number of non-missing values.

So, likely, likely 8 series input to the function have this situation.

if nlat=30 and mlon-50
 the nlat*mlon (=1500) series were input and 8 of them had the above
condition.
At this point, since the error messages are from the underlying code, there
is no way to stop these messages.

Good Luck



On Mon, May 29, 2017 at 10:19 AM, Dawit Abebe <dawit.kan at gmail.com> wrote:

> 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*opt at spi_type <http://mailman.ucar.edu/mailman/listinfo/ncl-talk> = 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.
>
>
> Thank you so much
>
> Dawit
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170530/88dcb6d7/attachment.html 


More information about the ncl-talk mailing list