anchor.diff:      write(*,'('' Chest wall RV = '',F8.3,'' L'')') chestwall_restvol/1.0e+6_dp
           
       call write_flow_step_results(init_vol, &
  -         current_vol,ppl_current,pptrans,Pcw,p_mus,0.0_dp,0.0_dp)
  +         current_vol,ppl_current,pptrans,Pcw,P_muscle,0.0_dp,0.0_dp)
       
       continue = .true.
       do while (continue)
          n = n + 1 ! increment the breath number
          ttime = 0.0_dp ! each breath starts with ttime=0
          endtime = ventilation_values%time_breath * dble(n) - 0.5_dp * dt ! the end time of this breath
  -       p_mus = 0.0_dp 
  +       P_muscle = 0.0_dp
          ptrans_frc = SUM(unit_field(nu_pe,1:num_units))/num_units !ptrans at frc
   
          if(n.gt.1)then !write out 'end of breath' information
  
positive.code:             lung_mechanics%b)**2.0_dp *(lambda**2.0_dp-1.0_dp)**2.0_dp/lambda**2.0_dp+(3.0_dp* &
              lung_mechanics%a+lung_mechanics%b) *(lambda**2.0_dp+1.0_dp)/lambda**4.0_dp)
         unit_field(nu_comp,nunit) = undef/unit_field(nu_comp,nunit) ! V/P
         ! add the chest wall (proportionately) in parallel
         unit_field(nu_comp,nunit) = 1.0_dp/(1.0_dp/unit_field(nu_comp,nunit)&
              +1.0_dp/(lung_mechanics%chest_wall_compliance/dble(num_units)))
         !estimate an elastic recoil pressure for the unit
         unit_field(nu_pe,nunit) = lung_mechanics%c/2.0_dp*(3.0_dp*lung_mechanics%a + &
              lung_mechanics%b)*(lambda**2.0_dp -1.0_dp)*exp_term/lambda
  
negative.code:           
            if(abs(ventilation_values%tidal_volume).gt.1.0e-5_dp)THEN
               ! modify driving muscle pressure by volume_target/sum_tidal
               ! this increases P_muscle for volume_target>sum_tidal, and
               ! decreases P_muscle for volume_target<sum_tidal
               ventilation_values%factor_P_muscle_insp = ventilation_values%factor_P_muscle_insp * &
                    abs(ventilation_values%tidal_volume/sum_tidal)
               ventilation_values%factor_P_muscle_expn = ventilation_values%factor_P_muscle_expn * &
  