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