[ncl-talk] Fw:question about function wmstnm

Mary Haley haley at ucar.edu
Thu Nov 6 08:49:50 MST 2014


Ce Zhu,

I have to be honest and say that I don't know anything these station model
plots, but after looking in the wmstnm.f code, I do see that UNT only
affects the temperature values, and not the precipitation values.

You are looking at the correct Fortran file, but if it's precipitation that
you want to change, then you need to look at this code:

C

C  Precipitation.

C

      IF (IPRSNT(14).EQ.1 .AND. RRR.GT.0) THEN
        IF (RRR .EQ. 990) THEN
          CALL PLCHHQ(SYMPOS(1,14),SYMPOS(2,14),'T',SIZ,0.,0.)
          GO TO 75
        ENDIF
        IF (RRR .GT. 990) THEN
          INCHES = NINT(10.*REAL(RRR-990)/25.4)
        ELSE
          INCHES = NINT(100.*REAL(RRR)/25.4)
        ENDIF
        CHR5 = ' '
        WRITE(CHR5,'(I5)') INCHES
        LL = WMGTLN(CHR5,LEN(CHR5),1)
        CALL PLCHHQ(SYMPOS(1,14),SYMPOS(2,14),CHR5(LL:LEN(CHR5)),
     +              SIZ,0.,0.)
      ENDIF
   75 CONTINUE

And yes, if you change this as desired, and rebuild NCL from source code,
then you should get the desired change.

I recommend reading the description of NCL's station model data plotting at:

http://www.ncarg.ucar.edu/supplements/wmap/#HEADING1-151

It states the following:

 The internal parameter UNT
<http://www.ncarg.ucar.edu/supplements/wmap/#UNT> specifies whether
imperial units or metric units are used. The default is imperial units with
the station model data being coded according to the chart "Explanation of
the Daily Weather Map" provided by NOAA and published by the U.S.
Government Printing Office. The coding of the metric units is in accordance
with the SYNOP Data Format (FM-12) as described at:

 http://weather.unisys.com/wxp/Appendices/Formats/SYNOP.html

 One thing I don't understand, however, is that the weather.unisys.com page
mentions precipitation in mm, but the wmstnm.f code seems to be using
inches.

I don't know if this is a bug. Perhaps somebody else who is reading this
email and has experience with this can shed some light?

--Mary


​

On Tue, Nov 4, 2014 at 9:10 PM, Zhu CE <lovingzhuce at 163.com> wrote:

>
> Dear Mary,
>
> Script I used is same as you, which I download from weather map example
> page.
>
> Have you found that no matter 'UNT' be set as '0' or '1', the
> precipitation amount is still in imperial unit? I have showed the 'UNT=0'
> and 'UNT=1' figures in attachment. (where the precipitation is 40mm
> actually)
>
> I also read the wmstnm.f source code, and I find that the code transform
> the precipitation amount from WMO code into imperial unit. The source code
> is showed as below. My questions here are if I want to use metric unit in
> precipitation, can I just change the source code and rebuilt the NCL? Or
> are there any other ways I can try?
>
> Thanks a lot!
>
> Ce Zhu
>
>
>       IF (IPRSNT(14).EQ.1 .AND. RRR.GT.0) THEN
>         IF (RRR .EQ. 990) THEN
>           CALL PLCHHQ(SYMPOS(1,14),SYMPOS(2,14),'T',SIZ,0.,0.)
>           GO TO 75
>         ENDIF
>         IF (RRR .GT. 990) THEN
>           INCHES = NINT(10.*REAL(RRR-990)/25.4)
>         ELSE
>           INCHES = NINT(100.*REAL(RRR)/25.4)
>         ENDIF
>         CHR5 = ' '
>         WRITE(CHR5,'(I5)') INCHES
>         LL = WMGTLN(CHR5,LEN(CHR5),1)
>         CALL PLCHHQ(SYMPOS(1,14),SYMPOS(2,14),CHR5(LL:LEN(CHR5)),
>      +              SIZ,0.,0.)
>       ENDIF
>
>
>
>
> At 2014-11-05 00:36:23, "Mary Haley" <haley at ucar.edu> wrote:
>
> Dear Ce Zhu,
>
> It is helpful if you include a script that illustrates the problem.
>
> I just took a weather map example from our examples page, modified it, and
> tried it with "UNT" set to 0, and then 1.
>
> I don't know anything about this procedure to be honest, but I do see that
> I get some different numbers when I use UNT = 0 or 1.
>
> Please see attached script.
>
> --Mary
>
>
> On Tue, Nov 4, 2014 at 8:07 AM, Zhu CE <lovingzhuce at 163.com> wrote:
>
>>
>> Dear ncl-talk,
>>
>> I tried to use *wmstnm* draw weather symbol. Function introduction says
>> that it uses use imperial units as default, but when I set *wmsetp*
>> *("unt**",2)*, the precipitation unit is still in imperial unit. Is
>> there something I missed? (e.g. when RRR=991, it means precipitation amount
>> is 0.1mm, but the *wmstnm* gives zero precipitation in weather symbol.)
>>
>> Thanks a lot.
>>
>> Ce Zhu
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141106/df94111a/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UNT=0,1.png
Type: image/png
Size: 37989 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141106/df94111a/attachment.png 


More information about the ncl-talk mailing list