User: cott Date: 2010/11/17 05:07 PM
Modified: /branches/hot_and_MHD_temp_dev/ param.ccl, schedule.ccl /branches/hot_and_MHD_temp_dev/src/ GRHydro_Boundaries.F90, GRHydro_Con2Prim.F90, GRHydro_ParamCheck.F90, Utils.F90
Log: * better error handling in c2p: implement a temporary hack to deal with boundary zones in octant symmetry; this will be removed once we have a sensible Carpet mask.
* fix boundary issues concerning temperature and entropy
File Changes:
Directory: /branches/hot_and_MHD_temp_dev/ ==========================================
File [modified]: param.ccl Delta lines: +6 -0 =================================================================== --- branches/hot_and_MHD_temp_dev/param.ccl 2010-11-16 22:44:45 UTC (rev 177) +++ branches/hot_and_MHD_temp_dev/param.ccl 2010-11-17 23:07:08 UTC (rev 178) @@ -545,3 +545,9 @@ { 0:* :: "Any value, but one to 12 is preferred" } 1.0 + +############### temporary parameters to be removed once connected issues are fixed. + +boolean con2prim_oct_hack "Disregard c2p failures in oct/rotsym90 boundary cells with xyz < 0" STEERABLE=ALWAYS +{ +} "no"
File [modified]: schedule.ccl Delta lines: +4 -19 =================================================================== --- branches/hot_and_MHD_temp_dev/schedule.ccl 2010-11-16 22:44:45 UTC (rev 177) +++ branches/hot_and_MHD_temp_dev/schedule.ccl 2010-11-17 23:07:08 UTC (rev 178) @@ -878,15 +878,10 @@ } "Calculate current refinement level"
#debug -### schedule GRHydro_Debug IN MoL_PostRHS AFTER dissipation_add -### { -### LANG: Fortran -### } "debug" -### -### schedule GRHydro_Debug AS guender IN MoL_Step AFTER MoL_Add -### { -### LANG: Fortran -### } "debug" +###schedule GRHydro_Debug IN ZelmaniLeakChangeYe BEFORE ZelmaniLeak_ye_of_rho +###{ +### LANG: Fortran +###} "debug"
schedule GRHydro_RefinementLevel AT CCTK_PostStep { @@ -1286,13 +1281,3 @@ { } "Calculate the stress-energy tensor"
- -###schedule GRH_debug in CCTK_POSTPOSTINITIAL -###{ -### LANG: Fortran -###} "Do some debugging" -### -###schedule GRH_debug in MoL_Step AFTER MoL_InitRHS BEFORE MoL_CalcRHS -###{ -### LANG: Fortran -###} "Do some debugging"
Directory: /branches/hot_and_MHD_temp_dev/src/ ==============================================
File [modified]: GRHydro_Boundaries.F90 Delta lines: +22 -3 =================================================================== --- branches/hot_and_MHD_temp_dev/src/GRHydro_Boundaries.F90 2010-11-16 22:44:45 UTC (rev 177) +++ branches/hot_and_MHD_temp_dev/src/GRHydro_Boundaries.F90 2010-11-17 23:07:08 UTC (rev 178) @@ -47,7 +47,7 @@ DECLARE_CCTK_FUNCTIONS
integer, dimension(3) :: sym - integer :: ierr + integer :: ierr = 0 integer :: itracer
character(len=100) tracername @@ -76,6 +76,10 @@ call SetCartSymGN(ierr, cctkGH, sym, "GRHydro::Y_e_con") endif
+ if(evolve_temper.ne.0) then + call SetCartSymGN(ierr, cctkGH, sym, "HydroBase::temperature") + call SetCartSymGN(ierr, cctkGH, sym, "HydroBase::entropy") + endif
sym(1) = -1 sym(2) = 1 @@ -160,13 +164,21 @@ "GRHydro::GRHydro_cons_tracers", "Flat") endif
- if(CCTK_EQUALS(Y_e_evolution_method,"GRHydro")) then + if(evolve_y_e) then ierr = Boundary_SelectGroupForBC(cctkGH, faces, GRHydro_stencil, -ione, & "HydroBase::Y_e", "Flat") ierr = Boundary_SelectGroupForBC(cctkGH, faces, GRHydro_stencil, -ione, & "GRHydro::Y_e_con", "Flat") endif
+ if(evolve_temper) then + ierr = Boundary_SelectGroupForBC(cctkGH, faces, GRHydro_stencil, -ione, & + "HydroBase::temperature", "Flat") + ierr = Boundary_SelectGroupForBC(cctkGH, faces, GRHydro_stencil, -ione, & + "HydroBase::entropy", "Flat") + endif + + endif
if (CCTK_EQUALS(bound,"none")) then @@ -194,13 +206,20 @@ "GRHydro::GRHydro_cons_tracers", "None") endif
- if(CCTK_EQUALS(Y_e_evolution_method,"GRHydro")) then + if(evolve_y_e) then ierr = Boundary_SelectGroupForBC(cctkGH, faces, GRHydro_stencil, -ione, & "HydroBase::Y_e", "None") ierr = Boundary_SelectGroupForBC(cctkGH, faces, GRHydro_stencil, -ione, & "GRHydro::Y_e_con", "None") endif
+ if(evolve_temper) then + ierr = Boundary_SelectGroupForBC(cctkGH, faces, GRHydro_stencil, -ione, & + "HydroBase::temperature", "None") + ierr = Boundary_SelectGroupForBC(cctkGH, faces, GRHydro_stencil, -ione, & + "HydroBase::entropy", "None") + endif + end if
if (CCTK_EQUALS(bound,"scalar")) then
File [modified]: GRHydro_Con2Prim.F90 Delta lines: +45 -31 =================================================================== --- branches/hot_and_MHD_temp_dev/src/GRHydro_Con2Prim.F90 2010-11-16 22:44:45 UTC (rev 177) +++ branches/hot_and_MHD_temp_dev/src/GRHydro_Con2Prim.F90 2010-11-17 23:07:08 UTC (rev 178) @@ -493,17 +493,30 @@ character(len=200) warnline logical epsnegative
+ integer :: failwarnmode = 0 + integer :: failinfomode = 1 + ! begin EOS Omni vars integer :: n = 1 integer :: keytemp = 0 integer :: anyerr = 0 integer :: keyerr(1) = 0 real*8 :: xpress = 0.0d0 + real*8 :: temp0 = 0.0d0 ! end EOS Omni vars
! set pmin and epsmin to something sensible: pmin = 1.0d-28 epsmin = 1.0e-5 + + + if(con2prim_oct_hack.ne.0.and.& + x .lt. 0.0d0 .or.& + y .lt. 0.0d0 .or.& + z .lt. 0.0d0) then + failwarnmode = 2 + failinfomode = 2 + endif
!!$ Undensitize the variables
@@ -516,21 +529,22 @@ 2.*usx*usz*uxz + 2.*usy*usz*uyz
!!$ Set initial guess for pressure: + temp0 = temp call EOS_Omni_press(handle,keytemp,GRHydro_eos_rf_prec,n,& rho,epsilon,temp,ye,xpress,keyerr,anyerr) pold = max(1.d-15,xpress) ! error handling if(anyerr.ne.0) then - call CCTK_WARN(1,"EOS error in c2p 0") + call CCTK_WARN(failinfomode,"EOS error in c2p 0") write(warnline,"(3i5,1P10E15.6)") ii,jj,kk,x,y,z - call CCTK_WARN(1,warnline) - write(warnline,"(1P10E15.6)") rho,dens,epsilon,temp,ye - call CCTK_WARN(1,warnline) + call CCTK_WARN(failinfomode,warnline) + write(warnline,"(1P10E15.6)") rho,dens,epsilon,temp,temp0,ye + call CCTK_WARN(failinfomode,warnline) write(warnline,"(A7,i8)") "code: ",keyerr(1) - call CCTK_WARN(1,warnline) + call CCTK_WARN(failinfomode,warnline) write(warnline,"(A10,i5)") "reflevel: ", GRHydro_reflevel - call CCTK_WARN(1,warnline) - call CCTK_WARN(0,"Aborting!!!") + call CCTK_WARN(failinfomode,warnline) + call CCTK_WARN(failwarnmode,"Aborting!!!") endif
@@ -564,16 +578,16 @@ rho,epsilon,temp,ye,xpress,keyerr,anyerr) ! error handling if(anyerr.ne.0) then - call CCTK_WARN(1,"EOS error in c2p 1") + call CCTK_WARN(failinfomode,"EOS error in c2p 1") write(warnline,"(3i5,1P10E15.6)") ii,jj,kk,x,y,z - call CCTK_WARN(1,warnline) + call CCTK_WARN(failinfomode,warnline) write(warnline,"(1P10E15.6)") rho,epsilon,temp,ye - call CCTK_WARN(1,warnline) + call CCTK_WARN(failinfomode,warnline) write(warnline,"(A7,i8)") "code: ",keyerr(1) - call CCTK_WARN(1,warnline) + call CCTK_WARN(failinfomode,warnline) write(warnline,"(A10,i5)") "reflevel: ", GRHydro_reflevel - call CCTK_WARN(1,warnline) - call CCTK_WARN(0,"Aborting!!!") + call CCTK_WARN(failinfomode,warnline) + call CCTK_WARN(failwarnmode,"Aborting!!!") endif
f = pold - xpress @@ -592,16 +606,16 @@ GRHydro_C2P_failed = 1
!$OMP CRITICAL - call CCTK_WARN(1, 'count > GRHydro_countmax! ') + call CCTK_WARN(failinfomode, 'count > GRHydro_countmax! ') write(warnline,'(a28,i2)') 'on carpet reflevel: ',GRHydro_reflevel - call CCTK_WARN(1,warnline) + call CCTK_WARN(failinfomode,warnline) write(warnline,'(a20,3g16.7)') 'xyz location: ',x,y,z - call CCTK_WARN(1,warnline) + call CCTK_WARN(failinfomode,warnline) write(warnline,'(a20,3i5)') 'ijk location: ',ii,jj,kk - call CCTK_WARN(1,warnline) + call CCTK_WARN(failinfomode,warnline) write(warnline,'(a20,g16.7)') 'radius: ',r - call CCTK_WARN(1,warnline) - call CCTK_WARN(1,"Setting the point to atmosphere") + call CCTK_WARN(failinfomode,warnline) + call CCTK_WARN(failinfomode,"Setting the point to atmosphere") !$OMP END CRITICAL
! for safety, let's set the point to atmosphere @@ -653,16 +667,16 @@ rho,epsilon,temp,ye,xpress,keyerr,anyerr) ! error handling if(anyerr.ne.0) then - call CCTK_WARN(1,"EOS error in c2p 2") + call CCTK_WARN(failinfomode,"EOS error in c2p 2") write(warnline,"(3i5,1P10E15.6)") ii,jj,kk,x,y,z - call CCTK_WARN(1,warnline) + call CCTK_WARN(failinfomode,warnline) write(warnline,"(1P10E15.6)") rho,epsilon,temp,ye - call CCTK_WARN(1,warnline) + call CCTK_WARN(failinfomode,warnline) write(warnline,"(A7,i8)") "code: ",keyerr(1) - call CCTK_WARN(1,warnline) + call CCTK_WARN(failinfomode,warnline) write(warnline,"(A10,i5)") "reflevel: ", GRHydro_reflevel - call CCTK_WARN(1,warnline) - call CCTK_WARN(0,"Aborting!!!") + call CCTK_WARN(failinfomode,warnline) + call CCTK_WARN(failwarnmode,"Aborting!!!") endif
f = pnew - xpress @@ -702,16 +716,16 @@
! error handling if(anyerr.ne.0) then - call CCTK_WARN(1,"EOS error in c2p 3") + call CCTK_WARN(failinfomode,"EOS error in c2p 3") write(warnline,"(3i5,1P10E15.6)") ii,jj,kk,x,y,z - call CCTK_WARN(1,warnline) + call CCTK_WARN(failinfomode,warnline) write(warnline,"(1P10E15.6)") rho,epsilon,temp,ye - call CCTK_WARN(1,warnline) + call CCTK_WARN(failinfomode,warnline) write(warnline,"(A7,i8)") "code: ",keyerr(1) - call CCTK_WARN(1,warnline) + call CCTK_WARN(failinfomode,warnline) write(warnline,"(A10,i5)") "reflevel: ", GRHydro_reflevel - call CCTK_WARN(1,warnline) - call CCTK_WARN(0,"Aborting!!!") + call CCTK_WARN(failinfomode,warnline) + call CCTK_WARN(failwarnmode,"Aborting!!!") endif
File [modified]: GRHydro_ParamCheck.F90 Delta lines: +0 -1 =================================================================== --- branches/hot_and_MHD_temp_dev/src/GRHydro_ParamCheck.F90 2010-11-16 22:44:45 UTC (rev 177) +++ branches/hot_and_MHD_temp_dev/src/GRHydro_ParamCheck.F90 2010-11-17 23:07:08 UTC (rev 178) @@ -105,6 +105,5 @@ endif
- end subroutine GRHydro_ParamCheck
File [modified]: Utils.F90 Delta lines: +11 -19 =================================================================== --- branches/hot_and_MHD_temp_dev/src/Utils.F90 2010-11-16 22:44:45 UTC (rev 177) +++ branches/hot_and_MHD_temp_dev/src/Utils.F90 2010-11-17 23:07:08 UTC (rev 178) @@ -31,29 +31,21 @@
implicit none DECLARE_CCTK_ARGUMENTS - integer loc(3) + integer i,j,k
- loc = minloc(y_e_con/dens) -#if 0 - write(6,*) minval(y_e_con/dens) - write(6,*) y_e_con_rhs(loc(1),loc(2),loc(3)),densrhs(loc(1),loc(2),loc(3)) - write(6,*) y_e_con(loc(1),loc(2),loc(3)),dens(loc(1),loc(2),loc(3)) - write(6,*) loc - write(6,*) dens(4,5,5),y_e(4,5,5),y_e_con(4,5,5) - write(6,*) x(loc(1),loc(2),loc(3)),y(loc(1),loc(2),loc(3)),z(loc(1),loc(2),loc(3)) -#endif - loc(1) = 4 - loc(2) = 5 - loc(3) = 4 - write(6,*) minval(y_e_con/dens) - write(6,*) y_e_con_rhs(loc(1),loc(2),loc(3)),densrhs(loc(1),loc(2),loc(3)) - write(6,*) y_e_con(loc(1),loc(2),loc(3)),dens(loc(1),loc(2),loc(3)) - write(6,*) loc - write(6,*) dens(4,5,5),y_e(4,5,5),y_e_con(4,5,5) - write(6,*) x(loc(1),loc(2),loc(3)),y(loc(1),loc(2),loc(3)),z(loc(1),loc(2),loc(3)) + GRHydro_reflevel = aint(log10(dble(cctk_levfac(1)))/log10(2.0d0))
+ i=25 + j=3 + k=3 + write(6,"(i4,1P10E15.6)") GRHydro_reflevel, temperature(i,j,k),temperature(i,j,k),temperature(i,j,k) + write(6,"(i4,1P10E15.6)") GRHydro_reflevel, rho(i,j,k) + write(6,"(3i4)") cctk_lsh(1),cctk_lsh(2),cctk_lsh(3)
call flush(6) +! if(GRHydro_reflevel.eq.4.and.temperature(1,1,1).lt.0.1d0) then +! call CCTK_WARN(0,"stop") +! endif
end subroutine GRHydro_Debug