<p><b>laura@ucar.edu</b> 2012-02-29 12:33:08 -0700 (Wed, 29 Feb 2012)</p><p>added the call to physics_update (that call was moved from mpas_atm_mpas_core.F). made corrections to the call to driver_radiation_lw in order to save the CAM arrays abstot,absnxt, and emstot to restarts. modified mpas_atmphys_driver_radiation_lw accordingly<br>
</p><hr noshade><pre><font color="gray">Modified: branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_driver.F
===================================================================
--- branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_driver.F        2012-02-29 19:28:22 UTC (rev 1551)
+++ branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_driver.F        2012-02-29 19:33:08 UTC (rev 1552)
@@ -80,16 +80,17 @@
     !call to long wave radiation scheme:
     if(l_radtlw) then
        call allocate_radiation_lw(xtime_s)
-       call driver_radiation_lw(itimestep,block%mesh,block%state%time_levs(1)%state,  &amp;
-                               block%diag_physics,block%sfc_input,block%tend_physics, &amp;
-                               xtime_s)
+       call driver_radiation_lw(xtime_s,block%mesh,block%state%time_levs(1)%state, &amp;
+                              block%diag_physics,block%sfc_input,block%tend_physics)
     endif
+    if(l_camlw .and. config_radt_lw_scheme .eq. 'cam_lw') &amp;
+                              call radiation_camlw_to_MPAS(block%diag_physics) 
 
     !deallocate all radiation arrays:
     if(config_radt_sw_scheme.ne.'off' .or. config_radt_lw_scheme.ne.'off') &amp;
        call deallocate_cloudiness
     if(config_radt_sw_scheme.ne.'off') call deallocate_radiation_sw
-    if(config_radt_lw_scheme.ne.'off') call deallocate_radiation_lw(xtime_s)
+    if(config_radt_lw_scheme.ne.'off') call deallocate_radiation_lw
 
     !call to surface-layer scheme:
     if(config_sfclayer_scheme .ne. 'off') then
@@ -118,6 +119,9 @@
        call driver_convection_deep(itimestep,block%mesh,block%sfc_input,block%diag_physics, &amp;
                                   block%tend_physics)
        call deallocate_convection_deep
+
+       !update diagnostics:
+       call update_convection_deep(config_bucket_rainc,block%mesh,block%diag_physics)
     endif
 
     !deallocate arrays shared by all physics parameterizations:

Modified: branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_driver_radiation_lw.F
===================================================================
--- branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_driver_radiation_lw.F        2012-02-29 19:28:22 UTC (rev 1551)
+++ branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_driver_radiation_lw.F        2012-02-29 19:33:08 UTC (rev 1552)
@@ -20,7 +20,8 @@
  public:: allocate_radiation_lw,   &amp;
           deallocate_radiation_lw, &amp;
           driver_radiation_lw,     &amp;
-          init_radiation_lw
+          init_radiation_lw,       &amp;
+          radiation_camlw_to_MPAS
 
  integer,private:: i,j,k,n
 
@@ -101,17 +102,11 @@
 
        !allocate these arrays on the first time step, only:
        if(xtime_s .lt. 1.e-12) then
-
-          write(0,*) 
-          write(0,*) '--- end subroutine allocate_radiation_lw:'
-          write(0,*) '--- allocate emstot_p,abstot_p,absnxt_p'
-
           if(.not.allocated(emstot_p) ) allocate(emstot_p(ims:ime,kms:kme,jms:jme) )
           if(.not.allocated(abstot_p) ) &amp;
              allocate(abstot_p(ims:ime,kms:kme,cam_abs_dim2,jms:jme) )
           if(.not.allocated(absnxt_p) ) &amp;
              allocate(absnxt_p(ims:ime,kms:kme,cam_abs_dim1,jms:jme) )
-
        endif
 
     case default
@@ -121,14 +116,9 @@
  end subroutine allocate_radiation_lw
 
 !=============================================================================================
- subroutine deallocate_radiation_lw(xtime_s)
+ subroutine deallocate_radiation_lw
 !=============================================================================================
 
-!input arguments:
- real(kind=RKIND),intent(in):: xtime_s
-
-!---------------------------------------------------------------------------------------------
-
  if(allocated(f_ice)        ) deallocate(f_ice        )
  if(allocated(f_rain)       ) deallocate(f_rain       )
  if(allocated(sfc_emiss_p)  ) deallocate(sfc_emiss_p  )
@@ -196,7 +186,7 @@
  end subroutine deallocate_radiation_lw
 
 !=============================================================================================
- subroutine radiation_lw_from_MPAS(mesh,state,diag_physics,sfc_input,xtime_s)
+ subroutine radiation_lw_from_MPAS(xtime_s,mesh,state,diag_physics,sfc_input)
 !=============================================================================================
 
 !input arguments:
@@ -301,30 +291,30 @@
        enddo
        enddo
 
+       !On the first time-step of each model run, the local arrays absnxt_p, absnst_p,
+       !and emstot_p are filled with the MPAS arrays abstot, absnxt, and emstot. If it
+       !is a new run, these three arrays will be initialized to zero;If a restart run,
+       !these three arrays will be filled with the restart values.
        call mpas_timer_start(&quot;CAM lw: fill arrays for infrared absorption&quot;)
        if(xtime_s .lt. 1.e-12) then
-          write(0,*)
-          write(0,*) '--- radiation_lw_from_MPAS:'
-          write(0,*) '--- initialize emstot_p,abstot_p,absnxt_p'
-          !infrared absorption:
           do j = jts,jte
           do n = 1,cam_abs_dim1
           do k = kts,kte
           do i = its,ite
-             absnxt_p(i,k,n,j) = 0.
+             absnxt_p(i,k,n,j) = diag_physics % absnxt % array(k,n,i)
           enddo
           enddo
           enddo
           do n = 1,cam_abs_dim2
           do k = kts,kte+1
           do i = its,ite
-             abstot_p(i,k,n,j) = 0.
+             abstot_p(i,k,n,j) = diag_physics % abstot % array(k,n,i)
           enddo
           enddo
           enddo
           do k = kts,kte+1
           do i = its,ite
-             emstot_p(i,k,j) = 0.
+             emstot_p(i,k,j) = diag_physics % emstot % array(k,i)
           enddo
           enddo
           enddo
@@ -377,40 +367,29 @@
  end subroutine radiation_lw_from_MPAS
 
 !=============================================================================================
- subroutine radiation_lw_to_MPAS(diag_physics,tend_physics,xtime_s)
+ subroutine radiation_lw_to_MPAS(diag_physics,tend_physics)
 !=============================================================================================
 
 !input arguments:
  type(diag_physics_type),intent(inout):: diag_physics
  type(tend_physics_type),intent(inout):: tend_physics
 
- real(kind=RKIND),intent(in):: xtime_s
-
 !---------------------------------------------------------------------------------------------
 
  do j = jts,jte
  do i = its,ite
-    diag_physics % glw      % array(i) = glw_p(i,j)
-    diag_physics % lwcf     % array(i) = lwcf_p(i,j)
-    diag_physics % lwdnb    % array(i) = lwdnb_p(i,j)
-    diag_physics % lwdnbc   % array(i) = lwdnbc_p(i,j)
-    diag_physics % lwdnt    % array(i) = lwdnt_p(i,j)
-    diag_physics % lwdntc   % array(i) = lwdntc_p(i,j)
-    diag_physics % lwupb    % array(i) = lwupb_p(i,j)
-    diag_physics % lwupbc   % array(i) = lwupbc_p(i,j)
-    diag_physics % lwupt    % array(i) = lwupt_p(i,j)
-    diag_physics % lwuptc   % array(i) = lwuptc_p(i,j)
-    diag_physics % olrtoa   % array(i) = olrtoa_p(i,j)
+    diag_physics % glw    % array(i) = glw_p(i,j)
+    diag_physics % lwcf   % array(i) = lwcf_p(i,j)
+    diag_physics % lwdnb  % array(i) = lwdnb_p(i,j)
+    diag_physics % lwdnbc % array(i) = lwdnbc_p(i,j)
+    diag_physics % lwdnt  % array(i) = lwdnt_p(i,j)
+    diag_physics % lwdntc % array(i) = lwdntc_p(i,j)
+    diag_physics % lwupb  % array(i) = lwupb_p(i,j)
+    diag_physics % lwupbc % array(i) = lwupbc_p(i,j)
+    diag_physics % lwupt  % array(i) = lwupt_p(i,j)
+    diag_physics % lwuptc % array(i) = lwuptc_p(i,j)
+    diag_physics % olrtoa % array(i) = olrtoa_p(i,j)
  enddo
-!not needed: 
-!do k = kts,kte+2
-!do i = its,ite
-!   diag_physics % lwdnflx  % array(k,i) = lwdnflx_p(i,k,j)
-!   diag_physics % lwdnflxc % array(k,i) = lwdnflxc_p(i,k,j)
-!   diag_physics % lwupflx  % array(k,i) = lwupflx_p(i,k,j)
-!   diag_physics % lwupflxc % array(k,i) = lwupflxc_p(i,k,j)
-!enddo
-!enddo
 
  do k = kts,kte
  do i = its,ite
@@ -419,13 +398,45 @@
  enddo
  enddo
 
-!format:
- 101 format(i3,2i6,12(1x,e15.8))
- 102 format(i6,12(1x,e15.8))
+!end select radiation_lw_select
 
  end subroutine radiation_lw_to_MPAS
 
 !=============================================================================================
+ subroutine radiation_camlw_to_MPAS(diag_physics)
+!=============================================================================================
+
+!input arguments:
+ type(diag_physics_type),intent(inout):: diag_physics
+
+!---------------------------------------------------------------------------------------------
+
+ write(0,*) '--- writing absnxt,abstot,and emstot to restart =', l_camlw
+ do j = jts,jte
+ do n = 1,cam_abs_dim1
+ do k = kts,kte
+ do i = its,ite
+    diag_physics % absnxt % array(k,n,i) = absnxt_p(i,k,n,j)
+ enddo
+ enddo
+ enddo
+ do n = 1,cam_abs_dim2
+ do k = kts,kte+1
+ do i = its,ite
+    diag_physics % abstot % array(k,n,i) = abstot_p(i,k,n,j)
+ enddo
+ enddo
+ enddo
+ do k = kts,kte+1
+ do i = its,ite
+    diag_physics % emstot % array(k,i) = emstot_p(i,k,j)
+ enddo
+ enddo
+ enddo
+
+ end subroutine radiation_camlw_to_MPAS
+
+!=============================================================================================
  subroutine init_radiation_lw(dminfo,mesh,state_1,state_2)
 !=============================================================================================
 
@@ -460,12 +471,10 @@
  end subroutine init_radiation_lw
 
 !=============================================================================================
- subroutine driver_radiation_lw(itimestep,mesh,state,diag_physics,sfc_input, &amp;
-                                tend_physics,xtime_s)
+ subroutine driver_radiation_lw(xtime_s,mesh,state,diag_physics,sfc_input,tend_physics)
 !=============================================================================================
 
 !input arguments:
- integer,intent(in):: itimestep
  type(mesh_type),intent(in) :: mesh
  real(kind=RKIND),intent(in):: xtime_s
 
@@ -480,14 +489,14 @@
 
 !---------------------------------------------------------------------------------------------
  call mpas_timer_start(&quot;radiation_lw&quot;)
- write(0,100) itimestep
+ write(0,100)
 
 !formats:
  100 format(/,' --- enter subroutine driver_radiation_lw: ',i6)
  101 format(i8,12(1x,e15.8))
 
 !copy all MPAS arrays to rectangular grid:
- call radiation_lw_from_MPAS(mesh,state,diag_physics,sfc_input,xtime_s)
+ call radiation_lw_from_MPAS(xtime_s,mesh,state,diag_physics,sfc_input)
 
 !call to longwave radiation scheme:
  radiation_lw_select: select case (trim(radt_lw_scheme))
@@ -594,7 +603,7 @@
  end select radiation_lw_select
 
 !copy all arrays back to MPAS geodesic grid:
- call radiation_lw_to_MPAS(diag_physics,tend_physics,xtime_s)
+ call radiation_lw_to_MPAS(diag_physics,tend_physics)
 
  write(0,*) '--- end subroutine driver_radiation_lw'
  call mpas_timer_stop(&quot;radiation_lw&quot;)

</font>
</pre>