The Elk Code
init0.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2002-2005 J. K. Dewhurst, S. Sharma and C. Ambrosch-Draxl.
3 ! This file is distributed under the terms of the GNU General Public License.
4 ! See the file COPYING for license details.
5 
6 !BOP
7 ! !ROUTINE: init0
8 ! !INTERFACE:
9 subroutine init0
10 ! !USES:
11 use modmain
12 use modxcifc
13 use moddftu
14 use modtddft
15 use modphonon
16 use modulr
17 use modgw
18 use modtest
19 use modvars
20 use modmpi
21 use modomp
22 ! !DESCRIPTION:
23 ! Performs basic consistency checks as well as allocating and initialising
24 ! global variables not dependent on the $k$-point set.
25 !
26 ! !REVISION HISTORY:
27 ! Created January 2004 (JKD)
28 !EOP
29 !BOC
30 implicit none
31 ! local variables
32 logical hybrid_
33 integer is,ia,ias,npc
34 integer idu,ist,nr,l,n,i
35 integer xcspin_
36 real(8) hybridc_,t1
37 real(8) ts0,ts1
38 
39 !-------------------------------!
40 ! zero timing variables !
41 !-------------------------------!
42 timeinit=0.d0
43 timemat=0.d0
44 timefv=0.d0
45 timesv=0.d0
46 timerho=0.d0
47 timepot=0.d0
48 timefor=0.d0
49 call timesec(ts0)
50 
51 !------------------------------------!
52 ! angular momentum variables !
53 !------------------------------------!
54 if (lmaxo > lmaxapw) then
55  write(*,*)
56  write(*,'("Error(init0): lmaxo > lmaxapw :",2(X,I0))') lmaxo,lmaxapw
57  write(*,*)
58  stop
59 end if
60 lmaxi=min(lmaxi,lmaxo)
61 lmmaxapw=(lmaxapw+1)**2
62 lmmaxi=(lmaxi+1)**2
63 lmmaxo=(lmaxo+1)**2
64 ! check DOS and band structure angular momentum maximum is within range
65 lmaxdb=min(lmaxdb,lmaxo)
66 lmmaxdb=(lmaxdb+1)**2
67 ! write to VARIABLES.OUT
68 if (wrtvars) then
69  call writevars('lmaxapw',iv=lmaxapw)
70  call writevars('lmaxi',iv=lmaxi)
71  call writevars('lmaxo',iv=lmaxo)
72  call writevars('lmaxdb',iv=lmaxdb)
73 end if
74 
75 !------------------------------------!
76 ! index to atoms and species !
77 !------------------------------------!
78 natmmax=0
79 ias=0
80 do is=1,nspecies
81  do ia=1,natoms(is)
82  ias=ias+1
83  idxas(ia,is)=ias
84  idxis(ias)=is
85  idxia(ias)=ia
86  end do
87 ! maximum number of atoms over all species
88  natmmax=max(natmmax,natoms(is))
89 end do
90 ! total number of atoms
91 natmtot=ias
92 ! number of phonon branches
93 nbph=3*natmtot
94 ! write to VARIABLES.OUT
95 if (wrtvars) then
96  call writevars('nspecies',iv=nspecies)
97  call writevars('natoms',nv=nspecies,iva=natoms)
98  call writevars('spsymb',nv=nspecies,sva=spsymb)
99  call writevars('spname',nv=nspecies,sva=spname)
100  call writevars('spzn',nv=nspecies,rva=spzn)
101 end if
102 
103 !------------------------!
104 ! spin variables !
105 !------------------------!
106 if (spinsprl) then
107  spinpol=.true.
108  spinorb=.false.
109  if (any(task == [5,51,52,53,61,62,63,700,701])) then
110  write(*,*)
111  write(*,'("Error(init0): spin-spirals do not work with task ",I0)') task
112  write(*,*)
113  stop
114  end if
115  if (xctype(1) < 0) then
116  write(*,*)
117  write(*,'("Error(init0): spin-spirals do not work with the OEP method")')
118  write(*,*)
119  stop
120  end if
121 end if
122 ! de-phasing required only for spin-spirals
123 if (.not.spinsprl) ssdph=.false.
124 ! spin-orbit coupling, B-field-orbit coupling, fixed spin moment, spin spirals
125 ! or spin-polarised cores requires a spin-polarised calculation
126 if (spinorb.or.bforb.or.(fsmtype /= 0).or.spinsprl.or.spincore) spinpol=.true.
127 ! number of spinor components and maximum allowed occupancy
128 if (spinpol) then
129  nspinor=2
130  occmax=1.d0
131 else
132  nspinor=1
133  occmax=2.d0
134 end if
135 ! number of spin-dependent first-variational functions per state and map from
136 ! second- to first-variational spin index
137 if (spinsprl) then
138  nspnfv=2
139  jspnfv(1)=1
140  jspnfv(2)=2
141 else
142  nspnfv=1
143  jspnfv(1)=1
144  jspnfv(2)=1
145 end if
146 ! no calculation of second-variational eigenvectors by default
147 tevecsv=.false.
148 ! spin-polarised calculations require second-variational eigenvectors
149 if (spinpol) tevecsv=.true.
150 ! Hartree-Fock/RDMFT/TDDFT/GW/TDHFC/ULR require second-variational eigenvectors
151 if (any(task == [5,10,170,300,460,461,462,463,600,601,620,670,680,700,701,720, &
152  725]).or.ksgwrho) then
153  tevecsv=.true.
154 end if
155 ! get exchange-correlation functional data
157 if ((spinpol).and.(xcspin == 0)) then
158  write(*,*)
159  write(*,'("Error(init0): requested spin-polarised run with &
160  &spin-unpolarised")')
161  write(*,'(" exchange-correlation functional")')
162  write(*,*)
163  stop
164 end if
165 ! set flag for hybrid functional
166 if (task == 5) then
168 else
169  hybrid=.false.
170 end if
171 ! check for collinearity in the z-direction and set the dimension of the
172 ! magnetisation and exchange-correlation vector fields
173 if (spinpol) then
174  ndmag=1
175  if ((abs(bfieldc0(1)) > epslat).or.(abs(bfieldc0(2)) > epslat)) ndmag=3
176  do is=1,nspecies
177  do ia=1,natoms(is)
178  if ((abs(bfcmt0(1,ia,is)) > epslat).or. &
179  (abs(bfcmt0(2,ia,is)) > epslat)) ndmag=3
180  end do
181  end do
182 ! spin-orbit coupling is non-collinear in general
183  if (spinorb) ndmag=3
184 ! source-free fields and spin-spirals must be non-collinear
185  if (nosource.or.spinsprl) then
186  ndmag=3
187  cmagz=.false.
188  end if
189 ! force collinear magnetism along the z-axis if required
190  if (cmagz) ndmag=1
191 else
192  ndmag=0
193 end if
194 ! set the non-collinear flag
195 ncmag=(ndmag == 3)
196 ! check for meta-GGA with non-collinearity
197 if (any(xcgrad == [3,4,5,6]).and.ncmag) then
198  write(*,*)
199  write(*,'("Error(init0): meta-GGA is not valid for non-collinear magnetism")')
200  write(*,*)
201  stop
202 end if
203 if (tbdip.and.(.not.ncmag)) then
204  write(*,*)
205  write(*,'("Error(init0): non-collinear magnetism required for inclusion of &
206  &the dipole field")')
207  write(*,*)
208  stop
209 end if
210 ! spin-polarised cores
211 if (.not.spinpol) spincore=.false.
212 if (fsmtype /= 0) then
213 ! set fixed spin moment effective field to zero
214  bfsmc(:)=0.d0
215 ! set muffin-tin FSM fields to zero
216  if (allocated(bfsmcmt)) deallocate(bfsmcmt)
217  allocate(bfsmcmt(3,natmtot))
218  bfsmcmt(:,:)=0.d0
219  if (mixtype > 1) then
220  mixtype=1
221  if (mp_mpi) then
222  write(*,'("Info(init0): mixtype changed to 1 for FSM calculation")')
223  end if
224  end if
225 end if
226 ! number of independent spin components of the f_xc spin tensor
227 if (spinpol) then
228  if (ncmag) then
229  nscfxc=10
230  else
231  nscfxc=3
232  end if
233 else
234  nscfxc=1
235 end if
236 ! set the magnetic fields to the initial values
237 bfieldc(:)=bfieldc0(:)
238 bfcmt(:,:,:)=bfcmt0(:,:,:)
239 if (tmwrite.or.(ftmtype /= 0).or.(task == 400)) then
240  if (.not.spinorb) then
241  write(*,*)
242  write(*,'("Error(init0): tensor moments require spin-orbit coupling &
243  &enabled")')
244  write(*,'(" set spinorb=.true.")')
245  write(*,*)
246  stop
247  end if
248 end if
249 ! generate the fixed tensor moment density matrices if required
250 if (ftmtype /= 0) call gendmftm
251 ! if reducebf < 1 then reduce the external magnetic fields and tensor moments
252 ! immediately for non-self-consistent calculations
253 if (reducebf < 1.d0-1.d-4) then
254  if (all(task /= [0,2,28,200,208,350,380,420,421,440])) then
255  bfieldc(:)=0.d0
256  bfcmt(:,:,:)=0.d0
257  if (ftmtype < 0) dmftm(:,:,:,:,:)=0.d0
258  end if
259 end if
260 ! write to VARIABLES.OUT
261 if (wrtvars) then
262  call writevars('nspinor',iv=nspinor)
263  call writevars('ndmag',iv=ndmag)
264  call writevars('sxcscf',rv=sxcscf)
265  call writevars('bfieldc0',nv=3,rva=bfieldc0)
266 end if
267 
268 !----------------------------------!
269 ! crystal structure set up !
270 !----------------------------------!
271 ! use reference lattice vectors if required
272 if (tavref) then
273  avec0(:,:)=avec(:,:)
274  avec(:,:)=avecref(:,:)
275 end if
276 ! generate the reciprocal lattice vectors, unit cell and Brillouin zone volumes
278 ! inverse of the lattice vector matrix
279 call r3minv(avec,ainv)
280 ! inverse of the reciprocal vector matrix
281 call r3minv(bvec,binv)
282 ! Cartesian coordinates of the spin-spiral vector
283 call r3mv(bvec,vqlss,vqcss)
284 do is=1,nspecies
285  do ia=1,natoms(is)
286 ! map atomic lattice coordinates to [0,1)
287  call r3frac(epslat,atposl(:,ia,is))
288 ! determine atomic Cartesian coordinates
289  call r3mv(avec,atposl(:,ia,is),atposc(:,ia,is))
290  end do
291 end do
292 ! check for overlapping muffin-tins and adjust radii if required
293 call checkmt
294 ! compute the total muffin-tin volume (M. Meinert)
295 omegamt=0.d0
296 do is=1,nspecies
297  omegamt=omegamt+dble(natoms(is))*(fourpi/3.d0)*rmt(is)**3
298 end do
299 ! input q-vector in Cartesian coordinates
300 call r3mv(bvec,vecql,vecqc)
301 
302 !-------------------------------!
303 ! vector fields E and A !
304 !-------------------------------!
305 ! static electric field
306 tefield=.false.
307 if (any(abs(efieldc(:)) > epslat)) then
308 ! no shift of the atomic positions
309  tshift=.false.
310 ! electric field vector in lattice coordinates
311  call r3mv(ainv,efieldc,efieldl)
312 ! potential at maximum distance
313  vmaxefc=dmaxefc*norm2(efieldc(1:3))
314 ! allocate array for average electric field in each muffin-tin
315  if (allocated(efcmt)) deallocate(efcmt)
316  allocate(efcmt(3,natmtot))
317 ! set the E-field flag
318  tefield=.true.
319 end if
320 ! static vector potential
321 tafield=.false.
322 if (any(abs(afieldc(:)) > epslat)) then
323  tafield=.true.
324 ! A-field in lattice coordinates
325  call r3mv(ainv,afieldc,afieldl)
326 ! vector potential added in second-variational step
327  tevecsv=.true.
328 end if
329 ! static spin-dependent vector potential
330 tafsp=.false.
331 if (spinpol.and.(any(abs(afspc(:,:)) > epslat))) then
332  tafsp=.true.
333  tevecsv=.true.
334 end if
335 ! time-dependent vector potential
336 tafieldt=.false.
337 if (any(task == [460,461,462,463,480,481,485])) then
338 ! read time-dependent A-field from file
339  call readafieldt
340  tafieldt=.true.
341 ! zero the induced A-field and its time derivative
342  afindt(:,:)=0.d0
343 end if
344 ! write to VARIABLES.OUT
345 if (wrtvars) then
346  call writevars('efieldc',nv=3,rva=efieldc)
347  call writevars('afieldc',nv=3,rva=afieldc)
348  call writevars('afspc',nv=9,rva=afspc)
349 end if
350 
351 !---------------------------------!
352 ! crystal symmetry set up !
353 !---------------------------------!
354 call symmetry
355 
356 !-----------------------!
357 ! radial meshes !
358 !-----------------------!
359 nrmtmax=1
360 nrcmtmax=1
361 do is=1,nspecies
362 ! make the muffin-tin mesh commensurate with lradstp
363  nrmt(is)=nrmt(is)-mod(nrmt(is)-1,lradstp)
364  nrmtmax=max(nrmtmax,nrmt(is))
365 ! number of coarse radial mesh points
366  nrcmt(is)=(nrmt(is)-1)/lradstp+1
367  nrcmtmax=max(nrcmtmax,nrcmt(is))
368 end do
369 ! set up atomic and muffin-tin radial meshes
370 call genrmesh
371 ! number of points in packed muffin-tins
372 npmtmax=1
373 npcmtmax=1
374 do is=1,nspecies
375  npmti(is)=lmmaxi*nrmti(is)
376  npmt(is)=npmti(is)+lmmaxo*(nrmt(is)-nrmti(is))
377  npmtmax=max(npmtmax,npmt(is))
378  npcmti(is)=lmmaxi*nrcmti(is)
379  npcmt(is)=npcmti(is)+lmmaxo*(nrcmt(is)-nrcmti(is))
380  npcmtmax=max(npcmtmax,npcmt(is))
381 end do
382 ! index to first muffin-tin point in packed array over all atoms
383 if (allocated(ipcmt)) deallocate(ipcmt)
384 allocate(ipcmt(natmtot))
385 ipcmt(1)=1
386 npc=npcmt(1)
387 npcmttot=npc
388 do ias=2,natmtot
389  is=idxis(ias)
390  ipcmt(ias)=ipcmt(ias)+npc
391  npc=npcmt(is)
392  npcmttot=npcmttot+npc
393 end do
394 
395 !--------------------------------------!
396 ! charges and number of states !
397 !--------------------------------------!
398 chgzn=0.d0
399 chgcrtot=0.d0
400 chgval=0.d0
401 nstspmax=0
402 nstcr=0
403 do is=1,nspecies
404 ! nuclear charge
405  chgzn=chgzn+spzn(is)*natoms(is)
406 ! find the maximum number of atomic states
407  nstspmax=max(nstspmax,nstsp(is))
408 ! compute the electronic charge for each species, as well as the total core and
409 ! valence charge
410  spze(is)=0.d0
411  chgcr(is)=0.d0
412  do ist=1,nstsp(is)
413  spze(is)=spze(is)+occsp(ist,is)
414  if (spcore(ist,is)) then
415  chgcr(is)=chgcr(is)+occsp(ist,is)
416  nstcr=nstcr+2*ksp(ist,is)*natoms(is)
417  else
418  chgval=chgval+occsp(ist,is)*natoms(is)
419  end if
420  end do
421  chgcrtot=chgcrtot+chgcr(is)*natoms(is)
422 end do
423 ! add excess charge
425 ! total charge
427 if (chgtot < 1.d-8) then
428  write(*,*)
429  write(*,'("Error(init0): zero total charge")')
430  write(*,*)
431  stop
432 end if
433 ! subtract small charge to ensure consistent Fermi energy for insulators
435 ! effective Wigner radius
436 rwigner=(3.d0/(fourpi*(chgtot/omega)))**(1.d0/3.d0)
437 ! write to VARIABLES.OUT
438 if (wrtvars) then
439  call writevars('spze',nv=nspecies,rva=spze)
440  call writevars('chgcr',nv=nspecies,rva=chgcr)
441  call writevars('chgexs',rv=chgexs)
442  call writevars('chgval',rv=chgtot)
443 end if
444 
445 !-------------------------!
446 ! G-vector arrays !
447 !-------------------------!
448 ! determine gkmax from rgkmax
449 if (nspecies == 0) isgkmax=-2
450 select case(isgkmax)
451 case(:-4)
452 ! use largest muffin-tin radius
453  gkmax=rgkmax/maxval(rmt(1:nspecies))
454 case(-3)
455 ! use smallest muffin-tin radius
456  gkmax=rgkmax/minval(rmt(1:nspecies))
457 case(-2)
458 ! use the fixed value of 2.0
459  gkmax=rgkmax/2.d0
460 case(-1,0)
461 ! use average muffin-tin radius
462  t1=sum(natoms(1:nspecies)*rmt(1:nspecies))/dble(natmtot)
463  gkmax=rgkmax/t1
464 case(1:)
465 ! use user-specified muffin-tin radius
466  if (isgkmax <= nspecies) then
468  else
469  write(*,*)
470  write(*,'("Error(init0): isgkmax > nspecies :",2(X,I0))') isgkmax,nspecies
471  write(*,*)
472  stop
473  end if
474 end select
475 ! generate the G-vectors
476 call gengvec
477 ! apply strain to A-, B- and G-vectors if required
478 call strainabg
479 ! write number of G-vectors to test file
480 call writetest(900,'number of G-vectors',iv=ngvec)
481 ! Poisson solver pseudocharge density constant
482 if (nspecies > 0) then
483  t1=0.25d0*gmaxvr*maxval(rmt(1:nspecies))
484 else
485  t1=0.25d0*gmaxvr*2.d0
486 end if
487 npsd=max(nint(t1),1)
488 lnpsd=lmaxo+npsd+1
489 ! generate the Coulomb Green's function in G-space = 4π/G²
490 call gengclg
491 ! compute the spherical Bessel functions j_l(|G|Rₘₜ)
492 if (allocated(jlgrmt)) deallocate(jlgrmt)
493 allocate(jlgrmt(0:lnpsd,ngvec,nspecies))
495 ! generate the spherical harmonics of the G-vectors
496 call genylmg
497 ! allocate structure factor array for G-vectors
498 if (allocated(sfacg)) deallocate(sfacg)
499 allocate(sfacg(ngvec,natmtot))
500 ! generate structure factors for G-vectors
502 ! generate the smooth step function form factors
503 if (allocated(ffacg)) deallocate(ffacg)
504 allocate(ffacg(ngtot,nspecies))
506 ! generate the smooth characteristic function
507 call gencfun
508 ! G-vector variables for coarse grid with |G| < 2 gkmax
509 call gengvc
510 ! generate the characteristic function on the coarse grid
511 call gencfrc
512 ! write to VARIABLES.OUT
513 if (wrtvars) then
514  call writevars('avec',nv=9,rva=avec)
515  call writevars('bvec',nv=9,rva=bvec)
516  call writevars('omega',rv=omega)
517  do is=1,nspecies
518  call writevars('atposl',n1=is,nv=3*natoms(is),rva=atposl(:,:,is))
519  end do
520  do is=1,nspecies
521  call writevars('atposc',n1=is,nv=3*natoms(is),rva=atposc(:,:,is))
522  end do
523  call writevars('vqlss',nv=3,rva=vqlss)
524  call writevars('vqcss',nv=3,rva=vqcss)
525  call writevars('gmaxvr',rv=gmaxvr)
526  call writevars('ngridg',nv=3,iva=ngridg)
527  call writevars('intgv',nv=6,iva=intgv)
528  call writevars('ngvec',iv=ngvec)
529  call writevars('ivg',nv=3*ngtot,iva=ivg)
530  call writevars('igfft',nv=ngtot,iva=igfft)
531 end if
532 
533 !-------------------------!
534 ! atoms and cores !
535 !-------------------------!
536 ! determine the nuclear Coulomb potential
537 if (allocated(vcln)) deallocate(vcln)
538 allocate(vcln(nrspmax,nspecies))
539 do is=1,nspecies
540  nr=nrsp(is)
541  call potnucl(ptnucl,nr,rsp(:,is),spzn(is),vcln(:,is))
542  vcln(1:nr,is)=vcln(1:nr,is)*y00i
543 end do
544 ! solve the Kohn-Sham-Dirac equations for all atoms
545 call allatoms
546 ! allocate core state occupancy and eigenvalue arrays and set to default
547 if (allocated(occcr)) deallocate(occcr)
548 allocate(occcr(nstspmax,natmtot))
549 if (allocated(evalcr)) deallocate(evalcr)
550 allocate(evalcr(nstspmax,natmtot))
551 do ias=1,natmtot
552  is=idxis(ias)
553  do ist=1,nstsp(is)
554  occcr(ist,ias)=occsp(ist,is)
555  evalcr(ist,ias)=evalsp(ist,is)
556  end do
557 end do
558 ! allocate core state radial wavefunction array
559 if (allocated(rwfcr)) deallocate(rwfcr)
560 allocate(rwfcr(nrspmax,2,nstspmax,natmtot))
561 ! number of core spin channels
562 if (spincore) then
563  nspncr=2
564 else
565  nspncr=1
566 end if
567 ! allocate core state charge density array
568 if (allocated(rhocr)) deallocate(rhocr)
569 allocate(rhocr(nrmtmax,natmtot,nspncr))
570 
571 !-------------------------------------------------------------!
572 ! charge density, potentials and exchange-correlation !
573 !-------------------------------------------------------------!
574 ! combined target array for density and magnetisation
575 if (allocated(rhmg)) deallocate(rhmg)
577 if (spinpol) n=n*(1+ndmag)
578 allocate(rhmg(n))
579 ! associate pointer arrays with target
580 rhomt(1:npmtmax,1:natmtot) => rhmg(1:)
581 i=size(rhomt)+1
582 rhoir(1:ngtot) => rhmg(i:)
583 if (spinpol) then
584  i=i+size(rhoir)
585  magmt(1:npmtmax,1:natmtot,1:ndmag) => rhmg(i:)
586  i=i+size(magmt)
587  magir(1:ngtot,1:ndmag) => rhmg(i:)
588 end if
589 if (any(task == [371,372,373]).or.tafield.or.tdjr1d.or.tdjr2d.or.tdjr3d) then
590  tjr=.true.
591 end if
592 ! allocate current density arrays
593 if (allocated(jrmt)) deallocate(jrmt)
594 if (allocated(jrir)) deallocate(jrir)
595 if (tjr) then
596  allocate(jrmt(npmtmax,natmtot,3),jrir(ngtot,3))
597 end if
598 ! Coulomb potential
599 if (allocated(vclmt)) deallocate(vclmt)
600 allocate(vclmt(npmtmax,natmtot))
601 if (allocated(vclir)) deallocate(vclir)
602 allocate(vclir(ngtot))
603 ! exchange energy density
604 if (allocated(exmt)) deallocate(exmt)
605 allocate(exmt(npmtmax,natmtot))
606 if (allocated(exir)) deallocate(exir)
607 allocate(exir(ngtot))
608 ! correlation energy density
609 if (allocated(ecmt)) deallocate(ecmt)
610 allocate(ecmt(npmtmax,natmtot))
611 if (allocated(ecir)) deallocate(ecir)
612 allocate(ecir(ngtot))
613 ! exchange-correlation potential
614 if (allocated(vxcmt)) deallocate(vxcmt)
615 allocate(vxcmt(npmtmax,natmtot))
616 if (allocated(vxcir)) deallocate(vxcir)
617 allocate(vxcir(ngtot))
618 ! exchange-correlation and dipole magnetic fields
619 if (allocated(bxcmt)) deallocate(bxcmt)
620 if (allocated(bxcir)) deallocate(bxcir)
621 if (allocated(bdmt)) deallocate(bdmt)
622 if (allocated(bdir)) deallocate(bdir)
623 if (allocated(bdmta)) deallocate(bdmta)
624 if (spinpol) then
626  if (tbdip) then
627  allocate(bdmt(npmtmax,natmtot,ndmag),bdir(ngtot,ndmag))
628  allocate(bdmta(ndmag,natmtot))
629  bdmta(1:ndmag,1:natmtot)=0.d0
630  end if
631 end if
632 ! combined target array for Kohn-Sham potential and magnetic field
633 if (allocated(vsbs)) deallocate(vsbs)
635 if (spinpol) n=n+(npcmtmax*natmtot+ngtc)*ndmag
636 allocate(vsbs(n))
637 ! associate pointer arrays with target
638 vsmt(1:npmtmax,1:natmtot) => vsbs(1:)
639 i=size(vsmt)+1
640 vsirc(1:ngtc) => vsbs(i:)
641 if (spinpol) then
642  i=i+size(vsirc)
643  bsmt(1:npcmtmax,1:natmtot,1:ndmag) => vsbs(i:)
644  i=i+size(bsmt)
645  bsirc(1:ngtc,1:ndmag) => vsbs(i:)
646 ! allocate the Kohn-Sham magnetic field on the intersitial grid
647  if (allocated(bsir)) deallocate(bsir)
648  allocate(bsir(ngtot,ndmag))
649 end if
650 ! interstitial Kohn-Sham potential
651 if (allocated(vsir)) deallocate(vsir)
652 allocate(vsir(ngtot))
653 ! interstitial Kohn-Sham potential in G-space
654 if (allocated(vsig)) deallocate(vsig)
655 allocate(vsig(ngvc))
656 ! kinetic energy density and meta-GGA exchange-correlation potential
657 if (allocated(taumt)) deallocate(taumt)
658 if (allocated(tauir)) deallocate(tauir)
659 if (allocated(taucr)) deallocate(taucr)
660 if (allocated(wxcmt)) deallocate(wxcmt)
661 if (allocated(wxcir)) deallocate(wxcir)
662 if (any(xcgrad == [3,4,5,6])) then
664  allocate(taucr(npmtmax,natmtot,nspinor))
665  allocate(wxcmt(npmtmax,natmtot),wxcir(ngtot))
666 ! approximate kinetic energy density functional used to compute the functional
667 ! derivative δτ(r')/δρ(r) for meta-GGA
668  call getxcdata(ktype,kdescr,xcspin_,kgrad,hybrid_,hybridc_)
669 end if
670 ! spin-orbit coupling radial function
671 if (allocated(socfr)) deallocate(socfr)
672 if (spinorb) then
673  allocate(socfr(nrcmtmax,natmtot))
674 end if
675 ! allocate muffin-tin charge and moment arrays
676 if (allocated(chgcrlk)) deallocate(chgcrlk)
677 allocate(chgcrlk(natmtot))
678 if (allocated(chgmt)) deallocate(chgmt)
679 allocate(chgmt(natmtot))
680 if (allocated(mommt)) deallocate(mommt)
681 allocate(mommt(3,natmtot))
682 ! check if scaled spin exchange-correlation should be used
683 tssxc=(abs(sxcscf-1.d0) > 1.d-6)
684 ! spin-spiral phase factors
685 if (ssdph) then
686  if (allocated(zqss)) deallocate(zqss)
687  allocate(zqss(natmtot))
688  do ias=1,natmtot
689  is=idxis(ias)
690  ia=idxia(ias)
691  t1=-0.5d0*dot_product(vqcss(1:3),atposc(1:3,ia,is))
692  zqss(ias)=cmplx(cos(t1),sin(t1),8)
693  end do
694 end if
695 ! mixing vector: either density/magnetisation or potential/magnetic field
696 if (mixrho) then
697  vmixer => rhmg
698 else
699  vmixer => vsbs
700 end if
701 ! zero the mixing vector
702 vmixer(:)=0.d0
703 
704 !-------------------------!
705 ! force variables !
706 !-------------------------!
707 if (tforce) then
708  if (allocated(forcehf)) deallocate(forcehf)
709  allocate(forcehf(3,natmtot))
710  if (allocated(forcetot)) deallocate(forcetot)
711  allocate(forcetot(3,natmtot))
712 end if
713 
714 !-------------------------------------------------!
715 ! DFT+U and fixed tensor moment variables !
716 !-------------------------------------------------!
717 if ((dftu /= 0).or.(ftmtype /= 0)) then
718 ! density matrix elements in each muffin-tin
719  if (allocated(dmatmt)) deallocate(dmatmt)
721 ! potential matrix elements in each muffin-tin
722  if (allocated(vmatmt)) deallocate(vmatmt)
724 ! zero the potential matrix
725  vmatmt(:,:,:,:,:)=0.d0
726 ! matrix elements in spherical coordinates for TDDFT+U
727  if (any(task == [460,461,462,463,478])) then
728  if (allocated(vmatmti)) deallocate(vmatmti)
730  if (allocated(vmatmto)) deallocate(vmatmto)
732  end if
733 ! require the potential matrix elements be calculated
734  tvmatmt=.true.
735 ! flags for non-zero muffin-tin potential matrices
736  if (allocated(tvmmt)) deallocate(tvmmt)
737  allocate(tvmmt(0:lmaxdm,natmtot))
738  tvmmt(:,:)=.false.
739 ! require second-variational eigenvectors
740  tevecsv=.true.
741 end if
742 if (dftu /= 0) then
743  if (any(task == [5,300,600,601,610,620,630,640])) then
744  write(*,*)
745  write(*,'("Error(init0): DFT+U does not work with task ",I0)') task
746  write(*,*)
747  stop
748  end if
749 ! DFT+U energy for each atom
750  if (allocated(engyadu)) deallocate(engyadu)
751  allocate(engyadu(natmmax,ndftu))
752 ! flag the muffin-tin potential matrices which are non-zero
753  do idu=1,ndftu
754  is=isldu(1,idu)
755  if (is > nspecies) then
756  write(*,*)
757  write(*,'("Error(init0): invalid species number : ",I0)') is
758  write(*,*)
759  stop
760  end if
761  l=isldu(2,idu)
762  do ia=1,natoms(is)
763  ias=idxas(ia,is)
764  tvmmt(l,ias)=.true.
765  end do
766  end do
767 ! zero the initial values of screening length
768  lamdu0(:)=0.d0
769 ! write to VARIABLES.OUT
770  if (wrtvars) then
771  call writevars('udufix',nv=ndftu,rva=udufix)
772  end if
773 end if
774 if (ftmtype /= 0) then
775 ! allocate and zero the fixed tensor moment potential array
776  if (allocated(vmftm)) deallocate(vmftm)
778  vmftm(:,:,:,:,:)=0.d0
779 ! flag the muffin-tin potential matrices which are non-zero
780  do i=1,ntmfix
781  is=itmfix(1,i)
782  ia=itmfix(2,i)
783  ias=idxas(ia,is)
784  l=itmfix(3,i)
785  tvmmt(l,ias)=.true.
786  end do
787 end if
788 
789 !-----------------------!
790 ! miscellaneous !
791 !-----------------------!
792 ! determine nuclear radii and volumes
793 call nuclei
794 ! determine the nuclear-nuclear energy
795 call energynn
796 ! get smearing function description
797 call getsdata(stype,sdescr)
798 ! get mixing type description
800 ! generate the spherical harmonic transform (SHT) matrices
801 call genshtmat
802 ! find the maximum size of the spherical Bessel function array over all species
803 call findnjcmax
804 ! allocate 1D plotting arrays
805 if (allocated(dvp1d)) deallocate(dvp1d)
806 allocate(dvp1d(nvp1d))
807 if (allocated(vplp1d)) deallocate(vplp1d)
808 allocate(vplp1d(3,npp1d))
809 if (allocated(dpp1d)) deallocate(dpp1d)
810 allocate(dpp1d(npp1d))
811 ! initial self-consistent loop number
812 iscl=1
813 tlast=.false.
814 ! set the Fermi energy to zero
815 efermi=0.d0
816 ! set the temperature from the smearing width
818 
819 call timesec(ts1)
820 timeinit=timeinit+ts1-ts0
821 
822 end subroutine
823 !EOC
824 
integer, dimension(:,:), allocatable itmfix
Definition: moddftu.f90:85
subroutine getsdata(stype, sdescr)
Definition: sdelta.f90:68
complex(8), dimension(:,:), allocatable sfacg
Definition: modmain.f90:430
real(8), dimension(3, maxatoms, maxspecies) bfcmt0
Definition: modmain.f90:275
real(8), dimension(:), allocatable wxcir
Definition: modmain.f90:674
real(8) efermi
Definition: modmain.f90:901
subroutine potnucl(ptnucl, nr, r, zn, vn)
Definition: potnucl.f90:10
real(8), dimension(maxstsp, maxspecies) occsp
Definition: modmain.f90:133
integer npcmttot
Definition: modmain.f90:218
subroutine writetest(id, descr, nv, iv, iva, tol, rv, rva, zv, zva)
Definition: modtest.f90:16
real(8), dimension(3, 3) afspc
Definition: modmain.f90:331
integer, dimension(maxstsp, maxspecies) ksp
Definition: modmain.f90:125
real(8) dmaxefc
Definition: modmain.f90:318
real(8), dimension(:,:), allocatable mommt
Definition: modmain.f90:742
integer, dimension(maxspecies) npcmt
Definition: modmain.f90:214
logical tjr
Definition: modmain.f90:618
real(8), dimension(3) efieldl
Definition: modmain.f90:314
integer mixtype
Definition: modmain.f90:693
integer, dimension(3) ktype
Definition: modmain.f90:604
integer natmmax
Definition: modmain.f90:38
integer npcmtmax
Definition: modmain.f90:216
integer, dimension(3) ngridg
Definition: modmain.f90:386
pure subroutine gensfacgp(ngp, vgpc, ld, sfacgp)
Definition: gensfacgp.f90:10
subroutine gengvc
Definition: gengvc.f90:7
real(8), dimension(:), allocatable, target rhmg
Definition: modmain.f90:610
integer task
Definition: modmain.f90:1291
logical mp_mpi
Definition: modmpi.f90:17
subroutine reciplat(avec, bvec, omega, omegabz)
Definition: reciplat.f90:10
integer ngtot
Definition: modmain.f90:390
real(8), dimension(:), pointer, contiguous vmixer
Definition: modmain.f90:687
integer lmmaxo
Definition: modmain.f90:203
complex(4), dimension(:,:,:,:,:), allocatable vmatmti
Definition: moddftu.f90:23
real(8), dimension(:,:), allocatable vxcmt
Definition: modmain.f90:632
integer, dimension(3) xctype
Definition: modmain.f90:586
integer ngtc
Definition: modmain.f90:392
real(8) rwigner
Definition: modmain.f90:734
real(8), dimension(:,:), allocatable occcr
Definition: modmain.f90:927
real(8), dimension(:), allocatable ecir
Definition: modmain.f90:630
logical spinpol
Definition: modmain.f90:228
real(8), dimension(:), pointer, contiguous rhoir
Definition: modmain.f90:612
integer lmmaxapw
Definition: modmain.f90:199
logical hybrid
Definition: modmain.f90:1144
integer, parameter lmmaxdm
Definition: moddftu.f90:15
integer, dimension(maxatoms, maxspecies) idxas
Definition: modmain.f90:42
complex(8), dimension(:,:,:,:,:), allocatable dmftm
Definition: moddftu.f90:89
logical tshift
Definition: modmain.f90:352
real(8), dimension(:,:), allocatable vcln
Definition: modmain.f90:97
real(8) reducebf
Definition: modmain.f90:279
integer ndmag
Definition: modmain.f90:238
integer, dimension(maxspecies) npmt
Definition: modmain.f90:213
real(8) sxcscf
Definition: modmain.f90:666
real(8), dimension(:,:), allocatable vclmt
Definition: modmain.f90:622
real(8), dimension(3, 3) ainv
Definition: modmain.f90:14
real(8) omega
Definition: modmain.f90:20
logical tevecsv
Definition: modmain.f90:915
real(8), dimension(:), allocatable dpp1d
Definition: modmain.f90:1118
integer iscl
Definition: modmain.f90:1043
integer, dimension(:), allocatable ipcmt
Definition: modmain.f90:220
integer nstcr
Definition: modmain.f90:129
subroutine r3minv(a, b)
Definition: r3minv.f90:10
real(8), dimension(:,:,:), allocatable bdmt
Definition: modmain.f90:636
logical spinsprl
Definition: modmain.f90:283
Definition: modomp.f90:6
real(8), parameter kboltz
Definition: modmain.f90:1255
real(8) swidth
Definition: modmain.f90:889
real(8), dimension(:,:), allocatable evalcr
Definition: modmain.f90:929
subroutine gendmftm
Definition: gendmftm.f90:7
real(8), dimension(:,:), pointer, contiguous rhomt
Definition: modmain.f90:612
logical hybrid0
Definition: modmain.f90:1144
real(8) epsocc
Definition: modmain.f90:897
real(8), dimension(:,:), allocatable bdmta
Definition: modmain.f90:638
subroutine getmixdata(mtype, mixdescr)
Definition: mixerifc.f90:47
real(8), dimension(:,:,:), allocatable rhocr
Definition: modmain.f90:933
subroutine gencfun
Definition: gencfun.f90:10
logical tssxc
Definition: modmain.f90:664
real(8), dimension(:), allocatable chgmt
Definition: modmain.f90:730
character(264) kdescr
Definition: modmain.f90:606
real(8) timemat
Definition: modmain.f90:1209
logical mixrho
Definition: modmain.f90:685
character(264) xcdescr
Definition: modmain.f90:588
real(8), dimension(:,:), allocatable ecmt
Definition: modmain.f90:630
logical nosource
Definition: modmain.f90:662
real(8), dimension(:,:), allocatable forcetot
Definition: modmain.f90:985
integer lmaxo
Definition: modmain.f90:201
real(8), dimension(3) vqlss
Definition: modmain.f90:293
logical tmwrite
Definition: moddftu.f90:75
logical tafieldt
Definition: modtddft.f90:56
real(8), dimension(3) vecql
Definition: modmain.f90:1096
integer nrspmax
Definition: modmain.f90:109
real(8), dimension(3) bfsmc
Definition: modmain.f90:257
integer ngvc
Definition: modmain.f90:398
real(8) timefor
Definition: modmain.f90:1219
complex(8), dimension(:,:,:,:,:), allocatable dmatmt
Definition: moddftu.f90:17
real(8) vmaxefc
Definition: modmain.f90:320
real(8), dimension(:), allocatable vsir
Definition: modmain.f90:649
integer xcspin
Definition: modmain.f90:590
integer lmaxapw
Definition: modmain.f90:197
real(8), dimension(:,:), allocatable exmt
Definition: modmain.f90:628
integer kgrad
Definition: modmain.f90:608
real(8) timerho
Definition: modmain.f90:1215
real(8), dimension(:), allocatable vxcir
Definition: modmain.f90:632
logical bforb
Definition: modmain.f90:234
real(8) chgcrtot
Definition: modmain.f90:716
integer lmmaxdb
Definition: modmain.f90:1073
real(8), dimension(:,:), allocatable vgc
Definition: modmain.f90:420
complex(4), dimension(:,:,:,:,:), allocatable vmatmto
Definition: moddftu.f90:23
logical tforce
Definition: modmain.f90:981
integer, dimension(2, maxdftu) isldu
Definition: moddftu.f90:49
real(8), dimension(3, 3) avecref
Definition: modmain.f90:1022
logical, dimension(maxstsp, maxspecies) spcore
Definition: modmain.f90:127
real(8) timeinit
Definition: modmain.f90:1207
integer nrcmtmax
Definition: modmain.f90:175
real(8), dimension(:,:), allocatable wxcmt
Definition: modmain.f90:674
real(8) timepot
Definition: modmain.f90:1217
logical tefield
Definition: modmain.f90:310
real(8), dimension(:,:,:), allocatable taucr
Definition: modmain.f90:672
complex(8), dimension(:), allocatable zqss
Definition: modmain.f90:287
subroutine symmetry
Definition: symmetry.f90:7
real(8), dimension(3, maxatoms, maxspecies) atposl
Definition: modmain.f90:51
logical tlast
Definition: modmain.f90:1045
real(8), dimension(:), allocatable dvp1d
Definition: modmain.f90:1114
integer nspncr
Definition: modmain.f90:937
subroutine gencfrc
Definition: gencfrc.f90:7
integer ndftu
Definition: moddftu.f90:47
integer, dimension(:), allocatable igfft
Definition: modmain.f90:406
real(8), dimension(:,:,:), allocatable bxcmt
Definition: modmain.f90:634
real(8), dimension(:,:), allocatable bsir
Definition: modmain.f90:656
subroutine getxcdata(xctype, xcdescr, xcspin, xcgrad, hybrid, hybridc)
Definition: modxcifc.f90:411
real(8), dimension(:,:,:), pointer, contiguous magmt
Definition: modmain.f90:614
real(8) omegamt
Definition: modmain.f90:169
real(8) occmax
Definition: modmain.f90:895
subroutine readafieldt
Definition: readafieldt.f90:7
real(8), dimension(maxspecies) chgcr
Definition: modmain.f90:714
integer ftmtype
Definition: moddftu.f90:79
integer nbph
Definition: modphonon.f90:13
subroutine energynn
Definition: energynn.f90:7
integer lmaxdb
Definition: modmain.f90:1073
real(8), dimension(maxstsp, maxspecies) evalsp
Definition: modmain.f90:131
real(8), dimension(:,:), allocatable engyadu
Definition: moddftu.f90:53
real(8), dimension(:), allocatable chgcrlk
Definition: modmain.f90:718
subroutine genrmesh
Definition: genrmesh.f90:10
real(8), dimension(3, 3) avec
Definition: modmain.f90:12
subroutine genshtmat
Definition: genshtmat.f90:10
real(8), dimension(3, 0:1) afindt
Definition: modtddft.f90:67
logical tdjr2d
Definition: modtddft.f90:93
real(8) tempk
Definition: modmain.f90:682
real(8), dimension(:,:), allocatable bdir
Definition: modmain.f90:636
real(8) rgkmax
Definition: modmain.f90:493
real(8), dimension(:,:), allocatable ffacg
Definition: modmain.f90:432
logical cmagz
Definition: modmain.f90:242
integer ngvec
Definition: modmain.f90:396
integer nscfxc
Definition: modtddft.f90:16
real(8) chgzn
Definition: modmain.f90:712
integer lradstp
Definition: modmain.f90:171
logical tvmatmt
Definition: moddftu.f90:25
real(8), dimension(:,:), allocatable forcehf
Definition: modmain.f90:983
real(8), dimension(:), allocatable vclir
Definition: modmain.f90:622
integer nspinor
Definition: modmain.f90:267
subroutine gengvec
Definition: gengvec.f90:10
complex(8), dimension(:,:,:,:,:), allocatable vmatmt
Definition: moddftu.f90:21
real(8), dimension(3) afieldc
Definition: modmain.f90:325
logical, dimension(:,:), allocatable tvmmt
Definition: moddftu.f90:27
pure subroutine r3frac(eps, v)
Definition: r3frac.f90:10
real(8), dimension(maxspecies) rmt
Definition: modmain.f90:162
logical tavref
Definition: modmain.f90:1024
subroutine allatoms
Definition: allatoms.f90:10
real(8), dimension(:,:), allocatable bxcir
Definition: modmain.f90:634
real(8), dimension(3, 3) avec0
Definition: modmain.f90:12
real(8), dimension(3, 3) bvec
Definition: modmain.f90:16
complex(8), dimension(:,:,:,:,:), allocatable vmftm
Definition: moddftu.f90:91
subroutine checkmt
Definition: checkmt.f90:10
real(8), dimension(maxspecies) spze
Definition: modmain.f90:99
real(8), dimension(:), allocatable, target vsbs
Definition: modmain.f90:645
integer, dimension(:,:), allocatable ivg
Definition: modmain.f90:400
real(8), dimension(3, maxatoms, maxspecies) bfcmt
Definition: modmain.f90:273
real(8), dimension(:), pointer, contiguous vsirc
Definition: modmain.f90:651
character(64) mixdescr
Definition: modmain.f90:695
real(8), dimension(3) vqcss
Definition: modmain.f90:295
subroutine strainabg
Definition: strainabg.f90:7
Definition: modgw.f90:6
integer, dimension(maxspecies) nrsp
Definition: modmain.f90:107
integer, dimension(maxspecies) natoms
Definition: modmain.f90:36
integer, dimension(2, 3) intgv
Definition: modmain.f90:394
logical wrtvars
Definition: modvars.f90:9
logical ssdph
Definition: modmain.f90:285
integer, dimension(maxspecies) npcmti
Definition: modmain.f90:214
integer, dimension(maxatoms *maxspecies) idxis
Definition: modmain.f90:44
integer lmmaxi
Definition: modmain.f90:207
real(8), dimension(3, 3) binv
Definition: modmain.f90:18
real(8) epslat
Definition: modmain.f90:24
integer npsd
Definition: modmain.f90:624
real(8), parameter y00i
Definition: modmain.f90:1229
real(8), dimension(maxdftu) udufix
Definition: moddftu.f90:69
integer stype
Definition: modmain.f90:885
Definition: modmpi.f90:6
real(8), dimension(:,:,:), allocatable jlgrmt
Definition: modmain.f90:426
character(64), dimension(maxspecies) spname
Definition: modmain.f90:76
real(8), dimension(:,:), allocatable bfsmcmt
Definition: modmain.f90:263
subroutine timesec(ts)
Definition: timesec.f90:10
character(64) sdescr
Definition: modmain.f90:887
integer dftu
Definition: moddftu.f90:36
real(8) chgval
Definition: modmain.f90:720
logical ptnucl
Definition: modmain.f90:83
real(8) timefv
Definition: modmain.f90:1211
subroutine nuclei
Definition: nuclei.f90:7
pure subroutine genffacgp(ngp, gpc, ld, ffacgp)
Definition: genffacgp.f90:10
real(8), dimension(:), allocatable gc
Definition: modmain.f90:422
logical tbdip
Definition: modmain.f90:641
logical spinorb
Definition: modmain.f90:230
real(8), dimension(:,:), allocatable tauir
Definition: modmain.f90:670
real(8), dimension(3) bfieldc0
Definition: modmain.f90:271
real(8), dimension(maxdftu) lamdu0
Definition: moddftu.f90:63
integer lnpsd
Definition: modmain.f90:626
integer nspecies
Definition: modmain.f90:34
integer, dimension(maxatoms *maxspecies) idxia
Definition: modmain.f90:45
real(8), dimension(:,:), allocatable efcmt
Definition: modmain.f90:316
subroutine genjlgprmt(lmax, ngp, gpc, ld, jlgprmt)
Definition: genjlgprmt.f90:10
real(8) chgtot
Definition: modmain.f90:724
logical tdjr3d
Definition: modtddft.f90:93
real(8) timesv
Definition: modmain.f90:1213
integer, dimension(maxspecies) nstsp
Definition: modmain.f90:113
real(8) gkmax
Definition: modmain.f90:495
real(8), dimension(:,:,:,:), allocatable rwfcr
Definition: modmain.f90:931
logical tafsp
Definition: modmain.f90:329
real(8), dimension(maxspecies) spzn
Definition: modmain.f90:80
integer npmtmax
Definition: modmain.f90:216
real(8), dimension(:,:), pointer, contiguous magir
Definition: modmain.f90:614
real(8), dimension(:,:,:), allocatable jrmt
Definition: modmain.f90:620
subroutine init0
Definition: init0.f90:10
real(8), parameter fourpi
Definition: modmain.f90:1226
real(8), dimension(:,:), allocatable rsp
Definition: modmain.f90:135
integer natmtot
Definition: modmain.f90:40
real(8) omegabz
Definition: modmain.f90:22
logical ksgwrho
Definition: modgw.f90:38
integer, dimension(maxspecies) nrcmt
Definition: modmain.f90:173
integer, dimension(maxspecies) nrcmti
Definition: modmain.f90:211
integer, dimension(maxspecies) npmti
Definition: modmain.f90:213
integer, parameter lmaxdm
Definition: moddftu.f90:14
logical tdjr1d
Definition: modtddft.f90:93
pure subroutine r3mv(a, x, y)
Definition: r3mv.f90:10
Definition: modulr.f90:6
integer nrmtmax
Definition: modmain.f90:152
subroutine genylmg
Definition: genylmg.f90:10
logical ncmag
Definition: modmain.f90:240
subroutine gengclg
Definition: gengclg.f90:7
real(8) chgexs
Definition: modmain.f90:722
complex(8), dimension(:), allocatable vsig
Definition: modmain.f90:660
logical tafield
Definition: modmain.f90:322
real(8), dimension(:,:), pointer, contiguous bsirc
Definition: modmain.f90:658
integer nvp1d
Definition: modmain.f90:1106
real(8), dimension(3, maxatoms, maxspecies) atposc
Definition: modmain.f90:54
integer nstspmax
Definition: modmain.f90:115
real(8), dimension(:,:), pointer, contiguous vsmt
Definition: modmain.f90:647
integer, dimension(maxspecies) nrmti
Definition: modmain.f90:211
integer npp1d
Definition: modmain.f90:1108
real(8), dimension(3) efieldc
Definition: modmain.f90:312
real(8), dimension(3) afieldl
Definition: modmain.f90:327
real(8), dimension(:,:,:), allocatable taumt
Definition: modmain.f90:670
subroutine findnjcmax
Definition: findnjcmax.f90:7
real(8), dimension(:,:), allocatable jrir
Definition: modmain.f90:620
real(8) hybridc
Definition: modmain.f90:1146
integer xcgrad
Definition: modmain.f90:600
real(8), dimension(:,:), allocatable vplp1d
Definition: modmain.f90:1116
integer, dimension(2) jspnfv
Definition: modmain.f90:291
logical spincore
Definition: modmain.f90:935
character(64), dimension(maxspecies) spsymb
Definition: modmain.f90:78
real(8), dimension(:), allocatable exir
Definition: modmain.f90:628
real(8), dimension(3) vecqc
Definition: modmain.f90:1096
subroutine writevars(vname, n1, n2, n3, n4, n5, n6, nv, iv, iva, rv, rva, zv, zva, sv, sva)
Definition: modvars.f90:16
integer isgkmax
Definition: modmain.f90:491
integer nspnfv
Definition: modmain.f90:289
real(8), dimension(3) bfieldc
Definition: modmain.f90:269
real(8), dimension(:,:,:), pointer, contiguous bsmt
Definition: modmain.f90:654
integer fsmtype
Definition: modmain.f90:251
real(8), dimension(:,:), allocatable socfr
Definition: modmain.f90:668
integer, dimension(maxspecies) nrmt
Definition: modmain.f90:150
real(8) gmaxvr
Definition: modmain.f90:384
integer ntmfix
Definition: moddftu.f90:81
integer lmaxi
Definition: modmain.f90:205