83 CHARACTER(LEN=32),
PARAMETER ::
source_name =
"heating of planetary atmosphere"
84 REAL,
PARAMETER ::
au = 1.49597870691e+11
124 TYPE(
dict_typ),
POINTER :: config,IO
129 CALL getattr(config,
"stype", stype)
132 CALL this%Info(
"############################ ATTENTION ############################")
133 CALL this%Warning(
"sources_planetheating::InitSources",
"Untested module, use with care!")
136 SELECT TYPE (phys => physics)
140 CALL this%Error(
"InitSources_planetheating",
"physics not supported")
143 SELECT TYPE (const => physics%constants)
147 CALL this%Error(
"InitSources_planetheating",
"only SI units supported")
150 ALLOCATE(this%Q,this%cos1,this%sin1)
156 CALL getattr(config,
"cvis", this%cvis, 0.1)
158 CALL getattr(config,
"radflux", this%radflux)
160 CALL getattr(config,
"albedo", this%albedo)
162 CALL getattr(config,
"excentricity", this%excentricity, 0.0)
164 CALL getattr(config,
"semimajoraxis", this%sm_axis)
166 CALL getattr(config,
"omegasun", this%omegasun, 0.0)
168 CALL getattr(config,
"year", this%year)
170 CALL getattr(config,
"theta0", this%theta0, 0.0)
171 CALL getattr(config,
"phi0", this%phi0, 0.0)
173 SELECT TYPE (mgeo => mesh%Geometry)
176 this%cos1%data4d(:,:,:,1) = cos(mesh%bcenter(:,:,:,2))
178 this%sin1%data4d(:,:,:,1) = sin(mesh%bcenter(:,:,:,2))
182 this%cos1%data4d(:,:,:,1) = cos(mesh%bcenter(:,:,:,1))
184 this%sin1%data4d(:,:,:,1) = sin(mesh%bcenter(:,:,:,1))
187 CALL this%Error(
"InitSources_planetheating",
"only spherical geometry allowed")
195 this%Q%data1d(:) = 0.0
198 CALL this%SetOutput(mesh,config,io)
201 CALL this%InfoSources(mesh)
209 TYPE(
dict_typ),
POINTER :: config,IO
214 CALL getattr(config,
"output/Qstar", valwrite, 0)
215 IF (valwrite .EQ. 1) &
216 CALL setattr(io,
"Qstar", &
217 this%Q%data3d(mesh%IMIN:mesh%IMAX,mesh%JMIN:mesh%JMAX,mesh%KMIN:mesh%KMAX))
227 CHARACTER(LEN=32) :: param_str
229 REAL,
PARAMETER :: AU = 1.49597870691e+11
231 WRITE (param_str,
'(ES10.2)') this%year/(3.6e3*24*365.2425)
232 CALL this%Info(
" sid. year: " // trim(param_str) //
" yr")
234 IF (abs(this%omegasun).GT.tiny(this%omegasun))
THEN
235 WRITE (param_str,
'(ES10.2)') abs(1./(this%omegasun*3.6e3*24.0))
236 CALL this%Info(
" day: " // trim(param_str) //
" d")
238 CALL this%Info(
" day: " //
"infinite (tidally locked)")
241 WRITE (param_str,
'(ES10.2)') this%sm_axis/au
242 CALL this%Info(
" semi-major axis: " // trim(param_str) //
" au")
244 WRITE (param_str,
'(ES10.2)') this%excentricity
245 CALL this%Info(
" excentricity: " // trim(param_str))
247 WRITE (param_str,
'(ES10.2)') this%sm_axis/au*(1.+0.5*this%excentricity**2)
248 CALL this%Info(
" mean distance: " // trim(param_str) //
" au")
297 REAL,
INTENT(IN) :: time
301 REAL :: theta2,phi1,phi2,r,mean_anomaly,true_anomaly
304 IF (time.NE.this%time)
THEN
306 CALL kepler(time,this%year,this%excentricity,this%sm_axis,r,true_anomaly)
308 DO k=mesh%KMIN,mesh%KMAX
309 DO j=mesh%JMIN,mesh%JMAX
310 DO i=mesh%IMIN,mesh%IMAX
312 phi1=mesh%bcenter(i,j,k,2) + 2.*pi*this%omegasun*this%time
314 theta2 = acos(this%cos1%data4d(i,j,k,1)*cos(this%theta0*&
315 cos(2*pi*this%time/this%year)) + &
316 this%sin1%data4d(i,j,k,1)*sin(this%theta0*&
317 cos(2*pi*this%time/this%year))*cos(phi1-this%phi0))
320 phi2 = modulo(atan2(this%sin1%data4d(i,j,k,1)*sin(phi1-this%phi0),&
321 (-this%cos1%data4d(i,j,k,1)*sin(this%theta0*cos(2.*pi*this%time/&
322 this%year)) + this%sin1%data4d(i,j,k,1)*cos(phi1-this%phi0)*&
323 cos(this%theta0*cos(2*pi*this%time/this%year)))),2*pi)
327 IF (phi2.LE.pi/2..OR.phi2.GE.3./2.*pi)
THEN
331 this%Q%data3d(i,j,k) = (1.-this%albedo)*this%radflux * (
au/r)**2 &
332 *sin(theta2)*cos(phi2)
334 this%Q%data3d(i,j,k) = 0.0
350 DEALLOCATE(this%cos1,this%sin1)
Dictionary for generic data types.
module for SI units and physical constants
base module for numerical flux functions
defines properties of a 3D spherical mesh
defines properties of a 3D spherical mesh
source terms module for gravitational acceleration due to two pointmasses
pure subroutine, public kepler(time, period, excent, semax, r, phi)
solve Kepler-Equation and return new distance r and position angle phi
subroutine finalize(this)
Destructor of logging_base class.
base class for mesh arrays
derived class for compound of mesh arrays
subroutine setoutput(this, config, IO)
Setup mesh fields for i/o.
physics module for 1D,2D and 3D non-isothermal Euler equations
generic source terms module providing functionaly common to all source terms
source terms module for simple optically thin cooling
subroutine initsources(this, Mesh, Physics, Fluxes, config, IO)
subroutine updatecooling(this, Mesh, Physics, time, pvar)
Updates the cooling function at each time step.
character(len=32), parameter source_name
heating of a planet by a star
subroutine updateplanetheating(this, Mesh, Physics, time, pvar)
Updates the heating for a given time.
subroutine infosources(this, Mesh)