Index: palm/trunk/SOURCE/pmc_interface_mod.f90
===================================================================
--- palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 2101)
+++ palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 2174)
@@ -21,5 +21,8 @@
 ! Current revisions:
 ! ------------------
-! 
+! Added support for cloud physics quantities, syntax layout improvements. Data
+! transfer of qc and nc is prepared but currently deactivated until both
+! quantities become prognostic variables.
+! Some bugfixes.
 ! 
 ! Former revisions:
@@ -121,22 +124,26 @@
 ! Domain nesting interface routines. The low-level inter-domain communication   
 ! is conducted by the PMC-library routines.
+!
+! @todo Remove array_3d variables from USE statements thate not used in the 
+!       routine
+! @todo Data transfer of qc and nc is prepared but not activated
 !-------------------------------------------------------------------------------!
 
 #if defined( __nopointer )
-    USE arrays_3d,                                                              &
-        ONLY:  dzu, dzw, e, e_p, pt, pt_p, q, q_p, u, u_p, v, v_p, w, w_p, zu,  &
-               zw, z0
+    USE arrays_3d,                                                             &
+        ONLY:  dzu, dzw, e, e_p, nr, pt, pt_p, q, q_p, qr, u, u_p, v, v_p,     &
+               w, w_p, zu, zw, z0
 #else
-   USE arrays_3d,                                                               &
-        ONLY:  dzu, dzw, e, e_p, e_1, e_2, pt, pt_p, pt_1, pt_2, q, q_p, q_1,   &
-               q_2, s, s_2, u, u_p, u_1, u_2, v, v_p, v_1, v_2, w, w_p, w_1,    &
-               w_2, zu, zw, z0
+   USE arrays_3d,                                                              &
+        ONLY:  dzu, dzw, e, e_p, e_1, e_2, nr, nr_2, nr_p, pt, pt_p, pt_1,     &
+               pt_2, q, q_p, q_1, q_2, qr, qr_2, s, s_2, u, u_p, u_1, u_2, v,  &
+               v_p, v_1, v_2, w, w_p, w_1, w_2, zu, zw, z0
 #endif
 
     USE control_parameters,                                                     &
-        ONLY:  coupling_char, dt_3d, dz, humidity, message_string,              &
-               nest_bound_l, nest_bound_r, nest_bound_s, nest_bound_n,          &
-               nest_domain, neutral, passive_scalar, simulated_time,            &
-               topography, volume_flow
+        ONLY:  cloud_physics, coupling_char, dt_3d, dz, humidity,               &
+               message_string, microphysics_seifert, nest_bound_l, nest_bound_r,&
+               nest_bound_s, nest_bound_n, nest_domain, neutral, passive_scalar,& 
+               simulated_time, topography, volume_flow
 
     USE cpulog,                                                                 &
@@ -249,5 +256,9 @@
     REAL(wp), SAVE, DIMENSION(:,:,:), ALLOCATABLE, TARGET ::  vc   !:
     REAL(wp), SAVE, DIMENSION(:,:,:), ALLOCATABLE, TARGET ::  wc   !:
-    REAL(wp), SAVE, DIMENSION(:,:,:), ALLOCATABLE, TARGET ::  qc   !:
+    REAL(wp), SAVE, DIMENSION(:,:,:), ALLOCATABLE, TARGET ::  q_c  !:
+!     REAL(wp), SAVE, DIMENSION(:,:,:), ALLOCATABLE, TARGET ::  qcc  !:
+    REAL(wp), SAVE, DIMENSION(:,:,:), ALLOCATABLE, TARGET ::  qrc  !:
+    REAL(wp), SAVE, DIMENSION(:,:,:), ALLOCATABLE, TARGET ::  nrc  !:
+!     REAL(wp), SAVE, DIMENSION(:,:,:), ALLOCATABLE, TARGET ::  ncc  !:
     REAL(wp), SAVE, DIMENSION(:,:,:), ALLOCATABLE, TARGET ::  sc   !:
 
@@ -920,10 +931,23 @@
        CALL pmc_set_dataarray_name( 'coarse', 'w'  ,'fine', 'w',  ierr )
        CALL pmc_set_dataarray_name( 'coarse', 'e'  ,'fine', 'e',  ierr )
+
        IF ( .NOT. neutral )  THEN
           CALL pmc_set_dataarray_name( 'coarse', 'pt' ,'fine', 'pt', ierr )
        ENDIF
+
        IF ( humidity )  THEN
+
           CALL pmc_set_dataarray_name( 'coarse', 'q'  ,'fine', 'q',  ierr )
-       ENDIF
+
+          IF ( cloud_physics  .AND.  microphysics_seifert )  THEN
+!              CALL pmc_set_dataarray_name( 'coarse', 'qc'  ,'fine', 'qc',  ierr )  
+             CALL pmc_set_dataarray_name( 'coarse', 'qr'  ,'fine', 'qr',  ierr )
+!             CALL pmc_set_dataarray_name( 'coarse', 'nc'  ,'fine', 'nc',  ierr ) 
+             CALL pmc_set_dataarray_name( 'coarse', 'nr'  ,'fine', 'nr',  ierr ) 
+
+          ENDIF
+     
+       ENDIF
+
        IF ( passive_scalar )  THEN
           CALL pmc_set_dataarray_name( 'coarse', 's'  ,'fine', 's',  ierr )
@@ -2541,4 +2565,8 @@
     IF ( TRIM(name) == "pt" )  p_3d => pt
     IF ( TRIM(name) == "q"  )  p_3d => q
+!     IF ( TRIM(name) == "qc" )  p_3d => qc
+    IF ( TRIM(name) == "qr" )  p_3d => qr
+    IF ( TRIM(name) == "nr" )  p_3d => nr
+!     IF ( TRIM(name) == "nc" )  p_3d => nc
     IF ( TRIM(name) == "s"  )  p_3d => s
 !
@@ -2573,4 +2601,8 @@
     IF ( TRIM(name) == "pt" )  p_3d_sec => pt_2
     IF ( TRIM(name) == "q"  )  p_3d_sec => q_2
+!     IF ( TRIM(name) == "qc" )  p_3d_sec => qc_2
+    IF ( TRIM(name) == "qr" )  p_3d_sec => qr_2
+    IF ( TRIM(name) == "nr" )  p_3d_sec => nr_2
+!     IF ( TRIM(name) == "nc" )  p_3d_sec => nc_2
     IF ( TRIM(name) == "s"  )  p_3d_sec => s_2
 
@@ -2643,6 +2675,18 @@
        p_3d => ptc
     ELSEIF ( TRIM( name ) == "q")  THEN
-       IF ( .NOT. ALLOCATED( qc ) ) ALLOCATE( qc(0:nzc+1, js:je, is:ie) )
-       p_3d => qc
+       IF ( .NOT. ALLOCATED( q_c ) ) ALLOCATE( q_c(0:nzc+1, js:je, is:ie) )
+       p_3d => q_c
+!     ELSEIF ( TRIM( name ) == "qc")  THEN
+!        IF ( .NOT. ALLOCATED( qcc ) ) ALLOCATE( qcc(0:nzc+1, js:je, is:ie) )
+!        p_3d => qcc
+    ELSEIF ( TRIM( name ) == "qr")  THEN
+       IF ( .NOT. ALLOCATED( qrc ) ) ALLOCATE( qrc(0:nzc+1, js:je, is:ie) )
+       p_3d => qrc
+    ELSEIF ( TRIM( name ) == "nr")  THEN
+       IF ( .NOT. ALLOCATED( nrc ) ) ALLOCATE( nrc(0:nzc+1, js:je, is:ie) )
+       p_3d => nrc
+!     ELSEIF ( TRIM( name ) == "nc")  THEN
+!        IF ( .NOT. ALLOCATED( ncc ) ) ALLOCATE( ncc(0:nzc+1, js:je, is:ie) )
+!        p_3d => ncc
     ELSEIF ( TRIM( name ) == "s")  THEN
        IF ( .NOT. ALLOCATED( sc ) ) ALLOCATE( sc(0:nzc+1, js:je, is:ie) )
@@ -2743,12 +2787,32 @@
        CALL pmci_interp_tril_all ( e,  ec,  ico, jco, kco, r1xo, r2xo, r1yo,    &
                                    r2yo, r1zo, r2zo, nzb_s_inner, 'e' )
+
        IF ( .NOT. neutral )  THEN
           CALL pmci_interp_tril_all ( pt, ptc, ico, jco, kco, r1xo, r2xo,       &
                                       r1yo, r2yo, r1zo, r2zo, nzb_s_inner, 's' )
        ENDIF
+
        IF ( humidity )  THEN
-          CALL pmci_interp_tril_all ( q, qc, ico, jco, kco, r1xo, r2xo, r1yo,   &
+
+          CALL pmci_interp_tril_all ( q, q_c, ico, jco, kco, r1xo, r2xo, r1yo,   &
                                       r2yo, r1zo, r2zo, nzb_s_inner, 's' )
-       ENDIF
+
+          IF ( cloud_physics  .AND.  microphysics_seifert )  THEN
+!              CALL pmci_interp_tril_all ( qc, qcc, ico, jco, kco, r1xo, r2xo,    &
+!                                          r1yo, r2yo, r1zo, r2zo, nzb_s_inner,   & 
+!                                          's' ) 
+             CALL pmci_interp_tril_all ( qr, qrc, ico, jco, kco, r1xo, r2xo,    &
+                                         r1yo, r2yo, r1zo, r2zo, nzb_s_inner,   & 
+                                         's' )
+!             CALL pmci_interp_tril_all ( nc, ncc, ico, jco, kco, r1xo, r2xo,    &
+!                                         r1yo, r2yo, r1zo, r2zo, nzb_s_inner,   & 
+!                                         's' )   
+             CALL pmci_interp_tril_all ( nr, nrc, ico, jco, kco, r1xo, r2xo,    &
+                                         r1yo, r2yo, r1zo, r2zo, nzb_s_inner,   & 
+                                         's' )
+          ENDIF
+
+       ENDIF
+
        IF ( passive_scalar )  THEN
           CALL pmci_interp_tril_all ( s, sc, ico, jco, kco, r1xo, r2xo, r1yo,   &
@@ -3378,16 +3442,20 @@
                                        logc_u_l, logc_ratio_u_l,                &
                                        nzt_topo_nestbc_l, 'l', 'u' )
+
              CALL pmci_interp_tril_lr( v,  vc,  ico, jcv, kco, r1xo, r2xo,      &
                                        r1yv, r2yv, r1zo, r2zo, nzb_v_inner,     &
                                        logc_v_l, logc_ratio_v_l,                &
                                        nzt_topo_nestbc_l, 'l', 'v' )
+
              CALL pmci_interp_tril_lr( w,  wc,  ico, jco, kcw, r1xo, r2xo,      &
                                        r1yo, r2yo, r1zw, r2zw, nzb_w_inner,     &
                                        logc_w_l, logc_ratio_w_l,                &
                                        nzt_topo_nestbc_l, 'l', 'w' )
+
              CALL pmci_interp_tril_lr( e,  ec,  ico, jco, kco, r1xo, r2xo,      &
                                        r1yo, r2yo, r1zo, r2zo, nzb_s_inner,     &
                                        logc_u_l, logc_ratio_u_l,                &
                                        nzt_topo_nestbc_l, 'l', 'e' )
+
              IF ( .NOT. neutral )  THEN
                 CALL pmci_interp_tril_lr( pt, ptc, ico, jco, kco, r1xo, r2xo,   &
@@ -3396,10 +3464,41 @@
                                           nzt_topo_nestbc_l, 'l', 's' )
              ENDIF
+
              IF ( humidity )  THEN
-                CALL pmci_interp_tril_lr( q, qc, ico, jco, kco, r1xo, r2xo,     &
+
+                CALL pmci_interp_tril_lr( q, q_c, ico, jco, kco, r1xo, r2xo,    &
                                           r1yo, r2yo, r1zo, r2zo, nzb_s_inner,  &
                                           logc_u_l, logc_ratio_u_l,             &
                                           nzt_topo_nestbc_l, 'l', 's' )
+
+
+                IF ( cloud_physics  .AND.  microphysics_seifert )  THEN
+!                    CALL pmci_interp_tril_lr( qc, qcc, ico, jco, kco, r1xo, r2xo,&
+!                                              r1yo, r2yo, r1zo, r2zo,            &
+!                                              nzb_s_inner, logc_u_l,             &
+!                                              logc_ratio_u_l, nzt_topo_nestbc_l, &
+!                                              'l', 's' )  
+
+                   CALL pmci_interp_tril_lr( qr, qrc, ico, jco, kco, r1xo, r2xo,&
+                                             r1yo, r2yo, r1zo, r2zo,            &
+                                             nzb_s_inner, logc_u_l,             &
+                                             logc_ratio_u_l, nzt_topo_nestbc_l, &
+                                             'l', 's' ) 
+
+!                    CALL pmci_interp_tril_lr( nc, ncc, ico, jco, kco, r1xo, r2xo,&
+!                                              r1yo, r2yo, r1zo, r2zo,            &
+!                                              nzb_s_inner, logc_u_l,             &
+!                                              logc_ratio_u_l, nzt_topo_nestbc_l, &
+!                                              'l', 's' ) 
+
+                   CALL pmci_interp_tril_lr( nr, nrc, ico, jco, kco, r1xo, r2xo,&
+                                             r1yo, r2yo, r1zo, r2zo,            &
+                                             nzb_s_inner, logc_u_l,             &
+                                             logc_ratio_u_l, nzt_topo_nestbc_l, &
+                                             'l', 's' )             
+                ENDIF
+
              ENDIF
+
              IF ( passive_scalar )  THEN
                 CALL pmci_interp_tril_lr( s, sc, ico, jco, kco, r1xo, r2xo,     &
@@ -3410,17 +3509,33 @@
 
              IF ( TRIM( nesting_mode ) == 'one-way' )  THEN
+
                 CALL pmci_extrap_ifoutflow_lr( u, nzb_u_inner, 'l', 'u' )
                 CALL pmci_extrap_ifoutflow_lr( v, nzb_v_inner, 'l', 'v' )
                 CALL pmci_extrap_ifoutflow_lr( w, nzb_w_inner, 'l', 'w' )
                 CALL pmci_extrap_ifoutflow_lr( e, nzb_s_inner, 'l', 'e' )
+
                 IF ( .NOT. neutral )  THEN
                    CALL pmci_extrap_ifoutflow_lr( pt,nzb_s_inner, 'l', 's' )
                 ENDIF
+
                 IF ( humidity )  THEN
+
                    CALL pmci_extrap_ifoutflow_lr( q, nzb_s_inner, 'l', 's' )
+
+                   IF ( cloud_physics  .AND.  microphysics_seifert )  THEN
+
+!                       CALL pmci_extrap_ifoutflow_lr( qc, nzb_s_inner, 'l', 's' )
+                      CALL pmci_extrap_ifoutflow_lr( qr, nzb_s_inner, 'l', 's' )
+!                      CALL pmci_extrap_ifoutflow_lr( nc, nzb_s_inner, 'l', 's' )
+                      CALL pmci_extrap_ifoutflow_lr( nr, nzb_s_inner, 'l', 's' )
+
+                   ENDIF
+
                 ENDIF
+
                 IF ( passive_scalar )  THEN
                    CALL pmci_extrap_ifoutflow_lr( s, nzb_s_inner, 'l', 's' )
                 ENDIF
+
              ENDIF
 
@@ -3430,50 +3545,100 @@
    !--    Right border pe
           IF ( nest_bound_r )  THEN
-             CALL pmci_interp_tril_lr( u,  uc,  icu, jco, kco, r1xu, r2xu,      &
-                                       r1yo, r2yo, r1zo, r2zo, nzb_u_inner,     &
-                                       logc_u_r, logc_ratio_u_r,                &
+
+             CALL pmci_interp_tril_lr( u,  uc,  icu, jco, kco, r1xu, r2xu,     &
+                                       r1yo, r2yo, r1zo, r2zo, nzb_u_inner,    &
+                                       logc_u_r, logc_ratio_u_r,               &
                                        nzt_topo_nestbc_r, 'r', 'u' )
-             CALL pmci_interp_tril_lr( v,  vc,  ico, jcv, kco, r1xo, r2xo,      &
-                                       r1yv, r2yv, r1zo, r2zo, nzb_v_inner,     &
-                                       logc_v_r, logc_ratio_v_r,                &
+
+             CALL pmci_interp_tril_lr( v,  vc,  ico, jcv, kco, r1xo, r2xo,     &
+                                       r1yv, r2yv, r1zo, r2zo, nzb_v_inner,    &
+                                       logc_v_r, logc_ratio_v_r,               &
                                        nzt_topo_nestbc_r, 'r', 'v' )
-             CALL pmci_interp_tril_lr( w,  wc,  ico, jco, kcw, r1xo, r2xo,      &
-                                       r1yo, r2yo, r1zw, r2zw, nzb_w_inner,     &
-                                       logc_w_r, logc_ratio_w_r,                &
+
+             CALL pmci_interp_tril_lr( w,  wc,  ico, jco, kcw, r1xo, r2xo,     &
+                                       r1yo, r2yo, r1zw, r2zw, nzb_w_inner,    &
+                                       logc_w_r, logc_ratio_w_r,               &
                                        nzt_topo_nestbc_r, 'r', 'w' )
-             CALL pmci_interp_tril_lr( e,  ec,  ico, jco, kco, r1xo, r2xo,      &
-                                       r1yo,r2yo, r1zo, r2zo, nzb_s_inner,      &
-                                       logc_u_r, logc_ratio_u_r,                &
+
+             CALL pmci_interp_tril_lr( e,  ec,  ico, jco, kco, r1xo, r2xo,     &
+                                       r1yo,r2yo, r1zo, r2zo, nzb_s_inner,     &
+                                       logc_u_r, logc_ratio_u_r,               &
                                        nzt_topo_nestbc_r, 'r', 'e' )
+
              IF ( .NOT. neutral )  THEN
-                CALL pmci_interp_tril_lr( pt, ptc, ico, jco, kco, r1xo, r2xo,   &
-                                          r1yo, r2yo, r1zo, r2zo, nzb_s_inner,  &
-                                          logc_u_r, logc_ratio_u_r,             &
+                CALL pmci_interp_tril_lr( pt, ptc, ico, jco, kco, r1xo, r2xo,  &
+                                          r1yo, r2yo, r1zo, r2zo, nzb_s_inner, &
+                                          logc_u_r, logc_ratio_u_r,            &
                                           nzt_topo_nestbc_r, 'r', 's' )
              ENDIF
+
              IF ( humidity )  THEN
-                CALL pmci_interp_tril_lr( q, qc, ico, jco, kco, r1xo, r2xo,     &
-                                          r1yo, r2yo, r1zo, r2zo, nzb_s_inner,  &
-                                          logc_u_r, logc_ratio_u_r,             &
+
+                CALL pmci_interp_tril_lr( q, q_c, ico, jco, kco, r1xo, r2xo,   &
+                                          r1yo, r2yo, r1zo, r2zo, nzb_s_inner, &
+                                          logc_u_r, logc_ratio_u_r,            &
+                                          nzt_topo_nestbc_r, 'r', 's' )
+
+                IF ( cloud_physics  .AND.  microphysics_seifert )  THEN
+
+!                    CALL pmci_interp_tril_lr( qc, qcc, ico, jco, kco, r1xo,     &
+!                                              r2xo, r1yo, r2yo, r1zo, r2zo,     &
+!                                              nzb_s_inner, logc_u_r,            &
+!                                              logc_ratio_u_r, nzt_topo_nestbc_r,&
+!                                              'r', 's' ) 
+     
+                   CALL pmci_interp_tril_lr( qr, qrc, ico, jco, kco, r1xo,     &
+                                             r2xo, r1yo, r2yo, r1zo, r2zo,     &
+                                             nzb_s_inner, logc_u_r,            &
+                                             logc_ratio_u_r, nzt_topo_nestbc_r,&
+                                             'r', 's' ) 
+
+!                    CALL pmci_interp_tril_lr( nc, ncc, ico, jco, kco, r1xo,     &
+!                                              r2xo, r1yo, r2yo, r1zo, r2zo,     &
+!                                              nzb_s_inner, logc_u_r,            &
+!                                              logc_ratio_u_r, nzt_topo_nestbc_r,&
+!                                              'r', 's' ) 
+
+                   CALL pmci_interp_tril_lr( nr, nrc, ico, jco, kco, r1xo,     &
+                                             r2xo, r1yo, r2yo, r1zo, r2zo,     &
+                                             nzb_s_inner, logc_u_r,            &
+                                             logc_ratio_u_r, nzt_topo_nestbc_r,&
+                                             'r', 's' ) 
+
+                ENDIF
+
+             ENDIF
+
+             IF ( passive_scalar )  THEN
+                CALL pmci_interp_tril_lr( s, sc, ico, jco, kco, r1xo, r2xo,    &
+                                          r1yo, r2yo, r1zo, r2zo, nzb_s_inner, &
+                                          logc_u_r, logc_ratio_u_r,            &
                                           nzt_topo_nestbc_r, 'r', 's' )
              ENDIF
-             IF ( passive_scalar )  THEN
-                CALL pmci_interp_tril_lr( s, sc, ico, jco, kco, r1xo, r2xo,     &
-                                          r1yo, r2yo, r1zo, r2zo, nzb_s_inner,  &
-                                          logc_u_r, logc_ratio_u_r,             &
-                                          nzt_topo_nestbc_r, 'r', 's' )
-             ENDIF
 
              IF ( TRIM( nesting_mode ) == 'one-way' )  THEN
+
                 CALL pmci_extrap_ifoutflow_lr( u, nzb_u_inner, 'r', 'u' )
                 CALL pmci_extrap_ifoutflow_lr( v, nzb_v_inner, 'r', 'v' )
                 CALL pmci_extrap_ifoutflow_lr( w, nzb_w_inner, 'r', 'w' )
                 CALL pmci_extrap_ifoutflow_lr( e, nzb_s_inner, 'r', 'e' )
+
                 IF ( .NOT. neutral )  THEN
                    CALL pmci_extrap_ifoutflow_lr( pt,nzb_s_inner, 'r', 's' )
                 ENDIF
+
                 IF ( humidity )  THEN
+
                    CALL pmci_extrap_ifoutflow_lr( q, nzb_s_inner, 'r', 's' )
+
+                   IF ( cloud_physics  .AND.  microphysics_seifert )  THEN
+!                       CALL pmci_extrap_ifoutflow_lr( qc, nzb_s_inner, 'r', 's' )
+                      CALL pmci_extrap_ifoutflow_lr( qr, nzb_s_inner, 'r', 's' )
+!                      CALL pmci_extrap_ifoutflow_lr( nc, nzb_s_inner, 'r', 's' )  
+                      CALL pmci_extrap_ifoutflow_lr( nr, nzb_s_inner, 'r', 's' )
+                   ENDIF
+
                 ENDIF
+
                 IF ( passive_scalar )  THEN
                    CALL pmci_extrap_ifoutflow_lr( s, nzb_s_inner, 'r', 's' )
@@ -3486,53 +3651,104 @@
    !--    South border pe
           IF ( nest_bound_s )  THEN
-             CALL pmci_interp_tril_sn( u,  uc,  icu, jco, kco, r1xu, r2xu,      &
-                                       r1yo, r2yo, r1zo, r2zo, nzb_u_inner,     &
-                                       logc_u_s, logc_ratio_u_s,                &
+             CALL pmci_interp_tril_sn( u,  uc,  icu, jco, kco, r1xu, r2xu,     &
+                                       r1yo, r2yo, r1zo, r2zo, nzb_u_inner,    &
+                                       logc_u_s, logc_ratio_u_s,               &
                                        nzt_topo_nestbc_s, 's', 'u' )
-             CALL pmci_interp_tril_sn( v,  vc,  ico, jcv, kco, r1xo, r2xo,      &
-                                       r1yv, r2yv, r1zo, r2zo, nzb_v_inner,     &
-                                       logc_v_s, logc_ratio_v_s,                &
+
+             CALL pmci_interp_tril_sn( v,  vc,  ico, jcv, kco, r1xo, r2xo,     &
+                                       r1yv, r2yv, r1zo, r2zo, nzb_v_inner,    &
+                                       logc_v_s, logc_ratio_v_s,               &
                                        nzt_topo_nestbc_s, 's', 'v' )
-             CALL pmci_interp_tril_sn( w,  wc,  ico, jco, kcw, r1xo, r2xo,      &
-                                       r1yo, r2yo, r1zw, r2zw, nzb_w_inner,     &
-                                       logc_w_s, logc_ratio_w_s,                &
+
+             CALL pmci_interp_tril_sn( w,  wc,  ico, jco, kcw, r1xo, r2xo,     &
+                                       r1yo, r2yo, r1zw, r2zw, nzb_w_inner,    &
+                                       logc_w_s, logc_ratio_w_s,               &
                                        nzt_topo_nestbc_s, 's','w' )
-             CALL pmci_interp_tril_sn( e,  ec,  ico, jco, kco, r1xo, r2xo,      &
-                                       r1yo, r2yo, r1zo, r2zo, nzb_s_inner,     &
-                                       logc_u_s, logc_ratio_u_s,                &
+
+             CALL pmci_interp_tril_sn( e,  ec,  ico, jco, kco, r1xo, r2xo,     &
+                                       r1yo, r2yo, r1zo, r2zo, nzb_s_inner,    &
+                                       logc_u_s, logc_ratio_u_s,               &
                                        nzt_topo_nestbc_s, 's', 'e' )
+
              IF ( .NOT. neutral )  THEN
-                CALL pmci_interp_tril_sn( pt, ptc, ico, jco, kco, r1xo, r2xo,   &
-                                          r1yo, r2yo, r1zo, r2zo, nzb_s_inner,  &
-                                          logc_u_s, logc_ratio_u_s,             &
+                CALL pmci_interp_tril_sn( pt, ptc, ico, jco, kco, r1xo, r2xo,  &
+                                          r1yo, r2yo, r1zo, r2zo, nzb_s_inner, &
+                                          logc_u_s, logc_ratio_u_s,            &
                                           nzt_topo_nestbc_s, 's', 's' )
              ENDIF
+
              IF ( humidity )  THEN
-                CALL pmci_interp_tril_sn( q, qc, ico, jco, kco, r1xo, r2xo,     &
-                                          r1yo,r2yo, r1zo, r2zo, nzb_s_inner,   &
-                                          logc_u_s, logc_ratio_u_s,             &
+
+                CALL pmci_interp_tril_sn( q, q_c, ico, jco, kco, r1xo, r2xo,   &
+                                          r1yo,r2yo, r1zo, r2zo, nzb_s_inner,  &
+                                          logc_u_s, logc_ratio_u_s,            &
+                                          nzt_topo_nestbc_s, 's', 's' )
+
+                IF ( cloud_physics  .AND.  microphysics_seifert )  THEN
+
+!                    CALL pmci_interp_tril_sn( qc, qcc, ico, jco, kco, r1xo,     &
+!                                              r2xo, r1yo,r2yo, r1zo, r2zo,      &
+!                                              nzb_s_inner, logc_u_s,            &
+!                                              logc_ratio_u_s, nzt_topo_nestbc_s,&
+!                                              's', 's' )
+
+                   CALL pmci_interp_tril_sn( qr, qrc, ico, jco, kco, r1xo,     &
+                                             r2xo, r1yo,r2yo, r1zo, r2zo,      &
+                                             nzb_s_inner, logc_u_s,            &
+                                             logc_ratio_u_s, nzt_topo_nestbc_s,&
+                                             's', 's' )
+
+!                    CALL pmci_interp_tril_sn( nc, ncc, ico, jco, kco, r1xo,     &
+!                                              r2xo, r1yo,r2yo, r1zo, r2zo,      &
+!                                              nzb_s_inner, logc_u_s,            &
+!                                              logc_ratio_u_s, nzt_topo_nestbc_s,&
+!                                              's', 's' )
+
+                   CALL pmci_interp_tril_sn( nr, nrc, ico, jco, kco, r1xo,     &
+                                             r2xo, r1yo,r2yo, r1zo, r2zo,      &
+                                             nzb_s_inner, logc_u_s,            &
+                                             logc_ratio_u_s, nzt_topo_nestbc_s,&
+                                             's', 's' )
+
+                ENDIF
+
+             ENDIF
+
+             IF ( passive_scalar )  THEN
+                CALL pmci_interp_tril_sn( s, sc, ico, jco, kco, r1xo, r2xo,    &
+                                          r1yo,r2yo, r1zo, r2zo, nzb_s_inner,  &
+                                          logc_u_s, logc_ratio_u_s,            &
                                           nzt_topo_nestbc_s, 's', 's' )
              ENDIF
-             IF ( passive_scalar )  THEN
-                CALL pmci_interp_tril_sn( s, sc, ico, jco, kco, r1xo, r2xo,     &
-                                          r1yo,r2yo, r1zo, r2zo, nzb_s_inner,   &
-                                          logc_u_s, logc_ratio_u_s,             &
-                                          nzt_topo_nestbc_s, 's', 's' )
-             ENDIF
 
              IF ( TRIM( nesting_mode ) == 'one-way' )  THEN
+
                 CALL pmci_extrap_ifoutflow_sn( u, nzb_u_inner, 's', 'u' )
                 CALL pmci_extrap_ifoutflow_sn( v, nzb_v_inner, 's', 'v' )
                 CALL pmci_extrap_ifoutflow_sn( w, nzb_w_inner, 's', 'w' )
                 CALL pmci_extrap_ifoutflow_sn( e, nzb_s_inner, 's', 'e' )
+
                 IF ( .NOT. neutral )  THEN
                    CALL pmci_extrap_ifoutflow_sn( pt,nzb_s_inner, 's', 's' )
                 ENDIF
+
                 IF ( humidity )  THEN
+
                    CALL pmci_extrap_ifoutflow_sn( q, nzb_s_inner, 's', 's' )
+
+                   IF ( cloud_physics  .AND.  microphysics_seifert )  THEN
+!                       CALL pmci_extrap_ifoutflow_sn( qc, nzb_s_inner, 's', 's' ) 
+                      CALL pmci_extrap_ifoutflow_sn( qr, nzb_s_inner, 's', 's' )      
+!                       CALL pmci_extrap_ifoutflow_sn( nc, nzb_s_inner, 's', 's' ) 
+                      CALL pmci_extrap_ifoutflow_sn( nr, nzb_s_inner, 's', 's' ) 
+
+                   ENDIF
+
                 ENDIF
+
                 IF ( passive_scalar )  THEN
                    CALL pmci_extrap_ifoutflow_sn( s, nzb_s_inner, 's', 's' )
                 ENDIF
+
              ENDIF
 
@@ -3542,50 +3758,97 @@
    !--    North border pe
           IF ( nest_bound_n )  THEN
-             CALL pmci_interp_tril_sn( u,  uc,  icu, jco, kco, r1xu, r2xu,      &
-                                       r1yo, r2yo, r1zo, r2zo, nzb_u_inner,     &
-                                       logc_u_n, logc_ratio_u_n,                &
+
+             CALL pmci_interp_tril_sn( u,  uc,  icu, jco, kco, r1xu, r2xu,     &
+                                       r1yo, r2yo, r1zo, r2zo, nzb_u_inner,    &
+                                       logc_u_n, logc_ratio_u_n,               &
                                        nzt_topo_nestbc_n, 'n', 'u' )
-             CALL pmci_interp_tril_sn( v,  vc,  ico, jcv, kco, r1xo, r2xo,      &
-                                       r1yv, r2yv, r1zo, r2zo, nzb_v_inner,     &
-                                       logc_v_n, logc_ratio_v_n,                & 
+             CALL pmci_interp_tril_sn( v,  vc,  ico, jcv, kco, r1xo, r2xo,     &
+                                       r1yv, r2yv, r1zo, r2zo, nzb_v_inner,    &
+                                       logc_v_n, logc_ratio_v_n,               & 
                                        nzt_topo_nestbc_n, 'n', 'v' )
-             CALL pmci_interp_tril_sn( w,  wc,  ico, jco, kcw, r1xo, r2xo,      &
-                                       r1yo, r2yo, r1zw, r2zw, nzb_w_inner,     &
-                                       logc_w_n, logc_ratio_w_n,                &
+             CALL pmci_interp_tril_sn( w,  wc,  ico, jco, kcw, r1xo, r2xo,     &
+                                       r1yo, r2yo, r1zw, r2zw, nzb_w_inner,    &
+                                       logc_w_n, logc_ratio_w_n,               &
                                        nzt_topo_nestbc_n, 'n', 'w' )
-             CALL pmci_interp_tril_sn( e,  ec,  ico, jco, kco, r1xo, r2xo,      &
-                                       r1yo, r2yo, r1zo, r2zo, nzb_s_inner,     &
-                                       logc_u_n, logc_ratio_u_n,                &
+             CALL pmci_interp_tril_sn( e,  ec,  ico, jco, kco, r1xo, r2xo,     &
+                                       r1yo, r2yo, r1zo, r2zo, nzb_s_inner,    &
+                                       logc_u_n, logc_ratio_u_n,               &
                                        nzt_topo_nestbc_n, 'n', 'e' )
+
              IF ( .NOT. neutral )  THEN
-                CALL pmci_interp_tril_sn( pt, ptc, ico, jco, kco, r1xo, r2xo,   &
-                                          r1yo, r2yo, r1zo, r2zo, nzb_s_inner,  &
-                                          logc_u_n, logc_ratio_u_n,             &
+                CALL pmci_interp_tril_sn( pt, ptc, ico, jco, kco, r1xo, r2xo,  &
+                                          r1yo, r2yo, r1zo, r2zo, nzb_s_inner, &
+                                          logc_u_n, logc_ratio_u_n,            &
                                           nzt_topo_nestbc_n, 'n', 's' )
              ENDIF
+
              IF ( humidity )  THEN
-                CALL pmci_interp_tril_sn( q, qc, ico, jco, kco, r1xo, r2xo,     &
-                                          r1yo, r2yo, r1zo, r2zo, nzb_s_inner,  &
-                                          logc_u_n, logc_ratio_u_n,             &
+
+                CALL pmci_interp_tril_sn( q, q_c, ico, jco, kco, r1xo, r2xo,   &
+                                          r1yo, r2yo, r1zo, r2zo, nzb_s_inner, &
+                                          logc_u_n, logc_ratio_u_n,            &
+                                          nzt_topo_nestbc_n, 'n', 's' )
+
+                IF ( cloud_physics  .AND.  microphysics_seifert )  THEN
+
+!                    CALL pmci_interp_tril_sn( qc, qcc, ico, jco, kco, r1xo,     &
+!                                              r2xo, r1yo, r2yo, r1zo, r2zo,     &
+!                                              nzb_s_inner, logc_u_n,            &
+!                                              logc_ratio_u_n, nzt_topo_nestbc_n,& 
+!                                              'n', 's' )
+
+                   CALL pmci_interp_tril_sn( qr, qrc, ico, jco, kco, r1xo,     &
+                                             r2xo, r1yo, r2yo, r1zo, r2zo,     &
+                                             nzb_s_inner, logc_u_n,            &
+                                             logc_ratio_u_n, nzt_topo_nestbc_n,& 
+                                             'n', 's' )
+
+!                    CALL pmci_interp_tril_sn( nc, ncc, ico, jco, kco, r1xo,     &
+!                                              r2xo, r1yo, r2yo, r1zo, r2zo,     &
+!                                              nzb_s_inner, logc_u_n,            &
+!                                              logc_ratio_u_n, nzt_topo_nestbc_n,& 
+!                                              'n', 's' )
+
+                   CALL pmci_interp_tril_sn( nr, nrc, ico, jco, kco, r1xo,     &
+                                             r2xo, r1yo, r2yo, r1zo, r2zo,     &
+                                             nzb_s_inner, logc_u_n,            &
+                                             logc_ratio_u_n, nzt_topo_nestbc_n,& 
+                                             'n', 's' )
+
+                ENDIF
+
+             ENDIF
+
+             IF ( passive_scalar )  THEN
+                CALL pmci_interp_tril_sn( s, sc, ico, jco, kco, r1xo, r2xo,    &
+                                          r1yo, r2yo, r1zo, r2zo, nzb_s_inner, &
+                                          logc_u_n, logc_ratio_u_n,            &
                                           nzt_topo_nestbc_n, 'n', 's' )
              ENDIF
-             IF ( passive_scalar )  THEN
-                CALL pmci_interp_tril_sn( s, sc, ico, jco, kco, r1xo, r2xo,     &
-                                          r1yo, r2yo, r1zo, r2zo, nzb_s_inner,  &
-                                          logc_u_n, logc_ratio_u_n,             &
-                                          nzt_topo_nestbc_n, 'n', 's' )
-             ENDIF
 
              IF ( TRIM( nesting_mode ) == 'one-way' )  THEN
+
                 CALL pmci_extrap_ifoutflow_sn( u, nzb_u_inner, 'n', 'u' )
                 CALL pmci_extrap_ifoutflow_sn( v, nzb_v_inner, 'n', 'v' )
                 CALL pmci_extrap_ifoutflow_sn( w, nzb_w_inner, 'n', 'w' )
                 CALL pmci_extrap_ifoutflow_sn( e, nzb_s_inner, 'n', 'e' )
+
                 IF ( .NOT. neutral )  THEN
                    CALL pmci_extrap_ifoutflow_sn( pt,nzb_s_inner, 'n', 's' )
                 ENDIF
+
                 IF ( humidity )  THEN
+
                    CALL pmci_extrap_ifoutflow_sn( q, nzb_s_inner, 'n', 's' )
+
+                   IF ( cloud_physics  .AND.  microphysics_seifert )  THEN
+!                       CALL pmci_extrap_ifoutflow_sn( qc, nzb_s_inner, 'n', 's' )
+                      CALL pmci_extrap_ifoutflow_sn( qr, nzb_s_inner, 'n', 's' )
+!                       CALL pmci_extrap_ifoutflow_sn( nc, nzb_s_inner, 'n', 's' )
+                      CALL pmci_extrap_ifoutflow_sn( nr, nzb_s_inner, 'n', 's' )
+                   ENDIF
+
                 ENDIF
+
                 IF ( passive_scalar )  THEN
                    CALL pmci_extrap_ifoutflow_sn( s, nzb_s_inner, 'n', 's' )
@@ -3600,39 +3863,75 @@
 !
 !--    All PEs are top-border PEs
-       CALL pmci_interp_tril_t( u,  uc,  icu, jco, kco, r1xu, r2xu, r1yo,       &
+       CALL pmci_interp_tril_t( u,  uc,  icu, jco, kco, r1xu, r2xu, r1yo,      &
                                 r2yo, r1zo, r2zo, 'u' )
-       CALL pmci_interp_tril_t( v,  vc,  ico, jcv, kco, r1xo, r2xo, r1yv,       &
+       CALL pmci_interp_tril_t( v,  vc,  ico, jcv, kco, r1xo, r2xo, r1yv,      &
                                 r2yv, r1zo, r2zo, 'v' )
-       CALL pmci_interp_tril_t( w,  wc,  ico, jco, kcw, r1xo, r2xo, r1yo,       &
+       CALL pmci_interp_tril_t( w,  wc,  ico, jco, kcw, r1xo, r2xo, r1yo,      &
                                 r2yo, r1zw, r2zw, 'w' )
-       CALL pmci_interp_tril_t( e,  ec,  ico, jco, kco, r1xo, r2xo, r1yo,       &
+       CALL pmci_interp_tril_t( e,  ec,  ico, jco, kco, r1xo, r2xo, r1yo,      &
                                 r2yo, r1zo, r2zo, 'e' )
+
        IF ( .NOT. neutral )  THEN
-          CALL pmci_interp_tril_t( pt, ptc, ico, jco, kco, r1xo, r2xo, r1yo,    &
+          CALL pmci_interp_tril_t( pt, ptc, ico, jco, kco, r1xo, r2xo, r1yo,   &
                                    r2yo, r1zo, r2zo, 's' )
        ENDIF
+
        IF ( humidity )  THEN
-          CALL pmci_interp_tril_t( q, qc, ico, jco, kco, r1xo, r2xo, r1yo,      &
+
+          CALL pmci_interp_tril_t( q, q_c, ico, jco, kco, r1xo, r2xo, r1yo,    &
                                    r2yo, r1zo, r2zo, 's' )
-       ENDIF
+
+          IF ( cloud_physics  .AND.  microphysics_seifert )  THEN
+
+!              CALL pmci_interp_tril_t( qc, qcc, ico, jco, kco, r1xo, r2xo, r1yo,&
+!                                       r2yo, r1zo, r2zo, 's' )
+
+             CALL pmci_interp_tril_t( qr, qrc, ico, jco, kco, r1xo, r2xo, r1yo,&
+                                      r2yo, r1zo, r2zo, 's' )
+
+!              CALL pmci_interp_tril_t( nc, ncc, ico, jco, kco, r1xo, r2xo, r1yo,&
+!                                       r2yo, r1zo, r2zo, 's' )
+
+             CALL pmci_interp_tril_t( nr, nrc, ico, jco, kco, r1xo, r2xo, r1yo,&
+                                      r2yo, r1zo, r2zo, 's' )
+
+          ENDIF
+
+       ENDIF
+
        IF ( passive_scalar )  THEN
-          CALL pmci_interp_tril_t( s, sc, ico, jco, kco, r1xo, r2xo, r1yo,      &
+          CALL pmci_interp_tril_t( s, sc, ico, jco, kco, r1xo, r2xo, r1yo,     &
                                    r2yo, r1zo, r2zo, 's' )
        ENDIF
 
        IF ( TRIM( nesting_mode ) == 'one-way' )  THEN
+
           CALL pmci_extrap_ifoutflow_t( u,  'u' )
           CALL pmci_extrap_ifoutflow_t( v,  'v' )
           CALL pmci_extrap_ifoutflow_t( w,  'w' )
           CALL pmci_extrap_ifoutflow_t( e,  'e' )
+
           IF ( .NOT. neutral )  THEN
              CALL pmci_extrap_ifoutflow_t( pt, 's' )
           ENDIF
+
           IF ( humidity )  THEN
+
              CALL pmci_extrap_ifoutflow_t( q, 's' )
+
+             IF ( cloud_physics  .AND.  microphysics_seifert )  THEN
+!                 CALL pmci_extrap_ifoutflow_t( qc, 's' )
+                CALL pmci_extrap_ifoutflow_t( qr, 's' )
+!                 CALL pmci_extrap_ifoutflow_t( nc, 's' )
+                CALL pmci_extrap_ifoutflow_t( nr, 's' )
+
+             ENDIF
+
           ENDIF
+
           IF ( passive_scalar )  THEN
              CALL pmci_extrap_ifoutflow_t( s, 's' )
           ENDIF
+
        ENDIF
 
@@ -3648,20 +3947,41 @@
       IMPLICIT NONE
 
-      CALL pmci_anterp_tophat( u,  uc,  kctu, iflu, ifuu, jflo, jfuo, kflo,     &
+      CALL pmci_anterp_tophat( u,  uc,  kctu, iflu, ifuu, jflo, jfuo, kflo,    &
                                kfuo, ijfc_u, 'u' )
-      CALL pmci_anterp_tophat( v,  vc,  kctu, iflo, ifuo, jflv, jfuv, kflo,     &
+      CALL pmci_anterp_tophat( v,  vc,  kctu, iflo, ifuo, jflv, jfuv, kflo,    &
                                kfuo, ijfc_v, 'v' )
-      CALL pmci_anterp_tophat( w,  wc,  kctw, iflo, ifuo, jflo, jfuo, kflw,     &
+      CALL pmci_anterp_tophat( w,  wc,  kctw, iflo, ifuo, jflo, jfuo, kflw,    &
                                kfuw, ijfc_s, 'w' )
+
       IF ( .NOT. neutral )  THEN
-         CALL pmci_anterp_tophat( pt, ptc, kctu, iflo, ifuo, jflo, jfuo, kflo,  &
+         CALL pmci_anterp_tophat( pt, ptc, kctu, iflo, ifuo, jflo, jfuo, kflo, &
                                   kfuo, ijfc_s, 's' )
       ENDIF
+
       IF ( humidity )  THEN
-         CALL pmci_anterp_tophat( q, qc, kctu, iflo, ifuo, jflo, jfuo, kflo,    &
+
+         CALL pmci_anterp_tophat( q, q_c, kctu, iflo, ifuo, jflo, jfuo, kflo,  &
                                   kfuo, ijfc_s, 's' )
+
+         IF ( cloud_physics  .AND.  microphysics_seifert )  THEN
+
+!             CALL pmci_anterp_tophat( qc, qcc, kctu, iflo, ifuo, jflo, jfuo,    &
+!                                      kflo, kfuo, ijfc_s, 's' )
+
+            CALL pmci_anterp_tophat( qr, qrc, kctu, iflo, ifuo, jflo, jfuo,    &
+                                     kflo, kfuo, ijfc_s, 's' )
+
+!             CALL pmci_anterp_tophat( nc, ncc, kctu, iflo, ifuo, jflo, jfuo,    &
+!                                      kflo, kfuo, ijfc_s, 's' )
+
+            CALL pmci_anterp_tophat( nr, nrc, kctu, iflo, ifuo, jflo, jfuo,    &
+                                     kflo, kfuo, ijfc_s, 's' )
+
+         ENDIF
+
       ENDIF
+
       IF ( passive_scalar )  THEN
-         CALL pmci_anterp_tophat( s, sc, kctu, iflo, ifuo, jflo, jfuo, kflo,    &
+         CALL pmci_anterp_tophat( s, sc, kctu, iflo, ifuo, jflo, jfuo, kflo,   &
                                   kfuo, ijfc_s, 's' )
       ENDIF
@@ -4389,5 +4709,5 @@
        INTEGER(iwp) ::  k         !: Fine-grid index
        INTEGER(iwp) ::  kk        !: Coarse-grid index
-       INTEGER(iwp) ::  kcb       !:
+       INTEGER(iwp) ::  kcb = 0   !:
        INTEGER(iwp) ::  nfc       !:
 
@@ -4458,5 +4778,4 @@
              jcnm = jcn - nhln
           ENDIF
-          kcb = 0
        ENDIF
        
@@ -4485,9 +4804,9 @@
 !
 !--             Block out the fine-grid corner patches from the anterpolation
-                IF ( ( ifl(ii) < nxl ) .OR. ( ifu(ii) > nxr ) )  THEN
-                   IF ( ( jfl(jj) < nys ) .OR. ( jfu(jj) > nyn ) )  THEN
-                      fra = 0.0_wp
-                   ENDIF
-                ENDIF
+!                 IF ( ( ifl(ii) < nxl ) .OR. ( ifu(ii) > nxr ) )  THEN
+!                    IF ( ( jfl(jj) < nys ) .OR. ( jfu(jj) > nyn ) )  THEN
+!                       fra = 0.0_wp
+!                    ENDIF
+!                 ENDIF
 
                 fc(kk,jj,ii) = ( 1.0_wp - fra ) * fc(kk,jj,ii) +                &
