From 82ce32fad41b6983563ced197f5fc373c3836796 Mon Sep 17 00:00:00 2001 From: Daniel Price Date: Fri, 16 Jun 2023 18:15:55 +1000 Subject: [PATCH] (#55) renamed .F90 files without #ifdef statements to .f90 --- build/Makefile | 32 +++++++++---------- build/Makefile_fastmath | 4 +-- build/Makefile_setups | 12 +++---- src/main/{cooling.F90 => cooling.f90} | 0 src/main/{dust.F90 => dust.f90} | 0 ...{dust_formation.F90 => dust_formation.f90} | 0 src/main/{eos.F90 => eos.f90} | 9 ++++-- src/main/{evwrite.F90 => evwrite.f90} | 14 +++----- ...{extern_gnewton.F90 => extern_gnewton.f90} | 0 .../{extern_prdrag.F90 => extern_prdrag.f90} | 0 ...{externalforces.F90 => externalforces.f90} | 4 +-- ...nalforces_gr.F90 => externalforces_gr.f90} | 2 ++ src/main/{mpi_memory.F90 => mpi_memory.f90} | 0 ...il_supplement.F90 => nicil_supplement.f90} | 0 src/main/{phantom.F90 => phantom.f90} | 0 ...{ptmass_heating.F90 => ptmass_heating.f90} | 0 ...ass_radiation.F90 => ptmass_radiation.f90} | 0 ...{sort_particles.F90 => sort_particles.f90} | 0 src/main/{timestep.F90 => timestep.f90} | 0 .../{setup_bondi.F90 => setup_bondi.f90} | 0 src/setup/{setup_wind.F90 => setup_wind.f90} | 0 .../{test_fastmath.F90 => test_fastmath.f90} | 0 src/tests/{test_gr.F90 => test_gr.f90} | 0 .../{test_gravity.F90 => test_gravity.f90} | 0 .../{test_growth.F90 => test_growth.f90} | 0 src/tests/{test_mpi.F90 => test_mpi.f90} | 0 ...elope.F90 => analysis_common_envelope.f90} | 0 ...s_dustywind.F90 => analysis_dustywind.f90} | 0 .../{struct_part.F90 => struct_part.f90} | 0 ...tracer_all.F90 => utils_raytracer_all.f90} | 0 30 files changed, 38 insertions(+), 39 deletions(-) rename src/main/{cooling.F90 => cooling.f90} (100%) rename src/main/{dust.F90 => dust.f90} (100%) rename src/main/{dust_formation.F90 => dust_formation.f90} (100%) rename src/main/{eos.F90 => eos.f90} (99%) rename src/main/{evwrite.F90 => evwrite.f90} (99%) rename src/main/{extern_gnewton.F90 => extern_gnewton.f90} (100%) rename src/main/{extern_prdrag.F90 => extern_prdrag.f90} (100%) rename src/main/{externalforces.F90 => externalforces.f90} (99%) rename src/main/{externalforces_gr.F90 => externalforces_gr.f90} (99%) rename src/main/{mpi_memory.F90 => mpi_memory.f90} (100%) rename src/main/{nicil_supplement.F90 => nicil_supplement.f90} (100%) rename src/main/{phantom.F90 => phantom.f90} (100%) rename src/main/{ptmass_heating.F90 => ptmass_heating.f90} (100%) rename src/main/{ptmass_radiation.F90 => ptmass_radiation.f90} (100%) rename src/main/{sort_particles.F90 => sort_particles.f90} (100%) rename src/main/{timestep.F90 => timestep.f90} (100%) rename src/setup/{setup_bondi.F90 => setup_bondi.f90} (100%) rename src/setup/{setup_wind.F90 => setup_wind.f90} (100%) rename src/tests/{test_fastmath.F90 => test_fastmath.f90} (100%) rename src/tests/{test_gr.F90 => test_gr.f90} (100%) rename src/tests/{test_gravity.F90 => test_gravity.f90} (100%) rename src/tests/{test_growth.F90 => test_growth.f90} (100%) rename src/tests/{test_mpi.F90 => test_mpi.f90} (100%) rename src/utils/{analysis_common_envelope.F90 => analysis_common_envelope.f90} (100%) rename src/utils/{analysis_dustywind.F90 => analysis_dustywind.f90} (100%) rename src/utils/{struct_part.F90 => struct_part.f90} (100%) rename src/utils/{utils_raytracer_all.F90 => utils_raytracer_all.f90} (100%) diff --git a/build/Makefile b/build/Makefile index 6f716f195..33caa10bc 100644 --- a/build/Makefile +++ b/build/Makefile @@ -96,11 +96,11 @@ ifndef SETUPFILE endif ifndef SRCNIMHD - SRCNIMHD = nicil.F90 nicil_supplement.F90 + SRCNIMHD = nicil.F90 nicil_supplement.f90 endif ifndef SRCDUST - SRCDUST = dust.F90 growth.F90 + SRCDUST = dust.f90 growth.F90 endif ifdef SMOL @@ -471,13 +471,13 @@ SRCPOTS= extern_corotate.f90 \ extern_binary.f90 \ extern_spiral.f90 \ extern_lensethirring.f90 \ - extern_gnewton.F90 \ - lumin_nsdisc.F90 extern_prdrag.F90 \ + extern_gnewton.f90 \ + lumin_nsdisc.F90 extern_prdrag.f90 \ extern_Bfield.f90 \ extern_densprofile.f90 \ extern_staticsine.f90 \ extern_gwinspiral.f90 \ - externalforces.F90 + externalforces.f90 endif ifeq (X$(SRCPOT), X) SRCPOT=${SRCPOTS} @@ -486,7 +486,7 @@ endif # metrics for GR # ifeq ($(GR),yes) - SRCPOT=extern_gr.F90 $(SRCPOTS:externalforces.F90=externalforces_gr.F90) + SRCPOT=extern_gr.F90 $(SRCPOTS:externalforces.f90=externalforces_gr.f90) endif ifdef METRIC SRCMETRIC= metric_${METRIC}.f90 @@ -505,12 +505,12 @@ SRCCHEM= fs_data.f90 mol_data.f90 utils_spline.f90 \ cooling_molecular.f90 \ cooling_functions.f90 \ cooling_solver.f90 \ - h2chem.f90 cooling.F90 + h2chem.f90 cooling.f90 # # equations of state # SRCMESA= eos_mesa_microphysics.f90 eos_mesa.f90 -SRCEOS = eos_barotropic.f90 eos_stratified.f90 eos_piecewise.f90 ${SRCMESA} eos_shen.f90 eos_helmholtz.f90 eos_idealplusrad.f90 ionization.F90 eos_gasradrec.f90 eos.F90 +SRCEOS = eos_barotropic.f90 eos_stratified.f90 eos_piecewise.f90 ${SRCMESA} eos_shen.f90 eos_helmholtz.f90 eos_idealplusrad.f90 ionization.F90 eos_gasradrec.f90 eos.f90 ifeq ($(HDF5), yes) SRCREADWRITE_DUMPS= utils_hdf5.f90 utils_dumpfiles_hdf5.f90 readwrite_dumps_common.F90 readwrite_dumps_fortran.F90 readwrite_dumps_hdf5.F90 readwrite_dumps.F90 @@ -535,14 +535,14 @@ SOURCES= physcon.f90 ${CONFIG} ${SRCKERNEL} io.F90 units.f90 \ checkoptions.F90 viscosity.f90 damping.f90 options.f90 cons2primsolver.f90 radiation_utils.f90 cons2prim.f90 \ centreofmass.f90 ${SRCPOT} checkconserved.f90 \ utils_filenames.f90 utils_summary.F90 ${SRCCHEM} ${SRCDUST} \ - mpi_memory.F90 mpi_derivs.F90 mpi_tree.F90 kdtree.F90 linklist_kdtree.F90 utils_healpix.f90 utils_raytracer.f90 \ - partinject.F90 utils_inject.f90 dust_formation.F90 ptmass_radiation.F90 ptmass_heating.F90 \ + mpi_memory.f90 mpi_derivs.F90 mpi_tree.F90 kdtree.F90 linklist_kdtree.F90 utils_healpix.f90 utils_raytracer.f90 \ + partinject.F90 utils_inject.f90 dust_formation.f90 ptmass_radiation.f90 ptmass_heating.f90 \ radiation_implicit.f90 ${SRCTURB} \ ${SRCPHOTO} ${SRCINJECT_DEPS} ${SRCINJECT} \ ${SRCKROME} memory.F90 ${SRCREADWRITE_DUMPS} \ quitdump.f90 ptmass.F90 \ - readwrite_infile.F90 dens.F90 force.F90 utils_deriv.f90 deriv.F90 energies.F90 sort_particles.F90 \ - utils_shuffleparticles.F90 evwrite.F90 step_leapfrog.F90 writeheader.F90 ${SRCAN} step_supertimestep.F90 \ + readwrite_infile.F90 dens.F90 force.F90 utils_deriv.f90 deriv.F90 energies.F90 sort_particles.f90 \ + utils_shuffleparticles.F90 evwrite.f90 step_leapfrog.F90 writeheader.F90 ${SRCAN} step_supertimestep.F90 \ mf_write.f90 evolve.F90 utils_orbits.f90 utils_linalg.f90 \ checksetup.F90 initial.F90 @@ -612,7 +612,7 @@ edit: checksetup SRCDUMP= physcon.f90 ${CONFIG} ${SRCKERNEL} utils_omp.F90 io.F90 units.f90 boundary.f90 boundary_dynamic.f90 mpi_utils.F90 \ utils_timing.f90 utils_infiles.f90 dtype_kdtree.f90 utils_allocate.f90 part.F90 ${DOMAIN} \ mpi_dens.F90 mpi_force.F90 \ - mpi_balance.F90 mpi_memory.F90 mpi_derivs.F90 mpi_tree.F90 kdtree.F90 linklist_kdtree.F90 \ + mpi_balance.F90 mpi_memory.f90 mpi_derivs.F90 mpi_tree.F90 kdtree.F90 linklist_kdtree.F90 \ utils_dumpfiles.f90 utils_vectors.f90 utils_mathfunc.f90 \ utils_datafiles.f90 utils_filenames.f90 utils_system.f90 utils_tables.f90 datafiles.f90 gitinfo.f90 \ centreofmass.f90 \ @@ -677,14 +677,14 @@ cleansetup: # phantom test suite # ifeq ($(MPI),yes) - SRCTESTMPI = test_mpi.F90 + SRCTESTMPI = test_mpi.f90 else SRCTESTMPI = endif SRCTESTS=utils_testsuite.f90 ${TEST_FASTMATH} test_kernel.f90 \ - test_dust.F90 test_growth.F90 test_smol.F90 \ - test_nonidealmhd.F90 directsum.f90 test_gravity.F90 \ + test_dust.F90 test_growth.f90 test_smol.F90 \ + test_nonidealmhd.F90 directsum.f90 test_gravity.f90 \ test_derivs.F90 test_cooling.f90 test_eos_stratified.f90 \ test_eos.f90 test_externf.f90 test_rwdump.f90 \ test_step.F90 test_indtstep.F90 set_disc.F90 test_setdisc.F90 \ diff --git a/build/Makefile_fastmath b/build/Makefile_fastmath index 0e05134d1..a148a96c0 100644 --- a/build/Makefile_fastmath +++ b/build/Makefile_fastmath @@ -29,7 +29,7 @@ endif ifeq ($(FASTMATH), yes) SRCFASTMATH=fastmath.o - TEST_FASTMATH=test_fastmath.F90 + TEST_FASTMATH=test_fastmath.f90 FPPFLAGS+=-DFINVSQRT else SRCFASTMATH= @@ -38,7 +38,7 @@ endif fastmath.o: fastmath.f90 $(FC) $(FFLAGS) -o $@ -c $< || ${MAKE} fastmathlinkerr -test_fastmath.o: test_fastmath.F90 +test_fastmath.o: test_fastmath.f90 $(FC) $(FFLAGS) -o $@ -c $< || ${MAKE} fastmathlinkerr getmathflags.o: getmathflags.f90 $(FC) $(FFLAGS) -o $@ -c $< || ${MAKE} fastmathlinkerr diff --git a/build/Makefile_setups b/build/Makefile_setups index 1c4b919a5..9810d92c1 100644 --- a/build/Makefile_setups +++ b/build/Makefile_setups @@ -732,7 +732,7 @@ ifeq ($(SETUP), star) # import stellar model from 1D stellar evolution code SETUPFILE= setup_star.f90 MODFILE= utils_binary.f90 set_binary.f90 moddump_binary.f90 - ANALYSIS= ${SRCNIMHD} utils_summary.o utils_omp.o ptmass.o energies.o analysis_common_envelope.F90 + ANALYSIS= ${SRCNIMHD} utils_summary.o utils_omp.o ptmass.o energies.o analysis_common_envelope.f90 KNOWN_SETUP=yes MAXP=10000000 GRAVITY=yes @@ -745,7 +745,7 @@ ifeq ($(SETUP), grstar) IND_TIMESTEPS=yes SETUPFILE= setup_star.f90 MODFILE= moddump_tidal.f90 - ANALYSIS= ${SRCNIMHD} utils_summary.o utils_omp.o ptmass.o energies.o analysis_common_envelope.F90 + ANALYSIS= ${SRCNIMHD} utils_summary.o utils_omp.o ptmass.o energies.o analysis_common_envelope.f90 KNOWN_SETUP=yes MAXP=100000000 GRAVITY=yes @@ -756,7 +756,7 @@ ifeq ($(SETUP), dustystar) FPPFLAGS= -DDUST_NUCLEATION -DSINK_RADIATION -DSTAR SETUPFILE= setup_star.f90 MODFILE= utils_binary.f90 set_binary.f90 moddump_binary.f90 - ANALYSIS= ${SRCNIMHD} utils_summary.o utils_omp.o ptmass.o energies.o analysis_common_envelope.F90 dust_formation.F90 + ANALYSIS= ${SRCNIMHD} utils_summary.o utils_omp.o ptmass.o energies.o analysis_common_envelope.f90 dust_formation.F90 KNOWN_SETUP=yes MAXP=10000000 GRAVITY=yes @@ -766,7 +766,7 @@ ifeq ($(SETUP), radstar) # setup a star as in the star setup but with radiation SETUPFILE= setup_star.f90 MODFILE= utils_binary.f90 set_binary.f90 moddump_binary.f90 - ANALYSIS= ${SRCNIMHD} utils_summary.o utils_omp.o ptmass.o energies.o analysis_common_envelope.F90 + ANALYSIS= ${SRCNIMHD} utils_summary.o utils_omp.o ptmass.o energies.o analysis_common_envelope.f90 KNOWN_SETUP=yes MAXP=10000000 GRAVITY=yes @@ -795,13 +795,13 @@ endif ifeq ($(SETUP), radwind) # wind setup with dust nucleation FPPFLAGS= -DWIND -DSINK_RADIATION -DDUST_NUCLEATION - ANALYSIS= utils_getneighbours.f90 utils_raytracer_all.F90 analysis_raytracer.f90 + ANALYSIS= utils_getneighbours.f90 utils_raytracer_all.f90 analysis_raytracer.f90 WIND=yes endif ifeq ($(WIND), yes) # wind particle injection setup - SETUPFILE= setup_wind.F90 + SETUPFILE= setup_wind.f90 SRCINJECT= utils_binary.f90 set_binary.f90 wind_equations.F90 wind.F90 inject_wind.f90 KNOWN_SETUP=yes endif diff --git a/src/main/cooling.F90 b/src/main/cooling.f90 similarity index 100% rename from src/main/cooling.F90 rename to src/main/cooling.f90 diff --git a/src/main/dust.F90 b/src/main/dust.f90 similarity index 100% rename from src/main/dust.F90 rename to src/main/dust.f90 diff --git a/src/main/dust_formation.F90 b/src/main/dust_formation.f90 similarity index 100% rename from src/main/dust_formation.F90 rename to src/main/dust_formation.f90 diff --git a/src/main/eos.F90 b/src/main/eos.f90 similarity index 99% rename from src/main/eos.F90 rename to src/main/eos.f90 index 2be3a507c..4194b3f87 100644 --- a/src/main/eos.F90 +++ b/src/main/eos.f90 @@ -1374,6 +1374,7 @@ end subroutine read_headeropts_eos !+ !----------------------------------------------------------------------- subroutine write_options_eos(iunit) + use dim, only:use_krome use infile_utils, only:write_inopt use eos_helmholtz, only:eos_helmholtz_write_inopt use eos_barotropic, only:write_options_eos_barotropic @@ -1383,9 +1384,11 @@ subroutine write_options_eos(iunit) write(iunit,"(/,a)") '# options controlling equation of state' call write_inopt(ieos,'ieos','eqn of state (1=isoth;2=adiab;3=locally iso;8=barotropic)',iunit) -#ifndef KROME - if (.not. eos_outputs_mu(ieos)) call write_inopt(gmw,'mu','mean molecular weight',iunit) -#endif + + if (.not.use_krome .or. .not.eos_outputs_mu(ieos)) then + call write_inopt(gmw,'mu','mean molecular weight',iunit) + endif + select case(ieos) case(8) call write_options_eos_barotropic(iunit) diff --git a/src/main/evwrite.F90 b/src/main/evwrite.f90 similarity index 99% rename from src/main/evwrite.F90 rename to src/main/evwrite.f90 index e5420c4e8..65168ba0a 100644 --- a/src/main/evwrite.F90 +++ b/src/main/evwrite.f90 @@ -247,7 +247,7 @@ subroutine init_evfile(iunit,evfile,open_file) endif end subroutine init_evfile -! + !---------------------------------------------------------------- !+ ! creates up to three lables per input value, and fills the required @@ -300,7 +300,7 @@ subroutine fill_ev_tag(ev_fmt,itag,label,cmd,i,j) endif enddo enddo - ! + end subroutine fill_ev_tag !---------------------------------------------------------------- !+ @@ -350,11 +350,9 @@ end subroutine fill_ev_header subroutine write_evfile(t,dt) use energies, only:compute_energies,ev_data_update use io, only:id,master,ievfile -#ifndef GR use timestep, only:dtmax_user use options, only:iexternalforce - use extern_binary, only:accretedmass1,accretedmass2 -#endif + use externalforces,only:accretedmass1,accretedmass2 real, intent(in) :: t,dt integer :: i,j real :: ev_data_out(ielements) @@ -364,14 +362,12 @@ subroutine write_evfile(t,dt) if (id==master) then !--fill in additional details that are not calculated in energies.f -#ifndef GR ev_data(iev_sum,iev_dt) = dt ev_data(iev_sum,iev_dtx) = dtmax_user if (iexternalforce==iext_binary) then ev_data(iev_sum,iev_maccsink(1)) = accretedmass1 ev_data(iev_sum,iev_maccsink(2)) = accretedmass2 endif -#endif ! Fill in the data_out array j = 1 do i = 1,iquantities @@ -405,7 +401,6 @@ subroutine write_evfile(t,dt) call flush(ievfile) endif - return end subroutine write_evfile !---------------------------------------------------------------- !+ @@ -499,7 +494,6 @@ subroutine write_evlog(iprint) endif write(iprint,"(/)") - return end subroutine write_evlog -!---------------------------------------------------------------- + end module evwrite diff --git a/src/main/extern_gnewton.F90 b/src/main/extern_gnewton.f90 similarity index 100% rename from src/main/extern_gnewton.F90 rename to src/main/extern_gnewton.f90 diff --git a/src/main/extern_prdrag.F90 b/src/main/extern_prdrag.f90 similarity index 100% rename from src/main/extern_prdrag.F90 rename to src/main/extern_prdrag.f90 diff --git a/src/main/externalforces.F90 b/src/main/externalforces.f90 similarity index 99% rename from src/main/externalforces.F90 rename to src/main/externalforces.f90 index 940278203..9f56c236d 100644 --- a/src/main/externalforces.F90 +++ b/src/main/externalforces.f90 @@ -23,14 +23,14 @@ module externalforces ! extern_lensethirring, extern_prdrag, extern_spiral, extern_staticsine, ! infile_utils, io, lumin_nsdisc, part, units ! - use extern_binary, only:accradius1 + use extern_binary, only:accradius1,accretedmass1,accretedmass2 use extern_corotate, only:omega_corotate ! so public from this module implicit none private public :: externalforce,externalforce_vdependent public :: accrete_particles,was_accreted - public :: accradius1,omega_corotate + public :: accradius1,omega_corotate,accretedmass1,accretedmass2 public :: write_options_externalforces,read_options_externalforces public :: initialise_externalforces,is_velocity_dependent public :: update_vdependent_extforce_leapfrog diff --git a/src/main/externalforces_gr.F90 b/src/main/externalforces_gr.f90 similarity index 99% rename from src/main/externalforces_gr.F90 rename to src/main/externalforces_gr.f90 index 0a3e1b79a..7f3f17ba5 100644 --- a/src/main/externalforces_gr.F90 +++ b/src/main/externalforces_gr.f90 @@ -39,6 +39,8 @@ module externalforces public :: mass1 ! exported from metric module real, public :: accradius1 = 0. real, public :: accradius1_hard = 0. + real, public :: accretedmass1 = 0. + real, public :: accretedmass2 = 0. logical, public :: extract_iextern_from_hdr = .false. diff --git a/src/main/mpi_memory.F90 b/src/main/mpi_memory.f90 similarity index 100% rename from src/main/mpi_memory.F90 rename to src/main/mpi_memory.f90 diff --git a/src/main/nicil_supplement.F90 b/src/main/nicil_supplement.f90 similarity index 100% rename from src/main/nicil_supplement.F90 rename to src/main/nicil_supplement.f90 diff --git a/src/main/phantom.F90 b/src/main/phantom.f90 similarity index 100% rename from src/main/phantom.F90 rename to src/main/phantom.f90 diff --git a/src/main/ptmass_heating.F90 b/src/main/ptmass_heating.f90 similarity index 100% rename from src/main/ptmass_heating.F90 rename to src/main/ptmass_heating.f90 diff --git a/src/main/ptmass_radiation.F90 b/src/main/ptmass_radiation.f90 similarity index 100% rename from src/main/ptmass_radiation.F90 rename to src/main/ptmass_radiation.f90 diff --git a/src/main/sort_particles.F90 b/src/main/sort_particles.f90 similarity index 100% rename from src/main/sort_particles.F90 rename to src/main/sort_particles.f90 diff --git a/src/main/timestep.F90 b/src/main/timestep.f90 similarity index 100% rename from src/main/timestep.F90 rename to src/main/timestep.f90 diff --git a/src/setup/setup_bondi.F90 b/src/setup/setup_bondi.f90 similarity index 100% rename from src/setup/setup_bondi.F90 rename to src/setup/setup_bondi.f90 diff --git a/src/setup/setup_wind.F90 b/src/setup/setup_wind.f90 similarity index 100% rename from src/setup/setup_wind.F90 rename to src/setup/setup_wind.f90 diff --git a/src/tests/test_fastmath.F90 b/src/tests/test_fastmath.f90 similarity index 100% rename from src/tests/test_fastmath.F90 rename to src/tests/test_fastmath.f90 diff --git a/src/tests/test_gr.F90 b/src/tests/test_gr.f90 similarity index 100% rename from src/tests/test_gr.F90 rename to src/tests/test_gr.f90 diff --git a/src/tests/test_gravity.F90 b/src/tests/test_gravity.f90 similarity index 100% rename from src/tests/test_gravity.F90 rename to src/tests/test_gravity.f90 diff --git a/src/tests/test_growth.F90 b/src/tests/test_growth.f90 similarity index 100% rename from src/tests/test_growth.F90 rename to src/tests/test_growth.f90 diff --git a/src/tests/test_mpi.F90 b/src/tests/test_mpi.f90 similarity index 100% rename from src/tests/test_mpi.F90 rename to src/tests/test_mpi.f90 diff --git a/src/utils/analysis_common_envelope.F90 b/src/utils/analysis_common_envelope.f90 similarity index 100% rename from src/utils/analysis_common_envelope.F90 rename to src/utils/analysis_common_envelope.f90 diff --git a/src/utils/analysis_dustywind.F90 b/src/utils/analysis_dustywind.f90 similarity index 100% rename from src/utils/analysis_dustywind.F90 rename to src/utils/analysis_dustywind.f90 diff --git a/src/utils/struct_part.F90 b/src/utils/struct_part.f90 similarity index 100% rename from src/utils/struct_part.F90 rename to src/utils/struct_part.f90 diff --git a/src/utils/utils_raytracer_all.F90 b/src/utils/utils_raytracer_all.f90 similarity index 100% rename from src/utils/utils_raytracer_all.F90 rename to src/utils/utils_raytracer_all.f90