load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" begin ; *************************************************** ; read parameter_list ; *************************************************** if (isfilepresent("~/.ncl_preferences")) then parameter = asciiread("~/.ncl_preferences",129,"string") delete(parameter@_FillValue) else if (isfilepresent("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences")) then parameter = asciiread("~/palm/current_version/trunk/SRIPTS/NCL/.ncl_preferences",129,"string") delete(parameter@_FillValue) else print(" ") print("'.ncl_preferences' is not present in '~/palm/current_version/trunk/SRIPTS/NCL/'") print(" ") exit end if end if ; *************************************************** ; set up default parameter values and strings if not assigned in prompt or parameter list ; *************************************************** if ( .not. isvar("file_1") ) then if (parameter(7) .EQ. "File in") then print(" ") print("Please provide 1st input file 'file_1=' either in prompt or parameter_list") print(" ") exit else file_in = parameter(7) end if else file_in = file_1 end if if (.not. isfilepresent(file_in)) then print(" ") print("Your 1st input file: '"+file_in+"' does not exist") print(" ") exit end if if ( .not. isvar("format_out") ) then format_out = "x11" if (parameter(9) .NE. "x11") then format_out = parameter(9) if (format_out .NE. "x11" .AND. format_out .NE. "pdf" .AND. format_out .NE. "eps" .AND. format_out .NE. "ps" .AND. format_out .NE. "epsi" .AND. format_out .NE. "ncgm")then print(" ") print("Your 'format_out = "+format_out+"' is invalid and set to'x11'") print(" ") end if end if else if (format_out .NE. "x11" .AND. format_out .NE. "pdf" .AND. format_out .NE. "eps" .AND. format_out .NE. "ps" .AND. format_out .NE. "epsi" .AND. format_out .NE. "ncgm")then print(" ") print("Your 'format_out = "+format_out+"' is invalid and set to'x11'") print(" ") end if end if if ( .not. isvar("file_out") ) then ; path+name of output file file_out = "test" if (parameter(11) .NE. "test") then file_out = parameter(11) end if end if if ( .not. isvar("no_columns") ) then ; number of plots in one row no_columns = 1 if (parameter(17) .NE. "1") then no_columns = stringtointeger(parameter(17)) end if end if if ( .not. isvar("no_lines") ) then ; number of plot-lines on one sheet no_lines = 2 if (parameter(19) .NE. "2") then no_lines = stringtointeger(parameter(19)) end if end if if ( .not. isvar("var") ) then ; variable name check = True end if if ( .not. isvar("over") ) then ; switches overlaying plots on over = 0 if (stringtointeger(parameter(37)) .NE. 0) then over = stringtointeger(parameter(37)) if (stringtointeger(parameter(37)) .NE. 1) then print(" ") print("Your 'over'= "+over+" is invalid and set to 0") print(" ") over = 0 end if end if else if (over .NE. 0 .AND. over .NE. 1)then print(" ") print("Your 'over'= "+over+" is invalid and set to 0") print(" ") over = 0 end if end if ; *************************************************** ; open input file ; *************************************************** f = addfile(file_in , "r" ) vNam = getfilevarnames(f) print(" ") print("Variable on netCDF file: " + vNam) print(" ") dim = dimsizes(vNam) if (dim .EQ. 0) then print(" ") print("There are no data on file") print(" ") end if t_all = f->time nt = dimsizes(t_all) delta_t=t_all(nt-1)/nt ; **************************************************** ; start of time step and different types of mistakes that could be done ; **************************************************** if ( .not. isvar("start_time_step") ) then start_time_step=t_all(0)/3600 if (parameter(13) .NE. "t(0)") then if (stringtodouble(parameter(13)) .GE. t_all(nt-1)/3600) print(" ") print("'start_time_step' = "+ parameter(13) +"h is equal or greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h") print(" ") print("Please select another 'start_time_step'") print(" ") exit end if if (stringtofloat(parameter(13)) .LT. t_all(0)/3600) print(" ") print("'start_time_step' = "+ parameter(13) +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h") print(" ") print("Please select another 'start_time_step'") print(" ") exit end if start_time_step=stringtodouble(parameter(13)) end if else if (start_time_step .GE. t_all(nt-1)/3600) print(" ") print("'start_time_step' = "+ start_time_step +"h is equal or greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h") print(" ") print("Please select another 'start_time_step'") print(" ") exit end if if (start_time_step .LT. t_all(0)/3600) print(" ") print("'start_time_step' = "+ start_time_step +"h is lower than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h") print(" ") print("Please select another 'start_time_step'") print(" ") exit end if end if start_time_step = start_time_step*3600 do i=0,nt-2 if (start_time_step .GE. t_all(i)-delta_t/2 .AND. start_time_step .LT. t_all(i)+delta_t/2)then st=i break end if end do if (start_time_step .GE. t_all(nt-1)-delta_t/2 .AND. start_time_step .LT. t_all(nt-1)) then st=nt-2 end if ; **************************************************** ; end of time step and different types of mistakes that could be done ; **************************************************** if ( .not. isvar("end_time_step") ) then end_time_step = t_all(nt-1)/3600 if (parameter(15) .NE. "t(end)") then if (stringtodouble(parameter(15)) .LE. t_all(0)/3600) print(" ") print("'end_time_step' = "+parameter(15)+ "h is lower or equal than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h") print(" ") print("Please select another 'end_time_step'") print(" ") exit end if if (stringtodouble(parameter(15)) .GT. t_all(nt-1)/3600) print(" ") print("'end_time_step' = "+ parameter(15) +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h") print(" ") print("Please select another 'end_time_step'") print(" ") exit end if if (stringtodouble(parameter(15)) .LE. start_time_step/3600) print(" ") print("'end_time_step' = "+ parameter(15) +"h is equal or lower than 'start_time_step' = "+parameter(13)+"h") print(" ") print("Please select another 'start_time_step' or 'end_time_step'") print(" ") exit end if end_time_step = stringtodouble(parameter(15)) end if else if (end_time_step .LE. t_all(0)/3600) print(" ") print("'end_time_step' = "+end_time_step+ "h is lower or equal than first time step = " + t_all(0)+"s = "+t_all(0)/3600+"h") print(" ") print("Please select another 'end_time_step'") print(" ") exit end if if (end_time_step .GT. t_all(nt-1)/3600) print(" ") print("'end_time_step' = "+ end_time_step +"h is greater than last time step = " + t_all(nt-1)+"s = "+t_all(nt-1)/3600+"h") print(" ") print("Please select another 'end_time_step'") print(" ") exit end if if (end_time_step .LE. start_time_step/3600) print(" ") print("'end_time_step' = "+ end_time_step +"h is equal or lower than 'start_time_step' = "+start_time_step+"h") print(" ") print("Please select another 'start_time_step' or 'end_time_step'") print(" ") exit end if end if end_time_step = end_time_step*3600 do i=0,nt-1 if (end_time_step .GE. t_all(i)-delta_t/2 .AND. end_time_step .LT. t_all(i)+delta_t/2)then et=i break end if end do delete(start_time_step) start_time_step=round(st,3) delete(end_time_step) end_time_step=round(et,3) print(" ") print("Output of time steps from "+t_all(start_time_step)/3600+" h = "+t_all(start_time_step)+" s => index = "+start_time_step) print(" till "+t_all(end_time_step)/3600+" h = "+t_all(end_time_step)+" s => index = "+end_time_step) print(" ") t = f->time(start_time_step:end_time_step) ; *************************************************** ; set up recourses ; *************************************************** res = True res@gsnDraw = False res@gsnFrame = False res@gsnPaperOrientation = "portrait" res@gsnPaperWidth = 8.27 res@gsnPaperHeight = 11.69 res@gsnPaperMargin = 0.79 res@tmXBMode = True res@tmYLMode = True res@txFont = "helvetica" res@tiMainFont = "helvetica" res@tiXAxisFont = "helvetica" res@tiYAxisFont = "helvetica" res@tmXBLabelFont = "helvetica" res@tmYLLabelFont = "helvetica" res@xyLineColors = (/237/) res@lgLabelFontHeightF = .02 resP = True resP@txFont = "helvetica" resP@txString = f@title+" time series " resP@txFuncCode = "~" resP@txFontHeightF = 0.015 res@vpWidthF=4 txres = True ; *************************************************** ; read data and create plots ; *************************************************** wks_ps = gsn_open_wks(format_out,file_out) gsn_define_colormap(wks_ps,"rainbow+white") plot_ps=new(dim,graphic) n=0 minE=1.E27 maxE=-1.E27 minus=1.E27 maxus=-1.E27 minu=1.E27 maxu=-1.E27 minz=1.E27 maxz=-1.E27 minw=1.E27 maxw=-1.E27 minp=1.E27 maxp=-1.E27 mins=1.E27 maxs=-1.E27 data = new((/dim,(end_time_step-start_time_step)+1/),float) unit = new(dim,string) data_0 = new((end_time_step-start_time_step)+1,float) data_0 = 0.0 mini = new(dim,float) maxi = new(dim,float) if (over .EQ. 1) then plot_E = gsn_csm_xy(wks_ps,t,data_0(:),res) plot_Es = gsn_csm_xy(wks_ps,t,data_0(:),res) plot_us = gsn_csm_xy(wks_ps,t,data_0(:),res) plot_ws = gsn_csm_xy(wks_ps,t,data_0(:),res) plot_umax = gsn_csm_xy(wks_ps,t,data_0(:),res) plot_vmax = gsn_csm_xy(wks_ps,t,data_0(:),res) plot_wmax = gsn_csm_xy(wks_ps,t,data_0(:),res) plot_z_i_wpt = gsn_csm_xy(wks_ps,t,data_0(:),res) plot_z_i_pt = gsn_csm_xy(wks_ps,t,data_0(:),res) plot_wpptp0 = gsn_csm_xy(wks_ps,t,data_0(:),res) plot_wpptp = gsn_csm_xy(wks_ps,t,data_0(:),res) plot_wpt = gsn_csm_xy(wks_ps,t,data_0(:),res) plot_pt_0_ = gsn_csm_xy(wks_ps,t,data_0(:),res) plot_pt_zp_ = gsn_csm_xy(wks_ps,t,data_0(:),res) plot_splptx = gsn_csm_xy(wks_ps,t,data_0(:),res) plot_splpty = gsn_csm_xy(wks_ps,t,data_0(:),res) plot_splptz = gsn_csm_xy(wks_ps,t,data_0(:),res) end if count_var=0 do varn = dim-1,0,1 if( isStrSubset (vNam(varn), "time") ) check = False else check = True end if if( isvar("var") ) then check = isStrSubset( var,","+vNam(varn)+"," ) end if if (parameter(21) .NE. "variables") then var = parameter(21) check = isStrSubset( var,","+vNam(varn)+"," ) end if if(check) then count_var=count_var+1 data_all = f ->$vNam(varn)$ unit(varn) = data_all@units data(varn,:)=data_all(start_time_step:end_time_step) if (over .EQ. 1) then mini(varn) = min(data(varn,:)) maxi(varn) = max(data(varn,:)) if (vNam(varn) .EQ. "E" .OR. vNam(varn) .EQ. "Es") then if (mini(varn) .EQ. maxi(varn)) then if (min(data(varn,:)) .EQ. 0)then mini(varn)= mini(varn)-1. maxi(varn)= maxi(varn)+1. end if if (min(data(varn,:)) .LT. 0)then mini(varn)= mini(varn)-1.+(mini(varn))/2 maxi(varn)= maxi(varn)+1.-(maxi(varn))/2 end if if (min(data(varn,:)) .GT. 0)then mini(varn)= mini(varn)-1.-(mini(varn))/2 maxi(varn)= maxi(varn)+1.+(maxi(varn))/2 end if end if minE=min((/minE,mini(varn)/)) maxE=max((/maxE,maxi(varn)/)) end if if (vNam(varn) .EQ. "us" .OR. vNam(varn) .EQ. "ws") then if (mini(varn) .EQ. maxi(varn)) then if (min(data(varn,:)) .EQ. 0)then mini(varn)= mini(varn)-1. maxi(varn)= maxi(varn)+1. end if if (min(data(varn,:)) .LT. 0)then mini(varn)= mini(varn)-1.+(mini(varn))/2 maxi(varn)= maxi(varn)+1.-(maxi(varn))/2 end if if (min(data(varn,:)) .GT. 0)then mini(varn)= mini(varn)-1.-(mini(varn))/2 maxi(varn)= maxi(varn)+1.+(maxi(varn))/2 end if end if minus=min((/minus,mini(varn)/)) maxus=max((/maxus,maxi(varn)/)) end if if (vNam(varn) .EQ. "umax" .OR. vNam(varn) .EQ. "vmax" .OR. vNam(varn) .EQ. "wmax") then if (mini(varn) .EQ. maxi(varn)) then if (mini(varn) .EQ. 0)then mini(varn)= mini(varn)-1. maxi(varn)= maxi(varn)+1. end if if (mini(varn) .LT. 0)then mini(varn)= mini(varn)-1.+(mini(varn))/2 maxi(varn)= maxi(varn)+1.-(maxi(varn))/2 end if if (mini(varn) .GT. 0)then mini(varn)= mini(varn)-1.-(mini(varn))/2 maxi(varn)= maxi(varn)+1.+(maxi(varn))/2 end if end if minu=min((/minu,mini(varn)/)) maxu=max((/maxu,maxi(varn)/)) end if if (vNam(varn) .EQ. "z_i_wpt" .OR. vNam(varn) .EQ. "z_i_pt") then if (mini(varn) .EQ. maxi(varn)) then if (min(data(varn,:)) .EQ. 0)then mini(varn)= mini(varn)-1. maxi(varn)= maxi(varn)+1. end if if (min(data(varn,:)) .LT. 0)then mini(varn)= mini(varn)-1.+(mini(varn))/2 maxi(varn)= maxi(varn)+1.-(maxi(varn))/2 end if if (min(data(varn,:)) .GT. 0)then mini(varn)= mini(varn)-1.-(mini(varn))/2 maxi(varn)= maxi(varn)+1.+(maxi(varn))/2 end if end if minz=min((/minz,mini(varn)/)) maxz=max((/maxz,maxi(varn)/)) end if if (vNam(varn) .EQ. "wpptp0" .OR. vNam(varn) .EQ. "wpptp" .OR. vNam(varn) .EQ. "wpt") then if (mini(varn) .EQ. maxi(varn)) then if (min(data(varn,:)) .EQ. 0)then mini(varn)= mini(varn)-1. maxi(varn)= maxi(varn)+1. end if if (min(data(varn,:)) .LT. 0)then mini(varn)= mini(varn)-1.+(mini(varn))/2 maxi(varn)= maxi(varn)+1.-(maxi(varn))/2 end if if (min(data(varn,:)) .GT. 0)then mini(varn)= mini(varn)-1.-(mini(varn))/2 maxi(varn)= maxi(varn)+1.+(maxi(varn))/2 end if end if minw=min((/minw,mini(varn)/)) maxw=max((/maxw,maxi(varn)/)) end if if (vNam(varn) .EQ. "pt_0_" .OR. vNam(varn) .EQ. "pt_zp_") then if (mini(varn) .EQ. maxi(varn)) then if (min(data(varn,:)) .EQ. 0)then mini(varn)= mini(varn)-1. maxi(varn)= maxi(varn)+1. end if if (min(data(varn,:)) .LT. 0)then mini(varn)= mini(varn)-1.+(mini(varn))/2 maxi(varn)= maxi(varn)+1.-(maxi(varn))/2 end if if (min(data(varn,:)) .GT. 0)then mini(varn)= mini(varn)-1.-(mini(varn))/2 maxi(varn)= maxi(varn)+1.+(maxi(varn))/2 end if end if minp=min((/minp,mini(varn)/)) maxp=max((/maxp,maxi(varn)/)) end if if (vNam(varn) .EQ. "splptx" .OR. vNam(varn) .EQ. "splpty" .OR. vNam(varn) .EQ. "splptz") then if (mini(varn) .EQ. maxi(varn)) then if (min(data(varn,:)) .EQ. 0)then mini(varn)= mini(varn)-1. maxi(varn)= maxi(varn)+1. end if if (min(data(varn,:)) .LT. 0)then mini(varn)= mini(varn)-1.+(mini(varn))/2 maxi(varn)= maxi(varn)+1.-(maxi(varn))/2 end if if (min(data(varn,:)) .GT. 0)then mini(varn)= mini(varn)-1.-(mini(varn))/2 maxi(varn)= maxi(varn)+1.+(maxi(varn))/2 end if end if mins=min((/mins,mini(varn)/)) maxs=max((/maxs,maxi(varn)/)) end if end if end if end do if (count_var .EQ. 0) then print(" ") print("The variables 'var=°"+var+"°' do not exist on your input file") print(" ") exit end if do varn = dim-1,0,1 if( isStrSubset (vNam(varn), "time") ) check = False else check = True end if if( isvar("var") ) then check = isStrSubset( var,","+vNam(varn)+"," ) end if if (parameter(21) .NE. "variables") then var = parameter(21) check = isStrSubset( var,","+vNam(varn)+"," ) end if if(check) then if (isStrSubset(vNam(varn),"_0" ))then print(" ") print("If you have Outputs of statistic regions you cannot overlay variables; 'over' is set to 0") print(" ") over = 0 end if if (over .EQ. 1) then res@gsnLeftString = "overlayed plot" res@gsnRightString = unit(varn) res@tiXAxisString = " time [s] " res@tiYAxisString = " " res@tiXAxisFontHeightF = 0.07 res@txFontHeightF = 0.07 res@tiYAxisFontHeightF = 0.07 if (vNam(varn) .EQ. "E") E=0 res@xyLineColors = (/237/) res@xyLineLabelFontHeightF = 0.05 res@xyLineLabelFontColor = 237 res@trYMaxF = minE res@trYMinF = maxE plot_E = gsn_csm_xy(wks_ps,t,data(varn,:),res) end if if (vNam(varn) .EQ. "Es") Es=0 res@xyLineColors = (/144/) res@xyLineLabelFontHeightF = 0.05 res@xyLineLabelFontColor = 144 plot_Es = gsn_csm_xy(wks_ps,t,data(varn,:),res) end if if (vNam(varn) .EQ. "us") us=0 res@xyLineColors = (/237/) res@xyLineLabelFontHeightF = 0.05 res@xyLineLabelFontColor = 237 res@trYMaxF = minus res@trYMinF = maxus plot_us = gsn_csm_xy(wks_ps,t,data(varn,:),res) end if if (vNam(varn) .EQ. "ws") ws=0 res@xyLineColors = (/144/) res@xyLineLabelFontHeightF = 0.05 res@xyLineLabelFontColor = 144 plot_ws = gsn_csm_xy(wks_ps,t,data(varn,:),res) end if if (vNam(varn) .EQ. "umax") u=0 res@xyLineColors = (/237/) res@xyLineLabelFontHeightF = 0.05 res@xyLineLabelFontColor = 237 res@trYMaxF = minu res@trYMinF = maxu plot_umax = gsn_csm_xy(wks_ps,t,data(varn,:),res) end if if (vNam(varn) .EQ. "vmax") v=0 res@xyLineColors = (/144/) res@xyLineLabelFontHeightF = 0.05 res@xyLineLabelFontColor = 144 plot_vmax = gsn_csm_xy(wks_ps,t,data(varn,:),res) end if if (vNam(varn) .EQ. "wmax") w=0 res@xyLineColors = (/80/) res@xyLineLabelFontHeightF = 0.05 res@xyLineLabelFontColor = 80 plot_wmax = gsn_csm_xy(wks_ps,t,data(varn,:),res) end if if (vNam(varn) .EQ. "z_i_wpt") zw=0 res@xyLineColors = (/237/) res@xyLineLabelFontHeightF = 0.05 res@xyLineLabelFontColor = 237 res@trYMaxF = minz res@trYMinF = maxz plot_z_i_wpt = gsn_csm_xy(wks_ps,t,data(varn,:),res) end if if (vNam(varn) .EQ. "z_i_pt") z=0 res@xyLineColors = (/144/) res@xyLineLabelFontHeightF = 0.05 res@xyLineLabelFontColor = 144 plot_z_i_pt = gsn_csm_xy(wks_ps,t,data(varn,:),res) end if if (vNam(varn) .EQ. "wpptp0") w0=0 res@xyLineColors = (/237/) res@xyLineLabelFontHeightF = 0.05 res@xyLineLabelFontColor = 237 res@trYMaxF = minw res@trYMinF = maxw plot_wpptp0 = gsn_csm_xy(wks_ps,t,data(varn,:),res) end if if (vNam(varn) .EQ. "wpptp") wp=0 res@xyLineColors = (/144/) res@xyLineLabelFontHeightF = 0.05 res@xyLineLabelFontColor = 144 plot_wpptp = gsn_csm_xy(wks_ps,t,data(varn,:),res) end if if (vNam(varn) .EQ. "wpt") wt=0 res@xyLineColors = (/80/) res@xyLineLabelFontHeightF = 0.05 res@xyLineLabelFontColor = 80 plot_wpt = gsn_csm_xy(wks_ps,t,data(varn,:),res) end if if (vNam(varn) .EQ. "pt_0_") p=0 res@xyLineColors = (/237/) res@xyLineLabelFontHeightF = 0.05 res@xyLineLabelFontColor = 237 res@trYMaxF = minp res@trYMinF = maxp plot_pt_0_ = gsn_csm_xy(wks_ps,t,data(varn,:),res) end if if (vNam(varn) .EQ. "pt_zp_") pz=0 res@xyLineColors = (/144/) res@xyLineLabelFontHeightF = 0.05 res@xyLineLabelFontColor = 144 plot_pt_zp_ = gsn_csm_xy(wks_ps,t,data(varn,:),res) end if if (vNam(varn) .EQ. "splptx") x=0 res@xyLineColors = (/237/) res@xyLineLabelFontHeightF = 0.05 res@xyLineLabelFontColor = 237 res@trYMaxF = mins res@trYMinF = maxs plot_splptx = gsn_csm_xy(wks_ps,t,data(varn,:),res) end if if (vNam(varn) .EQ. "splpty") y=0 res@xyLineColors = (/144/) res@xyLineLabelFontHeightF = 0.05 res@xyLineLabelFontColor = 144 plot_splpty = gsn_csm_xy(wks_ps,t,data(varn,:),res) end if if (vNam(varn) .EQ. "splptz") z=0 res@xyLineColors = (/80/) res@xyLineLabelFontHeightF = 0.05 res@xyLineLabelFontColor = 80 plot_splptz = gsn_csm_xy(wks_ps,t,data(varn,:),res) end if end if end if end do do varn = dim-1,0,1 if( isStrSubset (vNam(varn), "time") ) check = False else check = True end if if( isvar("var") ) then check = isStrSubset( var,","+vNam(varn)+"," ) end if if (parameter(21) .NE. "variables") then var = parameter(21) check = isStrSubset( var,","+vNam(varn)+"," ) end if if(check) then if (over .EQ. 1) then if (vNam(varn) .EQ. "E" .AND. Es .NE. 1) then E=1 overlay(plot_E,plot_Es) n=n+1 plot_ps(n) = plot_E ; *************************************************** ; legend for combined plot ; *************************************************** lgres = True lgMonoDashIndex = False lgres@lgLabelFont = "helvetica" lgres@lgLabelFontHeightF = .1 lgres@vpWidthF = 0.4 lgres@vpHeightF = 0.4 lgres@lgDashIndexes = (/0,0,0/) lgres@lgLineColors = (/237,144,80/) lbid = gsn_create_legend(wks_ps,2,(/"E","Es"/),lgres) amres = True amres@amParallelPosF = 0.6 amres@amOrthogonalPosF = -0.2 annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) end if if (vNam(varn) .EQ. "Es" .AND. E .NE. 1) then Es=1 overlay(plot_E,plot_Es) n=n+1 plot_ps(n) = plot_E ; *************************************************** ; legend for combined plot ; *************************************************** lgres = True lgMonoDashIndex = False lgres@lgLabelFont = "helvetica" lgres@lgLabelFontHeightF = .1 lgres@vpWidthF = 0.4 lgres@vpHeightF = 0.4 lgres@lgDashIndexes = (/0,0,0/) lgres@lgLineColors = (/237,144,80/) lbid = gsn_create_legend(wks_ps,2,(/"E","Es"/),lgres) amres = True amres@amParallelPosF = 0.6 amres@amOrthogonalPosF = -0.2 annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) end if if (vNam(varn) .EQ. "us" .AND. ws .NE. 1) then us=1 overlay(plot_us,plot_ws) n=n+1 plot_ps(n) = plot_us ; *************************************************** ; legend for combined plot ; *************************************************** lgres = True lgMonoDashIndex = False lgres@lgLabelFont = "helvetica" lgres@lgLabelFontHeightF = .1 lgres@vpWidthF = 0.4 lgres@vpHeightF = 0.4 lgres@lgDashIndexes = (/0,0,0/) lgres@lgLineColors = (/237,144,80/) lbid = gsn_create_legend(wks_ps,2,(/"us","ws"/),lgres) amres = True amres@amParallelPosF = 0.6 amres@amOrthogonalPosF = -0.2 annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) end if if (vNam(varn) .EQ. "ws" .AND. us .NE. 1) then ws=1 overlay(plot_us,plot_ws) n=n+1 plot_ps(n) = plot_us ; *************************************************** ; legend for combined plot ; *************************************************** lgres = True lgMonoDashIndex = False lgres@lgLabelFont = "helvetica" lgres@lgLabelFontHeightF = .1 lgres@vpWidthF = 0.4 lgres@vpHeightF = 0.4 lgres@lgDashIndexes = (/0,0,0/) lgres@lgLineColors = (/237,144,80/) lbid = gsn_create_legend(wks_ps,2,(/"us","ws"/),lgres) amres = True amres@amParallelPosF = 0.6 amres@amOrthogonalPosF = -0.2 annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) end if if (vNam(varn) .EQ. "umax" .AND. v .NE. 1) if (w .NE. 1) then u=1 overlay(plot_umax,plot_vmax) overlay(plot_umax,plot_wmax) n=n+1 plot_ps(n) = plot_umax ; *************************************************** ; legend for combined plot ; *************************************************** lgres = True lgMonoDashIndex = False lgres@lgLabelFont = "helvetica" lgres@lgLabelFontHeightF = .1 lgres@vpWidthF = 0.4 lgres@vpHeightF = 0.4 lgres@lgDashIndexes = (/0,0,0/) lgres@lgLineColors = (/237,144,80/) lbid = gsn_create_legend(wks_ps,3,(/"umax","vmax","wmax"/),lgres) amres = True amres@amParallelPosF = 0.6 amres@amOrthogonalPosF = -0.2 annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) end if end if if (vNam(varn) .EQ. "vmax" .AND. u .NE. 1) if (w .NE. 1) then v=1 overlay(plot_umax,plot_vmax) overlay(plot_umax,plot_wmax) n=n+1 plot_ps(n) = plot_umax ; *************************************************** ; legend for combined plot ; *************************************************** lgres = True lgMonoDashIndex = False lgres@lgLabelFont = "helvetica" lgres@lgLabelFontHeightF = .1 lgres@vpWidthF = 0.4 lgres@vpHeightF = 0.4 lgres@lgDashIndexes = (/0,0,0/) lgres@lgLineColors = (/237,144,80/) lbid = gsn_create_legend(wks_ps,3,(/"umax","vmax","wmax"/),lgres) amres = True amres@amParallelPosF = 0.6 amres@amOrthogonalPosF = -0.2 annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) end if end if if (vNam(varn) .EQ. "wmax" .AND. v .NE. 1) if(u .NE. 1) then w=1 overlay(plot_umax,plot_vmax) overlay(plot_umax,plot_wmax) n=n+1 plot_ps(n) = plot_umax ; *************************************************** ; legend for combined plot ; *************************************************** lgres = True lgMonoDashIndex = False lgres@lgLabelFont = "helvetica" lgres@lgLabelFontHeightF = .1 lgres@vpWidthF = 0.4 lgres@vpHeightF = 0.4 lgres@lgDashIndexes = (/0,0,0/) lgres@lgLineColors = (/237,144,80/) lbid = gsn_create_legend(wks_ps,3,(/"umax","vmax","wmax"/),lgres) amres = True amres@amParallelPosF = 0.6 amres@amOrthogonalPosF = -0.2 annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) end if end if if (vNam(varn) .EQ. "z_i_wpt" .AND. z .NE. 1) then zw=1 overlay(plot_z_i_wpt,plot_z_i_pt) n=n+1 plot_ps(n) = plot_z_i_wpt ; *************************************************** ; legend for combined plot ; *************************************************** lgres = True lgMonoDashIndex = False lgres@lgLabelFont = "helvetica" lgres@lgLabelFontHeightF = .1 lgres@vpWidthF = 0.4 lgres@vpHeightF = 0.4 lgres@lgDashIndexes = (/0,0,0/) lgres@lgLineColors = (/237,144,80/) lbid = gsn_create_legend(wks_ps,2,(/"z_i_wpt","z_i_pt"/),lgres) amres = True amres@amParallelPosF = 0.6 amres@amOrthogonalPosF = -0.2 annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) end if if (vNam(varn) .EQ. "z_i_pt" .AND. zw .NE. 1) then z=1 overlay(plot_z_i_wpt,plot_z_i_pt) n=n+1 plot_ps(n) = plot_z_i_wpt ; *************************************************** ; legend for combined plot ; *************************************************** lgres = True lgMonoDashIndex = False lgres@lgLabelFont = "helvetica" lgres@lgLabelFontHeightF = .1 lgres@vpWidthF = 0.4 lgres@vpHeightF = 0.4 lgres@lgDashIndexes = (/0,0,0/) lgres@lgLineColors = (/237,144,80/) lbid = gsn_create_legend(wks_ps,2,(/"z_i_wpt","z_i_pt"/),lgres) amres = True amres@amParallelPosF = 0.6 amres@amOrthogonalPosF = -0.2 annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) end if if (vNam(varn) .EQ. "wpptp0" .AND. wp .NE. 1) if (wt .NE. 1) then w0=1 overlay(plot_wpptp0,plot_wpptp) overlay(plot_wpptp0,plot_wpt) n=n+1 plot_ps(n) = plot_wpptp0 ; *************************************************** ; legend for combined plot ; *************************************************** lgres = True lgMonoDashIndex = False lgres@lgLabelFont = "helvetica" lgres@lgLabelFontHeightF = .1 lgres@vpWidthF = 0.4 lgres@vpHeightF = 0.4 lgres@lgDashIndexes = (/0,0,0/) lgres@lgLineColors = (/237,144,80/) lbid = gsn_create_legend(wks_ps,3,(/"wpptp0","wpptp","wpt"/),lgres) amres = True amres@amParallelPosF = 0.6 amres@amOrthogonalPosF = -0.2 annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) end if end if if (vNam(varn) .EQ. "wpptp" .AND. w0 .NE. 1) if (wt .NE. 1) then wp=1 overlay(plot_wpptp0,plot_wpptp) overlay(plot_wpptp0,plot_wpt) n=n+1 plot_ps(n) = plot_wpptp0 ; *************************************************** ; legend for combined plot ; *************************************************** lgres = True lgMonoDashIndex = False lgres@lgLabelFont = "helvetica" lgres@lgLabelFontHeightF = .1 lgres@vpWidthF = 0.4 lgres@vpHeightF = 0.4 lgres@lgDashIndexes = (/0,0,0/) lgres@lgLineColors = (/237,144,80/) lbid = gsn_create_legend(wks_ps,3,(/"wpptp0","wpptp","wpt"/),lgres) amres = True amres@amParallelPosF = 0.6 amres@amOrthogonalPosF = -0.2 annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) end if end if if (vNam(varn) .EQ. "wpt" .AND. wp .NE. 1) if (w0 .NE. 1) then wt=1 overlay(plot_wpptp0,plot_wpptp) overlay(plot_wpptp0,plot_wpt) n=n+1 plot_ps(n) = plot_wpptp0 ; *************************************************** ; legend for combined plot ; *************************************************** lgres = True lgMonoDashIndex = False lgres@lgLabelFont = "helvetica" lgres@lgLabelFontHeightF = .1 lgres@vpWidthF = 0.4 lgres@vpHeightF = 0.4 lgres@lgDashIndexes = (/0,0,0/) lgres@lgLineColors = (/237,144,80/) lbid = gsn_create_legend(wks_ps,3,(/"wpptp0","wpptp","wpt"/),lgres) amres = True amres@amParallelPosF = 0.6 amres@amOrthogonalPosF = -0.2 annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) end if end if if (vNam(varn) .EQ. "pt_0_" .AND. pz .NE. 1) then p=1 overlay(plot_pt_0_,plot_pt_zp_) n=n+1 plot_ps(n) = plot_pt_0_ ; *************************************************** ; legend for combined plot ; *************************************************** lgres = True lgMonoDashIndex = False lgres@lgLabelFont = "helvetica" lgres@lgLabelFontHeightF = .1 lgres@vpWidthF = 0.4 lgres@vpHeightF = 0.4 lgres@lgDashIndexes = (/0,0,0/) lgres@lgLineColors = (/237,144,80/) lbid = gsn_create_legend(wks_ps,2,(/"pt_0_","pt_zp_"/),lgres) amres = True amres@amParallelPosF = 0.6 amres@amOrthogonalPosF = -0.2 annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) end if if (vNam(varn) .EQ. "pt_zp_" .AND. p .NE. 1) then pz=1 overlay(plot_pt_0_,plot_pt_zp_) n=n+1 plot_ps(n) = plot_pt_0_ ; *************************************************** ; legend for combined plot ; *************************************************** lgres = True lgMonoDashIndex = False lgres@lgLabelFont = "helvetica" lgres@lgLabelFontHeightF = .1 lgres@vpWidthF = 0.4 lgres@vpHeightF = 0.4 lgres@lgDashIndexes = (/0,0,0/) lgres@lgLineColors = (/237,144,80/) lbid = gsn_create_legend(wks_ps,2,(/"pt_0_","pt_zp_"/),lgres) amres = True amres@amParallelPosF = 0.6 amres@amOrthogonalPosF = -0.2 annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) end if if (vNam(varn) .EQ. "splptx" .AND. y .NE. 1) if (z .NE.1 ) then x=1 overlay(plot_splptx,plot_splpty) overlay(plot_splptx,plot_splptz) n=n+1 plot_ps(n) = plot_splptx ; *************************************************** ; legend for combined plot ; *************************************************** lgres = True lgMonoDashIndex = False lgres@lgLabelFont = "helvetica" lgres@lgLabelFontHeightF = .1 lgres@vpWidthF = 0.4 lgres@vpHeightF = 0.4 lgres@lgDashIndexes = (/0,0,0/) lgres@lgLineColors = (/237,144,80/) lbid = gsn_create_legend(wks_ps,3,(/"splptx","splpty","splptz"/),lgres) amres = True amres@amParallelPosF = 0.6 amres@amOrthogonalPosF = -0.2 annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) end if end if if (vNam(varn) .EQ. "splpty" .AND. x .NE. 1) if(z .NE.1 ) then y=1 overlay(plot_splptx,plot_splpty) overlay(plot_splptx,plot_splptz) n=n+1 plot_ps(n) = plot_splptx ; *************************************************** ; legend for combined plot ; *************************************************** lgres = True lgMonoDashIndex = False lgres@lgLabelFont = "helvetica" lgres@lgLabelFontHeightF = .1 lgres@vpWidthF = 0.4 lgres@vpHeightF = 0.4 lgres@lgDashIndexes = (/0,0,0/) lgres@lgLineColors = (/237,144,80/) lbid = gsn_create_legend(wks_ps,3,(/"splptx","splpty","splptz"/),lgres) amres = True amres@amParallelPosF = 0.6 amres@amOrthogonalPosF = -0.2 annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) end if end if if (vNam(varn) .EQ. "splptz" .AND. y .NE. 1) if(x .NE.1 ) then z=1 overlay(plot_splptx,plot_splpty) overlay(plot_splptx,plot_splptz) n=n+1 plot_ps(n) = plot_splptx ; *************************************************** ; legend for combined plot ; *************************************************** lgres = True lgMonoDashIndex = False lgres@lgLabelFont = "helvetica" lgres@lgLabelFontHeightF = .1 lgres@vpWidthF = 0.4 lgres@vpHeightF = 0.4 lgres@lgDashIndexes = (/0,0,0/) lgres@lgLineColors = (/237,144,80/) lbid = gsn_create_legend(wks_ps,3,(/"splptx","splpty","splptz"/),lgres) amres = True amres@amParallelPosF = 0.6 amres@amOrthogonalPosF = -0.2 annoid1 = gsn_add_annotation(plot_ps(n),lbid,amres) end if end if 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 n=n+1 res@xyLineColors = (/237/) res@xyLabelMode = False res@gsnLeftString = vNam(varn) res@gsnRightString = unit(varn) res@trYMaxF = min(data(varn,:)) res@trYMinF = max(data(varn,:)) if (min(data(varn,:)) .EQ. max(data(varn,:))) then if (min(data(varn,:)) .EQ. 0)then res@trYMaxF = min(data(varn,:))-1. res@trYMinF = max(data(varn,:))+1. end if if (min(data(varn,:)) .LT. 0)then res@trYMaxF = min(data(varn,:))+(min(data(varn,:)))/2 res@trYMinF = max(data(varn,:))-(max(data(varn,:)))/2 end if if (min(data(varn,:)) .GT. 0)then res@trYMaxF = min(data(varn,:))-(min(data(varn,:)))/2 res@trYMinF = max(data(varn,:))+(max(data(varn,:)))/2 end if end if plot_ps(n) = gsn_csm_xy(wks_ps,t,data(varn,:),res) end if else print("plot of " + vNam(varn)) n=n+1 res@xyLineColors = (/237/) res@gsnLeftString = vNam(varn) res@gsnRightString = unit(varn) res@tiXAxisString = " time [s] " res@tiYAxisString = " " res@tiXAxisFontHeightF = 0.07 res@txFontHeightF = 0.07 res@tiYAxisFontHeightF = 0.07 res@trYMaxF = min(data(varn,:)) res@trYMinF = max(data(varn,:)) if (min(data(varn,:)) .EQ. max(data(varn,:))) then if (min(data(varn,:)) .EQ. 0)then res@trYMaxF = min(data(varn,:))-1. res@trYMinF = max(data(varn,:))+1. end if if (min(data(varn,:)) .LT. 0)then res@trYMaxF = min(data(varn,:))+(min(data(varn,:)))/2 res@trYMinF = max(data(varn,:))-(max(data(varn,:)))/2 end if if (min(data(varn,:)) .GT. 0)then res@trYMaxF = min(data(varn,:))-(min(data(varn,:)))/2 res@trYMinF = max(data(varn,:))+(max(data(varn,:)))/2 end if end if plot_ps(n) = gsn_csm_xy(wks_ps,t,data(varn,:),res) end if end if end do ; *************************************************** ; merge plots onto one page ; *************************************************** if (format_out .EQ. "eps" .OR. format_out .EQ. "epsi") then gsn_panel(wks_ps,plot_ps(1:n),(/n,1/),resP) else do np = 1,n,no_lines*no_columns if ( np + no_lines*no_columns .gt. n) then gsn_panel(wks_ps, plot_ps(np:n),(/no_lines,no_columns/),resP) else gsn_panel(wks_ps, plot_ps(np:np+no_lines*no_columns-1),(/no_lines,no_columns/),resP) end if end do end if print(" ") print("Output to: " + file_out +"."+ format_out) print(" ") end