load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/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",75,"string") delete(parameter@_FillValue) else print(" ") print("Please copy '.ncl_preferences' into your $home dircetory") print(" ") exit end if ; *************************************************** ; set default parameter values and strings if not assigned in prompt or parameter list ; *************************************************** if ( .not. isvar("file_in") ) then ; path+name of input file if (parameter(7) .EQ. "input file") then print(" ") print("Please provide input file 'file_in = ' either in prompt or parameter_list") print(" ") exit else file_in = parameter(7) end if end if if ( .not. isvar("format_out") ) then ; format of output file format_out = "x11" if (parameter(9) .NE. "x11") then format_out = parameter(9) 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("sort") ) then ; sort of plots sort = "time" if (parameter(37) .NE. "time") then sort = parameter(37) end if end if if ( .not. isvar("mode") ) then ; pattern of contour plots mode = "Fill" if (parameter(39) .NE. "Fill") then mode = parameter(39) end if end if if ( .not. isvar("fill_mode") ) then ; pattern of filling fill_mode = "AreaFill" if (parameter(41) .NE. "AreaFill") then mode = parameter(41) end if end if if ( .not. isvar("shape") ) then ; keeping of aspect ratio shape = 1 if (parameter(43) .NE. "1") then shape = stringtointeger(parameter(43)) if (stringtointeger(parameter(43)) .NE. 0) then print(" ") print("Please set 'shape' to 0 or 1") print(" ") exit end if end if end if if ( .not. isvar("var") ) then ; set output of all variables check = True end if if ( .not. isvar("xyc") ) then ; turn xy cross-section on or off xyc = 0 if (parameter(45) .NE. "0") then xyc = stringtointeger(parameter(45)) if (stringtointeger(parameter(45)) .NE. 1) then print(" ") print("Please set 'xyc' to 0 or 1") print(" ") exit end if end if end if if ( .not. isvar("xzc") ) then ; turn xz cross-section on or off xzc = 0 if (parameter(47) .NE. "0") then xzc = stringtointeger(parameter(47)) if (stringtointeger(parameter(47)) .NE. 1) then print(" ") print("Please set 'xzc' to 0 or 1") print(" ") exit end if end if end if if ( .not. isvar("yzc") ) then ; turn yz cross-section on or off yzc = 0 if (parameter(49) .NE. "0") then yzc = stringtointeger(parameter(49)) if (stringtointeger(parameter(49)) .NE. 1) then print(" ") print("Please set 'yzc' to 0 or 1") print(" ") exit end if end if end if if ( .not. isvar("xs") ) then ; start of x-coordinate range xs = 0 if (parameter(51) .NE. "0") then xs = stringtointeger(parameter(51)) end if end if if ( .not. isvar("ys") ) then ; start of y-coordinate range ys = 0 if (parameter(55) .NE. "0") then ys = stringtointeger(parameter(55)) end if end if if ( .not. isvar("zs") ) then ; start of z-coordinate range zs = 0 if (parameter(59) .NE. "0") then zs = stringtointeger(parameter(59)) end if end if if (xyc .EQ. 0 .AND. xzc .EQ. 0 .AND. yzc .EQ. 0) then print(" ") print("Please select one crossection (xyc=1 or xzc=1 or yzc=1)") print(" ") exit end if if (xyc .EQ. 1 ) then if (xzc .EQ. 1 .OR. yzc .EQ. 1) then print(" ") print("Please select just one crossection (xyc=1 or xzc=1 or yzc=1)") print(" ") exit end if end if if (xzc .EQ. 1) then if (xyc .EQ. 1 .OR. yzc .EQ. 1) then print(" ") print("Please select just one crossection (xyc=1 or xzc=1 or yzc=1)") print(" ") exit end if end if if (yzc .EQ. 1) then if (xyc .EQ. 1 .OR. xzc .EQ. 1) then print(" ") print("Please select just one crossection (xyc=1 or xzc=1 or yzc=1)") print(" ") exit end if end if if ( .not. isvar("vector") ) then ; sort of plots vector = 0 if (parameter(63) .NE. "0") then vector = stringtointeger(parameter(63)) if (stringtointeger(parameter(63)) .NE. 1) then print(" ") print("Please set 'vector' to 0 or 1") print(" ") exit end if end if end if if ( .not. isvar("ref_mag") ) then ; sort of plots ref_mag = 0.05 if (parameter(71) .NE. "0.05") then ref_mag = stringtofloat(parameter(71)) 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 ; *************************************************** ; set up recourses ; *************************************************** cs_res = True cs_res@gsnYAxisIrregular2Linear = True if( shape .eq. 1 ) then ; keep the shape cs_res@gsnShape = True end if cs_res@gsnDraw = False cs_res@gsnFrame = False cs_res@gsnMaximize = True cs_res@gsnPaperOrientation = "portrait" cs_res@gsnPaperWidth = 8.27 cs_res@gsnPaperHeight = 11.69 cs_res@gsnPaperMargin = 0.79 cs_res@tmXBLabelFontHeightF = .02 cs_res@tmYLLabelFontHeightF = .02 cs_res@tiXAxisFontHeightF = .02 cs_res@tiYAxisFontHeightF = .02 cs_res@tmXBMode ="Automatic" cs_res@tmYLMode ="Automatic" cs_res@lgTitleFontHeightF = .02 cs_res@lgLabelFontHeightF = .02 cs_res@txFontHeightF = .02 cs_resP = True cs_resP@txString = f@title cs_resP@txFuncCode = "~" ; necessary for title cs_resP@txFontHeightF = .02 if ( mode .eq. "Fill" ) then cs_res@cnFillOn = True cs_res@gsnSpreadColors = True cs_res@cnFillMode = fill_mode cs_res@lbOrientation = "Vertical" ; vertical label bar cs_res@cnLinesOn = False cs_res@cnLineLabelsOn = False end if if ( mode .eq. "Both" ) then cs_res@cnFillOn = True cs_res@gsnSpreadColors = True cs_res@cnFillMode = fill_mode cs_res@lbOrientation = "Vertical" ; vertical label bar cs_res@cnLinesOn = True cs_res@cnLineLabelsOn = True end if ; ********************************************* ; set up of start_time_step and end_time_step ; ********************************************* t = f->time nt = dimsizes(t) ; ********************************************* ; start of time step and different types of mistakes that could be done ; ********************************************* if ( .not. isvar("start_time_step") ) then start_time_step = 0 if (parameter(13) .NE. "1") then if (parameter(13) .LT. "1") print(" ") print("Begin with time step 1") print(" ") exit end if if (stringtointeger(parameter(13)) .GT. nt) print(" ") print("'start_time_step' = "+ parameter(13) +" is greater than available time steps = " + (nt)) print(" ") exit end if start_time_step = stringtointeger(parameter(13))-1 end if else if (start_time_step .LE. 0) print(" ") print("Begin with time step 1") print(" ") exit end if if (start_time_step .GT. nt) print(" ") print("'start_time_step' = "+ start_time_step +" is greater than available time steps = " + (nt)) print(" ") exit end if start_time_step = start_time_step - 1 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 = nt-1 if (parameter(15) .NE. "nt") then if (parameter(15) .LE. "0") print(" ") print("'end_time_step' = "+parameter(15)+ " is too small; 'end_time_step' should be at least 1 ") print(" ") exit end if if (stringtointeger(parameter(15)) .GT. nt) print(" ") print("'end_time_step' = "+ parameter(15) +" is greater than available time steps = " + (nt)) print(" ") exit end if if (stringtointeger(parameter(15)) .LT. stringtointeger(parameter(13)) ) print(" ") print("'end_time_step' = "+ parameter(15) +" is lower than 'start_time_step' = "+parameter(15)) print(" ") exit end if end_time_step = stringtointeger(parameter(15))-1 end if else if (end_time_step .LE. 0) print(" ") print("'end_time_step' = "+end_time_step+ " is too small; 'end_time_step' should be at least 1 ") print(" ") exit end if if (end_time_step .GT. nt) print(" ") print("'end_time_step' = "+ end_time_step +" is greater than available time steps = "+(nt)) print(" ") exit end if if (end_time_step .LT. start_time_step) print(" ") print("'end_time_step' = "+end_time_step +" is lower than 'start_time_step' = "+start_time_step) print(" ") exit end if end_time_step = end_time_step-1 end if no_time=(end_time_step-start_time_step)+1 ; **************************************************** ; set up variables for vector plot if required ; **************************************************** if (vector .EQ. 1) then if ( .not. isvar("plotvec") ) then plotvec = parameter(69) end if if ( .not. isvar("vec1") ) then vec1 = parameter(65) if (parameter(65) .EQ. "vec1") then print(" ") print("Please indicate Vector 1 ('vec1') for Vector-Plot") print(" ") exit end if end if if ( .not. isvar("vec2") ) then vec2 = parameter(67) if (parameter(67) .EQ. "vec2") then print(" ") print("Please indicate Vector 2 ('vec2') for Vector-Plot") print(" ") exit end if end if end if check_vec1 = False check_vec2 = False check_vecp = False ; **************************************************** ; get data for plots ; **************************************************** do varn=dim-1,0,1 if ( vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "xu" .or. vNam(varn) .eq. "zu" .or. vNam(varn) .eq. "zwwi" .or. vNam(varn) .eq. "zusi" .or. vNam(varn) .eq. "time" .or. vNam(varn) .eq. "zu_3d" .or. vNam(varn) .eq. "zw_3d" .or. vNam(varn) .eq. "x" .or. vNam(varn) .eq. "y" .or. vNam(varn) .eq. "zu_xy" .or. vNam(varn) .eq. "zw_xy" .or. vNam(varn) .eq. "zu1_xy" .or. vNam(varn) .eq. "ind_z_xy" .or. vNam(varn) .eq. "y_xz" .or. vNam(varn) .eq. "yv_xz" .or. vNam(varn) .eq. "ind_y_xz" .or. vNam(varn) .eq. "x_yz" .or. vNam(varn) .eq. "xu_yz" .or. vNam(varn) .eq. "ind_x_yz") then 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 print(vNam(varn)) data_all = f->$vNam(varn)$ ; **************************************************** ; set up ranges of x-, y- and z-coordinates ; **************************************************** xdim = dimsizes(data_all(0,0,0,:)) - 1 ydim = dimsizes(data_all(0,0,:,0)) - 1 zdim = dimsizes(data_all(0,:,0,0)) - 1 if ( .not. isvar("xe")) then ; output x-coordinate range end (in index) xe = xdim if (parameter(53) .NE. "xdim") then if (stringtointeger(parameter(53)) .GT. xdim) then print(" ") print("range end for x-coordinate = "+parameter(53)+" is higher than available dimensions = "+xdim) print(" ") exit end if if (stringtointeger(parameter(53)) .LT. 0 .OR. stringtointeger(parameter(53)) .LT. xs) then print(" ") print("range end for x-coordinate = "+parameter(53)+" is too small") print(" ") exit end if xe = stringtointeger(parameter(53)) end if else if (xe .GT. xdim) then print(" ") print("range end for x-coordinate = "+xe+" is higher than available dimensions = "+xdim) print(" ") exit end if if (xe .LT. 0 .OR. xe .LT. xs) then print(" ") print("range end for x-coordinate = "+xe+" is too small") print(" ") exit end if end if if ( .not. isvar("ye")) then ; output y-coordinate range end (in index) ye = ydim if (parameter(57) .NE. "ydim") then if (stringtointeger(parameter(57)) .GT. ydim) then print(" ") print("range end for y-coordinate = "+parameter(57)+" is higher than available dimensions = "+ydim) print(" ") exit end if if (stringtointeger(parameter(57)) .LT. 0 .OR. stringtointeger(parameter(57)) .LT. ys) then print(" ") print("range end for y-coordinate = "+parameter(57)+" is too small") print(" ") exit end if ye = stringtointeger(parameter(57)) end if else if (ye .GT. ydim) then print(" ") print("range end for y-coordinate = "+ye+" is higher than available dimensions = "+ydim) print(" ") exit end if if (ye .LT. 0 .OR. ye .LT. ys) then print(" ") print("range end for y-coordinate = "+ye+" is too small") print(" ") exit end if end if if ( .not. isvar("ze")) then ; output z-coordinate range end (in index) ze = zdim if (parameter(61) .NE. "zdim") then if (stringtointeger(parameter(61)) .GT. zdim) then print(" ") print("range end for z-coordinate = "+parameter(61)+" is higher than available dimensions = "+zdim) print(" ") exit end if if (stringtointeger(parameter(61)) .LT. 0 .OR. stringtointeger(parameter(61)) .LT. zs) then print(" ") print("range end for z-coordinate = "+parameter(61)+" is too small") print(" ") exit end if ze = stringtointeger(parameter(61)) end if else if (ze .GT. zdim) then print(" ") print("range end for z-coordinate = "+ze+" is higher than available dimensions = "+zdim) print(" ") exit end if if (ze .LT. 0 .OR. ze .LT. zs) then print(" ") print("range end for z-coordinate = "+ze+" is too small") print(" ") exit end if end if delete(data_all) end if end do if (xyc .EQ. 1) then no_layer = (ze-zs)+1 end if if (xzc .EQ. 1) then no_layer = (ye-ys)+1 end if if (yzc .EQ. 1) then no_layer = (xe-xs)+1 end if data = new((/dim,nt,(ze-zs)+1,(ye-ys)+1,(xe-xs)+1/),float) ; **************************************************** ; define inner and outer loops depending on "sort" ; **************************************************** if ( xyc .eq. 1 ) then lays = zs laye = ze end if if ( xzc .eq. 1 ) then lays = ys laye = ye end if if ( yzc .eq. 1) then lays = xs laye = xe end if if ( sort .eq. "time" ) then lis = start_time_step lie = end_time_step los = lays loe = laye else lis = lays lie = laye los = start_time_step loe = end_time_step end if check = True v1=0 v2=0 no_var=0 n=0 do varn=dim-1,0,1 data_all = f->$vNam(varn)$ if (vector .EQ. 1) then check_vec1 = isStrSubset( vec1,","+vNam(varn)+",") check_vec2 = isStrSubset( vec2,","+vNam(varn)+",") end if if ( vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "xu" .or. vNam(varn) .eq. "zu" .or. vNam(varn) .eq. "zwwi" .or. vNam(varn) .eq. "zusi" .or. vNam(varn) .eq. "time" .or. vNam(varn) .eq. "zu_3d" .or. vNam(varn) .eq. "zw_3d" .or. vNam(varn) .eq. "x".or. vNam(varn) .eq. "y" .or. vNam(varn) .eq. "zu_xy" .or. vNam(varn) .eq. "zw_xy" .or. vNam(varn) .eq. "zu1_xy" .or. vNam(varn) .eq. "ind_z_xy" .or. vNam(varn) .eq. "y_xz" .or. vNam(varn) .eq. "yv_xz" .or. vNam(varn) .eq. "ind_y_xz" .or. vNam(varn) .eq. "x_yz" .or. vNam(varn) .eq. "xu_yz" .or. vNam(varn) .eq. "ind_x_yz") then 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 no_var=no_var+1 if (vector .EQ. 1) then if (","+vNam(varn)+"," .EQ. vec1) then v1=v1+1 end if if (","+vNam(varn)+"," .EQ. vec2) then v2=v2+1 end if end if data(varn,:,:,:,:)=data_all(0:nt-1,zs:ze,ys:ye,xs:xe) if (check_vec1) then vect1=data_all end if if (check_vec2) then vect2=data_all end if data!0 = "var" data!1 = "t" data!2 = "z" data!3 = "y" data!4 = "x" end if delete(data_all) end do plot_panel=new((/no_time*no_layer*no_var/),graphic) if (vector .EQ. 1) then if (v1 .EQ. 0)then print(" ") print("Varible for vector-plot ('vec1') must be one of the varibles for plot ('var')") print(" ") exit end if if (v2 .EQ. 0)then print(" ") print("Varible for vector-plot ('vec2') must be one of the varibles for plot ('var')") print(" ") exit end if end if ; *************************************************** ; open workstation(s) ; *************************************************** wks_ps = gsn_open_wks(format_out,file_out) gsn_define_colormap(wks_ps,"rainbow+white") plot=new((/no_time*no_layer*no_var/),graphic) page = 0 n=0 print("plots sorted by '"+sort+"'") print(" ") ; *************************************************** ; create plots ; *************************************************** check = True do varn=dim-1,0,1 if (vector .EQ. 1) then check_vecp = isStrSubset( plotvec,","+vNam(varn)+",") end if if ( vNam(varn) .eq. "zw" .or. vNam(varn) .eq. "yv" .or. vNam(varn) .eq. "xu" .or. vNam(varn) .eq. "zu" .or. vNam(varn) .eq. "zwwi" .or. vNam(varn) .eq. "zusi" .or. vNam(varn) .eq. "time" .or. vNam(varn) .eq. "zu_3d" .or. vNam(varn) .eq. "zw_3d" .or. vNam(varn) .eq. "x".or. vNam(varn) .eq. "y" .or. vNam(varn) .eq. "zu_xy" .or. vNam(varn) .eq. "zw_xy" .or. vNam(varn) .eq. "zu1_xy" .or. vNam(varn) .eq. "ind_z_xy" .or. vNam(varn) .eq. "y_xz" .or. vNam(varn) .eq. "yv_xz" .or. vNam(varn) .eq. "ind_y_xz" .or. vNam(varn) .eq. "x_yz" .or. vNam(varn) .eq. "xu_yz" .or. vNam(varn) .eq. "ind_x_yz") then 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 ; **************************************************** ; loops over time and layer ; **************************************************** do lo = los, loe do li = lis, lie ; **************************************************** ; xy cross section ; **************************************************** if ( xyc .eq. 1 ) then cs_res@tiXAxisString = "x [m]" cs_res@tiYAxisString = "y [m]" cs_res@gsnLeftString = "Plot of "+vNam(varn) if ( sort .eq. "time" ) then if ( data&z(lo) .eq. -1 ) then level = "-average" else level = "=" + data&z(lo) + "m" end if cs_res@gsnCenterString = "time=" + data&t(li) +"s z"+level plot(n) = gsn_csm_contour(wks_ps,data(varn,li,lo,:,:),cs_res) if (vector .EQ. 1) then if (check_vecp) vecres = True ; vector only resources vecres@gsnDraw = False ; don't draw vecres@gsnFrame = False ; don't advance frame vecres@vcGlyphStyle = "CurlyVector" ; curly vectors vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag vecres@vcRefLengthF = 0.05 ; define length of vec ref vecres@gsnRightString = " " ; turn off right string vecres@gsnLeftString = " " ; turn off left string vecres@tiXAxisString = " " plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres) overlay(plot(n), plot_vec) else vecres = True ; vector only resources vecres@gsnDraw = False ; don't draw vecres@gsnFrame = False ; don't advance frame vecres@vcGlyphStyle = "CurlyVector" ; curly vectors vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag vecres@vcRefLengthF = 0.05 ; define length of vec ref vecres@gsnRightString = "Vector plot of "+vec1+" and "+vec2 vecres@gsnLeftString = " " ; turn off left string vecres@tiXAxisString = " " plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres) plot(n) = plot_vec end if end if end if if ( sort .eq. "layer" ) then if ( data&z(li) .eq. -1 ) then level = "-average" else level = "=" + data&z(li) + "m" end if cs_res@gsnCenterString = "t=" + data&t(lo) + "s z"+ level plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,li,:,:),cs_res) if (vector .EQ. 1) then if (check_vecp) vecres = True ; vector only resources vecres@gsnDraw = False ; don't draw vecres@gsnFrame = False ; don't advance frame vecres@vcGlyphStyle = "CurlyVector" ; curly vectors vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag vecres@vcRefLengthF = 0.05 ; define length of vec ref vecres@gsnRightString = " " ; turn off right string vecres@gsnLeftString = " " ; turn off left string vecres@tiXAxisString = " " plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres) overlay(plot(n), plot_vec) else vecres = True ; vector only resources vecres@gsnDraw = False ; don't draw vecres@gsnFrame = False ; don't advance frame vecres@vcGlyphStyle = "CurlyVector" ; curly vectors vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag vecres@vcRefLengthF = 0.05 ; define length of vec ref vecres@gsnRightString = "Vector plot of "+vec1+" and "+vec2 vecres@gsnLeftString = " " ; turn off left string vecres@tiXAxisString = " " plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres) plot(n) = plot_vec end if end if end if end if ; **************************************************** ; xz cross section ; **************************************************** if ( xzc .eq. 1 ) then cs_res@tiXAxisString = "x [m]" cs_res@tiYAxisString = "z [m]" cs_res@gsnLeftString = "Plot of "+vNam(varn) if ( sort .eq. "time" ) then if ( data&z(lo) .eq. -1 ) then level = "-average" else level = "=" + data&y(lo) + "m" end if cs_res@gsnCenterString = "t=" + data&t(li) + "s y"+ level plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,lo,:),cs_res) if (vector .EQ. 1) then if (check_vecp) vecres = True ; vector only resources vecres@gsnDraw = False ; don't draw vecres@gsnFrame = False ; don't advance frame vecres@vcGlyphStyle = "CurlyVector" ; curly vectors vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag vecres@vcRefLengthF = 0.05 ; define length of vec ref vecres@gsnRightString = " " ; turn off right string vecres@gsnLeftString = " " ; turn off left string vecres@tiXAxisString = " " plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres) overlay(plot(n), plot_vec) else vecres = True ; vector only resources vecres@gsnDraw = False ; don't draw vecres@gsnFrame = False ; don't advance frame vecres@vcGlyphStyle = "CurlyVector" ; curly vectors vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag vecres@vcRefLengthF = 0.05 ; define length of vec ref vecres@gsnRightString = "Vector plot of "+vec1+" and "+vec2 vecres@gsnLeftString = " " ; turn off left string vecres@tiXAxisString = " " plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres) plot(n) = plot_vec end if end if end if if ( sort .eq. "layer" ) then if ( data&z(li) .eq. -1 ) then level = "-average" else level = "=" + data&y(li) + "m" end if cs_res@gsnCenterString = "t=" + data&t(lo) + "s y"+ level plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,li,:),cs_res) if (vector .EQ. 1) then if (check_vecp) vecres = True ; vector only resources vecres@gsnDraw = False ; don't draw vecres@gsnFrame = False ; don't advance frame vecres@vcGlyphStyle = "CurlyVector" ; curly vectors vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag vecres@vcRefLengthF = 0.05 ; define length of vec ref vecres@gsnRightString = " " ; turn off right string vecres@gsnLeftString = " " ; turn off left string vecres@tiXAxisString = " " plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres) overlay(plot(n), plot_vec) else vecres = True ; vector only resources vecres@gsnDraw = False ; don't draw vecres@gsnFrame = False ; don't advance frame vecres@vcGlyphStyle = "CurlyVector" ; curly vectors vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag vecres@vcRefLengthF = 0.05 ; define length of vec ref vecres@gsnRightString = "Vector plot of "+vec1+" and "+vec2 vecres@gsnLeftString = " " ; turn off left string vecres@tiXAxisString = " " plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres) plot(n) = plot_vec end if end if end if end if ; **************************************************** ; yz cross section ; **************************************************** if ( yzc .eq. 1 ) then cs_res@tiXAxisString = "y [m]" cs_res@tiYAxisString = "z [m]" cs_res@gsnLeftString = "Plot of "+vNam(varn) if ( sort .eq. "time" ) then if ( data&z(lo) .eq. -1 ) then level = "-average" else level = "=" + data&z(lo) + "m" end if cs_res@gsnCenterString = "t=" + data&t(li) + "s x"+ level plot(n) = gsn_csm_contour(wks_ps,data(varn,li,:,:,lo),cs_res) if (vector .EQ. 1) then if (check_vecp) vecres = True ; vector only resources vecres@gsnDraw = False ; don't draw vecres@gsnFrame = False ; don't advance frame vecres@vcGlyphStyle = "CurlyVector" ; curly vectors vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag vecres@vcRefLengthF = 0.05 ; define length of vec ref vecres@gsnRightString = " " ; turn off right string vecres@gsnLeftString = " " ; turn off left string vecres@tiXAxisString = " " plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres) overlay(plot(n), plot_vec) else vecres = True ; vector only resources vecres@gsnDraw = False ; don't draw vecres@gsnFrame = False ; don't advance frame vecres@vcGlyphStyle = "CurlyVector" ; curly vectors vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag vecres@vcRefLengthF = 0.05 ; define length of vec ref vecres@gsnRightString = "Vector plot of "+vec1+" and "+vec2 vecres@gsnLeftString = " " ; turn off left string vecres@tiXAxisString = " " plot_vec=gsn_csm_vector(wks_ps,vect1(li,lo,:,:),vect2(li,lo,:,:),vecres) plot(n) = plot_vec end if end if end if if ( sort .eq. "layer" ) then if ( data&z(li) .eq. -1 ) then level = "-average" else level = "=" + data&z(li) + "m" end if cs_res@gsnCenterString = "t=" + data&t(lo) + "s x"+ level plot(n) = gsn_csm_contour(wks_ps,data(varn,lo,:,:,li),cs_res) if (vector .EQ. 1) then if (check_vecp) vecres = True ; vector only resources vecres@gsnDraw = False ; don't draw vecres@gsnFrame = False ; don't advance frame vecres@vcGlyphStyle = "CurlyVector" ; curly vectors vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag vecres@vcRefLengthF = 0.05 ; define length of vec ref vecres@gsnRightString = " " ; turn off right string vecres@gsnLeftString = " " ; turn off left string vecres@tiXAxisString = " " plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres) overlay(plot(n), plot_vec) else vecres = True ; vector only resources vecres@gsnDraw = False ; don't draw vecres@gsnFrame = False ; don't advance frame vecres@vcGlyphStyle = "CurlyVector" ; curly vectors vecres@vcRefMagnitudeF = ref_mag ; define vector ref mag vecres@vcRefLengthF = 0.05 ; define length of vec ref vecres@gsnRightString = "Vector plot of "+vec1+" and "+vec2 vecres@gsnLeftString = " " ; turn off left string vecres@tiXAxisString = " " plot_vec=gsn_csm_vector(wks_ps,vect1(lo,li,:,:),vect2(lo,li,:,:),vecres) plot(n) = plot_vec end if end if end if end if n=n+1 end do end do 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(0:(no_time*no_layer*no_var)-1),(/no_var,no_layer*no_time/),cs_resP) print(" ") print("Outputs to .eps or .epsi have only one frame") print(" ") else do np = 0,no_layer*no_time*no_var-1,no_lines*no_columns if ( np + no_lines*no_columns .gt. (no_layer*no_time*no_var)-1) then gsn_panel(wks_ps, plot(np:(no_layer*no_time*no_var)-1),(/no_lines,no_columns/),cs_resP) else gsn_panel(wks_ps, plot(np:np+no_lines*no_columns-1),(/no_lines,no_columns/),cs_resP) end if end do end if print(" ") print("Output to: " + file_out +"."+ format_out) print(" ") end