diff --git a/src/gray_core.f90 b/src/gray_core.f90 index a3d0880..7103f14 100644 --- a/src/gray_core.f90 +++ b/src/gray_core.f90 @@ -82,8 +82,6 @@ contains logical, dimension(:), pointer :: iwait=>null() logical, dimension(:,:), pointer :: iroff=>null() - ! parameters log in file headers - character(len=headw), dimension(headl) :: strheader ! buffer for formatting log messages character(256) :: msg @@ -131,8 +129,7 @@ contains ! ========= set environment END ========= ! ======== pre-proc prints BEGIN ======== - call print_parameters(params, strheader) - call print_headers(strheader) + call print_headers(params) ! print ψ surface for q=1.5 and q=2 on file and log psi,rhot,rhop call print_surfq([1.5_wp_, 2.0_wp_]) @@ -1890,21 +1887,23 @@ bb: do - subroutine print_headers(strheader) + subroutine print_headers(params) ! Prints the headers of all gray_main output tables - use units, only : uprj0, uwbm, udisp, ucenr, uoutr, upec, usumm, & - unit_active + use units, only : uprj0, uwbm, udisp, ucenr, uoutr, upec, usumm, & + unit_active, active_units + use gray_params, only : gray_parameters, headw, headl, print_parameters implicit none ! subroutine arguments - character(len=*), dimension(:), intent(in) :: strheader + type(gray_parameters), intent(in) :: params ! local variables integer :: i, j integer :: main_units(8) character(256) :: main_headers(8) + character(len=headw), dimension(headl) :: header main_units = [uprj0, uprj0+1, uwbm, udisp, ucenr, uoutr, upec, usumm] @@ -1922,10 +1921,14 @@ bb: do // 'chipol index_rt Jphimx dPdVmx drhotj drhotp P0 ' & // 'cplO cplX' + if (all(active_units == 0)) return + + call print_parameters(params, header) + do i=1,size(main_units) if (unit_active(main_units(i))) then - do j=1,size(strheader) - write (main_units(i), '(1x,a)') strheader(j) + do j=1,size(header) + write (main_units(i), '(1x,a)') header(j) end do write (main_units(i), '(1x,a)') trim(main_headers(i)) end if diff --git a/src/main.f90 b/src/main.f90 index 50b97bf..65829be 100644 --- a/src/main.f90 +++ b/src/main.f90 @@ -443,12 +443,7 @@ contains ! ======= set environment END ====== ! ======== pre-proc prints BEGIN ======== - block - ! Parameters log in file headers - character(len=headw), dimension(headl) :: strheader - call print_parameters(params, strheader) - call print_headers(strheader) - end block + call print_headers(params) ! Print ψ surface for q=1.5 and q=2 on file and psi,rhot,rhop on stdout call print_surfq([1.5_wp_, 2.0_wp_])