Changeset 532


Ignore:
Timestamp:
Apr 21, 2010 1:33:38 PM (14 years ago)
Author:
heinze
Message:

NCL scripts allow the output of png files

Location:
palm/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/DOC/tec/technical_documentation.html

    r530 r532  
    11<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
    22<html><head>
     3
     4
    35
    46
     
    9395   
    9496    <tr>
     97      <td style="vertical-align: top;">21/04/10<br>
     98      </td>
     99      <td style="vertical-align: top;">RH<br>
     100      </td>
     101      <td style="vertical-align: top;">532<br>
     102      </td>
     103      <td style="vertical-align: top;">3.71<br>
     104      </td>
     105      <td style="vertical-align: top;">C<br>
     106      </td>
     107      <td style="vertical-align: top;">
     108Large scale vertical motion (subsidence/ascent) can be added as
     109additional source to the prognostic equation for humidity/passive scalar<br>
     110&nbsp;<br>
     111character length for dopr_unit enlarged<br>
     112      <br>
     113Adjustment of the NCL scripts<span style="font-family: Courier New,Courier,monospace;"> </span>to allow for output of png files <br>
     114 </td>
     115      <td style="vertical-align: top;">modules, prognostic_equations<br>
     116      <br>
     117.ncl.config.default, cross_sections.ncl, profiles.ncl, timeseries.ncl, spectra.ncl<br>
     118      </td>
     119    </tr>
     120    <tr>
     121      <td style="vertical-align: top;"><br>
     122      </td>
     123      <td style="vertical-align: top;"><br>
     124      </td>
     125      <td style="vertical-align: top;"><br>
     126      </td>
     127      <td style="vertical-align: top;"><br>
     128      </td>
     129      <td style="vertical-align: top;">B<br>
     130      </td>
     131      <td style="vertical-align: top;">Bugfix: unit of hyp changed to dbar<br>
     132      </td>
     133      <td style="vertical-align: top;">check_parameters<br>
     134      </td>
     135    </tr>
     136<tr>
    95137      <td style="vertical-align: top;">01/04/10<br>
    96138      </td>
     
    249291      <td style="vertical-align: top;">3.7a<br>
    250292      </td>
    251       <td style="vertical-align: top;">E<br>
     293      <td style="vertical-align: top;">B<br>
    252294      </td>
    253295      <td style="vertical-align: top;">bugfix for rev 504: remode_md was given a wrong value<br>
  • palm/trunk/SCRIPTS/NCL/.ncl.config.default

    r526 r532  
    136136      ;
    137137      ; format of the output file;
    138       ; supported file formats: x11, pdf, ps, eps, epsi or ncgm
     138      ; supported file formats: x11, pdf, ps, eps, epsi ncgm or png
    139139      ;
    140140      ; data type: string
     
    811811      ; OPTIONAL --format_out-- OUTPUT FORMAT
    812812      ;
    813       ; supported file formats: x11, pdf, ps, eps, epsi or ncgm
     813      ; supported file formats: x11, pdf, ps, eps, epsi, ncgm or png
    814814      ;
    815815      ; data type: string
     
    18491849      ;
    18501850      ; format of the output file;
    1851       ; supported file formats: x11, pdf, ps, eps, epsi or ncgm
     1851      ; supported file formats: x11, pdf, ps, eps, epsi, ncgm or png
    18521852      ;
    18531853      ; data type: string
     
    22872287      ;
    22882288      ; format of the output file;
    2289       ; supported file formats: x11, pdf, ps, eps, epsi or ncgm
     2289      ; supported file formats: x11, pdf, ps, eps, epsi, ncgm or png
    22902290      ;
    22912291      ; data type: string
  • palm/trunk/SCRIPTS/NCL/cross_sections.ncl

    r529 r532  
    3535begin
    3636
     37   ;***************************************************
     38   ; Retrieving the NCL version used
     39   ;***************************************************
     40   
     41   ncl_version_ch = systemfunc("ncl -V")
     42   ncl_version    = stringtofloat(ncl_version_ch)
     43
    3744   ; ***************************************************
    3845   ; Retrieving the double quote character
     
    5461   end if
    5562
    56    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
     63   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
    5764      print(" ")
    5865      print("'format_out = "+format_out+"' is invalid and set to'x11'")
    5966      print(" ")
    6067      format_out="x11"
     68   end if
     69
     70   if (ncl_version .LE. 5.1 .AND. format_out .EQ. "png") then
     71      print(" ")
     72      print("Output of png files not available")
     73      print("png output is avaiable with NCL version 5.2.0 and higher ")
     74      print("NCL version used: " + ncl_version_ch)
     75      print(" ")
     76      exit
    6177   end if
    6278
     
    336352   cs_res@gsnDraw                 = False
    337353   cs_res@gsnFrame                = False
    338    cs_res@gsnMaximize             = True
     354    cs_res@gsnMaximize                = True
    339355   
    340356   cs_res@tmXBLabelFontHeightF   = font_size
     
    14461462   ; open workstation(s)
    14471463   ; ***************************************************
     1464
     1465   if ( format_out .EQ. "pdf" .OR. format_out .EQ. "ps" ) then
     1466      format_out@wkPaperSize = "A4"
     1467   end if
     1468   if ( format_out .EQ. "png" ) then
     1469      format_out@wkWidth  = 1000
     1470      format_out@wkHeight = 1000
     1471   end if
    14481472
    14491473   wks_ps  = gsn_open_wks(format_out,file_out)
     
    18071831   ; merge plots onto one page
    18081832   ; ***************************************************   
     1833
     1834   no_frames = 0
     1835
    18091836   if (vector .EQ. 1 .AND. plotvec .EQ. "plotvec") then
    18101837      if ((format_out .EQ. "eps" .OR. format_out .EQ. "epsi") .AND. no_time*no_layer*(no_var+1) .gt. no_rows*no_columns) then
     
    18171844            if ( np + no_rows*no_columns .gt. dim_plot-1) then
    18181845               gsn_panel(wks_ps, plot(np:dim_plot-1),(/no_rows,no_columns/),cs_resP)
     1846               no_frames = no_frames + 1
    18191847            else
    18201848               gsn_panel(wks_ps, plot(np:np+no_rows*no_columns-1),(/no_rows,no_columns/),cs_resP)
     1849               no_frames = no_frames + 1
    18211850            end if
    18221851         end do
     
    18321861            if ( np + no_rows*no_columns .gt. dim_plot-1) then
    18331862               gsn_panel(wks_ps, plot(np:dim_plot-1),(/no_rows,no_columns/),cs_resP)
     1863               no_frames = no_frames + 1
    18341864            else
    18351865               gsn_panel(wks_ps, plot(np:np+no_rows*no_columns-1),(/no_rows,no_columns/),cs_resP)
     1866               no_frames = no_frames + 1
    18361867            end if
    18371868         end do
     
    18391870   end if
    18401871
    1841    print(" ")
    1842    print("Output to: " + file_out +"."+ format_out)
    1843    print(" ")   
     1872   if (format_out .EQ. "png" ) then
     1873     png_output = new((/no_frames/), string)
     1874     j = 0
     1875     do i=0, no_frames-1
     1876       j = i + 1
     1877       if (j .LE. 9) then
     1878         png_output(i) = file_out+".00000"+j+".png"
     1879       end if
     1880       if (j .GT. 9 .AND. j .LE. 99) then
     1881         png_output(i) = file_out+".0000"+j+".png"
     1882       end if
     1883       if (j .GT. 99 .AND. j .LE. 999) then
     1884         png_output(i) = file_out+".000"+j+".png"
     1885       end if
     1886       if (j .GT. 999) then
     1887         png_output(i) = file_out+".00"+j+".png"
     1888       end if
     1889
     1890       ;using imagemagick's convert for reducing the white
     1891       ;space around the plot
     1892       cmd = "convert -geometry 1000x1000 -density 300 -trim " +  \
     1893              png_output(i) + " " + png_output(i)
     1894       system(cmd)
     1895     end do
     1896
     1897     print(" ")
     1898     print("Output to: "+ png_output)
     1899     print(" ")
     1900   else
     1901     print(" ")
     1902     print("Output to: " + file_out +"."+ format_out)
     1903     print(" ")
     1904   end if
    18441905 
    18451906end
  • palm/trunk/SCRIPTS/NCL/profiles.ncl

    r526 r532  
    3333   
    3434begin
     35
     36   ;***************************************************
     37   ; Retrieving the NCL version used
     38   ;***************************************************
     39   
     40   ncl_version_ch = systemfunc("ncl -V")
     41   ncl_version    = stringtofloat(ncl_version_ch)
    3542
    3643   ;***************************************************
     
    241248
    242249   
    243    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
     250   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
    244251      print(" ")
    245252      print("'format_out = "+format_out+"' is invalid and set to'x11'")
     
    247254      format_out="x11"
    248255   end if 
     256
     257   if (ncl_version .LE. 5.1 .AND. format_out .EQ. "png") then
     258      print(" ")
     259      print("Output of png files not available")
     260      print("png output is avaiable with NCL version 5.2.0 and higher ")
     261      print("NCL version used: " + ncl_version_ch)
     262      print(" ")
     263      exit
     264   end if
    249265
    250266   if (over .NE. 0 .AND. over .NE. 1) then
     
    10881104   res@gsnDraw                 = False
    10891105   res@gsnFrame                = False
    1090    res@gsnPaperOrientation     = "portrait"
    1091    res@gsnPaperWidth           = 8.27
    1092    res@gsnPaperHeight          = 11.69
    1093    res@gsnPaperMargin          = 0.79
    10941106   res@txFont                  = "helvetica"
    10951107   res@tiMainFont              = "helvetica"
     
    11641176   end if
    11651177 
     1178   if ( format_out .EQ. "pdf" .OR. format_out .EQ. "ps" ) then
     1179      format_out@wkPaperSize = "A4"
     1180   end if
     1181   if ( format_out .EQ. "png" ) then
     1182      format_out@wkWidth  = 1000
     1183      format_out@wkHeight = 1000
     1184   end if
     1185
    11661186   wks=gsn_open_wks(format_out,file_out)
    11671187   gsn_define_colormap(wks,"rainbow+white")
     
    40924112   end do
    40934113
     4114   no_frames = 0
     4115
    40944116   if ((format_out .EQ. "eps" .OR. format_out .EQ. "epsi") .AND. n .gt. no_rows*no_columns) then
    40954117      gsn_panel(wks,plot_,(/n,1/),resP)
     
    41014123         if( (i+no_rows*no_columns) .gt. (n-1)) then
    41024124            gsn_panel(wks,plot_(i:n-1),(/no_rows,no_columns/),resP)
     4125            no_frames = no_frames + 1 
    41034126         else
    41044127            gsn_panel(wks,plot_(i:i+no_rows*no_columns-1),(/no_rows,no_columns/),resP)
     4128            no_frames = no_frames + 1 
    41054129         end if
    41064130      end do
    41074131   end if
    41084132
    4109    print(" ")
    4110    print("Output to: " + file_out +"."+ format_out)
    4111    print(" ")
     4133    if (format_out .EQ. "png" ) then
     4134     png_output = new((/no_frames/), string)
     4135     j = 0
     4136     do i=0, no_frames-1
     4137       j = i + 1
     4138       if (j .LE. 9) then
     4139         png_output(i) = file_out+".00000"+j+".png"
     4140       end if
     4141       if (j .GT. 9 .AND. j .LE. 99) then
     4142         png_output(i) = file_out+".0000"+j+".png"
     4143       end if
     4144       if (j .GT. 99 .AND. j .LE. 999) then
     4145         png_output(i) = file_out+".000"+j+".png"
     4146       end if
     4147       if (j .GT. 999) then
     4148         png_output(i) = file_out+".00"+j+".png"
     4149       end if
     4150
     4151       ;using imagemagick's convert for reducing the white
     4152       ;space around the plot
     4153       cmd = "convert -geometry 1000x1000 -density 300 -trim " +  \
     4154              png_output(i) + " " + png_output(i)
     4155       system(cmd)
     4156     end do
     4157
     4158     print(" ")
     4159     print("Output to: "+ png_output)
     4160     print(" ")
     4161   else
     4162     print(" ")
     4163     print("Output to: " + file_out +"."+ format_out)
     4164     print(" ")
     4165   end if
    41124166
    41134167end
  • palm/trunk/SCRIPTS/NCL/spectra.ncl

    r526 r532  
    3434
    3535   ;***************************************************
     36   ; Retrieving the NCL version used
     37   ;***************************************************
     38   
     39   ncl_version_ch = systemfunc("ncl -V")
     40   ncl_version    = stringtofloat(ncl_version_ch)
     41
     42   ;***************************************************
    3643   ; Retrieving the double quote character
    3744   ;***************************************************
     
    5259   end if
    5360
    54    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
     61   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
    5562      print(" ")
    5663      print("'format_out = "+format_out+"' is invalid and set to'x11'")
     
    5865      format_out="x11"
    5966   end if
     67
     68   if (ncl_version .LE. 5.1 .AND. format_out .EQ. "png") then
     69      print(" ")
     70      print("Output of png files not available")
     71      print("png output is avaiable with NCL version 5.2.0 and higher ")
     72      print("NCL version used: " + ncl_version_ch)
     73      print(" ")
     74      exit
     75   end if
    6076   
    6177   if (log_x .NE. 0 .AND. log_x .NE. 1)then
     
    340356   res@gsnDraw                 = False
    341357   res@gsnFrame                = False
    342    res@gsnPaperOrientation     = "portrait"
    343    res@gsnPaperWidth           = 8.27
    344    res@gsnPaperHeight          = 11.69
    345    res@gsnPaperMargin          = 0.79
    346358   res@txFont                  = "helvetica"
    347359   res@tiMainFont              = "helvetica"
     
    417429   if ( dash .eq. 0 ) then
    418430      res@xyMonoDashPattern = True
     431   end if
     432
     433   if ( format_out .EQ. "pdf" .OR. format_out .EQ. "ps" ) then
     434      format_out@wkPaperSize = "A4"
     435   end if
     436   if ( format_out .EQ. "png" ) then
     437      format_out@wkWidth  = 1000
     438      format_out@wkHeight = 1000
    419439   end if
    420440
     
    664684   end if
    665685
    666    print(" ")
    667    print("Output to: " + file_out +"."+ format_out)
    668    print(" ")
     686   if (format_out .EQ. "png" ) then
     687     png_output = new((/no_frames/), string)
     688     j = 0
     689     do i=0, no_frames-1
     690       j = i + 1
     691       if (j .LE. 9) then
     692         png_output(i) = file_out+".00000"+j+".png"
     693       end if
     694       if (j .GT. 9 .AND. j .LE. 99) then
     695         png_output(i) = file_out+".0000"+j+".png"
     696       end if
     697       if (j .GT. 99 .AND. j .LE. 999) then
     698         png_output(i) = file_out+".000"+j+".png"
     699       end if
     700       if (j .GT. 999) then
     701         png_output(i) = file_out+".00"+j+".png"
     702       end if
     703
     704       ;using imagemagick's convert for reducing the white
     705       ;space around the plot
     706       cmd = "convert -geometry 1000x1000 -density 300 -trim " +  \
     707              png_output(i) + " " + png_output(i)
     708       system(cmd)
     709     end do
     710
     711     print(" ")
     712     print("Output to: "+ png_output)
     713     print(" ")
     714   else
     715     print(" ")
     716     print("Output to: " + file_out +"."+ format_out)
     717     print(" ")
     718   end if
    669719   
    670720end
  • palm/trunk/SCRIPTS/NCL/timeseries.ncl

    r526 r532  
    3535
    3636   ;***************************************************
     37   ; Retrieving the NCL version used
     38   ;***************************************************
     39   
     40   ncl_version_ch = systemfunc("ncl -V")
     41   ncl_version    = stringtofloat(ncl_version_ch)
     42
     43   ;***************************************************
    3744   ; Retrieving the double quote character
    3845   ;***************************************************
     
    5360   end if
    5461
    55    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
     62   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
    5663      print(" ")
    5764      print("'format_out = "+format_out+"' is invalid and set to'x11'")
     
    5966      format_out="x11"
    6067   end if 
     68
     69   if (ncl_version .LE. 5.1 .AND. format_out .EQ. "png") then
     70      print(" ")
     71      print("Output of png files not available")
     72      print("png output is avaiable with NCL version 5.2.0 and higher ")
     73      print("NCL version used: " + ncl_version_ch)
     74      print(" ")
     75      exit
     76   end if
    6177
    6278   if (over .NE. 0 .AND. over .NE. 1) then
     
    275291   res@gsnDraw                 = False
    276292   res@gsnFrame                = False
    277    res@gsnPaperOrientation     = "portrait"
    278    res@gsnPaperWidth           = 8.27
    279    res@gsnPaperHeight          = 11.69
    280    res@gsnPaperMargin          = 0.79
    281293   res@tmXBMode                = True
    282294   res@tmYLMode                = True
     
    308320   ; ***************************************************
    309321   
     322   if ( format_out .EQ. "pdf" .OR. format_out .EQ. "ps" ) then
     323      format_out@wkPaperSize = "A4"
     324   end if
     325   if ( format_out .EQ. "png" ) then
     326      format_out@wkWidth  = 1000
     327      format_out@wkHeight = 1000
     328   end if
     329
    310330   wks_ps = gsn_open_wks(format_out,file_out)           
    311331   gsn_define_colormap(wks_ps,"rainbow+white")
     
    12071227   ; merge plots onto one page
    12081228   ; ***************************************************
     1229
     1230   no_frames = 0
    12091231 
    12101232   if ((format_out .EQ. "eps" .OR. format_out .EQ. "epsi") .AND. n .gt. no_rows*no_columns) then
     
    12171239         if ( np + no_rows*no_columns .gt. n) then   
    12181240            gsn_panel(wks_ps, plot_ps(np:n),(/no_rows,no_columns/),resP)
     1241            no_frames = no_frames + 1           
    12191242         else
    12201243            gsn_panel(wks_ps, plot_ps(np:np+no_rows*no_columns-1),(/no_rows,no_columns/),resP)
     1244            no_frames = no_frames + 1
    12211245         end if
    12221246      end do
    12231247   end if
    12241248
    1225    print(" ")
    1226    print("Output to: " + file_out +"."+ format_out)
    1227    print(" ")
     1249   if (format_out .EQ. "png" ) then
     1250     png_output = new((/no_frames/), string)
     1251     j = 0
     1252     do i=0, no_frames-1
     1253       j = i + 1
     1254       if (j .LE. 9) then
     1255         png_output(i) = file_out+".00000"+j+".png"
     1256       end if
     1257       if (j .GT. 9 .AND. j .LE. 99) then
     1258         png_output(i) = file_out+".0000"+j+".png"
     1259       end if
     1260       if (j .GT. 99 .AND. j .LE. 999) then
     1261         png_output(i) = file_out+".000"+j+".png"
     1262       end if
     1263       if (j .GT. 999) then
     1264         png_output(i) = file_out+".00"+j+".png"
     1265       end if
     1266
     1267       ;using imagemagick's convert for reducing the white
     1268       ;space around the plot
     1269       cmd = "convert -geometry 1000x1000 -density 300 -trim " +  \
     1270              png_output(i) + " " + png_output(i)
     1271       system(cmd)
     1272     end do
     1273
     1274     print(" ")
     1275     print("Output to: "+ png_output)
     1276     print(" ")
     1277   else
     1278     print(" ")
     1279     print("Output to: " + file_out +"."+ format_out)
     1280     print(" ")
     1281   end if
     1282 
    12281283 
    12291284end
  • palm/trunk/SOURCE/check_parameters.f90

    r531 r532  
    44! Current revisions:
    55! -----------------
    6 ! Bugfix: unit of hyp changed to dbar
     6!
    77!
    88! Former revisions:
    99! -----------------
    1010! $Id$
     11!
     12! 531 2010-04-21 06:47:21Z heinze
     13! Bugfix: unit of hyp changed to dbar
    1114!
    1215! 524 2010-03-30 02:04:51Z raasch
  • palm/trunk/SOURCE/modules.f90

    r531 r532  
    55! Current revisions:
    66! -----------------
    7 ! character length of dopr_unit enlarged
     7!
    88!
    99! Former revisions:
    1010! -----------------
    1111! $Id$
     12!
     13! 531 2010-04-21 06:47:21Z heinze
     14! character length of dopr_unit enlarged
    1215!
    1316! 519 2010-03-19 05:30:02Z raasch
  • palm/trunk/SOURCE/prognostic_equations.f90

    r531 r532  
    44! Current revisions:
    55! -----------------
    6 ! add call of subsidence in the equation for humidity / passive scalar
     6!
    77!
    88! Former revisions:
    99! -----------------
    1010! $Id$
     11!
     12! 531 2010-04-21 06:47:21Z heinze
     13! add call of subsidence in the equation for humidity / passive scalar
    1114!
    1215! 411 2009-12-11 14:15:58Z heinze
Note: See TracChangeset for help on using the changeset viewer.