* PACKAGE ASETS  
*
*"  [HIS] 90/05/19(numaguti)
*"        92/11/09(takepiro)
*"        93/11/05(horinout) デフォルト以外の KMAX も許されるようにした
*"        96/03/08(ishiwatari)
*
***********************************************************************
      SUBROUTINE SETSIG      
     O         ( SIG   , DSIG  , HASIG ,
     O           SIGM  , DSIGM , HASIGM,
     D           KMAX  , KDIM            )
*
*"               (*  Arakawa & Suarez 鉛直差分 σ座標 *)
*
*   [PARAM] 




* PACKAGE ZHDIM  !" 標準物理定数(common)  
*
*"  [HIS]  90/08/31(numaguti)
*
      ReaL*8       ER             !" 地球半径
      ReaL*8       GRAV                        !" 重力加速度
      ReaL*8       CP                          !" 大気定圧比熱
      ReaL*8       RAIR                        !" 大気気体定数
      ReaL*8       EL                          !" 水の凝結の潜熱
      ReaL*8       CPVAP                       !" 水蒸気定圧比熱
      ReaL*8       RVAP                        !" 水蒸気気体定数
      ReaL*8       DH2O                        !" 水の密度
      ReaL*8       EPSV                        !" 水と大気の分子量比ε
      ReaL*8       ES0                         !" ０℃飽和蒸気圧：Ｐａ
      ReaL*8       STB                         !" Stefan-Boltzman
      ReaL*8       FKARM                       !" Karman 定数
      ReaL*8       EPSVT                       !" 1/ε-1
*
      COMMON   /COMCON/
     &          ER    , GRAV  ,
     &          CP    , RAIR  ,
     &          EL    , CPVAP , RVAP  , DH2O  , EPSV  , ES0   ,
     &          STB   , FKARM , EPSVT

      INTEGER    KMAX,  KDIM
*
*   [OUTPUT] 
      ReaL*8       SIG   ( KDIM )              
      ReaL*8       SIGM  (KDIM+1)              
      ReaL*8       DSIG  ( KDIM )              
      ReaL*8       DSIGM (KDIM+1)              
      CHARACTER  HASIG  *(*)                 
      CHARACTER  HASIGM *(*)                 
*
*    [INTERNAL WORK]    
      ReaL*8       AKAPPA                      
      INTEGER    K
*
*"         < 1. σ(半整数) >
*
      CALL SETSGM
     O         ( SIGM  , HASIG , HASIGM ,
     I           KMAX                    )
*
*"         < 2. σ, Δσの計算 >
*
      AKAPPA = RAIR / CP
*
      DO 3100 K = 1 , KMAX
*
        DSIG  ( K ) =   SIGM ( K ) - SIGM ( K+1 )
*
        SIG   ( K ) = (    (   SIGM ( K   )**( 1. + AKAPPA )
     &                       - SIGM ( K+1 )**( 1. + AKAPPA )  )
     &                   / (   DSIG ( K ) *  ( 1. + AKAPPA )  )
     &                 )
     &                  **( 1. /AKAPPA )
*
 3100 CONTINUE
*
      DO 3200 K = 2, KMAX
        DSIGM ( K ) = SIG ( K-1 ) - SIG ( K )
 3200 CONTINUE
      DSIGM ( 1      ) = SIGM( 1    ) - SIG ( 1      )
      DSIGM ( KMAX+1 ) = SIG ( KMAX ) - SIGM( KMAX+1 )
*
      RETURN
      END
************************************************************************
*"         << σレベル(半整数) >>
************************************************************************
      SUBROUTINE SETSGM
     O         ( SIGMX , HASIGX , HASIMX,
     I           KMAX                     )
*
*   [PARAM] 
      INTEGER    KMAX,K
*
*   [OUTPUT] 
      ReaL*8       SIGMX (KMAX+1)              
      CHARACTER  HASIGX *(*)                 
      CHARACTER  HASIMX *(*)                 
*
*   [INTERNAL WORK] 




* PACKAGE ZHDIM  !" 文字列文字数 
*
*"  [HIS]  90/08/31(numaguti)
*
      INTEGER     NCC
      INTEGER     NDC
      INTEGER     NFILN
*
      PARAMETER ( NCC   = 16, NDC   = 64 ,
     &            NFILN = 38              )

      INTEGER    KDIMD
      PARAMETER ( KDIMD=1000 )
*"                            1000->10000 に変更 94/05/16 (Ishiwatari)
      ReaL*8       SIGM  ( KDIMD )
*
*    [INTERNAL PARAM]
      INTEGER    KM1, KM2, KM5, KM12, KM16, KM23, KM45
      INTEGER    KM22, KM32, KM33, KM40, KM41, KM64,
     &           KM21, KM24, KM28, KM99, KM1000
c$$$     &           KM5000, KM2000, KM9999, KM1M
*"                            追加 2002/06/20 (Ishiwatari)
*
      SAVE
*
      PARAMETER  ( KM1=1 )
      ReaL*8       SIGM1 ( KM1+1 )
      DATA       SIGM1 / 1.000  , 0.000   /
      PARAMETER  ( KM2=2 )
      ReaL*8       SIGM2 ( KM2+1 )
      DATA       SIGM2 / 1.000  , 0.500  , 0.000 /
      PARAMETER  ( KM5= 5 )
      ReaL*8       SIGM5 ( KM5+1 )
      DATA       SIGM5 / 1.000, 0.800, 0.600, 0.300,
     &                   0.150,
     &                   0.000                /
      PARAMETER  ( KM12=12 )
      ReaL*8       SIGM12 ( KM12+1 )
      DATA       SIGM12/ 1.000  , 0.990  , 0.970  , 0.930  , 0.850  ,
     &                   0.750  , 0.630  , 0.500  , 0.360  , 0.220  ,
     &                   0.100  , 0.050  , 0.000                    /
      PARAMETER  ( KM16=16 )
      ReaL*8       SIGM16 ( KM16+1 )
      DATA       SIGM16/ 1.000  , 0.990  , 0.970  , 0.930  , 0.870  ,
     &                   0.790  , 0.700  , 0.600  , 0.500  , 0.410  ,
     &                   0.330  , 0.260  , 0.200  , 0.150  , 0.100  ,
     &                   0.050  , 0.000                             /
      PARAMETER  ( KM21=21 )    
      ReaL*8       SIGM21 ( KM21+1 )
      DATA       SIGM21/ 1.000  , 0.990  , 0.970  , 0.930  , 0.870  ,
     &                   0.790  , 0.700  , 0.600  , 0.500  , 0.410  ,
     &                   0.330  , 0.260  , 0.200  , 0.150  , 0.100  ,
     &                   0.050  , 0.1E-1 , 0.1E-2 , 0.1E-3 , 0.1E-4 , 
     &                   0.1E-5 , 0.000                             /
      PARAMETER  ( KM22=22 )    
      ReaL*8       SIGM22 ( KM22+1 )
      DATA       SIGM22/ 1.000  , 0.990  , 0.980  , 0.970  , 0.950  ,
     &                   0.930  , 0.900  , 0.870  , 0.830  , 0.790  , 
     &                   0.745  , 0.700  , 0.650  , 0.600  , 0.500  ,
     &                   0.410  , 0.330  , 0.260  , 0.200  , 0.150  ,
     &                   0.100  ,0.050  , 0.000                     /
      PARAMETER  ( KM23=23 )    
      ReaL*8       SIGM23 ( KM23+1 )
      DATA       SIGM23/ 1.000  , 0.990  , 0.980  , 0.965  , 0.945  ,
     &                   0.920  , 0.890  , 0.850  , 0.800  , 0.740  ,
     &                   0.650  , 0.550  , 0.450  , 0.360  , 0.300  ,
     &                   0.260  , 0.220  , 0.180  , 0.150  , 0.120  ,
     &                   0.090  , 0.060  , 0.030  , 0.000           /
      PARAMETER  ( KM24=24 )     
      ReaL*8       SIGM24 ( KM24+1 )
      DATA       SIGM24/ 1.000  , 0.990  , 0.970  , 0.930  , 0.870  ,
     &                   0.790  , 0.700  , 0.600  , 0.500  , 0.410  ,
     &                   0.330  , 0.260  , 0.200  , 0.150  , 0.100  ,
     &                   0.050  , 
     &                   0.254E-1 , 0.129E-1 , 0.658E-2 , 0.334E-2 ,
     &                   0.170E-2 , 0.865E-3 , 0.440E-3 , 0.224E-3 ,
     &                   0.000                             /
      PARAMETER  ( KM28=28 )    
      ReaL*8       SIGM28 ( KM28+1 )
      DATA       SIGM28/ 1.000  , 0.990  , 0.970  , 0.930  , 0.870  ,
     &                   0.790  , 0.700  , 0.600  , 0.500  , 0.410  ,
     &                   0.330  , 0.260  , 0.200  , 0.150  , 0.100  ,
     &                   0.050  , 
     &     0.203E-01 , 0.824E-02 , 0.334E-02 , 0.136E-02 , 0.551E-03 ,
     &     0.224E-03 , 0.908E-04 , 0.368E-04 , 0.150E-04 , 0.607E-05 ,
     &     0.246E-05 , 0.100E-5  , 0.000    /
      PARAMETER  ( KM32=32 )    
      ReaL*8       SIGM32 ( KM32+1 )
      DATA       SIGM32/ 1.000  , 0.990  , 0.970  , 0.930  , 0.870  ,
     &                   0.790  , 0.700  , 0.600  , 0.500  , 0.410  ,
     &                   0.330  , 0.260  , 0.200  , 0.150  , 0.100  ,
     &                   0.050  ,
     &      0.254E-1 , 0.129E-1 , 0.658E-2 , 0.334E-2 , 0.170E-2 ,
     &      0.865E-3 , 0.440E-3 , 0.224E-3 , 0.114E-3 , 0.578E-4 , 
     &      0.294E-4 , 0.150E-4 , 0.760E-5 , 0.387E-5 , 0.197E-5 , 
     &      0.100E-5 , 0.000                             /
      PARAMETER  ( KM33=33 )    
      ReaL*8       SIGM33 ( KM33+1 )
      DATA       SIGM33/ 1.000  , 0.990  , 0.970  , 0.930  , 0.870  ,
     &                   0.790  , 0.700  , 0.600  , 0.500  , 0.410  ,
     &                   0.330  , 0.260  , 0.200  , 0.150  , 0.100  ,
     &                   0.050  ,
     &      0.471E-1 , 0.441E-1 , 0.412E-1 , 0.382E-1 , 0.353E-1 ,
     &      0.324E-1 , 0.294E-1 , 0.265E-1 , 0.235E-1 , 0.206E-1 , 
     &      0.176E-1 , 0.147E-1 , 0.118E-1 , 0.882E-2 , 0.588E-2 , 
     &      0.294E-2 , 0.100E-2 , 0.000                             /
      PARAMETER  ( KM40=40 )    
      ReaL*8       SIGM40 ( KM40+1 )
      DATA       SIGM40/ 1.000  , 0.990  , 0.970  , 0.930  , 0.870  ,
     &                   0.790  , 0.700  , 0.600  , 0.500  , 0.410  ,
     &                   0.330  , 0.260  , 0.200  , 0.150  , 0.100  ,
     &                   0.050  ,
     &      0.254E-1 , 0.129E-1 , 0.658E-2 , 0.334E-2 , 0.170E-2 ,
     &      0.865E-3 , 0.440E-3 , 0.224E-3 , 0.114E-3 , 0.578E-4 , 
     &      0.294E-4 , 0.150E-4 , 0.760E-5 , 0.387E-5 , 0.197E-5 , 
     &      0.100E-5 , 
     &      0.509E-6 , 0.259E-6 , 0.132E-6 , 0.669E-7 , 0.340E-7 , 
     &      0.173E-7 , 0.879E-8 , 0.447E-8 , 
     &      0.0000                             /
      PARAMETER  ( KM41=41 )    
*"                            これはSKYHI と同じ鉛直座標
      ReaL*8       SIGM41 ( KM41+1 )
      DATA       SIGM41/ 1.000  , 0.9905 , 0.9601 , 0.9101 , 0.8455 ,
     &                   0.7712 , 0.6914 , 0.6099 , 0.5297 , 0.4531 ,
     &                   0.3817 , 0.3166 , 0.2585 , 0.2078 , 0.1653 ,
     &                   0.1305 , 0.1623 , 0.7961E-1 , 
     &    0.6154E-1 , 0.4730E-1 , 0.3622E-1 , 0.2766E-1 , 0.2105E-1 ,
     &    0.1598E-1 , 0.1208E-1 , 0.9101E-2 , 0.6827E-2 , 0.5096E-2 , 
     &    0.3784E-2 , 0.2791E-2 , 0.2044E-2 , 0.1485E-2 , 0.1066E-2 , 
     &    0.7525E-3 , 0.5182E-3 , 0.3447E-3 , 0.2187E-3 , 0.1295E-3 ,
     &    0.6876E-4 , 0.3043E-4 , 0.9448E-5 , 0.0000                /
      PARAMETER  ( KM45=45 )
      ReaL*8       SIGM45 ( KM45+1 )
      DATA       SIGM45/ 1.000, 0.990, 0.970, 0.930, 0.870,
     &                   0.790, 0.700, 0.600, 0.500, 0.410,
     &                   0.330, 0.260, 0.200, 0.150, 0.100,
     &                  0.861E-01,0.741E-01,0.638E-01,0.549E-01,
     &                  0.472E-01,0.407E-01,0.350E-01,0.301E-01,
     &                  0.259E-01,0.223E-01,0.192E-01,0.165E-01,
     &                  0.142E-01,0.122E-01,0.105E-01,0.907E-02,
     &                  0.781E-02,0.672E-02,0.578E-02,0.498E-02,
     &                  0.429E-02,0.369E-02,0.317E-02,0.273E-02,
     &                  0.235E-02,0.202E-02,0.174E-02,0.150E-02,
     &                  0.129E-02,0.111E-02, 0.000             /
      PARAMETER  ( KM64=64 )
      ReaL*8       SIGM64 ( KM64+1 )
      DATA       SIGM64/ 1.000 , 0.995 , 0.990 , 0.980 , 0.970 ,
     & 0.930 , 0.900 , 0.870 , 0.830 , 0.790 , 0.745 , 0.700 , 0.650 ,
     & 0.600 , 0.550 , 0.500 , 0.455 , 0.410 , 0.370 , 0.330 , 0.295 ,
     & 0.260 , 0.230 , 0.200 , 0.175 , 0.150 , 0.125 , 0.100 , 0.075 ,
     & 0.050 , 3.64E-02 , 2.65E-02 , 1.92E-02 , 1.40E-02 , 1.02E-02 , 
     & 7.41E-03 , 5.39E-03 , 3.92E-03 , 2.85E-03 , 2.07E-03 , 1.51E-03 ,
     & 1.10E-03 , 7.99E-04 , 5.81E-04 , 4.23E-04 , 3.07E-04 , 2.24E-04 ,
     & 1.63E-04 , 1.18E-04 , 8.61E-05 , 6.26E-05 , 4.55E-05 , 3.31E-05 , 
     & 2.41E-05 , 1.75E-05 , 1.28E-05 , 9.28E-06 , 6.75E-06 , 4.91E-06 , 
     & 3.57E-06 , 2.60E-06 , 1.89E-06 , 1.37E-06 , 1.00E-06 , 0.000  /
      PARAMETER  ( KM99=99 )
      ReaL*8       SIGM99 ( KM99+1 )
      DATA       SIGM99/1.000, 0.995, 0.990, 0.980, 0.970, 0.950,
     &    0.930, 0.910, 0.890, 0.870, 0.850, 0.830, 0.810, 0.790,
     &    0.770, 0.750, 0.730, 0.710, 0.690, 0.670, 0.650, 0.630,
     &    0.600, 0.570, 0.550, 0.530, 0.510, 0.490, 0.470, 0.450,
     &    0.430, 0.410, 0.390, 0.370, 0.350, 0.330, 0.300, 0.280,
     &    0.260, 0.230, 0.200, 0.175, 0.150, 0.125, 0.100, 0.931E-01,
     &    0.861E-01, 0.800E-01, 0.741E-01, 0.688E-01, 0.638E-01,
     &    0.549E-01, 0.510E-01, 0.472E-01, 0.440E-01, 0.407E-01,
     &    0.375E-01, 0.350E-01, 0.325E-01, 0.301E-01, 0.280E-01,
     &    0.259E-01, 0.240E-01, 0.223E-01, 0.205E-01, 0.192E-01,
     &    0.180E-01, 0.165E-01, 0.150E-01, 0.142E-01, 0.130E-01,
     &    0.122E-01, 0.111E-01, 0.105E-01, 0.915E-02, 0.907E-02,
     &    0.840E-02, 0.781E-02, 0.720E-02, 0.672E-02, 0.620E-02,
     &    0.578E-02, 0.540E-02, 0.498E-02, 0.465E-02, 0.429E-02,
     &    0.400E-02, 0.369E-02, 0.340E-02, 0.317E-02, 0.290E-02,
     &    0.273E-02, 0.255E-02, 0.235E-02, 0.210E-02, 0.190E-02,
     &    0.174E-02, 0.150E-02, 0.500E-03, 0.000    /
      PARAMETER  ( KM1000=1000 )
      ReaL*8       SIGM1T ( KM1000+1 )
c$$$      PARAMETER  ( KM2000=2000 )
c$$$      ReaL*8       SGM2E3 ( KM2000+1 )
c$$$      PARAMETER  ( KM5000=5000 )
c$$$      ReaL*8       SGM5E3 ( KM5000+1 )
c$$$      PARAMETER  ( KM9999=9999 )
c$$$      ReaL*8       SGM9E3 ( KM9999+1 )
c$$$      PARAMETER  ( KM1M=10000 )
c$$$      ReaL*8       SIGM1M( KM1M+1 )
*"      ln p 座標で等間隔  
*" 次の 1500, 1600 のループが入るとダメ
*" なんで???? 石渡 (2002/06/22)
c      DO 1500 K=1,KM99+1
c         SIGM99(K) = EXP( - 6.0 * ALOG(10.0)/KM99 * ReaL*8(K-1) )
c 1500 CONTINUE 
*"      ln p 座標で等間隔
c      DO 1600 K=1,KM1000+1
c         SIGM1T(K) = EXP( - 6.0 * ALOG(10.0)/KM1000 * ReaL*8(K-1) )
c 1600 CONTINUE 
c$$$      DO 1300 K=1,KM2000+1
c$$$         SGM2E3(K) = EXP( - 6.0 * ALOG(10.0)/KM2000 * ReaL*8(K-1) )
c$$$ 1300 CONTINUE 
c$$$      DO 1400 K=1,KM5000+1
c$$$         SGM5E3(K) = EXP( - 6.0 * ALOG(10.0)/KM5000 * ReaL*8(K-1) )
c$$$ 1400 CONTINUE 
c$$$      DO 1500 K=1,KM9999+1
c$$$         SGM9E3(K) = EXP( - 6.0 * ALOG(10.0)/KM9999 * ReaL*8(K-1) )
c$$$ 1500 CONTINUE 
c$$$      DO 1600 K=1,KM1M+1
c$$$         SIGM1M(K) = EXP( - 6.0 * ALOG(10.0)/KM1M * ReaL*8(K-1) )
c$$$ 1600 CONTINUE 
*"      ln p 座標で等間隔
*
      CHARACTER  HASIG1 *(NCC)
      DATA       HASIG1 / 'CSIG'  /
*
      WRITE ( 6,* ) 
     &     ' SIGMA LEVEL CSIG A2.1 MODIFIED BY momoko DATE=2002/06/20'
*
*"         < 1. デフォルト値 >
*
      IF      ( KMAX .EQ. KM1 ) THEN
         CALL COPY  ( SIGM, SIGM1, KM1+1 )
      ELSE IF ( KMAX .EQ. KM2 ) THEN
         CALL COPY  ( SIGM, SIGM2, KM2+1 )
      ELSE IF ( KMAX .EQ. KM5 ) THEN
         CALL COPY  ( SIGM, SIGM5, KM5+1 )
      ELSE IF ( KMAX .EQ. KM12 ) THEN
         CALL COPY  ( SIGM, SIGM12, KM12+1 )
      ELSE IF ( KMAX .EQ. KM16 ) THEN
         CALL COPY  ( SIGM, SIGM16, KM16+1 )
      ELSE IF ( KMAX .EQ. KM21 ) THEN
         CALL COPY  ( SIGM, SIGM21, KM21+1 )
      ELSE IF ( KMAX .EQ. KM22 ) THEN
         CALL COPY  ( SIGM, SIGM22, KM22+1 )
      ELSE IF ( KMAX .EQ. KM23 ) THEN
         CALL COPY  ( SIGM, SIGM23, KM23+1 )
      ELSE IF ( KMAX .EQ. KM24 ) THEN
         CALL COPY  ( SIGM, SIGM24, KM24+1 )
      ELSE IF ( KMAX .EQ. KM28 ) THEN
         CALL COPY  ( SIGM, SIGM28, KM28+1 )
      ELSE IF ( KMAX .EQ. KM32 ) THEN
         CALL COPY  ( SIGM, SIGM32, KM32+1 )
      ELSE IF ( KMAX .EQ. KM33 ) THEN
         CALL COPY  ( SIGM, SIGM33, KM33+1 )
      ELSE IF ( KMAX .EQ. KM40 ) THEN
         CALL COPY  ( SIGM, SIGM40, KM40+1 )
      ELSE IF ( KMAX .EQ. KM41 ) THEN
         CALL COPY  ( SIGM, SIGM41, KM41+1 )
      ELSE IF ( KMAX .EQ. KM45 ) THEN
         CALL COPY  ( SIGM, SIGM45, KM45+1 )
      ELSE IF ( KMAX .EQ. KM64 ) THEN
         CALL COPY  ( SIGM, SIGM64, KM64+1 )
      ELSE IF ( KMAX .EQ. KM99 ) THEN
         CALL COPY  ( SIGM, SIGM99, KM99+1 )
      ELSE IF ( KMAX .EQ. KM1000 ) THEN
         CALL COPY  ( SIGM, SIGM1T, KM1000+1 )
c$$$      ELSE IF ( KMAX .EQ. KM2000 ) THEN
c$$$         CALL COPY  ( SIGM, SGM2E3, KM2000+1 )
c$$$      ELSE IF ( KMAX .EQ. KM5000 ) THEN
c$$$         CALL COPY  ( SIGM, SGM5E3, KM5000+1 )
c$$$      ELSE IF ( KMAX .EQ. KM9999 ) THEN
c$$$         CALL COPY  ( SIGM, SGM9E3, KM9999+1 )
c$$$      ELSE IF ( KMAX .EQ. KM1M ) THEN
c$$$         CALL COPY  ( SIGM, SIGM1M, KM1M+1 )
      ELSE
*                     93/11/05 horinout, 'E' --> 'W' :
         CALL MSGDMP( 'W', 'SETSGM', 'DEFAULT LEVEL NOT DEFINED' )
         DO 1100 K=1,KMAX+1
            SIGM(K)=0.0
 1100    CONTINUE
      ENDIF
*
      CALL       SETSIX
     M         ( SIGM  ,
     O           HASIGX, HASIMX,
     I           HASIG1, KMAX   )
*
      CALL COPY ( SIGMX, SIGM, KMAX+1 )
*
      RETURN
*--------------------------------------------------------------------
      ENTRY      STNSIG
     O         ( HASIGX, HASIMX ,
     I           KMAX             )
*
      CALL       SETSIX
     M         ( SIGM  ,
     O           HASIGX, HASIMX,
     I           HASIG1, KMAX   )
*
      RETURN
      END
*====================================================================
      SUBROUTINE SETSIX
     M         ( SIGMY ,
     O           HASIGX, HASIMX,
     I           HASIG1, KMAX   )
*
*   [PARAM] 
      INTEGER    KMAX
*
*   [MODIFY] 
      ReaL*8       SIGMY ( * )
*
*   [OUTPUT] 
      CHARACTER  HASIGX *(*)                 
      CHARACTER  HASIMX *(*)                 
*
*   [INPUT] 
      CHARACTER  HASIG1 *(*)                 
*
*   [INTERNAL PARM] 




* PACKAGE ZHDIM  !" 文字列文字数 
*
*"  [HIS]  90/08/31(numaguti)
*
      INTEGER     NCC
      INTEGER     NDC
      INTEGER     NFILN
*
      PARAMETER ( NCC   = 16, NDC   = 64 ,
     &            NFILN = 38              )

      INTEGER    KDIMD
      PARAMETER ( KDIMD=10000 )   
      CHARACTER  HASIG  *(NCC)
      CHARACTER  HASIGM *(NCC)
      ReaL*8       SIGM  ( KDIMD )
*
      NAMELIST  /NMSIGM/ SIGM, HASIG , HASIGM
*
      CHARACTER  HASI0Z *(NCC)
      CHARACTER  HNUM   *(NCC)
*
*    [INTERNAL WORK]
      INTEGER    INUM, IAZ, K, IFPAR, JFPAR
*
*    [EXTERNAL FUNC]
      INTEGER    LENC
*
*"         < 1. 名称セット >
*
      CALL GULCHR
     I     ( '(I4)', KMAX  ,
     O       HNUM  , INUM   )
*
      HASI0Z = HASIG1
*
      IAZ    = LENC( HASI0Z )
      HASIG  = HASI0Z(1:IAZ)//HNUM(1:INUM)//'.P'
      HASIGM = HASI0Z(1:IAZ)//HNUM(1:INUM)//'.M'
*
*"         < 2. NAMELIST 読み込み >
*
      DO 2100 K = 1, KMAX
         SIGM( K ) = SIGMY( K )
 2100 CONTINUE    
*
      WRITE ( 6,* ) ' CONTROL PARAMETER NMSIGM: '
*
      CALL   REWNML ( IFPAR , JFPAR )
      READ   ( IFPAR, NMSIGM, END=2190 )
 2190 WRITE  ( JFPAR, NMSIGM )
*
      HASIGX = HASIG
      HASIMX = HASIGM
*
      DO 2900 K = 1, KMAX
         SIGMY( K ) = SIGM( K )
 2900 CONTINUE    
*
*" added by horinout 93/11/05--ここから（デフォルト以外の KMAX を許したので）
      IF ( SIGMY(1).EQ.0. )  CALL MSGDMP
     +  ( 'E','SETSIX','SIGM LEVEL MUST BE GIVEN BY NAMELIST INPUT' )
*" added by horinout --ここまで
*
      RETURN
      END
