avoid issues with empty files

optional files (numerics.yaml, debug.yaml) can be empty
This commit is contained in:
Martin Diehl 2021-08-14 20:01:25 +02:00
parent 30d9f57db0
commit 1963343cd8
2 changed files with 11 additions and 7 deletions

@ -1 +1 @@
Subproject commit bea0b1c2e3ead08d0d2f1e5b4561bfe6251052a4
Subproject commit ad4a685d454271a400914c0334c017e3ac0dfc99

View File

@ -83,9 +83,11 @@ subroutine parse_numerics()
if (worldrank == 0) then
print*, 'reading numerics.yaml'; flush(IO_STDOUT)
fileContent = IO_read('numerics.yaml')
call results_openJobFile(parallel=.false.)
call results_writeDataset_str(fileContent,'setup','numerics.yaml','numerics configuration')
call results_closeJobFile
if (len(fileContent) > 0) then
call results_openJobFile(parallel=.false.)
call results_writeDataset_str(fileContent,'setup','numerics.yaml','numerics configuration')
call results_closeJobFile
endif
endif
call parallelization_bcast_str(fileContent)
@ -113,9 +115,11 @@ subroutine parse_debug()
if (worldrank == 0) then
print*, 'reading debug.yaml'; flush(IO_STDOUT)
fileContent = IO_read('debug.yaml')
call results_openJobFile(parallel=.false.)
call results_writeDataset_str(fileContent,'setup','debug.yaml','debug configuration')
call results_closeJobFile
if (len(fileContent) > 0) then
call results_openJobFile(parallel=.false.)
call results_writeDataset_str(fileContent,'setup','debug.yaml','debug configuration')
call results_closeJobFile
endif
endif
call parallelization_bcast_str(fileContent)