Changeset 342
- Timestamp:
- Jun 18, 2009 1:54:07 PM (15 years ago)
- Location:
- palm/trunk/SCRIPTS/NCL
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/NCL/ncl_preferences.ncl
r267 r342 195 195 ; data type: string 196 196 ; 197 ; example: var = ",u,v,w "197 ; example: var = ",u,v,w," 198 198 ; 199 199 ; default: "all" (all available variables are plotted) … … 788 788 ; data type: string 789 789 ; 790 ; example: var = ",u,v,w ";790 ; example: var = ",u,v,w,"; 791 791 ; 792 792 ; default: "all" (all available variables are plotted) … … 1726 1726 ; data type: string 1727 1727 ; 1728 ; example: var = ",u,v,w "1728 ; example: var = ",u,v,w," 1729 1729 ; 1730 1730 ; default: "all" (all available variables are plotted) … … 2141 2141 ; data type: string 2142 2142 ; 2143 ; example: var = ",u,v,w "2143 ; example: var = ",u,v,w," 2144 2144 ; 2145 2145 ; default: "all" (all available variables are plotted) -
palm/trunk/SCRIPTS/NCL/profiles.ncl
r324 r342 357 357 ListSetType(f,"cat") 358 358 359 vNam = getfilevarnames(f_att) 359 vNam = getfilevarnames(f_att) 360 360 361 361 if (nof .EQ. 0)then … … 401 401 end if 402 402 end do 403 404 if (var .NE. "all") then 405 ;rearrange the order of the variables in vNam so that the variables 406 ;specified by "var" are in the top of vNam 407 408 vNam_static = new((/dim/),string) 409 vNam_temp = new((/dim/),string) 410 411 var_char = stringtocharacter(var) 412 no_char = dimsizes(var_char) 413 comma = 0 414 415 do j=0,no_char-1 416 if(var_char(j) .eq. ",") 417 comma = comma + 1 418 end if 419 end do 420 421 if(comma .le. 1) 422 print(" ") 423 print("The variables 'var="+var+"'" ) 424 print("do not exist on your input file;") 425 print("be sure to have one comma before and after each variable") 426 print(" ") 427 exit 428 end if 429 430 indices = new((/comma/),integer) 431 comma = 0 432 433 do j=0,no_char-1 434 if(var_char(j) .eq. ",") 435 indices(comma) = j 436 comma = comma + 1 437 end if 438 end do 439 440 do j=0,comma-2 441 vNam_temp(j) = charactertostring(var_char(indices(j)+1:indices(j+1)-1)) 442 end do 443 444 do j=0,comma-2 445 vNam_static(j) = vNam_temp(comma - 2 - j) 446 end do 447 448 vNam_temp = vNam_static 449 vNam_static = "" 450 451 if (prof3d .EQ. 0) then 452 i = 0 453 do j=0,dim-1,2 454 vNam_static(j) = vNam_temp(i) 455 vNam_static(j+1) = "z" + vNam_static(j) 456 i = i+1 457 if(i .eq. comma-1) 458 break 459 end if 460 end do 461 462 delete(vNam_temp) 463 count_variable = 2*(comma-1) 464 else 465 i = 0 466 do j=0,dim-1,1 467 vNam_static(j) = vNam_temp(i) 468 i = i+1 469 if(i .eq. comma-1) 470 break 471 end if 472 end do 473 474 delete(vNam_temp) 475 count_variable = comma-1 476 end if 477 478 counter = 0 479 counter2 = 0 480 do j=0,dim-1 481 counter = 0 482 do i = 0, count_variable - 1 483 if(vNam_static(i) .ne. vNam(j)) 484 counter = counter + 1 485 end if 486 end do 487 488 if (counter .eq. count_variable) 489 vNam_static(count_variable + counter2) = vNam(j) 490 counter2 = counter2 + 1 491 end if 492 end do 493 494 vNam = vNam_static 495 delete(vNam_static) 496 end if 403 497 404 498 ;-----------------------------------------------------below steps only for first file -> nof=0 … … 417 511 if (prof3d .EQ. 0) then 418 512 419 do varn = dim-1,0,1513 do varn=0,dim-1 420 514 if ( isStrSubset( vNam(varn), "time") .OR. isStrSubset( vNam(varn), "NORM")) then 421 varn=varn-1422 515 continue 423 516 end if … … 531 624 end if 532 625 end if 533 varn=varn-1534 626 end do 535 627 536 do varn= dim-1,0,1628 do varn=0,dim-1 537 629 if ( isStrSubset( vNam(varn), "time") .OR. isStrSubset( vNam(varn), "NORM")) then 538 varn=varn-1539 630 continue 540 631 end if … … 703 794 end if 704 795 end if 705 varn=varn-1706 796 end do 707 797 … … 733 823 if (co .EQ. 0) then 734 824 print(" ") 735 print("The variables 'var="+var+"' do not exist on your input file;") 736 print("be sure to have one comma berfore and after each variable") 737 print(" ") 738 exit 825 print("The variables 'var="+var+"'" ) 826 print("do not exist on your input file;") 827 print("be sure to have one comma before and after each variable") 828 print(" ") 829 exit 739 830 end if 740 831 end if … … 789 880 exit 790 881 end if 791 882 792 883 if (prof3d .EQ. 1)then 793 884 t_all = f[:]->time … … 876 967 do i=0,nt-1 877 968 if (end_time_step .GE. (t_all(i)-delta_t/2)/3600 .AND. end_time_step .LT. (t_all(i)+delta_t/2)/3600)then 878 print((t_all(i)-delta_t/2)/3600)879 print((t_all(i)+delta_t/2)/3600)880 969 et=i 881 970 break … … 896 985 end_time_step=round(et,3) 897 986 898 print(start_time_step)899 print(end_time_step)900 901 987 print(" ") 902 988 print("Output of time steps from "+t_all(start_time_step)/3600+" h = "+t_all(start_time_step)+" s => index = "+start_time_step) … … 1054 1140 end if 1055 1141 end if 1142 1056 1143 if (isvar("z_w"))then 1057 1144 if (min_z .GE. max(z_w) ) then … … 1496 1583 1497 1584 if(check) then 1498 if (isStrSubset(vNam(varn),"_0" ))then 1499 print(" ") 1500 print("If you have Outputs of statistic regions you cannot overlay variables; 'over' is set to 0") 1501 print(" ") 1502 over = 0 1503 end if 1504 1585 1505 1586 count_var=count_var+1 1506 1587 1507 1588 if (prof3d .EQ. 0) then 1508 1589 if (t_null)then 1509 temp = f[:]->$vNam(varn)$(1:,:) 1590 temp = f[:]->$vNam(varn)$(1:,:) 1510 1591 else 1511 1592 temp = f[:]->$vNam(varn)$ … … 1520 1601 data_temp = temp(j,i,start_y:end_y,start_x:end_x) 1521 1602 data(varn,j-start_time_step,i-1) = dim_avg_Wrap(dim_avg_Wrap(data_temp)) 1603 delete(data_temp) 1522 1604 end do 1523 1605 end do … … 1531 1613 data_temp!1 = "z" 1532 1614 data(varn,j-start_time_step,i) = dim_avg_Wrap(dim_avg_Wrap(data_temp)) 1615 delete(data_temp) 1533 1616 end do 1534 1617 end do … … 2701 2784 if (count_var .EQ. 0) then 2702 2785 print(" ") 2703 print("The variables 'var="+var+"' do not exist on your input file;") 2704 print("be sure to have one comma berfore and after each variable") 2705 print(" ") 2706 exit 2786 print("The variables 'var="+var+"'" ) 2787 print("do not exist on your input file;") 2788 print("be sure to have one comma before and after each variable") 2789 print(" ") 2790 exit 2791 end if 2792 2793 if (isStrSubset(data@long_name," SR " ))then 2794 print(" ") 2795 print("If you have outputs of statistic regions you cannot overlay variables;") 2796 print("'over' is set to 0" ) 2797 print(" ") 2798 over = 0 2707 2799 end if 2708 2800 … … 3762 3854 3763 3855 com=isStrSubset( c_var,","+vNam(varn)+"," ) 3764 3765 3856 if (com)then 3766 3857 co = co+1 … … 3806 3897 print("'c_var'(= "+c_var+") must include two variables of the general plots = ") 3807 3898 print("- "+com_var_avail) 3808 print("be sure to have one comma be rfore and after the variable")3899 print("be sure to have one comma before and after the variable") 3809 3900 print(" ") 3810 3901 exit … … 3820 3911 print("'c_var'(= "+c_var+") must include three variables of the general plots = ") 3821 3912 print("- "+com_var_avail) 3822 print("be sure to have one comma be rfore and after the variable")3913 print("be sure to have one comma before and after the variable") 3823 3914 print(" ") 3824 3915 exit
Note: See TracChangeset
for help on using the changeset viewer.