Changeset 600


Ignore:
Timestamp:
04/16/11 19:38:57 (2 years ago)
Author:
micael
Message:
  • 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
  • trunk/src/ps_io.F90

    r599 r600  
    687687    !Mesh 
    688688    call mesh_null(new_m) 
    689     call mesh_init(new_m, MESH_LOG1, MESH_CUBIC_SPLINE, info%m%r(1), info%m%r(info%m%np), np=info%m%np) 
     689    call mesh_init(new_m, MESH_LOG1, MESH_FINITE_DIFF, info%m%r(1), info%m%r(info%m%np), np=info%m%np, fd_order=4) 
    690690 
    691691    !Header 
     
    758758    integer, intent(in) :: unit 
    759759 
    760     integer :: values(8) 
     760    integer :: i, values(8) 
     761    real(R8) :: rc 
    761762    character(60) :: header 
    762763 
     
    782783          ixc_to_abinit(info%ixc), maxval(info%psp_l), info%kb_l_local, info%m%np, 0.0 
    783784    if (info%nlcc) then 
    784       write(unit,'(3F20.14,T64,A)') info%nlcc_rc, 1.0, 0.0, 'rchrg,fchrg,qchrg' 
     785      do i = info%m%np, 1, -1 
     786        if (info%rho_core(i) > 1.e-6) then 
     787          rc = info%m%r(i) 
     788          exit 
     789        end if 
     790      end do 
     791      write(unit,'(3F20.14,T64,A)') rc, 1.0, M_FOUR*M_PI*mesh_integrate(info%m, info%rho_core), 'rchrg,fchrg,qchrg' 
    785792    else 
    786793      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.