module com_monit
  use  prm, only : imax, jmax, kmax
  implicit none


  integer, parameter :: limit_2 = 50
  integer, parameter :: limit_3 = 50
  


  INTEGER,SAVE :: mxptr_2
  INTEGER,SAVE :: mxptr_3


  INTEGER,SAVE :: mxptr_nouse_2
  INTEGER,SAVE :: mxptr_nouse_3


  REAL(8),POINTER :: sum_2(:,:,:)
  REAL(8),POINTER :: sum_3(:,:,:,:)


  character(LEN=10), save :: name_2(limit_2)          ! write   name
  character(LEN=10), save :: name_nouse_2(limit_2)    ! nowrite name
  integer,           save :: swch_2(limit_2)          ! write or no write
  character(LEN=3),  save :: tflg_2(limit_2)          ! SNP or AVR


  character(LEN=10), save :: name_3(limit_3)          ! write   name
  character(LEN=10), save :: name_nouse_3(limit_3)    ! nowrite name
  integer, save :: swch_3(limit_3)                    ! write or no write
  character(LEN=3), save :: tflg_3(limit_2)           ! SNP or AVR

contains 

  subroutine com_monit_ini_pre
    implicit none
    mxptr_2 = 0 
    mxptr_3 = 0


    mxptr_nouse_2 = 0 
    mxptr_nouse_3 = 0 



    
  end subroutine com_monit_ini_pre


  subroutine com_monit_ini
    implicit none
    
    allocate( sum_2(imax, jmax, mxptr_2)) 
    allocate( sum_3(imax, jmax, kmax, mxptr_3))
    

    sum_2 = 0.0D0
    sum_3 = 0.0D0
  end subroutine com_monit_ini

end module com_monit
