Revision 5 src/Egrad.f90

Egrad.f90 (revision 5)
163 163
!  write(*,*) "Coucou 4-mixed"
164 164
     Call Mixed2Cart(Nat,indzmat,geom,GeomCart)
165 165
  CASE ('CART')
166
!  write(*,*) "Coucou 4-cart"
167
     if (debug) WRITE(*,*) "Coord=CART... in egrad"
166

  
168 167
     GeomCart=reshape(Geom,(/Nat,3/))
169
     DO Iat=1,Nat
170
        WRITE(IOTMP,'(1X,A10,3(1X,F15.8),A)') Trim(AtName(Iat)),Geom(3*Iat-2:3*Iat)
171
     END DO
168
     if (debug) THEN
169
        WRITE(*,*) "Coord=CART... in egrad"
170
        DO Iat=1,Nat
171
           WRITE(IOTMP,'(1X,A10,3(1X,F15.8),A)') Trim(AtName(Iat)),Geom(3*Iat-2:3*Iat)
172
        END DO
173
     END IF
172 174
  CASE ('HYBRID')
173 175
!  write(*,*) "Coucou 4-hybrid"
174 176
        GeomCart=reshape(Geom,(/Nat,3/))
......
195 197
     Call egrad_mopac(E,GeomCart,GradCart)
196 198
  CASE ('VASP')
197 199
     Call egrad_vasp(E,Geomcart,GradCart)
200
  CASE ('SIESTA')
201
     Call egrad_siesta(E,Geomcart,GradCart)
198 202
  CASE ('TURBOMOLE')
199 203
     Call egrad_turbomole(E,Geomcart,GradCart)
200 204
  CASE ('EXT')
201 205
     Call egrad_ext(E,Geomcart,GradCart)
202 206
  CASE ('TEST')
203 207
     Call egrad_test(Nat,E,Geomcart,GradCart)
208
  CASE ('TEST2D')
209
     Call egrad_test_2D(Nat,E,Geomcart,GradCart)
204 210
  CASE ('CHAMFRE')
205 211
     Call egrad_chamfre(Nat,E,Geomcart,GradCart)
206 212
  CASE ('LEPS')
......
435 441
              Grad(7)=GradTmp(7)
436 442
              Grad(8)=GradTmp(8)
437 443
              Idx=9
438
              IBeg=4
444
               IBeg=4
439 445
            CASE DEFAULT
440 446
               Idx=1
441 447
               IBeg=1
......
448 454
     END DO
449 455
     DEALLOCATE(GradTmp)
450 456
  CASE ("CART","HYBRID")
451
     Grad=GradCart
457
! PFL 2013 Feb 
458
! We could think of just doing:
459
!     Grad=GradCart
460
! however, this does not work as implicitly we have :
461
! Grad(Nat,3)  BUT GradCar(3,Nat)
462
! So we have to use reshape :-(
463
     Grad=reshape(reshape(GradCart,(/3,Nat/),ORDER=(/2,1/)),(/3*Nat/))
452 464
  CASE DEFAULT
453 465
     WRITE(*,*) "Coord=",AdjustL(Trim(COORD))," not yet implemented in Egradients. STOP"
454 466
     STOP

Also available in: Unified diff