<p><b>laura@ucar.edu</b> 2012-02-29 12:28:22 -0700 (Wed, 29 Feb 2012)</p><p>added the option of using config_bucket_rainc and config_bucket_rainnc to limit the accumulated precipitation diagnostic rainc and rainnc to amounts less (or equal to) their prescribed bucket vales. This is needed for long-term simulations for which rainc and rainnc can be,come quite large.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_driver_convection_deep.F
===================================================================
--- branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_driver_convection_deep.F        2012-02-29 19:17:44 UTC (rev 1550)
+++ branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_driver_convection_deep.F        2012-02-29 19:28:22 UTC (rev 1551)
@@ -413,12 +413,12 @@
  end subroutine convection_to_MPAS
 
 !=============================================================================================
- subroutine update_convection_deep(dt_dyn,mesh,diag_physics)
+ subroutine update_convection_deep(rainc_bucket,mesh,diag_physics)
 !=============================================================================================
 
 !input arguments:
  type(mesh_type),intent(in):: mesh
- real(kind=RKIND),intent(in):: dt_dyn
+ real(kind=RKIND),intent(in):: rainc_bucket
 
 !inout arguments:
  type(diag_physics_type),intent(inout):: diag_physics
@@ -427,11 +427,19 @@
  integer:: iCell
 
 !---------------------------------------------------------------------------------------------
-
-!update the accumuluted precipitation rate at the end of each dynamic time-step:
- do iCell = 1, mesh % nCells

+!update the accumulated precipitation at the end of each dynamic time-step:
+ do iCell = 1, mesh % nCellsSolve
     diag_physics % rainc % array(iCell) = diag_physics % rainc % array(iCell) &amp;
                                     + diag_physics % cuprec % array(iCell) * dt_dyn
+
+    if(l_rain .and. rainc_bucket.gt.0._RKIND .and. &amp;
+       diag_physics%rainc%array(iCell).gt.rainc_bucket) then
+       diag_physics % i_rainc % array(iCell) = diag_physics % i_rainc % array(iCell) + 1
+       diag_physics % rainc % array(iCell) = diag_physics % rainc % array(iCell) &amp;
+                                           - rainc_bucket
+    endif
+
  enddo
 
  end subroutine update_convection_deep

Modified: branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_driver_microphysics.F
===================================================================
--- branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_driver_microphysics.F        2012-02-29 19:17:44 UTC (rev 1550)
+++ branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_driver_microphysics.F        2012-02-29 19:28:22 UTC (rev 1551)
@@ -296,7 +296,7 @@
 
 !... copy updated precipitation from the wrf-physics grid back to the geodesic-dynamics grid:
 
- call precip_to_MPAS(diag_physics)
+ call precip_to_MPAS(config_bucket_rainnc,diag_physics)
 
 !... copy updated cloud microphysics variables from the wrf-physics grid back to the geodesic-
 !    dynamics grid:
@@ -374,10 +374,11 @@
  end subroutine precip_from_MPAS
 
 !=============================================================================================
- subroutine precip_to_MPAS(diag_physics)
+ subroutine precip_to_MPAS(rainnc_bucket,diag_physics)
 !=============================================================================================
 
 !output variables:
+ real(kind=RKIND),intent(in):: rainnc_bucket
  type(diag_physics_type),intent(inout):: diag_physics
 
 !local variables:
@@ -396,7 +397,13 @@
     !accumulated precipitation:
     diag_physics % rainnc % array(i) = diag_physics % rainnc % array(i) &amp;
                                      + diag_physics % rainncv % array(i)
-    
+
+   if(l_rain .and. rainnc_bucket.gt.0._RKIND .and. &amp;
+      diag_physics%rainnc%array(i).gt.rainnc_bucket) then
+      diag_physics % i_rainnc % array(i) = diag_physics % i_rainnc % array(i) + 1
+      diag_physics % rainnc % array(i) = diag_physics % rainnc % array(i) - rainnc_bucket
+   endif

  enddo
  enddo
 

</font>
</pre>