Page 1 of 4

How to edit GFS input gribs?

Posted: Sat Sep 21, 2013 6:50 pm
by meteoadriatic
Does anybody have knowledge about how to manipulate contents of GFS input files, for example, how to change values of some variable? I would like to do some hacking, particularly with snow on the ground during winter time, but I have no idea how to proceed.

Thanks

Re: How to edit GFS input gribs?

Posted: Mon Sep 23, 2013 9:04 am
by Antonix
meteoadriatic hello!
this road is good!? viewtopic.php?f=6&t=494

or you can edit the file netcdf.
I use matlab, but if you want we can work on something more "operational"

Re: How to edit GFS input gribs?

Posted: Mon Sep 23, 2013 12:59 pm
by meteoadriatic
Now I see that topic, I somehow missed that. It looks promising though! I'll take a look at that :)

Re: How to edit GFS input gribs?

Posted: Mon Sep 23, 2013 1:20 pm
by meteoadriatic
However I don't like that approach for operational needs.

I think changes should be done if possible on the intermediate format files, not on gribs, because it would save us decompressing and compressing again grib file.

However it doesn't look like simple task. I found something that might be a guideline...
http://forum.wrfforum.com/viewtopic.php?f=22&t=2481

Re: How to edit GFS input gribs?

Posted: Mon Sep 23, 2013 1:45 pm
by Antonix
this is a good way.
but I did not understand how to change the variable.
I could try to create an executable in matlab.
with only 3 commands opens, modify&write and save the netcdf.
which variable you want to change??

Re: How to edit GFS input gribs?

Posted: Mon Sep 23, 2013 1:56 pm
by meteoadriatic
But intermediate files are not netcdf. Netcdf are created from metgrid, intermediate files are created before, from ungrib.

However, editing netcdf is also good idea and maybe even easier.

About details, well, I would like to hack a little bit the snow coverage on the ground. It is common problem that snow coverage in GFS is way too much spreaded from mountains into low-altitude land, and so it makes daily WRF temperature in those low-altitude areas that are in reality free of snow cover, much lower than they should be.

So I got an idea; what if we could completely remove snow cover from, lets say, areas where it's depth is below 10cm, or, it's percent coverage is below 30% (I'm not sure which of those two is in files)? Could this improve forecasts? I know one project where they did exactly that. However, they didn't replied when I asked how it is done.

Re: How to edit GFS input gribs?

Posted: Mon Sep 23, 2013 2:06 pm
by Antonix
resigned, this forum is one of the few places where we share 100% of the knowledge;-).

I think it is very easy to work in matlab or octave.
it would be trivial for me, I feel tonight.
I would like to change the temperature on the ground,
by removing the bias calculated with the weather stations, but also your editing is more important!

is a good idea to work on the file wrfinput_d01

what you think!?

Re: How to edit GFS input gribs?

Posted: Mon Sep 23, 2013 2:20 pm
by meteoadriatic
Try if you think you can. I never used matlab or octave so unfortunately cannot assist you much.

For temperature bias, I think better approach is to nudge model with obsgrid because you can have better control over influence of your observations:

http://www.mmm.ucar.edu/wrf/users/docs/ ... _chap7.htm

Theocarter2911 also thinks about working this out:
viewtopic.php?f=8&t=16&p=3003#p3002

Re: How to edit GFS input gribs?

Posted: Tue Sep 24, 2013 12:04 pm
by Antonix
I'm working on the program in matlab.
but I have a great doubt.
but the grib files do not contain the rain??
met_XYZ files do not contain the rain??
WRF calculated as the rain at the first instant??

maybe it's a stupid question ...

Re: How to edit GFS input gribs?

Posted: Tue Sep 24, 2013 12:43 pm
by meteoadriatic
Grib files does contain precipitation, but those fields are lost after ungrib because these are not input variables for WRF. So, intermediate format and netcdf does not contain precipitation.

It should be there snow on the ground, though.