[gradsusr] Is it possible to multiply an array by a scalar variable rather than a hard-coded constant?

Robert Kuligowski bob.kuligowski at noaa.gov
Mon Feb 11 09:01:49 EST 2019


Jennifer,

     That worked; thanks a lot!

Cheers,

Bob

On 2/9/2019 10:44 AM, Jennifer M Adams wrote:
> Hi, Bob —
> I think your define command will work as you expect if you put quotes around fk1, like this:
>
>> fk1=5067.1
>> 'define CMI='fk1'/Rad'
>
> —Jennifer
>
>> On Feb 8, 2019, at 10:36 AM, Robert Kuligowski <bob.kuligowski at noaa.gov> wrote:
>>
>> All,
>>
>>      I'm trying to make GrADS convert radiances to brightness temperatures on the fly, and I'd really prefer to have as little hard-coding as possible so I put the Planck coefficients in scalar variables.  The problem is that the 'define' command seems to allow an array to be multiplied by a constant value *only* if the constant value is hard-coded.  In other words, for an input array called 'Rad' (and using a grossly simplified example with most of the equation left out),
>>
>> 'define CMI=1/Rad'
>>
>> works, but
>>
>> fk1=5067.1
>> 'define CMI=fk1/Rad'
>>
>> does not; it tells me that 'fk1' is not a variable or function name.
>>
>>      Is there any way forward that doesn't involve hard-coding stuff?  Thanks!
>>
>> Cheers,
>>
>> -- 
>> Bob Kuligowski, Ph.D.
>> Meteorologist
>> NOAA/NESDIS/Center for Satellite Applications and Research (STAR)
>>
>> Mailing Address:
>> National Oceanic and Atmospheric Administration
>> NESDIS STAR/SMCD
>> Bob Kuligowski
>> NCWCP E/RA2
>> 5830 University Research Court
>> 2nd Floor, Office #2828
>> College Park, MD 20740-3818
>>
>> Phone:  (301) 683-3593
>> Fax  :  (301) 683-3616
>>
>> http://secure-web.cisco.com/1Gkj6oMLCzeoQ52PkipE8hj1ikTe5LJQcFN22E0ytJ0pSR8VWS7bVqKXZN_ab9AZ7ne76betPnex3FNUgG9TEFLDVqEgfjOp3CaN6DnS3Sw4ZvQsGJVmJIFPpkhS5ZHiZu02yfufChK496W5OH5S8xTDwMVH5jqN1H6oVZYnxlcEbk0Zptw378-zrMYeDIiVGt2_PTISaQaM7hlwBz9DkhJD3-zgk3OWhPJzzL3rLRBFNA0hwvAi005k-TyB_PwXbQlmIH4dDGA-3GY67UQDiCjNbRf7zKmxhn6z1LsXtThgUDQCbBhFjItRLUgTIL9bwbM1bsfNkGr4-ecL5sA719Z4iXLUXIqP2M4eVYJHwCjB0YVHI0r4n1Du15edQ_6JcrydPspLgx5TEr4H16fUWcQ/http%3A%2F%2Fwww.star.nesdis.noaa.gov%2Fstar%2FKuligowski_B.php
>> http://secure-web.cisco.com/1qgR98ZsuHKsEu5tAtD9spCVJr6Sqc4hOJ2hVdcaIB0IAeW3XANGXE2Vc_fch1h0j8RQu1UVA-v76Oz_bY0YufP_rFw5I8kCrZrGwJxq4anpVq45-JElQfDlbecHxo1yB2h0ri_J7mhiKu-Aix8-tBhXgaUTllWKb91QJKSD-SYeeJxcOYFX8wXj3jv1TaYM-XyAN3YIOcTZzekoHvutD80HNRq05xQ_RAKiCrM3OlbQuSrz_B4UYcUxHk6Rht4T0-J86hoy_TlOhSmbyAg1nfKM9fTC3YldUhC3vL-WnyLUU2obqbDa6hejrEVkC__0vBIFpUm2YDZE1vXw7IqdRzBep0dDWl4KE1h-nCAgREowF9SS8bIgru3UtvApPlt6eoIrURO8azwOgG3RJE_tZ4g/http%3A%2F%2Fwww.star.nesdis.noaa.gov%2Fsmcd%2Femb%2Fff%2Findex.php
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://secure-web.cisco.com/1O19MU2OwbDNCTieIfluP7ZlqqjrEiXOR83_AdyB6dfJQiaG0cyl9ZSJdMmHcc56t1rRQM49hjNX0D3L6PTBay8FebdUQXjfSYrx0M6monibs6WyTi0knRB7jlH6WXskRHigp6dqsFXtKagP0xJ1S2O6RtDnqlBcxm89wPuDeJBg6DStHl6T-5rh88mcMrFLOvFxhwc0xDSf0uP76RFFnma-ytG4tOce-ZO3iRPrwmlvySEQXciZEugX-SbqTTicWHzD373KEbQUlMRQlYysGf37Hqs65PSdOHgs0RksMubWoTOk-0EqvSapQj_FHDM7zZvHe-irPkicYSUTIBUBFXmB2j_bxIBFeg9_m273QZjM4s4rzR5osp5kKPqg2e8aD/http%3A%2F%2Fgradsusr.org%2Fmailman%2Flistinfo%2Fgradsusr
> --
> Jennifer Miletta Adams
> Center for Ocean-Land-Atmosphere Studies (COLA)
> George Mason University
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

-- 
Bob Kuligowski, Ph.D.
Meteorologist
NOAA/NESDIS/Center for Satellite Applications and Research (STAR)

Mailing Address:
National Oceanic and Atmospheric Administration
NESDIS STAR/SMCD
Bob Kuligowski
NCWCP E/RA2
5830 University Research Court
2nd Floor, Office #2828
College Park, MD 20740-3818

Phone:  (301) 683-3593
Fax  :  (301) 683-3616

http://www.star.nesdis.noaa.gov/star/Kuligowski_B.php
http://www.star.nesdis.noaa.gov/smcd/emb/ff/index.php



More information about the gradsusr mailing list