* PACKAGE XMKSST  !" SST の作成
*
*"  [HIS] 93/9/12(堀之内) CALSST を適当に取り替えていろいろな初期場を
*"        つくれるように設定。今のところ一定値代入のルーチンがあるのみ。
*"        ( sstconst.F )
**************************************************************************
      PROGRAM MKSST
*
*   [PARAM] 
#if   SYS_IBMS
      INCLUDE   (ZCDIM)                      !" 格子点数, 波数
      INCLUDE   (ZHDIM)                      !" 文字列文字数
#else
#include        "zcdim.F"                    !" 格子点数, 波数
#include        "zhdim.F"                    !" 文字列文字数
#endif
*
*"  [VAR] 
      REAL        GSST  ( IDIM , JDIM  )
      REAL        ALAT  ( IDIM )
      REAL        DLAT  ( IDIM )
      CHARACTER   HALAT  *(NCC) !" 緯度軸名称
*
*   [INTERNAL PARM] 
      CHARACTER  HITEM*(NCC)
      CHARACTER  HTITL*(NCC)
      CHARACTER  HUNIT*(NCC)
      DATA       HITEM / 'GRSST' /
      DATA       HTITL / 'Sea Surface Temp.' /
      DATA       HUNIT / 'K' /
      INTEGER    IT
      INTEGER    IDATE(6)
      INTEGER    ISTEP
      INTEGER    ITDUR
      INTEGER    IOMODE
      INTEGER    NOEND
      DATA       IT    / 0 /
      DATA       IDATE / 1992, 3, 21, 0, 0, 0 /
      DATA       ISTEP  / 0 /
      DATA       ITDUR  / 1 /
      DATA       IOMODE / 1 /
      DATA       NOEND  / 0 /
*
      NAMELIST  /NMDATE/ IT, IDATE, ISTEP
*
      CHARACTER  DDSET *(NCC)
      DATA       DDSET / ' ' /
      CHARACTER  HDFMT *(NCC)
**      DATA       HDFMT  / 'UR4' /
**
      DATA       HDFMT  / 'UR8' /
      REAL       TEQ
      REAL       ALAT0
      REAL       ALAT1
      REAL       ALPHA
      REAL       BETA
      REAL       GAMMA
      REAL       ALACON
      DATA       TEQ   , ALAT0, ALAT1, ALPHA,  BETA, GAMMA
     &         / 302.  ,  0.  , 30.  , 60.  , 32.  , 0.     /
      DATA       ALACON / 7.   /
*
      NAMELIST  /NMSST/ TEQ, ALAT0, ALAT1, ALPHA, BETA, GAMMA, ALACON
*
*   [INTERNAL WORK] 
      INTEGER    JFILE
*
      CALL YPREP
      CALL PCONST
      CALL GTOPEN
*
      WRITE ( 6,*      ) ' DATASET NAME? '
      READ  ( 5,'(A)'  ) DDSET
      CALL GFWOPQ ( JFILE, 'SST OUTPUT' )
*
**      WRITE ( 6,NMSST  )
**      WRITE ( 6,*      ) ' ENTER NAMELST NMSST?'
**      READ  ( 5,NMSST,  END=1900  )
** 1900 CONTINUE
      WRITE ( 6,NMDATE )
      WRITE ( 6,*      ) ' ENTER NAMELST NMDATE?'
      READ  ( 5,NMDATE, END=1910 )
 1910 CONTINUE
*
      CALL GTCSET( 'DDSET' , DDSET    )
*
      CALL SETLAT      !"  モデル緯度座標定数の計算 
     O         ( ALAT  , DLAT  , HALAT  ,
     D           JMAX  , JDIM             )
*
      CALL CALSST
     O         ( GSST  ,
     I           ALAT  ,
     I           TEQ   , ALAT0 , ALAT1 , ALPHA , BETA  , GAMMA ,
     I           ALACON,
     I           IDIM  , JDIM                                   )
*
      WRITE ( 6,* ) 'GSST(1,J)',(GSST(1,J),J=1,JMAX)
*
      CALL GDWRIT
     I         ( GSST  ,
     I           HITEM , HTITL , HUNIT ,
     I           IT    , IDATE , ISTEP , ITDUR ,
     I           JFILE , IOMODE, NOEND , 'ASFC', HDFMT  )
*
      CALL GTCLSE
      CALL YFINE
*
      STOP
      END
