2 ; Script display location of model domains
3 ; Only works for ARW domains
4 ; Reads namelist file directly
6 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
7 load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
8 ;load "./WRFUserARW.ncl"
13 ; We generate plots, but what kind do we prefer?
18 wks = gsn_open_wks(type,"wps_show_dom")
20 ; read the following namelist file
21 filename = "./namelist.wps"
24 ; Set the colors to be used
25 colors = (/"white","black","White","ForestGreen","DeepSkyBlue","Red","Blue"/)
26 gsn_define_colormap(wks, colors)
29 ; Set some map information ; line and text information
32 mpres@mpFillColors = (/"background","DeepSkyBlue","ForestGreen","DeepSkyBlue", "transparent"/)
33 mpres@mpGeophysicalLineColor = "Black"
34 mpres@mpGridLineColor = "Black"
35 mpres@mpLimbLineColor = "Black"
36 mpres@mpNationalLineColor = "Black"
37 mpres@mpPerimLineColor = "Black"
38 mpres@mpUSStateLineColor = "Black"
39 ;mpres@mpGridSpacingF = 45
40 mpres@tiMainString = " WPS Domain Configuration "
43 lnres@gsLineThicknessF = 2.5
44 lnres@domLineColors = (/ "white", "Red" , "Red" , "Blue" /)
47 txres@txFont = "helvetica-bold"
48 ;txres@txJust = "BottomLeft"
49 txres@txJust = "TopLeft"
50 txres@txPerimOn = False
51 txres@txFontHeightF = 0.015
53 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
54 ; Do not change anything between the ";;;;;" lines
56 mpres@max_dom = stringtoint (systemfunc("grep max_dom " +filename+ " | cut -f2 -d'=' | cut -f1 -d','" ) )
57 mpres@dx = stringtofloat(systemfunc("grep dx " +filename+ " | cut -f2 -d'=' | cut -f1 -d','" ) )
58 mpres@dy = stringtofloat(systemfunc("grep dy " +filename+ " | cut -f2 -d'=' | cut -f1 -d','" ) )
59 mpres@ref_lat = stringtofloat(systemfunc("grep ref_lat " +filename+ " | cut -f2 -d'=' | cut -f1 -d','" ) )
60 mpres@ref_lon = stringtofloat(systemfunc("grep ref_lon " +filename+ " | cut -f2 -d'=' | cut -f1 -d','" ) )
61 test = systemfunc("grep truelat1 " +filename )
62 if ( .not. ismissing(test) )
63 mpres@truelat1 = stringtofloat(systemfunc("grep truelat1 " +filename+ " | cut -f2 -d'=' | cut -f1 -d','" ) )
67 test = systemfunc("grep truelat2 " +filename )
68 if ( .not. ismissing(test) )
69 mpres@truelat2 = stringtofloat(systemfunc("grep truelat2 " +filename+ " | cut -f2 -d'=' | cut -f1 -d','" ) )
73 mpres@stand_lon = stringtofloat(systemfunc("grep stand_lon " +filename+ " | cut -f2 -d'=' | cut -f1 -d','" ) )
75 test = systemfunc("grep lambert " +filename )
76 if ( .not. ismissing(test) )
77 mpres@map_proj = "lambert"
79 test = systemfunc("grep mercator " +filename )
80 if ( .not. ismissing(test) )
81 mpres@map_proj = "mercator"
83 test = systemfunc("grep polar " +filename )
84 if ( .not. ismissing(test) )
85 mpres@map_proj = "polar"
87 testa = systemfunc("grep 'lat-lon' " +filename )
88 if ( .not. ismissing(testa) )
89 mpres@map_proj = "lat-lon"
90 mpres@pole_lat = stringtofloat(systemfunc("grep pole_lat " +filename+ " | cut -f2 -d'=' | cut -f1 -d','" ) )
91 mpres@pole_lon = stringtofloat(systemfunc("grep pole_lon " +filename+ " | cut -f2 -d'=' | cut -f1 -d','" ) )
94 parent_id = new ( mpres@max_dom , integer )
95 parent_grid_ratio = new ( mpres@max_dom , integer )
96 i_parent_start = new ( mpres@max_dom , integer )
97 j_parent_start = new ( mpres@max_dom , integer )
98 e_we = new ( mpres@max_dom , integer )
99 e_sn = new ( mpres@max_dom , integer )
101 do n = 1, mpres@max_dom
104 parent_id(n0) = stringtoint(systemfunc("grep parent_id " +filename+ " | cut -f2 -d'=' | cut -f"+n+" -d','" ) )
105 parent_grid_ratio(n0) = stringtoint(systemfunc("grep parent_grid_ratio " +filename+ " | cut -f2 -d'=' | cut -f"+n+" -d','" ) )
106 i_parent_start(n0) = stringtoint(systemfunc("grep i_parent_start " +filename+ " | cut -f2 -d'=' | cut -f"+n+" -d','" ) )
107 j_parent_start(n0) = stringtoint(systemfunc("grep j_parent_start " +filename+ " | cut -f2 -d'=' | cut -f"+n+" -d','" ) )
108 e_we(n0) = stringtoint(systemfunc("grep e_we " +filename+ " | cut -f2 -d'=' | cut -f"+n+" -d','" ) )
109 e_sn(n0) = stringtoint(systemfunc("grep e_sn " +filename+ " | cut -f2 -d'=' | cut -f"+n+" -d','" ) )
113 mpres@parent_id = parent_id
114 mpres@parent_grid_ratio = parent_grid_ratio
115 mpres@i_parent_start = i_parent_start
116 mpres@j_parent_start = j_parent_start
120 mp = wrf_wps_dom (wks,mpres,lnres,txres)
122 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
124 ; Now you can add some information to the plot.
125 ; Below is an example of adding a white dot over the DC location.
127 ;pmres@gsMarkerColor = "White"
128 ;pmres@gsMarkerIndex = 16
129 ;pmres@gsMarkerSizeF = 0.01
130 ;gsn_polymarker(wks,mp,-77.26,38.56,pmres)
133 frame(wks) ; lets frame the plot - do not delete