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