[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20040707: Decoding Eta Grids



>From: address@hidden (Jennie L. Moody)
>Organization: UVa
>Keywords: 200407071959.i67JxGaW011411 McIDAS ETA 212 grids

Jennie,

Did Chiz's reply give you enough to get going?

  From:    Steve Chiswell <address@hidden>
  Date:    07 Jul 2004 14:21:55 MDT
  To:      "Jennie L. Moody" <address@hidden>
  Subject: 20040707: Decoding Eta Grids
  
  Jennie,
  
  These ETA212 FTP files are the same as those being distributed via the 
  CONDUIT feedtype for the IDD. We can set you up with a feed. The ETA 212
  grids on the FTP server are a superset of what are delivered on NOAAPORT
  and distributed under the HRS feed on IDD (there are many more
  levels/parameters/forecast times in the CONDUIT and FTP files).
  
  I routinely decode these here for GEMPAK and running the Workstation ETA
  model. Tom would be the person to consult with regarding XCD and all the
  parameters/levels for McIDAS, or acessing via ADDE.
  
  Steve Chiswell
  Unidata User Support

Tom

>I am working with some guys at NASA running some code
>they wrote.  The code goes out and grabs Eta forecasts
>from and NWS server:
>ftp://tgftp.nws.noaa.gov/SL.us008001/ST.opnl/MT.eta_CY.12/RD.20040707/PT.grid_
> DF.gr1/
>
>and grabs files like:
>fh.0000_tl.press_gr.awip3d 
>fh.0003_tl.press_gr.awip3d
> etc. through
>fh.0048_t1.press_gr.awip3d
>
>It then runs a decoder, wgrib, for a designated set of parameters
>and levels.  I have appended the decoder perl script here.
>The problem I am having is that I often have a problem
>with retrieving the grids via ftp (I guess it just times
>out my connection).  
>
>The reason I am writing to Unidata, is that it seems silly to
>me that I should even retrieve data this way, since I am
>currently running the ldm on another machine and decoding
>data.  Presently, I run the McIDAS-XCD decoders and decode
>various grids.  What I am wondering is if there is a way
>to use the ldm to decode these awip3d files that I am
>currently trying to ftp...they should be the 40km Eta 212 grid.
>
>Are these in fact the same grids that are being sent out
>via the IDD?
>
>Thanks for any light you can shed on this for me.  I am trying to
>run some forecast trajectories using these decoded grid files and
>I might have more luck getting the forecasts out if I use the
>idd data that I am getting anyway.
>
>Jennie
>
>
>--------------------code appended here-------
>
>[fcast@nike fcast]$ more
>/home/fcast/Traject_LaRC/Decode/Forecast/convert_eta40km.pl
>#!/usr/bin/perl
>use Time::Local;
>
>### Directory paths ####################################
>$dir_current="/home/fcast/Traject_LaRC/";
>$dir_idl="/usr/local/rsi/idl/bin/";
>########################################################
>
>$dirx=$dir_current."Decode/Forecast/";
>$indir_orig_prefix=$dir_current."Data/ETA/Forecast/Original/";
>$indir_binary_prefix=$dir_current."Data/ETA/Forecast/Binary_40km/";
>
>$intz="12Z";
># Define $fxdayr
># Default is current day
>
>my
>($current_sec,$current_min,$current_hr,$current_day,$current_month,$current_ye
> ar,$current_wday,$current_yday,$current_isdst)=loca
>ltime(time);
>$current_month=$current_month+1;
>$current_year=$current_year+1900;
>$current_yday=$current_yday+1;
>if(length($current_yday)==1){$current_yday="00".$current_yday;}
>if(length($current_yday)==2){$current_yday="0".$current_yday;}
>if(length($current_day)==1){$current_day="0".$current_day;}
>if(length($current_month)==1){$current_month="0".$current_month;}
>
>$year=$current_year;
>$month=$current_month;
>$day=$current_day;
>$yday=$current_yday;
>
>###########################################################################
>
>print "Today is: $current_year$current_month$current_day \n";
>#print "Input Date in yyyymmdd \n";
>#my $input_caldate=<stdin>;
>#chomp($input_caldate);
>#$year=substr($input_caldate,0,4);
>#$month=substr($input_caldate,4,2);
>#$day=substr($input_caldate,6,2);
>
>$time_epoch=timelocal(0,0,0,$day,($month-1),($year-1900));
>my($sec,$min,$hr,$day_tmp,$month_tmp,$year_tmp,$wday,$yday,$isdst)=
> localtime($time_epoch);
>$yday=$yday+1;
>if(length($yday)==1){$yday="00".$yday;}
>if(length($yday)==2){$yday="0".$yday;}
>
>###########################################################################
>
>$fxday=$year.$month.$day;
>#$fxday="20040426";
>
>$indir_orig=$indir_orig_prefix.$fxday."/";
>$indir_binary=$indir_binary_prefix.$fxday."/";
>$fl_latlon="latlon.g212";
>
>opendir(OD,$indir_binary) || mkdir("$indir_binary");
>closedir(OD);
>
>#$infl="fh.0000_tl.press_gr.awip3d";
>$ugrd="UGRD";
>$vgrd="VGRD";
>$vvel="VVEL";
>$temp="TMP";
>$rh="RH";
>$psfc=":PRES:sfc:";
>
>@level=(1000,975,950,925,900,875,850,825,800,775,750,725,700,675,650,625,600,5
> 75,550,525,500,475,450,425,400,375,350,325,300,275,250
>,225,200,175,150,125,100,75,50);
>#@level=(1000.,975.,950.,925.,900.,875.,850.,825.,800.,750.,700.,650.,600.,550
> .,500.,400.,300.,250.,200.,150.,100.,50.);
>
>#$uwinds=":UGRD:850 mb:";
>#$vwinds=":VGRD:850 mb:";
>#$wwinds=":VVEL:850 mb:";
>
>$search="\^fh.00.._tl.press_gr.awip3d\$";
>
>opendir(OD,$indir_orig) || die("Cannot open the directory");
>@fl_orig_all=readdir(OD);
>closedir(OD);
>@fl_orig=();
>foreach(@fl_orig_all)
> {
>  if($_ =~ m/$search/)
   {
>    push(@fl_orig,$_);
>   }
> }
>foreach(@fl_orig) {print "$_\n";}
>
>$wgrib=$dirx."wgrib";
>foreach(@fl_orig)
>{
> print "$_\n";
> $infl=$_;
> $hr_fx=substr($infl,5,2);
> if($hr_fx != 0){$hr_fx3before=$hr_fx-3;}
> if($hr_fx < 10){$hr_fx=substr($hr_fx,1,1);}
> if($hr_fx == 0)
>  {$hr_fx3before="0";
>   $hr_fx="0";}
> $apcp=":APCP:sfc:".$hr_fx3before."-".$hr_fx."hr";
> unlink $_;
> $outfl_bin=$infl.".bin";
> $pid=open(WGRIB_bin,"|$wgrib -s $indir_orig$infl \| grep
>\"$psfc\" \|$wgrib -i -append $indir_orig$infl -o
>$indir_binary$outfl_bin"
>);
> print WGRIB_bin;
> close(WGRIB_bin);
> $pid=open(WGRIB_bin,"|$wgrib -s $indir_orig$infl \| grep
>\"$apcp\" \|$wgrib -i -append $indir_orig$infl -o
>$indir_binary$outfl_bin"
>);
> print WGRIB_bin;
> close(WGRIB_bin);
>
> for($i=0;$i<=$#level;$i++)
>  {
>   print "LEVEL = $level[$i]\n";
>   $uwinds=":$ugrd:$level[$i] mb:";
>   $vwinds=":$vgrd:$level[$i] mb:";
>   $wwinds=":$vvel:$level[$i] mb:";
>   $temp3d=":$temp:$level[$i] mb:";
>   $rh3d=":$rh:$level[$i] mb:";
>   $pid=open(WGRIB_bin,"|$wgrib -s $indir_orig$infl \| grep
>\"$uwinds\" \|$wgrib -i -append $indir_orig$infl -o
>$indir_binary$outfl_
>bin");
>  # print WGRIB_bin;
>   close(WGRIB_bin);
>   $pid=open(WGRIB_bin,"|$wgrib -s $indir_orig$infl \| grep
>\"$vwinds\" \|$wgrib -i -append $indir_orig$infl -o
>$indir_binary$outfl_
>bin");
>  # print WGRIB_bin;
>   close(WGRIB_bin);
>   $pid=open(WGRIB_bin,"|$wgrib -s $indir_orig$infl \| grep
>\"$wwinds\" \|$wgrib -i -append $indir_orig$infl -o
>$indir_binary$outfl_
>bin");
>  # print WGRIB_bin;
>   close(WGRIB_bin);
>   $pid=open(WGRIB_bin,"|$wgrib -s $indir_orig$infl \| grep
>\"$temp3d\" \|$wgrib -i -append $indir_orig$infl -o
>$indir_binary$outfl_
>bin");
>  # print WGRIB_bin;
>   close(WGRIB_bin);
>   $pid=open(WGRIB_bin,"|$wgrib -s $indir_orig$infl \| grep
>\"$rh3d\" \|$wgrib -i -append $indir_orig$infl -o
>$indir_binary$outfl_bi
>n");
>  # print WGRIB_bin;
>   close(WGRIB_bin);
>  }
>} 
>
>foreach(@fl_orig)
> {
>  $ENV{"INDIR"}=$indir_binary;
>  $ENV{"INFL"}=$_.".bin";
>  $ENV{"DIRX"}=$dirx;
>  $ENV{"FL_LATLON"}=$fl_latlon;
>  $ENV{"DATE"}=$fxday;
>  $ENV{"INTZ"}=$intz;
>  chdir("$dirx");
>  $idl="|".$dir_idl."idl -quiet";
>  $pid=open(IDL, "$idl") or die "Couldn't fork: $!\n";
>  print IDL ".run convert_eta_40km_pl.pro";
>  close(IDL)
> }
>
>---------------------------end of perl script
>-----------------------
>
>
>-- 
>
>*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
>
>                    Jennie Lynne Moody, Ph.D.
>                  Research Associate Professor             
>
>Department of Environmental Sciences       Ph: (434) 924-0592
>University of Virginia                         
>244 Clark Hall                             address@hidden
>291 McCormick Rd.                          FAX:(434) 982-2300 
>P.O. Box 400123
>Charlottesville, VA  22904-4123
>
>  UVA Weather Page--> http://windfall.evsc.virginia.edu/~mcuser
>
>*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
>
>
>
>
>
--
NOTE: All email exchanges with Unidata User Support are recorded in the
Unidata inquiry tracking system and then made publically available
through the web.  If you do not want to have your interactions made
available in this way, you must let us know in each email you send to us.