Changeset 604


Ignore:
Timestamp:
06/26/11 18:03:07 (2 years ago)
Author:
micael
Message:

Backport of #600

  • Bug fixed: the definition of the core charge radius in the Abinit file format is in fact the radius at which the core density vanishes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1.x/src/ps_io.F90

    r471 r604  
    718718    integer, intent(in) :: unit 
    719719 
    720     integer :: values(8) 
     720    integer :: i, values(8) 
     721    real(R8) :: rc 
    721722    type(mesh_type) :: new_m 
    722723    character(60) :: header 
     
    745746          ixc_to_abinit(info%ixc), maxval(info%psp_l), info%kb_l_local, new_m%np, 0.0 
    746747    if (info%nlcc) then 
    747       write(unit,'(3F20.14,T64,A)') info%nlcc_rc, 1.0, 0.0, 'rchrg,fchrg,qchrg' 
     748      do i = info%m%np, 1, -1  
     749        if (info%rho_core(i) > 1.e-6) then  
     750          rc = info%m%r(i)  
     751          exit  
     752        end if 
     753      end do 
     754      write(unit,'(3F20.14,T64,A)') rc, 1.0, & 
     755           M_FOUR*M_PI*spline_integ(info%m%np, info%m%r, info%rho_core*info%m%r**2, M_ZERO, info%m%r(info%m%np), 3), & 
     756           'rchrg,fchrg,qchrg' 
    748757    else 
    749758      write(unit,'(3F20.14,T64,A)') 0.0, 0.0, 0.0, 'rchrg,fchrg,qchrg' 
Note: See TracChangeset for help on using the changeset viewer.