<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Precipitation in the Meteorology component
Goal
Step1:  Import the Babel-wrapped Meteorology component and create an instance
Step2:  Initialize the model.
Step3:  The initial model precipitation volume flux is the first value from precip_rates.txt
Step4:  Advance the model to the end, saving the model time and output P values (converted back to mm/hr for convenience) at each step
Step5:  Check the time and flux values (noting that I've included the time = 0.0 value here)
<ASSISTANT_TASK:>
Python Code:
mps_to_mmph = 1000 * 3600
Explanation: Precipitation in the Meteorology component
Goal: In this example, I give the Meteorology component a grid sequence of linearly increasing precipitation values and check whether it produces output when the model state is updated.
Define a helpful constant:
End of explanation
from cmt.components import Meteorology
met = Meteorology()
Explanation: Import the Babel-wrapped Meteorology component and create an instance:
End of explanation
%cd input
met.initialize('meteorology-P-linear.cfg')
Explanation: Initialize the model.
End of explanation
bprecip = met.get_value('atmosphere_water__precipitation_leq-volume_flux')
print type(bprecip)
print bprecip.size
print bprecip.shape
bprecip * mps_to_mmph
Explanation: The initial model precipitation volume flux is the first value from precip_rates.txt:
End of explanation
time = [met.get_current_time()]
flux = [bprecip.max() * mps_to_mmph]
count = 1
while met.get_current_time() < met.get_end_time():
    met.update(met.get_time_step()*count)
    time.append(met.get_current_time())
    flux.append(met.get_value('atmosphere_water__precipitation_leq-volume_flux').max() * mps_to_mmph)
    count += 1
Explanation: Advance the model to the end, saving the model time and output P values (converted back to mm/hr for convenience) at each step:
End of explanation
time
flux
Explanation: Check the time and flux values (noting that I've included the time = 0.0 value here):
End of explanation
<END_TASK>