@@ -328,6 +328,9 @@ def parse_stdout(stdout, input_parameters, parser_options=None, parsed_xml=None,
328
328
# Determine whether the input switched on an electric field
329
329
lelfield = input_parameters .get ('CONTROL' , {}).get ('lelfield' , False )
330
330
331
+ # Determine whether SIRIUS is used
332
+ uses_sirius = 'SIRIUS' in ' ' .join (data_lines [:50 ])
333
+
331
334
# Find some useful quantities.
332
335
if not parsed_xml .get ('number_of_bands' , None ):
333
336
try :
@@ -513,11 +516,14 @@ def parse_stdout(stdout, input_parameters, parser_options=None, parsed_xml=None,
513
516
# (cell, initial positions, kpoints, ...) and I skip them.
514
517
# In case, parse for them before this point.
515
518
# Put everything in a trajectory_data dictionary
516
- relax_steps = stdout .split ('Self-consistent Calculation' )[1 :]
519
+ if uses_sirius :
520
+ relax_steps = stdout .split ('* running SCF ground state *' )[1 :]
521
+ else :
522
+ relax_steps = stdout .split ('Self-consistent Calculation' )[1 :]
523
+
517
524
relax_steps = [i .split ('\n ' ) for i in relax_steps ]
518
525
519
526
# now I create a bunch of arrays for every step.
520
-
521
527
for data_step in relax_steps :
522
528
trajectory_frame = {}
523
529
@@ -677,9 +683,9 @@ def parse_stdout(stdout, input_parameters, parser_options=None, parsed_xml=None,
677
683
pass
678
684
679
685
# grep energy and possibly, magnetization
680
- elif '!' in line :
686
+ elif re . search ( r'^\s*!\s+total energy\s*' , line , re . IGNORECASE ) :
681
687
try :
682
-
688
+ breakpoint ()
683
689
En = float (line .split ('=' )[1 ].split ('Ry' )[0 ]) * CONSTANTS .ry_to_ev
684
690
685
691
# Up till v6.5, the line after total energy would be the Harris-Foulkes estimate, followed by the
@@ -876,7 +882,11 @@ def parse_stdout(stdout, input_parameters, parser_options=None, parsed_xml=None,
876
882
trajectory_data .setdefault ('ionic_dipole_cartesian_axes' , []).append (id_axes )
877
883
878
884
# check consistency of scf_accuracy and scf_iterations
879
- if 'scf_accuracy' in trajectory_data :
885
+
886
+ # we skip the skip is SIRIUS is used, as SIRIUS does not print the scf_accuracy
887
+ # for all scf steps per default, only at the end of each ionic step. Therefore,
888
+ # the lenghts will typically not match
889
+ if 'scf_accuracy' in trajectory_data and not uses_sirius :
880
890
if 'scf_iterations' in trajectory_data :
881
891
if len (trajectory_data ['scf_accuracy' ]) != sum (trajectory_data ['scf_iterations' ]):
882
892
logs .warning .append (
0 commit comments