2020-01-27 00:26:30 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2018-06-10 14:37:17 +05:30
|
|
|
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
|
2020-08-15 19:32:10 +05:30
|
|
|
!> @brief Reads in the material, numerics & debug configuration from their respective file
|
|
|
|
!> @details Reads the material configuration file, where solverJobName.yaml takes
|
2020-09-13 13:49:38 +05:30
|
|
|
!! precedence over material.yaml.
|
2018-06-10 14:37:17 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2018-06-14 10:09:49 +05:30
|
|
|
module config
|
2019-05-17 02:26:48 +05:30
|
|
|
use IO
|
2020-06-16 22:17:19 +05:30
|
|
|
use YAML_parse
|
|
|
|
use YAML_types
|
2021-07-27 10:58:35 +05:30
|
|
|
use results
|
|
|
|
use parallelization
|
2020-08-15 19:32:10 +05:30
|
|
|
|
2019-03-29 13:04:44 +05:30
|
|
|
implicit none
|
2019-05-15 02:42:32 +05:30
|
|
|
private
|
2019-05-17 02:26:48 +05:30
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
class(tNode), pointer, public :: &
|
2020-09-13 14:09:17 +05:30
|
|
|
config_material, &
|
|
|
|
config_numerics, &
|
|
|
|
config_debug
|
2020-08-15 19:32:10 +05:30
|
|
|
|
2019-03-29 13:04:44 +05:30
|
|
|
public :: &
|
|
|
|
config_init, &
|
|
|
|
config_deallocate
|
2018-06-10 22:08:31 +05:30
|
|
|
|
2018-06-09 00:31:58 +05:30
|
|
|
contains
|
|
|
|
|
2018-06-27 00:00:41 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2020-09-14 00:58:53 +05:30
|
|
|
!> @brief Real *.yaml configuration files.
|
2018-06-27 00:00:41 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2019-03-13 02:57:45 +05:30
|
|
|
subroutine config_init
|
2019-05-17 02:26:48 +05:30
|
|
|
|
2020-09-22 16:39:12 +05:30
|
|
|
print'(/,a)', ' <<<+- config init -+>>>'; flush(IO_STDOUT)
|
2020-09-13 13:49:38 +05:30
|
|
|
|
2021-07-27 10:58:35 +05:30
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
call parse_material
|
|
|
|
call parse_numerics
|
|
|
|
call parse_debug
|
|
|
|
|
|
|
|
end subroutine config_init
|
|
|
|
|
2019-03-29 13:04:44 +05:30
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2020-09-14 00:58:53 +05:30
|
|
|
!> @brief Read material.yaml or <jobname>.yaml.
|
2020-08-15 19:32:10 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2021-07-27 10:58:35 +05:30
|
|
|
subroutine parse_material()
|
2019-03-29 13:04:44 +05:30
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
logical :: fileExists
|
2021-07-27 10:58:35 +05:30
|
|
|
character(len=:), allocatable :: fileContent
|
2021-02-13 04:05:06 +05:30
|
|
|
|
|
|
|
|
|
|
|
inquire(file='material.yaml',exist=fileExists)
|
|
|
|
if(.not. fileExists) call IO_error(100,ext_msg='material.yaml')
|
|
|
|
print*, 'reading material.yaml'; flush(IO_STDOUT)
|
2021-07-27 10:58:35 +05:30
|
|
|
fileContent = IO_read('material.yaml')
|
|
|
|
if (worldrank == 0) then
|
|
|
|
call results_openJobFile(parallel=.false.)
|
|
|
|
call results_writeDataset_str(fileContent,'setup','material.yaml','DAMASK main configuration')
|
|
|
|
call results_closeJobFile
|
|
|
|
endif
|
2021-02-13 04:05:06 +05:30
|
|
|
config_material => YAML_parse_file('material.yaml')
|
2018-06-09 17:18:37 +05:30
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
end subroutine parse_material
|
2019-03-13 02:18:33 +05:30
|
|
|
|
|
|
|
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
2020-09-14 00:58:53 +05:30
|
|
|
!> @brief Read numerics.yaml.
|
2019-03-13 02:18:33 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2021-07-27 10:58:35 +05:30
|
|
|
subroutine parse_numerics()
|
2020-08-15 19:32:10 +05:30
|
|
|
|
2021-07-27 10:58:35 +05:30
|
|
|
logical :: fileExists
|
|
|
|
character(len=:), allocatable :: fileContent
|
2020-08-15 19:32:10 +05:30
|
|
|
|
2021-02-13 04:05:06 +05:30
|
|
|
|
2020-09-13 14:09:17 +05:30
|
|
|
config_numerics => emptyDict
|
2021-07-27 10:58:35 +05:30
|
|
|
inquire(file='numerics.yaml', exist=fileExists)
|
|
|
|
if (fileExists) then
|
2020-09-22 16:39:12 +05:30
|
|
|
print*, 'reading numerics.yaml'; flush(IO_STDOUT)
|
2021-07-27 10:58:35 +05:30
|
|
|
fileContent = IO_read('numerics.yaml')
|
|
|
|
if (worldrank == 0) then
|
|
|
|
call results_openJobFile(parallel=.false.)
|
|
|
|
call results_writeDataset_str(fileContent,'setup','numerics.yaml','numerics configuration (optional)')
|
|
|
|
call results_closeJobFile
|
|
|
|
endif
|
2020-09-13 16:13:49 +05:30
|
|
|
config_numerics => YAML_parse_file('numerics.yaml')
|
2019-03-13 02:18:33 +05:30
|
|
|
endif
|
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
end subroutine parse_numerics
|
2019-03-13 02:18:33 +05:30
|
|
|
|
2018-06-09 00:31:58 +05:30
|
|
|
|
2018-08-04 23:09:50 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2020-09-14 00:58:53 +05:30
|
|
|
!> @brief Read debug.yaml.
|
2018-08-04 23:09:50 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2021-07-27 10:58:35 +05:30
|
|
|
subroutine parse_debug()
|
2018-06-27 00:00:41 +05:30
|
|
|
|
2021-07-27 10:58:35 +05:30
|
|
|
logical :: fileExists
|
|
|
|
character(len=:), allocatable :: fileContent
|
2018-08-21 11:44:59 +05:30
|
|
|
|
2021-02-13 04:05:06 +05:30
|
|
|
|
2020-09-13 14:09:17 +05:30
|
|
|
config_debug => emptyDict
|
2021-07-27 10:58:35 +05:30
|
|
|
inquire(file='debug.yaml', exist=fileExists)
|
|
|
|
if (fileExists) then
|
2020-09-22 16:39:12 +05:30
|
|
|
print*, 'reading debug.yaml'; flush(IO_STDOUT)
|
2021-07-27 10:58:35 +05:30
|
|
|
fileContent = IO_read('debug.yaml')
|
|
|
|
if (worldrank == 0) then
|
|
|
|
call results_openJobFile(parallel=.false.)
|
|
|
|
call results_writeDataset_str(fileContent,'setup','debug.yaml','debug configuration (optional)')
|
|
|
|
call results_closeJobFile
|
|
|
|
endif
|
2020-09-13 16:13:49 +05:30
|
|
|
config_debug => YAML_parse_file('debug.yaml')
|
2021-07-27 10:58:35 +05:30
|
|
|
endif
|
2018-08-21 11:44:59 +05:30
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
end subroutine parse_debug
|
2018-08-21 11:44:59 +05:30
|
|
|
|
|
|
|
|
2020-08-15 19:32:10 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
2020-09-14 00:58:53 +05:30
|
|
|
!> @brief Deallocate config_material.
|
2021-05-23 03:40:46 +05:30
|
|
|
!ToDo: deallocation of numerics and debug (optional)
|
2020-08-15 19:32:10 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
subroutine config_deallocate
|
2018-06-27 00:00:41 +05:30
|
|
|
|
2020-09-13 14:09:17 +05:30
|
|
|
deallocate(config_material)
|
2020-09-12 19:26:59 +05:30
|
|
|
|
2018-06-27 00:00:41 +05:30
|
|
|
end subroutine config_deallocate
|
|
|
|
|
2018-06-14 10:09:49 +05:30
|
|
|
end module config
|