store load case (full reproducibility for grid solver)

This commit is contained in:
Martin Diehl 2021-07-27 07:57:04 +02:00
parent e01d271ee4
commit ddb0429a1d
3 changed files with 11 additions and 11 deletions

View File

@ -119,9 +119,10 @@ function IO_read(fileName) result(fileContent)
character(len=:), allocatable :: fileContent
integer :: &
fileLength, &
fileUnit, &
myStat
integer(pI64) :: &
fileLength
inquire(file = fileName, size=fileLength)

View File

@ -107,6 +107,8 @@ program DAMASK_grid
step_bc, &
step_mech, &
step_discretization
character(len=:), allocatable :: &
fileContent
!--------------------------------------------------------------------------------------------------
! init DAMASK (all modules)
@ -127,6 +129,12 @@ program DAMASK_grid
if (stagItMax < 0) call IO_error(301,ext_msg='maxStaggeredIter')
if (maxCutBack < 0) call IO_error(301,ext_msg='maxCutBack')
if (worldrank == 0) then
fileContent = IO_read(interface_loadFile)
call results_openJobFile(parallel=.false.)
call results_writeDataset_str(fileContent,'setup',interface_loadFile,'load case definition (grid solver)')
call results_closeJobFile
endif
config_load => YAML_parse_file(trim(interface_loadFile))
solver => config_load%get('solver')

View File

@ -68,9 +68,6 @@ subroutine discretization_grid_init(restart)
devNull, z, z_offset
integer, dimension(worldsize) :: &
displs, sendcounts
integer :: fileUnit, myStat
integer(pI64) :: &
fileLength
character(len=:), allocatable :: &
fileContent
@ -79,13 +76,7 @@ subroutine discretization_grid_init(restart)
if(worldrank == 0) then
inquire(file = trim(interface_geomFile), size=fileLength)
open(newunit=fileUnit, file=trim(interface_geomFile), access='stream',&
status='old', position='rewind', action='read',iostat=myStat)
if(myStat /= 0) call IO_error(100,ext_msg=trim(interface_geomFile))
allocate(character(len=fileLength)::fileContent)
read(fileUnit) fileContent
close(fileUnit)
fileContent = IO_read(interface_geomFile)
call readVTI(grid,geomSize,origin,materialAt_global,fileContent)
call results_openJobFile(parallel=.false.)
call results_writeDataset_str(fileContent,'setup',interface_geomFile,'geometry definition (grid solver)')