Flight Crew Air Transport Pilot (ATP)
Situational Awareness; Distraction; Communication Breakdown; Confusion
ATC Issue All Types; Conflict Airborne Conflict; Deviation / Discrepancy - Procedural Clearance
Air Traffic Control Issued New Clearance; Flight Crew FLC Overrode Automation; Flight Crew Took Evasive Action; Flight Crew Requested ATC Assistance / Clarification
Procedure; Weather
An airplane departed before us and was cleared to fly 210 heading after departure.  We were cleared for takeoff; runway heading.  Passing 1;000 feet Tower turned us to 230 heading and we called Departure.  Departure cleared us to 9;000 feet and in a few minutes turned us to a 210 heading.  He mentioned that when we passed 8;000 we could expect a turn to DITCH.  At some point he turned us to heading 190. I was hand flying and increased rate through 8;000 and Departure said something to the effect that traffic was no factor; cleared to DITCH.  Sometime between 8;000 and 9;000 I engaged autopilot. Approaching 9;000 TCAS called 'traffic' and within a few seconds called 'descend; descend'. I disengaged autopilot; called for Flight directors off and flew to the green Vertical Speed commanded which was about 2;000fpm down; maybe more.  Around 8;400 feet TCAS commanded monitor vertical speed then clear of conflict.  The First Officer looked outside for traffic but due clouds saw nothing.  He reported that on the Navigation Display the traffic was very close; less than .25 miles and showed 100 feet above. We resumed the climb and ATC cleared us to 12;000.I have no idea why this occurred.  The crew; all three of us; felt we flew that we were cleared lateral and vertical path described above.
TCAS gave us descend command of at least 2;000FPM. The RA icon was right on us and read 0 feet. The Captain responded to the alert and when the RA icon passed our nose it was red and read 1. We recovered about 8;400 feet and were given a clearance back to 9;000 and direct Ditch. Continued flight without any more problems.
An air carrier crew departed PHL in IMC and near 9;000 feet followed a TCAS RA generated by a very close airborne conflict with another air carrier aircraft which had departed before them.