From decf9371ea3a92c1297e9730b27b29275bee0362 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 26 Jan 2020 13:18:29 +0100 Subject: [PATCH] avoid issues with unsufficient length of strings --- src/DAMASK_interface.f90 | 10 ++++++---- src/numerics.f90 | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/DAMASK_interface.f90 b/src/DAMASK_interface.f90 index af56a5a77..dbe6ecd6b 100644 --- a/src/DAMASK_interface.f90 +++ b/src/DAMASK_interface.f90 @@ -86,12 +86,14 @@ subroutine DAMASK_interface_init =================================================================================================== #endif - character(len=1024) :: & - commandLine, & !< command line call as string + character(len=pPathLen*3+pStringLen) :: & + commandLine !< command line call as string + character(len=pPathLen) :: & arg, & !< individual argument loadCaseArg = '', & !< -l argument given to the executable geometryArg = '', & !< -g argument given to the executable - workingDirArg = '', & !< -w argument given to the executable + workingDirArg = '' !< -w argument given to the executable + character(len=pStringLen) :: & userName !< name of user calling the executable integer :: & stat, & @@ -295,7 +297,7 @@ end subroutine DAMASK_interface_init subroutine setWorkingDirectory(workingDirectoryArg) character(len=*), intent(in) :: workingDirectoryArg !< working directory argument - character(len=1024) :: workingDirectory !< working directory argument + character(len=pPathLen) :: workingDirectory logical :: error external :: quit diff --git a/src/numerics.f90 b/src/numerics.f90 index c35bfae11..61297ff6f 100644 --- a/src/numerics.f90 +++ b/src/numerics.f90 @@ -89,7 +89,7 @@ module numerics structOrder = 2 !< order of displacement shape functions logical, protected, public :: & BBarStabilisation = .false. - character(len=4096), protected, public :: & + character(len=*), parameter, public :: & petsc_defaultOptions = '-mech_snes_type newtonls & &-mech_snes_linesearch_type cp & &-mech_snes_ksp_ew & @@ -100,7 +100,8 @@ module numerics &-mech_pc_type ml & &-mech_mg_levels_ksp_type chebyshev & &-mech_mg_levels_pc_type sor & - &-mech_pc_ml_nullspace user ',& + &-mech_pc_ml_nullspace user' + character(len=pStringLen), protected, public :: & petsc_options = '' #endif