  Water is an important molecule in interstellar and circumstellar
environments. Previous observations of mid-infrared rotational lines of OH
suggest that these lines may be used to probe the photodissociation of water.
In this work, cross sections for the photodissociation of H$_2$O resolving the
state of the OH fragment are collected and incorporated in a new molecular
excitation code called GROSBETA, which includes radiative pumping, collisional
(de)excitation, and prompt emission (i.e., following the production of OH in
excited states). We find that the OH rotational line intensities in the range
9-16$\mu$m, covering rotational transitions with $N_{up}=18$ to 45, are
proportional to the column density of H$_2$O photodissociated per second by
photons in the range 114-143nm and do not depend on other local properties.
Provided an independent measurement of the column density of water is
available, the strength of the local UV radiation field can be deduced with
good accuracy. In contrast, the OH lines at longer far-infrared wavelengths are
primarily produced by IR radiative pumping and collisions. Our model
successfully reproduces the OH mid-IR lines in the $10-16\mu$m range observed
by Spitzer toward the tip of the HH 211 bow-shock and shows that the jet shock
irradiates its surroundings, exposing H$_2$O to a UV photon flux that is about
$5 \times 10^3$ times larger than the standard interstellar radiation field. We
also find that chemical pumping by the reaction H$_2$ + O may supplement the
excitation of lines in the range $16-30\mu$m. The mid-infrared lines of OH
constitute a powerful diagnostic for inferring the photodissociation rate of
water and thus the UV field water is exposed to. Future JWST-MIRI observations
will be able to map the photodestruction rate of H$_2$O in various dense and
irradiated environments and provide robust estimates of the local UV radiation
field.
