! -*- coding: utf-8; mode: f90 -*-
!-------------------------------------------------------------------------------------
! Copyright (c) 2000-2016 Gtool Development Group. All rights reserved.
!-------------------------------------------------------------------------------------
! ** Important**
!
! This file is generated from gtvarputnum.erb by ERB included Ruby 2.3.1.
! Please do not edit this file directly. @see "gtvarputnum.erb"
!-------------------------------------------------------------------------------------
!
!== å¤‰æ•°ã¸ã®æ•°å€¤ãƒ‡ãƒ¼ã‚¿ã®å‡ºåŠ›
!
! å¤‰æ•° *var* ã¸æ•°å€¤ãƒ‡ãƒ¼ã‚¿ *value* ãŒå‡ºåŠ›ã•ã‚Œã¾ã™ã€‚
! *nvalue* ã«ã¯é…åˆ—é•·ã‚’ä»£å…¥ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚
!
! æ•°å€¤ãƒ‡ãƒ¼ã‚¿å‡ºåŠ›ã®éš›ã«ã‚¨ãƒ©ãƒ¼ãŒç”Ÿã˜ãŸå ´åˆã€ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’å‡ºåŠ›
! ã—ã¦ãƒ—ãƒã‚°ãƒ©ãƒ ã¯å¼·åˆ¶çµ‚äº†ã—ã¾ã™ã€‚*err* ã‚’ä¸Žãˆã¦ã‚ã‚‹å ´åˆã«ã¯
! ã®å¼•æ•°ã« .true. ãŒè¿”ã‚Šã€ãƒ—ãƒã‚°ãƒ©ãƒ ã¯çµ‚äº†ã—ã¾ã›ã‚“ã€‚
!
! å‡ºåŠ›ã—ã‚ˆã†ã¨ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã®åž‹ãŒ *var* ã®åž‹ã¨ç•°ãªã‚‹å ´åˆã€ãƒ‡ãƒ¼ã‚¿ã¯ *var* ã®
! åž‹ã«å¤‰æ›ã•ã‚Œã¾ã™ã€‚ ã“ã®å¤‰æ›ã¯ netCDF ã®æ©Ÿèƒ½ã‚’ç”¨ã„ã¦ã„ã¾ã™ã€‚
! è©³ã—ãã¯ {netCDF æ—¥æœ¬èªžç‰ˆãƒžãƒ‹ãƒ¥ã‚¢ãƒ«}[link:../xref.htm#label-10]
! ã® 3.3 åž‹å¤‰æ› ã‚’å‚ç…§ã—ã¦ãã ã•ã„ã€‚
!
! *Get* ã¯è¤‡æ•°ã®ã‚µãƒ–ãƒ«ãƒ¼ãƒãƒ³ã®ç·ç§°åã§ã‚ã‚Šã€
! *value* ã«å¤šæ¬¡å…ƒé…åˆ—ã‚’ä¸Žãˆã‚‹ã“ã¨ã‚‚å¯èƒ½ã§ã™ã€‚ä¸Šè¨˜ã®
! ã‚µãƒ–ãƒ«ãƒ¼ãƒãƒ³ã‚’å‚ç…§ã—ã¦ãã ã•ã„ã€‚
!
subroutine GTVarPutDouble(var, value, nvalue, err)
  use gtdata_types, only: GT_VARIABLE
  use gtdata_internal_map, only: &
    & var_class, &
    & vtb_class_netcdf, &
    & map_to_internal_specs
  use gtdata_netcdf_generic,  only: put
  use gtdata_netcdf_types, only: GD_NC_VARIABLE
  use dc_error,    only: StoreError, GT_EFAKE
  ! use dc_trace,    only: BeginSub, EndSub
  use dc_types,    only: DP
  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 var_class(var, class, cid)
  call map_to_internal_specs(var, specs, ndims)
  if (class == vtb_class_netcdf) then
    call put(GD_NC_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)
end subroutine GTVarPutDouble

subroutine GTVarPutReal(var, value, nvalue, err)
  use gtdata_types, only: GT_VARIABLE
  use gtdata_internal_map, only: &
    & var_class, &
    & vtb_class_netcdf, &
    & map_to_internal_specs
  use gtdata_netcdf_generic,  only: put
  use gtdata_netcdf_types, only: GD_NC_VARIABLE
  use dc_error,    only: StoreError, GT_EFAKE
  ! use dc_trace,    only: BeginSub, EndSub
  use dc_types,    only: SP
  implicit none
  type(GT_VARIABLE), intent(in)            :: var
  integer,           intent(in)            :: nvalue
  real(SP),          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 var_class(var, class, cid)
  call map_to_internal_specs(var, specs, ndims)
  if (class == vtb_class_netcdf) then
    call put(GD_NC_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)
end subroutine GTVarPutReal

subroutine GTVarPutInt(var, value, nvalue, err)
  use gtdata_types, only: GT_VARIABLE
  use gtdata_internal_map, only: &
    & var_class, &
    & vtb_class_netcdf, &
    & map_to_internal_specs
  use gtdata_netcdf_generic,  only: put
  use gtdata_netcdf_types, only: GD_NC_VARIABLE
  use dc_error,    only: StoreError, GT_EFAKE
  ! 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 var_class(var, class, cid)
  call map_to_internal_specs(var, specs, ndims)
  if (class == vtb_class_netcdf) then
    call put(GD_NC_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)
end subroutine GTVarPutInt

subroutine GTVarPutChar(var, value, nvalue, err)
  use gtdata_types, only: GT_VARIABLE
  use gtdata_internal_map, only: &
    & var_class, &
    & vtb_class_netcdf, &
    & map_to_internal_specs
  use gtdata_netcdf_generic,  only: put
  use gtdata_netcdf_types, only: GD_NC_VARIABLE
  use dc_error,    only: StoreError, GT_EFAKE
  ! use dc_trace,    only: BeginSub, EndSub
  implicit none
  type(GT_VARIABLE), intent(in)            :: var
  integer,           intent(in)            :: nvalue
  character(*),      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 = "GTVarPutChar"
  continue
  call var_class(var, class, cid)
  call map_to_internal_specs(var, specs, ndims)
  if (class == vtb_class_netcdf) then
    call put(GD_NC_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)
end subroutine GTVarPutChar

subroutine GTVarPutDouble1(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutDouble
  use dc_types,       only: DP
  real(DP), intent(in) :: value(:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutDouble(var, value, size(value), err)
end subroutine GTVarPutDouble1

subroutine GTVarPutDouble2(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutDouble
  use dc_types,       only: DP
  real(DP), intent(in) :: value(:,:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutDouble(var, value, size(value), err)
end subroutine GTVarPutDouble2

subroutine GTVarPutDouble3(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutDouble
  use dc_types,       only: DP
  real(DP), intent(in) :: value(:,:,:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutDouble(var, value, size(value), err)
end subroutine GTVarPutDouble3

subroutine GTVarPutDouble4(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutDouble
  use dc_types,       only: DP
  real(DP), intent(in) :: value(:,:,:,:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutDouble(var, value, size(value), err)
end subroutine GTVarPutDouble4

subroutine GTVarPutDouble5(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutDouble
  use dc_types,       only: DP
  real(DP), intent(in) :: value(:,:,:,:,:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutDouble(var, value, size(value), err)
end subroutine GTVarPutDouble5

subroutine GTVarPutDouble6(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutDouble
  use dc_types,       only: DP
  real(DP), intent(in) :: value(:,:,:,:,:,:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutDouble(var, value, size(value), err)
end subroutine GTVarPutDouble6

subroutine GTVarPutDouble7(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutDouble
  use dc_types,       only: DP
  real(DP), intent(in) :: value(:,:,:,:,:,:,:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutDouble(var, value, size(value), err)
end subroutine GTVarPutDouble7

subroutine GTVarPutReal1(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal
  use dc_types,       only: SP
  real(SP), intent(in) :: value(:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutReal(var, value, size(value), err)
end subroutine GTVarPutReal1

subroutine GTVarPutReal2(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal
  use dc_types,       only: SP
  real(SP), intent(in) :: value(:,:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutReal(var, value, size(value), err)
end subroutine GTVarPutReal2

subroutine GTVarPutReal3(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal
  use dc_types,       only: SP
  real(SP), intent(in) :: value(:,:,:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutReal(var, value, size(value), err)
end subroutine GTVarPutReal3

subroutine GTVarPutReal4(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal
  use dc_types,       only: SP
  real(SP), intent(in) :: value(:,:,:,:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutReal(var, value, size(value), err)
end subroutine GTVarPutReal4

subroutine GTVarPutReal5(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal
  use dc_types,       only: SP
  real(SP), intent(in) :: value(:,:,:,:,:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutReal(var, value, size(value), err)
end subroutine GTVarPutReal5

subroutine GTVarPutReal6(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal
  use dc_types,       only: SP
  real(SP), intent(in) :: value(:,:,:,:,:,:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutReal(var, value, size(value), err)
end subroutine GTVarPutReal6

subroutine GTVarPutReal7(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutReal
  use dc_types,       only: SP
  real(SP), intent(in) :: value(:,:,:,:,:,:,:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutReal(var, value, size(value), err)
end subroutine GTVarPutReal7

subroutine GTVarPutInt1(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutInt
  integer,  intent(in) :: value(:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutInt(var, value, size(value), err)
end subroutine GTVarPutInt1

subroutine GTVarPutInt2(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutInt
  integer,  intent(in) :: value(:,:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutInt(var, value, size(value), err)
end subroutine GTVarPutInt2

subroutine GTVarPutInt3(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutInt
  integer,  intent(in) :: value(:,:,:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutInt(var, value, size(value), err)
end subroutine GTVarPutInt3

subroutine GTVarPutInt4(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutInt
  integer,  intent(in) :: value(:,:,:,:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutInt(var, value, size(value), err)
end subroutine GTVarPutInt4

subroutine GTVarPutInt5(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutInt
  integer,  intent(in) :: value(:,:,:,:,:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutInt(var, value, size(value), err)
end subroutine GTVarPutInt5

subroutine GTVarPutInt6(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutInt
  integer,  intent(in) :: value(:,:,:,:,:,:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutInt(var, value, size(value), err)
end subroutine GTVarPutInt6

subroutine GTVarPutInt7(var, value, err)
  use gtdata_types,   only: GT_VARIABLE
  use gtdata_generic, only: Put, GTVarPutInt
  integer,  intent(in) :: value(:,:,:,:,:,:,:)
  type(GT_VARIABLE), intent(inout):: var
  logical  ,intent(out), optional:: err
  continue
  call GTVarPutInt(var, value, size(value), err)
end subroutine GTVarPutInt7