here no SI_UNIT used by default, to be implemented eq_state_units by default, to be implemented
subroutine phys_units() use mod_global_parameters double precision :: mp, kB double precision :: a,b !> here no SI_UNIT used by default, to be implemented mp = mp_cgs kB = kB_cgs !> eq_state_units by default, to be implemented a = 1.d0+4.d0*He_abundance b = 2.d0+3.d0*He_abundance if(unit_density/=1.d0 .or. unit_numberdensity/=1.d0) then if(unit_density/=1.d0) then unit_numberdensity=unit_density/(a*mp) else if(unit_numberdensity/=1.d0) then unit_density=a*mp*unit_numberdensity end if if(unit_temperature/=1.d0) then unit_pressure=b*unit_numberdensity*kB*unit_temperature unit_velocity=dsqrt(unit_pressure/unit_density) if(unit_length/=1.d0) then unit_time=unit_length/unit_velocity else if(unit_time/=1.d0) then unit_length=unit_velocity*unit_time end if else if(unit_pressure/=1.d0) then unit_temperature=unit_pressure/(b*unit_numberdensity*kB) unit_velocity=dsqrt(unit_pressure/unit_density) if(unit_length/=1.d0) then unit_time=unit_length/unit_velocity else if(unit_time/=1.d0) then unit_length=unit_velocity*unit_time end if else if(unit_velocity/=1.d0) then unit_pressure=unit_density*unit_velocity**2 unit_temperature=unit_pressure/(b*unit_numberdensity*kB) if(unit_length/=1.d0) then unit_time=unit_length/unit_velocity else if(unit_time/=1.d0) then unit_length=unit_velocity*unit_time end if else if(unit_time/=1.d0) then unit_velocity=unit_length/unit_time unit_pressure=unit_density*unit_velocity**2 unit_temperature=unit_pressure/(b*unit_numberdensity*kB) end if else if(unit_temperature/=1.d0) then ! units of temperature and velocity are dependent if(unit_pressure/=1.d0) then unit_numberdensity=unit_pressure/(b*unit_temperature*kB) unit_density=a*mp*unit_numberdensity unit_velocity=dsqrt(unit_pressure/unit_density) if(unit_length/=1.d0) then unit_time=unit_length/unit_velocity else if(unit_time/=1.d0) then unit_length=unit_velocity*unit_time end if end if else if(unit_pressure/=1.d0) then if(unit_velocity/=1.d0) then unit_density=unit_pressure/unit_velocity**2 unit_numberdensity=unit_density/(a*mp) unit_temperature=unit_pressure/(b*unit_numberdensity*kB) if(unit_length/=1.d0) then unit_time=unit_length/unit_velocity else if(unit_time/=1.d0) then unit_length=unit_velocity*unit_time end if else if(unit_time/=0.d0) then unit_velocity=unit_length/unit_time unit_density=unit_pressure/unit_velocity**2 unit_numberdensity=unit_density/(a*mp) unit_temperature=unit_pressure/(b*unit_numberdensity*kB) end if end if unit_mass=unit_density*unit_length**3 if (tc_kappa0_par <= 0.0d0 .and. tc_kappa_par <= 0.0d0) & tc_kappa0_par = 8.0d-7 * unit_temperature**3.5d0 & / (unit_length * unit_density * unit_velocity**3.0d0) htc_Cchi = 0.823d0 * (4.753567596681522d6 / 20.0d0) & * unit_magneticfield * unit_temperature**1.5d0 / unit_numberdensity end subroutine phys_units