def_ungrib doesn't create GRIB symlinks

Questions or comments about the WRF Portal

def_ungrib doesn't create GRIB symlinks

Postby radovan » Thu Dec 29, 2011 4:49 pm

Hi,

The problem I have is that my def_ungrib job fails with the following error:
ERROR: edition_num: unable to open GRIBFILE.AAA

The problem is that the symlinks to the actual GRIB data is not being created by the ruby script. Appparently the fie name doesn't match with the pattern that is expected.
It should be something like this: ungrib_format = "%y%j%H00%F"

Does anybody have any idea what the grib filename should look like?

regards,
radovan
 
Posts: 1
Joined: Thu Dec 29, 2011 4:29 pm

Re: def_ungrib doesn't create GRIB symlinks

Postby kdeblois » Mon Jun 17, 2013 5:48 am

Hi Radovan,

I am having the same problem. Please tell me how you resolved this?

Thanks.

Kees
kdeblois
 
Posts: 6
Joined: Tue Jan 29, 2013 4:51 am

Re: def_ungrib doesn't create GRIB symlinks

Postby davidce » Tue Mar 25, 2014 10:34 am

I got the same problem on WRF Portal Version 2.84 with FNL data, And i resolved it with some changes on ruby scripts, Here is the steps:
1. Set ungrib_format = "fnl_%Y%m%d_%H_00_c"
2. Change code of def_ungrib.rb:
Replace the code between Line (id="AAA") and Line (# Run ungrib) to this:
Code: Select all
# Link the Fnl data
# check fnl dir name with date

@curr_time = @start_time.dup
while @curr_time <= @start_time+3600*@fcst_length
Dir.foreach(@ungrib_source_path) { |fdir|
dir_name=@curr_time.strftime("%Y%m")

if fdir == dir_name
if File.directory?("#{@ungrib_source_path}/#{fdir}")

Dir.foreach("#{@ungrib_source_path}/#{fdir}") { |fname|
catch(:mismatch) do
@ungrib_format_pattern.each { |char,pattern|
match=pattern.match(fname)
throw :mismatch if match.nil?
val=match.captures[0].to_i
case char
when "%y"
throw :mismatch unless val == @curr_time.strftime("%y").to_i
when "%Y"
throw :mismatch unless val == @curr_time.year
when "%j"
throw :mismatch unless val == @curr_time.yday
when "%m"
throw :mismatch if val != @curr_time.month
when "%d"
throw :mismatch if val != @curr_time.day
when "%H"
throw :mismatch if val != @curr_time.hour
when "%M"
throw :mismatch if val != @curr_time.minute
when "%f","%F"
throw :mismatch if val > @curr_length
end
}
File.delete("GRIBFILE.#{id}") if File.symlink?("GRIBFILE.#{id}")
File.symlink("#{@ungrib_source_path}/#{fdir}/#{fname}","GRIBFILE.#{id}")
id=id.succ

end # catch :mismatch
} # Dir.foreach

end
end # if fdir==dir_name

} # Dir.foreach

@curr_time += @fcst_interval*3600
end # while

# End of Link the Fnl data

The FNL data path just like this:(\fnl\200011\fnl_20001101_00_00_c), You could set Ungrib Input Dir to:"\fnl"

There are also a few problem with running def_wrf.rb:
1. In "# Move existing rsl files to a subdir" section,
Change:
rsldir="#{output_root}/logs/rsl.wrf.#{File.mtime("rsl.error.0000").strftime("%Y%m%d%H%M%S")}"
To:
rsldir="#{output_root}/wrf-output/rsl.wrf.#{File.mtime("rsl.error.0000").strftime("%Y%m%d%H%M%S")}"
2. In "# Save a copy of the rsl files" section,
Change:
rsldir="#{output_root}/logs/rsl.wrf.#{runtime.strftime("%Y%m%d%H%M%S")}"
To:
rsldir="#{output_root}/wrf-output/rsl.wrf.#{runtime.strftime("%Y%m%d%H%M%S")}"

If you want to using Urban Canopy Model, add ("#{wrf_root}/run/URBPARM.TBL") to the (@datfiles) array and pay attention to the comma.

This changes should be work.
davidce
 
Posts: 1
Joined: Tue Mar 25, 2014 4:28 am


Return to WRF Portal (GUI for running WRF)

Who is online

Users browsing this forum: No registered users and 2 guests