Skip to content

Commit

Permalink
adds verbosity toggle to DIC program
Browse files Browse the repository at this point in the history
  • Loading branch information
marcdegraef committed Dec 22, 2024
1 parent 9327a3d commit 5c71bec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions NamelistTemplates/EMHREBSDDIC.template
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
mindeltap = 0.001D0,
! number of threads (default = 1)
nthreads = 1,
verbose = .FALSE.,
!
! name of experimental pattern file; path relative to EMdatapathname
! for this program, this should be a preprocessed data file (EMppEBSD output)
Expand Down
19 changes: 13 additions & 6 deletions Source/EMsoftOOLib/program_mods/mod_HREBSDDIC.f90
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ module mod_HREBSDDIC
character(fnlen) :: ppEBSDnml
character(fnlen) :: DInml
character(3) :: crystal
logical :: verbose
end type HREBSDDICNameListType

! class definition
Expand Down Expand Up @@ -183,8 +184,9 @@ subroutine readNameList_(self, nmlfile, initonly)
character(fnlen) :: ppEBSDnml
character(fnlen) :: DInml
character(3) :: crystal
logical :: verbose

namelist / HREBSDDICdata / patx, paty, nthreads, C11, C12, C44, C13, C33, DIfile, DInml, mindeltap, &
namelist / HREBSDDICdata / patx, paty, nthreads, C11, C12, C44, C13, C33, DIfile, DInml, mindeltap, verbose, &
datafile, patternfile, DIfile, ppEBSDnml, crystal, nbx, nby, maxnumit

patx = 0
Expand All @@ -205,6 +207,7 @@ subroutine readNameList_(self, nmlfile, initonly)
ppEBSDnml = 'undefined'
DInml = 'undefined'
crystal = 'cub'
verbose = .FALSE.

if (present(initonly)) then
if (initonly) skipread = .TRUE.
Expand Down Expand Up @@ -257,6 +260,7 @@ subroutine readNameList_(self, nmlfile, initonly)
self%nml%ppEBSDnml = ppEBSDnml
self%nml%DInml = DInml
self%nml%crystal = crystal
self%nml%verbose = verbose

end subroutine readNameList_

Expand Down Expand Up @@ -299,26 +303,30 @@ recursive subroutine writeHDFNameList_(self, HDF, HDFnames)
type(HDF_T), INTENT(INOUT) :: HDF
type(HDFnames_T), INTENT(INOUT) :: HDFnames

integer(kind=irg),parameter :: n_int = 6, n_real = 6
integer(kind=irg) :: hdferr, io_int(n_int)
integer(kind=irg),parameter :: n_int = 7, n_real = 6
integer(kind=irg) :: hdferr, io_int(n_int), vb
real(kind=sgl) :: io_real(n_real)
character(20) :: intlist(n_int), reallist(n_real)
character(fnlen) :: dataset, sval(1),groupname
character(fnlen,kind=c_char) :: line2(1),line10(10)

associate( enl => self%nml )

vb = 0
if (self%nml%verbose.eqv..TRUE.) vb = 1

! create the group for this namelist
hdferr = HDF%createGroup(HDFnames%get_NMLlist())

! write all the single integers
io_int = (/ enl%nthreads, enl%patx, enl%paty, enl%nbx, enl%nby, enl%maxnumit /)
io_int = (/ enl%nthreads, enl%patx, enl%paty, enl%nbx, enl%nby, enl%maxnumit, vb /)
intlist(1) = 'nthreads'
intlist(2) = 'patx'
intlist(3) = 'paty'
intlist(4) = 'nbx'
intlist(5) = 'nby'
intlist(6) = 'maxnumit'
intlist(7) = 'verbose'
call HDF%writeNMLintegers(io_int, intlist, n_int)

! write all the single reals
Expand Down Expand Up @@ -547,8 +555,7 @@ subroutine HREBSD_DIC_(self, EMsoft, progname, HDFnames)

!copy the exptpattern into the thread's DIC class
DIC = DIC_T( binx, biny )
! call DIC%setverbose( .FALSE. )
call DIC%setverbose( .TRUE. )
call DIC%setverbose( enl%verbose )
call DIC%setpattern( 'r', dble(exptpattern) )

! define the border widths nbx and nby for the subregion
Expand Down

0 comments on commit 5c71bec

Please sign in to comment.