The Elk Code
 
Loading...
Searching...
No Matches
readinput.f90
Go to the documentation of this file.
1
2! Copyright (C) 2002-2008 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: readinput
8! !INTERFACE:
9subroutine readinput
10! !USES:
11use modmain
12use moddftu
13use modrdm
14use modphonon
15use modtest
16use modrandom
17use modpw
18use modtddft
19use modulr
20use modvars
21use modgw
22use modbog
23use modw90
24use modtdhfc
25use modmpi
26use modomp
27use modramdisk
28! !DESCRIPTION:
29! Reads in the input parameters from the file {\tt elk.in}. Also sets default
30! values for the input parameters.
31!
32! !REVISION HISTORY:
33! Created September 2002 (JKD)
34!EOP
35!BOC
36implicit none
37! local variables
38logical lv
39integer is,ia,ias,ios
40integer i,j,k,l
41real(8) sc,sc1,sc2,sc3
42real(8) scx,scy,scz
43real(8) scu,scu1,scu2,scu3
44real(8) solscf,zn
45real(8) axang(4),rot(3,3)
46real(8) rndavec,v(3),t1
47character(256) block,symb,str
48
49!------------------------!
50! default values !
51!------------------------!
52ntasks=0
53avec(:,:)=0.d0
54avec(1,1)=1.d0
55avec(2,2)=1.d0
56avec(3,3)=1.d0
57davec(:,:)=0.d0
58sc=1.d0
59sc1=1.d0
60sc2=1.d0
61sc3=1.d0
62scx=1.d0
63scy=1.d0
64scz=1.d0
65epslat=1.d-6
66primcell=.false.
67tshift=.true.
68ngridk(:)=1
69dngridk(:)=0
70vkloff(:)=0.d0
71autokpt=.false.
72radkpt=40.d0
73reducek=1
74ngridq(:)=-1
75reduceq=1
76rgkmax=7.d0
77drgkmax=0.d0
78gmaxvr=12.d0
79dgmaxvr=0.d0
80lmaxapw=8
82lmaxo=6
83dlmaxo=0
84lmaxi=1
85fracinr=0.01d0
86trhonorm=.true.
87xctype(1)=3
88xctype(2:3)=0
89xctsp(1)=3
90xctsp(2:3)=0
91ktype(1)=52
92ktype(2:3)=0
93stype=3
94swidth=0.001d0
95autoswidth=.false.
96mstar=10.d0
97epsocc=1.d-10
98epschg=1.d-3
99nempty0=4.d0
100dnempty0=0.d0
101maxscl=200
102mixtype=3
103mixsave=.false.
104amixpm(1)=0.05d0
105amixpm(2)=1.d0
106! Broyden parameters recommended by M. Meinert
107mixsdb=5
108broydpm(1)=0.4d0
109broydpm(2)=0.15d0
110mixrho=.false.
111epspot=1.d-6
112epsengy=1.d-4
113epsforce=5.d-3
114epsstress=2.d-3
115molecule=.false.
116nspecies=0
117natoms(:)=0
118atposl(:,:,:)=0.d0
119datposl(:,:,:)=0.d0
120atposc(:,:,:)=0.d0
121bfcmt0(:,:,:)=0.d0
122sppath=''
123scrpath=''
124nvp1d=2
125if (allocated(vvlp1d)) deallocate(vvlp1d)
126allocate(vvlp1d(3,nvp1d))
127vvlp1d(:,1)=0.d0
128vvlp1d(:,2)=1.d0
129npp1d=200
130ip01d=1
131vclp2d(:,:)=0.d0
132vclp2d(1,1)=1.d0
133vclp2d(2,2)=1.d0
134np2d(:)=40
135vclp3d(:,:)=0.d0
136vclp3d(1,1)=1.d0
137vclp3d(2,2)=1.d0
138vclp3d(3,3)=1.d0
139np3d(:)=20
140nwplot=500
141ngrkf=100
142nswplot=1
143wplot(1)=-0.5d0
144wplot(2)=0.5d0
145dosocc=.false.
146tpdos=.true.
147dosmsum=.false.
148dosssum=.false.
149lmirep=.true.
150spinpol=.false.
151spinorb=.false.
152socscf=1.d0
153bforb=.false.
154bfdmag=.false.
155atpopt=1
156maxatpstp=200
157tau0atp=0.2d0
158deltast=0.005d0
159avecref(:,:)=0.d0
160latvopt=0
161maxlatvstp=30
162tau0latv=0.2d0
163lradstp=4
164chgexs=0.d0
165dchgexs=0.d0
166scissor=0.d0
167noptcomp=1
168! list of all optical tensor components
169do k=1,3; do j=1,3; do i=1,3
170 l=(k-1)*9+(j-1)*3+i
171 optcomp(:,l)=[i,j,k]
172end do; end do; end do
173optcomp(:,1)=1
174intraband=.false.
175evaltol=-1.d0
176epsband=1.d-12
177demaxbnd=2.5d0
178autolinengy=.false.
179deapw=0.2d0
180delorb=0.05d0
181dlefe=-0.1d0
182bfieldc0(:)=0.d0
183dbfieldc0(:)=0.d0
184efieldc(:)=0.d0
185dmaxefc=1.d6
186afieldc(:)=0.d0
187dafieldc(:)=0.d0
188afspc(:,:)=0.d0
189dafspc(:,:)=0.d0
190fsmtype=0
191momfix(:)=0.d0
192momfixm=0.d0
193dmomfix(:)=0.d0
194mommtfix(:,:,:)=1.d6
195mommtfixm(:,:)=-1.d0
196taufsm=0.01d0
197rmtdelta=0.05d0
198isgkmax=-1
199symtype=1
200deltaph=0.01d0
201nphwrt=1
202if (allocated(vqlwrt)) deallocate(vqlwrt)
203allocate(vqlwrt(3,nphwrt))
204vqlwrt(:,:)=0.d0
205notelns=0
206tforce=.false.
207maxitoep=400
208tau0oep=0.1d0
209nkstlist=1
210kstlist(:,1)=1
211vklem(:)=0.d0
212deltaem=0.025d0
213ndspem=1
214nosource=.false.
215spinsprl=.false.
216ssdph=.true.
217vqlss(:)=0.d0
218dvqlss(:)=0.d0
219nwrite=0
220dftu=0
221inpdftu=1
222ndftu=0
223ujdu(:,:)=0.d0
224fdu(:,:)=0.d0
225edu(:,:)=0.d0
226lamdu(:)=0.d0
227udufix(:)=0.d0
228dudufix(:)=0.d0
229tmwrite=.false.
230rdmxctype=2
231rdmmaxscl=2
232maxitn=200
233maxitc=0
234taurdmn=0.5d0
235taurdmc=0.25d0
236rdmalpha=0.656d0
237rdmtemp=0.d0
238reducebf=1.d0
239ptnucl=.true.
240tefvr=.true.
241tefvit=.false.
242minitefv=6
243maxitefv=4
244befvit=0.25d0
245epsefvit=1.d-5
246vecql(:)=0.d0
247mustar=0.15d0
248sqados(1:2)=0.d0
249sqados(3)=1.d0
250test=.false.
251spincore=.false.
252solscf=1.d0
253emaxelnes=-1.2d0
254wsfac(1)=-1.1d6; wsfac(2)=1.1d6
255vhmat(:,:)=0.d0
256vhmat(1,1)=1.d0
257vhmat(2,2)=1.d0
258vhmat(3,3)=1.d0
259reduceh=.true.
260hybrid0=.false.
261hybridc=1.d0
262ecvcut=-3.5d0
263esccut=-0.4d0
264gmaxrf=3.d0
265mbwgrf=-1
266emaxrf=1.d6
267ntemp=40
268nvbse0=2
269ncbse0=3
270nvxbse=0
271ncxbse=0
272bsefull=.false.
273hxbse=.true.
274hdbse=.true.
275fxctype=-1
276fxclrc(1)=0.d0
277fxclrc(2)=0.d0
278rndatposc=0.d0
279rndbfcmt=0.d0
280rndavec=0.d0
281c_tb09=0.d0
282tc_tb09=.false.
283hmaxvr=20.d0
284hkmax=12.d0
285lorbcnd=.false.
286lorbordc=3
287nrmtscf=1.d0
288dnrmtscf=0.d0
289lmaxdos=3
290epsdev=0.0025d0
291npmae0=-1
292wrtvars=.false.
293ftmtype=0
294ntmfix=0
295tauftm=0.1d0
296cmagz=.false.
297axang(:)=0.d0
298dncgga=1.d-8
299tstime=1000.d0
300dtimes=0.1d0
301npulse=0
302nramp=0
303nstep=0
304ntswrite(1)=500
305ntswrite(2)=1
306nxoapwlo=0
307nxlo=0
308tdrho1d=.false.
309tdrho2d=.false.
310tdrho3d=.false.
311tdmag1d=.false.
312tdmag2d=.false.
313tdmag3d=.false.
314tdjr1d=.false.
315tdjr2d=.false.
316tdjr3d=.false.
317tddos=.false.
318tdlsj=.false.
319tdjtk=.false.
320tdxrmk=.false.
321rndevt0=0.d0
322sxcscf=1.d0
323dsxcscf=0.d0
324avecu(:,:)=0.d0
325avecu(1,1)=1.d0
326avecu(2,2)=1.d0
327avecu(3,3)=1.d0
328scu=1.d0
329scu1=1.d0
330scu2=1.d0
331scu3=1.d0
332q0cut=0.d0
333rndbfcu=0.d0
334bfieldcu(:)=0.d0
335efieldcu(:)=0.d0
336tplotq0=.true.
337trdvclr=.false.
338trdbfcr=.false.
339wmaxgw=-10.d0
340tsediag=.false.
341actype=10
342npole=3
343nspade=100
344tfav0=.true.
345rmtscf=1.d0
346mrmtav=0
347rmtall=-1.d0
348maxthd=0
349maxthd1=0
350maxthdmkl=0
351maxlvl=4
352tdphi=0.d0
353thetamld=45.d0*pi/180.d0
354ntsbackup=0
355! Wannier90 variables
356seedname='wannier'
357num_wann=0
358num_bands=0
359num_iter=500
360dis_num_iter=500
361trial_step=1.d-3
362nxlwin=0
363wrtunk=.false.
364tbdip=.false.
365tjr=.false.
366tauefm=0.01d0
367epsefm=1.d-6
368ehfb=1.d0
369t0gclq0=.false.
370tafindt=.false.
371afindpm(:)=0.d0
372afindpm(2)=1.d0
373nkspolar=4
374ntsforce=100
375wphcut=1.d-6
376ephscf(1)=8.d0
377ephscf(2)=0.02d0
378anomalous=.false.
379tephde=.false.
380bdiag=.false.
381ecutb=0.001d0
382ediag=.false.
383pwxpsn=2
384ramdisk=.true.
385wrtdsk=.true.
386epsdmat=1.d-8
387tm3old=.false.
388batch=.false.
389tafspt=.false.
390tbaspat=.false.
391trdatdv=.false.
392atdfc=0.d0
393maxforce=-1.d0
394msmgmt=0
395ntsorth=1000
396deltabf=0.5d0
397jtconst0=.false.
398trmt0=.true.
399ksgwrho=.false.
400npfftg=4
401npfftgc=4
402npfftq=4
403npfftw=4
404tphnat=.false.
405ecutthc=0.01d0
406tbdipu=.false.
407bdipscf=1.d0
408
409!--------------------------!
410! read from elk.in !
411!--------------------------!
412open(50,file='elk.in',status='OLD',form='FORMATTED',iostat=ios)
413if (ios /= 0) then
414 write(*,*)
415 write(*,'("Error(readinput): error opening elk.in")')
416 write(*,*)
417 stop
418end if
41910 continue
420read(50,*,end=30) block
421! check for a comment
422if ((block(1:1) == '!').or.(block(1:1) == '#')) goto 10
423select case(trim(block))
424case('tasks')
425 do i=1,maxtasks
426 read(50,'(A)',err=20) str
427 if (trim(str) == '') then
428 if (i == 1) then
429 write(*,*)
430 write(*,'("Error(readinput): no tasks to perform")')
431 write(*,*)
432 stop
433 end if
434 ntasks=i-1
435 goto 10
436 end if
437 read(str,*,iostat=ios) tasks(i)
438 if (ios /= 0) then
439 write(*,*)
440 write(*,'("Error(readinput): error reading tasks")')
441 write(*,'("(blank line required after tasks block)")')
442 write(*,*)
443 stop
444 end if
445 end do
446 write(*,*)
447 write(*,'("Error(readinput): too many tasks")')
448 write(*,'("Adjust maxtasks in modmain and recompile code")')
449 write(*,*)
450 stop
451case('species')
452! generate a species file
453 call genspecies(50)
454case('fspecies')
455! generate fractional species files
456 do is=1,maxspecies
457 read(50,'(A)',err=20) str
458 if (trim(str) == '') goto 10
459 read(str,*,iostat=ios) zn,symb
460 if (ios /= 0) then
461 write(*,*)
462 write(*,'("Error(readinput): error reading fractional species")')
463 write(*,'("(blank line required after fspecies block)")')
464 write(*,*)
465 stop
466 end if
467 if (zn > 0.d0) then
468 write(*,*)
469 write(*,'("Error(readinput): fractional nuclear Z > 0 : ",G18.10)') zn
470 write(*,*)
471 stop
472 end if
473 call genfspecies(zn,symb)
474 end do
475 write(*,*)
476 write(*,'("Error(readinput): too many fractional nucleus species")')
477 write(*,*)
478 stop
479case('avec')
480 do i=1,3
481 read(50,'(A)',err=20) str
482 read(str,*,err=20) avec(:,i)
483 read(str,*,iostat=ios) avec(:,i),davec(:,i)
484 end do
485case('scale')
486 read(50,*,err=20) sc
487case('scale1')
488 read(50,*,err=20) sc1
489case('scale2')
490 read(50,*,err=20) sc2
491case('scale3')
492 read(50,*,err=20) sc3
493case('scalex')
494 read(50,*,err=20) scx
495case('scaley')
496 read(50,*,err=20) scy
497case('scalez')
498 read(50,*,err=20) scz
499case('epslat')
500 read(50,*,err=20) epslat
501 if (epslat <= 0.d0) then
502 write(*,*)
503 write(*,'("Error(readinput): epslat <= 0 : ",G18.10)') epslat
504 write(*,*)
505 stop
506 end if
507case('primcell')
508 read(50,*,err=20) primcell
509case('tshift')
510 read(50,*,err=20) tshift
511case('autokpt')
512 read(50,*,err=20) autokpt
513case('radkpt')
514 read(50,*,err=20) radkpt
515 if (radkpt <= 0.d0) then
516 write(*,*)
517 write(*,'("Error(readinput): radkpt <= 0 : ",G18.10)') radkpt
518 write(*,*)
519 stop
520 end if
521case('ngridk')
522 read(50,'(A)',err=20) str
523 read(str,*,err=20) ngridk(:)
524 read(str,*,iostat=ios) ngridk(:),dngridk(:)
525 if (any(ngridk(:) < 1)) then
526 write(*,*)
527 write(*,'("Error(readinput): invalid ngridk : ",3I8)') ngridk
528 write(*,*)
529 stop
530 end if
531 autokpt=.false.
532case('vkloff')
533 read(50,*,err=20) vkloff(:)
534 if (any(vkloff(:) < 0.d0).or.any(vkloff(:) >= 1.d0)) then
535 write(*,*)
536 write(*,'("Error(readinput): vkloff components should be in [0,1) : ",&
537 &3G18.10)') vkloff
538 write(*,*)
539 stop
540 end if
541case('reducek')
542 read(50,*,err=20) reducek
543case('ngridq')
544 read(50,*,err=20) ngridq(:)
545 if (any(ngridq(:) < 1)) then
546 write(*,*)
547 write(*,'("Error(readinput): invalid ngridq : ",3I8)') ngridq
548 write(*,*)
549 stop
550 end if
551case('reduceq')
552 read(50,*,err=20) reduceq
553case('rgkmax')
554 read(50,'(A)',err=20) str
555 read(str,*,err=20) rgkmax
556 read(str,*,iostat=ios) rgkmax,drgkmax
557 if (rgkmax <= 0.d0) then
558 write(*,*)
559 write(*,'("Error(readinput): rgkmax <= 0 : ",G18.10)') rgkmax
560 write(*,*)
561 stop
562 end if
563case('gmaxvr')
564 read(50,'(A)',err=20) str
565 read(str,*,err=20) gmaxvr
566 read(str,*,iostat=ios) gmaxvr,dgmaxvr
567case('lmaxapw')
568 read(50,'(A)',err=20) str
569 read(str,*,err=20) lmaxapw
570 read(str,*,iostat=ios) lmaxapw,dlmaxapw
571 if (lmaxapw < 0) then
572 write(*,*)
573 write(*,'("Error(readinput): lmaxapw < 0 : ",I8)') lmaxapw
574 write(*,*)
575 stop
576 end if
577 if (lmaxapw >= maxlapw) then
578 write(*,*)
579 write(*,'("Error(readinput): lmaxapw too large : ",I8)') lmaxapw
580 write(*,'("Adjust maxlapw in modmain and recompile code")')
581 write(*,*)
582 stop
583 end if
584case('lmaxo','lmaxvr')
585 read(50,'(A)',err=20) str
586 read(str,*,err=20) lmaxo
587 read(str,*,iostat=ios) lmaxo,dlmaxo
588 if (lmaxo < 3) then
589 write(*,*)
590 write(*,'("Error(readinput): lmaxo < 3 : ",I8)') lmaxo
591 write(*,*)
592 stop
593 end if
594case('lmaxi','lmaxinr')
595 read(50,*,err=20) lmaxi
596 if (lmaxi < 1) then
597 write(*,*)
598 write(*,'("Error(readinput): lmaxi < 1 : ",I8)') lmaxi
599 write(*,*)
600 stop
601 end if
602case('lmaxmat')
603 read(50,*,err=20)
604 write(*,'("Info(readinput): variable ''lmaxmat'' is no longer used")')
605case('fracinr')
606 read(50,*,err=20) fracinr
607case('trhonorm')
608 read(50,*,err=20) trhonorm
609case('spinpol')
610 read(50,*,err=20) spinpol
611case('spinorb')
612 read(50,*,err=20) spinorb
613case('socscf')
614 read(50,*,err=20) socscf
615 if (socscf < 0.d0) then
616 write(*,*)
617 write(*,'("Error(readinput): socscf < 0 : ",G18.10)') socscf
618 write(*,*)
619 stop
620 end if
621case('bforb')
622 read(50,*,err=20) bforb
623case('bfdmag')
624 read(50,*,err=20) bfdmag
625case('xctype')
626 read(50,'(A)',err=20) str
627 str=trim(str)//' 0 0'
628 read(str,*,err=20) xctype(:)
629case('xctsp')
630 read(50,'(A)',err=20) str
631 str=trim(str)//' 0 0'
632 read(str,*,err=20) xctsp(:)
633case('ktype')
634 read(50,'(A)',err=20) str
635 str=trim(str)//' 0 0'
636 read(str,*,err=20) ktype(:)
637 if (ktype(3) /= 0) then
638 write(*,*)
639 write(*,'("Error(readinput): ktype(3) should be zero : ",I8)') ktype(3)
640 write(*,*)
641 stop
642 end if
643case('stype')
644 read(50,*,err=20) stype
645case('swidth')
646 read(50,*,err=20) swidth
647 if (swidth < 1.d-9) then
648 write(*,*)
649 write(*,'("Error(readinput): swidth too small or negative : ",G18.10)') &
650 swidth
651 write(*,*)
652 stop
653 end if
654case('autoswidth')
655 read(50,*,err=20) autoswidth
656case('mstar')
657 read(50,*,err=20) mstar
658 if (mstar <= 0.d0) then
659 write(*,*)
660 write(*,'("Error(readinput): mstar <= 0 : ",G18.10)') mstar
661 write(*,*)
662 stop
663 end if
664case('epsocc')
665 read(50,*,err=20) epsocc
666 if (epsocc <= 0.d0) then
667 write(*,*)
668 write(*,'("Error(readinput): epsocc <= 0 : ",G18.10)') epsocc
669 write(*,*)
670 stop
671 end if
672case('epschg')
673 read(50,*,err=20) epschg
674 if (epschg <= 0.d0) then
675 write(*,*)
676 write(*,'("Error(readinput): epschg <= 0 : ",G18.10)') epschg
677 write(*,*)
678 stop
679 end if
680case('nempty','nempty0')
681 read(50,'(A)',err=20) str
682 read(str,*,err=20) nempty0
683 read(str,*,iostat=ios) nempty0,dnempty0
684 if (nempty0 <= 0.d0) then
685 write(*,*)
686 write(*,'("Error(readinput): nempty <= 0 : ",G18.10)') nempty0
687 write(*,*)
688 stop
689 end if
690case('mixtype')
691 read(50,*,err=20) mixtype
692case('mixsave')
693 read(50,*,err=20) mixsave
694case('amixpm','beta0','betamax')
695 if (trim(block) == 'amixpm') then
696 read(50,*,err=20) amixpm(:)
697 else if (trim(block) == 'beta0') then
698 read(50,*,err=20) amixpm(1)
699 else
700 read(50,*,err=20) amixpm(2)
701 end if
702 if (amixpm(1) < 0.d0) then
703 write(*,*)
704 write(*,'("Error(readinput): beta0 [amixpm(1)] < 0 : ",G18.10)') amixpm(1)
705 write(*,*)
706 stop
707 end if
708 if ((amixpm(2) < 0.d0).or.(amixpm(2) > 1.d0)) then
709 write(*,*)
710 write(*,'("Error(readinput): betamax [amixpm(2)] not in [0,1] : ",G18.10)')&
711 amixpm(2)
712 write(*,*)
713 stop
714 end if
715case('mixsdb')
716 read(50,*,err=20) mixsdb
717 if (mixsdb < 2) then
718 write(*,*)
719 write(*,'("Error(readinput): mixsdb < 2 : ",I8)') mixsdb
720 write(*,*)
721 stop
722 end if
723case('broydpm')
724 read(50,*,err=20) broydpm(:)
725 if ((broydpm(1) < 0.d0).or.(broydpm(1) > 1.d0).or. &
726 (broydpm(2) < 0.d0).or.(broydpm(2) > 1.d0)) then
727 write(*,*)
728 write(*,'("Error(readinput): invalid Broyden mixing parameters : ",&
729 &2G18.10)') broydpm
730 write(*,*)
731 stop
732 end if
733case('mixrho')
734 read(50,*,err=20) mixrho
735case('maxscl')
736 read(50,*,err=20) maxscl
737 if (maxscl < 0) then
738 write(*,*)
739 write(*,'("Error(readinput): maxscl < 0 : ",I8)') maxscl
740 write(*,*)
741 stop
742 end if
743case('epspot')
744 read(50,*,err=20) epspot
745case('epsengy')
746 read(50,*,err=20) epsengy
747case('epsforce')
748 read(50,*,err=20) epsforce
749case('epsstress')
750 read(50,*,err=20) epsstress
751case('sppath')
752 read(50,*,err=20) sppath
753 sppath=adjustl(sppath)
754case('scrpath')
755 read(50,*,err=20) scrpath
756case('molecule')
757 read(50,*,err=20) molecule
758case('atoms')
759 read(50,*,err=20) nspecies
760 if (nspecies < 1) then
761 write(*,*)
762 write(*,'("Error(readinput): nspecies < 1 : ",I8)') nspecies
763 write(*,*)
764 stop
765 end if
766 if (nspecies > maxspecies) then
767 write(*,*)
768 write(*,'("Error(readinput): nspecies too large : ",I8)') nspecies
769 write(*,'("Adjust maxspecies in modmain and recompile code")')
770 write(*,*)
771 stop
772 end if
773 do is=1,nspecies
774 read(50,*,err=20) spfname(is)
775 spfname(is)=adjustl(spfname(is))
776 read(50,*,err=20) natoms(is)
777 if (natoms(is) < 1) then
778 write(*,*)
779 write(*,'("Error(readinput): natoms < 1 : ",I8)') natoms(is)
780 write(*,'(" for species ",I4)') is
781 write(*,*)
782 stop
783 end if
784 if (natoms(is) > maxatoms) then
785 write(*,*)
786 write(*,'("Error(readinput): natoms too large : ",I8)') natoms(is)
787 write(*,'(" for species ",I4)') is
788 write(*,'("Adjust maxatoms in modmain and recompile code")')
789 write(*,*)
790 stop
791 end if
792 do ia=1,natoms(is)
793 read(50,'(A)',err=20) str
794 read(str,*,err=20) atposl(:,ia,is)
795 read(str,*,iostat=ios) atposl(:,ia,is),bfcmt0(:,ia,is),datposl(:,ia,is)
796 end do
797 end do
798case('plot1d')
799 read(50,*,err=20) nvp1d,npp1d
800 if (nvp1d < 1) then
801 write(*,*)
802 write(*,'("Error(readinput): nvp1d < 1 : ",I8)') nvp1d
803 write(*,*)
804 stop
805 end if
806 if (npp1d < nvp1d) then
807 write(*,*)
808 write(*,'("Error(readinput): npp1d < nvp1d : ",2I8)') npp1d,nvp1d
809 write(*,*)
810 stop
811 end if
812 if (allocated(vvlp1d)) deallocate(vvlp1d)
813 allocate(vvlp1d(3,nvp1d))
814 do i=1,nvp1d
815 read(50,*,err=20) vvlp1d(:,i)
816 end do
817case('ip01d')
818 read(50,*,err=20) ip01d
819 if (ip01d < 1) then
820 write(*,*)
821 write(*,'("Error(readinput): ip01d < 1 : ",I8)') ip01d
822 write(*,*)
823 stop
824 end if
825case('plot2d')
826 read(50,*,err=20) vclp2d(:,0)
827 read(50,*,err=20) vclp2d(:,1)
828 read(50,*,err=20) vclp2d(:,2)
829 read(50,*,err=20) np2d(:)
830 if ((np2d(1) < 1).or.(np2d(2) < 1)) then
831 write(*,*)
832 write(*,'("Error(readinput): np2d < 1 : ",2I8)') np2d
833 write(*,*)
834 stop
835 end if
836case('plot3d')
837 read(50,*,err=20) vclp3d(:,0)
838 read(50,*,err=20) vclp3d(:,1)
839 read(50,*,err=20) vclp3d(:,2)
840 read(50,*,err=20) vclp3d(:,3)
841 read(50,*,err=20) np3d(:)
842 if ((np3d(1) < 1).or.(np3d(2) < 1).or.(np3d(3) < 1)) then
843 write(*,*)
844 write(*,'("Error(readinput): np3d < 1 : ",3I8)') np3d
845 write(*,*)
846 stop
847 end if
848case('wplot','dos')
849 read(50,*,err=20) nwplot,ngrkf,nswplot
850 if (nwplot < 2) then
851 write(*,*)
852 write(*,'("Error(readinput): nwplot < 2 : ",I8)') nwplot
853 write(*,*)
854 stop
855 end if
856 if (ngrkf < 1) then
857 write(*,*)
858 write(*,'("Error(readinput): ngrkf < 1 : ",I8)') ngrkf
859 write(*,*)
860 stop
861 end if
862 if (nswplot < 0) then
863 write(*,*)
864 write(*,'("Error(readinput): nswplot < 0 : ",I8)') nswplot
865 write(*,*)
866 stop
867 end if
868 read(50,*,err=20) wplot(:)
869 if (wplot(1) > wplot(2)) then
870 write(*,*)
871 write(*,'("Error(readinput): wplot(1) > wplot(2) : ",2G18.10)') wplot
872 write(*,*)
873 stop
874 end if
875case('dosocc')
876 read(50,*,err=20) dosocc
877case('tpdos')
878 read(50,*,err=20) tpdos
879case('dosmsum')
880 read(50,*,err=20) dosmsum
881case('dosssum')
882 read(50,*,err=20) dosssum
883case('lmirep')
884 read(50,*,err=20) lmirep
885case('atpopt')
886 read(50,*,err=20) atpopt
887case('maxatpstp','maxatmstp')
888 read(50,*,err=20) maxatpstp
889 if (maxatpstp < 1) then
890 write(*,*)
891 write(*,'("Error(readinput): maxatpstp < 1 : ",I8)') maxatpstp
892 write(*,*)
893 stop
894 end if
895case('tau0atp','tau0atm')
896 read(50,*,err=20) tau0atp
897case('deltast')
898 read(50,*,err=20) deltast
899 if (deltast <= 0.d0) then
900 write(*,*)
901 write(*,'("Error(readinput): deltast <= 0 : ",G18.10)') deltast
902 write(*,*)
903 stop
904 end if
905case('avecref')
906 read(50,*,err=20) avecref(:,1)
907 read(50,*,err=20) avecref(:,2)
908 read(50,*,err=20) avecref(:,3)
909case('latvopt')
910 read(50,*,err=20) latvopt
911case('maxlatvstp')
912 read(50,*,err=20) maxlatvstp
913 if (maxlatvstp < 1) then
914 write(*,*)
915 write(*,'("Error(readinput): maxlatvstp < 1 : ",I8)') maxlatvstp
916 write(*,*)
917 stop
918 end if
919case('tau0latv')
920 read(50,*,err=20) tau0latv
921case('nstfsp')
922 read(50,*,err=20)
923 write(*,'("Info(readinput): variable ''nstfsp'' is no longer used")')
924case('lradstp')
925 read(50,*,err=20) lradstp
926 if (lradstp < 1) then
927 write(*,*)
928 write(*,'("Error(readinput): lradstp < 1 : ",I8)') lradstp
929 write(*,*)
930 stop
931 end if
932case('chgexs')
933 read(50,'(A)',err=20) str
934 read(str,*,err=20) chgexs
935 read(str,*,iostat=ios) chgexs,dchgexs
936case('nprad')
937 read(50,*,err=20)
938 write(*,'("Info(readinput): variable ''nprad'' is no longer used")')
939case('scissor')
940 read(50,*,err=20) scissor
941case('noptcomp')
942 read(50,*,err=20) noptcomp
943 if ((noptcomp < 1).or.(noptcomp > 27)) then
944 write(*,*)
945 write(*,'("Error(readinput): noptcomp should be from 1 to 27 : ",I8)') &
946 noptcomp
947 write(*,*)
948 stop
949 end if
950case('optcomp')
951 do i=1,27
952 read(50,'(A)',err=20) str
953 if (trim(str) == '') then
954 if (i == 1) then
955 write(*,*)
956 write(*,'("Error(readinput): empty optical component list")')
957 write(*,*)
958 stop
959 end if
960 noptcomp=i-1
961 goto 10
962 end if
963 str=trim(str)//' 1 1'
964 read(str,*,iostat=ios) optcomp(:,i)
965 if (ios /= 0) then
966 write(*,*)
967 write(*,'("Error(readinput): error reading optical component list")')
968 write(*,'("(blank line required after optcomp block)")')
969 write(*,*)
970 stop
971 end if
972 if (any(optcomp(:,i) < 1).or.any(optcomp(:,i) > 3)) then
973 write(*,*)
974 write(*,'("Error(readinput): invalid optcomp : ",3I8)') optcomp(:,i)
975 write(*,*)
976 stop
977 end if
978 end do
979 write(*,*)
980 write(*,'("Error(readinput): optical component list too long")')
981 write(*,*)
982 stop
983case('intraband')
984 read(50,*,err=20) intraband
985case('evaltol')
986 read(50,*,err=20) evaltol
987case('deband')
988 read(50,*,err=20)
989 write(*,'("Info(readinput): variable ''deband'' is no longer used")')
990case('epsband')
991 read(50,*,err=20) epsband
992 if (epsband <= 0.d0) then
993 write(*,*)
994 write(*,'("Error(readinput): epsband <= 0 : ",G18.10)') epsband
995 write(*,*)
996 stop
997 end if
998case('demaxbnd')
999 read(50,*,err=20) demaxbnd
1000 if (demaxbnd <= 0.d0) then
1001 write(*,*)
1002 write(*,'("Error(readinput): demaxbnd <= 0 : ",G18.10)') demaxbnd
1003 write(*,*)
1004 stop
1005 end if
1006case('autolinengy')
1007 read(50,*,err=20) autolinengy
1008case('deapw')
1009 read(50,*,err=20) deapw
1010 if (abs(deapw) < 1.d-8) then
1011 write(*,*)
1012 write(*,'("Error(readinput): invalid deapw : ",G18.10)') deapw
1013 write(*,*)
1014 stop
1015 end if
1016case('delorb')
1017 read(50,*,err=20) delorb
1018 if (abs(delorb) < 1.d-8) then
1019 write(*,*)
1020 write(*,'("Error(readinput): invalid delorb : ",G18.10)') delorb
1021 write(*,*)
1022 stop
1023 end if
1024case('dlefe')
1025 read(50,*,err=20) dlefe
1026case('bfieldc')
1027 read(50,'(A)',err=20) str
1028 read(str,*,err=20) bfieldc0(:)
1029 read(str,*,iostat=ios) bfieldc0(:),dbfieldc0(:)
1030case('efieldc')
1031 read(50,*,err=20) efieldc(:)
1032case('dmaxefc')
1033 read(50,*,err=20) dmaxefc
1034 if (dmaxefc < 0) then
1035 write(*,*)
1036 write(*,'("Error(readinput): dmaxefc < 0 : ",G18.10)') dmaxefc
1037 write(*,*)
1038 stop
1039 end if
1040case('afieldc')
1041 read(50,'(A)',err=20) str
1042 read(str,*,err=20) afieldc(:)
1043 read(str,*,iostat=ios) afieldc(:),dafieldc(:)
1044case('afspc')
1045 do i=1,3
1046 read(50,'(A)',err=20) str
1047 read(str,*,err=20) afspc(i,:)
1048 read(str,*,iostat=ios) afspc(i,:),dafspc(i,:)
1049 end do
1050case('fsmtype','fixspin')
1051 read(50,*,err=20) fsmtype
1052case('momfix')
1053 read(50,'(A)',err=20) str
1054 read(str,*,err=20) momfix(:)
1055 read(str,*,iostat=ios) momfix(:),dmomfix(:)
1056case('momfixm')
1057 read(50,*,err=20) momfixm
1058 if (momfixm < 0.d0) then
1059 write(*,*)
1060 write(*,'("Error(readinput): momfixm < 0 : ",G18.10)') momfixm
1061 write(*,*)
1062 stop
1063 end if
1064case('mommtfix')
1065 do ias=1,maxspecies*maxatoms
1066 read(50,'(A)',err=20) str
1067 if (trim(str) == '') goto 10
1068 read(str,*,iostat=ios) is,ia,mommtfix(:,ia,is)
1069 if (ios /= 0) then
1070 write(*,*)
1071 write(*,'("Error(readinput): error reading muffin-tin fixed spin &
1072 &moments")')
1073 write(*,'("(blank line required after mommtfix block)")')
1074 write(*,*)
1075 stop
1076 end if
1077 end do
1078case('mommtfixm')
1079 do ias=1,maxspecies*maxatoms
1080 read(50,'(A)',err=20) str
1081 if (trim(str) == '') goto 10
1082 read(str,*,iostat=ios) is,ia,mommtfixm(ia,is)
1083 if (ios /= 0) then
1084 write(*,*)
1085 write(*,'("Error(readinput): error reading muffin-tin fixed spin &
1086 &moment magnitudes")')
1087 write(*,'("(blank line required after mommtfixm block)")')
1088 write(*,*)
1089 stop
1090 end if
1091 end do
1092case('taufsm')
1093 read(50,*,err=20) taufsm
1094 if (taufsm < 0.d0) then
1095 write(*,*)
1096 write(*,'("Error(readinput): taufsm < 0 : ",G18.10)') taufsm
1097 write(*,*)
1098 stop
1099 end if
1100case('autormt')
1101 read(50,*,err=20)
1102 write(*,'("Info(readinput): variable ''autormt'' is no longer used")')
1103case('rmtdelta')
1104 read(50,*,err=20) rmtdelta
1105 if (rmtdelta < 0.d0) then
1106 write(*,*)
1107 write(*,'("Warning(readinput): rmtdelta < 0 : ",G18.10)') rmtdelta
1108 end if
1109case('isgkmax')
1110 read(50,*,err=20) isgkmax
1111case('nosym')
1112 read(50,*,err=20) lv
1113 if (lv) symtype=0
1114case('symtype')
1115 read(50,*,err=20) symtype
1116 if ((symtype < 0).or.(symtype > 2)) then
1117 write(*,*)
1118 write(*,'("Error(readinput): symtype not defined : ",I8)') symtype
1119 write(*,*)
1120 stop
1121 end if
1122case('deltaph')
1123 read(50,*,err=20) deltaph
1124 if (deltaph <= 0.d0) then
1125 write(*,*)
1126 write(*,'("Error(readinput): deltaph <= 0 : ",G18.10)') deltaph
1127 write(*,*)
1128 stop
1129 end if
1130case('phwrite')
1131 read(50,*,err=20) nphwrt
1132 if (nphwrt < 1) then
1133 write(*,*)
1134 write(*,'("Error(readinput): nphwrt < 1 : ",I8)') nphwrt
1135 write(*,*)
1136 stop
1137 end if
1138 if (allocated(vqlwrt)) deallocate(vqlwrt)
1139 allocate(vqlwrt(3,nphwrt))
1140 do i=1,nphwrt
1141 read(50,*,err=20) vqlwrt(:,i)
1142 end do
1143case('notes')
1144 if (allocated(notes)) deallocate(notes)
1145 allocate(notes(0))
1146 notelns=0
1147 do
1148 read(50,'(A)') str
1149 if (trim(str) == '') goto 10
1150 notes=[notes(1:notelns),str]
1151 notelns=notelns+1
1152 end do
1153case('tforce')
1154 read(50,*,err=20) tforce
1155case('tfibs')
1156 read(50,*,err=20)
1157 write(*,'("Info(readinput): variable ''tfibs'' is no longer used")')
1158case('maxitoep')
1159 read(50,*,err=20) maxitoep
1160 if (maxitoep < 1) then
1161 write(*,*)
1162 write(*,'("Error(readinput): maxitoep < 1 : ",I8)') maxitoep
1163 write(*,*)
1164 stop
1165 end if
1166case('tauoep')
1167 read(50,*,err=20)
1168 write(*,'("Info(readinput): variable ''tauoep'' is no longer used")')
1169case('tau0oep')
1170 read(50,*,err=20) tau0oep
1171 if (tau0oep < 0.d0) then
1172 write(*,*)
1173 write(*,'("Error(readinput): tau0oep < 0 : ",G18.10)') tau0oep
1174 write(*,*)
1175 stop
1176 end if
1177case('kstlist')
1178 do i=1,maxkst
1179 read(50,'(A)',err=20) str
1180 if (trim(str) == '') then
1181 if (i == 1) then
1182 write(*,*)
1183 write(*,'("Error(readinput): empty k-point and state list")')
1184 write(*,*)
1185 stop
1186 end if
1187 nkstlist=i-1
1188 goto 10
1189 end if
1190 str=trim(str)//' 1'
1191 read(str,*,iostat=ios) kstlist(:,i)
1192 if (ios /= 0) then
1193 write(*,*)
1194 write(*,'("Error(readinput): error reading k-point and state list")')
1195 write(*,'("(blank line required after kstlist block)")')
1196 write(*,*)
1197 stop
1198 end if
1199 end do
1200 write(*,*)
1201 write(*,'("Error(readinput): k-point and state list too long")')
1202 write(*,*)
1203 stop
1204case('vklem')
1205 read(50,*,err=20) vklem
1206case('deltaem')
1207 read(50,*,err=20) deltaem
1208 if (deltaem <= 0.d0) then
1209 write(*,*)
1210 write(*,'("Error(readinput): deltaem <= 0 : ",G18.10)') deltaem
1211 write(*,*)
1212 stop
1213 end if
1214case('ndspem')
1215 read(50,*,err=20) ndspem
1216 if ((ndspem < 1).or.(ndspem > 4)) then
1217 write(*,*)
1218 write(*,'("Error(readinput): ndspem out of range : ",I8)') ndspem
1219 write(*,*)
1220 stop
1221 end if
1222case('nosource')
1223 read(50,*,err=20) nosource
1224case('spinsprl')
1225 read(50,*,err=20) spinsprl
1226case('ssdph')
1227 read(50,*,err=20) ssdph
1228case('vqlss')
1229 read(50,'(A)',err=20) str
1230 read(str,*,err=20) vqlss
1231 read(str,*,iostat=ios) vqlss,dvqlss
1232case('nwrite')
1233 read(50,*,err=20) nwrite
1234case('DFT+U','dft+u','lda+u')
1235 read(50,*,err=20) dftu,inpdftu
1236 do i=1,maxdftu
1237 read(50,'(A)',err=20) str
1238 if (trim(str) == '') then
1239 ndftu=i-1
1240 goto 10
1241 end if
1242 select case(inpdftu)
1243 case(1)
1244 read(str,*,iostat=ios) is,l,ujdu(1:2,i)
1245 case(2)
1246 read(str,*,iostat=ios) is,l,(fdu(k,i),k=0,2*l,2)
1247 case(3)
1248 read(str,*,iostat=ios) is,l,(edu(k,i),k=0,l)
1249 case(4)
1250 read(str,*,iostat=ios) is,l,lamdu(i)
1251 case(5)
1252 read(str,*,iostat=ios) is,l,udufix(i),dudufix(i)
1253 read(str,*,iostat=ios) is,l,udufix(i)
1254 case default
1255 write(*,*)
1256 write(*,'("Error(readinput): invalid inpdftu : ",I8)') inpdftu
1257 write(*,*)
1258 stop
1259 end select
1260 if (ios /= 0) then
1261 write(*,*)
1262 write(*,'("Error(readinput): error reading DFT+U parameters")')
1263 write(*,'("(blank line required after dft+u block)")')
1264 write(*,*)
1265 stop
1266 end if
1267 if ((is < 1).or.(is >= maxspecies)) then
1268 write(*,*)
1269 write(*,'("Error(readinput): invalid species number in dft+u block : ", &
1270 &I8)') is
1271 write(*,*)
1272 stop
1273 end if
1274 if (l < 0) then
1275 write(*,*)
1276 write(*,'("Error(readinput): l < 0 in dft+u block : ",I8)') l
1277 write(*,*)
1278 stop
1279 end if
1280 if (l > lmaxdm) then
1281 write(*,*)
1282 write(*,'("Error(readinput): l > lmaxdm in dft+u block : ",2I8)') l,lmaxdm
1283 write(*,*)
1284 stop
1285 end if
1286! check for repeated entries
1287 do j=1,i-1
1288 if ((is == isldu(1,j)).and.(l == isldu(2,j))) then
1289 write(*,*)
1290 write(*,'("Error(readinput): repeated entry in DFT+U block")')
1291 write(*,*)
1292 stop
1293 end if
1294 end do
1295 isldu(1,i)=is
1296 isldu(2,i)=l
1297 end do
1298 write(*,*)
1299 write(*,'("Error(readinput): too many DFT+U entries")')
1300 write(*,'("Adjust maxdftu in modmain and recompile code")')
1301 write(*,*)
1302 stop
1303case('tmwrite','tmomlu')
1304 read(50,*,err=20) tmwrite
1305case('readadu','readalu')
1306 read(50,*,err=20)
1307 write(*,'("Info(readinput): variable ''readadu'' is no longer used")')
1308case('rdmxctype')
1309 read(50,*,err=20) rdmxctype
1310case('rdmmaxscl')
1311 read(50,*,err=20) rdmmaxscl
1312 if (rdmmaxscl < 0) then
1313 write(*,*)
1314 write(*,'("Error(readinput): rdmmaxscl < 0 : ",I8)') rdmmaxscl
1315 write(*,*)
1316 end if
1317case('maxitn')
1318 read(50,*,err=20) maxitn
1319case('maxitc')
1320 read(50,*,err=20) maxitc
1321case('taurdmn')
1322 read(50,*,err=20) taurdmn
1323 if (taurdmn < 0.d0) then
1324 write(*,*)
1325 write(*,'("Error(readinput): taurdmn < 0 : ",G18.10)') taurdmn
1326 write(*,*)
1327 stop
1328 end if
1329case('taurdmc')
1330 read(50,*,err=20) taurdmc
1331 if (taurdmc < 0.d0) then
1332 write(*,*)
1333 write(*,'("Error(readinput): taurdmc < 0 : ",G18.10)') taurdmc
1334 write(*,*)
1335 stop
1336 end if
1337case('rdmalpha')
1338 read(50,*,err=20) rdmalpha
1339 if ((rdmalpha <= 0.d0).or.(rdmalpha >= 1.d0)) then
1340 write(*,*)
1341 write(*,'("Error(readinput): rdmalpha not in (0,1) : ",G18.10)') rdmalpha
1342 write(*,*)
1343 stop
1344 end if
1345case('rdmtemp')
1346 read(50,*,err=20) rdmtemp
1347 if (rdmtemp < 0.d0) then
1348 write(*,*)
1349 write(*,'("Error(readinput): rdmtemp < 0 : ",G18.10)') rdmtemp
1350 write(*,*)
1351 stop
1352 end if
1353case('reducebf')
1354 read(50,*,err=20) reducebf
1355 if ((reducebf < 0.49d0).or.(reducebf > 1.d0)) then
1356 write(*,*)
1357 write(*,'("Error(readinput): reducebf not in [0.5,1] : ",G18.10)') reducebf
1358 write(*,*)
1359 stop
1360 end if
1361case('ptnucl')
1362 read(50,*,err=20) ptnucl
1363case('tefvr','tseqr')
1364 read(50,*,err=20) tefvr
1365case('tefvit','tseqit')
1366 read(50,*,err=20) tefvit
1367case('minitefv','minseqit')
1368 read(50,*,err=20) minitefv
1369 if (minitefv < 1) then
1370 write(*,*)
1371 write(*,'("Error(readinput): minitefv < 1 : ",I8)') minitefv
1372 write(*,*)
1373 stop
1374 end if
1375case('maxitefv','maxseqit')
1376 read(50,*,err=20) maxitefv
1377 if (maxitefv < 1) then
1378 write(*,*)
1379 write(*,'("Error(readinput): maxitefv < 1 : ",I8)') maxitefv
1380 write(*,*)
1381 stop
1382 end if
1383case('befvit','bseqit')
1384 read(50,*,err=20) befvit
1385 if (befvit <= 0.d0) then
1386 write(*,*)
1387 write(*,'("Error(readinput): befvit <= 0 : ",G18.10)') befvit
1388 write(*,*)
1389 stop
1390 end if
1391case('epsefvit','epsseqit')
1392 read(50,*,err=20) epsefvit
1393 if (epsefvit < 0.d0) then
1394 write(*,*)
1395 write(*,'("Error(readinput): epsefvit < 0 : ",G18.10)') epsefvit
1396 write(*,*)
1397 stop
1398 end if
1399case('nseqit')
1400 read(50,*,err=20)
1401 write(*,'("Info(readinput): variable ''nseqit'' is no longer used")')
1402case('tauseq')
1403 read(50,*,err=20)
1404 write(*,'("Info(readinput): variable ''tauseq'' is no longer used")')
1405case('vecql')
1406 read(50,*,err=20) vecql(:)
1407case('mustar')
1408 read(50,*,err=20) mustar
1409case('sqados')
1410 read(50,*,err=20) sqados(:)
1411case('test')
1412 read(50,*,err=20) test
1413case('frozencr')
1414 read(50,*,err=20)
1415 write(*,'("Info(readinput): variable ''frozencr'' is no longer used")')
1416case('spincore')
1417 read(50,*,err=20) spincore
1418case('solscf')
1419 read(50,*,err=20) solscf
1420 if (solscf < 0.d0) then
1421 write(*,*)
1422 write(*,'("Error(readinput): solscf < 0 : ",G18.10)') solscf
1423 write(*,*)
1424 stop
1425 end if
1426case('emaxelnes')
1427 read(50,*,err=20) emaxelnes
1428case('wsfac')
1429 read(50,*,err=20) wsfac(:)
1430case('vhmat')
1431 read(50,*,err=20) vhmat(1,:)
1432 read(50,*,err=20) vhmat(2,:)
1433 read(50,*,err=20) vhmat(3,:)
1434case('reduceh')
1435 read(50,*,err=20) reduceh
1436case('hybrid')
1437 read(50,*,err=20) hybrid0
1438case('hybridc','hybmix')
1439 read(50,*,err=20) hybridc
1440 if ((hybridc < 0.d0).or.(hybridc > 1.d0)) then
1441 write(*,*)
1442 write(*,'("Error(readinput): invalid hybridc : ",G18.10)') hybridc
1443 write(*,*)
1444 stop
1445 end if
1446case('ecvcut')
1447 read(50,*,err=20) ecvcut
1448case('esccut')
1449 read(50,*,err=20) esccut
1450case('nvbse')
1451 read(50,*,err=20) nvbse0
1452 if (nvbse0 < 0) then
1453 write(*,*)
1454 write(*,'("Error(readinput): nvbse < 0 : ",I8)') nvbse0
1455 write(*,*)
1456 stop
1457 end if
1458case('ncbse')
1459 read(50,*,err=20) ncbse0
1460 if (ncbse0 < 0) then
1461 write(*,*)
1462 write(*,'("Error(readinput): ncbse < 0 : ",I8)') ncbse0
1463 write(*,*)
1464 stop
1465 end if
1466case('istxbse')
1467 do i=1,maxxbse
1468 read(50,'(A)',err=20) str
1469 if (trim(str) == '') then
1470 if (i == 1) then
1471 write(*,*)
1472 write(*,'("Error(readinput): empty BSE extra valence state list")')
1473 write(*,*)
1474 stop
1475 end if
1476 nvxbse=i-1
1477 goto 10
1478 end if
1479 read(str,*,iostat=ios) istxbse(i)
1480 if (ios /= 0) then
1481 write(*,*)
1482 write(*,'("Error(readinput): error reading BSE valence state list")')
1483 write(*,'("(blank line required after istxbse block)")')
1484 write(*,*)
1485 stop
1486 end if
1487 end do
1488 write(*,*)
1489 write(*,'("Error(readinput): BSE extra valence state list too long")')
1490 write(*,*)
1491 stop
1492case('jstxbse')
1493 do i=1,maxxbse
1494 read(50,'(A)',err=20) str
1495 if (trim(str) == '') then
1496 if (i == 1) then
1497 write(*,*)
1498 write(*,'("Error(readinput): empty BSE extra conduction state list")')
1499 write(*,*)
1500 stop
1501 end if
1502 ncxbse=i-1
1503 goto 10
1504 end if
1505 read(str,*,iostat=ios) jstxbse(i)
1506 if (ios /= 0) then
1507 write(*,*)
1508 write(*,'("Error(readinput): error reading BSE conduction state list")')
1509 write(*,'("(blank line required after jstxbse block)")')
1510 write(*,*)
1511 stop
1512 end if
1513 end do
1514 write(*,*)
1515 write(*,'("Error(readinput): BSE extra conduction state list too long")')
1516 write(*,*)
1517 stop
1518case('bsefull')
1519 read(50,*,err=20) bsefull
1520case('hxbse')
1521 read(50,*,err=20) hxbse
1522case('hdbse')
1523 read(50,*,err=20) hdbse
1524case('gmaxrf','gmaxrpa')
1525 read(50,*,err=20) gmaxrf
1526 if (gmaxrf < 0.d0) then
1527 write(*,*)
1528 write(*,'("Error(readinput): gmaxrf < 0 : ",G18.10)') gmaxrf
1529 write(*,*)
1530 stop
1531 end if
1532case('mbwgrf')
1533 read(50,*,err=20) mbwgrf
1534case('emaxrf')
1535 read(50,*,err=20) emaxrf
1536 if (emaxrf < 0.d0) then
1537 write(*,*)
1538 write(*,'("Error(readinput): emaxrf < 0 : ",G18.10)') emaxrf
1539 write(*,*)
1540 stop
1541 end if
1542case('fxctype')
1543 read(50,'(A)',err=20) str
1544 str=trim(str)//' 0 0'
1545 read(str,*,err=20) fxctype
1546case('fxclrc')
1547 read(50,'(A)',err=20) str
1548 str=trim(str)//' 0.0'
1549 read(str,*,err=20) fxclrc(:)
1550case('ntemp')
1551 read(50,*,err=20) ntemp
1552 if (ntemp < 1) then
1553 write(*,*)
1554 write(*,'("Error(readinput): ntemp < 1 : ",I8)') ntemp
1555 write(*,*)
1556 stop
1557 end if
1558case('trimvg')
1559 write(*,'("Info(readinput): variable ''trimvg'' is no longer used")')
1560 read(50,*,err=20)
1561case('rndstate','rndseed')
1562 read(50,*,err=20) rndstate(0)
1563 rndstate(0)=abs(rndstate(0))
1564case('rndatposc')
1565 read(50,*,err=20) rndatposc
1566case('rndbfcmt')
1567 read(50,*,err=20) rndbfcmt
1568case('rndavec')
1569 read(50,*,err=20) rndavec
1570case('c_tb09')
1571 read(50,*,err=20) c_tb09
1572! set flag to indicate Tran-Blaha constant has been read in
1573 tc_tb09=.true.
1574case('lowq','highq','vhighq','uhighq')
1575 read(50,*,err=20) lv
1576 if (lv) then
1577 if (trim(block) == 'lowq') then
1578 rgkmax=6.5d0
1579 gmaxvr=10.d0
1580 lmaxapw=7
1581 lmaxo=5
1582 nxlo=2
1583 lorbcnd=.true.
1584 radkpt=25.d0
1585 autokpt=.true.
1586 vkloff(:)=0.5d0
1587 nempty0=4.d0
1588 epspot=1.d-5
1589 epsengy=5.d-4
1590 epsforce=1.d-2
1591 epsstress=3.d-3
1592 autolinengy=.true.
1593 gmaxrf=2.5d0
1594 lradstp=6
1595 else if (trim(block) == 'highq') then
1596! parameter set for high-quality calculation
1597 rgkmax=max(rgkmax,8.d0)
1598 gmaxvr=max(gmaxvr,16.d0)
1599 lmaxapw=max(lmaxapw,9)
1600 lmaxo=max(lmaxo,7)
1601 nrmtscf=max(nrmtscf,1.5d0)
1602 nxlo=max(nxlo,2)
1603 lorbcnd=.true.
1604 radkpt=max(radkpt,50.d0)
1605 autokpt=.true.
1606 vkloff(:)=0.d0
1607 nempty0=max(nempty0,10.d0)
1608 epspot=min(epspot,1.d-7)
1609 epsengy=min(epsengy,1.d-5)
1610 epsforce=min(epsforce,5.d-4)
1611 epsstress=min(epsstress,1.d-3)
1612 autolinengy=.true.
1613 gmaxrf=max(gmaxrf,4.d0)
1614 else if (trim(block) == 'vhighq') then
1615! parameter set for very high-quality calculation
1616 rgkmax=max(rgkmax,9.d0)
1617 gmaxvr=max(gmaxvr,18.d0)
1618 lmaxapw=max(lmaxapw,11)
1619 lmaxo=max(lmaxo,9)
1620 nrmtscf=max(nrmtscf,2.d0)
1621 nxlo=max(nxlo,3)
1622 lorbcnd=.true.
1623 radkpt=max(radkpt,90.d0)
1624 autokpt=.true.
1625 vkloff(:)=0.d0
1626 nempty0=max(nempty0,20.d0)
1627 epspot=min(epspot,1.d-7)
1628 epsengy=min(epsengy,1.d-6)
1629 epsforce=min(epsforce,2.d-4)
1630 epsstress=min(epsstress,5.d-4)
1631 autolinengy=.true.
1632 gmaxrf=max(gmaxrf,5.d0)
1633 else
1634! parameter set for ultra high-quality calculation
1635 rgkmax=max(rgkmax,10.d0)
1636 gmaxvr=max(gmaxvr,20.d0)
1637 lmaxapw=max(lmaxapw,12)
1638 lmaxo=max(lmaxo,9)
1639 nrmtscf=max(nrmtscf,4.d0)
1640 nxlo=max(nxlo,3)
1641 lorbcnd=.true.
1642 radkpt=max(radkpt,120.d0)
1643 autokpt=.true.
1644 vkloff(:)=0.d0
1645 nempty0=max(nempty0,40.d0)
1646 epspot=min(epspot,1.d-7)
1647 epsengy=min(epsengy,1.d-6)
1648 epsforce=min(epsforce,1.d-4)
1649 epsstress=min(epsstress,2.d-4)
1650 autolinengy=.true.
1651 gmaxrf=max(gmaxrf,6.d0)
1652 end if
1653 if (mp_mpi) then
1654 write(*,*)
1655 write(*,'("Info(readinput): parameters set by ",A," option")') trim(block)
1656 write(*,'(" rgkmax : ",G18.10)') rgkmax
1657 write(*,'(" gmaxvr : ",G18.10)') gmaxvr
1658 write(*,'(" lmaxapw : ",I4)') lmaxapw
1659 write(*,'(" lmaxo : ",I4)') lmaxo
1660 write(*,'(" nrmtscf : ",G18.10)') nrmtscf
1661 write(*,'(" nxlo : ",I4)') nxlo
1662 write(*,'(" lorbcnd : ",L1)') lorbcnd
1663 write(*,'(" radkpt : ",G18.10)') radkpt
1664 write(*,'(" autokpt : ",L1)') autokpt
1665 write(*,'(" vkloff : ",3G18.10)') vkloff
1666 write(*,'(" nempty0 : ",G18.10)') nempty0
1667 write(*,'(" epspot : ",G18.10)') epspot
1668 write(*,'(" epsengy : ",G18.10)') epsengy
1669 write(*,'(" epsforce : ",G18.10)') epsforce
1670 write(*,'(" epsstress : ",G18.10)') epsstress
1671 write(*,'(" autolinengy : ",L1)') autolinengy
1672 write(*,'(" gmaxrf : ",G18.10)') gmaxrf
1673 if (trim(block) == 'lowq') then
1674 write(*,'(" lradstp : ",I4)') lradstp
1675 end if
1676 end if
1677 end if
1678case('hmaxvr')
1679 read(50,*,err=20) hmaxvr
1680 if (hmaxvr < 0.d0) then
1681 write(*,*)
1682 write(*,'("Error(readinput): hmaxvr < 0 : ",G18.10)') hmaxvr
1683 write(*,*)
1684 stop
1685 end if
1686case('hkmax')
1687 read(50,*,err=20) hkmax
1688 if (hkmax <= 0.d0) then
1689 write(*,*)
1690 write(*,'("Error(readinput): hkmax <= 0 : ",G18.10)') hkmax
1691 write(*,*)
1692 stop
1693 end if
1694case('lorbcnd')
1695 read(50,*,err=20) lorbcnd
1696case('lorbordc')
1697 read(50,*,err=20) lorbordc
1698 if (lorbordc < 2) then
1699 write(*,*)
1700 write(*,'("Error(readinput): lorbordc < 2 : ",I8)') lorbordc
1701 write(*,*)
1702 stop
1703 end if
1704 if (lorbordc > maxlorbord) then
1705 write(*,*)
1706 write(*,'("Error(readinput): lorbordc too large : ",I8)') lorbordc
1707 write(*,'("Adjust maxlorbord in modmain and recompile code")')
1708 write(*,*)
1709 stop
1710 end if
1711case('nrmtscf')
1712 read(50,'(A)',err=20) str
1713 read(str,*,err=20) nrmtscf
1714 read(str,*,iostat=ios) nrmtscf,dnrmtscf
1715 if (nrmtscf < 0.5d0) then
1716 write(*,*)
1717 write(*,'("Error(readinput): nrmtscf < 0.5 : ",G18.10)') nrmtscf
1718 write(*,*)
1719 stop
1720 end if
1721case('lmaxdos')
1722 read(50,*,err=20) lmaxdos
1723 if (lmaxdos < 0) then
1724 write(*,*)
1725 write(*,'("Error(readinput): lmaxdos < 0 : ",I8)') lmaxdos
1726 write(*,*)
1727 stop
1728 end if
1729case('epsdev')
1730 read(50,*,err=20) epsdev
1731 if (epsdev <= 0.d0) then
1732 write(*,*)
1733 write(*,'("Error(readinput): epsdev <= 0 : ",G18.10)') epsdev
1734 write(*,*)
1735 stop
1736 end if
1737case('msmooth')
1738 read(50,*,err=20)
1739 write(*,'("Info(readinput): variable ''msmooth'' is no longer used")')
1740case('npmae')
1741 read(50,*,err=20) npmae0
1742case('wrtvars')
1743 read(50,*,err=20) wrtvars
1744case('ftmtype')
1745 read(50,*,err=20) ftmtype
1746case('tmomfix')
1747 write(*,*)
1748 write(*,'("Error(readinput): variable ''tmomfix'' is no longer used")')
1749 write(*,'(" use tm3fix instead")')
1750 write(*,*)
1751 stop
1752case('tm3fix')
1753 read(50,*,err=20) ntmfix
1754 if (ntmfix < 1) then
1755 write(*,*)
1756 write(*,'("Error(readinput): ntmfix < 1 : ",I8)') ntmfix
1757 write(*,*)
1758 stop
1759 end if
1760 if (allocated(itmfix)) deallocate(itmfix)
1761 allocate(itmfix(7,ntmfix))
1762 if (allocated(wkprfix)) deallocate(wkprfix)
1763 allocate(wkprfix(ntmfix))
1764 do i=1,ntmfix
1765 read(50,*,err=20) is,ia,l
1766 if ((is < 1).or.(ia < 1).or.(l < 0)) then
1767 write(*,*)
1768 write(*,'("Error(readinput): invalid is, ia or l in tm3fix block : ",&
1769 &3I8)') is,ia,l
1770 write(*,*)
1771 stop
1772 end if
1773 itmfix(1,i)=is
1774 itmfix(2,i)=ia
1775 itmfix(3,i)=l
1776! read k, p, r, t for the 3-index tensor
1777 read(50,*,err=20) itmfix(4:7,i)
1778! read 3-index tensor component with conventional normalisation
1779 read(50,*,err=20) wkprfix(i)
1780 end do
1781case('tauftm')
1782 read(50,*,err=20) tauftm
1783 if (tauftm < 0.d0) then
1784 write(*,*)
1785 write(*,'("Error(readinput): tauftm < 0 : ",G18.10)') tauftm
1786 write(*,*)
1787 stop
1788 end if
1789case('ftmstep')
1790 read(50,*,err=20)
1791 write(*,'("Info(readinput): variable ''ftmstep'' is no longer used")')
1792case('cmagz','forcecmag')
1793 read(50,*,err=20) cmagz
1794case('rotavec')
1795 read(50,*,err=20) axang(:)
1796case('tstime')
1797 read(50,*,err=20) tstime
1798 if (tstime <= 0.d0) then
1799 write(*,*)
1800 write(*,'("Error(readinput): tstime <= 0 : ",G18.10)') tstime
1801 write(*,*)
1802 stop
1803 end if
1804case('dtimes')
1805 read(50,*,err=20) dtimes
1806 if (dtimes <= 0.d0) then
1807 write(*,*)
1808 write(*,'("Error(readinput): dtimes <= 0 : ",G18.10)') dtimes
1809 write(*,*)
1810 stop
1811 end if
1812case('pulse')
1813 read(50,*,err=20) npulse
1814 if (npulse < 1) then
1815 write(*,*)
1816 write(*,'("Error(readinput): npulse < 1 : ",I8)') npulse
1817 write(*,*)
1818 stop
1819 end if
1820 if (allocated(pulse)) deallocate(pulse)
1821 allocate(pulse(12,npulse))
1822 do i=1,npulse
1823 read(50,'(A)',err=20) str
1824 str=trim(str)//' 1.0 0.0 0.0 0.0'
1825 read(str,*,err=20) pulse(:,i)
1826 end do
1827case('ramp')
1828 read(50,*,err=20) nramp
1829 if (nramp < 1) then
1830 write(*,*)
1831 write(*,'("Error(readinput): nramp < 1 : ",I8)') nramp
1832 write(*,*)
1833 stop
1834 end if
1835 if (allocated(ramp)) deallocate(ramp)
1836 allocate(ramp(12,nramp))
1837 do i=1,nramp
1838 read(50,'(A)',err=20) str
1839 str=trim(str)//' 1.0 0.0 0.0 0.0'
1840 read(str,*,err=20) ramp(:,i)
1841 end do
1842case('step')
1843 read(50,*,err=20) nstep
1844 if (nstep < 1) then
1845 write(*,*)
1846 write(*,'("Error(readinput): nstep < 1 : ",I8)') nstep
1847 write(*,*)
1848 stop
1849 end if
1850 if (allocated(step)) deallocate(step)
1851 allocate(step(9,nstep))
1852 do i=1,nstep
1853 read(50,'(A)',err=20) str
1854 str=trim(str)//' 1.0 0.0 0.0 0.0'
1855 read(str,*,err=20) step(:,i)
1856 end do
1857case('ncgga')
1858 read(50,*,err=20)
1859 write(*,'("Info(readinput): variable ''ncgga'' is no longer used")')
1860case('dncgga')
1861 read(50,*,err=20) dncgga
1862 if (dncgga < 0.d0) then
1863 write(*,*)
1864 write(*,'("Error(readinput): dncgga < 0 : ",G18.10)') dncgga
1865 write(*,*)
1866 stop
1867 end if
1868case('ntswrite')
1869 read(50,'(A)',err=20) str
1870 str=trim(str)//' 1'
1871 read(str,*,err=20) ntswrite(:)
1872case('nxoapwlo','nxapwlo')
1873 read(50,*,err=20) nxoapwlo
1874 if (nxoapwlo < 0) then
1875 write(*,*)
1876 write(*,'("Error(readinput): nxoapwlo < 0 : ",I8)') nxoapwlo
1877 write(*,*)
1878 stop
1879 end if
1880case('nxlo')
1881 read(50,*,err=20) nxlo
1882 if (nxlo < 0) then
1883 write(*,*)
1884 write(*,'("Error(readinput): nxlo < 0 : ",I8)') nxlo
1885 write(*,*)
1886 stop
1887 end if
1888case('tdrho1d')
1889 read(50,*,err=20) tdrho1d
1890case('tdrho2d')
1891 read(50,*,err=20) tdrho2d
1892case('tdrho3d')
1893 read(50,*,err=20) tdrho3d
1894case('tdmag1d')
1895 read(50,*,err=20) tdmag1d
1896case('tdmag2d')
1897 read(50,*,err=20) tdmag2d
1898case('tdmag3d')
1899 read(50,*,err=20) tdmag3d
1900case('tdjr1d','tdcd1d')
1901 read(50,*,err=20) tdjr1d
1902case('tdjr2d','tdcd2d')
1903 read(50,*,err=20) tdjr2d
1904case('tdjr3d','tdcd3d')
1905 read(50,*,err=20) tdjr3d
1906case('tddos')
1907 read(50,*,err=20) tddos
1908case('tdlsj')
1909 read(50,*,err=20) tdlsj
1910case('tdjtk')
1911 read(50,*,err=20) tdjtk
1912case('tdxrmk')
1913 read(50,*,err=20) tdxrmk
1914case('epseph')
1915 read(50,*,err=20)
1916 write(*,'("Info(readinput): variable ''epseph'' is no longer used")')
1917case('rndevt0')
1918 read(50,*,err=20) rndevt0
1919case('sxcscf','ssxc','rstsf')
1920 read(50,'(A)',err=20) str
1921 read(str,*,err=20) sxcscf
1922 read(str,*,iostat=ios) sxcscf,dsxcscf
1923case('tempk')
1924 read(50,*,err=20) tempk
1925 if (tempk <= 0.d0) then
1926 write(*,*)
1927 write(*,'("Error(readinput): tempk <= 0 : ",G18.10)') tempk
1928 write(*,*)
1929 stop
1930 end if
1931! set Fermi-Dirac smearing
1932 stype=3
1933! set the smearing width
1934 swidth=kboltz*tempk
1935case('avecu')
1936 read(50,*,err=20) avecu(:,1)
1937 read(50,*,err=20) avecu(:,2)
1938 read(50,*,err=20) avecu(:,3)
1939case('scaleu')
1940 read(50,*,err=20) scu
1941case('scaleu1')
1942 read(50,*,err=20) scu1
1943case('scaleu2')
1944 read(50,*,err=20) scu2
1945case('scaleu3')
1946 read(50,*,err=20) scu3
1947case('q0cut')
1948 read(50,*,err=20) q0cut
1949case('rndbfcu')
1950 read(50,*,err=20) rndbfcu
1951case('bfieldcu','bfielduc')
1952 read(50,*,err=20) bfieldcu
1953case('efieldcu','efielduc')
1954 read(50,*,err=20) efieldcu
1955case('tplotq0')
1956 read(50,*,err=20) tplotq0
1957case('trdvclr')
1958 read(50,*,err=20) trdvclr
1959case('trdbfcr')
1960 read(50,*,err=20) trdbfcr
1961case('evtype')
1962 read(50,*,err=20)
1963 write(*,'("Info(readinput): variable ''evtype'' is no longer used")')
1964case('wmaxgw')
1965 read(50,*,err=20) wmaxgw
1966case('twdiag')
1967 read(50,*,err=20)
1968 write(*,'("Info(readinput): variable ''twdiag'' is no longer used")')
1969case('tsediag')
1970 read(50,*,err=20) tsediag
1971case('actype')
1972 read(50,*,err=20) actype
1973case('npole')
1974 read(50,*,err=20) npole
1975 if (npole < 1) then
1976 write(*,*)
1977 write(*,'("Error(readinput): npole < 1 : ",I8)') npole
1978 write(*,*)
1979 stop
1980 end if
1981case('nspade')
1982 read(50,*,err=20) nspade
1983 if (nspade < 1) then
1984 write(*,*)
1985 write(*,'("Error(readinput): nspade < 1 : ",I8)') nspade
1986 write(*,*)
1987 stop
1988 end if
1989case('tfav0')
1990 read(50,*,err=20) tfav0
1991case('rmtscf')
1992 read(50,*,err=20) rmtscf
1993 if (rmtscf <= 0.d0) then
1994 write(*,*)
1995 write(*,'("Error(readinput): rmtscf <= 0 : ",G18.10)') rmtscf
1996 write(*,*)
1997 stop
1998 end if
1999case('mrmtav')
2000 read(50,*,err=20) mrmtav
2001case('rmtall')
2002 read(50,*,err=20) rmtall
2003case('maxthd','omp_num_threads','OMP_NUM_THREADS')
2004 read(50,*,err=20) maxthd
2005case('maxthd1')
2006 read(50,*,err=20) maxthd1
2007case('maxthdmkl')
2008 read(50,*,err=20) maxthdmkl
2009case('maxlvl','omp_max_active_levels','OMP_MAX_ACTIVE_LEVELS')
2010 read(50,*,err=20) maxlvl
2011 if (maxlvl < 1) then
2012 write(*,*)
2013 write(*,'("Error(readinput): maxlvl < 1 : ",I8)') maxlvl
2014 write(*,*)
2015 stop
2016 end if
2017case('stable')
2018 read(50,*,err=20) lv
2019 if (lv) then
2020 autolinengy=.true.
2021 mrmtav=1
2022 lmaxapw=max(lmaxapw,10)
2023 gmaxvr=max(gmaxvr,24.d0)
2024 msmgmt=max(msmgmt,4)
2025 if (mp_mpi) then
2026 write(*,*)
2027 write(*,'("Info(readinput): parameters set by stable option")')
2028 write(*,'(" autolinengy : ",L1)') autolinengy
2029 write(*,'(" mrmtav : ",I4)') mrmtav
2030 write(*,'(" lmaxapw : ",I4)') lmaxapw
2031 write(*,'(" gmaxvr : ",G18.10)') gmaxvr
2032 write(*,'(" msmgmt : ",I4)') msmgmt
2033 end if
2034 end if
2035case('metagga')
2036 read(50,*,err=20) lv
2037 if (lv) then
2038 lmaxi=max(lmaxi,2)
2039 gmaxvr=max(gmaxvr,16.d0)
2040 nrmtscf=max(nrmtscf,3.d0)
2041 msmgmt=max(msmgmt,4)
2042 epspot=1.d6
2043 epsengy=min(epsengy,1.d-6)
2044 if (mp_mpi) then
2045 write(*,*)
2046 write(*,'("Info(readinput): parameters set by metagga option")')
2047 write(*,'(" lmaxi : ",I4)') lmaxi
2048 write(*,'(" gmaxvr : ",G18.10)') gmaxvr
2049 write(*,'(" nrmtscf : ",G18.10)') nrmtscf
2050 write(*,'(" msmgmt : ",I4)') msmgmt
2051 write(*,'(" epspot : ",G18.10)') epspot
2052 write(*,'(" epsengy : ",G18.10)') epsengy
2053 end if
2054 end if
2055case('t0tdlr')
2056 read(50,*,err=20)
2057 write(*,'("Info(readinput): variable ''t0tdlr'' is no longer used")')
2058case('tdphi')
2059 read(50,*,err=20) tdphi
2060! convert phase from degrees to radians
2061 tdphi=tdphi*pi/180.d0
2062case('thetamld')
2063 read(50,*,err=20) thetamld
2064! convert MLD angle from degrees to radians
2065 thetamld=thetamld*pi/180.d0
2066case('ntsbackup')
2067 read(50,*,err=20) ntsbackup
2068case('seedname')
2069 read(50,*,err=20) seedname
2070 seedname=adjustl(seedname)
2071case('num_wann')
2072 read(50,*,err=20) num_wann
2073case('idxw90','wann_bands')
2074 read(50,'(A)',err=20) str
2075 num_bands=1024
2076 if (allocated(idxw90)) deallocate(idxw90)
2077 allocate(idxw90(num_bands))
2078 call numlist(str,num_bands,idxw90)
2079case('num_iter')
2080 read(50,*,err=20) num_iter
2081case('dis_num_iter')
2082 read(50,*,err=20) dis_num_iter
2083case('trial_step')
2084 read(50,*,err=20) trial_step
2085case('xlwin','wannierExtra')
2086 if (allocated(xlwin)) deallocate(xlwin)
2087 allocate(xlwin(0))
2088 nxlwin=0
2089 do
2090 read(50,'(A)',err=20) str
2091 if (trim(str) == '') goto 10
2092 xlwin=[xlwin(1:nxlwin),str]
2093 nxlwin=nxlwin+1
2094 end do
2095case('wrtunk')
2096 read(50,*,err=20) wrtunk
2097case('tbdip')
2098 read(50,*,err=20) tbdip
2099case('tjr','tcden')
2100 read(50,*,err=20) tjr
2101case('tauefm')
2102 read(50,*,err=20) tauefm
2103case('epsefm')
2104 read(50,*,err=20) epsefm
2105case('ehfb')
2106 read(50,*,err=20) ehfb
2107case('t0gclq0')
2108 read(50,*,err=20) t0gclq0
2109case('tafindt')
2110 read(50,*,err=20) tafindt
2111case('afindscf')
2112 read(50,*,err=20)
2113 write(*,'("Info(readinput): variable ''afindscf'' is no longer used")')
2114case('afindpm')
2115 read(50,*,err=20) afindpm(:)
2116 if (afindpm(2) == 0.d0) then
2117 write(*,*)
2118 write(*,'("Error(readinput): afindpm(2) = 0")')
2119 write(*,*)
2120 stop
2121 end if
2122case('nkspolar')
2123 read(50,*,err=20) nkspolar
2124 if (nkspolar < 1) then
2125 write(*,*)
2126 write(*,'("Error(readinput): nkspolar < 1 : ",I8)') nkspolar
2127 write(*,*)
2128 stop
2129 end if
2130case('ntsforce')
2131 read(50,*,err=20) ntsforce
2132 if (ntsforce < 1) then
2133 write(*,*)
2134 write(*,'("Error(readinput): ntsforce < 1 : ",I8)') ntsforce
2135 write(*,*)
2136 stop
2137 end if
2138case('wphcut')
2139 read(50,*,err=20) wphcut
2140 if (wphcut <= 0.d0) then
2141 write(*,*)
2142 write(*,'("Error(readinput): wphcut <= 0 : ",G18.10)') wphcut
2143 write(*,*)
2144 stop
2145 end if
2146case('ephscf')
2147 read(50,*,err=20) ephscf(:)
2148case('anomalous')
2149 read(50,*,err=20) anomalous
2150case('tephde')
2151 read(50,*,err=20) tephde
2152case('bdiag')
2153 read(50,*,err=20) bdiag
2154case('ecutb')
2155 read(50,*,err=20) ecutb
2156 if (ecutb <= 0.d0) then
2157 write(*,*)
2158 write(*,'("Error(readinput): ecutb <= 0 : ",G18.10)') ecutb
2159 write(*,*)
2160 stop
2161 end if
2162case('ediag')
2163 read(50,*,err=20) ediag
2164case('pwxpsn')
2165 read(50,*,err=20) pwxpsn
2166 if (pwxpsn < 1) then
2167 write(*,*)
2168 write(*,'("Error(readinput): pwxpsn < 1 : ",I8)') pwxpsn
2169 write(*,*)
2170 stop
2171 end if
2172case('ramdisk')
2173 read(50,*,err=20) ramdisk
2174case('wrtdsk')
2175 read(50,*,err=20) wrtdsk
2176case('epsdmat')
2177 read(50,*,err=20) epsdmat
2178case('tm3old')
2179 read(50,*,err=20) tm3old
2180case('batch')
2181 read(50,*,err=20) batch
2182case('tafspt')
2183 read(50,*,err=20) tafspt
2184case('tbaspat')
2185 read(50,*,err=20) tbaspat
2186case('trdatdv')
2187 read(50,*,err=20) trdatdv
2188case('atdfc')
2189 read(50,*,err=20) atdfc
2190 if (atdfc < 0.d0) then
2191 write(*,*)
2192 write(*,'("Error(readinput): atdfc < 0 : ",G18.10)') atdfc
2193 write(*,*)
2194 stop
2195 end if
2196case('maxforce')
2197 read(50,*,err=20) maxforce
2198case('msmgmt','msmg2mt')
2199 read(50,*,err=20) msmgmt
2200case('ntsorth')
2201 read(50,*,err=20) ntsorth
2202case('deltabf')
2203 read(50,*,err=20) deltabf
2204 if (deltabf <= 0.d0) then
2205 write(*,*)
2206 write(*,'("Error(readinput): deltabf <= 0 : ",G18.10)') deltabf
2207 write(*,*)
2208 stop
2209 end if
2210case('jtconst0')
2211 read(50,*,err=20) jtconst0
2212case('trmt0')
2213 read(50,*,err=20) trmt0
2214case('ksgwrho')
2215 read(50,*,err=20) ksgwrho
2216case('npfftg')
2217 read(50,*,err=20) npfftg
2218case('npfftgc')
2219 read(50,*,err=20) npfftgc
2220case('npfftq')
2221 read(50,*,err=20) npfftq
2222case('npfftw')
2223 read(50,*,err=20) npfftw
2224case('tphnat')
2225 read(50,*,err=20) tphnat
2226case('ecutthc')
2227 read(50,*,err=20) ecutthc
2228 if (ecutthc <= 0.d0) then
2229 write(*,*)
2230 write(*,'("Error(readinput): ecutthc <= 0 : ",G18.10)') ecutthc
2231 write(*,*)
2232 stop
2233 end if
2234case('tbdipu')
2235 read(50,*,err=20) tbdipu
2236case('bdipscf')
2237 read(50,*,err=20) bdipscf
2238case('')
2239 goto 10
2240case default
2241 write(*,*)
2242 write(*,'("Error(readinput): invalid block name : ",A)') trim(block)
2243 write(*,*)
2244 stop
2245end select
2246goto 10
224720 continue
2248write(*,*)
2249write(*,'("Error(readinput): error reading from elk.in")')
2250write(*,'("Problem occurred in ''",A,"'' block")') trim(block)
2251write(*,'("Check input convention in manual")')
2252write(*,*)
2253stop
225430 continue
2255close(50)
2256! scale the speed of light
2257solsc=sol*solscf
2258! scale and rotate the lattice vectors (not referenced again in code)
2259avec(:,:)=sc*avec(:,:)
2260avec(:,1)=sc1*avec(:,1)
2261avec(:,2)=sc2*avec(:,2)
2262avec(:,3)=sc3*avec(:,3)
2263avec(1,:)=scx*avec(1,:)
2264avec(2,:)=scy*avec(2,:)
2265avec(3,:)=scz*avec(3,:)
2266t1=axang(4)
2267if (t1 /= 0.d0) then
2268 t1=t1*pi/180.d0
2269 call axangrot(axang(:),t1,rot)
2270 do i=1,3
2271 v(:)=avec(:,i)
2272 call r3mv(rot,v,avec(:,i))
2273 end do
2274end if
2275! randomise lattice vectors if required
2276if (rndavec > 0.d0) then
2277 do i=1,3
2278 do j=1,3
2279 t1=rndavec*(randomu()-0.5d0)
2280 avec(i,j)=avec(i,j)+t1
2281 end do
2282 end do
2283end if
2284! check if reference lattice vectors should be used
2285tavref=(any(abs(avecref(:,:)) > epslat))
2286! case of isolated molecule
2287if (molecule) then
2288! convert atomic positions from Cartesian to lattice coordinates
2289 call r3minv(avec,ainv)
2290 do is=1,nspecies
2291 do ia=1,natoms(is)
2292 call r3mv(ainv,atposl(:,ia,is),v)
2293 atposl(:,ia,is)=v(:)
2294 end do
2295 end do
2296end if
2297! randomise atomic positions if required
2298if (rndatposc > 0.d0) then
2299 call r3minv(avec,ainv)
2300 do is=1,nspecies
2301 do ia=1,natoms(is)
2302 call r3mv(avec,atposl(:,ia,is),v)
2303 do i=1,3
2304 t1=rndatposc*(randomu()-0.5d0)
2305 v(i)=v(i)+t1
2306 end do
2307 call r3mv(ainv,v,atposl(:,ia,is))
2308 end do
2309 end do
2310end if
2311! randomise the muffin-tin magnetic fields if required
2312if (rndbfcmt > 0.d0) then
2313 do is=1,nspecies
2314 do ia=1,natoms(is)
2315 do i=1,3
2316 t1=rndbfcmt*(randomu()-0.5d0)
2317 bfcmt0(i,ia,is)=bfcmt0(i,ia,is)+t1
2318 end do
2319 end do
2320 end do
2321end if
2322! set fxctype to fxctype if required
2323if (fxctype(1) == -1) fxctype(:)=xctype(:)
2324! find primitive cell if required
2325if (primcell) call findprimcell
2326! scale the ultracell vectors if required
2327avecu(:,1)=scu1*avecu(:,1)
2328avecu(:,2)=scu2*avecu(:,2)
2329avecu(:,3)=scu3*avecu(:,3)
2330avecu(:,:)=scu*avecu(:,:)
2331! read in atomic species data
2332call readspecies
2333return
2334
2335end subroutine
2336!EOC
2337
pure subroutine axangrot(v, th, rot)
Definition axangrot.f90:10
subroutine findprimcell
subroutine genfspecies(zn, symb)
subroutine genspecies(fnum)
Definition genspecies.f90:7
Definition modgw.f90:6
real(8) deltast
Definition modmain.f90:1019
real(8) gmaxvr
Definition modmain.f90:384
real(8) epsengy
Definition modmain.f90:1060
integer reduceq
Definition modmain.f90:519
real(8) epspot
Definition modmain.f90:1058
logical dosssum
Definition modmain.f90:1086
real(8) epsforce
Definition modmain.f90:1062
real(8), dimension(3, maxatoms, maxspecies) datposl
Definition modmain.f90:52
real(8) drgkmax
Definition modmain.f90:493
integer, dimension(2) np2d
Definition modmain.f90:1127
integer npp1d
Definition modmain.f90:1113
real(8), dimension(3, 0:2) vclp2d
Definition modmain.f90:1125
logical autoswidth
Definition modmain.f90:894
real(8) radkpt
Definition modmain.f90:446
logical tshift
Definition modmain.f90:352
logical mixrho
Definition modmain.f90:687
logical trhonorm
Definition modmain.f90:618
integer dlmaxo
Definition modmain.f90:201
real(8), dimension(3, maxatoms, maxspecies) atposc
Definition modmain.f90:54
integer ngrkf
Definition modmain.f90:1072
integer dlmaxapw
Definition modmain.f90:197
integer nvp1d
Definition modmain.f90:1111
real(8) epsstress
Definition modmain.f90:1064
integer, dimension(3, 27) optcomp
Definition modmain.f90:1090
integer, dimension(maxspecies) natoms
Definition modmain.f90:36
real(8) nempty0
Definition modmain.f90:880
logical spinpol
Definition modmain.f90:228
character(256) scrpath
Definition modmain.f90:1302
integer maxlatvstp
Definition modmain.f90:1036
integer nwplot
Definition modmain.f90:1070
real(8), dimension(2) broydpm
Definition modmain.f90:706
real(8), dimension(3, 3) avecref
Definition modmain.f90:1027
integer, dimension(3) ktype
Definition modmain.f90:606
real(8), dimension(:,:), allocatable vvlp1d
Definition modmain.f90:1117
real(8) mstar
Definition modmain.f90:896
logical lmirep
Definition modmain.f90:1095
integer nswplot
Definition modmain.f90:1074
integer ip01d
Definition modmain.f90:1115
integer, dimension(3) xctype
Definition modmain.f90:588
integer atpopt
Definition modmain.f90:1004
logical spinorb
Definition modmain.f90:230
integer mixsdb
Definition modmain.f90:704
logical molecule
Definition modmain.f90:47
integer lradstp
Definition modmain.f90:171
logical dosocc
Definition modmain.f90:1080
real(8), dimension(3, 3) avec
Definition modmain.f90:12
real(8) dnempty0
Definition modmain.f90:880
logical dosmsum
Definition modmain.f90:1084
integer maxatpstp
Definition modmain.f90:1006
integer ntasks
Definition modmain.f90:1292
integer, dimension(3) xctsp
Definition modmain.f90:142
integer mixtype
Definition modmain.f90:695
real(8) swidth
Definition modmain.f90:892
logical autokpt
Definition modmain.f90:444
integer latvopt
Definition modmain.f90:1034
real(8) epslat
Definition modmain.f90:24
real(8) tau0latv
Definition modmain.f90:1038
real(8), dimension(2) wplot
Definition modmain.f90:1076
real(8), dimension(3, 3) davec
Definition modmain.f90:12
integer lmaxapw
Definition modmain.f90:197
integer, dimension(3) ngridk
Definition modmain.f90:448
integer noptcomp
Definition modmain.f90:1088
real(8), dimension(3, 0:3) vclp3d
Definition modmain.f90:1129
logical bforb
Definition modmain.f90:234
real(8), dimension(2) amixpm
Definition modmain.f90:702
real(8) epschg
Definition modmain.f90:712
logical mixsave
Definition modmain.f90:700
logical tpdos
Definition modmain.f90:1082
integer, dimension(3) np3d
Definition modmain.f90:1131
real(8) socscf
Definition modmain.f90:232
character(256) sppath
Definition modmain.f90:72
real(8) scissor
Definition modmain.f90:908
integer lmaxo
Definition modmain.f90:201
real(8) dchgexs
Definition modmain.f90:724
integer maxscl
Definition modmain.f90:1046
real(8) tau0atp
Definition modmain.f90:1008
real(8) epsocc
Definition modmain.f90:900
integer, dimension(3) dngridk
Definition modmain.f90:448
real(8) chgexs
Definition modmain.f90:724
real(8) dgmaxvr
Definition modmain.f90:384
logical bfdmag
Definition modmain.f90:236
integer reducek
Definition modmain.f90:455
real(8) fracinr
Definition modmain.f90:209
integer lmaxi
Definition modmain.f90:205
real(8), dimension(3) vkloff
Definition modmain.f90:450
integer stype
Definition modmain.f90:888
integer nspecies
Definition modmain.f90:34
integer, dimension(3) ngridq
Definition modmain.f90:515
real(8) rgkmax
Definition modmain.f90:493
real(8), dimension(3, maxatoms, maxspecies) atposl
Definition modmain.f90:51
real(8), dimension(3, maxatoms, maxspecies) bfcmt0
Definition modmain.f90:275
logical primcell
Definition modmain.f90:49
Definition modpw.f90:6
subroutine numlist(str, n, list)
Definition numlist.f90:10
subroutine r3minv(a, b)
Definition r3minv.f90:10
pure subroutine r3mv(a, x, y)
Definition r3mv.f90:10
subroutine readinput
Definition readinput.f90:10
subroutine readspecies