Skip to content

Commit

Permalink
Merge pull request #579 from danieljprice/mega-merge
Browse files Browse the repository at this point in the history
Merge #566, #572 and #578
  • Loading branch information
danieljprice authored Aug 5, 2024
2 parents 6052f26 + c4a2d9f commit 21b2b59
Show file tree
Hide file tree
Showing 36 changed files with 870 additions and 346 deletions.
11 changes: 10 additions & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,16 @@ Megha Sharma <[email protected]> megha sharma <[email protected]>
Megha Sharma <[email protected]> Megha Sharma <[email protected]>
Megha Sharma <[email protected]> Megha Sharma <[email protected]>
Megha Sharma <[email protected]> Megha Sharma <[email protected]>
Mike Lau <[email protected]> Mike Lau <[email protected]>
Mike Lau <[email protected]> Mike Lau <[email protected]>
Mike Lau <[email protected]> Mike Lau <[email protected]>
Elisabeth Borchert <[email protected]> emborchert <[email protected]>
Ward Homan <[email protected]> ward <[email protected]>
Ward Homan <[email protected]> wardhoman <[email protected]>
Benedetta Veronesi <[email protected]> benedetta veronesi <[email protected]>
Benedetta Veronesi <[email protected]> <[email protected]>
Phantom benchmark bot <[email protected]> Ubuntu <[email protected]>
Stephane Michoulier <[email protected]> StephaneMichoulier <[email protected]>
Stephane Michoulier <[email protected]> MICHOULIER Stephane <smichoulier@sidus11>
Jolien Malfait <[email protected]> Jolien128 <[email protected]>
Martina Toscani <[email protected]> <[email protected]>
Martina Toscani <[email protected]> <[email protected]>
Expand All @@ -115,4 +117,11 @@ Amena Faruqi <[email protected]> <[email protected]
Amena Faruqi <[email protected]> Amena Faruqi <[email protected]>
Alison Young <[email protected]> Alison Young <[email protected]>
Simone Ceppi <[email protected]> Simone Ceppi <[email protected]>
Madeline Overton <[email protected]> Madeline Nicole Overton <[email protected]>
Madeline Overton <[email protected]> Madeline Overton <[email protected]>
Nicolás Cuello <[email protected]> Nicolas Cuello <[email protected]>
Rebecca Martin <[email protected]> rebeccagmartin <[email protected]>
Stephen Nielson <[email protected]> s-neilson <[email protected]>
Stephen Nielson <[email protected]> Stephen Neilson <[email protected]>
Yann Bernard <[email protected]> Yrisch <[email protected]>
David Bamba <[email protected]> DavidBamba <[email protected]>
42 changes: 21 additions & 21 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
# Edit .mailmap if your name or email are wrong #
#-------------------------------------------------------#
Daniel Price <[email protected]>
Mike Lau <mike.lau@monash.edu>
Mike Lau <mike.lau@h-its.org>
Conrad Chan <[email protected]>
James Wurster <[email protected]>
David Liptai <[email protected]>
Lionel Siess <[email protected]>
Fangyi (Fitz) Hu <[email protected]>
Daniel Mentiplay <[email protected]>
Yrisch <[email protected]>
Yann Bernard <[email protected]>
Megha Sharma <[email protected]>
Arnaud Vericel <[email protected]>
Mark Hutchison <[email protected]>
Expand All @@ -26,50 +26,50 @@ Terrence Tricco <[email protected]>
Stephane Michoulier <[email protected]>
Simone Ceppi <[email protected]>
Spencer Magnall <[email protected]>
Caitlyn Hardiman <[email protected]>
Enrico Ragusa <[email protected]>
Caitlyn Hardiman <[email protected]>
Cristiano Longarini <[email protected]>
Sergei Biriukov <[email protected]>
Giovanni Dipierro <[email protected]>
Roberto Iaconi <[email protected]>
Amena Faruqi <[email protected]>
Hauke Worpel <[email protected]>
Alison Young <[email protected]>
Stephen Neilson <36410751+s-neilson@users.noreply.github.com>
Stephen Nielson <stephen.neilson@students.mq.edu.au>
Martina Toscani <[email protected]>
Benedetta Veronesi <[email protected]>
Sahl Rowther <[email protected]>
Simon Glover <[email protected]>
Sahl Rowther <[email protected]>
Thomas Reichardt <[email protected]>
Jean-François Gonzalez <[email protected]>
Christopher Russell <[email protected]>
Alessia Franchini <alessia.franchini@unlv.edu>
Madeline Overton <overtm2@unlv.nevada.edu>
Alex Pettitt <[email protected]>
Jolien Malfait <[email protected]>
Phantom benchmark bot <[email protected]>
Kieran Hirsh <[email protected]>
Mike Lau <[email protected]>
Jolien Malfait <[email protected]>
Alessia Franchini <[email protected]>
Nicole Rodrigues <[email protected]>
David Trevascus <dtre10@student.monash.edu>
Kieran Hirsh <kieran.hirsh1@monash.edu>
Farzana Meru <[email protected]>
David Trevascus <[email protected]>
Nicolás Cuello <[email protected]>
Chris Nixon <[email protected]>
Miguel Gonzalez-Bolivar <[email protected]>
Benoit Commercon <[email protected]>
Giulia Ballabio <[email protected]>
Joe Fisher <[email protected]>
Maxime Lombart <[email protected]>
Orsola De Marco <[email protected]>
Zachary Pellow <[email protected]>
s-neilson <[email protected]>
Ariel Chitan <[email protected]>
Chunliang Mu <[email protected]>
Cox, Samuel <[email protected]>
Orsola De Marco <[email protected]>
Joe Fisher <[email protected]>
Benoit Commercon <[email protected]>
Giulia Ballabio <[email protected]>
Rebecca Martin <[email protected]>
Jorge Cuadra <[email protected]>
Hugh Griffiths <[email protected]>
Jeremy Smallwood <[email protected]>
Jorge Cuadra <[email protected]>
MICHOULIER Stephane <smichoulier@sidus11>
David Bamba <[email protected]>
Cox, Samuel <[email protected]>
Chunliang Mu <[email protected]>
Shunquan Huang <[email protected]>
Steven Rieder <[email protected]>
Stéven Toupin <[email protected]>
Taj Jankovič <[email protected]>
rebeccagmartin <[email protected].com>
Ariel Chitan <arielchitan@gmail.com>
20 changes: 19 additions & 1 deletion build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ ifdef METRIC
else
SRCMETRIC= metric_minkowski.f90
endif
SRCGR=inverse4x4.f90 einsteintk_utils.f90 $(SRCMETRIC) metric_tools.f90 utils_gr.f90 interpolate3D.f90 tmunu2grid.f90
SRCGR=inverse4x4.f90 metric_et_utils.f90 einsteintk_utils.f90 $(SRCMETRIC) metric_tools.f90 utils_gr.f90 interpolate3D.f90 tmunu2grid.f90
#
# chemistry and cooling
#
Expand Down Expand Up @@ -1230,6 +1230,24 @@ combinedustdumps: checksys checkparams $(OBJCDD)
cleancombinedustdumps:
rm -f $(BINDIR)/combinedustdumps

#----------------------------------------------------
# these are the sources for the tabulate_metric tility
.PHONY: tabulate_metric
SRCTAB= io.F90 utils_infiles.f90 metric_${METRIC}.f90 metric_et_utils.f90 tabulate_metric.f90 #metric_tools.F90
OBJTAB1= $(SRCTAB:.F90=.o)
OBJTAB= $(OBJTAB1:.f90=.o)

tabulate_metric: checksys $(OBJTAB)
@echo ""
@echo "tabulate_metric: Because grids are great"
@echo ""
$(FC) $(FFLAGS) -o $(BINDIR)/$@ $(OBJTAB)

cleantabulatemetric:
rm -f $(BINDIR)/tabulate_metric




include Makefile_qscripts

Expand Down
12 changes: 11 additions & 1 deletion build/Makefile_setups
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,17 @@ endif
ifeq ($(SETUP), asteroidwind)
# asteroid emitting a wind (Trevascus et al. 2021)
SETUPFILE=setup_asteroidwind.f90
SRCINJECT=utils_binary.f90 inject_asteroidwind.f90
SRCINJECT=utils_binary.f90 inject_randomwind.f90
IND_TIMESTEPS=yes
CONST_AV=yes
ISOTHERMAL=yes
KNOWN_SETUP=yes
endif

ifeq ($(SETUP), randomwind)
# asteroid emitting a wind (Trevascus et al. 2021)
SETUPFILE=setup_disc.f90
SRCINJECT=utils_binary.f90 inject_randomwind.f90
IND_TIMESTEPS=yes
CONST_AV=yes
ISOTHERMAL=yes
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-guide/datafiles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ order for your modules to be portable.
Small files
-----------

For *very small files* (under 1Mb), you can simply add these to the git
For *very small files* (under 100Kb), you can simply add these to the git
repository in a subdirectory of the phantom/data directory:

::
Expand Down
80 changes: 48 additions & 32 deletions src/main/H2regions.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,17 @@
!--------------------------------------------------------------------------!
module HIIRegion
!
! HIIRegion
! Feedback from HII regions
!
! :References: Fujii et al. (2021), Hopkins et al. (2012)
!
! :Owner: Yrisch
! :Owner: Yann Bernard
!
! :Runtime parameters: None
!
! :Dependencies: dim, eos, infile_utils, io, linklist, part, physcon,
! sortutils, timing, units
!
! contains routines to model HII region expansion due to ionization and radiation pressure..
! routine originally made by Hopkins et al. (2012),reused by Fujii et al. (2021)
! and adapted in Phantom by Yann Bernard

implicit none

public :: update_ionrates,update_ionrate, HII_feedback,initialize_H2R,read_options_H2R,write_options_H2R
Expand Down Expand Up @@ -52,17 +48,18 @@ module HIIRegion

contains

!-----------------------------------------------------------------------
!+
! Initialise stellar feedbacks
!+
!-----------------------------------------------------------------------
!-----------------------------------------------------------------------
!+
! Initialise stellar feedbacks
!+
!-----------------------------------------------------------------------
subroutine initialize_H2R
use io, only:iprint,iverbose,id,master
use part, only:isionised
use units, only:udist,umass,utime
use physcon, only:mass_proton_cgs,kboltz,pc,eV,solarm
use eos , only:gmw,gamma
use eos, only:gmw,gamma

isionised(:)=.false.
!calculate the useful constant in code units
mH = gmw*mass_proton_cgs
Expand All @@ -85,15 +82,14 @@ subroutine initialize_H2R
write(iprint,"(a,es18.10,es18.10)") " Max strögrem radius (code/pc) : ", Rst_max, Rmax
write(iprint,"(a,es18.10,es18.10)") " Min feedback mass (code/Msun) : ", Minmass, Mmin
endif
return

end subroutine initialize_H2R

!-----------------------------------------------------------------------
!+
! Calculation of the the ionizing photon rate of all stars (Only for restart)
!+
!-----------------------------------------------------------------------

subroutine update_ionrates(nptmass,xyzmh_ptmass,h_acc)
use io, only:iprint,iverbose
use units, only:umass
Expand All @@ -104,6 +100,7 @@ subroutine update_ionrates(nptmass,xyzmh_ptmass,h_acc)
real, intent(in) :: h_acc
real :: logmi,log_Q,mi,hi
integer :: i

nHIIsources = 0
!$omp parallel do default(none) &
!$omp shared(xyzmh_ptmass,iprint,iverbose,umass)&
Expand All @@ -122,7 +119,7 @@ subroutine update_ionrates(nptmass,xyzmh_ptmass,h_acc)
xyzmh_ptmass(irstrom,i) = -1.
nHIIsources = nHIIsources + 1
if (iverbose >= 0) then
write(iprint,"(/a,es18.10,es18.10/)")"Massive stars detected : Log Q, Mass : ",log_Q,mi
write(iprint,"(/a,es18.10,es18.10/)") "Massive stars detected : Log Q, Mass : ",log_Q,mi
endif
else
xyzmh_ptmass(irateion,i) = -1.
Expand All @@ -133,9 +130,14 @@ subroutine update_ionrates(nptmass,xyzmh_ptmass,h_acc)
if (iverbose > 1) then
write(iprint,"(/a,i8/)") "nb_feedback sources : ",nHIIsources
endif
return

end subroutine update_ionrates

!-----------------------------------------------------------------------
!+
! update the ionizing photon rate
!+
!-----------------------------------------------------------------------
subroutine update_ionrate(i,xyzmh_ptmass,h_acc)
use io, only:iprint,iverbose
use units, only:umass
Expand All @@ -145,6 +147,7 @@ subroutine update_ionrate(i,xyzmh_ptmass,h_acc)
real, intent(inout) :: xyzmh_ptmass(:,:)
real, intent(in) :: h_acc
real :: logmi,log_Q,mi,hi

mi = xyzmh_ptmass(4,i)
hi = xyzmh_ptmass(ihacc,i)
if (mi > Minmass .and. hi < h_acc) then
Expand All @@ -156,7 +159,7 @@ subroutine update_ionrate(i,xyzmh_ptmass,h_acc)
xyzmh_ptmass(irstrom,i) = -1.
nHIIsources = nHIIsources + 1
if (iverbose >= 0) then
write(iprint,"(/a,es18.10,es18.10/)")"Massive stars detected : Log Q, Mass : ",log_Q,mi
write(iprint,"(/a,es18.10,es18.10/)") "Massive stars detected : Log Q, Mass : ",log_Q,mi
endif
else
xyzmh_ptmass(irateion,i) = -1.
Expand All @@ -166,15 +169,14 @@ subroutine update_ionrate(i,xyzmh_ptmass,h_acc)
if (iverbose > 1) then
write(iprint,"(/a,i8/)") "nb_feedback sources : ",nHIIsources
endif
return
end subroutine update_ionrate

!-----------------------------------------------------------------------
!+
! Main subroutine : Application of the HII feedback using Hopkins's like prescription
!+
!-----------------------------------------------------------------------
end subroutine update_ionrate

!-----------------------------------------------------------------------
!+
! Main subroutine : Application of the HII feedback using Hopkins's like prescription
!+
!-----------------------------------------------------------------------
subroutine HII_feedback(nptmass,npart,xyzh,xyzmh_ptmass,vxyzu,isionised,dt)
use part, only:rhoh,massoftype,ihsoft,igas,irateion,isdead_or_accreted,&
irstrom
Expand Down Expand Up @@ -268,10 +270,10 @@ subroutine HII_feedback(nptmass,npart,xyzh,xyzmh_ptmass,vxyzu,isionised,dt)
r_in = sqrt((xi-xyzh(1,j))**2 + (yi-xyzh(2,j))**2 + (zi-xyzh(3,j))**2)
mHII = ((4.*pi*(r**3-r_in**3)*rhoh(xyzh(4,j),pmass))/3)
if (mHII>3*pmass) then
!$omp parallel do default(none) &
!$omp shared(mHII,listneigh,xyzh,sigd,dt) &
!$omp shared(mH,vxyzu,log_Qi,hv_on_c,npartin,pmass,xi,yi,zi) &
!$omp private(j,dx,dy,dz,vkx,vky,vkz,xj,yj,zj,r,taud)
!$omp parallel do default(none) &
!$omp shared(mHII,listneigh,xyzh,sigd,dt) &
!$omp shared(mH,vxyzu,log_Qi,hv_on_c,npartin,pmass,xi,yi,zi) &
!$omp private(j,dx,dy,dz,vkx,vky,vkz,xj,yj,zj,r,taud)
do k=1,npartin
j = listneigh(1)
xj = xyzh(1,j)
Expand All @@ -290,35 +292,48 @@ subroutine HII_feedback(nptmass,npart,xyzh,xyzmh_ptmass,vxyzu,isionised,dt)
vxyzu(2,j) = vxyzu(2,j) + vky*dt
vxyzu(3,j) = vxyzu(3,j) + vkz*dt
enddo
!$omp end parallel do
!$omp end parallel do
endif
endif
enddo
endif
call get_timings(t2,tcpu2)
call increment_timer(itimer_HII,t2-t1,tcpu2-tcpu1)
return

end subroutine HII_feedback

!-----------------------------------------------------------------------
!+
! write options to input file
!+
!-----------------------------------------------------------------------
subroutine write_options_H2R(iunit)
use infile_utils, only:write_inopt
use physcon, only:solarm
integer, intent(in) :: iunit
write(iunit,"(/,a)") '# options controlling HII region expansion feedback'
if (iH2R>0) then

if (iH2R > 0) then
write(iunit,"(/,a)") '# options controlling HII region expansion feedback'
call write_inopt(iH2R, 'iH2R', "enable the HII region expansion feedback in star forming reigon", iunit)
call write_inopt(Mmin, 'Mmin', "Minimum star mass to trigger HII region (MSun)", iunit)
call write_inopt(Rmax, 'Rmax', "Maximum radius for HII region (pc)", iunit)
endif

end subroutine write_options_H2R

!-----------------------------------------------------------------------
!+
! read options from input file
!+
!-----------------------------------------------------------------------
subroutine read_options_H2R(name,valstring,imatch,igotall,ierr)
use io, only:fatal
character(len=*), intent(in) :: name,valstring
logical, intent(out) :: imatch,igotall
integer, intent(out) :: ierr
integer, save :: ngot = 0
character(len=30), parameter :: label = 'read_options_H2R'

imatch = .true.
select case(trim(name))
case('iH2R')
Expand All @@ -337,6 +352,7 @@ subroutine read_options_H2R(name,valstring,imatch,igotall,ierr)
imatch = .true.
end select
igotall = (ngot >= 3)

end subroutine read_options_H2R

end module HIIRegion
Loading

0 comments on commit 21b2b59

Please sign in to comment.