Skip to content

Commit

Permalink
(blob) build failures fixed, routines work when changing precision of…
Browse files Browse the repository at this point in the history
… real variables
  • Loading branch information
danieljprice committed Jul 17, 2020
1 parent 931aded commit 238e588
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/main/dust_formation.F90
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ subroutine calc_kappa_dust(K3, Tdust, rho_cgs, kappa_cgs)

!carbon fraction
!fC = max(1.d-15,K3/eps(iC))
fac = max(0.75*K3*mc/(mass_per_H*rho_Cdust),1.d-15)
fac = max(0.75*K3*mc/(mass_per_H*rho_Cdust),1.e-15)

!kappa = Qplanck_abs *fac ! planck
!kappa = Qross_ext * fac ! Rosseland
Expand Down Expand Up @@ -438,7 +438,7 @@ real function psat_C(T)
real :: T2,T3,pC1!,pC2,pC3,pC4,pC5

if (T > 1.d4) then
Psat_C = 1.d99
Psat_C = huge(Psat_C)
else
T2 = T*T
T3 = T*T2
Expand Down
12 changes: 6 additions & 6 deletions src/main/ptmass_radiation.F90
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ module ptmass_radiation
public :: get_dust_temperature_from_ptmass
private
integer, parameter :: N = 1024
double precision, parameter :: theta = 0., phi = 0.
double precision, parameter :: u(3) = (/ sin(theta)*cos(phi), sin(theta)*sin(phi), cos(theta) /)
real, parameter :: theta = 0., phi = 0.
real, parameter :: u(3) = (/ sin(theta)*cos(phi), sin(theta)*sin(phi), cos(theta) /)

contains
!-----------------------------------------------------------------------
Expand Down Expand Up @@ -217,7 +217,7 @@ subroutine get_Teq_from_Lucy(npart,xyzh,xa,ya,za,R_star,T_star,dust_temp)

!.. find particles that lie within 2 smoothing lengths of the ray axis
r0(1:3) = (/xa, ya, za/)
dmin = 1.d99
dmin = huge(dmin)
dmax = 0
naxis = 0
!$omp parallel do default(none) &
Expand Down Expand Up @@ -275,7 +275,7 @@ subroutine calculate_Teq(N, dmax, R_star, T_star, rho, rho_over_r2, OR, Teq, K3)

real :: OR(N),tau_prime(N),vTeq(N),kappa(N),dTeq,rho_m
real :: dr, fact
real, parameter :: tol = 1.d-2, kap_gas = 2.d-4
real, parameter :: tol = 1.e-2, kap_gas = 2.e-4
integer :: i,istart,iter


Expand Down Expand Up @@ -310,8 +310,8 @@ subroutine calculate_Teq(N, dmax, R_star, T_star, rho, rho_over_r2, OR, Teq, K3)
#endif
rho_m = (rho_over_r2(N-i)+rho_over_r2(N-i+1)+rho_over_r2(N+i+1)+rho_over_r2(N+i+2))
tau_prime(i) = tau_prime(i+1) + fact*(kappa(i)+kap_gas)*rho_m
Teq(i) = T_star*(0.5*(1.-sqrt(1.-(R_star/OR(i))**2)) + 0.75*tau_prime(i))**(1./4.)
dTeq = max(dTeq,abs(1.-Teq(i)/(1.d-5+vTeq(i))))
Teq(i) = T_star*(0.5*(1.-sqrt(1.-(R_star/OR(i))**2)) + 0.75*tau_prime(i))**0.25
dTeq = max(dTeq,abs(1.-Teq(i)/(1.e-5+vTeq(i))))
vTeq(i) = Teq(i)
enddo
enddo
Expand Down
2 changes: 1 addition & 1 deletion src/main/step_leapfrog.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,7 @@ subroutine step_extern(npart,ntypes,dtsph,dtextforce,xyzh,vxyzu,fext,fxyzu,time,
!
! Get updated abundances of all species, updates 'chemarrays',
!
dphot = get_dphot(dphotflag,dphot0,xyzh(1,i),xyzh(2,i),xyzh(3,i))
dphot = get_dphot(dphotflag,real(dphot0),xyzh(1,i),xyzh(2,i),xyzh(3,i))
call update_abundances(vxyzu(4,i),rhoh(xyzh(4,i),pmassi),abundance(:,i),&
nabundances,dphot,dt,abundi,nabn,gmwvar,abundc,abunde,abundo,abundsi)
endif
Expand Down

0 comments on commit 238e588

Please sign in to comment.