Changeset 194 for palm/trunk


Ignore:
Timestamp:
Aug 28, 2008 12:15:13 PM (16 years ago)
Author:
letzel
Message:
  • NCL scripts in trunk/SCRIPTS/NCL updated
Location:
palm/trunk/SCRIPTS/NCL
Files:
5 edited

Legend:

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

    r190 r194  
    88; load ncl_preferences.ncl
    99;***************************************************
    10    
     10
     11function which_script()
     12local script
     13begin
     14   script="cross_section"
     15   return(script)
     16end
     17       
    1118if (isfilepresent("~/ncl_preferences.ncl")) then
    1219   loadscript("~/ncl_preferences.ncl")
     
    2128   end if
    2229end if
    23    
     30
    2431begin
    25 
    26    if (cross_sections .NE. 1 .OR. profiles .NE. 0 .OR. timeseries .NE. 0 .OR. spectra .NE. 0)then
    27       print(" ")
    28       print("Please specify the used script in 'ncl_preferences.ncl' (Line 7-10)")
    29       print(" ")
    30       print("Set 'cross_sections' equal 1 and the other variables equal 0")
    31       print(" ")
    32       exit
    33    end if
    3432
    3533   ; ***************************************************
     
    916914         check = True
    917915      end if 
    918    
    919       if (var .NE. "all") then
    920          check = isStrSubset( var,","+vNam(varn)+"," )
    921       end if 
    922916
    923917      if(check) then
    924 
     918     
    925919         no_var=no_var+1
    926920
     
    965959   var_input=new(no_var,string)
    966960   numb=0
     961   no_var=0
     962   
    967963   do varn=dim-1,0,1   
    968964   
     
    977973         check = True
    978974      end if 
    979    
    980       if (var .NE. "all") then
    981          check = isStrSubset( var,","+vNam(varn)+"," )
    982       end if 
    983975
    984976      if(check) then     
     
    986978         numb=numb+1     
    987979      end if
     980                 
     981      if (var .NE. "all") then
     982         check = isStrSubset( var,","+vNam(varn)+"," )
     983      end if
     984     
     985      if (check) then
     986         no_var = no_var+1
     987      end if
    988988     
    989989   end do
     
    10001000      if (v1 .EQ. 0)then
    10011001         print(" ")
    1002          print("Component 1 for the vector-plot ('vec1') must be one of the input varibles:")
     1002         print("Component 1 for the vector-plot ('vec1') must be one of the varibles on the input file:")
    10031003         print("- "+var_input)
    10041004         print("be sure to have one comma berfore and after the variable")
     
    10091009      if (v2 .EQ. 0)then
    10101010         print(" ")
    1011          print("Component 2 for the vector-plot ('vec2') must be one of the input varibles:")
     1011         print("Component 2 for the vector-plot ('vec2') must be one of the varibles on the input file:")
    10121012         print("- "+var_input)
    10131013         print("be sure to have one comma berfore and after the variable")
     
    10241024   gsn_define_colormap(wks_ps,"rainbow+white")
    10251025
    1026    plot=new((/no_time*no_layer*no_var*2/),graphic)
     1026   plot=new((/no_time*no_layer*no_var/),graphic)
    10271027 
    10281028   page = 0
     
    10991099                 
    11001100                  if ( sort .eq. "time" ) then
    1101                      if ( data&z(lo) .eq. -1 ) then
    1102                         level = "-average"
     1101                     if ( data&z(lo) .eq. -1)then
     1102                        if (delta_z .EQ. -1) then
     1103                           level = "-average"
     1104                        else
     1105                           level = "=" + data&z(lo) + "m"
     1106                        end if
    11031107                     else
    11041108                        level = "=" + data&z(lo) + "m"
     
    11221126                 
    11231127                  if ( sort .eq. "layer" ) then
    1124                      if ( data&z(li) .eq. -1 ) then
    1125                         level = "-average"
     1128                     if (data&z(li) .eq. -1) then
     1129                        if (delta_z .EQ. -1) then
     1130                           level = "-average"
     1131                        else
     1132                           level = "=" + data&z(li) + "m"
     1133                        end if
    11261134                     else
    11271135                        level = "=" + data&z(li) + "m"
     
    12671275   ; merge plots onto one page
    12681276   ; ***************************************************
    1269 
     1277   
    12701278   if (vector .EQ. 1 .AND. plotvec .EQ. "plotvec")then
    12711279      if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then
     
    12911299      else
    12921300         do np = 0,no_layer*no_time*no_var-1,no_lines*no_columns   
    1293             if ( np + no_lines*no_columns .gt. (no_layer*no_time*no_var)-1) then 
     1301            if ( np + no_lines*no_columns .gt. (no_layer*no_time*no_var)-1) then
    12941302               gsn_panel(wks_ps, plot(np:(no_layer*no_time*no_var)-1),(/no_lines,no_columns/),cs_resP)
    12951303            else
  • palm/trunk/SCRIPTS/NCL/ncl_preferences.ncl

    r190 r194  
    11begin
    22
    3 ;*********************************************************
    4 ; Please specify the used script by setting it to 1:
    53;*********************************************************
    6  
    7    cross_sections = 0
    8    profiles       = 0
    9    timeseries     = 0
    10    spectra        = 0
     4
     5script=which_script
    116   
    127;*********************************************************
    13 
     8   
    149   ;******************************************************
    1510   ; parameters used by CROSS_SECTIONS
    1611   ;******************************************************
    1712   
    18    if (cross_sections .EQ. 1)then
     13   if (script .EQ. "cross_section")then
    1914   
    2015      ;***************************************************
     
    2823      ;***************************************************
    2924      if(.not. isvar("file_1"))then
    30      
    31      
     25
     26
    3227         file_1 = "File in"
    3328         
    34      
     29       
    3530      end if
    3631      ;***************************************************
     
    8176      ; data type: string
    8277      ;
    83       ; default:   "~/test"
     78      ; default:   "~/test_cs"
    8479      ;***************************************************
    8580      if(.not. isvar("file_out"))then   
     
    264259      ; OPTIONAL --zs-- MINIMUM Z-AXIS
    265260      ;
    266       ; value for minimum of z-axis, selectable if there are NO preseted layers for z (as for XZ or YZ 2D-DATA);
    267       ; you don't have to specify a precise meter value from the input file, it will be rounded to the next
    268       ; existent value
     261      ; index for minimum of z-axis, selectable if there are NO preseted layers for z (as for XZ or YZ 2D-DATA);
     262      ; you cannot specify a meter value from the input file due to grid stretching 
    269263      ;
    270264      ; data type: integer
     
    282276      ; OPTIONAL --ze-- MAXIMUM Z-AXIS
    283277      ;
    284       ; value for maximum of z-axis, selectable if there are NO preseted layers for z (as for XZ or YZ 2D-DATA);
    285       ; you don't have to specify a precise meter value from the input file, it will be rounded to the next
    286       ; existent value
     278      ; index for maximum of z-axis, selectable if there are NO preseted layers for z (as for XZ or YZ 2D-DATA);
     279      ; you cannot specify a meter value from the input file due to grid stretching 
    287280      ;
    288281      ; data type: integer
     
    417410      end if             
    418411      ;***************************************************
    419      
     412
    420413   end if
    421414
     
    424417   ;******************************************************
    425418   
    426    if (profiles .EQ. 1)then
    427    
     419   if (script .EQ. "profiles")then
     420
    428421      ;***************************************************
    429422      ; REQUIRED --file_1-- INPUT FILE
     
    481474      ; data type: string
    482475      ;
    483       ; default:   "~/test"
     476      ; default:   "~/test_pr"
    484477      ;***************************************************
    485478      if (.not. isvar("file_out"))then 
     
    11571150       
    11581151   end if
    1159    
     1152
    11601153   ;******************************************************
    11611154   ; parameters used by SPECTRA
    11621155   ;******************************************************
    11631156   
    1164    if (spectra .EQ. 1) then
    1165    
     1157   if (script .EQ. "spectra") then
     1158
    11661159      ;***************************************************
    11671160      ; REQUIRED --file_1-- INPUT FILE
     
    12031196      ; data type: string
    12041197      ;
    1205       ; default:   "~/test"
     1198      ; default:   "~/test_sp"
    12061199      ;***************************************************
    12071200      if (.not. isvar("file_out"))then 
     
    14281421     
    14291422   end if
    1430    
    1431    
     1423
    14321424   ;******************************************************
    14331425   ; parameters used by TIMESERIES
    14341426   ;******************************************************
    14351427
    1436    if (timeseries .EQ. 1) then
    1437    
     1428   if (script .EQ. "timeseries") then
     1429
    14381430      ;***************************************************
    14391431      ; REQUIRED --file_1-- INPUT FILE
     
    14751467      ; data type: string
    14761468      ;
    1477       ; default:   "~/test"
     1469      ; default:   "~/test_ts"
    14781470      ;***************************************************
    14791471      if (.not. isvar("file_out"))then 
     
    15871579
    15881580   end if
    1589 
    15901581         
    15911582;*********************************************************       
  • palm/trunk/SCRIPTS/NCL/profiles.ncl

    r190 r194  
    66; load ncl_preferences.ncl
    77;***************************************************
     8
     9function which_script()
     10local script
     11begin
     12   script="profiles"
     13   return(script)
     14end
    815   
    916if (isfilepresent("~/ncl_preferences.ncl")) then
     
    2229begin
    2330
    24    if (cross_sections .NE. 0 .OR. profiles .NE. 1 .OR. timeseries .NE. 0 .OR. spectra .NE. 0)then
    25       print(" ")
    26       print("Please specify the used script in 'ncl_preferences.ncl' (Line 7-10)")
    27       print(" ")
    28       print("Set 'profiles' equal 1 and the other variables equal 0")
    29       print(" ")
    30       exit
    31    end if
    32  
    3331   ;***************************************************
    3432   ; set up default parameter values and strings
  • palm/trunk/SCRIPTS/NCL/spectra.ncl

    r190 r194  
    66; load ncl_preferences.ncl
    77;***************************************************
     8
     9function which_script()
     10local script
     11begin
     12   script="spectra"
     13   return(script)
     14end
    815   
    916if (isfilepresent("~/ncl_preferences.ncl")) then
     
    2128   
    2229begin
    23      
    24    if (cross_sections .NE. 0 .OR. profiles .NE. 0 .OR. timeseries .NE. 0 .OR. spectra .NE. 1)then
    25       print(" ")
    26       print("Please specify the used script in 'ncl_preferences.ncl' (Line 7-10)")
    27       print(" ")
    28       print("Set 'spectra' equal 1 and the other variables equal 0")
    29       print(" ")
    30       exit
    31    end if
    3230
    3331   ;***************************************************
     
    339337      end do
    340338   end if
    341    
    342    step=round(235/(np-1),3)
    343    if (black .eq. 0 ) then 
    344       res@xyLineColors = ispan(2,237,step)
     339
     340   if (black .eq. 0 ) then
     341      if (np .EQ. 1)then
     342         res@xyLineColors = 237
     343      else   
     344         step=round(235/(np-1),3)
     345         res@xyLineColors = ispan(2,237,step)
     346      end if
    345347   end if
    346348   if ( dash .eq. 0 ) then
  • palm/trunk/SCRIPTS/NCL/timeseries.ncl

    r190 r194  
    1 6load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl"
     1load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl"
    22load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
    33load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
     
    77; load ncl_preferences.ncl
    88;***************************************************
     9
     10function which_script()
     11local script
     12begin
     13   script="timeseries"
     14   return(script)
     15end
    916   
    1017if (isfilepresent("~/ncl_preferences.ncl")) then
     
    2229   
    2330begin
    24      
    25    if (cross_sections .NE. 0 .OR. profiles .NE. 0 .OR. timeseries .NE. 1 .OR. spectra .NE. 0)then
    26       print(" ")
    27       print("Please specify the used script in 'ncl_preferences.ncl' (Line 7-10)")
    28       print(" ")
    29       print("Set 'timeseries' equal 1 and the other variables equal 0")
    30       print(" ")
    31       exit
    32    end if
    3331
    3432   ;***************************************************
Note: See TracChangeset for help on using the changeset viewer.