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


subroutine GDNcVarPutReal(var, start, count, stride, imap, siz, value, iostat)
  use dc_types, only: DP
  use gtdata_netcdf_types, only: GD_NC_VARIABLE
  use gtdata_netcdf_internal, only: GD_NC_VARIABLE_ENTRY, vtable_lookup
  use netcdf_f77, only: nf_noerr, nf_einval, nf_put_varm_Real
  use gtdata_netcdf_file_generic, only: GDNcFileDataMode
  use dc_trace, only: BeginSub, EndSub, DbgMessage
  implicit none
  type(GD_NC_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(GD_NC_VARIABLE_ENTRY):: ent
  character(len = *), parameter:: subname = "GDNcVarPutReal"
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 = GDNcFileDataMode(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 GDNcVarPutReal


subroutine GDNcVarPutDouble(var, start, count, stride, imap, siz, value, iostat)
  use dc_types, only: DP
  use gtdata_netcdf_types, only: GD_NC_VARIABLE
  use gtdata_netcdf_internal, only: GD_NC_VARIABLE_ENTRY, vtable_lookup
  use netcdf_f77, only: nf_noerr, nf_einval, nf_put_varm_Double
  use gtdata_netcdf_file_generic, only: GDNcFileDataMode
  use dc_trace, only: BeginSub, EndSub, DbgMessage
  implicit none
  type(GD_NC_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(GD_NC_VARIABLE_ENTRY):: ent
  character(len = *), parameter:: subname = "GDNcVarPutDouble"
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 = GDNcFileDataMode(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 GDNcVarPutDouble


subroutine GDNcVarPutInt(var, start, count, stride, imap, siz, value, iostat)
  use dc_types, only: DP
  use gtdata_netcdf_types, only: GD_NC_VARIABLE
  use gtdata_netcdf_internal, only: GD_NC_VARIABLE_ENTRY, vtable_lookup
  use netcdf_f77, only: nf_noerr, nf_einval, nf_put_varm_Int
  use gtdata_netcdf_file_generic, only: GDNcFileDataMode
  use dc_trace, only: BeginSub, EndSub, DbgMessage
  implicit none
  type(GD_NC_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(GD_NC_VARIABLE_ENTRY):: ent
  character(len = *), parameter:: subname = "GDNcVarPutInt"
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 = GDNcFileDataMode(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 GDNcVarPutInt

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