diff --git a/src/main.f90 b/src/main.f90 index af9e3dc..c4f9730 100644 --- a/src/main.f90 +++ b/src/main.f90 @@ -80,9 +80,12 @@ program main call init_misc(params, data) + ! Get back to the initial directory + err = chdir(cwd) + ! Change the current directory to output files there if (allocated(opts%output_dir)) then - if (chdir(trim(cwd) // '/' // opts%output_dir) /= 0) then + if (chdir(opts%output_dir) /= 0) then call log_message(level=ERROR, mod='main', & msg='chdir to output_dir ('//opts%output_dir//') failed!') call exit(1)