Index: palm/trunk/SCRIPTS/NCL/cross_sections.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 582)
+++ palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 585)
@@ -276,4 +276,12 @@
 
    vNam  = getfilevarnames(f_att) 
+   vType = getfilevartypes(f_att,vNam) 
+
+   if ((all(vType .eq. "double"))) then ;distinction if data is double or float
+      check_vType = True
+   else
+      check_vType = False
+   end if 
+
    print(" ")
    print("Variables in input file:")
@@ -1346,17 +1354,34 @@
    if (xyc .EQ. 1) then
       no_layer = (ze-zs)+1
-      data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float)
+      if (check_vType) then
+         data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),double)
+      else
+         data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float)
+      end if
    end if
    if (xzc .EQ. 1) then
       no_layer = (ye-ys)+1
-      data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float)
+      if (check_vType) then
+         data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),double)
+      else
+         data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float)
+      end if
    end if
    if (yzc .EQ. 1) then
       no_layer = (xe-xs)+1
-      data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float)
-   end if
-
-   MinVal = new(dim,float)
-   MaxVal = new(dim,float)
+      if (check_vType) then
+         data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),double)
+      else
+         data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float)
+      end if
+   end if
+
+   if (check_vType) then
+      MinVal = new(dim,double)
+      MaxVal = new(dim,double)
+   else
+      MinVal = new(dim,float)
+      MaxVal = new(dim,float)
+   end if
    unit   = new(dim,string) 
 
Index: palm/trunk/SCRIPTS/NCL/profiles.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 582)
+++ palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 585)
@@ -403,5 +403,12 @@
    ListSetType(f,"cat")
    
-   vNam = getfilevarnames(f_att)    
+   vNam  = getfilevarnames(f_att)
+   vType = getfilevartypes(f_att,vNam) 
+
+   if ((all(vType .eq. "double"))) then ;distinction if data is double or float
+      check_vType = True
+   else
+      check_vType = False
+   end if
    
    if (nof .EQ. 0)then
@@ -1339,8 +1346,13 @@
    end do  
    
-   if (log_z .EQ. 1) then
-      data   = new((/dim,np,dimz-1/),float) 
+   if (log_z .EQ. 1) then      
+      if (check_vType) then
+         data   = new((/dim,np,dimz-1/),double) 
+         data_0 = new((/np,dimz-1/),double)
+      else
+         data   = new((/dim,np,dimz-1/),float) 
+         data_0 = new((/np,dimz-1/),float)
+      end if
       data@_FillValue=9.96921e+36
-      data_0 = new((/np,dimz-1/),float)
       data_0 = 0.1
       t      = new((/np,dimz-1/),float) 
@@ -1371,7 +1383,12 @@
       end if
    else
-      data   = new((/dim,np,dimz/),float) 
-      data@_FillValue=9.96921e+36
-      data_0 = new((/np,dimz/),float)
+      if (check_vType) then
+         data   = new((/dim,np,dimz/),double) 
+         data_0 = new((/np,dimz/),double)
+      else
+         data   = new((/dim,np,dimz/),float) 
+         data_0 = new((/np,dimz/),float)
+      end if
+      data@_FillValue=9.96921e+36      
       data_0 = 0.0
       t      = new((/np,dimz/),float) 
@@ -1418,134 +1435,50 @@
    if (over .EQ. 1) then 
       plot_u         = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniu = 1.E27
-      maxiu =-1.E27
       plot_v         = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniv = 1.E27
-      maxiv =-1.E27
       plot_w         = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniw = 1.E27
-      maxiw =-1.E27
-      plot_pt        = gsn_csm_xy(wks,t,data_0(:,:),res)
-      minipt = 1.E27
-      maxipt =-1.E27
+      plot_pt        = gsn_csm_xy(wks,t,data_0(:,:),res)      
       plot_vpt       = gsn_csm_xy(wks,t,data_0(:,:),res)
-      minivpt = 1.E27
-      maxivpt =-1.E27
       plot_lpt       = gsn_csm_xy(wks,t,data_0(:,:),res)
-      minilpt = 1.E27
-      maxilpt =-1.E27
       plot_q         = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniq = 1.E27
-      maxiq =-1.E27
       plot_qv        = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniqv = 1.E27
-      maxiqv =-1.E27
       plot_ql        = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniql = 1.E27
-      maxiql =-1.E27
       plot_rho       = gsn_csm_xy(wks,t,data_0(:,:),res)
       plot_s         = gsn_csm_xy(wks,t,data_0(:,:),res)
       plot_sa        = gsn_csm_xy(wks,t,data_0(:,:),res)
       plot_e         = gsn_csm_xy(wks,t,data_0(:,:),res)
-      minie = 1.E27
-      maxie =-1.E27
       plot_es        = gsn_csm_xy(wks,t,data_0(:,:),res)
-      minie = 1.E27
-      maxie =-1.E27
       plot_km        = gsn_csm_xy(wks,t,data_0(:,:),res)
-      minie = 1.E27
-      maxie =-1.E27
       plot_kh        = gsn_csm_xy(wks,t,data_0(:,:),res)
-      minie = 1.E27
-      maxie =-1.E27
       plot_l         = gsn_csm_xy(wks,t,data_0(:,:),res)     
       plot_wpup      = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwpup = 1.E27
-      maxiwpup =-1.E27
       plot_wsus      = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwsus = 1.E27
-      maxiwsus =-1.E27
       plot_wu        = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwu = 1.E27
-      maxiwu =-1.E27
       plot_wpvp      = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwpvp = 1.E27
-      maxiwpvp =-1.E27
       plot_wsvs      = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwsvs = 1.E27
-      maxiwsvs =-1.E27
       plot_wv        = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwv = 1.E27
-      maxiwv =-1.E27
       plot_wpptp     = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwpptp = 1.E27
-      maxiwpptp =-1.E27
       plot_wspts     = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwspts = 1.E27
-      maxiwspts =-1.E27
       plot_wpt       = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwpt = 1.E27
-      maxiwpt =-1.E27
       plot_wsptsBC   = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwsptsBC = 1.E27
-      maxiwsptsBC =-1.E27 
       plot_wptBC     = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwptBC = 1.E27
-      maxiwptBC =-1.E27 
       plot_wpvptp    = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwpvptp = 1.E27
-      maxiwpvptp =-1.E27
       plot_wsvpts    = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwsvpts = 1.E27
-      maxiewsvpts=-1.E27
       plot_wvpt      = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwvpt = 1.E27
-      maxiwvpt =-1.E27 
       plot_wpqp      = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwpqp = 1.E27
-      maxiwpqp =-1.E27
       plot_wsqs      = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwsqs = 1.E27
-      maxiwsqs =-1.E27
       plot_wq        = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwq = 1.E27
-      maxiwq =-1.E27 
       plot_wpqvp     = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwpqvp = 1.E27
-      maxiwpqvp =-1.E27
       plot_wsqvs     = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwsqvs = 1.E27
-      maxiwsqvs =-1.E27
       plot_wqv       = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwqv = 1.E27
-      maxiwqv =-1.E27
       plot_wpsp      = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwpsp = 1.E27
-      maxiwpsp =-1.E27
       plot_wsss      = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwsss = 1.E27
-      maxiwsss =-1.E27
       plot_ws        = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniws = 1.E27
-      maxiws =-1.E27
       plot_wpsap     = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwpsap = 1.E27
-      maxiwpsap =-1.E27
       plot_wssas     = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwssas = 1.E27
-      maxiwssas =-1.E27 
       plot_wsa       = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwsa = 1.E27
-      maxiwsa =-1.E27
       plot_wses      = gsn_csm_xy(wks,t,data_0(:,:),res)
       plot_us2       = gsn_csm_xy(wks,t,data_0(:,:),res)
-      minius2 = 1.E27
-      maxius2 =-1.E27
       plot_vs2       = gsn_csm_xy(wks,t,data_0(:,:),res)
-      minivs2 = 1.E27
-      maxivs2 =-1.E27
       plot_ws2       = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniws2 = 1.E27
-      maxiws2 =-1.E27
       plot_pts2      = gsn_csm_xy(wks,t,data_0(:,:),res)
       plot_ws3       = gsn_csm_xy(wks,t,data_0(:,:),res)
@@ -1554,12 +1487,191 @@
       plot_wspts2    = gsn_csm_xy(wks,t,data_0(:,:),res)
       plot_wsususodz = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwsususodz = 1.E27
-      maxiwsususodz =-1.E27
       plot_wspsodz   = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwspsodz = 1.E27
-      maxiwspsodz =-1.E27
       plot_wpeodz    = gsn_csm_xy(wks,t,data_0(:,:),res)
-      miniwpeodz = 1.E27
-      maxiwpeodz =-1.E27
+  
+      if (check_vType) then
+        miniu         =  100000.d
+        maxiu         = -100000.d
+        miniv         =  100000.d
+        maxiv         = -100000.d
+        miniw         =  100000.d
+        maxiw         = -100000.d
+        minipt        =  100000.d
+        maxipt        = -100000.d
+        minivpt       =  100000.d
+        maxivpt       = -100000.d
+        minilpt       =  100000.d
+        maxilpt       = -100000.d
+        miniq         =  100000.d
+        maxiq         = -100000.d
+        miniqv        =  100000.d
+        maxiqv        = -100000.d
+        miniql        =  100000.d
+        maxiql        = -100000.d
+        minie         =  100000.d
+        maxie         = -100000.d
+        minies        =  100000.d
+        maxies        = -100000.d
+        minikm        =  100000.d
+        maxikm        = -100000.d
+        minikh        =  100000.d
+        maxikh        = -100000.d
+        miniwpup      =  100000.d
+        maxiwpup      = -100000.d
+        miniwsus      =  100000.d
+        maxiwsus      = -100000.d
+        miniwu        =  100000.d
+        maxiwu        = -100000.d
+        miniwpvp      =  100000.d
+        maxiwpvp      = -100000.d
+        miniwsvs      =  100000.d
+        maxiwsvs      = -100000.d
+        miniwv        =  100000.d
+        maxiwv        = -100000.d
+        miniwpptp     =  100000.d
+        maxiwpptp     = -100000.d
+        miniwspts     =  100000.d
+        maxiwspts     = -100000.d
+        miniwpt       =  100000.d
+        maxiwpt       = -100000.d
+        miniwsptsBC   =  100000.d
+        maxiwsptsBC   = -100000.d
+        miniwptBC     =  100000.d
+        maxiwptBC     = -100000.d
+        miniwpvptp    =  100000.d
+        maxiwpvptp    = -100000.d
+        miniwsvpts    =  100000.d
+        maxiwsvpts    = -100000.d
+        miniwvpt      =  100000.d
+        maxiwvpt      = -100000.d
+        miniwpqp      =  100000.d
+        maxiwpqp      = -100000.d
+        miniwsqs      =  100000.d
+        maxiwsqs      = -100000.d
+        miniwq        =  100000.d
+        maxiwq        = -100000.d
+        miniwpqvp     =  100000.d
+        maxiwpqvp     = -100000.d
+        miniwsqvs     =  100000.d
+        maxiwsqvs     = -100000.d
+        miniwqv       =  100000.d
+        maxiwqv       = -100000.d
+        miniwpsp      =  100000.d
+        maxiwpsp      = -100000.d
+        miniwsss      =  100000.d
+        maxiwsss      = -100000.d
+        miniws        =  100000.d
+        maxiws        = -100000.d
+        miniwpsap     =  100000.d
+        maxiwpsap     = -100000.d
+        miniwssas     =  100000.d
+        maxiwssas     = -100000.d
+        miniwsa       =  100000.d
+        maxiwsa       = -100000.d
+        minius2       =  100000.d
+        maxius2       = -100000.d
+        minivs2       =  100000.d
+        maxivs2       = -100000.d
+        miniws2       =  100000.d
+        maxiws2       = -100000.d
+        miniwsususodz =  100000.d
+        maxiwsususodz = -100000.d
+        miniwspsodz   =  100000.d
+        maxiwspsodz   = -100000.d
+        miniwpeodz    =  100000.d
+        maxiwpeodz    = -100000.d
+      else
+        miniu         =  100000.
+        maxiu         = -100000.
+        miniv         =  100000.
+        maxiv         = -100000.
+        miniw         =  100000.
+        maxiw         = -100000.
+        minipt        =  100000.
+        maxipt        = -100000.
+        minivpt       =  100000.
+        maxivpt       = -100000.
+        minilpt       =  100000.
+        maxilpt       = -100000.
+        miniq         =  100000.
+        maxiq         = -100000.
+        miniqv        =  100000.
+        maxiqv        = -100000.
+        miniql        =  100000.
+        maxiql        = -100000.
+        minie         =  100000.
+        maxie         = -100000.
+        minies        =  100000.
+        maxies        = -100000.
+        minikm        =  100000.
+        maxikm        = -100000.
+        minikh        =  100000.
+        maxikh        = -100000.
+        miniwpup      =  100000.
+        maxiwpup      = -100000.
+        miniwsus      =  100000.
+        maxiwsus      = -100000.
+        miniwu        =  100000.
+        maxiwu        = -100000.
+        miniwpvp      =  100000.
+        maxiwpvp      = -100000.
+        miniwsvs      =  100000.
+        maxiwsvs      = -100000.
+        miniwv        =  100000.
+        maxiwv        = -100000.
+        miniwpptp     =  100000.
+        maxiwpptp     = -100000.
+        miniwspts     =  100000.
+        maxiwspts     = -100000.
+        miniwpt       =  100000.
+        maxiwpt       = -100000.
+        miniwsptsBC   =  100000.
+        maxiwsptsBC   = -100000.
+        miniwptBC     =  100000.
+        maxiwptBC     = -100000.
+        miniwpvptp    =  100000.
+        maxiwpvptp    = -100000.
+        miniwsvpts    =  100000.
+        maxiwsvpts    = -100000.
+        miniwvpt      =  100000.
+        maxiwvpt      = -100000.
+        miniwpqp      =  100000.
+        maxiwpqp      = -100000.
+        miniwsqs      =  100000.
+        maxiwsqs      = -100000.
+        miniwq        =  100000.
+        maxiwq        = -100000.
+        miniwpqvp     =  100000.
+        maxiwpqvp     = -100000.
+        miniwsqvs     =  100000.
+        maxiwsqvs     = -100000.
+        miniwqv       =  100000.
+        maxiwqv       = -100000.
+        miniwpsp      =  100000.
+        maxiwpsp      = -100000.
+        miniwsss      =  100000.
+        maxiwsss      = -100000.
+        miniws        =  100000.
+        maxiws        = -100000.
+        miniwpsap     =  100000.
+        maxiwpsap     = -100000.
+        miniwssas     =  100000.
+        maxiwssas     = -100000.
+        miniwsa       =  100000.
+        maxiwsa       = -100000.
+        minius2       =  100000.
+        maxius2       = -100000.
+        minivs2       =  100000.
+        maxivs2       = -100000.
+        miniws2       =  100000.
+        maxiws2       = -100000.
+        miniwsususodz =  100000.
+        maxiwsususodz = -100000.
+        miniwspsodz   =  100000.
+        maxiwspsodz   = -100000.
+        miniwpeodz    =  100000.
+        maxiwpeodz    = -100000.
+      end if
+
    end if
 
@@ -1864,5 +1976,5 @@
          end if
 
-         if (max_z_int .gt. dimz-1)
+         if (max_z_int .ge. dimz-1)
             max_z_int = dimz-1
             if (log_z .EQ. 1) then
Index: palm/trunk/SCRIPTS/NCL/spectra.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/spectra.ncl	(revision 582)
+++ palm/trunk/SCRIPTS/NCL/spectra.ncl	(revision 585)
@@ -203,4 +203,12 @@
    
    vNam = getfilevarnames(f_att) 
+   vType = getfilevartypes(f_att,vNam) 
+
+   if ((all(vType .eq. "double"))) then ;distinction if data is double or float
+      check_vType = True
+   else
+      check_vType = False
+   end if 
+
    print(" ")
    print("Variables in input file:")
@@ -530,8 +538,14 @@
          end do  
 	 
+         if (check_vType) then
+            min_y=new(dimz,double)
+	    max_y=new(dimz,double)
+         else
+            min_y=new(dimz,float)
+	    max_y=new(dimz,float)
+         end if 
          min_x=new(dimz,double)
 	 max_x=new(dimz,double)
-	 min_y=new(dimz,float)
-	 max_y=new(dimz,float)
+	 
 	 plot_h  = new(dimz,graphic)
 	 
Index: palm/trunk/SCRIPTS/NCL/timeseries.ncl
===================================================================
--- palm/trunk/SCRIPTS/NCL/timeseries.ncl	(revision 582)
+++ palm/trunk/SCRIPTS/NCL/timeseries.ncl	(revision 585)
@@ -170,6 +170,13 @@
    ListSetType(f,"cat")
 
-   vNam=getfilevarnames(f_att)
-   vNam_static=vNam
+   vNam  =getfilevarnames(f_att)
+   vType = getfilevartypes(f_att,vNam) 
+   vNam_static = vNam
+
+   if ((all(vType .eq. "double"))) then ;distinction if data is double or float
+      check_vType = True
+   else
+      check_vType = False
+   end if
 
    print(" ")
@@ -356,25 +363,50 @@
                            	 
    n=0 
-   minE=1.E27
-   maxE=-1.E27
-   minus=1.E27
-   maxus=-1.E27
-   minu=1.E27
-   maxu=-1.E27
-   minz=1.E27
-   maxz=-1.E27
-   minw=1.E27
-   maxw=-1.E27
-   minp=1.E27
-   maxp=-1.E27
-   mins=1.E27
-   maxs=-1.E27
-
-   data   = new((/dim,(end_time_step-start_time_step)+1/),float)
-   unit   = new(dim,string)
-   data_0 = new((end_time_step-start_time_step)+1,float)
+   if (check_vType) then
+      minE  =  100000.d
+      maxE  = -100000.d
+      minus =  100000.d
+      maxus = -100000.d
+      minu  =  100000.d
+      maxu  = -100000.d
+      minz  =  100000.d
+      maxz  = -100000.d
+      minw  =  100000.d
+      maxw  = -100000.d
+      minp  =  100000.d
+      maxp  = -100000.d
+      mins  =  100000.d
+      maxs  = -100000.d
+   else
+      minE  =  100000.
+      maxE  = -100000.
+      minus =  100000.
+      maxus = -100000.
+      minu  =  100000.
+      maxu  = -100000.
+      minz  =  100000.
+      maxz  = -100000.
+      minw  =  100000.
+      maxw  = -100000.
+      minp  =  100000.
+      maxp  = -100000.
+      mins  =  100000.
+      maxs  = -100000.
+   end if
+
+   if (check_vType) then
+      data   = new((/dim,(end_time_step-start_time_step)+1/),double)
+      data_0 = new((end_time_step-start_time_step)+1,double) 
+      mini   = new(dim,double)
+      maxi   = new(dim,double)
+   else
+      data   = new((/dim,(end_time_step-start_time_step)+1/),float) 
+      data_0 = new((end_time_step-start_time_step)+1,float) 
+      mini   = new(dim,float)
+      maxi   = new(dim,float)
+   end if 
+   unit   = new(dim,string)   
    data_0 = 0.0
-   mini   = new(dim,float)
-   maxi   = new(dim,float)
+  
    
    if (over .EQ. 1) then 
