[CP2K:2683] a bug in the "cls_assign_core_states" subroutine in xas_methods.F

zh vale... at gmail.com
Sat Apr 24 08:43:15 UTC 2010


Dear CPK developers,


For the latest version of cp2k (e.g., 2.1.223), if the value specified
for "STATE_SEARCH" in the XAS calculations is larger than 2, it will
lead to an error message as fellows:

 LOCALIZE| The spread relative to a set of orbitals is computed
 LOCALIZE| Orbitals to be localized: Those with index between
1 and        3
 LOCALIZE| Spread defined by the Berry phase operator
 LOCALIZE| The optimal unitary transformation is generated by the
Jacobi algorithm

         Localize a sub-set of MOs with spin alpha, to better identify
the core states that have to be excited

 The sub-set contains states from       1 to       3
          Spread Functional     sum_in -w_i ln(|z_in|^2)    sum_in
w_i(1-|z_in|^2)
    Initial Spread (Berry) :                   1.3768156742
1.1122317318
         Localization by iterative Jacobi rotation
                      Iteration           Tolerance   Time
               Localization  for spin   1 converged in      2
iterations
          Spread Functional     sum_in -w_i ln(|z_in|^2)    sum_in
w_i(1-|z_in|^2)
    Total Spread (Berry) :                   1.3716326089
1.1086930159
At line 1699 of file /opt/cp2k-2.1.223/makefiles/../src/xas_methods.F
Traceback: (Innermost first)
............
Fortran runtime error: Array element out of bounds: 3 in (1:2), dim=1

By comparing "xas_methods.F" in this new version with the one in the
old version(2.1.81) and testing my following modification, the above
error is caused by that the variables "nexc_search" and "nexc_atoms"
are not assigned before calling them in the subroutine
"cls_assign_core_states".

In the subroutine "cls_assign_core_states", the following places are
needed to be updated:
1.
1664     CALL get_mo_set(mos(1)%mo_set, mo_coeff=mo_coeff,
maxocc=maxocc, nao=nao, homo=homo)
1665
1666     CALL get_xas_env(xas_env=xas_env,&

The following two lines should be added to the line 1665:
              nexc_search = xas_control%nexc_search
              nexc_atoms  = xas_control%nexc_atoms
2.
1695       ! Assign the state to the closest atom
1696       distmin = 100.0_dp
1697
1698       DO iat = 1,nexc_atoms

The line 1698 should be replaced with
               DO iat = 1,xas_control%nexc_atoms

3.
1741   ! In the set of states, assign the index of the state to be
excited for iatom
1742     IF (output_unit>0) THEN
1743           WRITE (UNIT=output_unit,FMT="(/,T10,A,/)")&
1744            "List the atoms to be excited and the relative of MOs
index "
1745     END IF
1746     DO iat = 1,nexc_atoms
1747       iatom = xas_env%exc_atoms(iat)

The lines 1746 and 1747 should be replaced with
              DO iat = 1,xas_control%nexc_atoms
                    iatom = xas_control%exc_atoms(iat)

Please check them.

Best regards
zh

-- 
You received this message because you are subscribed to the Google Groups "cp2k" group.
To post to this group, send email to cp... at googlegroups.com.
To unsubscribe from this group, send email to cp2k+uns... at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cp2k?hl=en.




More information about the CP2K-user mailing list