[Met_help] NA/-9999 value?

John Halley Gotway johnhg at rap.ucar.edu
Fri May 29 19:44:04 MDT 2009


Ming,

Sorry for the trouble we've caused you!  We decided to change the -9999 to
NA's in METv2.0 to make the output look nicer, and so it would be easier
for the R-code we often use to read the output of MET.

It would seem to me that you have two options:
(1) Change the source code for METv2.0 to change the bad data string back
to -9999.
(2) Keep the NA string in there, but just call the "sed" command on the
output of MET to change it back to -9999.  Something like the following
would do the trick:
sed 's/ NA / -9999 /g' met_with_na.stat > met_with_9999.stat

If you'd like to go the first route, hopefully, it's just a one line
change.  Open up the file, "METv2.0/lib/vx_math/constants.h" and change
line number 88...
FROM: static const char   na_str[]              = "NA";
TO:   static const char   na_str[]              = "-9999";

Then rebuild MET by going to the top-level METv2.0 directory, do a "make
clean", followed by a "make".

I've never tried doing this myself.  So I'd be interested to find out if
it works for you.  If not, let me know, and I'll try to figure out what's
going on.

John

> John,
>
> When I use METv1.1, vsdb_analysis output files (*.vsdb) include some
> -9999 which indicates missing value.
> However, in METv2.0, stat_analysis output includes many NA that
> indicates missing value. I wonder how to change the codes so that these
> NA can be replaced by -9999?
>
> I write a Fortran code to  read  vsdb_analysis/stat_analysis  output
> file. It is hard to handle "NA" in the data file.
>
> Thanks for your attention!
>
> Ming
>
> --
> Dr. Ming Chen
> Earth & Sun System Laboratory
> National Center for Atmopsheric Research
> FL3, Room 3081
> Phone: (303) 497 8196
> Boulder, Co 80307
>
> _______________________________________________
> Met_help mailing list
> Met_help at mailman.ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/met_help
>




More information about the Met_help mailing list