<p><b>ringler@lanl.gov</b> 2011-06-10 16:25:01 -0600 (Fri, 10 Jun 2011)</p><p><br>
add drag to tendency equation<br>
</p><hr noshade><pre><font color="gray">Modified: branches/pv_based_swm/mpas/src/core_pvsw/Registry
===================================================================
--- branches/pv_based_swm/mpas/src/core_pvsw/Registry        2011-06-10 20:06:17 UTC (rev 898)
+++ branches/pv_based_swm/mpas/src/core_pvsw/Registry        2011-06-10 22:25:01 UTC (rev 899)
@@ -158,9 +158,9 @@
 var persistent real    uReconstructZ ( nVertLevels nCells Time ) 2 - uReconstructZ state - -
 var persistent real    uReconstructZonal ( nVertLevels nCells Time ) 2 o uReconstructZonal state - -
 var persistent real    uReconstructMeridional ( nVertLevels nCells Time ) 2 o uReconstructMeridional state - -
-var persistent real    gradKeReconstructX ( nVertLevels nCells Time ) 2 o gradKeReconstructX state - -
-var persistent real    gradKeReconstructY ( nVertLevels nCells Time ) 2 o gradKeReconstructY state - -
-var persistent real    gradKeReconstructZ ( nVertLevels nCells Time ) 2 o gradKeReconstructZ state - -
+var persistent real    gradKeReconstructX ( nVertLevels nCells Time ) 2 - gradKeReconstructX state - -
+var persistent real    gradKeReconstructY ( nVertLevels nCells Time ) 2 - gradKeReconstructY state - -
+var persistent real    gradKeReconstructZ ( nVertLevels nCells Time ) 2 - gradKeReconstructZ state - -
 var persistent real    gradKeReconstructZonal ( nVertLevels nCells Time ) 2 o gradKeReconstructZonal state - -
 var persistent real    gradKeReconstructMerid ( nVertLevels nCells Time ) 2 o gradKeReconstructMerid state - -
 var persistent real    dvordt ( nVertLevels nCells Time ) 2 o dvordt state - -

Modified: branches/pv_based_swm/mpas/src/core_pvsw/module_mpas_core.F
===================================================================
--- branches/pv_based_swm/mpas/src/core_pvsw/module_mpas_core.F        2011-06-10 20:06:17 UTC (rev 898)
+++ branches/pv_based_swm/mpas/src/core_pvsw/module_mpas_core.F        2011-06-10 22:25:01 UTC (rev 899)
@@ -72,6 +72,7 @@
    
    
       call compute_solve_diagnostics(dt, block % state % time_levs(1) % state, mesh)
+      call compute_drag(block % state % time_levs(1) % state, block % mesh)
    
       call rbfInterp_initialize(mesh)
       call init_reconstruct(mesh)

Modified: branches/pv_based_swm/mpas/src/core_pvsw/module_time_integration.F
===================================================================
--- branches/pv_based_swm/mpas/src/core_pvsw/module_time_integration.F        2011-06-10 20:06:17 UTC (rev 898)
+++ branches/pv_based_swm/mpas/src/core_pvsw/module_time_integration.F        2011-06-10 22:25:01 UTC (rev 899)
@@ -101,6 +101,15 @@
          block % state % time_levs(2) % state % pv_forcing % array(:,:) = 0.0
          block % state % time_levs(2) % state % pv_drag % array(:,:) = 0.0
 
+         block % state % time_levs(2) % state % uReconstructX % array(:,:) = block % state % time_levs(1) % state % uReconstructX % array(:,:)
+         block % state % time_levs(2) % state % uReconstructY % array(:,:) = block % state % time_levs(1) % state % uReconstructY % array(:,:)
+         block % state % time_levs(2) % state % uReconstructZ % array(:,:) = block % state % time_levs(1) % state % uReconstructZ % array(:,:)
+
+         block % state % time_levs(2) % state % gradKeReconstructX % array(:,:) = block % state % time_levs(1) % state % gradKeReconstructX % array(:,:)
+         block % state % time_levs(2) % state % gradKeReconstructY % array(:,:) = block % state % time_levs(1) % state % gradKeReconstructY % array(:,:)
+         block % state % time_levs(2) % state % gradKeReconstructZ % array(:,:) = block % state % time_levs(1) % state % gradKeReconstructZ % array(:,:)
+
+
          do iCell=1,block % mesh % nCells  ! couple tracers to h
            do k=1,block % mesh % nVertLevels
              block % state % time_levs(2) % state % tracers % array(:,k,iCell) = block % state % time_levs(1) % state % tracers % array(:,k,iCell) &amp;
@@ -224,8 +233,15 @@
                     provis % pv % array(k,iCell) = provis % tracers % array(1,k,iCell)
                  end do
               end do
+
               call compute_solve_diagnostics(dt, provis, block % mesh)
+              call reconstruct(provis, block % mesh)
+              call reconstructGradKE(provis, block % mesh)
               call compute_drag(provis, block % mesh)
+
+              write(6,*) ' uR min', minval(provis % uReconstructX % array(:,:))
+              write(6,*) ' uR max ', maxval(provis % uReconstructX % array(:,:))
+
               block =&gt; block % next
            end do
         end if
@@ -311,10 +327,10 @@
       do while (associated(block))
 
          call compute_solve_diagnostics(dt, block % state % time_levs(2) % state, block % mesh)
-         call compute_drag(provis, block % mesh)
-
          call reconstruct(block % state % time_levs(2) % state, block % mesh)
          call reconstructGradKE(block % state % time_levs(2) % state, block % mesh)
+         call compute_drag(block % state % time_levs(2) % state, block % mesh)
+         write(6,*) ' uR minc', minval(block % state % time_levs(2) % state % uReconstructX % array(:,:))
 
          block =&gt; block % next
       end do
@@ -445,7 +461,7 @@
       real (kind=RKIND) :: d2fdx2_cell1, d2fdx2_cell2
       real (kind=RKIND), dimension(:), pointer :: dvEdge, dcEdge, areaCell
       real (kind=RKIND), dimension(:,:,:), pointer :: tracers, tracer_tend
-      real (kind=RKIND), dimension(:,:), pointer :: tend_pv_advection, tend_pv_dissipation, tend_pv_forcing, tend_pv_drag
+      real (kind=RKIND), dimension(:,:), pointer :: tend_pv_advection, tend_pv_dissipation, tend_pv_forcing, tend_pv_drag, pv_drag
       integer, dimension(:,:), pointer :: cellsOnEdge, boundaryCell
       real (kind=RKIND), dimension(:,:,:), pointer :: deriv_two
       real (kind=RKIND) :: coef_3rd_order
@@ -462,6 +478,7 @@
       boundaryEdge=&gt; grid % boundaryEdge % array
       areaCell    =&gt; grid % areaCell % array
       tracer_tend =&gt; tend % tracers % array
+      pv_drag     =&gt; s % pv_drag % array
       tend_pv_advection =&gt; tend % pv_advection % array
       tend_pv_dissipation =&gt; tend % pv_dissipation % array
       tend_pv_forcing =&gt; tend % pv_forcing % array
@@ -716,6 +733,9 @@
       enddo
 
 
+      ! compute forcing here
+
+
       ! store PV forcing term
       do iCell = 1,grid%nCells
        do k=1,grid % nVertLevels
@@ -723,6 +743,13 @@
        enddo
       enddo
 
+      iTracer=1
+      do iCell = 1,grid%nCells
+       do k=1,grid % nVertLevels
+        tracer_tend(iTracer,k,iCell) = tracer_tend(iTracer,k,iCell) + pv_drag(k,iCell)
+       enddo
+      enddo
+
       ! store PV drag term
       do iCell = 1,grid%nCells
        do k=1,grid % nVertLevels
@@ -772,12 +799,14 @@
       gz          =&gt; s % gradKeReconstructZ % array
 
 
-      do iCell = 1,grid%nCells
-       do k=1,grid % nVertLevels
-         pv_drag(k,iCell) = -config_dragCoefficient * sqrt(2.0*ke(k,iCell)) * vor(k,iCell) / h(k,iCell)
-       enddo
-      enddo
+      pv_drag(:,:) = 0.0
 
+  !   do iCell = 1,grid%nCells
+  !    do k=1,grid % nVertLevels
+  !      pv_drag(k,iCell) = -config_dragCoefficient * sqrt(2.0*ke(k,iCell)) * vor(k,iCell) / h(k,iCell)
+  !    enddo
+  !   enddo
+
       do iCell = 1,grid%nCells
        do k=1,grid % nVertLevels
         p(1) = gx(k,iCell); p(2) = gy(k,iCell); p(3) = gz(k,iCell)
@@ -785,6 +814,11 @@
         call cross_product_in_R3(p,q,t)
         r = xCell(iCell)*t(1) + yCell(iCell)*t(2) + zCell(iCell)*t(3)
         pv_drag(k,iCell) = pv_drag(k,iCell) - config_dragCoefficient * r / h(k,iCell)
+        write(6,*) 'p ',p(:)
+        write(6,*) 'q ',q(:)
+        write(6,*) 't ',t(:)
+        write(6,*) 'r ',r
+        write(6,*) 'drag ',config_dragCoefficient * r / h(k,iCell)
        enddo
       enddo
 

</font>
</pre>