| | 175 | SUBROUTINE ProblemModuleInit() |
| | 176 | INTEGER :: n,i,j,k,edge |
| | 177 | real(KIND=qPREC) :: rhoambient,pambient,mass,xloc(3),vel(3),alpha,radiusw |
| | 178 | integer :: grav_soft_rad |
| | 179 | TYPE(ProjectionDef), POINTER :: Projection |
| | 180 | NAMELIST/AmbientData/ rhoambient,pambient |
| | 181 | NAMELIST /ParticleData/ mass,xloc,vel,alpha,radiusw,grav_soft_rad |
| | 182 | NAMELIST/ProblemData/ outflowstarttime, outflowendtime, outflowdensity, mintracer |
| | 183 | open(unit=problem_data_handle,file='problem.data',status='old') |
| | 184 | read(problem_data_handle,nml=ProblemData) |
| | 185 | |
| | 186 | ! Make sure interpopts starts at zero for initial grid setup |
| | 187 | if (.not. lRestart) then |
| | 188 | InterpOpts=0 |
| | 189 | MinDensity=4d-6 ! << set mindensity higher to overwrite the odd spherical region, change to 1d-10 later in ProblemBeforeGlobalStep |
| | 190 | MinTemp=20 ! << set mintemp higher for frame 0, change to 10 later in ProblemBeforeGlobalStep |
| | 191 | end if |
| | 192 | |
| | 193 | if (lRestart) then |
| | 194 | particle=>SinkParticles%self ! handle to the particle |
| | 195 | Call addtracer(particle%outflowobj%iTracer,'Outflow_Tracer') ! <<< tracers need to be added in the same order when the code is restarted, but don't re-creat the particle - or the outflow object |
| | 196 | end if |
| | 197 | |
| | 198 | ! Physical bounds of boxes |
| | 199 | box_0=64000*reshape((/-1,-1,-1,1,1,1/),(/3,2/)) |
| | 200 | box_4=4000*reshape((/-1,-1,-1,1,1,1/),(/3,2/)) |
| | 201 | box_7=750*reshape((/-1,-1,-1,1,1,1/),(/3,2/)) |
| | 202 | |
| | 203 | ! index of boxes in each level's index space |
| | 204 | ibox_0=nint(box_0-spread(GxBounds(:,1),2,2))/levels(0)%dx + spread((/1,0/),1,3) |
| | 205 | if (maxlevel >= 4) then |
| | 206 | ibox_4=nint(box_4-spread(GxBounds(:,1),2,2))/levels(4)%dx + spread((/1,0/),1,3) |
| | 207 | if (maxlevel >= 7) then |
| | 208 | ibox_7=nint(box_7-spread(GxBounds(:,1),2,2))/levels(7)%dx + spread((/1,0/),1,3) |
| | 209 | end if |
| | 210 | end if |
| | 211 | |
| | 212 | CALL CreateRefinement(RefineJet) |
| | 213 | CALL CreateShape(RefineJet%shape, RECTANGULAR_PRISM, (/750d0,750d0,0d0/)) !position defaults to 0,0,0 |
| | 214 | RefineJet%type=REFINE_INSIDE |
| | 215 | |