anchor.diff:                  e2 = e1
               endif
   
  +            ! If the energy is good enough, run FEMSIM and re-evaluate the acceptance
               if(energy_accepted) then
                   call fem_update(m, atom, res, k, vk, scatfact_e, communicator, istat)
   
  
positive.code:             ! to be accepted.
              ! This can save an entire call to fem_update.
              energy_accepted = .true.
              if(log(1.0-randnum) > -(te2-chi2_old)*beta) then
                  energy_accepted = .false.
                  accepted = .false.
                  call reject_position(m, atom, xx_cur, yy_cur, zz_cur)
  
negative.code:                 else
                      ! Based on the random number above, even if del_chi is negative, decide
                      ! whether to accept or not.
                      if(log(randnum) < -del_chi*beta) then
                          ! Accept move
                          call fem_accept_move()
                          e1 = e2 ! eam
  