-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path30mbdewp.csh
167 lines (144 loc) · 4.3 KB
/
30mbdewp.csh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#!/bin/csh -f
source /home/gempak/NAWIPS/Gemenviron
setenv DISPLAY :9
# Deal with directory formalities:
set ProdDir = "/home/scripts/models/prodscripts"
cd $ProdDir/dewpoint
# Handle the incoming vars:
# Ordering is Model Runtime, Model Name, Forecast Hour, Sector.
set ModRunTime = $1
set ModName = $2
set FHour = $3
set Sector = $4
# Define the level and product to be generated (for use in filenames):
set Level = sfc
set Product = 30mbdewp
# Set the size of the image
if (($Sector == "ILS") || ($Sector == "ILB")) then
set Size = "1024;768"
else
set Size = "800;600"
endif
# Load Sector Coords and projections:
if (($Sector == "WXCS") || ($Sector == "WXCB")) then
set SectorFileName = "/home/apache/climate/wxchallenge/wxcs.dat"
if ($Sector == "WXCS") then
set Domain = `awk '{if (NR==9) print}' $SectorFileName`
else if ($Sector == "WXCB") then
set Domain = `awk '{if (NR==10) print}' $SectorFileName`
endif
set Projection = "lcc"
else if ($Sector == "FLT") then
set SectorFileName = "/home/scripts/reference/floater.txt"
set Domain = `awk '{if (NR==1) print}' $SectorFileName`
set Projection = "LCC"
else
set SectorFileName = "/home/scripts/reference/sectors.txt"
set Domain = `awk '$1 == "'$Sector'" {print $3}' $SectorFileName`
set Projection = `awk '$1 == "'$Sector'" {print $4}' $SectorFileName`
endif
# Convert Model Name to Grid Name:
set GridFileName = "/home/scripts/reference/gridnames.txt"
set GridName = `awk '$1 == "'$ModName'" {print $2}' $GridFileName`
# Check if GFSHD, and if so remove the HD... And deal with NAM12 in a similar fashion.
if ($ModName == "GFSHD") then
set ModName = GFS
else if ($ModName == "GFSNA") then
set ModName = GFS
else if ($ModName == "NAM12") then
set ModName = NAM
endif
# Convert Model Name to lower case for filenames:
set LModName = `echo $ModName | tr "[:upper:]" "[:lower:]"`
# Set Base Directory and File Name:
set BaseDir = "/home/apache/climate/data/forecast/${ModName}/${ModRunTime}/${Sector}"
set ImageFileName = "${LModName}${Sector}_${Level}_${Product}_${FHour}.gif"
# Set valid time for date string
set hour = `date -u +%H`
@ starttime = -1 * ($hour - $ModRunTime)
@ diff = ((-1 * ($hour - $ModRunTime)) + $FHour)
set vtime = `date -u -d "+$diff hours" "+%HZ %a %h %d %Y"`
# Create text file for date string:
echo ${ModRunTime}Z ${ModName} ${FHour} hour - Valid ${vtime} " ." > ${Level}${Product}${FHour}.txt
if ($Sector == "US") then
set mapfil = "base"
set map = "32//1"
else
set mapfil = "rdis + base"
set map = "28//1 + 32//1"
endif
# Account for various filters of Streamlines:
if ($ModName == RAP) then
set STRM = "0.3"
else
set STRM = "1"
endif
# Add station IDs to WXC images:
if (($Sector == "WXCS") || ($Sector == "WXCL")) then
set stnplt = "32/1|32/15/4/2|wxcstations.tbl"
#set stnplt = "32/1|32/15/4/2|spcwatch.tbl"
else
set stnplt = ""
endif
##################################
# Begin Product-Specific Details #
##################################
gdplot3_gf << eof
\$mapfil = ${mapfil}
GDFILE = ${GridName} | ${ModRunTime}
GDATTIM = f${FHour}
GLEVEL = 0
GVCORD = none
PANEL = 0
SKIP = 0
SCALE = 0
GDPFUN = DWPF@30:0%pdly!DWPF@30:0%pdly!kntv(wnd @10 %HGHT)
TYPE = F/C!C!S
CONTUR = 0!1/1
CINT = 30;35;40;45;50;55;60;65;70;75;80;85;90;95;100!1/45/45
LINE = 32/10/1!31/1/1/n!27/1/1
FINT = 0;5;10;15;20;25;30;35;40;45;50;55;60;65;70;75;80
FLINE = 31;1;2;3;4;5;6;7;8;9;10;11;12;14;15;16;17;18
HILO =
HLSYM =
CLRBAR = 31/h/lc/.5;.002/.95;.012//|.65/1
WIND = ak6/.6//111/.4
REFVEC =
TITLE = 31/-3/0-30mb AG DEWPOINT (F) / WIND (kts) - COD NEXLAB WEATHER.COD.EDU
TEXT = 1/1/hw
CLEAR = y
GAREA = ${Domain}
PROJ = ${Projection}
MAP = ${map}
STNPLT = ${stnplt}
LATLON =
DEVICE = GIF|$ImageFileName|${Size}
SATFIL =
RADFIL =
IMCBAR =
FILTER = 1.1
STREAM = ${STRM}/0.8/0/1000/3
BOXLIN = 32
REGION = view
TXTFIL = ${Level}${Product}${FHour}.txt
TXTLOC = .8;1
TXTYPE = 1/2//221/s/c/sw
TXTCOL = 31
COLUMN =
SHAPE =
INFO =
LOCI =
ANOTLN =
ANOTYP =
r
exit
eof
##################################
# Move image to output dir:
#mkdir ${BaseDir}
mv -f $ImageFileName ${BaseDir}
# Remove temp Gempak .nts files:
rm gemglb.nts
rm last.nts
# Remove text file for date string:
rm ${Level}${Product}${FHour}.txt