Index: /palm/trunk/SOURCE/advec_ws.f90
===================================================================
--- /palm/trunk/SOURCE/advec_ws.f90	(revision 1018)
+++ /palm/trunk/SOURCE/advec_ws.f90	(revision 1019)
@@ -194,6 +194,6 @@
 
 !
-!--    Arrays needed for reasons of speed optimization for cache and noopt 
-!--    version. For the vector version the buffer arrays are not necessary, 
+!--    Arrays needed for reasons of speed optimization for cache version.
+!--    For the vector version the buffer arrays are not necessary,
 !--    because the the fluxes can swapped directly inside the loops of the 
 !--    advection routines.
Index: /palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- /palm/trunk/SOURCE/check_parameters.f90	(revision 1018)
+++ /palm/trunk/SOURCE/check_parameters.f90	(revision 1019)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! non-optimized version of prognostic_equations not allowed any more
 !
 ! Former revisions:
@@ -488,5 +488,5 @@
     SELECT CASE ( TRIM( loop_optimization ) )
 
-       CASE ( 'acc', 'cache', 'noopt', 'vector' )
+       CASE ( 'acc', 'cache', 'vector' )
           CONTINUE
 
@@ -646,9 +646,4 @@
 !
 !-- Advection schemes:
-!       
-!-- Set the LOGICALS to enhance the performance.
-    IF ( momentum_advec == 'ws-scheme' )    ws_scheme_mom = .TRUE.
-    IF ( scalar_advec   == 'ws-scheme'   )  ws_scheme_sca = .TRUE.
-    
     IF ( momentum_advec /= 'pw-scheme'  .AND.  momentum_advec /= 'ws-scheme' ) &
     THEN
@@ -673,4 +668,11 @@
        CALL message( 'check_parameters', 'PA0024', 1, 2, 0, 6, 0 )
     ENDIF
+    IF ( scalar_advec == 'bc-scheme'  .AND.  loop_optimization == 'cache' ) &
+    THEN
+       message_string = 'advection_scheme scalar_advec = "' &
+         // TRIM( scalar_advec ) // '" not implemented for & loop_optimization = "' // &
+         TRIM( loop_optimization ) // '"'
+       CALL message( 'check_parameters', 'PA0026', 1, 2, 0, 6, 0 )
+    ENDIF
 
     IF ( use_sgs_for_particles  .AND.  .NOT. use_upstream_for_tke )  THEN
@@ -686,4 +688,9 @@
        CALL message( 'check_parameters', 'PA0349', 1, 2, 0, 6, 0 )
     ENDIF
+
+!
+!-- Set LOGICAL switches to enhance performance
+    IF ( momentum_advec == 'ws-scheme' )    ws_scheme_mom = .TRUE.
+    IF ( scalar_advec   == 'ws-scheme'   )  ws_scheme_sca = .TRUE.
 
 !
Index: /palm/trunk/SOURCE/prognostic_equations.f90
===================================================================
--- /palm/trunk/SOURCE/prognostic_equations.f90	(revision 1018)
+++ /palm/trunk/SOURCE/prognostic_equations.f90	(revision 1019)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! non-optimized version of prognostic_equations removed
 !
 ! Former revisions:
@@ -139,10 +139,6 @@
 
     PRIVATE
-    PUBLIC prognostic_equations_noopt, prognostic_equations_cache, &
-           prognostic_equations_vector, prognostic_equations_acc
-
-    INTERFACE prognostic_equations_noopt
-       MODULE PROCEDURE prognostic_equations_noopt
-    END INTERFACE prognostic_equations_noopt
+    PUBLIC prognostic_equations_cache, prognostic_equations_vector, &
+           prognostic_equations_acc
 
     INTERFACE prognostic_equations_cache
@@ -160,612 +156,4 @@
 
  CONTAINS
-
-
- SUBROUTINE prognostic_equations_noopt
-
-!------------------------------------------------------------------------------!
-! Version with single loop optimization
-!
-! (Optimized over each single prognostic equation.)
-!------------------------------------------------------------------------------!
-
-    IMPLICIT NONE
-
-    CHARACTER (LEN=9) ::  time_to_string
-    INTEGER ::  i, i_omp_start, j, k, tn = 0
-    REAL    ::  sbt
-
-!
-!-- Calculate those variables needed in the tendency terms which need
-!-- global communication
-    IF ( .NOT. neutral )  CALL calc_mean_profile( pt, 4 )
-    IF ( ocean         )  CALL calc_mean_profile( rho, 64 )
-    IF ( humidity      )  CALL calc_mean_profile( vpt, 44 )
-    IF ( ( ws_scheme_mom .OR. ws_scheme_sca )  .AND.  &
-         intermediate_timestep_count == 1 )  CALL ws_statistics
-
-!
-!-- u-velocity component
-    CALL cpu_log( log_point(5), 'u-equation', 'start' )
-
-    i_omp_start = nxlu
-    DO  i = nxlu, nxr
-       DO  j = nys, nyn
-!
-!--       Tendency terms
-          tend(:,j,i) = 0.0
-          IF ( timestep_scheme(1:5) == 'runge' )  THEN
-             IF ( ws_scheme_mom )  THEN
-                 CALL advec_u_ws( i, j, i_omp_start, tn )
-             ELSE
-                 CALL advec_u_pw( i, j )
-             ENDIF
-          ELSE
-             CALL advec_u_up( i, j )
-          ENDIF
-          CALL diffusion_u( i, j )
-          CALL coriolis( i, j, 1 )
-          IF ( sloping_surface  .AND.  .NOT. neutral )  THEN
-             CALL buoyancy( i, j, pt, pt_reference, 1, 4 )
-          ENDIF
-
-!
-!--       Drag by plant canopy
-          IF ( plant_canopy )  CALL plant_canopy_model( i, j, 1 )
-
-!
-!--       External pressure gradient
-          IF ( dp_external )  THEN
-             DO  k = dp_level_ind_b+1, nzt
-                tend(k,j,i) = tend(k,j,i) - dpdxy(1) * dp_smooth_factor(k)
-             ENDDO
-          ENDIF
-
-          CALL user_actions( i, j, 'u-tendency' )
-
-!
-!--       Prognostic equation for u-velocity component
-          DO  k = nzb_u_inner(j,i)+1, nzt
-             u_p(k,j,i) = u(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +          &
-                                               tsc(3) * tu_m(k,j,i) )          &
-                                   - tsc(5) * rdf(k) * ( u(k,j,i) - ug(k) )
-          ENDDO
-
-!
-!--       Calculate tendencies for the next Runge-Kutta step
-          IF ( timestep_scheme(1:5) == 'runge' )  THEN
-             IF ( intermediate_timestep_count == 1 )  THEN
-                DO  k = nzb_u_inner(j,i)+1, nzt
-                   tu_m(k,j,i) = tend(k,j,i)
-                ENDDO
-             ELSEIF ( intermediate_timestep_count < &
-                      intermediate_timestep_count_max )  THEN
-                DO  k = nzb_u_inner(j,i)+1, nzt
-                   tu_m(k,j,i) = -9.5625 * tend(k,j,i) + 5.3125 * tu_m(k,j,i)
-                ENDDO
-             ENDIF
-          ENDIF
-
-       ENDDO
-    ENDDO
-
-    CALL cpu_log( log_point(5), 'u-equation', 'stop' )
-
-!
-!-- v-velocity component
-    CALL cpu_log( log_point(6), 'v-equation', 'start' )
-
-    i_omp_start = nxl
-    DO  i = nxl, nxr
-       DO  j = nysv, nyn
-!
-!--       Tendency terms
-          tend(:,j,i) = 0.0
-          IF ( timestep_scheme(1:5) == 'runge' )  THEN
-             IF ( ws_scheme_mom )  THEN
-                 CALL advec_v_ws( i, j, i_omp_start, tn )
-             ELSE 
-                 CALL advec_v_pw( i, j )
-             ENDIF
-
-          ELSE
-             CALL advec_v_up( i, j )
-          ENDIF
-          CALL diffusion_v( i, j )
-          CALL coriolis( i, j, 2 )
-
-!
-!--       Drag by plant canopy
-          IF ( plant_canopy )  CALL plant_canopy_model( i, j, 2 )     
-
-!
-!--       External pressure gradient
-          IF ( dp_external )  THEN
-             DO  k = dp_level_ind_b+1, nzt
-                tend(k,j,i) = tend(k,j,i) - dpdxy(2) * dp_smooth_factor(k)
-             ENDDO
-          ENDIF
-
-          CALL user_actions( i, j, 'v-tendency' )
-
-!
-!--       Prognostic equation for v-velocity component
-          DO  k = nzb_v_inner(j,i)+1, nzt
-             v_p(k,j,i) = v(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +          &
-                                               tsc(3) * tv_m(k,j,i) )          &
-                                   - tsc(5) * rdf(k) * ( v(k,j,i) - vg(k) )
-          ENDDO
-
-!
-!--       Calculate tendencies for the next Runge-Kutta step
-          IF ( timestep_scheme(1:5) == 'runge' )  THEN
-             IF ( intermediate_timestep_count == 1 )  THEN
-                DO  k = nzb_v_inner(j,i)+1, nzt
-                   tv_m(k,j,i) = tend(k,j,i)
-                ENDDO
-             ELSEIF ( intermediate_timestep_count < &
-                      intermediate_timestep_count_max )  THEN
-                DO  k = nzb_v_inner(j,i)+1, nzt
-                   tv_m(k,j,i) = -9.5625 * tend(k,j,i) + 5.3125 * tv_m(k,j,i)
-                ENDDO
-             ENDIF
-          ENDIF
-
-       ENDDO
-    ENDDO
-
-    CALL cpu_log( log_point(6), 'v-equation', 'stop' )
-
-!
-!-- w-velocity component
-    CALL cpu_log( log_point(7), 'w-equation', 'start' )
-
-    DO  i = nxl, nxr
-       DO  j = nys, nyn
-!
-!--       Tendency terms
-          tend(:,j,i) = 0.0
-          IF ( timestep_scheme(1:5) == 'runge' )  THEN
-             IF ( ws_scheme_mom )  THEN
-                 CALL advec_w_ws( i, j, i_omp_start, tn )
-             ELSE  
-                 CALL advec_w_pw( i, j )
-             ENDIF
-
-          ELSE
-             CALL advec_w_up( i, j )
-          ENDIF
-          CALL diffusion_w( i, j )
-          CALL coriolis( i, j, 3 )
-
-          IF ( .NOT. neutral )  THEN
-             IF ( ocean )  THEN
-                CALL buoyancy( i, j, rho, rho_reference, 3, 64 )
-             ELSE
-                IF ( .NOT. humidity )  THEN
-                   CALL buoyancy( i, j, pt, pt_reference, 3, 4 )
-                ELSE
-                   CALL buoyancy( i, j, vpt, pt_reference, 3, 44 )
-                ENDIF
-             ENDIF
-          ENDIF
-
-!
-!--       Drag by plant canopy
-          IF ( plant_canopy )  CALL plant_canopy_model( i, j, 3 )
-
-          CALL user_actions( i, j, 'w-tendency' )
-
-!
-!--       Prognostic equation for w-velocity component
-          DO  k = nzb_w_inner(j,i)+1, nzt-1
-             w_p(k,j,i) = w(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +          &
-                                               tsc(3) * tw_m(k,j,i) )          &
-                                   - tsc(5) * rdf(k) * w(k,j,i)
-          ENDDO
-
-!
-!--       Calculate tendencies for the next Runge-Kutta step
-          IF ( timestep_scheme(1:5) == 'runge' )  THEN
-             IF ( intermediate_timestep_count == 1 )  THEN
-                DO  k = nzb_w_inner(j,i)+1, nzt-1
-                   tw_m(k,j,i) = tend(k,j,i)
-                ENDDO
-             ELSEIF ( intermediate_timestep_count < &
-                      intermediate_timestep_count_max )  THEN
-                DO  k = nzb_w_inner(j,i)+1, nzt-1
-                   tw_m(k,j,i) = -9.5625 * tend(k,j,i) + 5.3125 * tw_m(k,j,i)
-                ENDDO
-             ENDIF
-          ENDIF
-
-       ENDDO
-    ENDDO
-
-    CALL cpu_log( log_point(7), 'w-equation', 'stop' )
-
-!
-!-- If required, compute prognostic equation for potential temperature
-    IF ( .NOT. neutral )  THEN
-
-       CALL cpu_log( log_point(13), 'pt-equation', 'start' )
-
-!
-!--    pt-tendency terms with communication
-       sbt = tsc(2)
-       IF ( scalar_advec == 'bc-scheme' )  THEN
-
-          IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-!
-!--          Bott-Chlond scheme always uses Euler time step. Thus:
-             sbt = 1.0
-          ENDIF
-          tend = 0.0
-          CALL advec_s_bc( pt, 'pt' )
-
-       ENDIF
-
-!
-!--    pt-tendency terms with no communication
-       DO  i = nxl, nxr
-          DO  j = nys, nyn
-!
-!--          Tendency terms
-             IF ( scalar_advec /= 'bc-scheme' )  THEN
-                tend(:,j,i) = 0.0
-                IF ( timestep_scheme(1:5) == 'runge' )  THEN
-                   IF ( ws_scheme_sca )  THEN
-                      CALL advec_s_ws( i, j, pt, 'pt', flux_s_pt,       &
-                                       diss_s_pt, flux_l_pt, diss_l_pt, &
-                                       i_omp_start, tn )
-                   ELSE
-                       CALL advec_s_pw( i, j, pt )
-                   ENDIF
-                ELSE
-                   CALL advec_s_up( i, j, pt )
-                ENDIF
-             ENDIF
-
-             CALL diffusion_s( i, j, pt, shf, tswst, wall_heatflux )
-
-!
-!--          If required compute heating/cooling due to long wave radiation
-!--          processes
-             IF ( radiation )  THEN
-                CALL calc_radiation( i, j )
-             ENDIF
-
-!
-!--          If required compute impact of latent heat due to precipitation
-             IF ( precipitation )  THEN
-                CALL impact_of_latent_heat( i, j )
-             ENDIF
-
-!
-!--          Consideration of heat sources within the plant canopy
-             IF ( plant_canopy .AND. ( cthf /= 0.0 ) ) THEN
-                CALL plant_canopy_model( i, j, 4 )
-             ENDIF
-
-!
-!--          If required compute influence of large-scale subsidence/ascent
-             IF ( large_scale_subsidence )  THEN
-                CALL subsidence( i, j, tend, pt, pt_init )
-             ENDIF
-
-             CALL user_actions( i, j, 'pt-tendency' )
-
-!
-!--          Prognostic equation for potential temperature
-             DO  k = nzb_s_inner(j,i)+1, nzt
-                pt_p(k,j,i) = pt(k,j,i) + dt_3d * ( sbt * tend(k,j,i) +        &
-                                                    tsc(3) * tpt_m(k,j,i) )    &
-                                        - tsc(5) * ( pt(k,j,i) - pt_init(k) ) *&
-                                          ( rdf_sc(k) + ptdf_x(i) + ptdf_y(j) )
-             ENDDO
-
-!
-!--          Calculate tendencies for the next Runge-Kutta step
-             IF ( timestep_scheme(1:5) == 'runge' )  THEN
-                IF ( intermediate_timestep_count == 1 )  THEN
-                   DO  k = nzb_s_inner(j,i)+1, nzt
-                      tpt_m(k,j,i) = tend(k,j,i)
-                   ENDDO
-                ELSEIF ( intermediate_timestep_count < &
-                         intermediate_timestep_count_max )  THEN
-                   DO  k = nzb_s_inner(j,i)+1, nzt
-                      tpt_m(k,j,i) = -9.5625 * tend(k,j,i) + &
-                                     5.3125 * tpt_m(k,j,i)
-                   ENDDO
-                ENDIF
-             ENDIF
-
-          ENDDO
-       ENDDO
-
-       CALL cpu_log( log_point(13), 'pt-equation', 'stop' )
-
-    ENDIF
-
-!
-!-- If required, compute prognostic equation for salinity
-    IF ( ocean )  THEN
-
-       CALL cpu_log( log_point(37), 'sa-equation', 'start' )
-
-!
-!--    sa-tendency terms with communication
-       sbt = tsc(2)
-       IF ( scalar_advec == 'bc-scheme' )  THEN
-
-          IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-!
-!--          Bott-Chlond scheme always uses Euler time step. Thus:
-             sbt = 1.0
-          ENDIF
-          tend = 0.0
-          CALL advec_s_bc( sa, 'sa' )
-
-       ENDIF
-
-!
-!--    sa terms with no communication
-       DO  i = nxl, nxr
-          DO  j = nys, nyn
-!
-!--          Tendency-terms
-             IF ( scalar_advec /= 'bc-scheme' )  THEN
-                tend(:,j,i) = 0.0
-                IF ( timestep_scheme(1:5) == 'runge' ) THEN
-                   IF ( ws_scheme_sca )  THEN
-                       CALL advec_s_ws( i, j, sa, 'sa', flux_s_sa,  &
-                                    diss_s_sa, flux_l_sa, diss_l_sa, i_omp_start, tn )
-                   ELSE
-                       CALL advec_s_pw( i, j, sa )
-                   ENDIF
-
-                ELSE
-                   CALL advec_s_up( i, j, sa )
-                ENDIF
-             ENDIF
-
-             CALL diffusion_s( i, j, sa, saswsb, saswst, wall_salinityflux )
-       
-             CALL user_actions( i, j, 'sa-tendency' )
-
-!
-!--          Prognostic equation for salinity
-             DO  k = nzb_s_inner(j,i)+1, nzt
-                sa_p(k,j,i) = sa(k,j,i) + dt_3d * ( sbt * tend(k,j,i) +        &
-                                                    tsc(3) * tsa_m(k,j,i) )    &
-                                        - tsc(5) * rdf_sc(k) *                 &
-                                          ( sa(k,j,i) - sa_init(k) )
-                IF ( sa_p(k,j,i) < 0.0 )  sa_p(k,j,i) = 0.1 * sa(k,j,i)
-             ENDDO
-
-!
-!--          Calculate tendencies for the next Runge-Kutta step
-             IF ( timestep_scheme(1:5) == 'runge' )  THEN
-                IF ( intermediate_timestep_count == 1 )  THEN
-                   DO  k = nzb_s_inner(j,i)+1, nzt
-                      tsa_m(k,j,i) = tend(k,j,i)
-                   ENDDO
-                ELSEIF ( intermediate_timestep_count < &
-                         intermediate_timestep_count_max )  THEN
-                   DO  k = nzb_s_inner(j,i)+1, nzt
-                      tsa_m(k,j,i) = -9.5625 * tend(k,j,i) + &
-                                      5.3125 * tsa_m(k,j,i)
-                   ENDDO
-                ENDIF
-             ENDIF
-
-!
-!--          Calculate density by the equation of state for seawater
-             CALL eqn_state_seawater( i, j )
-
-          ENDDO
-       ENDDO
-
-       CALL cpu_log( log_point(37), 'sa-equation', 'stop' )
-
-    ENDIF
-
-!
-!-- If required, compute prognostic equation for total water content / scalar
-    IF ( humidity  .OR.  passive_scalar )  THEN
-
-       CALL cpu_log( log_point(29), 'q/s-equation', 'start' )
-
-!
-!--    Scalar/q-tendency terms with communication
-       sbt = tsc(2)
-       IF ( scalar_advec == 'bc-scheme' )  THEN
-
-          IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-!
-!--          Bott-Chlond scheme always uses Euler time step. Thus:
-             sbt = 1.0
-          ENDIF
-          tend = 0.0
-          CALL advec_s_bc( q, 'q' )
-
-       ENDIF
-
-!
-!--    Scalar/q-tendency terms with no communication
-       DO  i = nxl, nxr
-          DO  j = nys, nyn
-!
-!--          Tendency-terms
-             IF ( scalar_advec /= 'bc-scheme' )  THEN
-                tend(:,j,i) = 0.0
-                IF ( timestep_scheme(1:5) == 'runge' ) THEN
-                   IF ( ws_scheme_sca )  THEN
-                       CALL advec_s_ws( i, j, q, 'q', flux_s_q, &
-                                   diss_s_q, flux_l_q, diss_l_q, i_omp_start, tn )
-                   ELSE
-                       CALL advec_s_pw( i, j, q )
-                   ENDIF
-                ELSE
-                   CALL advec_s_up( i, j, q )
-                ENDIF
-             ENDIF
-
-             CALL diffusion_s( i, j, q, qsws, qswst, wall_qflux )
-       
-!
-!--          If required compute decrease of total water content due to
-!--          precipitation
-             IF ( precipitation )  THEN
-                CALL calc_precipitation( i, j )
-             ENDIF
-
-!
-!--          Sink or source of scalar concentration due to canopy elements
-             IF ( plant_canopy ) CALL plant_canopy_model( i, j, 5 )
-             
-!
-!--          If required compute influence of large-scale subsidence/ascent
-             IF ( large_scale_subsidence )  THEN
-                CALL subsidence( i, j, tend, q, q_init )
-             ENDIF
-
-             CALL user_actions( i, j, 'q-tendency' )
-
-!
-!--          Prognostic equation for total water content / scalar
-             DO  k = nzb_s_inner(j,i)+1, nzt
-                q_p(k,j,i) = q(k,j,i) + dt_3d * ( sbt * tend(k,j,i) +          &
-                                                  tsc(3) * tq_m(k,j,i) )       &
-                                      - tsc(5) * rdf_sc(k) *                   &
-                                        ( q(k,j,i) - q_init(k) )
-                IF ( q_p(k,j,i) < 0.0 )  q_p(k,j,i) = 0.1 * q(k,j,i)
-             ENDDO
-
-!
-!--          Calculate tendencies for the next Runge-Kutta step
-             IF ( timestep_scheme(1:5) == 'runge' )  THEN
-                IF ( intermediate_timestep_count == 1 )  THEN
-                   DO  k = nzb_s_inner(j,i)+1, nzt
-                      tq_m(k,j,i) = tend(k,j,i)
-                   ENDDO
-                ELSEIF ( intermediate_timestep_count < &
-                         intermediate_timestep_count_max )  THEN
-                   DO  k = nzb_s_inner(j,i)+1, nzt
-                      tq_m(k,j,i) = -9.5625 * tend(k,j,i) + 5.3125 * tq_m(k,j,i)
-                   ENDDO
-                ENDIF
-             ENDIF
-
-          ENDDO
-       ENDDO
-
-       CALL cpu_log( log_point(29), 'q/s-equation', 'stop' )
-
-    ENDIF
-
-!
-!-- If required, compute prognostic equation for turbulent kinetic 
-!-- energy (TKE)
-    IF ( .NOT. constant_diffusion )  THEN
-
-       CALL cpu_log( log_point(16), 'tke-equation', 'start' )
-
-!
-!--    TKE-tendency terms with communication
-       CALL production_e_init
-
-       sbt = tsc(2)
-       IF ( .NOT. use_upstream_for_tke )  THEN
-          IF ( scalar_advec == 'bc-scheme' )  THEN
-
-             IF ( timestep_scheme(1:5) /= 'runge' )  THEN
-!
-!--             Bott-Chlond scheme always uses Euler time step. Thus:
-                sbt = 1.0
-             ENDIF
-             tend = 0.0
-             CALL advec_s_bc( e, 'e' )
-          ENDIF
-       ENDIF
-
-!
-!--    TKE-tendency terms with no communication
-       DO  i = nxl, nxr
-          DO  j = nys, nyn
-!
-!--          Tendency-terms
-             IF ( scalar_advec /= 'bc-scheme' .OR. use_upstream_for_tke )  THEN
-                IF ( use_upstream_for_tke )  THEN
-                   tend(:,j,i) = 0.0
-                   CALL advec_s_up( i, j, e )
-                ELSE
-                   tend(:,j,i) = 0.0
-                   IF ( timestep_scheme(1:5) == 'runge' )  THEN
-                      IF ( ws_scheme_sca )  THEN
-                          CALL advec_s_ws( i, j, e, 'e', flux_s_e, & 
-                                      diss_s_e, flux_l_e, diss_l_e, i_omp_start, tn )
-                      ELSE
-                          CALL advec_s_pw( i, j, e )
-                      ENDIF
-                   ELSE
-                      CALL advec_s_up( i, j, e )
-                   ENDIF
-                ENDIF
-             ENDIF
-
-             IF ( .NOT. humidity )  THEN
-                IF ( ocean )  THEN
-                   CALL diffusion_e( i, j, prho, prho_reference )
-                ELSE
-                   CALL diffusion_e( i, j, pt, pt_reference )
-                ENDIF
-             ELSE
-                CALL diffusion_e( i, j, vpt, pt_reference )
-             ENDIF
-
-             CALL production_e( i, j )
-
-!
-!--          Additional sink term for flows through plant canopies
-             IF ( plant_canopy )  CALL plant_canopy_model( i, j, 6 )         
-
-             CALL user_actions( i, j, 'e-tendency' )
-
-!
-!--          Prognostic equation for TKE.
-!--          Eliminate negative TKE values, which can occur due to numerical
-!--          reasons in the course of the integration. In such cases the old TKE
-!--          value is reduced by 90%.
-             DO  k = nzb_s_inner(j,i)+1, nzt
-                e_p(k,j,i) = e(k,j,i) + dt_3d * ( sbt * tend(k,j,i) +          &
-                                                  tsc(3) * te_m(k,j,i) )
-                IF ( e_p(k,j,i) < 0.0 )  e_p(k,j,i) = 0.1 * e(k,j,i)
-             ENDDO
-
-!
-!--          Calculate tendencies for the next Runge-Kutta step
-             IF ( timestep_scheme(1:5) == 'runge' )  THEN
-                IF ( intermediate_timestep_count == 1 )  THEN
-                   DO  k = nzb_s_inner(j,i)+1, nzt
-                      te_m(k,j,i) = tend(k,j,i)
-                   ENDDO
-                ELSEIF ( intermediate_timestep_count < &
-                         intermediate_timestep_count_max )  THEN
-                   DO  k = nzb_s_inner(j,i)+1, nzt
-                      te_m(k,j,i) = -9.5625 * tend(k,j,i) + 5.3125 * te_m(k,j,i)
-                   ENDDO
-                ENDIF
-             ENDIF
-
-          ENDDO
-       ENDDO
-
-       CALL cpu_log( log_point(16), 'tke-equation', 'stop' )
-
-    ENDIF
-
-
- END SUBROUTINE prognostic_equations_noopt
 
 
Index: /palm/trunk/SOURCE/time_integration.f90
===================================================================
--- /palm/trunk/SOURCE/time_integration.f90	(revision 1018)
+++ /palm/trunk/SOURCE/time_integration.f90	(revision 1019)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-!
+! non-optimized version of prognostic_equations removed
 !
 ! Former revisions:
@@ -177,14 +177,10 @@
 !--       in the other versions a good vectorization is prohibited due to
 !--       inlining problems.
-          IF ( loop_optimization == 'vector' )  THEN
+          IF ( loop_optimization == 'cache' )  THEN
+             CALL prognostic_equations_cache
+          ELSEIF ( loop_optimization == 'vector' )  THEN
              CALL prognostic_equations_vector
           ELSEIF ( loop_optimization == 'acc' )  THEN
              CALL prognostic_equations_acc
-          ELSE
-             IF ( scalar_advec == 'bc-scheme' )  THEN
-                CALL prognostic_equations_noopt
-             ELSE
-                CALL prognostic_equations_cache
-             ENDIF
           ENDIF
 
