mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-27 21:55:16 -04:00
Improving docs for EAM file format (full description of the file format),
allowing a different number of points than the hardcoded 5000 for EAM potentials: this means that the old CU.pot may break old cp2k version. Please use an updated one! Most important: using the parser to parse the EAM pot file svn-origin-rev: 7669
This commit is contained in:
parent
8c4b4f8174
commit
9837babafe
8 changed files with 144 additions and 173 deletions
|
|
@ -23,7 +23,6 @@ MODULE force_fields_input
|
|||
Yamada2000,&
|
||||
cite_reference
|
||||
USE convert_units, ONLY: convert_to_cp2k_units
|
||||
USE cp_files, ONLY: open_file
|
||||
USE cp_output_handling, ONLY: cp_print_key_finished_output,&
|
||||
cp_print_key_unit_nr
|
||||
USE cp_para_types, ONLY: cp_para_env_type
|
||||
|
|
@ -51,7 +50,6 @@ MODULE force_fields_input
|
|||
USE kinds, ONLY: default_string_length,&
|
||||
dp
|
||||
USE memory_utilities, ONLY: reallocate
|
||||
USE message_passing, ONLY: mp_bcast
|
||||
USE pair_potential_types, ONLY: &
|
||||
b4_type, bm_type, do_potential_single_allocation, ea_type, &
|
||||
eam_pot_type, ft_pot_type, ft_type, gp_type, gw_type, ip_type, &
|
||||
|
|
@ -1360,8 +1358,6 @@ CPSourceFileRef,&
|
|||
CALL parser_get_next_line(parser,1,error=error)
|
||||
CALL parser_get_object(parser,ntype,error=error)
|
||||
CALL reallocate(namearray,1,ntype)
|
||||
!ALLOCATE(namearray(ntype),stat=stat)
|
||||
!CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
DO itype=1,ntype
|
||||
CALL parser_get_next_line(parser,1,error=error)
|
||||
CALL parser_get_object(parser,namearray(itype),lower_to_upper=.TRUE.,error=error)
|
||||
|
|
@ -1981,148 +1977,65 @@ CPSourceFileRef,&
|
|||
CHARACTER(len=*), PARAMETER :: routineN = 'read_eam_data', &
|
||||
routineP = moduleN//':'//routineN
|
||||
|
||||
CHARACTER(len=default_string_length) :: title3
|
||||
INTEGER :: handle, i, iw, ntyp, stat, &
|
||||
unit_number
|
||||
INTEGER :: handle, i, iw
|
||||
LOGICAL :: failure
|
||||
REAL(KIND=dp) :: acutal, drar, drhoar, rlatt, &
|
||||
rmass
|
||||
REAL(KINd=dp), DIMENSION(:), POINTER :: frho, frhop, phi, phip, rho, &
|
||||
rhop, rhoval, rval
|
||||
TYPE(cp_logger_type), POINTER :: logger
|
||||
TYPE(cp_parser_type), POINTER :: parser
|
||||
|
||||
CALL timeset(routineN,'I','',handle)
|
||||
failure = .FALSE.
|
||||
NULLIFY(parser, logger)
|
||||
logger => cp_error_get_logger(error)
|
||||
iw = cp_print_key_unit_nr(logger,mm_section,"PRINT%FF_INFO",&
|
||||
extension=".mmLog",error=error)
|
||||
NULLIFY ( rval, rhoval, phi, phip, frho, frhop, rho, rhop )
|
||||
IF (.NOT.failure) THEN
|
||||
IF ( para_env%ionode ) THEN
|
||||
ALLOCATE ( rho ( 5000 ), STAT = stat )
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
rho=0.0_dp
|
||||
ALLOCATE ( rhop ( 5000 ), STAT = stat )
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
rhop=0.0_dp
|
||||
ALLOCATE ( rval ( 5000 ), STAT = stat )
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
rval=0.0_dp
|
||||
ALLOCATE ( rhoval ( 5000 ), STAT = stat )
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
rhoval=0.0_dp
|
||||
ALLOCATE ( phi ( 5000 ), STAT = stat )
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
phi=0.0_dp
|
||||
ALLOCATE ( phip ( 5000 ), STAT = stat )
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
phip=0.0_dp
|
||||
ALLOCATE ( frho ( 5000 ), STAT = stat )
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
frho=0.0_dp
|
||||
ALLOCATE ( frhop ( 5000 ), STAT = stat )
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
frhop=0.0_dp
|
||||
IF (iw>0) WRITE ( iw, * ) "Reading EAM data from: ",TRIM(eam%eam_file_name)
|
||||
CALL parser_create(parser,TRIM(eam%eam_file_name),para_env=para_env,error=error)
|
||||
|
||||
CALL open_file(file_name=TRIM(eam % eam_file_name),&
|
||||
file_form="FORMATTED",&
|
||||
file_position="REWIND",&
|
||||
file_status="OLD",&
|
||||
unit_number=unit_number)
|
||||
READ ( unit_number, '(A72)' ) title3
|
||||
IF (iw>0) THEN
|
||||
WRITE ( iw, * ) "Reading EAM data from: ",TRIM(eam % eam_file_name)
|
||||
WRITE ( iw, * ) "Title: ",title3
|
||||
END IF
|
||||
READ ( unit_number, * ) ntyp,rmass,rlatt
|
||||
CALL parser_get_next_line(parser,1,error=error)
|
||||
IF (iw>0) WRITE(iw,*) "Title: ",parser%input_line
|
||||
|
||||
READ ( unit_number, * ) drar, drhoar, acutal
|
||||
CALL convert_to_cp2k_units ( "ANGSTROM", length = drar )
|
||||
CALL convert_to_cp2k_units ( "ANGSTROM", length = acutal )
|
||||
CALL parser_get_next_line(parser,2,error=error)
|
||||
READ(parser%input_line,*) eam%drar, eam%drhoar, eam%acutal, eam%npoints
|
||||
CALL convert_to_cp2k_units ("ANGSTROM",length=eam%drar )
|
||||
CALL convert_to_cp2k_units ("ANGSTROM",length=eam%acutal )
|
||||
! Relocating arrays with the right size
|
||||
CALL reallocate(eam%rho, 1, eam%npoints)
|
||||
CALL reallocate(eam%rhop, 1, eam%npoints)
|
||||
CALL reallocate(eam%rval, 1, eam%npoints)
|
||||
CALL reallocate(eam%rhoval, 1, eam%npoints)
|
||||
CALL reallocate(eam%phi, 1, eam%npoints)
|
||||
CALL reallocate(eam%phip, 1, eam%npoints)
|
||||
CALL reallocate(eam%frho, 1, eam%npoints)
|
||||
CALL reallocate(eam%frhop, 1, eam%npoints)
|
||||
! Reading density and derivative of density (with respect to r)
|
||||
DO i = 1,eam%npoints
|
||||
CALL parser_get_next_line(parser,1,error=error)
|
||||
READ (parser%input_line,*) eam%rho(i), eam%rhop(i)
|
||||
CALL convert_to_cp2k_units ("ANGSTROM",length=eam%rhop(i), l_power=-1 )
|
||||
eam%rval(i) = REAL(i-1,KIND=dp)*eam%drar
|
||||
eam%rhoval(i) = REAL(i-1,KIND=dp)*eam%drhoar
|
||||
END DO
|
||||
! Reading pair potential PHI and its derivative (with respect to r)
|
||||
DO i = 1,eam%npoints
|
||||
CALL parser_get_next_line(parser,1,error=error)
|
||||
READ (parser%input_line,*) eam%phi(i), eam%phip(i)
|
||||
CALL convert_to_cp2k_units ("EV",energy=eam%phi(i))
|
||||
CALL convert_to_cp2k_units ("EV",energy=eam%phip(i))
|
||||
CALL convert_to_cp2k_units ("ANGSTROM",length=eam%phip(i),l_power=-1)
|
||||
END DO
|
||||
! Reading embedded function and its derivative (with respect to density)
|
||||
DO i = 1,eam%npoints
|
||||
CALL parser_get_next_line(parser,1,error=error)
|
||||
READ (parser%input_line,*) eam%frho(i), eam%frhop(i)
|
||||
CALL convert_to_cp2k_units ("EV",energy=eam%frho(i))
|
||||
CALL convert_to_cp2k_units ("EV",energy=eam%frhop(i))
|
||||
END DO
|
||||
|
||||
DO i = 1,5000
|
||||
READ ( unit_number, * ) rho(i), rhop(i)
|
||||
CALL convert_to_cp2k_units ( "ANGSTROM", length = rhop ( i ), l_power = -1 )
|
||||
rval(i) = REAL ( i-1 ) * drar
|
||||
rhoval(i) = REAL ( i-1 )* drhoar
|
||||
END DO
|
||||
!
|
||||
DO i = 1,5000
|
||||
READ ( unit_number, * ) phi(i), phip(i)
|
||||
CALL convert_to_cp2k_units ( "EV", energy = phi ( i ) )
|
||||
CALL convert_to_cp2k_units ( "EV", energy = phip ( i ) )
|
||||
CALL convert_to_cp2k_units ( "ANGSTROM", length = phip ( i ), l_power = -1 )
|
||||
END DO
|
||||
!
|
||||
DO i = 1,5000
|
||||
READ ( unit_number, * ) frho(i), frhop(i)
|
||||
CALL convert_to_cp2k_units ( "EV", energy = frho ( i ) )
|
||||
CALL convert_to_cp2k_units ( "EV", energy = frhop ( i ) )
|
||||
END DO
|
||||
!
|
||||
IF (iw>0) WRITE ( iw, * ) 'Finished EAM data'
|
||||
CLOSE ( unit_number )
|
||||
ENDIF
|
||||
CALL mp_bcast ( drar, para_env%source, para_env % group )
|
||||
CALL mp_bcast ( drhoar, para_env % source, para_env % group )
|
||||
CALL mp_bcast ( acutal, para_env % source, para_env % group )
|
||||
|
||||
eam % drar = drar
|
||||
eam % drhoar = drhoar
|
||||
eam % acutal = acutal
|
||||
|
||||
CALL reallocate ( rho, 1, 5000 )
|
||||
CALL mp_bcast ( rho, para_env%source, para_env%group )
|
||||
|
||||
CALL reallocate ( rhop, 1, 5000 )
|
||||
CALL mp_bcast ( rhop, para_env%source, para_env%group )
|
||||
|
||||
CALL reallocate ( rval, 1, 5000 )
|
||||
CALL mp_bcast ( rval, para_env%source, para_env%group )
|
||||
|
||||
CALL reallocate ( rhoval, 1, 5000 )
|
||||
CALL mp_bcast ( rhoval, para_env%source, para_env%group )
|
||||
|
||||
CALL reallocate ( phi, 1, 5000 )
|
||||
CALL mp_bcast ( phi, para_env%source, para_env%group )
|
||||
|
||||
CALL reallocate ( phip, 1, 5000 )
|
||||
CALL mp_bcast ( phip, para_env%source, para_env%group )
|
||||
|
||||
CALL reallocate ( frho, 1, 5000 )
|
||||
CALL mp_bcast ( frho, para_env%source, para_env%group )
|
||||
|
||||
CALL reallocate ( frhop, 1, 5000 )
|
||||
CALL mp_bcast ( frhop, para_env%source, para_env%group )
|
||||
|
||||
eam % rho = rho
|
||||
eam % rhop = rhop
|
||||
eam % rval = rval
|
||||
eam % rhoval = rhoval
|
||||
eam % phi = phi
|
||||
eam % phip = phip
|
||||
eam % frho = frho
|
||||
eam % frhop = frhop
|
||||
|
||||
DEALLOCATE ( rho, STAT = stat )
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
DEALLOCATE ( rhop, STAT = stat )
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
DEALLOCATE ( rval, STAT = stat )
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
DEALLOCATE ( rhoval, STAT = stat )
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
DEALLOCATE ( phi, STAT = stat )
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
DEALLOCATE ( phip, STAT = stat )
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
DEALLOCATE ( frho, STAT = stat )
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
DEALLOCATE ( frhop, STAT = stat )
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
END IF
|
||||
CALL cp_print_key_finished_output(iw,logger,mm_section,&
|
||||
"PRINT%FF_INFO",error=error)
|
||||
IF (iw>0) WRITE(iw,*)"Finished EAM data"
|
||||
CALL parser_release(parser,error=error)
|
||||
END IF
|
||||
CALL cp_print_key_finished_output(iw,logger,mm_section,"PRINT%FF_INFO",error=error)
|
||||
CALL timestop(0.0_dp,handle)
|
||||
|
||||
END SUBROUTINE read_eam_data
|
||||
|
|
|
|||
|
|
@ -1196,7 +1196,16 @@ CONTAINS
|
|||
|
||||
CALL keyword_create(keyword, name="PARM_FILE_NAME",&
|
||||
variants=(/"PARMFILE"/),&
|
||||
description="Specifies the filename that contains the parameters of the EAM FF.",&
|
||||
description="Specifies the filename that contains the tabulated EAM potential. "//&
|
||||
"File structure: the first line of the potential file contains a title. "//&
|
||||
"The second line contains: atomic number, mass and lattice constant. "//&
|
||||
"These information are parsed but not used in CP2K. The third line contains: "//&
|
||||
"dr: increment of r for the tabulated values of density and phi (assuming r starts in 0) [angstrom]; "//&
|
||||
"drho: increment of density for the tabulated values of the embedding function (assuming rho starts "//&
|
||||
"in 0) [au_c]; cutoff: cutoff of the EAM potential; npoints: number of points in tabulated. Follow "//&
|
||||
"in order npoints lines for rho [au_c] and its derivative [au_c*angstrom^-1]; npoints lines for "//&
|
||||
"PHI [ev] and its derivative [ev*angstrom^-1] and npoint lines for the embedded function [ev] "//&
|
||||
"and its derivative [ev*au_c^-1].",&
|
||||
usage="PARM_FILE_NAME {FILENAME}",default_lc_val=" ",error=error)
|
||||
CALL section_add_keyword(section,keyword,error=error)
|
||||
CALL keyword_release(keyword,error=error)
|
||||
|
|
|
|||
|
|
@ -149,8 +149,8 @@ CONTAINS
|
|||
rab = SQRT ( rab2 )
|
||||
index = INT ( rab / eam % drar ) + 1
|
||||
|
||||
IF ( index > 5000 ) THEN
|
||||
index = 5000
|
||||
IF ( index > eam%npoints) THEN
|
||||
index = eam%npoints
|
||||
ELSEIF ( index < 1 ) THEN
|
||||
index = 1
|
||||
ENDIF
|
||||
|
|
@ -186,8 +186,8 @@ CONTAINS
|
|||
rab = SQRT ( rab2 )
|
||||
index = INT ( rab / eam % drar ) + 1
|
||||
|
||||
IF ( index > 5000 ) THEN
|
||||
index = 5000
|
||||
IF ( index > eam%npoints ) THEN
|
||||
index = eam%npoints
|
||||
ELSEIF ( index < 1 ) THEN
|
||||
index = 1
|
||||
ENDIF
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ CONTAINS
|
|||
DO iparticle_local=1,nparticle_local
|
||||
iparticle = local_particles%list(ikind)%array(iparticle_local)
|
||||
index = INT ( particle_set(iparticle)%rho / eam%drhoar) + 1
|
||||
IF ( index > 4999 ) index = 5000
|
||||
IF ( index > eam%npoints-1 ) index = eam%npoints
|
||||
qr = particle_set(iparticle)%rho - eam%rhoval(index)
|
||||
|
||||
embed = eam%frho(index) + qr*eam%frhop(index)
|
||||
|
|
|
|||
|
|
@ -722,7 +722,7 @@ CPSourceFileRef,&
|
|||
CASE (gw_type)
|
||||
nvar = 5 + nvar
|
||||
CASE (ea_type)
|
||||
nvar = 3 + nvar
|
||||
nvar = 4 + nvar
|
||||
CASE (ft_type)
|
||||
nvar = 4 + nvar
|
||||
CASE (ip_type)
|
||||
|
|
@ -793,6 +793,7 @@ CPSourceFileRef,&
|
|||
pot_par(nk,1) = potparm%pot(i,j)%pot%set(1)%eam%drar
|
||||
pot_par(nk,2) = potparm%pot(i,j)%pot%set(1)%eam%drhoar
|
||||
pot_par(nk,3) = potparm%pot(i,j)%pot%set(1)%eam%acutal
|
||||
pot_par(nk,4) = potparm%pot(i,j)%pot%set(1)%eam%npoints
|
||||
CASE (ft_type)
|
||||
pot_par(nk,1) = potparm%pot(i,j)%pot%set(1)%ft%A
|
||||
pot_par(nk,2) = potparm%pot(i,j)%pot%set(1)%ft%B
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ MODULE pair_potential_types
|
|||
USE kinds, ONLY: default_path_length,&
|
||||
default_string_length,&
|
||||
dp
|
||||
USE memory_utilities, ONLY: reallocate
|
||||
USE splines_types, ONLY: spline_data_p_copy,&
|
||||
spline_data_p_release,&
|
||||
spline_data_p_type,&
|
||||
|
|
@ -140,10 +141,11 @@ MODULE pair_potential_types
|
|||
|
||||
! *****************************************************************************
|
||||
TYPE eam_pot_type
|
||||
CHARACTER ( len = default_path_length ) :: eam_file_name
|
||||
REAL ( KIND = dp ) :: drar, drhoar, acutal
|
||||
REAL ( KIND = dp ), DIMENSION ( 5000 ) :: rho, phi, frho, rhoval, rval
|
||||
REAL ( KIND = dp ), DIMENSION ( 5000 ) :: rhop, phip, frhop
|
||||
CHARACTER (LEN=default_path_length) :: eam_file_name
|
||||
INTEGER :: npoints
|
||||
REAL (KIND=dp) :: drar, drhoar, acutal
|
||||
REAL (KIND=dp),POINTER, DIMENSION(:) :: rho, phi, frho, rhoval, rval
|
||||
REAL (KIND=dp),POINTER, DIMENSION(:) :: rhop, phip, frhop
|
||||
END TYPE eam_pot_type
|
||||
|
||||
! *****************************************************************************
|
||||
|
|
@ -301,17 +303,20 @@ CONTAINS
|
|||
(pot1%set(i)%goodwin%d ==pot2%set(i)%goodwin%d ).AND.&
|
||||
(pot1%set(i)%goodwin%dc ==pot2%set(i)%goodwin%dc )) mycompare=.TRUE.
|
||||
CASE (ea_type)
|
||||
IF ((pot1%set(i)%eam%drar ==pot2%set(i)%eam%drar ).AND.&
|
||||
(pot1%set(i)%eam%drhoar==pot2%set(i)%eam%drhoar).AND.&
|
||||
(pot1%set(i)%eam%acutal==pot2%set(i)%eam%acutal).AND.&
|
||||
(SUM(ABS(pot1%set(i)%eam%rho -pot2%set(i)%eam%rho ))==0.0_dp).AND.&
|
||||
(SUM(ABS(pot1%set(i)%eam%phi -pot2%set(i)%eam%phi ))==0.0_dp).AND.&
|
||||
(SUM(ABS(pot1%set(i)%eam%frho -pot2%set(i)%eam%frho ))==0.0_dp).AND.&
|
||||
(SUM(ABS(pot1%set(i)%eam%rhoval-pot2%set(i)%eam%rhoval))==0.0_dp).AND.&
|
||||
(SUM(ABS(pot1%set(i)%eam%rval -pot2%set(i)%eam%rval ))==0.0_dp).AND.&
|
||||
(SUM(ABS(pot1%set(i)%eam%rhop -pot2%set(i)%eam%rhop ))==0.0_dp).AND.&
|
||||
(SUM(ABS(pot1%set(i)%eam%phip -pot2%set(i)%eam%phip ))==0.0_dp).AND.&
|
||||
(SUM(ABS(pot1%set(i)%eam%frhop -pot2%set(i)%eam%frhop ))==0.0_dp)) mycompare=.TRUE.
|
||||
! Compare only if EAM have the same number of points
|
||||
IF (pot1%set(i)%eam%npoints==pot2%set(i)%eam%npoints) THEN
|
||||
IF ((pot1%set(i)%eam%drar ==pot2%set(i)%eam%drar ).AND.&
|
||||
(pot1%set(i)%eam%drhoar ==pot2%set(i)%eam%drhoar).AND.&
|
||||
(pot1%set(i)%eam%acutal ==pot2%set(i)%eam%acutal).AND.&
|
||||
(SUM(ABS(pot1%set(i)%eam%rho -pot2%set(i)%eam%rho ))==0.0_dp).AND.&
|
||||
(SUM(ABS(pot1%set(i)%eam%phi -pot2%set(i)%eam%phi ))==0.0_dp).AND.&
|
||||
(SUM(ABS(pot1%set(i)%eam%frho -pot2%set(i)%eam%frho ))==0.0_dp).AND.&
|
||||
(SUM(ABS(pot1%set(i)%eam%rhoval-pot2%set(i)%eam%rhoval))==0.0_dp).AND.&
|
||||
(SUM(ABS(pot1%set(i)%eam%rval -pot2%set(i)%eam%rval ))==0.0_dp).AND.&
|
||||
(SUM(ABS(pot1%set(i)%eam%rhop -pot2%set(i)%eam%rhop ))==0.0_dp).AND.&
|
||||
(SUM(ABS(pot1%set(i)%eam%phip -pot2%set(i)%eam%phip ))==0.0_dp).AND.&
|
||||
(SUM(ABS(pot1%set(i)%eam%frhop -pot2%set(i)%eam%frhop ))==0.0_dp)) mycompare=.TRUE.
|
||||
END IF
|
||||
CASE (ft_type)
|
||||
IF ((pot1%set(i)%ft%A==pot2%set(i)%ft%A).AND.&
|
||||
(pot1%set(i)%ft%B==pot2%set(i)%ft%B).AND.&
|
||||
|
|
@ -1520,6 +1525,8 @@ CONTAINS
|
|||
CPPostcondition(.NOT.ASSOCIATED(eam),cp_failure_level,routineP,error,failure)
|
||||
ALLOCATE(eam, stat=stat)
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
NULLIFY(eam%rho, eam%phi, eam%frho, eam%rhoval, eam%rval,&
|
||||
eam%rhop, eam%phip, eam%frhop)
|
||||
CALL pair_potential_eam_clean(eam, error=error)
|
||||
END IF
|
||||
END SUBROUTINE pair_potential_eam_create
|
||||
|
|
@ -1546,6 +1553,16 @@ CONTAINS
|
|||
eam_dest%drar = eam_source%drar
|
||||
eam_dest%drhoar = eam_source%drhoar
|
||||
eam_dest%acutal = eam_source%acutal
|
||||
eam_dest%npoints = eam_source%npoints
|
||||
! Allocate arrays with the proper size
|
||||
CALL reallocate(eam_dest%rho, 1, eam_dest%npoints)
|
||||
CALL reallocate(eam_dest%rhop, 1, eam_dest%npoints)
|
||||
CALL reallocate(eam_dest%phi, 1, eam_dest%npoints)
|
||||
CALL reallocate(eam_dest%phip, 1, eam_dest%npoints)
|
||||
CALL reallocate(eam_dest%frho, 1, eam_dest%npoints)
|
||||
CALL reallocate(eam_dest%frhop, 1, eam_dest%npoints)
|
||||
CALL reallocate(eam_dest%rval, 1, eam_dest%npoints)
|
||||
CALL reallocate(eam_dest%rhoval,1, eam_dest%npoints)
|
||||
eam_dest%rho = eam_source%rho
|
||||
eam_dest%phi = eam_source%phi
|
||||
eam_dest%frho = eam_source%frho
|
||||
|
|
@ -1577,15 +1594,15 @@ CONTAINS
|
|||
eam%drar = 0.0_dp
|
||||
eam%drhoar = 0.0_dp
|
||||
eam%acutal = 0.0_dp
|
||||
! Arrays
|
||||
eam%rho = 0.0_dp
|
||||
eam%phi = 0.0_dp
|
||||
eam%frho = 0.0_dp
|
||||
eam%rhoval = 0.0_dp
|
||||
eam%rval = 0.0_dp
|
||||
eam%rhop = 0.0_dp
|
||||
eam%phip = 0.0_dp
|
||||
eam%frhop = 0.0_dp
|
||||
eam%npoints = 0
|
||||
CALL reallocate(eam%rho, 1, eam%npoints)
|
||||
CALL reallocate(eam%rhop, 1, eam%npoints)
|
||||
CALL reallocate(eam%phi, 1, eam%npoints)
|
||||
CALL reallocate(eam%phip, 1, eam%npoints)
|
||||
CALL reallocate(eam%frho, 1, eam%npoints)
|
||||
CALL reallocate(eam%frhop, 1, eam%npoints)
|
||||
CALL reallocate(eam%rval, 1, eam%npoints)
|
||||
CALL reallocate(eam%rhoval,1, eam%npoints)
|
||||
END IF
|
||||
END SUBROUTINE pair_potential_eam_clean
|
||||
|
||||
|
|
@ -1606,10 +1623,41 @@ CONTAINS
|
|||
failure = .FALSE.
|
||||
IF (.NOT.failure) THEN
|
||||
IF (ASSOCIATED(eam)) THEN
|
||||
IF (ASSOCIATED(eam%rho)) THEN
|
||||
DEALLOCATE(eam%rho, stat=stat)
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
END IF
|
||||
IF (ASSOCIATED(eam%rhop)) THEN
|
||||
DEALLOCATE(eam%rhop, stat=stat)
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
END IF
|
||||
IF (ASSOCIATED(eam%phi)) THEN
|
||||
DEALLOCATE(eam%phi, stat=stat)
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
END IF
|
||||
IF (ASSOCIATED(eam%phip)) THEN
|
||||
DEALLOCATE(eam%phip, stat=stat)
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
END IF
|
||||
IF (ASSOCIATED(eam%frho)) THEN
|
||||
DEALLOCATE(eam%frho, stat=stat)
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
END IF
|
||||
IF (ASSOCIATED(eam%frhop)) THEN
|
||||
DEALLOCATE(eam%frhop, stat=stat)
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
END IF
|
||||
IF (ASSOCIATED(eam%rval)) THEN
|
||||
DEALLOCATE(eam%rval, stat=stat)
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
END IF
|
||||
IF (ASSOCIATED(eam%rhoval)) THEN
|
||||
DEALLOCATE(eam%rhoval, stat=stat)
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
END IF
|
||||
DEALLOCATE(eam, stat=stat)
|
||||
CPPostcondition(stat==0,cp_failure_level,routineP,error,failure)
|
||||
END IF
|
||||
NULLIFY(eam)
|
||||
END IF
|
||||
END SUBROUTINE pair_potential_eam_release
|
||||
|
||||
|
|
|
|||
|
|
@ -89,15 +89,15 @@ CONTAINS
|
|||
ELSE IF (pot%type(j)==ft_type) THEN
|
||||
lvalue = pot%set(j)%ft%a*EXP(-pot%set(j)%ft%b*r) - pot%set(j)%ft%c/r**6 - pot%set(j)%ft%d/r**8
|
||||
ELSE IF (pot%type(j)==ea_type) THEN
|
||||
index = INT ( r / pot % set(j) % eam % drar ) + 1
|
||||
IF ( index > 5000 ) THEN
|
||||
index = 5000
|
||||
index = INT ( r / pot%set(j)%eam%drar ) + 1
|
||||
IF ( index > pot%set(j)%eam%npoints ) THEN
|
||||
index = pot%set(j)%eam%npoints
|
||||
ELSEIF ( index < 1 ) THEN
|
||||
index = 1
|
||||
ENDIF
|
||||
qq = r - pot % set(j) % eam % rval (index)
|
||||
pp = pot % set(j) % eam % phi ( index ) + &
|
||||
qq * pot % set(j) % eam % phip ( index )
|
||||
qq = r - pot%set(j)%eam%rval(index)
|
||||
pp = pot%set(j)%eam%phi(index) + &
|
||||
qq * pot%set(j)%eam%phip(index)
|
||||
lvalue = pp
|
||||
ELSE IF (pot%type(j)==b4_type) THEN
|
||||
IF(r<=pot%set(j)%buck4r%r1) THEN
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
cu functions (universal l10)
|
||||
29 63.550 3.6030
|
||||
0.9981995681300759E-03 0.5001000317861326E-04 0.4949999809265137E+01
|
||||
0.9981995681300759E-03 0.5001000317861326E-04 0.4949999809265137E+01 5000
|
||||
0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
1.3944658203125000e+03 1.4491192500000000e+06 1.3944658203125000e+03 1.4491192500000000e+06
|
||||
2.8930205078125000e+03 1.5347635000000000e+06 2.8930205078125000e+03 1.5347635000000000e+06
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue