[Pw_forum] question about constrained magnetization

Gabriele Sclauzero sclauzer at sissa.it
Thu Dec 10 09:02:57 CET 2009


Cyrille Barreteau wrote:
> Dear Gabriele
> 
> The last solution that you provided seems to be the most adapted to my 
> problem.
> The choice of the initial moment is maybe not the most adapted but this 

I think there is a possibility to fix this as well, but I don't know if this solution may 
have any bad side effects.
You should move the check on starting magnetization after reading the pseudopotential, 
i.e. right after

   CALL readpp ()

AND convert from "starting magnetization" to "starting spin polarization" before checking:

   !
   ! ... read pseudopotentials
   !
   CALL readpp()
   !
   DO nt = 1, ntyp
      !
      IF ( starting_magnetization(nt) == sm_not_set ) THEN
         starting_magnetization(nt) = 0.0_dp
      ELSE
         starting_magnetization(nt) = starting_magnetization(nt)/zv(nt)
         IF ( starting_magnetization(nt) > 1.0_dp ) THEN
            starting_magnetization(nt) = 1.0_dp
         ELSE IF ( starting_magnetization(nt) <-1.0_dp ) THEN
            starting_magnetization(nt) =-1.0_dp
         END IF
      END IF
      !
   END DO
   starting_magnetization_ = starting_magnetization

You will also need to include zv from the ions_base module, by substituting

   USE ions_base,     ONLY : if_pos, ityp, tau, extfor, &

with:

   USE ions_base,     ONLY : if_pos, ityp, tau, extfor, zv,&

at the beginning of the subroutine iosys.


Regards,

Gabriele



> not a
> very big problem.. thanks for this very quick fix:-)
> 
> cyrille
> 

-- 


o ------------------------------------------------ o
| Gabriele Sclauzero, PhD Student                  |
| c/o:   SISSA & CNR-INFM Democritos,              |
|        via Beirut 2-4, 34014 Trieste (Italy)     |
| email: sclauzer at sissa.it                         |
| phone: +39 040 3787 511                          |
| skype: gurlonotturno                             |
o ------------------------------------------------ o



More information about the users mailing list