option to specify numerics configuration file and jobname
default jobname now includes all CLI arguments (for mesh/grid only)
This commit is contained in:
parent
bb49289b76
commit
3af61233c9
2
PRIVATE
2
PRIVATE
|
@ -1 +1 @@
|
||||||
Subproject commit 9f4ffce8b2df951191a14dc3229de1aee6e544e6
|
Subproject commit 3c4052994318bf41620af2e4c8795f36cabc3645
|
236
src/CLI.f90
236
src/CLI.f90
|
@ -21,14 +21,16 @@ module CLI
|
||||||
implicit none(type,external)
|
implicit none(type,external)
|
||||||
private
|
private
|
||||||
integer, public, protected :: &
|
integer, public, protected :: &
|
||||||
CLI_restartInc = 0 !< Increment at which calculation starts
|
CLI_restartInc = 0 !< increment at which calculation starts
|
||||||
character(len=:), allocatable, public, protected :: &
|
character(len=:), allocatable, public, protected :: &
|
||||||
CLI_geomFile, & !< parameter given for geometry file
|
CLI_geomFile, & !< location of the geometry file
|
||||||
CLI_loadFile, & !< parameter given for load case file
|
CLI_loadFile, & !< location of the load case file
|
||||||
CLI_materialFile
|
CLI_materialFile, & !< location of the material configuration file
|
||||||
|
CLI_numericsFile, & !< location of the numerics configuration file
|
||||||
|
solverJobname
|
||||||
|
|
||||||
public :: &
|
public :: &
|
||||||
getSolverJobName, &
|
getSolverJobname, &
|
||||||
CLI_init
|
CLI_init
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
@ -47,10 +49,11 @@ subroutine CLI_init()
|
||||||
character(len=:), allocatable :: &
|
character(len=:), allocatable :: &
|
||||||
commandLine, & !< command line call as string
|
commandLine, & !< command line call as string
|
||||||
arg, & !< individual argument
|
arg, & !< individual argument
|
||||||
loadCaseArg, & !< -l argument given to the executable
|
geomArg, & !< -g CLI argument
|
||||||
geometryArg, & !< -g argument given to the executable
|
loadArg, & !< -l CLI argument
|
||||||
materialArg, & !< -m argument given to the executable
|
materialArg, & !< -m CLI argument
|
||||||
workingDirArg !< -w argument given to the executable
|
numericsArg, & !< -n CLI argument
|
||||||
|
workingDirArg !< -w CLI argument
|
||||||
integer :: &
|
integer :: &
|
||||||
stat, &
|
stat, &
|
||||||
i
|
i
|
||||||
|
@ -62,94 +65,105 @@ subroutine CLI_init()
|
||||||
|
|
||||||
workingDirArg = getCWD()
|
workingDirArg = getCWD()
|
||||||
|
|
||||||
print '(/,1x,a)', '<<<+- CLI init -+>>>'
|
print'(/,1x,a)', '<<<+- CLI init -+>>>'
|
||||||
|
|
||||||
! http://patorjk.com/software/taag/#p=display&f=Lean&t=DAMASK%203
|
! http://patorjk.com/software/taag/#p=display&f=Lean&t=DAMASK%203
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
print '(a)', achar(27)//'[31m'
|
print'(a)', achar(27)//'[31m'
|
||||||
print '(1x,a,/)', 'debug version - debug version - debug version - debug version - debug version'
|
print'(1x,a,/)', 'debug version - debug version - debug version - debug version - debug version'
|
||||||
#else
|
#else
|
||||||
print '(a)', achar(27)//'[94m'
|
print'(a)', achar(27)//'[94m'
|
||||||
#endif
|
#endif
|
||||||
print '(1x,a)', ' _/_/_/ _/_/ _/ _/ _/_/ _/_/_/ _/ _/ _/_/_/'
|
print'(1x,a)', ' _/_/_/ _/_/ _/ _/ _/_/ _/_/_/ _/ _/ _/_/_/'
|
||||||
print '(1x,a)', ' _/ _/ _/ _/ _/_/ _/_/ _/ _/ _/ _/ _/ _/'
|
print'(1x,a)', ' _/ _/ _/ _/ _/_/ _/_/ _/ _/ _/ _/ _/ _/'
|
||||||
print '(1x,a)', ' _/ _/ _/_/_/_/ _/ _/ _/ _/_/_/_/ _/_/ _/_/ _/_/'
|
print'(1x,a)', ' _/ _/ _/_/_/_/ _/ _/ _/ _/_/_/_/ _/_/ _/_/ _/_/'
|
||||||
print '(1x,a)', ' _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/'
|
print'(1x,a)', ' _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/'
|
||||||
print '(1x,a)', '_/_/_/ _/ _/ _/ _/ _/ _/ _/_/_/ _/ _/ _/_/_/'
|
print'(1x,a)', '_/_/_/ _/ _/ _/ _/ _/ _/ _/_/_/ _/ _/ _/_/_/'
|
||||||
#if defined(GRID)
|
#if defined(GRID)
|
||||||
print '(1x,a)', 'Grid solver'
|
print'(1x,a)', 'Grid solver'
|
||||||
#elif defined(MESH)
|
#elif defined(MESH)
|
||||||
print '(1x,a)', 'Mesh solver'
|
print'(1x,a)', 'Mesh solver'
|
||||||
#endif
|
#endif
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
print '(/,1x,a)', 'debug version - debug version - debug version - debug version - debug version'
|
print'(/,1x,a)', 'debug version - debug version - debug version - debug version - debug version'
|
||||||
#endif
|
#endif
|
||||||
print '(a)', achar(27)//'[0m'
|
print'(a)', achar(27)//'[0m'
|
||||||
|
|
||||||
print '(1x,a)', 'F. Roters et al., Computational Materials Science 158:420–478, 2019'
|
print'(1x,a)', 'F. Roters et al., Computational Materials Science 158:420–478, 2019'
|
||||||
print '(1x,a)', 'https://doi.org/10.1016/j.commatsci.2018.04.030'
|
print'(1x,a)', 'https://doi.org/10.1016/j.commatsci.2018.04.030'
|
||||||
|
|
||||||
print '(/,1x,a)', 'Version: '//DAMASKVERSION
|
print'(/,1x,a)', 'Version: '//DAMASKVERSION
|
||||||
|
|
||||||
print '(/,1x,a)', 'Compiled with: '//compiler_version()
|
print'(/,1x,a)', 'Compiled with: '//compiler_version()
|
||||||
print '(1x,a)', 'Compiled on: '//CMAKE_SYSTEM
|
print'(1x,a)', 'Compiled on: '//CMAKE_SYSTEM
|
||||||
print '(1x,a)', 'Compiler options: '//compiler_options()
|
print'(1x,a)', 'Compiler options: '//compiler_options()
|
||||||
|
|
||||||
! https://github.com/jeffhammond/HPCInfo/blob/master/docs/Preprocessor-Macros.md
|
! https://github.com/jeffhammond/HPCInfo/blob/master/docs/Preprocessor-Macros.md
|
||||||
print '(/,1x,a)', 'Compiled on: '//__DATE__//' at '//__TIME__
|
print'(/,1x,a)', 'Compiled on: '//__DATE__//' at '//__TIME__
|
||||||
|
|
||||||
print '(/,1x,a,1x,i0,a,i0,a,i0)', &
|
print'(/,1x,a,1x,i0,a,i0,a,i0)', &
|
||||||
'PETSc version:',PETSC_VERSION_MAJOR,'.',PETSC_VERSION_MINOR,'.',PETSC_VERSION_SUBMINOR
|
'PETSc version:',PETSC_VERSION_MAJOR,'.',PETSC_VERSION_MINOR,'.',PETSC_VERSION_SUBMINOR
|
||||||
|
|
||||||
call date_and_time(values = dateAndTime)
|
call date_and_time(values = dateAndTime)
|
||||||
print '(/,1x,a,1x,2(i2.2,a),i4.4)', 'Date:',dateAndTime(3),'/',dateAndTime(2),'/',dateAndTime(1)
|
print'(/,1x,a,1x,2(i2.2,a),i4.4)', 'Date:',dateAndTime(3),'/',dateAndTime(2),'/',dateAndTime(1)
|
||||||
print '(1x,a,1x,2(i2.2,a),i2.2)', 'Time:',dateAndTime(5),':',dateAndTime(6),':',dateAndTime(7)
|
print'(1x,a,1x,2(i2.2,a),i2.2)', 'Time:',dateAndTime(5),':',dateAndTime(6),':',dateAndTime(7)
|
||||||
|
|
||||||
do i = 1, command_argument_count()
|
do i = 1, command_argument_count()
|
||||||
arg = getArg(i)
|
arg = getArg(i)
|
||||||
select case(trim(arg)) ! extract key
|
select case(trim(arg)) ! extract key
|
||||||
case ('-h','--help')
|
case ('-h','--help')
|
||||||
print '(/,1x,a)','#######################################################################'
|
print'(/,1x,a)','#######################################################################'
|
||||||
print '(1x,a)', 'DAMASK Command Line Interface:'
|
print'(1x,a)', 'DAMASK Command Line Interface:'
|
||||||
print '(1x,a)', 'Düsseldorf Advanced Material Simulation Kit with PETSc-based solvers'
|
print'(1x,a)', 'Düsseldorf Advanced Material Simulation Kit with PETSc-based solvers'
|
||||||
print '(1x,a,/)','#######################################################################'
|
print'(1x,a,/)','#######################################################################'
|
||||||
print '(1x,a,/)','Valid command line switches:'
|
print'(1x,a,/)','Valid command line switches:'
|
||||||
print '(1x,a)', ' --geom (-g, --geometry)'
|
print'(1x,a)', ' --geom (-g, --geometry)'
|
||||||
print '(1x,a)', ' --load (-l, --loadcase)'
|
print'(1x,a)', ' --load (-l, --loadcase)'
|
||||||
print '(1x,a)', ' --material (-m, --materialconfig)'
|
print'(1x,a)', ' --material (-m, --materialconfig)'
|
||||||
print '(1x,a)', ' --workingdir (-w, --wd, --workingdirectory)'
|
print'(1x,a)', ' --numerics (-n, --numericsconfig)'
|
||||||
print '(1x,a)', ' --restart (-r, --rs)'
|
print'(1x,a)', ' --jobname (-j, --job)'
|
||||||
print '(1x,a)', ' --help (-h)'
|
print'(1x,a)', ' --workingdir (-w, --wd, --workingdirectory)'
|
||||||
print '(/,1x,a)','-----------------------------------------------------------------------'
|
print'(1x,a)', ' --restart (-r, --rs)'
|
||||||
print '(1x,a)', 'Mandatory arguments:'
|
print'(1x,a)', ' --help (-h)'
|
||||||
print '(/,1x,a)',' --geom PathToGeomFile/NameOfGeom'
|
print'(/,1x,a)','-----------------------------------------------------------------------'
|
||||||
print '(1x,a)', ' Specifies the location of the geometry definition file.'
|
print'(1x,a)', 'Mandatory arguments:'
|
||||||
print '(/,1x,a)',' --load PathToLoadFile/NameOfLoadFile'
|
print'(/,1x,a)',' --geom GEOMFILE'
|
||||||
print '(1x,a)', ' Specifies the location of the load case definition file.'
|
print'(1x,a)', ' specify the file path of the geometry definition'
|
||||||
print '(/,1x,a)',' --material PathToMaterialConfigurationFile/NameOfMaterialConfigurationFile'
|
print'(/,1x,a)',' --load LOADFILE'
|
||||||
print '(1x,a)', ' Specifies the location of the material configuration file.'
|
print'(1x,a)', ' specify the file path of the load case definition'
|
||||||
print '(/,1x,a)','-----------------------------------------------------------------------'
|
print'(/,1x,a)',' --material MATERIALFILE'
|
||||||
print '(1x,a)', 'Optional arguments:'
|
print'(1x,a)', ' specify the file path of the material configuration'
|
||||||
print '(/,1x,a)',' --workingdirectory PathToWorkingDirectory'
|
print'(/,1x,a)','-----------------------------------------------------------------------'
|
||||||
print '(1x,a)', ' Specifies the base directory of relative paths.'
|
print'(1x,a)', 'Optional arguments:'
|
||||||
print '(/,1x,a)',' --restart N'
|
print'(/,1x,a)',' --numerics NUMERICSFILE'
|
||||||
print '(1x,a)', ' Reads in increment N and continues with calculating'
|
print'(1x,a)', ' Specify the file path of the numerics configuration'
|
||||||
print '(1x,a)', ' increment N+1, N+2, ... based on this.'
|
print'(/,1x,a)',' --jobname JOBNAME'
|
||||||
print '(1x,a)', ' Appends to existing results file'
|
print'(1x,a)', ' specify the job name.'
|
||||||
print '(1x,a)', ' "NameOfGeom_NameOfLoadFile_NameOfMaterialConfigurationFile.hdf5".'
|
print'(1x,a)', ' Defaults to GEOM_LOAD_MATERIAL[_NUMERICS].'
|
||||||
print '(1x,a)', ' Works only if the restart information for increment N'
|
print'(/,1x,a)',' --workingdirectory WORKINGDIRECTORY'
|
||||||
print '(1x,a)', ' is available in the base directory.'
|
print'(1x,a)', ' specify the base directory of relative paths.'
|
||||||
print '(/,1x,a)','-----------------------------------------------------------------------'
|
print'(1x,a)', ' Defaults to the current working directory'
|
||||||
print '(1x,a)', 'Help:'
|
print'(/,1x,a)',' --restart N'
|
||||||
print '(/,1x,a)',' --help'
|
print'(1x,a)', ' read in increment N and continues with calculating'
|
||||||
print '(1x,a,/)',' Prints this message and exits'
|
print'(1x,a)', ' increment N+1, N+2, ... based on this'
|
||||||
|
print'(1x,a)', ' works only if the restart information for increment N'
|
||||||
|
print'(1x,a)', ' is available in JOBNAME_restart.hdf5'
|
||||||
|
print'(1x,a)', ' append to existing results file JOBNAME.hdf5'
|
||||||
|
print'(/,1x,a)','-----------------------------------------------------------------------'
|
||||||
|
print'(1x,a)', 'Help:'
|
||||||
|
print'(/,1x,a)',' --help'
|
||||||
|
print'(1x,a,/)',' Prints this message and exits'
|
||||||
call quit(0) ! normal Termination
|
call quit(0) ! normal Termination
|
||||||
case ('-l', '--load', '--loadcase')
|
|
||||||
loadCaseArg = getArg(i+1)
|
|
||||||
case ('-g', '--geom', '--geometry')
|
case ('-g', '--geom', '--geometry')
|
||||||
geometryArg = getArg(i+1)
|
geomArg = getArg(i+1)
|
||||||
|
case ('-l', '--load', '--loadcase')
|
||||||
|
loadArg = getArg(i+1)
|
||||||
case ('-m', '--material', '--materialconfig')
|
case ('-m', '--material', '--materialconfig')
|
||||||
materialArg = getArg(i+1)
|
materialArg = getArg(i+1)
|
||||||
|
case ('-n', '--numerics', '--numericsconfig')
|
||||||
|
numericsArg = getArg(i+1)
|
||||||
|
case ('-j', '--job', '--jobname')
|
||||||
|
solverJobname = getArg(i+1)
|
||||||
case ('-w', '--wd', '--workingdir', '--workingdirectory')
|
case ('-w', '--wd', '--workingdir', '--workingdirectory')
|
||||||
workingDirArg = getArg(i+1)
|
workingDirArg = getArg(i+1)
|
||||||
case ('-r', '--rs', '--restart')
|
case ('-r', '--rs', '--restart')
|
||||||
|
@ -162,33 +176,46 @@ subroutine CLI_init()
|
||||||
end select
|
end select
|
||||||
end do
|
end do
|
||||||
|
|
||||||
if (.not. all([allocated(loadcaseArg),allocated(geometryArg),allocated(materialArg)])) then
|
if (.not. all([allocated(loadArg),allocated(geomArg),allocated(materialArg)])) then
|
||||||
print '(/,1x,a)', 'ERROR: Please specify geometry AND load case AND material configuration (-h for help)'
|
print'(/,1x,a)', 'ERROR: Please specify geometry AND load case AND material configuration (-h for help)'
|
||||||
call quit(1)
|
call quit(1)
|
||||||
end if
|
end if
|
||||||
|
|
||||||
call setWorkingDirectory(trim(workingDirArg))
|
call setWorkingDirectory(trim(workingDirArg))
|
||||||
CLI_geomFile = getPathRelCWD(geometryArg,'geometry')
|
CLI_geomFile = getPathRelCWD(geomArg,'geometry')
|
||||||
CLI_loadFile = getPathRelCWD(loadCaseArg,'load case')
|
CLI_loadFile = getPathRelCWD(loadArg,'load case')
|
||||||
CLI_materialFile = getPathRelCWD(materialArg,'material configuration')
|
CLI_materialFile = getPathRelCWD(materialArg,'material configuration')
|
||||||
|
if (allocated(numericsArg)) then
|
||||||
|
CLI_numericsFile = getPathRelCWD(numericsArg,'numerics configuration')
|
||||||
|
else
|
||||||
|
CLI_numericsFile = ''
|
||||||
|
endif
|
||||||
|
|
||||||
|
if (.not. allocated(solverJobname)) then
|
||||||
|
solverJobname = jobname(CLI_geomFile,CLI_loadFile,CLI_materialFile,CLI_numericsFile)
|
||||||
|
elseif (scan(solverJobname,'/') > 0) then
|
||||||
|
print'(/,1x,a)', 'ERROR: JOBNAME must not contain any slashes'
|
||||||
|
call quit(1)
|
||||||
|
endif
|
||||||
|
|
||||||
commandLine = getArg(-1)
|
commandLine = getArg(-1)
|
||||||
|
|
||||||
print '(/,1x,a)', 'Host name: '//getHostName()
|
print'(/,1x,a)', 'Host name: '//getHostName()
|
||||||
print '(1x,a)', 'User name: '//getUserName()
|
print'(1x,a)', 'User name: '//getUserName()
|
||||||
|
|
||||||
print '(/,1x,a,/)', 'Command line call: '//trim(commandLine)
|
print'(/,1x,a,/)', 'Command line call: '//trim(commandLine)
|
||||||
print '(1x,a)', 'Working directory: '//IO_glueDiffering(getCWD(),workingDirArg)
|
print'(1x,a)', 'Working directory: '//IO_glueDiffering(getCWD(),workingDirArg)
|
||||||
print '(1x,a)', 'Geometry: '//IO_glueDiffering(CLI_geomFile,geometryArg)
|
print'(1x,a)', 'Geometry: '//IO_glueDiffering(CLI_geomFile,geomArg)
|
||||||
print '(1x,a)', 'Load case: '//IO_glueDiffering(CLI_loadFile,loadCaseArg)
|
print'(1x,a)', 'Load case: '//IO_glueDiffering(CLI_loadFile,loadArg)
|
||||||
print '(1x,a)', 'Material config: '//IO_glueDiffering(CLI_materialFile,materialArg)
|
print'(1x,a)', 'Material config: '//IO_glueDiffering(CLI_materialFile,materialArg)
|
||||||
print '(1x,a)', 'Solver job name: '//getSolverJobName()
|
print'(1x,a)', 'Solver job name: '//getSolverJobname()
|
||||||
if (CLI_restartInc > 0) &
|
if (CLI_restartInc > 0) &
|
||||||
print '(1x,a,i6.6)', 'Restart from increment: ', CLI_restartInc
|
print'(1x,a,i6.6)', 'Restart from increment: ', CLI_restartInc
|
||||||
|
|
||||||
|
|
||||||
end subroutine CLI_init
|
end subroutine CLI_init
|
||||||
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief Get argument from command line.
|
!> @brief Get argument from command line.
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
@ -242,7 +269,7 @@ subroutine setWorkingDirectory(workingDirectoryArg)
|
||||||
workingDirectory = trim(normpath(workingDirectory))
|
workingDirectory = trim(normpath(workingDirectory))
|
||||||
error = setCWD(trim(workingDirectory))
|
error = setCWD(trim(workingDirectory))
|
||||||
if (error) then
|
if (error) then
|
||||||
print '(1x,a)', 'ERROR: Invalid Working directory: '//trim(workingDirectory)
|
print'(1x,a)', 'ERROR: Invalid Working directory: '//trim(workingDirectory)
|
||||||
call quit(1)
|
call quit(1)
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
@ -250,26 +277,43 @@ end subroutine setWorkingDirectory
|
||||||
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
!> @brief solver job name (no extension) as combination of geometry and load case name
|
!> @brief Return solver job name (MSC.Marc compatible).
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
function getSolverJobName()
|
function getSolverJobname()
|
||||||
|
|
||||||
character(len=:), allocatable :: getSolverJobName
|
character(len=:), allocatable :: getSolverJobname
|
||||||
|
|
||||||
integer :: posExt,posSep
|
|
||||||
|
|
||||||
|
|
||||||
posExt = scan(CLI_geomFile,'.',back=.true.)
|
getSolverJobname = solverJobname
|
||||||
posSep = scan(CLI_geomFile,'/',back=.true.)
|
|
||||||
|
|
||||||
getSolverJobName = CLI_geomFile(posSep+1:posExt-1)
|
end function getSolverJobname
|
||||||
|
|
||||||
posExt = scan(CLI_loadFile,'.',back=.true.)
|
|
||||||
posSep = scan(CLI_loadFile,'/',back=.true.)
|
|
||||||
|
|
||||||
getSolverJobName = getSolverJobName//'_'//CLI_loadFile(posSep+1:posExt-1)
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
!> @brief Determine solver job name.
|
||||||
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
function jobname(geomFile,LoadFile,materialsFile,numericsFile)
|
||||||
|
|
||||||
end function getSolverJobName
|
character(len=:), allocatable :: jobname
|
||||||
|
character(len=*), intent(in) :: geomFile,loadFile,materialsFile,numericsFile
|
||||||
|
|
||||||
|
|
||||||
|
jobname = stem(geomFile)//'_'//stem(loadFile)//'_'//stem(materialsFile)
|
||||||
|
if (len_trim(numericsFile) > 0) jobname = jobname//'_'//stem(numericsFile)
|
||||||
|
|
||||||
|
contains
|
||||||
|
|
||||||
|
function stem(fullname)
|
||||||
|
|
||||||
|
character(len=:), allocatable :: stem
|
||||||
|
character(len=*), intent(in) :: fullname
|
||||||
|
|
||||||
|
|
||||||
|
stem = fullname(scan(fullname,'/',back=.true.)+1:scan(fullname,'.',back=.true.)-1)
|
||||||
|
|
||||||
|
end function stem
|
||||||
|
|
||||||
|
end function jobname
|
||||||
|
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
|
@ -291,7 +335,7 @@ function getPathRelCWD(path,fileType)
|
||||||
|
|
||||||
inquire(file=getPathRelCWD, exist=file_exists)
|
inquire(file=getPathRelCWD, exist=file_exists)
|
||||||
if (.not. file_exists) then
|
if (.not. file_exists) then
|
||||||
print '(1x,a)', 'ERROR: '//fileType//' file does not exist: '//trim(getPathRelCWD)
|
print'(1x,a)', 'ERROR: '//fileType//' file does not exist: '//trim(getPathRelCWD)
|
||||||
call quit(1)
|
call quit(1)
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
|
|
@ -68,11 +68,10 @@ end subroutine config_numerics_deallocate
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
function config_listReferences(config,indent) result(references)
|
function config_listReferences(config,indent) result(references)
|
||||||
|
|
||||||
type(tDict) :: config
|
type(tDict), intent(in) :: config
|
||||||
integer, optional :: indent
|
integer, intent(in), optional :: indent
|
||||||
character(len=:), allocatable :: references
|
character(len=:), allocatable :: references
|
||||||
|
|
||||||
|
|
||||||
type(tList), pointer :: ref
|
type(tList), pointer :: ref
|
||||||
character(len=:), allocatable :: filler
|
character(len=:), allocatable :: filler
|
||||||
integer :: r
|
integer :: r
|
||||||
|
@ -97,13 +96,13 @@ end function config_listReferences
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine parse_material()
|
subroutine parse_material()
|
||||||
|
|
||||||
logical :: fileExists
|
|
||||||
character(len=:), allocatable :: &
|
character(len=:), allocatable :: &
|
||||||
fileContent, fname
|
fileContent, fname
|
||||||
|
|
||||||
|
|
||||||
if (worldrank == 0) then
|
if (worldrank == 0) then
|
||||||
print'(/,1x,a)', 'reading material configuration'; flush(IO_STDOUT)
|
print'(/,1x,a)', 'reading material configuration'; flush(IO_STDOUT)
|
||||||
#if defined(MESH) || defined(GRID)
|
#if defined(MESH) || defined(GRID)
|
||||||
fname = CLI_materialFile
|
fname = CLI_materialFile
|
||||||
#else
|
#else
|
||||||
fname = 'material.yaml'
|
fname = 'material.yaml'
|
||||||
|
@ -126,23 +125,30 @@ end subroutine parse_material
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
subroutine parse_numerics()
|
subroutine parse_numerics()
|
||||||
|
|
||||||
logical :: fileExists
|
character(len=:), allocatable :: &
|
||||||
character(len=:), allocatable :: fileContent
|
fileContent, fname
|
||||||
|
logical :: parse
|
||||||
|
|
||||||
|
|
||||||
config_numerics => emptyDict
|
config_numerics => emptyDict
|
||||||
|
|
||||||
inquire(file='numerics.yaml', exist=fileExists)
|
#if defined(MESH) || defined(GRID)
|
||||||
if (fileExists) then
|
fname = CLI_numericsFile
|
||||||
|
parse = len_trim(CLI_numericsFile) > 0
|
||||||
|
#else
|
||||||
|
fname = 'numerics.yaml'
|
||||||
|
inquire(file=fname, exist=parse)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (parse) then
|
||||||
|
|
||||||
if (worldrank == 0) then
|
if (worldrank == 0) then
|
||||||
print'(1x,a)', 'reading numerics.yaml'; flush(IO_STDOUT)
|
print'(1x,a)', 'reading numerics configuration'; flush(IO_STDOUT)
|
||||||
fileContent = IO_read('numerics.yaml')
|
fileContent = IO_read(fname)
|
||||||
if (len(fileContent) > 0) then
|
if (scan(fname,'/') /= 0) fname = fname(scan(fname,'/',.true.)+1:)
|
||||||
call result_openJobFile(parallel=.false.)
|
call result_openJobFile(parallel=.false.)
|
||||||
call result_writeDataset_str(fileContent,'setup','numerics.yaml','numerics configuration')
|
call result_writeDataset_str(fileContent,'setup',fname,'numerics configuration')
|
||||||
call result_closeJobFile()
|
call result_closeJobFile()
|
||||||
end if
|
|
||||||
end if
|
end if
|
||||||
call parallelization_bcast_str(fileContent)
|
call parallelization_bcast_str(fileContent)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue