anchor.diff:          enddo
   
           ! Compute misfit for new model, save if the best model
  -        obj_new = misfit(slip_ssds) + shear_stress(slip_ssds)
  +        obj_new = misfit(slip_ssds) + stress_weight*shear_stress(slip_ssds)
           ! write(0,*) 'misfit:',misfit(slip_ssds),' shear_stress:',shear_stress(slip_ssds)
           if (obj_new.lt.obj_best) then
               slip_best = slip_new
  
positive.code:         slip_ssds(j,1) = slip_0(j)*dcos(rake_0(j)*d2r)
          slip_ssds(j,2) = slip_0(j)*dsin(rake_0(j)*d2r)
      enddo
      obj_0 = misfit(slip_ssds) + shear_stress(slip_ssds)
      obj_best = obj_0
      last_obj_best = 0
  
  
negative.code: 
      misfit = 0.0d0
  
      if (displacement%file.eq.'none'.and.displacement%flag.ne.'misfit') then
          return
      endif
  
  