Skip to content

Commit

Permalink
Merge pull request #456 from emborchert/master
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljprice committed Jul 18, 2023
2 parents 930c2d3 + 377b2c0 commit c91674f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
28 changes: 14 additions & 14 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ ifeq ($(MCFOST), yes)
MCFOST_LIBS = $(PREFIX)/lib
MCFOST_LIB = $(PREFIX)/lib
MCFOST_INCLUDE = $(PREFIX)/include
ifeq ("X$(HDF5ROOT)","X")
HDF5ROOT=$(PREFIX)
ifeq ("X$(HDF5_DIR)","X")
HDF5_DIR=$(PREFIX)
endif
else
#--otherwise assume the source code is lying around somewhere
Expand All @@ -149,8 +149,8 @@ ifeq ($(MCFOST), yes)
FPPFLAGS+= -DMCFOST
LDFLAGS+= -I$(MCFOST_INCLUDE) -I$(MCFOST_INCLUDE)/voro++ -I$(MCFOST_INCLUDE)/hdf5 -I$(MCFOST_INCLUDE)/$(FC) \
-L$(MCFOST_LIB) -lmcfost -L$(MCFOST_LIBS) $(LIBCXX) -lcfitsio -lvoro++ -lsprng \
-L$(HDF5ROOT) -lhdf5_fortran -lhdf5 -lz #$(LXGBOOST)
#-L$(HDF5ROOT)/lib/Intel -lhdf5_fortran
-L$(HDF5_DIR) -lhdf5_fortran -lhdf5 -lz #$(LXGBOOST)
#-L$(HDF5_DIR)/lib/Intel -lhdf5_fortran
endif

include Makefile_systems
Expand Down Expand Up @@ -415,21 +415,21 @@ endif
# - lib for the shared library .so files
#
# Often both directories are under one root,
# e.g. HDF5ROOT= /usr/local/opt/hdf5
# In this case just set HDF5ROOT for your machine.
# e.g. HDF5_DIR= /usr/local/opt/hdf5
# In this case just set HDF5_DIR for your machine.
#
# However, sometimes these directories are separate,
# then you must set both HDF5INCLUDE and HDF5LIB.
#
ifeq ($(HDF5), yes)
ifeq (X$(HDF5ROOT), X)
HDF5ROOT= /usr/local/opt/hdf5
ifeq (X$(HDF5_DIR), X)
HDF5_DIR= /usr/local/opt/hdf5
endif
ifeq (X$(HDF5INCLUDE), X)
HDF5INCLUDE= $(HDF5ROOT)/include
HDF5INCLUDE= $(HDF5_DIR)/include
endif
ifeq (X$(HDF5LIB), X)
HDF5LIB= $(HDF5ROOT)/lib
HDF5LIB= $(HDF5_DIR)/lib
endif
FFLAGS+= -I$(HDF5INCLUDE)
CCFLAGS+= -I$(HDF5INCLUDE)
Expand Down Expand Up @@ -766,7 +766,7 @@ OBJG2PDF= io.o utils_filenames.o asciiutils.o write_griddata.o \
.PHONY: grid2pdf
grid2pdf: checksys checkparams checkhdf5 $(OBJG2PDF)
@echo "objects are $(OBJG2PDF)"
$(FC) $(FFLAGS) -o $(BINDIR)/grid2pdf $(OBJG2PDF) $(LDFLAGS) -L$(HDF5ROOT)/lib -lhdf5
$(FC) $(FFLAGS) -o $(BINDIR)/grid2pdf $(OBJG2PDF) $(LDFLAGS) -L$(HDF5_DIR)/lib -lhdf5
@echo ""
@echo "Grid2pdf: we are Possibly Dangerously Fanatical"
@echo ""
Expand Down Expand Up @@ -1100,10 +1100,10 @@ cleantestbinary:
# check for anything that depends on HDF5
#
checkhdf5:
ifeq (X${HDF5ROOT}, X)
@echo; echo "ERROR: HDF5ROOT should be set before compiling with HDF5 utilities"; echo; ${MAKE} err;
ifeq (X${HDF5_DIR}, X)
@echo; echo "ERROR: HDF5_DIR should be set before compiling with HDF5 utilities"; echo; ${MAKE} err;
else
@if [ -d $$HDF5ROOT ]; then echo; echo "HDF5ROOT=$$HDF5ROOT"; echo; else echo; echo "ERROR: Directory given by HDF5ROOT=$$HDF5ROOT does not exist"; echo; ${MAKE} err; fi;
@if [ -d $$HDF5_DIR ]; then echo; echo "HDF5_DIR=$$HDF5_DIR"; echo; else echo; echo "ERROR: Directory given by HDF5_DIR=$$HDF5_DIR does not exist"; echo; ${MAKE} err; fi;
endif

#----------------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions build/Makefile_setups
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ ifeq ($(SETUP), mcfost) # [buildbot skip]
override SETUP=disc
MCFOST=yes
endif
ifeq ($(SETUP), dustymcfost) # [buildbot skip]
OBSOLETE_SETUP=yes
OLDSETUP=dustymcfost
override SETUP=dustydisc
MCFOST=yes
endif
ifeq ($(SETUP), planets) # [buildbot skip]
OBSOLETE_SETUP=yes
OLDSETUP= planets
Expand Down
5 changes: 2 additions & 3 deletions src/utils/analysis_binarydisc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ end subroutine read_dotin
!-----------------------------------------------------------------------
subroutine get_binary_params(ipri,isec,xyzmh_ptmass,vxyz_ptmass,time,a,ecc,G)
!-----------------------------------------------------------------------
use io, only:fatal
use io, only:fatal,warning

implicit none

Expand Down Expand Up @@ -516,7 +516,7 @@ subroutine get_binary_params(ipri,isec,xyzmh_ptmass,vxyz_ptmass,time,a,ecc,G)
Lmag = sqrt(dot_product(L,L))
E = 0.5*dot_product(dv,dv) - G*(mpri+msec)/rbin

if (abs(E) < tiny(E)) stop 'binary energy problem'
if (abs(E) < tiny(E)) call warning(analysistype, 'E=0 for binary')
call get_ae(Lmag,E,mpri,msec,a,ecc)

if (time <= tiny(time)) then
Expand Down Expand Up @@ -548,7 +548,6 @@ subroutine get_ae(Lmag,E,m1,m2,a,ecc)
real,intent(in) :: Lmag,E,m1,m2

if (Lmag < tiny(Lmag)) stop 'Lmag is zero in get_ae'
if (abs(E) < tiny(E)) stop 'E is zero in get_ae'

! Hence obtain the binary eccentricity
ecc = sqrt(1.0 + (2.0*E*Lmag**2)/((m1+m2)**2))
Expand Down

0 comments on commit c91674f

Please sign in to comment.