! -*- coding: utf-8; mode: f90 -*-
!-------------------------------------------------------------------------------------
! Copyright (c) 2000-2016 Gtool Development Group. All rights reserved.
!-------------------------------------------------------------------------------------
! ** Important**
!
! This file is generated from gtvargetpointernum.erb by ERB included Ruby 2.3.1.
! Please do not edit this file directly. @see "gtvargetpointernum.erb"
!-------------------------------------------------------------------------------------
!
!++
!= ãƒã‚¤ãƒ³ã‚¿é…åˆ—ã¸ã®æ•°å€¤ãƒ‡ãƒ¼ã‚¿ã®å…¥åŠ›
!
! Authors::   Yasuhiro MORIKAWA, Eizi TOYODA
! Version::   $Id: gtvargetpointernum.rb2f90,v 1.5 2009-05-25 09:55:58 morikawa Exp $
! Tag Name::  $Name:  $
! Copyright:: Copyright (C) GFD Dennou Club, 2000-2005. All rights reserved.
! License::   See COPYRIGHT[link:../../COPYRIGHT]
!
! ä»¥ä¸‹ã®ã‚µãƒ–ãƒ«ãƒ¼ãƒãƒ³ã€é–¢æ•°ã¯ gtdata_generic ã‹ã‚‰ gtdata_generic#Get
! ã¨ã—ã¦æä¾›ã•ã‚Œã¾ã™ã€‚

  !
                                          !
  !== ãƒã‚¤ãƒ³ã‚¿é…åˆ—ã¸ã®æ•°å€¤ãƒ‡ãƒ¼ã‚¿ã®å…¥åŠ›
  !
  ! å¤‰æ•° *var* ã‹ã‚‰ *value* ã«æ•°å€¤ãƒ‡ãƒ¼ã‚¿ãŒå…¥åŠ›ã•ã‚Œã¾ã™ã€‚
  ! *value* ã¯ãƒã‚¤ãƒ³ã‚¿é…åˆ—ã§ã‚ã‚Šã€æ•°å€¤ãƒ‡ãƒ¼ã‚¿ã®ã‚µã‚¤ã‚ºã«åˆã‚ã›ãŸ
  ! é…åˆ—ã‚µã‚¤ã‚ºãŒè‡ªå‹•çš„ã«å‰²ã‚Šä»˜ã‘ã‚‰ã‚Œã¾ã™ã€‚
  ! *Get* ã¯è¤‡æ•°ã®ã‚µãƒ–ãƒ«ãƒ¼ãƒãƒ³ã®ç·ç§°åã§ã‚ã‚Šã€
  ! 1 ã€œ 7 æ¬¡å…ƒã®ãƒã‚¤ãƒ³ã‚¿ã‚’ä¸Žãˆã‚‹ã“ã¨ãŒå¯èƒ½ã§ã™ã€‚
  ! ã¾ãŸ *value* ã«å›ºå®šé•·é…åˆ—ã‚’ä¸Žãˆã‚‹ã“ã¨ãŒå¯èƒ½ãªæ‰‹ç¶šãã‚‚ã‚ã‚Šã¾ã™ã€‚
  ! ä¸‹è¨˜ã‚’å‚ç…§ã—ã¦ãã ã•ã„ã€‚
  !
  ! *value* ãŒæ—¢ã«å‰²ã‚Šä»˜ã‘ã‚‰ã‚Œã¦ãŠã‚Šã€ä¸”ã¤å…¥åŠ›ã™ã‚‹æ•°å€¤ãƒ‡ãƒ¼ã‚¿ã¨é…åˆ—
  ! ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã€ã‚¨ãƒ©ãƒ¼ (ã‚³ãƒ¼ãƒ‰ dc_error#GT_EBADALLOCATESIZE)
  ! ã‚’ç”Ÿã˜ã¾ã™ã€‚åŽŸå‰‡çš„ã«ã¯ *value* ã‚’ç©ºçŠ¶æ…‹ã«ã—ã¦ä¸Žãˆã‚‹ã“ã¨ã‚’
  ! æŽ¨å¥¨ã—ã¾ã™ã€‚ä¸å®šçŠ¶æ…‹ã§ä¸Žãˆã‚‹ã“ã¨ã¯äºˆæœŸã›ã¬å‹•ä½œã‚’æ‹›ãå¯èƒ½æ€§ãŒ
  ! ã‚ã‚‹ãŸã‚ç¦æ¢ã—ã¾ã™ã€‚
  !
  ! æ•°å€¤ãƒ‡ãƒ¼ã‚¿å…¥åŠ›ã‚„ä¸Šè¨˜ã®å‰²ã‚Šä»˜ã‘ã®éš›ã«ã‚¨ãƒ©ãƒ¼ãŒç”Ÿã˜ãŸå ´åˆã€ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸
  ! ã‚’å‡ºåŠ›ã—ã¦ãƒ—ãƒã‚°ãƒ©ãƒ ã¯å¼·åˆ¶çµ‚äº†ã—ã¾ã™ã€‚*err* ã‚’ä¸Žãˆã¦ã‚ã‚‹å ´åˆã«ã¯
  ! ã®å¼•æ•°ã« .true. ãŒè¿”ã‚Šã€ãƒ—ãƒã‚°ãƒ©ãƒ ã¯çµ‚äº†ã—ã¾ã›ã‚“ã€‚
  !
  ! å…¥åŠ›ã—ã‚ˆã†ã¨ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã®åž‹ãŒå¼•æ•°ã®åž‹ã¨ç•°ãªã‚‹å ´åˆã€ãƒ‡ãƒ¼ã‚¿ã¯å¼•æ•°ã®
  ! åž‹ã«å¤‰æ›ã•ã‚Œã¾ã™ã€‚ ã“ã®å¤‰æ›ã¯ netCDF ã®æ©Ÿèƒ½ã‚’ç”¨ã„ã¦ã„ã¾ã™ã€‚
  ! è©³ã—ãã¯ {netCDF æ—¥æœ¬èªžç‰ˆãƒžãƒ‹ãƒ¥ã‚¢ãƒ«}[link:../xref.htm#label-10]
  ! ã® 3.3 åž‹å¤‰æ› ã‚’å‚ç…§ã—ã¦ãã ã•ã„ã€‚
  !
  !
  ! This subroutine returns multi-dimensional data to argument "value".
  ! You need to provide GT_VARIABLE variable to argument "var".
  ! If you provide logical argument "err", .true. is returned
  ! instead of abort with messages when error is occurred.

subroutine GTVarGetPointerDouble1(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetDouble
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING, DP
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  real(DP), pointer :: value(:) !(out)
  real(DP), allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(1), cause_i, data_rank
  logical                         :: invalid_check(1)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerDouble1'
  continue
  cause_i = 0
  cause_c = ''
  n(1) = -1
  stat = DC_NOERR
  call map_set_rank(var, 1, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  if (n(1) < 0) then
    ! count_compact ã§ã¯ãªã„ã®ã§ã€ã‚¼ãƒæ¬¡å…ƒåŒ–ã—ã¦ã„ã‚‹ã¨ n = -1 ã¨ãªã‚‹
    n(1) = 1
  endif
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 1'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetDouble(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = array1dim_tmp
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerDouble1

subroutine GTVarGetPointerDouble2(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetDouble
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING, DP
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  real(DP), pointer :: value(:,:) !(out)
  real(DP), allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(2), cause_i, data_rank
  logical                         :: invalid_check(2)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerDouble2'
  continue
  cause_i = 0
  cause_c = ''
  n(2) = -1
  stat = DC_NOERR
  call map_set_rank(var, 2, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  call Get_Slice(var, dimord=2, count=n(2), count_compact=.false.)
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 2'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .not. size(value,2) == n(2) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1),  &
      & n(2))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetDouble(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = reshape(array1dim_tmp, n)
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerDouble2

subroutine GTVarGetPointerDouble3(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetDouble
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING, DP
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  real(DP), pointer :: value(:,:,:) !(out)
  real(DP), allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(3), cause_i, data_rank
  logical                         :: invalid_check(3)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerDouble3'
  continue
  cause_i = 0
  cause_c = ''
  n(3) = -1
  stat = DC_NOERR
  call map_set_rank(var, 3, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  call Get_Slice(var, dimord=2, count=n(2), count_compact=.false.)
  call Get_Slice(var, dimord=3, count=n(3), count_compact=.false.)
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 3'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .not. size(value,2) == n(2) .or. &
      & .not. size(value,3) == n(3) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1),  &
      & n(2),  &
      & n(3))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetDouble(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = reshape(array1dim_tmp, n)
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerDouble3

subroutine GTVarGetPointerDouble4(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetDouble
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING, DP
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  real(DP), pointer :: value(:,:,:,:) !(out)
  real(DP), allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(4), cause_i, data_rank
  logical                         :: invalid_check(4)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerDouble4'
  continue
  cause_i = 0
  cause_c = ''
  n(4) = -1
  stat = DC_NOERR
  call map_set_rank(var, 4, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  call Get_Slice(var, dimord=2, count=n(2), count_compact=.false.)
  call Get_Slice(var, dimord=3, count=n(3), count_compact=.false.)
  call Get_Slice(var, dimord=4, count=n(4), count_compact=.false.)
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 4'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .not. size(value,2) == n(2) .or. &
      & .not. size(value,3) == n(3) .or. &
      & .not. size(value,4) == n(4) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1),  &
      & n(2),  &
      & n(3),  &
      & n(4))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetDouble(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = reshape(array1dim_tmp, n)
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerDouble4

subroutine GTVarGetPointerDouble5(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetDouble
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING, DP
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  real(DP), pointer :: value(:,:,:,:,:) !(out)
  real(DP), allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(5), cause_i, data_rank
  logical                         :: invalid_check(5)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerDouble5'
  continue
  cause_i = 0
  cause_c = ''
  n(5) = -1
  stat = DC_NOERR
  call map_set_rank(var, 5, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  call Get_Slice(var, dimord=2, count=n(2), count_compact=.false.)
  call Get_Slice(var, dimord=3, count=n(3), count_compact=.false.)
  call Get_Slice(var, dimord=4, count=n(4), count_compact=.false.)
  call Get_Slice(var, dimord=5, count=n(5), count_compact=.false.)
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 5'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .not. size(value,2) == n(2) .or. &
      & .not. size(value,3) == n(3) .or. &
      & .not. size(value,4) == n(4) .or. &
      & .not. size(value,5) == n(5) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1),  &
      & n(2),  &
      & n(3),  &
      & n(4),  &
      & n(5))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetDouble(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = reshape(array1dim_tmp, n)
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerDouble5

subroutine GTVarGetPointerDouble6(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetDouble
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING, DP
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  real(DP), pointer :: value(:,:,:,:,:,:) !(out)
  real(DP), allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(6), cause_i, data_rank
  logical                         :: invalid_check(6)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerDouble6'
  continue
  cause_i = 0
  cause_c = ''
  n(6) = -1
  stat = DC_NOERR
  call map_set_rank(var, 6, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  call Get_Slice(var, dimord=2, count=n(2), count_compact=.false.)
  call Get_Slice(var, dimord=3, count=n(3), count_compact=.false.)
  call Get_Slice(var, dimord=4, count=n(4), count_compact=.false.)
  call Get_Slice(var, dimord=5, count=n(5), count_compact=.false.)
  call Get_Slice(var, dimord=6, count=n(6), count_compact=.false.)
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 6'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .not. size(value,2) == n(2) .or. &
      & .not. size(value,3) == n(3) .or. &
      & .not. size(value,4) == n(4) .or. &
      & .not. size(value,5) == n(5) .or. &
      & .not. size(value,6) == n(6) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1),  &
      & n(2),  &
      & n(3),  &
      & n(4),  &
      & n(5),  &
      & n(6))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetDouble(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = reshape(array1dim_tmp, n)
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerDouble6

subroutine GTVarGetPointerDouble7(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetDouble
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING, DP
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  real(DP), pointer :: value(:,:,:,:,:,:,:) !(out)
  real(DP), allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(7), cause_i, data_rank
  logical                         :: invalid_check(7)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerDouble7'
  continue
  cause_i = 0
  cause_c = ''
  n(7) = -1
  stat = DC_NOERR
  call map_set_rank(var, 7, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  call Get_Slice(var, dimord=2, count=n(2), count_compact=.false.)
  call Get_Slice(var, dimord=3, count=n(3), count_compact=.false.)
  call Get_Slice(var, dimord=4, count=n(4), count_compact=.false.)
  call Get_Slice(var, dimord=5, count=n(5), count_compact=.false.)
  call Get_Slice(var, dimord=6, count=n(6), count_compact=.false.)
  call Get_Slice(var, dimord=7, count=n(7), count_compact=.false.)
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 7'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .not. size(value,2) == n(2) .or. &
      & .not. size(value,3) == n(3) .or. &
      & .not. size(value,4) == n(4) .or. &
      & .not. size(value,5) == n(5) .or. &
      & .not. size(value,6) == n(6) .or. &
      & .not. size(value,7) == n(7) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1),  &
      & n(2),  &
      & n(3),  &
      & n(4),  &
      & n(5),  &
      & n(6),  &
      & n(7))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetDouble(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = reshape(array1dim_tmp, n)
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerDouble7

subroutine GTVarGetPointerReal1(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetReal
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING, SP
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  real(SP), pointer :: value(:) !(out)
  real(SP), allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(1), cause_i, data_rank
  logical                         :: invalid_check(1)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerReal1'
  continue
  cause_i = 0
  cause_c = ''
  n(1) = -1
  stat = DC_NOERR
  call map_set_rank(var, 1, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  if (n(1) < 0) then
    ! count_compact ã§ã¯ãªã„ã®ã§ã€ã‚¼ãƒæ¬¡å…ƒåŒ–ã—ã¦ã„ã‚‹ã¨ n = -1 ã¨ãªã‚‹
    n(1) = 1
  endif
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 1'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetReal(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = array1dim_tmp
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerReal1

subroutine GTVarGetPointerReal2(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetReal
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING, SP
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  real(SP), pointer :: value(:,:) !(out)
  real(SP), allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(2), cause_i, data_rank
  logical                         :: invalid_check(2)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerReal2'
  continue
  cause_i = 0
  cause_c = ''
  n(2) = -1
  stat = DC_NOERR
  call map_set_rank(var, 2, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  call Get_Slice(var, dimord=2, count=n(2), count_compact=.false.)
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 2'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .not. size(value,2) == n(2) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1),  &
      & n(2))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetReal(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = reshape(array1dim_tmp, n)
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerReal2

subroutine GTVarGetPointerReal3(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetReal
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING, SP
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  real(SP), pointer :: value(:,:,:) !(out)
  real(SP), allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(3), cause_i, data_rank
  logical                         :: invalid_check(3)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerReal3'
  continue
  cause_i = 0
  cause_c = ''
  n(3) = -1
  stat = DC_NOERR
  call map_set_rank(var, 3, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  call Get_Slice(var, dimord=2, count=n(2), count_compact=.false.)
  call Get_Slice(var, dimord=3, count=n(3), count_compact=.false.)
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 3'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .not. size(value,2) == n(2) .or. &
      & .not. size(value,3) == n(3) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1),  &
      & n(2),  &
      & n(3))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetReal(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = reshape(array1dim_tmp, n)
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerReal3

subroutine GTVarGetPointerReal4(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetReal
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING, SP
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  real(SP), pointer :: value(:,:,:,:) !(out)
  real(SP), allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(4), cause_i, data_rank
  logical                         :: invalid_check(4)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerReal4'
  continue
  cause_i = 0
  cause_c = ''
  n(4) = -1
  stat = DC_NOERR
  call map_set_rank(var, 4, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  call Get_Slice(var, dimord=2, count=n(2), count_compact=.false.)
  call Get_Slice(var, dimord=3, count=n(3), count_compact=.false.)
  call Get_Slice(var, dimord=4, count=n(4), count_compact=.false.)
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 4'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .not. size(value,2) == n(2) .or. &
      & .not. size(value,3) == n(3) .or. &
      & .not. size(value,4) == n(4) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1),  &
      & n(2),  &
      & n(3),  &
      & n(4))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetReal(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = reshape(array1dim_tmp, n)
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerReal4

subroutine GTVarGetPointerReal5(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetReal
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING, SP
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  real(SP), pointer :: value(:,:,:,:,:) !(out)
  real(SP), allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(5), cause_i, data_rank
  logical                         :: invalid_check(5)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerReal5'
  continue
  cause_i = 0
  cause_c = ''
  n(5) = -1
  stat = DC_NOERR
  call map_set_rank(var, 5, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  call Get_Slice(var, dimord=2, count=n(2), count_compact=.false.)
  call Get_Slice(var, dimord=3, count=n(3), count_compact=.false.)
  call Get_Slice(var, dimord=4, count=n(4), count_compact=.false.)
  call Get_Slice(var, dimord=5, count=n(5), count_compact=.false.)
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 5'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .not. size(value,2) == n(2) .or. &
      & .not. size(value,3) == n(3) .or. &
      & .not. size(value,4) == n(4) .or. &
      & .not. size(value,5) == n(5) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1),  &
      & n(2),  &
      & n(3),  &
      & n(4),  &
      & n(5))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetReal(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = reshape(array1dim_tmp, n)
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerReal5

subroutine GTVarGetPointerReal6(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetReal
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING, SP
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  real(SP), pointer :: value(:,:,:,:,:,:) !(out)
  real(SP), allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(6), cause_i, data_rank
  logical                         :: invalid_check(6)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerReal6'
  continue
  cause_i = 0
  cause_c = ''
  n(6) = -1
  stat = DC_NOERR
  call map_set_rank(var, 6, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  call Get_Slice(var, dimord=2, count=n(2), count_compact=.false.)
  call Get_Slice(var, dimord=3, count=n(3), count_compact=.false.)
  call Get_Slice(var, dimord=4, count=n(4), count_compact=.false.)
  call Get_Slice(var, dimord=5, count=n(5), count_compact=.false.)
  call Get_Slice(var, dimord=6, count=n(6), count_compact=.false.)
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 6'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .not. size(value,2) == n(2) .or. &
      & .not. size(value,3) == n(3) .or. &
      & .not. size(value,4) == n(4) .or. &
      & .not. size(value,5) == n(5) .or. &
      & .not. size(value,6) == n(6) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1),  &
      & n(2),  &
      & n(3),  &
      & n(4),  &
      & n(5),  &
      & n(6))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetReal(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = reshape(array1dim_tmp, n)
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerReal6

subroutine GTVarGetPointerReal7(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetReal
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING, SP
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  real(SP), pointer :: value(:,:,:,:,:,:,:) !(out)
  real(SP), allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(7), cause_i, data_rank
  logical                         :: invalid_check(7)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerReal7'
  continue
  cause_i = 0
  cause_c = ''
  n(7) = -1
  stat = DC_NOERR
  call map_set_rank(var, 7, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  call Get_Slice(var, dimord=2, count=n(2), count_compact=.false.)
  call Get_Slice(var, dimord=3, count=n(3), count_compact=.false.)
  call Get_Slice(var, dimord=4, count=n(4), count_compact=.false.)
  call Get_Slice(var, dimord=5, count=n(5), count_compact=.false.)
  call Get_Slice(var, dimord=6, count=n(6), count_compact=.false.)
  call Get_Slice(var, dimord=7, count=n(7), count_compact=.false.)
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 7'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .not. size(value,2) == n(2) .or. &
      & .not. size(value,3) == n(3) .or. &
      & .not. size(value,4) == n(4) .or. &
      & .not. size(value,5) == n(5) .or. &
      & .not. size(value,6) == n(6) .or. &
      & .not. size(value,7) == n(7) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1),  &
      & n(2),  &
      & n(3),  &
      & n(4),  &
      & n(5),  &
      & n(6),  &
      & n(7))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetReal(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = reshape(array1dim_tmp, n)
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerReal7

subroutine GTVarGetPointerInt1(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetInt
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  integer, pointer :: value(:) !(out)
  integer, allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(1), cause_i, data_rank
  logical                         :: invalid_check(1)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerInt1'
  continue
  cause_i = 0
  cause_c = ''
  n(1) = -1
  stat = DC_NOERR
  call map_set_rank(var, 1, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  if (n(1) < 0) then
    ! count_compact ã§ã¯ãªã„ã®ã§ã€ã‚¼ãƒæ¬¡å…ƒåŒ–ã—ã¦ã„ã‚‹ã¨ n = -1 ã¨ãªã‚‹
    n(1) = 1
  endif
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 1'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetInt(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = array1dim_tmp
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerInt1

subroutine GTVarGetPointerInt2(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetInt
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  integer, pointer :: value(:,:) !(out)
  integer, allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(2), cause_i, data_rank
  logical                         :: invalid_check(2)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerInt2'
  continue
  cause_i = 0
  cause_c = ''
  n(2) = -1
  stat = DC_NOERR
  call map_set_rank(var, 2, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  call Get_Slice(var, dimord=2, count=n(2), count_compact=.false.)
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 2'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .not. size(value,2) == n(2) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1),  &
      & n(2))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetInt(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = reshape(array1dim_tmp, n)
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerInt2

subroutine GTVarGetPointerInt3(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetInt
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  integer, pointer :: value(:,:,:) !(out)
  integer, allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(3), cause_i, data_rank
  logical                         :: invalid_check(3)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerInt3'
  continue
  cause_i = 0
  cause_c = ''
  n(3) = -1
  stat = DC_NOERR
  call map_set_rank(var, 3, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  call Get_Slice(var, dimord=2, count=n(2), count_compact=.false.)
  call Get_Slice(var, dimord=3, count=n(3), count_compact=.false.)
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 3'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .not. size(value,2) == n(2) .or. &
      & .not. size(value,3) == n(3) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1),  &
      & n(2),  &
      & n(3))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetInt(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = reshape(array1dim_tmp, n)
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerInt3

subroutine GTVarGetPointerInt4(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetInt
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  integer, pointer :: value(:,:,:,:) !(out)
  integer, allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(4), cause_i, data_rank
  logical                         :: invalid_check(4)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerInt4'
  continue
  cause_i = 0
  cause_c = ''
  n(4) = -1
  stat = DC_NOERR
  call map_set_rank(var, 4, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  call Get_Slice(var, dimord=2, count=n(2), count_compact=.false.)
  call Get_Slice(var, dimord=3, count=n(3), count_compact=.false.)
  call Get_Slice(var, dimord=4, count=n(4), count_compact=.false.)
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 4'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .not. size(value,2) == n(2) .or. &
      & .not. size(value,3) == n(3) .or. &
      & .not. size(value,4) == n(4) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1),  &
      & n(2),  &
      & n(3),  &
      & n(4))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetInt(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = reshape(array1dim_tmp, n)
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerInt4

subroutine GTVarGetPointerInt5(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetInt
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  integer, pointer :: value(:,:,:,:,:) !(out)
  integer, allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(5), cause_i, data_rank
  logical                         :: invalid_check(5)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerInt5'
  continue
  cause_i = 0
  cause_c = ''
  n(5) = -1
  stat = DC_NOERR
  call map_set_rank(var, 5, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  call Get_Slice(var, dimord=2, count=n(2), count_compact=.false.)
  call Get_Slice(var, dimord=3, count=n(3), count_compact=.false.)
  call Get_Slice(var, dimord=4, count=n(4), count_compact=.false.)
  call Get_Slice(var, dimord=5, count=n(5), count_compact=.false.)
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 5'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .not. size(value,2) == n(2) .or. &
      & .not. size(value,3) == n(3) .or. &
      & .not. size(value,4) == n(4) .or. &
      & .not. size(value,5) == n(5) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1),  &
      & n(2),  &
      & n(3),  &
      & n(4),  &
      & n(5))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetInt(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = reshape(array1dim_tmp, n)
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerInt5

subroutine GTVarGetPointerInt6(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetInt
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  integer, pointer :: value(:,:,:,:,:,:) !(out)
  integer, allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(6), cause_i, data_rank
  logical                         :: invalid_check(6)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerInt6'
  continue
  cause_i = 0
  cause_c = ''
  n(6) = -1
  stat = DC_NOERR
  call map_set_rank(var, 6, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  call Get_Slice(var, dimord=2, count=n(2), count_compact=.false.)
  call Get_Slice(var, dimord=3, count=n(3), count_compact=.false.)
  call Get_Slice(var, dimord=4, count=n(4), count_compact=.false.)
  call Get_Slice(var, dimord=5, count=n(5), count_compact=.false.)
  call Get_Slice(var, dimord=6, count=n(6), count_compact=.false.)
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 6'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .not. size(value,2) == n(2) .or. &
      & .not. size(value,3) == n(3) .or. &
      & .not. size(value,4) == n(4) .or. &
      & .not. size(value,5) == n(5) .or. &
      & .not. size(value,6) == n(6) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1),  &
      & n(2),  &
      & n(3),  &
      & n(4),  &
      & n(5),  &
      & n(6))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetInt(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = reshape(array1dim_tmp, n)
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerInt6

subroutine GTVarGetPointerInt7(var, value, err)
  use gtdata_types,          only: GT_VARIABLE
  use gtdata_generic,        only: Get_Slice, GTVarGetInt
  use gtdata_internal_map,   only: map_set_rank
  use gtdata_netcdf_generic, only: Get
  use gtdata_netcdf_types,   only: GD_NC_VARIABLE
  use dc_types,              only: STRING
  use dc_trace,              only: DbgMessage
  use dc_error,              only: StoreError, DC_NOERR, &
    & GT_EBADALLOCATESIZE, GT_ENOMOREDIMS, GT_ERANKMISMATCH
  use dc_string,             only: toChar
  implicit none
  type(GT_VARIABLE), intent(in):: var
  integer, pointer :: value(:,:,:,:,:,:,:) !(out)
  integer, allocatable :: array1dim_tmp(:)
  logical, intent(out), optional  :: err
  integer                         :: stat, n(7), cause_i, data_rank
  logical                         :: invalid_check(7)
  character(STRING)               :: cause_c
  character(*), parameter :: subname = 'GTVarGetPointerInt7'
  continue
  cause_i = 0
  cause_c = ''
  n(7) = -1
  stat = DC_NOERR
  call map_set_rank(var, 7, stat)
  if (stat /= DC_NOERR) goto 999
  call Get_Slice(var, dimord=1, count=n(1), count_compact=.false.)
  call Get_Slice(var, dimord=2, count=n(2), count_compact=.false.)
  call Get_Slice(var, dimord=3, count=n(3), count_compact=.false.)
  call Get_Slice(var, dimord=4, count=n(4), count_compact=.false.)
  call Get_Slice(var, dimord=5, count=n(5), count_compact=.false.)
  call Get_Slice(var, dimord=6, count=n(6), count_compact=.false.)
  call Get_Slice(var, dimord=7, count=n(7), count_compact=.false.)
  call DbgMessage('n(:)=%*d', i=n, n=(/size(n)/))
  invalid_check = n > 0
  if (.not. all(invalid_check)) then
    stat = GT_ERANKMISMATCH
    data_rank = count(invalid_check)
    cause_c = trim(toChar(data_rank)) // ' and 7'
    goto 999
  end if
  ! value ãŒ allocate ã•ã‚Œã¦ã„ãªã‘ã‚Œã° allocate ã™ã‚‹.
  ! value ãŒæ—¢ã« allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒå–å¾—ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ã¨åŒã˜ã§
  ! ã‚ã‚Œã°ãã®ã¾ã¾å–å¾—.
  ! value ãŒ allocate ã•ã‚Œã¦ã„ã¦ã‚µã‚¤ã‚ºãŒç•°ãªã‚‹å ´åˆã¯ã‚¨ãƒ©ãƒ¼.
  if ( associated(value) ) then
    if ( &
      & .not. size(value,1) == n(1) .or. &
      & .not. size(value,2) == n(2) .or. &
      & .not. size(value,3) == n(3) .or. &
      & .not. size(value,4) == n(4) .or. &
      & .not. size(value,5) == n(5) .or. &
      & .not. size(value,6) == n(6) .or. &
      & .not. size(value,7) == n(7) .or. &
      & .false.                             ) then
      stat = GT_EBADALLOCATESIZE
      if (stat /= DC_NOERR) goto 999
    else
      call DbgMessage('@ value is already allocated')
    endif
  else
    call DbgMessage('@ allocate value')
    allocate( value (&
      & n(1),  &
      & n(2),  &
      & n(3),  &
      & n(4),  &
      & n(5),  &
      & n(6),  &
      & n(7))  &
      &  )
  endif
  if (allocated(array1dim_tmp)) then
    deallocate(array1dim_tmp)
  end if
  allocate(array1dim_tmp(product(n)))
  call GTVarGetInt(var, array1dim_tmp, product(n), err)
  !    call DbgMessage('max=%f min=%f', d=(/maxval(value), minval(value)/))
  value = reshape(array1dim_tmp, n)
999 continue
  call StoreError(stat, subname, err, cause_i=cause_i, cause_c=cause_c)
end subroutine GTVarGetPointerInt7