Index: palm/trunk/SOURCE/poismg_noopt_mod.f90
===================================================================
--- palm/trunk/SOURCE/poismg_noopt_mod.f90	(revision 2939)
+++ palm/trunk/SOURCE/poismg_noopt_mod.f90	(revision 3182)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! Rename variables in mesoscale-offline nesting mode
 ! 
 ! Former revisions:
@@ -165,8 +165,7 @@
  
     USE control_parameters,                                                    &
-        ONLY:  grid_level, force_bound_l, force_bound_n, force_bound_r,        &
-               force_bound_s, forcing, inflow_l, inflow_n, inflow_r, inflow_s, &
-               nest_bound_l, nest_bound_n, nest_bound_r, nest_bound_s,         &
-               outflow_l, outflow_n, outflow_r, outflow_s
+        ONLY:  bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r,                 &
+               bc_dirichlet_s, bc_radiation_l, bc_radiation_n, bc_radiation_r, &
+               bc_radiation_s, child_domain, grid_level, nesting_offline
 
     USE cpulog,                                                                &
@@ -261,13 +260,13 @@
 !--    Set lateral boundary conditions in non-cyclic case
        IF ( .NOT. bc_lr_cyc )  THEN
-          IF ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR. force_bound_l )  &
+          IF ( bc_dirichlet_l   .OR.  bc_radiation_l )                         &
              d(:,:,nxl-1) = d(:,:,nxl)
-          IF ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR. force_bound_r )  &
+          IF ( bc_dirichlet_r   .OR.  bc_radiation_r )                         &
              d(:,:,nxr+1) = d(:,:,nxr)
        ENDIF
        IF ( .NOT. bc_ns_cyc )  THEN
-          IF ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR. force_bound_n )  &
+          IF ( bc_dirichlet_n   .OR.  bc_radiation_n )                         &
              d(:,nyn+1,:) = d(:,nyn,:)
-          IF ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR. force_bound_s )  &
+          IF ( bc_dirichlet_s   .OR.  bc_radiation_s )                         &
              d(:,nys-1,:) = d(:,nys,:)
        ENDIF
@@ -442,8 +441,8 @@
 
        IF ( .NOT. bc_lr_cyc )  THEN
-          IF ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR. force_bound_l )  THEN
+          IF ( bc_dirichlet_l  .OR.  bc_radiation_l )  THEN
              r(:,:,nxl_mg(l)-1) = r(:,:,nxl_mg(l))
           ENDIF
-          IF ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR. force_bound_r )  THEN
+          IF ( bc_dirichlet_r  .OR.  bc_radiation_r )  THEN
              r(:,:,nxr_mg(l)+1) = r(:,:,nxr_mg(l))
           ENDIF
@@ -451,8 +450,8 @@
 
        IF ( .NOT. bc_ns_cyc )  THEN
-          IF ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR. force_bound_n )  THEN
+          IF ( bc_dirichlet_n  .OR.  bc_radiation_n )  THEN
              r(:,nyn_mg(l)+1,:) = r(:,nyn_mg(l),:)
           ENDIF
-          IF ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR. force_bound_s )  THEN
+          IF ( bc_dirichlet_s  .OR.  bc_radiation_s )  THEN
              r(:,nys_mg(l)-1,:) = r(:,nys_mg(l),:)
           ENDIF
@@ -657,8 +656,8 @@
 
        IF ( .NOT. bc_lr_cyc )  THEN
-          IF ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR. force_bound_l )  THEN
+          IF ( bc_dirichlet_l  .OR.  bc_radiation_l )  THEN
              f_mg(:,:,nxl_mg(l)-1) = f_mg(:,:,nxl_mg(l))
           ENDIF
-          IF ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR. force_bound_r )  THEN
+          IF ( bc_dirichlet_r  .OR.  bc_radiation_r )  THEN
              f_mg(:,:,nxr_mg(l)+1) = f_mg(:,:,nxr_mg(l))
           ENDIF
@@ -666,8 +665,8 @@
 
        IF ( .NOT. bc_ns_cyc )  THEN
-          IF ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR. force_bound_n )  THEN
+          IF ( bc_dirichlet_n  .OR.  bc_radiation_n )  THEN
              f_mg(:,nyn_mg(l)+1,:) = f_mg(:,nyn_mg(l),:)
           ENDIF
-          IF ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR. force_bound_s )  THEN
+          IF ( bc_dirichlet_s  .OR.  bc_radiation_s )  THEN
              f_mg(:,nys_mg(l)-1,:) = f_mg(:,nys_mg(l),:)
           ENDIF
@@ -770,8 +769,8 @@
 
     IF ( .NOT. bc_lr_cyc )  THEN
-       IF ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR. force_bound_l )  THEN
+       IF ( bc_dirichlet_l  .OR.  bc_radiation_l )  THEN
           temp(:,:,nxl_mg(l)-1) = temp(:,:,nxl_mg(l))
        ENDIF
-       IF ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR. force_bound_r )  THEN
+       IF ( bc_dirichlet_r  .OR.  bc_radiation_r )  THEN
           temp(:,:,nxr_mg(l)+1) = temp(:,:,nxr_mg(l))
        ENDIF
@@ -779,8 +778,8 @@
 
     IF ( .NOT. bc_ns_cyc )  THEN
-       IF ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR. force_bound_n )  THEN
+       IF ( bc_dirichlet_n  .OR.  bc_radiation_n )  THEN
           temp(:,nyn_mg(l)+1,:) = temp(:,nyn_mg(l),:)
        ENDIF
-       IF ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR. force_bound_s )  THEN
+       IF ( bc_dirichlet_s  .OR.  bc_radiation_s )  THEN
           temp(:,nys_mg(l)-1,:) = temp(:,nys_mg(l),:)
        ENDIF
@@ -1200,8 +1199,8 @@
 
              IF ( .NOT. bc_lr_cyc )  THEN
-                IF ( inflow_l .OR. outflow_l .OR. nest_bound_l .OR. force_bound_l )  THEN
+                IF ( bc_dirichlet_l  .OR.  bc_radiation_l )  THEN
                    p_mg(:,:,nxl_mg(l)-1) = p_mg(:,:,nxl_mg(l))
                 ENDIF
-                IF ( inflow_r .OR. outflow_r .OR. nest_bound_r .OR. force_bound_r )  THEN
+                IF ( bc_dirichlet_r  .OR.  bc_radiation_r )  THEN
                    p_mg(:,:,nxr_mg(l)+1) = p_mg(:,:,nxr_mg(l))
                 ENDIF
@@ -1209,8 +1208,8 @@
 
              IF ( .NOT. bc_ns_cyc )  THEN
-                IF ( inflow_n .OR. outflow_n .OR. nest_bound_n .OR. force_bound_n )  THEN
+                IF ( bc_dirichlet_n  .OR.  bc_radiation_n )  THEN
                    p_mg(:,nyn_mg(l)+1,:) = p_mg(:,nyn_mg(l),:)
                 ENDIF
-                IF ( inflow_s .OR. outflow_s .OR. nest_bound_s .OR. force_bound_s )  THEN
+                IF ( bc_dirichlet_s  .OR.  bc_radiation_s )  THEN
                    p_mg(:,nys_mg(l)-1,:) = p_mg(:,nys_mg(l),:)
                 ENDIF
@@ -1422,5 +1421,5 @@
                   gamma_mg, grid_level_count, ibc_p_b, ibc_p_t,                &
                   maximum_grid_level,                                          &
-                  mg_switch_to_pe0_level, mg_switch_to_pe0, nest_domain, ngsrb
+                  mg_switch_to_pe0_level, mg_switch_to_pe0, ngsrb
 
 
@@ -1562,37 +1561,31 @@
 !--          because then they have the total domain.
              IF ( bc_lr_dirrad )  THEN
-                inflow_l  = .TRUE.
-                inflow_r  = .FALSE.
-                outflow_l = .FALSE.
-                outflow_r = .TRUE.
+                bc_dirichlet_l  = .TRUE.
+                bc_dirichlet_r  = .FALSE.
+                bc_radiation_l = .FALSE.
+                bc_radiation_r = .TRUE.
              ELSEIF ( bc_lr_raddir )  THEN
-                inflow_l  = .FALSE.
-                inflow_r  = .TRUE.
-                outflow_l = .TRUE.
-                outflow_r = .FALSE.
-             ELSEIF ( nest_domain )  THEN
-                nest_bound_l = .TRUE.
-                nest_bound_r = .TRUE.
-             ELSEIF ( forcing )  THEN
-                force_bound_l = .TRUE.
-                force_bound_r = .TRUE.
+                bc_dirichlet_l  = .FALSE.
+                bc_dirichlet_r  = .TRUE.
+                bc_radiation_l = .TRUE.
+                bc_radiation_r = .FALSE.
+             ELSEIF ( child_domain  .OR.  nesting_offline )  THEN
+                bc_dirichlet_l = .TRUE.
+                bc_dirichlet_r = .TRUE.
              ENDIF
 
              IF ( bc_ns_dirrad )  THEN
-                inflow_n  = .TRUE.
-                inflow_s  = .FALSE.
-                outflow_n = .FALSE.
-                outflow_s = .TRUE.
+                bc_dirichlet_n  = .TRUE.
+                bc_dirichlet_s  = .FALSE.
+                bc_radiation_n = .FALSE.
+                bc_radiation_s = .TRUE.
              ELSEIF ( bc_ns_raddir )  THEN
-                inflow_n  = .FALSE.
-                inflow_s  = .TRUE.
-                outflow_n = .TRUE.
-                outflow_s = .FALSE.
-             ELSEIF ( nest_domain )  THEN
-                nest_bound_s = .TRUE.
-                nest_bound_n = .TRUE.
-             ELSEIF ( forcing )  THEN
-                force_bound_s = .TRUE.
-                force_bound_n = .TRUE.
+                bc_dirichlet_n  = .FALSE.
+                bc_dirichlet_s  = .TRUE.
+                bc_radiation_n = .TRUE.
+                bc_radiation_s = .FALSE.
+             ELSEIF ( child_domain  .OR.  nesting_offline )  THEN
+                bc_dirichlet_s = .TRUE.
+                bc_dirichlet_n = .TRUE.
              ENDIF
 
@@ -1655,32 +1648,15 @@
 !--          For non-cyclic lateral boundary conditions and in case of nesting, 
 !--          restore the in-/outflow conditions. 
-             inflow_l  = .FALSE.;  inflow_r  = .FALSE.
-             inflow_n  = .FALSE.;  inflow_s  = .FALSE.
-             outflow_l = .FALSE.;  outflow_r = .FALSE.
-             outflow_n = .FALSE.;  outflow_s = .FALSE.
-!
-!--          In case of nesting, restore lateral boundary conditions
-             IF ( nest_domain )  THEN
-                nest_bound_l = .FALSE.
-                nest_bound_r = .FALSE.
-                nest_bound_s = .FALSE.
-                nest_bound_n = .FALSE.      
-             ENDIF
-             IF ( forcing )  THEN
-                force_bound_l = .FALSE.
-                force_bound_r = .FALSE.
-                force_bound_s = .FALSE.
-                force_bound_n = .FALSE.      
-             ENDIF
+             bc_dirichlet_l = .FALSE.;  bc_dirichlet_r = .FALSE.
+             bc_dirichlet_n = .FALSE.;  bc_dirichlet_s = .FALSE.
+             bc_radiation_l = .FALSE.;  bc_radiation_r = .FALSE.
+             bc_radiation_n = .FALSE.;  bc_radiation_s = .FALSE.
 
              IF ( pleft == MPI_PROC_NULL )  THEN
-                IF ( bc_lr_dirrad )  THEN
-                   inflow_l  = .TRUE.
+                IF ( bc_lr_dirrad  .OR.  child_domain  .OR.  nesting_offline )  &
+                THEN
+                   bc_dirichlet_l = .TRUE.
                 ELSEIF ( bc_lr_raddir )  THEN
-                   outflow_l = .TRUE.
-                ELSEIF ( nest_domain )  THEN
-                   nest_bound_l = .TRUE.
-                ELSEIF ( forcing )  THEN
-                   force_bound_l = .TRUE.
+                   bc_radiation_l = .TRUE.
                 ENDIF
              ENDIF
@@ -1688,11 +1664,8 @@
              IF ( pright == MPI_PROC_NULL )  THEN
                 IF ( bc_lr_dirrad )  THEN
-                   outflow_r = .TRUE.
-                ELSEIF ( bc_lr_raddir )  THEN
-                   inflow_r  = .TRUE.
-                ELSEIF ( nest_domain )  THEN
-                   nest_bound_r = .TRUE.
-                ELSEIF ( forcing )  THEN
-                   force_bound_r = .TRUE.
+                   bc_radiation_r = .TRUE.
+                ELSEIF ( bc_lr_raddir  .OR.  child_domain  .OR.                 &
+                         nesting_offline )  THEN
+                   bc_dirichlet_r = .TRUE.
                 ENDIF
              ENDIF
@@ -1700,23 +1673,17 @@
              IF ( psouth == MPI_PROC_NULL )  THEN
                 IF ( bc_ns_dirrad )  THEN
-                   outflow_s = .TRUE.
-                ELSEIF ( bc_ns_raddir )  THEN
-                   inflow_s  = .TRUE.
-                ELSEIF ( nest_domain )  THEN
-                   nest_bound_s = .TRUE.
-                ELSEIF ( forcing )  THEN
-                   force_bound_s = .TRUE.
+                   bc_radiation_s = .TRUE.
+                ELSEIF ( bc_ns_raddir  .OR.  child_domain  .OR.                 &
+                         nesting_offline )  THEN
+                   bc_dirichlet_s = .TRUE.
                 ENDIF
              ENDIF
 
              IF ( pnorth == MPI_PROC_NULL )  THEN
-                IF ( bc_ns_dirrad )  THEN
-                   inflow_n  = .TRUE.
+                IF ( bc_ns_dirrad  .OR.  child_domain  .OR.  nesting_offline )  &
+                THEN
+                   bc_dirichlet_n = .TRUE.
                 ELSEIF ( bc_ns_raddir )  THEN
-                   outflow_n = .TRUE.
-                ELSEIF ( nest_domain )  THEN
-                   nest_bound_n = .TRUE.
-                ELSEIF ( forcing )  THEN
-                   force_bound_n = .TRUE.
+                   bc_radiation_n = .TRUE.
                 ENDIF
              ENDIF
@@ -1897,11 +1864,9 @@
 !--          Set non-cyclic boundary conditions on respective multigrid level
              IF ( .NOT. bc_ns_cyc )  THEN
-                IF ( inflow_s  .OR.  outflow_s  .OR.  nest_bound_s  .OR.       &
-                     force_bound_s )  THEN
+                IF ( bc_dirichlet_s  .OR.  bc_radiation_s )  THEN
 !                    topo_tmp(:,-2,:) = topo_tmp(:,0,:)
                    topo_tmp(:,-1,:) = topo_tmp(:,0,:)
                 ENDIF
-                IF ( inflow_n  .OR.  outflow_n  .OR.  nest_bound_n  .OR.       &
-                     force_bound_n )  THEN
+                IF ( bc_dirichlet_n  .OR.  bc_radiation_n )  THEN
 !                    topo_tmp(:,nyn_l+2,:) = topo_tmp(:,nyn_l,:)
                    topo_tmp(:,nyn_l+1,:) = topo_tmp(:,nyn_l,:)
@@ -1909,11 +1874,9 @@
              ENDIF
              IF ( .NOT. bc_lr_cyc )  THEN
-                IF ( inflow_l  .OR.  outflow_l  .OR.  nest_bound_l  .OR.       &
-                     force_bound_l )  THEN
+                IF ( bc_dirichlet_l  .OR.  bc_radiation_l )  THEN
 !                    topo_tmp(:,:,-2) = topo_tmp(:,:,0)
                    topo_tmp(:,:,-1) = topo_tmp(:,:,0)
                 ENDIF
-                IF ( inflow_r  .OR.  outflow_r  .OR.  nest_bound_r  .OR.       &
-                     force_bound_r )  THEN
+                IF ( bc_dirichlet_r  .OR.  bc_radiation_r )  THEN
 !                    topo_tmp(:,:,nxr_l+2) = topo_tmp(:,:,nxr_l)      
                    topo_tmp(:,:,nxr_l+1) = topo_tmp(:,:,nxr_l)    
