

















































































































 


































































































































































 













































































































































































































































 



















































 










 








































































































































































































































 










                                
                                

                                
                                

                                
                                

                                



















































































subroutine TestReadWrite_TestF_A(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk_alignment&
  &,cctk_alignment_offset,cctk_from,cctk_to,cctk_bbox,cctk_delta_time,cctk_time,cctk_delta_space,cctk_origin_space,cctk_levfac,cctk&
  &_levoff,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2,cct&
  &k_ash3, ScalarVar,Var2, TestGroup_length,Var3_length,X0gridArrayGroup,X1gridArrayGroup,ArrayCurrentLevelC,ArrayCurrentLevelF,Arr&
  &aySizeF,GroupCurrentLevelC,GroupCurrentLevelF,GroupPastLevelC,GroupPastLevelF,ScalarVarCurrentLevelC,ScalarVarCurrentLevelF,Unus&
  &edGroupIsNullC,UnusedGroupIsNullF,UnusedVar,UnusedVarIsNullC,UnusedVarIsNullF,ValidRegionsC,ValidRegionsF,Var3,VarCurrentLevelC,&
  &VarCurrentLevelF,VarPastLevelC,VarPastLevelF,gridArray1,gridArray1_p,gridArray1_p_p,gridArray2,gridArray2_p,gridArray2_p_p,group&
  &Var1,groupVar1_p,groupVar1_p_p,groupVar2,groupVar2_p,groupVar2_p_p, X0rad1,X0rad2,X0rad3,X1rad2,X1rad3,X2rad3,rad1_length,rad2_l&
  &ength,rad3_length,Var1,Var1_p,coarse_dx,coarse_dy,coarse_dz,r,rad1,rad2,rad3,x,y,z)

  implicit none


  INTEGER cctk_dim
  integer, parameter :: cctki_use_cctk_dim = kind(cctk_dim)
  INTEGER cctk_gsh (cctk_dim)
  integer, parameter :: cctki_use_cctk_gsh = kind(cctk_gsh)
  INTEGER cctk_lsh (cctk_dim)
  integer, parameter :: cctki_use_cctk_lsh = kind(cctk_lsh)
  INTEGER cctk_lbnd (cctk_dim)
  integer, parameter :: cctki_use_cctk_lbnd = kind(cctk_lbnd)
  INTEGER cctk_ubnd (cctk_dim)
  integer, parameter :: cctki_use_cctk_ubnd = kind(cctk_ubnd)
  INTEGER cctk_tile_min (cctk_dim)
  integer, parameter :: cctki_use_cctk_tile_min = kind(cctk_tile_min)
  INTEGER cctk_tile_max (cctk_dim)
  integer, parameter :: cctki_use_cctk_tile_max = kind(cctk_tile_max)
  INTEGER cctk_ash (cctk_dim)
  integer, parameter :: cctki_use_cctk_ash = kind(cctk_ash)
  INTEGER cctk_alignment
  integer, parameter :: cctki_use_cctk_alignment = kind(cctk_alignment)
  INTEGER cctk_alignment_offset
  integer, parameter :: cctki_use_cctk_alignment_offset = kind(cctk_alignment_offset)
  INTEGER cctk_from (cctk_dim)
  integer, parameter :: cctki_use_cctk_from = kind(cctk_from)
  INTEGER cctk_to (cctk_dim)
  integer, parameter :: cctki_use_cctk_to = kind(cctk_to)
  INTEGER cctk_bbox (2*cctk_dim)
  integer, parameter :: cctki_use_cctk_bbox = kind(cctk_bbox)
  REAL*8 cctk_delta_time
  integer, parameter :: cctki_use_cctk_delta_time = kind(cctk_delta_time)
  REAL*8 cctk_time
  integer, parameter :: cctki_use_cctk_time = kind(cctk_time)
  REAL*8 cctk_delta_space (cctk_dim)
  integer, parameter :: cctki_use_cctk_delta_space = kind(cctk_delta_space)
  REAL*8 cctk_origin_space (cctk_dim)
  integer, parameter :: cctki_use_cctk_origin_space = kind(cctk_origin_space)
  INTEGER cctk_levfac (cctk_dim)
  integer, parameter :: cctki_use_cctk_levfac = kind(cctk_levfac)
  INTEGER cctk_levoff (cctk_dim)
  integer, parameter :: cctki_use_cctk_levoff = kind(cctk_levoff)
  INTEGER cctk_levoffdenom (cctk_dim)
  integer, parameter :: cctki_use_cctk_levoffdenom = kind(cctk_levoffdenom)
  INTEGER cctk_timefac
  integer, parameter :: cctki_use_cctk_timefac = kind(cctk_timefac)
  INTEGER cctk_convlevel
  integer, parameter :: cctki_use_cctk_convlevel = kind(cctk_convlevel)
  INTEGER cctk_convfac
  integer, parameter :: cctki_use_cctk_convfac = kind(cctk_convfac)
  INTEGER cctk_nghostzones (cctk_dim)
  integer, parameter :: cctki_use_cctk_nghostzones = kind(cctk_nghostzones)
  INTEGER cctk_iteration
  integer, parameter :: cctki_use_cctk_iteration = kind(cctk_iteration)
  integer*8 cctkGH
  integer, parameter :: cctki_use_cctkGH = kind(cctkGH)
  INTEGER cctk_ash1
  integer, parameter :: cctki_use_cctk_ash1 = kind(cctk_ash1)
  INTEGER cctk_ash2
  integer, parameter :: cctki_use_cctk_ash2 = kind(cctk_ash2)
  INTEGER cctk_ash3
  integer, parameter :: cctki_use_cctk_ash3 = kind(cctk_ash3)
  REAL*8, iNteNt(iN) :: x (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_x = kind(x)
  REAL*8 :: scalarvar
  integer, parameter :: cctki_use_scalarvar = kind(scalarvar)
  REAL*8 :: var2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_var2 = kind(var2)
  INTEGER*4 :: arraysizef
  integer, parameter :: cctki_use_arraysizef = kind(arraysizef)
  integer :: x0gridarraygroup
  integer :: x1gridarraygroup
  REAL*8 :: gridarray1 (x0gridarraygroup,x1gridarraygroup)
  integer, parameter :: cctki_use_gridarray1 = kind(gridarray1)
  REAL*8 :: gridarray1_p_p (x0gridarraygroup,x1gridarraygroup)
  integer, parameter :: cctki_use_gridarray1_p_p = kind(gridarray1_p_p)
  REAL*8 :: gridarray2_p_p (x0gridarraygroup,x1gridarraygroup)
  integer, parameter :: cctki_use_gridarray2_p_p = kind(gridarray2_p_p)
  integer :: testgroup_length
  INTEGER*4 :: groupvar1_p_p (cctk_ash1,cctk_ash2,cctk_ash3,testgroup_length)
  integer, parameter :: cctki_use_groupvar1_p_p = kind(groupvar1_p_p)
  INTEGER*4 :: groupvar2_p_p (cctk_ash1,cctk_ash2,cctk_ash3,testgroup_length)
  integer, parameter :: cctki_use_groupvar2_p_p = kind(groupvar2_p_p)
  integer :: x0rad1
  integer :: rad1_length
  REAL*8 :: rad1 (x0rad1,rad1_length)
  integer, parameter :: cctki_use_rad1 = kind(rad1)
  integer :: x0rad2
  integer :: x1rad2
  integer :: rad2_length
  REAL*8 :: rad2 (x0rad2,x1rad2,rad2_length)
  integer, parameter :: cctki_use_rad2 = kind(rad2)
  integer :: x0rad3
  integer :: x1rad3
  integer :: x2rad3
  integer :: rad3_length
  REAL*8 :: rad3 (x0rad3,x1rad3,x2rad3,rad3_length)
  integer, parameter :: cctki_use_rad3 = kind(rad3)
  INTEGER*4 :: groupvar1 (cctk_ash1,cctk_ash2,cctk_ash3,testgroup_length)
  integer, parameter :: cctki_use_groupvar1 = kind(groupvar1)
  INTEGER*4 :: groupvar2 (cctk_ash1,cctk_ash2,cctk_ash3,testgroup_length)
  integer, parameter :: cctki_use_groupvar2 = kind(groupvar2)
  INTEGER*4 :: validregionsf
  integer, parameter :: cctki_use_validregionsf = kind(validregionsf)
  REAL*8 :: var1 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_var1 = kind(var1)
  REAL*8 :: var1_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_var1_p = kind(var1_p)
  integer :: var3_length
  REAL*8 :: var3 (cctk_ash1,cctk_ash2,cctk_ash3,var3_length)
  integer, parameter :: cctki_use_var3 = kind(var3)
  characTer*8, intent(IN) :: arraycurrentlevelc
  integer, parameter :: cctki_use_arraycurrentlevelc = kind(arraycurrentlevelc)
  characTer*8, intent(IN) :: arraycurrentlevelf
  integer, parameter :: cctki_use_arraycurrentlevelf = kind(arraycurrentlevelf)
  characTer*8, intent(IN) :: groupcurrentlevelc
  integer, parameter :: cctki_use_groupcurrentlevelc = kind(groupcurrentlevelc)
  characTer*8, intent(IN) :: groupcurrentlevelf
  integer, parameter :: cctki_use_groupcurrentlevelf = kind(groupcurrentlevelf)
  characTer*8, intent(IN) :: grouppastlevelc
  integer, parameter :: cctki_use_grouppastlevelc = kind(grouppastlevelc)
  characTer*8, intent(IN) :: grouppastlevelf
  integer, parameter :: cctki_use_grouppastlevelf = kind(grouppastlevelf)
  characTer*8, intent(IN) :: scalarvarcurrentlevelc
  integer, parameter :: cctki_use_scalarvarcurrentlevelc = kind(scalarvarcurrentlevelc)
  characTer*8, intent(IN) :: scalarvarcurrentlevelf
  integer, parameter :: cctki_use_scalarvarcurrentlevelf = kind(scalarvarcurrentlevelf)
  characTer*8, intent(IN) :: unusedgroupisnullc
  integer, parameter :: cctki_use_unusedgroupisnullc = kind(unusedgroupisnullc)
  characTer*8, intent(IN) :: unusedgroupisnullf
  integer, parameter :: cctki_use_unusedgroupisnullf = kind(unusedgroupisnullf)
  characTer*8, intent(IN) :: unusedvar
  integer, parameter :: cctki_use_unusedvar = kind(unusedvar)
  characTer*8, intent(IN) :: unusedvarisnullc
  integer, parameter :: cctki_use_unusedvarisnullc = kind(unusedvarisnullc)
  characTer*8, intent(IN) :: unusedvarisnullf
  integer, parameter :: cctki_use_unusedvarisnullf = kind(unusedvarisnullf)
  characTer*8, intent(IN) :: validregionsc
  integer, parameter :: cctki_use_validregionsc = kind(validregionsc)
  characTer*8, intent(IN) :: varcurrentlevelc
  integer, parameter :: cctki_use_varcurrentlevelc = kind(varcurrentlevelc)
  characTer*8, intent(IN) :: varcurrentlevelf
  integer, parameter :: cctki_use_varcurrentlevelf = kind(varcurrentlevelf)
  characTer*8, intent(IN) :: varpastlevelc
  integer, parameter :: cctki_use_varpastlevelc = kind(varpastlevelc)
  characTer*8, intent(IN) :: varpastlevelf
  integer, parameter :: cctki_use_varpastlevelf = kind(varpastlevelf)
  characTer*8, intent(IN) :: gridarray1_p
  integer, parameter :: cctki_use_gridarray1_p = kind(gridarray1_p)
  characTer*8, intent(IN) :: gridarray2
  integer, parameter :: cctki_use_gridarray2 = kind(gridarray2)
  characTer*8, intent(IN) :: gridarray2_p
  integer, parameter :: cctki_use_gridarray2_p = kind(gridarray2_p)
  characTer*8, intent(IN) :: groupvar1_p
  integer, parameter :: cctki_use_groupvar1_p = kind(groupvar1_p)
  characTer*8, intent(IN) :: groupvar2_p
  integer, parameter :: cctki_use_groupvar2_p = kind(groupvar2_p)
  characTer*8, intent(IN) :: coarse_dx
  integer, parameter :: cctki_use_coarse_dx = kind(coarse_dx)
  characTer*8, intent(IN) :: coarse_dy
  integer, parameter :: cctki_use_coarse_dy = kind(coarse_dy)
  characTer*8, intent(IN) :: coarse_dz
  integer, parameter :: cctki_use_coarse_dz = kind(coarse_dz)
  characTer*8, intent(IN) :: r
  integer, parameter :: cctki_use_r = kind(r)
  characTer*8, intent(IN) :: y
  integer, parameter :: cctki_use_y = kind(y)
  characTer*8, intent(IN) :: z
  integer, parameter :: cctki_use_z = kind(z)
  INTEGER*4 rad_param
  integer, parameter :: cctki_use_rad_param = kind(rad_param)
  INTEGER*4 radx
  integer, parameter :: cctki_use_radx = kind(radx)
  INTEGER*4 rady
  integer, parameter :: cctki_use_rady = kind(rady)
  INTEGER*4 radz
  integer, parameter :: cctki_use_radz = kind(radz)
  COMMON /TestReadWritepriv/rad_param, radx, rady, radz
  interface
  integer*8 function CCTK_PointerTo (var)
  implicit none
  type(*),dimension(..),TARGET :: var
  end function CCTK_PointerTo
  end interface
  interface
  integer function CCTK_Equals (arg1, arg2)
  implicit none
  integer*8 arg1
  character(*) arg2
  end function CCTK_Equals
  integer function CCTK_MyProc (cctkGH)
  implicit none
  integer*8 cctkGH
  end function CCTK_MyProc
  integer function CCTK_nProcs (cctkGH)
  implicit none
  integer*8 cctkGH
  end function CCTK_nProcs
  integer function CCTK_IsThornActive (name)
  implicit none
  character(*) name
  end function CCTK_IsThornActive
  integer*8 function CCTK_NullPointer ()
  implicit none
  end function CCTK_NullPointer
  end interface
  interface
  INTEGER*4 function Driver_GetValidRegion (cctkGH, vi, tl)
  implicit none
  integer*8 cctkGH
  INTEGER*4 vi
  INTEGER*4 tl
  end function Driver_GetValidRegion
  end interface
  interface
  INTEGER*4 function Driver_SelectGroupForBC (cctkGH, faces, width, table_handle, group_name, bc_name)
  implicit none
  integer*8 cctkGH
  INTEGER*4 faces
  INTEGER*4 width
  INTEGER*4 table_handle
  character(*) group_name
  character(*) bc_name
  end function Driver_SelectGroupForBC
  end interface
  interface
  subroutine Driver_SetValidRegion (cctkGH, vi, tl, where)
  implicit none
  integer*8 cctkGH
  INTEGER*4 vi
  INTEGER*4 tl
  INTEGER*4 where
  end subroutine Driver_SetValidRegion
  end interface

  logical, save :: first_time = .true.
  integer :: vi

  
  if(first_time) then
    Var3(1,1,1,1) = 46.
    Var2(1,1,1) = x(1,1,1)

    groupVar1(1,1,1,1) = 43
    groupVar2(1,1,1,1) = 44

    groupVar1_p_p(1,1,1,1) = 53
    groupVar2_p_p(1,1,1,1) = 54

    gridArray1(1,1) = 62.

    rad1(2,1) = 63.

    ScalarVar = 74.

    if(SIZE(gridArray1_p_p,1) .eq. 12 .and. SIZE(gridArray2_p_p,2) .eq. 13 .and. &
       SIZE(rad1,1) .eq. radx .and. SIZE(rad1,2) .eq. rad_param .and. &
       SIZE(rad2,1) .eq. radx .and. SIZE(rad2,2) .eq. rady .and. &
       SIZE(rad2,3) .eq. rad_param .and. &
       SIZE(rad3,1) .eq. radx .and. SIZE(rad3,2) .eq. rady .and. &
       SIZE(rad3,3) .eq. radz .and. SIZE(rad3,4) .eq. rad_param) then
      ArraySizeF = 1
    else
      ArraySizeF = 0
    end if

    ValidRegionsF = 1

    call CCTK_VarIndex(vi, "TestReadWriteImp::groupVar1[0]")
    if(Driver_GetValidRegion(cctkGH, vi, 0) .ne. 0) then
      ValidRegionsF = 0
    end if

    call CCTK_VarIndex(vi, "TestReadWriteImp::groupVar1[0]")
    if(Driver_GetValidRegion(cctkGH, vi, 2) .ne. 0) then
      ValidRegionsF = 0
    end if

    call CCTK_VarIndex(vi, "TestReadWriteImp::groupVar2[0]")
    if(Driver_GetValidRegion(cctkGH, vi, 2) .ne. 0) then
      ValidRegionsF = 0
    end if

    call CCTK_VarIndex(vi, "TestReadWriteImp::Var3[0]")
    if(Driver_GetValidRegion(cctkGH, vi, 0) .ne. 0) then
      ValidRegionsF = 0
    end if

    call CCTK_VarIndex(vi, "TestReadWriteImp::GridArray1")
    if(Driver_GetValidRegion(cctkGH, vi, 0) .ne. 0) then
      ValidRegionsF = 0
    end if

    call CCTK_VarIndex(vi, "TestReadWrite::ScalarVar")
    if(Driver_GetValidRegion(cctkGH, vi, 0) .ne. 0) then
      ValidRegionsF = 0
    end if

    first_time = .false.
  else
    Var1(1,1,1) = 42.
    Var1_p(1,1,1) = 52.

    call CCTK_VarIndex(vi, "TestReadWriteImp::Var1")
    if(Driver_GetValidRegion(cctkGH, vi, 0) .ne. 0) then
      ValidRegionsF = 0
    end if
  end if

end subroutine

subroutine TestReadWrite_TestF_B(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk_alignment&
  &,cctk_alignment_offset,cctk_from,cctk_to,cctk_bbox,cctk_delta_time,cctk_time,cctk_delta_space,cctk_origin_space,cctk_levfac,cctk&
  &_levoff,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2,cct&
  &k_ash3, ScalarVar,Var2, TestGroup_length,Var3_length,X0gridArrayGroup,X1gridArrayGroup,ArrayCurrentLevelC,ArrayCurrentLevelF,Arr&
  &aySizeF,GroupCurrentLevelC,GroupCurrentLevelF,GroupPastLevelC,GroupPastLevelF,ScalarVarCurrentLevelC,ScalarVarCurrentLevelF,Unus&
  &edGroupIsNullC,UnusedGroupIsNullF,UnusedVar,UnusedVarIsNullC,UnusedVarIsNullF,ValidRegionsC,ValidRegionsF,Var3,VarCurrentLevelC,&
  &VarCurrentLevelF,VarPastLevelC,VarPastLevelF,gridArray1,gridArray1_p,gridArray1_p_p,gridArray2,gridArray2_p,gridArray2_p_p,group&
  &Var1,groupVar1_p,groupVar1_p_p,groupVar2,groupVar2_p,groupVar2_p_p, X0rad1,X0rad2,X0rad3,X1rad2,X1rad3,X2rad3,rad1_length,rad2_l&
  &ength,rad3_length,Var1,Var1_p,coarse_dx,coarse_dy,coarse_dz,r,rad1,rad2,rad3,x,y,z)

  implicit none


  INTEGER cctk_dim
  integer, parameter :: cctki_use_cctk_dim = kind(cctk_dim)
  INTEGER cctk_gsh (cctk_dim)
  integer, parameter :: cctki_use_cctk_gsh = kind(cctk_gsh)
  INTEGER cctk_lsh (cctk_dim)
  integer, parameter :: cctki_use_cctk_lsh = kind(cctk_lsh)
  INTEGER cctk_lbnd (cctk_dim)
  integer, parameter :: cctki_use_cctk_lbnd = kind(cctk_lbnd)
  INTEGER cctk_ubnd (cctk_dim)
  integer, parameter :: cctki_use_cctk_ubnd = kind(cctk_ubnd)
  INTEGER cctk_tile_min (cctk_dim)
  integer, parameter :: cctki_use_cctk_tile_min = kind(cctk_tile_min)
  INTEGER cctk_tile_max (cctk_dim)
  integer, parameter :: cctki_use_cctk_tile_max = kind(cctk_tile_max)
  INTEGER cctk_ash (cctk_dim)
  integer, parameter :: cctki_use_cctk_ash = kind(cctk_ash)
  INTEGER cctk_alignment
  integer, parameter :: cctki_use_cctk_alignment = kind(cctk_alignment)
  INTEGER cctk_alignment_offset
  integer, parameter :: cctki_use_cctk_alignment_offset = kind(cctk_alignment_offset)
  INTEGER cctk_from (cctk_dim)
  integer, parameter :: cctki_use_cctk_from = kind(cctk_from)
  INTEGER cctk_to (cctk_dim)
  integer, parameter :: cctki_use_cctk_to = kind(cctk_to)
  INTEGER cctk_bbox (2*cctk_dim)
  integer, parameter :: cctki_use_cctk_bbox = kind(cctk_bbox)
  REAL*8 cctk_delta_time
  integer, parameter :: cctki_use_cctk_delta_time = kind(cctk_delta_time)
  REAL*8 cctk_time
  integer, parameter :: cctki_use_cctk_time = kind(cctk_time)
  REAL*8 cctk_delta_space (cctk_dim)
  integer, parameter :: cctki_use_cctk_delta_space = kind(cctk_delta_space)
  REAL*8 cctk_origin_space (cctk_dim)
  integer, parameter :: cctki_use_cctk_origin_space = kind(cctk_origin_space)
  INTEGER cctk_levfac (cctk_dim)
  integer, parameter :: cctki_use_cctk_levfac = kind(cctk_levfac)
  INTEGER cctk_levoff (cctk_dim)
  integer, parameter :: cctki_use_cctk_levoff = kind(cctk_levoff)
  INTEGER cctk_levoffdenom (cctk_dim)
  integer, parameter :: cctki_use_cctk_levoffdenom = kind(cctk_levoffdenom)
  INTEGER cctk_timefac
  integer, parameter :: cctki_use_cctk_timefac = kind(cctk_timefac)
  INTEGER cctk_convlevel
  integer, parameter :: cctki_use_cctk_convlevel = kind(cctk_convlevel)
  INTEGER cctk_convfac
  integer, parameter :: cctki_use_cctk_convfac = kind(cctk_convfac)
  INTEGER cctk_nghostzones (cctk_dim)
  integer, parameter :: cctki_use_cctk_nghostzones = kind(cctk_nghostzones)
  INTEGER cctk_iteration
  integer, parameter :: cctki_use_cctk_iteration = kind(cctk_iteration)
  integer*8 cctkGH
  integer, parameter :: cctki_use_cctkGH = kind(cctkGH)
  INTEGER cctk_ash1
  integer, parameter :: cctki_use_cctk_ash1 = kind(cctk_ash1)
  INTEGER cctk_ash2
  integer, parameter :: cctki_use_cctk_ash2 = kind(cctk_ash2)
  INTEGER cctk_ash3
  integer, parameter :: cctki_use_cctk_ash3 = kind(cctk_ash3)
  REAL*8 :: var2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_var2 = kind(var2)
  integer :: x0gridarraygroup
  integer :: x1gridarraygroup
  REAL*8, iNteNt(iN) :: gridarray1_p_p (x0gridarraygroup,x1gridarraygroup)
  integer, parameter :: cctki_use_gridarray1_p_p = kind(gridarray1_p_p)
  REAL*8, iNteNt(iN) :: gridarray2_p_p (x0gridarraygroup,x1gridarraygroup)
  integer, parameter :: cctki_use_gridarray2_p_p = kind(gridarray2_p_p)
  integer :: testgroup_length
  INTEGER*4 :: groupvar1 (cctk_ash1,cctk_ash2,cctk_ash3,testgroup_length)
  integer, parameter :: cctki_use_groupvar1 = kind(groupvar1)
  INTEGER*4 :: groupvar2 (cctk_ash1,cctk_ash2,cctk_ash3,testgroup_length)
  integer, parameter :: cctki_use_groupvar2 = kind(groupvar2)
  INTEGER*4 :: unusedgroupisnullf
  integer, parameter :: cctki_use_unusedgroupisnullf = kind(unusedgroupisnullf)
  INTEGER*4 :: unusedvarisnullf
  integer, parameter :: cctki_use_unusedvarisnullf = kind(unusedvarisnullf)
  INTEGER*4 :: validregionsf
  integer, parameter :: cctki_use_validregionsf = kind(validregionsf)
  REAL*8, iNteNt(iN) :: var1 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_var1 = kind(var1)
  REAL*8 :: var1_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_var1_p = kind(var1_p)
  integer :: var3_length
  REAL*8, iNteNt(iN) :: var3 (cctk_ash1,cctk_ash2,cctk_ash3,var3_length)
  integer, parameter :: cctki_use_var3 = kind(var3)
  characTer*8, intent(IN) :: scalarvar
  integer, parameter :: cctki_use_scalarvar = kind(scalarvar)
  characTer*8, intent(IN) :: arraycurrentlevelc
  integer, parameter :: cctki_use_arraycurrentlevelc = kind(arraycurrentlevelc)
  characTer*8, intent(IN) :: arraycurrentlevelf
  integer, parameter :: cctki_use_arraycurrentlevelf = kind(arraycurrentlevelf)
  characTer*8, intent(IN) :: arraysizef
  integer, parameter :: cctki_use_arraysizef = kind(arraysizef)
  characTer*8, intent(IN) :: groupcurrentlevelc
  integer, parameter :: cctki_use_groupcurrentlevelc = kind(groupcurrentlevelc)
  characTer*8, intent(IN) :: groupcurrentlevelf
  integer, parameter :: cctki_use_groupcurrentlevelf = kind(groupcurrentlevelf)
  characTer*8, intent(IN) :: grouppastlevelc
  integer, parameter :: cctki_use_grouppastlevelc = kind(grouppastlevelc)
  characTer*8, intent(IN) :: grouppastlevelf
  integer, parameter :: cctki_use_grouppastlevelf = kind(grouppastlevelf)
  characTer*8, intent(IN) :: scalarvarcurrentlevelc
  integer, parameter :: cctki_use_scalarvarcurrentlevelc = kind(scalarvarcurrentlevelc)
  characTer*8, intent(IN) :: scalarvarcurrentlevelf
  integer, parameter :: cctki_use_scalarvarcurrentlevelf = kind(scalarvarcurrentlevelf)
  characTer*8, intent(IN) :: unusedgroupisnullc
  integer, parameter :: cctki_use_unusedgroupisnullc = kind(unusedgroupisnullc)
  characTer*8, intent(IN) :: unusedvar
  integer, parameter :: cctki_use_unusedvar = kind(unusedvar)
  characTer*8, intent(IN) :: unusedvarisnullc
  integer, parameter :: cctki_use_unusedvarisnullc = kind(unusedvarisnullc)
  characTer*8, intent(IN) :: validregionsc
  integer, parameter :: cctki_use_validregionsc = kind(validregionsc)
  characTer*8, intent(IN) :: varcurrentlevelc
  integer, parameter :: cctki_use_varcurrentlevelc = kind(varcurrentlevelc)
  characTer*8, intent(IN) :: varcurrentlevelf
  integer, parameter :: cctki_use_varcurrentlevelf = kind(varcurrentlevelf)
  characTer*8, intent(IN) :: varpastlevelc
  integer, parameter :: cctki_use_varpastlevelc = kind(varpastlevelc)
  characTer*8, intent(IN) :: varpastlevelf
  integer, parameter :: cctki_use_varpastlevelf = kind(varpastlevelf)
  characTer*8, intent(IN) :: gridarray1
  integer, parameter :: cctki_use_gridarray1 = kind(gridarray1)
  characTer*8, intent(IN) :: gridarray1_p
  integer, parameter :: cctki_use_gridarray1_p = kind(gridarray1_p)
  characTer*8, intent(IN) :: gridarray2
  integer, parameter :: cctki_use_gridarray2 = kind(gridarray2)
  characTer*8, intent(IN) :: gridarray2_p
  integer, parameter :: cctki_use_gridarray2_p = kind(gridarray2_p)
  characTer*8, intent(IN) :: groupvar1_p
  integer, parameter :: cctki_use_groupvar1_p = kind(groupvar1_p)
  characTer*8, intent(IN) :: groupvar1_p_p
  integer, parameter :: cctki_use_groupvar1_p_p = kind(groupvar1_p_p)
  characTer*8, intent(IN) :: groupvar2_p
  integer, parameter :: cctki_use_groupvar2_p = kind(groupvar2_p)
  characTer*8, intent(IN) :: groupvar2_p_p
  integer, parameter :: cctki_use_groupvar2_p_p = kind(groupvar2_p_p)
  characTer*8, intent(IN) :: x0rad1
  integer, parameter :: cctki_use_x0rad1 = kind(x0rad1)
  characTer*8, intent(IN) :: x0rad2
  integer, parameter :: cctki_use_x0rad2 = kind(x0rad2)
  characTer*8, intent(IN) :: x0rad3
  integer, parameter :: cctki_use_x0rad3 = kind(x0rad3)
  characTer*8, intent(IN) :: x1rad2
  integer, parameter :: cctki_use_x1rad2 = kind(x1rad2)
  characTer*8, intent(IN) :: x1rad3
  integer, parameter :: cctki_use_x1rad3 = kind(x1rad3)
  characTer*8, intent(IN) :: x2rad3
  integer, parameter :: cctki_use_x2rad3 = kind(x2rad3)
  characTer*8, intent(IN) :: rad1_length
  integer, parameter :: cctki_use_rad1_length = kind(rad1_length)
  characTer*8, intent(IN) :: rad2_length
  integer, parameter :: cctki_use_rad2_length = kind(rad2_length)
  characTer*8, intent(IN) :: rad3_length
  integer, parameter :: cctki_use_rad3_length = kind(rad3_length)
  characTer*8, intent(IN) :: coarse_dx
  integer, parameter :: cctki_use_coarse_dx = kind(coarse_dx)
  characTer*8, intent(IN) :: coarse_dy
  integer, parameter :: cctki_use_coarse_dy = kind(coarse_dy)
  characTer*8, intent(IN) :: coarse_dz
  integer, parameter :: cctki_use_coarse_dz = kind(coarse_dz)
  characTer*8, intent(IN) :: r
  integer, parameter :: cctki_use_r = kind(r)
  characTer*8, intent(IN) :: rad1
  integer, parameter :: cctki_use_rad1 = kind(rad1)
  characTer*8, intent(IN) :: rad2
  integer, parameter :: cctki_use_rad2 = kind(rad2)
  characTer*8, intent(IN) :: rad3
  integer, parameter :: cctki_use_rad3 = kind(rad3)
  characTer*8, intent(IN) :: x
  integer, parameter :: cctki_use_x = kind(x)
  characTer*8, intent(IN) :: y
  integer, parameter :: cctki_use_y = kind(y)
  characTer*8, intent(IN) :: z
  integer, parameter :: cctki_use_z = kind(z)
  interface
  integer*8 function CCTK_PointerTo (var)
  implicit none
  type(*),dimension(..),TARGET :: var
  end function CCTK_PointerTo
  end interface
  interface
  integer function CCTK_Equals (arg1, arg2)
  implicit none
  integer*8 arg1
  character(*) arg2
  end function CCTK_Equals
  integer function CCTK_MyProc (cctkGH)
  implicit none
  integer*8 cctkGH
  end function CCTK_MyProc
  integer function CCTK_nProcs (cctkGH)
  implicit none
  integer*8 cctkGH
  end function CCTK_nProcs
  integer function CCTK_IsThornActive (name)
  implicit none
  character(*) name
  end function CCTK_IsThornActive
  integer*8 function CCTK_NullPointer ()
  implicit none
  end function CCTK_NullPointer
  end interface
  interface
  INTEGER*4 function Driver_GetValidRegion (cctkGH, vi, tl)
  implicit none
  integer*8 cctkGH
  INTEGER*4 vi
  INTEGER*4 tl
  end function Driver_GetValidRegion
  end interface
  interface
  INTEGER*4 function Driver_SelectGroupForBC (cctkGH, faces, width, table_handle, group_name, bc_name)
  implicit none
  integer*8 cctkGH
  INTEGER*4 faces
  INTEGER*4 width
  INTEGER*4 table_handle
  character(*) group_name
  character(*) bc_name
  end function Driver_SelectGroupForBC
  end interface
  interface
  subroutine Driver_SetValidRegion (cctkGH, vi, tl, where)
  implicit none
  integer*8 cctkGH
  INTEGER*4 vi
  INTEGER*4 tl
  INTEGER*4 where
  end subroutine Driver_SetValidRegion
  end interface
  INTEGER*4 rad_param
  integer, parameter :: cctki_use_rad_param = kind(rad_param)
  INTEGER*4 radx
  integer, parameter :: cctki_use_radx = kind(radx)
  INTEGER*4 rady
  integer, parameter :: cctki_use_rady = kind(rady)
  INTEGER*4 radz
  integer, parameter :: cctki_use_radz = kind(radz)
  COMMON /TestReadWritepriv/rad_param, radx, rady, radz

  integer :: vi

  integer*8 :: NULL

  NULL = CCTK_NullPointer()

  Var2(1,1,1) = Var3(1,1,1,1) - 1.

  if(CCTK_PointerTo(Var1) .eq. NULL .and. CCTK_PointerTo(Var1_p) .eq. NULL .and. &
    CCTK_PointerTo(gridArray1_p_p) .eq. NULL) then
    UnusedVarIsNullF = 1
  else
    UnusedVarIsNullF = 0
  end if
  if(CCTK_PointerTo(groupVar1) .eq. NULL .and. &
     CCTK_PointerTo(groupVar2) .eq. NULL) then
    UnusedGroupIsNullF = 1
  else
    UnusedGroupIsNullF = 0
  end if

  call CCTK_VarIndex(vi, "TestReadWriteImp::groupVar1[0]")
  if(Driver_GetValidRegion(cctkGH, vi, 0) .ne. 6) then
    ValidRegionsF = 0
  end if

  call CCTK_VarIndex(vi, "TestReadWriteImp::groupVar1[0]")
  if(Driver_GetValidRegion(cctkGH, vi, 2) .ne. 7) then
    ValidRegionsF = 0
  end if

  call CCTK_VarIndex(vi, "TestReadWriteImp::groupVar2[0]")
  if(Driver_GetValidRegion(cctkGH, vi, 2) .ne. 7) then
    ValidRegionsF = 0
  end if

  call CCTK_VarIndex(vi, "TestReadWriteImp::Var3[0]")
  if(Driver_GetValidRegion(cctkGH, vi, 0) .ne. 7) then
    ValidRegionsF = 0
  end if

  call CCTK_VarIndex(vi, "TestReadWriteImp::GridArray1")
  if(Driver_GetValidRegion(cctkGH, vi, 0) .ne. 4) then
    ValidRegionsF = 0
  end if

  call CCTK_VarIndex(vi, "TestReadWriteImp::Var1")
  if(Driver_GetValidRegion(cctkGH, vi, 0) .ne. 7) then
    ValidRegionsF = 0
  end if

  call CCTK_VarIndex(vi, "TestReadWrite::ScalarVar")
  if(Driver_GetValidRegion(cctkGH, vi, 0) .ne. 7) then
    ValidRegionsF = 0
  end if
end subroutine

subroutine TestReadWrite_TestF_C(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk_alignment&
  &,cctk_alignment_offset,cctk_from,cctk_to,cctk_bbox,cctk_delta_time,cctk_time,cctk_delta_space,cctk_origin_space,cctk_levfac,cctk&
  &_levoff,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2,cct&
  &k_ash3, ScalarVar,Var2, TestGroup_length,Var3_length,X0gridArrayGroup,X1gridArrayGroup,ArrayCurrentLevelC,ArrayCurrentLevelF,Arr&
  &aySizeF,GroupCurrentLevelC,GroupCurrentLevelF,GroupPastLevelC,GroupPastLevelF,ScalarVarCurrentLevelC,ScalarVarCurrentLevelF,Unus&
  &edGroupIsNullC,UnusedGroupIsNullF,UnusedVar,UnusedVarIsNullC,UnusedVarIsNullF,ValidRegionsC,ValidRegionsF,Var3,VarCurrentLevelC,&
  &VarCurrentLevelF,VarPastLevelC,VarPastLevelF,gridArray1,gridArray1_p,gridArray1_p_p,gridArray2,gridArray2_p,gridArray2_p_p,group&
  &Var1,groupVar1_p,groupVar1_p_p,groupVar2,groupVar2_p,groupVar2_p_p, X0rad1,X0rad2,X0rad3,X1rad2,X1rad3,X2rad3,rad1_length,rad2_l&
  &ength,rad3_length,Var1,Var1_p,coarse_dx,coarse_dy,coarse_dz,r,rad1,rad2,rad3,x,y,z)

  implicit none


  INTEGER cctk_dim
  integer, parameter :: cctki_use_cctk_dim = kind(cctk_dim)
  INTEGER cctk_gsh (cctk_dim)
  integer, parameter :: cctki_use_cctk_gsh = kind(cctk_gsh)
  INTEGER cctk_lsh (cctk_dim)
  integer, parameter :: cctki_use_cctk_lsh = kind(cctk_lsh)
  INTEGER cctk_lbnd (cctk_dim)
  integer, parameter :: cctki_use_cctk_lbnd = kind(cctk_lbnd)
  INTEGER cctk_ubnd (cctk_dim)
  integer, parameter :: cctki_use_cctk_ubnd = kind(cctk_ubnd)
  INTEGER cctk_tile_min (cctk_dim)
  integer, parameter :: cctki_use_cctk_tile_min = kind(cctk_tile_min)
  INTEGER cctk_tile_max (cctk_dim)
  integer, parameter :: cctki_use_cctk_tile_max = kind(cctk_tile_max)
  INTEGER cctk_ash (cctk_dim)
  integer, parameter :: cctki_use_cctk_ash = kind(cctk_ash)
  INTEGER cctk_alignment
  integer, parameter :: cctki_use_cctk_alignment = kind(cctk_alignment)
  INTEGER cctk_alignment_offset
  integer, parameter :: cctki_use_cctk_alignment_offset = kind(cctk_alignment_offset)
  INTEGER cctk_from (cctk_dim)
  integer, parameter :: cctki_use_cctk_from = kind(cctk_from)
  INTEGER cctk_to (cctk_dim)
  integer, parameter :: cctki_use_cctk_to = kind(cctk_to)
  INTEGER cctk_bbox (2*cctk_dim)
  integer, parameter :: cctki_use_cctk_bbox = kind(cctk_bbox)
  REAL*8 cctk_delta_time
  integer, parameter :: cctki_use_cctk_delta_time = kind(cctk_delta_time)
  REAL*8 cctk_time
  integer, parameter :: cctki_use_cctk_time = kind(cctk_time)
  REAL*8 cctk_delta_space (cctk_dim)
  integer, parameter :: cctki_use_cctk_delta_space = kind(cctk_delta_space)
  REAL*8 cctk_origin_space (cctk_dim)
  integer, parameter :: cctki_use_cctk_origin_space = kind(cctk_origin_space)
  INTEGER cctk_levfac (cctk_dim)
  integer, parameter :: cctki_use_cctk_levfac = kind(cctk_levfac)
  INTEGER cctk_levoff (cctk_dim)
  integer, parameter :: cctki_use_cctk_levoff = kind(cctk_levoff)
  INTEGER cctk_levoffdenom (cctk_dim)
  integer, parameter :: cctki_use_cctk_levoffdenom = kind(cctk_levoffdenom)
  INTEGER cctk_timefac
  integer, parameter :: cctki_use_cctk_timefac = kind(cctk_timefac)
  INTEGER cctk_convlevel
  integer, parameter :: cctki_use_cctk_convlevel = kind(cctk_convlevel)
  INTEGER cctk_convfac
  integer, parameter :: cctki_use_cctk_convfac = kind(cctk_convfac)
  INTEGER cctk_nghostzones (cctk_dim)
  integer, parameter :: cctki_use_cctk_nghostzones = kind(cctk_nghostzones)
  INTEGER cctk_iteration
  integer, parameter :: cctki_use_cctk_iteration = kind(cctk_iteration)
  integer*8 cctkGH
  integer, parameter :: cctki_use_cctkGH = kind(cctkGH)
  INTEGER cctk_ash1
  integer, parameter :: cctki_use_cctk_ash1 = kind(cctk_ash1)
  INTEGER cctk_ash2
  integer, parameter :: cctki_use_cctk_ash2 = kind(cctk_ash2)
  INTEGER cctk_ash3
  integer, parameter :: cctki_use_cctk_ash3 = kind(cctk_ash3)
  REAL*8, iNteNt(iN) :: scalarvar
  integer, parameter :: cctki_use_scalarvar = kind(scalarvar)
  REAL*8, iNteNt(iN) :: var2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_var2 = kind(var2)
  INTEGER*4 :: arraycurrentlevelf
  integer, parameter :: cctki_use_arraycurrentlevelf = kind(arraycurrentlevelf)
  integer :: x0gridarraygroup
  integer :: x1gridarraygroup
  REAL*8, iNteNt(iN) :: gridarray1 (x0gridarraygroup,x1gridarraygroup)
  integer, parameter :: cctki_use_gridarray1 = kind(gridarray1)
  INTEGER*4 :: groupcurrentlevelf
  integer, parameter :: cctki_use_groupcurrentlevelf = kind(groupcurrentlevelf)
  INTEGER*4 :: grouppastlevelf
  integer, parameter :: cctki_use_grouppastlevelf = kind(grouppastlevelf)
  integer :: testgroup_length
  INTEGER*4, iNteNt(iN) :: groupvar1 (cctk_ash1,cctk_ash2,cctk_ash3,testgroup_length)
  integer, parameter :: cctki_use_groupvar1 = kind(groupvar1)
  INTEGER*4, iNteNt(iN) :: groupvar2 (cctk_ash1,cctk_ash2,cctk_ash3,testgroup_length)
  integer, parameter :: cctki_use_groupvar2 = kind(groupvar2)
  integer :: x0rad1
  integer :: rad1_length
  REAL*8, iNteNt(iN) :: rad1 (x0rad1,rad1_length)
  integer, parameter :: cctki_use_rad1 = kind(rad1)
  INTEGER*4 :: scalarvarcurrentlevelf
  integer, parameter :: cctki_use_scalarvarcurrentlevelf = kind(scalarvarcurrentlevelf)
  INTEGER*4, iNteNt(iN) :: groupvar1_p_p (cctk_ash1,cctk_ash2,cctk_ash3,testgroup_length)
  integer, parameter :: cctki_use_groupvar1_p_p = kind(groupvar1_p_p)
  INTEGER*4, iNteNt(iN) :: groupvar2_p_p (cctk_ash1,cctk_ash2,cctk_ash3,testgroup_length)
  integer, parameter :: cctki_use_groupvar2_p_p = kind(groupvar2_p_p)
  REAL*8, iNteNt(iN) :: var1 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_var1 = kind(var1)
  REAL*8, iNteNt(iN) :: var1_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_var1_p = kind(var1_p)
  integer :: var3_length
  REAL*8, iNteNt(iN) :: var3 (cctk_ash1,cctk_ash2,cctk_ash3,var3_length)
  integer, parameter :: cctki_use_var3 = kind(var3)
  INTEGER*4 :: varcurrentlevelf
  integer, parameter :: cctki_use_varcurrentlevelf = kind(varcurrentlevelf)
  INTEGER*4 :: varpastlevelf
  integer, parameter :: cctki_use_varpastlevelf = kind(varpastlevelf)
  characTer*8, intent(IN) :: arraycurrentlevelc
  integer, parameter :: cctki_use_arraycurrentlevelc = kind(arraycurrentlevelc)
  characTer*8, intent(IN) :: arraysizef
  integer, parameter :: cctki_use_arraysizef = kind(arraysizef)
  characTer*8, intent(IN) :: groupcurrentlevelc
  integer, parameter :: cctki_use_groupcurrentlevelc = kind(groupcurrentlevelc)
  characTer*8, intent(IN) :: grouppastlevelc
  integer, parameter :: cctki_use_grouppastlevelc = kind(grouppastlevelc)
  characTer*8, intent(IN) :: scalarvarcurrentlevelc
  integer, parameter :: cctki_use_scalarvarcurrentlevelc = kind(scalarvarcurrentlevelc)
  characTer*8, intent(IN) :: unusedgroupisnullc
  integer, parameter :: cctki_use_unusedgroupisnullc = kind(unusedgroupisnullc)
  characTer*8, intent(IN) :: unusedgroupisnullf
  integer, parameter :: cctki_use_unusedgroupisnullf = kind(unusedgroupisnullf)
  characTer*8, intent(IN) :: unusedvar
  integer, parameter :: cctki_use_unusedvar = kind(unusedvar)
  characTer*8, intent(IN) :: unusedvarisnullc
  integer, parameter :: cctki_use_unusedvarisnullc = kind(unusedvarisnullc)
  characTer*8, intent(IN) :: unusedvarisnullf
  integer, parameter :: cctki_use_unusedvarisnullf = kind(unusedvarisnullf)
  characTer*8, intent(IN) :: validregionsc
  integer, parameter :: cctki_use_validregionsc = kind(validregionsc)
  characTer*8, intent(IN) :: validregionsf
  integer, parameter :: cctki_use_validregionsf = kind(validregionsf)
  characTer*8, intent(IN) :: varcurrentlevelc
  integer, parameter :: cctki_use_varcurrentlevelc = kind(varcurrentlevelc)
  characTer*8, intent(IN) :: varpastlevelc
  integer, parameter :: cctki_use_varpastlevelc = kind(varpastlevelc)
  characTer*8, intent(IN) :: gridarray1_p
  integer, parameter :: cctki_use_gridarray1_p = kind(gridarray1_p)
  characTer*8, intent(IN) :: gridarray1_p_p
  integer, parameter :: cctki_use_gridarray1_p_p = kind(gridarray1_p_p)
  characTer*8, intent(IN) :: gridarray2
  integer, parameter :: cctki_use_gridarray2 = kind(gridarray2)
  characTer*8, intent(IN) :: gridarray2_p
  integer, parameter :: cctki_use_gridarray2_p = kind(gridarray2_p)
  characTer*8, intent(IN) :: gridarray2_p_p
  integer, parameter :: cctki_use_gridarray2_p_p = kind(gridarray2_p_p)
  characTer*8, intent(IN) :: groupvar1_p
  integer, parameter :: cctki_use_groupvar1_p = kind(groupvar1_p)
  characTer*8, intent(IN) :: groupvar2_p
  integer, parameter :: cctki_use_groupvar2_p = kind(groupvar2_p)
  characTer*8, intent(IN) :: x0rad2
  integer, parameter :: cctki_use_x0rad2 = kind(x0rad2)
  characTer*8, intent(IN) :: x0rad3
  integer, parameter :: cctki_use_x0rad3 = kind(x0rad3)
  characTer*8, intent(IN) :: x1rad2
  integer, parameter :: cctki_use_x1rad2 = kind(x1rad2)
  characTer*8, intent(IN) :: x1rad3
  integer, parameter :: cctki_use_x1rad3 = kind(x1rad3)
  characTer*8, intent(IN) :: x2rad3
  integer, parameter :: cctki_use_x2rad3 = kind(x2rad3)
  characTer*8, intent(IN) :: rad2_length
  integer, parameter :: cctki_use_rad2_length = kind(rad2_length)
  characTer*8, intent(IN) :: rad3_length
  integer, parameter :: cctki_use_rad3_length = kind(rad3_length)
  characTer*8, intent(IN) :: coarse_dx
  integer, parameter :: cctki_use_coarse_dx = kind(coarse_dx)
  characTer*8, intent(IN) :: coarse_dy
  integer, parameter :: cctki_use_coarse_dy = kind(coarse_dy)
  characTer*8, intent(IN) :: coarse_dz
  integer, parameter :: cctki_use_coarse_dz = kind(coarse_dz)
  characTer*8, intent(IN) :: r
  integer, parameter :: cctki_use_r = kind(r)
  characTer*8, intent(IN) :: rad2
  integer, parameter :: cctki_use_rad2 = kind(rad2)
  characTer*8, intent(IN) :: rad3
  integer, parameter :: cctki_use_rad3 = kind(rad3)
  characTer*8, intent(IN) :: x
  integer, parameter :: cctki_use_x = kind(x)
  characTer*8, intent(IN) :: y
  integer, parameter :: cctki_use_y = kind(y)
  characTer*8, intent(IN) :: z
  integer, parameter :: cctki_use_z = kind(z)
  INTEGER*4 rad_param
  integer, parameter :: cctki_use_rad_param = kind(rad_param)
  INTEGER*4 radx
  integer, parameter :: cctki_use_radx = kind(radx)
  INTEGER*4 rady
  integer, parameter :: cctki_use_rady = kind(rady)
  INTEGER*4 radz
  integer, parameter :: cctki_use_radz = kind(radz)
  COMMON /TestReadWritepriv/rad_param, radx, rady, radz

  if(Var1(1,1,1) .eq. 42. .and. Var2(1,1,1) .eq. 45. .and. Var3(1,1,1,1) .eq. 46.) then
    VarCurrentLevelF = 1
  else
    VarCurrentLevelF = 0
  end if
  if(groupVar1(1,1,1,1) .eq. 43 .and. groupVar2(1,1,1,1) .eq. 44) then
    GroupCurrentLevelF = 1
  else
    GroupCurrentLevelF = 0
  end if

  if(Var1_p(1,1,1) .eq. 52) then
    VarPastLevelF = 1
  else
    VarPastLevelF = 0
  end if
  if(groupVar1_p_p(1,1,1,1) .eq. 53 .and. &
     groupVar2_p_p(1,1,1,1) .eq. 54) then
    GroupPastLevelF = 1
  else
    GroupPastLevelF = 0
  end if

  if(gridArray1(1,1) .eq. 62. .and.  rad1(2,1) .eq. 63.) then
    ArrayCurrentLevelF = 1
  else
    ArrayCurrentLevelF = 0
  end if

  if(ScalarVar .eq. 74.) then
    ScalarVarCurrentLevelF = 1
  else
    ScalarVarCurrentLevelF = 0
  end if
end subroutine


subroutine TestReadWrite_TestF_D(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk_alignment&
  &,cctk_alignment_offset,cctk_from,cctk_to,cctk_bbox,cctk_delta_time,cctk_time,cctk_delta_space,cctk_origin_space,cctk_levfac,cctk&
  &_levoff,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2,cct&
  &k_ash3, ScalarVar,Var2, TestGroup_length,Var3_length,X0gridArrayGroup,X1gridArrayGroup,ArrayCurrentLevelC,ArrayCurrentLevelF,Arr&
  &aySizeF,GroupCurrentLevelC,GroupCurrentLevelF,GroupPastLevelC,GroupPastLevelF,ScalarVarCurrentLevelC,ScalarVarCurrentLevelF,Unus&
  &edGroupIsNullC,UnusedGroupIsNullF,UnusedVar,UnusedVarIsNullC,UnusedVarIsNullF,ValidRegionsC,ValidRegionsF,Var3,VarCurrentLevelC,&
  &VarCurrentLevelF,VarPastLevelC,VarPastLevelF,gridArray1,gridArray1_p,gridArray1_p_p,gridArray2,gridArray2_p,gridArray2_p_p,group&
  &Var1,groupVar1_p,groupVar1_p_p,groupVar2,groupVar2_p,groupVar2_p_p, X0rad1,X0rad2,X0rad3,X1rad2,X1rad3,X2rad3,rad1_length,rad2_l&
  &ength,rad3_length,Var1,Var1_p,coarse_dx,coarse_dy,coarse_dz,r,rad1,rad2,rad3,x,y,z)

  implicit none

  
  
  
  
  
  
  
  





  INTEGER cctk_dim
  integer, parameter :: cctki_use_cctk_dim = kind(cctk_dim)
  INTEGER cctk_gsh (cctk_dim)
  integer, parameter :: cctki_use_cctk_gsh = kind(cctk_gsh)
  INTEGER cctk_lsh (cctk_dim)
  integer, parameter :: cctki_use_cctk_lsh = kind(cctk_lsh)
  INTEGER cctk_lbnd (cctk_dim)
  integer, parameter :: cctki_use_cctk_lbnd = kind(cctk_lbnd)
  INTEGER cctk_ubnd (cctk_dim)
  integer, parameter :: cctki_use_cctk_ubnd = kind(cctk_ubnd)
  INTEGER cctk_tile_min (cctk_dim)
  integer, parameter :: cctki_use_cctk_tile_min = kind(cctk_tile_min)
  INTEGER cctk_tile_max (cctk_dim)
  integer, parameter :: cctki_use_cctk_tile_max = kind(cctk_tile_max)
  INTEGER cctk_ash (cctk_dim)
  integer, parameter :: cctki_use_cctk_ash = kind(cctk_ash)
  INTEGER cctk_alignment
  integer, parameter :: cctki_use_cctk_alignment = kind(cctk_alignment)
  INTEGER cctk_alignment_offset
  integer, parameter :: cctki_use_cctk_alignment_offset = kind(cctk_alignment_offset)
  INTEGER cctk_from (cctk_dim)
  integer, parameter :: cctki_use_cctk_from = kind(cctk_from)
  INTEGER cctk_to (cctk_dim)
  integer, parameter :: cctki_use_cctk_to = kind(cctk_to)
  INTEGER cctk_bbox (2*cctk_dim)
  integer, parameter :: cctki_use_cctk_bbox = kind(cctk_bbox)
  REAL*8 cctk_delta_time
  integer, parameter :: cctki_use_cctk_delta_time = kind(cctk_delta_time)
  REAL*8 cctk_time
  integer, parameter :: cctki_use_cctk_time = kind(cctk_time)
  REAL*8 cctk_delta_space (cctk_dim)
  integer, parameter :: cctki_use_cctk_delta_space = kind(cctk_delta_space)
  REAL*8 cctk_origin_space (cctk_dim)
  integer, parameter :: cctki_use_cctk_origin_space = kind(cctk_origin_space)
  INTEGER cctk_levfac (cctk_dim)
  integer, parameter :: cctki_use_cctk_levfac = kind(cctk_levfac)
  INTEGER cctk_levoff (cctk_dim)
  integer, parameter :: cctki_use_cctk_levoff = kind(cctk_levoff)
  INTEGER cctk_levoffdenom (cctk_dim)
  integer, parameter :: cctki_use_cctk_levoffdenom = kind(cctk_levoffdenom)
  INTEGER cctk_timefac
  integer, parameter :: cctki_use_cctk_timefac = kind(cctk_timefac)
  INTEGER cctk_convlevel
  integer, parameter :: cctki_use_cctk_convlevel = kind(cctk_convlevel)
  INTEGER cctk_convfac
  integer, parameter :: cctki_use_cctk_convfac = kind(cctk_convfac)
  INTEGER cctk_nghostzones (cctk_dim)
  integer, parameter :: cctki_use_cctk_nghostzones = kind(cctk_nghostzones)
  INTEGER cctk_iteration
  integer, parameter :: cctki_use_cctk_iteration = kind(cctk_iteration)
  integer*8 cctkGH
  integer, parameter :: cctki_use_cctkGH = kind(cctkGH)
  INTEGER cctk_ash1
  integer, parameter :: cctki_use_cctk_ash1 = kind(cctk_ash1)
  INTEGER cctk_ash2
  integer, parameter :: cctki_use_cctk_ash2 = kind(cctk_ash2)
  INTEGER cctk_ash3
  integer, parameter :: cctki_use_cctk_ash3 = kind(cctk_ash3)
  REAL*8, INTENT(iN), optional :: var2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_var2 = kind(var2)
  integer :: testgroup_length
  INTEGER*4, INTENT(iN), optional :: groupvar1 (cctk_ash1,cctk_ash2,cctk_ash3,testgroup_length)
  integer, parameter :: cctki_use_groupvar1 = kind(groupvar1)
  INTEGER*4, INTENT(iN), optional :: groupvar2 (cctk_ash1,cctk_ash2,cctk_ash3,testgroup_length)
  integer, parameter :: cctki_use_groupvar2 = kind(groupvar2)
  INTEGER*4, INTENT(iN), optional :: groupvar1_p_p (cctk_ash1,cctk_ash2,cctk_ash3,testgroup_length)
  integer, parameter :: cctki_use_groupvar1_p_p = kind(groupvar1_p_p)
  INTEGER*4, INTENT(iN), optional :: groupvar2_p_p (cctk_ash1,cctk_ash2,cctk_ash3,testgroup_length)
  integer, parameter :: cctki_use_groupvar2_p_p = kind(groupvar2_p_p)
  REAL*8, INTENT(iN), optional :: var1 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_var1 = kind(var1)
  REAL*8, INTENT(iN), optional :: var1_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_var1_p = kind(var1_p)
  characTer*8, INTENT(IN), optional :: scalarvar
  integer, parameter :: cctki_use_scalarvar = kind(scalarvar)
  characTer*8, INTENT(IN), optional :: var3_length
  integer, parameter :: cctki_use_var3_length = kind(var3_length)
  characTer*8, INTENT(IN), optional :: x0gridarraygroup
  integer, parameter :: cctki_use_x0gridarraygroup = kind(x0gridarraygroup)
  characTer*8, INTENT(IN), optional :: x1gridarraygroup
  integer, parameter :: cctki_use_x1gridarraygroup = kind(x1gridarraygroup)
  characTer*8, INTENT(IN), optional :: arraycurrentlevelc
  integer, parameter :: cctki_use_arraycurrentlevelc = kind(arraycurrentlevelc)
  characTer*8, INTENT(IN), optional :: arraycurrentlevelf
  integer, parameter :: cctki_use_arraycurrentlevelf = kind(arraycurrentlevelf)
  characTer*8, INTENT(IN), optional :: arraysizef
  integer, parameter :: cctki_use_arraysizef = kind(arraysizef)
  characTer*8, INTENT(IN), optional :: groupcurrentlevelc
  integer, parameter :: cctki_use_groupcurrentlevelc = kind(groupcurrentlevelc)
  characTer*8, INTENT(IN), optional :: groupcurrentlevelf
  integer, parameter :: cctki_use_groupcurrentlevelf = kind(groupcurrentlevelf)
  characTer*8, INTENT(IN), optional :: grouppastlevelc
  integer, parameter :: cctki_use_grouppastlevelc = kind(grouppastlevelc)
  characTer*8, INTENT(IN), optional :: grouppastlevelf
  integer, parameter :: cctki_use_grouppastlevelf = kind(grouppastlevelf)
  characTer*8, INTENT(IN), optional :: scalarvarcurrentlevelc
  integer, parameter :: cctki_use_scalarvarcurrentlevelc = kind(scalarvarcurrentlevelc)
  characTer*8, INTENT(IN), optional :: scalarvarcurrentlevelf
  integer, parameter :: cctki_use_scalarvarcurrentlevelf = kind(scalarvarcurrentlevelf)
  characTer*8, INTENT(IN), optional :: unusedgroupisnullc
  integer, parameter :: cctki_use_unusedgroupisnullc = kind(unusedgroupisnullc)
  characTer*8, INTENT(IN), optional :: unusedgroupisnullf
  integer, parameter :: cctki_use_unusedgroupisnullf = kind(unusedgroupisnullf)
  characTer*8, INTENT(IN), optional :: unusedvar
  integer, parameter :: cctki_use_unusedvar = kind(unusedvar)
  characTer*8, INTENT(IN), optional :: unusedvarisnullc
  integer, parameter :: cctki_use_unusedvarisnullc = kind(unusedvarisnullc)
  characTer*8, INTENT(IN), optional :: unusedvarisnullf
  integer, parameter :: cctki_use_unusedvarisnullf = kind(unusedvarisnullf)
  characTer*8, INTENT(IN), optional :: validregionsc
  integer, parameter :: cctki_use_validregionsc = kind(validregionsc)
  characTer*8, INTENT(IN), optional :: validregionsf
  integer, parameter :: cctki_use_validregionsf = kind(validregionsf)
  characTer*8, INTENT(IN), optional :: var3
  integer, parameter :: cctki_use_var3 = kind(var3)
  characTer*8, INTENT(IN), optional :: varcurrentlevelc
  integer, parameter :: cctki_use_varcurrentlevelc = kind(varcurrentlevelc)
  characTer*8, INTENT(IN), optional :: varcurrentlevelf
  integer, parameter :: cctki_use_varcurrentlevelf = kind(varcurrentlevelf)
  characTer*8, INTENT(IN), optional :: varpastlevelc
  integer, parameter :: cctki_use_varpastlevelc = kind(varpastlevelc)
  characTer*8, INTENT(IN), optional :: varpastlevelf
  integer, parameter :: cctki_use_varpastlevelf = kind(varpastlevelf)
  characTer*8, INTENT(IN), optional :: gridarray1
  integer, parameter :: cctki_use_gridarray1 = kind(gridarray1)
  characTer*8, INTENT(IN), optional :: gridarray1_p
  integer, parameter :: cctki_use_gridarray1_p = kind(gridarray1_p)
  characTer*8, INTENT(IN), optional :: gridarray1_p_p
  integer, parameter :: cctki_use_gridarray1_p_p = kind(gridarray1_p_p)
  characTer*8, INTENT(IN), optional :: gridarray2
  integer, parameter :: cctki_use_gridarray2 = kind(gridarray2)
  characTer*8, INTENT(IN), optional :: gridarray2_p
  integer, parameter :: cctki_use_gridarray2_p = kind(gridarray2_p)
  characTer*8, INTENT(IN), optional :: gridarray2_p_p
  integer, parameter :: cctki_use_gridarray2_p_p = kind(gridarray2_p_p)
  characTer*8, INTENT(IN), optional :: groupvar1_p
  integer, parameter :: cctki_use_groupvar1_p = kind(groupvar1_p)
  characTer*8, INTENT(IN), optional :: groupvar2_p
  integer, parameter :: cctki_use_groupvar2_p = kind(groupvar2_p)
  characTer*8, INTENT(IN), optional :: x0rad1
  integer, parameter :: cctki_use_x0rad1 = kind(x0rad1)
  characTer*8, INTENT(IN), optional :: x0rad2
  integer, parameter :: cctki_use_x0rad2 = kind(x0rad2)
  characTer*8, INTENT(IN), optional :: x0rad3
  integer, parameter :: cctki_use_x0rad3 = kind(x0rad3)
  characTer*8, INTENT(IN), optional :: x1rad2
  integer, parameter :: cctki_use_x1rad2 = kind(x1rad2)
  characTer*8, INTENT(IN), optional :: x1rad3
  integer, parameter :: cctki_use_x1rad3 = kind(x1rad3)
  characTer*8, INTENT(IN), optional :: x2rad3
  integer, parameter :: cctki_use_x2rad3 = kind(x2rad3)
  characTer*8, INTENT(IN), optional :: rad1_length
  integer, parameter :: cctki_use_rad1_length = kind(rad1_length)
  characTer*8, INTENT(IN), optional :: rad2_length
  integer, parameter :: cctki_use_rad2_length = kind(rad2_length)
  characTer*8, INTENT(IN), optional :: rad3_length
  integer, parameter :: cctki_use_rad3_length = kind(rad3_length)
  characTer*8, INTENT(IN), optional :: coarse_dx
  integer, parameter :: cctki_use_coarse_dx = kind(coarse_dx)
  characTer*8, INTENT(IN), optional :: coarse_dy
  integer, parameter :: cctki_use_coarse_dy = kind(coarse_dy)
  characTer*8, INTENT(IN), optional :: coarse_dz
  integer, parameter :: cctki_use_coarse_dz = kind(coarse_dz)
  characTer*8, INTENT(IN), optional :: r
  integer, parameter :: cctki_use_r = kind(r)
  characTer*8, INTENT(IN), optional :: rad1
  integer, parameter :: cctki_use_rad1 = kind(rad1)
  characTer*8, INTENT(IN), optional :: rad2
  integer, parameter :: cctki_use_rad2 = kind(rad2)
  characTer*8, INTENT(IN), optional :: rad3
  integer, parameter :: cctki_use_rad3 = kind(rad3)
  characTer*8, INTENT(IN), optional :: x
  integer, parameter :: cctki_use_x = kind(x)
  characTer*8, INTENT(IN), optional :: y
  integer, parameter :: cctki_use_y = kind(y)
  characTer*8, INTENT(IN), optional :: z
  integer, parameter :: cctki_use_z = kind(z)
  INTEGER*4 rad_param
  integer, parameter :: cctki_use_rad_param = kind(rad_param)
  INTEGER*4 radx
  integer, parameter :: cctki_use_radx = kind(radx)
  INTEGER*4 rady
  integer, parameter :: cctki_use_rady = kind(rady)
  INTEGER*4 radz
  integer, parameter :: cctki_use_radz = kind(radz)
  COMMON /TestReadWritepriv/rad_param, radx, rady, radz

  integer :: idx

  
  
  if(PRESENT(Var1)) then
    STOP
  end if

  if(PRESENT(Var1_p)) then
    STOP
  end if

  if(PRESENT(Var2)) then
    STOP
  end if

  if(PRESENT(groupVar1)) then
    STOP
  end if

  if(PRESENT(groupVar2)) then
    STOP
  end if

  if(PRESENT(groupVar1_p_p)) then
    STOP
  end if

  if(PRESENT(groupVar2_p_p)) then
    STOP
  end if

  if(PRESENT(UnusedVar)) then
    STOP
  end if

  idx = INDEX(UnusedVar, "")
end subroutine
