#! /bin/perl $model=@ARGV[0]; $cycle=@ARGV[1]; $cdate=@ARGV[2]; if ($ENV{BASEDIR}) {$basep=$ENV{BASEDIR}; } else { die "You must define environment variable BASEDIR.\n"; } if ($ENV{REGION}) {$region=$ENV{REGION}; } else { die "You must define environment variable REGION.\n"; } %short_mo=("01","Jan","02","Feb","03","Mar","04","Apr","05","May","06","Jun","07","Jul","08","Aug","09","Sep","10","Oct","11","Nov","12","Dec"); $mo=substr($cdate,0,2); $da=substr($cdate,2,2); $yr=substr($cdate,4,2); print "\$mo=$mo \$da=$da \$yr=$yr\n"; print "\$region=$region\n"; open UDF, ">$basep/$region/$model/$cycle/.update" or die "Couldn't write update file.\n"; print UDF "$da-$short_mo{$mo}-$yr"; close UDF; if ($region =~ "hur") { `cp $basep/$region/$model/$cycle/.update $basep/hur/storm_1/00/.updatelatest`; `cp $basep/$region/$model/$cycle/.update $basep/hur_nested/storm_1/00/.updatelatest`; } if ($region =~ "hwrf") { `cp $basep/$region/$model/$cycle/.update $basep/hwrf/storm_1/00/.updatelatest`; `cp $basep/$region/$model/$cycle/.update $basep/hwrf_nested/storm_1/00/.updatelatest`; }