• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

eT-program / eT / 22395

07 Mar 2025 10:29PM UTC coverage: 88.587%. Remained the same
22395

push

gitlab-ci

Merge branch 'write_xyz_trj' into 'development'

Write geometry optimization trajectory to .xyz file

See merge request eT-program/eT!1544

18 of 18 new or added lines in 5 files covered. (100.0%)

38 existing lines in 4 files now uncovered.

53858 of 60797 relevant lines covered (88.59%)

3059275.34 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

96.82
/src/program/eT_class.F90
1

2

3
! eT - a coupled cluster program
4
! Copyright (C) 2016-2024 the authors of eT
5
!
6
! eT is free software: you can redistribute it and/or modify
7
! it under the terms of the GNU General Public License as published by
8
! the Free Software Foundation, either version 3 of the License, or
9
! (at your option) any later version.
10
!
11
! eT is distributed in the hope that it will be useful,
12
! but WITHOUT ANY WARRANTY; without even the implied warranty of
13
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
! GNU General Public License for more details.
15
!
16
! You should have received a copy of the GNU General Public License
17
! along with this program. If not, see <https://www.gnu.org/licenses/>.
18

19

20
module eT_class
21

22
   !!
23
   !! eT class
24
   !! Written by Eirik F. Kjønstad, May 2022
25
   !!
26

27
   use timings_class, only: timings
28

29
   implicit none
30

31
   type :: eT
32

33
      type(timings), allocatable, private :: timer
34

35
   contains
36

37
      procedure, public :: run
38

39
      procedure, public :: initialize
40
      procedure, public :: finalize
41
      procedure, public :: run_calculations
42

43
      procedure, private, nopass :: create_memory_manager
44

45
      procedure, private, nopass :: get_and_print_n_threads
46
      procedure, private, nopass :: set_global_print_levels_in_output_and_timing
47
      procedure, private, nopass :: print_compilation_info
48

49
      procedure, private :: print_timestamp
50
      procedure, private, nopass :: get_date_and_time
51

52
      procedure, private, nopass :: cholesky_decompose_eris
53
      procedure, private         :: run_geometry_optimization
54
      procedure, private         :: run_harmonic_frequencies
55
      procedure, public, nopass  :: run_reference_calculation
56
      procedure, private, nopass :: run_cc_calculation
57
      procedure, private, nopass :: run_ci_calculation
58

59
      procedure, private :: print_top_info_to_output_and_timing
60
      procedure, private :: print_bottom_info_to_output
61

62
   end type eT
63

64

65
   interface eT
66

67
      procedure :: new_eT
68

69
   end interface eT
70

71

72
contains
73

74

75
   function new_eT() result(this)
3,241✔
76
      !!
77
      !! Written by Eirik F. Kjønstad, May 2022
78
      !!
79
      implicit none
80

81
      type(eT) :: this
82

83
      this%timer = timings("Total time in eT", pl='minimal')
3,241✔
84

85
   end function new_eT
3,241✔
86

87

88
   subroutine run(this)
3,229✔
89
      !!
90
      !! Written by Sarai D. Folkestad, Eirik F. Kjønstad,
91
      !! Alexander C. Paul, and Rolf H. Myhre, 2018-2022
92
      !!
93
      use global_in
94

95
      implicit none
96

97
      class(eT), intent(inout) :: this
98

99
      input = input_tool()
3,229✔
100
      call input%read_input(file_name='eT.inp')
3,229✔
101

102
      call this%initialize()
3,229✔
103

104
      call this%run_calculations()
3,229✔
105

106
      call this%finalize()
3,199✔
107

108
   end subroutine run
3,199✔
109

110

111
   subroutine initialize(this)
3,241✔
112
      !!
113
      !! Written by Eirik F. Kjønstad, Mar 2024
114
      !!
115
      use global_in
116
      use global_out
117
      use timings_file_class,       only: timings_file
118
      use memory_manager_class,     only: mem
119
      use citation_printer_class,   only: eT_citations, citation_printer
120

121
#ifdef USE_LIBINT
122
      use libint_initialization, only: initialize_libint_c
123
#endif
124

125
      implicit none
126

127
      class(eT), intent(inout) :: this
128

129
      call this%timer%turn_on()
3,241✔
130

131
      output = output_file('eT.out')
3,241✔
132
      timing = timings_file('eT.timing.out')
3,241✔
133

134
      call output%open_()
3,241✔
135
      call timing%open_()
3,241✔
136

137
      call this%print_top_info_to_output_and_timing()
3,241✔
138

139
      call input%process_input()
3,241✔
140

141
      call this%set_global_print_levels_in_output_and_timing()
3,241✔
142

143
      eT_citations = citation_printer(input)
3,313✔
144
      mem = this%create_memory_manager(input)
3,241✔
145

146
#ifdef USE_LIBINT
147
      call initialize_libint_c() ! Safe to use Libint from now on
1,069✔
148
#endif
149

150
   end subroutine initialize
3,241✔
151

152

153
   subroutine finalize(this)
3,211✔
154
      !!
155
      !! Written by Eirik F. Kjønstad, Mar 2024
156
      !!
157
      use global_out
158
      use global_in
159
      use memory_manager_class, only: mem
160

161
#ifdef USE_LIBINT
162
      use libint_initialization, only: finalize_libint_c
163
#endif
164

165
      implicit none
166

167
      class(eT), intent(inout) :: this
168

169
      call mem%check_for_leak()
3,211✔
170

171
      call input%cleanup()
3,211✔
172

173
      call this%timer%turn_off()
3,211✔
174

175
      call output%check_for_warnings()
3,211✔
176

177
      call this%print_bottom_info_to_output()
3,211✔
178

179
#ifdef USE_LIBINT
180
      call finalize_libint_c() ! No longer safe to use Libint
1,059✔
181
#endif
182

183
      call timing%close_()
3,211✔
184

185
      call output%printf('m', 'eT terminated successfully!', fs='(/t3,a)')
3,211✔
186
      call output%close_()
3,211✔
187

188
   end subroutine finalize
3,211✔
189

190
   subroutine print_timestamp(this, print_label)
6,452✔
191
      !!
192
      !! Written by Eirik F. Kjønstad, May 2022
193
      !!
194
      use global_out, only: output
195

196
      implicit none
197

198
      class(eT), intent(in) :: this
199

200
      character(len=*), intent(in) :: print_label
201

202
      character(len=50) :: timestamp
203

204
      call this%get_date_and_time(timestamp)
6,452✔
205
      call output%printf('m', 'Calculation (a0):', chars=[print_label], fs='(/t3,a)', adv=.false.)
19,356✔
206
      call output%printf('m', "(a0)", chars=[timestamp], fs='(t1,a)')
12,904✔
207

208
   end subroutine print_timestamp
6,452✔
209

210

211
   subroutine get_and_print_n_threads()
3,241✔
212
      !!
213
      !! Written by Eirik F. Kjønstad, May 2022
214
      !!
215
      use omp_lib
216
      use global_out, only: output
217

218
      implicit none
219

220
      integer :: n_threads
221

222
      n_threads = 1
223

224
      !$    n_threads = omp_get_max_threads()
3,241✔
225

226
      if (n_threads .eq. 1) then
3,241✔
227

228
         call output%printf('m', 'Running on (i0) OMP thread', ints=[n_threads], fs='(/t3,a)')
×
229

230
      else
231

232
         call output%printf('m', 'Running on (i0) OMP threads', ints=[n_threads], fs='(/t3,a)')
6,482✔
233

234
      endif
235

236
   end subroutine get_and_print_n_threads
3,241✔
237

238

239
   function create_memory_manager(input) result(mem_manager)
3,241✔
240
      !!
241
      !! Written by Eirik F. Kjønstad, May 2022
242
      !!
243
      use parameters
244
      use memory_manager_class, only: memory_manager
245
      use input_tool_class, only: input_tool
246

247
      implicit none
248

249
      class(input_tool), intent(in) :: input
250

251
      character(len=200) :: mem_unit
252
      integer(i64)       :: mem_total
253

254
      type(memory_manager) :: mem_manager
255

256
      mem_total = 8
3,241✔
257
      mem_unit  = 'gb'
3,241✔
258

259
      call input%get_keyword('available', 'memory', mem_total)
3,241✔
260
      call input%get_keyword('unit',      'memory', mem_unit)
3,241✔
261

262
      mem_manager = memory_manager(total = mem_total, &
263
                                   units = mem_unit)
3,241✔
264

265
   end function create_memory_manager
3,241✔
266

267

268
   subroutine run_calculations(this)
3,229✔
269
      !!
270
      !! Written by Eirik F. Kjønstad, May 2022
271
      !!
272
      use global_out, only: output
273
      use global_in, only: input
274

275
      use hf_class, only: hf
276

277
      implicit none
278

279
      class(eT), intent(in) :: this
280

281
      class(hf), allocatable :: ref_wf
6,428✔
282

283
      logical :: requested_cholesky
284

285
      ! Cholesky decomposition of electron repulsion integrals (ERIs)
286
      requested_cholesky = input%is_keyword_present('cholesky eri', 'do')
3,229✔
287
      if (requested_cholesky) call cholesky_decompose_eris(input%is_keyword_present('diagonal test', 'solver cholesky'))
3,229✔
288

289
      if (input%is_keyword_present('geometry optimization', 'do')) then
3,229✔
290

291
         call this%run_geometry_optimization(ref_wf)
122✔
292

293
      elseif (input%is_keyword_present('harmonic frequencies','do')) then
3,107✔
294

295
         call this%run_harmonic_frequencies(ref_wf)
42✔
296

297
      elseif (input%requested_reference_calculation()) then
3,065✔
298

299
         call this%run_reference_calculation(ref_wf)
3,059✔
300

301
         if (input%requested_cc_calculation()) then
3,041✔
302

303
            call this%run_cc_calculation(ref_wf)
1,983✔
304

305
         else if (input%requested_ci_calculation()) then
1,058✔
306

307
            call this%run_ci_calculation(ref_wf)
372✔
308

309
         endif
310

311
         call ref_wf%cleanup()
3,029✔
312
         deallocate(ref_wf)
6,058✔
313

314
      else
315

316
         if (input%requested_cc_calculation()) &
6✔
317
            call output%error_msg('to run CC calculation reference wavefunction must be specified.')
×
318

319
         if (.not. requested_cholesky) &
6✔
320
            call output%error_msg('no method nor ERI Cholesky decomposition selected in input.')
×
321

322
      endif
323

324
   end subroutine run_calculations
3,199✔
325

326

327
   subroutine run_geometry_optimization(this, ref_wf)
122✔
328
      !!
329
      !! Written by Eirik F. Kjønstad, 2022
330
      !!
331
      use hf_class, only: hf
332
      use ccs_class, only: ccs
333

334
      use reference_wavefunction_factory_class, only: reference_wavefunction_factory
335
      use cc_wavefunction_factory_class, only: cc_wavefunction_factory
336

337
      use geoopt_engine_class, only: geoopt_engine
338

339
      use global_in, only: input
340

341
      implicit none
342

343
      class(eT), intent(in) :: this
344

345
      class(hf), allocatable, intent(inout)              :: ref_wf
346
      class(reference_wavefunction_factory), allocatable :: ref_wf_factory
347

348
      class(geoopt_engine), allocatable :: engine
349

350
      class(ccs), allocatable                    :: cc_wf
298✔
351
      type(cc_wavefunction_factory), allocatable :: cc_wf_factory
352

353
      if (.not. input%requested_cc_calculation()) then
122✔
354

355
         ref_wf_factory = reference_wavefunction_factory()
68✔
356
         call ref_wf_factory%create(ref_wf)
68✔
357

358
         engine = geoopt_engine()
68✔
359
         call engine%run(ref_wf)
68✔
360

361
      else
362

363
         call this%run_reference_calculation(ref_wf)
54✔
364

365
         cc_wf_factory = cc_wavefunction_factory()
54✔
366
         call cc_wf_factory%create(ref_wf, cc_wf)
54✔
367

368
         engine = geoopt_engine()
54✔
369
         call engine%run(cc_wf, ref_wf)
54✔
370

371
         call cc_wf%cleanup()
54✔
372

373
      endif
374

375
      call ref_wf%cleanup()
122✔
376
      deallocate(ref_wf)
122✔
377

378
   end subroutine run_geometry_optimization
122✔
379

380

381
   subroutine run_harmonic_frequencies(this, ref_wf)
42✔
382
      !!
383
      !! Written by Eirik F. Kjønstad, 2022
384
      !!
385
      use hf_class, only: hf
386
      use ccs_class, only: ccs
387

388
      use reference_wavefunction_factory_class, only: reference_wavefunction_factory
389
      use cc_wavefunction_factory_class, only: cc_wavefunction_factory
390

391
      use harmonic_frequencies_engine_class, only: harmonic_frequencies_engine
392
      use geoopt_engine_class, only: geoopt_engine
393

394
      use global_in, only: input
395

396
      implicit none
397

398
      class(eT), intent(in) :: this
399

400
      class(hf), allocatable, intent(inout)              :: ref_wf
401
      class(reference_wavefunction_factory), allocatable :: ref_wf_factory
402

403
      class(harmonic_frequencies_engine), allocatable :: engine
404
      class(geoopt_engine), allocatable :: optimization_engine
405

406
      class(ccs), allocatable                    :: cc_wf
108✔
407
      type(cc_wavefunction_factory), allocatable :: cc_wf_factory
408

409
      if (.not. input%requested_cc_calculation()) then
42✔
410

411
         ref_wf_factory = reference_wavefunction_factory()
18✔
412
         call ref_wf_factory%create(ref_wf)
18✔
413

414
         if (input%is_keyword_present('run geometry optimization', 'harmonic frequencies')) then
18✔
415

416
            optimization_engine = geoopt_engine()
18✔
417
            call optimization_engine%run(ref_wf)
18✔
418

419
         endif
420

421
         engine = harmonic_frequencies_engine(ref_wf)
18✔
422
         call engine%initialize()
18✔
423
         call engine%run()
18✔
424

425
      else
426

427
         call this%run_reference_calculation(ref_wf)
24✔
428

429
         cc_wf_factory = cc_wavefunction_factory()
24✔
430
         call cc_wf_factory%create(ref_wf, cc_wf)
24✔
431

432
         if (input%is_keyword_present('run geometry optimization', 'harmonic frequencies')) then
24✔
433

434
            optimization_engine = geoopt_engine()
18✔
435
            call optimization_engine%run(cc_wf, ref_wf)
18✔
436

437
         endif
438

439
         engine = harmonic_frequencies_engine(ref_wf, cc_wf)
24✔
440
         call engine%initialize()
24✔
441
         call engine%run()
24✔
442

443
         call cc_wf%cleanup()
24✔
444

445
      endif
446

447
      call ref_wf%cleanup()
42✔
448
      deallocate(ref_wf)
42✔
449

450
   end subroutine run_harmonic_frequencies
42✔
451

452

453
   subroutine run_reference_calculation(ref_wf)
3,137✔
454
      !!
455
      !! Written by Sarai D. Folkestad and Eirik F. Kjønstad, Apr 2019
456
      !!
457
      use hf_class, only: hf
458
      use hf_engine_class, only: hf_engine
459
      use reference_wavefunction_factory_class, only: reference_wavefunction_factory
460
      use reference_engine_factory_class, only: reference_engine_factory
461

462
      implicit none
463

464
      class(hf), allocatable, intent(inout)              :: ref_wf
465
      class(reference_wavefunction_factory), allocatable :: ref_wf_factory
466

467
      class(hf_engine), allocatable  :: ref_engine
6,256✔
468
      type(reference_engine_factory) :: ref_engine_factory
469

470
      ref_wf_factory = reference_wavefunction_factory()
3,137✔
471

472
      call ref_wf_factory%create(ref_wf)
3,137✔
473

474
      call ref_engine_factory%create(ref_engine)
475

476
      call ref_engine%ignite(ref_wf)
3,137✔
477

478
   end subroutine run_reference_calculation
3,119✔
479

480

481
   subroutine run_cc_calculation(ref_wf)
1,983✔
482
      !!
483
      !! Written by Sarai D. Folkestad and Eirik F. Kjønstad, Apr 2019
484
      !!
485
      use hf_class, only: hf
486

487
      use ccs_class,                      only: ccs
488
      use cc_wavefunction_factory_class,  only: cc_wavefunction_factory
489

490
      use cc_engine_class,          only: cc_engine
491
      use cc_engine_factory_class,  only: cc_engine_factory
492

493
      implicit none
494

495
      class(hf), intent(in) :: ref_wf
496

497
      class(ccs), allocatable                    :: cc_wf
5,925✔
498
      type(cc_wavefunction_factory), allocatable :: cc_wf_factory
499

500
      class(cc_engine), allocatable        :: engine
3,954✔
501
      type(cc_engine_factory), allocatable :: engine_factory
502

503
      cc_wf_factory = cc_wavefunction_factory()
1,983✔
504
      call cc_wf_factory%create(ref_wf, cc_wf)
1,983✔
505

506
      allocate(cc_engine_factory::engine_factory)
1,983✔
507
      call engine_factory%create(engine)
508

509
      call engine%ignite(cc_wf)
1,983✔
510

511
      call cc_wf%cleanup()
1,971✔
512

513
   end subroutine run_cc_calculation
1,971✔
514

515

516
   subroutine run_ci_calculation(ref_wf)
372✔
517
      !!
518
      !! Written by Enrico Ronca, 2020
519
      !!
520
      use hf_class, only: hf
521

522
      use fci_class,                      only: fci
523
      use ci_wavefunction_factory_class,  only: ci_wavefunction_factory
524

525
      use ci_engine_class, only: ci_engine
526

527
      implicit none
528

529
      class(hf), intent(in) :: ref_wf
530

531
      class(fci), allocatable                     :: ci_wf
744✔
532
      type(ci_wavefunction_factory), allocatable  :: ci_wf_factory
533

534
      class(ci_engine), allocatable :: engine
535

536
      ci_wf_factory = ci_wavefunction_factory()
372✔
537
      call ci_wf_factory%create(ref_wf, ci_wf)
372✔
538

539
      engine = ci_engine()
372✔
540

541
      call engine%ignite(ci_wf)
372✔
542

543
      call ci_wf%cleanup()
372✔
544

545
   end subroutine run_ci_calculation
372✔
546

547

548
   subroutine cholesky_decompose_eris(diagonal_test)
6✔
549
      !!
550
      !! Written by Eirik F. Kjønstad and Sarai D. Folkestad, Apr 2019 and Dec 2019
551
      !!
552
      !! Performs Cholesky decomposition of the electron repulsion integral matrix.
553
      !!
554
      use eri_cd_class,  only: eri_cd
555
      use ao_tool_class, only: ao_tool
556
      use ao_eri_getter_class, only: ao_eri_getter
557

558
      implicit none
559

560
      logical, intent(in) :: diagonal_test
561

562
      type(eri_cd), allocatable  :: eri_cholesky_solver
563
      class(ao_tool), allocatable :: ao
564
      type(ao_eri_getter) :: eri_getter
565

566
      ao = ao_tool()
6✔
567
      call ao%initialize()
6✔
568

569
      eri_getter = ao_eri_getter(ao)
6✔
570
      eri_cholesky_solver = eri_cd(ao, eri_getter)
6✔
571

572
      call eri_cholesky_solver%run(ao)
6✔
573

574
      if (diagonal_test) then
6✔
575

576
         ! Determine the largest deviation in the ERI matrix
577
         call eri_cholesky_solver%diagonal_test(ao)
6✔
578

579
      end if
580

581
      call eri_cholesky_solver%cleanup()
6✔
582

583
   end subroutine cholesky_decompose_eris
6✔
584

585

586
   subroutine set_global_print_levels_in_output_and_timing()
3,241✔
587
      !!
588
      !! Written by Rolf H. Myhre, Oct. 2019
589
      !!
590
      use global_out, only: output, timing
591
      use global_in,  only: input
592

593
      implicit none
594

595
      character(len=200) :: print_level
596

597
      print_level = 'normal'
3,241✔
598
      call input%get_keyword('output print level', 'print', print_level)
3,241✔
599

600
      ! This is the only place this routine is allowed to be called
601
      call output%set_global_print_level(print_level)
3,241✔
602

603
      ! Repeat for timing file
604
      print_level = 'normal'
3,241✔
605
      call input%get_keyword('timing print level', 'print', print_level)
3,241✔
606

607
      ! This is the only place this routine is allowed to be called
608
      call timing%set_global_print_level(print_level)
3,241✔
609

610
   end subroutine set_global_print_levels_in_output_and_timing
3,241✔
611

612

613
   subroutine print_top_info_to_output_and_timing(this)
3,241✔
614
      !!
615
      !! Written by Eirik F. Kjønstad, 2019
616
      !!
617
      use parameters
618
      use global_out, only: output, timing
619

620
      implicit none
621

622
      class(eT), intent(in) :: this
623

624
      call output%printf('m', 'eT (i0).(i0) - an electronic structure program ', &
625
                      ints=[major_version, minor_version], fs='(///t22,a)')
3,241✔
626

627
      call output%print_separator('m',72,'-', fs='(/t3,a)')
3,241✔
628

629
      call output%printf('m', 'Author list in alphabetical order:', fs='(t4,a)')
3,241✔
630

631
      call output%print_separator('m',72,'-', fs='(t3,a)')
3,241✔
632

633
      call output%printf('m', 'J. H. Andersen, '         // &
634
                              'S. Angelico, '            // &
635
                              'A. Balbi, '               // &
636
                              'A. Barlini, '             // &
637
                              'A. Bianchi, '             // &
638
                              'C. Cappelli, '            // &
639
                              'M. Castagnola, '          // &
640
                              'S. Coriani, '             // &
641
                              'S. D. Folkestad, '        // &
642
                              'Y. El Moutaoukal, '       // &
643
                              'T. Giovannini, '          // &
644
                              'L. Goletto, '             // &
645
                              'T. S. Haugland, '         // &
646
                              'A. Hutcheson, '           // &
647
                              'I-M. Høyvik, '            // &
648
                              'E. F. Kjønstad, '         // &
649
                              'H. Koch, '                // &
650
                              'M. T. Lexander, '         // &
651
                              'G. Marrazzini, '          // &
652
                              'T. Moitra, '              // &
653
                              'R. H. Myhre, '            // &
654
                              'Y. Os, '                  // &
655
                              'A. C. Paul, '             // &
656
                              'R. Paul, '                // &
657
                              'J. Pedersen, '            // &
658
                              'M. Rinaldi, '             // &
659
                              'R. R. Riso, '             // &
660
                              'S. Roet, '                // &
661
                              'E. Ronca, '               // &
662
                              'F. Rossi, '               // &
663
                              'B. S. Sannes, '           // &
664
                              'M. Scavino, '             // &
665
                              'A. K. Schnack-Petersen, ' // &
666
                              'A. S. Skeidsvoll, '       // &
667
                              'J. H. M. Trabski, '       // &
668
                              'Å. H. Tveten',               &
669
                              ffs='(t4,a)', fs='(t4,a)', ll=68)
3,241✔
670

671
      call output%print_separator('m',72,'-', fs='(t3,a)')
3,241✔
672

673
      call output%printf('m', 'J. Chem. Phys. 152, 184103 (2020); https://doi.org/10.1063/5.0004713', &
674
                      fs='(t4,a)')
3,241✔
675

676
      call output%printf('m', "This is eT (i0).(i0).(i0) (a0)", &
677
                         ints=[major_version, minor_version, patch_version], &
678
                         chars = [version_name], fs='(//t4,a)')
6,482✔
679

680
      call this%print_compilation_info(output)
3,241✔
681
      call this%print_compilation_info(timing)
3,241✔
682

683
      call timing%print_banner()
3,241✔
684

685
      call this%print_timestamp(print_label = 'start')
3,241✔
686

687
      call this%get_and_print_n_threads()
3,241✔
688

689
   end subroutine print_top_info_to_output_and_timing
3,241✔
690

691

692
   subroutine print_bottom_info_to_output(this)
3,211✔
693
      !!
694
      !! Written by Eirik F. Kjønstad, May 2022
695
      !!
696
      use memory_manager_class, only: mem
697
      use citation_printer_class, only: eT_citations
698
      use global_out, only: output
699

700
      implicit none
701

702
      class(eT), intent(in) :: this
703

704
      call mem%print_max_used()
3,211✔
705

706
      call this%timer%print_to_file(output, string="in eT")
3,211✔
707

708
      call this%print_timestamp(print_label = 'end')
3,211✔
709

710
      call eT_citations%print_(output)
3,211✔
711

712
   end subroutine print_bottom_info_to_output
3,211✔
713

714

715
   subroutine get_date_and_time(string)
6,452✔
716
      !!
717
      !! Written by Rolf H. Myhre, Nov, 2020
718
      !!
719
      !! Returns a formatted string with date, time and UTC offset
720
      !!
721
      !! Format: yyyy-mm-dd hh:mm:ss UTC xhh:mm
722
      !!
723
      implicit none
724

725
      character(len=*), intent(out) :: string
726
      character(len=20) :: date, time, zone
727

728
      call date_and_time(date=date, time=time, zone=zone)
6,452✔
729

730
      string = ""
6,452✔
731
      write(string, "(a,a,a,a,a,a)") date(1:4), "-", date(5:6), "-", date(7:8), " "
6,452✔
732
      write(string(12:), "(a,a,a,a,a)") time(1:2), ":", time(3:4), ":", time(5:6)
6,452✔
733
      write(string(20:), "(a,a,a,a)") " UTC ", zone(1:3), ":", zone(4:5)
6,452✔
734

735
   end subroutine get_date_and_time
6,452✔
736

737

738
   subroutine print_compilation_info(file_)
6,482✔
739
      !!
740
      !! Written by Rolf H. Myhre, Nov, 2020
741
      !!
742
      !! Retrieves compilation information from the
743
      !! get_compilation_info library generated by CMake
744
      !! and prints to output
745
      !!
746
      use output_file_class, only: output_file
747

748
      implicit none
749

750
      class(output_file), intent(inout) :: file_
751

752
      character(len=200) :: string
753

754
      call file_%print_separator('n',61,'-', fs='(t3,a)')
6,482✔
755

756
      call get_configuration_time(string)
6,482✔
757
      call file_%printf("m", "Configuration date:  (a0)", chars =[string])
12,964✔
758

759
      call get_git_branch(string)
6,482✔
760
      if(len_trim(string) .gt. 0) then
6,482✔
UNCOV
761
         call file_%printf("m", "Git branch:          (a0)", chars =[string])
×
762

UNCOV
763
         call get_git_hash(string)
×
764
         call file_%printf("m", "Git hash:            (a0)", chars =[string])
×
765
      endif
766

767
      call get_fortran_compiler(string)
6,482✔
768
      call file_%printf("m", "Fortran compiler:    (a0)", chars =[string])
12,964✔
769

770
      call get_c_compiler(string)
6,482✔
771
      call file_%printf("m", "C compiler:          (a0)", chars =[string])
12,964✔
772

773
      call get_cxx_compiler(string)
6,482✔
774
      call file_%printf("m", "C++ compiler:        (a0)", chars =[string])
12,964✔
775

776
      call get_lapack_type(string)
6,482✔
777
      call file_%printf("m", "LAPACK type:         (a0)", chars =[string])
12,964✔
778

779
      call get_blas_type(string)
6,482✔
780
      call file_%printf("m", "BLAS type:           (a0)", chars =[string])
12,964✔
781

782
      call get_oei_type(string)
6,482✔
783
      call file_%printf("m", "OEI type:            (a0)", chars =[string])
12,964✔
784

785
      call get_eri_type(string)
6,482✔
786
      call file_%printf("m", "ERI type:            (a0)", chars =[string])
12,964✔
787

788
      call get_int64(string)
6,482✔
789
      call file_%printf("m", "64-bit integers:     (a0)", chars =[string])
12,964✔
790

791
      call get_omp(string)
6,482✔
792
      call file_%printf("m", "OpenMP:              (a0)", chars =[string])
12,964✔
793

794
      call get_pcm(string)
6,482✔
795
      call file_%printf("m", "PCM:                 (a0)", chars =[string])
12,964✔
796

797
      call get_forced_batching(string)
6,482✔
798
      call file_%printf("m", "Forced batching:     (a0)", chars =[string])
12,964✔
799

800
      call get_runtime_check(string)
6,482✔
801
      call file_%printf("m", "Runtime checks:      (a0)", chars =[string])
12,964✔
802

803
      call get_initialize_nan_check(string)
6,482✔
804
      call file_%printf("m", "Initializing to NAN: (a0)", chars =[string])
12,964✔
805

806
      call file_%print_separator("m",61,"-", fs="(t3,a)")
6,482✔
807

808
   end subroutine print_compilation_info
6,482✔
809

810

UNCOV
811
end module eT_class
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc