2011-04-07 12:50:28 +05:30
|
|
|
! Copyright 2011 Max-Planck-Institut für Eisenforschung GmbH
|
2011-04-04 19:39:54 +05:30
|
|
|
!
|
|
|
|
! This file is part of DAMASK,
|
2011-04-07 12:50:28 +05:30
|
|
|
! the Düsseldorf Advanced MAterial Simulation Kit.
|
2011-04-04 19:39:54 +05:30
|
|
|
!
|
|
|
|
! DAMASK is free software: you can redistribute it and/or modify
|
|
|
|
! it under the terms of the GNU General Public License as published by
|
|
|
|
! the Free Software Foundation, either version 3 of the License, or
|
|
|
|
! (at your option) any later version.
|
|
|
|
!
|
|
|
|
! DAMASK is distributed in the hope that it will be useful,
|
|
|
|
! but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
! GNU General Public License for more details.
|
|
|
|
!
|
|
|
|
! You should have received a copy of the GNU General Public License
|
|
|
|
! along with DAMASK. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
!
|
|
|
|
!##############################################################
|
2009-08-31 20:39:15 +05:30
|
|
|
!* $Id$
|
2007-03-20 19:25:22 +05:30
|
|
|
!##############################################################
|
|
|
|
MODULE IO
|
|
|
|
!##############################################################
|
2012-02-10 16:54:53 +05:30
|
|
|
|
2007-03-20 19:25:22 +05:30
|
|
|
CONTAINS
|
|
|
|
!---------------------------
|
2010-07-13 15:56:07 +05:30
|
|
|
! function IO_abaqus_assembleInputFile
|
2012-02-16 00:28:38 +05:30
|
|
|
! subroutine IO_open_file(myUnit,relPath)
|
|
|
|
! subroutine IO_open_inputFile(myUnit, model)
|
|
|
|
! subroutine IO_open_logFile(myUnit)
|
2007-03-21 22:34:10 +05:30
|
|
|
! function IO_hybridIA(Nast,ODFfileName)
|
|
|
|
! private function hybridIA_reps(dV_V,steps,C)
|
2007-04-10 16:51:34 +05:30
|
|
|
! function IO_stringPos(line,maxN)
|
2012-02-16 00:28:38 +05:30
|
|
|
! function IO_stringValue(line,positions,myPos)
|
|
|
|
! function IO_floatValue(line,positions,myPos)
|
|
|
|
! function IO_intValue(line,positions,myPos)
|
|
|
|
! function IO_fixedStringValue(line,ends,myPos)
|
|
|
|
! function IO_fixedFloatValue(line,ends,myPos)
|
|
|
|
! function IO_fixedFloatNoEValue(line,ends,myPos)
|
|
|
|
! function IO_fixedIntValue(line,ends,myPos)
|
|
|
|
! function IO_continousIntValues(myUnit,maxN)
|
2007-04-10 16:51:34 +05:30
|
|
|
! function IO_lc(line)
|
|
|
|
! subroutine IO_lcInplace(line)
|
2007-03-20 19:25:22 +05:30
|
|
|
! subroutine IO_error(ID)
|
2009-03-31 14:51:57 +05:30
|
|
|
! subroutine IO_warning(ID)
|
2007-03-20 19:25:22 +05:30
|
|
|
!---------------------------
|
|
|
|
|
2009-08-31 20:39:15 +05:30
|
|
|
!********************************************************************
|
|
|
|
! output version number
|
|
|
|
!********************************************************************
|
2009-10-12 21:31:49 +05:30
|
|
|
subroutine IO_init ()
|
|
|
|
|
2012-02-10 16:54:53 +05:30
|
|
|
use, intrinsic :: iso_fortran_env
|
2009-10-12 21:31:49 +05:30
|
|
|
!$OMP CRITICAL (write2out)
|
|
|
|
write(6,*)
|
|
|
|
write(6,*) '<<<+- IO init -+>>>'
|
|
|
|
write(6,*) '$Id$'
|
2012-02-01 00:48:55 +05:30
|
|
|
#include "compilation_info.f90"
|
2009-10-12 21:31:49 +05:30
|
|
|
call flush(6)
|
|
|
|
!$OMP END CRITICAL (write2out)
|
|
|
|
|
2009-09-18 21:07:14 +05:30
|
|
|
endsubroutine
|
2007-03-20 19:25:22 +05:30
|
|
|
|
2010-07-13 15:56:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
!********************************************************************
|
|
|
|
! AP: 12.07.10
|
|
|
|
! create a new input file for abaqus simulations
|
|
|
|
! by removing all comment lines and including "include"s
|
|
|
|
!********************************************************************
|
|
|
|
recursive function IO_abaqus_assembleInputFile(unit1,unit2) result(createSuccess)
|
|
|
|
use prec
|
2011-05-11 22:31:03 +05:30
|
|
|
use DAMASK_interface
|
2010-07-13 15:56:07 +05:30
|
|
|
implicit none
|
|
|
|
|
|
|
|
character(len=300) line,fname
|
|
|
|
integer(pInt), intent(in) :: unit1, unit2
|
|
|
|
logical createSuccess,fexist
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), parameter :: maxNchunks = 6_pInt
|
2011-07-18 14:45:20 +05:30
|
|
|
integer(pInt), dimension(1+2*maxNchunks) :: positions
|
|
|
|
|
2010-07-13 15:56:07 +05:30
|
|
|
|
|
|
|
do
|
|
|
|
read(unit2,'(A300)',END=220) line
|
2011-07-18 14:45:20 +05:30
|
|
|
! line = IO_lc(trim(line))
|
|
|
|
! do not change the whole line to lower case, file names in Linux are case sensitive!
|
|
|
|
positions = IO_stringPos(line,maxNchunks)
|
|
|
|
|
2010-07-13 15:56:07 +05:30
|
|
|
! call IO_lcInPlace(line)
|
2012-02-02 18:49:02 +05:30
|
|
|
if (IO_lc(IO_StringValue(line,positions,1_pInt))=='*include') then
|
2012-02-16 00:28:38 +05:30
|
|
|
fname = trim(getSolverWorkingDirectoryName())//trim(line(9+scan(line(9:),'='):))
|
2010-07-13 15:56:07 +05:30
|
|
|
inquire(file=fname, exist=fexist)
|
|
|
|
if (.not.(fexist)) then
|
openmp parallelization working again (at least for j2 and nonlocal constitutive model).
In order to keep it like that, please follow these simple rules:
DON'T use implicit array subscripts:
example: real, dimension(3,3) :: A,B
A(:,2) = B(:,1) <--- DON'T USE
A(1:3,2) = B(1:3,1) <--- BETTER USE
In many cases the use of explicit array subscripts is inevitable for parallelization. Additionally, it is an easy means to prevent memory leaks.
Enclose all write statements with the following:
!$OMP CRITICAL (write2out)
<your write statement>
!$OMP END CRITICAL (write2out)
Whenever you change something in the code and are not sure if it affects parallelization and leads to nonconforming behavior, please ask me and/or Franz to check this.
2011-03-17 16:16:17 +05:30
|
|
|
!$OMP CRITICAL (write2out)
|
|
|
|
write(6,*)'ERROR: file does not exist error in IO_abaqus_assembleInputFile'
|
|
|
|
write(6,*)'filename: ', trim(fname)
|
|
|
|
!$OMP END CRITICAL (write2out)
|
2010-07-13 15:56:07 +05:30
|
|
|
createSuccess = .false.
|
|
|
|
return
|
|
|
|
endif
|
|
|
|
open(unit2+1,err=200,status='old',file=fname)
|
2012-02-02 18:49:02 +05:30
|
|
|
if (IO_abaqus_assembleInputFile(unit1,unit2+1_pInt)) then
|
2010-07-13 15:56:07 +05:30
|
|
|
createSuccess=.true.
|
|
|
|
close(unit2+1)
|
|
|
|
else
|
|
|
|
createSuccess=.false.
|
|
|
|
return
|
|
|
|
endif
|
|
|
|
else if (line(1:2) /= '**') then
|
|
|
|
write(unit1,'(A)') trim(line)
|
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
|
|
|
|
220 createSuccess = .true.
|
|
|
|
return
|
|
|
|
|
|
|
|
200 createSuccess =.false.
|
2011-09-13 21:24:06 +05:30
|
|
|
|
2010-07-13 15:56:07 +05:30
|
|
|
end function
|
|
|
|
|
|
|
|
!***********************************************************
|
|
|
|
! check if the input file for Abaqus contains part info
|
|
|
|
!***********************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
function IO_abaqus_hasNoPart(myUnit)
|
2010-07-13 15:56:07 +05:30
|
|
|
|
|
|
|
use prec, only: pInt
|
|
|
|
implicit none
|
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt) myUnit
|
|
|
|
integer(pInt), parameter :: maxNchunks = 1_pInt
|
|
|
|
integer(pInt), dimension(1+2*maxNchunks) :: myPos
|
2010-07-13 15:56:07 +05:30
|
|
|
logical IO_abaqus_hasNoPart
|
|
|
|
character(len=300) line
|
|
|
|
|
|
|
|
IO_abaqus_hasNoPart = .true.
|
|
|
|
|
|
|
|
610 FORMAT(A300)
|
2012-02-16 00:28:38 +05:30
|
|
|
rewind(myUnit)
|
2010-07-13 15:56:07 +05:30
|
|
|
do
|
2012-02-16 00:28:38 +05:30
|
|
|
read(myUnit,610,END=620) line
|
|
|
|
myPos = IO_stringPos(line,maxNchunks)
|
|
|
|
if (IO_lc(IO_stringValue(line,myPos,1_pInt)) == '*part' ) then
|
2010-07-13 15:56:07 +05:30
|
|
|
IO_abaqus_hasNoPart = .false.
|
|
|
|
exit
|
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
|
2011-10-18 14:52:33 +05:30
|
|
|
620 endfunction
|
2010-07-13 15:56:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
2007-03-20 19:25:22 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
! open existing file to given myUnit
|
2007-03-20 19:25:22 +05:30
|
|
|
! path to file is relative to working directory
|
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
logical function IO_open_file_stat(myUnit,relPath)
|
2007-03-20 19:25:22 +05:30
|
|
|
|
|
|
|
use prec, only: pInt
|
2011-05-11 22:31:03 +05:30
|
|
|
use DAMASK_interface
|
2012-02-10 16:54:53 +05:30
|
|
|
|
2007-03-20 19:25:22 +05:30
|
|
|
implicit none
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), intent(in) :: myUnit
|
2012-02-13 23:11:27 +05:30
|
|
|
character(len=*), intent(in) :: relPath
|
2012-02-14 05:00:59 +05:30
|
|
|
character(len=1024) path
|
|
|
|
integer(pInt) stat
|
2012-02-13 23:11:27 +05:30
|
|
|
|
|
|
|
path = trim(getSolverWorkingDirectoryName())//relPath
|
2012-02-16 00:28:38 +05:30
|
|
|
open(myUnit,status='old',iostat=stat,file=path)
|
2012-02-14 05:00:59 +05:30
|
|
|
IO_open_file_stat = (stat == 0_pInt)
|
2012-02-13 23:11:27 +05:30
|
|
|
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
|
|
!********************************************************************
|
|
|
|
! open existing file to given unit
|
|
|
|
! path to file is relative to working directory
|
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
subroutine IO_open_file(myUnit,relPath)
|
2007-03-20 19:25:22 +05:30
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
use prec, only: pInt
|
|
|
|
use DAMASK_interface
|
2010-07-13 15:56:07 +05:30
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
implicit none
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), intent(in) ::myUnit
|
2012-02-13 23:11:27 +05:30
|
|
|
character(len=*), intent(in) :: relPath
|
2012-02-14 05:00:59 +05:30
|
|
|
character(len=1024) path
|
2012-02-13 23:11:27 +05:30
|
|
|
integer(pInt) stat
|
2010-07-13 15:56:07 +05:30
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
path = trim(getSolverWorkingDirectoryName())//relPath
|
2012-02-16 00:28:38 +05:30
|
|
|
open(myUnit,status='old',iostat=stat,file=path)
|
2012-02-14 05:00:59 +05:30
|
|
|
if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path)
|
2012-02-13 23:11:27 +05:30
|
|
|
|
|
|
|
endsubroutine
|
2007-03-20 19:25:22 +05:30
|
|
|
|
|
|
|
|
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
! open FEM inputfile to given myUnit
|
2010-07-13 15:56:07 +05:30
|
|
|
! AP: 12.07.10
|
|
|
|
! : changed the function to open *.inp_assembly, which is basically
|
|
|
|
! the input file without comment lines and possibly assembled includes
|
2007-03-20 19:25:22 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
subroutine IO_open_inputFile(myUnit,model)
|
2007-03-20 19:25:22 +05:30
|
|
|
|
|
|
|
use prec, only: pReal, pInt
|
2011-05-11 22:31:03 +05:30
|
|
|
use DAMASK_interface
|
2007-03-20 19:25:22 +05:30
|
|
|
implicit none
|
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), intent(in) :: myUnit
|
2012-02-13 23:11:27 +05:30
|
|
|
character(len=*), intent(in) :: model
|
2012-02-14 05:00:59 +05:30
|
|
|
character(len=1024) path
|
2012-02-13 23:11:27 +05:30
|
|
|
integer(pInt) stat
|
2010-05-10 20:32:59 +05:30
|
|
|
|
2010-07-13 15:56:07 +05:30
|
|
|
|
|
|
|
if (FEsolver == 'Abaqus') then
|
2012-02-14 05:00:59 +05:30
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
path = trim(getSolverWorkingDirectoryName())//trim(model)//InputFileExtension
|
2012-02-16 00:28:38 +05:30
|
|
|
open(myUnit+1,status='old',iostat=stat,file=path)
|
2012-02-14 05:00:59 +05:30
|
|
|
if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path)
|
2012-02-13 23:11:27 +05:30
|
|
|
|
|
|
|
path = trim(getSolverWorkingDirectoryName())//trim(model)//InputFileExtension//'_assembly'
|
2012-02-16 00:28:38 +05:30
|
|
|
open(myUnit,iostat=stat,file=path)
|
2012-02-14 05:00:59 +05:30
|
|
|
if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path)
|
2012-02-16 00:28:38 +05:30
|
|
|
if (IO_abaqus_assembleInputFile(myUnit,myUnit+1_pInt)) call IO_error(103_pInt) ! strip comments and concatenate any "include"s
|
|
|
|
close(myUnit+1_pInt)
|
2012-02-13 23:11:27 +05:30
|
|
|
|
2010-07-13 15:56:07 +05:30
|
|
|
else
|
2012-02-13 23:11:27 +05:30
|
|
|
path = trim(getSolverWorkingDirectoryName())//trim(model)//InputFileExtension
|
2012-02-16 00:28:38 +05:30
|
|
|
open(myUnit,status='old',iostat=stat,file=path)
|
2012-02-14 05:00:59 +05:30
|
|
|
if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path)
|
|
|
|
|
2010-07-13 15:56:07 +05:30
|
|
|
endif
|
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
endsubroutine
|
2007-03-20 19:25:22 +05:30
|
|
|
|
|
|
|
|
2010-11-03 20:09:18 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
! open FEM logfile to given myUnit
|
2010-11-03 20:09:18 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
subroutine IO_open_logFile(myUnit)
|
2010-11-03 20:09:18 +05:30
|
|
|
use prec, only: pReal, pInt
|
2011-05-11 22:31:03 +05:30
|
|
|
use DAMASK_interface
|
2010-11-03 20:09:18 +05:30
|
|
|
implicit none
|
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), intent(in) :: myUnit
|
2012-02-14 05:00:59 +05:30
|
|
|
character(len=1024) path
|
|
|
|
integer(pInt) stat
|
2010-11-03 20:09:18 +05:30
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//LogFileExtension
|
2012-02-16 00:28:38 +05:30
|
|
|
open(myUnit,status='old',iostat=stat,file=path)
|
2012-02-14 05:00:59 +05:30
|
|
|
if (stat /= 0) call IO_error(100_pInt,ext_msg=path)
|
2010-11-03 20:09:18 +05:30
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
endsubroutine
|
2010-11-03 20:09:18 +05:30
|
|
|
|
|
|
|
|
2009-07-22 21:37:19 +05:30
|
|
|
!********************************************************************
|
|
|
|
! open (write) file related to current job
|
2012-02-16 00:28:38 +05:30
|
|
|
! but with different extension to given myUnit
|
2009-07-22 21:37:19 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
logical function IO_open_jobFile_stat(myUnit,newExt)
|
2009-07-22 21:37:19 +05:30
|
|
|
|
|
|
|
use prec, only: pReal, pInt
|
2011-05-11 22:31:03 +05:30
|
|
|
use DAMASK_interface
|
2009-07-22 21:37:19 +05:30
|
|
|
implicit none
|
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), intent(in) :: myUnit
|
2012-02-14 05:00:59 +05:30
|
|
|
character(len=*), intent(in) :: newExt
|
|
|
|
character(len=1024) path
|
|
|
|
integer(pInt) stat
|
2012-02-13 23:11:27 +05:30
|
|
|
|
|
|
|
path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'.'//newExt
|
2012-02-16 00:28:38 +05:30
|
|
|
open(myUnit,status='old',iostat=stat,file=path)
|
2012-02-14 05:00:59 +05:30
|
|
|
IO_open_jobFile_stat = (stat == 0_pInt)
|
2012-02-16 00:28:38 +05:30
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
endfunction
|
2009-07-22 21:37:19 +05:30
|
|
|
|
|
|
|
|
2011-08-02 15:44:16 +05:30
|
|
|
!********************************************************************
|
|
|
|
! open (write) file related to current job
|
|
|
|
! but with different extension to given unit
|
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
subroutine IO_open_jobFile(myUnit,newExt)
|
2011-08-02 15:44:16 +05:30
|
|
|
|
|
|
|
use prec, only: pReal, pInt
|
|
|
|
use DAMASK_interface
|
|
|
|
implicit none
|
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), intent(in) :: myUnit
|
2012-02-14 05:00:59 +05:30
|
|
|
character(len=*), intent(in) :: newExt
|
|
|
|
character(len=1024) path
|
2012-02-13 23:11:27 +05:30
|
|
|
integer(pInt) stat
|
2011-08-02 15:44:16 +05:30
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'.'//newExt
|
2012-02-16 00:28:38 +05:30
|
|
|
open(myUnit,status='old',iostat=stat,file=path)
|
2012-02-14 05:00:59 +05:30
|
|
|
if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path)
|
2011-08-02 15:44:16 +05:30
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
endsubroutine
|
|
|
|
|
|
|
|
|
|
|
|
!********************************************************************
|
|
|
|
! open (write) file related to current job
|
2012-02-16 00:28:38 +05:30
|
|
|
! but with different extension to given myUnit
|
2012-02-13 23:11:27 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
subroutine IO_write_jobFile(myUnit,newExt)
|
2012-02-13 23:11:27 +05:30
|
|
|
|
|
|
|
use prec, only: pReal, pInt
|
|
|
|
use DAMASK_interface
|
|
|
|
implicit none
|
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), intent(in) :: myUnit
|
2012-02-14 05:00:59 +05:30
|
|
|
character(len=*), intent(in) :: newExt
|
|
|
|
character(len=1024) path
|
2012-02-13 23:11:27 +05:30
|
|
|
integer(pInt) stat
|
|
|
|
|
|
|
|
path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'.'//newExt
|
2012-02-16 00:28:38 +05:30
|
|
|
open(myUnit,status='replace',iostat=stat,file=path)
|
2012-02-14 05:00:59 +05:30
|
|
|
if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path)
|
2011-08-02 15:44:16 +05:30
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
endsubroutine
|
2011-08-02 15:44:16 +05:30
|
|
|
|
|
|
|
|
2010-11-03 20:09:18 +05:30
|
|
|
!********************************************************************
|
|
|
|
! open (write) binary file related to current job
|
2012-02-16 00:28:38 +05:30
|
|
|
! but with different extension to given myUnit
|
2010-11-03 20:09:18 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
subroutine IO_write_jobBinaryFile(myUnit,newExt,recMultiplier)
|
2010-11-03 20:09:18 +05:30
|
|
|
|
|
|
|
use prec, only: pReal, pInt
|
2011-05-11 22:31:03 +05:30
|
|
|
use DAMASK_interface
|
2010-11-03 20:09:18 +05:30
|
|
|
implicit none
|
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), intent(in) :: myUnit
|
2010-11-03 20:09:18 +05:30
|
|
|
integer(pInt), intent(in), optional :: recMultiplier
|
2012-02-14 05:00:59 +05:30
|
|
|
character(len=*), intent(in) :: newExt
|
|
|
|
character(len=1024) path
|
2012-02-13 23:11:27 +05:30
|
|
|
integer(pInt) stat
|
2010-11-03 20:09:18 +05:30
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
path = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'.'//newExt
|
2010-11-03 20:09:18 +05:30
|
|
|
if (present(recMultiplier)) then
|
2012-02-16 00:28:38 +05:30
|
|
|
open(myUnit,status='replace',form='unformatted',access='direct',recl=pReal*recMultiplier,iostat=stat,file=path)
|
2012-02-13 23:11:27 +05:30
|
|
|
else
|
2012-02-16 00:28:38 +05:30
|
|
|
open(myUnit,status='replace',form='unformatted',access='direct',recl=pReal,iostat=stat,file=path)
|
2012-02-13 23:11:27 +05:30
|
|
|
endif
|
2012-02-14 05:00:59 +05:30
|
|
|
if (stat /= 0_pInt) call IO_error(100_pInt,ext_msg=path)
|
2010-11-03 20:09:18 +05:30
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
endsubroutine
|
2010-11-03 20:09:18 +05:30
|
|
|
|
|
|
|
|
|
|
|
!********************************************************************
|
|
|
|
! open (read) binary file related to restored job
|
2012-02-16 00:28:38 +05:30
|
|
|
! and with different extension to given myUnit
|
2010-11-03 20:09:18 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
subroutine IO_read_jobBinaryFile(myUnit,newExt,jobName,recMultiplier)
|
2010-11-03 20:09:18 +05:30
|
|
|
|
|
|
|
use prec, only: pReal, pInt
|
2011-05-11 22:31:03 +05:30
|
|
|
use DAMASK_interface
|
2010-11-03 20:09:18 +05:30
|
|
|
implicit none
|
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), intent(in) :: myUnit
|
2010-11-03 20:09:18 +05:30
|
|
|
integer(pInt), intent(in), optional :: recMultiplier
|
2012-02-14 05:00:59 +05:30
|
|
|
character(len=*), intent(in) :: newExt, jobName
|
|
|
|
character(len=1024) path
|
2012-02-13 23:11:27 +05:30
|
|
|
integer(pInt) stat
|
2010-11-03 20:09:18 +05:30
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
path = trim(getSolverWorkingDirectoryName())//trim(jobName)//'.'//newExt
|
2010-11-03 20:09:18 +05:30
|
|
|
if (present(recMultiplier)) then
|
2012-02-16 00:28:38 +05:30
|
|
|
open(myUnit,status='old',form='unformatted',access='direct',recl=pReal*recMultiplier,iostat=stat,file=path)
|
2012-02-13 23:11:27 +05:30
|
|
|
else
|
2012-02-16 00:28:38 +05:30
|
|
|
open(myUnit,status='old',form='unformatted',access='direct',recl=pReal,iostat=stat,file=path)
|
2012-02-13 23:11:27 +05:30
|
|
|
endif
|
|
|
|
if (stat /= 0) then
|
|
|
|
call IO_error(100_pInt,ext_msg=path)
|
2010-11-03 20:09:18 +05:30
|
|
|
endif
|
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
endsubroutine
|
2010-11-03 20:09:18 +05:30
|
|
|
|
|
|
|
|
2007-03-21 18:02:15 +05:30
|
|
|
!********************************************************************
|
|
|
|
! hybrid IA repetition counter
|
|
|
|
!********************************************************************
|
2009-06-15 18:41:21 +05:30
|
|
|
function hybridIA_reps(dV_V,steps,C)
|
2007-03-21 18:02:15 +05:30
|
|
|
|
|
|
|
use prec, only: pReal, pInt
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(pInt), intent(in), dimension(3) :: steps
|
|
|
|
integer(pInt) hybridIA_reps, phi1,Phi,phi2
|
|
|
|
real(pReal), intent(in), dimension(steps(3),steps(2),steps(1)) :: dV_V
|
|
|
|
real(pReal), intent(in) :: C
|
|
|
|
|
|
|
|
hybridIA_reps = 0_pInt
|
2012-02-16 00:28:38 +05:30
|
|
|
do phi1=1_pInt,steps(1)
|
|
|
|
do Phi =1_pInt,steps(2)
|
|
|
|
do phi2=1_pInt,steps(3)
|
2007-03-21 18:02:15 +05:30
|
|
|
hybridIA_reps = hybridIA_reps+nint(C*dV_V(phi2,Phi,phi1), pInt)
|
2009-06-15 18:41:21 +05:30
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
2007-03-21 18:02:15 +05:30
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
endfunction
|
2007-03-21 18:02:15 +05:30
|
|
|
|
|
|
|
|
|
|
|
!********************************************************************
|
|
|
|
! hybrid IA sampling of ODFfile
|
|
|
|
!********************************************************************
|
2009-06-15 18:41:21 +05:30
|
|
|
function IO_hybridIA(Nast,ODFfileName)
|
2007-03-21 18:02:15 +05:30
|
|
|
|
|
|
|
use prec, only: pReal, pInt
|
|
|
|
implicit none
|
|
|
|
|
2010-07-13 15:56:07 +05:30
|
|
|
real(pReal), parameter :: pi = 3.14159265358979323846264338327950288419716939937510_pReal
|
|
|
|
real(pReal), parameter :: inRad = pi/180.0_pReal
|
|
|
|
|
2007-03-21 18:02:15 +05:30
|
|
|
character(len=*) ODFfileName
|
|
|
|
character(len=80) line
|
|
|
|
character(len=*), parameter :: fileFormat = '(A80)'
|
2007-03-26 20:33:21 +05:30
|
|
|
integer(pInt) i,j,bin,Nast,NnonZero,Nset,Nreps,reps,phi1,Phi,phi2
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), dimension(7) :: myPos
|
2007-03-21 18:02:15 +05:30
|
|
|
integer(pInt), dimension(3) :: steps
|
|
|
|
integer(pInt), dimension(:), allocatable :: binSet
|
|
|
|
real(pReal) center,sum_dV_V,prob,dg_0,C,lowerC,upperC,rnd
|
|
|
|
real(pReal), dimension(3) :: limits,deltas
|
|
|
|
real(pReal), dimension(:,:,:), allocatable :: dV_V
|
2007-03-26 20:33:21 +05:30
|
|
|
real(pReal), dimension(3,Nast) :: IO_hybridIA
|
2007-03-21 18:02:15 +05:30
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
call IO_open_file(999_pInt,ODFfileName)
|
2007-03-21 18:02:15 +05:30
|
|
|
|
|
|
|
!--- parse header of ODF file ---
|
|
|
|
!--- limits in phi1, Phi, phi2 ---
|
|
|
|
read(999,fmt=fileFormat,end=100) line
|
2012-02-16 00:28:38 +05:30
|
|
|
myPos = IO_stringPos(line,3_pInt)
|
|
|
|
if (myPos(1).ne.3) goto 100
|
|
|
|
do i=1_pInt,3_pInt
|
|
|
|
limits(i) = IO_floatValue(line,myPos,i)*inRad
|
2009-06-15 18:41:21 +05:30
|
|
|
enddo
|
2007-03-21 18:02:15 +05:30
|
|
|
|
|
|
|
!--- deltas in phi1, Phi, phi2 ---
|
|
|
|
read(999,fmt=fileFormat,end=100) line
|
2012-02-16 00:28:38 +05:30
|
|
|
myPos = IO_stringPos(line,3_pInt)
|
|
|
|
if (myPos(1).ne.3) goto 100
|
|
|
|
do i=1_pInt,3_pInt
|
|
|
|
deltas(i) = IO_floatValue(line,myPos,i)*inRad
|
2009-06-15 18:41:21 +05:30
|
|
|
enddo
|
2007-03-21 18:02:15 +05:30
|
|
|
steps = nint(limits/deltas,pInt)
|
|
|
|
allocate(dV_V(steps(3),steps(2),steps(1)))
|
|
|
|
|
|
|
|
!--- box boundary/center at origin? ---
|
|
|
|
read(999,fmt=fileFormat,end=100) line
|
|
|
|
if (index(IO_lc(line),'bound')>0) then
|
|
|
|
center = 0.5_pReal
|
|
|
|
else
|
|
|
|
center = 0.0_pReal
|
2009-06-15 18:41:21 +05:30
|
|
|
endif
|
2007-03-21 18:02:15 +05:30
|
|
|
|
|
|
|
!--- skip blank line ---
|
|
|
|
read(999,fmt=fileFormat,end=100) line
|
|
|
|
|
|
|
|
sum_dV_V = 0.0_pReal
|
|
|
|
dV_V = 0.0_pReal
|
|
|
|
dg_0 = deltas(1)*deltas(3)*2.0_pReal*sin(deltas(2)/2.0_pReal)
|
|
|
|
NnonZero = 0_pInt
|
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
do phi1=1_pInt,steps(1)
|
|
|
|
do Phi=1_pInt,steps(2)
|
|
|
|
do phi2=1_pInt,steps(3)
|
2008-03-12 19:23:00 +05:30
|
|
|
read(999,fmt=*,end=100) prob
|
2007-03-21 18:02:15 +05:30
|
|
|
if (prob > 0.0_pReal) then
|
2012-02-16 00:28:38 +05:30
|
|
|
NnonZero = NnonZero+1_pInt
|
2007-03-21 18:02:15 +05:30
|
|
|
sum_dV_V = sum_dV_V+prob
|
|
|
|
else
|
|
|
|
prob = 0.0_pReal
|
2009-06-15 18:41:21 +05:30
|
|
|
endif
|
2007-03-21 18:02:15 +05:30
|
|
|
dV_V(phi2,Phi,phi1) = prob*dg_0*sin((Phi-1.0_pReal+center)*deltas(2))
|
2009-06-15 18:41:21 +05:30
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
2009-08-13 18:51:22 +05:30
|
|
|
|
2007-03-21 18:02:15 +05:30
|
|
|
dV_V = dV_V/sum_dV_V ! normalize to 1
|
|
|
|
|
|
|
|
!--- now fix bounds ---
|
2009-10-14 18:51:03 +05:30
|
|
|
Nset = max(Nast,NnonZero) ! if less than non-zero voxel count requested, sample at least that much
|
2007-03-21 18:02:15 +05:30
|
|
|
lowerC = 0.0_pReal
|
|
|
|
upperC = real(Nset, pReal)
|
|
|
|
|
|
|
|
do while (hybridIA_reps(dV_V,steps,upperC) < Nset)
|
|
|
|
lowerC = upperC
|
|
|
|
upperC = upperC*2.0_pReal
|
2009-06-15 18:41:21 +05:30
|
|
|
enddo
|
2007-03-21 18:02:15 +05:30
|
|
|
!--- binary search for best C ---
|
|
|
|
do
|
|
|
|
C = (upperC+lowerC)/2.0_pReal
|
|
|
|
Nreps = hybridIA_reps(dV_V,steps,C)
|
|
|
|
if (abs(upperC-lowerC) < upperC*1.0e-14_pReal) then
|
|
|
|
C = upperC
|
|
|
|
Nreps = hybridIA_reps(dV_V,steps,C)
|
|
|
|
exit
|
|
|
|
elseif (Nreps < Nset) then
|
|
|
|
lowerC = C
|
|
|
|
elseif (Nreps > Nset) then
|
|
|
|
upperC = C
|
|
|
|
else
|
|
|
|
exit
|
2009-06-15 18:41:21 +05:30
|
|
|
endif
|
|
|
|
enddo
|
2009-08-13 18:51:22 +05:30
|
|
|
|
2007-03-21 18:02:15 +05:30
|
|
|
allocate(binSet(Nreps))
|
2012-02-10 16:54:53 +05:30
|
|
|
bin = 0_pInt ! bin counter
|
2012-02-16 00:28:38 +05:30
|
|
|
i = 1_pInt ! set counter
|
|
|
|
do phi1=1_pInt,steps(1)
|
|
|
|
do Phi=1_pInt,steps(2)
|
|
|
|
do phi2=1_pInt,steps(3)
|
2007-03-21 18:02:15 +05:30
|
|
|
reps = nint(C*dV_V(phi2,Phi,phi1), pInt)
|
|
|
|
binSet(i:i+reps-1) = bin
|
2012-02-16 00:28:38 +05:30
|
|
|
bin = bin+1_pInt ! advance bin
|
2007-03-21 18:02:15 +05:30
|
|
|
i = i+reps ! advance set
|
2009-06-15 18:41:21 +05:30
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
enddo
|
2007-03-21 18:02:15 +05:30
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
do i=1_pInt,Nast
|
2007-03-21 18:02:15 +05:30
|
|
|
if (i < Nast) then
|
|
|
|
call random_number(rnd)
|
2009-08-13 18:51:22 +05:30
|
|
|
j = nint(rnd*(Nreps-i)+i+0.5_pReal,pInt)
|
2007-03-21 18:02:15 +05:30
|
|
|
else
|
|
|
|
j = i
|
2009-06-15 18:41:21 +05:30
|
|
|
endif
|
2007-03-21 18:02:15 +05:30
|
|
|
bin = binSet(j)
|
2012-02-10 16:54:53 +05:30
|
|
|
IO_hybridIA(1,i) = deltas(1)*(real(mod(bin/(steps(3)*steps(2)),steps(1)),pReal)+center) ! phi1
|
|
|
|
IO_hybridIA(2,i) = deltas(2)*(real(mod(bin/ steps(3) ,steps(2)),pReal)+center) ! Phi
|
|
|
|
IO_hybridIA(3,i) = deltas(3)*(real(mod(bin ,steps(3)),pReal)+center) ! phi2
|
2007-03-21 18:02:15 +05:30
|
|
|
binSet(j) = binSet(i)
|
2009-06-15 18:41:21 +05:30
|
|
|
enddo
|
2007-03-21 18:02:15 +05:30
|
|
|
close(999)
|
|
|
|
return
|
|
|
|
|
|
|
|
! on error
|
2012-02-10 16:54:53 +05:30
|
|
|
100 IO_hybridIA = -1.0_pReal
|
2007-03-21 18:02:15 +05:30
|
|
|
close(999)
|
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
endfunction
|
2007-03-21 18:02:15 +05:30
|
|
|
|
|
|
|
|
2009-03-04 17:18:54 +05:30
|
|
|
!********************************************************************
|
|
|
|
! identifies lines without content
|
|
|
|
!********************************************************************
|
2009-06-15 18:41:21 +05:30
|
|
|
pure function IO_isBlank (line)
|
2009-03-04 17:18:54 +05:30
|
|
|
|
|
|
|
use prec, only: pInt
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
character(len=*), intent(in) :: line
|
|
|
|
character(len=*), parameter :: blank = achar(32)//achar(9)//achar(10)//achar(13) ! whitespaces
|
|
|
|
character(len=*), parameter :: comment = achar(35) ! comment id '#'
|
2012-02-16 00:28:38 +05:30
|
|
|
integer :: posNonBlank, posComment !no pInt
|
2009-03-04 17:18:54 +05:30
|
|
|
logical IO_isBlank
|
|
|
|
|
|
|
|
posNonBlank = verify(line,blank)
|
|
|
|
posComment = scan(line,comment)
|
|
|
|
IO_isBlank = posNonBlank == 0 .or. posNonBlank == posComment
|
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
endfunction
|
2009-03-04 17:18:54 +05:30
|
|
|
|
|
|
|
!********************************************************************
|
|
|
|
! get tagged content of line
|
|
|
|
!********************************************************************
|
2011-09-13 21:24:06 +05:30
|
|
|
pure function IO_getTag (line,openChar,closeChar)
|
2009-03-04 17:18:54 +05:30
|
|
|
|
|
|
|
use prec, only: pInt
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
character(len=*), intent(in) :: line,openChar,closeChar
|
|
|
|
character(len=*), parameter :: sep=achar(32)//achar(9)//achar(10)//achar(13) ! whitespaces
|
|
|
|
character(len=len_trim(line)) IO_getTag
|
2012-02-16 00:28:38 +05:30
|
|
|
integer :: left,right !no pInt
|
2009-03-04 17:18:54 +05:30
|
|
|
|
|
|
|
IO_getTag = ''
|
|
|
|
left = scan(line,openChar)
|
|
|
|
right = scan(line,closeChar)
|
|
|
|
|
|
|
|
if (left == verify(line,sep) .and. right > left) & ! openChar is first and closeChar occurs
|
|
|
|
IO_getTag = line(left+1:right-1)
|
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
endfunction
|
2009-03-04 17:18:54 +05:30
|
|
|
|
|
|
|
|
|
|
|
!*********************************************************************
|
2009-06-15 18:41:21 +05:30
|
|
|
function IO_countSections(file,part)
|
2009-03-04 17:18:54 +05:30
|
|
|
!*********************************************************************
|
|
|
|
use prec, only: pInt
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
!* Definition of variables
|
|
|
|
integer(pInt), intent(in) :: file
|
|
|
|
character(len=*), intent(in) :: part
|
|
|
|
integer(pInt) IO_countSections
|
|
|
|
character(len=1024) line
|
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
IO_countSections = 0_pInt
|
2009-03-04 17:18:54 +05:30
|
|
|
line = ''
|
|
|
|
rewind(file)
|
|
|
|
|
|
|
|
do while (IO_getTag(line,'<','>') /= part) ! search for part
|
|
|
|
read(file,'(a1024)',END=100) line
|
|
|
|
enddo
|
|
|
|
|
|
|
|
do
|
|
|
|
read(file,'(a1024)',END=100) line
|
|
|
|
if (IO_isBlank(line)) cycle ! skip empty lines
|
|
|
|
if (IO_getTag(line,'<','>') /= '') exit ! stop at next part
|
|
|
|
if (IO_getTag(line,'[',']') /= '') & ! found [section] identifier
|
2012-02-16 00:28:38 +05:30
|
|
|
IO_countSections = IO_countSections + 1_pInt
|
2009-03-04 17:18:54 +05:30
|
|
|
enddo
|
|
|
|
|
2011-10-18 14:52:33 +05:30
|
|
|
100 endfunction
|
2009-03-04 17:18:54 +05:30
|
|
|
|
|
|
|
|
|
|
|
!*********************************************************************
|
|
|
|
! return array of myTag counts within <part> for at most N[sections]
|
|
|
|
!*********************************************************************
|
2009-06-15 18:41:21 +05:30
|
|
|
function IO_countTagInPart(file,part,myTag,Nsections)
|
2009-03-04 17:18:54 +05:30
|
|
|
|
|
|
|
use prec, only: pInt
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
!* Definition of variables
|
|
|
|
integer(pInt), intent(in) :: file, Nsections
|
|
|
|
character(len=*), intent(in) :: part, myTag
|
|
|
|
integer(pInt), dimension(Nsections) :: IO_countTagInPart, counter
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), parameter :: maxNchunks = 1_pInt
|
2009-03-04 17:18:54 +05:30
|
|
|
integer(pInt), dimension(1+2*maxNchunks) :: positions
|
|
|
|
integer(pInt) section
|
|
|
|
character(len=1024) line,tag
|
|
|
|
|
|
|
|
counter = 0_pInt
|
|
|
|
section = 0_pInt
|
|
|
|
line = ''
|
|
|
|
rewind(file)
|
|
|
|
|
|
|
|
do while (IO_getTag(line,'<','>') /= part) ! search for part
|
|
|
|
read(file,'(a1024)',END=100) line
|
|
|
|
enddo
|
|
|
|
|
|
|
|
do
|
|
|
|
read(file,'(a1024)',END=100) line
|
|
|
|
if (IO_isBlank(line)) cycle ! skip empty lines
|
|
|
|
if (IO_getTag(line,'<','>') /= '') exit ! stop at next part
|
|
|
|
if (IO_getTag(line,'[',']') /= '') & ! found [section] identifier
|
2012-02-16 00:28:38 +05:30
|
|
|
section = section + 1_pInt
|
2009-03-04 17:18:54 +05:30
|
|
|
if (section > 0) then
|
|
|
|
positions = IO_stringPos(line,maxNchunks)
|
2012-02-02 18:49:02 +05:30
|
|
|
tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key
|
2009-03-04 17:18:54 +05:30
|
|
|
if (tag == myTag) & ! match
|
2012-02-02 18:49:02 +05:30
|
|
|
counter(section) = counter(section) + 1_pInt
|
2009-03-04 17:18:54 +05:30
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
|
|
|
|
100 IO_countTagInPart = counter
|
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
endfunction
|
2009-03-04 17:18:54 +05:30
|
|
|
|
|
|
|
|
2009-04-03 16:00:18 +05:30
|
|
|
!*********************************************************************
|
|
|
|
! return array of myTag presence within <part> for at most N[sections]
|
|
|
|
!*********************************************************************
|
2009-06-15 18:41:21 +05:30
|
|
|
function IO_spotTagInPart(file,part,myTag,Nsections)
|
2009-04-03 16:00:18 +05:30
|
|
|
|
|
|
|
use prec, only: pInt
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
!* Definition of variables
|
|
|
|
integer(pInt), intent(in) :: file, Nsections
|
|
|
|
character(len=*), intent(in) :: part, myTag
|
|
|
|
logical, dimension(Nsections) :: IO_spotTagInPart
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), parameter :: maxNchunks = 1_pInt
|
2009-04-03 16:00:18 +05:30
|
|
|
integer(pInt), dimension(1+2*maxNchunks) :: positions
|
|
|
|
integer(pInt) section
|
|
|
|
character(len=1024) line,tag
|
|
|
|
|
|
|
|
IO_spotTagInPart = .false. ! assume to nowhere spot tag
|
|
|
|
section = 0_pInt
|
|
|
|
line = ''
|
|
|
|
rewind(file)
|
|
|
|
|
|
|
|
do while (IO_getTag(line,'<','>') /= part) ! search for part
|
|
|
|
read(file,'(a1024)',END=100) line
|
|
|
|
enddo
|
|
|
|
|
|
|
|
do
|
|
|
|
read(file,'(a1024)',END=100) line
|
|
|
|
if (IO_isBlank(line)) cycle ! skip empty lines
|
|
|
|
if (IO_getTag(line,'<','>') /= '') exit ! stop at next part
|
|
|
|
if (IO_getTag(line,'[',']') /= '') & ! found [section] identifier
|
2012-02-16 00:28:38 +05:30
|
|
|
section = section + 1_pInt
|
|
|
|
if (section > 0_pInt) then
|
2009-04-03 16:00:18 +05:30
|
|
|
positions = IO_stringPos(line,maxNchunks)
|
2012-02-02 18:49:02 +05:30
|
|
|
tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key
|
2009-04-03 16:00:18 +05:30
|
|
|
if (tag == myTag) & ! match
|
|
|
|
IO_spotTagInPart(section) = .true.
|
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
|
2011-10-18 14:52:33 +05:30
|
|
|
100 endfunction
|
2009-04-03 16:00:18 +05:30
|
|
|
|
2007-03-20 19:25:22 +05:30
|
|
|
!********************************************************************
|
|
|
|
! locate at most N space-separated parts in line
|
2009-12-15 21:33:53 +05:30
|
|
|
! return array containing number of parts in line and
|
|
|
|
! the left/right positions of at most N to be used by IO_xxxVal
|
2007-03-20 19:25:22 +05:30
|
|
|
!********************************************************************
|
2009-12-15 21:33:53 +05:30
|
|
|
! pure function IO_stringPos (line,N)
|
|
|
|
function IO_stringPos (line,N)
|
2007-03-20 19:25:22 +05:30
|
|
|
|
|
|
|
use prec, only: pReal,pInt
|
|
|
|
implicit none
|
|
|
|
|
2009-01-16 20:55:37 +05:30
|
|
|
character(len=*), intent(in) :: line
|
2009-10-12 21:31:49 +05:30
|
|
|
character(len=*), parameter :: sep=achar(44)//achar(32)//achar(9)//achar(10)//achar(13) ! comma and whitespaces
|
2009-01-20 00:40:58 +05:30
|
|
|
integer(pInt), intent(in) :: N
|
2012-02-16 00:28:38 +05:30
|
|
|
integer :: left,right !no pInt (verify and scan return default integer)
|
|
|
|
integer(pInt) :: IO_stringPos(1_pInt+N*2_pInt)
|
2007-04-25 20:08:22 +05:30
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
IO_stringPos = -1_pInt
|
|
|
|
IO_stringPos(1) = 0_pInt
|
2009-12-15 21:33:53 +05:30
|
|
|
right = 0
|
|
|
|
|
|
|
|
do while (verify(line(right+1:),sep)>0)
|
|
|
|
left = right + verify(line(right+1:),sep)
|
|
|
|
right = left + scan(line(left:),sep) - 2
|
2011-05-30 14:39:19 +05:30
|
|
|
if ( line(left:left) == '#' ) then
|
|
|
|
exit
|
|
|
|
endif
|
2009-12-15 21:33:53 +05:30
|
|
|
if ( IO_stringPos(1)<N ) then
|
2012-02-16 00:28:38 +05:30
|
|
|
IO_stringPos(1_pInt+IO_stringPos(1)*2_pInt+1_pInt) = int(left, pInt)
|
|
|
|
IO_stringPos(1_pInt+IO_stringPos(1)*2_pInt+2_pInt) = int(right, pInt)
|
2009-12-15 21:33:53 +05:30
|
|
|
endif
|
2012-02-16 00:28:38 +05:30
|
|
|
IO_stringPos(1) = IO_stringPos(1)+1_pInt
|
2009-06-15 18:41:21 +05:30
|
|
|
enddo
|
2009-12-15 21:33:53 +05:30
|
|
|
|
2011-10-18 14:52:33 +05:30
|
|
|
endfunction
|
2007-03-20 19:25:22 +05:30
|
|
|
|
|
|
|
|
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
! read string value at myPos from line
|
2007-03-20 19:25:22 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
pure function IO_stringValue (line,positions,myPos)
|
2007-03-20 19:25:22 +05:30
|
|
|
|
|
|
|
use prec, only: pReal,pInt
|
|
|
|
implicit none
|
|
|
|
|
2009-01-16 20:55:37 +05:30
|
|
|
character(len=*), intent(in) :: line
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), intent(in) :: positions(*),myPos
|
|
|
|
character(len=1+positions(myPos*2+1)-positions(myPos*2)) :: IO_stringValue
|
2007-04-25 20:08:22 +05:30
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
if (positions(1) < myPos) then
|
2007-04-25 20:08:22 +05:30
|
|
|
IO_stringValue = ''
|
2007-03-28 15:30:49 +05:30
|
|
|
else
|
2012-02-16 00:28:38 +05:30
|
|
|
IO_stringValue = line(positions(myPos*2):positions(myPos*2+1))
|
2007-03-28 15:30:49 +05:30
|
|
|
endif
|
2007-03-20 19:25:22 +05:30
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
endfunction
|
2007-03-20 19:25:22 +05:30
|
|
|
|
|
|
|
|
2007-03-21 20:15:03 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
! read string value at myPos from fixed format line
|
2007-03-21 20:15:03 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
pure function IO_fixedStringValue (line,ends,myPos)
|
2007-03-21 20:15:03 +05:30
|
|
|
|
|
|
|
use prec, only: pReal,pInt
|
|
|
|
implicit none
|
|
|
|
|
2009-01-16 20:55:37 +05:30
|
|
|
character(len=*), intent(in) :: line
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), intent(in) :: ends(*),myPos
|
|
|
|
character(len=ends(myPos+1)-ends(myPos)) :: IO_fixedStringValue
|
2007-03-21 20:15:03 +05:30
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
IO_fixedStringValue = line(ends(myPos)+1:ends(myPos+1))
|
2007-03-21 20:15:03 +05:30
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
endfunction
|
2007-03-21 20:15:03 +05:30
|
|
|
|
|
|
|
|
2007-03-20 19:25:22 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
! read float value at myPos from line
|
2007-03-20 19:25:22 +05:30
|
|
|
!********************************************************************
|
2011-10-18 14:52:33 +05:30
|
|
|
pure function IO_floatValue (line,positions,myPos)
|
2007-03-20 19:25:22 +05:30
|
|
|
|
|
|
|
use prec, only: pReal,pInt
|
|
|
|
implicit none
|
|
|
|
|
2009-01-16 20:55:37 +05:30
|
|
|
character(len=*), intent(in) :: line
|
2011-10-18 14:52:33 +05:30
|
|
|
integer(pInt), intent(in) :: positions(*),myPos
|
2012-02-16 00:28:38 +05:30
|
|
|
real(pReal) :: IO_floatValue
|
2007-03-20 19:25:22 +05:30
|
|
|
|
2011-10-18 14:52:33 +05:30
|
|
|
if (positions(1) < myPos) then
|
2009-06-19 12:39:39 +05:30
|
|
|
IO_floatValue = 0.0_pReal
|
|
|
|
else
|
2011-10-18 14:52:33 +05:30
|
|
|
read(UNIT=line(positions(myPos*2):positions(myPos*2+1)),ERR=100,FMT=*) IO_floatValue
|
2007-03-28 15:30:49 +05:30
|
|
|
endif
|
2009-06-19 12:39:39 +05:30
|
|
|
return
|
2007-04-26 18:10:06 +05:30
|
|
|
100 IO_floatValue = huge(1.0_pReal)
|
2007-03-20 19:25:22 +05:30
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
endfunction
|
2007-03-20 19:25:22 +05:30
|
|
|
|
|
|
|
|
2007-03-21 20:15:03 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
! read float value at myPos from fixed format line
|
2007-03-21 20:15:03 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
pure function IO_fixedFloatValue (line,ends,myPos)
|
2007-03-21 20:15:03 +05:30
|
|
|
|
|
|
|
use prec, only: pReal,pInt
|
|
|
|
implicit none
|
|
|
|
|
2009-01-16 20:55:37 +05:30
|
|
|
character(len=*), intent(in) :: line
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), intent(in) :: ends(*),myPos
|
|
|
|
real(pReal) :: IO_fixedFloatValue
|
2007-03-21 20:15:03 +05:30
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
read(UNIT=line(ends(myPos-1)+1:ends(myPos)),ERR=100,FMT=*) IO_fixedFloatValue
|
2007-03-21 20:15:03 +05:30
|
|
|
return
|
2007-04-26 18:10:06 +05:30
|
|
|
100 IO_fixedFloatValue = huge(1.0_pReal)
|
2007-03-21 20:15:03 +05:30
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
endfunction
|
2007-03-21 20:15:03 +05:30
|
|
|
|
|
|
|
|
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
! read float x.y+z value at myPos from format line line
|
2007-03-21 20:15:03 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
pure function IO_fixedNoEFloatValue (line,ends,myPos)
|
2007-03-21 20:15:03 +05:30
|
|
|
|
|
|
|
use prec, only: pReal,pInt
|
|
|
|
implicit none
|
|
|
|
|
2009-01-16 20:55:37 +05:30
|
|
|
character(len=*), intent(in) :: line
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), intent(in) :: ends(*),myPos
|
|
|
|
integer(pInt) :: expon
|
|
|
|
integer :: pos_exp
|
2009-01-20 00:40:58 +05:30
|
|
|
real(pReal) IO_fixedNoEFloatValue,base
|
2007-03-21 20:15:03 +05:30
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
pos_exp = scan(line(ends(myPos)+1:ends(myPos+1)),'+-',back=.true.)
|
2007-03-21 20:15:03 +05:30
|
|
|
if (pos_exp > 1) then
|
2012-02-16 00:28:38 +05:30
|
|
|
read(UNIT=line(ends(myPos)+1:ends(myPos)+pos_exp-1),ERR=100,FMT=*) base
|
|
|
|
read(UNIT=line(ends(myPos)+pos_exp:ends(myPos+1)),ERR=100,FMT=*) expon
|
2007-03-21 20:15:03 +05:30
|
|
|
else
|
2012-02-16 00:28:38 +05:30
|
|
|
read(UNIT=line(ends(myPos)+1:ends(myPos+1)),ERR=100,FMT=*) base
|
2007-03-21 22:34:10 +05:30
|
|
|
expon = 0_pInt
|
2007-03-21 20:15:03 +05:30
|
|
|
endif
|
|
|
|
IO_fixedNoEFloatValue = base*10.0_pReal**expon
|
|
|
|
return
|
2007-04-26 18:10:06 +05:30
|
|
|
100 IO_fixedNoEFloatValue = huge(1.0_pReal)
|
2007-03-21 20:15:03 +05:30
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
endfunction
|
2007-03-21 20:15:03 +05:30
|
|
|
|
|
|
|
|
2007-03-20 19:25:22 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
! read int value at myPos from line
|
2007-03-20 19:25:22 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
pure function IO_intValue (line,positions,myPos)
|
2007-03-20 19:25:22 +05:30
|
|
|
|
|
|
|
use prec, only: pReal,pInt
|
|
|
|
implicit none
|
|
|
|
|
2009-01-16 20:55:37 +05:30
|
|
|
character(len=*), intent(in) :: line
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), intent(in) :: positions(*),myPos
|
|
|
|
integer(pInt) :: IO_intValue
|
2007-03-20 19:25:22 +05:30
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
if (positions(1) < myPos) then
|
2009-06-19 12:39:39 +05:30
|
|
|
IO_intValue = 0_pInt
|
|
|
|
else
|
2012-02-16 00:28:38 +05:30
|
|
|
read(UNIT=line(positions(myPos*2):positions(myPos*2+1)),ERR=100,FMT=*) IO_intValue
|
2007-04-25 20:08:22 +05:30
|
|
|
endif
|
2009-06-19 12:39:39 +05:30
|
|
|
return
|
2007-04-26 18:10:06 +05:30
|
|
|
100 IO_intValue = huge(1_pInt)
|
2007-03-20 19:25:22 +05:30
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
endfunction
|
2007-03-20 19:25:22 +05:30
|
|
|
|
|
|
|
|
2007-03-21 20:15:03 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
! read int value at myPos from fixed format line
|
2007-03-21 20:15:03 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
pure function IO_fixedIntValue (line,ends,myPos)
|
2007-03-21 20:15:03 +05:30
|
|
|
|
|
|
|
use prec, only: pReal,pInt
|
|
|
|
implicit none
|
|
|
|
|
2009-01-16 20:55:37 +05:30
|
|
|
character(len=*), intent(in) :: line
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), intent(in) :: ends(*),myPos
|
2009-01-20 00:40:58 +05:30
|
|
|
integer(pInt) IO_fixedIntValue
|
2007-03-21 20:15:03 +05:30
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
read(UNIT=line(ends(myPos)+1:ends(myPos+1)),ERR=100,FMT=*) IO_fixedIntValue
|
2007-03-21 20:15:03 +05:30
|
|
|
return
|
2007-04-26 18:10:06 +05:30
|
|
|
100 IO_fixedIntValue = huge(1_pInt)
|
2007-03-21 20:15:03 +05:30
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
endfunction
|
2007-03-21 20:15:03 +05:30
|
|
|
|
|
|
|
|
2007-04-25 20:08:22 +05:30
|
|
|
!********************************************************************
|
|
|
|
! change character in line to lower case
|
|
|
|
!********************************************************************
|
2009-06-15 18:41:21 +05:30
|
|
|
pure function IO_lc (line)
|
2007-03-20 19:25:22 +05:30
|
|
|
|
|
|
|
use prec, only: pInt
|
|
|
|
implicit none
|
|
|
|
|
2009-01-16 20:55:37 +05:30
|
|
|
character (len=*), intent(in) :: line
|
2007-03-21 18:02:15 +05:30
|
|
|
character (len=len(line)) IO_lc
|
2012-02-16 00:28:38 +05:30
|
|
|
integer :: i !no pInt (len returns default integer)
|
2007-03-20 19:25:22 +05:30
|
|
|
|
2007-03-21 18:02:15 +05:30
|
|
|
IO_lc = line
|
2007-04-25 20:08:22 +05:30
|
|
|
do i=1,len(line)
|
|
|
|
if(64<iachar(line(i:i)) .and. iachar(line(i:i))<91) IO_lc(i:i)=achar(iachar(line(i:i))+32)
|
|
|
|
enddo
|
2007-03-20 19:25:22 +05:30
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
endfunction
|
2007-03-20 19:25:22 +05:30
|
|
|
|
|
|
|
|
|
|
|
!********************************************************************
|
2007-03-21 18:02:15 +05:30
|
|
|
! in place change of character in line to lower case
|
2007-03-20 19:25:22 +05:30
|
|
|
!********************************************************************
|
2009-06-15 18:41:21 +05:30
|
|
|
subroutine IO_lcInplace (line)
|
2007-03-20 19:25:22 +05:30
|
|
|
|
|
|
|
use prec, only: pInt
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
character (len=*) line
|
2007-03-28 14:01:12 +05:30
|
|
|
character (len=len(line)) IO_lc
|
2012-02-16 00:28:38 +05:30
|
|
|
integer :: i !no pInt (len returns default integer)
|
2007-03-20 19:25:22 +05:30
|
|
|
|
2007-03-28 14:01:12 +05:30
|
|
|
IO_lc = line
|
2007-04-25 20:08:22 +05:30
|
|
|
do i=1,len(line)
|
|
|
|
if(64<iachar(line(i:i)) .and. iachar(line(i:i))<91) IO_lc(i:i)=achar(iachar(line(i:i))+32)
|
|
|
|
enddo
|
2007-03-28 14:01:12 +05:30
|
|
|
line = IO_lc
|
2007-03-20 19:25:22 +05:30
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
endsubroutine
|
2007-03-20 19:25:22 +05:30
|
|
|
|
|
|
|
|
2009-04-03 12:34:31 +05:30
|
|
|
!********************************************************************
|
|
|
|
! read on in file to skip (at least) N chunks (may be over multiple lines)
|
|
|
|
!********************************************************************
|
2009-06-15 18:41:21 +05:30
|
|
|
subroutine IO_skipChunks (unit,N)
|
2009-04-03 12:34:31 +05:30
|
|
|
|
|
|
|
use prec, only: pReal,pInt
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(pInt) remainingChunks,unit,N
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), parameter :: maxNchunks = 64_pInt
|
|
|
|
integer(pInt), dimension(1+2*maxNchunks) :: myPos
|
2009-04-03 12:34:31 +05:30
|
|
|
character(len=300) line
|
|
|
|
|
|
|
|
remainingChunks = N
|
|
|
|
do while (remainingChunks > 0)
|
|
|
|
read(unit,'(A300)',end=100) line
|
2012-02-16 00:28:38 +05:30
|
|
|
myPos = IO_stringPos(line,maxNchunks)
|
|
|
|
remainingChunks = remainingChunks - myPos(1)
|
2009-06-15 18:41:21 +05:30
|
|
|
enddo
|
2011-10-18 14:52:33 +05:30
|
|
|
100 endsubroutine
|
2009-04-03 12:34:31 +05:30
|
|
|
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
|
|
!********************************************************************
|
|
|
|
! extract value from key=value pair and check whether key matches
|
|
|
|
!********************************************************************
|
|
|
|
pure function IO_extractValue (line,key)
|
2009-04-03 12:34:31 +05:30
|
|
|
|
2009-10-12 21:31:49 +05:30
|
|
|
implicit none
|
|
|
|
|
|
|
|
character(len=*), intent(in) :: line,key
|
|
|
|
character(len=*), parameter :: sep = achar(61) ! '='
|
2012-02-16 00:28:38 +05:30
|
|
|
integer :: myPos ! no pInt (scan returns default integer)
|
2009-10-12 21:31:49 +05:30
|
|
|
character(len=300) IO_extractValue
|
|
|
|
|
|
|
|
IO_extractValue = ''
|
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
myPos = scan(line,sep)
|
|
|
|
if (myPos > 0 .and. line(:myPos-1) == key(:myPos-1)) & ! key matches expected key
|
|
|
|
IO_extractValue = line(myPos+1:) ! extract value
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
2007-04-25 20:08:22 +05:30
|
|
|
!********************************************************************
|
2009-10-12 21:31:49 +05:30
|
|
|
! count lines containig data up to next *keyword
|
2010-07-13 15:56:07 +05:30
|
|
|
! AP: changed the function to neglect comment lines between keyword definitions.
|
|
|
|
! : is not changed back to the original version since *.inp_assembly does not
|
|
|
|
! : contain any comment lines (12.07.2010)
|
2007-10-15 19:25:52 +05:30
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
function IO_countDataLines (myUnit)
|
2007-10-15 19:25:52 +05:30
|
|
|
|
|
|
|
use prec, only: pReal,pInt
|
|
|
|
implicit none
|
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt) :: IO_countDataLines,myUnit
|
|
|
|
integer(pInt), parameter :: maxNchunks = 1_pInt
|
|
|
|
integer(pInt), dimension(1+2*maxNchunks) :: myPos
|
|
|
|
character(len=300) :: line,tmp
|
2007-10-15 19:25:52 +05:30
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
IO_countDataLines = 0_pInt
|
2007-10-15 19:25:52 +05:30
|
|
|
do
|
2012-02-16 00:28:38 +05:30
|
|
|
read(myUnit,'(A300)',end=100) line
|
|
|
|
myPos = IO_stringPos(line,maxNchunks)
|
|
|
|
tmp = IO_lc(IO_stringValue(line,myPos,1_pInt))
|
2010-07-13 15:56:07 +05:30
|
|
|
if (tmp(1:1) == '*' .and. tmp(2:2) /= '*') then ! found keyword
|
2009-10-12 21:31:49 +05:30
|
|
|
exit
|
2007-10-15 19:25:52 +05:30
|
|
|
else
|
2010-07-13 15:56:07 +05:30
|
|
|
if (tmp(2:2) /= '*') IO_countDataLines = IO_countDataLines + 1_pInt
|
2007-10-15 19:25:52 +05:30
|
|
|
endif
|
|
|
|
enddo
|
2012-02-16 00:28:38 +05:30
|
|
|
100 backspace(myUnit)
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
|
|
!********************************************************************
|
|
|
|
! count items in consecutive lines
|
|
|
|
! Marc: ints concatenated by "c" as last char or range of values a "to" b
|
|
|
|
! Abaqus: triplet of start,stop,inc
|
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
function IO_countContinousIntValues (myUnit)
|
2009-10-12 21:31:49 +05:30
|
|
|
|
2011-05-11 22:31:03 +05:30
|
|
|
use DAMASK_interface
|
2009-10-12 21:31:49 +05:30
|
|
|
use prec, only: pReal,pInt
|
|
|
|
implicit none
|
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt) :: myUnit,l,c
|
|
|
|
integer(pInt) :: IO_countContinousIntValues
|
|
|
|
integer(pInt), parameter :: maxNchunks = 8192_pInt
|
|
|
|
integer(pInt), dimension(1+2*maxNchunks) :: myPos
|
2012-01-12 22:31:24 +05:30
|
|
|
character(len=65536) line
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
|
|
IO_countContinousIntValues = 0_pInt
|
|
|
|
|
|
|
|
select case (FEsolver)
|
2012-01-12 22:31:24 +05:30
|
|
|
case ('Marc','Spectral')
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
|
|
do
|
2012-02-16 00:28:38 +05:30
|
|
|
read(myUnit,'(A300)',end=100) line
|
|
|
|
myPos = IO_stringPos(line,maxNchunks)
|
|
|
|
if (IO_lc(IO_stringValue(line,myPos,2_pInt)) == 'to' ) then ! found range indicator
|
|
|
|
IO_countContinousIntValues = 1_pInt + IO_intValue(line,myPos,3_pInt) - IO_intValue(line,myPos,1_pInt)
|
2009-10-12 21:31:49 +05:30
|
|
|
exit ! only one single range indicator allowed
|
|
|
|
else
|
2012-02-16 00:28:38 +05:30
|
|
|
IO_countContinousIntValues = IO_countContinousIntValues+myPos(1)-1_pInt ! add line's count when assuming 'c'
|
|
|
|
if ( IO_lc(IO_stringValue(line,myPos,myPos(1))) /= 'c' ) then ! line finished, read last value
|
|
|
|
IO_countContinousIntValues = IO_countContinousIntValues+1_pInt
|
2009-10-12 21:31:49 +05:30
|
|
|
exit ! data ended
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
|
|
|
|
case('Abaqus')
|
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
c = IO_countDataLines(myUnit)
|
|
|
|
do l = 1_pInt,c
|
|
|
|
backspace(myUnit)
|
2009-10-12 21:31:49 +05:30
|
|
|
enddo
|
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
do l = 1_pInt,c
|
|
|
|
read(myUnit,'(A300)',end=100) line
|
|
|
|
myPos = IO_stringPos(line,maxNchunks)
|
|
|
|
IO_countContinousIntValues = IO_countContinousIntValues + 1_pInt + & ! assuming range generation
|
|
|
|
(IO_intValue(line,myPos,2_pInt)-IO_intValue(line,myPos,1_pInt))/&
|
|
|
|
max(1_pInt,IO_intValue(line,myPos,3_pInt))
|
2009-10-12 21:31:49 +05:30
|
|
|
enddo
|
|
|
|
|
|
|
|
endselect
|
|
|
|
|
2011-10-18 14:52:33 +05:30
|
|
|
100 endfunction
|
2007-10-15 19:25:52 +05:30
|
|
|
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
|
|
!********************************************************************
|
|
|
|
! return integer list corrsponding to items in consecutive lines
|
|
|
|
! Marc: ints concatenated by "c" as last char, range of a "to" b, or named set
|
|
|
|
! Abaqus: triplet of start,stop,inc or named set
|
|
|
|
!********************************************************************
|
2012-02-16 00:28:38 +05:30
|
|
|
function IO_continousIntValues (myUnit,maxN,lookupName,lookupMap,lookupMaxN)
|
2007-04-25 20:08:22 +05:30
|
|
|
|
2011-05-11 22:31:03 +05:30
|
|
|
use DAMASK_interface
|
2007-04-25 20:08:22 +05:30
|
|
|
use prec, only: pReal,pInt
|
|
|
|
implicit none
|
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt) myUnit,maxN,i,j,l,c,first,last
|
2007-04-25 20:08:22 +05:30
|
|
|
integer(pInt), dimension(1+maxN) :: IO_continousIntValues
|
2012-01-12 22:31:24 +05:30
|
|
|
integer(pInt), parameter :: maxNchunks = 8192_pInt
|
2012-02-16 00:28:38 +05:30
|
|
|
integer(pInt), dimension(1+2*maxNchunks) :: myPos
|
2007-10-23 18:38:27 +05:30
|
|
|
character(len=64), dimension(:) :: lookupName
|
|
|
|
integer(pInt) :: lookupMaxN
|
|
|
|
integer(pInt), dimension(:,:) :: lookupMap
|
2012-01-12 22:31:24 +05:30
|
|
|
character(len=65536) line
|
2010-07-13 15:56:07 +05:30
|
|
|
logical rangeGeneration
|
2007-04-25 20:08:22 +05:30
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
IO_continousIntValues = 0_pInt
|
2010-07-13 15:56:07 +05:30
|
|
|
rangeGeneration = .false.
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
|
|
select case (FEsolver)
|
2012-01-12 22:31:24 +05:30
|
|
|
case ('Marc','Spectral')
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
|
|
do
|
2012-02-16 00:28:38 +05:30
|
|
|
read(myUnit,'(A65536)',end=100) line
|
|
|
|
myPos = IO_stringPos(line,maxNchunks)
|
|
|
|
if (verify(IO_stringValue(line,myPos,1_pInt),'0123456789') > 0) then ! a non-int, i.e. set name
|
|
|
|
do i = 1_pInt, lookupMaxN ! loop over known set names
|
|
|
|
if (IO_stringValue(line,myPos,1_pInt) == lookupName(i)) then ! found matching name
|
2009-10-12 21:31:49 +05:30
|
|
|
IO_continousIntValues = lookupMap(:,i) ! return resp. entity list
|
|
|
|
exit
|
|
|
|
endif
|
|
|
|
enddo
|
2007-10-23 18:38:27 +05:30
|
|
|
exit
|
2012-02-16 00:28:38 +05:30
|
|
|
else if (myPos(1) > 2_pInt .and. IO_lc(IO_stringValue(line,myPos,2_pInt)) == 'to' ) then ! found range indicator
|
|
|
|
do i = IO_intValue(line,myPos,1_pInt),IO_intValue(line,myPos,3_pInt)
|
2012-02-02 18:49:02 +05:30
|
|
|
IO_continousIntValues(1) = IO_continousIntValues(1) + 1_pInt
|
2009-10-12 21:31:49 +05:30
|
|
|
IO_continousIntValues(1+IO_continousIntValues(1)) = i
|
|
|
|
enddo
|
|
|
|
exit
|
|
|
|
else
|
2012-02-16 00:28:38 +05:30
|
|
|
do i = 1_pInt ,myPos(1)-1_pInt ! interpret up to second to last value
|
2012-02-02 18:49:02 +05:30
|
|
|
IO_continousIntValues(1) = IO_continousIntValues(1) + 1_pInt
|
2012-02-16 00:28:38 +05:30
|
|
|
IO_continousIntValues(1+IO_continousIntValues(1)) = IO_intValue(line,myPos,i)
|
2009-10-12 21:31:49 +05:30
|
|
|
enddo
|
2012-02-16 00:28:38 +05:30
|
|
|
if ( IO_lc(IO_stringValue(line,myPos,myPos(1))) /= 'c' ) then ! line finished, read last value
|
2012-02-02 18:49:02 +05:30
|
|
|
IO_continousIntValues(1) = IO_continousIntValues(1) + 1_pInt
|
2012-02-16 00:28:38 +05:30
|
|
|
IO_continousIntValues(1+IO_continousIntValues(1)) = IO_intValue(line,myPos,myPos(1))
|
2009-10-12 21:31:49 +05:30
|
|
|
exit
|
|
|
|
endif
|
2007-10-23 18:38:27 +05:30
|
|
|
endif
|
|
|
|
enddo
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
|
|
case('Abaqus')
|
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
c = IO_countDataLines(myUnit)
|
|
|
|
do l = 1_pInt,c
|
|
|
|
backspace(myUnit)
|
2007-04-25 20:08:22 +05:30
|
|
|
enddo
|
2009-10-12 21:31:49 +05:30
|
|
|
|
2010-07-13 15:56:07 +05:30
|
|
|
! check if the element values in the elset are auto generated
|
2012-02-16 00:28:38 +05:30
|
|
|
backspace(myUnit)
|
|
|
|
read(myUnit,'(A65536)',end=100) line
|
|
|
|
myPos = IO_stringPos(line,maxNchunks)
|
|
|
|
do i = 1_pInt,myPos(1)
|
|
|
|
if (IO_lc(IO_stringValue(line,myPos,i)) == 'generate') rangeGeneration = .true.
|
2010-07-13 15:56:07 +05:30
|
|
|
enddo
|
|
|
|
|
2012-02-16 00:28:38 +05:30
|
|
|
do l = 1_pInt,c
|
|
|
|
read(myUnit,'(A65536)',end=100) line
|
|
|
|
myPos = IO_stringPos(line,maxNchunks)
|
|
|
|
if (verify(IO_stringValue(line,myPos,1_pInt),'0123456789') > 0) then ! a non-int, i.e. set names follow on this line
|
|
|
|
do i = 1_pInt,myPos(1) ! loop over set names in line
|
|
|
|
do j = 1_pInt,lookupMaxN ! look thru known set names
|
|
|
|
if (IO_stringValue(line,myPos,i) == lookupName(j)) then ! found matching name
|
|
|
|
first = 2_pInt + IO_continousIntValues(1) ! where to start appending data
|
|
|
|
last = first + lookupMap(1,j) - 1_pInt ! up to where to append data
|
2009-10-12 21:31:49 +05:30
|
|
|
IO_continousIntValues(first:last) = lookupMap(2:1+lookupMap(1,j),j) ! add resp. entity list
|
|
|
|
IO_continousIntValues(1) = IO_continousIntValues(1) + lookupMap(1,j) ! count them
|
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
enddo
|
2010-07-13 15:56:07 +05:30
|
|
|
else if (rangeGeneration) then ! range generation
|
2012-02-16 00:28:38 +05:30
|
|
|
do i = IO_intValue(line,myPos,1_pInt),IO_intValue(line,myPos,2_pInt),max(1_pInt,IO_intValue(line,myPos,3_pInt))
|
|
|
|
IO_continousIntValues(1) = IO_continousIntValues(1) + 1_pInt
|
2009-10-12 21:31:49 +05:30
|
|
|
IO_continousIntValues(1+IO_continousIntValues(1)) = i
|
|
|
|
enddo
|
2010-07-13 15:56:07 +05:30
|
|
|
else ! read individual elem nums
|
2012-02-16 00:28:38 +05:30
|
|
|
do i = 1_pInt,myPos(1)
|
|
|
|
! write(*,*)'IO_CIV-int',IO_intValue(line,myPos,i)
|
|
|
|
IO_continousIntValues(1) = IO_continousIntValues(1) + 1_pInt
|
|
|
|
IO_continousIntValues(1+IO_continousIntValues(1)) = IO_intValue(line,myPos,i)
|
2010-07-13 15:56:07 +05:30
|
|
|
enddo
|
2009-10-12 21:31:49 +05:30
|
|
|
endif
|
2007-04-25 20:08:22 +05:30
|
|
|
enddo
|
2009-10-12 21:31:49 +05:30
|
|
|
|
|
|
|
endselect
|
|
|
|
|
2011-10-18 14:52:33 +05:30
|
|
|
100 endfunction
|
2007-04-25 20:08:22 +05:30
|
|
|
|
|
|
|
|
2009-10-12 21:31:49 +05:30
|
|
|
|
2007-03-20 19:25:22 +05:30
|
|
|
!********************************************************************
|
|
|
|
! write error statements to standard out
|
|
|
|
! and terminate the Marc run with exit #9xxx
|
|
|
|
! in ABAQUS either time step is reduced or execution terminated
|
|
|
|
!********************************************************************
|
2011-11-02 20:08:42 +05:30
|
|
|
subroutine IO_error(error_ID,e,i,g,ext_msg)
|
2007-03-20 19:25:22 +05:30
|
|
|
|
2008-02-15 15:34:49 +05:30
|
|
|
use prec, only: pInt
|
2007-03-20 19:25:22 +05:30
|
|
|
implicit none
|
|
|
|
|
2011-11-02 20:08:42 +05:30
|
|
|
integer(pInt), intent(in) :: error_ID
|
2009-03-04 17:18:54 +05:30
|
|
|
integer(pInt), optional, intent(in) :: e,i,g
|
|
|
|
character(len=*), optional, intent(in) :: ext_msg
|
2011-11-02 20:08:42 +05:30
|
|
|
character(len=1024) msg
|
2007-03-20 19:25:22 +05:30
|
|
|
|
2011-11-02 20:08:42 +05:30
|
|
|
select case (error_ID)
|
2012-02-13 23:11:27 +05:30
|
|
|
|
|
|
|
!* file handling errors
|
|
|
|
|
2012-02-02 18:49:02 +05:30
|
|
|
case (100_pInt)
|
2012-02-13 23:11:27 +05:30
|
|
|
msg = 'could not open file:'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (101_pInt)
|
2012-02-13 23:11:27 +05:30
|
|
|
msg = 'write error for file:'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (102_pInt)
|
2012-02-13 23:11:27 +05:30
|
|
|
msg = 'could not read file:'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (103_pInt)
|
2012-02-13 23:11:27 +05:30
|
|
|
msg = 'could not assemble input files'
|
|
|
|
|
|
|
|
|
|
|
|
!* material error messages and related messages in mesh
|
|
|
|
|
2012-02-02 18:49:02 +05:30
|
|
|
case (150_pInt)
|
2011-08-02 15:44:16 +05:30
|
|
|
msg = 'crystallite index out of bounds'
|
2012-02-13 23:11:27 +05:30
|
|
|
case (151_pInt)
|
2011-08-02 15:44:16 +05:30
|
|
|
msg = 'phase index out of bounds'
|
2012-02-13 23:11:27 +05:30
|
|
|
case (152_pInt)
|
2011-08-02 15:44:16 +05:30
|
|
|
msg = 'texture index out of bounds'
|
2012-02-13 23:11:27 +05:30
|
|
|
case (153_pInt)
|
2011-08-02 15:44:16 +05:30
|
|
|
msg = 'sum of phase fractions differs from 1'
|
2012-02-13 23:11:27 +05:30
|
|
|
case (154_pInt)
|
|
|
|
msg = 'homogenization index out of bounds'
|
|
|
|
case (155_pInt)
|
|
|
|
msg = 'microstructure index out of bounds'
|
|
|
|
case (156_pInt)
|
|
|
|
msg = 'reading from ODF file'
|
|
|
|
case (160_pInt)
|
|
|
|
msg = 'no entries in config part'
|
|
|
|
case (170_pInt)
|
|
|
|
msg = 'no homogenization specified via State Variable 2'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (180_pInt)
|
2012-02-13 23:11:27 +05:30
|
|
|
msg = 'no microstructure specified via State Variable 3'
|
|
|
|
|
|
|
|
|
|
|
|
!* constitutive error messages
|
|
|
|
|
2012-02-02 18:49:02 +05:30
|
|
|
case (200_pInt)
|
2011-08-02 15:44:16 +05:30
|
|
|
msg = 'unknown constitution specified'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (205_pInt)
|
2011-08-02 15:44:16 +05:30
|
|
|
msg = 'unknown lattice structure encountered'
|
2012-02-13 23:11:27 +05:30
|
|
|
|
2012-02-14 14:52:37 +05:30
|
|
|
case (210_pInt)
|
|
|
|
msg = 'unknown material parameter for j2 constitutive phase:'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (211_pInt)
|
2012-02-13 23:11:27 +05:30
|
|
|
msg = 'material parameter for j2 constitutive phase out of bounds:'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (212_pInt)
|
2012-02-13 23:11:27 +05:30
|
|
|
msg = 'unknown constitutive output for j2 constitution:'
|
|
|
|
|
2012-02-14 14:52:37 +05:30
|
|
|
case (220_pInt)
|
|
|
|
msg = 'unknown material parameter for phenopowerlaw constitutive phase:'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (221_pInt)
|
2012-02-13 23:11:27 +05:30
|
|
|
msg = 'material parameter for phenopowerlaw constitutive phase out of bounds:'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (222_pInt)
|
2012-02-13 23:11:27 +05:30
|
|
|
msg = 'unknown constitutive output for phenopowerlaw constitution:'
|
|
|
|
|
2012-02-14 14:52:37 +05:30
|
|
|
case (230_pInt)
|
|
|
|
msg = 'unknown material parameter for titanmod constitutive phase:'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (231_pInt)
|
2012-02-13 23:11:27 +05:30
|
|
|
msg = 'material parameter for titanmod constitutive phase out of bounds:'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (232_pInt)
|
2012-02-13 23:11:27 +05:30
|
|
|
msg = 'unknown constitutive output for titanmod constitution:'
|
|
|
|
|
2012-02-14 14:52:37 +05:30
|
|
|
case (240_pInt)
|
|
|
|
msg = 'unknown material parameter for dislotwin constitutive phase:'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (241_pInt)
|
2012-02-13 23:11:27 +05:30
|
|
|
msg = 'material parameter for dislotwin constitutive phase out of bounds:'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (242_pInt)
|
2012-02-13 23:11:27 +05:30
|
|
|
msg = 'unknown constitutive output for dislotwin constitution:'
|
|
|
|
case (243_pInt)
|
2012-02-14 05:00:59 +05:30
|
|
|
msg = 'zero stacking fault energy'
|
2009-11-10 19:06:27 +05:30
|
|
|
|
2012-02-14 14:52:37 +05:30
|
|
|
case (250_pInt)
|
|
|
|
msg = 'unknown material parameter for nonlocal constitutive phase:'
|
2012-02-13 23:11:27 +05:30
|
|
|
case (251_pInt)
|
|
|
|
msg = 'material parameter for nonlocal constitutive phase out of bounds:'
|
|
|
|
case (252_pInt)
|
|
|
|
msg = 'unknown constitutive output for nonlocal constitution:'
|
|
|
|
case (253_pInt)
|
|
|
|
msg = 'element type not supported for nonlocal constitution'
|
2009-10-16 01:32:52 +05:30
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
|
|
|
|
!* numerics error messages
|
2009-10-16 01:32:52 +05:30
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
case (300_pInt)
|
|
|
|
msg = 'unknown numerics parameter:'
|
|
|
|
case (301_pInt)
|
|
|
|
msg = 'numerics parameter out of bounds:'
|
|
|
|
|
|
|
|
|
|
|
|
!* math errors
|
|
|
|
|
|
|
|
case (400_pInt)
|
|
|
|
msg = 'matrix inversion error'
|
|
|
|
case (401_pInt)
|
2010-05-06 19:37:21 +05:30
|
|
|
msg = 'math_check: quat -> axisAngle -> quat failed'
|
2012-02-13 23:11:27 +05:30
|
|
|
case (402_pInt)
|
2010-05-06 19:37:21 +05:30
|
|
|
msg = 'math_check: quat -> R -> quat failed'
|
2012-02-13 23:11:27 +05:30
|
|
|
case (403_pInt)
|
2010-05-06 19:37:21 +05:30
|
|
|
msg = 'math_check: quat -> euler -> quat failed'
|
2012-02-13 23:11:27 +05:30
|
|
|
case (404_pInt)
|
2010-05-06 19:37:21 +05:30
|
|
|
msg = 'math_check: R -> euler -> R failed'
|
2012-02-13 23:11:27 +05:30
|
|
|
case (405_pInt)
|
|
|
|
msg = 'I_TO_HALTON-error: An input base BASE is <= 1'
|
|
|
|
case (406_pInt)
|
|
|
|
msg = 'Prime-error: N must be between 0 and PRIME_MAX'
|
|
|
|
case (450_pInt)
|
|
|
|
msg = 'unknown symmetry type specified'
|
|
|
|
|
|
|
|
|
|
|
|
!* homogenization errors
|
|
|
|
|
|
|
|
case (500_pInt)
|
|
|
|
msg = 'unknown homogenization specified'
|
|
|
|
|
2010-05-06 19:37:21 +05:30
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
!* DAMASK_marc errors
|
|
|
|
|
2012-02-02 18:49:02 +05:30
|
|
|
case (700_pInt)
|
2012-02-13 23:11:27 +05:30
|
|
|
msg = 'invalid materialpoint result requested'
|
|
|
|
|
|
|
|
|
|
|
|
!* errors related to spectral solver
|
2010-07-13 15:56:07 +05:30
|
|
|
|
2012-02-13 19:38:07 +05:30
|
|
|
case (802_pInt)
|
2012-02-13 23:11:27 +05:30
|
|
|
msg = 'non-positive dimension'
|
|
|
|
case (803_pInt)
|
|
|
|
msg = 'odd resolution given'
|
|
|
|
case (808_pInt)
|
|
|
|
msg = 'precision not suitable for FFTW'
|
|
|
|
case (809_pInt)
|
|
|
|
msg = 'initializing FFTW'
|
|
|
|
case (831_pInt)
|
|
|
|
msg = 'mask consistency violated in spectral loadcase'
|
|
|
|
case (832_pInt)
|
|
|
|
msg = 'ill-defined L (each line should be either fully or not at all defined) in spectral loadcase'
|
|
|
|
case (834_pInt)
|
|
|
|
msg = 'negative time increment in spectral loadcase'
|
|
|
|
case (835_pInt)
|
|
|
|
msg = 'non-positive increments in spectral loadcase'
|
|
|
|
case (836_pInt)
|
|
|
|
msg = 'non-positive result frequency in spectral loadcase'
|
|
|
|
case (837_pInt)
|
|
|
|
msg = 'incomplete loadcase'
|
|
|
|
case (838_pInt)
|
|
|
|
msg = 'mixed boundary conditions allow rotation'
|
|
|
|
case (842_pInt)
|
|
|
|
msg = 'missing header info in spectral mesh'
|
|
|
|
case (843_pInt)
|
|
|
|
msg = 'resolution in spectral mesh'
|
|
|
|
case (844_pInt)
|
|
|
|
msg = 'dimension in spectral mesh'
|
|
|
|
case (845_pInt)
|
|
|
|
msg = 'incomplete information in spectral mesh header'
|
|
|
|
case (846_pInt)
|
|
|
|
msg = 'not a rotation defined for loadcase rotation'
|
|
|
|
case (847_pInt)
|
|
|
|
msg = 'updating of gamma operator not possible if it is pre calculated'
|
|
|
|
case (880_pInt)
|
|
|
|
msg = 'mismatch of microstructure count and a*b*c in geom file'
|
|
|
|
|
|
|
|
|
|
|
|
!* Error messages related to parsing of Abaqus input file
|
2011-02-21 20:07:38 +05:30
|
|
|
|
2012-02-02 18:49:02 +05:30
|
|
|
case (900_pInt)
|
2010-07-13 15:56:07 +05:30
|
|
|
msg = 'PARSE ERROR: Improper definition of nodes in input file (Nnodes < 2)'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (901_pInt)
|
2010-07-13 15:56:07 +05:30
|
|
|
msg = 'PARSE ERROR: No Elements defined in input file (Nelems = 0)'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (902_pInt)
|
2010-07-13 15:56:07 +05:30
|
|
|
msg = 'PARSE ERROR: No Element sets defined in input file (Atleast one *Elset must exist)'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (903_pInt)
|
2010-07-13 15:56:07 +05:30
|
|
|
msg = 'PARSE ERROR: No Materials defined in input file (Look into section assigments)'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (904_pInt)
|
2011-08-02 15:44:16 +05:30
|
|
|
msg = 'PARSE ERROR: No elements could be assigned for Elset: '
|
2012-02-02 18:49:02 +05:30
|
|
|
case (905_pInt)
|
2010-07-13 15:56:07 +05:30
|
|
|
msg = 'PARSE ERROR: Error in mesh_abaqus_map_materials'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (906_pInt)
|
2010-07-13 15:56:07 +05:30
|
|
|
msg = 'PARSE ERROR: Error in mesh_abaqus_count_cpElements'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (907_pInt)
|
2010-07-13 15:56:07 +05:30
|
|
|
msg = 'PARSE ERROR: Incorrect size of mesh_mapFEtoCPelem in mesh_abaqus_map_elements; Size cannot be zero'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (908_pInt)
|
2010-07-13 15:56:07 +05:30
|
|
|
msg = 'PARSE ERROR: Incorrect size of mesh_mapFEtoCPnode in mesh_abaqus_map_nodes; Size cannot be zero'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (909_pInt)
|
2010-07-13 15:56:07 +05:30
|
|
|
msg = 'PARSE ERROR: Incorrect size of mesh_node in mesh_abaqus_build_nodes; must be equal to mesh_Nnodes'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (910_pInt)
|
2011-08-02 15:44:16 +05:30
|
|
|
msg = 'PARSE ERROR: Incorrect element type mapping in '
|
2010-07-13 15:56:07 +05:30
|
|
|
|
|
|
|
|
2012-02-13 23:11:27 +05:30
|
|
|
!* general error messages
|
|
|
|
|
|
|
|
case (666_pInt)
|
|
|
|
msg = 'memory leak detected'
|
2007-03-20 19:25:22 +05:30
|
|
|
case default
|
2009-03-31 14:51:57 +05:30
|
|
|
msg = 'Unknown error number...'
|
2012-02-13 23:11:27 +05:30
|
|
|
|
2007-03-20 19:25:22 +05:30
|
|
|
end select
|
2009-01-20 00:40:58 +05:30
|
|
|
|
2008-05-26 18:41:25 +05:30
|
|
|
!$OMP CRITICAL (write2out)
|
2009-03-31 14:51:57 +05:30
|
|
|
write(6,*)
|
2011-11-02 20:08:42 +05:30
|
|
|
write(6,'(a38)') '+------------------------------------+'
|
|
|
|
write(6,'(a38)') '+ error +'
|
|
|
|
write(6,'(a17,i3,a18)') '+ ',error_ID,' +'
|
|
|
|
write(6,'(a38)') '+ +'
|
|
|
|
write(6,'(a2,a)') '+ ', trim(msg)
|
|
|
|
if (present(ext_msg)) write(6,'(a2,a)') '+ ', trim(ext_msg)
|
2009-03-04 17:18:54 +05:30
|
|
|
if (present(e)) then
|
|
|
|
if (present(i) .and. present(g)) then
|
2011-05-13 22:25:13 +05:30
|
|
|
write(6,'(a13,i6,a4,i2,a7,i4,a2)') '+ at element ',e,' IP ',i,' grain ',g,' +'
|
2009-03-04 17:18:54 +05:30
|
|
|
else
|
2011-05-13 22:25:13 +05:30
|
|
|
write(6,'(a18,i6,a14)') '+ at ',e,' +'
|
2009-03-04 17:18:54 +05:30
|
|
|
endif
|
|
|
|
endif
|
2009-05-28 22:08:40 +05:30
|
|
|
write(6,'(a38)') '+------------------------------------+'
|
2007-03-20 19:25:22 +05:30
|
|
|
call flush(6)
|
2012-02-10 16:54:53 +05:30
|
|
|
call quit(9000_pInt+error_ID)
|
2010-02-18 15:42:45 +05:30
|
|
|
!$OMP END CRITICAL (write2out)
|
2009-01-20 00:40:58 +05:30
|
|
|
|
2007-03-20 19:25:22 +05:30
|
|
|
! ABAQUS returns in some cases
|
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
endsubroutine
|
2007-03-20 19:25:22 +05:30
|
|
|
|
|
|
|
|
2009-03-31 14:51:57 +05:30
|
|
|
!********************************************************************
|
|
|
|
! write warning statements to standard out
|
|
|
|
!********************************************************************
|
2011-11-02 20:08:42 +05:30
|
|
|
subroutine IO_warning(warning_ID,e,i,g,ext_msg)
|
2009-03-31 14:51:57 +05:30
|
|
|
|
|
|
|
use prec, only: pInt
|
|
|
|
implicit none
|
|
|
|
|
2011-11-02 20:08:42 +05:30
|
|
|
integer(pInt), intent(in) :: warning_ID
|
2009-03-31 14:51:57 +05:30
|
|
|
integer(pInt), optional, intent(in) :: e,i,g
|
|
|
|
character(len=*), optional, intent(in) :: ext_msg
|
2011-11-02 20:08:42 +05:30
|
|
|
character(len=1024) msg
|
2009-03-31 14:51:57 +05:30
|
|
|
|
2011-11-02 20:08:42 +05:30
|
|
|
select case (warning_ID)
|
2012-02-02 18:49:02 +05:30
|
|
|
case (34_pInt)
|
2011-12-06 22:28:17 +05:30
|
|
|
msg = 'invalid restart increment given'
|
2012-02-02 18:49:02 +05:30
|
|
|
case (35_pInt)
|
2012-01-30 19:22:41 +05:30
|
|
|
msg = 'could not get $DAMASK_NUM_THREADS'
|
2011-11-15 23:24:18 +05:30
|
|
|
case (47_pInt)
|
|
|
|
msg = 'No valid parameter for FFTW given, using FFTW_PATIENT'
|
2011-11-02 20:08:42 +05:30
|
|
|
case (101_pInt)
|
2010-11-03 20:28:11 +05:30
|
|
|
msg = '+ crystallite debugging off... +'
|
2011-11-02 20:08:42 +05:30
|
|
|
case (600_pInt)
|
2010-11-03 20:28:11 +05:30
|
|
|
msg = '+ crystallite responds elastically +'
|
2011-11-02 20:08:42 +05:30
|
|
|
case (601_pInt)
|
2010-11-04 23:48:01 +05:30
|
|
|
msg = '+ stiffness close to zero +'
|
2011-11-02 20:08:42 +05:30
|
|
|
case (650_pInt)
|
2010-11-03 20:28:11 +05:30
|
|
|
msg = '+ polar decomposition failed +'
|
2011-11-02 20:08:42 +05:30
|
|
|
case (700_pInt)
|
2009-12-15 13:50:31 +05:30
|
|
|
msg = '+ unknown crystal symmetry +'
|
2009-03-31 14:51:57 +05:30
|
|
|
case default
|
2010-11-03 20:28:11 +05:30
|
|
|
msg = '+ unknown warning number... +'
|
2009-03-31 14:51:57 +05:30
|
|
|
end select
|
|
|
|
|
|
|
|
!$OMP CRITICAL (write2out)
|
|
|
|
write(6,*)
|
2011-11-02 20:08:42 +05:30
|
|
|
write(6,'(a38)') '+------------------------------------+'
|
|
|
|
write(6,'(a38)') '+ warning +'
|
|
|
|
write(6,'(a38)') '+ +'
|
|
|
|
write(6,'(a17,i3,a18)') '+ ',warning_ID,' +'
|
|
|
|
write(6,'(a2,a)') '+ ', trim(msg)
|
|
|
|
if (present(ext_msg)) write(6,'(a2,a)') '+ ', trim(ext_msg)
|
2009-03-31 14:51:57 +05:30
|
|
|
if (present(e)) then
|
2010-11-04 23:48:01 +05:30
|
|
|
if (present(i)) then
|
|
|
|
if (present(g)) then
|
2012-02-01 00:48:55 +05:30
|
|
|
write(6,'(a12,1x,i6,1x,a2,1x,i2,1x,a5,1x,i4,a2)') '+ at element',e,'IP',i,'grain',g,' +'
|
2010-11-04 23:48:01 +05:30
|
|
|
else
|
2012-02-01 00:48:55 +05:30
|
|
|
write(6,'(a12,1x,i6,1x,a2,1x,i2,a13)') '+ at element',e,'IP',i,' +'
|
2010-11-04 23:48:01 +05:30
|
|
|
endif
|
2009-03-31 14:51:57 +05:30
|
|
|
else
|
2012-02-01 00:48:55 +05:30
|
|
|
write(6,'(a12,1x,i6,a19)') '+ at element',e,' +'
|
2009-03-31 14:51:57 +05:30
|
|
|
endif
|
|
|
|
endif
|
2009-05-28 22:08:40 +05:30
|
|
|
write(6,'(a38)') '+------------------------------------+'
|
constitutive_nonlocal:
- read in activation energy for dislocation glide from material.config
- changed naming of dDipMin/Max to dLower/dUpper
- added new outputs: rho_dot, rho_dot_dip, rho_dot_gen, rho_dot_sgl2dip, rho_dot_dip2sgl, rho_dot_ann_ath, rho_dot_ann_the, rho_dot_flux, d_upper_edge, d_upper_screw, d_upper_dot_edge, d_upper_dot_screw
- poisson's ratio is now calculated from elastic constants
- microstrucutre has state as first argument, since this is our output variable
- periodic boundary conditions are taken into account for fluxes and internal stresses. for the moment, flag has to be set in constitutive_nonlocal.
- corrected calculation for dipole formation by glide
- added terms for dipole formation/annihilation by stress decrease/increase
constitutive:
- passing of arguments is adapted for constitutive_nonlocal model
crystallite:
- in stiffness calculation: call to collect_dotState used wrong arguments
- crystallite_postResults uses own Tstar_v and temperature, no need for passing them from materialpoint_postResults
homogenization:
- crystallite_postResults uses own Tstar_v and temperature, no need for passing them from materialpoint_postResults
IO:
- changed error message 229
material.config:
- changed example for nonlocal constitution according to constitutive_nonlocal
all:
- added some flush statements
2009-10-20 20:06:03 +05:30
|
|
|
call flush(6)
|
2010-04-06 12:17:15 +05:30
|
|
|
!$OMP END CRITICAL (write2out)
|
2009-03-31 14:51:57 +05:30
|
|
|
|
2009-06-15 18:41:21 +05:30
|
|
|
endsubroutine
|
2009-03-31 14:51:57 +05:30
|
|
|
|
2007-03-20 19:25:22 +05:30
|
|
|
END MODULE IO
|