<p><b>laura@ucar.edu</b> 2011-10-11 13:54:22 -0600 (Tue, 11 Oct 2011)</p><p>corrected the calculation of the tendency of the modified potential temperature due to physics processes.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/atmos_physics/src/core_physics/module_physics_todynamics.F
===================================================================
--- branches/atmos_physics/src/core_physics/module_physics_todynamics.F        2011-10-11 19:45:50 UTC (rev 1059)
+++ branches/atmos_physics/src/core_physics/module_physics_todynamics.F        2011-10-11 19:54:22 UTC (rev 1060)
@@ -3,6 +3,8 @@
use configure
use grid_types
+ use module_physics_constants, only: R_d,R_v
+
implicit none
private
public:: physics_addtend
@@ -10,8 +12,8 @@
contains
!=============================================================================================
- subroutine physics_addtend(dminfo,cellsToSend,cellsToRecv,mesh,tend,tend_physics, &
- mass,mass_edge)
+ subroutine physics_addtend(dminfo,cellsToSend,cellsToRecv,mesh,state,diag,tend, &
+ tend_physics,mass,mass_edge)
!=============================================================================================
!input variables:
@@ -20,6 +22,8 @@
type(mesh_type),intent(in):: mesh
type(exchange_list),pointer:: cellsToSend,cellsToRecv
+ type(state_type),intent(in):: state
+ type(diag_type),intent(in):: diag
type(tend_physics_type),intent(in):: tend_physics
real(kind=RKIND),dimension(:,:):: mass
real(kind=RKIND),dimension(:,:):: mass_edge
@@ -32,6 +36,7 @@
!----------------
integer:: i,k,nCells,nCellsSolve,nEdges,nEdgesSolve,nVertLevels
+ real(kind=RKIND),dimension(:,:),pointer:: theta,theta_m,qv
real(kind=RKIND),dimension(:,:),pointer:: rthblten,rqvblten,rqcblten, &
rqiblten,rublten,rvblten
real(kind=RKIND),dimension(:,:),pointer:: rthcuten,rqvcuten,rqccuten, &
@@ -54,6 +59,10 @@
nEdgesSolve = mesh % nEdgesSolve
nVertLevels = mesh % nVertLevels
+ theta => diag % theta % array
+ theta_m => state % theta_m % array
+ qv => state % scalars % array(state%index_qv,:,:)
+
rublten => tend_physics % rublten % array
rvblten => tend_physics % rvblten % array
rthblten => tend_physics % rthblten % array
@@ -132,6 +141,19 @@
enddo
endif
+!if non-hydrostatic core, convert the tendency for the potential temperature to a
+!tendency for the modified potential temperature:
+#ifdef non_hydrostatic_core
+ do i = 1, nCellsSolve
+ do k = 1, nVertLevels
+
+ theta(k,i) = theta_m(k,i) / (1. + R_v/R_d * qv(k,i))
+ tend_theta(k,i) = (1. + R_v/R_d * qv(k,i)) * tend_theta(k,i) &
+ + R_v/R_d * theta(k,i) * tend_scalars(tend%index_qv,k,i)
+ enddo
+ enddo
+#endif
+
!write(0,*) 'max PBL tendencies:'
!write(0,*) 'max rthblten=',maxval(rthblten(:,:))
!write(0,*) 'max rqvblten=',maxval(rqvblten(:,:))
</font>
</pre>