@@ -591,6 +591,27 @@ subroutine metropolis_decorrelated_samples(setup, metropolis, my_rank)
591591 ! Set up the lattice
592592 call initial_setup(setup, config)
593593
594+ ! Make the relevant directories
595+ if ((metropolis% write_final_config_xyz).or. (metropolis% write_final_config_nc)) then
596+ if (my_rank == 0 ) call execute_command_line(' mkdir -p configs' )
597+ end if
598+ if (metropolis% calculate_energies) then
599+ if (my_rank == 0 ) call execute_command_line(' mkdir -p energies' )
600+ end if
601+ if (metropolis% calculate_asro) then
602+ if (my_rank == 0 ) call execute_command_line(' mkdir -p asro' )
603+ end if
604+ if (metropolis% calculate_alro) then
605+ if (my_rank == 0 ) call execute_command_line(' mkdir -p alro' )
606+ end if
607+ if ((metropolis% write_trajectory_energy).or. (metropolis% write_trajectory_asro).or. (metropolis% write_trajectory_xyz)) then
608+ if (my_rank == 0 ) call execute_command_line(' mkdir -p trajectories' )
609+ end if
610+
611+ ! Make sure the required directories have been made before moving
612+ ! to later portions of the calculation
613+ call comms_wait()
614+
594615#ifdef USE_MPI
595616
596617 ! Initialise some global arrays
@@ -676,7 +697,7 @@ subroutine metropolis_decorrelated_samples(setup, metropolis, my_rank)
676697 acceptance = acceptance + accept
677698
678699 ! Draw samples
679- if (mod (i, metropolis% n_sample_steps_asro ) .eq. 0 ) then
700+ if (mod (i, metropolis% n_sample_steps ) .eq. 0 ) then
680701
681702 ! Get the energy of this configuration
682703 current_energy = setup% full_energy(config)
0 commit comments