improved version of general I/O functions

renamed module cpfem_interface to mpie_interface
This commit is contained in:
Franz Roters 2010-05-11 06:57:15 +00:00
parent e810e5cfa1
commit 483584ceb3
6 changed files with 49 additions and 72 deletions

View File

@ -130,7 +130,7 @@ subroutine CPFEM_general(mode, ffn, ffn1, Temperature, dt, element, IP, cauchySt
materialpoint_stressAndItsTangent, &
materialpoint_postResults
use IO, only: IO_init
use cpfem_interface
use mpie_interface
implicit none

View File

@ -47,14 +47,14 @@ endsubroutine
logical function IO_open_file(unit,relPath)
use prec, only: pInt
use cpfem_interface
use mpie_interface
implicit none
character(len=*), parameter :: pathSep = achar(47)//achar(92) ! /, \
character(len=*) relPath
integer(pInt) unit
open(unit,status='old',err=100,file=trim(getWorkingDirectoryName())//relPath)
open(unit,status='old',err=100,file=trim(getSolverWorkingDirectoryName())//relPath)
IO_open_file = .true.
return
100 IO_open_file = .false.
@ -68,13 +68,14 @@ endsubroutine
!********************************************************************
logical function IO_open_inputFile(unit)
use cpfem_interface
use prec, only: pReal, pInt
use mpie_interface
implicit none
integer(pInt), intent(in) :: unit
open(unit,status='old',err=100,file=getInputFileName())
open(unit,status='old',err=100,file=trim(getSolverWorkingDirectoryName())//&
trim(getSolverJobName())//InputFileExtension)
IO_open_inputFile = .true.
return
100 IO_open_inputFile = .false.
@ -90,13 +91,14 @@ endsubroutine
logical function IO_open_jobFile(unit,newExt)
use prec, only: pReal, pInt
use cpfem_interface
use mpie_interface
implicit none
integer(pInt), intent(in) :: unit
character(*), intent(in) :: newExt
open(unit,status='replace',err=100,file=trim(getFullJobName())//'.'//newExt)
open(unit,status='replace',err=100,file=trim(getSolverWorkingDirectoryName())//&
trim(getSolverJobName())//'.'//newExt)
IO_open_jobFile = .true.
return
100 IO_open_jobFile = .false.
@ -765,7 +767,7 @@ endfunction
!********************************************************************
function IO_countContinousIntValues (unit)
use cpfem_interface
use mpie_interface
use prec, only: pReal,pInt
implicit none
@ -823,7 +825,7 @@ endfunction
!********************************************************************
function IO_continousIntValues (unit,maxN,lookupName,lookupMap,lookupMaxN)
use cpfem_interface
use mpie_interface
use prec, only: pReal,pInt
implicit none

View File

@ -211,7 +211,7 @@
!***********************************************************
subroutine mesh_init (ip,element)
use cpfem_interface
use mpie_interface
use prec, only: pInt
use IO, only: IO_error,IO_open_InputFile
use FEsolving, only: parallelExecution, FEsolving_execElem, FEsolving_execIP, calcMode, lastMode

View File

@ -17,9 +17,10 @@
include "prec.f90" ! uses nothing else
MODULE cpfem_interface
MODULE mpie_interface
character(len=64), parameter :: FEsolver = 'Abaqus'
character(len=4), parameter :: InputFileExtension = '.inp'
CONTAINS
@ -31,37 +32,27 @@ subroutine mpie_cpfem_init
return
end subroutine
function getWorkingDirectoryName
function getSolverWorkingDirectoryName
use prec
implicit none
character(1024) getWorkingDirectoryName
character(1024) getSolverWorkingDirectoryName
integer(pInt) LENOUTDIR
getWorkingDirectoryName=''
CALL VGETOUTDIR( getWorkingDirectoryName, LENOUTDIR )
! write(6,*) 'getWorkingDirectoryName', getWorkingDirectoryName
getSolverWorkingDirectoryName=''
CALL VGETOUTDIR( getSolverWorkingDirectoryName, LENOUTDIR )
! write(6,*) 'getSolverWorkingDirectoryName', getSolverWorkingDirectoryName
end function
function getFullJobName
function getSolverJobName
use prec
implicit none
character(1024) getFullJobName, JOBNAME
character(1024) getSolverJobName, JOBNAME
integer(pInt) LENJOBNAME
getFullJobName=''
CALL VGETJOBNAME(JOBNAME , LENJOBNAME )
getFullJobName=trim(getWorkingDirectoryName())//trim(JOBNAME)
! write(6,*) 'getFullJobName', getFullJobName
end function
function getInputFileName
implicit none
character(1024) getInputFileName
getInputFileName=''
getInputFileName=trim(getFullJobName())//'.inp'
! write(6,*) 'getInputFileName', getInputFileName
getSolverJobName=''
CALL VGETJOBNAME(getSolverJobName , LENJOBNAME )
! write(6,*) 'getSolverJobName', getSolverJobName
end function
END MODULE

View File

@ -17,9 +17,10 @@
include "prec.f90" ! uses nothing else
MODULE cpfem_interface
MODULE mpie_interface
character(len=64), parameter :: FEsolver = 'Abaqus'
character(len=4), parameter :: InputFileExtension = '.inp'
CONTAINS
@ -31,37 +32,27 @@ subroutine mpie_cpfem_init
return
end subroutine
function getWorkingDirectoryName
function getSolverWorkingDirectoryName
use prec
implicit none
character(1024) getWorkingDirectoryName
character(1024) getSolverWorkingDirectoryName
integer(pInt) LENOUTDIR
getWorkingDirectoryName=''
CALL GETOUTDIR( getWorkingDirectoryName, LENOUTDIR )
! write(6,*) 'getWorkingDirectoryName', getWorkingDirectoryName
getSolverWorkingDirectoryName=''
CALL GETOUTDIR( getSolverWorkingDirectoryName, LENOUTDIR )
! write(6,*) 'getSolverWorkingDirectoryName', getSolverWorkingDirectoryName
end function
function getFullJobName
function getSolverJobName
use prec
implicit none
character(1024) getFullJobName, JOBNAME
character(1024) getSolverJobName, JOBNAME
integer(pInt) LENJOBNAME
getFullJobName=''
CALL GETJOBNAME(JOBNAME , LENJOBNAME )
getFullJobName=trim(getWorkingDirectoryName())//trim(JOBNAME)
! write(6,*) 'getFullJobName', getFullJobName
end function
function getInputFileName
implicit none
character(1024) getInputFileName
getInputFileName=''
getInputFileName=trim(getFullJobName())//'.inp'
! write(6,*) 'getInputFileName', getInputFileName
getSolverJobName=''
CALL GETJOBNAME(getSolverJobName , LENJOBNAME )
! write(6,*) 'getSolverJobName', getSolverJobName
end function
END MODULE

View File

@ -39,9 +39,10 @@
include "prec.f90" ! uses nothing else
MODULE cpfem_interface
MODULE mpie_interface
character(len=64), parameter :: FEsolver = 'Marc'
character(len=4), parameter :: InputFileExtension = '.dat'
CONTAINS
@ -53,40 +54,32 @@ subroutine mpie_cpfem_init
return
end subroutine
function getWorkingDirectoryName
function getSolverWorkingDirectoryName
implicit none
character(1024) getWorkingDirectoryName, outName
character(1024) getSolverWorkingDirectoryName, outName
character(len=*), parameter :: pathSep = achar(47)//achar(92) ! /, \
getWorkingDirectoryName=''
getSolverWorkingDirectoryName=''
outName=''
inquire(6, name=outName) ! determine outputfile
getWorkingDirectoryName=outName(1:scan(outName,pathSep,back=.true.))
! write(6,*) 'getWorkingDirectoryName', getWorkingDirectoryName
getSolverWorkingDirectoryName=outName(1:scan(outName,pathSep,back=.true.))
! write(6,*) 'getSolverWorkingDirectoryName', getSolverWorkingDirectoryName
end function
function getFullJobName
function getSolverJobName
use prec
implicit none
character(1024) getFullJobName, outName
character(1024) getSolverJobName, outName
character(len=*), parameter :: pathSep = achar(47)//achar(92) ! /, \
integer(pInt) extPos
getFullJobName=''
getSolverJobName=''
outName=''
inquire(6, name=outName) ! determine outputfile
extPos = len_trim(outName)-4
getFullJobName=outName(1:extPos)
! write(6,*) 'getFullJobName', getFullJobName
end function
function getInputFileName
implicit none
character(1024) getInputFileName
getInputFileName=''
getInputFileName=trim(getFullJobName())//'.dat'
! write(6,*) 'getInputFileName', getInputFileName
getSolverJobName=outName(scan(outName,pathSep,back=.true.)+1:extPos)
! write(6,*) 'getSolverJobName', getSolverJobName
end function
END MODULE