The Elk Code
 
Loading...
Searching...
No Matches
init1.f90
Go to the documentation of this file.
1
2! Copyright (C) 2002-2005 J. K. Dewhurst, S. Sharma and C. Ambrosch-Draxl.
3! This file is distributed under the terms of the GNU General Public License.
4! See the file COPYING for license details.
5
6!BOP
7! !ROUTINE: init1
8! !INTERFACE:
9subroutine init1
10! !USES:
11use modmain
12use moddftu
13use modulr
14use modtddft
15use modgw
16use modtest
17use modvars
18! !DESCRIPTION:
19! Generates the $k$-point set and then allocates and initialises global
20! variables which depend on the $k$-point set.
21!
22! !REVISION HISTORY:
23! Created January 2004 (JKD)
24!EOP
25!BOC
26implicit none
27! local variables
28logical lsym(48)
29integer is,ias,nppt
30integer io,ilo,i1,i2,i3
31integer ik,isym,jspn
32integer l1,l2,l3,m1,m2,m3
33integer lm1,lm2,lm3,n
34real(8) vl(3),vc(3),t1
35real(8) boxl(3,0:3)
36real(8) ts0,ts1
37! external functions
38complex(8), external :: gauntyry
39
40call timesec(ts0)
41
42!---------------------!
43! k-point set !
44!---------------------!
45! check if the system is an isolated molecule
46if (molecule) then
47 ngridk(:)=1
48 vkloff(:)=0.d0
49 autokpt=.false.
50end if
51! store the point group symmetries for reducing the k-point set
52if (reducek == 0) then
53 nsymkpt=1
54 symkpt(:,:,1)=symlat(:,:,1)
55else
56 lsym(:)=.false.
57 do isym=1,nsymcrys
58 if (reducek == 2) then
59! check symmetry is symmorphic
60 if (.not.tv0symc(isym)) goto 10
61! check also that the spin rotation is the same as the spatial rotation
62 if (spinpol) then
63 if (lspnsymc(isym) /= lsplsymc(isym)) goto 10
64 end if
65 end if
66 lsym(lsplsymc(isym))=.true.
6710 continue
68 end do
69 nsymkpt=0
70 do isym=1,nsymlat
71 if (lsym(isym)) then
73 symkpt(:,:,nsymkpt)=symlat(:,:,isym)
74 end if
75 end do
76end if
77if (any(task == [20,21,22,23,720,725])) then
78! generate k-points along a path for band structure plots
81 if (allocated(vkl)) deallocate(vkl)
82 allocate(vkl(3,nkpt))
83 if (allocated(vkc)) deallocate(vkc)
84 allocate(vkc(3,nkpt))
85 do ik=1,nkpt
86 vkl(1:3,ik)=vplp1d(1:3,ik)
87 call r3mv(bvec,vkl(:,ik),vkc(:,ik))
88 end do
90else if (task == 25) then
91! effective mass calculation
92 nkpt=(2*ndspem+1)**3
93 if (allocated(ivk)) deallocate(ivk)
94 allocate(ivk(3,nkpt))
95 if (allocated(vkl)) deallocate(vkl)
96 allocate(vkl(3,nkpt))
97 if (allocated(vkc)) deallocate(vkc)
98 allocate(vkc(3,nkpt))
99! map vector to [0,1)
100 call r3frac(epslat,vklem)
101 ik=0
102 do i3=-ndspem,ndspem
103 do i2=-ndspem,ndspem
104 do i1=-ndspem,ndspem
105 ik=ik+1
106 ivk(1,ik)=i1; ivk(2,ik)=i2; ivk(3,ik)=i3
107 vc(1)=dble(i1); vc(2)=dble(i2); vc(3)=dble(i3)
108 vc(:)=vc(:)*deltaem
109 call r3mv(binv,vc,vl)
110 vkl(:,ik)=vklem(:)+vl(:)
111 call r3mv(bvec,vkl(:,ik),vkc(:,ik))
112 end do
113 end do
114 end do
116else
117! determine the k-point grid automatically from radkpt if required
118 if (autokpt) then
119 t1=radkpt/twopi
120 ngridk(:)=int(t1*sqrt(bvec(1,:)**2+bvec(2,:)**2+bvec(3,:)**2))+1
121 end if
122! set up the default k-point box
123 boxl(:,0)=vkloff(:)/dble(ngridk(:))
124 if (task == 102) boxl(:,0)=0.d0
125 boxl(:,1)=boxl(:,0)
126 boxl(:,2)=boxl(:,0)
127 boxl(:,3)=boxl(:,0)
128 boxl(1,1)=boxl(1,1)+1.d0
129 boxl(2,2)=boxl(2,2)+1.d0
130 boxl(3,3)=boxl(3,3)+1.d0
131! k-point set and box for Fermi surface plots
132 if (any(task == [100,101,102,103,104])) then
133 ngridk(:)=np3d(:)
134 if (task /= 102) boxl(:,:)=vclp3d(:,:)
135 end if
136! allocate the k-point set arrays
137 if (allocated(ivkik)) deallocate(ivkik)
138 allocate(ivkik(0:ngridk(1)-1,0:ngridk(2)-1,0:ngridk(3)-1))
139 if (allocated(ivkiknr)) deallocate(ivkiknr)
140 allocate(ivkiknr(0:ngridk(1)-1,0:ngridk(2)-1,0:ngridk(3)-1))
141 nkptnr=ngridk(1)*ngridk(2)*ngridk(3)
142 if (allocated(ivk)) deallocate(ivk)
143 allocate(ivk(3,nkptnr))
144 if (allocated(vkl)) deallocate(vkl)
145 allocate(vkl(3,nkptnr))
146 if (allocated(vkc)) deallocate(vkc)
147 allocate(vkc(3,nkptnr))
148 if (allocated(wkpt)) deallocate(wkpt)
149 allocate(wkpt(nkptnr))
150! generate the k-point set
151 call genppts(.false.,nsymkpt,symkpt,ngridk,nkptnr,epslat,bvec,boxl,nkpt, &
153! write to VARIABLES.OUT
154 if (wrtvars) then
155 call writevars('nsymkpt',iv=nsymkpt)
156 call writevars('symkpt',nv=9*nsymkpt,iva=symkpt)
157 call writevars('ngridk',nv=3,iva=ngridk)
158 call writevars('vkloff',nv=3,rva=vkloff)
159 call writevars('nkpt',iv=nkpt)
160 call writevars('ivkik',nv=nkptnr,iva=ivkik)
161 call writevars('ivk',nv=3*nkptnr,iva=ivk)
162 call writevars('vkl',nv=3*nkptnr,rva=vkl)
163 call writevars('wkpt',nv=nkpt,rva=wkpt)
164 end if
165end if
166if (any(task == [700,701,710,720,725,731,732,733,741,742,743,771,772,773])) then
167! generate ultracell reciprocal lattice vectors if required
169! generate the κ, k+κ and Q-points if required
170 call genkpakq
171end if
172! write the k-points to test file
173call writetest(910,'k-points (Cartesian)',nv=3*nkpt,tol=1.d-8,rva=vkc)
174
175!---------------------!
176! G+k-vectors !
177!---------------------!
178if ((xctype(1) < 0).or.tddos.or.any(task == [5,10,205,300,600,601,620]).or. &
179 ksgwrho) then
180 nppt=nkptnr
181else
182 nppt=nkpt
183end if
184! find the maximum number of G+k-vectors
186! allocate the G+k-vector arrays
187if (allocated(ngk)) deallocate(ngk)
188allocate(ngk(nspnfv,nppt))
189if (allocated(igkig)) deallocate(igkig)
190allocate(igkig(ngkmax,nspnfv,nppt))
191if (allocated(vgkl)) deallocate(vgkl)
192allocate(vgkl(3,ngkmax,nspnfv,nppt))
193if (allocated(vgkc)) deallocate(vgkc)
194allocate(vgkc(3,ngkmax,nspnfv,nppt))
195if (allocated(gkc)) deallocate(gkc)
196allocate(gkc(ngkmax,nspnfv,nppt))
197if (allocated(sfacgk)) deallocate(sfacgk)
198allocate(sfacgk(ngkmax,natmtot,nspnfv,nppt))
199do ik=1,nppt
200 do jspn=1,nspnfv
201 vl(1:3)=vkl(1:3,ik)
202 vc(1:3)=vkc(1:3,ik)
203! spin-spiral case
204 if (spinsprl) then
205 if (jspn == 1) then
206 vl(1:3)=vl(1:3)+0.5d0*vqlss(1:3)
207 vc(1:3)=vc(1:3)+0.5d0*vqcss(1:3)
208 else
209 vl(1:3)=vl(1:3)-0.5d0*vqlss(1:3)
210 vc(1:3)=vc(1:3)-0.5d0*vqcss(1:3)
211 end if
212 end if
213! generate the G+k-vectors
214 call gengkvec(ngvc,ivg,vgc,vl,vc,gkmax,ngkmax,ngk(jspn,ik), &
215 igkig(:,jspn,ik),vgkl(:,:,jspn,ik),vgkc(:,:,jspn,ik),gkc(:,jspn,ik))
216! generate structure factors for G+k-vectors
217 call gensfacgp(ngk(jspn,ik),vgkc(:,:,jspn,ik),ngkmax,sfacgk(:,:,jspn,ik))
218 end do
219end do
220! write to VARIABLES.OUT
221if (wrtvars) then
222 call writevars('nspnfv',iv=nspnfv)
223 call writevars('gkmax',rv=gkmax)
224 call writevars('ngk',nv=nspnfv*nkpt,iva=ngk)
225 do ik=1,nkpt
226 do jspn=1,nspnfv
227 call writevars('igkig',n1=jspn,n2=ik,nv=ngk(jspn,ik),iva=igkig(:,jspn,ik))
228 end do
229 end do
230end if
231
232!---------------------------------!
233! APWs and local-orbitals !
234!---------------------------------!
235apwordmax=0
237lolmax=0
238do is=1,nspecies
239 lmoapw(is)=0
240 do l1=0,lmaxapw
241! find the maximum APW order
242 apwordmax=max(apwordmax,apword(l1,is))
243! find total number of APW coefficients (l, m and order)
244 lmoapw(is)=lmoapw(is)+(2*l1+1)*apword(l1,is)
245 if (l1 == lmaxo) nlmwf(is)=lmoapw(is)
246 end do
247! find the maximum local-orbital order and angular momentum
248 n=0
249 do ilo=1,nlorb(is)
250 l1=lorbl(ilo,is)
251 lolmax=max(lolmax,l1)
252 lorbordmax=max(lorbordmax,lorbord(ilo,is))
253 n=n+2*l1+1
254 end do
255! number of (l,m) components used for generating the muffin-tin wavefunctions
256 nlmwf(is)=max(nlmwf(is),n)
257end do
258lolmmax=(lolmax+1)**2
259! set the APW and local-orbital linearisation energies to the default
260if (allocated(apwe)) deallocate(apwe)
261allocate(apwe(apwordmax,0:lmaxapw,natmtot))
262if (allocated(lorbe)) deallocate(lorbe)
264do ias=1,natmtot
265 is=idxis(ias)
266 do l1=0,lmaxapw
267 do io=1,apword(l1,is)
268 apwe(io,l1,ias)=apwe0(io,l1,is)
269 end do
270 end do
271 do ilo=1,nlorb(is)
272 do io=1,lorbord(ilo,is)
273 lorbe(io,ilo,ias)=lorbe0(io,ilo,is)
274 end do
275 end do
276end do
277! generate the local-orbital index
278call genidxlo
279! allocate radial function arrays
280if (allocated(apwfr)) deallocate(apwfr)
282if (allocated(apwdfr)) deallocate(apwdfr)
283allocate(apwdfr(apwordmax,0:lmaxapw,natmtot))
284if (allocated(lofr)) deallocate(lofr)
285allocate(lofr(nrmtmax,2,nlomax,natmtot))
286! store single-precision radial functions if required
287if (any(task == [5,180,185,240,241,300,320,330,331,460,461,462,463,478,600,601,&
288 620,680,700,701,720,725]).or.(xctype(1) < 0).or.ksgwrho) then
289 if (allocated(apwfr_sp)) deallocate(apwfr_sp)
291 if (allocated(lofr_sp)) deallocate(lofr_sp)
292 allocate(lofr_sp(nrcmtmax,nlomax,natmtot))
293 tfr_sp=.true.
294else
295 tfr_sp=.false.
296end if
297
298!-------------------------!
299! DFT+U variables !
300!-------------------------!
301if (dftu /= 0) then
302! allocate energy arrays to calculate Slater integrals with Yukawa potential
303 if (allocated(efdu)) deallocate(efdu)
304 allocate(efdu(0:lmaxdm,natmtot))
305! allocate radial functions to calculate Slater integrals with Yukawa potential
306 if (allocated(fdufr)) deallocate(fdufr)
307 allocate(fdufr(nrmtmax,0:lmaxdm,natmtot))
308end if
309
310!---------------------------------------!
311! eigenvalue equation variables !
312!---------------------------------------!
313! total number of empty states (M. Meinert)
314nempty=nint(nempty0*max(natmtot,1))
315if (nempty < 1) nempty=1
316! number of first-variational states
317nstfv=nint(chgval/2.d0)+nempty+1
318! overlap and Hamiltonian matrix sizes
319if (allocated(nmat)) deallocate(nmat)
320allocate(nmat(nspnfv,nkpt))
321nmatmax=0
322do ik=1,nkpt
323 do jspn=1,nspnfv
324 n=ngk(jspn,ik)+nlotot
325 if (nstfv > n) then
326 write(*,*)
327 write(*,'("Error(init1): number of first-variational states larger than &
328 &matrix size")')
329 write(*,'("Increase rgkmax or decrease nempty")')
330 write(*,*)
331 stop
332 end if
333 nmat(jspn,ik)=n
334 nmatmax=max(nmatmax,n)
335 end do
336end do
337! number of second-variational states
339! allocate second-variational arrays
340if (allocated(evalsv)) deallocate(evalsv)
341allocate(evalsv(nstsv,nkpt))
342if (allocated(occsv)) deallocate(occsv)
343allocate(occsv(nstsv,nkpt))
344! allocate overlap and Hamiltonian integral arrays
345if (allocated(oalo)) deallocate(oalo)
346allocate(oalo(apwordmax,nlomax,natmtot))
347if (allocated(ololo)) deallocate(ololo)
348allocate(ololo(nlomax,nlomax,natmtot))
349if (allocated(haa)) deallocate(haa)
351if (allocated(hloa)) deallocate(hloa)
353if (allocated(hlolo)) deallocate(hlolo)
355! allocate and generate complex Gaunt coefficient array
356if (allocated(gntyry)) deallocate(gntyry)
358do l1=0,lmaxapw
359 do m1=-l1,l1
360 lm1=l1*(l1+1)+m1+1
361 do l3=0,lmaxapw
362 do m3=-l3,l3
363 lm3=l3*(l3+1)+m3+1
364 do l2=0,lmaxo
365 do m2=-l2,l2
366 lm2=l2*(l2+1)+m2+1
367 gntyry(lm2,lm3,lm1)=gauntyry(l1,l2,l3,m1,m2,m3)
368 end do
369 end do
370 end do
371 end do
372 end do
373end do
374! check if the scissor correction is non-zero
375tscissor=(abs(scissor) > 1.d-8)
376! write to VARIABLES.OUT
377if (wrtvars) then
378 call writevars('nempty',iv=nempty)
379 call writevars('nstfv',iv=nstfv)
380 call writevars('nlotot',iv=nlotot)
381 call writevars('nstsv',iv=nstsv)
382end if
383
384call timesec(ts1)
385timeinit=timeinit+ts1-ts0
386
387end subroutine
388!EOC
389
pure subroutine findngkmax(nkpt, vkc, nspnfv, vqcss, ngv, vgc, gkmax, ngkmax)
pure subroutine gengkvec(ngv, ivg, vgc, vkl, vkc, gkmax, ngkmax, ngk, igkig, vgkl, vgkc, gkc)
Definition gengkvec.f90:11
subroutine genidxlo
Definition genidxlo.f90:10
subroutine genkpakq
Definition genkpakq.f90:7
subroutine genppts(tfbz, nsym, sym, ngridp, npptnr, epslat, bvec, boxl, nppt, ipvip, ipvipnr, ivp, vpl, vpc, wppt, wpptnr)
Definition genppts.f90:11
pure subroutine gensfacgp(ngp, vgpc, ld, sfacgp)
Definition gensfacgp.f90:10
subroutine init1
Definition init1.f90:10
integer dftu
Definition moddftu.f90:32
real(8), dimension(:,:,:), allocatable fdufr
Definition moddftu.f90:58
integer, parameter lmaxdm
Definition moddftu.f90:13
real(8), dimension(:,:), allocatable efdu
Definition moddftu.f90:56
Definition modgw.f90:6
logical ksgwrho
Definition modgw.f90:38
real(8), dimension(:,:,:,:), allocatable vgkc
Definition modmain.f90:505
logical tscissor
Definition modmain.f90:906
real(8), dimension(:), allocatable wkpt
Definition modmain.f90:475
integer lorbordmax
Definition modmain.f90:794
integer npp1d
Definition modmain.f90:1113
real(8), dimension(maxapword, 0:maxlapw, maxspecies) apwe0
Definition modmain.f90:766
real(8) radkpt
Definition modmain.f90:446
real(8), dimension(:,:,:), allocatable gkc
Definition modmain.f90:507
integer nsymlat
Definition modmain.f90:342
integer nkptnr
Definition modmain.f90:463
real(8), dimension(:,:,:), allocatable apwe
Definition modmain.f90:768
integer nspinor
Definition modmain.f90:267
integer nvp1d
Definition modmain.f90:1111
real(8) nempty0
Definition modmain.f90:880
real(8), dimension(3, 3) bvec
Definition modmain.f90:16
logical spinpol
Definition modmain.f90:228
real(4), dimension(:,:,:,:), allocatable apwfr_sp
Definition modmain.f90:776
integer, dimension(:,:), allocatable ngk
Definition modmain.f90:497
real(8) deltaem
Definition modmain.f90:481
real(8) chgval
Definition modmain.f90:722
integer, dimension(:,:,:), allocatable igkig
Definition modmain.f90:501
real(8), parameter twopi
Definition modmain.f90:1230
integer lolmax
Definition modmain.f90:798
real(8), dimension(3, 3) binv
Definition modmain.f90:18
integer, dimension(:,:), allocatable ivk
Definition modmain.f90:465
real(8), dimension(:,:), allocatable vvlp1d
Definition modmain.f90:1117
real(8) gkmax
Definition modmain.f90:495
integer, dimension(3) xctype
Definition modmain.f90:588
integer, dimension(0:maxlapw, maxspecies) apword
Definition modmain.f90:758
logical molecule
Definition modmain.f90:47
integer, dimension(maxatoms *maxspecies) idxis
Definition modmain.f90:44
real(8), dimension(maxlorbord, maxlorb, maxspecies) lorbe0
Definition modmain.f90:804
integer nlotot
Definition modmain.f90:790
integer lmmaxapw
Definition modmain.f90:199
real(8), dimension(:,:,:,:,:,:), allocatable haa
Definition modmain.f90:856
real(8), dimension(3) vqcss
Definition modmain.f90:295
integer apwordmax
Definition modmain.f90:760
real(4), dimension(:,:,:), allocatable lofr_sp
Definition modmain.f90:816
integer nlomax
Definition modmain.f90:788
integer, dimension(maxsymcrys) lspnsymc
Definition modmain.f90:366
logical autokpt
Definition modmain.f90:444
real(8) epslat
Definition modmain.f90:24
integer nkpt
Definition modmain.f90:461
integer natmtot
Definition modmain.f90:40
integer nspnfv
Definition modmain.f90:289
integer lmaxapw
Definition modmain.f90:197
real(8), dimension(:,:,:,:), allocatable vgkl
Definition modmain.f90:503
real(8), dimension(:,:,:,:), allocatable hlolo
Definition modmain.f90:860
integer, dimension(3) ngridk
Definition modmain.f90:448
integer, dimension(maxlorb, maxspecies) lorbord
Definition modmain.f90:792
real(8), dimension(:,:), allocatable vplp1d
Definition modmain.f90:1121
real(8), dimension(3, 0:3) vclp3d
Definition modmain.f90:1129
real(8), dimension(:), allocatable dvp1d
Definition modmain.f90:1119
complex(8), dimension(:,:,:), allocatable gntyry
Definition modmain.f90:862
integer nmatmax
Definition modmain.f90:848
real(8), dimension(:,:,:), allocatable apwdfr
Definition modmain.f90:778
real(8), dimension(:,:,:,:,:), allocatable apwfr
Definition modmain.f90:774
integer task
Definition modmain.f90:1298
integer nstsv
Definition modmain.f90:886
real(8), dimension(:), allocatable dpp1d
Definition modmain.f90:1123
integer nsymkpt
Definition modmain.f90:457
integer, dimension(3) np3d
Definition modmain.f90:1131
integer, dimension(maxspecies) lmoapw
Definition modmain.f90:762
logical tfr_sp
Definition modmain.f90:818
logical spinsprl
Definition modmain.f90:283
real(8) scissor
Definition modmain.f90:908
integer lmaxo
Definition modmain.f90:201
logical, dimension(maxsymcrys) tv0symc
Definition modmain.f90:362
integer, dimension(3, 3, 48) symkpt
Definition modmain.f90:459
integer, dimension(:,:), allocatable ivg
Definition modmain.f90:400
real(8), dimension(:,:), allocatable vkl
Definition modmain.f90:471
integer ngkmax
Definition modmain.f90:499
real(8) timeinit
Definition modmain.f90:1212
integer, dimension(:,:,:), allocatable ivkiknr
Definition modmain.f90:469
integer, dimension(:,:), allocatable nmat
Definition modmain.f90:846
real(8), dimension(:,:), allocatable vgc
Definition modmain.f90:420
integer lolmmax
Definition modmain.f90:800
integer reducek
Definition modmain.f90:455
real(8), dimension(3) vqlss
Definition modmain.f90:293
integer, dimension(maxspecies) nlorb
Definition modmain.f90:786
integer, dimension(:,:,:), allocatable ivkik
Definition modmain.f90:467
integer nrcmtmax
Definition modmain.f90:175
integer nrmtmax
Definition modmain.f90:152
real(8), dimension(3) vkloff
Definition modmain.f90:450
integer nsymcrys
Definition modmain.f90:358
real(8), dimension(:,:), allocatable vkc
Definition modmain.f90:473
real(8), dimension(:,:,:), allocatable ololo
Definition modmain.f90:854
integer lmmaxo
Definition modmain.f90:203
integer, dimension(3, 3, 48) symlat
Definition modmain.f90:344
real(8), dimension(:,:,:), allocatable oalo
Definition modmain.f90:852
integer ngvc
Definition modmain.f90:398
integer nstfv
Definition modmain.f90:884
real(8), dimension(:,:,:,:,:), allocatable hloa
Definition modmain.f90:858
complex(8), dimension(:,:,:,:), allocatable sfacgk
Definition modmain.f90:509
integer nspecies
Definition modmain.f90:34
real(8), dimension(:,:), allocatable occsv
Definition modmain.f90:902
integer nempty
Definition modmain.f90:882
integer, dimension(maxspecies) nlmwf
Definition modmain.f90:840
real(8), dimension(3) vklem
Definition modmain.f90:479
real(8) wkptnr
Definition modmain.f90:477
real(8), dimension(:,:,:,:), allocatable lofr
Definition modmain.f90:814
integer, dimension(maxsymcrys) lsplsymc
Definition modmain.f90:364
real(8), dimension(:,:), allocatable evalsv
Definition modmain.f90:918
integer, parameter maxlorb
Definition modmain.f90:780
integer, dimension(maxlorb, maxspecies) lorbl
Definition modmain.f90:796
integer ndspem
Definition modmain.f90:483
real(8), dimension(:,:,:), allocatable lorbe
Definition modmain.f90:808
logical tddos
Definition modtddft.f90:94
subroutine writetest(id, descr, nv, iv, iva, tol, rv, rva, zv, zva)
Definition modtest.f90:16
real(8) omegau
Definition modulr.f90:16
real(8), dimension(3, 3) bvecu
Definition modulr.f90:14
real(8), dimension(3, 3) avecu
Definition modulr.f90:12
real(8) omegabzu
Definition modulr.f90:16
subroutine writevars(vname, n1, n2, n3, n4, n5, n6, nv, iv, iva, rv, rva, zv, zva, sv, sva)
Definition modvars.f90:16
logical wrtvars
Definition modvars.f90:9
subroutine plotpt1d(cvec, nv, np, vvl, vpl, dv, dp)
Definition plotpt1d.f90:10
pure subroutine r3frac(eps, v)
Definition r3frac.f90:10
pure subroutine r3mv(a, x, y)
Definition r3mv.f90:10
subroutine reciplat(avec, bvec, omega, omegabz)
Definition reciplat.f90:10
subroutine timesec(ts)
Definition timesec.f90:10