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 character(len=:), allocatable :: fileContent
integer :: & integer :: &
fileLength, &
fileUnit, & fileUnit, &
myStat myStat
integer(pI64) :: &
fileLength
inquire(file = fileName, size=fileLength) inquire(file = fileName, size=fileLength)

View File

@ -107,6 +107,8 @@ program DAMASK_grid
step_bc, & step_bc, &
step_mech, & step_mech, &
step_discretization step_discretization
character(len=:), allocatable :: &
fileContent
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! init DAMASK (all modules) ! init DAMASK (all modules)
@ -127,6 +129,12 @@ program DAMASK_grid
if (stagItMax < 0) call IO_error(301,ext_msg='maxStaggeredIter') if (stagItMax < 0) call IO_error(301,ext_msg='maxStaggeredIter')
if (maxCutBack < 0) call IO_error(301,ext_msg='maxCutBack') 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)) config_load => YAML_parse_file(trim(interface_loadFile))
solver => config_load%get('solver') solver => config_load%get('solver')

View File

@ -68,9 +68,6 @@ subroutine discretization_grid_init(restart)
devNull, z, z_offset devNull, z, z_offset
integer, dimension(worldsize) :: & integer, dimension(worldsize) :: &
displs, sendcounts displs, sendcounts
integer :: fileUnit, myStat
integer(pI64) :: &
fileLength
character(len=:), allocatable :: & character(len=:), allocatable :: &
fileContent fileContent
@ -79,13 +76,7 @@ subroutine discretization_grid_init(restart)
if(worldrank == 0) then if(worldrank == 0) then
inquire(file = trim(interface_geomFile), size=fileLength) fileContent = IO_read(interface_geomFile)
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)
call readVTI(grid,geomSize,origin,materialAt_global,fileContent) call readVTI(grid,geomSize,origin,materialAt_global,fileContent)
call results_openJobFile(parallel=.false.) call results_openJobFile(parallel=.false.)
call results_writeDataset_str(fileContent,'setup',interface_geomFile,'geometry definition (grid solver)') call results_writeDataset_str(fileContent,'setup',interface_geomFile,'geometry definition (grid solver)')