Ignore:
Timestamp:
Oct 14, 2010 11:15:06 AM (12 years ago)
Author:
heinze
Message:

Bugfix: enable plot of data if it is of kind double instead of kind float

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/NCL/cross_sections.ncl

    r566 r585  
    276276
    277277   vNam  = getfilevarnames(f_att)
     278   vType = getfilevartypes(f_att,vNam)
     279
     280   if ((all(vType .eq. "double"))) then ;distinction if data is double or float
     281      check_vType = True
     282   else
     283      check_vType = False
     284   end if
     285
    278286   print(" ")
    279287   print("Variables in input file:")
     
    13461354   if (xyc .EQ. 1) then
    13471355      no_layer = (ze-zs)+1
    1348       data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float)
     1356      if (check_vType) then
     1357         data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),double)
     1358      else
     1359         data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float)
     1360      end if
    13491361   end if
    13501362   if (xzc .EQ. 1) then
    13511363      no_layer = (ye-ys)+1
    1352       data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float)
     1364      if (check_vType) then
     1365         data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),double)
     1366      else
     1367         data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float)
     1368      end if
    13531369   end if
    13541370   if (yzc .EQ. 1) then
    13551371      no_layer = (xe-xs)+1
    1356       data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float)
    1357    end if
    1358 
    1359    MinVal = new(dim,float)
    1360    MaxVal = new(dim,float)
     1372      if (check_vType) then
     1373         data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),double)
     1374      else
     1375         data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float)
     1376      end if
     1377   end if
     1378
     1379   if (check_vType) then
     1380      MinVal = new(dim,double)
     1381      MaxVal = new(dim,double)
     1382   else
     1383      MinVal = new(dim,float)
     1384      MaxVal = new(dim,float)
     1385   end if
    13611386   unit   = new(dim,string)
    13621387
Note: See TracChangeset for help on using the changeset viewer.