!--
! *** Caution!! ***
! 
! This file is generated from "anvarputnum.rb2f90" by Ruby 1.8.2.
! Please do not edit this file directly.
!
! [JAPANESE]
!
! ※※※ 注意!!! ※※※
!
! このファイルは "anvarputnum.rb2f90" から Ruby 1.8.2
! によって自動生成されたファイルです.
! このファイルを直接編集しませんようお願い致します.
!
!
!++
!= AN_VARIABLES の出力
!
!= Put AN_VARIABLES
!
! Authors::   Yasuhiro MORIKAWA, Eizi TOYODA
! Version::   $Id: anvarputnum.f90,v 1.3 2007/08/22 18:34:25 morikawa Exp $
! Tag Name::  $Name: gt4f90io-20071009 $
! Copyright:: Copyright (C) GFD Dennou Club, 2000-2005. All rights reserved.
! License::   See COPYRIGHT[link:../../COPYRIGHT]
!


subroutine ANVarPutReal(var, start, count, stride, imap, siz, value, iostat)
  use dc_types, only: DP
  use an_types, only: AN_VARIABLE
  use an_vartable, only: an_variable_entry, vtable_lookup
  use netcdf_f77, only: nf_noerr, nf_einval, nf_put_varm_Real
  use an_file, only: anfiledatamode
  use dc_trace, only: BeginSub, EndSub, DbgMessage
  implicit none
  type(AN_VARIABLE), intent(in):: var
  integer,           intent(in):: start(:)
  integer,           intent(in):: count(:)
  integer,           intent(in):: stride(:)
  integer,           intent(in):: imap(:)
  integer,           intent(in):: siz
  real, intent(in):: value(siz)
  integer, intent(out):: iostat
  integer:: ndims
  type(an_variable_entry):: ent
  character(len = *), parameter:: subname = "ANVarPutReal"
continue
  call BeginSub(subname)
  iostat = vtable_lookup(var, ent)
  if (iostat /= nf_noerr) goto 999
  ndims = 0
  if (associated(ent%dimids)) ndims = size(ent%dimids)
  if (min(size(start), size(count), size(stride), size(imap)) < ndims) then
    iostat = nf_einval
    goto 999
  endif
  call DbgMessage("f=%d v=%d sta=%*d c=%*d str=%*d imap=%*d", &
    & i=(/ent%fileid, ent%varid, start, count, stride, imap/), &
    & n=(/ndims, ndims, ndims, ndims/))
  iostat = anfiledatamode(ent%fileid)
  if (iostat /= nf_noerr) return
  iostat = nf_put_varm_Real(ent%fileid, ent%varid, &
    & start, count, stride, imap, value)
999 continue
  call EndSub(subname, "iostat=%d", i=(/iostat/))
end subroutine ANVarPutReal


subroutine ANVarPutDouble(var, start, count, stride, imap, siz, value, iostat)
  use dc_types, only: DP
  use an_types, only: AN_VARIABLE
  use an_vartable, only: an_variable_entry, vtable_lookup
  use netcdf_f77, only: nf_noerr, nf_einval, nf_put_varm_Double
  use an_file, only: anfiledatamode
  use dc_trace, only: BeginSub, EndSub, DbgMessage
  implicit none
  type(AN_VARIABLE), intent(in):: var
  integer,           intent(in):: start(:)
  integer,           intent(in):: count(:)
  integer,           intent(in):: stride(:)
  integer,           intent(in):: imap(:)
  integer,           intent(in):: siz
  real(DP), intent(in):: value(siz)
  integer, intent(out):: iostat
  integer:: ndims
  type(an_variable_entry):: ent
  character(len = *), parameter:: subname = "ANVarPutDouble"
continue
  call BeginSub(subname)
  iostat = vtable_lookup(var, ent)
  if (iostat /= nf_noerr) goto 999
  ndims = 0
  if (associated(ent%dimids)) ndims = size(ent%dimids)
  if (min(size(start), size(count), size(stride), size(imap)) < ndims) then
    iostat = nf_einval
    goto 999
  endif
  call DbgMessage("f=%d v=%d sta=%*d c=%*d str=%*d imap=%*d", &
    & i=(/ent%fileid, ent%varid, start, count, stride, imap/), &
    & n=(/ndims, ndims, ndims, ndims/))
  iostat = anfiledatamode(ent%fileid)
  if (iostat /= nf_noerr) return
  iostat = nf_put_varm_Double(ent%fileid, ent%varid, &
    & start, count, stride, imap, value)
999 continue
  call EndSub(subname, "iostat=%d", i=(/iostat/))
end subroutine ANVarPutDouble


subroutine ANVarPutInt(var, start, count, stride, imap, siz, value, iostat)
  use dc_types, only: DP
  use an_types, only: AN_VARIABLE
  use an_vartable, only: an_variable_entry, vtable_lookup
  use netcdf_f77, only: nf_noerr, nf_einval, nf_put_varm_Int
  use an_file, only: anfiledatamode
  use dc_trace, only: BeginSub, EndSub, DbgMessage
  implicit none
  type(AN_VARIABLE), intent(in):: var
  integer,           intent(in):: start(:)
  integer,           intent(in):: count(:)
  integer,           intent(in):: stride(:)
  integer,           intent(in):: imap(:)
  integer,           intent(in):: siz
  integer, intent(in):: value(siz)
  integer, intent(out):: iostat
  integer:: ndims
  type(an_variable_entry):: ent
  character(len = *), parameter:: subname = "ANVarPutInt"
continue
  call BeginSub(subname)
  iostat = vtable_lookup(var, ent)
  if (iostat /= nf_noerr) goto 999
  ndims = 0
  if (associated(ent%dimids)) ndims = size(ent%dimids)
  if (min(size(start), size(count), size(stride), size(imap)) < ndims) then
    iostat = nf_einval
    goto 999
  endif
  call DbgMessage("f=%d v=%d sta=%*d c=%*d str=%*d imap=%*d", &
    & i=(/ent%fileid, ent%varid, start, count, stride, imap/), &
    & n=(/ndims, ndims, ndims, ndims/))
  iostat = anfiledatamode(ent%fileid)
  if (iostat /= nf_noerr) return
  iostat = nf_put_varm_Int(ent%fileid, ent%varid, &
    & start, count, stride, imap, value)
999 continue
  call EndSub(subname, "iostat=%d", i=(/iostat/))
end subroutine ANVarPutInt

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