Changeset 351 for palm/trunk/SCRIPTS/NCL
- Timestamp:
- Jul 8, 2009 1:42:45 PM (15 years ago)
- Location:
- palm/trunk/SCRIPTS/NCL
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/NCL/ncl_preferences.ncl
r342 r351 1256 1256 end if 1257 1257 ;*************************************************** 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 ;*************************************************** 1258 1278 ; OPTIONAL --start_x-- STARTVALUE IN X-DIRECTION 1259 1279 ; -
palm/trunk/SCRIPTS/NCL/profiles.ncl
r347 r351 990 990 delete(end_time_step) 991 991 end_time_step=round(et,3) 992 993 no_time = end_time_step-start_time_step+1 992 994 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 993 1017 print(" ") 994 1018 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) 996 1021 print(" ") 1022 997 1023 998 1024 ; **************************************************** … … 1000 1026 ; **************************************************** 1001 1027 1002 legend_label=new(n t,double)1003 do p= start_time_step,end_time_step1004 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) 1005 1031 end do 1006 1032 1007 np = end_time_step-start_time_step+11008 1033 1009 1034 ; *************************************************** … … 1034 1059 res@pmLegendOrthogonalPosF = -1.0 1035 1060 res@pmLegendWidthF = 0.12 1036 res@pmLegendHeightF = 0.05* (end_time_step-start_time_step+1)1061 res@pmLegendHeightF = 0.05*np 1037 1062 res@lgLabelFontHeightF = font_size 1038 1063 res@lgTitleString = "Time [h]" … … 1193 1218 ; *************************************************** 1194 1219 1195 do ti = start_time_step, end_time_step1196 if( t_all(ti ) .lt. 10^36) then1220 do ti =0,np-1 1221 if( t_all(ti_in(ti)) .lt. 10^36) then 1197 1222 start_time_step = ti 1198 1223 break … … 1201 1226 1202 1227 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) 1204 1229 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) 1206 1231 data_0 = 0.1 1207 t = new((/ (end_time_step-start_time_step)+1,dimz-1/),float)1232 t = new((/np,dimz-1/),float) 1208 1233 t = 0.0 1209 1234 unit = new(dim,string) … … 1232 1257 end if 1233 1258 else 1234 data = new((/dim, (end_time_step-start_time_step)+1,dimz/),float)1259 data = new((/dim,np,dimz/),float) 1235 1260 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) 1237 1262 data_0 = 0.0 1238 t = new((/ (end_time_step-start_time_step)+1,dimz/),float)1263 t = new((/np,dimz/),float) 1239 1264 t = 0.0 1240 1265 unit = new(dim,string) … … 1526 1551 temp_att = f_att->$vNam(varn)$ 1527 1552 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 1531 1560 end if 1532 1561 else 1533 1562 if (log_z .EQ. 1) then 1534 1563 do i=1,dimz-1 1535 do j= start_time_step,end_time_step1564 do j=0,np-1 1536 1565 temp= f[:]->$vNam(varn)$ 1537 1566 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)) 1540 1569 end do 1541 1570 end do 1542 1571 else 1543 1572 do i=0,dimz-1 1544 do j= start_time_step,end_time_step1573 do j=0,np-1 1545 1574 temp= f[:]->$vNam(varn)$ 1546 1575 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)) 1549 1578 end do 1550 1579 end do … … 1598 1627 if (log_z .EQ. 1) then 1599 1628 do i=1,dimz-1 1600 do j= start_time_step,end_time_step1601 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)$ 1602 1631 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)) 1605 1634 delete(data_temp) 1606 1635 end do … … 1608 1637 else 1609 1638 do i=0,dimz-1 1610 do j= start_time_step,end_time_step1611 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)$ 1612 1641 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) 1614 1643 data_temp!0 = "t" 1615 1644 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)) 1617 1646 delete(data_temp) 1618 1647 end do … … 1631 1660 z = f_att->$vNam(varn+1)$(1:dimz-1) 1632 1661 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 1634 1665 else 1635 1666 z = f_att->$vNam(varn+1)$ 1636 1667 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 1638 1671 end if 1639 1672 else
Note: See TracChangeset
for help on using the changeset viewer.