Index: palm/trunk/SOURCE/prognostic_equations.f90
===================================================================
--- palm/trunk/SOURCE/prognostic_equations.f90	(revision 3770)
+++ palm/trunk/SOURCE/prognostic_equations.f90	(revision 3771)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! preprocessor directivs fro rrtmg added
+! 
+! 3761 2019-02-25 15:31:42Z raasch
 ! unused variable removed
 ! 
@@ -425,7 +428,9 @@
         ONLY:  cthf, pcm_tendency
 
+#if defined( __rrtmg )
     USE radiation_model_mod,                                                   &
         ONLY:  radiation, radiation_tendency,                                  &
                skip_time_do_radiation
+#endif
                           
     USE salsa_mod,                                                             &
@@ -943,4 +948,5 @@
              ENDIF
 
+#if defined( __rrtmg )
 !
 !--          If required, add tendency due to radiative heating/cooling
@@ -949,5 +955,5 @@
                 CALL radiation_tendency ( i, j, tend )
              ENDIF
-
+#endif
 
              CALL module_interface_actions( i, j, 'pt-tendency' )
@@ -1957,4 +1963,5 @@
        ENDIF
 
+#if defined( __rrtmg )
 !
 !--    If required, add tendency due to radiative heating/cooling
@@ -1963,4 +1970,5 @@
             CALL radiation_tendency ( tend )
        ENDIF
+#endif
 
        CALL module_interface_actions( 'pt-tendency' )
Index: palm/trunk/SOURCE/radiation_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/radiation_model_mod.f90	(revision 3770)
+++ palm/trunk/SOURCE/radiation_model_mod.f90	(revision 3771)
@@ -23,9 +23,14 @@
 ! Current revisions:
 ! ------------------
-!
+! 
 ! 
 ! Former revisions:
 ! -----------------
 ! $Id$
+! rrtmg preprocessor for directives moved/added, save attribute added to temporary
+! pointers to avoid compiler warnings about outlived pointer targets,
+! statement added to avoid compiler warning about unused variable
+! 
+! 3769 2019-02-28 10:16:49Z moh.hefny
 ! removed unused variables and subroutine radiation_radflux_gridbox
 !
@@ -1219,8 +1224,10 @@
     END INTERFACE radiation_rrtmg
 
+#if defined( __rrtmg )
     INTERFACE radiation_tendency
        MODULE PROCEDURE radiation_tendency
        MODULE PROCEDURE radiation_tendency_ij
     END INTERFACE radiation_tendency
+#endif
 
     INTERFACE radiation_rrd_local
@@ -1267,5 +1274,5 @@
            radiation_check_parameters, radiation_control,                      &
            radiation_header, radiation_init, radiation_parin,                  &
-           radiation_3d_data_averaging, radiation_tendency,                    &
+           radiation_3d_data_averaging,                                        &
            radiation_data_output_2d, radiation_data_output_3d,                 &
            radiation_define_netcdf_grid, radiation_wrd_local,                  &
@@ -1274,5 +1281,4 @@
            radiation_interaction, radiation_interaction_init,                  &
            radiation_read_svf, radiation_presimulate_solar_pos
-            
 
     
@@ -1300,5 +1306,5 @@
 
 #if defined ( __rrtmg )
-    PUBLIC rrtm_aldif, rrtm_aldir, rrtm_asdif, rrtm_asdir
+    PUBLIC radiation_tendency, rrtm_aldif, rrtm_aldir, rrtm_asdif, rrtm_asdir
 #endif
 
@@ -1483,6 +1489,10 @@
 
 
-   INTEGER(iwp),      INTENT(IN)     ::  dots_max
-   INTEGER(iwp),      INTENT(INOUT)  ::  dots_num
+    INTEGER(iwp),      INTENT(IN)     ::  dots_max
+    INTEGER(iwp),      INTENT(INOUT)  ::  dots_num
+
+!
+!-- Next line is just to avoid compiler warning about unused variable.
+    IF ( dots_max == 0 )  CONTINUE
 
 !
@@ -4881,4 +4891,5 @@
 !> Cache-optimized version.
 !------------------------------------------------------------------------------!
+#if defined( __rrtmg )
  SUBROUTINE radiation_tendency_ij ( i, j, tend )
 
@@ -4890,5 +4901,4 @@
 
     IF ( radiation_scheme == 'rrtmg' )  THEN
-#if defined  ( __rrtmg )
 !
 !--    Calculate tendency based on heating rate
@@ -4897,8 +4907,9 @@
                                          * d_exner(k) * d_seconds_hour
        ENDDO
+
+    ENDIF
+
+ END SUBROUTINE radiation_tendency_ij
 #endif
-    ENDIF
-
-    END SUBROUTINE radiation_tendency_ij
 
 
@@ -4909,4 +4920,5 @@
 !> Vector-optimized version
 !------------------------------------------------------------------------------!
+#if defined( __rrtmg )
  SUBROUTINE radiation_tendency ( tend )
 
@@ -4921,5 +4933,4 @@
 
     IF ( radiation_scheme == 'rrtmg' )  THEN
-#if defined  ( __rrtmg )
 !
 !--    Calculate tendency based on heating rate
@@ -4933,9 +4944,8 @@
           ENDDO
        ENDDO
+    ENDIF
+
+ END SUBROUTINE radiation_tendency
 #endif
-    ENDIF
-
-
- END SUBROUTINE radiation_tendency
 
 !------------------------------------------------------------------------------!
@@ -5899,5 +5909,5 @@
        REAL(wp)     :: mrl
 #if defined( __parallel )
-       INTEGER(iwp), DIMENSION(:), POINTER       ::  gridsurf_rma   !< fortran pointer, but lower bounds are 1
+       INTEGER(iwp), DIMENSION(:), POINTER, SAVE ::  gridsurf_rma   !< fortran pointer, but lower bounds are 1
        TYPE(c_ptr)                               ::  gridsurf_rma_p !< allocated c pointer
        INTEGER(iwp)                              ::  minfo          !< MPI RMA window info handle
@@ -6445,5 +6455,5 @@
         INTEGER(iwp)                                  :: max_track_len !< maximum 2d track length
         INTEGER(iwp)                                  :: minfo
-        REAL(wp), DIMENSION(:), POINTER               :: lad_s_rma       !< fortran 1D pointer
+        REAL(wp), DIMENSION(:), POINTER, SAVE         :: lad_s_rma       !< fortran 1D pointer
         TYPE(c_ptr)                                   :: lad_s_rma_p     !< allocated c pointer
 #if defined( __parallel )
