Ignore:
Timestamp:
Mar 30, 2010 2:04:38 PM (14 years ago)
Author:
heinze
Message:

Adjustment of the NCL scripts and palmplot to allow for the use of special characters in NetCDF variable names

File:
1 edited

Legend:

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

    r418 r526  
    3333   
    3434begin
     35
     36   ;***************************************************
     37   ; Retrieving the double quote character
     38   ;***************************************************
     39   
     40   dq=str_get_dq()
    3541
    3642   ;***************************************************
     
    344350      plot_pt_0_   = gsn_csm_xy(wks_ps,t,data_0(:),res)
    345351      plot_pt_zp_  = gsn_csm_xy(wks_ps,t,data_0(:),res)
    346       plot_splptx  = gsn_csm_xy(wks_ps,t,data_0(:),res)
    347       plot_splpty  = gsn_csm_xy(wks_ps,t,data_0(:),res)
    348       plot_splptz  = gsn_csm_xy(wks_ps,t,data_0(:),res)
    349352   end if
    350353
     
    435438            maxi(varn) = max(data(varn,:))
    436439           
    437             if (vNam(varn) .EQ. "E" .OR. vNam(varn) .EQ. "Es") then
     440            if (vNam(varn) .EQ. "E" .OR. vNam(varn) .EQ. "Es" .OR. vNam(varn) .EQ. "E*") then
    438441               if (mini(varn) .EQ. maxi(varn)) then
    439442                  if (min(data(varn,:)) .EQ. 0)then
     
    454457            end if
    455458
    456             if (vNam(varn) .EQ. "us" .OR. vNam(varn) .EQ. "ws") then
     459            if (vNam(varn) .EQ. "us" .OR. vNam(varn) .EQ. "ws"\
     460                .OR. vNam(varn) .EQ. "u*" .OR. vNam(varn) .EQ. "w*") then
    457461               if (mini(varn) .EQ. maxi(varn)) then
    458462                  if (min(data(varn,:)) .EQ. 0)then
     
    511515            end if
    512516
    513             if (vNam(varn) .EQ. "wpptp0" .OR. vNam(varn) .EQ. "wpptp" .OR. vNam(varn) .EQ. "wpt") then
     517            if (vNam(varn) .EQ. "wpptp0" .OR. vNam(varn) .EQ. "wpptp" .OR. vNam(varn) .EQ. "wpt"\
     518               .OR. vNam(varn) .EQ. "w"+dq+"pt"+dq+"0" .OR. vNam(varn) .EQ. "w"+dq+"pt"+dq ) then
    514519               if (mini(varn) .EQ. maxi(varn)) then
    515520                  if (min(data(varn,:)) .EQ. 0)then
     
    530535            end if
    531536
    532             if (vNam(varn) .EQ. "pt_0_" .OR. vNam(varn) .EQ. "pt_zp_") then
     537            if (vNam(varn) .EQ. "pt_0_" .OR. vNam(varn) .EQ. "pt_zp_"\
     538               .OR. vNam(varn) .EQ. "pt(0)" .OR. vNam(varn) .EQ. "pt(zp)") then
    533539               if (mini(varn) .EQ. maxi(varn)) then
    534540                  if (min(data(varn,:)) .EQ. 0)then
     
    547553               minp=min((/minp,mini(varn)/))
    548554               maxp=max((/maxp,maxi(varn)/))
    549             end if
    550 
    551             if (vNam(varn) .EQ. "splptx" .OR. vNam(varn) .EQ. "splpty" .OR. vNam(varn) .EQ. "splptz") then
    552                if (mini(varn) .EQ. maxi(varn)) then
    553                   if (min(data(varn,:)) .EQ. 0)then
    554                      mini(varn)= mini(varn)-0.1
    555                      maxi(varn)= maxi(varn)+0.1
    556                   end if
    557                   if (min(data(varn,:)) .LT. 0)then
    558                      mini(varn)= mini(varn)-1.+(mini(varn))/2
    559                      maxi(varn)= maxi(varn)+1.-(maxi(varn))/2
    560                   end if
    561                   if (min(data(varn,:)) .GT. 0)then
    562                      mini(varn)= mini(varn)-1.-(mini(varn))/2
    563                      maxi(varn)= maxi(varn)+1.+(maxi(varn))/2
    564                   end if
    565                end if
    566                mins=min((/mins,mini(varn)/))
    567                maxs=max((/maxs,maxi(varn)/))
    568555            end if
    569556           
     
    617604               plot_E = gsn_csm_xy(wks_ps,t,data(varn,:),res)
    618605            end if
    619             if (vNam(varn) .EQ. "Es")
     606            if (vNam(varn) .EQ. "Es" .OR. vNam(varn) .EQ. "E*")
    620607               Es=0
    621608               res@xyLineColors            = (/144/)
     
    625612            end if
    626613             
    627             if (vNam(varn) .EQ. "us")
     614            if (vNam(varn) .EQ. "us" .OR. vNam(varn) .EQ. "u*")
    628615               us=0
    629616               res@xyLineColors            = (/237/)
     
    634621               plot_us = gsn_csm_xy(wks_ps,t,data(varn,:),res)
    635622            end if             
    636             if (vNam(varn) .EQ. "ws")
     623            if (vNam(varn) .EQ. "ws" .OR. vNam(varn) .EQ. "w*")
    637624               ws=0
    638625               res@xyLineColors            = (/144/)
     
    683670            end if
    684671
    685             if (vNam(varn) .EQ. "wpptp0")
     672            if (vNam(varn) .EQ. "wpptp0" .OR. vNam(varn) .EQ. "w"+dq+"pt"+dq+"0" )
    686673               w0=0
    687674               res@xyLineColors            = (/237/)
     
    692679               plot_wpptp0 = gsn_csm_xy(wks_ps,t,data(varn,:),res)
    693680            end if
    694             if (vNam(varn) .EQ. "wpptp")
     681            if (vNam(varn) .EQ. "wpptp" .OR. vNam(varn) .EQ. "w"+dq+"pt"+dq)
    695682               wp=0
    696683               res@xyLineColors            = (/144/)
     
    707694            end if
    708695
    709             if (vNam(varn) .EQ. "pt_0_")
     696            if (vNam(varn) .EQ. "pt_0_" .OR. vNam(varn) .EQ. "pt(0)")
    710697               p=0
    711698               res@xyLineColors            = (/237/)
     
    716703               plot_pt_0_ = gsn_csm_xy(wks_ps,t,data(varn,:),res) 
    717704            end if
    718             if (vNam(varn) .EQ. "pt_zp_")
     705            if (vNam(varn) .EQ. "pt_zp_" .OR. vNam(varn) .EQ. "pt(zp)")
    719706               pz=0
    720707               res@xyLineColors            = (/144/)
     
    722709               res@xyLineLabelFontColor   = 144
    723710               plot_pt_zp_ = gsn_csm_xy(wks_ps,t,data(varn,:),res)
    724             end if
    725 
    726             if (vNam(varn) .EQ. "splptx")
    727                x=0
    728                res@xyLineColors            = (/237/)
    729                res@xyLineLabelFontHeightF = 0.05
    730                res@xyLineLabelFontColor   = 237
    731                res@trYMaxF           = maxs
    732                res@trYMinF           = mins
    733                plot_splptx = gsn_csm_xy(wks_ps,t,data(varn,:),res)   
    734             end if
    735             if (vNam(varn) .EQ. "splpty")
    736                y=0
    737                res@xyLineColors            = (/144/)
    738                res@xyLineLabelFontHeightF = 0.05
    739                res@xyLineLabelFontColor   = 144
    740                plot_splpty = gsn_csm_xy(wks_ps,t,data(varn,:),res)
    741             end if
    742             if (vNam(varn) .EQ. "splptz")
    743                z=0
    744                res@xyLineColors            = (/80/)
    745                res@xyLineLabelFontHeightF = 0.05
    746                res@xyLineLabelFontColor   = 80
    747                plot_splptz = gsn_csm_xy(wks_ps,t,data(varn,:),res)         
    748711            end if
    749712
     
    787750               lgres@lgDashIndexes      = (/0,0,0/)
    788751               lgres@lgLineColors       = (/237,144,80/)
    789                lbid = gsn_create_legend(wks_ps,2,(/"E","Es"/),lgres)       
     752               lbid = gsn_create_legend(wks_ps,2,(/"E","E*"/),lgres)       
    790753
    791754               amres = True
     
    794757               annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)           
    795758            end if
    796             if (vNam(varn) .EQ. "Es" .AND. E .NE. 1) then
     759            if ((vNam(varn) .EQ. "Es" .OR. vNam(varn) .EQ. "E*") .AND. E .NE. 1) then
    797760               Es=1
    798761               overlay(plot_E,plot_Es)
     
    812775               lgres@lgDashIndexes      = (/0,0,0/)
    813776               lgres@lgLineColors       = (/237,144,80/)
    814                lbid = gsn_create_legend(wks_ps,2,(/"E","Es"/),lgres)       
     777               lbid = gsn_create_legend(wks_ps,2,(/"E","E*"/),lgres)       
    815778
    816779               amres = True
     
    820783            end if
    821784
    822             if (vNam(varn) .EQ. "us" .AND. ws .NE. 1) then
     785            if ((vNam(varn) .EQ. "us" .OR. vNam(varn) .EQ. "u*") .AND. ws .NE. 1) then
    823786               us=1
    824787               overlay(plot_us,plot_ws)
     
    838801               lgres@lgDashIndexes      = (/0,0,0/)
    839802               lgres@lgLineColors       = (/237,144,80/)
    840                lbid = gsn_create_legend(wks_ps,2,(/"us","ws"/),lgres)       
     803               lbid = gsn_create_legend(wks_ps,2,(/"u*","w*"/),lgres)       
    841804
    842805               amres = True
     
    845808               annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)
    846809            end if
    847             if (vNam(varn) .EQ. "ws" .AND. us .NE. 1) then
     810            if ((vNam(varn) .EQ. "ws" .OR. vNam(varn) .EQ. "w*") .AND. us .NE. 1) then
    848811               ws=1
    849812               overlay(plot_us,plot_ws)
     
    863826               lgres@lgDashIndexes      = (/0,0,0/)
    864827               lgres@lgLineColors       = (/237,144,80/)
    865                lbid = gsn_create_legend(wks_ps,2,(/"us","ws"/),lgres)       
     828               lbid = gsn_create_legend(wks_ps,2,(/"u*","w*"/),lgres)       
    866829
    867830               amres = True
     
    1008971            end if   
    1009972         
    1010             if (vNam(varn) .EQ. "wpptp0" .AND. wp .NE. 1)
     973            if ((vNam(varn) .EQ. "wpptp0" .OR. vNam(varn) .EQ. "w"+dq+"pt"+dq+"0") .AND. wp .NE. 1)
    1011974               if (wt .NE. 1) then
    1012975                  w0=1
     
    1036999               end if           
    10371000            end if
    1038             if (vNam(varn) .EQ. "wpptp" .AND. w0 .NE. 1)
     1001            if ((vNam(varn) .EQ. "wpptp" .OR. vNam(varn) .EQ. "w"+dq+"pt"+dq) .AND. w0 .NE. 1)
    10391002               if (wt .NE. 1) then
    10401003                 wp=1
     
    10931056            end if
    10941057
    1095             if (vNam(varn) .EQ. "pt_0_" .AND. pz .NE. 1) then
     1058            if ((vNam(varn) .EQ. "pt_0_" .OR. vNam(varn) .EQ. "pt(0)") .AND. pz .NE. 1) then
    10961059               p=1     
    10971060               overlay(plot_pt_0_,plot_pt_zp_)
     
    11181081               annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)
    11191082            end if
    1120             if (vNam(varn) .EQ. "pt_zp_" .AND. p .NE. 1) then
     1083            if ((vNam(varn) .EQ. "pt_zp_" .OR. vNam(varn) .EQ. "pt(zp)") .AND. p .NE. 1) then
    11211084               pz=1       
    11221085               overlay(plot_pt_0_,plot_pt_zp_)
     
    11431106               annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)
    11441107            end if
    1145            
    1146             if (vNam(varn) .EQ. "splptx" .AND. y .NE. 1)
    1147                if (z .NE.1 ) then
    1148                   x=1     
    1149                   overlay(plot_splptx,plot_splpty)
    1150                   overlay(plot_splptx,plot_splptz)
    1151                   n=n+1
    1152                   plot_ps(n) = plot_splptx   
    1153 
    1154                   ; ***************************************************
    1155                   ; legend for combined plot
    1156                   ; ***************************************************
    1157      
    1158                   lgres                    = True
    1159                   lgMonoDashIndex          = False
    1160                   lgres@lgLabelFont        = "helvetica"   
    1161                   lgres@lgLabelFontHeightF = .1           
    1162                   lgres@vpWidthF           = 0.4           
    1163                   lgres@vpHeightF          = 0.4         
    1164                   lgres@lgDashIndexes      = (/0,0,0/)
    1165                   lgres@lgLineColors       = (/237,144,80/)
    1166                   lbid = gsn_create_legend(wks_ps,3,(/"splptx","splpty","splptz"/),lgres)       
    1167 
    1168                   amres = True
    1169                   amres@amParallelPosF   = 0.6             
    1170                   amres@amOrthogonalPosF = -0.2           
    1171                   annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)
    1172                end if
    1173             end if
    1174             if (vNam(varn) .EQ. "splpty" .AND. x .NE. 1)
    1175                if(z .NE.1 ) then
    1176                   y=1         
    1177                   overlay(plot_splptx,plot_splpty)
    1178                   overlay(plot_splptx,plot_splptz)
    1179                   n=n+1
    1180                   plot_ps(n) = plot_splptx
    1181 
    1182                   ; ***************************************************
    1183                   ; legend for combined plot
    1184                   ; ***************************************************
    1185      
    1186                   lgres                    = True
    1187                   lgMonoDashIndex          = False
    1188                   lgres@lgLabelFont        = "helvetica"   
    1189                   lgres@lgLabelFontHeightF = .1           
    1190                   lgres@vpWidthF           = 0.4           
    1191                   lgres@vpHeightF          = 0.4         
    1192                   lgres@lgDashIndexes      = (/0,0,0/)
    1193                   lgres@lgLineColors       = (/237,144,80/)
    1194                   lbid = gsn_create_legend(wks_ps,3,(/"splptx","splpty","splptz"/),lgres)       
    1195 
    1196                   amres = True
    1197                   amres@amParallelPosF   = 0.6             
    1198                   amres@amOrthogonalPosF = -0.2           
    1199                   annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)
    1200                end if           
    1201             end if
    1202             if (vNam(varn) .EQ. "splptz" .AND. y .NE. 1)
    1203                if(x .NE.1 ) then
    1204                   z=1         
    1205                   overlay(plot_splptx,plot_splpty)
    1206                   overlay(plot_splptx,plot_splptz)
    1207                   n=n+1
    1208                   plot_ps(n) = plot_splptx 
    1209 
    1210                   ; ***************************************************
    1211                   ; legend for combined plot
    1212                   ; ***************************************************
    1213      
    1214                   lgres                    = True
    1215                   lgMonoDashIndex          = False
    1216                   lgres@lgLabelFont        = "helvetica"   
    1217                   lgres@lgLabelFontHeightF = .1           
    1218                   lgres@vpWidthF           = 0.4           
    1219                   lgres@vpHeightF          = 0.4         
    1220                   lgres@lgDashIndexes      = (/0,0,0/)
    1221                   lgres@lgLineColors       = (/237,144,80/)
    1222                   lbid = gsn_create_legend(wks_ps,3,(/"splptx","splpty","splptz"/),lgres)       
    1223 
    1224                   amres = True
    1225                   amres@amParallelPosF   = 0.6             
    1226                   amres@amOrthogonalPosF = -0.2           
    1227                   annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres)
    1228                end if       
    1229             end if
    1230 
    1231             if(vNam(varn) .NE. "splptz" .AND. vNam(varn) .NE. "splpty" .AND. vNam(varn) .NE. "splptx" .AND. vNam(varn) .NE. "pt_zp_" .AND. vNam(varn) .NE. "pt_0_" .AND. vNam(varn) .NE. "wpt" .AND. vNam(varn) .NE. "wpptp" .AND. vNam(varn) .NE. "wpptp0" .AND. vNam(varn) .NE. "z_i_pt" .AND. vNam(varn) .NE. "z_i_wpt" .AND. vNam(varn) .NE. "wmax" .AND. vNam(varn) .NE. "vmax" .AND. vNam(varn) .NE. "umax" .AND. vNam(varn) .NE. "ws" .AND.  vNam(varn) .NE. "us" .AND. vNam(varn) .NE. "Es" .AND. vNam(varn) .NE. "E") then
     1108
     1109            if(vNam(varn) .NE. "pt_zp_" .AND. vNam(varn) .NE. "pt(zp)" .AND. \
     1110               vNam(varn) .NE. "pt_0_" .AND. vNam(varn) .NE. "pt(0)" .AND. \
     1111               vNam(varn) .NE. "wpt" .AND. vNam(varn) .NE. "wpptp" .AND. \
     1112               vNam(varn) .NE. "w"+dq+"pt"+dq .AND. vNam(varn) .NE. "wpptp0" .AND. \
     1113               vNam(varn) .NE. "w"+dq+"pt"+dq+"0" .AND. vNam(varn) .NE. "z_i_pt" .AND.\
     1114               vNam(varn) .NE. "z_i_wpt" .AND. vNam(varn) .NE. "wmax" .AND. \
     1115               vNam(varn) .NE. "vmax" .AND. vNam(varn) .NE. "umax" .AND. \
     1116               vNam(varn) .NE. "ws" .AND. vNam(varn) .NE. "w*" .AND.  \
     1117               vNam(varn) .NE. "us" .AND. vNam(varn) .NE. "u*" .AND. \
     1118               vNam(varn) .NE. "Es" .AND. vNam(varn) .NE. "E*" .AND. \
     1119               vNam(varn) .NE. "E") then
     1120
    12321121               n=n+1
    12331122               res@xyLineColors   = (/237/)
Note: See TracChangeset for help on using the changeset viewer.