Changeset 351 for palm/trunk


Ignore:
Timestamp:
Jul 8, 2009 1:42:45 PM (15 years ago)
Author:
heinze
Message:

New parameter time_stride is in profiles.ncl available.

Location:
palm/trunk/SCRIPTS/NCL
Files:
4 edited

Legend:

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

    r342 r351  
    12561256      end if
    12571257      ;***************************************************
     1258      ; OPTIONAL --time_stride-- TEMPORAL STRIDE
     1259      ;
     1260      ; temporal stride for the plots; if time_stride=1 all the profiles between first_time_step
     1261      ; and end_time_step are plotted (including first_time_step and end_time_step),
     1262      ; if time_stride=3 every third time step between start_time_step and end_time_step is plotted
     1263      ;
     1264      ; data type: integer
     1265      ;
     1266      ; example:   time_stride = 3
     1267      ;
     1268      ; default:   1
     1269      ;***************************************************
     1270      if (.not. isvar("time_stride"))then       
     1271     
     1272       
     1273         time_stride = 1
     1274         
     1275         
     1276      end if
     1277      ;***************************************************
    12581278      ; OPTIONAL --start_x-- STARTVALUE IN X-DIRECTION 
    12591279      ;
  • palm/trunk/SCRIPTS/NCL/profiles.ncl

    r347 r351  
    990990   delete(end_time_step)
    991991   end_time_step=round(et,3)
     992
     993   no_time = end_time_step-start_time_step+1
    992994   
     995   ; ****************************************************
     996   ; time_stride and different types of mistakes that could be done
     997   ; ****************************************************
     998 
     999   if(time_stride .LT. 1)
     1000      print(" ")
     1001      print("'time_stride' has to be positive and is set to 1")
     1002      print(" ")
     1003      time_stride = 1
     1004   end if
     1005
     1006   if(time_stride .GE. no_time)
     1007      print(" ")
     1008      print("'time_stride' is greater equal than number of available time steps,")
     1009      print("only start time step will be plotted then")
     1010      print(" ")
     1011      time_stride = no_time
     1012   end if
     1013
     1014   ti_in = ispan(start_time_step,end_time_step,time_stride) ;ti_in contents the time indices to plot
     1015   np    = dimsizes(ti_in) 
     1016
    9931017   print(" ")
    9941018   print("Output of time steps from "+t_all(start_time_step)/3600+" h = "+t_all(start_time_step)+" s => index = "+start_time_step)
    995    print("                     till "+t_all(end_time_step)/3600+" h = "+t_all(end_time_step)+" s => index = "+end_time_step)
     1019   print("                     till "+t_all(ti_in(np-1))/3600+" h = "+t_all(ti_in(np-1))+" s => index = "+end_time_step)
     1020   print("                     with temporal stride = "+time_stride)
    9961021   print(" ")
     1022
    9971023
    9981024   ; ****************************************************
     
    10001026   ; ****************************************************
    10011027   
    1002    legend_label=new(nt,double)
    1003    do p=start_time_step,end_time_step
    1004       legend_label(p-start_time_step)=decimalPlaces(t_all(p)/3600,3,True)         
     1028   legend_label=new(np,double)
     1029   do p=0, np-1
     1030      legend_label(p)=decimalPlaces(t_all(ti_in(p))/3600,3,True)         
    10051031   end do
    10061032   
    1007    np = end_time_step-start_time_step+1 
    10081033
    10091034   ; ***************************************************
     
    10341059   res@pmLegendOrthogonalPosF  = -1.0
    10351060   res@pmLegendWidthF          = 0.12
    1036    res@pmLegendHeightF         = 0.05*(end_time_step-start_time_step+1)
     1061   res@pmLegendHeightF         = 0.05*np
    10371062   res@lgLabelFontHeightF     = font_size
    10381063   res@lgTitleString      = "Time [h]"
     
    11931218   ; ***************************************************
    11941219     
    1195    do ti = start_time_step, end_time_step
    1196       if( t_all(ti) .lt. 10^36) then
     1220   do ti =0,np-1
     1221      if( t_all(ti_in(ti)) .lt. 10^36) then
    11971222         start_time_step = ti
    11981223         break
     
    12011226   
    12021227   if (log_z .EQ. 1) then
    1203       data   = new((/dim,(end_time_step-start_time_step)+1,dimz-1/),float)
     1228      data   = new((/dim,np,dimz-1/),float)
    12041229      data@_FillValue=9.96921e+36
    1205       data_0 = new((/(end_time_step-start_time_step)+1,dimz-1/),float)
     1230      data_0 = new((/np,dimz-1/),float)
    12061231      data_0 = 0.1
    1207       t      = new((/(end_time_step-start_time_step)+1,dimz-1/),float)
     1232      t      = new((/np,dimz-1/),float)
    12081233      t      = 0.0
    12091234      unit   = new(dim,string)
     
    12321257      end if
    12331258   else
    1234       data   = new((/dim,(end_time_step-start_time_step)+1,dimz/),float)
     1259      data   = new((/dim,np,dimz/),float)
    12351260      data@_FillValue=9.96921e+36
    1236       data_0 = new((/(end_time_step-start_time_step)+1,dimz/),float)
     1261      data_0 = new((/np,dimz/),float)
    12371262      data_0 = 0.0
    1238       t      = new((/(end_time_step-start_time_step)+1,dimz/),float)
     1263      t      = new((/np,dimz/),float)
    12391264      t      = 0.0
    12401265      unit   = new(dim,string)
     
    15261551               temp_att = f_att->$vNam(varn)$
    15271552               if (log_z .EQ. 1) then
    1528                   data(varn,:,:) = temp(start_time_step:end_time_step,1:dimz-1)
    1529                else
    1530                   data(varn,:,:) = temp(start_time_step:end_time_step,0:dimz-1)
     1553                  do j=0,np-1
     1554                     data(varn,j,:) = temp(ti_in(j),1:dimz-1)
     1555                  end do
     1556               else
     1557                  do j=0,np-1
     1558                     data(varn,j,:) = temp(ti_in(j),0:dimz-1)
     1559                  end do
    15311560               end if
    15321561            else
    15331562               if (log_z .EQ. 1) then
    15341563                  do i=1,dimz-1
    1535                      do j=start_time_step,end_time_step
     1564                     do j=0,np-1
    15361565                        temp= f[:]->$vNam(varn)$
    15371566                        temp_att = f_att->$vNam(varn)$
    1538                         data_temp = temp(j,i,start_y:end_y,start_x:end_x)
    1539                         data(varn,j-start_time_step,i-1) = dim_avg_Wrap(dim_avg_Wrap(data_temp))
     1567                        data_temp = temp(ti_in(j),i,start_y:end_y,start_x:end_x)
     1568                        data(varn,j,i-1) = dim_avg_Wrap(dim_avg_Wrap(data_temp))
    15401569                     end do
    15411570                  end do
    15421571               else
    15431572                  do i=0,dimz-1
    1544                      do j=start_time_step,end_time_step
     1573                     do j=0,np-1
    15451574                        temp= f[:]->$vNam(varn)$
    15461575                        temp_att = f_att->$vNam(varn)$
    1547                         data_temp = temp(j,i,start_y:end_y,start_x:end_x)
    1548                         data(varn,j-start_time_step,i) = dim_avg_Wrap(dim_avg_Wrap(data_temp))
     1576                        data_temp = temp(ti_in(j),i,start_y:end_y,start_x:end_x)
     1577                        data(varn,j,i) = dim_avg_Wrap(dim_avg_Wrap(data_temp))
    15491578                     end do
    15501579                  end do
     
    15981627             if (log_z .EQ. 1) then
    15991628               do i=1,dimz-1
    1600                   do j=start_time_step,end_time_step
    1601                      temp= f[:]->$vNam(varn)$(j,i,start_y:end_y,start_x:end_x)
     1629                  do j=0,np-1
     1630                     temp= f[:]->$vNam(varn)$
    16021631                     temp_att = f_att->$vNam(varn)$
    1603                      data_temp = temp(j,i,start_y:end_y,start_x:end_x)
    1604                      data(varn,j-start_time_step,i-1) = dim_avg_Wrap(dim_avg_Wrap(data_temp))
     1632                     data_temp = temp(ti_in(j),i,start_y:end_y,start_x:end_x)
     1633                     data(varn,j,i-1) = dim_avg_Wrap(dim_avg_Wrap(data_temp))
    16051634                     delete(data_temp)
    16061635                  end do
     
    16081637            else
    16091638               do i=0,dimz-1
    1610                   do j=start_time_step,end_time_step
    1611                      temp= f[:]->$vNam(varn)$;(j,i,start_y:end_y,start_x:end_x)
     1639                  do j=0,np-1
     1640                     temp= f[:]->$vNam(varn)$
    16121641                     temp_att = f_att->$vNam(varn)$
    1613                      data_temp = temp(j,i,start_y:end_y,start_x:end_x)
     1642                     data_temp = temp(ti_in(j),i,start_y:end_y,start_x:end_x)
    16141643                     data_temp!0 = "t"
    16151644                     data_temp!1 = "z"
    1616                      data(varn,j-start_time_step,i) = dim_avg_Wrap(dim_avg_Wrap(data_temp))
     1645                     data(varn,j,i) = dim_avg_Wrap(dim_avg_Wrap(data_temp))
    16171646                     delete(data_temp)
    16181647                  end do
     
    16311660               z = f_att->$vNam(varn+1)$(1:dimz-1)
    16321661               unit(varn) = temp_att@units
    1633                data(varn,:,:) = temp(start_time_step:end_time_step,1:dimz-1)
     1662               do j=0,np-1
     1663                  data(varn,j,:) = temp(ti_in(j),1:dimz-1)
     1664               end do
    16341665            else
    16351666               z = f_att->$vNam(varn+1)$
    16361667               unit(varn) = temp_att@units
    1637                data(varn,:,:) = temp(start_time_step:end_time_step,:)
     1668               do j=0,np-1
     1669                  data(varn,j,:) = temp(ti_in(j),:)
     1670               end do
    16381671            end if
    16391672         else
Note: See TracChangeset for help on using the changeset viewer.