!--
! *** 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-nostd.f90,v 1.1 2009-03-20 09:09:49 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()
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, result)
  endif
end subroutine SysdepArgGet

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