Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/adjust_data.f90
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,11 @@ subroutine adjust_data_codeunits
dat(:,1,1) = dat(:,1,1) - period*int(dat(:,1,1)/period)
endif

get_h = lenvironment('SPLASH_GETH')
if (.not.get_h) get_h = lenvironment('SPLASH_GET_H')
!
!--recompute smoothing lengths (--geth / --get_h)
!
get_h = get_command_flag('geth')
if (.not.get_h) get_h = get_command_flag('get_h')
if (ndim >= 1 .and. get_h) then
call get_h_on_all_particles(dat,npartoftype,nstepsinfile(ifileopen),ndim,ncolumns)
endif
Expand Down Expand Up @@ -619,4 +622,4 @@ subroutine get_h_on_all_particles(dat,npartoftype,nsteps,ndim,ncol)

end subroutine get_h_on_all_particles

end module adjustdata
end module adjustdata
4 changes: 2 additions & 2 deletions src/allocate.f90
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ subroutine alloc(npartin,nstep,ncolumnsin,mixedtypes)
npartoftype(:,1:maxstepold) = npartoftypetemp(:,1:maxstepold)
masstype(:,1:maxstepold) = masstypetemp(:,1:maxstepold)
time(1:maxstepold) = timetemp(1:maxstepold)
gamma(1:maxstepold) = gammatemp(1:maxstepold)
headervals(:,1:maxstepold) = headervalstemp(:,1:maxstepold)
if (allocated(gammatemp)) gamma(1:maxstepold) = gammatemp(1:maxstepold)
if (allocated(headervalstemp)) headervals(:,1:maxstepold) = headervalstemp(:,1:maxstepold)
deallocate(npartoftypetemp,masstypetemp)
deallocate(timetemp,gammatemp)
deallocate(headervalstemp)
Expand Down
22 changes: 13 additions & 9 deletions src/defaults.f90
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ subroutine defaults_set(use_evdefaults)
use settings_xsecrot, only:defaults_set_xsecrotate
use settings_powerspec, only:defaults_set_powerspec
use settings_units, only:defaults_set_units
use settings_data, only:iverbose
use titles, only:pagetitles,steplegend
logical, intent(in) :: use_evdefaults
integer :: i
integer :: i,iverbose_save
!
!--set defaults for submenu options
!
iverbose_save = iverbose
call defaults_set_data
call defaults_set_limits
call defaults_set_page
Expand All @@ -66,7 +68,7 @@ subroutine defaults_set(use_evdefaults)
!--if using evsplash, override some default options
!
if (use_evdefaults) then
print "(a)",' ** ev mode: using default settings for .ev files **'
if (iverbose_save >= 0) print "(a)",' ** ev mode: using default settings for .ev files **'
call defaults_set_page_ev
call defaults_set_part_ev
endif
Expand Down Expand Up @@ -170,7 +172,7 @@ end subroutine defaults_write
subroutine defaults_read(filename)
use filenames, only:rootname,maxfile
use multiplot, only:multi
use settings_data, only:dataopts,idustfrac_plot,idefaults_file_read
use settings_data, only:dataopts,idustfrac_plot,idefaults_file_read,iverbose
use settings_part, only:plotopts
use settings_page, only:pageopts
use settings_render, only:renderopts
Expand Down Expand Up @@ -251,19 +253,21 @@ subroutine defaults_read(filename)
66 continue

close(unit=iunit)
if (nerr > 0) then
print "(a)",' WARNING: '//trim(filename)//' incomplete (from old code version)'
else
print*,'read '//trim(filename)
if (iverbose >= 0) then
if (nerr > 0) then
print "(a)",' WARNING: '//trim(filename)//' incomplete (from old code version)'
else
print*,'read '//trim(filename)
endif
endif
return
else
print*,trim(filename)//' not found: using default settings'
if (iverbose >= 0) print*,trim(filename)//' not found: using default settings'
return
endif

88 continue
print "(a)",' *** error opening defaults file '//trim(filename)//': using default settings'
if (iverbose >= 0) print "(a)",' *** error opening defaults file '//trim(filename)//': using default settings'

return
end subroutine defaults_read
Expand Down
25 changes: 14 additions & 11 deletions src/get_data.f90
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ subroutine get_data(ireadfile,gotfilenames,firsttime,iposinfile)
if (present(firsttime)) isfirsttime = firsttime
if (debugmode) then
iverbose = 2
elseif (isfirsttime) then
iverbose = 1
else
iverbose = 0
elseif (iverbose >= 0) then
if (isfirsttime) then
iverbose = 1
else
iverbose = 0
endif
endif

! ipos is the offset for *which* timestep to read from files containing multiple steps
Expand Down Expand Up @@ -122,7 +124,7 @@ subroutine get_data(ireadfile,gotfilenames,firsttime,iposinfile)
!
nstepsinfile(1:nfiles) = 0
required = .true.
print "(/a)",' reading ALL dumpfiles into memory'
if (iverbose >= 0) print "(/a)",' reading ALL dumpfiles into memory'
!call endian_info()

do i=1,nfiles
Expand All @@ -132,7 +134,7 @@ subroutine get_data(ireadfile,gotfilenames,firsttime,iposinfile)
if (nstepsinfile(i) > 0 .and. ncolumnsfirst==0 .and. ncolumns > 0) then
ncolumnsfirst = ncolumns
elseif (nstepsinfile(i) > 0 .and. ncolumns /= ncolumnsfirst) then
print "(a,i2,a,i2,a)",' WARNING: file contains ',ncolumns, &
if (iverbose >= 0) print "(a,i2,a,i2,a)",' WARNING: file contains ',ncolumns, &
' columns (',ncolumnsfirst,' previously)'
ncolumns = max(ncolumns,ncolumnsfirst)
endif
Expand All @@ -144,7 +146,7 @@ subroutine get_data(ireadfile,gotfilenames,firsttime,iposinfile)
else
ncolumns = 0
endif
print "(a,i6,a,i3)",' >> Finished data read, nsteps = ',nsteps,' ncolumns = ',ncolumns
if (iverbose >= 0) print "(a,i6,a,i3)",' >> Finished data read, nsteps = ',nsteps,' ncolumns = ',ncolumns

!
!--set labels (and units) for each column of data
Expand Down Expand Up @@ -204,7 +206,7 @@ subroutine get_data(ireadfile,gotfilenames,firsttime,iposinfile)
! print "(a)",' trying different endian'
! call read_data_otherendian(rootname(ireadfile),istart,nstepsinfile(ireadfile))
!endif
if (dotiming) then
if (dotiming .and. iverbose >= 0) then
call wall_time(t2)
if (t2-t1 > 1.) then
if (ipartialread) then
Expand Down Expand Up @@ -319,7 +321,7 @@ subroutine get_labels
use asciiutils, only:read_asciifile
use filenames, only:fileprefix
use labels, only:label
use settings_data, only:ncolumns
use settings_data, only:ncolumns,iverbose
use particle_data, only:maxcol
use params, only:maxplot
use readdata, only:set_labels
Expand All @@ -339,7 +341,7 @@ subroutine get_labels
nlabelsread = 0
if (iexist) then
call read_asciifile(trim(fileprefix)//'.columns',nlabelsread,label(1:min(ncolumns,maxcol,maxplot)))
if (nlabelsread < ncolumns) &
if (nlabelsread < ncolumns .and. iverbose >= 0) &
print "(a,i3)",' end of file in '//trim(fileprefix)//'.columns file: labels read to column ',nlabelsread
endif

Expand Down Expand Up @@ -382,7 +384,8 @@ subroutine rescale_data(firsttime,nsteps_read)
if (firsttime) call read_unitsfile(trim(unitsfile),ncolumns,ierr,iverbose)

if (firsttime) then
labelorig = ''
! save bare column labels before units are appended
labelorig = label
labelreq = ''
endif

Expand Down
8 changes: 4 additions & 4 deletions src/interpolate3D.f90
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ subroutine interpolate3D(x,y,z,hh,weight,dat,itype,npart,&
!$omp private(pixint,wint,negflag,dfac,threadid) &
!$omp firstprivate(iprintnext) &
!$omp reduction(+:nwarn,usedpart)
!$omp master
!$omp masked
!$ print "(1x,a,i3,a)",'Using ',omp_get_num_threads(),' cpus'
!$omp end master
!$omp end masked

!$omp do schedule (guided, 2)
over_parts: do i=1,npart
Expand Down Expand Up @@ -471,9 +471,9 @@ subroutine interpolate3D_vec(x,y,z,hh,weight,datvec,itype,npart,&
!$omp private(ipix,jpix,kpix,ipixi,jpixi,kpixi) &
!$omp private(dx2i,nxpix,zpix,dz,dz2,dyz2,dy,ypix,q2,wab) &
!$omp reduction(+:nwarn)
!$omp master
!$omp masked
!$ print "(1x,a,i3,a)",'Using ',omp_get_num_threads(),' cpus'
!$omp end master
!$omp end masked
!
!--loop over particles
!
Expand Down
8 changes: 4 additions & 4 deletions src/interpolate3D_geom.f90
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ subroutine interpolate3Dgeom(igeom,x,y,z,hh,weight,dat,itype,npart,&
!$omp private(dx,q2,wab,isub,jsub,ksub,nsubpix,dsubpix) &
!$omp reduction(+:nsub,meansubpix,ncount) &
!$omp reduction(max:maxsubpix)
!$omp master
!$omp masked
!$ print "(1x,a,i3,a)",'Using ',omp_get_num_threads(),' cpus'
!$omp end master
!$omp end masked

!$omp do schedule (guided, 2)
over_parts: do i=1,npart
Expand Down Expand Up @@ -354,9 +354,9 @@ subroutine interpolate3Dgeom_vec(igeom,x,y,z,hh,weight,datvec,itype,npart,&
!$omp private(dx,q2,wab,isub,jsub,ksub,nsubpix,dsubpix) &
!$omp reduction(+:nsub,meansubpix,ncount) &
!$omp reduction(max:maxsubpix)
!$omp master
!$omp masked
!$ print "(1x,a,i3,a)",'Using ',omp_get_num_threads(),' cpus'
!$omp end master
!$omp end masked

!$omp do schedule (guided, 2)
over_parts: do i=1,npart
Expand Down
4 changes: 2 additions & 2 deletions src/interpolate3D_proj_geom.f90
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ subroutine interpolate3D_proj_geom(x,y,z,hh,weight,dat,itype,npart, &
endif
ncpus = 0
!$omp parallel
!$omp master
!$omp masked
!$ ncpus = omp_get_num_threads()
!$omp end master
!$omp end masked
!$omp end parallel

if (ncpus > 0) then
Expand Down
4 changes: 2 additions & 2 deletions src/interpolate3D_projection.f90
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ subroutine interpolate3D_projection(x,y,z,hh,weight,dat,itype,npart, &

ncpus = 0
!$omp parallel
!$omp master
!$omp masked
!$ ncpus = omp_get_num_threads()
!$omp end master
!$omp end masked
!$omp end parallel

if (ncpus > 0 .and. iverbose >= 0) then
Expand Down
18 changes: 14 additions & 4 deletions src/kernels.f90
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,17 @@ end function k_func
! cnormk values and pointer to kernel function
!
!--------------------------------------
subroutine select_kernel(j)
subroutine select_kernel(j,verbose)
integer, intent(in) :: j
logical, intent(in), optional :: verbose
logical :: isverbose

isverbose = .true.
if (present(verbose)) isverbose = verbose

if (j >= 1 .and. j <= nkernels) then
!--print only if NOT using the default kernel
print "(a,/)",' Using '//trim(kernelname(j))//' kernel'
if (isverbose) print "(a,/)",' Using '//trim(kernelname(j))//' kernel'
endif

select case(j)
Expand Down Expand Up @@ -135,10 +140,15 @@ end subroutine select_kernel
! Kernel selection based on string
!
!--------------------------------------
subroutine select_kernel_by_name(string)
subroutine select_kernel_by_name(string,verbose)
use asciiutils, only:lcase
character(len=*), intent(in) :: string
logical, intent(in), optional :: verbose
integer :: i,jkern
logical :: isverbose

isverbose = .true.
if (present(verbose)) isverbose = verbose

jkern = 0
!
Expand Down Expand Up @@ -169,7 +179,7 @@ subroutine select_kernel_by_name(string)
end select
endif

call select_kernel(jkern)
call select_kernel(jkern,verbose=isverbose)

end subroutine select_kernel_by_name

Expand Down
54 changes: 54 additions & 0 deletions src/labels.f90
Original file line number Diff line number Diff line change
Expand Up @@ -682,4 +682,58 @@ subroutine set_vector_labels(ncolumns,ndimV,iamveci,labelveci,labeli,labelcoordi

end subroutine set_vector_labels

!-----------------------------------------------------------------
!
! print dump file header tags and values
!
!-----------------------------------------------------------------
subroutine print_headers(headervals1)
real, intent(in) :: headervals1(:)
integer :: i,nhdr

nhdr = min(count_non_blank(headertags),size(headervals1))
do i=1,nhdr
print "(1x,a,' = ',1pg14.6)",trim(headertags(i)),headervals1(i)
enddo

end subroutine print_headers

!-----------------------------------------------------------------
!
! print column labels one per line (no numbers)
!
!-----------------------------------------------------------------
subroutine print_column_labels(ncolumns,ncalc)
integer, intent(in) :: ncolumns,ncalc
integer :: i,nlab

nlab = min(ncolumns + ncalc,size(label),ubound(unitslabel,1))
do i=1,nlab
if (len_trim(label(i))==0) cycle
if (len_trim(unitslabel(i)) > 0 .and. index(label(i),trim(unitslabel(i)))==0) then
print "(a)",trim(label(i))//trim(unitslabel(i))
else
print "(a)",trim(label(i))
endif
enddo

end subroutine print_column_labels

!-----------------------------------------------------------------
!
! print original column labels one per line (no units, no numbers)
!
!-----------------------------------------------------------------
subroutine print_column_labels_orig(ncolumns)
integer, intent(in) :: ncolumns
integer :: i,nlab

nlab = min(ncolumns,size(labelorig))
do i=1,nlab
if (len_trim(labelorig(i))==0) cycle
print "(a)",trim(labelorig(i))
enddo

end subroutine print_column_labels_orig

end module labels
Loading
Loading