* PACKAGE XMKAXIS    !" $B:BI8<4%U%!%$%k=PNO(B
*
*"  [HIS] 95/08/18 (takepiro) 
***********************************************************************
      PROGRAM XMKAXS
*
* [PARAM]
#include        "zcdim.F"            !" $B3J;RE@?t(B, $BGH?t(B
#include        "zhdim.F"            !" $BJ8;zNsJ8;z?t(B
*
*" $B:BI87W;;MQ(B
      REAL     DX                   !" X $B<4>e$N3J;RE@4V3V(B
      REAL     DZ                   !" Z $B<4>e$N3J;RE@4V3V(B
      REAL     XCLOC( NX+1 )        !" X $B<43J;R0LCV(B
      REAL     XCWGT( NX+1 )        !" X $B<43J;R=E$_(B
      REAL     ZCLOC( 0:NZ+1 )      !" Z $B<43J;R0LCV(B
      REAL     ZCWGT( 0:NZ+1 )      !" Z $B<43J;R=E$_(B
      INTEGER  IX , IZ
*
*" $B<4%U%!%$%kL>(B
      CHARACTER HCORX*(NCC)     !" X $B:BI8<4L>(B
      CHARACTER HCORZ*(NCC)     !" Z $B:BI8<4L>(B
*
      CHARACTER HFXLOC*(NFILN)    !" X $B:BI83J;R0LCV%U%!%$%kL>(B
      CHARACTER HFXWGT*(NFILN)    !" X $B:BI83J;R=E$_%U%!%$%kL>(B
      CHARACTER HFZLOC*(NFILN)    !" Z $B:BI83J;R0LCV%U%!%$%kL>(B
      CHARACTER HFZWGT*(NFILN)    !" Z $B:BI83J;R=E$_%U%!%$%kL>(B
*
      CHARACTER HALOC*(NFILN)     !"$B3J;R0LCV%U%!%$%k@\F,;R(B
      CHARACTER HAWGT*(NFILN)     !"$B3J;R=E$_%U%!%$%k@\F,;R(B
*
      INTEGER   NHX, NHZ, NHL, NHW
      INTEGER   LENC            !" dennou math1 $B4X?t(B
*
*" $B%X%C%@!<:n@.(B
      CHARACTER HEADXL (NDC)*(NCC) !" $B%X%C%@!<(B
      CHARACTER HEADXW (NDC)*(NCC) !" $B%X%C%@!<(B
      CHARACTER HEADZL (NDC)*(NCC) !" $B%X%C%@!<(B
      CHARACTER HEADZW (NDC)*(NCC) !" $B%X%C%@!<(B
*
      CHARACTER HKIND * (NCC)   !" $B3J;R>pJs$N<oN`(B
      CHARACTER HITEM * (NCC)   !" $B3J;R<1JLL>>N(B
      CHARACTER HTITL * (NCC)   !" $B<4%?%$%H%k(B
      CHARACTER HUNIT * (NCC)   !" $BC10L(B
      INTEGER   IXDIM           !" $B3J;R?t(B
      CHARACTER HDFMT * (NCC)   !" $B%G!<%?%U%)!<%^%C%H(B
      REAL      VMISS           !" $B7gB;CM$NCM(B
      REAL      DMIN            !" $B%l%s%8(B($B:G>.(B)
      REAL      DMAX            !" $B%l%s%8(B($B:GBg(B)
      REAL      DIVS            !" $B4V3V(B($B>.(B)
      REAL      DIVL            !" $B4V3V(B($BBg(B)
      INTEGER   ISTYP           !" $B%9%1!<%j%s%0%?%$%W(B
*
c$$$      REAL*4    RGNLE           !" dennou math1 $B4X?t(B
*
      CHARACTER  SIGN *(NCC)    !" $B<B83<TL>(B
      DATA  SIGN / 'momoko' /
*
*"      << 1. $B:BI8<4$N7W;;(B >>
*
      CALL GTCSET( 'MYSIGN', SIGN   )
*
      CALL ACRGET               !" $B:BI8CM(B
     O       (  DX , DZ  )
*
      DO 1000 IX = 0, NX+1
         XCLOC( IX ) = DX*(IX-1)
 1000 CONTINUE 
      CALL SETV( XCWGT , DX , NX+1 )
*
      DO 1100 IZ = 0, NZ+1 
         ZCLOC( IZ ) = DZ*IZ
 1100 CONTINUE 
      CALL SETV( ZCWGT , DZ , NZ+2 )
      ZCWGT( 0 )    = DZ/2
      ZCWGT( NZ+1 ) = DZ/2
*
*"     << 2. $B<4%U%!%$%kL>(B >>
*
      CALL ACNGET               !" $B:BI8<4L>(B
     O       ( HCORX , HCORZ )
*
      CALL CLADJ( HCORX )
      NHX = LENC( HCORX )
      CALL CLADJ( HCORZ )
      NHZ = LENC( HCORZ )
*
c$$$      CALL GTCGET( 'FAXLOC', HALOC )  !" $BL>A0$K<4%U%!%$%k$N(B path $BL>$,F~$k(B
c$$$      CALL GTCGET( 'FAXWGT', HAWGT )
      CALL GTCGET( 'FAXLOC1', HALOC )   !" $BL>A0$K(B path $BL>$,F~$i$J$$(B
      CALL GTCGET( 'FAXWGT1', HAWGT )
      NHL = LENC( HALOC )
      NHW = LENC( HAWGT )
*
      HFXLOC = HALOC(1:NHL)//HCORX(1:NHX)
      HFXWGT = HAWGT(1:NHW)//HCORX(1:NHX)
      HFZLOC = HALOC(1:NHL)//HCORZ(1:NHZ)
      HFZWGT = HAWGT(1:NHW)//HCORZ(1:NHZ)
*
*"      << 3. $B%X%C%@!<:n@.(B >>
*
*"          < 3.1 X $B:BI8(B >
*
*"    CALL GTPGET
      CALL ZTPGET                       !" $B<+F0G\@:EYBP1~%k!<%A%s(B
     I      ( 'MISS',
     O         VMISS  )
*
      HKIND = 'CAXLOC'
      HITEM = 'X'
      HTITL = 'X-Coordinate'
      HUNIT = 'Non-dim'
      IXDIM = NX
      HDFMT = 'UR4'
      DMIN  = XCLOC(1)
      DMAX  = XCLOC(NX+1)
      DIVS  = (DMAX - DMIN) / 4
      DIVL  = (DMAX - DMIN) / 2 
      ISTYP = 1
*
*"    CALL GHPACA
      CALL ZHPACA                       !" $B<+F0G\@:EYBP1~%k!<%A%s(B
     O         ( HEADXL,
     I           HKIND , HITEM ,
     I           HTITL , HUNIT ,
     I           IXDIM ,
     I           HDFMT , VMISS ,
     I           DMIN  , DMAX  , DIVS  , DIVL  , ISTYP  )
*
      HKIND = 'CAXWGT'
*
*"    CALL GHPACA
      CALL ZHPACA                       !" $B<+F0G\@:EYBP1~%k!<%A%s(B
     O         ( HEADXW,
     I           HKIND , HITEM ,
     I           HTITL , HUNIT ,
     I           IXDIM ,
     I           HDFMT , VMISS ,
     I           DMIN  , DMAX  , DIVS  , DIVL  , ISTYP  )
*
*"          < 3.2 Z $B:BI8(B >
*
      HKIND = 'AXLOC'
      HITEM = 'Z'
      HTITL = 'Z-Coordinate'
      HUNIT = 'Non-dim'
      IXDIM = NZ+2
      HDFMT = 'UR4'
      DMIN  = ZCLOC(0)
      DMAX  = ZCLOC(NZ+1)
      DIVS  = (DMAX - DMIN) / 20 
      DIVL  = (DMAX - DMIN) / 4 
      ISTYP = 1
*
*"    CALL GHPACA
      CALL ZHPACA                       !" $B<+F0G\@:EYBP1~%k!<%A%s(B
     O         ( HEADZL,
     I           HKIND , HITEM ,
     I           HTITL , HUNIT ,
     I           IXDIM ,
     I           HDFMT , VMISS ,
     I           DMIN  , DMAX  , DIVS  , DIVL  , ISTYP  )
*
      HKIND = 'AXWGT'
*
*"    CALL GHPACA
      CALL ZHPACA                       !" $B<+F0G\@:EYBP1~%k!<%A%s(B
     O         ( HEADZW,
     I           HKIND , HITEM ,
     I           HTITL , HUNIT ,
     I           IXDIM ,
     I           HDFMT , VMISS ,
     I           DMIN  , DMAX  , DIVS  , DIVL  , ISTYP  )
*
*"      << 4. $B<4%U%!%$%k=PNO(B >>
*
      CALL WRTAXS
     I     ( HFXLOC , HEADXL , XCLOC )
      CALL WRTAXS
     I     ( HFXWGT , HEADXW , XCWGT )
      CALL WRTAXS
     I     ( HFZLOC , HEADZL , ZCLOC )
      CALL WRTAXS
     I     ( HFZWGT , HEADZW , ZCWGT )
*
      STOP
      END
***********************************************************************
      SUBROUTINE WRTAXS
     I           ( HFILE , HHEAD , GDATA )
*
* [INPUT]
      CHARACTER HFILE*(*)
      CHARACTER HHEAD(*)*(*)
      REAL      GDATA(*)
*
* [INTERNAL WORK]
      INTEGER JFILE
      DATA    JFILE /50/
*
      CALL GFWOPN
     M     ( JFILE , 
     I       HFILE  )
*
*"    CALL GFWRIT
      CALL ZFWRIT                       !" $B<+F0G\@:EYBP1~%k!<%A%s(B
     I     ( HHEAD , GDATA ,
     I       JFILE ,    1  , 0  )
*
      CALL GFCLSE( JFILE )
*
      RETURN
      END
