I once had an international operations instructor screaming at me at the top of her lungs when I asked "where are we?" in response to her question about weather deviation procedures. Lost on many is that if you are in radar contact and talking to an air traffic controller, you should state your intentions and start from there. If you are not in radar contact and your only means of communication is via an ARINC radio operator or CPDLC, well then things change.
Most of these procedures are given in ICAO Doc 4444 §15.2, and are repeated below.
The basic concepts for contingencies are described in International Abnormal Procedures / Special Procedures for In-flight Contingencies in Oceanic Airspace.
What follows are quotes from the relevant regulatory documents, listed below.
ICAO Doc 4444 §15.2
Note.— The following procedures are intended for deviations around adverse meteorological conditions.
18.104.22.168.1 When the pilot initiates communications with ATC, a rapid response may be obtained by stating "WEATHER DEVIATION REQUIRED" to indicate that priority is desired on the frequency and for ATC response. When necessary, the pilot should initiate the communications using the urgency call "PAN PAN" (preferably spoken three times).
22.214.171.124.2 The pilot shall inform ATC when weather deviation is no longer required, or when a weather deviation has been completed and the aircraft has returned to its cleared route.
126.96.36.199.1 The pilot should notify ATC and request clearance to deviate from track, advising, when possible, the extent of the deviation expected.
188.8.131.52.2 ATC should take one of the following actions:
184.108.40.206.3 The pilot should take the following actions:
Note.— The provisions of this section apply to situations where a pilot needs to exercise the authority of a pilot-in-command under the provisions of Annex 2, 2.3.1.
If the aircraft is required to deviate from track to avoid adverse meteorological conditions and prior clearance cannot be obtained, an ATC clearance shall be obtained at the earliest possible time. Until an ATC clearance is received, the pilot shall take the following actions:
Note.— If, as a result of actions taken under the provisions of 220.127.116.11.1 b) and c), the pilot determines that there is another aircraft at or near the same flight level with which a conflict may occur, then the pilot is expected to adjust the path of the aircraft, as necessary, to avoid conflict.
Portions of this page can be found in the book International Flight Operations, Part VI, Chapter 6.
ICAO Doc 4444 - Air Traffic Management, Fourteenth Edition, Procedures for Air Navigation Services, International Civil Aviation Organization, 2001 *
ICAO Doc 4444 - Air Traffic Management, Fifteenth Edition, Procedures for Air Navigation Services, International Civil Aviation Organization, 2007 *
* Not all of Doc 4444 seems to have been reproduced in the 15th edition, so you might need to look at the 15th edition and then then 14th edition for some sections.
ICAO Doc 4444 - Amendment No. 1, Procedures for Air Navigation Services, International Civil Aviation Organization, Amendment No. 1, 2007
ICAO Doc 4444 - Amendment No. 2, Procedures for Air Navigation Services, International Civil Aviation Organization, Amendment No. 2, 19/11/09