!--
! *** Caution!! ***
! 
! This file is generated from "gtvarputnum.rb2f90" by Ruby 1.8.2.
! Please do not edit this file directly.
!
! [JAPANESE]
!
! ※※※ 注意!!! ※※※
!
! このファイルは "gtvarputnum.rb2f90" から Ruby 1.8.2
! によって自動生成されたファイルです.
! このファイルを直接編集しませんようお願い致します.
!
!
!++
!
!= 変数への数値データの出力
!
! Authors::   Yasuhiro MORIKAWA, Eizi TOYODA
! Version::   $Id: gtvarputnum.f90,v 1.5 2008-02-17 17:26:59 morikawa Exp $
! Tag Name::  $Name: gt4f90io-20080729 $
! Copyright:: Copyright (C) GFD Dennou Club, 2000-2005. All rights reserved.
! License::   See COPYRIGHT[link:../../COPYRIGHT]
!
! 以下のサブルーチン、関数は gtdata_generic から gtdata_generic#Put
! として提供されます。
!

subroutine GTVarPutDouble(var, value, nvalue, err)
  !
  !
  !== 変数への数値データの出力
  !
  ! 変数 *var* へ数値データ *value* が出力されます。
  ! *nvalue* には配列長を代入する必要があります。
  !
  ! 数値データ出力の際にエラーが生じた場合、メッセージを出力
  ! してプログラムは強制終了します。*err* を与えてある場合には
  ! の引数に .true. が返り、プログラムは終了しません。
  !
  ! 出力しようとするデータの型が *var* の型と異なる場合、データは *var* の
  ! 型に変換されます。 この変換は netCDF の機能を用いています。
  ! 詳しくは {netCDF 日本語版マニュアル}[link:../xref.htm#label-10]
  ! の 3.3 型変換 を参照してください。
  !
  ! *Get* は複数のサブルーチンの総称名であり、
  ! *value* に多次元配列を与えることも可能です。上記の
  ! サブルーチンを参照してください。
  !
  !
  use gtdata_types,only: GT_VARIABLE
  use gt_map,      only: var_class, vtb_class_netcdf, &
    &                    map_to_internal_specs
  use an_generic,  only: put, an_variable
  use dc_error,    only: StoreError, GT_EFAKE
  use dc_types,    only: DP
  use dc_trace,    only: BeginSub, EndSub
  implicit none
  type(GT_VARIABLE), intent(in)           :: var
  integer,           intent(in)           :: nvalue
  real(DP), intent(in)           :: value(nvalue)
  logical,           intent(out), optional:: err

  ! Variables for Intenal work
  integer:: class, cid, stat, ndims
  integer, pointer:: specs(:, :)
  character(len = *), parameter:: subname = "GTVarPutDouble"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call var_class(var, class, cid)
  call map_to_internal_specs(var, specs, ndims)
  if (class == vtb_class_netcdf) then
    call put(an_variable(cid), start=specs(:, 1), count=specs(:, 2), &
      & stride=specs(:, 3), imap=specs(:, 4), value=value, &
      & siz=nvalue, iostat=stat)
  else
    stat = gt_efake
  endif
  call StoreError(stat, subname, err=err)
  deallocate(specs)
  call EndSub(subname)
end subroutine GTVarPutDouble


subroutine GTVarPutReal(var, value, nvalue, err)
  !

  !
  use gtdata_types,only: GT_VARIABLE
  use gt_map,      only: var_class, vtb_class_netcdf, &
    &                    map_to_internal_specs
  use an_generic,  only: put, an_variable
  use dc_error,    only: StoreError, GT_EFAKE
  use dc_types,    only: DP
  use dc_trace,    only: BeginSub, EndSub
  implicit none
  type(GT_VARIABLE), intent(in)           :: var
  integer,           intent(in)           :: nvalue
  real, intent(in)           :: value(nvalue)
  logical,           intent(out), optional:: err

  ! Variables for Intenal work
  integer:: class, cid, stat, ndims
  integer, pointer:: specs(:, :)
  character(len = *), parameter:: subname = "GTVarPutReal"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call var_class(var, class, cid)
  call map_to_internal_specs(var, specs, ndims)
  if (class == vtb_class_netcdf) then
    call put(an_variable(cid), start=specs(:, 1), count=specs(:, 2), &
      & stride=specs(:, 3), imap=specs(:, 4), value=value, &
      & siz=nvalue, iostat=stat)
  else
    stat = gt_efake
  endif
  call StoreError(stat, subname, err=err)
  deallocate(specs)
  call EndSub(subname)
end subroutine GTVarPutReal


subroutine GTVarPutInt(var, value, nvalue, err)
  !

  !
  use gtdata_types,only: GT_VARIABLE
  use gt_map,      only: var_class, vtb_class_netcdf, &
    &                    map_to_internal_specs
  use an_generic,  only: put, an_variable
  use dc_error,    only: StoreError, GT_EFAKE
  use dc_types,    only: DP
  use dc_trace,    only: BeginSub, EndSub
  implicit none
  type(GT_VARIABLE), intent(in)           :: var
  integer,           intent(in)           :: nvalue
  integer, intent(in)           :: value(nvalue)
  logical,           intent(out), optional:: err

  ! Variables for Intenal work
  integer:: class, cid, stat, ndims
  integer, pointer:: specs(:, :)
  character(len = *), parameter:: subname = "GTVarPutInt"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call var_class(var, class, cid)
  call map_to_internal_specs(var, specs, ndims)
  if (class == vtb_class_netcdf) then
    call put(an_variable(cid), start=specs(:, 1), count=specs(:, 2), &
      & stride=specs(:, 3), imap=specs(:, 4), value=value, &
      & siz=nvalue, iostat=stat)
  else
    stat = gt_efake
  endif
  call StoreError(stat, subname, err=err)
  deallocate(specs)
  call EndSub(subname)
end subroutine GTVarPutInt


subroutine GTVarPutDouble1(var, value, err)
  !
  !
  !== 変数への数値データの出力
  !
  ! 変数 *var* へ数値データ *value* が出力されます。
  !
  ! 数値データ入力の際にエラーが生じた場合、メッセージを出力
  ! してプログラムは強制終了します。*err* を与えてある場合には
  ! の引数に .true. が返り、プログラムは終了しません。
  !
  ! 出力しようとするデータの型が *var* の型と異なる場合、データは *var* の
  ! 型に変換されます。 この変換は netCDF の機能を用いています。
  ! 詳しくは {netCDF 日本語版マニュアル}[link:../xref.htm#label-10]
  ! の 3.3 型変換 を参照してください。
  !
  ! *Get* は複数のサブルーチンの総称名であり、
  ! *value* には 1 〜 7 次元の配列を与えることも可能です。
  ! 下記のサブルーチンを参照してください。
  !
  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  real(DP), intent(in) :: value(:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutDouble1"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutDouble(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutDouble1


subroutine GTVarPutDouble2(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  real(DP), intent(in) :: value(:,:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutDouble2"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutDouble(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutDouble2


subroutine GTVarPutDouble3(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  real(DP), intent(in) :: value(:,:,:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutDouble3"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutDouble(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutDouble3


subroutine GTVarPutDouble4(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  real(DP), intent(in) :: value(:,:,:,:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutDouble4"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutDouble(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutDouble4


subroutine GTVarPutDouble5(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  real(DP), intent(in) :: value(:,:,:,:,:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutDouble5"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutDouble(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutDouble5


subroutine GTVarPutDouble6(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  real(DP), intent(in) :: value(:,:,:,:,:,:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutDouble6"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutDouble(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutDouble6


subroutine GTVarPutDouble7(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  real(DP), intent(in) :: value(:,:,:,:,:,:,:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutDouble7"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutDouble(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutDouble7


subroutine GTVarPutReal1(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  real, intent(in) :: value(:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutReal1"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutReal(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutReal1


subroutine GTVarPutReal2(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  real, intent(in) :: value(:,:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutReal2"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutReal(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutReal2


subroutine GTVarPutReal3(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  real, intent(in) :: value(:,:,:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutReal3"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutReal(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutReal3


subroutine GTVarPutReal4(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  real, intent(in) :: value(:,:,:,:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutReal4"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutReal(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutReal4


subroutine GTVarPutReal5(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  real, intent(in) :: value(:,:,:,:,:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutReal5"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutReal(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutReal5


subroutine GTVarPutReal6(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  real, intent(in) :: value(:,:,:,:,:,:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutReal6"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutReal(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutReal6


subroutine GTVarPutReal7(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  real, intent(in) :: value(:,:,:,:,:,:,:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutReal7"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutReal(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutReal7


subroutine GTVarPutInt1(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  integer, intent(in) :: value(:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutInt1"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutInt(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutInt1


subroutine GTVarPutInt2(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  integer, intent(in) :: value(:,:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutInt2"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutInt(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutInt2


subroutine GTVarPutInt3(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  integer, intent(in) :: value(:,:,:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutInt3"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutInt(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutInt3


subroutine GTVarPutInt4(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  integer, intent(in) :: value(:,:,:,:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutInt4"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutInt(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutInt4


subroutine GTVarPutInt5(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  integer, intent(in) :: value(:,:,:,:,:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutInt5"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutInt(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutInt5


subroutine GTVarPutInt6(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  integer, intent(in) :: value(:,:,:,:,:,:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutInt6"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutInt(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutInt6


subroutine GTVarPutInt7(var, value, err)
  !

  !
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal, GTVarPutDouble, GTVarPutInt
  use dc_trace,    only: BeginSub, EndSub
  use dc_types,       only: DP
  type(GT_VARIABLE), intent(inout):: var
  integer, intent(in) :: value(:,:,:,:,:,:,:)
  logical  ,intent(out), optional:: err
  character(len = *), parameter:: subname = "GTVarPutInt7"
continue
  call BeginSub(subname, 'var.mapid=%d', i=(/var%mapid/))
  call GTVarPutInt(var, value, size(value), err)
  call EndSub(subname)
end subroutine GTVarPutInt7

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