1. Matthew Turk
  2. enzo-dev-problem-types

Commits

Matthew Turk  committed 418e1c2

Removed the bad timestepping information. Said -- as a result of equilibrium
species wreaking havoc -- that non-HI,H2I and ge fields can have up to but not
including 30% correction factor without manually inserting a timestep (the
timestepping algorithm will still catch any relevant problems, but it will take
more rejected steps before doing so) and changed tiny to 1e-35 in fortran.def.

Added optimizatiom but no symbol-stripping to the orange makefile.

Made sure that even below 0.8 GeV, we calculate a k1 rate. It is small, but
this avoids a sharp cutoff.

  • Participants
  • Parent commits 30f5a21
  • Branches popiii_colorfield

Comments (0)

Files changed (5)

File src/enzo/Make.mach.orange

View file
 
 MACH_OPT_WARN        = 
 MACH_OPT_DEBUG       = -g
-MACH_OPT_HIGH        = -O2
-MACH_OPT_AGGRESSIVE  = -O3
+MACH_OPT_HIGH        = -O2 -g
+MACH_OPT_AGGRESSIVE  = -O3 -g
 
 #-----------------------------------------------------------------------
 # Includes

File src/enzo/coll_rates.src

View file
       T_eV = T/11605
       log_T_eV = log(T_eV)
       
+      k1 = exp(-32.71396786375 
+     &     + 13.53655609057*log_T_eV
+     &     - 5.739328757388*log_T_eV**2 
+     &     + 1.563154982022*log_T_eV**3
+     &     - 0.2877056004391*log_T_eV**4
+     &     + 0.03482559773736999*log_T_eV**5
+     &     - 0.00263197617559*log_T_eV**6
+     &     + 0.0001119543953861*log_T_eV**7
+     &     - 2.039149852002e-6*log_T_eV**8) / kunit
+      
       IF (T_eV .GT. 0.8) THEN
-         k1 = exp(-32.71396786375 
-     &        + 13.53655609057*log_T_eV
-     &        - 5.739328757388*log_T_eV**2 
-     &        + 1.563154982022*log_T_eV**3
-     &        - 0.2877056004391*log_T_eV**4
-     &        + 0.03482559773736999*log_T_eV**5
-     &        - 0.00263197617559*log_T_eV**6
-     &        + 0.0001119543953861*log_T_eV**7
-     &        - 2.039149852002e-6*log_T_eV**8) / kunit
-         
          k3 = exp(-44.09864886561001
      &        + 23.91596563469*log_T_eV
      &        - 10.75323019821*log_T_eV**2
      &        + 0.0001975705312221*log_T_eV**7
      &        - 3.165581065665e-6*log_T_eV**8) / kunit
       ELSE
-         k1 = tiny
+         k1 = max(tiny, k1)
          k3 = tiny
          k4 = 3.92e-13/T_eV**0.6353 / kunit
          k5 = tiny

File src/enzo/fortran.def

View file
 #endif
 
 #ifdef CONFIG_PFLOAT_16
-#define tiny 1.0e-20
-#define huge 1.0e+20
+#define tiny 1.0e-35
+#define huge 1.0e+35
 #define REALSUB real*8
 #endif
 

File src/enzo/primordial_derivstep.inc

View file
               endif
               rejected(i) = .false.
               if(esterr(i).gt.1.0.or.abs(1.0d0-correctH(i)).gt.0.1)then
-                rejected(i)=.true.
+                if((mins(i).eq.6).or.(mins(i).eq.1).or.(mins(i).eq.7))
+     &            rejected(i)=.true.
+                if(abs(1.0d0-correctH(i)).gt.0.3)rejected(i)=.true.
               endif
 c              if(rejected(i).eqv..true.)then
 c                esterr(i) = max(esterr(i), 1.1)

File src/enzo/primordial_solver.src

View file
             endif
             dtit(i) = dt(i,j,k)/5.0
 #else
-            dtit(i) = dt
+            dtit(i) = dt/5.0
             subgridmask = 1
             itmask(i) = .true.
 #endif
 
             do i = is+1, ie+1
             if ((itmask(i).eqv..true.))then!.and.(eqmask(i).eqv..false.))then
-              rejected(i) = .false.
               if(iter.eq.1e6)then
 #ifdef PYFORT
                 write(0,*) 't',i,j,k,dtit(i)/dt(i,j,k),mins(i)
 #else
-                write(0,*) 't',i,j,k,dtit(i)/dt,mins(i)
+                write(0,*) 't',i,j,k,dtit(i)/dt,mins(i),ttot(i)/dt
 #endif
                 if(mins(i).gt.0)then
 #ifdef PYFORT
                   write(0,*)'q',dsp(i,mins(i)),dsq(i,mins(i)),
      & (dsq(i,mins(i))-dsp(i,mins(i)))/(dsq(i,mins(i))+dsp(i,mins(i)))
                   write(0,*)'p',tgas(i),gamma2(i),eqmask(i),s(i,mins(i))/d(i,j,k)
-                  write(0,*)'r',s(i,iH2I)/d(i,j,k)
+                  write(0,*)'r',s(i,iH2I)/d(i,j,k),rejected(i),correctH(i),correctHe(i)
+                  write(0,*)'x',esterr(i)
+                  do n = 1, ncspecies
+                    write(0,*) 'aa',n,s(i,n)/d(i,j,k),dsq(i,n),dsp(i,n),
+     &                        (dsq(i,n)-dsp(i,n))*dtit(i)/sp(i,n)
+                  enddo
                 endif
-c                do n = 1, ncspecies
-c                  write(0,*) 'aa',n,s(i,n)/d(i,j,k),dsq(i,n),dsp(i,n),
-c     &                      (dsq(i,n)-dsp(i,n))*dtit(i)/sp(i,n)
-c                enddo
               endif
+              rejected(i) = .false.
               if(iter.gt.1)then
                 tsc(i) = olddtit(i)/dtit(i) ! c
                 tsgamma(i) = (tsc(i)+1.0d0)/(tsc(i)+2.0d0) ! gamma
 #ifdef PYFORT
               dtit(i) = min(dt(i,j,k)-ttot(i),max(
      &                  0.5,min(2.0,0.8/sqrt(esterr(i))))*dtit(i))
-              dtit(i) = min(dt(i,j,k)/5.0, dtit(i))
-              dtit(i) = min(dt/5.0, dtit(i))
 #else
               dtit(i) = min(dt-ttot(i),max(
      &                  0.5,min(2.0,0.8/sqrt(esterr(i))))*dtit(i))
-              dtit(i) = min(dt/5.0, dtit(i))
 #endif
             endif
             enddo