      PROGRAM PGMPARM
C     PROGRAM PGMPARM ( INPUT,       OUTPUT,                            )       I2
C    1            TAPE5=INPUT, TAPE6=OUTPUT) 
C     --------------------------------------                                    I2
C                                                                               I2
C     JUL 03/03 - A.IRWIN,F.MAJAESS (REVISED FOR F90 AND LINUX PLATFORMS)       I2
C     JUL 10/01 - F.MAJAESS (ADD "OCEAN PARAMETERS" AND "V")                    I2
C     JUN 19/97 - F.MAJAESS (CHANGE PTMIN VALUE TO 1.E-10 FROM 0.01)            
C     JUN 13/97 - F.MAJAESS (ADD "X50L" )                                       
C     SEP 27/95 - F.MAJAESS (LIMIT "1025TSL"  <= 10497025)                      
C     AUG 15/94 - F.MAJAESS (LIMIT "2RPM2MP1" <= 6000000)                       
C     DEC 30/93 - F.MAJAESS (ADD 8L AND LBIJ )                                  
C     DEC 30/93 - F.MAJAESS (REVISE FOR TRUNCATIONS > 99)                       
C     APR 15/93 - E.CHAN   (CHANGE 13TSL TO 1025TSL FOR GGATIM)                
C     NOV 24/92 - E.CHAN   (ADD NEW PARAMETERS NLM AND NLMNLM FOR SPPLOT) 
C     SEP 16/92 - E.CHAN   (ADD NEW PARMSUB PARAMETER LREC FOR DIMENSIONING     
C                           ARRAY USED IN PAKGCMH, PAKGCM7 AND UNPAKRS)        
C     JUL 29/92 - E.CHAN   (ADD NEW PARMSUB PARAMETERS FOR DIMENSIONING       
C                           ARRAYS USED AS I/O BUFFERS)                      
C     FEB 06/92 - E.CHAN   (MODIFY TO USE JUST STANDARD INPUT/OUTPUT)       
C     DEC 19/90 - F.MAJAESS                                                     
C                                                                               I2
CPGMPARM - COMPUTES ARRAY DIMENSIONS FOR PROGRAM LIBRARY                0  1 C  I1
C                                                                               I3
CAUTHOR  - F.MAJAESS                                                            I3
C                                                                               I3
CPURPOSE - COMPUTES AND WRITES OUT TO STANDARD OUTPUT THE INPUT CARD IMAGES     I3
C          USED BY PARMSUB TO PROCESS THE PROGRAM LIBRARY ARRAY DIMENSIONS      I3 
C          (AUTOMATIC DIMENSIONING)                                             I3
C 
CINPUT PARAMETERS...
C                                                                               I5
C      ILEV    = NUMBER OF MODEL LEVELS.                                        I5
C      LON     = NUMBER OF GRID LONGITUDES.                                     I5
C      LAT     = NUMBER OF GRID LATITUDES.                                      I5
C      LRT,LMT = N,M SPECTRAL TRUNCATION WAVE NUMBERS.                          I5
C      TYP     = SPECTRAL TRUNCATION TYPE (0=RHOMBOIDAL, 2=TRIANGULAR).         I5
C      PLV     = NUMBER OF PRESSURE LEVELS.                                     I5
C      BLN,BLT = CONTROL ARRAY DIMENSIONS FOR A SUBSET OF THE PROGRAM LIBRARY   I5
C                WHICH HANDLE LARGE RECORD FIELDS (1X1 GRID)                    I5
C                "BLN" CONTROLS THE NUMBER OF LONGITUDES,                       I5
C                "BLT"    "      "     "      LATITUDES (EQUATOR INCLUDED).     I5
C      TSL     = MAXIMUM TIME SERIES LENGTH.                                    I5
C      MACHINE = 1 IF PROGRAMS ARE TO BE COMPILED ON A MACHINE WITH 64-BIT      I5
C                  INTEGERS                                                     I5
C              = 2 IF PROGRAMS ARE TO BE COMPILED ON A MACHINE WITH 32-BIT      I5
C                  INTEGERS                                                     I5
C                (THIS INFORMATION IS REQUIRED TO SET THE CORRECT LENGTH OF     I5
C                 ARRAYS USED AS I/O BUFFERS FOR STANDARD 64-BIT IEEE DATA)     I5
C                                                                               I5
C      NOTE - ANY OF THE ABOVE MAY BE SET TO A VALUE GREATER THAN OR            I5
C             EQUAL TO THE REQUIRED SIZE.                                       I5
C                                                                               I5
CEXAMPLE OF INPUT CARD...                                                       I5
C                                                                               I5
C* PGMPARM   20   96   48   32   32    2   20  360  181     10241    2          I5
C---------------------------------------------------------------------------- 
C 
C     * ARRAY DIMENSIONS NAMING CONVENTION. 
C 
C     * L     = ILEV   = NUMBER OF MODEL LEVELS 
C     * I     = LON+1  = NUMBER OF GRID LONGITUDES + 1
C     * J     = LAT    = NUMBER OF GRID LATITUDES 
C     * PL    = PLV    = NUMBER OF PRESSURE LEVELS
C     * BI    = BLN+1  = NUMBER OF HIGH RESOLUTION GRID LONGITUDES + 1
C     * BJ    = BLT    = NUMBER OF HIGH RESOLUTION GRID LATITUDES 
C     * M     = LM  + 1 
C     * N     = LRT + 1 
C     * R     = LA
C     * V     = MACHINE (VARIABLE - DEPENDS ON TYPE OF MACHINE CODE
C     *                  IS TO BE COMPILED ON)
  
      IMPLICIT REAL (A-H,O-Z),
     +INTEGER (I-N)
      CHARACTER ASTRNG*80
      INTEGER V,TSL,TYP,PLV,BLN,BLT,BI,BJ,PL,R,RPM,IU,LSR(2,400)
      INTEGER OI,OJ,OL
      REAL    PTMIN 
      DATA MXMP1/400/
  
C-------------------------------------------------------------------- 
C 
      READ(5,5010,END=901) ILEV,LON,LAT,LRT,LMT,TYP,PLV,BLN,BLT,TSL,            I4
     1                     MACHINE                                              I4 
      IF (MACHINE.NE.1 .AND. MACHINE.NE.2) CALL    XIT('PGMPARM',-2) 
      IF((LRT+2).GT.MXMP1.OR.(LMT+2).GT.MXMP1)CALL XIT('PGMPARM',-3) 
C 
      IF ( LRT.GE.99 .OR. LMT.GE.99 ) THEN
        LRLMT=10000*(LRT+1)+10*(LMT+1)+TYP 
      ELSE
        LRLMT=1000*(LRT+1)+10*(LMT+1)+TYP 
      ENDIF
C 
      CALL DIMGT(LSR,LA,LR,LM,KTR,LRLMT)
C 
      L     = ILEV
      I     = LON + 1 
      J     = LAT 
      PL    = PLV 
      M     = LM
      N     = LR
      R     = LA
      RPM   = R + M 
      NLM   = 3 * (M - 1) + M
      L     = MAX(L,PL)
      BI    = BLN + 1 
      BJ    = BLT 
      V     = MACHINE
C     
C     * SET NUMBER OF TRACERS.
C
      NTRAC=10
C 
C     * SET PLID MINIMUM VALUE... 
C 
      PTMIN=1.E-10
C 
C     * SET TAPE UNIT NUMBER WHERE THE PARMSUB PARAMETERS ARE TO BE WRITTEN TO. 
C 
      IU=6
C 
C     * WRITE PLID MINIMUM VALUE... 
C 
      WRITE(IU,1000) PTMIN
C 
C     * INITIALIZE "ASTRNG" STRING. 
C 
      NCPS=0
      CALL PUTPARM(IU,ASTRNG,NCPS,'        ',-1)
C 
C     * DECLARE PARMSUB PARAMETER D=$,
C     * (THIS IS NECESSARY BECAUSE OF THE DOLLAR SIGNS IN THE SOURCE CODE)
C 
      ASTRNG(NCPS+1:NCPS+5)='D=$, ' 
      NCPS=NCPS+5 
C 
C     * THEN, COMPUTE AND WRITE OUT:  
C 
C     * PARAMETERS DEPENDENT ON THE NUMBER OF LONGITUDINAL POINTS IN THE
C     * GAUSSIAN GRID.
C     * (POSSIBLY THOSE DEPENDENT ON THE NUMBER OF LEVELS AS WELL)
C     * "64IP1" IS USED TO CONTROL THE DIMENSION OF A WORKING ARRAY IN
C     *         DOING THE TRANSFORMATION FROM GRID TO FOURIER COEFFICIENTS. 
C     *         "64" IS A MULTIPLIER USED FOR IMPROVING THE VECTORIZATION.
C     * "LIP3"  IS SIMILAR TO "64IP1" EXCEPT IT APPLIES FOR MULTILEVEL TRANS. 
C     * "13LHI"/"17LHI" IS USED TO CONTROL ACCUMULATION ARRAY DIMENSION IN
C     *          SPDVDT/SPDDDT WHERE "13"/"17" REFERS TO THE NUMBER OF
C     *          VARIABLES... 
C     * "LREC" IS USED TO CONTROL GRID SLICE DIMENSION SIZES USED IN PAKGCMH,
C     * PAKGCM7, AND UNPAKRS TO DO I/O ON THE MODEL RESTART FILE.
C 
      CALL PUTPARM(IU,ASTRNG,NCPS,'I       ',     I  )
      CALL PUTPARM(IU,ASTRNG,NCPS,'IM1     ',     I-1)
      CALL PUTPARM(IU,ASTRNG,NCPS,'IP1     ',     I+1)
      CALL PUTPARM(IU,ASTRNG,NCPS,'64IP1   ',64* (I+1)) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'64IP1P1 ',64* (I+1)+1) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'LIP3    ',  L*(I+3)) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'2LIP3   ',2*L*(I+3)) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'13LHI   ',13*L*INT(0.5E0*(I+1))) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'17LHI   ',17*L*INT(0.5E0*(I+1))) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'LREC    ',  (I+1)*L*(4+NTRAC))
C 
C     * PARAMETERS DEPENDENT ON THE LAT/LONG GAUSSIAN GRID RESOLUTION 
C     * (POSSIBLY THOSE DEPENDENT ON THE NUMBER OF LEVELS AS WELL)
C     * "26IJ"/"40IJ" IS USED TO CONTROL ACCUMULATION ARRAY DIMENSION IN
C     *          CRVPLOT/PERMUT WHERE "26"/"40" REFERS TO THE NUMBER OF 
C     *          CURVES/PERMUTATIONS THAT CAN BE PROCESSED. 
C 
      CALL PUTPARM(IU,ASTRNG,NCPS,'IJ      ',     I*J)
      CALL PUTPARM(IU,ASTRNG,NCPS,'2IJ     ', 2*  I*J)
      CALL PUTPARM(IU,ASTRNG,NCPS,'26IJ    ',26*  I*J   ) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'40IJ    ',40*  I*J   ) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'HIJ     ',INT((I*J+1)/2.E0)) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'IJP10   ',     I*J+10) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'LIJ     ', L   *I*J )
      CALL PUTPARM(IU,ASTRNG,NCPS,'LP1IJ   ',(L+1)*I*J )
      CALL PUTPARM(IU,ASTRNG,NCPS,'PLIJ    ',PL*I*J)
C 
C     * PARAMETERS FOR ZONAL/MERIDIONAL FIELDS
C     * (POSSIBLY ON THE NUMBER OF LEVELS AS WELL)
C     * "26XIJ" IS USED TO CONTROL ACCUMULATION ARRAY DIMENSION IN XMPLOT 
C     *         WHERE "26" REFERS TO THE NUMBER OF CURVES...
C     * "X100J" AND "JX100J" ARRAY DIMENSION PARAMETERS ARE USED IN ZXDLAT
C     *         WHERE THEIR VALUES ARE RELATED TO THE MAXIMUM NUMBER OF 
C     *         LEGENDRE POLYNIMIALS USED IN THE EXPANSION. THESE TWO 
C     *         PARAMETER VALUES ARE FORCED TO BE AT LEAST 100 IN ORDER TO
C     *         KEEP THE DIMENSIONS UPWARDLY COMPATIBLE WITH PRESENT VALUES...
C 
      CALL PUTPARM(IU,ASTRNG,NCPS,'XIJ     ',    MAX(I  ,J)) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'26XIJ   ',26* MAX(I  ,J)) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'XIP1J   ',    MAX(I+1,J)) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'X100J   ',    MAX(100,J)) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'JX100J  ', J* MAX(100,J)) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'LXIJ    ',L*MAX(I  ,J)) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'LXIP1J  ',L*MAX(I+1,J)) 
C 
C     * PARAMETERS DEPENDENT ON THE NUMBER OF GAUSSIAN LATITUDES. 
C     * "JLP2LP2" CONTROLS THE DIMENSION OF THE ARRAY USED IN THE 
C     *           CALCULATION OF CLOUD AMOUNT IN INITCL6 PROGRAM. 
C 
      CALL PUTPARM(IU,ASTRNG,NCPS,'J       ',J) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'JLP2LP2 ',J*(L+2)*(L+2)  ) 
C 
C     * PARAMETERS DEPENDENT ON THE LARGEST LAT/LONG GRID.
C     * (POSSIBLY ON THE NUMBER OF LEVELS AS WELL)
C     * "2BIP3" AND "3BIP3" CONTROL THE DIMENSION OF THE WORK ARRAYS USED 
C     *           IN DOING THE TRANFORMATION FROM GRID TO SPECTRAL COEFF. 
C     * "L2RAIP1J" CONTROLS THE DIMENSION OF AN ARRAY USED IN DOING THE 
C     *           TRANFORMATION SPECTRAL SPACE TO GRID. IT APPEARS IN 
C     *           COFAGG, COFALL AND GGACOF PROGRAMS. 
C     * "LBIJ"    CONTROLS THE DIMENSION OF AN ARRAY USED IN THE 
C     *           ENSEMBLE AVERAGING PROGRAMS.
C 
      CALL PUTPARM(IU,ASTRNG,NCPS,'BI      ',        BI  )
      CALL PUTPARM(IU,ASTRNG,NCPS,'BIP3    ',        BI+3)
      CALL PUTPARM(IU,ASTRNG,NCPS,'2BIP3   ',2*     (BI+3)) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'3BIP3   ',3*     (BI+3)) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'3HBIP3  ',3*INT( (BI+4)/2.E0)) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'BIP5    ',        BI+5)
      CALL PUTPARM(IU,ASTRNG,NCPS,'HBIHBJ  ',(  INT((BI+1)/2.E0)-1)*
     1                                          INT((BJ+1)/2.E0)     )
      CALL PUTPARM(IU,ASTRNG,NCPS,'BJ      ',        BJ)
      CALL PUTPARM(IU,ASTRNG,NCPS,'HBJ     ',   INT((BJ+1)/2.E0)     )
      CALL PUTPARM(IU,ASTRNG,NCPS,'BIJ     ',     BI*BJ   ) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'XBIBJ   ',MAX(BI,BJ)  ) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'BIJP10  ',     BI*BJ+10) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'LBJ     ',L*BJ)
      CALL PUTPARM(IU,ASTRNG,NCPS,'LBIJ    ',L*BI*BJ)
      CALL PUTPARM(IU,ASTRNG,NCPS,'LXBIBJ  ',L*MAX(BI,BJ)  ) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'L2RAIP1J',L*(2*(R+M)+(I+1)*J)) 
C 
C     * PARAMETERS DEPENDENT ON THE NUMBER OF MODEL/MOISTURE LEVELS.
C     * "LL" AND "4LP3" PARAMETERS APPEAR IN GSOMEGA PROGRAM WHERE THE FIRST
C     *           CONTROLS THE DIMENSION OF THE DRY CONVECTIVE STABILITY
C     *           MATRICES, AND THE LATER IS USED TO CONTROL AN ARRAY SIZE
C     *           WHERE 4 MULTILEVEL AND 3 SURFACE VARIABLES VALUES ARE STORED. 
C     * "X33L" ARRAY DIMENSION PARAMETER APPERARS IN ZXLOOK. ITS VALUE IS 
C     *           FORCED TO BE AT LEAST 33 IN ORDER TO KEEP THE DIMENSION 
C     *           UPWARDLY COMPATIBLE WITH PRESENT VALUE... 
C     * "X50L" ARRAY DIMENSION PARAMETER APPERARS IN ICNTRL9. ITS VALUE IS 
C     *           FORCED TO BE AT LEAST 50 IN ORDER TO KEEP THE DIMENSION 
C     *           UPWARDLY COMPATIBLE WITH PRESENT VALUE... 
C     * "8L"   ARRAY DIMENSION PARAMETER APPERARS IN ENSEMBLE AVERAGING 
C     *        PROGRAMS TO STORE THE 8-WORD LABEL OF THE RECORDS OPERATED
C     *        ON.
C 
      CALL PUTPARM(IU,ASTRNG,NCPS,'L       ',   L)
      CALL PUTPARM(IU,ASTRNG,NCPS,'LP1     ',   L+1)
      CALL PUTPARM(IU,ASTRNG,NCPS,'LM1     ',   L-1)
      CALL PUTPARM(IU,ASTRNG,NCPS,'LP2     ',   L+2)
      CALL PUTPARM(IU,ASTRNG,NCPS,'LM3     ',   L-3)
      CALL PUTPARM(IU,ASTRNG,NCPS,'8L      ', 8*L  )
      CALL PUTPARM(IU,ASTRNG,NCPS,'4LP3    ', 4*L+3)
      CALL PUTPARM(IU,ASTRNG,NCPS,'LL      ',   L*L)
      CALL PUTPARM(IU,ASTRNG,NCPS,'X33L    ',MAX(33,L))
      CALL PUTPARM(IU,ASTRNG,NCPS,'X50L    ',MAX(50,L))
C 
C     * PARAMETERS DEPENDENT ON THE NUMBER OF MODEL/MOISTURE LEVELS.
C 
      CALL PUTPARM(IU,ASTRNG,NCPS,'PL      ',PL)
      CALL PUTPARM(IU,ASTRNG,NCPS,'PLP1    ',PL+1)
C 
C     * COMPLEX ARRAYS DIMENSION PARAMETERS 
C     * "MAXC" APPERAS IN SPAMP, SPCONJ, SPREIM...
C     * "2MAXC" HAS TWICE THE VALUE OF "MAXC" AND IT IS USED WITH REAL ARRAYS.
C 
      CALL PUTPARM(IU,ASTRNG,NCPS,'MAXC    ',  MAX((M+1)*J,(R+M))) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'2MAXC   ',2*MAX((M+1)*J,(R+M))) 
C 
C     * PARAMETERS DEPENDENT ON "LM" SPECTRAL TRUNCATION. 
C     * "2MM" PARAMETER APPEARS IN SPPLOT WHERE IT IS USED ON ARRAYS STORING
C     *           SPECTRAL FIELDS.
C     * "2MP1" PARAMETER APPEARS IN COFAPS WHERE IT IS USED ON ARRAYS STORING 
C     *           FOURIER COEFFICIENTS. 
C     * "NLM" PARAMETER APPEARS IN SPPLOT WHERE IT IS USED FOR DEFINING
C     *           ARRAY CONTAINING GRID PASSED TO CONTOURING ROUTINES.
C     * "6MP1" PARAMETER IS SIMILAR TO "2MP1" EXCEPT ITS CALCULATION IS BASED 
C     *           ON 6 VARIABLES. THIS PARAMETER APPEARS IN SPVDGX PROGRAM. 
C 
      CALL PUTPARM(IU,ASTRNG,NCPS,'M       ',    M) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'2MM     ',2*  M*M) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'MP1     ',    M+1) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'2MP1    ',2* (M+1))
      CALL PUTPARM(IU,ASTRNG,NCPS,'NLM     ',     NLM)   
      CALL PUTPARM(IU,ASTRNG,NCPS,'NLMNLM  ', NLM*NLM)
      CALL PUTPARM(IU,ASTRNG,NCPS,'6MP1    ',6* (M+1))
C 
C     * FOURIER COEFFICIENTS COMPLEX ARRAYS DIMENSION PARAMETERS
C     * "NPM" PARAMETER APPEARS IN SPCSUM, SPFLUX AND SPSLOPE PROGRAMS. 
C 
      CALL PUTPARM(IU,ASTRNG,NCPS,'MP1J    ',   (M+1)*J  )
      CALL PUTPARM(IU,ASTRNG,NCPS,'2MP1J   ',2* (M+1)*J   ) 
C 
      CALL PUTPARM(IU,ASTRNG,NCPS,'MP1JL   ',   (M+1)*J*L)
      CALL PUTPARM(IU,ASTRNG,NCPS,'N       ',N) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'NPM     ',N+M  ) 
C 
C     * SPECTRAL FIELDS COMPLEX ARRAY DIMENSION PARAMETERS
C 
      CALL PUTPARM(IU,ASTRNG,NCPS,'R       ',  R) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'2R      ',2*R  ) 
C 
C     * PARAMETERS DEPENDENT ON "LA" AND "LM" FOR SPECTRAL FIELDS.
C     * "RP2M" PARAMETER APPEARS IN COFAGG PROGRAM. 
C     * "2RPM2MP1" PARAMETER CONTROLS THE DIMENSION OF ACCUMULATION ARRAY 
C     *           USED IN SPVDGX WHERE THE EFFICIENT EXECUTION OF THE 
C     *           PROGRAM IS VERY MUCH DEPENDENT ON HAVING THE ARRAYS 
C     *           DIMENSIONED LARGE ENOUGH... 
C 
      CALL PUTPARM(IU,ASTRNG,NCPS,'RPM     ',R+M) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'2RPM    ',2*(R+M)) 
C     * THIS FIX IS BECAUSE OF THE MEMORY SIZE ON THE IBM
C     * IN WHICH "2RPM2MP1" USED IN "SPVDGX" IS LIMTED TO 6 MILLIONS.
      IF(2*(R+M)*2*(M+1).GT.6000000) THEN
       CALL PUTPARM(IU,ASTRNG,NCPS,'2RPM2MP1',6000000 ) 
      ELSE
       CALL PUTPARM(IU,ASTRNG,NCPS,'2RPM2MP1',2*(R+M)*2*(M+1)) 
      ENDIF

      CALL PUTPARM(IU,ASTRNG,NCPS,'RP2M    ',R+(2*M)) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'RP2MP1  ',R+(2*M)+1) 
C 
C     * PARAMETERS DEPENDENT ON THE NUMBER OF LEVELS. 
C     * "6RPML" PARAMETER APPEARS IN SPDDDT PROGRAM WHERE ITS VALUE CONTROLS
C     *           THE DIMENSION OF SPECTRAL ACCUMULATION ARRAY STORING DATA 
C     *           FOR SIX VARIABLES.
C 
      CALL PUTPARM(IU,ASTRNG,NCPS,'RL      ',  R*L) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'2RL     ',2*R*L) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'R2LP1   ',  R*(2*L+1)) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'RLP1    ',  R*(L+1)) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'6RPML   ',6*(R+M)*L) 
C 
C     * PARAMETERS FOR TIME SERIES ARRAYS.
C     * "2TSLP1"/"6TSLP1" PARAMETER IS USED TO CONTROL ARRAY REFERENCE ADDRESS
C     *           IN AN EQUIVALENCE STATEMENT IN GGATIM/TIMAGG PROGRAM. 
C     * "6TSLP1" AND "6TSLP18" ARE USED IN TSAFC PROGRAM WHERE TRANSFORMATION 
C     *           FROM TIME SERIES TO FOURIER COEFFICIENTS IS DONE. MAINLY
C     *           THEY CONTROL WORKING ARRAY DIMENSIONS.
C     * "7TSLP1"  HAS SIMILAR DESCRIPTION AS "6TSLP1" AND IT APPEARS IN FCATS.
C     * "12TSL"/"1025TSL" APPEARS IN TIMAGG/GGATIM PROGRAM. 
C 
      CALL PUTPARM(IU,ASTRNG,NCPS,'HTSL    ',INT((TSL+1)/2.E0)) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'TSL     ',     TSL)
      CALL PUTPARM(IU,ASTRNG,NCPS,'TSLP1   ',     TSL+1)
      CALL PUTPARM(IU,ASTRNG,NCPS,'2TSLP1  ', 2*  TSL+1)
      CALL PUTPARM(IU,ASTRNG,NCPS,'6TSL    ', 6*  TSL)
      CALL PUTPARM(IU,ASTRNG,NCPS,'6TSLP1  ', 6*  TSL+ 1) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'6TSLP18 ', 6*  TSL+18) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'7TSL    ', 7*  TSL)
      CALL PUTPARM(IU,ASTRNG,NCPS,'7TSLP1  ', 7*  TSL+1)
      CALL PUTPARM(IU,ASTRNG,NCPS,'12TSL   ',12*  TSL   ) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'1025TSL ',
     +              MIN(1025*TSL,MAX(13*TSL,1025*10241)))
C 
C     * "WRKS" IS AN ACCUMULATION WORK ARRAY DIMENSION PARAMETER USED IN
C                 GGACOF PROGRAM. 
C 
      CALL PUTPARM(IU,ASTRNG,NCPS,'WRKS    ',MAX((I+3)*L+64*(I+1), 
     1                                            2*R)) 
C
C     * PARAMETERS FOR I/O BUFFERS.
C
      CALL PUTPARM(IU,ASTRNG,NCPS,'V       ',                     V) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'JV      ',                   J*V) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'IJV     ',                 I*J*V)
      CALL PUTPARM(IU,ASTRNG,NCPS,'XIJV    ',            MAX(I,J)*V) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'JLP2LP2V',       J*(L+2)*(L+2)*V) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'BJV     ',                  BJ*V)
      CALL PUTPARM(IU,ASTRNG,NCPS,'BIV     ',                  BI*V)
      CALL PUTPARM(IU,ASTRNG,NCPS,'BIJV    ',               BI*BJ*V) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'BIJP10V ',            10+BI*BJ*V) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'2RPMV   ',             2*(R+M)*V) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'2MAXCV  ',2*MAX((M+1)*J,(R+M))*V) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'2RV     ',                 2*R*V) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'2MP1JV  ',           2*(M+1)*J*V) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'NPMV    ',               (N+M)*V) 
      CALL PUTPARM(IU,ASTRNG,NCPS,'TSLV    ',                 TSL*V)
      CALL PUTPARM(IU,ASTRNG,NCPS,'LRECV   ',   (I+1)*L*(4+NTRAC)*V)
      CALL PUTPARM(IU,ASTRNG,NCPS,'XBIBJV  ',          MAX(BI,BJ)*V)
      CALL PUTPARM(IU,ASTRNG,NCPS,'LXBIBJV ',        L*MAX(BI,BJ)*V)
C
C     * OCEAN PARAMETERS...
C
      OI=769
      OJ=384
      OL=200
      CALL PUTPARM(IU,ASTRNG,NCPS,'OI      ',                    OI)
      CALL PUTPARM(IU,ASTRNG,NCPS,'OJ      ',                    OJ)
      CALL PUTPARM(IU,ASTRNG,NCPS,'OIJ     ',                 OI*OJ)
      CALL PUTPARM(IU,ASTRNG,NCPS,'OIJV    ',               OI*OJ*V)
      CALL PUTPARM(IU,ASTRNG,NCPS,'OIP2    ',                  OI+2)
      CALL PUTPARM(IU,ASTRNG,NCPS,'OJP2    ',                  OJ+2)
      CALL PUTPARM(IU,ASTRNG,NCPS,'OIP2JP2 ',         (OI+2)*(OJ+2))
      CALL PUTPARM(IU,ASTRNG,NCPS,'OIP2JP2V',       (OI+2)*(OJ+2)*V)
      CALL PUTPARM(IU,ASTRNG,NCPS,'OL      ',                    OL)
C 
C     * WRITE OUT WHATEVER LEFT IN "ASTRNG"...
C 
      IF(NCPS.GT.1) THEN
        NCPS=-NCPS
        CALL PUTPARM(IU,ASTRNG,NCPS,'        ',-1)
      ENDIF 
C 
C     * NORMAL PROGRAM TERMINATION.
C 
      STOP
  
C     * E.O.F. ON INPUT.
  
  901 CALL                                         XIT('PGMPARM',-1) 
C-------------------------------------------------------------------- 
 1000 FORMAT(' PTMIN=',E10.3,',')                                               
 5010 FORMAT(10X,7I5,2I5,I10,I5)                                                I4
      END 
