[Met_help] NA/-9999 value?

John Halley Gotway johnhg at rap.ucar.edu
Mon Jun 1 15:06:53 MDT 2009


Ming,

Since it didn't work for you, I went and tried it myself.  And it does
seem to work for me.  I did the following:

(1) Edit the file METv2.0/lib/vx_math/constants.h, to change the NA string
from "NA" to "-9999".
(2) In the top-level METv2.0 directory, execute a "make clean".
(3) In the top-level METv2.0 directory, execute a "make".
(4) In the scripts directory, re-run the sample scripts:
cd scripts
./test_all.sh
(5) Then in the STAT-Analysis output file
"METv2.0/out/stat_analysis/stat_analysis.out", all of the instances of
"NA" had changed to "-9999".

I'm wondering if you just ran a "make" without first doing a "make clean".
 If that's the case, then the change would not have taken effect.

And are you sure that you're running the STAT-Analysis version that you
rebuilt and not the original version?

Please try this again and let me know if you're still having the same
problem.

John


> John,
>
> Thanks for getting back to me quickly. I have revised constants.h in
> /vx_math/  based on your suggestion, and recompile MET. But the
> stat_analysis  results are the  same as before.
>
> Ming
>
> John Halley Gotway wrote:
>> 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
>>>
>>>
>>
>>
>>
>
>
> --
> Dr. Ming Chen
> Earth & Sun System Laboratory
> National Center for Atmopsheric Research
> FL3, Room 3081
> Phone: (303) 497 8196
> Boulder, Co 80307
>




More information about the Met_help mailing list