Index: /palm/trunk/DOC/tec/technical_documentation.html
===================================================================
--- /palm/trunk/DOC/tec/technical_documentation.html	(revision 531)
+++ /palm/trunk/DOC/tec/technical_documentation.html	(revision 532)
@@ -1,4 +1,6 @@
 <!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
 <html><head>
+
+
 
 
@@ -93,4 +95,44 @@
     
     <tr>
+      <td style="vertical-align: top;">21/04/10<br>
+      </td>
+      <td style="vertical-align: top;">RH<br>
+      </td>
+      <td style="vertical-align: top;">532<br>
+      </td>
+      <td style="vertical-align: top;">3.71<br>
+      </td>
+      <td style="vertical-align: top;">C<br>
+      </td>
+      <td style="vertical-align: top;">
+Large scale vertical motion (subsidence/ascent) can be added as
+additional source to the prognostic equation for humidity/passive scalar<br>
+&nbsp;<br>
+character length for dopr_unit enlarged<br>
+      <br>
+Adjustment of the NCL scripts<span style="font-family: Courier New,Courier,monospace;"> </span>to allow for output of png files <br>
+ </td>
+      <td style="vertical-align: top;">modules, prognostic_equations<br>
+      <br>
+.ncl.config.default, cross_sections.ncl, profiles.ncl, timeseries.ncl, spectra.ncl<br>
+      </td>
+    </tr>
+    <tr>
+      <td style="vertical-align: top;"><br>
+      </td>
+      <td style="vertical-align: top;"><br>
+      </td>
+      <td style="vertical-align: top;"><br>
+      </td>
+      <td style="vertical-align: top;"><br>
+      </td>
+      <td style="vertical-align: top;">B<br>
+      </td>
+      <td style="vertical-align: top;">Bugfix: unit of hyp changed to dbar<br>
+      </td>
+      <td style="vertical-align: top;">check_parameters<br>
+      </td>
+    </tr>
+<tr>
       <td style="vertical-align: top;">01/04/10<br>
       </td>
@@ -249,5 +291,5 @@
       <td style="vertical-align: top;">3.7a<br>
       </td>
-      <td style="vertical-align: top;">E<br>
+      <td style="vertical-align: top;">B<br>
       </td>
       <td style="vertical-align: top;">bugfix for rev 504: remode_md was given a wrong value<br>
Index: /palm/trunk/SCRIPTS/NCL/.ncl.config.default
===================================================================
--- /palm/trunk/SCRIPTS/NCL/.ncl.config.default	(revision 531)
+++ /palm/trunk/SCRIPTS/NCL/.ncl.config.default	(revision 532)
@@ -136,5 +136,5 @@
       ;
       ; format of the output file; 
-      ; supported file formats: x11, pdf, ps, eps, epsi or ncgm 
+      ; supported file formats: x11, pdf, ps, eps, epsi ncgm or png 
       ;
       ; data type: string
@@ -811,5 +811,5 @@
       ; OPTIONAL --format_out-- OUTPUT FORMAT
       ;
-      ; supported file formats: x11, pdf, ps, eps, epsi or ncgm 
+      ; supported file formats: x11, pdf, ps, eps, epsi, ncgm or png 
       ;
       ; data type: string
@@ -1849,5 +1849,5 @@
       ;
       ; format of the output file; 
-      ; supported file formats: x11, pdf, ps, eps, epsi or ncgm 
+      ; supported file formats: x11, pdf, ps, eps, epsi, ncgm or png 
       ;
       ; data type: string
@@ -2287,5 +2287,5 @@
       ;
       ; format of the output file; 
-      ; supported file formats: x11, pdf, ps, eps, epsi or ncgm 
+      ; supported file formats: x11, pdf, ps, eps, epsi, ncgm or png 
       ;
       ; data type: string
Index: /palm/trunk/SCRIPTS/NCL/cross_sections.ncl
===================================================================
--- /palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 531)
+++ /palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 532)
@@ -35,4 +35,11 @@
 begin
 
+   ;***************************************************
+   ; Retrieving the NCL version used
+   ;***************************************************
+   
+   ncl_version_ch = systemfunc("ncl -V") 
+   ncl_version    = stringtofloat(ncl_version_ch)
+
    ; ***************************************************
    ; Retrieving the double quote character
@@ -54,9 +61,18 @@
    end if
 
-   if (format_out .NE. "x11" .AND. format_out .NE. "pdf" .AND. format_out .NE. "eps" .AND. format_out .NE. "ps" .AND. format_out .NE. "epsi" .AND. format_out .NE. "ncgm")then
+   if (format_out .NE. "x11" .AND. format_out .NE. "pdf" .AND. format_out .NE. "eps" .AND. format_out .NE. "ps" .AND. format_out .NE. "epsi" .AND. format_out .NE. "ncgm" .AND. format_out .NE. "png")then
       print(" ")
       print("'format_out = "+format_out+"' is invalid and set to'x11'")
       print(" ")
       format_out="x11"
+   end if
+
+   if (ncl_version .LE. 5.1 .AND. format_out .EQ. "png") then
+      print(" ")
+      print("Output of png files not available")
+      print("png output is avaiable with NCL version 5.2.0 and higher ")
+      print("NCL version used: " + ncl_version_ch)
+      print(" ")
+      exit
    end if
 
@@ -336,5 +352,5 @@
    cs_res@gsnDraw                 = False
    cs_res@gsnFrame                = False
-   cs_res@gsnMaximize             = True 
+    cs_res@gsnMaximize                = True
    
    cs_res@tmXBLabelFontHeightF   = font_size
@@ -1446,4 +1462,12 @@
    ; open workstation(s) 
    ; ***************************************************
+
+   if ( format_out .EQ. "pdf" .OR. format_out .EQ. "ps" ) then
+      format_out@wkPaperSize = "A4"
+   end if
+   if ( format_out .EQ. "png" ) then
+      format_out@wkWidth  = 1000
+      format_out@wkHeight = 1000
+   end if
 
    wks_ps  = gsn_open_wks(format_out,file_out)
@@ -1807,4 +1831,7 @@
    ; merge plots onto one page 
    ; ***************************************************   
+
+   no_frames = 0
+
    if (vector .EQ. 1 .AND. plotvec .EQ. "plotvec") then 
       if ((format_out .EQ. "eps" .OR. format_out .EQ. "epsi") .AND. no_time*no_layer*(no_var+1) .gt. no_rows*no_columns) then
@@ -1817,6 +1844,8 @@
             if ( np + no_rows*no_columns .gt. dim_plot-1) then 
                gsn_panel(wks_ps, plot(np:dim_plot-1),(/no_rows,no_columns/),cs_resP)
+               no_frames = no_frames + 1
             else
                gsn_panel(wks_ps, plot(np:np+no_rows*no_columns-1),(/no_rows,no_columns/),cs_resP)
+               no_frames = no_frames + 1
             end if
          end do
@@ -1832,6 +1861,8 @@
             if ( np + no_rows*no_columns .gt. dim_plot-1) then
                gsn_panel(wks_ps, plot(np:dim_plot-1),(/no_rows,no_columns/),cs_resP)
+               no_frames = no_frames + 1
             else
                gsn_panel(wks_ps, plot(np:np+no_rows*no_columns-1),(/no_rows,no_columns/),cs_resP)
+               no_frames = no_frames + 1
             end if
          end do
@@ -1839,7 +1870,37 @@
    end if
 
-   print(" ")
-   print("Output to: " + file_out +"."+ format_out)
-   print(" ")  	
+   if (format_out .EQ. "png" ) then
+     png_output = new((/no_frames/), string)
+     j = 0
+     do i=0, no_frames-1
+       j = i + 1
+       if (j .LE. 9) then
+         png_output(i) = file_out+".00000"+j+".png"
+       end if
+       if (j .GT. 9 .AND. j .LE. 99) then
+         png_output(i) = file_out+".0000"+j+".png"
+       end if
+       if (j .GT. 99 .AND. j .LE. 999) then
+         png_output(i) = file_out+".000"+j+".png"
+       end if
+       if (j .GT. 999) then
+         png_output(i) = file_out+".00"+j+".png"
+       end if
+
+       ;using imagemagick's convert for reducing the white 
+       ;space around the plot
+       cmd = "convert -geometry 1000x1000 -density 300 -trim " +  \
+              png_output(i) + " " + png_output(i)
+       system(cmd)
+     end do
+
+     print(" ")
+     print("Output to: "+ png_output)
+     print(" ")
+   else
+     print(" ")
+     print("Output to: " + file_out +"."+ format_out)
+     print(" ")
+   end if
  
 end
Index: /palm/trunk/SCRIPTS/NCL/profiles.ncl
===================================================================
--- /palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 531)
+++ /palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 532)
@@ -33,4 +33,11 @@
     
 begin
+
+   ;***************************************************
+   ; Retrieving the NCL version used
+   ;***************************************************
+   
+   ncl_version_ch = systemfunc("ncl -V") 
+   ncl_version    = stringtofloat(ncl_version_ch)
 
    ;***************************************************
@@ -241,5 +248,5 @@
 
    
-   if (format_out .NE. "x11" .AND. format_out .NE. "pdf" .AND. format_out .NE. "eps" .AND. format_out .NE. "ps" .AND. format_out .NE. "epsi" .AND. format_out .NE. "ncgm")then
+   if (format_out .NE. "x11" .AND. format_out .NE. "pdf" .AND. format_out .NE. "eps" .AND. format_out .NE. "ps" .AND. format_out .NE. "epsi" .AND. format_out .NE. "ncgm" .AND. format_out .NE. "png")then
       print(" ")
       print("'format_out = "+format_out+"' is invalid and set to'x11'")
@@ -247,4 +254,13 @@
       format_out="x11"
    end if  
+
+   if (ncl_version .LE. 5.1 .AND. format_out .EQ. "png") then
+      print(" ")
+      print("Output of png files not available")
+      print("png output is avaiable with NCL version 5.2.0 and higher ")
+      print("NCL version used: " + ncl_version_ch)
+      print(" ")
+      exit
+   end if
 
    if (over .NE. 0 .AND. over .NE. 1) then
@@ -1088,8 +1104,4 @@
    res@gsnDraw                 = False
    res@gsnFrame                = False
-   res@gsnPaperOrientation     = "portrait"
-   res@gsnPaperWidth           = 8.27
-   res@gsnPaperHeight          = 11.69
-   res@gsnPaperMargin          = 0.79
    res@txFont                  = "helvetica"
    res@tiMainFont              = "helvetica"
@@ -1164,4 +1176,12 @@
    end if
  
+   if ( format_out .EQ. "pdf" .OR. format_out .EQ. "ps" ) then
+      format_out@wkPaperSize = "A4"
+   end if
+   if ( format_out .EQ. "png" ) then
+      format_out@wkWidth  = 1000
+      format_out@wkHeight = 1000
+   end if
+
    wks=gsn_open_wks(format_out,file_out)
    gsn_define_colormap(wks,"rainbow+white") 
@@ -4092,4 +4112,6 @@
    end do
 
+   no_frames = 0
+
    if ((format_out .EQ. "eps" .OR. format_out .EQ. "epsi") .AND. n .gt. no_rows*no_columns) then
       gsn_panel(wks,plot_,(/n,1/),resP)
@@ -4101,13 +4123,45 @@
          if( (i+no_rows*no_columns) .gt. (n-1)) then
             gsn_panel(wks,plot_(i:n-1),(/no_rows,no_columns/),resP)
+            no_frames = no_frames + 1  
          else
             gsn_panel(wks,plot_(i:i+no_rows*no_columns-1),(/no_rows,no_columns/),resP)
+            no_frames = no_frames + 1  
          end if
       end do
    end if
 
-   print(" ")
-   print("Output to: " + file_out +"."+ format_out)
-   print(" ")
+    if (format_out .EQ. "png" ) then
+     png_output = new((/no_frames/), string)
+     j = 0
+     do i=0, no_frames-1
+       j = i + 1
+       if (j .LE. 9) then
+         png_output(i) = file_out+".00000"+j+".png"
+       end if
+       if (j .GT. 9 .AND. j .LE. 99) then
+         png_output(i) = file_out+".0000"+j+".png"
+       end if
+       if (j .GT. 99 .AND. j .LE. 999) then
+         png_output(i) = file_out+".000"+j+".png"
+       end if
+       if (j .GT. 999) then
+         png_output(i) = file_out+".00"+j+".png"
+       end if
+
+       ;using imagemagick's convert for reducing the white 
+       ;space around the plot
+       cmd = "convert -geometry 1000x1000 -density 300 -trim " +  \
+              png_output(i) + " " + png_output(i)
+       system(cmd)
+     end do
+
+     print(" ")
+     print("Output to: "+ png_output)
+     print(" ")
+   else
+     print(" ")
+     print("Output to: " + file_out +"."+ format_out)
+     print(" ")
+   end if
 
 end
Index: /palm/trunk/SCRIPTS/NCL/spectra.ncl
===================================================================
--- /palm/trunk/SCRIPTS/NCL/spectra.ncl	(revision 531)
+++ /palm/trunk/SCRIPTS/NCL/spectra.ncl	(revision 532)
@@ -34,4 +34,11 @@
 
    ;***************************************************
+   ; Retrieving the NCL version used
+   ;***************************************************
+   
+   ncl_version_ch = systemfunc("ncl -V") 
+   ncl_version    = stringtofloat(ncl_version_ch)
+
+   ;***************************************************
    ; Retrieving the double quote character
    ;***************************************************
@@ -52,5 +59,5 @@
    end if
 
-   if (format_out .NE. "x11" .AND. format_out .NE. "pdf" .AND. format_out .NE. "eps" .AND. format_out .NE. "ps" .AND. format_out .NE. "epsi" .AND. format_out .NE. "ncgm")then
+   if (format_out .NE. "x11" .AND. format_out .NE. "pdf" .AND. format_out .NE. "eps" .AND. format_out .NE. "ps" .AND. format_out .NE. "epsi" .AND. format_out .NE. "ncgm" .AND. format_out .NE. "png")then
       print(" ")
       print("'format_out = "+format_out+"' is invalid and set to'x11'")
@@ -58,4 +65,13 @@
       format_out="x11"
    end if 
+
+   if (ncl_version .LE. 5.1 .AND. format_out .EQ. "png") then
+      print(" ")
+      print("Output of png files not available")
+      print("png output is avaiable with NCL version 5.2.0 and higher ")
+      print("NCL version used: " + ncl_version_ch)
+      print(" ")
+      exit
+   end if
    
    if (log_x .NE. 0 .AND. log_x .NE. 1)then
@@ -340,8 +356,4 @@
    res@gsnDraw                 = False
    res@gsnFrame                = False
-   res@gsnPaperOrientation     = "portrait"
-   res@gsnPaperWidth           = 8.27
-   res@gsnPaperHeight          = 11.69
-   res@gsnPaperMargin          = 0.79
    res@txFont                  = "helvetica"
    res@tiMainFont              = "helvetica"
@@ -417,4 +429,12 @@
    if ( dash .eq. 0 ) then
       res@xyMonoDashPattern = True 
+   end if
+
+   if ( format_out .EQ. "pdf" .OR. format_out .EQ. "ps" ) then
+      format_out@wkPaperSize = "A4"
+   end if
+   if ( format_out .EQ. "png" ) then
+      format_out@wkWidth  = 1000
+      format_out@wkHeight = 1000
    end if
 
@@ -664,7 +684,37 @@
    end if
 
-   print(" ")
-   print("Output to: " + file_out +"."+ format_out)
-   print(" ")
+   if (format_out .EQ. "png" ) then
+     png_output = new((/no_frames/), string)
+     j = 0
+     do i=0, no_frames-1
+       j = i + 1
+       if (j .LE. 9) then
+         png_output(i) = file_out+".00000"+j+".png"
+       end if
+       if (j .GT. 9 .AND. j .LE. 99) then
+         png_output(i) = file_out+".0000"+j+".png"
+       end if
+       if (j .GT. 99 .AND. j .LE. 999) then
+         png_output(i) = file_out+".000"+j+".png"
+       end if
+       if (j .GT. 999) then
+         png_output(i) = file_out+".00"+j+".png"
+       end if
+
+       ;using imagemagick's convert for reducing the white 
+       ;space around the plot
+       cmd = "convert -geometry 1000x1000 -density 300 -trim " +  \
+              png_output(i) + " " + png_output(i)
+       system(cmd)
+     end do
+
+     print(" ")
+     print("Output to: "+ png_output)
+     print(" ")
+   else
+     print(" ")
+     print("Output to: " + file_out +"."+ format_out)
+     print(" ")
+   end if
    
 end
Index: /palm/trunk/SCRIPTS/NCL/timeseries.ncl
===================================================================
--- /palm/trunk/SCRIPTS/NCL/timeseries.ncl	(revision 531)
+++ /palm/trunk/SCRIPTS/NCL/timeseries.ncl	(revision 532)
@@ -35,4 +35,11 @@
 
    ;***************************************************
+   ; Retrieving the NCL version used
+   ;***************************************************
+   
+   ncl_version_ch = systemfunc("ncl -V") 
+   ncl_version    = stringtofloat(ncl_version_ch)
+
+   ;***************************************************
    ; Retrieving the double quote character
    ;***************************************************
@@ -53,5 +60,5 @@
    end if
 
-   if (format_out .NE. "x11" .AND. format_out .NE. "pdf" .AND. format_out .NE. "eps" .AND. format_out .NE. "ps" .AND. format_out .NE. "epsi" .AND. format_out .NE. "ncgm")then
+   if (format_out .NE. "x11" .AND. format_out .NE. "pdf" .AND. format_out .NE. "eps" .AND. format_out .NE. "ps" .AND. format_out .NE. "epsi" .AND. format_out .NE. "ncgm" .AND. format_out .NE. "png")then
       print(" ")
       print("'format_out = "+format_out+"' is invalid and set to'x11'")
@@ -59,4 +66,13 @@
       format_out="x11"
    end if  
+
+   if (ncl_version .LE. 5.1 .AND. format_out .EQ. "png") then
+      print(" ")
+      print("Output of png files not available")
+      print("png output is avaiable with NCL version 5.2.0 and higher ")
+      print("NCL version used: " + ncl_version_ch)
+      print(" ")
+      exit
+   end if
 
    if (over .NE. 0 .AND. over .NE. 1) then
@@ -275,8 +291,4 @@
    res@gsnDraw                 = False
    res@gsnFrame                = False
-   res@gsnPaperOrientation     = "portrait"
-   res@gsnPaperWidth           = 8.27
-   res@gsnPaperHeight          = 11.69
-   res@gsnPaperMargin          = 0.79
    res@tmXBMode                = True
    res@tmYLMode                = True
@@ -308,4 +320,12 @@
    ; ***************************************************
    
+   if ( format_out .EQ. "pdf" .OR. format_out .EQ. "ps" ) then
+      format_out@wkPaperSize = "A4"
+   end if
+   if ( format_out .EQ. "png" ) then
+      format_out@wkWidth  = 1000
+      format_out@wkHeight = 1000
+   end if
+
    wks_ps = gsn_open_wks(format_out,file_out)		
    gsn_define_colormap(wks_ps,"rainbow+white") 
@@ -1207,4 +1227,6 @@
    ; merge plots onto one page 
    ; ***************************************************
+
+   no_frames = 0
  
    if ((format_out .EQ. "eps" .OR. format_out .EQ. "epsi") .AND. n .gt. no_rows*no_columns) then
@@ -1217,13 +1239,46 @@
          if ( np + no_rows*no_columns .gt. n) then   
             gsn_panel(wks_ps, plot_ps(np:n),(/no_rows,no_columns/),resP)
+            no_frames = no_frames + 1            
          else
             gsn_panel(wks_ps, plot_ps(np:np+no_rows*no_columns-1),(/no_rows,no_columns/),resP)
+            no_frames = no_frames + 1
          end if
       end do
    end if
 
-   print(" ")
-   print("Output to: " + file_out +"."+ format_out)
-   print(" ")
+   if (format_out .EQ. "png" ) then
+     png_output = new((/no_frames/), string)
+     j = 0
+     do i=0, no_frames-1
+       j = i + 1
+       if (j .LE. 9) then
+         png_output(i) = file_out+".00000"+j+".png"
+       end if
+       if (j .GT. 9 .AND. j .LE. 99) then
+         png_output(i) = file_out+".0000"+j+".png"
+       end if
+       if (j .GT. 99 .AND. j .LE. 999) then
+         png_output(i) = file_out+".000"+j+".png"
+       end if
+       if (j .GT. 999) then
+         png_output(i) = file_out+".00"+j+".png"
+       end if
+
+       ;using imagemagick's convert for reducing the white 
+       ;space around the plot
+       cmd = "convert -geometry 1000x1000 -density 300 -trim " +  \
+              png_output(i) + " " + png_output(i)
+       system(cmd)
+     end do
+
+     print(" ")
+     print("Output to: "+ png_output)
+     print(" ")
+   else
+     print(" ")
+     print("Output to: " + file_out +"."+ format_out)
+     print(" ")
+   end if
+ 
  
 end
Index: /palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- /palm/trunk/SOURCE/check_parameters.f90	(revision 531)
+++ /palm/trunk/SOURCE/check_parameters.f90	(revision 532)
@@ -4,9 +4,12 @@
 ! Current revisions:
 ! -----------------
-! Bugfix: unit of hyp changed to dbar 
+! 
 !
 ! Former revisions:
 ! -----------------
 ! $Id$
+! 
+! 531 2010-04-21 06:47:21Z heinze
+! Bugfix: unit of hyp changed to dbar 
 !
 ! 524 2010-03-30 02:04:51Z raasch
Index: /palm/trunk/SOURCE/modules.f90
===================================================================
--- /palm/trunk/SOURCE/modules.f90	(revision 531)
+++ /palm/trunk/SOURCE/modules.f90	(revision 532)
@@ -5,9 +5,12 @@
 ! Current revisions:
 ! -----------------
-! character length of dopr_unit enlarged
+! 
 !
 ! Former revisions:
 ! -----------------
 ! $Id$
+!
+! 531 2010-04-21 06:47:21Z heinze
+! character length of dopr_unit enlarged
 !
 ! 519 2010-03-19 05:30:02Z raasch
Index: /palm/trunk/SOURCE/prognostic_equations.f90
===================================================================
--- /palm/trunk/SOURCE/prognostic_equations.f90	(revision 531)
+++ /palm/trunk/SOURCE/prognostic_equations.f90	(revision 532)
@@ -4,9 +4,12 @@
 ! Current revisions:
 ! -----------------
-! add call of subsidence in the equation for humidity / passive scalar
+!
 !
 ! Former revisions:
 ! -----------------
 ! $Id$
+!
+! 531 2010-04-21 06:47:21Z heinze
+! add call of subsidence in the equation for humidity / passive scalar
 !
 ! 411 2009-12-11 14:15:58Z heinze
