Normally, NCL's "conform" function
http://ngwww.ucar.edu/ngdoc/ng/ref/ncl/functions/conform.html
would be the correct choice.
However, the conform function does not work in the
specific case in the code to whicj the user refers.
pp = 700.0
RH1= in->RH_2_ISBL_10( 4,:,:) ; 700mb
T1 = in->TMP_2_ISBL_10(13,:,:) ; 700mb
;Q1 = mixhum_ptrh (conform(t1,pp,0)???????, t1 ,rh1,2 ) ;
The "problem" is that the second argument to conform must be
(at least) a ond-dimensional array. "pp" is a scalar.
I will ask that "conform" be modified to handle the scalar case.
There is an easy 'workaround.
pp = 700.0
RH1 = in->RH_2_ISBL_10( 4,:,:) ; 700mb
T1 = in->TMP_2_ISBL_10(13,:,:) ; 700mb
P1 = T1 ; create a copy of T1
; this will have the correct dimensions
P1 = pp ; array syntax to set all T1=700
Q1 = mixhum_ptrh (P1, T1 ,RH1,2 ) ; calculate specific humidity
======================================
>
>hui sent this to me individually and I answered him directly.
>
>for the record, use NCL's conform funcition
>
>http://ngwww.ucar.edu/ngdoc/ng/ref/ncl/functions/conform.html
>
>
>On Mon, 16 Aug 2004, Hui Liu wrote:
>
>> Dear Sir:
>>
>> I got another question about the calculation of specific himudity
>> using the "mixhum_ptrh" function. I have a 2 dimension (lon, lat) T
>> and RH (relative humidity) at one level (p=850mb). but the function
>> requires the p has same dimension with T and Q. How can I get the 3
>> variables conformed in shape?
>>
>> the related script q00.ncl is on dataproc:/ptmp/hliu/ncl/ggg.
>> the related lines are between line 114 to 120.
>>
>> your help is appreciated.
>>
>> hui
_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
This archive was generated by hypermail 2b29 : Mon Aug 16 2004 - 14:25:51 MDT