!--
! *** Caution!! ***
!
! This file is generated from "sysdeparg.rb2f90" by Ruby 1.8.5.
! Please do not edit this file directly.
!
! [JAPANESE]
!
! 窶ｻ窶ｻ窶ｻ 豕ｨ諢�!!! 窶ｻ窶ｻ窶ｻ
!
! 縺薙�繝輔ぃ繧､繝ｫ縺ｯ "sysdeparg.rb2f90" 縺九ｉ Ruby 1.8.5
! 縺ｫ繧医▲縺ｦ閾ｪ蜍慕函謌舌＆繧後◆繝輔ぃ繧､繝ｫ縺ｧ縺�.
! 縺薙�繝輔ぃ繧､繝ｫ繧堤峩謗･邱ｨ髮�＠縺ｾ縺帙ｓ繧医≧縺企｡倥＞閾ｴ縺励∪縺�.
!
!
!++
!
!== SysdepArg - 迺ｰ蠅�ｾ晏ｭ俶ｧ繝ｫ繝ｼ繝√Φ (繧ｳ繝槭Φ繝峨Λ繧､繝ｳ蜿門ｾ�)
!
! Authors::   Eizi TOYODA, Yasuhiro MORIKAWA
! Version::   $Id: sysdeparg-hitachi.f90,v 1.1 2009-03-26 02:28:34 morikawa Exp $
! Tag Name::  $Name:  $
! Copyright:: Copyright (C) GFD Dennou Club, 2000-2005. All rights reserved.
! License::   See COPYRIGHT[link:../../COPYRIGHT]
!
! Fortran 95 莉･蜑阪�螟ｧ謚ｵ縺ｮ蜃ｦ逅�ｳｻ縺ｧ縺ｯ IARGC, GETARG 縺ｨ縺�≧繧ｵ繝ｼ繝薙せ繧ｵ繝悶Ν繝ｼ繝√Φ縺�
! 逕ｨ諢上＆繧後※縺�ｋ (縺薙ｌ繧峨� Fortran90/95 縺ｮ隕乗�ｼ縺ｫ縺ｯ蜷ｫ縺ｾ繧後※縺�↑縺�).
! Fortran 2003 隕乗�ｼ縺ｫ縺ｯ COMMAND_ARGUMENT_COUNT, GET_COMMAND_ARGUMENT
! 縺ｨ縺�≧繧ｵ繝悶Ν繝ｼ繝√Φ縺瑚ｦ丞ｮ壹＆繧後※縺�ｋ.
! 縺薙ｌ繧剃ｽｿ縺医↑縺��逅�ｳｻ縺ｧ縺ｯ驕ｩ螳懷ｯｾ蜃ｦ縺悟ｿ�ｦ√〒縺ゅｋ縲�
! 譌･遶九さ繝ｳ繝代う繝ｩ縺ｧ縺ｯ荳願ｨ倥し繝ｼ繝薙せ繧ｵ繝悶Ν繝ｼ繝√Φ縺ｮ謖吝虚縺碁＆縺��縺ｧ豕ｨ諢上�
!

integer function SysdepArgCount() result(result)
  !
  ! 縺薙�謇狗ｶ壹″縺ｯ, 繧ｳ繝槭Φ繝峨Λ繧､繝ｳ蠑墓焚縺ｮ謨ｰ繧定ｿ斐＠縺ｾ縺�.
  ! F95 莉･蜑阪�蜃ｦ逅�ｳｻ縺ｧ縺ｯ Fortran90/95 隕乗�ｼ螟悶� <b>IARGC()</b>
  ! 髢｢謨ｰ縺ｫ繧医ｊ螳溯｣�＆繧�, F2003 縺ｫ蟇ｾ蠢懊☆繧句�逅�ｳｻ縺ｧ縺ｯ
  ! COMMAND_ARGUMENT_COUNT 髢｢謨ｰ縺ｫ繧医▲縺ｦ螳溯｣�＆繧後∪縺�.
  !
  ! Get the number of commandline arguments.
  ! In F95, it is implemented by nonstandard built-in
  ! function <b>IARGC()</b>.
  ! In F2003, it is implemented by standard built-in
  ! function <b>COMMAND_ARGUMENT_COUNT()</b>.
  !
  implicit none
  !
  ! Selected by Makefile using Ruby
  !
  interface
    integer function iargc()
    end function iargc
  end interface
  result = iargc() - 1
end function SysdepArgCount

subroutine SysdepArgGet(idx_given, result)
  !
  ! 縺薙�謇狗ｶ壹″縺ｯ繧ｳ繝槭Φ繝峨Λ繧､繝ｳ蠑墓焚縺ｮ縺�■縲�*index* (*idx_given*)
  ! 逡ｪ逶ｮ縺ｮ蛟､繧� *value* (*result*) 縺ｫ霑斐＠縺ｾ縺吶�
  !
  ! *index* 縺悟ｼ墓焚縺ｮ謨ｰ繧医ｊ繧ょ､ｧ縺阪＞蝣ｴ蜷医�*value* 縺ｫ縺ｯ遨ｺ譁�ｭ�
  ! 縺瑚ｿ斐ｊ縺ｾ縺吶�*index* 縺瑚ｲ�縺ｮ蝣ｴ蜷医↓縺ｯ縲∝ｾ梧婿縺九ｉ縺ｮ鬆�分縺ｫ縺ｪ繧翫∪縺吶�
  ! 縺吶↑繧上■縲�-1 縺ｪ繧峨�譛蠕後�蠑墓焚縺瑚ｿ斐ｊ縺ｾ縺吶�
  !
  ! 縺ｻ縺ｨ繧薙←縺ｮ蜃ｦ逅�ｳｻ縺ｧ縺ｯ Fortran90/95 隕乗�ｼ螟悶� <b>GETARGC()</b>
  ! 髢｢謨ｰ縺ｫ繧医ｊ螳溯｣�＆繧後∪縺吶�
  !
  ! gets the *index*th (*idx_given*th) commandline argument
  ! to *value* (*result*).
  !
  ! If *index* is more than the number of arguments,
  ! *value* will be filled with blank.
  ! If *index* is negative, *index*th argument in reverse
  ! is return to *value*. In other words, if *index* = -1,
  ! the last argument is returned.
  !
  ! Most typically, it is implemented by nonstandard built-in
  ! subroutine <b>GETARG()</b>.
  !
  implicit none
  integer, intent(in):: idx_given
  character(len = *), intent(out):: result
  integer:: idx
  integer:: argc
  interface
    integer function SysdepArgCount()
    end function SysdepArgCount
  end interface
continue
  argc = SysdepArgCount()
  if (idx_given < 0) then
    idx = argc + 1 + idx_given
  else
    idx = idx_given
  endif
  if (idx > argc) then
    result = ""
  else
  !
  ! Selected by Makefile using Ruby
  !
  call getarg(idx + 1, result)
  endif
end subroutine SysdepArgGet

!--
! vi:set readonly sw=4 ts=8:
!
!Local Variables:
!mode: f90
!buffer-read-only: t
!End:
!
!++