From d00bf2d3d5c0bef3fbd8529e7ea29192870816fd Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Wed, 7 Jun 2023 15:55:01 +0200 Subject: [PATCH] causes problem for MARC to be removed later --- src/Marc/DAMASK_Marc.f90 | 27 +++++++++++++++++++++++++++ src/config.f90 | 10 ++++++++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/Marc/DAMASK_Marc.f90 b/src/Marc/DAMASK_Marc.f90 index 032c77394..84ad33de2 100644 --- a/src/Marc/DAMASK_Marc.f90 +++ b/src/Marc/DAMASK_Marc.f90 @@ -33,6 +33,7 @@ module DAMASK_interface public :: & DAMASK_interface_init, & +! getMaterialFileName, & getSolverJobName contains @@ -93,6 +94,32 @@ function getSolverJobName() end function getSolverJobName +!-------------------------------------------------------------------------------------------------- +!> @brief material configuration file name +!-------------------------------------------------------------------------------------------------- +!function getMaterialFileName() + +! character(len=:), allocatable :: getMaterialFileName +! character(len=pSTRLEN) :: line +! integer :: myStat,fileUnit,s,e + +! open(newunit=fileUnit, file=getSolverJobName()//INPUTFILEEXTENSION, & +! status='old', position='rewind', action='read',iostat=myStat) +! do +! read (fileUnit,'(A)',END=100) line +! if (index(trim(line),'materialConfig') == 1) then +! read (fileUnit,'(A)',END=100) line ! next line +! s = verify(line, ' ') ! start of first chunk +! s = s + verify(line(s+1:),' ') ! start of second chunk +! e = s + scan (line(s+1:),' ') ! end of second chunk +! getMaterialFileName = line(s:e) +! end if +! end do +!100 close(fileUnit) + +!end function getMaterialFileName + + !-------------------------------------------------------------------------------------------------- !> @brief determines whether a symmetric solver is used !-------------------------------------------------------------------------------------------------- diff --git a/src/config.f90 b/src/config.f90 index a78e2eb73..5d0d6e222 100644 --- a/src/config.f90 +++ b/src/config.f90 @@ -4,13 +4,14 @@ !-------------------------------------------------------------------------------------------------- module config use IO - use CLI use misc use YAML_parse use YAML_types use result use parallelization - +#if defined(MESH) || defined(GRID) + use CLI +#endif implicit none(type,external) private @@ -102,8 +103,13 @@ subroutine parse_material() if (worldrank == 0) then print'(/,1x,a)', 'reading material.yaml'; flush(IO_STDOUT) +#if defined(MESH) || defined(GRID) fileContent = IO_read(CLI_materialFile) fname = CLI_materialFile +#else + fileContent = IO_read('material.yaml') + fname = 'material.yaml' +#endif if (scan(fname,'/') /= 0) fname = fname(scan(fname,'/',.true.)+1:) call result_openJobFile(parallel=.false.) call result_writeDataset_str(fileContent,'setup',fname,'main configuration')