!=======================================================================
!
!  PROGRAM  PHASE/0 2014.01 (rev.375)
!
!  "First-principles Electronic Structure Calculation Program"
!
!  SUBROUINE: Preparation_ep
!
!  AUTHOR(S): T. Yamasaki   August/20/2003
!  
!  Contact address :  Phase System Consortium
!                     E-mail: phase_system@nims.go.jp URL https://azuma.nims.go.jp
!  
!
!
!=======================================================================
!
!   Since 2002, this program set had been intensively developed as a part of the following 
!  national projects supported by the Ministry of Education, Culture, Sports, Science and 
!  Technology (MEXT) of Japan; "Frontier Simulation Software for Industrial Science 
!  (FSIS)" from 2002 to 2005, "Revolutionary Simulation Software (RSS21)" from 2006 to 
!  2008. "Research and Development of Innovative Simulation Software (RISS)" from 2008 
!  to 2013. These projects is lead by the Center for Research on Innovative Simulation 
!  Software (CISS), the Institute of Industrial Science (IIS), the University of Tokyo.
!   Since 2013, this program set has been further developed centering on PHASE System 
!  Consortium. 
!   The activity of development of this program set has been supervised by Takahisa Ohno.
!
subroutine Preparation_ep
! $Id: Preparation_ep.f90 334 2013-07-18 14:15:28Z yamasaki $
  use m_Control_Parameters,only: m_CtrlP_set_wct_start
  use m_Files,             only: nfout
  use m_Crystal_Structure, only: nbztyp_spg, m_CS_alloc_op_tau &
       &                       , m_CS_gnrt_symmetry_operations
  use m_Ionic_System,      only: m_IS_alloc_napt &
       &                       , m_IS_symm_check_of_pos
  use m_Force,             only: m_Force_alloc

  implicit none

  call m_CtrlP_set_wct_start                   !  (ckcput)
!!$  if(nbztyp_spg >= GENERAL) call m_Files_open_
!!$  call m_CS_gnrt_symmetry_operations(.true.,nfout,nfspg)
  call m_CS_gnrt_symmetry_operations(.true.,nfout)
!!$  if(.not.paramset) then
     call m_CS_alloc_op_tau(nfout)
!!$     call m_CS_gnrt_symmetry_operations(.false.,nfout,nfspg)
     call m_CS_gnrt_symmetry_operations(.false.,nfout)
     call m_IS_alloc_napt()
     call m_IS_symm_check_of_pos()
!!$  end if
  call m_Force_alloc()
end subroutine Preparation_ep
