<p><b>laura@ucar.edu</b> 2010-06-14 10:12:34 -0600 (Mon, 14 Jun 2010)</p><p>Uncommented call to microphysics driver. Added call toadd physics tendencies in the Runge-Kutta loop<br>
</p><hr noshade><pre><font color="gray">Modified: branches/atmos_physics/src/core_hyd_atmos/module_time_integration.F
===================================================================
--- branches/atmos_physics/src/core_hyd_atmos/module_time_integration.F        2010-06-14 16:09:34 UTC (rev 346)
+++ branches/atmos_physics/src/core_hyd_atmos/module_time_integration.F        2010-06-14 16:12:34 UTC (rev 347)
@@ -8,13 +8,14 @@
#ifdef DO_PHYSICS
use module_microphysics_driver
+ use module_physics_todynamics
#endif
contains
#ifdef DO_PHYSICS
- subroutine timestep(domain, dt, itimestep)
+ subroutine timestep(domain, dt, itimestep, config_ntimesteps)
#else
subroutine timestep(domain, dt)
#endif
@@ -36,12 +37,12 @@
type (block_type), pointer :: block
#ifdef DO_PHYSICS
- integer, intent(in):: itimestep
+ integer, intent(in):: itimestep, config_ntimesteps
#endif
if (trim(config_time_integration) == 'SRK3') then
#ifdef DO_PHYSICS
- call srk3(domain, dt, itimestep)
+ call srk3(domain, dt, itimestep, config_ntimesteps)
#else
call srk3(domain, dt)
#endif
@@ -56,13 +57,12 @@
block % time_levs(2) % state % xtime % scalar = block % time_levs(1) % state % xtime % scalar + dt
block => block % next
end do
- write(0,*) '--- end subroutine timestep:'
end subroutine timestep
#ifdef DO_PHYSICS
- subroutine srk3(domain, dt, itimestep)
+ subroutine srk3(domain, dt, itimestep , config_ntimesteps)
#else
subroutine srk3(domain, dt)
#endif
@@ -99,7 +99,7 @@
real (kind=RKIND) :: global_domain_mass, global_scalar_mass, global_scalar_min, global_scalar_max
#ifdef DO_PHYSICS
- integer, intent(in):: itimestep
+ integer, intent(in):: itimestep, config_ntimesteps
#endif
!
@@ -176,10 +176,13 @@
block => domain % blocklist
do while (associated(block))
+#ifdef DO_PHYSICS
+! call physics_addtend( block % intermediate_step(TEND), block % time_levs(2) % state, block % mesh )
+#endif
call compute_dyn_tend( block % intermediate_step(TEND), block % time_levs(2) % state, block % mesh )
block => block % next
end do
-
+
if(debug) write(0,*) ' returned from dyn_tend '
!
@@ -392,25 +395,73 @@
! LDF end.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!#ifdef DO_PHYSICS
-! if(config_mp_physics /=0) then
+#ifdef DO_PHYSICS
+ if(config_mp_physics /=0) then
-! block => domain % blocklist
-! do while(associated(block))
-! call microphysics_driver ( block % mesh, block % time_levs(2) % state, itimestep)
-! block => block % next
-! end do
+ block => domain % blocklist
+ do while(associated(block))
+ call microphysics_driver ( block % intermediate_step(TEND), block % time_levs(2) % state, &
+ block % mesh, itimestep , config_ntimesteps )
-! endif
-!#endif
+ !to be moved into a module:
+ do iCell = 1, block % mesh % nCellsSolve
+ block % time_levs(2) % state % qv_col % array(iCell) = 0.
+ block % time_levs(2) % state % qc_col % array(iCell) = 0.
+ block % time_levs(2) % state % qr_col % array(iCell) = 0.
+ block % time_levs(2) % state % qi_col % array(iCell) = 0.
+ block % time_levs(2) % state % qs_col % array(iCell) = 0.
+ do k=1, block % mesh % nVertLevelsSolve
+ block % time_levs(2) % state % qv_col % array(iCell) = &
+ block % time_levs(2) % state % qv_col % array(iCell) &
+ - block % time_levs(2) % state % scalars % array (index_qv,k,iCell) &
+ * block % time_levs(2) % state % h % array (k,iCell) &
+ * block % mesh % dnw % array (k)
+
+ block % time_levs(2) % state % qc_col % array(iCell) = &
+ block % time_levs(2) % state % qc_col % array(iCell) &
+ - block % time_levs(2) % state % scalars % array (index_qc,k,iCell) &
+ * block % time_levs(2) % state % h % array (k,iCell) &
+ * block % mesh % dnw % array (k)
+
+ block % time_levs(2) % state % qr_col % array(iCell) = &
+ block % time_levs(2) % state % qr_col % array(iCell) &
+ - block % time_levs(2) % state % scalars % array (index_qr,k,iCell) &
+ * block % time_levs(2) % state % h % array (k,iCell) &
+ * block % mesh % dnw % array (k)
+
+ block % time_levs(2) % state % qi_col % array(iCell) = &
+ block % time_levs(2) % state % qi_col % array(iCell) &
+ - block % time_levs(2) % state % scalars % array (index_qi,k,iCell) &
+ * block % time_levs(2) % state % h % array (k,iCell) &
+ * block % mesh % dnw % array (k)
+
+ block % time_levs(2) % state % qs_col % array(iCell) = &
+ block % time_levs(2) % state % qs_col % array(iCell) &
+ - block % time_levs(2) % state % scalars % array (index_qs,k,iCell) &
+ * block % time_levs(2) % state % h % array (k,iCell) &
+ * block % mesh % dnw % array (k)
+
+ block % time_levs(2) % state % qg_col % array(iCell) = &
+ block % time_levs(2) % state % qg_col % array(iCell) &
+ - block % time_levs(2) % state % scalars % array (index_qg,k,iCell) &
+ * block % time_levs(2) % state % h % array (k,iCell) &
+ * block % mesh % dnw % array (k)
+ enddo
+ enddo
+
+ block => block % next
+ end do
+
+ endif
+#endif
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! LDF begin (04-26-2010):
! CALL TO CLOUD MICROPHYISCS SCHEMES ENDS HERE:
! LDF end.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- write(0,*) '--- end subroutine srk3:'
end subroutine srk3
@@ -612,6 +663,7 @@
pv_edge => s % pv_edge % array
geopotential => s % geopotential % array
theta => s % theta % array
+ h_diabatic => s % h_diabatic % array
weightsOnEdge => grid % weightsOnEdge % array
cellsOnEdge => grid % cellsOnEdge % array
@@ -628,7 +680,7 @@
vh => tend % vh % array
tend_u => tend % u % array
tend_theta => tend % theta % array
- h_diabatic => grid % h_diabatic % array
+! h_diabatic => grid % h_diabatic % array
ww => s % ww % array
rdnu => grid % rdnu % array
@@ -868,9 +920,10 @@
!----------- rhs for theta
+!#ifndef DO_PHYSICS
tend_theta(:,:) = 0.
+!#endif
-
!
! horizontal mixing for theta - we could combine this with advection directly (i.e. as a turbulent flux),
! but here we can also code in hyperdiffusion if we wish (2nd order at present)
@@ -1371,8 +1424,9 @@
nVertLevels = grid % nVertLevels
+#ifndef DO_PHYSICS
scalar_tend = 0. ! testing purposes - we have no sources or sinks
-
+#endif
!
! Runge Kutta integration, so we compute fluxes from scalar_new values, update starts form scalar_old
!
</font>
</pre>