!copyright (C) 2001  MSC-RPN COMM  %%%RPNPHY%%%
***S/P SERALLC2  -  ALLOCATION DES VARIABLES DES SERIES TEMPORELLES
*

      SUBROUTINE SERALLC2 (bs,bp,NI,NJ,NK) 2,2
#include "impnone.cdk"
      INTEGER NI,NJ,NK
      real bs,bp
*
*Author
*          M. Lepine  -  RFE model code revision project (Feb 87)
*
*Revision
* 001      G. Pellerin (April 92) - Change name from seraloc to serallc.
*           Adaptation to conform to PASTEMP. Clean up Zonal Diagnostics.
* 002      G. Pellerin (April-94) - Call to HPALLOC instead of ALLOUE
* 003      B. Bilodeau (Nov 95) - Add P8
* 004      B. Bilodeau (Feb 02) - Remove P7
*
*Object
*          to allocate time-series variables
*
*Arguments
*
*          - Input -
* bs       first address for sers
* bp       first address for serp
* NI       1st horizontal dimension
* NJ       2nd horizontal dimension
* NK       vertical dimension
*
*Notes
*          The routine calling this subroutine must not have the
*          case in where the common block SERVAR contradicts
*          the one in this routine. The result would be bad
*          addressing to the fields in SERVAR. Therefore, this
*          is the reason to call SERALC2 for the initialization
*          of the variables.
*
*IMPLICITES
*
#include "sercmdk.cdk"
*MODULES
      EXTERNAL SERALC2,SERDATA
      EXTERNAL HPALLOC
      INTEGER  HEAPERR
**
*
      call serdata ()
      IF ( MXSTT.LE.0 ) return
*
      INITOK = .TRUE.
*
      CALL HPALLOC(P1,  MAX(1,MXSTT),            HEAPERR,1)
      CALL HPALLOC(P2,  MAX(1,MXSTT*2),          HEAPERR,1)
      CALL HPALLOC(P11, MAX(1,MXSTT),            HEAPERR,1)
      CALL HPALLOC(P22, MAX(1,MXSTT),            HEAPERR,1)
      CALL HPALLOC(P3,  MAX(1,MXSTT),            HEAPERR,1)
      p5 = loc(bs)
      p6 = loc(bp)
      CALL HPALLOC(P8, MAX(1,NJ),               HEAPERR,1)
        
      CALL SERALC2(NI,NJ,NK)
*
      RETURN
      END