source: configs/dcmip2016/PLOTS/testcase/CYCLONE/dcmip2-intensity-trace.ncl @ 437

Last change on this file since 437 was 437, checked in by dubos, 8 years ago

Plots for DCMIP2016

File size: 2.4 KB
Line 
1;=======================================================================================
2; This NCL
3;
4; Written by Colin Zarzycki (zarzycki@ucar.edu)
5; Version 0.1 (6/5/2016) - DCMIP-2016 release
6;=======================================================================================
7
8load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"   
9load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
10begin
11
12;=======================================================================================
13
14
15;whichVar="PS"          ; PS or WIND
16top_to_bottom=True     ; is data top to bottom? (false for bottom to top)
17model="DYNAMICO"
18out_type="png"
19
20; needs to be a catted file ordered time, lev, lat, lon (or time, lat, lon for PS)
21filename="output_dcmip2016_regular.nc"
22;=======================================================================================
23
24maxLat=90.0
25minLat=0.0
26
27;=======================================================================================
28
29a = addfile(filename,"r")
30
31; figure out what is surface level for wind speed...
32if (top_to_bottom) then
33  sfcLev=dimsizes(a->lev)-1                  ; dimsizes(a->lev)-1 subsets bottom level
34else
35  sfcLev=0
36end if
37
38do varid=1,2
39   
40if( varid .eq. 1) then
41  whichVar = "PS"
42  PS=a->PS(:,{minLat:maxLat},:)              ; just take out NH since we know storm is there
43  PS=PS/100.                                 ; convert from Pa to hPa/mb
44  PS@long_name="Surface pressure"
45  PS@units="hPa"
46  var_vtime = dim_min_n_Wrap(PS,(/1,2/))     ; for now, just find min over lat/lon domain at each time
47else if (varid .eq. 2) then
48  whichVar = "WIND"
49  UBOT=a->U(:,sfcLev,{minLat:maxLat},:)
50  VBOT=a->V(:,sfcLev,{minLat:maxLat},:)
51  WIND=UBOT
52  WIND=sqrt(UBOT^2+VBOT^2)
53  WIND@long_name="Lowest level wind"
54  WIND@units="m/s"
55  var_vtime = dim_max_n_Wrap(WIND,(/1,2/))
56else
57  print("unsupported var choice... exiting...")
58  exit
59end if
60end if
61
62wks   = gsn_open_wks (out_type,whichVar)               ; send graphics to PNG file
63
64res                  = True                     ; plot mods desired
65res@gsnDraw=False
66res@gsnFrame=False
67res@tiMainString     = "DCMIP2 "+model+" "+whichVar+" v. time"          ; add title
68
69res@tiXAxisString        = "Time (days)" 
70res@tiYAxisString        = var_vtime@long_name+" ("+var_vtime@units+")"
71
72res@xyLineThicknessF=5.0
73res@xyLineColor="Blue"
74
75time = var_vtime&time_counter/86400
76plot  = gsn_csm_xy (wks,time,var_vtime,res) ; create plot
77draw(plot)
78frame(wks)
79
80end do
81
82end
Note: See TracBrowser for help on using the repository browser.