<p><b>laura@ucar.edu</b> 2012-10-22 16:50:06 -0600 (Mon, 22 Oct 2012)</p><p>added logical l_diags to trigger the calculation of physics diagnostics when writing to output files only. l_diags is determined through the use of a local alarm which rings every config_output_intervals.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_manager.F
===================================================================
--- branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_manager.F        2012-10-22 22:25:05 UTC (rev 2254)
+++ branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_manager.F        2012-10-22 22:50:06 UTC (rev 2255)
@@ -55,6 +55,9 @@
  integer, parameter:: acradtAlarmID   = 20
  type(MPAS_TimeInterval_Type):: acradtTimeStep
 
+!defines alarm to compute some physics diagnostics, such as radar reflectivity:
+ integer, parameter:: diagAlarmID     = 21
+
  integer :: h, m, s, s_n, s_d, DoY, yr
  real(kind=RKIND) :: utc_h
 
@@ -229,6 +232,14 @@
     write(0,*) '--- time to apply limit to accumulated radiation diags. L_ACRADT   =',l_acradt
  endif
 
+!check to see if it is time to calculate additional physics diagnostics:
+ l_diags = .false.
+ if(mpas_is_alarm_ringing(clock,diagAlarmID,ierr=ierr)) then
+    call mpas_reset_clock_alarm(clock,diagAlarmID,ierr=ierr)
+    l_diags = .true.
+ endif
+ write(0,*) '--- time to calculate additional physics_diagnostics               =',l_diags
+
  end subroutine physics_timetracker
 
 !=============================================================================================
@@ -419,6 +430,11 @@
           call physics_error_fatal('subroutine physics_init: error creating alarm radiation limit')
  endif
 
+!set alarm to calculate physics diagnostics on IO outpt only:
+ call mpas_set_timeInterval(alarmTimeStep,timeString=config_output_interval,ierr=ierr)
+ alarmStartTime = startTime
+ call mpas_add_clock_alarm(clock,diagAlarmID,alarmStartTime,alarmTimeStep,ierr=ierr)
+
  write(0,102) dt_radtlw,dt_radtsw,dt_cu,dt_pbl
 
 !initialization of physics dimensions to mimic a rectangular grid:
@@ -466,6 +482,7 @@
  l_radtlw = .false.
  l_radtsw = .false.
 !... others:
+ l_diags  = .false.
  l_camlw  = .false.
  l_acrain = .false.
  l_acradt = .false.

Modified: branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_vars.F
===================================================================
--- branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_vars.F        2012-10-22 22:25:05 UTC (rev 2254)
+++ branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_vars.F        2012-10-22 22:50:06 UTC (rev 2255)
@@ -30,6 +30,7 @@
  logical:: l_radtsw                   !controls call to shortwave radiation parameterization.
  logical:: l_conv                     !controls call to convective parameterization.
  logical:: l_camlw                    !controls when to save local CAM LW abs and ems arrays.
+ logical:: l_diags                    !controls when to calculate physics diagnostics.
  logical:: l_acrain                   !when .true., limit to accumulated rain is applied.
  logical:: l_acradt                   !when .true., limit to lw and sw radiation is applied.
 

</font>
</pre>