CP2K 2.4 (Revision 12889)

ep_qs_methods.f90

Go to the documentation of this file.
00001 !-----------------------------------------------------------------------------!
00002 !   CP2K: A general program to perform molecular dynamics simulations         !
00003 !   Copyright (C) 2000 - 2013  CP2K developers group                          !
00004 !-----------------------------------------------------------------------------!
00005 
00006 ! *****************************************************************************
00012 MODULE ep_qs_methods
00013   USE ep_qs_types,                     ONLY: ep_qs_type
00014   USE f77_blas
00015   USE kinds,                           ONLY: dp
00016   USE qs_environment_types,            ONLY: qs_environment_type
00017   USE timings,                         ONLY: timeset,&
00018                                              timestop
00019 #include "cp_common_uses.h"
00020 
00021   IMPLICIT NONE
00022   PRIVATE
00023 
00024   CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'ep_qs_methods'
00025   INTEGER, SAVE, PRIVATE :: last_ep_qs_id=0
00026 
00027   PUBLIC :: ep_qs_create
00028 
00029 CONTAINS
00030 
00031 ! *****************************************************************************
00039 SUBROUTINE ep_qs_create(ep_qs_env,qs_env,error)
00040     TYPE(ep_qs_type), POINTER                :: ep_qs_env
00041     TYPE(qs_environment_type), POINTER       :: qs_env
00042     TYPE(cp_error_type), INTENT(inout)       :: error
00043 
00044     CHARACTER(len=*), PARAMETER :: routineN = 'ep_qs_create', 
00045       routineP = moduleN//':'//routineN
00046 
00047     INTEGER                                  :: handle, stat
00048     LOGICAL                                  :: failure
00049 
00050   failure=.FALSE.
00051 
00052   CALL timeset(routineN,handle)
00053   CPPrecondition(.NOT.ASSOCIATED(ep_qs_env),cp_failure_level,routineP,error,failure)
00054   IF (.NOT.failure) THEN
00055      ALLOCATE(ep_qs_env,stat=stat)
00056      CPPostcondition(stat==0,cp_fatal_level,routineP,error,failure)
00057      last_ep_qs_id=last_ep_qs_id+1
00058      ep_qs_env%id_nr=last_ep_qs_id
00059      ep_qs_env%ref_count=1
00060      NULLIFY(ep_qs_env%dH_coeffs,ep_qs_env%dS_coeffs)
00061      ep_qs_env%tot_rho=0._dp
00062      ep_qs_env%core_energy=0._dp
00063      ep_qs_env%ep_active=.FALSE.
00064   END IF
00065   CALL timestop(handle)
00066 END SUBROUTINE ep_qs_create
00067 
00068 END MODULE ep_qs_methods