This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Keshab,
In that case you'll want to keep the foreach loop and use the state
abbreviation in your file name, example shown below
#!/bin/csh
# Get UTC hour and add zeros
set hour=`date -u "+%H"`
set hour="${hour}00"
# Loop through states and get METAR data
foreach state (al ak as az ar ca co ct de dc fm fl ga gu hi id il in ia
ks ky la me mh)
sflist<< SFLIST_FLAG
sffile=metar
area=@$state
dattim=$hour
sfparm=text
output=f/metar_text_${state}.txt
idntyp=stid
run
exit
SFLIST_FLAG
end
> Michael,
>
> I tried changing the AREA to US and gave me the result what I expected
> but not what I want. It produced a list of METAR (for all stations in
> US) in an alphabetical order of station identifiers. But I would like to
> have a set of METAR for each state and be able to save it as 50 text files.
>
> thanks,
> Keshab
>
Ticket Details
===================
Ticket ID: BCK-543992
Department: Support GEMPAK
Priority: High
Status: Open