From 416d0cf3635515ffbc46555e97d7b1fef8d882fb Mon Sep 17 00:00:00 2001 From: Mike Lau Date: Thu, 28 Sep 2023 22:06:39 +0200 Subject: [PATCH] (windtunnel) fix some bugs --- src/main/inject_windtunnel.f90 | 5 +++-- src/setup/setup_windtunnel.f90 | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/inject_windtunnel.f90 b/src/main/inject_windtunnel.f90 index ee868f5b1..7c304db07 100644 --- a/src/main/inject_windtunnel.f90 +++ b/src/main/inject_windtunnel.f90 @@ -40,7 +40,7 @@ module inject ! Particle-related parameters integer, public :: lattice_type = 1 - real, public :: handled_layers = 4 + integer, public :: handled_layers = 4 real, public :: wind_radius = 30. real, public :: wind_injection_x = -10. real, public :: wind_length = 100. @@ -146,7 +146,8 @@ subroutine init_inject(ierr) max_particles = int(max_layers*(nodd+neven)/2) + nstar time_between_layers = distance_between_layers/v_inf - call print_summary(v_inf,cs_inf,rho_inf,pres_inf,mach,pmass,distance_between_layers,time_between_layers,max_layers,nstar,max_particles) + call print_summary(v_inf,cs_inf,rho_inf,pres_inf,mach,pmass,distance_between_layers,& + time_between_layers,max_layers,nstar,max_particles) if (max_particles > maxp) call fatal('windtunnel', 'maxp too small for this simulation, please increase MAXP!') diff --git a/src/setup/setup_windtunnel.f90 b/src/setup/setup_windtunnel.f90 index 4064fa553..2c8e20ba4 100644 --- a/src/setup/setup_windtunnel.f90 +++ b/src/setup/setup_windtunnel.f90 @@ -117,10 +117,10 @@ subroutine setpart(id,npart,npartoftype,xyzh,massoftype,vxyzu,polyk,gamma,hfact, stop 'please check and edit .setup file and rerun phantomsetup' endif - call check_setup(pmass,ierr) - if (ierr /= 0) call fatal('windtunnel','errors in setup parameters') pmass = Mstar / real(nstar) massoftype(igas) = pmass + call check_setup(pmass,ierr) + if (ierr /= 0) call fatal('windtunnel','errors in setup parameters') ! Initialise particle injection @@ -259,7 +259,7 @@ end subroutine read_setupfile !+ !----------------------------------------------------------------------- subroutine check_setup(pmass,ierr) - real, intent(in) :: pmass + real, intent(in) :: pmass integer, intent(out) :: ierr real :: min_layer_sep