<p><b>laura@ucar.edu</b> 2010-11-18 16:04:38 -0700 (Thu, 18 Nov 2010)</p><p>added calculation of surface pressure. added call to add the physics tendencies to the dynamics tendencies<br>
</p><hr noshade><pre><font color="gray">Modified: branches/atmos_physics/src/core_nhyd_atmos/module_time_integration.F
===================================================================
--- branches/atmos_physics/src/core_nhyd_atmos/module_time_integration.F        2010-11-18 22:59:27 UTC (rev 626)
+++ branches/atmos_physics/src/core_nhyd_atmos/module_time_integration.F        2010-11-18 23:04:38 UTC (rev 627)
@@ -146,6 +146,11 @@
block % mesh % nVertLevels+1, block % mesh % nCells, &
block % parinfo % CellsToSend, block % parinfo % CellsToRecv)
+!surface_pressure
+ call dmpar_exch_halo_field1dReal(domain % dminfo, block % diag % surface_pressure % array(:), &
+ block % mesh % nEdges, block % parinfo % edgesToSend, &
+ block % parinfo % edgesToRecv)
+
block => block % next
end do
@@ -197,16 +202,16 @@
if (debug) write(0,*) ' finished compute_dyn_tend '
-!#ifdef DO_PHYSICS
-! if (debug) write(0,*) ' add physics tendencies '
-! block => domain % blocklist
-! do while (associated(block))
-! call physics_addtend( block % tend, block % state % time_levs(2) % state, &
-! block % state % time_levs(2) % state % rho % array(:,:), block % mesh )
-! block => block % next
-! end do
-! if (debug) write(0,*) ' finished add physics tendencies '
-!#endif
+#ifdef DO_PHYSICS
+ if (debug) write(0,*) ' add physics tendencies '
+ block => domain % blocklist
+ do while (associated(block))
+ call physics_addtend( block % mesh , block % tend, block % tend_physics , &
+ block % state % time_levs(2) % state % rho % array(:,:) )
+ block => block % next
+ end do
+ if (debug) write(0,*) ' finished add physics tendencies '
+#endif
!***********************************
! we will need to communicate the momentum tendencies here - we want tendencies for all edges of owned cells
@@ -413,7 +418,8 @@
!call microphysics schemes:
if(config_microp_scheme .ne. 'off') &
- call microphysics_driver ( block % state % time_levs(2) % state, block % diag, block % tend, block % mesh, itimestep )
+ call microphysics_driver ( block % state % time_levs(2) % state, block % diag, block % diag_physics, &
+ block % tend, block % mesh, itimestep )
block => block % next
end do
@@ -976,8 +982,8 @@
rtheta_p_save, rt_diabatic_tend, rho_p, rho_p_save, &
rho_pp, rho, rho_base, ruAvg, ru_save, ru_p, u, ru, &
exner, exner_base, rtheta_base, pressure_p, &
- zz, theta
- real (kind=RKIND), dimension(:), pointer :: fzm, fzp, dvEdge, AreaCell
+ zz, theta, pressure_b, qvapor
+ real (kind=RKIND), dimension(:), pointer :: fzm, fzp, dvEdge, AreaCell, rdzw, surface_pressure
real (kind=RKIND), dimension(:,:,:), pointer :: zb, zb3
integer, dimension(:,:), pointer :: cellsOnEdge
@@ -1002,6 +1008,7 @@
rtheta_base => diag % rtheta_base % array
rt_diabatic_tend => tend % rt_diabatic_tend % array
theta => s % theta % array
+ qvapor => s % scalars % array(s%index_qv,:,:)
rho => s % rho % array
rho_p => diag % rho_p % array
@@ -1019,7 +1026,10 @@
exner_base => diag % exner_base % array
pressure_p => diag % pressure_p % array
+ pressure_b => diag % pressure_base % array
+ surface_pressure => diag % surface_pressure % array
+ rdzw => grid % rdzw % array
zz => grid % zz % array
zb => grid % zb % array
zb3 => grid % zb3 % array
@@ -1117,6 +1127,13 @@
! end if
+ !calculation of the surface pressure:
+ surface_pressure(iCell) = 0.5*gravity/rdzw(1) &
+ * (1.25*(rtheta_p(1,iCell) + rtheta_base(1,iCell)) * (1. + qvapor(1,iCell)) &
+ - 0.25*(rtheta_p(2,iCell) + rtheta_base(2,iCell)) * (1. + qvapor(2,iCell)))
+ surface_pressure(iCell) = surface_pressure(iCell) + pressure_p(1,iCell) + pressure_b(1,iCell)
+
+
end do
! recover time-averaged ruAvg on all edges of owned cells (for upcoming scalar transport).
</font>
</pre>