Initialize the module
subroutine phys_init() use mod_global_parameters ! use mod_particles, only: particles_init use mod_radiative_cooling, only: rc_fl, radiative_cooling_init_params, radiative_cooling_init call read_params(par_files) call phys_units() phys_energy = hd_energy phys_total_energy = hd_energy phys_internal_e = .false. phys_gamma = hd_gamma phys_partial_ionization=hd_partial_ionization gamma_1 = hd_gamma - 1.0d0 inv_gamma_1 = 1.0d0/gamma_1 use_particles = hd_particles ! Determine flux variables rho_ = var_set_rho() allocate(mom(ndir)) mom(:) = var_set_momentum(ndir) ! Set index of energy variable if (hd_energy) then e_ = var_set_energy() p_ = e_ else e_ = -1 p_ = -1 end if ! Whether diagonal ghost cells are required for the physics phys_req_diagonal = .false. if (hd_force_diagonal) then ! ensure corners are filled, otherwise divide by zero when getting primitives ! --> only for debug purposes phys_req_diagonal = .true. endif tracer(1) = var_set_fluxvar("trc", "trp", 1, need_bc=.false.) ! set number of variables which need update ghostcells nwgc=nwflux ! Define custom flux types: if (.not. allocated(flux_type)) then allocate(flux_type(ndir, nw_flux)) flux_type = flux_default else if (any(shape(flux_type) /= [ndir, nw_flux])) then call mpistop("phys_check error: flux_type has wrong shape") end if ! use cycle, needs to be dealt with: ! ! Initialize particles module ! if (hd_particles) then ! call particles_init() ! phys_req_diagonal = .true. ! end if nvector = 1 ! No. vector vars allocate(iw_vector(nvector)) iw_vector(1) = mom(1) - 1 call radiative_cooling_init_params(phys_gamma,He_abundance) call radiative_cooling_init(rc_fl) end subroutine phys_init