Initialize the module
subroutine phys_init() use mod_global_parameters integer :: idir call read_params(par_files) call phys_units() phys_energy = .true. phys_total_energy = .true. phys_gamma = srhd_gamma gamma_1=srhd_gamma-1.0d0 inv_gamma_1=1.0d0/gamma_1 gamma_to_gamma_1=srhd_gamma/gamma_1 phys_internal_e=.false. phys_partial_ionization=.false. need_global_cmax=.false. ! Whether diagonal ghost cells are required for the physics phys_req_diagonal = .false. use_particles = srhd_particles ! Determine flux variables rho_ = var_set_rho() d_=rho_ allocate(mom(ndir)) mom(:) = var_set_momentum(ndir) ! Set index of energy variable e_ = var_set_energy() p_ = e_ ! Register tracer fields tracer(1) = var_set_fluxvar("trc", "trp", 1, need_bc=.false.) ! Set index for auxiliary variables ! MUST be after the possible tracers (which have fluxes) xi_ = var_set_auxvar('xi','xi') lfac_= var_set_auxvar('lfac','lfac') ! set number of variables which need update ghostcells nwgc=nwflux+nwaux ! 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 nvector = 1 ! No. vector vars allocate(iw_vector(nvector)) iw_vector(1) = mom(1) - 1 ! use cycle, needs to be dealt with: ! ! Initialize particles module ! if (srhd_particles) then ! call particles_init() ! phys_req_diagonal = .true. ! end if end subroutine phys_init