Index: palm/trunk/SCRIPTS/NCL/spectra.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/spectra.ncl	(revision 182)
+++ palm/trunk/SCRIPTS/NCL/spectra.ncl	(revision 183)
@@ -13,10 +13,10 @@
       delete(parameter@_FillValue)
    else
-      if (isfilepresent("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences")) then
-         parameter = asciiread("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences",129,"string")
+      if (isfilepresent("~/palm/current_version/trunk/SCRIPTS/NCL/.ncl_preferences")) then
+         parameter = asciiread("~/palm/current_version/trunk/SCRIPTS/NCL/.ncl_preferences",129,"string")
          delete(parameter@_FillValue)
       else
          print(" ")
-         print("'.ncl_preferences' does not exist in '~/palm/current_version/trunk/SRIPTS/NCL/'")
+         print("'.ncl_preferences' does not exist in '~/palm/current_version/trunk/SCRIPTS/NCL/'")
          print(" ")
          exit
@@ -372,10 +372,8 @@
    if (sort .EQ. "time")
       plot  = new(dim*dimz,graphic)
-      plot_ = new(dim*dimz,graphic)
       np=dimt
       res@lgTitleString = "Time [h]"
    else
       plot  = new(dim*dimt,graphic)
-      plot_ = new(dim*dimt,graphic)
       np=dimz
       res@lgTitleString = "Height [m]"  
@@ -455,5 +453,5 @@
                res@trXMaxF = max(x_axis)
                res@gsnLeftString      = vNam(varn)
-               res@gsnRightString     = "Height: "+z(p)+"m"
+               res@gsnRightString     = "Height = "+z(p)+"m"
                if (norm .NE. 1)then
                   res@tiYAxisString      = vNam(varn)+" / "+norm
@@ -482,5 +480,5 @@
                   res@trXMaxF = max(x_axis)
                   res@gsnLeftString      = vNam(varn)
-                  res@gsnRightString     = "Time: "+legend_label(p)+"h"
+                  res@gsnRightString     = "Time = "+legend_label(p)+"h"
                   if (norm .NE. 1)then
                      res@tiYAxisString      = vNam(varn)+" / "+norm
@@ -521,16 +519,12 @@
    resP@txFontHeightF          = 0.014
 
-   do m=0,n-1
-      plot_(m)=plot(n-1-m)
-   end do
-
    if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then
-      gsn_panel(wks,plot_,(/n,1/),resP)
+      gsn_panel(wks,plot,(/n,1/),resP)
    else    
       do i = 0,n-1, no_lines*no_columns
          if( (i+no_lines*no_columns) .gt. (n-1)) then
-            gsn_panel(wks,plot_(i:n-1),(/no_lines,no_columns/),resP)
+            gsn_panel(wks,plot(i:n-1),(/no_lines,no_columns/),resP)
          else
-           gsn_panel(wks,plot_(i:i+no_lines*no_columns-1),(/no_lines,no_columns/),resP)
+           gsn_panel(wks,plot(i:i+no_lines*no_columns-1),(/no_lines,no_columns/),resP)
          end if
       end do
Index: palm/trunk/SCRIPTS/mrun
===================================================================
--- palm/trunk/SCRIPTS/mrun	(revision 182)
+++ palm/trunk/SCRIPTS/mrun	(revision 183)
@@ -147,7 +147,9 @@
      #                     adjustments for lcxt4 (Bergen Center for Computational
      #                     Science)
+     # 22/05/08 - Marcus - If environment variable link_local_input is set to 
+     #                     true, mrun tries "ln -f" on local input and resorts 
+     #                     to "cp" or "cp -r" on error
      # 27/05/08 - Siggi  - PATH is set to PALM_BIN everywhere (missing so far)
      # 14/07/08 - Siggi  - adjustments for lcsgih
-
  
     # VARIABLENVEREINBARUNGEN + DEFAULTWERTE
@@ -196,4 +198,5 @@
  job_on_file=""
  keep_data_from_previous_run=false
+ link_local_input=false
  link_local_output=false
  localhost_realname=$(hostname)
@@ -2539,9 +2542,40 @@
                 printf "\n      providing $numprocs files for the respective processors"
                 mkdir  ${localin[$i]}
-                cp -r  ${absnamein[$i]}/*  ${localin[$i]}
+		if [[ $link_local_input = true ]]
+		    then
+		    printf "      using ln -f\n"
+		    cd ${absnamein[$i]}
+		    for file in $(ls *)
+		      do
+		      ln -f $file  ${localin[$i]}
+		    done
+		    cd $TEMPDIR
+		fi
+                # If "ln -f" fails of if "$link_local_input = false" do a normal "cp -r"
+		if [[ ! -f "${localin[$i]}/_0000" ]]
+		    then
+		    if [[ $link_local_input = true ]]
+			then
+			printf "      ln failed for .../_0000, using cp...\n"
+		    fi
+		    cp -r  ${absnamein[$i]}/*  ${localin[$i]}
+		fi
 
              else
                    # BEREITSTELLUNG AUF EINPROZESSORRECHNERN
-                cp  ${absnamein[$i]}  ${localin[$i]}
+		if [[ $link_local_input = true ]]
+		then
+		    printf "      using ln -f\n"
+		    ln -f  ${absnamein[$i]}  ${localin[$i]}
+		fi
+		# If "ln -f" fails of if "$link_local_input = false" do a normal "cp"
+		if [[ ! -f "${localin[$i]}" ]]
+                then
+		    if [[ $link_local_input = true ]]
+	            then
+			printf "      ln failed, using cp...\n"
+		    fi
+		    cp  ${absnamein[$i]}  ${localin[$i]}
+                fi
              fi
           fi
Index: palm/trunk/SOURCE/CURRENT_MODIFICATIONS
===================================================================
--- palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 182)
+++ palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 183)
@@ -81,4 +81,6 @@
 Errors:
 ------
+Bugfix: calculation of horizontal fluxes at vertical walls (diffusion_s)
+
 Bugfix: zero assignments to tendency arrays in case of restarts (init_3d_model)
 
@@ -117,4 +119,4 @@
 
 
-check_parameters, flow_statistics, init_dvrp, init_3d_model, local_stop, plant_canopy_model, poismg, pres, read_3d_binary, user_interface, write_3d_binary
+check_parameters, diffusion_s, flow_statistics, init_dvrp, init_3d_model, local_stop, plant_canopy_model, poismg, pres, read_3d_binary, user_interface, write_3d_binary
 
Index: palm/trunk/SOURCE/diffusion_s.f90
===================================================================
--- palm/trunk/SOURCE/diffusion_s.f90	(revision 182)
+++ palm/trunk/SOURCE/diffusion_s.f90	(revision 183)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! bugfix: calculation of fluxes at vertical surfaces
 !
 ! Former revisions:
@@ -90,15 +90,15 @@
 
                    tend(k,j,i) = tend(k,j,i)                                  &
-                                          + 0.5 * ( fwxp(j,i) *               &
+                                                + ( fwxp(j,i) * 0.5 *         &
                         ( kh(k,j,i) + kh(k,j,i+1) ) * ( s(k,j,i+1)-s(k,j,i) ) &
                         + ( 1.0 - fwxp(j,i) ) * wall_s_flux(1)                &
-                                                   -fwxm(j,i) *               &
+                                                   -fwxm(j,i) * 0.5 *         &
                         ( kh(k,j,i) + kh(k,j,i-1) ) * ( s(k,j,i)-s(k,j,i-1) ) &
                         + ( 1.0 - fwxm(j,i) ) * wall_s_flux(2)                &
                                                   ) * ddx2                    &
-                                          + 0.5 * ( fwyp(j,i) *               &
+                                                + ( fwyp(j,i) * 0.5 *         &
                         ( kh(k,j,i) + kh(k,j+1,i) ) * ( s(k,j+1,i)-s(k,j,i) ) &
                         + ( 1.0 - fwyp(j,i) ) * wall_s_flux(3)                &
-                                                   -fwym(j,i) *               &
+                                                   -fwym(j,i) * 0.5 *         &
                         ( kh(k,j,i) + kh(k,j-1,i) ) * ( s(k,j,i)-s(k,j-1,i) ) &
                         + ( 1.0 - fwym(j,i) ) * wall_s_flux(4)                &
@@ -200,15 +200,15 @@
 
              tend(k,j,i) = tend(k,j,i)                                        &
-                                          + 0.5 * ( fwxp(j,i) *               &
+                                                + ( fwxp(j,i) * 0.5 *         &
                         ( kh(k,j,i) + kh(k,j,i+1) ) * ( s(k,j,i+1)-s(k,j,i) ) &
                         + ( 1.0 - fwxp(j,i) ) * wall_s_flux(1)                &
-                                                   -fwxm(j,i) *               &
+                                                   -fwxm(j,i) * 0.5 *         &
                         ( kh(k,j,i) + kh(k,j,i-1) ) * ( s(k,j,i)-s(k,j,i-1) ) &
                         + ( 1.0 - fwxm(j,i) ) * wall_s_flux(2)                &
                                                   ) * ddx2                    &
-                                          + 0.5 * ( fwyp(j,i) *               &
+                                                + ( fwyp(j,i) * 0.5 *         &
                         ( kh(k,j,i) + kh(k,j+1,i) ) * ( s(k,j+1,i)-s(k,j,i) ) &
                         + ( 1.0 - fwyp(j,i) ) * wall_s_flux(3)                &
-                                                   -fwym(j,i) *               &
+                                                   -fwym(j,i) * 0.5 *         &
                         ( kh(k,j,i) + kh(k,j-1,i) ) * ( s(k,j,i)-s(k,j-1,i) ) &
                         + ( 1.0 - fwym(j,i) ) * wall_s_flux(4)                &
