From 5c71bec57d8390f28278caef17f584304aa7bcef Mon Sep 17 00:00:00 2001 From: Marc DeGraef Date: Sun, 22 Dec 2024 11:51:18 -0500 Subject: [PATCH] adds verbosity toggle to DIC program --- NamelistTemplates/EMHREBSDDIC.template | 1 + .../program_mods/mod_HREBSDDIC.f90 | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/NamelistTemplates/EMHREBSDDIC.template b/NamelistTemplates/EMHREBSDDIC.template index c94cdd8..bdfa209 100644 --- a/NamelistTemplates/EMHREBSDDIC.template +++ b/NamelistTemplates/EMHREBSDDIC.template @@ -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) diff --git a/Source/EMsoftOOLib/program_mods/mod_HREBSDDIC.f90 b/Source/EMsoftOOLib/program_mods/mod_HREBSDDIC.f90 index 9c0d26b..34fc6f9 100644 --- a/Source/EMsoftOOLib/program_mods/mod_HREBSDDIC.f90 +++ b/Source/EMsoftOOLib/program_mods/mod_HREBSDDIC.f90 @@ -61,6 +61,7 @@ module mod_HREBSDDIC character(fnlen) :: ppEBSDnml character(fnlen) :: DInml character(3) :: crystal + logical :: verbose end type HREBSDDICNameListType ! class definition @@ -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 @@ -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. @@ -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_ @@ -299,8 +303,8 @@ 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 @@ -308,17 +312,21 @@ recursive subroutine writeHDFNameList_(self, HDF, HDFnames) 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 @@ -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